PageSourceSearch

https://sogiturkiye.com/static/js/main.05826989.js

js sogiturkiye.com collected 2026-10-02 00:55:50 UTC 2,524,047 bytes, 3 lines download raw bytes

1/*! For license information please see main.05826989.js.LICENSE.txt */
2(()=>{var e={106(e,t){var i;!function(n){"use strict";var r=":not(:disabled):not(.ajs-reset)",s=13,a=27,o=112,l=123,h=37,u=39,c=9,d={autoReset:!0,basic:!1,closable:!0,closableByDimmer:!0,invokeOnCloseOff:!1,frameless:!1,defaultFocusOff:!1,maintainFocus:!0,maximizable:!0,modal:!0,movable:!0,moveBounded:!1,overflow:!0,padding:!0,pinnable:!0,pinned:!0,preventBodyShift:!1,resizable:!0,startMaximized:!1,transition:"pulse",transitionOff:!1,tabbable:["button","[href]","input","select","textarea",'[tabindex]:not([tabindex^="-"])'+r].join(r+","),notifier:{delay:5,position:"bottom-right",closeButton:!1,classes:{base:"alertify-notifier",prefix:"ajs-",message:"ajs-message",top:"ajs-top",right:"ajs-right",bottom:"ajs-bottom",left:"ajs-left",center:"ajs-center",visible:"ajs-visible",hidden:"ajs-hidden",close:"ajs-close"}},glossary:{title:"AlertifyJS",ok:"OK",cancel:"Cancel",acccpt:"Accept",deny:"Deny",confirm:"Confirm",decline:"Decline",close:"Close",maximize:"Maximize",restore:"Restore"},theme:{input:"ajs-input",ok:"ajs-ok",cancel:"ajs-cancel"},hooks:{preinit:function(){},postinit:function(){}}},f=[];function p(e,t){e.className+=" "+t}function m(e,t){for(var i=e.className.split(" "),n=t.split(" "),r=0;r<n.length;r+=1){var s=i.indexOf(n[r]);s>-1&&i.splice(s,1)}e.className=i.join(" ")}function g(){return"rtl"===n.getComputedStyle(document.body).direction}function v(){return document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop}function y(){return document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft}function x(e){for(;e.lastChild;)e.removeChild(e.lastChild)}function b(e){return"[object String]"===Object.prototype.toString.call(e)}function w(e){if(null===e)return e;var t;if(Array.isArray(e)){t=[];for(var i=0;i<e.length;i+=1)t.push(w(e[i]));return t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return(t=new RegExp(e.source)).global=e.global,t.ignoreCase=e.ignoreCase,t.multiline=e.multiline,t.lastIndex=e.lastIndex,t;if("object"===typeof e){for(var n in t={},e)e.hasOwnProperty(n)&&(t[n]=w(e[n]));return t}return e}function T(e,t){if(e.elements){var i=e.elements.root;i.parentNode.removeChild(i),delete e.elements,e.settings=w(e.__settings),e.__init=t,delete e.__internal}}var _=!1;try{var S=Object.defineProperty({},"passive",{get:function(){_=!0}});n.addEventListener("test",S,S),n.removeEventListener("test",S,S)}catch(I){}var E=function(e,t,i,n,r){e.addEventListener(t,i,_?{capture:n,passive:r}:!0===n)},C=function(e,t,i,n,r){e.removeEventListener(t,i,_?{capture:n,passive:r}:!0===n)},A=function(){var e,t,i=!1,n={animation:"animationend",OAnimation:"oAnimationEnd oanimationend",msAnimation:"MSAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(e in n)if(void 0!==document.documentElement.style[e]){t=n[e],i=!0;break}return{type:t,supported:i}}();function k(e,t){return function(){if(arguments.length>0){for(var i=[],n=0;n<arguments.length;n+=1)i.push(arguments[n]);return i.push(e),t.apply(e,i)}return t.apply(e,[null,e])}}function R(e,t){return{index:e,button:t,cancel:!1}}function O(e,t){if("function"===typeof t.get(e))return t.get(e).call(t)}var P=function(){var e,t,i=[],r=!1,s=n.navigator.userAgent.indexOf("Safari")>-1&&n.navigator.userAgent.indexOf("Chrome")<0,_='<div class="ajs-dimmer"></div>',S='<div class="ajs-modal" tabindex="0"></div>',P='<div class="ajs-dialog" tabindex="0"></div>',M='<button class="ajs-reset"></button>',I='<div class="ajs-commands"><button class="ajs-pin"></button><button class="ajs-maximize"></button><button class="ajs-close"></button></div>',L='<div class="ajs-header"></div>',D='<div class="ajs-body"></div>',F='<div class="ajs-content"></div>',B='<div class="ajs-footer"></div>',U={primary:'<div class="ajs-primary ajs-buttons"></div>',auxiliary:'<div class="ajs-auxiliary ajs-buttons"></div>'},z='<button class="ajs-button"></button>',V='<div class="ajs-handle"></div>',H="ajs-in",j="ajs-out",Y="alertify",W="ajs-basic",G="ajs-capture",X="ajs-closable",q="ajs-fixed",K="ajs-frameless",Q="ajs-hidden",J="ajs-maximized",Z="ajs-maximizable",$="ajs-modeless",ee="ajs-movable",te="ajs-no-selection",ie="ajs-no-overflow",ne="ajs-no-padding",re="ajs-pinnable",se="ajs-",ae="ajs-resizable",oe="ajs-shake",le="ajs-unpinned",he="ajs-no-transition";function ue(e){if(!e.__internal){var t;N.defaults.hooks.preinit(e),delete e.__init,e.__settings||(e.__settings=w(e.settings)),"function"===typeof e.setup?((t=e.setup()).options=t.options||{}
2,t.focus=t.focus||{}):t={buttons:[],focus:{element:null,select:!1},options:{}},"object"!==typeof e.hooks&&(e.hooks={});var n=[];if(Array.isArray(t.buttons))for(var r=0;r<t.buttons.length;r+=1){var s=t.buttons[r],a={};for(var o in s)s.hasOwnProperty(o)&&(a[o]=s[o]);n.push(a)}var l=e.__internal={isOpen:!1,activeElement:document.body,timerIn:void 0,timerOut:void 0,buttons:n,focus:t.focus,options:{title:void 0,modal:void 0,basic:void 0,frameless:void 0,defaultFocusOff:void 0,pinned:void 0,movable:void 0,moveBounded:void 0,resizable:void 0,autoReset:void 0,closable:void 0,closableByDimmer:void 0,invokeOnCloseOff:void 0,maximizable:void 0,startMaximized:void 0,pinnable:void 0,transition:void 0,transitionOff:void 0,padding:void 0,overflow:void 0,onshow:void 0,onclosing:void 0,onclose:void 0,onfocus:void 0,onmove:void 0,onmoved:void 0,onresize:void 0,onresized:void 0,onmaximize:void 0,onmaximized:void 0,onrestore:void 0,onrestored:void 0},resetHandler:void 0,beginMoveHandler:void 0,beginResizeHandler:void 0,bringToFrontHandler:void 0,modalClickHandler:void 0,buttonsClickHandler:void 0,commandsClickHandler:void 0,transitionInHandler:void 0,transitionOutHandler:void 0,destroy:void 0},h={};h.root=document.createElement("div"),h.root.style.display="none",h.root.className=Y+" "+Q+" ",h.root.innerHTML=_+S,h.dimmer=h.root.firstChild,h.modal=h.root.lastChild,h.modal.innerHTML=P,h.dialog=h.modal.firstChild,h.dialog.innerHTML=M+I+L+D+B+V+M,h.reset=[],h.reset.push(h.dialog.firstChild),h.reset.push(h.dialog.lastChild),h.commands={},h.commands.container=h.reset[0].nextSibling,h.commands.pin=h.commands.container.firstChild,h.commands.maximize=h.commands.pin.nextSibling,h.commands.close=h.commands.maximize.nextSibling,h.header=h.commands.container.nextSibling,h.body=h.header.nextSibling,h.body.innerHTML=F,h.content=h.body.firstChild,h.footer=h.body.nextSibling,h.footer.innerHTML=U.auxiliary+U.primary,h.resizeHandle=h.footer.nextSibling,h.buttons={},h.buttons.auxiliary=h.footer.firstChild,h.buttons.primary=h.buttons.auxiliary.nextSibling,h.buttons.primary.innerHTML=z,h.buttonTemplate=h.buttons.primary.firstChild,h.buttons.primary.removeChild(h.buttonTemplate);for(var u=0;u<e.__internal.buttons.length;u+=1){var c=e.__internal.buttons[u];for(var d in i.indexOf(c.key)<0&&i.push(c.key),c.element=h.buttonTemplate.cloneNode(),c.element.innerHTML=c.text,"string"===typeof c.className&&""!==c.className&&p(c.element,c.className),c.attrs)"className"!==d&&c.attrs.hasOwnProperty(d)&&c.element.setAttribute(d,c.attrs[d]);"auxiliary"===c.scope?h.buttons.auxiliary.appendChild(c.element):h.buttons.primary.appendChild(c.element)}for(var f in e.elements=h,l.resetHandler=k(e,Be),l.beginMoveHandler=k(e,$e),l.beginResizeHandler=k(e,lt),l.bringToFrontHandler=k(e,ge),l.modalClickHandler=k(e,Oe),l.buttonsClickHandler=k(e,Ie),l.commandsClickHandler=k(e,be),l.transitionInHandler=k(e,Ve),l.transitionOutHandler=k(e,He),l.options)void 0!==t.options[f]?e.set(f,t.options[f]):N.defaults.hasOwnProperty(f)?e.set(f,N.defaults[f]):"title"===f&&e.set(f,N.defaults.glossary[f]);"function"===typeof e.build&&e.build(),N.defaults.hooks.postinit(e)}document.body.appendChild(e.elements.root)}function ce(){n.scrollTo(e,t)}function de(){for(var e=0,t=0;t<f.length;t+=1){var i=f[t];(i.isModal()||i.isMaximized())&&(e+=1)}0===e&&document.body.className.indexOf(ie)>=0?(m(document.body,ie),me(!1)):e>0&&document.body.className.indexOf(ie)<0&&(me(!0),p(document.body,ie))}var fe="",pe=0;function me(e){N.defaults.preventBodyShift&&(e&&document.documentElement.scrollHeight>document.documentElement.clientHeight?(pe=t,fe=n.getComputedStyle(document.body).top,p(document.body,q),document.body.style.top=-t+"px"):e||(t=pe,document.body.style.top=fe,m(document.body,q),ce()))}function ge(e,t){for(var i=f.indexOf(t)+1;i<f.length;i+=1)if(f[i].isModal())return;return document.body.lastChild!==t.elements.root&&(document.body.appendChild(t.elements.root),f.splice(f.indexOf(t),1),f.push(t),Fe(t)),!1}function ve(e,t,i,n){switch(t){case"title":e.setHeader(n);break;case"modal":!function(e){e.get("modal")?(m(e.elements.root,$),e.isOpen()&&(pt(e),Ae(e),de())):(p(e.elements.root,$),e.isOpen()&&(ft(e),Ae(e),de()))}(e);break;case"basic":!function(e){e.get("basic")?p(e.elements.root,W):m(e.elements.root,W)}(e);break;case"frameless":!function(e){e.get("frameless")?p(e.elements.root,K):m(e.elements.root,K)}(e);break;case"pinned":!function(e){e.get("pinned")?(m(e.elements.root,le),e.isOpen()&&Ce(e)):(p(e.elements.root,le),e.isOpen()&&!e.isModal()&&Ee(e))}(e);break;case"closable":!function(e){e.get("closable")?(p(e.elements.root,X),function(e){E(e.elements.modal,"click",e.__internal.modalClickHandler)}(e)):(m(e.elements.root,X),function(e){C(e.elements.modal,"click",e.__internal.modalClickHandler)}(e))}(e);break;case"maximizable":!function(e){e.get("maximizable")?p(e.elements.root,Z):m(e.elements.root,Z)}(e);break;case"pinnable":!function(e){e.get("pinnable")?p(e.elements.root,re):m(e.elements.root,re)}(e);break;case"movable":!function(e){e.get("movable")?(p(e.elements.root,ee),e.isOpen()&&mt(e)):(it(e),m(e.elements.root,ee),e.isOpen()&&gt(e))}(e);break;case"resizable":!function(e){e.get("resizable")?(p(e.elements.root,ae),e.isOpen()&&vt(e)):(ct(e),m(e.elements.root,ae),e.isOpen()&&yt(e))}(e);break;case"padding":n?m(e.elements.root,ne):e.elements.root.className.indexOf(ne)<0&&p(e.elements.root,ne);break;case"overflow":n?m(e.elements.root,ie):e.elements.root.className.indexOf(ie)<0&&p(e.elements.root,ie);break;case"transition":!function(e,t,i){b(i)&&m(e.elements.root,se+i),p(e.elements.root,se+t),e.elements.root.offsetWidth}(e,n,i);break;case"transitionOff":!function(e){e.get("transitionOff")?p(e.elements.root,he):m(e.elements.root,he)}(e)}"function"===typeof e.hooks.onupdate&&e.hooks.onupdate.call(e,t,i,n)}function ye(e,t,i,n,r){var s,a={op:void 0,items:[]};if("undefined"===typeof r&&"string"===typeof n)a.op="get",t.hasOwnProperty(n)?(a.found=!0,a.value=t[n]):(a.found=!1,a.value=void 0);else if(a.op="set","object"===typeof n){var o=n;for(var l in o)t.hasOwnProperty(l)?(t[l]!==o[l]&&(s=t[l],t[l]=o[l],i.call(e,l,s,o[l])),a.items.push({key:l,value:o[l],found:!0})):a.items.push({key:l,value:o[l],found:!1})}else{if("string"!==typeof n)throw new Error("args must be a string or object");t.hasOwnProperty(n)?(t[n]!==r&&(s=t[n],t[n]=r,i.call(e,n,s,r)),a.items.push({key:n,value:r,foun
2d:!0})):a.items.push({key:n,value:r,found:!1})}return a}function xe(e){var t;Ne(e,function(i){return t=!0!==e.get("invokeOnCloseOff")&&!0===i.invokeOnClose}),!t&&e.isOpen()&&e.close()}function be(e,t){switch(e.srcElement||e.target){case t.elements.commands.pin:t.isPinned()?Te(t):we(t);break;case t.elements.commands.maximize:t.isMaximized()?Se(t):_e(t);break;case t.elements.commands.close:xe(t)}return!1}function we(e){e.set("pinned",!0)}function Te(e){e.set("pinned",!1)}function _e(e){O("onmaximize",e),p(e.elements.root,J),e.isOpen()&&de(),O("onmaximized",e)}function Se(e){O("onrestore",e),m(e.elements.root,J),e.isOpen()&&de(),O("onrestored",e)}function Ee(e){var t=y();e.elements.modal.style.marginTop=v()+"px",e.elements.modal.style.marginLeft=t+"px",e.elements.modal.style.marginRight=-t+"px"}function Ce(e){var t=parseInt(e.elements.modal.style.marginTop,10),i=parseInt(e.elements.modal.style.marginLeft,10);if(e.elements.modal.style.marginTop="",e.elements.modal.style.marginLeft="",e.elements.modal.style.marginRight="",e.isOpen()){var n=0,r=0;""!==e.elements.dialog.style.top&&(n=parseInt(e.elements.dialog.style.top,10)),e.elements.dialog.style.top=n+(t-v())+"px",""!==e.elements.dialog.style.left&&(r=parseInt(e.elements.dialog.style.left,10)),e.elements.dialog.style.left=r+(i-y())+"px"}}function Ae(e){e.get("modal")||e.get("pinned")?Ce(e):Ee(e)}var ke=!1,Re=0;function Oe(e,t){if(e.timeStamp-Re>200&&(Re=e.timeStamp)&&!ke){var i=e.srcElement||e.target;!0===t.get("closableByDimmer")&&i===t.elements.modal&&xe(t)}ke=!1}var Pe=0,Me=!1;function Ne(e,t){if(Date.now()-Pe>200&&(Pe=Date.now()))for(var i=0;i<e.__internal.buttons.length;i+=1){var n=e.__internal.buttons[i];if(!n.element.disabled&&t(n)){var r=R(i,n);"function"===typeof e.callback&&e.callback.apply(e,[r]),!1===r.cancel&&e.close();break}}}function Ie(e,t){var i=e.srcElement||e.target;Ne(t,function(e){return e.element.contains(i)&&(Me=!0)})}function Le(e){if(!Me){var t=f[f.length-1],n=e.keyCode;return 0===t.__internal.buttons.length&&n===a&&!0===t.get("closable")?(xe(t),!1):i.indexOf(n)>-1?(Ne(t,function(e){return e.key===n}),!1):void 0}Me=!1}function De(e){var t=f[f.length-1],n=e.keyCode;if(n===h||n===u){for(var r=t.__internal.buttons,s=0;s<r.length;s+=1)if(document.activeElement===r[s].element)switch(n){case h:return void r[(s||r.length)-1].element.focus();case u:return void r[(s+1)%r.length].element.focus()}}else if(n<l+1&&n>o-1&&i.indexOf(n)>-1)return e.preventDefault(),e.stopPropagation(),Ne(t,function(e){return e.key===n}),!1}function Fe(e,t){if(t)t.focus();else{var i=e.__internal.focus,n=i.element;switch(typeof i.element){case"number":e.__internal.buttons.length>i.element&&(n=!0===e.get("basic")?e.elements.reset[0]:e.__internal.buttons[i.element].element);break;case"string":n=e.elements.body.querySelector(i.element);break;case"function":n=i.element.call(e)}!0!==e.get("defaultFocusOff")&&("undefined"!==typeof n&&null!==n||0!==e.__internal.buttons.length)||(n=e.elements.reset[0]),n&&n.focus&&(n.focus(),i.select&&n.select&&n.select())}}function Be(e,t){if(!t)for(var i=f.length-1;i>-1;i-=1)if(f[i].isModal()){t=f[i];break}if(t&&t.isModal()){var n,r=t.elements.reset[0],s=t.elements.reset[1],a=e.relatedTarget,o=t.elements.root.contains(a),l=e.srcElement||e.target;if(l===r&&!o||l===s&&a===r)return;l===s||l===document.body?n=r:l===r&&a===s?n=Ue(t):l===r&&o&&(n=Ue(t,!0)),Fe(t,n)}}function Ue(e,t){var i=[].slice.call(e.elements.dialog.querySelectorAll(d.tabbable));t&&i.reverse();for(var n=0;n<i.length;n+=1){var r=i[n];if(r.offsetParent||r.offsetWidth||r.offsetHeight||r.getClientRects().length)return r}}function ze(e){var t=f[f.length-1];t&&e.shiftKey&&e.keyCode===c&&t.elements.reset[1].focus()}function Ve(e,t){clearTimeout(t.__internal.timerIn),Fe(t),Me=!1,O("onfocus",t),C(t.elements.dialog,A.type,t.__internal.transitionInHandler),m(t.elements.root,H)}function He(e,t){clearTimeout(t.__internal.timerOut),C(t.elements.dialog,A.type,t.__internal.transitionOutHandler),it(t),ct(t),t.isMaximized()&&!t.get("startMaximized")&&Se(t),"function"===typeof t.__internal.destroy&&t.__internal.destroy.apply(t)}var je=null,Ye=0,We=0,Ge="pageX",Xe="pageY",qe=null,Ke=!1,Qe=null;function Je(e,t){var i=e[Ge]-Ye,n=e[Xe]-We;Ke&&(n-=document.body.scrollTop),t.style.left=i+"px",t.style.top=n+"px"}function Ze(e,t){var i=e[Ge]-Ye,n=e[Xe]-We;Ke&&(n-=document.body.scrollTop),t.style.left=Math.min(qe.maxLeft,Math.max(qe.minLeft,i))+"px",t.style.top=Ke?Math.min(qe.maxTop,Math.max(qe.minTop,n))+"px":Math.max(qe.minTop,n)+"px"}function $e(e,t){if(null===nt&&!t.isMaximized()&&t.get("movable")){var i,n=0,r=0;if("touchstart"===e.type?(e.preventDefault(),i=e.targetTouches[0],Ge="clientX",Xe="clientY"):0===e.button&&(i=e),i){var s=t.elements.dialog;if(p(s,G),s.style.left&&(n=parseInt(s.style.left,10)),s.style.top&&(r=parseInt(s.style.top,10)),Ye=i[Ge]-n,We=i[Xe]-r,t.isModal()?We+=t.elements.modal.scrollTop:t.isPinned()&&(We-=document.body.scrollTop),t.get("moveBounded")){var a=s,o=-n,l=-r;do{o+=a.offsetLeft,l+=a.offsetTop}while(a=a.offsetParent);qe={maxLeft:o,minLeft:-o,maxTop:document.documentElement.clientHeight-s.clientHeight-l,minTop:-l},Qe=Ze}else qe=null,Qe=Je;return O("onmove",t),Ke=!t.isModal()&&t.isPinned(),je=t,Qe(i,s),p(document.body,te),!1}}}function et(e){var t;je&&("touchmove"===e.type?(e.preventDefault(),t=e.targetTouches[0]):0===e.button&&(t=e),t&&Qe(t,je.elements.dialog))}function tt(){if(je){var e=je;je=qe=null,m(document.body,te),m(e.elements.dialog,G),O("onmoved",e)}}function it(e){je=null;var t=e.elements.dialog;t.style.left=t.style.top=""}var nt=null,rt=Number.Nan,st=0,at=0,ot=0;function lt(e,t){var i;if(!t.isMaximized()&&("touchstart"===e.type?(e.preventDefault(),i=e.targetTouches[0]):0===e.button&&(i=e),i)){O("onresize",t),nt=t,ot=t.elements.resizeHandle.offsetHeight/2;var n=t.elements.dialog;return p(n,G),rt=parseInt(n.style.left,10),n.style.height=n.offsetHeight+"px",n.style.minHeight=t.elements.header.offsetHeight+t.elements.footer.offsetHeight+"px",n.style.width=(st=n.offsetWidth)+"px","none"!==n.style.maxWidth&&(n.style.minWidth=(at=n.offsetWidth)+"px"),n.style.maxWidth="none",p(document.body,te),!1}}function ht(e){var t;nt&&("touchmove"===e.type?(e.preventDefault(),t=e.targetTouches[0]):0===e.button&&(t=e),t&&function(e,t,i){var n,r,s=t,a=0,o=0;do{a+=s.offsetLeft,o+=s.offsetTop}while(s=s.offsetParent);!0===i?(n=e.pageX,r=e.pageY):(n=e.clientX,r=e.clientY);var l=g();if(l&&(n=document.body.offsetWidth-n,isNaN(rt)||(a=document.body.offsetWidth-a-t.offsetWidth)),t.style.height=r-o+ot+"px",t.style.width=n-a+ot+"px",!isNaN(rt)){var h=.5*Math.abs(t.offsetWidth-st);l&&(h*=-1),t.offsetWidth>st?t.style.left=rt+h+"px":t.offsetWidth>=at&&(t.style.left=rt-h+"px")}}(t,nt.elements.dialog,!nt.get("modal")&&!nt.get("pinned")))}
2function ut(){if(nt){var e=nt;nt=null,m(document.body,te),m(e.elements.dialog,G),ke=!0,O("onresized",e)}}function ct(e){nt=null;var t=e.elements.dialog;"none"===t.style.maxWidth&&(t.style.maxWidth=t.style.minWidth=t.style.width=t.style.height=t.style.minHeight=t.style.left="",rt=Number.Nan,st=at=ot=0)}function dt(){for(var e=0;e<f.length;e+=1){var t=f[e];t.get("autoReset")&&(it(t),ct(t))}}function ft(e){E(e.elements.dialog,"focus",e.__internal.bringToFrontHandler,!0)}function pt(e){C(e.elements.dialog,"focus",e.__internal.bringToFrontHandler,!0)}function mt(e){E(e.elements.header,"mousedown",e.__internal.beginMoveHandler),E(e.elements.header,"touchstart",e.__internal.beginMoveHandler,!1,!1)}function gt(e){C(e.elements.header,"mousedown",e.__internal.beginMoveHandler),C(e.elements.header,"touchstart",e.__internal.beginMoveHandler,!1,!1)}function vt(e){E(e.elements.resizeHandle,"mousedown",e.__internal.beginResizeHandler),E(e.elements.resizeHandle,"touchstart",e.__internal.beginResizeHandler,!1,!1)}function yt(e){C(e.elements.resizeHandle,"mousedown",e.__internal.beginResizeHandler),C(e.elements.resizeHandle,"touchstart",e.__internal.beginResizeHandler,!1,!1)}return{__init:ue,isOpen:function(){return this.__internal.isOpen},isModal:function(){return this.elements.root.className.indexOf($)<0},isMaximized:function(){return this.elements.root.className.indexOf(J)>-1},isPinned:function(){return this.elements.root.className.indexOf(le)<0},maximize:function(){return this.isMaximized()||_e(this),this},restore:function(){return this.isMaximized()&&Se(this),this},pin:function(){return this.isPinned()||we(this),this},unpin:function(){return this.isPinned()&&Te(this),this},bringToFront:function(){return ge(0,this),this},moveTo:function(e,t){if(!isNaN(e)&&!isNaN(t)){O("onmove",this);var i=this.elements.dialog,n=i,r=0,s=0;i.style.left&&(r-=parseInt(i.style.left,10)),i.style.top&&(s-=parseInt(i.style.top,10));do{r+=n.offsetLeft,s+=n.offsetTop}while(n=n.offsetParent);var a=e-r,o=t-s;g()&&(a*=-1),i.style.left=a+"px",i.style.top=o+"px",O("onmoved",this)}return this},resizeTo:function(e,t){var i=parseFloat(e),n=parseFloat(t),r=/(\d*\.\d+|\d+)%/;if(!isNaN(i)&&!isNaN(n)&&!0===this.get("resizable")){O("onresize",this),(""+e).match(r)&&(i=i/100*document.documentElement.clientWidth),(""+t).match(r)&&(n=n/100*document.documentElement.clientHeight);var s=this.elements.dialog;
2"none"!==s.style.maxWidth&&(s.style.minWidth=(at=s.offsetWidth)+"px"),s.style.maxWidth="none",s.style.minHeight=this.elements.header.offsetHeight+this.elements.footer.offsetHeight+"px",s.style.width=i+"px",s.style.height=n+"px",O("onresized",this)}return this},setting:function(e,t){var i=this,n=ye(this,this.__internal.options,function(e,t,n){ve(i,e,t,n)},e,t);if("get"===n.op)return n.found?n.value:"undefined"!==typeof this.settings?ye(this,this.settings,this.settingUpdated||function(){},e,t).value:void 0;if("set"===n.op){if(n.items.length>0)for(var r=this.settingUpdated||function(){},s=0;s<n.items.length;s+=1){var a=n.items[s];a.found||"undefined"===typeof this.settings||ye(this,this.settings,r,a.key,a.value)}return this}},set:function(e,t){return this.setting(e,t),this},get:function(e){return this.setting(e)},setHeader:function(e){return b(e)?(x(this.elements.header),this.elements.header.innerHTML=e):e instanceof n.HTMLElement&&this.elements.header.firstChild!==e&&(x(this.elements.header),this.elements.header.appendChild(e)),this},setContent:function(e){return b(e)?(x(this.elements.content),this.elements.content.innerHTML=e):e instanceof n.HTMLElement&&this.elements.content.firstChild!==e&&(x(this.elements.content),this.elements.content.appendChild(e)),this},showModal:function(e){return this.show(!0,e)},show:function(i,a){if(ue(this),this.__internal.isOpen){it(this),ct(this),p(this.elements.dialog,oe);var o=this;setTimeout(function(){m(o.elements.dialog,oe)},200)}else{if(this.__internal.isOpen=!0,f.push(this),N.defaults.maintainFocus&&(this.__internal.activeElement=document.activeElement),document.body.hasAttribute("tabindex")||document.body.setAttribute("tabindex",r="0"),"function"===typeof this.prepare&&this.prepare(),h=this,1===f.length&&(E(n,"resize",dt),E(document.body,"keyup",Le),E(document.body,"keydown",De),E(document.body,"focus",Be),E(document.documentElement,"mousemove",et),E(document.documentElement,"touchmove",et,!1,!1),E(document.documentElement,"mouseup",tt),E(document.documentElement,"touchend",tt),E(document.documentElement,"mousemove",ht),E(document.documentElement,"touchmove",ht,!1,!1),E(document.documentElement,"mouseup",ut),E(document.documentElement,"touchend",ut)),E(h.elements.commands.container,"click",h.__internal.commandsClickHandler),E(h.elements.footer,"click",h.__internal.buttonsClickHandler),E(h.elements.reset[0],"focusin",h.__internal.resetHandler),E(h.elements.reset[0],"keydown",ze),E(h.elements.reset[1],"focusin",h.__internal.resetHandler),Me=!0,E(h.elements.dialog,A.type,h.__internal.transitionInHandler),h.get("modal")||ft(h),h.get("resizable")&&vt(h),h.get("movable")&&mt(h),void 0!==i&&this.set("modal",i),e=y(),t=v(),de(),"string"===typeof a&&""!==a&&(this.__internal.className=a,p(this.elements.root,a)),this.get("startMaximized")?this.maximize():this.isMaximized()&&Se(this),Ae(this),this.elements.root.removeAttribute("style"),m(this.elements.root,j),p(this.elements.root,H),clearTimeout(this.__internal.timerIn),this.__internal.timerIn=setTimeout(this.__internal.transitionInHandler,A.supported?1e3:100),s){var l=this.elements.root;l.style.display="none",setTimeout(function(){l.style.display="block"},0)}this.elements.root.offsetWidth,m(this.elements.root,Q),ce(),"function"===typeof this.hooks.onshow&&this.hooks.onshow.call(this),O("onshow",this)}var h;return this},close:function(){var e;return this.__internal.isOpen&&!1!==O("onclosing",this)&&(e=this,1===f.length&&(C(n,"resize",dt),C(document.body,"keyup",Le),C(document.body,"keydown",De),C(document.body,"focus",Be),C(document.documentElement,"mousemove",et),C(document.documentElement,"mouseup",tt),C(document.documentElement,"mousemove",ht),C(document.documentElement,"mouseup",ut)),C(e.elements.commands.container,"click",e.__internal.commandsClickHandler),C(e.elements.footer,"click",e.__internal.buttonsClickHandler),C(e.elements.reset[0],"focusin",e.__internal.resetHandler),C(e.elements.reset[0],"keydown",ze),C(e.elements.reset[1],"focusin",e.__internal.resetHandler),E(e.elements.dialog,A.type,e.__internal.transitionOutHandler),e.get("modal")||pt(e),e.get("movable")&&gt(e),e.get("resizable")&&yt(e),m(this.elements.root,H),p(this.elements.root,j),clearTimeout(this.__internal.timerOut),this.__internal.timerOut=setTimeout(this.__internal.transitionOutHandler,A.supported?1e3:100),p(this.elements.root,Q),this.elements.modal.offsetWidth,N.defaults.maintainFocus&&this.__internal.activeElement&&(this.__internal.activeElement.focus(),this.__internal.activeElement=null),"undefined"!==typeof this.__internal.className&&""!==this.__internal.className&&m(this.elements.root,this.__internal.className),"function"===typeof this.hooks.onclose&&this.hooks.onclose.call(this),O("onclose",this),f.splice(f.indexOf(this),1),this.__internal.isOpen=!1,de()),f.length||"0"!==r||document.body.removeAttribute("tabindex"),this},closeOthers:function(){return N.closeAll(this),this},destroy:function(){return this.__internal&&(this.__internal.isOpen?(this.__internal.destroy=function(){T(this,ue)},this.close()):this.__internal.destroy||T(this,ue)),this}}}(),M=function(){var e,t=[],i=d.notifier.classes,r=i.base;function s(t){t.__internal||(t.__internal={position:N.defaults.notifier.position,delay:N.defaults.notifier.delay},e=document.createElement("DIV"),("transitionOff"in d.notifier?d.notifier.transitionOff:d.transitionOff)&&(r=i.base+" ajs-no-transition"),a(t));e.parentNode!==document.body&&document.body.appendChild(e)}function a(t){switch(e.className=r,t.__internal.position){case"top-right":p(e,i.top+" "+i.right);break;case"top-left":p(e,i.top+" "+i.left);break;case"top-center":p(e,i.top+" "+i.center);break;case"bottom-left":p(e,i.bottom+" "+i.left);break;case"bottom-center":p(e,i.bottom+" "+i.center);break;default:p(e,i.bottom+" "+i.right)}}function o(r,s){function a(e,t){t.__internal.closeButton&&"true"!==e.target.getAttribute("data-close")||t.dismiss(!0)}function o(t,i){C(i.element,A.type,o),e.removeChild(i.element)}function l(e){clearTimeout(e.__internal.timer),clearTimeout(e.__internal.transitionTimeout)}return h={element:r,push:function(n,r){if(!this.__internal.pushed){var s,a;switch((o=this).__internal.pushed=!0,t.push(o),l(this),arguments.length){case 0:a=this.__internal.delay;break;case 1:"number"===typeof n?a=n:(s=n,a=this.__internal.delay);break;case 2:s=n,a=r}return this.__internal.closeButton=N.defaults.notifier.closeButton,"undefined"!==typeof s&&this.setContent(s),M.__internal.position.indexOf("top")<0?e.appendChild(this.element):e.insertBefore(this.element,e.firstChild),this.element.offsetWidth,p(this.element,i.visible),E(this.element,"click",this.__internal.clickHandler),this.delay(a)}var o;return this},ondismiss:function(){},callback:s,dismiss:function(n){var r;return this.__internal.pushed&&(l(this),"function"===typeof this.ondismiss&&!1===this.ondismiss.call(this)||(C(this.element,"click",this.__internal.clickHandler),"undefined"!==typeof this.element&&this.element.parentNode===e&&(this.__internal.transitionTimeout=setTimeout(this.__internal.transitionEndHandler,A.supported?1e3:100),m(this.element,i.visible),"function"===typeof this.callback&&this.callback.call(this,n)),r=this,t.splice(t.indexOf(r),1),r.__internal.pushed=!1)),this},delay:function(e){if(l(this),this.__internal.delay="undefined"===typeof e||isNaN(+e)?M.__internal.delay:+e,this.__internal.delay>0){var t=this;this.__internal.timer=setTimeout(function(){t.dismiss()},1e3*this.__internal.delay)}return this},setContent:function(e){if(b(e)?(x(this.element),this.element.innerHTML=e):e instanceof n.HTMLElement&&this.element.firstChild!==e&&(x(this.element),this.element.appendChild(e)),this.__internal.closeButton){var t=document.createElement("span");p(t,i.close),t.setAttribute("data-close",!0),this.element.appendChild(t)}return this},dismissOthers:function(){return M.dismissAll(this),this}},h.__internal||(h.__internal={pushed:!1,delay:void 0,timer:void 0,clickHandler:void 0,transitionEndHandler:void 0,transitionTimeout:void 0},h.__internal.clickHandler=k(h,a),h.__internal.transitionEndHandler=k(h,o)),h;var h}return{setting:function(e,t){if(s(this),"undefined"===typeof t)return this.__internal[e];switch(e){case"position":this.__internal.position=t,a(this);break;case"delay":this.__internal.delay=t}return this},set:function(e,t){return this.setting(e,t),this},get:function(e){return this.setting(e)},create:function(e,t){s(this);var n=document.createElement("div");return n.className=i.message+("string"===typeof e&&""!==e?" "+i.prefix+e:""),o(n,t)},dismissAll:function(e){for(var i=t.slice(0),n=0;n<i.length;n+=1){var r=i[n];void 0!==e&&e===r||r.dismiss()}}}}();var N=new function(){var e={};function t(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function i(t){var i=e[t].dialog;return i&&"function"===typeof i.__init&&i.__init(i),i}return{defaults:d,dialog:function(n,r,s,a){if("function"!==typeof r)return i(n);
2if(this.hasOwnProperty(n))throw new Error("alertify.dialog: name already exists");var o=function(i,n,r,s){var a={dialog:null,factory:n};return void 0!==s&&(a.factory=function(){return t(new e[s].factory,new n)}),r||(a.dialog=t(new a.factory,P)),e[i]=a}(n,r,s,a);this[n]=s?function(){if(0===arguments.length)return o.dialog;var e=t(new o.factory,P);return e&&"function"===typeof e.__init&&e.__init(e),e.main.apply(e,arguments),e.show.apply(e)}:function(){if(o.dialog&&"function"===typeof o.dialog.__init&&o.dialog.__init(o.dialog),0===arguments.length)return o.dialog;var e=o.dialog;return e.main.apply(o.dialog,arguments),e.show.apply(o.dialog)}},closeAll:function(e){for(var t=f.slice(0),i=0;i<t.length;i+=1){var n=t[i];void 0!==e&&e===n||n.close()}},setting:function(e,t,n){if("notifier"===e)return M.setting(t,n);var r=i(e);return r?r.setting(t,n):void 0},set:function(e,t,i){return this.setting(e,t,i)},get:function(e,t){return this.setting(e,t)},notify:function(e,t,i,n){return M.create(t,n).push(e,i)},message:function(e,t,i){return M.create(null,i).push(e,t)},success:function(e,t,i){return M.create("success",i).push(e,t)},error:function(e,t,i){return M.create("error",i).push(e,t)},warning:function(e,t,i){return M.create("warning",i).push(e,t)},dismissAll:function(){M.dismissAll()}}};N.dialog("alert",function(){return{main:function(e,t,i){var n,r,s;switch(arguments.length){case 1:r=e;break;case 2:"function"===typeof t?(r=e,s=t):(n=e,r=t);break;case 3:n=e,r=t,s=i}return this.set("title",n),this.set("message",r),this.set("onok",s),this},setup:function(){return{buttons:[{text:N.defaults.glossary.ok,key:a,invokeOnClose:!0,className:N.defaults.theme.ok}],focus:{element:0,select:!1},options:{maximizable:!1,resizable:!1}}},build:function(){},prepare:function(){},setMessage:function(e){this.setContent(e)},settings:{message:void 0,onok:void 0,label:void 0},settingUpdated:function(e,t,i){switch(e){case"message":this.setMessage(i);break;case"label":this.__internal.buttons[0].element&&(this.__internal.buttons[0].element.innerHTML=i)}},callback:function(e){if("function"===typeof this.get("onok")){var t=this.get("onok").call(this,e);"undefined"!==typeof t&&(e.cancel=!t)}}}}),N.dialog("confirm",function(){var e={timer:null,index:null,text:null,duration:null,task:function(i,n){if(n.isOpen()){if(n.__internal.buttons[e.index].element.innerHTML=e.text+" (&#8207;"+e.duration+"&#8207;) ",e.duration-=1,-1===e.duration){t(n);var r=n.__internal.buttons[e.index],s=R(e.index,r);"function"===typeof n.callback&&n.callback.apply(n,[s]),!1!==s.close&&n.close()}}else t(n)}};function t(t){null!==e.timer&&(clearInterval(e.timer),e.timer=null,t.__internal.buttons[e.index].element.innerHTML=e.text)}function i(i,n,r){t(i),e.duration=r,e.index=n,e.text=i.__internal.buttons[n].element.innerHTML,e.timer=setInterval(k(i,e.task),1e3),e.task(null,i)}return{main:function(e,t,i,n){var r,s,a,o;switch(arguments.length){case 1:s=e;break;case 2:s=e,a=t;break;case 3:s=e,a=t,o=i;break;case 4:r=e,s=t,a=i,o=n}return this.set("title",r),this.set("message",s),this.set("onok",a),this.set("oncancel",o),this},setup:function(){return{buttons:[{text:N.defaults.glossary.ok,key:s,className:N.defaults.theme.ok},{text:N.defaults.glossary.cancel,key:a,invokeOnClose:!0,className:N.defaults.theme.cancel}],focus:{element:0,select:!1},options:{maximizable:!1,resizable:!1}}},build:function(){},prepare:function(){},setMessage:function(e){this.setContent(e)},settings:{message:null,labels:null,onok:null,oncancel:null,defaultFocus:null,reverseButtons:null},settingUpdated:function(e,t,i){switch(e){case"message":this.setMessage(i);break;case"labels":"ok"in i&&this.__internal.buttons[0].element&&(this.__internal.buttons[0].text=i.ok,this.__internal.buttons[0].element.innerHTML=i.ok),"cancel"in i&&this.__internal.buttons[1].element&&(this.__internal.buttons[1].text=i.cancel,this.__internal.buttons[1].element.innerHTML=i.cancel);break;case"reverseButtons":!0===i?this.elements.buttons.primary.appendChild(this.__internal.buttons[0].element):this.elements.buttons.primary.appendChild(this.__internal.buttons[1].element);break;case"defaultFocus":this.__internal.focus.element="ok"===i?0:1}},callback:function(e){var i;switch(t(this),e.index){case 0:"function"===typeof this.get("onok")&&"undefined"!==typeof(i=this.get("onok").call(this,e))&&(e.cancel=!i);break;case 1:"function"===typeof this.get("oncancel")&&"undefined"!==typeof(i=this.get("oncancel").call(this,e))&&(e.cancel=!i)}},autoOk:function(e){return i(this,0,e),this},autoCancel:function(e){return i(this,1,e),this}}}),N.dialog("prompt",function(){var e=document.createElement("INPUT"),t=document.createElement("P");return{main:function(e,t,i,n,r){var s,a,o,l,h;switch(arguments.length){case 1:a=e;break;case 2:a=e,o=t;break;case 3:a=e,o=t,l=i;break;case 4:a=e,o=t,l=i,h=n;break;case 5:s=e,a=t,o=i,l=n,h=r}return this.set("title",s),this.set("message",a),this.set("value",o),this.set("onok",l),this.set("oncancel",h),this},setup:function(){return{buttons:[{text:N.defaults.glossary.ok,key:s,className:N.defaults.theme.ok}
2,{text:N.defaults.glossary.cancel,key:a,invokeOnClose:!0,className:N.defaults.theme.cancel}],focus:{element:e,select:!0},options:{maximizable:!1,resizable:!1}}},build:function(){e.className=N.defaults.theme.input,e.setAttribute("type","text"),e.value=this.get("value"),this.elements.content.appendChild(t),this.elements.content.appendChild(e)},prepare:function(){},setMessage:function(e){b(e)?(x(t),t.innerHTML=e):e instanceof n.HTMLElement&&t.firstChild!==e&&(x(t),t.appendChild(e))},settings:{message:void 0,labels:void 0,onok:void 0,oncancel:void 0,value:"",type:"text",reverseButtons:void 0},settingUpdated:function(t,i,n){switch(t){case"message":this.setMessage(n);break;case"value":e.value=n;break;case"type":switch(n){case"text":case"color":case"date":case"datetime-local":case"email":case"month":case"number":case"password":case"search":case"tel":case"time":case"week":e.type=n;break;default:e.type="text"}break;case"labels":n.ok&&this.__internal.buttons[0].element&&(this.__internal.buttons[0].element.innerHTML=n.ok),n.cancel&&this.__internal.buttons[1].element&&(this.__internal.buttons[1].element.innerHTML=n.cancel);break;case"reverseButtons":!0===n?this.elements.buttons.primary.appendChild(this.__internal.buttons[0].element):this.elements.buttons.primary.appendChild(this.__internal.buttons[1].element)}},callback:function(t){var i;switch(t.index){case 0:this.settings.value=e.value,"function"===typeof this.get("onok")&&"undefined"!==typeof(i=this.get("onok").call(this,t,this.settings.value))&&(t.cancel=!i);break;case 1:"function"===typeof this.get("oncancel")&&"undefined"!==typeof(i=this.get("oncancel").call(this,t))&&(t.cancel=!i),t.cancel||(e.value=this.settings.value)}}}}),"object"===typeof e.exports?e.exports=N:void 0===(i=function(){return N}.apply(t,[]))||(e.exports=i)}("undefined"!==typeof window?window:this)},740(e){"use strict";e.exports=function(e,t,i,n,r,s,a,o){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var h=[i,n,r,s,a,o],u=0;(l=new Error(t.replace(/%s/g,function(){return h[u++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},4(e,t,i){"use strict";var n=i(853),r=i(43),s=i(950);function a(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function l(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(i=t.return),e=t.return}while(e)}return 3===t.tag?i:null}function h(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function u(e){if(31===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function c(e){if(l(e)!==e)throw Error(a(188))}function d(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=d(e)))return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),w=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),C=Symbol.for("react.lazy");Symbol.for("react.scope");var A=Symbol.for("react.activity");Symbol.for("react.legacy_hidden"),Symbol.for("react.tracing_marker");var k=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var R=Symbol.iterator;function O(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=R&&e[R]||e["@@iterator"])?e:null}var P=Symbol.for("react.client.reference");function M(e){if(null==e)return null;if("function"===typeof e)return e.$$typeof===P?null:e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case v:return"Fragment";case x:return"Profiler";case y:return"StrictMode";case _:return"Suspense";case S:return"SuspenseList";case A:return"Activity"}if("object"===typeof e)switch(e.$$typeof){case g:return"Portal";case w:return e.displayName||"Context";case b:return(e._context.displayName||"Context")+".Consumer";case T:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case E:return null!==(t=e.displayName||null)?t:M(e.type)||"Memo";case C:t=e._payload,e=e._init;try{return M(e(t))}catch(i){}}return null}var N=Array.isArray,I=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D={pending:!1,data:null,method:null,action:null},F=[],B=-1;function U(e){return{current:e}}function z(e){0>B||(e.current=F[B],F[B]=null,B--)}function V(e,t){B++,F[B]=e.current,e.current=t}var H,j,Y=U(null),W=U(null),G=U(null),X=U(null);function q(e,t){switch(V(G,t),V(W,e),V(Y,null),t.nodeType){case 9:case 11:e=(e
vendor: 4,841 bytes, line 2
2=t.documentElement)&&(e=e.namespaceURI)?vc(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=yc(t=vc(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}z(Y),V(Y,e)}function K(){z(Y),z(W),z(G)}function Q(e){null!==e.memoizedState&&V(X,e);var t=Y.current,i=yc(t,e.type);t!==i&&(V(W,e),V(Y,i))}function J(e){W.current===e&&(z(Y),z(W)),X.current===e&&(z(X),ud._currentValue=D)}function Z(e){if(void 0===H)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);H=t&&t[1]||"",j=-1<i.stack.indexOf("\n    at")?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+H+e+j}var $=!1;function ee(e,t){if(!e||$)return"";$=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(i,[])}catch(r){var n=r}Reflect.construct(e,[],i)}else{try{i.call()}catch(s){n=s}e.call(i.prototype)}}else{try{throw Error()}catch(a){n=a}(i=e())&&"function"===typeof i.catch&&i.catch(function(){})}}catch(o){if(o&&n&&"string"===typeof o.stack)return[o.stack,n.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=n.DetermineComponentFrameRoot(),a=s[0],o=s[1];if(a&&o){var l=a.split("\n"),h=o.split("\n");for(r=n=0;n<l.length&&!l[n].includes("DetermineComponentFrameRoot");)n++;for(;r<h.length&&!h[r].includes("DetermineComponentFrameRoot");)r++;if(n===l.length||r===h.length)for(n=l.length-1,r=h.length-1;1<=n&&0<=r&&l[n]!==h[r];)r--;for(;1<=n&&0<=r;n--,r--)if(l[n]!==h[r]){if(1!==n||1!==r)do{if(n--,0>--r||l[n]!==h[r]){var u="\n"+l[n].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=n&&0<=r);break}}}finally{$=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Z(i):""}function te(e,t){switch(e.tag){case 26:case 27:case 5:return Z(e.type);case 16:return Z("Lazy");case 13:return e.child!==t&&null!==t?Z("Suspense Fallback"):Z("Suspense");case 19:return Z("SuspenseList");case 0:case 15:return ee(e.type,!1);case 11:return ee(e.type.render,!1);case 1:return ee(e.type,!0);case 31:return Z("Activity");default:return""}}function ie(e){try{var t="",i=null;do{t+=te(e,i),i=e,e=e.return}while(e);return t}catch(n){return"\nError generating stack: "+n.message+"\n"+n.stack}}var ne=Object.prototype.hasOwnProperty,re=n.unstable_scheduleCallback,se=n.unstable_cancelCallback,ae=n.unstable_shouldYield,oe=n.unstable_requestPaint,le=n.unstable_now,he=n.unstable_getCurrentPriorityLevel,ue=n.unstable_ImmediatePriority,ce=n.unstable_UserBlockingPriority,de=n.unstable_NormalPriority,fe=n.unstable_LowPriority,pe=n.unstable_IdlePriority,me=n.log,ge=n.unstable_setDisableYieldValue,ve=null,ye=null;function xe(e){if("function"===typeof me&&ge(e),ye&&"function"===typeof ye.setStrictMode)try{ye.setStrictMode(ve,e)}catch(t){}}var be=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(we(e)/Te|0)|0},we=Math.log,Te=Math.LN2;var _e=256,Se=262144,Ee=4194304;function Ce(e){var t=42&e;if(0!==t)return t;switch(e&-e){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ae(e,t,i){var n=e.pendingLanes;if(0===n)return 0;var r=0,s=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var o=134217727&n;return 0!==o?0!==(n=o&~s)?r=Ce(n):0!==(a&=o)?r=Ce(a):i||0!==(i=o&~e)&&(r=Ce(i)):0!==(o=n&~s)?r=Ce(o):0!==a?r=Ce(a):i||0!==(i=n&~e)&&(r=Ce(i)),0===r?0:0!==t&&t!==r&&0===(t&s)&&((s=r&-r)>=(i=t&-t)||32===s&&0!==(4194048&i))?t:r}function ke(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Re(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;default:return-1}}function Oe(){var e=Ee;return 0===(62914560&(Ee<<=1))&&(Ee=4194304),e}function Pe(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}
2function Me(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ne(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-be(t);e.entangledLanes|=t,e.entanglements[n]=1073741824|e.entanglements[n]|261930&i}function Ie(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var n=31-be(i),r=1<<n;r&t|e[n]&t&&(e[n]|=t),i&=~r}}function Le(e,t){var i=t&-t;return 0!==((i=0!==(42&i)?1:De(i))&(e.suspendedLanes|t))?0:i}function De(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Fe(e){return 2<(e&=-e)?8<e?0!==(134217727&e)?32:268435456:8:2}function Be(){var e=L.p;return 0!==e?e:void 0===(e=window.event)?32:Cd(e.type)}function Ue(e,t){var i=L.p;try{return L.p=e,t()}finally{L.p=i}}var ze=Math.random().toString(36).slice(2),Ve="__reactFiber$"+ze,He="__reactProps$"+ze,je="__reactContainer$"+ze,Ye="__reactEvents$"+ze,We="__reactListeners$"+ze,Ge="__reactHandles$"+ze,Xe="__reactResources$"+ze,qe="__reactMarker$"+ze;function Ke(e){delete e[Ve],delete e[He],delete e[Ye],delete e[We],delete e[Ge]}function Qe(e){var t=e[Ve];if(t)return t;for(var i=e.parentNode;i;){if(t=i[je]||i[Ve]){if(i=t.alternate,null!==t.child||null!==i&&null!==i.child)for(e=Dc(e);null!==e;){if(i=e[Ve])return i;e=Dc(e)}return t}i=(e=i).parentNode}return null}function Je(e){if(e=e[Ve]||e[je]){var t=e.tag;if(5===t||6===t||13===t||31===t||26===t||27===t||3===t)return e}return null}function Ze(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(a(33))}function $e(e){var t=e[Xe];return t||(t=e[Xe]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function et(e){e[qe]=!0}var tt=new Set,it={};function nt(e,t){rt(e,t),rt(e+"Capture",t)}function rt(e,t){for(it[e]=t,e=0;e<t.length;e++)tt.add(t[e])}var st=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),at={},ot={};function lt(e,t,i){if(r=t,ne.call(ot,r)||!ne.call(at,r)&&(st.test(r)?ot[r]=!0:(at[r]=!0,0)))if(null===i)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var n=t.toLowerCase().slice(0,5);if("data-"!==n&&"aria-"!==n)return void e.removeAttribute(t)}e.setAttribute(t,""+i)}var r}function ht(e,t,i){if(null===i)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+i)}}function ut(e,t,i,n){if(null===n)e.removeAttribute(i);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(i)}e.setAttributeNS(t,i,""+n)}}function ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function dt(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ft(e){if(!e._valueTracker){var t=dt(e)?"checked":"value";e._valueTracker=function(e,t,i){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var r=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(e){i=""+e,s.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(e){i=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e,t,""+e[t])}}function pt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),n="";return e&&(n=dt(e)?e.checked?"true":"false":e.value),(e=n)!==i&&(t.setValue(e),!0)}function mt(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var gt=/[\n"\\]/g;function vt(e){return e.replace(gt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function yt(e,t,i,n,r,s,a,o){e.name="",null!=a&&"function"!==typeof a&&"symbol"!==typeof a&&"boolean"!==typeof a?e.type=a:e.removeAttribute("type"),null!=t?"number"===a?(0===t&&""===e.value||e.value!=t)&&(e.value=""+ct(t)):e.value!==""+ct(t)&&(e.value=""+ct(t)):"submit"!==a&&"reset"!==a||e.removeAttribute("value"),null!=t?bt(e,a,ct(t)):null!=i?bt(e,a,ct(i)):null!=n&&e.removeAttribute("value"),null==r&&null!=s&&(e.defaultChecked=!!s),null!=r&&(e.checked=r&&"function"!==typeof r&&"symbol"!==typeof r),null!=o&&"function"!==typeof o&&"symbol"!==typeof o&&"boolean"!==typeof o?e.name=""+ct(o):e.removeAttribute("name")}function xt(e,t,i,n,r,s,a,o){if(null!=s&&"function"!==typeof s&&"symbol"!==typeof s&&"boolean"!==typeof s&&(e.type=s),null!=t||null!=i){if(!("submit"!==s&&"reset"!==s||void 0!==t&&null!==t))return void ft(e);i=null!=i?""+ct(i):"",t=null!=t?""+ct(t):i,o||t===e.value||(e.value=t),e.defaultValue=t}n="function"!==typeof(n=null!=n?n:r)&&"symbol"!==typeof n&&!!n,e.checked=o?e.checked:!!n,e.defaultChecked=!!n,null!=a&&"function"!==typeof a&&"symbol"!==typeof a&&"boolean"!==typeof a&&(e.name=a),ft(e)}function bt(e,t,i){"number"===t&&mt(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function wt(e,t,i,n){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&n&&(e[i].defaultSelected=!0)}else{for(i=""+ct(i),t=null,r=0;r<e.length;r++){if(e[r].value===i)return e[r].selected=!0,void(n&&(e[r].defaultSelected=!0));null!==t||e[r].disabled||(t=e[r])}null!==t&&(t.selected=!0)}}function Tt(e,t,i){null==t||((t=""+ct(t))!==e.value&&(e.value=t),null!=i)?e.defaultValue=null!=i?""+ct(i):"":e.defaultValue!==t&&(e.defaultValue=t)}function _t(e,t,i,n){if(null==t){if(null!=n){if(null!=i)throw Error(a(92));if(N(n)){if(1<n.length)throw Error(a(93));n=n[0]}i=n}null==i&&(i=""),t=i}i=ct(t),e.defaultValue=i,(n=e.textContent)===i&&""!==n&&null!==n&&(e.value=n),ft(e)}function St(e,t){if(t){var i=e.firstChild;
2if(i&&i===e.lastChild&&3===i.nodeType)return void(i.nodeValue=t)}e.textContent=t}var Et=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ct(e,t,i){var n=0===t.indexOf("--");null==i||"boolean"===typeof i||""===i?n?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":n?e.setProperty(t,i):"number"!==typeof i||0===i||Et.has(t)?"float"===t?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function At(e,t,i){if(null!=t&&"object"!==typeof t)throw Error(a(62));if(e=e.style,null!=i){for(var n in i)!i.hasOwnProperty(n)||null!=t&&t.hasOwnProperty(n)||(0===n.indexOf("--")?e.setProperty(n,""):"float"===n?e.cssFloat="":e[n]="");for(var r in t)n=t[r],t.hasOwnProperty(r)&&i[r]!==n&&Ct(e,r,n)}else for(var s in t)t.hasOwnProperty(s)&&Ct(e,s,t[s])}function kt(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Rt=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode
2-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ot=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Pt(e){return Ot.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Mt(){}var Nt=null;function It(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Lt=null,Dt=null;function Ft(e){var t=Je(e);if(t&&(e=t.stateNode)){var i=e[He]||null;e:switch(e=t.stateNode,t.type){case"input":if(yt(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,"radio"===i.type&&null!=t){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+vt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var n=i[t];if(n!==e&&n.form===e.form){var r=n[He]||null;if(!r)throw Error(a(90));yt(n,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<i.length;t++)(n=i[t]).form===e.form&&pt(n)}break e;case"textarea":Tt(e,i.value,i.defaultValue);break e;case"select":null!=(t=i.value)&&wt(e,!!i.multiple,t,!1)}}}var Bt=!1;function Ut(e,t,i){if(Bt)return e(t,i);Bt=!0;try{return e(t)}finally{if(Bt=!1,(null!==Lt||null!==Dt)&&($h(),Lt&&(t=Lt,e=Dt,Dt=Lt=null,Ft(t),e)))for(t=0;t<e.length;t++)Ft(e[t])}}function zt(e,t){var i=e.stateNode;if(null===i)return null;var n=i[He]||null;if(null===n)return null;i=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!n;break e;default:e=!1}if(e)return null;if(i&&"function"!==typeof i)throw Error(a(231,t,typeof i));return i}var Vt=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),Ht=!1;if(Vt)try{var jt={};Object.defineProperty(jt,"passive",{get:function(){Ht=!0}}),window.addEventListener("test",jt,jt),window.removeEventListener("test",jt,jt)}catch(Jd){Ht=!1}var Yt=null,Wt=null,Gt=null;function Xt(){if(Gt)return Gt;var e,t,i=Wt,n=i.length,r="value"in Yt?Yt.value:Yt.textContent,s=r.length;for(e=0;e<n&&i[e]===r[e];e++);var a=n-e;for(t=1;t<=a&&i[n-t]===r[s-t];t++);return Gt=r.slice(e,1<t?1-t:void 0)}function qt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Kt(){return!0}function Qt(){return!1}function Jt(e){function t(t,i,n,r,s){for(var a in this._reactName=t,this._targetInst=n,this.type=i,this.nativeEvent=r,this.target=s,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(r):r[a]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?Kt:Qt,this.isPropagationStopped=Qt,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Kt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Kt)},persist:function(){},isPersistent:Kt}),t}var Zt,$t,ei,ti={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ii=Jt(ti),ni=f({},ti,{view:0,detail:0}),ri=Jt(ni),si=f({},ni,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gi,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.from
vendor: 4,150 bytes, line 2
2Element===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ei&&(ei&&"mousemove"===e.type?(Zt=e.screenX-ei.screenX,$t=e.screenY-ei.screenY):$t=Zt=0,ei=e),Zt)},movementY:function(e){return"movementY"in e?e.movementY:$t}}),ai=Jt(si),oi=Jt(f({},si,{dataTransfer:0})),li=Jt(f({},ni,{relatedTarget:0})),hi=Jt(f({},ti,{animationName:0,elapsedTime:0,pseudoElement:0})),ui=Jt(f({},ti,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),ci=Jt(f({},ti,{data:0})),di={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fi={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},pi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mi(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=pi[e])&&!!t[e]}function gi(){return mi}var vi=Jt(f({},ni,{key:function(e){if(e.key){var t=di[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=qt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?fi[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gi,charCode:function(e){return"keypress"===e.type?qt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?qt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),yi=Jt(f({},si,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),xi=Jt(f({},ni,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gi})),bi=Jt(f({},ti,{propertyName:0,elapsedTime:0,pseudoElement:0})),wi=Jt(f({},si,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Ti=Jt(f({},ti,{newState:0,oldState:0})),_i=[9,13,27,32],Si=Vt&&"CompositionEvent"in window,Ei=null;Vt&&"documentMode"in document&&(Ei=document.documentMode);var Ci=Vt&&"TextEvent"in window&&!Ei,Ai=Vt&&(!Si||Ei&&8<Ei&&11>=Ei),ki=String.fromCharCode(32),Ri=!1;function Oi(e,t){switch(e){case"keyup":return-1!==_i.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pi(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Mi=!1;var Ni={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ii(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Ni[e.type]:"textarea"===t}function Li(e,t,i,n){Lt?Dt?Dt.push(n):Dt=[n]:Lt=n,0<(t=nc(t,"onChange")).length&&(i=new ii("onChange","change",null,i,n),e.push({event:i,listeners:t}))}var Di=null,Fi=null;function Bi(e){Ku(e,0)}function Ui(e){if(pt(Ze(e)))return e}function zi(e,t){if("change"===e)return t}var Vi=!1;if(Vt){var Hi;if(Vt){var ji="oninput"in document;if(!ji){var Yi=document.createElement("div");Yi.setAttribute("oninput","return;"),ji="function"===typeof Yi.oninput}Hi=ji}else Hi=!1;Vi=Hi&&(!document.documentMode||9<document.documentMode)}function Wi(){Di&&(Di.detachEvent("onpropertychange",Gi),Fi=Di=null)}function Gi(e){if("value"===e.propertyName&&Ui(Fi)){var t=[];Li(t,Fi,e,It(e)),Ut(Bi,t)}}function Xi(e,t,i){"focusin"===e?(Wi(),Fi=i,(Di=t).attachEvent("onpropertychange",Gi)):"focusout"===e&&Wi()}function qi(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Ui(
2Fi)}function Ki(e,t){if("click"===e)return Ui(t)}function Qi(e,t){if("input"===e||"change"===e)return Ui(t)}var Ji="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function Zi(e,t){if(Ji(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(n=0;n<i.length;n++){var r=i[n];if(!ne.call(t,r)||!Ji(e[r],t[r]))return!1}return!0}function $i(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function en(e,t){var i,n=$i(e);for(e=0;n;){if(3===n.nodeType){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$i(n)}}function tn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?tn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nn(e){for(var t=mt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var i="string"===typeof t.contentWindow.location.href}catch(n){i=!1}if(!i)break;t=mt((e=t.contentWindow).document)}return t}function rn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var sn=Vt&&"documentMode"in document&&11>=document.documentMode,an=null,on=null,ln=null,hn=!1;function un(e,t,i){var n=i.window===i?i.document:9===i.nodeType?i:i.ownerDocument;hn||null==an||an!==mt(n)||("selectionStart"in(n=an)&&rn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},ln&&Zi(ln,n)||(ln=n,0<(n=nc(on,"onSelect")).length&&(t=new ii("onSelect","select",null,t,i),e.push({event:t,listeners:n}),t.target=an)))}function cn(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var dn={animationend:cn("Animation","AnimationEnd"),animationiteration:cn("Animation","AnimationIteration"),animationstart:cn("Animation","AnimationStart"),transitionrun:cn("Transition","TransitionRun"),transitionstart:cn("Transition","TransitionStart"),transitioncancel:cn("Transition","TransitionCancel"),transitionend:cn("Transition","TransitionEnd")},fn={},pn={};function mn(e){if(fn[e])return fn[e];if(!dn[e])return e;var t,i=dn[e];for(t in i)if(i.hasOwnProperty(t)&&t in pn)return fn[e]=i[t];return e}Vt&&(pn=document.createElement("div").style,"AnimationEvent"in window||(delete dn.animationend.animation,delete dn.animationiteration.animation,delete dn.animationstart.animation),"TransitionEvent"in window||delete dn.transitionend.transition);var gn=mn("animationend"),vn=mn("animationiteration"),yn=mn("animationstart"),xn=mn("transitionrun"),bn=mn("transitionstart"),wn=mn("transitioncancel"),Tn=mn("transitionend"),_n=new Map,Sn="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function En(e,t){_n.set(e,t),nt(t,[e])}Sn.push("scrollEnd");var Cn="function"===typeof reportError?reportError:function(e){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof e&&null!==e&&"string"===typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"===typeof process&&"function"===typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},An=[],kn=0,Rn=0;function On(){for(var e=kn,t=Rn=kn=0;t<e;){var i=An[t];An[t++]=null;var n=An[t];An[t++]=null;var r=An[t];An[t++]=null;var s=An[t];if(An[t++]=null,null!==n&&null!==r){var a=n.pending;
vendor: 15,170 bytes, line 2
2null===a?r.next=r:(r.next=a.next,a.next=r),n.pending=r}0!==s&&In(i,r,s)}}function Pn(e,t,i,n){An[kn++]=e,An[kn++]=t,An[kn++]=i,An[kn++]=n,Rn|=n,e.lanes|=n,null!==(e=e.alternate)&&(e.lanes|=n)}function Mn(e,t,i,n){return Pn(e,t,i,n),Ln(e)}function Nn(e,t){return Pn(e,null,null,t),Ln(e)}function In(e,t,i){e.lanes|=i;var n=e.alternate;null!==n&&(n.lanes|=i);for(var r=!1,s=e.return;null!==s;)s.childLanes|=i,null!==(n=s.alternate)&&(n.childLanes|=i),22===s.tag&&(null===(e=s.stateNode)||1&e._visibility||(r=!0)),e=s,s=s.return;return 3===e.tag?(s=e.stateNode,r&&null!==t&&(r=31-be(i),null===(n=(e=s.hiddenUpdates)[r])?e[r]=[t]:n.push(t),t.lane=536870912|i),s):null}function Ln(e){if(50<Yh)throw Yh=0,Wh=null,Error(a(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var Dn={};function Fn(e,t,i,n){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bn(e,t,i,n){return new Fn(e,t,i,n)}function Un(e){return!(!(e=e.prototype)||!e.isReactComponent)}function zn(e,t){var i=e.alternate;return null===i?((i=Bn(e.tag,t,e.key,e.mode)).elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=65011712&e.flags,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Vn(e,t){e.flags&=65011714;var i=e.alternate;return null===i?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Hn(e,t,i,n,r,s){var o=0;if(n=e,"function"===typeof e)Un(e)&&(o=1);else if("string"===typeof e)o=function(e,t,i){if(1===i||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!==typeof t.precedence||"string"!==typeof t.href||""===t.href)break;return!0;case"link":if("string"!==typeof t.rel||"string"!==typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"===typeof t.precedence&&null==e);case"script":if(t.async&&"function"!==typeof t.async&&"symbol"!==typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"===typeof t.src)return!0}return!1}(e,i,Y.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case A:return(e=Bn(31,i,t,r)).elementType=A,e.lanes=s,e;case v:return jn(i.children,r,s,t);case y:o=8,r|=24;break;case x:return(e=Bn(12,i,t,2|r)).elementType=x,e.lanes=s,e;case _:return(e=Bn(13,i,t,r)).elementType=_,e.lanes=s,e;case S:return(e=Bn(19,i,t,r)).elementType=S,e.lanes=s,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case w:o=10;break e;case b:o=9;break e;case T:o=11;break e;case E:o=14;break e;case C:o=16,n=null;break e}o=29,i=Error(a(130,null===e?"null":typeof e,"")),n=null}return(t=Bn(o,i,t,r)).elementType=e,t.type=n,t.lanes=s,t}function jn(e,t,i,n){return(e=Bn(7,e,n,t)).lanes=i,e}function Yn(e,t,i){return(e=Bn(6,e,null,t)).lanes=i,e}function Wn(e){var t=Bn(18,null,null,0);return t.stateNode=e,t}function Gn(e,t,i){return(t=Bn(4,null!==e.children?e.children:[],e.key,t)).lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Xn=new WeakMap;function qn(e,t){if("object"===typeof e&&null!==e){var i=Xn.get(e);return void 0!==i?i:(t={value:e,source:t,stack:ie(t)},Xn.set(e,t),t)}return{value:e,source:t,stack:ie(t)}}var Kn=[],Qn=0,Jn=null,Zn=0,$n=[],er=0,tr=null,ir=1,nr="";function rr(e,t){Kn[Qn++]=Zn,Kn[Qn++]=Jn,Jn=e,Zn=t}function sr(e,t,i){$n[er++]=ir,$n[er++]=nr,$n[er++]=tr,tr=e;var n=ir;e=nr;var r=32-be(n)-1;n&=~(1<<r),i+=1;var s=32-be(t)+r;if(30<s){var a=r-r%5;s=(n&(1<<a)-1).toString(32),n>>=a,r-=a,ir=1<<32-be(t)+r|i<<r|n,nr=s+e}else ir=1<<s|i<<r|n,nr=e}function ar(e){null!==e.return&&(rr(e,1),sr(e,1,0))}function or(e){for(;e===Jn;)Jn=Kn[--Qn],Kn[Qn]=null,Zn=Kn[--Qn],Kn[Qn]=null;for(;e===tr;)tr=$n[--er],$n[er]=null,nr=$n[--er],$n[er]=null,ir=$n[--er],$n[er]=null}function lr(e,t){$n[er++]=ir,$n[er++]=nr,$n[er++]=tr,ir=t.id,nr=t.overflow,tr=e}var hr=null,ur=null,cr=!1,dr=null,fr=!1,pr=Error(a(519));function mr(e){throw wr(qn(Error(a(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML","")),e)),pr}function gr(e){var t=e.stateNode,i=e.type,n=e.memoizedProps;switch(t[Ve]=e,t[He]=n,i){case"dialog":Qu("cancel",t),Qu("close",t);break;case"iframe":case"object":case"embed":Qu("load",t);break;case"video":case"audio":for(i=0;i<Xu.length;i++)Qu(Xu[i],t);break;case"source":Qu("error",t);break;case"img":case"image":case"link":Qu("error",t),Qu("load",t);break;case"details":Qu("toggle",t);break;case"input":Qu("invalid",t),xt(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Qu("invalid",t);break;case"textarea":Qu("invalid",t),_t(t,n.value,n.defaultValue,n.children)}"string"!==typeof(i=n.children)&&"number"!==typeof i&&"bigint"!==typeof i||t.textContent===""+i||!0===n.suppressHydrationWarning||hc(t.textContent,i)?(null!=n.popover&&(Qu("beforetoggle",t),Qu("toggle",t)),null!=n.onScroll&&Qu("scroll",t),null!=n.onScrollEnd&&Qu("scrollend",t),null!=n.onClick&&(t.onclick=Mt),t=!0):t=!1,t||mr(e,!0)}function vr(e){for(hr=e.return;hr;)switch(hr.tag){case 5:case 31:case 13:return void(fr=!1);case 27:case 3:return void(fr=!0);default:hr=hr.return}}function yr(e){if(e!==hr)return!1;if(!cr)return vr(e),cr=!0,!1;var t,i=e.tag;if((t=3!==i&&27!==i)&&((t=5===i)&&(t=!("form"!==(t=e.type)&&"button"!==t)||xc(e.type,e.memoizedProps)),t=!t),t&&ur&&mr(e),vr(e),13===i){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));ur=Lc(e)}else if(31===i){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));ur=Lc(e)}else 27===i?(i=ur,Cc(e.type)?(e=Ic,Ic=null,ur=e):ur=i):ur=hr?Nc(e.stateNode.nextSibling):null;return!0}function xr(){ur=hr=null,cr=!1}function br(){var e=dr;return null!==e&&(null===Oh?Oh=e:Oh.push.apply(Oh,e),dr=null),e}function wr(e){null===dr?dr=[e]:dr.push(e)}var Tr=U(null),_r=null,Sr=null;function Er(e,t,i){V(Tr,t._currentValue),t._currentValue=i}function Cr(e){e._currentValue=Tr.current,z(Tr)}function Ar(e,t,i){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==n&&(n.childLanes|=t)):null!==n&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===i)break;e=e.return}}function kr(e,t,i,n){var r=e.child;for(null!==r&&(r.return=e);null!==r;){var s=r.dependencies;if(null!==s){var o=r.child;s=s.firstContext;e:for(;null!==s;){var l=s;s=r;for(var h=0;h<t.length;h++)if(l.context===t[h]){s.lanes|=i,null!==(l=s.alternate)&&(l.lanes|=i),Ar(s.return,i,e),n||(o=null);break e}s=l.next}}else if(18===r.tag){if(null===(o=r.return))throw Error(a(341));o.lanes|=i,null!==(s=o.alternate)&&(s.lanes|=i),Ar(o,i,e),o=null}else o=r.child;if(null!==o)o.return=r;else for(o=r;null!==o;){if(o===e){o=null;break}if(null!==(r=o.sibling)){r.return=o.return,o=r;break}o=o.return}r=o}}function Rr(e,t,i,n){e=null;for(var r=t,s=!1;null!==r;){if(!s)if(0!==(524288&r.flags))s=!0;else if(0!==(262144&r.flags))break;if(10===r.tag){var o=r.alternate;if(null===o)throw Error(a(387));if(null!==(o=o.memoizedProps)){var l=r.type;Ji(r.pendingProps.value,o.value)||(null!==e?e.push(l):e=[l])}}else if(r===X.current){if(null===(o=r.alternate))throw Error(a(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(null!==e?e.push(ud):e=[ud])}r=r.return}null!==e&&kr(t,e,i,n),t.flags|=262144}function Or(e){for(e=e.firstContext;null!==e;){if(!Ji(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Pr(e){_r=e,Sr=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Mr(e){return Ir(_r,e)}function Nr(e,t){return null===_r&&Pr(e),Ir(e,t)}function Ir(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},null===Sr){if(null===e)throw Error(a(308));Sr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Sr=Sr.next=t;return i}var Lr="undefined"!==typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Dr=n.unstable_scheduleCallback,Fr=n.unstable_NormalPriority,Br={$$typeof:w,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ur(){return{controller:new Lr,data:new Map,refCount:0}}function zr(e){e.refCount--,0===e.refCount&&Dr(Fr,function(){e.controller.abort()})}var Vr=null,Hr=0,jr=0,Yr=null;function Wr(){if(0===--Hr&&null!==Vr){null!==Yr&&(Yr.status="fulfilled");var e=Vr;Vr=null,jr=0,Yr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var Gr=I.S;I.S=function(e,t){Nh=le(),"object"===typeof t&&null!==t&&"function"===typeof t.then&&function(e,t){if(null===Vr){var i=Vr=[];Hr=0,jr=Hu(),Yr={status:"pending",value:void 0,then:function(e){i.push(e)}}}Hr++,t.then(Wr,Wr)}(0,t),null!==Gr&&Gr(e,t)};var Xr=U(null);function qr(){var e=Xr.current;return null!==e?e:ph.pooledCache}function Kr(e,t){V(Xr,null===t?Xr.current:t.pool)}function Qr(){var e=qr();return null===e?null:{parent:Br._currentValue,pool:e}}var Jr=Error(a(460)),Zr=Error(a(474)),$r=Error(a(542)),es={then:function(){}};function ts(e){return"fulfilled"===(e=e.status)||"rejected"===e}function is(e,t,i){switch(void 0===(i=e[i])?e.push(t):i!==t&&(t.then(Mt,Mt),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw as(e=t.reason),e;default:if("string"===typeof t.status)t.then(Mt,Mt);else{if(null!==(e=ph)&&100<e.shellSuspendCounter)throw Error(a(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var i=t;i.status="fulfilled",i.value=e}},function(e){if("pending"===t.status){var i=t;i.status="rejected",i.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw as(e=t.reason),e}throw rs=t,Jr}}function ns(e){try{return(0,e._init)(e._payload)}catch(t){if(null!==t&&"object"===typeof t&&"function"===typeof t.then)throw rs=t,Jr;throw t}}var rs=null;function ss(){if(null===rs)throw Error(a(459));var e=rs;return rs=null,e}function as(e){if(e===Jr||e===$r)throw Error(a(483))}var os=null,ls=0;function hs(e){var t=ls;return ls+=1,null===os&&(os=[]),is(os,e,t)}function us(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function cs(e,t){if(t.$$typeof===p)throw Error(a(525));throw e=Object.prototype.toString.call(t),Error(a(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ds(e){function t(t,i){if(e){var n=t.deletions;null===n?(t.deletions=[i],t.flags|=16):n.push(i)}}function i(i,n){if(!e)return null;for(;null!==n;)t(i,n),n=n.sibling;return null}function n(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function r(e,t){return(e=zn(e,t)).index=0,e.sibling=null,e}function s(t,i,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<i?(t.flags|=67108866,i):n:(t.flags|=67108866,i):(t.flags|=1048576,i)}function o(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function l(e,t,i,n){return null===t||6!==t.tag?((t=Yn(i,e.mode,n)).return=e,t):((t=r(t,i)).return=e,t)}function h(e,t,i,n){var s=i.type;return s===v?c(e,t,i.props.children,n,i.key):null!==t&&(t.elementType===s||"object"===typeof s&&null!==s&&s.$$typeof===C&&ns(s)===t.type)?(us(t=r(t,i.props),i),t.return=e,t):(us(t=Hn(i.type,i.key,i.props,null,e.mode,n),i),t.return=e,t)}function u(e,t,i,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==i.containerInfo||t.stateNode.implementation!==i.implementation?((t=Gn(i,e.mode,n)).return=e,t):((t=r(t,i.children||[])).return=e,t)}function c(e,t,i,n,s){return null===t||7!==t.tag?((t=jn(i,e.mode,n,s)).return=e,t):((t=r(t,i)).return=e,t)}function d(e,t,i){if("string"===typeof t&&""!==t||"number"===typeof t||"bigint"===typeof t)return(t=Yn(""+t,e.mode,i)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case m:return us(i=Hn(t.type,t.key,t.props,null,e.mode,i),t),i.return=e,i;case g:return(t=Gn(t,e.mode,i)).return=e,t;case C:return d(e,t=ns(t),i)}if(N(t)||O(t))return(t=jn(t,e.mode,i,null)).return=e,t;if("function"===typeof t.then)return d(e,hs(t),i);if(t.$$typeof===w)return d(e,Nr(e,t),i);cs(e,t)}return null}function f(e,t,i,n){var r=null!==t?t.key:null;if("string"===typeof i&&""!==i||"number"===typeof i||"bigint"===typeof i)return null!==r?null:l(e,t,""+i,n);if("object"===typeof i&&null!==i){switch(i.$$typeof){case m:return i.key===r?h(e,t,i,n):null;case g:return i.key===r?u(e,t,i,n):null;case C:return f(e,t,i=ns(i),n)}if(N(i)||O(i))return null!==r?null:c(e,t,i,n,null);if("function"===typeof i.then)return f(e,t,hs(i),n);if(i.$$typeof===w)return f(e,t,Nr(e,i),n);cs(e,i)}return null}function p(e,t,i,n,r){if("string"===typeof n&&""!==n||"number"===typeof n||"bigint"===typeof n)return l(t,e=e.get(i)||null,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case m:return h(t,e=e.get(null===n.key?i:n.key)||null,n,r);case g:return u(t,e=e.get(null===n.key?i:n.key)||null,n,r);case C:return p(e,t,i,n=ns(n),r)}if(N(n)||O(n))return c(t,e=e.get(i)||null,n,r,null);if("function"===typeof n.then)return p(e,t,i,hs(n),r);if(n.$$typeof===w)return p(e,t,i,Nr(t,n),r);cs(t,n)}return null}function y(l,h,u,c){if("object"===typeof u&&null!==u&&u.type===v&&null===u.key&&(u=u.props.children),"object"===typeof u&&null!==u){switch(u.$$typeof){case m:e:{for(var x=u.key;null!==h;){if(h.key===x){if((x=u.type)===v){if(7===h.tag){i(l,h.sibling),(c=r(h,u.props.children)).return=l,l=c;break e}}else if(h.elementType===x||"object"===typeof x&&null!==x&&x.$$typeof===C&&ns(x)===h.type){i(l,h.sibling),us(c=r(h,u.props),u),c.return=l,l=c;break e}i(l,h);break}t(l,h),h=h.sibling}u.type===v?((c=jn(u.props.children,l.mode,c,u.key)).return=l,l=c):(us(c=Hn(u.type,u.key,u.props,null,l.mode,c),u),c.return=l,l=c)}return o(l);case g:e:{for(x=u.key;null!==h;){if(h.key===x){if(4===h.tag&&h.stateNode.containerInfo===u.containerInfo&&h.stateNode.implementation===u.implementation){i(l,h.sibling),(c=r(h,u.children||[])).return=l,l=c;break e}i(l,h);break}t(l,h),h=h.sibling}(c=Gn(u,l.mode,c)).return=l,l=c}return o(l);case C:return y(l,h,u=ns(u),c)}if(N(u))return function(r,a,o,l){for(var h=null,u=null,c=a,m=a=0,g=null;null!==c&&m<o.length;m++){c.index>m?(g=c,c=null):g=c.sibling;var v=f(r,c,o[m],l);if(null===v){null===c&&(c=g);break}e&&c&&null===v.alternate&&t(r,c),a=s(v,a,m),null===u?h=v:u.sibling=v,u=v,c=g}if(m===o.length)return i(r,c),cr&&rr(r,m),h;
vendor: 4,374 bytes, line 2
2if(null===c){for(;m<o.length;m++)null!==(c=d(r,o[m],l))&&(a=s(c,a,m),null===u?h=c:u.sibling=c,u=c);return cr&&rr(r,m),h}for(c=n(c);m<o.length;m++)null!==(g=p(c,r,m,o[m],l))&&(e&&null!==g.alternate&&c.delete(null===g.key?m:g.key),a=s(g,a,m),null===u?h=g:u.sibling=g,u=g);return e&&c.forEach(function(e){return t(r,e)}),cr&&rr(r,m),h}(l,h,u,c);if(O(u)){if("function"!==typeof(x=O(u)))throw Error(a(150));return function(r,o,l,h){if(null==l)throw Error(a(151));for(var u=null,c=null,m=o,g=o=0,v=null,y=l.next();null!==m&&!y.done;g++,y=l.next()){m.index>g?(v=m,m=null):v=m.sibling;var x=f(r,m,y.value,h);if(null===x){null===m&&(m=v);break}e&&m&&null===x.alternate&&t(r,m),o=s(x,o,g),null===c?u=x:c.sibling=x,c=x,m=v}if(y.done)return i(r,m),cr&&rr(r,g),u;if(null===m){for(;!y.done;g++,y=l.next())null!==(y=d(r,y.value,h))&&(o=s(y,o,g),null===c?u=y:c.sibling=y,c=y);return cr&&rr(r,g),u}for(m=n(m);!y.done;g++,y=l.next())null!==(y=p(m,r,g,y.value,h))&&(e&&null!==y.alternate&&m.delete(null===y.key?g:y.key),o=s(y,o,g),null===c?u=y:c.sibling=y,c=y);return e&&m.forEach(function(e){return t(r,e)}),cr&&rr(r,g),u}(l,h,u=x.call(u),c)}if("function"===typeof u.then)return y(l,h,hs(u),c);if(u.$$typeof===w)return y(l,h,Nr(l,u),c);cs(l,u)}return"string"===typeof u&&""!==u||"number"===typeof u||"bigint"===typeof u?(u=""+u,null!==h&&6===h.tag?(i(l,h.sibling),(c=r(h,u)).return=l,l=c):(i(l,h),(c=Yn(u,l.mode,c)).return=l,l=c),o(l)):i(l,h)}return function(e,t,i,n){try{ls=0;var r=y(e,t,i,n);return os=null,r}catch(a){if(a===Jr||a===$r)throw a;var s=Bn(29,a,null,e.mode);return s.lanes=n,s.return=e,s}}}var fs=ds(!0),ps=ds(!1),ms=!1;function gs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ys(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xs(e,t,i){var n=e.updateQueue;if(null===n)return null;if(n=n.shared,0!==(2&fh)){var r=n.pending;return null===r?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=Ln(e),In(e,null,i),t}return Pn(e,n,t,i),Ln(e)}function bs(e,t,i){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194048&i))){var n=t.lanes;i|=n&=e.pendingLanes,t.lanes=i,Ie(e,i)}}function ws(e,t){var i=e.updateQueue,n=e.alternate;if(null!==n&&i===(n=n.updateQueue)){var r=null,s=null;if(null!==(i=i.firstBaseUpdate)){do{var a={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};null===s?r=s=a:s=s.next=a,i=i.next}while(null!==i);null===s?r=s=t:s=s.next=t}else r=s=t;return i={baseState:n.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:n.shared,callbacks:n.callbacks},void(e.updateQueue=i)}null===(e=i.lastBaseUpdate)?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Ts=!1;function _s(){if(Ts){if(null!==Yr)throw Yr}}function Ss(e,t,i,n){Ts=!1;var r=e.updateQueue;ms=!1;var s=r.firstBaseUpdate,a=r.lastBaseUpdate,o=r.shared.pending;if(null!==o){r.shared.pending=null;var l=o,h=l.next;l.next=null,null===a?s=h:a.next=h,a=l;var u=e.alternate;null!==u&&((o=(u=u.updateQueue).lastBaseUpdate)!==a&&(null===o?u.firstBaseUpdate=h:o.next=h,u.lastBaseUpdate=l))}if(null!==s){var c=r.baseState;for(a=0,u=h=l=null,o=s;;){var d=-536870913&o.lane,p=d!==o.lane;if(p?(gh&d)===d:(n&d)===d){0!==d&&d===jr&&(Ts=!0),null!==u&&(u=u.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var m=e,g=o;d=t;var v=i;switch(g.tag){case 1:if("function"===typeof(m=g.payload)){c=m.call(v,c,d);break e}c=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null===(d="function"===typeof(m=g.payload)?m.call(v,c,d):m)||void 0===d)break e;c=f({},c,d);break e;case 2:ms=!0}}null!==(d=o.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=r.callbacks)?r.callbacks=[d]:p.push(d))}else p={lane:d,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===u?(h=u=p,l=c):u=u.next=p,a|=d;if(null===(o=o.next)){if(null===(o=r.shared.pending))break;o=(p=o).next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}null===u&&(l=c),r.baseState=l,r.firstBaseUpdate=h,r.lastBaseUpdate=u,null===s&&(r.shared.lanes=0),Sh|=a,e.lanes=a,e.memoizedState=c}}function Es(e,t){if("function"!==typeof e)throw Error(a(191,e));e.call(t)}function Cs(e,t){var i=e.callbacks;
vendor: 7,711 bytes, line 2
2if(null!==i)for(e.callbacks=null,e=0;e<i.length;e++)Es(i[e],t)}var As=U(null),ks=U(0);function Rs(e,t){V(ks,e=Th),V(As,t),Th=e|t.baseLanes}function Os(){V(ks,Th),V(As,As.current)}function Ps(){Th=ks.current,z(As),z(ks)}var Ms=U(null),Ns=null;function Is(e){var t=e.alternate;V(Us,1&Us.current),V(Ms,e),null===Ns&&(null===t||null!==As.current||null!==t.memoizedState)&&(Ns=e)}function Ls(e){V(Us,Us.current),V(Ms,e),null===Ns&&(Ns=e)}function Ds(e){22===e.tag?(V(Us,Us.current),V(Ms,e),null===Ns&&(Ns=e)):Fs()}function Fs(){V(Us,Us.current),V(Ms,Ms.current)}function Bs(e){z(Ms),Ns===e&&(Ns=null),z(Us)}var Us=U(0);function zs(e){for(var t=e;null!==t;){if(13===t.tag){var i=t.memoizedState;if(null!==i&&(null===(i=i.dehydrated)||Pc(i)||Mc(i)))return t}else if(19!==t.tag||"forwards"!==t.memoizedProps.revealOrder&&"backwards"!==t.memoizedProps.revealOrder&&"unstable_legacy-backwards"!==t.memoizedProps.revealOrder&&"together"!==t.memoizedProps.revealOrder){if(null!==t.child){t.child.return=t,t=t.child;continue}}else if(0!==(128&t.flags))return t;if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vs=0,Hs=null,js=null,Ys=null,Ws=!1,Gs=!1,Xs=!1,qs=0,Ks=0,Qs=null,Js=0;function Zs(){throw Error(a(321))}function $s(e,t){if(null===t)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Ji(e[i],t[i]))return!1;return!0}function ea(e,t,i,n,r,s){return Vs=s,Hs=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=null===e||null===e.memoizedState?go:vo,Xs=!1,s=i(n,r),Xs=!1,Gs&&(s=ia(t,i,n,r)),ta(e),s}function ta(e){I.H=mo;var t=null!==js&&null!==js.next;if(Vs=0,Ys=js=Hs=null,Ws=!1,Ks=0,Qs=null,t)throw Error(a(300));null===e||No||null!==(e=e.dependencies)&&Or(e)&&(No=!0)}function ia(e,t,i,n){Hs=e;var r=0;do{if(Gs&&(Qs=null),Ks=0,Gs=!1,25<=r)throw Error(a(301));if(r+=1,Ys=js=null,null!=e.updateQueue){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,null!=s.memoCache&&(s.memoCache.index=0)}I.H=yo,s=t(i,n)}while(Gs);return s}function na(){var e=I.H,t=e.useState()[0];return t="function"===typeof t.then?ha(t):t,e=e.useState()[0],(null!==js?js.memoizedState:null)!==e&&(Hs.flags|=1024),t}function ra(){var e=0!==qs;return qs=0,e}function sa(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function aa(e){if(Ws){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}Ws=!1}Vs=0,Ys=js=Hs=null,Gs=!1,Ks=qs=0,Qs=null}function oa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ys?Hs.memoizedState=Ys=e:Ys=Ys.next=e,Ys}function la(){if(null===js){var e=Hs.alternate;e=null!==e?e.memoizedState:null}else e=js.next;var t=null===Ys?Hs.memoizedState:Ys.next;if(null!==t)Ys=t,js=e;else{if(null===e){if(null===Hs.alternate)throw Error(a(467));throw Error(a(310))}e={memoizedState:(js=e).memoizedState,baseState:js.baseState,baseQueue:js.baseQueue,queue:js.queue,next:null},null===Ys?Hs.memoizedState=Ys=e:Ys=Ys.next=e}return Ys}function ha(e){var t=Ks;return Ks+=1,null===Qs&&(Qs=[]),e=is(Qs,e,t),t=Hs,null===(null===Ys?t.memoizedState:Ys.next)&&(t=t.alternate,I.H=null===t||null===t.memoizedState?go:vo),e}function ua(e){if(null!==e&&"object"===typeof e){if("function"===typeof e.then)return ha(e);if(e.$$typeof===w)return Mr(e)}throw Error(a(438,String(e)))}function ca(e){var t=null,i=Hs.updateQueue;if(null!==i&&(t=i.memoCache),null==t){var n=Hs.alternate;null!==n&&(null!==(n=n.updateQueue)&&(null!=(n=n.memoCache)&&(t={data:n.data.map(function(e){return e.slice()}),index:0})))}if(null==t&&(t={data:[],index:0}),null===i&&(i={lastEffect:null,events:null,stores:null,memoCache:null},Hs.updateQueue=i),i.memoCache=t,void 0===(i=t.data[t.index]))for(i=t.data[t.index]=Array(e),n=0;n<e;n++)i[n]=k;return t.index++,i}function da(e,t){return"function"===typeof t?t(e):t}function fa(e){return pa(la(),js,e)}function pa(e,t,i){var n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=i;var r=e.baseQueue,s=n.pending;if(null!==s){if(null!==r){var o=r.next;r.next=s.next,s.next=o}t.baseQueue=r=s,n.pending=null}if(s=e.baseState,null===r)e.memoizedState=s;else{var l=o=null,h=null,u=t=r.next,c=!1;do{var d=-536870913&u.lane;if(d!==u.lane?(gh&d)===d:(Vs&d)===d){var f=u.revertLane;if(0===f)null!==h&&(h=h.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===jr&&(c=!0);else{if((Vs&f)===f){u=u.next,f===jr&&(c=!0);continue}d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===h?(l=h=d,o=s):h=h.next=d,Hs.lanes|=f,Sh|=f}d=u.action,Xs&&i(s,d),s=u.hasEagerState?u.eagerState:i(s,d)}else f={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===h?(l=h=f,o=s):h=h.next=f,Hs.lanes|=d,Sh|=d;u=u.next}while(null!==u&&u!==t);if(null===h?o=s:h.next=l,!Ji(s,e.memoizedState)&&(No=!0,c&&null!==(i=Yr)))throw i;e.memoizedState=s,e.baseState=o,e.baseQueue=h,n.lastRenderedState=s}return null===r&&(n.lanes=0),[e.memoizedState,n.dispatch]}function ma(e){var t=la(),i=t.queue;if(null===i)throw Error(a(311));i.lastRenderedReducer=e;var n=i.dispatch,r=i.pending,s=t.memoizedState;if(null!==r){i.pending=null;var o=r=r.next;do{s=e(s,o.action),o=o.next}while(o!==r);Ji(s,t.memoizedState)||(No=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),i.lastRenderedState=s}return[s,n]}function ga(e,t,i){var n=Hs,r=la(),s=cr;if(s){if(void 0===i)throw Error(a(407));i=i()}else i=t();var o=!Ji((js||r).memoizedState,i);if(o&&(r.memoizedState=i,No=!0),r=r.queue,Va(xa.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||null!==Ys&&1&Ys.memoizedState.tag){if(n.flags|=2048,Da(9,{destroy:void 0},ya.bind(null,n,r,i,t),null),null===ph)throw Error(a(349));s||0!==(127&Vs)||va(n,t,i)}return i}function va(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},null===(t=Hs.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},Hs.updateQueue=t,t.stores=[e]):null===(i=t.stores)?t.stores=[e]:i.push(e)}function ya(e,t,i,n){t.value=i,t.getSnapshot=n,ba(t)&&wa(e)}function xa(e,t,i){return i(function(){ba(t)&&wa(e)})}function ba(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Ji(e,i)}catch(n){return!0}}function wa(e){var t=Nn(e,2);null!==t&&qh(t,e,2)}function Ta(e){var t=oa();if("function"===typeof e){var i=e;if(e=i(),Xs){xe(!0);try{i()}finally{xe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:e},t}function _a(e,t,i,n){return e.baseState=i,pa(e,js,"function"===typeof n?n:da)}function Sa(e,t,i,n,r){if(co(e))throw Error(a(485));if(null!==(e=t.action)){var s={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){s.listeners.push(e)}};null!==I.T?i(!0):s.isTransition=!1,n(s),null===(i=t.pending)?(s.next=t.pending=s,Ea(t,s)):(s.next=i.next,t.pending=i.next=s)}}function Ea(e,t){var i=t.action,n=t.payload,r=e.state;if(t.isTransition){var s=I.T,a={};I.T=a;try{var o=i(r,n),l=I.S;null!==l&&l(a,o),Ca(e,t,o)}catch(h){ka(e,t,h)}finally{null!==s&&null!==a.types&&(s.types=a.types),I.T=s}}else try{Ca(e,t,s=i(r,n))}catch(u){ka(e,t,u)}}function Ca(e,t,i){null!==i&&"object"===typeof i&&"function"===typeof i.then?i.then(function(i){Aa(e,t,i)},function(i){return ka(e,t,i)}):Aa(e,t,i)}function Aa(e,t,i){t.status="fulfilled",t.value=i,Ra(t),e.state=i,null!==(t=e.pending)&&((i=t.next)===t?e.pending=null:(i=i.next,t.next=i,Ea(e,i)))}function ka(e,t,i){var n=e.pending;if(e.pending=null,null!==n){n=n.next;do{t.status="rejected",t.reason=i,Ra(t),t=t.next}
vendor: 9,752 bytes, line 2
2while(t!==n)}e.action=null}function Ra(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Oa(e,t){return t}function Pa(e,t){if(cr){var i=ph.formState;if(null!==i){e:{var n=Hs;if(cr){if(ur){t:{for(var r=ur,s=fr;8!==r.nodeType;){if(!s){r=null;break t}if(null===(r=Nc(r.nextSibling))){r=null;break t}}r="F!"===(s=r.data)||"F"===s?r:null}if(r){ur=Nc(r.nextSibling),n="F!"===r.data;break e}}mr(n)}n=!1}n&&(t=i[0])}}return(i=oa()).memoizedState=i.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:t},i.queue=n,i=lo.bind(null,Hs,n),n.dispatch=i,n=Ta(!1),s=uo.bind(null,Hs,!1,n.queue),r={state:t,dispatch:null,action:e,pending:null},(n=oa()).queue=r,i=Sa.bind(null,Hs,r,s,i),r.dispatch=i,n.memoizedState=e,[t,i,!1]}function Ma(e){return Na(la(),js,e)}function Na(e,t,i){if(t=pa(e,t,Oa)[0],e=fa(da)[0],"object"===typeof t&&null!==t&&"function"===typeof t.then)try{var n=ha(t)}catch(a){if(a===Jr)throw $r;throw a}else n=t;var r=(t=la()).queue,s=r.dispatch;return i!==t.memoizedState&&(Hs.flags|=2048,Da(9,{destroy:void 0},Ia.bind(null,r,i),null)),[n,s,e]}function Ia(e,t){e.action=t}function La(e){var t=la(),i=js;if(null!==i)return Na(t,i,e);la(),t=t.memoizedState;var n=(i=la()).queue.dispatch;return i.memoizedState=e,[t,n,!1]}function Da(e,t,i,n){return e={tag:e,create:i,deps:n,inst:t,next:null},null===(t=Hs.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},Hs.updateQueue=t),null===(i=t.lastEffect)?t.lastEffect=e.next=e:(n=i.next,i.next=e,e.next=n,t.lastEffect=e),e}function Fa(){return la().memoizedState}function Ba(e,t,i,n){var r=oa();Hs.flags|=e,r.memoizedState=Da(1|t,{destroy:void 0},i,void 0===n?null:n)}function Ua(e,t,i,n){var r=la();n=void 0===n?null:n;var s=r.memoizedState.inst;null!==js&&null!==n&&$s(n,js.memoizedState.deps)?r.memoizedState=Da(t,s,i,n):(Hs.flags|=e,r.memoizedState=Da(1|t,s,i,n))}function za(e,t){Ba(8390656,8,e,t)}function Va(e,t){Ua(2048,8,e,t)}function Ha(e){var t=la().memoizedState;return function(e){Hs.flags|=4;var t=Hs.updateQueue;if(null===t)t={lastEffect:null,events:null,stores:null,memoCache:null},Hs.updateQueue=t,t.events=[e];else{var i=t.events;null===i?t.events=[e]:i.push(e)}}({ref:t,nextImpl:e}),function(){if(0!==(2&fh))throw Error(a(440));return t.impl.apply(void 0,arguments)}}function ja(e,t){return Ua(4,2,e,t)}function Ya(e,t){return Ua(4,4,e,t)}function Wa(e,t){if("function"===typeof t){e=e();var i=t(e);return function(){"function"===typeof i?i():t(null)}}if(null!==t&&void 0!==t)return e=e(),t.current=e,function(){t.current=null}}function Ga(e,t,i){i=null!==i&&void 0!==i?i.concat([e]):null,Ua(4,4,Wa.bind(null,t,e),i)}function Xa(){}function qa(e,t){var i=la();t=void 0===t?null:t;var n=i.memoizedState;return null!==t&&$s(t,n[1])?n[0]:(i.memoizedState=[e,t],e)}function Ka(e,t){var i=la();t=void 0===t?null:t;var n=i.memoizedState;if(null!==t&&$s(t,n[1]))return n[0];if(n=e(),Xs){xe(!0);try{e()}finally{xe(!1)}}return i.memoizedState=[n,t],n}function Qa(e,t,i){return void 0===i||0!==(1073741824&Vs)&&0===(261930&gh)?e.memoizedState=t:(e.memoizedState=i,e=Xh(),Hs.lanes|=e,Sh|=e,i)}function Ja(e,t,i,n){return Ji(i,t)?i:null!==As.current?(e=Qa(e,i,n),Ji(e,t)||(No=!0),e):0===(42&Vs)||0!==(1073741824&Vs)&&0===(261930&gh)?(No=!0,e.memoizedState=i):(e=Xh(),Hs.lanes|=e,Sh|=e,t)}function Za(e,t,i,n,r){var s=L.p;L.p=0!==s&&8>s?s:8;var a=I.T,o={};I.T=o,uo(e,!1,t,i);try{var l=r(),h=I.S;if(null!==h&&h(o,l),null!==l&&"object"===typeof l&&"function"===typeof l.then)ho(e,t,function(e,t){var i=[],n={status:"pending",value:null,reason:null,then:function(e){i.push(e)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var e=0;e<i.length;e++)(0,i[e])(t)},function(e){for(n.status="rejected",n.reason=e,e=0;e<i.length;e++)(0,i[e])(void 0)}),n}(l,n),Gh());else ho(e,t,n,Gh())}catch(u){ho(e,t,{then:function(){},status:"rejected",reason:u},Gh())}finally{L.p=s,null!==a&&null!==o.types&&(a.types=o.types),I.T=a}}function $a(){}function eo(e,t,i,n){if(5!==e.tag)throw Error(a(476));var r=to(e).queue;Za(e,r,t,D,null===i?$a:function(){return io(e),i(n)})}function to(e){var t=e.memoizedState;if(null!==t)return t;var i={};return(t={memoizedState:D,baseState:D,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:D},next:null}).next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:i},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function io(e){var t=to(e);null===t.next&&(t=e.alternate.memoizedState),ho(e,t.next.queue,{},Gh())}function no(){return Mr(ud)}function ro(){return la().memoizedState}function so(){return la().memoizedState}function ao(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var i=Gh(),n=xs(t,e=ys(i),i);return null!==n&&(qh(n,t,i),bs(n,t,i)),t={cache:Ur()},void(e.payload=t)}t=t.return}}function oo(e,t,i){var n=Gh();i={lane:n,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},co(e)?fo(t,i):null!==(i=Mn(e,t,i,n))&&(qh(i,e,n),po(i,t,n))}function lo(e,t,i){ho(e,t,i,Gh())}function ho(e,t,i,n){var r={lane:n,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(co(e))fo(t,r);else{var s=e.alternate;if(0===e.lanes&&(null===s||0===s.lanes)&&null!==(s=t.lastRenderedReducer))try{var a=t.lastRenderedState,o=s(a,i);if(r.hasEagerState=!0,r.eagerState=o,Ji(o,a))return Pn(e,t,r,0),null===ph&&On(),!1}catch(l){}if(null!==(i=Mn(e,t,r,n)))return qh(i,e,n),po(i,t,n),!0}return!1}function uo(e,t,i,n){if(n={lane:2,revertLane:Hu(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},co(e)){if(t)throw Error(a(479))}else null!==(t=Mn(e,i,n,2))&&qh(t,e,2)}function co(e){var t=e.alternate;return e===Hs||null!==t&&t===Hs}function fo(e,t){Gs=Ws=!0;var i=e.pending;null===i?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function po(e,t,i){if(0!==(4194048&i)){var n=t.lanes;i|=n&=e.pendingLanes,t.lanes=i,Ie(e,i)}}var mo={readContext:Mr,use:ua,useCallback:Zs,useContext:Zs,useEffect:Zs,useImperativeHandle:Zs,useLayoutEffect:Zs,useInsertionEffect:Zs,useMemo:Zs,useReducer:Zs,useRef:Zs,useState:Zs,useDebugValue:Zs,useDeferredValue:Zs,useTransition:Zs,useSyncExternalStore:Zs,useId:Zs,useHostTransitionStatus:Zs,useFormState:Zs,useActionState:Zs,useOptimistic:Zs,useMemoCache:Zs,useCacheRefresh:Zs};mo.useEffectEvent=Zs;var go={readContext:Mr,use:ua,useCallback:function(e,t){return oa().memoizedState=[e,void 0===t?null:t],e},useContext:Mr,useEffect:za,useImperativeHandle:function(e,t,i){i=null!==i&&void 0!==i?i.concat([e]):null,Ba(4194308,4,Wa.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Ba(4194308,4,e,t)},useInsertionEffect:function(e,t){Ba(4,2,e,t)},useMemo:function(e,t){var i=oa();t=void 0===t?null:t;var n=e();if(Xs){xe(!0);try{e()}finally{xe(!1)}}return i.memoizedState=[n,t],n},useReducer:function(e,t,i){var n=oa();if(void 0!==i){var r=i(t);if(Xs){xe(!0);try{i(t)}finally{xe(!1)}}}else r=t;return n.memoizedState=n.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},n.queue=e,e=e.dispatch=oo.bind(null,Hs,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},oa().memoizedState=e},useState:function(e){var t=(e=Ta(e)).queue,i=lo.bind(null,Hs,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Xa,useDeferredValue:function(e,t){return Qa(oa(),e,t)},useTransition:function(){var e=Ta(!1);return e=Za.bind(null,Hs,e.queue,!0,!1),oa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var n=Hs,r=oa();if(cr){if(void 0===i)throw Error(a(407));i=i()}else{if(i=t(),null===ph)throw Error(a(349));0!==(127&gh)||va(n,t,i)}r.memoizedState=i;var s={value:i,getSnapshot:t};return r.queue=s,za(xa.bind(null,n,s,e),[e]),n.flags|=2048,Da(9,{destroy:void 0},ya.bind(null,n,s,i,t),null),i},useId:function(){var e=oa(),t=ph.identifierPrefix;if(cr){var i=nr;t="_"+t+"R_"+(i=(ir&~(1<<32-be(ir)-1)).toString(32)+i),0<(i=qs++)&&(t+="H"+i.toString(32)),t+="_"}else t="_"+t+"r_"+(i=Js++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:no,useFormState:Pa,useActionState:Pa,useOptimistic:function(e){var t=oa();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=uo.bind(null,Hs,!0,i),i.dispatch=t,[e,t]},useMemoCache:ca,useCacheRefresh:function(){return oa().memoizedState=ao.bind(null,Hs)},useEffectEvent:function(e){var t=oa(),i={impl:e};return t.memoizedState=i,function(){if(0!==(2&fh))throw Error(a(440));return i.impl.apply(void 0,arguments)}}},vo={readContext:Mr,use:ua,useCallback:qa,useContext:Mr,useEffect:Va,useImperativeHandle:Ga,useInsertionEffect:ja,useLayoutEffect:Ya,useMemo:Ka,useReducer:fa,useRef:Fa,useState:function(){return fa(da)},useDebugValue:Xa,useDeferredValue:function(e,t){return Ja(la(),js.memoizedState,e,t)},useTransition:function(){var e=fa(da)[0],t=la().memoizedState;return["boolean"===typeof e?e:ha(e),t]},useSyncExternalStore:ga,useId:ro,useHostTransitionStatus:no,useFormState:Ma,useActionState:Ma,useOptimistic:function(e,t){return _a(la(),0,e,t)},useMemoCache:ca,useCacheRefresh:so};vo.useEffectEvent=Ha;var yo={readContext:Mr,use:ua,useCallback:qa,useContext:Mr,useEffect:Va,useImperativeHandle:Ga,useInsertionEffect:ja,useLayoutEffect:Ya,useMemo:Ka,useReducer:ma,useRef:Fa,useState:function(){return ma(da)},useDebugValue:Xa,useDeferredValue:function(e,t){var i=la();return null===js?Qa(i,e,t):Ja(i,js.memoizedState,e,t)},useTransition:function(){var e=ma(da)[0],t=la().memoizedState;return["boolean"===typeof e?e:ha(e),t]},useSyncExternalStore:ga,useId:ro,useHostTransitionStatus:no,useFormState:La,useActionState:La,useOptimistic:function(e,t){var i=la();
2return null!==js?_a(i,0,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:ca,useCacheRefresh:so};function xo(e,t,i,n){i=null===(i=i(n,t=e.memoizedState))||void 0===i?t:f({},t,i),e.memoizedState=i,0===e.lanes&&(e.updateQueue.baseState=i)}yo.useEffectEvent=Ha;var bo={enqueueSetState:function(e,t,i){e=e._reactInternals;var n=Gh(),r=ys(n);r.payload=t,void 0!==i&&null!==i&&(r.callback=i),null!==(t=xs(e,r,n))&&(qh(t,e,n),bs(t,e,n))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var n=Gh(),r=ys(n);r.tag=1,r.payload=t,void 0!==i&&null!==i&&(r.callback=i),null!==(t=xs(e,r,n))&&(qh(t,e,n),bs(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Gh(),n=ys(i);n.tag=2,void 0!==t&&null!==t&&(n.callback=t),null!==(t=xs(e,n,i))&&(qh(t,e,i),bs(t,e,i))}};function wo(e,t,i,n,r,s,a){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,s,a):!t.prototype||!t.prototype.isPureReactComponent||(!Zi(i,n)||!Zi(r,s))}function To(e,t,i,n){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(i,n),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(i,n),t.state!==e&&bo.enqueueReplaceState(t,t.state,null)}function _o(e,t){var i=t;if("ref"in t)for(var n in i={},t)"ref"!==n&&(i[n]=t[n]);if(e=e.defaultProps)for(var r in i===t&&(i=f({},i)),e)void 0===i[r]&&(i[r]=e[r]);return i}function So(e){Cn(e)}function Eo(e){console.error(e)}function Co(e){Cn(e)}function Ao(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function ko(e,t,i){try{(0,e.onCaughtError)(i.value,{componentStack:i.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Ro(e,t,i){return(i=ys(i)).tag=3,i.payload={element:null},i.callback=function(){Ao(e,t)},i}function Oo(e){return(e=ys(e)).tag=3,e}function Po(e,t,i,n){var r=i.type.getDerivedStateFromError;if("function"===typeof r){var s=n.value;e.payload=function(){return r(s)},e.callback=function(){ko(t,i,n)}}var a=i.stateNode;null!==a&&"function"===typeof a.componentDidCatch&&(e.callback=function(){ko(t,i,n),"function"!==typeof r&&(null===Dh?Dh=new Set([this]):Dh.add(this));var e=n.stack;this.componentDidCatch(n.value,{componentStack:null!==e?e:""})})}var Mo=Error(a(461)),No=!1;function Io(e,t,i,n){t.child=null===e?ps(t,null,i,n):fs(t,e.child,i,n)}function Lo(e,t,i,n,r){i=i.render;var s=t.ref;if("ref"in n){var a={};for(var o in n)"ref"!==o&&(a[o]=n[o])}else a=n;return Pr(t),n=ea(e,t,i,a,s,r),o=ra(),null===e||No?(cr&&o&&ar(t),t.flags|=1,Io(e,t,n,r),t.child):(sa(e,t,r),rl(e,t,r))}function Do(e,t,i,n,r){if(null===e){var s=i.type;return"function"!==typeof s||Un(s)||void 0!==s.defaultProps||null!==i.compare?((e=Hn(i.type,null,n,t,t.mode,r)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=s,Fo(e,t,s,n,r))}if(s=e.child,!sl(e,r)){var a=s.memoizedProps;if((i=null!==(i=i.compare)?i:Zi)(a,n)&&e.ref===t.ref)return rl(e,t,r)}return t.flags|=1,(e=zn(s,n)).ref=t.ref,e.return=t,t.child=e}function Fo(e,t,i,n,r){if(null!==e){var s=e.memoizedProps;if(Zi(s,n)&&e.ref===t.ref){if(No=!1,t.pendingProps=n=s,!sl(e,r))return t.lanes=e.lanes,rl(e,t,r);0!==(131072&e.flags)&&(No=!0)}}return Yo(e,t,i,n,r)}function Bo(e,t,i,n){var r=n.children,s=null!==e?e.memoizedState:null;if(null===e&&null===t.stateNode&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===n.mode){if(0!==(128&t.flags)){if(s=null!==s?s.baseLanes|i:i,null!==e){for(n=t.child=e.child,r=0;null!==n;)r=r|n.lanes|n.childLanes,n=n.sibling;n=r&~s}else n=0,t.child=null;return zo(e,t,s,i,n)}if(0===(536870912&i))return n=t.lanes=536870912,zo(e,t,null!==s?s.baseLanes|i:i,i,n);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&Kr(0,null!==s?s.cachePool:null),null!==s?Rs(t,s):Os(),Ds(t)}else null!==s?(Kr(0,s.cachePool),Rs(t,s),Fs(),t.memoizedState=null):(null!==e&&Kr(0,null),Os(),Fs());return Io(e,t,r,i),t.child}function Uo(e,t){return null!==e&&22===e.tag||null!==t.stateNode||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function zo(e,t,i,n,r){var s=qr();return s=null===s?null:{parent:Br._currentValue,pool:s},t.memoizedState={baseLanes:i,cachePool:s},null!==e&&Kr(0,null),Os(),Ds(t),null!==e&&Rr(e,t,n,!0),t.childLanes=r,null}function Vo(e,t){return(t=$o({mode:t.mode,children:t.children},e.mode)).ref=e.ref,e.child=t,t.return=e,t}function Ho(e,t,i){return fs(t,e.child,null,i),(e=Vo(t,t.pendingProps)).flags|=2,Bs(t),t.memoizedState=null,e}function jo(e,t){var i=t.ref;if(null===i)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!==typeof i&&"object"!==typeof i)throw Error(a(284));null!==e&&e.ref===i||(t.flags|=4194816)}}function Yo(e,t,i,n,r){return Pr(t),i=ea(e,t,i,n,void 0,r),n=ra(),null===e||No?(cr&&n&&ar(t),t.flags|=1,Io(e,t,i,r),t.child):(sa(e,t,r),rl(e,t,r))}function Wo(e,t,i,n,r,s){return Pr(t),t.updateQueue=null,i=ia(t,n,i,r),ta(e),n=ra(),null===e||No?(cr&&n&&ar(t),t.flags|=1,Io(e,t,i,s),t.child):(sa(e,t,s),rl(e,t,s))}function Go(e,t,i,n,r){if(Pr(t),null===t.stateNode){var s=Dn,a=i.contextType;"object"===typeof a&&null!==a&&(s=Mr(a)),s=new i(n,s),t.memoizedState=null!==s.state&&void 0!==s.state?s.state:null,s.updater=bo,t.stateNode=s,s._reactInternals=t,(s=t.stateNode).props=n,s.state=t.memoizedState,s.refs={},gs(t),a=i.contextType,s.context="object"===typeof a&&null!==a?Mr(a):Dn,s.state=t.memoizedState,"function"===typeof(a=i.getDerivedStateFromProps)&&(xo(t,i,a,n),s.state=t.memoizedState),"function"===typeof i.getDerivedStateFromProps||"function"===typeof s.getSnapshotBeforeUpdate||"function"!==typeof s.UNSAFE_componentWillMount&&"function"!==typeof s.componentWillMount||(a=s.state,"function"===typeof s.componentWillMount&&s.componentWillMount(),"function"===typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount(),a!==s.state&&bo.enqueueReplaceState(s,s.state,null),Ss(t,n,s,r),_s(),s.state=t.memoizedState),"function"===typeof s.componentDidMount&&(t.flags|=4194308),n=!0}else if(null===e){s=t.stateNode;var o=t.memoizedProps,l=_o(i,o);s.props=l;var h=s.context,u=i.contextType;a=Dn,"object"===typeof u&&null!==u&&(a=Mr(u));var c=i.getDerivedStateFromProps;u="function"===typeof c||"function"===typeof s.getSnapshotBeforeUpdate,o=t.pendingProps!==o,u||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(o||h!==a)&&To(t,s,n,a),ms=!1;var d=t.memoizedState;s.state=d,Ss(t,n,s,r),_s(),h=t.memoizedState,o||d!==h||ms?("function"===typeof c&&(xo(t,i,c,n),h=t.memoizedState),(l=ms||wo(t,i,l,n,d,h,a))?(u||"function"!==typeof s.UNSAFE_componentWillMount&&"function"!==typeof s.componentWillMount||("function"===typeof s.componentWillMount&&s.componentWillMount(),"function"===typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"===typeof s.componentDidMount&&(t.flags|=4194308)):("function"===typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=h),s.props=n,s.state=h,s.context=a,n=l):("function"===typeof s.componentDidMount&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,vs(e,t),u=_o(i,a=t.memoizedProps),s.props=u,c=t.pendingProps,d=s.context,h=i.contextType,l=Dn,"object"===typeof h&&null!==h&&(l=Mr(h)),(h="function"===typeof(o=i.getDerivedStateFromProps)||"function"===typeof s.getSnapshotBeforeUpdate)||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(a!==c||d!==l)&&To(t,s,n,l),ms=!1,d=t.memoizedState,s.state=d,Ss(t,n,s,r),_s();var f=t.memoizedState;
vendor: 10,177 bytes, line 2
2a!==c||d!==f||ms||null!==e&&null!==e.dependencies&&Or(e.dependencies)?("function"===typeof o&&(xo(t,i,o,n),f=t.memoizedState),(u=ms||wo(t,i,u,n,d,f,l)||null!==e&&null!==e.dependencies&&Or(e.dependencies))?(h||"function"!==typeof s.UNSAFE_componentWillUpdate&&"function"!==typeof s.componentWillUpdate||("function"===typeof s.componentWillUpdate&&s.componentWillUpdate(n,f,l),"function"===typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(n,f,l)),"function"===typeof s.componentDidUpdate&&(t.flags|=4),"function"===typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof s.componentDidUpdate||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=f),s.props=n,s.state=f,s.context=l,n=u):("function"!==typeof s.componentDidUpdate||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),n=!1)}return s=n,jo(e,t),n=0!==(128&t.flags),s||n?(s=t.stateNode,i=n&&"function"!==typeof i.getDerivedStateFromError?null:s.render(),t.flags|=1,null!==e&&n?(t.child=fs(t,e.child,null,r),t.child=fs(t,null,i,r)):Io(e,t,i,r),t.memoizedState=s.state,e=t.child):e=rl(e,t,r),e}function Xo(e,t,i,n){return xr(),t.flags|=256,Io(e,t,i,n),t.child}var qo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ko(e){return{baseLanes:e,cachePool:Qr()}}function Qo(e,t,i){return e=null!==e?e.childLanes&~i:0,t&&(e|=Ah),e}function Jo(e,t,i){var n,r=t.pendingProps,s=!1,o=0!==(128&t.flags);if((n=o)||(n=(null===e||null!==e.memoizedState)&&0!==(2&Us.current)),n&&(s=!0,t.flags&=-129),n=0!==(32&t.flags),t.flags&=-33,null===e){if(cr){if(s?Is(t):Fs(),(e=ur)?null!==(e=null!==(e=Oc(e,fr))&&"&"!==e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==tr?{id:ir,overflow:nr}:null,retryLane:536870912,hydrationErrors:null},(i=Wn(e)).return=t,t.child=i,hr=t,ur=null):e=null,null===e)throw mr(t);return Mc(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,s?(Fs(),l=$o({mode:"hidden",children:l},s=t.mode),r=jn(r,s,i,null),l.return=t,r.return=t,l.sibling=r,t.child=l,(r=t.child).memoizedState=Ko(i),r.childLanes=Qo(e,n,i),t.memoizedState=qo,Uo(null,r)):(Is(t),Zo(t,l))}var h=e.memoizedState;if(null!==h&&null!==(l=h.dehydrated)){if(o)256&t.flags?(Is(t),t.flags&=-257,t=el(e,t,i)):null!==t.memoizedState?(Fs(),t.child=e.child,t.flags|=128,t=null):(Fs(),l=r.fallback,s=t.mode,r=$o({mode:"visible",children:r.children},s),(l=jn(l,s,i,null)).flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,fs(t,e.child,null,i),(r=t.child).memoizedState=Ko(i),r.childLanes=Qo(e,n,i),t.memoizedState=qo,t=Uo(null,r));else if(Is(t),Mc(l)){if(n=l.nextSibling&&l.nextSibling.dataset)var u=n.dgst;n=u,(r=Error(a(419))).stack="",r.digest=n,wr({value:r,source:null,stack:null}),t=el(e,t,i)}else if(No||Rr(e,t,i,!1),n=0!==(i&e.childLanes),No||n){if(null!==(n=ph)&&(0!==(r=Le(n,i))&&r!==h.retryLane))throw h.retryLane=r,Nn(e,r),qh(n,e,r),Mo;Pc(l)||au(),t=el(e,t,i)}else Pc(l)?(t.flags|=192,t.child=e.child,t=null):(e=h.treeContext,ur=Nc(l.nextSibling),hr=t,cr=!0,dr=null,fr=!1,null!==e&&lr(t,e),(t=Zo(t,r.children)).flags|=4096);return t}return s?(Fs(),l=r.fallback,s=t.mode,u=(h=e.child).sibling,(r=zn(h,{mode:"hidden",children:r.children})).subtreeFlags=65011712&h.subtreeFlags,null!==u?l=zn(u,l):(l=jn(l,s,i,null)).flags|=2,l.return=t,r.return=t,r.sibling=l,t.child=r,Uo(null,r),r=t.child,null===(l=e.child.memoizedState)?l=Ko(i):(null!==(s=l.cachePool)?(h=Br._currentValue,s=s.parent!==h?{parent:h,pool:h}:s):s=Qr(),l={baseLanes:l.baseLanes|i,cachePool:s}),r.memoizedState=l,r.childLanes=Qo(e,n,i),t.memoizedState=qo,Uo(e.child,r)):(Is(t),e=(i=e.child).sibling,(i=zn(i,{mode:"visible",children:r.children})).return=t,i.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i)}function Zo(e,t){return(t=$o({mode:"visible",children:t},e.mode)).return=e,e.child=t}function $o(e,t){return(e=Bn(22,e,null,t)).lanes=0,e}function el(e,t,i){return fs(t,e.child,null,i),(e=Zo(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function tl(e,t,i){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),Ar(e.return,t,i)}function il(e,t,i,n,r,s){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:i,tailMode:r,treeForkCount:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=i,a.tailMode=r,a.treeForkCount=s)}function nl(e,t,i){var n=t.pendingProps,r=n.revealOrder,s=n.tail;n=n.children;var a=Us.current,o=0!==(2&a);if(o?(a=1&a|2,t.flags|=128):a&=1,V(Us,a),Io(e,t,n,i),n=cr?Zn:0,!o&&null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&tl(e,i,t);else if(19===e.tag)tl(e,i,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(i=t.child,r=null;null!==i;)null!==(e=i.alternate)&&null===zs(e)&&(r=i),i=i.sibling;null===(i=r)?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),il(t,!1,r,i,s,n);break;case"backwards":case"unstable_legacy-backwards":for(i=null,r=t.child,t.child=null;null!==r;){if(null!==(e=r.alternate)&&null===zs(e)){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}il(t,!0,i,null,s,n);break;case"together":il(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function rl(e,t,i){if(null!==e&&(t.dependencies=e.dependencies),Sh|=t.lanes,0===(i&t.childLanes)){if(null===e)return null;if(Rr(e,t,i,!1),0===(i&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(i=zn(e=t.child,e.pendingProps),t.child=i,i.return=t;null!==e.sibling;)e=e.sibling,(i=i.sibling=zn(e,e.pendingProps)).return=t;i.sibling=null}return t.child}function sl(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!Or(e))}function al(e,t,i){if(null!==e)if(e.memoizedProps!==t.pendingProps)No=!0;else{if(!sl(e,i)&&0===(128&t.flags))return No=!1,function(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),Er(0,Br,e.memoizedState.cache),xr();break;case 27:case 5:Q(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:Er(0,t.type,t.memoizedProps.value);break;case 31:if(null!==t.memoizedState)return t.flags|=128,Ls(t),null;break;case 13:var n=t.memoizedState;if(null!==n)return null!==n.dehydrated?(Is(t),t.flags|=128,null):0!==(i&t.child.childLanes)?Jo(e,t,i):(Is(t),null!==(e=rl(e,t,i))?e.sibling:null);Is(t);break;case 19:var r=0!==(128&e.flags);if((n=0!==(i&t.childLanes))||(Rr(e,t,i,!1),n=0!==(i&t.childLanes)),r){if(n)return nl(e,t,i);t.flags|=128}if(null!==(r=t.memoizedState)&&(r.rendering=null,r.tail=null,r.lastEffect=null),V(Us,Us.current),n)break;return null;case 22:return t.lanes=0,Bo(e,t,i,t.pendingProps);case 24:Er(0,Br,e.memoizedState.cache)}return rl(e,t,i)}(e,t,i);No=0!==(131072&e.flags)}else No=!1,cr&&0!==(1048576&t.flags)&&sr(t,Zn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=ns(t.elementType),t.type=e,"function"!==typeof e){if(void 0!==e&&null!==e){var r=e.$$typeof;if(r===T){t.tag=11,t=Lo(null,t,e,n,i);break e}if(r===E){t.tag=14,t=Do(null,t,e,n,i);break e}}throw t=M(e)||e,Error(a(306,t,""))}Un(e)?(n=_o(e,n),t.tag=1,t=Go(null,t,e,n,i)):(t.tag=0,t=Yo(null,t,e,n,i))}return t;case 0:return Yo(e,t,t.type,t.pendingProps,i);case 1:return Go(e,t,n=t.type,r=_o(n,t.pendingProps),i);case 3:e:{if(q(t,t.stateNode.containerInfo),null===e)throw Error(a(387));n=t.pendingProps;var s=t.memoizedState;r=s.element,vs(e,t),Ss(t,n,null,i);var o=t.memoizedState;if(n=o.cache,Er(0,Br,n),n!==s.cache&&kr(t,[Br],i,!0),_s(),n=o.element,s.isDehydrated){if(s={element:n,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=s,t.memoizedState=s,256&t.flags){t=Xo(e,t,n,i);break e}if(n!==r){wr(r=qn(Error(a(424)),t)),t=Xo(e,t,n,i);break e}if(9===(e=t.stateNode.containerInfo).nodeType)e=e.body;else e="HTML"===e.nodeName?e.ownerDocument.body:e;for(ur=Nc(e.firstChild),hr=t,cr=!0,dr=null,fr=!0,i=ps(t,null,n,i),t.child=i;i;)i.flags=-3&i.flags|4096,i=i.sibling}else{if(xr(),n===r){t=rl(e,t,i);break e}Io(e,t,n,i)}t=t.child}return t;case 26:return jo(e,t),null===e?(i=Wc(t.type,null,t.pendingProps,null))?t.memoizedState=i:cr||(i=t.type,e=t.pendingProps,(n=gc(G.current).createElement(i))[Ve]=t,n[He]=e,dc(n,i,e),et(n),t.stateNode=n):t.memoizedState=Wc(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Q(t),null===e&&cr&&(n=t.stateNode=Fc(t.type,t.pendingProps,G.current),hr=t,fr=!0,r=ur,Cc(t.type)?(Ic=r,ur=Nc(n.firstChild)):ur=r),Io(e,t,t.pendingProps.children,i),jo(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&cr&&((r=n=ur)&&(null!==(n=function(e,t,i,n){for(;1===e.nodeType;){var r=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(n){if(!e[qe])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(s=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(s!==r.rel||e.getAttribute("href")!==(null==r.href||""===r.href?null:r.href)||e.getAttribute("crossorigin")!==(null==r.crossOrigin?null:r.crossOrigin)||e.getAttribute("title")!==(null==r.title?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((s=e.getAttribute("src"))!==(null==r.src?null:r.src)||e.getAttribute("type")!==(null==r.type?null:r.type)||e.getAttribute("crossorigin")!==(null==r.crossOrigin?null:r.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var s=null==r.name?null:""+r.name;if("hidden"===r.type&&e.getAttribute("name")===s)return e}if(null===(e=Nc(e.nextSibling)))break}return null}(n,t.type,t.pendingProps,fr))?(t.stateNode=n,hr=t,ur=Nc(n.firstChild),fr=!1,r=!0):r=!1),r||mr(t)),Q(t),r=t.type,s=t.pendingProps,o=null!==e?e.memoizedProps:null,n=s.
vendor: 4,173 bytes, line 2
2children,xc(r,s)?n=null:null!==o&&xc(r,o)&&(t.flags|=32),null!==t.memoizedState&&(r=ea(e,t,na,null,null,i),ud._currentValue=r),jo(e,t),Io(e,t,n,i),t.child;case 6:return null===e&&cr&&((e=i=ur)&&(null!==(i=function(e,t,i){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!i)return null;if(null===(e=Nc(e.nextSibling)))return null}return e}(i,t.pendingProps,fr))?(t.stateNode=i,hr=t,ur=null,e=!0):e=!1),e||mr(t)),null;case 13:return Jo(e,t,i);case 4:return q(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=fs(t,null,n,i):Io(e,t,n,i),t.child;case 11:return Lo(e,t,t.type,t.pendingProps,i);case 7:return Io(e,t,t.pendingProps,i),t.child;case 8:case 12:return Io(e,t,t.pendingProps.children,i),t.child;case 10:return n=t.pendingProps,Er(0,t.type,n.value),Io(e,t,n.children,i),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,Pr(t),n=n(r=Mr(r)),t.flags|=1,Io(e,t,n,i),t.child;case 14:return Do(e,t,t.type,t.pendingProps,i);case 15:return Fo(e,t,t.type,t.pendingProps,i);case 19:return nl(e,t,i);case 31:return function(e,t,i){var n=t.pendingProps,r=0!==(128&t.flags);if(t.flags&=-129,null===e){if(cr){if("hidden"===n.mode)return e=Vo(t,n),t.lanes=536870912,Uo(null,e);if(Ls(t),(e=ur)?null!==(e=null!==(e=Oc(e,fr))&&"&"===e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==tr?{id:ir,overflow:nr}:null,retryLane:536870912,hydrationErrors:null},(i=Wn(e)).return=t,t.child=i,hr=t,ur=null):e=null,null===e)throw mr(t);return t.lanes=536870912,null}return Vo(t,n)}var s=e.memoizedState;if(null!==s){var o=s.dehydrated;if(Ls(t),r)if(256&t.flags)t.flags&=-257,t=Ho(e,t,i);else{if(null===t.memoizedState)throw Error(a(558));t.child=e.child,t.flags|=128,t=null}else if(No||Rr(e,t,i,!1),r=0!==(i&e.childLanes),No||r){if(null!==(n=ph)&&0!==(o=Le(n,i))&&o!==s.retryLane)throw s.retryLane=o,Nn(e,o),qh(n,e,o),Mo;au(),t=Ho(e,t,i)}else e=s.treeContext,ur=Nc(o.nextSibling),hr=t,cr=!0,dr=null,fr=!1,null!==e&&lr(t,e),(t=Vo(t,n)).flags|=4096;return t}return(e=zn(e.child,{mode:n.mode,children:n.children})).ref=t.ref,t.child=e,e.return=t,e}(e,t,i);case 22:return Bo(e,t,i,t.pendingProps);case 24:return Pr(t),n=Mr(Br),null===e?(null===(r=qr())&&(r=ph,s=Ur(),r.pooledCache=s,s.refCount++,null!==s&&(r.pooledCacheLanes|=i),r=s),t.memoizedState={parent:n,cache:r},gs(t),Er(0,Br,r)):(0!==(e.lanes&i)&&(vs(e,t),Ss(t,null,null,i),_s()),r=e.memoizedState,s=t.memoizedState,r.parent!==n?(r={parent:n,cache:n},t.memoizedState=r,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=r),Er(0,Br,n)):(n=s.cache,Er(0,Br,n),n!==r.cache&&kr(t,[Br],i,!0))),Io(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function ol(e){e.flags|=4}function ll(e,t,i,n,r){if((t=0!==(32&e.mode))&&(t=!1),t){if(e.flags|=16777216,(335544128&r)===r)if(e.stateNode.complete)e.flags|=8192;else{if(!nu())throw rs=es,Zr;e.flags|=8192}}else e.flags&=-16777217}function hl(e,t){if("stylesheet"!==t.type||0!==(4&t.state.loading))e.flags&=-16777217;else if(e.flags|=16777216,!rd(t)){if(!nu())throw rs=es,Zr;e.flags|=8192}}function ul(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?Oe():536870912,e.lanes|=t,kh|=t)}function cl(e,t){if(!cr)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;null!==t;)null!==t.alternate&&(i=t),t=t.sibling;null===i?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var n=null;null!==i;)null!==i.alternate&&(n=i),i=i.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function dl(e){var t=null!==e.alternate&&e.alternate.child===e.child,i=0,n=0;if(t)for(var r=e.child;null!==r;)i|=r.lanes|r.childLanes,n|=65011712&r.subtreeFlags,n|=65011712&r.flags,r.return=e,r=r.sibling;else for(r=e.child;null!==r;)i|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=n,e.childLanes=i,t}function fl(e,t,i){var n=t.pendingProps;switch(or(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return dl(t),null;case 3:return i=t.stateNode,n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Cr(Br),K(),i.pe
vendor: 38,384 bytes, line 2
2ndingContext&&(i.context=i.pendingContext,i.pendingContext=null),null!==e&&null!==e.child||(yr(t)?ol(t):null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,br())),dl(t),null;case 26:var r=t.type,s=t.memoizedState;return null===e?(ol(t),null!==s?(dl(t),hl(t,s)):(dl(t),ll(t,r,0,0,i))):s?s!==e.memoizedState?(ol(t),dl(t),hl(t,s)):(dl(t),t.flags&=-16777217):((e=e.memoizedProps)!==n&&ol(t),dl(t),ll(t,r,0,0,i)),null;case 27:if(J(t),i=G.current,r=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==n&&ol(t);else{if(!n){if(null===t.stateNode)throw Error(a(166));return dl(t),null}e=Y.current,yr(t)?gr(t):(e=Fc(r,n,i),t.stateNode=e,ol(t))}return dl(t),null;case 5:if(J(t),r=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==n&&ol(t);else{if(!n){if(null===t.stateNode)throw Error(a(166));return dl(t),null}if(s=Y.current,yr(t))gr(t);else{var o=gc(G.current);switch(s){case 1:s=o.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:s=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":s=o.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":s=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":(s=o.createElement("div")).innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s="string"===typeof n.is?o.createElement("select",{is:n.is}):o.createElement("select"),n.multiple?s.multiple=!0:n.size&&(s.size=n.size);break;default:s="string"===typeof n.is?o.createElement(r,{is:n.is}):o.createElement(r)}}s[Ve]=t,s[He]=n;e:for(o=t.child;null!==o;){if(5===o.tag||6===o.tag)s.appendChild(o.stateNode);else if(4!==o.tag&&27!==o.tag&&null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;null===o.sibling;){if(null===o.return||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=s;e:switch(dc(s,r,n),r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&ol(t)}}return dl(t),ll(t,t.type,null===e||e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==n&&ol(t);else{if("string"!==typeof n&&null===t.stateNode)throw Error(a(166));if(e=G.current,yr(t)){if(e=t.stateNode,i=t.memoizedProps,n=null,null!==(r=hr))switch(r.tag){case 27:case 5:n=r.memoizedProps}e[Ve]=t,(e=!!(e.nodeValue===i||null!==n&&!0===n.suppressHydrationWarning||hc(e.nodeValue,i)))||mr(t,!0)}else(e=gc(e).createTextNode(n))[Ve]=t,t.stateNode=e}return dl(t),null;case 31:if(i=t.memoizedState,null===e||null!==e.memoizedState){if(n=yr(t),null!==i){if(null===e){if(!n)throw Error(a(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(a(557));e[Ve]=t}else xr(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;dl(t),e=!1}else i=br(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return 256&t.flags?(Bs(t),t):(Bs(t),null);if(0!==(128&t.flags))throw Error(a(558))}return dl(t),null;case 13:if(n=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(r=yr(t),null!==n&&null!==n.dehydrated){if(null===e){if(!r)throw Error(a(318));if(!(r=null!==(r=t.memoizedState)?r.dehydrated:null))throw Error(a(317));r[Ve]=t}else xr(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;dl(t),r=!1}else r=br(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return 256&t.flags?(Bs(t),t):(Bs(t),null)}return Bs(t),0!==(128&t.flags)?(t.lanes=i,t):(i=null!==n,e=null!==e&&null!==e.memoizedState,i&&(r=null,null!==(n=t.child).alternate&&null!==n.alternate.memoizedState&&null!==n.alternate.memoizedState.cachePool&&(r=n.alternate.memoizedState.cachePool.pool),s=null,null!==n.memoizedState&&null!==n.memoizedState.cachePool&&(s=n.memoizedState.cachePool.pool),s!==r&&(n.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),ul(t,t.updateQueue),dl(t),null);case 4:return K(),null===e&&$u(t.stateNode.containerInfo),dl(t),null;case 10:return Cr(t.type),dl(t),null;case 19:if(z(Us),null===(n=t.memoizedState))return dl(t),null;if(r=0!==(128&t.flags),null===(s=n.rendering))if(r)cl(n,!1);else{if(0!==_h||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(s=zs(e))){for(t.flags|=128,cl(n,!1),e=s.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=i,i=t.child;null!==i;)Vn(i,e),i=i.sibling;return V(Us,1&Us.current|2),cr&&rr(t,n.treeForkCount),t.child}e=e.sibling}null!==n.tail&&le()>Ih&&(t.flags|=128,r=!0,cl(n,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=zs(s))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),cl(n,!0),null===n.tail&&"hidden"===n.tailMode&&!s.alternate&&!cr)return dl(t),null}else 2*le()-n.renderingStartTime>Ih&&536870912!==i&&(t.flags|=128,r=!0,cl(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=n.last)?e.sibling=s:t.child=s,n.last=s)}return null!==n.tail?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=le(),e.sibling=null,i=Us.current,V(Us,r?1&i|2:1&i),cr&&rr(t,n.treeForkCount),e):(dl(t),null);case 22:case 23:return Bs(t),Ps(),n=null!==t.memoizedState,null!==e?null!==e.memoizedState!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?0!==(536870912&i)&&0===(128&t.flags)&&(dl(t),6&t.subtreeFlags&&(t.flags|=8192)):dl(t),null!==(i=t.updateQueue)&&ul(t,i.retryQueue),i=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(i=e.memoizedState.cachePool.pool),n=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(n=t.memoizedState.cachePool.pool),n!==i&&(t.flags|=2048),null!==e&&z(Xr),null;case 24:return i=null,null!==e&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Cr(Br),dl(t),null;case 25:case 30:return null}throw Error(a(156,t.tag))}function pl(e,t){switch(or(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Cr(Br),K(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return J(t),null;case 31:if(null!==t.memoizedState){if(Bs(t),null===t.alternate)throw Error(a(340));xr()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Bs(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));xr()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return z(Us),null;case 4:return K(),null;case 10:return Cr(t.type),null;case 22:case 23:return Bs(t),Ps(),null!==e&&z(Xr),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return Cr(Br),null;default:return null}}function ml(e,t){switch(or(t),t.tag){case 3:Cr(Br),K();break;case 26:case 27:case 5:J(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Bs(t);break;case 13:Bs(t);break;case 19:z(Us);break;case 10:Cr(t.type);break;case 22:case 23:Bs(t),Ps(),null!==e&&z(Xr);break;case 24:Cr(Br)}}function gl(e,t){try{var i=t.updateQueue,n=null!==i?i.lastEffect:null;if(null!==n){var r=n.next;i=r;do{if((i.tag&e)===e){n=void 0;var s=i.create,a=i.inst;n=s(),a.destroy=n}i=i.next}while(i!==r)}}catch(o){_u(t,t.return,o)}}function vl(e,t,i){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var s=r.next;n=s;do{if((n.tag&e)===e){var a=n.inst,o=a.destroy;if(void 0!==o){a.destroy=void 0,r=t;var l=i,h=o;try{h()}catch(u){_u(r,l,u)}}}n=n.next}while(n!==s)}}catch(u){_u(t,t.return,u)}}function yl(e){var t=e.updateQueue;if(null!==t){var i=e.stateNode;try{Cs(t,i)}catch(n){_u(e,e.return,n)}}}function xl(e,t,i){i.props=_o(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(n){_u(e,t,n)}}function bl(e,t){try{var i=e.ref;if(null!==i){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;default:n=e.stateNode}"function"===typeof i?e.refCleanup=i(n):i.current=n}}catch(r){_u(e,t,r)}}function wl(e,t){var i=e.ref,n=e.refCleanup;if(null!==i)if("function"===typeof n)try{n()}catch(r){_u(e,t,r)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"===typeof i)try{i(null)}catch(s){_u(e,t,s)}else i.current=null}function Tl(e){var t=e.type,i=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&n.focus();break e;case"img":i.src?n.src=i.src:i.srcSet&&(n.srcset=i.srcSet)}}catch(r){_u(e,e.return,r)}}function _l(e,t,i){try{var n=e.stateNode;!function(e,t,i,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,s=null,o=null,l=null,h=null,u=null,c=null;for(p in i){var d=i[p];if(i.hasOwnProperty(p)&&null!=d)switch(p){case"checked":case"value":break;case"defaultValue":h=d;default:n.hasOwnProperty(p)||uc(e,t,p,null,n,d)}}for(var f in n){var p=n[f];if(d=i[f],n.hasOwnProperty(f)&&(null!=p||null!=d))switch(f){case"type":s=p;break;case"name":r=p;break;case"checked":u=p;break;case"defaultChecked":c=p;break;case"value":o=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(a(137,t));break;default:p!==d&&uc(e,t,f,p,n,d)}}return void yt(e,o,l,h,u,c,s,r);case"select":for(s in p=o=l=f=null,i)if(h=i[s],i.hasOwnProperty(s)&&null!=h)switch(s){case"value":break;case"multiple":p=h;default:n.hasOwnProperty(s)||uc(e,t,s,null,n,h)}for(r in n)if(s=n[r],h=i[r],n.hasOwnProperty(r)&&(null!=s||null!=h))switch(r){case"value":f=s;break;case"defaultValue":l=s;break;case"multiple":o=s;default:s!==h&&uc(e,t,r,s,n,h)}return t=l,i=o,n=p,void(null!=f?wt(e,!!i,f,!1):!!n!==!!i&&(null!=t?wt(e,!!i,t,!0):wt(e,!!i,i?[]:"",!1)));case"textarea":for(l in p=f=null,i)if(r=i[l],i.hasOwnProperty(l)&&null!=r&&!n.hasOwnProperty(l))switch(l){case"value":case"children":break;default:uc(e,t,l,null,n,r)}for(o in n)if(r=n[o],s=i[o],n.hasOwnProperty(o)&&(null!=r||null!=s))switch(o){case"value":f=r;break;case"defaultValue":p=r;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=r)throw Error(a(91));break;default:r!==s&&uc(e,t,o,r,n,s)}return void Tt(e,f,p);case"option":for(var m in i)if(f=i[m],i.hasOwnProperty(m)&&null!=f&&!n.hasOwnProperty(m))if("selected"===m)e.selected=!1;else uc(e,t,m,null,n,f);for(h in n)if(f=n[h],p=i[h],n.hasOwnProperty(h)&&f!==p&&(null!=f||null!=p))if("selected"===h)e.selected=f&&"function"!==typeof f&&"symbol"!==typeof f;else uc(e,t,h,f,n,p);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in i)f=i[g],i.hasOwnProperty(g)&&null!=f&&!n.hasOwnProperty(g)&&uc(e,t,g,null,n,f);for(u in n)if(f=n[u],p=i[u],n.hasOwnProperty(u)&&f!==p&&(null!=f||null!=p))switch(u){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(a(137,t));break;default:uc(e,t,u,f,n,p)}return;default:if(kt(t)){for(var v in i)f=i[v],i.hasOwnProperty(v)&&void 0!==f&&!n.hasOwnProperty(v)&&cc(e,t,v,void 0,n,f);for(c in n)f=n[c],p=i[c],!n.hasOwnProperty(c)||f===p||void 0===f&&void 0===p||cc(e,t,c,f,n,p);return}}for(var y in i)f=i[y],i.hasOwnProperty(y)&&null!=f&&!n.hasOwnProperty(y)&&uc(e,t,y,null,n,f);for(d in n)f=n[d],p=i[d],!n.hasOwnProperty(d)||f===p||null==f&&null==p||uc(e,t,d,f,n,p)}(n,e.type,i,t),n[He]=t}catch(r){_u(e,e.return,r)}}function Sl(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&Cc(e.type)||4===e.tag}function El(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Sl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&Cc(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Cl(e,t,i){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?(9===i.nodeType?i.body:"HTML"===i.nodeName?i.ownerDocument.body:i).insertBefore(e,t):((t=9===i.nodeType?i.body:"HTML"===i.nodeName?i.ownerDocument.body:i).appendChild(e),null!==(i=i._reactRootContainer)&&void 0!==i||null!==t.onclick||(t.onclick=Mt));else if(4!==n&&(27===n&&Cc(e.type)&&(i=e.stateNode,t=null),null!==(e=e.child)))for(Cl(e,t,i),e=e.sibling;null!==e;)Cl(e,t,i),e=e.sibling}function Al(e,t,i){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(4!==n&&(27===n&&Cc(e.type)&&(i=e.stateNode),null!==(e=e.child)))for(Al(e,t,i),e=e.sibling;null!==e;)Al(e,t,i),e=e.sibling}function kl(e){var t=e.stateNode,i=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);dc(t,n,i),t[Ve]=e,t[He]=i}catch(s){_u(e,e.return,s)}}var Rl=!1,Ol=!1,Pl=!1,Ml="function"===typeof WeakSet?WeakSet:Set,Nl=null;function Il(e,t,i){var n=i.flags;switch(i.tag){case 0:case 11:case 15:ql(e,i),4&n&&gl(5,i);break;case 1:if(ql(e,i),4&n)if(e=i.stateNode,null===t)try{e.componentDidMount()}catch(a){_u(i,i.return,a)}else{var r=_o(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){_u(i,i.return,o)}}64&n&&yl(i),512&n&&bl(i,i.return);break;case 3:if(ql(e,i),64&n&&null!==(e=i.updateQueue)){if(t=null,null!==i.child)switch(i.child.tag){case 27:case 5:case 1:t=i.child.stateNode}try{Cs(e,t)}catch(a){_u(i,i.return,a)}}break;case 27:null===t&&4&n&&kl(i);case 26:case 5:ql(e,i),null===t&&4&n&&Tl(i),512&n&&bl(i,i.return);break;case 12:ql(e,i);break;case 31:ql(e,i),4&n&&zl(e,i);break;case 13:ql(e,i),4&n&&Vl(e,i),64&n&&(null!==(e=i.memoizedState)&&(null!==(e=e.dehydrated)&&function(e,t){var i=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==i.readyState)t();else{var n=function(){t(),i.removeEventListener("DOMContentLoaded",n)};i.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}(e,i=Au.bind(null,i))));break;case 22:if(!(n=null!==i.memoizedState||Rl)){t=null!==t&&null!==t.memoizedState||Ol,r=Rl;var s=Ol;Rl=n,(Ol=t)&&!s?Ql(e,i,0!==(8772&i.subtreeFlags)):ql(e,i),Rl=r,Ol=s}break;case 30:break;default:ql(e,i)}}function Ll(e){var t=e.alternate;null!==t&&(e.alternate=null,Ll(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&Ke(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Dl=null,Fl=!1;function Bl(e,t,i){for(i=i.child;null!==i;)Ul(e,t,i),i=i.sibling}function Ul(e,t,i){if(ye&&"function"===typeof ye.onCommitFiberUnmount)try{ye.onCommitFiberUnmount(ve,i)}catch(s){}switch(i.tag){case 26:Ol||wl(i,t),Bl(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode).parentNode.removeChild(i);break;case 27:Ol||wl(i,t);var n=Dl,r=Fl;Cc(i.type)&&(Dl=i.stateNode,Fl=!1),Bl(e,t,i),Bc(i.stateNode),Dl=n,Fl=r;break;case 5:Ol||wl(i,t);case 6:if(n=Dl,r=Fl,Dl=null,Bl(e,t,i),Fl=r,null!==(Dl=n))if(Fl)try{(9===Dl.nodeType?Dl.body:"HTML"===Dl.nodeName?Dl.ownerDocument.body:Dl).removeChild(i.stateNode)}catch(a){_u(i,t,a)}else try{Dl.removeChild(i.stateNode)}catch(a){_u(i,t,a)}break;case 18:null!==Dl&&(Fl?(Ac(9===(e=Dl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,i.stateNode),Yd(e)):Ac(Dl,i.stateNode));break;case 4:n=Dl,r=Fl,Dl=i.stateNode.containerInfo,Fl=!0,Bl(e,t,i),Dl=n,Fl=r;break;case 0:case 11:case 14:case 15:vl(2,i,t),Ol||vl(4,i,t),Bl(e,t,i);break;case 1:Ol||(wl(i,t),"function"===typeof(n=i.stateNode).componentWillUnmount&&xl(i,t,n)),Bl(e,t,i);break;case 21:Bl(e,t,i);break;case 22:Ol=(n=Ol)||null!==i.memoizedState,Bl(e,t,i),Ol=n;break;default:Bl(e,t,i)}}function zl(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&null!==(e=e.memoizedState))){e=e.dehydrated;try{Yd(e)}catch(i){_u(t,t.return,i)}}}function Vl(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{Yd(e)}catch(i){_u(t,t.return,i)}}function Hl(e,t){var i=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Ml),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Ml),t;default:throw Error(a(435,e.tag))}}(e);t.forEach(function(t){if(!i.has(t)){i.add(t);var n=ku.bind(null,e,t);t.then(n,n)}})}function jl(e,t){var i=t.deletions;if(null!==i)for(var n=0;n<i.length;n++){var r=i[n],s=e,o=t,l=o;e:for(;null!==l;){switch(l.tag){case 27:if(Cc(l.type)){Dl=l.stateNode,Fl=!1;break e}break;case 5:Dl=l.stateNode,Fl=!1;break e;case 3:case 4:Dl=l.stateNode.containerInfo,Fl=!0;break e}l=l.return}if(null===Dl)throw Error(a(160));Ul(s,o,r),Dl=null,Fl=!1,null!==(s=r.alternate)&&(s.return=null),r.return=null}if(13886&t.subtreeFlags)for(t=t.child;null!==t;)Wl(t,e),t=t.sibling}var Yl=null;function Wl(e,t){var i=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:jl(t,e),Gl(e),4&n&&(vl(3,e,e.return),gl(3,e),vl(5,e,e.return));break;case 1:jl(t,e),Gl(e),512&n&&(Ol||null===i||wl(i,i.return)),64&n&&Rl&&(null!==(e=e.updateQueue)&&(null!==(n=e.callbacks)&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===i?n:i.concat(n))));break;case 26:var r=Yl;if(jl(t,e),Gl(e),512&n&&(Ol||null===i||wl(i,i.return)),4&n){var s=null!==i?i.memoizedState:null;if(n=e.memoizedState,null===i)if(null===n)if(null===e.stateNode){e:{n=e.type,i=e.memoizedProps,r=r.ownerDocument||r;t:switch(n){case"title":(!(s=r.getElementsByTagName("title")[0])||s[qe]||s[Ve]||"http://www.w3.org/2000/svg"===s.namespaceURI||s.hasAttribute("itemprop"))&&(s=r.createElement(n),r.head.insertBefore(s,r.querySelector("head > title"))),dc(s,n,i),s[Ve]=e,et(s),n=s;break e;case"link":var o=id("link","href",r).get(n+(i.href||""));if(o)for(var l=0;l<o.length;l++)if((s=o[l]).getAttribute("href")===(null==i.href||""===i.href?null:i.href)&&s.getAttribute("rel")===(null==i.rel?null:i.rel)&&s.getAttribute("title")===(null==i.title?null:i.title)&&s.getAttribute("crossorigin")===(null==i.crossOrigin?null:i.crossOrigin)){o.splice(l,1);break t}dc(s=r.createElement(n),n,i),r.head.appendChild(s);break;case"meta":if(o=id("meta","content",r).get(n+(i.content||"")))for(l=0;l<o.length;l++)if((s=o[l]).getAttribute("content")===(null==i.content?null:""+i.content)&&s.getAttribute("name")===(null==i.name?null:i.name)&&s.getAttribute("property")===(null==i.property?null:i.property)&&s.getAttribute("http-equiv")===(null==i.httpEquiv?null:i.httpEquiv)&&s.getAttribute("charset")===(null==i.charSet?null:i.charSet)){o.splice(l,1);break t}dc(s=r.createElement(n),n,i),r.head.appendChild(s);break;default:throw Error(a(468,n))}s[Ve]=e,et(s),n=s}e.stateNode=n}else nd(r,e.type,e.stateNode);else e.stateNode=Jc(r,n,e.memoizedProps);else s!==n?(null===s?null!==i.stateNode&&(i=i.stateNode).parentNode.removeChild(i):s.count--,null===n?nd(r,e.type,e.stateNode):Jc(r,n,e.memoizedProps)):null===n&&null!==e.stateNode&&_l(e,e.memoizedProps,i.memoizedProps)}break;case 27:jl(t,e),Gl(e),512&n&&(Ol||null===i||wl(i,i.return)),null!==i&&4&n&&_l(e,e.memoizedProps,i.memoizedProps);break;case 5:if(jl(t,e),Gl(e),512&n&&(Ol||null===i||wl(i,i.return)),32&e.flags){r=e.stateNode;try{St(r,"")}catch(m){_u(e,e.return,m)}}4&n&&null!=e.stateNode&&_l(e,r=e.memoizedProps,null!==i?i.memoizedProps:r),1024&n&&(Pl=!0);break;case 6:if(jl(t,e),Gl(e),4&n){if(null===e.stateNode)throw Error(a(162));n=e.memoizedProps,i=e.stateNode;try{i.nodeValue=n}catch(m){_u(e,e.return,m)}}break;case 3:if(td=null,r=Yl,Yl=Vc(t.containerInfo),jl(t,e),Yl=r,Gl(e),4&n&&null!==i&&i.memoizedState.isDehydrated)try{Yd(t.containerInfo)}catch(m){_u(e,e.return,m)}Pl&&(Pl=!1,Xl(e));break;case 4:n=Yl,Yl=Vc(e.stateNode.containerInfo),jl(t,e),Gl(e),Yl=n;break;case 12:default:jl(t,e),Gl(e);break;case 31:case 19:jl(t,e),Gl(e),4&n&&(null!==(n=e.updateQueue)&&(e.updateQueue=null,Hl(e,n)));break;case 13:jl(t,e),Gl(e),8192&e.child.flags&&null!==e.memoizedState!==(null!==i&&null!==i.memoizedState)&&(Mh=le()),4&n&&(null!==(n=e.updateQueue)&&(e.updateQueue=null,Hl(e,n)));break;case 22:r=null!==e.memoizedState;var h=null!==i&&null!==i.memoizedState,u=Rl,c=Ol;if(Rl=u||r,Ol=c||h,jl(t,e),Ol=c,Rl=u,Gl(e),8192&n)e:for(t=e.stateNode,t._visibility=r?-2&t._visibility:1|t._visibility,r&&(null===i||h||Rl||Ol||Kl(e)),i=null,t=e;;){if(5===t.tag||26===t.tag){if(null===i){h=i=t;try{if(s=h.stateNode,r)"function"===typeof(o=s.style).setProperty?o.setProperty("display","none","important"):o.display="none";else{l=h.stateNode;var d=h.memoizedProps.style,f=void 0!==d&&null!==d&&d.hasOwnProperty("display")?d.display:null;l.style.display=null==f||"boolean"===typeof f?"":(""+f).trim()}}catch(m){_u(h,h.return,m)}}}else if(6===t.tag){if(null===i){h=t;try{h.stateNode.nodeValue=r?"":h.memoizedProps}catch(m){_u(h,h.return,m)}}}else if(18===t.tag){if(null===i){h=t;try{var p=h.stateNode;r?kc(p,!0):kc(h.stateNode,!1)}catch(m){_u(h,h.return,m)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}4&n&&(null!==(n=e.updateQueue)&&(null!==(i=n.retryQueue)&&(n.retryQueue=null,Hl(e,i))));case 30:case 21:}}function Gl(e){var t=e.flags;if(2&t){try{for(var i,n=e.return;null!==n;){if(Sl(n)){i=n;break}n=n.return}if(null==i)throw Error(a(160));switch(i.tag){case 27:var r=i.stateNode;Al(e,El(e),r);break;case 5:var s=i.stateNode;32&i.flags&&(St(s,""),i.flags&=-33),Al(e,El(e),s);break;case 3:case 4:var o=i.stateNode.containerInfo;Cl(e,El(e),o);break;default:throw Error(a(161))}}catch(l){_u(e,e.return,l)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function Xl(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;Xl(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function ql(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)Il(e,t.alternate,t),t=t.sibling}function Kl(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:vl(4,t,t.return),Kl(t);break;case 1:wl(t,t.return);var i=t.stateNode;"function"===typeof i.componentWillUnmount&&xl(t,t.return,i),Kl(t);break;case 27:Bc(t.stateNode);case 26:case 5:wl(t,t.return),Kl(t);break;case 22:null===t.memoizedState&&Kl(t);break;default:Kl(t)}e=e.sibling}}function Ql(e,t,i){for(i=i&&0!==(8772&t.subtreeFlags),t=t.child;null!==t;){var n=t.alternate,r=e,s=t,a=s.flags;switch(s.tag){case 0:case 11:case 15:Ql(r,s,i),gl(4,s);break;case 1:if(Ql(r,s,i),"function"===typeof(r=(n=s).stateNode).componentDidMount)try{r.componentDidMount()}catch(h){_u(n,n.return,h)}if(null!==(r=(n=s).updateQueue)){var o=n.stateNode;try{var l=r.shared.hiddenCallbacks;if(null!==l)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)Es(l[r],o)}catch(h){_u(n,n.return,h)}}i&&64&a&&yl(s),bl(s,s.return);break;case 27:kl(s);case 26:case 5:Ql(r,s,i),i&&null===n&&4&a&&Tl(s),bl(s,s.return);break;case 12:Ql(r,s,i);break;case 31:Ql(r,s,i),i&&4&a&&zl(r,s);break;case 13:Ql(r,s,i),i&&4&a&&Vl(r,s);break;case 22:null===s.memoizedState&&Ql(r,s,i),bl(s,s.return);break;case 30:break;default:Ql(r,s,i)}t=t.sibling}}function Jl(e,t){var i=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(i=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==i&&(null!=e&&e.refCount++,null!=i&&zr(i))}function Zl(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&zr(e))}function $l(e,t,i,n){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)eh(e,t,i,n),t=t.sibling}function eh(e,t,i,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:$l(e,t,i,n),2048&r&&gl(9,t);break;case 1:case 31:case 13:default:$l(e,t,i,n);break;case 3:$l(e,t,i,n),2048&r&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&zr(e)));break;case 12:if(2048&r){$l(e,t,i,n),e=t.stateNode;try{var s=t.memoizedProps,a=s.id,o=s.onPostCommit;"function"===typeof o&&o(a,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(l){_u(t,t.return,l)}}else $l(e,t,i,n);break;case 23:break;case 22:s=t.stateNode,a=t.alternate,null!==t.memoizedState?2&s._visibility?$l(e,t,i,n):ih(e,t):2&s._visibility?$l(e,t,i,n):(s._visibility|=2,th(e,t,i,n,0!==(10256&t.subtreeFlags)||!1)),2048&r&&Jl(a,t);break;case 24:$l(e,t,i,n),2048&r&&Zl(t.alternate,t)}}function th(e,t,i,n,r){for(r=r&&(0!==(10256&t.subtreeFlags)||!1),t=t.child;null!==t;){var s=e,a=t,o=i,l=n,h=a.flags;switch(a.tag){case 0:case 11:case 15:th(s,a,o,l,r),gl(8,a);break;case 23:break;case 22:var u=a.stateNode;null!==a.memoizedState?2&u._visibility?th(s,a,o,l,r):ih(s,a):(u._visibility|=2,th(s,a,o,l,r)),r&&2048&h&&Jl(a.alternate,a);break;case 24:th(s,a,o,l,r),r&&2048&h&&Zl(a.alternate,a);break;default:th(s,a,o,l,r)}t=t.sibling}}function ih(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var i=e,n=t,r=n.flags;switch(n.tag){case 22:ih(i,n),2048&r&&Jl(n.alternate,n);break;case 24:ih(i,n),2048&r&&Zl(n.alternate,n);break;default:ih(i,n)}t=t.sibling}}var nh=8192;function rh(e,t,i){if(e.subtreeFlags&nh)for(e=e.child;null!==e;)sh(e,t,i),e=e.sibling}function sh(e,t,i){switch(e.tag){case 26:rh(e,t,i),e.flags&nh&&null!==e.memoizedState&&function(e,t,i,n){if("stylesheet"===i.type&&("string"!==typeof n.media||!1!==matchMedia(n.media).matches)&&0===(4&i.state.loading)){if(null===i.instance){var r=Gc(n.href),s=t.querySelector(Xc(r));if(s)return null!==(t=s._p)&&"object"===typeof t&&"function"===typeof t.then&&(e.count++,e=ad.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=s,void et(s);s=t.ownerDocument||t,n=qc(n),(r=Uc.get(r))&&$c(n,r),et(s=s.createElement("link"));var a=s;a._p=new Promise(function(e,t){a.onload=e,a.onerror=t}),dc(s,"link",n),i.instance=s}null===e.stylesheets&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&0===(3&i.state.loading)&&(e.count++,i=ad.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}(i,Yl,e.memoizedState,e.memoizedProps);break;case 5:default:rh(e,t,i);break;case 3:case 4:var n=Yl;Yl=Vc(e.stateNode.containerInfo),rh(e,t,i),Yl=n;break;case 22:null===e.memoizedState&&(null!==(n=e.alternate)&&null!==n.memoizedState?(n=nh,nh=16777216,rh(e,t,i),nh=n):rh(e,t,i))}}function ah(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function oh(e){var t=e.deletions;if(0!==(16&e.flags)){if(null!==t)for(var i=0;i<t.length;i++){var n=t[i];Nl=n,uh(n,e)}ah(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)lh(e),e=e.sibling}function lh(e){switch(e.tag){case 0:case 11:case 15:oh(e),2048&e.flags&&vl(9,e,e.return);break;case 3:case 12:default:oh(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,hh(e)):oh(e)}}function hh(e){var t=e.deletions;if(0!==(16&e.flags)){if(null!==t)for(var i=0;i<t.length;i++){var n=t[i];Nl=n,uh(n,e)}ah(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:vl(8,t,t.return),hh(t);break;case 22:2&(i=t.stateNode)._visibility&&(i._visibility&=-3,hh(t));break;default:hh(t)}e=e.sibling}}function uh(e,t){for(;null!==Nl;){var i=Nl;switch(i.tag){case 0:case 11:case 15:vl(8,i,t);break;case 23:case 22:if(null!==i.memoizedState&&null!==i.memoizedState.cachePool){var n=i.memoizedState.cachePool.pool;null!=n&&n.refCount++}break;case 24:zr(i.memoizedState.cache)}if(null!==(n=i.child))n.return=i,Nl=n;else e:for(i=e;null!==Nl;){var r=(n=Nl).sibling,s=n.return;if(Ll(n),n===i){Nl=null;break e}if(null!==r){r.return=s,Nl=r;break e}Nl=s}}}var ch={getCacheForType:function(e){var t=Mr(Br),i=t.data.get(e);return void 0===i&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Mr(Br).controller.signal}},dh="function"===typeof WeakMap?WeakMap:Map,fh=0,ph=null,mh=null,gh=0,vh=0,yh=null,xh=!1,bh=!1,wh=!1,Th=0,_h=0,Sh=0,Eh=0,Ch=0,Ah=0,kh=0,Rh=null,Oh=null,Ph=!1,Mh=0,Nh=0,Ih=1/0,Lh=null,Dh=null,Fh=0,Bh=null,Uh=null,zh=0,Vh=0,Hh=null,jh=null,Yh=0,Wh=null;function Gh(){return 0!==(2&fh)&&0!==gh?gh&-gh:null!==I.T?Hu():Be()}function Xh(){if(0===Ah)if(0===(536870912&gh)||cr){var e=Se;0===(3932160&(Se<<=1))&&(Se=262144),Ah=e}else Ah=536870912;return null!==(e=Ms.current)&&(e.flags|=32),Ah}function qh(e,t,i){(e!==ph||2!==vh&&9!==vh)&&null===e.cancelPendingCommit||(tu(e,0),Zh(e,gh,Ah,!1)),Me(e,i),0!==(2&fh)&&e===ph||(e===ph&&(0===(2&fh)&&(Eh|=i),4===_h&&Zh(e,gh,Ah,!1)),Lu(e))}function Kh(e,t,i){if(0!==(6&fh))throw Error(a(327));for(var n=!i&&0===(127&t)&&0===(t&e.expiredLanes)||ke(e,t),r=n?function(e,t){var i=fh;fh|=2;var n=ru(),r=su();ph!==e||gh!==t?(Lh=null,Ih=le()+500,tu(e,t)):bh=ke(e,t);e:for(;;)try{if(0!==vh&&null!==mh){t=mh;var s=yh;t:switch(vh){case 1:vh=0,yh=null,du(e,t,s,1);break;case 2:case 9:if(ts(s)){vh=0,yh=null,cu(t);break}t=function(){2!==vh&&9!==vh||ph!==e||(vh=7),Lu(e)},s.then(t,t);break e;case 3:vh=7;break e;case 4:vh=5;break e;case 7:ts(s)?(vh=0,yh=null,cu(t)):(vh=0,yh=null,du(e,t,s,7));break;case 5:var o=null;switch(mh.tag){case 26:o=mh.memoizedState;case 5:case 27:var l=mh;if(o?rd(o):l.stateNode.complete){vh=0,yh=null;var h=l.sibling;if(null!==h)mh=h;else{var u=l.return;null!==u?(mh=u,fu(u)):mh=null}break t}}vh=0,yh=null,du(e,t,s,5);break;case 6:vh=0,yh=null,du(e,t,s,6);break;case 8:eu(),_h=6;break e;default:throw Error(a(462))}}hu();break}catch(c){iu(e,c)}return Sr=_r=null,I.H=n,I.A=r,fh=i,null!==mh?0:(ph=null,gh=0,On(),_h)}(e,t):ou(e,t,!0),s=n;;){if(0===r){bh&&!n&&Zh(e,t,0,!1);break}if(i=e.current.alternate,!s||Jh(i)){if(2===r){if(s=t,e.errorRecoveryDisabledLanes&s)var o=0;else o=0!==(o=-536870913&e.pendingLanes)?o:536870912&o?536870912:0;if(0!==o){t=o;e:{var l=e;r=Rh;var h=l.current.memoizedState.isDehydrated;if(h&&(tu(l,o).flags|=256),2!==(o=ou(l,o,!1))){if(wh&&!h){l.errorRecoveryDisabledLanes|=s,Eh|=s,r=4;break e}s=Oh,Oh=r,null!==s&&(null===Oh?Oh=s:Oh.push.apply(Oh,s))}r=o}if(s=!1,2!==r)continue}}if(1===r){tu(e,0),Zh(e,t,0,!0);break}e:{switch(n=e,s=r){case 0:case 1:throw Error(a(345));case 4:if((4194048&t)!==t)break;case 6:Zh(n,t,Ah,!xh);break e;case 2:Oh=null;break;case 3:case 5:break;default:throw Error(a(329))}if((62914560&t)===t&&10<(r=Mh+300-le())){if(Zh(n,t,Ah,!xh),0!==Ae(n,0,!0))break e;zh=t,n.timeoutHandle=wc(Qh.bind(null,n,i,Oh,Lh,Ph,t,Ah,Eh,kh,xh,s,"Throttled",-0,0),r)}else Qh(n,i,Oh,Lh,Ph,t,Ah,Eh,kh,xh,s,null,-0,0)}break}r=ou(e,t,!1),s=!1}Lu(e)}function Qh(e,t,i,n,r,s,a,o,l,h,u,c,d,f){if(e.timeoutHandle=-1,8192&(c=t.subtreeFlags)||16785408===(16785408&c)){sh(t,s,c={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Mt});var p=(62914560&s)===s?Mh-le():(4194048&s)===s?Nh-le():0;if(null!==(p=function(e,t){return e.stylesheets&&0===e.count&&ld(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var n=setTimeout(function(){if(e.stylesheets&&ld(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&0===sd&&(sd=62500*function(){if("function"===typeof performance.getEntriesByType){for(var e=0,t=0,i=performance.getEntriesByType("resource"),n=0;n<i.length;n++){var r=i[n],s=r.transferSize,a=r.initiatorType,o=r.duration;if(s&&o&&fc(a)){for(a=0,o=r.responseEnd,n+=1;n<i.length;n++){var l=i[n],h=l.startTime;if(h>o)break;var u=l.transferSize,c=l.initiatorType;u&&fc(c)&&(a+=u*((l=l.responseEnd)<o?1:(o-h)/(l-h)))}if(--n,t+=8*(s+a)/(r.duration/1e3),10<++e)break}}if(0<e)return t/e/1e6}return navigator.connection&&"number"===typeof(e=navigator.connection.downlink)?e:5}());var r=setTimeout(function(){if(e.waitingForImages=!1,0===e.count&&(e.stylesheets&&ld(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>sd?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}(c,p)))return zh=s,e.cancelPendingCommit=p(mu.bind(null,e,t,s,i,n,r,a,o,l,u,c,null,d,f)),void Zh(e,s,a,!h)}mu(e,t,s,i,n,r,a,o,l)}function Jh(e){for(var t=e;;){var i=t.tag;if((0===i||11===i||15===i)&&16384&t.flags&&(null!==(i=t.updateQueue)&&null!==(i=i.stores)))for(var n=0;n<i.length;n++){var r=i[n],s=r.getSnapshot;r=r.value;try{if(!Ji(s(),r))return!1}catch(a){return!1}}if(i=t.child,16384&t.subtreeFlags&&null!==i)i.return=t,t=i;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Zh(e,t,i,n){t&=~Ch,t&=~Eh,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var s=31-be(r),a=1<<s;n[s]=-1,r&=~a}0!==i&&Ne(e,i,t)}function $h(){return 0!==(6&fh)||(Du(0,!1),!1)}function eu(){if(null!==mh){if(0===vh)var e=mh.return;else Sr=_r=null,aa(e=mh),os=null,ls=0,e=mh;for(;null!==e;)ml(e.alternate,e),e=e.return;mh=null}}function tu(e,t){var i=e.timeoutHandle;-1!==i&&(e.timeoutHandle=-1,Tc(i)),null!==(i=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,i()),zh=0,eu(),ph=e,mh=i=zn(e.current,null),gh=t,vh=0,yh=null,xh=!1,bh=ke(e,t),wh=!1,kh=Ah=Ch=Eh=Sh=_h=0,Oh=Rh=null,Ph=!1,0!==(8&t)&&(t|=32&t);var n=e.entangledLanes;if(0!==n)for(e=e.entanglements,n&=t;0<n;){var r=31-be(n),s=1<<r;t|=e[r],n&=~s}return Th=t,On(),i}function iu(e,t){Hs=null,I.H=mo,t===Jr||t===$r?(t=ss(),vh=3):t===Zr?(t=ss(),vh=4):vh=t===Mo?8:null!==t&&"object"===typeof t&&"function"===typeof t.then?6:1,yh=t,null===mh&&(_h=1,Ao(e,qn(t,e.current)))}function nu(){var e=Ms.current;return null===e||((4194048&gh)===gh?null===Ns:((62914560&gh)===gh||0!==(536870912&gh))&&e===Ns)}function ru(){var e=I.H;return I.H=mo,null===e?mo:e}function su(){var e=I.A;return I.A=ch,e}function au(){_h=4,xh||(4194048&gh)!==gh&&null!==Ms.current||(bh=!0),0===(134217727&Sh)&&0===(134217727&Eh)||null===ph||Zh(ph,gh,Ah,!1)}function ou(e,t,i){var n=fh;fh|=2;var r=ru(),s=su();ph===e&&gh===t||(Lh=null,tu(e,t)),t=!1;var a=_h;e:for(;;)try{if(0!==vh&&null!==mh){var o=mh,l=yh;switch(vh){case 8:eu(),a=6;break e;case 3:case 2:case 9:case 6:null===Ms.current&&(t=!0);var h=vh;if(vh=0,yh=null,du(e,o,l,h),i&&bh){a=0;break e}break;default:h=vh,vh=0,yh=null,du(e,o,l,h)}}lu(),a=_h;break}catch(u){iu(e,u)}return t&&e.shellSuspendCounter++,Sr=_r=null,fh=n,I.H=r,I.A=s,null===mh&&(ph=null,gh=0,On()),a}function lu(){for(;null!==mh;)uu(mh)}function hu(){for(;null!==mh&&!ae();)uu(mh)}function uu(e){var t=al(e.alternate,e,Th);e.memoizedProps=e.pendingProps,null===t?fu(e):mh=t}function cu(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Wo(i,t,t.pendingProps,t.type,void 0,gh);break;case 11:t=Wo(i,t,t.pendingProps,t.type.render,t.ref,gh);break;case 5:aa(t);default:ml(i,t),t=al(i,t=mh=Vn(t,Th),Th)}e.memoizedProps=e.pendingProps,null===t?fu(e):mh=t}function du(e,t,i,n){Sr=_r=null,aa(t),os=null,ls=0;var r=t.return;try{if(function(e,t,i,n,r){if(i.flags|=32768,null!==n&&"object"===typeof n&&"function"===typeof n.then){if(null!==(t=i.alternate)&&Rr(t,i,r,!0),null!==(i=Ms.current)){switch(i.tag){case 31:case 13:return null===Ns?au():null===i.alternate&&0===_h&&(_h=3),i.flags&=-257,i.flags|=65536,i.lanes=r,n===es?i.flags|=16384:(null===(t=i.updateQueue)?i.updateQueue=new Set([n]):t.add(n),Su(e,n,r)),!1;case 22:return i.flags|=65536,n===es?i.flags|=16384:(null===(t=i.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},i.updateQueue=t):null===(i=t.retryQueue)?t.retryQueue=new Set([n]):i.add(n),Su(e,n,r)),!1}throw Error(a(435,i.tag))}return Su(e,n,r),au(),!1}if(cr)return null!==(t=Ms.current)?(0===(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==pr&&wr(qn(e=Error(a(422),{cause:n}),i))):(n!==pr&&wr(qn(t=Error(a(423),{cause:n}),i)),(e=e.current.alternate).flags|=65536,r&=-r,e.lanes|=r,n=qn(n,i),ws(e,r=Ro(e.stateNode,n,r)),4!==_h&&(_h=2)),!1;var s=Error(a(520),{cause:n});if(s=qn(s,i),null===Rh?Rh=[s]:Rh.push(s),4!==_h&&(_h=2),null===t)return!0;n=qn(n,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=r&-r,i.lanes|=e,ws(i,e=Ro(i.stateNode,n,e)),!1;case 1:if(t=i.type,s=i.stateNode,0===(128&i.flags)&&("function"===typeof t.getDerivedStateFromError||null!==s&&"function"===typeof s.componentDidCatch&&(null===Dh||!Dh.has(s))))return i.flags|=65536,r&=-r,i.lanes|=r,Po(r=Oo(r),e,i,n),ws(i,r),!1}i=i.return}while(null!==i);return!1}(e,r,t,i,gh))return _h=1,Ao(e,qn(i,e.current)),void(mh=null)}catch(s){if(null!==r)throw mh=r,s;return _h=1,Ao(e,qn(i,e.current)),void(mh=null)}32768&t.flags?(cr||1===n?e=!0:bh||0!==(536870912&gh)?e=!1:(xh=e=!0,(2===n||9===n||3===n||6===n)&&(null!==(n=Ms.current)&&13===n.tag&&(n.flags|=16384))),pu(t,e)):fu(t)}function fu(e){var t=e;do{if(0!==(32768&t.flags))return void pu(t,xh);e=t.return;var i=fl(t.alternate,t,Th);if(null!==i)return void(mh=i);if(null!==(t=t.sibling))return void(mh=t);mh=t=e}while(null!==t);0===_h&&(_h=5)}function pu(e,t){do{var i=pl(e.alternate,e);if(null!==i)return i.flags&=32767,void(mh=i);if(null!==(i=e.return)&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&null!==(e=e.sibling))return void(mh=e);mh=e=i}while(null!==e);_h=6,mh=null}function mu(e,t,i,n,r,s,o,l,h){e.cancelPendingCommit=null;do{bu()}while(0!==Fh);if(0!==(6&fh))throw Error(a(327));if(null!==t){if(t===e.current)throw Error(a(177));if(s=t.lanes|t.childLanes,function(e,t,i,n,r,s){var a=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var o=e.entanglements,l=e.expirationTimes,h=e.hiddenUpdates;for(i=a&~i;0<i;){var u=31-be(i),c=1<<u;o[u]=0,l[u]=-1;var d=h[u];if(null!==d)for(h[u]=null,u=0;u<d.length;u++){var f=d[u];null!==f&&(f.lane&=-536870913)}i&=~c}0!==n&&Ne(e,n,0),0!==s&&0===r&&0!==e.tag&&(e.suspendedLanes|=s&~(a&~t))}(e,i,s|=Rn,o,l,h),e===ph&&(mh=ph=null,gh=0),Uh=t,Bh=e,zh=i,Vh=s,Hh=r,jh=n,0!==(10256&t.subtreeFlags)||0!==(10256&t.flags)?(e.callbackNode=null,e.callbackPriority=0,re(de,function(){return wu(),null})):(e.callbackNode=null,e.callbackPriority=0),n=0!==(13878&t.flags),0!==(13878&t.subtreeFlags)||n){n=I.T,I.T=null,r=L.p,L.p=2,o=fh,fh|=4;try{!function(e,t){if(e=e.containerInfo,pc=xd,rn(e=nn(e))){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{var n=(i=(i=e.ownerDocument)&&i.defaultView||window).getSelection&&i.getSelection();if(n&&0!==n.rangeCount){i=n.anchorNode;var r=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{i.nodeType,s.nodeType}catch(g){i=null;break e}var o=0,l=-1,h=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==i||0!==r&&3!==d.nodeType||(l=o+r),d!==s||0!==n&&3!==d.nodeType||(h=o+n),3===d.nodeType&&(o+=d.nodeValue.length),null!==(p=d.firstChild);)f=d,d=p;for(;;){if(d===e)break t;if(f===i&&++u===r&&(l=o),f===s&&++c===n&&(h=o),null!==(p=d.nextSibling))break;f=(d=f).parentNode}d=p}i=-1===l||-1===h?null:{start:l,end:h}}else i=null}i=i||{start:0,end:0}}else i=null;
2for(mc={focusedElem:e,selectionRange:i},xd=!1,Nl=t;null!==Nl;)if(e=(t=Nl).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,Nl=e;else for(;null!==Nl;){switch(s=(t=Nl).alternate,e=t.flags,t.tag){case 0:if(0!==(4&e)&&null!==(e=null!==(e=t.updateQueue)?e.events:null))for(i=0;i<e.length;i++)(r=e[i]).ref.impl=r.nextImpl;break;case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(0!==(1024&e)&&null!==s){e=void 0,i=t,r=s.memoizedProps,s=s.memoizedState,n=i.stateNode;try{var m=_o(i.type,r);e=n.getSnapshotBeforeUpdate(m,s),n.__reactInternalSnapshotBeforeUpdate=e}catch(v){_u(i,i.return,v)}}break;case 3:if(0!==(1024&e))if(9===(i=(e=t.stateNode.containerInfo).nodeType))Rc(e);else if(1===i)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Rc(e);break;default:e.textContent=""}break;default:if(0!==(1024&e))throw Error(a(163))}if(null!==(e=t.sibling)){e.return=t.return,Nl=e;break}Nl=t.return}}(e,t)}finally{fh=o,L.p=r,I.T=n}}Fh=1,gu(),vu(),yu()}}function gu(){if(1===Fh){Fh=0;var e=Bh,t=Uh,i=0!==(13878&t.flags);if(0!==(13878&t.subtreeFlags)||i){i=I.T,I.T=null;var n=L.p;L.p=2;var r=fh;fh|=4;try{Wl(t,e);var s=mc,a=nn(e.containerInfo),o=s.focusedElem,l=s.selectionRange;if(a!==o&&o&&o.ownerDocument&&tn(o.ownerDocument.documentElement,o)){if(null!==l&&rn(o)){var h=l.start,u=l.end;if(void 0===u&&(u=h),"selectionStart"in o)o.selectionStart=h,o.selectionEnd=Math.min(u,o.value.length);else{var c=o.ownerDocument||document,d=c&&c.defaultView||window;if(d.getSelection){var f=d.getSelection(),p=o.textContent.length,m=Math.min(l.start,p),g=void 0===l.end?m:Math.min(l.end,p);!f.extend&&m>g&&(a=g,g=m,m=a);var v=en(o,m),y=en(o,g);if(v&&y&&(1!==f.rangeCount||f.anchorNode!==v.node||f.anchorOffset!==v.offset||f.focusNode!==y.node||f.focusOffset!==y.offset)){var x=c.createRange();x.setStart(v.node,v.offset),f.removeAllRanges(),m>g?(f.addRange(x),f.extend(y.node,y.offset)):(x.setEnd(y.node,y.offset),f.addRange(x))}}}}for(c=[],f=o;f=f.parentNode;)1===f.nodeType&&c.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"===typeof o.focus&&o.focus(),o=0;o<c.length;o++){var b=c[o];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}xd=!!pc,mc=pc=null}finally{fh=r,L.p=n,I.T=i}}e.current=t,Fh=2}}function vu(){if(2===Fh){Fh=0;var e=Bh,t=Uh,i=0!==(8772&t.flags);if(0!==(8772&t.subtreeFlags)||i){i=I.T,I.T=null;var n=L.p;L.p=2;var r=fh;fh|=4;try{Il(e,t.alternate,t)}finally{fh=r,L.p=n,I.T=i}}Fh=3}}function yu(){if(4===Fh||3===Fh){Fh=0,oe();var e=Bh,t=Uh,i=zh,n=jh;0!==(10256&t.subtreeFlags)||0!==(10256&t.flags)?Fh=5:(Fh=0,Uh=Bh=null,xu(e,e.pendingLanes));var r=e.pendingLanes;if(0===r&&(Dh=null),Fe(i),t=t.stateNode,ye&&"function"===typeof ye.onCommitFiberRoot)try{ye.onCommitFiberRoot(ve,t,void 0,128===(128&t.current.flags))}catch(l){}if(null!==n){t=I.T,r=L.p,L.p=2,I.T=null;try{for(var s=e.onRecoverableError,a=0;a<n.length;a++){var o=n[a];s(o.value,{componentStack:o.stack})}}finally{I.T=t,L.p=r}}0!==(3&zh)&&bu(),Lu(e),r=e.pendingLanes,0!==(261930&i)&&0!==(42&r)?e===Wh?Yh++:(Yh=0,Wh=e):Yh=0,Du(0,!1)}}function xu(e,t){0===(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,zr(t)))}function bu(){return gu(),vu(),yu(),wu()}function wu(){if(5!==Fh)return!1;var e=Bh,t=Vh;Vh=0;var i=Fe(zh),n=I.T,r=L.p;try{L.p=32>i?32:i,I.T=null,i=Hh,Hh=null;var s=Bh,o=zh;if(Fh=0,Uh=Bh=null,zh=0,0!==(6&fh))throw Error(a(331));var l=fh;if(fh|=4,lh(s.current),eh(s,s.current,o,i),fh=l,Du(0,!1),ye&&"function"===typeof ye.onPostCommitFiberRoot)try{ye.onPostCommitFiberRoot(ve,s)}catch(h){}return!0}finally{L.p=r,I.T=n,xu(e,t)}}function Tu(e,t,i){t=qn(i,t),null!==(e=xs(e,t=Ro(e.stateNode,t,2),2))&&(Me(e,2),Lu(e))}function _u(e,t,i){if(3===e.tag)Tu(e,e,i);else for(;null!==t;){if(3===t.tag){Tu(t,e,i);break}if(1===t.tag){var n=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof n.componentDidCatch&&(null===Dh||!Dh.has(n))){e=qn(i,e),null!==(n=xs(t,i=Oo(2),2))&&(Po(i,n,t,e),Me(n,2),Lu(n));break}}t=t.return}}function Su(e,t,i){var n=e.pingCache;if(null===n){n=e.pingCache=new dh;var r=new Set;n.set(t,r)}else void 0===(r=n.get(t))&&(r=new Set,n.set(t,r));r.has(i)||(wh=!0,r.add(i),e=Eu.bind(null,e,t,i),t.then(e,e))}function Eu(e,t,i){var n=e.pingCache;null!==n&&n.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ph===e&&(gh&i)===i&&(4===_h||3===_h&&(62914560&gh)===gh&&300>le()-Mh?0===(2&fh)&&tu(e,0):Ch|=i,kh===gh&&(kh=0)),Lu(e)}function Cu(e,t){0===t&&(t=Oe()),null!==(e=Nn(e,t))&&(Me(e,t),Lu(e))}function Au(e){var t=e.memoizedState,i=0;null!==t&&(i=t.retryLane),Cu(e,i)}function ku(e,t){var i=0;switch(e.tag){case 31:case 13:var n=e.stateNode,r=e.memoizedState;null!==r&&(i=r.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(a(314))}null!==n&&n.delete(t),Cu(e,i)}var Ru=null,Ou=null,Pu=!1,Mu=!1,Nu=!1,Iu=0;function Lu(e){e!==Ou&&null===e.next&&(null===Ou?Ru=Ou=e:Ou=Ou.next=e),Mu=!0,Pu||(Pu=!0,Sc(function(){0!==(6&fh)?re(ue,Fu):Bu()}))}function Du(e,t){if(!Nu&&Mu){Nu=!0;do{for(var i=!1,n=Ru;null!==n;){if(!t)if(0!==e){var r=n.pendingLanes;if(0===r)var s=0;else{var a=n.suspendedLanes,o=n.pingedLanes;
vendor: 4,946 bytes, line 2
2s=(1<<31-be(42|e)+1)-1,s=201326741&(s&=r&~(a&~o))?201326741&s|1:s?2|s:0}0!==s&&(i=!0,Vu(n,s))}else s=gh,0===(3&(s=Ae(n,n===ph?s:0,null!==n.cancelPendingCommit||-1!==n.timeoutHandle)))||ke(n,s)||(i=!0,Vu(n,s));n=n.next}}while(i);Nu=!1}}function Fu(){Bu()}function Bu(){Mu=Pu=!1;var e=0;0!==Iu&&function(){var e=window.event;if(e&&"popstate"===e.type)return e!==bc&&(bc=e,!0);return bc=null,!1}()&&(e=Iu);for(var t=le(),i=null,n=Ru;null!==n;){var r=n.next,s=Uu(n,t);0===s?(n.next=null,null===i?Ru=r:i.next=r,null===r&&(Ou=i)):(i=n,(0!==e||0!==(3&s))&&(Mu=!0)),n=r}0!==Fh&&5!==Fh||Du(e,!1),0!==Iu&&(Iu=0)}function Uu(e,t){for(var i=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,s=-62914561&e.pendingLanes;0<s;){var a=31-be(s),o=1<<a,l=r[a];-1===l?0!==(o&i)&&0===(o&n)||(r[a]=Re(o,t)):l<=t&&(e.expiredLanes|=o),s&=~o}if(i=gh,i=Ae(e,e===(t=ph)?i:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),n=e.callbackNode,0===i||e===t&&(2===vh||9===vh)||null!==e.cancelPendingCommit)return null!==n&&null!==n&&se(n),e.callbackNode=null,e.callbackPriority=0;if(0===(3&i)||ke(e,i)){if((t=i&-i)===e.callbackPriority)return t;switch(null!==n&&se(n),Fe(i)){case 2:case 8:i=ce;break;case 32:default:i=de;break;case 268435456:i=pe}return n=zu.bind(null,e),i=re(i,n),e.callbackPriority=t,e.callbackNode=i,t}return null!==n&&null!==n&&se(n),e.callbackPriority=2,e.callbackNode=null,2}function zu(e,t){if(0!==Fh&&5!==Fh)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(bu()&&e.callbackNode!==i)return null;var n=gh;return 0===(n=Ae(e,e===ph?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(Kh(e,n,t),Uu(e,le()),null!=e.callbackNode&&e.callbackNode===i?zu.bind(null,e):null)}function Vu(e,t){if(bu())return null;Kh(e,t,!0)}function Hu(){if(0===Iu){var e=jr;0===e&&(e=_e,0===(261888&(_e<<=1))&&(_e=256)),Iu=e}return Iu}function ju(e){return null==e||"symbol"===typeof e||"boolean"===typeof e?null:"function"===typeof e?e:Pt(""+e)}function Yu(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}for(var Wu=0;Wu<Sn.length;Wu++){var Gu=Sn[Wu];En(Gu.toLowerCase(),"on"+(Gu[0].toUpperCase()+Gu.slice(1)))}En(gn,"onAnimationEnd"),En(vn,"onAnimationIteration"),En(yn,"onAnimationStart"),En("dblclick","onDoubleClick"),En("focusin","onFocus"),En("focusout","onBlur"),En(xn,"onTransitionRun"),En(bn,"onTransitionStart"),En(wn,"onTransitionCancel"),En(Tn,"onTransitionEnd"),rt("onMouseEnter",["mouseout","mouseover"]),rt("onMouseLeave",["mouseout","mouseover"]),rt("onPointerEnter",["pointerout","pointerover"]),rt("onPointerLeave",["pointerout","pointerover"]),nt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),nt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),nt("onBeforeInput",["compositionend","keypress","textInput","paste"]),nt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),nt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),nt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),qu=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Xu));function Ku(e,t){t=0!==(4&t);for(var i=0;i<e.length;i++){var n=e[i],r=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var a=n.length-1;0<=a;a--){var o=n[a],l=o.instance,h=o.currentTarget;if(o=o.listener,l!==s&&r.isPropagationStopped())break e;s=o,r.currentTarget=h;try{s(r)}catch(u){Cn(u)}r.currentTarget=null,s=l}else for(a=0;a<n.length;a++){if(l=(o=n[a]).instance,h=o.currentTarget,o=o.listener,l!==s&&r.isPropagationStopped())break e;s=o,r.currentTarget=h;try{s(r)}catch(u){Cn(u)}r.currentTarget=null,s=l}}}}function Qu(e,t){var i=t[Ye];void 0===i&&(i=t[Ye]=new Set);var n=e+"__bubble";i.has(n)||(ec(t,e,2,!1),i.add(n))}function Ju(e,t,i){var n=0;t&&(n|=4),ec(i,e,n,t)}var Zu="_reactListening"+Math.random().toString(36).slice(2);function $u(e){if(!e[Zu]){e[Zu]=!0,tt.forEach(function(t){"selectionchange"!==t&&(qu.has(t)||Ju(t,!1,e),Ju(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Zu]||(t[Zu]=!0,Ju("selectionchange",!1,t))}}function ec(e,t,i,n){switch(Cd(t)){case 2:var r=bd;break;case 8:r=wd;break;default:r=Td}i=r.bind(null,t,i,e),r=void 0,!Ht||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(r=!0),n?void 0!==r?e.addEventListener(t,i,{capture:!0,passive:r}):e.addEventListener(t,i,!0):void 0!==r?e.addEventListener(t,i,{passive:r}):e.addEventListener(t,i,!1)}function tc(e,t,i,n,r){var s=n;
vendor: 8,936 bytes, line 2
2if(0===(1&t)&&0===(2&t)&&null!==n)e:for(;;){if(null===n)return;var a=n.tag;if(3===a||4===a){var o=n.stateNode.containerInfo;if(o===r)break;if(4===a)for(a=n.return;null!==a;){var h=a.tag;if((3===h||4===h)&&a.stateNode.containerInfo===r)return;a=a.return}for(;null!==o;){if(null===(a=Qe(o)))return;if(5===(h=a.tag)||6===h||26===h||27===h){n=s=a;continue e}o=o.parentNode}}n=n.return}Ut(function(){var n=s,r=It(i),a=[];e:{var o=_n.get(e);if(void 0!==o){var h=ii,u=e;switch(e){case"keypress":if(0===qt(i))break e;case"keydown":case"keyup":h=vi;break;case"focusin":u="focus",h=li;break;case"focusout":u="blur",h=li;break;case"beforeblur":case"afterblur":h=li;break;case"click":if(2===i.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=ai;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=oi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=xi;break;case gn:case vn:case yn:h=hi;break;case Tn:h=bi;break;case"scroll":case"scrollend":h=ri;break;case"wheel":h=wi;break;case"copy":case"cut":case"paste":h=ui;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=yi;break;case"toggle":case"beforetoggle":h=Ti}var c=0!==(4&t),d=!c&&("scroll"===e||"scrollend"===e),f=c?null!==o?o+"Capture":null:o;c=[];for(var p,m=n;null!==m;){var g=m;if(p=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===p||null===f||null!=(g=zt(m,f))&&c.push(ic(m,g,p)),d)break;m=m.return}0<c.length&&(o=new h(o,u,null,i,r),a.push({event:o,listeners:c}))}}if(0===(7&t)){if(h="mouseout"===e||"pointerout"===e,(!(o="mouseover"===e||"pointerover"===e)||i===Nt||!(u=i.relatedTarget||i.fromElement)||!Qe(u)&&!u[je])&&(h||o)&&(o=r.window===r?r:(o=r.ownerDocument)?o.defaultView||o.parentWindow:window,h?(h=n,null!==(u=(u=i.relatedTarget||i.toElement)?Qe(u):null)&&(d=l(u),c=u.tag,u!==d||5!==c&&27!==c&&6!==c)&&(u=null)):(h=null,u=n),h!==u)){if(c=ai,g="onMouseLeave",f="onMouseEnter",m="mouse","pointerout"!==e&&"pointerover"!==e||(c=yi,g="onPointerLeave",f="onPointerEnter",m="pointer"),d=null==h?o:Ze(h),p=null==u?o:Ze(u),(o=new c(g,m+"leave",h,i,r)).target=d,o.relatedTarget=p,g=null,Qe(r)===n&&((c=new c(f,m+"enter",u,i,r)).target=p,c.relatedTarget=d,g=c),d=g,h&&u)e:{for(c=rc,m=u,p=0,g=f=h;g;g=c(g))p++;g=0;for(var v=m;v;v=c(v))g++;for(;0<p-g;)f=c(f),p--;for(;0<g-p;)m=c(m),g--;for(;p--;){if(f===m||null!==m&&f===m.alternate){c=f;break e}f=c(f),m=c(m)}c=null}else c=null;null!==h&&sc(a,o,h,c,!1),null!==u&&null!==d&&sc(a,d,u,c,!0)}if("select"===(h=(o=n?Ze(n):window).nodeName&&o.nodeName.toLowerCase())||"input"===h&&"file"===o.type)var y=zi;else if(Ii(o))if(Vi)y=Qi;else{y=qi;var x=Xi}else!(h=o.nodeName)||"input"!==h.toLowerCase()||"checkbox"!==o.type&&"radio"!==o.type?n&&kt(n.elementType)&&(y=zi):y=Ki;switch(y&&(y=y(e,n))?Li(a,y,i,r):(x&&x(e,o,n),"focusout"===e&&n&&"number"===o.type&&null!=n.memoizedProps.value&&bt(o,"number",o.value)),x=n?Ze(n):window,e){case"focusin":(Ii(x)||"true"===x.contentEditable)&&(an=x,on=n,ln=null);break;case"focusout":ln=on=an=null;break;case"mousedown":hn=!0;break;case"contextmenu":case"mouseup":case"dragend":hn=!1,un(a,i,r);break;case"selectionchange":if(sn)break;case"keydown":case"keyup":un(a,i,r)}var b;if(Si)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else Mi?Oi(e,i)&&(w="onCompositionEnd"):"keydown"===e&&229===i.keyCode&&(w="onCompositionStart");w&&(Ai&&"ko"!==i.locale&&(Mi||"onCompositionStart"!==w?"onCompositionEnd"===w&&Mi&&(b=Xt()):(Wt="value"in(Yt=r)?Yt.value:Yt.textContent,Mi=!0)),0<(x=nc(n,w)).length&&(w=new ci(w,e,null,i,r),a.push({event:w,listeners:x}),b?w.data=b:null!==(b=Pi(i))&&(w.data=b))),(b=Ci?function(e,t){switch(e){case"compositionend":return Pi(t);case"keypress":return 32!==t.which?null:(Ri=!0,ki);case"textInput":return(e=t.data)===ki&&Ri?null:e;default:return null}}(e,i):function(e,t){if(Mi)return"compositionend"===e||!Si&&Oi(e,t)?(e=Xt(),Gt=Wt=Yt=null,Mi=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ai&&"ko"!==t.locale?null:t.data}}(e,i))&&(0<(w=nc(n,"onBeforeInput")).length&&(x=new ci("onBeforeInput","beforeinput",null,i,r),a.push({event:x,listeners:w}),x.data=b)),function(e,t,i,n,r){if("submit"===t&&i&&i.stateNode===r){var s=ju((r[He]||null).action),a=n.submitter;a&&null!==(t=(t=a[He]||null)?ju(t.formAction):a.getAttribute("formAction"))&&(s=t,a=null);var o=new ii("action","action",null,n,r);e.push({event:o,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(0!==Iu){var e=a?Yu(r,a):new FormData(r);eo(i,{pending:!0,data:e,method:r.method,action:s},null,e)}}else"function"===typeof s&&(o.preventDefault(),e=a?Yu(r,a):new FormData(r),eo(i,{pending:!0,data:e,method:r.method,action:s},s,e))},currentTarget:r}]})}}(a,e,n,i,r)}Ku(a,t)})}function ic(e,t,i){return{instance:e,listener:t,currentTarget:i}}function nc(e,t){for(var i=t+"Capture",n=[];null!==e;){var r=e,s=r.stateNode;if(5!==(r=r.tag)&&26!==r&&27!==r||null===s||(null!=(r=zt(e,i))&&n.unshift(ic(e,r,s)),null!=(r=zt(e,t))&&n.push(ic(e,r,s))),3===e.tag)return n;e=e.return}return[]}function rc(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function sc(e,t,i,n,r){for(var s=t._reactName,a=[];null!==i&&i!==n;){var o=i,l=o.alternate,h=o.stateNode;if(o=o.tag,null!==l&&l===n)break;5!==o&&26!==o&&27!==o||null===h||(l=h,r?null!=(h=zt(i,s))&&a.unshift(ic(i,h,l)):r||null!=(h=zt(i,s))&&a.push(ic(i,h,l))),i=i.return}0!==a.length&&e.push({event:t,listeners:a})}var ac=/\r\n?/g,oc=/\u0000|\uFFFD/g;function lc(e){return("string"===typeof e?e:""+e).replace(ac,"\n").replace(oc,"")}function hc(e,t){return t=lc(t),lc(e)===t}function uc(e,t,i,n,r,s){switch(i){case"children":"string"===typeof n?"body"===t||"textarea"===t&&""===n||St(e,n):("number"===typeof n||"bigint"===typeof n)&&"body"!==t&&St(e,""+n);break;case"className":ht(e,"class",n);break;case"tabIndex":ht(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":ht(e,i,n);break;case"style":At(e,n,s);break;case"data":if("object"!==t){ht(e,"data",n);break}case"src":case"href":if(""===n&&("a"!==t||"href"!==i)){e.removeAttribute(i);break}if(null==n||"function"===typeof n||"symbol"===typeof n||"boolean"===typeof n){e.removeAttribute(i);break}n=Pt(""+n),e.setAttribute(i,n);break;case"action":case"formAction":if("function"===typeof n){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"===typeof s&&("formAction"===i?("input"!==t&&uc(e,t,"name",r.name,r,null),uc(e,t,"formEncType",r.formEncType,r,null),uc(e,t,"formMethod",r.formMethod,r,null),uc(e,t,"formTarget",r.formTarget,r,null)):(uc(e,t,"encType",r.encType,r,null),uc(e,t,"method",r.method,r,null),uc(e,t,"target",r.target,r,null))),null==n||"symbol"===typeof n||"boolean"===typeof n){e.removeAttribute(i);break}n=Pt(""+n),e.setAttribute(i,n);break;case"onClick":null!=n&&(e.onclick=Mt);break;case"onScroll":null!=n&&Qu("scroll",e);break;case"onScrollEnd":null!=n&&Qu("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=n){if("object"!==typeof n||!("__html"in n))throw Error(a(61));if(null!=(i=n.__html)){if(null!=r.children)throw Error(a(60));e.innerHTML=i}}break;case"multiple":e.multiple=n&&"function"!==typeof n&&"symbol"!==typeof n;break;case"muted":e.muted=n&&"function"!==typeof n&&"symbol"!==typeof n;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==n||"function"===typeof n||"boolean"===typeof n||"symbol"===typeof n){e.removeAttribute("xlink:href");break}i=Pt(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=n&&"function"!==typeof n&&"symbol"!==typeof n?e.setAttribute(i,""+n):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
2ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&"function"!==typeof n&&"symbol"!==typeof n?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":!0===n?e.setAttribute(i,""):!1!==n&&null!=n&&"function"!==typeof n&&"symbol"!==typeof n?e.setAttribute(i,n):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":null!=n&&"function"!==typeof n&&"symbol"!==typeof n&&!isNaN(n)&&1<=n?e.setAttribute(i,n):e.removeAttribute(i);break;case"rowSpan":case"start":null==n||"function"===typeof n||"symbol"===typeof n||isNaN(n)?e.removeAttribute(i):e.setAttribute(i,n);break;case"popover":Qu("beforetoggle",e),Qu("toggle",e),lt(e,"popover",n);break;case"xlinkActuate":ut(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":ut(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":ut(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":ut(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":ut(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":ut(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":ut(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":ut(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":ut(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":lt(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<i.length)||"o"!==i[0]&&"O"!==i[0]||"n"!==i[1]&&"N"!==i[1])&&lt(e,i=Rt.get(i)||i,n)}}function cc(e,t,i,n,r,s){switch(i){case"style":At(e,n,s);break;case"dangerouslySetInnerHTML":if(null!=n){if("object"!==typeof n||!("__html"in n))throw Error(a(61));if(null!=(i=n.__html)){if(null!=r.children)throw Error(a(60));e.innerHTML=i}}break;case"children":"string"===typeof n?St(e,n):("number"===typeof n||"bigint"===typeof n)&&St(e,""+n);break;case"onScroll":null!=n&&Qu("scroll",e);break;case"onScrollEnd":null!=n&&Qu("scrollend",e);break;case"onClick":null!=n&&(e.onclick=Mt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:it.hasOwnProperty(i)||("o"!==i[0]||"n"!==i[1]||(r=i.endsWith("Capture"),t=i.slice(2,r?i.length-7:void 0),"function"===typeof(s=null!=(s=e[He]||null)?s[i]:null)&&e.removeEventListener(t,s,r),"function"!==typeof n)?i in e?e[i]=n:!0===n?e.setAttribute(i,""):lt(e,i,n):("function"!==typeof s&&null!==s&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,n,r)))}}function dc(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qu("error",e),Qu("load",e);var n,r=!1,s=!1;for(n in i)if(i.hasOwnProperty(n)){var o=i[n];if(null!=o)switch(n){case"src":r=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:uc(e,t,n,o,i,null)}}return s&&uc(e,t,"srcSet",i.srcSet,i,null),void(r&&uc(e,t,"src",i.src,i,null));case"input":Qu("invalid",e);var l=n=o=s=null,h=null,u=null;for(r in i)if(i.hasOwnProperty(r)){var c=i[r];if(null!=c)switch(r){case"name":s=c;break;case"type":o=c;break;case"checked":h=c;break;case"defaultChecked":u=c;break;case"value":n=c;break;case"defaultValue":l=c;break;case"children":case"dangerouslySetInnerHTML":if(null!=c)throw Error(a(137,t));break;default:uc(e,t,r,c,i,null)}}return void xt(e,n,l,h,u,o,s,!1);case"select":for(s in Qu("invalid",e),r=o=n=null,i)if(i.hasOwnProperty(s)&&null!=(l=i[s]))switch(s){case"value":n=l;break;case"defaultValue":o=l;break;case"multiple":r=l;default:uc(e,t,s,l,i,null)}return t=n,i=o,e.multiple=!!r,void(null!=t?wt(e,!!r,t,!1):null!=i&&wt(e,!!r,i,!0));case"textarea":for(o in Qu("invalid",e),n=s=r=null,i)if(i.hasOwnProperty(o)&&null!=(l=i[o]))switch(o){case"value":r=l;break;case"defaultValue":s=l;break;case"children":n=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(a(91));break;default:uc(e,t,o,l,i,null)}return void _t(e,r,s,n);case"option":for(h in i)if(i.hasOwnProperty(h)&&null!=(r=i[h]))if("selected"===h)e.selected=r&&"function"!==typeof r&&"symbol"!==typeof r;else uc(e,t,h,r,i,null);return;case"dialog":Qu("beforetoggle",e),Qu("toggle",e),Qu("cancel",e),Qu("close",e);break;case"iframe":case"object":Qu("load",e);break;case"video":case"audio":for(r=0;r<Xu.length;r++)Qu(Xu[r],e);break;case"image":Qu("error",e),Qu("load",e);break;case"details":Qu("toggle",e);break;case"embed":case"source":case"link":Qu("error",e),Qu("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in i)if(i.hasOwnProperty(u)&&null!=(r=i[u]))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:uc(e,t,u,r,i,null)}return;default:if(kt(t)){for(c in i)i.hasOwnProperty(c)&&(void 0!==(r=i[c])&&cc(e,t,c,r,i,void 0));return}}for(l in i)i.hasOwnProperty(l)&&(null!=(r=i[l])&&uc(e,t,l,r,i,null))}function fc(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}var pc=null,mc=null;
vendor: 9,740 bytes, line 2
2function gc(e){return 9===e.nodeType?e:e.ownerDocument}function vc(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function yc(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function xc(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"bigint"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var bc=null;var wc="function"===typeof setTimeout?setTimeout:void 0,Tc="function"===typeof clearTimeout?clearTimeout:void 0,_c="function"===typeof Promise?Promise:void 0,Sc="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof _c?function(e){return _c.resolve(null).then(e).catch(Ec)}:wc;function Ec(e){setTimeout(function(){throw e})}function Cc(e){return"head"===e}function Ac(e,t){var i=t,n=0;do{var r=i.nextSibling;if(e.removeChild(i),r&&8===r.nodeType)if("/$"===(i=r.data)||"/&"===i){if(0===n)return e.removeChild(r),void Yd(t);n--}else if("$"===i||"$?"===i||"$~"===i||"$!"===i||"&"===i)n++;else if("html"===i)Bc(e.ownerDocument.documentElement);else if("head"===i){Bc(i=e.ownerDocument.head);for(var s=i.firstChild;s;){var a=s.nextSibling,o=s.nodeName;s[qe]||"SCRIPT"===o||"STYLE"===o||"LINK"===o&&"stylesheet"===s.rel.toLowerCase()||i.removeChild(s),s=a}}else"body"===i&&Bc(e.ownerDocument.body);i=r}while(i);Yd(t)}function kc(e,t){var i=e;e=0;do{var n=i.nextSibling;if(1===i.nodeType?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",""===i.getAttribute("style")&&i.removeAttribute("style")):3===i.nodeType&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),n&&8===n.nodeType)if("/$"===(i=n.data)){if(0===e)break;e--}else"$"!==i&&"$?"!==i&&"$~"!==i&&"$!"!==i||e++;i=n}while(i)}function Rc(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Rc(i),Ke(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===i.rel.toLowerCase())continue}e.removeChild(i)}}function Oc(e,t){for(;8!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!t)return null;if(null===(e=Nc(e.nextSibling)))return null}return e}function Pc(e){return"$?"===e.data||"$~"===e.data}function Mc(e){return"$!"===e.data||"$?"===e.data&&"loading"!==e.ownerDocument.readyState}function Nc(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"$~"===t||"&"===t||"F!"===t||"F"===t)break;if("/$"===t||"/&"===t)return null}}return e}var Ic=null;function Lc(e){e=e.nextSibling;for(var t=0;e;){if(8===e.nodeType){var i=e.data;if("/$"===i||"/&"===i){if(0===t)return Nc(e.nextSibling);t--}else"$"!==i&&"$!"!==i&&"$?"!==i&&"$~"!==i&&"&"!==i||t++}e=e.nextSibling}return null}function Dc(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var i=e.data;if("$"===i||"$!"===i||"$?"===i||"$~"===i||"&"===i){if(0===t)return e;t--}else"/$"!==i&&"/&"!==i||t++}e=e.previousSibling}return null}function Fc(e,t,i){switch(t=gc(i),e){case"html":if(!(e=t.documentElement))throw Error(a(452));return e;case"head":if(!(e=t.head))throw Error(a(453));return e;case"body":if(!(e=t.body))throw Error(a(454));return e;default:throw Error(a(451))}}function Bc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ke(e)}var Uc=new Map,zc=new Set;function Vc(e){return"function"===typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var Hc=L.d;L.d={f:function(){var e=Hc.f(),t=$h();return e||t},r:function(e){var t=Je(e);null!==t&&5===t.tag&&"form"===t.type?io(t):Hc.r(e)},D:function(e){Hc.D(e),Yc("dns-prefetch",e,null)},C:function(e,t){Hc.C(e,t),Yc("preconnect",e,t)},L:function(e,t,i){Hc.L(e,t,i);var n=jc;if(n&&e&&t){var r='link[rel="preload"][as="'+vt(t)+'"]';"image"===t&&i&&i.imageSrcSet?(r+='[imagesrcset="'+vt(i.imageSrcSet)+'"]',"string"===typeof i.imageSizes&&(r+='[imagesizes="'+vt(i.imageSizes)+'"]')):r+='[href="'+vt(e)+'"]';var s=r;switch(t){case"style":s=Gc(e);break;case"script":s=Kc(e)}Uc.has(s)||(e=f({rel:"preload",href:"image"===t&&i&&i.imageSrcSet?void 0:e,as:t},i),Uc.set(s,e),null!==n.querySelector(r)||"style"===t&&n.querySelector(Xc(s))||"script"===t&&n.querySelector(Qc(s))||(dc(t=n.createElement("link"),"link",e),et(t),n.head.appendChild(t)))}},m:function(e,t){Hc.m(e,t);var i=jc;if(i&&e){var n=t&&"string"===typeof t.as?t.as:"script",r='link[rel="modulepreload"][as="'+vt(n)+'"][href="'+vt(e)+'"]',s=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Kc(e)}if(!Uc.has(s)&&(e=f({rel:"modulepreload",href:e},t),Uc.set(s,e),null===i.querySelector(r))){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Qc(s)))return}dc(n=i.createElement("link"),"link",e),et(n),i.head.appendChild(n)}}},X:function(e,t){Hc.X(e,t);var i=jc;if(i&&e){var n=$e(i).hoistableScripts,r=Kc(e),s=n.get(r);s||((s=i.querySelector(Qc(r)))||(e=f({src:e,async:!0},t),(t=Uc.get(r))&&ed(e,t),et(s=i.createElement("script")),dc(s,"link",e),i.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(r,s))}},S:function(e,t,i){Hc.S(e,t,i);var n=jc;if(n&&e){var r=$e(n).hoistableStyles,s=Gc(e);t=t||"default";var a=r.get(s);if(!a){var o={loading:0,preload:null};if(a=n.querySelector(Xc(s)))o.loading=5;else{e=f({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Uc.get(s))&&$c(e,i);var l=a=n.createElement("link");et(l),dc(l,"link",e),l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,Zc(a,t,n)}a={type:"stylesheet",instance:a,count:1,state:o},r.set(s,a)}}},M:function(e,t){Hc.M(e,t);var i=jc;if(i&&e){var n=$e(i).hoistableScripts,r=Kc(e),s=n.get(r);s||((s=i.querySelector(Qc(r)))||(e=f({src:e,async:!0,type:"module"},t),(t=Uc.get(r))&&ed(e,t),et(s=i.createElement("script")),dc(s,"link",e),i.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(r,s))}}};var jc="undefined"===typeof document?null:document;function Yc(e,t,i){var n=jc;if(n&&"string"===typeof t&&t){var r=vt(t);r='link[rel="'+e+'"][href="'+r+'"]',"string"===typeof i&&(r+='[crossorigin="'+i+'"]'),zc.has(r)||(zc.add(r),e={rel:e,crossOrigin:i,href:t},null===n.querySelector(r)&&(dc(t=n.createElement("link"),"link",e),et(t),n.head.appendChild(t)))}}function Wc(e,t,i,n){var r,s,o,l,h=(h=G.current)?Vc(h):null;if(!h)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return"string"===typeof i.precedence&&"string"===typeof i.href?(t=Gc(i.href),(n=(i=$e(h).hoistableStyles).get(t))||(n={type:"style",instance:null,count:0,state:null},i.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===i.rel&&"string"===typeof i.href&&"string"===typeof i.precedence){e=Gc(i.href);var u=$e(h).hoistableStyles,c=u.get(e);if(c||(h=h.ownerDocument||h,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,c),(u=h.querySelector(Xc(e)))&&!u._p&&(c.instance=u,c.state.loading=5),Uc.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Uc.set(e,i),u||(r=h,s=e,o=i,l=c.state,r.querySelector('link[rel="preload"][as="style"]['+s+"]")?l.loading=1:(s=r.createElement("link"),l.preload=s,s.addEventListener("load",function(){return l.loading|=1}),s.addEventListener("error",function(){return l.loading|=2}),dc(s,"link",o),et(s),r.head.appendChild(s))))),t&&null===n)throw Error(a(528,""));return c}if(t&&null!==n)throw Error(a(529,""));return null;case"script":return t=i.async,"string"===typeof(i=i.src)&&t&&"function"!==typeof t&&"symbol"!==typeof t?(t=Kc(i),(n=(i=$e(h).hoistableScripts).get(t))||(n={type:"script",instance:null,count:0,state:null},i.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Gc(e){return'href="'+vt(e)+'"'}function Xc(e){return'link[rel="stylesheet"]['+e+"]"}function qc(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Kc(e){return'[src="'+vt(e)+'"]'}function Qc(e){return"script[async]"+e}function Jc(e,t,i){if(t.count++,null===t.instance)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+vt(i.href)+'"]');if(n)return t.instance=n,et(n),n;var r=f({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return et(n=(e.ownerDocument||e).createElement("style")),dc(n,"style",r),Zc(n,i.precedence,e),t.instance=n;case"stylesheet":r=Gc(i.href);var s=e.querySelector(Xc(r));if(s)return t.state.loading|=4,t.instance=s,et(s),s;n=qc(i),(r=Uc.get(r))&&$c(n,r),et(s=(e.ownerDocument||e).createElement("link"));var o=s;return o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),dc(s,"link",n),t.state.loading|=4,Zc(s,i.precedence,e),t.instance=s;case"script":return s=Kc(i.src),(r=e.querySelector(Qc(s)))?(t.instance=r,et(r),r):(n=i,(r=Uc.get(s))&&ed(n=f({},i),r),et(r=(e=e.ownerDocument||e).createElement("script")),dc(r,"link",n),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(a(443,t.type))}else"stylesheet"===t.type&&0===(4&t.state.loading)&&(n=t.instance,t.state.loading|=4,Zc(n,i.precedence,e));return t.instance}function Zc(e,t,i){for(var n=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=n.length?n[n.length-1]:null,
vendor: 5,376 bytes, line 2
2s=r,a=0;a<n.length;a++){var o=n[a];if(o.dataset.precedence===t)s=o;else if(s!==r)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=9===i.nodeType?i.head:i).insertBefore(e,t.firstChild)}function $c(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function ed(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var td=null;function id(e,t,i){if(null===td){var n=new Map,r=td=new Map;r.set(i,n)}else(n=(r=td).get(i))||(n=new Map,r.set(i,n));if(n.has(e))return n;for(n.set(e,null),i=i.getElementsByTagName(e),r=0;r<i.length;r++){var s=i[r];if(!(s[qe]||s[Ve]||"link"===e&&"stylesheet"===s.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==s.namespaceURI){var a=s.getAttribute(t)||"";a=e+a;var o=n.get(a);o?o.push(s):n.set(a,[s])}}return n}function nd(e,t,i){(e=e.ownerDocument||e).head.insertBefore(i,"title"===t?e.querySelector("head > title"):null)}function rd(e){return"stylesheet"!==e.type||0!==(3&e.state.loading)}var sd=0;function ad(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ld(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var od=null;function ld(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,od=new Map,t.forEach(hd,e),od=null,ad.call(e))}function hd(e,t){if(!(4&t.state.loading)){var i=od.get(e);if(i)var n=i.get(null);else{i=new Map,od.set(e,i);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<r.length;s++){var a=r[s];"LINK"!==a.nodeName&&"not all"===a.getAttribute("media")||(i.set(a.dataset.precedence,a),n=a)}n&&i.set(null,n)}a=(r=t.instance).getAttribute("data-precedence"),(s=i.get(a)||n)===n&&i.set(null,r),i.set(a,r),this.count++,n=ad.bind(this),r.addEventListener("load",n),r.addEventListener("error",n),s?s.parentNode.insertBefore(r,s.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(r,e.firstChild),t.state.loading|=4}}var ud={$$typeof:w,Provider:null,Consumer:null,_currentValue:D,_currentValue2:D,_threadCount:0};function cd(e,t,i,n,r,s,a,o,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Pe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pe(0),this.hiddenUpdates=Pe(null),this.identifierPrefix=n,this.onUncaughtError=r,this.onCaughtError=s,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function dd(e,t,i,n,r,s,a,o,l,h,u,c){return e=new cd(e,t,i,a,l,h,u,c,o),t=1,!0===s&&(t|=24),s=Bn(3,null,null,t),e.current=s,s.stateNode=e,(t=Ur()).refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:n,isDehydrated:i,cache:t},gs(s),e}function fd(e){return e?e=Dn:Dn}function pd(e,t,i,n,r,s){r=fd(r),null===n.context?n.context=r:n.pendingContext=r,(n=ys(t)).payload={element:i},null!==(s=void 0===s?null:s)&&(n.callback=s),null!==(i=xs(e,n,t))&&(qh(i,0,t),bs(i,e,t))}function md(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var i=e.retryLane;e.retryLane=0!==i&&i<t?i:t}}function gd(e,t){md(e,t),(e=e.alternate)&&md(e,t)}function vd(e){if(13===e.tag||31===e.tag){var t=Nn(e,67108864);null!==t&&qh(t,0,67108864),gd(e,67108864)}}function yd(e){if(13===e.tag||31===e.tag){var t=Gh(),i=Nn(e,t=De(t));null!==i&&qh(i,0,t),gd(e,t)}}var xd=!0;function bd(e,t,i,n){var r=I.T;I.T=null;var s=L.p;try{L.p=2,Td(e,t,i,n)}finally{L.p=s,I.T=r}}function wd(e,t,i,n){var r=I.T;I.T=null;var s=L.p;try{L.p=8,Td(e,t,i,n)}finally{L.p=s,I.T=r}}function Td(e,t,i,n){if(xd){var r=_d(n);if(null===r)tc(e,t,n,Sd,i),Ld(e,n);else if(function(e,t,i,n,r){switch(t){case"focusin":return kd=Dd(kd,e,t,i,n,r),!0;case"dragenter":return Rd=Dd(Rd,e,t,i,n,r),!0;case"mouseover":return Od=Dd(Od,e,t,i,n,r),!0;case"pointerover":var s=r.pointerId;return Pd.set(s,Dd(Pd.get(s)||null,e,t,i,n,r)),!0;case"gotpointercapture":return s=r.pointerId,Md.set(s,Dd(Md.get(s)||null,e,t,i,n,r)),!0}return!1}(r,e,t,i,n))n.stopPropagation();else if(Ld(e,n),4&t&&-1<Id.indexOf(e)){for(;null!==r;){var s=Je(r);if(null!==s)switch(s.tag){case 3:if((s=s.stateNode).current.memoizedState.isDehydrated){var a=Ce(s.pendingLanes);if(0!==a){var o=s;for(o.pendingLanes|=2,o.entangledLanes|=2;a;){var l=1<<31-be(a);o.entanglements[1]|=l,a&=~l}Lu(s),0===(6&fh)&&(Ih=le()+500,Du(0,!1))}}break;case 31:case 13:null!==(o=Nn(s,2))&&qh(o,0,2),$h(),gd(s,2)}if(null===(s=_d(n))&&tc(e,t,n,Sd,i),s===r)break;r=s}null!==r&&n.stopPropagation()}else tc(e,t,n,null,i)}}function _d(e){return Ed(e=It(e))}var Sd=null;function Ed(e){if(Sd=null,null!==(e=Qe(e))){var t=l(e);if(null===t)e=null;else{var i=t.tag;if(13===i){if(null!==(e=h(t)))return e;e=null}else if(31===i){if(null!==(e=u(t)))return e;e=null}else if(3===i){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Sd=e,null}function Cd(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close"
vendor: 6,760 bytes, line 2
2:case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(he()){case ue:return 2;case ce:return 8;case de:case fe:return 32;case pe:return 268435456;default:return 32}default:return 32}}var Ad=!1,kd=null,Rd=null,Od=null,Pd=new Map,Md=new Map,Nd=[],Id="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Ld(e,t){switch(e){case"focusin":case"focusout":kd=null;break;case"dragenter":case"dragleave":Rd=null;break;case"mouseover":case"mouseout":Od=null;break;case"pointerover":case"pointerout":Pd.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Md.delete(t.pointerId)}}function Dd(e,t,i,n,r,s){return null===e||e.nativeEvent!==s?(e={blockedOn:t,domEventName:i,eventSystemFlags:n,nativeEvent:s,targetContainers:[r]},null!==t&&(null!==(t=Je(t))&&vd(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,null!==r&&-1===t.indexOf(r)&&t.push(r),e)}function Fd(e){var t=Qe(e.target);if(null!==t){var i=l(t);if(null!==i)if(13===(t=i.tag)){if(null!==(t=h(i)))return e.blockedOn=t,void Ue(e.priority,function(){yd(i)})}else if(31===t){if(null!==(t=u(i)))return e.blockedOn=t,void Ue(e.priority,function(){yd(i)})}else if(3===t&&i.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===i.tag?i.stateNode.containerInfo:null)}e.blockedOn=null}function Bd(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var i=_d(e.nativeEvent);if(null!==i)return null!==(t=Je(i))&&vd(t),e.blockedOn=i,!1;var n=new(i=e.nativeEvent).constructor(i.type,i);Nt=n,i.target.dispatchEvent(n),Nt=null,t.shift()}return!0}function Ud(e,t,i){Bd(e)&&i.delete(t)}function zd(){Ad=!1,null!==kd&&Bd(kd)&&(kd=null),null!==Rd&&Bd(Rd)&&(Rd=null),null!==Od&&Bd(Od)&&(Od=null),Pd.forEach(Ud),Md.forEach(Ud)}function Vd(e,t){e.blockedOn===t&&(e.blockedOn=null,Ad||(Ad=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,zd)))}var Hd=null;function jd(e){Hd!==e&&(Hd=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Hd===e&&(Hd=null);for(var t=0;t<e.length;t+=3){var i=e[t],n=e[t+1],r=e[t+2];if("function"!==typeof n){if(null===Ed(n||i))continue;break}var s=Je(i);null!==s&&(e.splice(t,3),t-=3,eo(s,{pending:!0,data:r,method:i.method,action:n},n,r))}}))}function Yd(e){function t(t){return Vd(t,e)}null!==kd&&Vd(kd,e),null!==Rd&&Vd(Rd,e),null!==Od&&Vd(Od,e),Pd.forEach(t),Md.forEach(t);for(var i=0;i<Nd.length;i++){var n=Nd[i];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Nd.length&&null===(i=Nd[0]).blockedOn;)Fd(i),null===i.blockedOn&&Nd.shift();if(null!=(i=(e.ownerDocument||e).$$reactFormReplay))for(n=0;n<i.length;n+=3){var r=i[n],s=i[n+1],a=r[He]||null;if("function"===typeof s)a||jd(i);else if(a){var o=null;if(s&&s.hasAttribute("formAction")){if(r=s,a=s[He]||null)o=a.formAction;else if(null!==Ed(r))continue}else o=a.action;"function"===typeof o?i[n+1]=o:(i.splice(n,3),n-=3),jd(i)}}}function Wd(){function e(e){e.canIntercept&&"react-transition"===e.info&&e.intercept({handler:function(){return new Promise(function(e){return r=e})},focusReset:"manual",scroll:"manual"})}function t(){null!==r&&(r(),r=null),n||setTimeout(i,20)}function i(){if(!n&&!navigation.transition){var e=navigation.currentEntry;e&&null!=e.url&&navigation.navigate(e.url,{state:e.getState(),info:"react-transition",history:"replace"})}}if("object"===typeof navigation){var n=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),null!==r&&(r(),r=null)}}}function Gd(e){this._internalRoot=e}function Xd(e){this._internalRoot=e}Xd.prototype.render=Gd.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(a(409));pd(t.current,Gh(),e,t,null,null)},Xd.prototype.unmount=Gd.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;pd(e.current,2,null,e,null,null),$h(),t[je]=null}},Xd.prototype.unstable_scheduleHydration=function(e){if(e){var t=Be();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Nd.length&&0!==t&&t<Nd[i].priority;i++);Nd.splice(i,0,e),0===i&&Fd(e)}};var qd=r.version;if("19.2.7"!==qd)throw Error(a(527,qd,"19.2.7"));L.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(a(188));throw e=Object.keys(e).join(","),Error(a(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=l(e)))throw Error(a(188));return t!==e?null:e}for(var i=e,n=t;;){var r=i.return;if(null===r)break;var s=r.alternate;if(null===s){if(null!==(n=r.return)){i=n;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===i)return c(r),e;if(s===n)return c(r),t;s=s.sibling}throw Error(a(188))}if(i.return!==n.return)i=r,n=s;else{for(var o=!1,h=r.child;h;){if(h===i){o=!0,i=r,n=s;break}if(h===n){o=!0,n=r,i=s;break}h=h.sibling}if(!o){for(h=s.child;h;){if(h===i){o=!0,i=s,n=r;break}if(h===n){o=!0,n=s,i=r;break}h=h.sibling}if(!o)throw Error(a(189))}}if(i.alternate!==n)throw Error(a(190))}if(3!==i.tag)throw Error(a(188));return i.stateNode.current===i?e:t}(t),e=null===(e=null!==e?d(e):null)?null:e.stateNode};var Kd={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.7"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Qd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qd.isDisabled&&Qd.supportsFiber)try{ve=Qd.inject(Kd),ye=Qd}
2catch(Zd){}}t.createRoot=function(e,t){if(!o(e))throw Error(a(299));var i=!1,n="",r=So,s=Eo,l=Co;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(i=!0),void 0!==t.identifierPrefix&&(n=t.identifierPrefix),void 0!==t.onUncaughtError&&(r=t.onUncaughtError),void 0!==t.onCaughtError&&(s=t.onCaughtError),void 0!==t.onRecoverableError&&(l=t.onRecoverableError)),t=dd(e,1,!1,null,0,i,n,null,r,s,l,Wd),e[je]=t.current,$u(e),new Gd(t)},t.hydrateRoot=function(e,t,i){if(!o(e))throw Error(a(299));var n=!1,r="",s=So,l=Eo,h=Co,u=null;return null!==i&&void 0!==i&&(!0===i.unstable_strictMode&&(n=!0),void 0!==i.identifierPrefix&&(r=i.identifierPrefix),void 0!==i.onUncaughtError&&(s=i.onUncaughtError),void 0!==i.onCaughtError&&(l=i.onCaughtError),void 0!==i.onRecoverableError&&(h=i.onRecoverableError),void 0!==i.formState&&(u=i.formState)),(t=dd(e,1,!0,t,0,n,r,u,s,l,h,Wd)).context=fd(null),i=t.current,(r=ys(n=De(n=Gh()))).callback=null,xs(i,r,n),i=n,t.current.lanes=i,Me(t,i),Lu(t),e[je]=t.current,$u(e),new Xd(t)},t.version="19.2.7"},672(e,t,i){"use strict";var n=i(43);function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var a={d:{f:s,r:function(){throw Error(r(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");var l=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(e,t){return"font"===e?"":"string"===typeof t?"use-credentials"===t?t:"":void 0}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,t.createPortal=function(e,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(r(299));return function(e,t,i){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:o,key:null==n?null:""+n,children:e,containerInfo:t,implementation:i}}(e,t,null,i)},t.flushSync=function(e){var t=l.T,i=a.p;try{if(l.T=null,a.p=2,e)return e()}finally{l.T=t,a.p=i,a.d.f()}},t.preconnect=function(e,t){"string"===typeof e&&(t?t="string"===typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,a.d.C(e,t))},t.prefetchDNS=function(e){"string"===typeof e&&a.d.D(e)},t.preinit=function(e,t){if("string"===typeof e&&t&&"string"===typeof t.as){var i=t.as,n=h(i,t.crossOrigin),r="string"===typeof t.integrity?t.integrity:void 0,s="string"===typeof t.fetchPriority?t.fetchPriority:void 0;"style"===i?a.d.S(e,"string"===typeof t.precedence?t.precedence:void 0,{crossOrigin:n,integrity:r,fetchPriority:s}):"script"===i&&a.d.X(e,{crossOrigin:n,integrity:r,fetchPriority:s,nonce:"string"===typeof t.nonce?t.nonce:void 0})}},t.preinitModule=function(e,t){if("string"===typeof e)if("object"===typeof t&&null!==t){if(null==t.as||"script"===t.as){var i=h(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:i,integrity:"string"===typeof t.integrity?t.integrity:void 0,nonce:"string"===typeof t.nonce?t.nonce:void 0})}}else null==t&&a.d.M(e)},t.preload=function(e,t){if("string"===typeof e&&"object"===typeof t&&null!==t&&"string"===typeof t.as){var i=t.as,n=h(i,t.crossOrigin);a.d.L(e,i,{crossOrigin:n,integrity:"string"===typeof t.integrity?t.integrity:void 0,nonce:"string"===typeof t.nonce?t.nonce:void 0,type:"string"===typeof t.type?t.type:void 0,fetchPriority:"string"===typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"===typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"===typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"===typeof t.imageSizes?t.imageSizes:void 0,media:"string"===typeof t.media?t.media:void 0})}},t.preloadModule=function(e,t){if("string"===typeof e)if(t){var i=h(t.as,t.crossOrigin);a.d.m(e,{as:"string"===typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:i,integrity:"string"===typeof t.integrity?t.integrity:void 0})}else a.d.m(e)},t.requestFormReset=function(e){a.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,i){return l.H.useFormState(e,t,i)},t.useFormStatus=function(){return l.H.useHostTransitionStatus()},t.version="19.2.7"},391(e,t,i){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=i(4)},950(e,t,i){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=i(672)},366(e){var t="undefined"!==typeof Element,i="function"===typeof Map,n="function"===typeof Set,r="function"===typeof ArrayBuffer&&!!ArrayBuffer.isView;function s(e,a){if(e===a)return!0;
2if(e&&a&&"object"==typeof e&&"object"==typeof a){if(e.constructor!==a.constructor)return!1;var o,l,h,u;if(Array.isArray(e)){if((o=e.length)!=a.length)return!1;for(l=o;0!==l--;)if(!s(e[l],a[l]))return!1;return!0}if(i&&e instanceof Map&&a instanceof Map){if(e.size!==a.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!a.has(l.value[0]))return!1;for(u=e.entries();!(l=u.next()).done;)if(!s(l.value[1],a.get(l.value[0])))return!1;return!0}if(n&&e instanceof Set&&a instanceof Set){if(e.size!==a.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!a.has(l.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(a)){if((o=e.length)!=a.length)return!1;for(l=o;0!==l--;)if(e[l]!==a[l])return!1;return!0}if(e.constructor===RegExp)return e.source===a.source&&e.flags===a.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"===typeof e.valueOf&&"function"===typeof a.valueOf)return e.valueOf()===a.valueOf();if(e.toString!==Object.prototype.toString&&"function"===typeof e.toString&&"function"===typeof a.toString)return e.toString()===a.toString();if((o=(h=Object.keys(e)).length)!==Object.keys(a).length)return!1;for(l=o;0!==l--;)if(!Object.prototype.hasOwnProperty.call(a,h[l]))return!1;if(t&&e instanceof Element)return!1;for(l=o;0!==l--;)if(("_owner"!==h[l]&&"__v"!==h[l]&&"__o"!==h[l]||!e.$$typeof)&&!s(e[h[l]],a[h[l]]))return!1;return!0}return e!==e&&a!==a}e.exports=function(e,t){try{return s(e,t)}catch(i){if((i.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw i}}},799(e,t){"use strict";var i=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(e,t,n){var r=null;if(void 0!==n&&(r=""+n),void 0!==t.key&&(r=""+t.key),"key"in t)for(var s in n={},t)"key"!==s&&(n[s]=t[s]);else n=t;return t=n.ref,{$$typeof:i,type:e,key:r,ref:void 0!==t?t:null,props:n}}t.Fragment=n,t.jsx=r,t.jsxs=r},288(e,t){"use strict";var i=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),p=Symbol.iterator;var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,v={};function y(e,t,i){this.props=e,this.context=t,this.refs=v,this.updater=i||m}function x(){}function b(e,t,i){this.props=e,this.context=t,this.refs=v,this.updater=i||m}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},x.prototype=y.prototype;var w=b.prototype=new x;w.constructor=b,g(w,y.prototype),w.isPureReactComponent=!0;var T=Array.isArray;function _(){}var S={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function C(e,t,n){var r=n.ref;return{$$typeof:i,type:e,key:t,ref:void 0!==r?r:null,props:n}}function A(e){return"object"===typeof e&&null!==e&&e.$$typeof===i}var k=/\/+/g;function R(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function O(e,t,r,s,a){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var l,h,u=!1;if(null===e)u=!0;else switch(o){case"bigint":case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case i:case n:u=!0;break;case d:return O((u=e._init)(e._payload),t,r,s,a)}}if(u)return a=a(e),u=""===s?"."+R(e,0):s,T(a)?(r="",null!=u&&(r=u.replace(k,"$&/")+"/"),O(a,t,r,"",function(e){return e})):null!=a&&(A(a)&&(l=a,h=r+(null==a.key||e&&e.key===a.key?"":(""+a.key).replace(k,"$&/")+"/")+u,a=C(l.type,h,l.props)),t.push(a)),1;u=0;var c,f=""===s?".":s+":";if(T(e))for(var m=0;m<e.length;m++)u+=O(s=e[m],t,r,o=f+R(s,m),a);else if("function"===typeof(m=null===(c=e)||"object"!==typeof c?null:"function"===typeof(c=
2p&&c[p]||c["@@iterator"])?c:null))for(e=m.call(e),m=0;!(s=e.next()).done;)u+=O(s=s.value,t,r,o=f+R(s,m++),a);else if("object"===o){if("function"===typeof e.then)return O(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"===typeof e.status?e.then(_,_):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,r,s,a);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return u}function P(e,t,i){if(null==e)return e;var n=[],r=0;return O(e,n,"","",function(e){return t.call(i,e,r++)}),n}function M(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var N="function"===typeof reportError?reportError:function(e){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof e&&null!==e&&"string"===typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"===typeof process&&"function"===typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},I={map:P,forEach:function(e,t,i){P(e,function(){t.apply(this,arguments)},i)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!A(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};t.Activity=f,t.Children=I,t.Component=y,t.Fragment=r,t.Profiler=a,t.PureComponent=b,t.StrictMode=s,t.Suspense=u,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return S.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,i){if(null===e||void 0===e)throw Error("The argument must be a React element, but you passed "+e+".");var n=g({},e.props),r=e.key;
vendor: 5,711 bytes, line 2
2if(null!=t)for(s in void 0!==t.key&&(r=""+t.key),t)!E.call(t,s)||"key"===s||"__self"===s||"__source"===s||"ref"===s&&void 0===t.ref||(n[s]=t[s]);var s=arguments.length-2;if(1===s)n.children=i;else if(1<s){for(var a=Array(s),o=0;o<s;o++)a[o]=arguments[o+2];n.children=a}return C(e.type,r,n)},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:o,_context:e},e},t.createElement=function(e,t,i){var n,r={},s=null;if(null!=t)for(n in void 0!==t.key&&(s=""+t.key),t)E.call(t,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(r[n]=t[n]);var a=arguments.length-2;if(1===a)r.children=i;else if(1<a){for(var o=Array(a),l=0;l<a;l++)o[l]=arguments[l+2];r.children=o}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===r[n]&&(r[n]=a[n]);return C(e,s,r)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:h,render:e}},t.isValidElement=A,t.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:M}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=S.T,i={};S.T=i;try{var n=e(),r=S.S;null!==r&&r(i,n),"object"===typeof n&&null!==n&&"function"===typeof n.then&&n.then(_,N)}catch(s){N(s)}finally{null!==t&&null!==i.types&&(t.types=i.types),S.T=t}},t.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},t.use=function(e){return S.H.use(e)},t.useActionState=function(e,t,i){return S.H.useActionState(e,t,i)},t.useCallback=function(e,t){return S.H.useCallback(e,t)},t.useContext=function(e){return S.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return S.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return S.H.useEffect(e,t)},t.useEffectEvent=function(e){return S.H.useEffectEvent(e)},t.useId=function(){return S.H.useId()},t.useImperativeHandle=function(e,t,i){return S.H.useImperativeHandle(e,t,i)},t.useInsertionEffect=function(e,t){return S.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return S.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return S.H.useMemo(e,t)},t.useOptimistic=function(e,t){return S.H.useOptimistic(e,t)},t.useReducer=function(e,t,i){return S.H.useReducer(e,t,i)},t.useRef=function(e){return S.H.useRef(e)},t.useState=function(e){return S.H.useState(e)},t.useSyncExternalStore=function(e,t,i){return S.H.useSyncExternalStore(e,t,i)},t.useTransition=function(){return S.H.useTransition()},t.version="19.2.7"},43(e,t,i){"use strict";e.exports=i(288)},579(e,t,i){"use strict";e.exports=i(799)},896(e,t){"use strict";function i(e,t){var i=e.length;e.push(t);e:for(;0<i;){var n=i-1>>>1,r=e[n];if(!(0<s(r,t)))break e;e[n]=t,e[i]=r,i=n}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],i=e.pop();if(i!==t){e[0]=i;e:for(var n=0,r=e.length,a=r>>>1;n<a;){var o=2*(n+1)-1,l=e[o],h=o+1,u=e[h];if(0>s(l,i))h<r&&0>s(u,l)?(e[n]=u,e[h]=i,n=h):(e[n]=l,e[o]=i,n=o);else{if(!(h<r&&0>s(u,i)))break e;e[n]=u,e[h]=i,n=h}}}return t}function s(e,t){var i=e.sortIndex-t.sortIndex;return 0!==i?i:e.id-t.id}if(t.unstable_now=void 0,"object"===typeof performance&&"function"===typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var h=[],u=[],c=1,d=null,f=3,p=!1,m=!1,g=!1,v=!1,y="function"===typeof setTimeout?setTimeout:null,x="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function w(e){for(var t=n(u);null!==t;){if(null===t.callback)r(u);else{if(!(t.startTime<=e))break;r(u),t.sortIndex=t.expirationTime,i(h,t)}t=n(u)}}function T(e){if(g=!1,w(e),!m)if(null!==n(h))m=!0,S||(S=!0,_());else{var t=n(u);null!==t&&M(T,t.startTime-e)}}var _,S=!1,E=-1,C=5,A=-1;function k(){return!!v||!(t.unstable_now()-A<C)}function R(){if(v=!1,S){var e=t.unstable_now();A=e;var i=!0;try{e:{m=!1,g&&(g=!1,x(E),E=-1),p=!0;var s=f;try{t:{for(w(e),d=n(h);null!==d&&!(d.expirationTime>e&&k());){var a=d.callback;if("function"===typeof a){d.callback=null,f=d.priorityLevel;var o=a(d.expirationTime<=e);if(e=t.unstable_now(),"function"===typeof o){d.callback=o,w(e),i=!0;break t}d===n(h)&&r(h),w(e)}else r(h);d=n(h)}if(null!==d)i=!0;else{var l=n(u);null!==l&&M(T,l.startTime-e),i=!1}}break e}finally{d=null,f=s,p=!1}i=void 0}}finally{i?_():S=!1}}}if("function"===typeof b)_=function(){b(R)};else if("undefined"!==typeof MessageChannel){var O=new MessageChannel,P=O.port2;O.port1.onmessage=R,_=function(){P.postMessage(null)}}else _=function(){y(R,0)};function M(e,i){E=y(function(){e(t.unstable_now())},i)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var i=f;f=t;try{return e()}finally{f=i}},t.unstable_requestPaint=function(){v=!0},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var i=f;f=e;try{return t()}finally{f=i}},t.unstable_scheduleCallback=function(e,r,s){var a=t.unstable_now();switch("object"===typeof s&&null!==s?s="number"===typeof(s=s.delay)&&0<s?a+s:a:s=a,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}
2return e={id:c++,callback:r,priorityLevel:e,startTime:s,expirationTime:o=s+o,sortIndex:-1},s>a?(e.sortIndex=s,i(u,e),null===n(h)&&e===n(u)&&(g?(x(E),E=-1):g=!0,M(T,s-a))):(e.sortIndex=o,i(h,e),m||p||(m=!0,S||(S=!0,_()))),e},t.unstable_shouldYield=k,t.unstable_wrapCallback=function(e){var t=f;return function(){var i=f;f=t;try{return e.apply(this,arguments)}finally{f=i}}}},853(e,t,i){"use strict";e.exports=i(896)},324(e){e.exports=function(e,t,i,n){var r=i?i.call(n,e,t):void 0;if(void 0!==r)return!!r;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),l=0;l<s.length;l++){var h=s[l];if(!o(h))return!1;var u=e[h],c=t[h];if(!1===(r=i?i.call(n,u,c,h):void 0)||void 0===r&&u!==c)return!1}return!0}}};const t={};function i(n){const r=t[n];if(void 0!==r)return r.exports;const s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}i.m=e,i.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},(()=>{const e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;let t;i.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"===typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"===typeof n.then)return n}const s=Object.create(null);i.r(s);const a={};t=t||[null,e({}),e([]),e(e)];for(var o=2&r&&n;("object"==typeof o||"function"==typeof o)&&!~t.indexOf(o);o=e(o))Object.getOwnPropertyNames(o).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,i.d(s,a),s}})(),i.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var r=t[n++],s=t[n++];i.o(e,r)?0===s&&n++:0===s?Object.defineProperty(e,r,{enumerable:!0,value:t[n++]}):Object.defineProperty(e,r,{enumerable:!0,get:s})}else for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,n)=>(i.f[n](e,t),t),[])),i.u=e=>"static/js/"+e+".ab880208.chunk.js",i.miniCssF=e=>{},i.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="my-app:";i.l=(n,r,s,a)=>{if(e[n])return void e[n].push(r);let o,l;if(void 0!==s){const e=document.getElementsByTagName("script");for(var h=0;h<e.length;h++){const i=e[h];if(i.getAttribute("src")==n||i.getAttribute("data-webpack")==t+s){o=i;break}}}o||(l=!0,o=document.createElement("script"),o.charset="utf-8",i.nc&&o.setAttribute("nonce",i.nc),o.setAttribute("data-webpack",t+s),o.src=n),e[n]=[r];const u=(t,i)=>{o.onerror=o.onload=null,clearTimeout(c);const r=e[n];if(delete e[n],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(e=>e(i)),t)return t(i)},c=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),l&&document.head.appendChild(o)}})(),i.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.p="/",(()=>{const e={792:0};i.f.j=(t,n)=>{let r=i.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{const s=new Promise((i,n)=>r=e[t]=[i,n]);n.push(r[2]=s);const a=i.p+i.u(t),o=new Error,l=n=>{if(i.o(e,t)&&(r=e[t],0!==r&&(e[t]=void 0),r)){const e=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;o.message="Loading chunk "+t+" failed.\n("+e+": "+i+")",o.name="ChunkLoadError",o.type=e,o.request=i,r[1](o)}};i.l(a,l,"chunk-"+t,t)}};const t=(t,n)=>{let[r,s,a]=n;var o,l,h=0;if(r.some(t=>0!==e[t])){for(o in s)i.o(s,o)&&(i.m[o]=s[o]);if(a)a(i)}for(t&&t(n);h<r.length;h++)l=r[h],i.o(e,l)&&e[l]&&e[l][0](),e[l]=0},n=self.webpackChunkmy_app=self.webpackChunkmy_app||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";var e=i(43),t=i.t(e,2),n=i(391);function r(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)i=s[n],-1===t.indexOf(i)&&{}.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function a(e){if(Array.isArray(e))return e}function o(e,t){if(e){if("string"==typeof e)return s(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?s(e,t):void 0}}
2function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e){return a(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(e)||l()}function u(e,t){return a(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,a,o=[],l=!0,h=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(e){h=!0,r=e}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(h)throw r}}return o}}(e,t)||o(e,t)||l()}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==c(t)?t:t+""}function f(e,t,i){return(t=d(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function p(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function m(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?p(Object(i),!0).forEach(function(t){f(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):p(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}const g=["sri"],v=["page"],y=["page","matches"],x=["page","matches"],b=["onClick","discover","prefetch","relative","reloadDocument","replace","mask","state","target","to","preventScrollReset","viewTransition","defaultShouldRevalidate"],w=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],T=["discover","fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition","defaultShouldRevalidate"];var _=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,S=/^[\\/]{2}/;function E(e,t){return t+e.replace(/\\/g,"/")}var C="popstate";function A(e){return"object"===typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function k(){return L(function(e,t){var i;let n=null===(i=t.state)||void 0===i?void 0:i.masked,r=n||e.location;return M("",{pathname:r.pathname,search:r.search,hash:r.hash},t.state&&t.state.usr||null,t.state&&t.state.key||"default",n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)},function(e,t){return"string"===typeof t?t:N(t)},null,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}function R(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function O(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(oT){}}}function P(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function M(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;return m(m({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?I(t):t),{},{state:i,key:t&&t.key||n||Math.random().toString(36).substring(2,10),mask:r})}function N(e){let t=e.pathname,i=void 0===t?"/":t,n=e.search,r=void 0===n?"":n,s=e.hash,a=void 0===s?"":s;return r&&"?"!==r&&(i+="?"===r.charAt(0)?r:"?"+r),a&&"#"!==a&&(i+="#"===a.charAt(0)?a:"#"+a),i}function I(e){let t={};if(e){let i=e.indexOf("#");i>=0&&(t.hash=e.substring(i),e=e.substring(0,i));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function L(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n.window,s=void 0===r?document.defaultView:r,a=n.v5Compat,o=void 0!==a&&a,l=s.history,h="POP",u=null,c=d();function d(){return(l.state||{idx:null}).idx}function f(){h="POP";let e=d(),t=null==e?null:e-c;c=e,u&&u({action:h,location:g.location,delta:t})}function p(e){return D(s,e)}null==c&&(c=0,l.replaceState(m(m({},l.state),{},{idx:c}),""));let g={get action(){return h},get location(){return e(s,l)},listen(e){if(u)throw new Error("A history only accepts one active listener");return s.addEventListener(C,f),u=e,()=>{s.removeEventListener(C,f),u=null}},createHref:e=>t(s,e),createURL:p,encodeLocation(e){let t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){h="PUSH";let n=A(e)?e:M(g.location,e,t);i&&i(n,e),c=d()+1;let r=P(n,c),a=g.createHref(n.mask||n);try{l.pushState(r,"",a)}catch(_E){if(_E instanceof DOMException&&"DataCloneError"===_E.name)throw _E;s.location.assign(a)}o&&u&&u({action:h,location:g.location,delta:1})},replace:function(e,t){h="REPLACE";let n=A(e)?e:M(g.location,e,t);i&&i(n,e),c=d();let r=P(n,c),s=g.createHref(n.mask||n);l.replaceState(r,"",s),o&&u&&u({action:h,location:g.location,delta:0})},go:e=>l.go(e)};return g}function D(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n="http://localhost";e&&(n="null"!==e.location.origin?e.location.origin:e.location.href),R(n,"No window.location.(origin|href) available to create URL");let r="string"===typeof t?t:N(t);return r=r.replace(/ $/,"%20"),!i&&S.test(r)&&(r=n+r),new URL(r,n)}new WeakMap;function F(e,t){return B(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/",!1)}
2function B(e,t,i,n,r){let s=te(("string"===typeof t?I(t):t).pathname||"/",i);if(null==s)return null;let a=null!==r&&void 0!==r?r:U(e),o=null,l=ee(s);for(let h=0;null==o&&h<a.length;++h)o=Q(a[h],l,n);return o}function U(e){let t=z(e);return function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let i=e.length===t.length&&e.slice(0,-1).every((e,i)=>e===t[i]);return i?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(t),t}function z(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=function(e,s){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r,o=arguments.length>3?arguments[3]:void 0,l={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:s,route:e};if(l.relativePath.startsWith("/")){if(!l.relativePath.startsWith(n)&&a)return;R(l.relativePath.startsWith(n),'Absolute route path "'.concat(l.relativePath,'" nested under path "').concat(n,'" is not valid. An absolute child route path must start with the combined path of all its parent routes.')),l.relativePath=l.relativePath.slice(n.length)}let h=le([n,l.relativePath]),c=i.concat(l);e.children&&e.children.length>0&&(R(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'.concat(h,'".')),z(e.children,t,c,h,a)),(null!=e.path||e.index)&&t.push({path:h,score:K(h,e.index),routesMeta:c.map((e,t)=>{let i=u($(e.relativePath,e.caseSensitive,t===c.length-1),2),n=i[0],r=i[1];return m(m({},e),{},{matcher:n,compiledParams:r})})})};return e.forEach((e,t)=>{var i;if(""!==e.path&&null!==(i=e.path)&&void 0!==i&&i.includes("?"))for(let n of V(e.path))s(e,t,!0,n);else s(e,t)}),t}function V(e){let t=e.split("/");if(0===t.length)return[];let i=h(t),n=i[0],r=s(i).slice(1),a=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return a?[o,""]:[o];let l=V(r.join("/")),u=[];return u.push(...l.map(e=>""===e?o:[o,e].join("/"))),a&&u.push(...l),u.map(t=>e.startsWith("/")&&""===t?"/":t)}var H=/^:[\w-]+$/,j=3,Y=2,W=1,G=10,X=-2,q=e=>"*"===e;function K(e,t){let i=e.split("/"),n=i.length;return i.some(q)&&(n+=X),t&&(n+=Y),i.filter(e=>!q(e)).reduce((e,t)=>e+(H.test(t)?j:""===t?W:G),n)}function Q(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.routesMeta,r={},s="/",a=[];for(let o=0;o<n.length;++o){let e=n[o],l=o===n.length-1,h="/"===s?t:t.slice(s.length)||"/",u={path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c=e.matcher&&e.compiledParams?Z(u,h,e.matcher,e.compiledParams):J(u,h),d=e.route;if(!c&&l&&i&&!n[n.length-1].route.index&&(c=J({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},h)),!c)return null;
2Object.assign(r,c.params),a.push({params:r,pathname:le([s,c.pathname]),pathnameBase:ue(le([s,c.pathnameBase])),route:d}),"/"!==c.pathnameBase&&(s=le([s,c.pathnameBase]))}return a}function J(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let i=u($(e.path,e.caseSensitive,e.end),2);return Z(e,t,i[0],i[1])}function Z(e,t,i,n){let r=t.match(i);if(!r)return null;let s=r[0],a=s.replace(/(.)\/+$/,"$1"),o=r.slice(1);return{params:n.reduce((e,t,i)=>{let n=t.paramName,r=t.isOptional;if("*"===n){let e=o[i]||"";a=s.slice(0,s.length-e.length).replace(/(.)\/+$/,"$1")}const l=o[i];return e[n]=r&&!l?void 0:(l||"").replace(/%2F/g,"/"),e},{}),pathname:s,pathnameBase:a,pattern:e}}function $(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];O("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'.concat(e,'" will be treated as if it were "').concat(e.replace(/\*$/,"/*"),'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "').concat(e.replace(/\*$/,"/*"),'".'));let n=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,i,r,s)=>{if(n.push({paramName:t,isOptional:null!=i}),i){let t=s.charAt(r+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),r+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?r+="\\/*$":""!==e&&"/"!==e&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),n]}function ee(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(_E){return O(!1,'The URL path "'.concat(e,'" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (').concat(_E,").")),e}}function te(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let i=t.endsWith("/")?t.length-1:t.length,n=e.charAt(i);return n&&"/"!==n?null:e.slice(i)||"/"}function ie(e,t){let i=he(t).split("/");return e.split("/").forEach(e=>{".."===e?i.length>1&&i.pop():"."!==e&&i.push(e)}),i.length>1?i.join("/"):"/"}function ne(e,t,i,n){return"Cannot include a '".concat(e,"' character in a manually specified `to.").concat(t,"` field [").concat(JSON.stringify(n),"].  Please separate it out to the `to.").concat(i,'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.')}function re(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function se(e){let t=re(e);return t.map((e,i)=>i===t.length-1?e.pathname:e.pathnameBase)}function ae(e,t,i){let n,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];"string"===typeof e?n=I(e):(n=m({},e),R(!n.pathname||!n.pathname.includes("?"),ne("?","pathname","search",n)),R(!n.pathname||!n.pathname.includes("#"),ne("#","pathname","hash",n)),R(!n.search||!n.search.includes("#"),ne("#","search","hash",n)));let s,a=""===e||""===n.pathname,o=a?"/":n.pathname;if(null==o)s=i;else{let e=t.length-1;if(!r&&o.startsWith("..")){let t=o.split("/");for(;".."===t[0];)t.shift(),e-=1;n.pathname=t.join("/")}s=e>=0?t[e]:"/"}let l=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",n="string"===typeof e?I(e):e,r=n.pathname,s=n.search,a=void 0===s?"":s,o=n.hash,l=void 0===o?"":o;return r?(r=oe(r),t=r.startsWith("/")?ie(r.substring(1),"/"):ie(r,i)):t=i,{pathname:t,search:ce(a),hash:de(l)}}(n,s),h=o&&"/"!==o&&o.endsWith("/"),u=(a||"."===o)&&i.endsWith("/");return l.pathname.endsWith("/")||!h&&!u||(l.pathname+="/"),l}var oe=e=>e.replace(/[\\/]{2,}/g,"/"),le=e=>oe(e.join("/")),he=e=>e.replace(/\/+$/,""),ue=e=>he(e).replace(/^\/*/,"/"),ce=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",de=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var fe=class{constructor(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.status=e,this.statusText=t||"",this.internal=n,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function pe(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}function me(e){let t=e.map(e=>
2e.route.path).filter(Boolean);return le(t)||"/"}var ge="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;function ve(e,t){let i=e;if("string"!==typeof i||!_.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let n=i,r=!1;if(ge)try{let e=new URL(window.location.href),n=S.test(i)?new URL(E(i,e.protocol)):new URL(i),s=te(n.pathname,t);n.origin===e.origin&&null!=s?i=s+n.search+n.hash:r=!0}catch(oT){O(!1,'<Link to="'.concat(i,'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.'))}return{absoluteURL:n,isExternal:r,to:i}}Symbol("Uninstrumented");Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ye=["POST","PUT","PATCH","DELETE"],xe=(new Set(ye),["GET",...ye]);new Set(xe),Symbol("ResetLoaderData");new WeakMap,new WeakMap,new WeakMap,new WeakMap;var be=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function we(e){try{return be.includes(new URL(e).protocol)}catch(t){return!1}}var Te=e.createContext(null);Te.displayName="DataRouter";var _e=e.createContext(null);_e.displayName="DataRouterState";var Se=e.createContext(!1);function Ee(){return e.useContext(Se)}var Ce=e.createContext({isTransitioning:!1});Ce.displayName="ViewTransition";var Ae=e.createContext(new Map);Ae.displayName="Fetchers";var ke=e.createContext(null);ke.displayName="Await";var Re=e.createContext(null);Re.displayName="Navigation";var Oe=e.createContext(null);Oe.displayName="Location";var Pe=e.createContext({outlet:null,matches:[],isDataRoute:!1});Pe.displayName="Route";var Me=e.createContext(null);Me.displayName="RouteError";var Ne="REACT_ROUTER_ERROR";function Ie(){return null!=e.useContext(Oe)}function Le(){return R(Ie(),"useLocation() may be used only in the context of a <Router> component."),e.useContext(Oe).location}var De="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Fe(t){e.useContext(Re).static||e.useLayoutEffect(t)}function Be(){return e.useContext(Pe).isDataRoute?function(){let t=Ke("useNavigate").router,i=Je("useNavigate"),n=e.useRef(!1);Fe(()=>{n.current=!0});let r=e.useCallback(async function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};O(n.current,De),n.current&&("number"===typeof e?await t.navigate(e):await t.navigate(e,m({fromRouteId:i},r)))},[t,i]);return r}():function(){R(Ie(),"useNavigate() may be used only in the context of a <Router> component.");let t=e.useContext(Te),i=e.useContext(Re),n=i.basename,r=i.navigator,s=e.useContext(Pe).matches,a=Le().pathname,o=JSON.stringify(se(s)),l=e.useRef(!1);Fe(()=>{l.current=!0});let h=e.useCallback(function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(O(l.current,De),!l.current)return;if("number"===typeof e)return void r.go(e);let s=ae(e,JSON.parse(o),a,"path"===i.relative);null==t&&"/"!==n&&(s.pathname="/"===s.pathname?n:le([n,s.pathname])),(i.replace?r.replace:r.push)(s,i.state,i)},[n,r,o,a,t]);return h}()}e.createContext(null);function Ue(t){let i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).relative,n=e.useContext(Pe).matches,r=Le().pathname,s=JSON.stringify(se(n));return e.useMemo(()=>ae(t,JSON.parse(s),r,"path"===i),[t,s,r,i])}function ze(t,i,n){R(Ie(),"useRoutes() may be used only in the context of a <Router> component.");let r=e.useContext(Re).navigator,s=e.useContext(Pe).matches,a=s[s.length-1],o=a?a.params:{},l=a?a.pathname:"/",h=a?a.pathnameBase:"/",u=a&&a.route;{let e=u&&u.path||"";et(l,!u||e.endsWith("*")||e.endsWith("*?"),'You rendered descendant <Routes> (or called `useRoutes()`) at "'.concat(l,'" (under <Route path="').concat(e,'">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won\'t match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="').concat(e,'"> to <Route path="').concat("/"===e?"*":"".concat(e,"/*"),'">.'))}let c,d=Le();if(i){var f;let e="string"===typeof i?I(i):i;R("/"===h||(null===(f=e.pathname)||void 0===f?void 0:f.startsWith(h)),'When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "'.concat(h,'" but pathname "').concat(e.pathname,'" was given in the `location` prop.')),c=e}else c=d;let p=c.pathname||"/",g=p;if("/"!==h){let e=h.replace(/^\//,"").split("/");g="/"+p.replace(/^\//,"").split("/").slice(e.length).join("/")}let v=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):F(t,{pathname:g});O(u||null!=v,'No routes matched location "'.concat(c.pathname).concat(c.search).concat(c.hash,'" ')),O(null==v||void 0!==v[v.length-1].route.element||void 0!==v[v.length-1].route.Component||void 0!==v[v.length-1].route.lazy,'Matched leaf route at location "'.concat(c.pathname).concat(c.search).concat(c.hash,'" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.'));let y=Xe(v&&v.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:le([h,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?h:le([h,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),s,n);return i&&y?e.createElement(Oe.Provider,{value:{location:m({pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0},c),navigationType:"POP"}},y):y}function Ve(){let t=Ze(),i=pe(t)?"".concat(t.status," ").concat(t.statusText):t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",t),o=e.createElement(e.Fragment,null,e.createElement("p",null,"\ud83d\udcbf Hey developer \ud83d\udc4b"),e.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",e.createElement("code",{style:a},"ErrorBoundary")," or"," ",e.createElement("code",{style:a},"errorElement")," prop on your route.")),e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application 
2Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},i),n?e.createElement("pre",{style:s},n):null,o)}var He=e.createElement(Ve,null),je=class extends e.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let t=this.state.error;if(this.context&&"object"===typeof t&&t&&"digest"in t&&"string"===typeof t.digest){const e=function(e){if(e.startsWith("".concat(Ne,":").concat("ROUTE_ERROR_RESPONSE",":{")))try{let t=JSON.parse(e.slice(40));if("object"===typeof t&&t&&"number"===typeof t.status&&"string"===typeof t.statusText)return new fe(t.status,t.statusText,t.data)}catch(t){}}(t.digest);e&&(t=e)}let i=void 0!==t?e.createElement(Pe.Provider,{value:this.props.routeContext},e.createElement(Me.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?e.createElement(We,{error:t},i):i}};je.contextType=Se;var Ye=new WeakMap;function We(t){let i=t.children,n=t.error,r=e.useContext(Re).basename;if("object"===typeof n&&n&&"digest"in n&&"string"===typeof n.digest){let t=function(e){if(e.startsWith("".concat(Ne,":").concat("REDIRECT",":{")))try{let t=JSON.parse(e.slice(28));if("object"===typeof t&&t&&"number"===typeof t.status&&"string"===typeof t.statusText&&"string"===typeof t.location&&"boolean"===typeof t.reloadDocument&&"boolean"===typeof t.replace)return t}catch(t){}}(n.digest);if(t){let i=Ye.get(n);if(i)throw i;let s=ve(t.location,r),a=s.absoluteURL||s.to;if(we(a))throw new Error("Invalid redirect location");if(ge&&!Ye.get(n)){if(!s.isExternal&&!t.reloadDocument){const e=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:t.replace}));throw Ye.set(n,e),e}window.location.href=a}return e.createElement("meta",{httpEquiv:"refresh",content:"0;url=".concat(a)})}}return i}function Ge(t){let i=t.routeContext,n=t.match,r=t.children,s=e.useContext(Te);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(Pe.Provider,{value:i},r)}function Xe(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=null===n||void 0===n?void 0:n.state;if(null==t){if(!r)return null;if(r.errors)t=r.matches;else{if(0!==i.length||r.initialized||!(r.matches.length>0))return null;t=r.matches}}let s=t,a=null===r||void 0===r?void 0:r.errors;if(null!=a){let e=s.findIndex(e=>e.route.id&&void 0!==(null===a||void 0===a?void 0:a[e.route.id]));R(e>=0,"Could not find a matching route for errors on route IDs: ".concat(Object.keys(a).join(","))),s=s.slice(0,Math.min(s.length,e+1))}let o=!1,l=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<s.length;e++){let t=s[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(l=e),t.route.id){let e=r.loaderData,i=r.errors,a=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!i||void 0===i[t.route.id]);if(t.route.lazy||a){n.isStatic&&(o=!0),s=l>=0?s.slice(0,l+1):[s[0]];break}}}}let h=null===n||void 0===n?void 0:n.onError,u=r&&h?(e,t)=>{var i,n;h(e,{location:r.location,params:null!==(i=null===(n=r.matches)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.params)&&void 0!==i?i:{},pattern:me(r.matches),errorInfo:t})}:void 0;return s.reduceRight((t,n,h)=>{let c,d=!1,f=null,p=null;r&&(c=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||He,o&&(l<0&&0===h?(et("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):l===h&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=i.concat(s.slice(0,h+1)),g=()=>{let i;return i=c?f:d?p:n.route.Component?e.createElement(n.route.Component,null):n.route.element?n.route.element:t,e.createElement(Ge,{match:n,routeContext:{outlet:t,matches:m,isDataRoute:null!=r},children:i})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===h)?e.createElement(je,{location:r.location,revalidation:r.revalidation,component:f,error:c,children:g(),routeC
2ontext:{outlet:null,matches:m,isDataRoute:!0},onError:u}):g()},null)}function qe(e){return"".concat(e," must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.")}function Ke(t){let i=e.useContext(Te);return R(i,qe(t)),i}function Qe(t){let i=e.useContext(_e);return R(i,qe(t)),i}function Je(t){let i=function(t){let i=e.useContext(Pe);return R(i,qe(t)),i}(t),n=i.matches[i.matches.length-1];return R(n.route.id,"".concat(t,' can only be used on routes that contain a unique "id"')),n.route.id}function Ze(){var t;let i=e.useContext(Me),n=Qe("useRouteError"),r=Je("useRouteError");return void 0!==i?i:null===(t=n.errors)||void 0===t?void 0:t[r]}var $e={};function et(e,t,i){t||$e[e]||($e[e]=!0,O(!1,i))}var tt={};function it(e,t){e||tt[t]||(tt[t]=!0,console.warn(t))}t.useOptimistic;e.memo(nt);function nt(e){let t=e.routes,i=e.manifest,n=e.future;return ze(t,void 0,{manifest:i,state:e.state,isStatic:e.isStatic,onError:e.onError,future:n})}function rt(t){let i=t.to,n=t.replace,r=t.state,s=t.relative;R(Ie(),"<Navigate> may be used only in the context of a <Router> component."),O(!e.useContext(Re).static,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let a=e.useContext(Pe).matches,o=Le().pathname,l=Be(),h=ae(i,se(a),o,"path"===s),u=JSON.stringify(h);return e.useEffect(()=>{l(JSON.parse(u),{replace:n,state:r,relative:s})},[l,u,s,n,r]),null}function st(e){R(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function at(t){let i=t.basename,n=void 0===i?"/":i,r=t.children,s=void 0===r?null:r,a=t.location,o=t.navigationType,l=void 0===o?"POP":o,h=t.navigator,u=t.static,c=void 0!==u&&u,d=t.useTransitions;R(!Ie(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=n.replace(/^\/*/,"/"),p=e.useMemo(()=>({basename:f,navigator:h,static:c,useTransitions:d,future:{}}),[f,h,c,d]);"string"===typeof a&&(a=I(a));let m=a,g=m.pathname,v=void 0===g?"/":g,y=m.search,x=void 0===y?"":y,b=m.hash,w=void 0===b?"":b,T=m.state,_=void 0===T?null:T,S=m.key,E=void 0===S?"default":S,C=m.mask,A=e.useMemo(()=>{let e=te(v,f);return null==e?null:{location:{pathname:e,search:x,hash:w,state:_,key:E,mask:C},navigationType:l}},[f,v,x,w,_,E,l,C]);return O(null!=A,'<Router basename="'.concat(f,'"> is not able to match the URL "').concat(v).concat(x).concat(w,"\" because it does not start with the basename, so the <Router> won't render anything.")),null==A?null:e.createElement(Re.Provider,{value:p},e.createElement(Oe.Provider,{children:s,value:A}))}function ot(e){let t=e.children,i=e.location;return ze(lt(t),i)}e.Component;function lt(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[];return e.Children.forEach(t,(t,r)=>{if(!e.isValidElement(t))return;let s=[...i,r];if(t.type===e.Fragment)return void n.push.apply(n,lt(t.props.children,s));R(t.type===st,"[".concat("string"===typeof t.type?t.type:t.type.name,"] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>")),R(!t.props.index||!t.props.children,"An index route cannot have child routes.");let a={id:t.props.id||s.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,middleware:t.props.middleware,loader:t.props.loader,action:t.props.action,hydrateFallbackElement:t.props.hydrateFallbackElement,HydrateFallback:t.props.HydrateFallback,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:!0===t.props.hasErrorBoundary||null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(a.children=lt(t.props.children,s)),n.push(a)}),n}var ht="get",ut="application/x-www-form-urlencoded";function ct(e){return"undefined"!==typeof HTMLElement&&e instanceof HTMLElement}var dt=null;var ft=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function pt(e){return null==e||ft.has(e)?e:(O(!1,'"'.concat(e,'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` and will default to "').concat(ut,'"')),null)}function mt(e,t){let i,n,r,s,a;if(ct(o=e)&&"form"===o.tagName.toLowerCase()){let a=e.getAttribute("action");n=a?te(a,t):null,i=e.getAttribute("method")||ht,r=pt(e.getAttribute("enctype"))||ut,s=new FormData(e)}else if(function(e){return ct(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return ct(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let a=e.form;if(null==a)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let o=e.getAttribute("formaction")||a.getAttribute("action");if(n=o?te(o,t):null,i=e.getAttribute("formmethod")||a.getAttribute("method")||ht,r=pt(e.getAttribute("formenctype"))||pt(
2a.getAttribute("enctype"))||ut,s=new FormData(a,e),!function(){if(null===dt)try{new FormData(document.createElement("form"),0),dt=!1}catch(oT){dt=!0}return dt}()){let t=e.name,i=e.type,n=e.value;if("image"===i){let e=t?"".concat(t,"."):"";s.append("".concat(e,"x"),"0"),s.append("".concat(e,"y"),"0")}else t&&s.append(t,n)}}else{if(ct(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=ht,n=null,r=ut,a=e}var o;return s&&"text/plain"===r&&(a=s,s=void 0),{action:n,method:i.toLowerCase(),encType:r,formData:s,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function gt(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}Symbol("SingleFetchRedirect");function vt(e,t,i,n){let r="string"===typeof e?new URL(e,"undefined"===typeof window?"server://singlefetch/":window.location.origin):e;return i?r.pathname.endsWith("/")?r.pathname="".concat(r.pathname,"_.").concat(n):r.pathname="".concat(r.pathname,".").concat(n):"/"===r.pathname?r.pathname="_root.".concat(n):t&&"/"===te(r.pathname,t)?r.pathname="".concat(he(t),"/_root.").concat(n):r.pathname="".concat(he(r.pathname),".").concat(n),r}async function yt(e,t){if(e.id in t)return t[e.id];try{let i=await import(e.module);return t[e.id]=i,i}catch(_E){return console.error("Error loading route module `".concat(e.module,"`, reloading page...")),console.error(_E),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function xt(e){return null!=e&&"string"===typeof e.page}function bt(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"===typeof e.imageSrcSet&&"string"===typeof e.imageSizes:"string"===typeof e.rel&&"string"===typeof e.href)}function wt(e,t,i,n,r,s){let a=(e,t)=>!i[t]||e.route.id!==i[t].route.id,o=(e,t)=>{var n;return i[t].pathname!==e.pathname||(null===(n=i[t].route.path)||void 0===n?void 0:n.endsWith("*"))&&i[t].params["*"]!==e.params["*"]};return"assets"===s?t.filter((e,t)=>a(e,t)||o(e,t)):"data"===s?t.filter((t,s)=>{let l=n.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(a(t,s)||o(t,s))return!0;if(t.route.shouldRevalidate){var h;let n=t.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:(null===(h=i[0])||void 0===h?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"===typeof n)return n}return!0}):[]}function Tt(e,t){let i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).includeHydrateFallback;return n=e.map(e=>{let n=t.routes[e.route.id];if(!n)return[];let r=[n.module];return n.clientActionModule&&(r=r.concat(n.clientActionModule)),n.clientLoaderModule&&(r=r.concat(n.clientLoaderModule)),i&&n.hydrateFallbackModule&&(r=r.concat(n.hydrateFallbackModule)),n.imports&&(r=r.concat(n.imports)),r}).flat(1),[...new Set(n)];var n}function _t(e,t){let i=new Set,n=new Set(t);return e.reduce((e,r)=>{if(t&&!xt(r)&&"script"===r.as&&r.href&&n.has(r.href))return e;let s=JSON.stringify(function(e){let t={},i=Object.keys(e).sort();for(let n of i)t[n]=e[n];return t}(r));return i.has(s)||(i.add(s),e.push({key:s,link:r})),e},[])}function St(e,t){return"lazy"===e.mode&&!0===t}function Et(){let t=e.useContext(Te);return gt(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function Ct(){let t=e.useContext(_e);return gt(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var At=e.createContext(void 0);function kt(){let t=e.useContext(At);return gt(t,"You must render this element inside a <HydratedRouter> element"),t}function Rt(e,t){return i=>{e&&e(i),i.defaultPrevented||t(i)}}function Ot(e,t,i){if(i&&!Lt)return[e[0]];if(t){let i=e.findIndex(e=>void 0!==t[e.route.id]);return e.slice(0,i+1)}return e}At.displayName="FrameworkContext";function Pt(t){let i=t.page,n=r(t,v),s=Ee(),a=kt().nonce,o=Et().router,l=e.useMemo(()=>F(o.routes,i,o.basename),[o.routes,i,o.basename]);return l?(null==n.nonce&&a&&(n=m(m({},n),{},{nonce:a})),s?e.createElement(Nt,m({page:i,matches:l},n)):e.createElement(It,m({page:i,matches:l},n))):null}function Mt(t){let i=kt(),n=i.manifest,r=i.routeModules,s=u(e.useState([]),2),a=s[0],o=s[1];return e.useEffect(()=>{let e=!1;return async function(e,t,i){let n=await Promise.all(e.map(async e=>{let n=t.routes[e.route.id];if(n){let e=await yt(n,i);return e.links?e.links():[]}return[]}));return _t(n.flat(1).filter(bt).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?m(m({},e),{},{rel:"prefetch",as:"style"}):m(m({},e),{},{rel:"prefetch"})))}(t,n,r).then(t=>{e||o(t)}),()=>{e=!0}},[t,n,r]),a}function Nt(t){let i=t.page,n=t.matches,s=r(t,y),a=Le(),o=kt().future,l=Et().basename,h=e.useMemo(()=>
2{if(i===a.pathname+a.search+a.hash)return[];let e=vt(i,l,o.v8_trailingSlashAwareDataRequests,"rsc"),t=!1,r=[];for(let i of n)"function"===typeof i.route.shouldRevalidate?t=!0:r.push(i.route.id);return t&&r.length>0&&e.searchParams.set("_routes",r.join(",")),[e.pathname+e.search]},[l,o.v8_trailingSlashAwareDataRequests,i,a,n]);return e.createElement(e.Fragment,null,h.map(t=>e.createElement("link",m({key:t,rel:"prefetch",as:"fetch",href:t},s))))}function It(t){let i=t.page,n=t.matches,s=r(t,x),a=Le(),o=kt(),l=o.future,h=o.manifest,u=o.routeModules,c=Et().basename,d=Ct(),f=d.loaderData,p=d.matches,g=e.useMemo(()=>wt(i,n,p,h,a,"data"),[i,n,p,h,a]),v=e.useMemo(()=>wt(i,n,p,h,a,"assets"),[i,n,p,h,a]),y=e.useMemo(()=>{if(i===a.pathname+a.search+a.hash)return[];let e=new Set,t=!1;if(n.forEach(i=>{var n;let r=h.routes[i.route.id];r&&r.hasLoader&&(!g.some(e=>e.route.id===i.route.id)&&i.route.id in f&&null!==(n=u[i.route.id])&&void 0!==n&&n.shouldRevalidate||r.hasClientLoader?t=!0:e.add(i.route.id))}),0===e.size)return[];let r=vt(i,c,l.v8_trailingSlashAwareDataRequests,"data");return t&&e.size>0&&r.searchParams.set("_routes",n.filter(t=>e.has(t.route.id)).map(e=>e.route.id).join(",")),[r.pathname+r.search]},[c,l.v8_trailingSlashAwareDataRequests,f,a,h,g,n,i,u]),b=e.useMemo(()=>Tt(v,h),[v,h]),w=Mt(v);return e.createElement(e.Fragment,null,y.map(t=>e.createElement("link",m({key:t,rel:"prefetch",as:"fetch",href:t},s))),b.map(t=>e.createElement("link",m({key:t,rel:"modulepreload",href:t},s))),w.map(t=>{var i;let n=t.key,r=t.link;return e.createElement("link",m(m({key:n,nonce:s.nonce},r),{},{crossOrigin:null!==(i=r.crossOrigin)&&void 0!==i?i:s.crossOrigin}))}))}var Lt=!1;function Dt(t){let i=kt(),n=i.manifest,s=i.serverHandoffString,a=i.isSpaMode,o=i.renderMeta,l=i.routeDiscovery,h=i.ssr,u=i.nonce,c=Et(),d=c.router,f=c.static,p=c.staticContext,v=Ct().matches,y=Ee(),x=St(l,h);null==t.nonce&&u&&m(m({},t),{},{nonce:u}),o&&(o.didRenderScripts=!0);let b=Ot(v,null,a);e.useEffect(()=>{0},[]);let w=e.useMemo(()=>{var i;if(y)return null;let a=p?"window.__reactRouterContext = ".concat(s,";").concat("window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());"):" ",o=f?"".concat(null!==n.hmr&&void 0!==i&&i.runtime?"import ".concat(JSON.stringify(n.hmr.runtime),";"):"").concat(x?"":"import ".concat(JSON.stringify(n.url)),";\n").concat(b.map((e,t)=>{let i="route".concat(t),r=n.routes[e.route.id];gt(r,"Route ".concat(e.route.id," not found in manifest"));let s=r.clientActionModule,a=r.clientLoaderModule,o=r.clientMiddlewareModule,l=r.hydrateFallbackModule,h=r.module,u=[...s?[{module:s,varName:"".concat(i,"_clientAction")}]:[],...a?[{module:a,varName:"".concat(i,"_clientLoader")}]:[],...o?[{module:o,varName:"".concat(i,"_clientMiddleware")}]:[],...l?[{module:l,varName:"".concat(i,"_HydrateFallback")}]:[],{module:h,varName:"".concat(i,"_main")}];return 1===u.length?"import * as ".concat(i," from ").concat(JSON.stringify(h),";"):[u.map(e=>"import * as ".concat(e.varName,' from "').concat(e.module,'";')).join("\n"),"const ".concat(i," = {").concat(u.map(e=>"...".concat(e.varName)).join(","),"};")].join("\n")}).join("\n"),"\n  ").concat(x?"window.__reactRouterManifest = ".concat(JSON.stringify(function(e,t){let i=e.sri,n=r(e,g),s=new Set(t.state.matches.map(e=>e.route.id)),a=t.state.location.pathname.split("/").filter(Boolean),o=["/"];for(a.pop();a.length>0;)o.push("/".concat(a.join("/"))),a.pop();o.forEach(e=>{let i=B(t.routes,e,t.basename||"/",!1,t.branches);i&&i.forEach(e=>s.add(e.route.id))});let l=[...s].reduce((e,t)=>Object.assign(e,{[t]:n.routes[t]}),{});return m(m({},n),{},{routes:l,sri:!!i||void 0})}(n,d),null,2),";"):"","\n  window.__reactRouterRouteModules = {").concat(b.map((e,t)=>"".concat(JSON.stringify(e.route.id),":route").concat(t)).join(","),"};\n\nimport(").concat(JSON.stringify(n.entry.module),");"):" ";return e.createElement(e.Fragment,null,e.createElement("script",m(m({},t),{},{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:a},type:void 0})),e.createElement("script",m(m({},t),{},{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:o},type:"module",async:!0})))},[]),T=Lt||y?[]:[...new Set(n.entry.imports.concat(Tt(b,n,{includeHydrateFallback:!0})))],_="object"===typeof n.sri?n.sri:{};return it(!y,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),Lt||y?null:e.createElement(e.Fragment,null,"object"===typeof n.sri?e.createElement("script",m(m({},t),{},{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:_})}})):null,x?null:e.createElement("link",{rel:"modulepreload",href:n.url,crossOrigin:t.crossOrigin,integrity:_[n.url],nonce:t.nonce,suppressHydrationWarning:!0}),e.createElement("link",{rel:"modulepreload",href:n.entry.module,crossOrigin:t.crossOrigin,integrity:_[n.entry.module],nonce:t.nonce,suppressHydrationWarning:!0}),T.map(i=>e.createElement("link",{key:i,rel:"modulepreload",href:i,crossOrigin:t.crossOrigin,integrity:_[i],nonce:t.nonce,suppressHydrationWarning:!0})),w)}function Ft(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return e=>{t.forEach(t=>{"function"===typeof t?t(e):null!=t&&(t.current=e)})}}e.Component;function Bt(t){let i=t.error,n=t.isOutsideRemixApp,r=kt().nonce;console.error(i);let s,a=e.createElement("script",{nonce:r,dangerouslySetInnerHTML:{__html:'\n        console.log(\n          "\ud83d\udcbf Hey developer \ud83d\udc4b. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."\n        );\n      '}});if(pe(i))return e.createElement(Ut,{title:"Unhandled Thrown Response!"},e.createElement("h1",{style:{fontSize:"24px"}},i.status," ",i.statusText),a);if(i instanceof Error)0;else{let e=null==i?"Unknown Error":"object"===typeof i&&"toString"in i?i.toString():JSON.stringify(i);new Error(e)}
2return e.createElement(Ut,{title:"Application Error!",isOutsideRemixApp:n},e.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),e.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},s.stack),a)}function Ut(t){var i;let n=t.title,r=t.renderScripts,s=t.isOutsideRemixApp,a=t.children;return null!==kt().routeModules.root&&void 0!==i&&i.Layout&&!s?a:e.createElement("html",{lang:"en"},e.createElement("head",null,e.createElement("meta",{charSet:"utf-8"}),e.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),e.createElement("title",null,n)),e.createElement("body",null,e.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},a,r?e.createElement(Dt,null):null)))}var zt="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;try{zt&&(window.__reactRouterVersion="7.18.1")}catch(oT){}function Vt(t){let i=t.basename,n=t.children,r=t.useTransitions,s=t.window,a=e.useRef();null==a.current&&(a.current=k({window:s,v5Compat:!0}));let o=a.current,l=u(e.useState({action:o.action,location:o.location}),2),h=l[0],c=l[1],d=e.useCallback(t=>{!1===r?c(t):e.startTransition(()=>c(t))},[r]);return e.useLayoutEffect(()=>o.listen(d),[o,d]),e.createElement(at,{basename:i,children:n,location:h.location,navigationType:h.action,navigator:o,useTransitions:r})}var Ht=e.forwardRef(function(t,i){let n=t.onClick,s=t.discover,a=void 0===s?"render":s,o=t.prefetch,l=void 0===o?"none":o,h=t.relative,c=t.reloadDocument,d=t.replace,f=t.mask,p=t.state,g=t.target,v=t.to,y=t.preventScrollReset,x=t.viewTransition,w=t.defaultShouldRevalidate,T=r(t,b),S=e.useContext(Re),E=S.basename,C=S.navigator,A=S.useTransitions,k="string"===typeof v&&_.test(v),O=ve(v,E);v=O.to;let P=function(t){let i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).relative;R(Ie(),"useHref() may be used only in the context of a <Router> component.");let n=e.useContext(Re),r=n.basename,s=n.navigator,a=Ue(t,{relative:i}),o=a.hash,l=a.pathname,h=a.search,u=l;return"/"!==r&&(u="/"===l?r:le([r,l])),s.createHref({pathname:u,search:h,hash:o})}(v,{relative:h}),M=Le(),I=null;if(f){let e=ae(f,[],M.mask?M.mask.pathname:"/",!0);"/"!==E&&(e.pathname="/"===e.pathname?E:le([E,e.pathname])),I=C.createHref(e)}let L=function(t,i){let n=e.useContext(At),r=u(e.useState(!1),2),s=r[0],a=r[1],o=u(e.useState(!1),2),l=o[0],h=o[1],c=i.onFocus,d=i.onBlur,f=i.onMouseEnter,p=i.onMouseLeave,m=i.onTouchStart,g=e.useRef(null);e.useEffect(()=>{if("render"===t&&h(!0),"viewport"===t){let e=new IntersectionObserver(e=>{e.forEach(e=>{h(e.isIntersecting)})},{threshold:.5});return g.current&&e.observe(g.current),()=>{e.disconnect()}}},[t]),e.useEffect(()=>{if(s){let e=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(e)}}},[s]);let v=()=>{a(!0)},y=()=>{a(!1),h(!1)};return n?"intent"!==t?[l,g,{}]:[l,g,{onFocus:Rt(c,v),onBlur:Rt(d,y),onMouseEnter:Rt(f,v),onMouseLeave:Rt(p,y),onTouchStart:Rt(m,v)}]:[!1,g,{}]}(l,T),D=u(L,3),F=D[0],B=D[1],U=D[2],z=function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.target,r=i.replace,s=i.mask,a=i.state,o=i.preventScrollReset,l=i.relative,h=i.viewTransition,u=i.defaultShouldRevalidate,c=i.useTransitions,d=Be(),f=Le(),p=Ue(t,{relative:l});return e.useCallback(i=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(i,n)){i.preventDefault();let n=void 0!==r?r:N(f)===N(p),m=()=>d(t,{replace:n,mask:s,state:a,preventScrollReset:o,relative:l,viewTransition:h,defaultShouldRevalidate:u});c?e.startTransition(()=>m()):m()}},[f,d,p,r,s,a,n,t,o,l,h,u,c])}(v,{replace:d,mask:f,state:p,target:g,preventScrollReset:y,relative:h,viewTransition:x,defaultShouldRevalidate:w,useTransitions:A});let V=!(O.isExternal||c),H=e.createElement("a",m(m(m({},T),U),{},{href:(V?I:void 0)||O.absoluteURL||P,onClick:V?function(e){n&&n(e),e.defaultPrevented||z(e)}:n,ref:Ft(i,B),target:g,"data-discover":k||"render"!==a?void 0:"true"}));return F&&!k?e.createElement(e.Fragment,null,H,e.createElement(Pt,{page:P})):H});Ht.displayName="Link";var jt=e.forwardRef(function(t,i){let n=t["aria-current"],s=void 0===n?"page":n,a=t.caseSensitive,o=void 0!==a&&a,l=t.className,h=void 0===l?"":l,u=t.end,c=void 0!==u&&u,d=t.style,f=t.to,p=t.viewTransition,g=t.children,v=r(t,w),y=Ue(f,{relative:v.relative}),x=Le(),b=e.useContext(_e),T=e.useContext(Re),_=T.navigator,S=T.basename,E=null!=b&&function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.relative,r=e.useContext(Ce);R(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let s=Gt("useViewTransitionState").basename,a=Ue(t,{relative:n});if(!r.isTransitioning)return!1;let o=te(r.currentLocation.pathname,s)||r.currentLocation.pathname,l=te(r.nextLocation.pathname,s)||r.nextLocation.pathname;return null!=J(a.pathname,l)||null!=J(a.pathname,o)}(y)&&!0===p,C=_.encodeLocation?_.encodeLocation(y).pathname:y.pathname,A=x.pathname,k=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;o||(A=A.toLowerCase(),k=k?k.toLowerCase():null,C=C.toLowerCase()),k&&S&&(k=te(k,S)||k);const O="/"!==C&&C.endsWith("/")?C.length-1:C.length;let P,M=A===C||!c&&A.startsWith(C)&&"/"===A.charAt(O),N=null!=k&&(k===C||!c&&k.startsWith(C)&&"/"===k.charAt(C.length)),I={isActive:M,isPending:N,isTransitioning:E},L=M?s:void 0;P="function"===typeof h?h(I):[h,M?"active":null,N?"pending":null,E?"transitioning":null].filter(
2Boolean).join(" ");let D="function"===typeof d?d(I):d;return e.createElement(Ht,m(m({},v),{},{"aria-current":L,className:P,ref:i,style:D,to:f,viewTransition:p}),"function"===typeof g?g(I):g)});jt.displayName="NavLink";var Yt=e.forwardRef((t,i)=>{let n=t.discover,s=void 0===n?"render":n,a=t.fetcherKey,o=t.navigate,l=t.reloadDocument,h=t.replace,c=t.state,d=t.method,f=void 0===d?ht:d,p=t.action,g=t.onSubmit,v=t.relative,y=t.preventScrollReset,x=t.viewTransition,b=t.defaultShouldRevalidate,w=r(t,T),S=e.useContext(Re).useTransitions,E=Kt(),C=function(t){let i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).relative,n=e.useContext(Re).basename,r=e.useContext(Pe);R(r,"useFormAction must be used inside a RouteContext");let s=u(r.matches.slice(-1),1)[0],a=m({},Ue(t||".",{relative:i})),o=Le();if(null==t){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll("index"),i=t.some(e=>""===e);if(i){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let i=e.toString();a.search=i?"?".concat(i):""}}t&&"."!==t||!s.route.index||(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(a.pathname="/"===a.pathname?n:le([n,a.pathname]));return N(a)}(p,{relative:v}),A="get"===f.toLowerCase()?"get":"post",k="string"===typeof p&&_.test(p);return e.createElement("form",m(m({ref:i,method:A,action:C,onSubmit:l?g:t=>
2{if(g&&g(t),t.defaultPrevented)return;t.preventDefault();let i=t.nativeEvent.submitter,n=(null===i||void 0===i?void 0:i.getAttribute("formmethod"))||f,r=()=>E(i||t.currentTarget,{fetcherKey:a,method:n,navigate:o,replace:h,state:c,relative:v,preventScrollReset:y,viewTransition:x,defaultShouldRevalidate:b});S&&!1!==o?e.startTransition(()=>r()):r()}},w),{},{"data-discover":k||"render"!==s?void 0:"true"}))});function Wt(e){return"".concat(e," must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.")}function Gt(t){let i=e.useContext(Te);return R(i,Wt(t)),i}Yt.displayName="Form";var Xt=0,qt=()=>"__".concat(String(++Xt),"__");function Kt(){let t=Gt("useSubmit").router,i=e.useContext(Re).basename,n=Je("useRouteId"),r=t.fetch,s=t.navigate;return e.useCallback(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=mt(e,i),o=a.action,l=a.method,h=a.encType,u=a.formData,c=a.body;if(!1===t.navigate){let e=t.fetcherKey||qt();await r(e,n,t.action||o,{defaultShouldRevalidate:t.defaultShouldRevalidate,preventScrollReset:t.preventScrollReset,formData:u,body:c,formMethod:t.method||l,formEncType:t.encType||h,flushSync:t.flushSync})}else await s(t.action||o,{defaultShouldRevalidate:t.defaultShouldRevalidate,preventScrollReset:t.preventScrollReset,formData:u,body:c,formMethod:t.method||l,formEncType:t.encType||h,replace:t.replace,state:t.state,fromRouteId:n,flushSync:t.flushSync,viewTransition:t.viewTransition})},[r,s,i,n])}var Qt=i(366),Jt=i.n(Qt),Zt=i(740),$t=i.n(Zt),ei=i(324),ti=i.n(ei);const ii=["context"],ni=["innerHTML"],ri=["cssText"],si=["innerHTML"],ai=["children"],oi=["children"];var li,hi,ui=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(ui||{}),ci={rel:["amphtml","canonical","alternate"]},di={type:["application/ld+json"]},fi={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},pi=Object.values(ui),mi={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},gi=Object.entries(mi).reduce((e,t)=>{let i=u(t,2),n=i[0];return e[i[1]]=n,e},{}),vi="data-rh",yi="defaultTitle",xi="defer",bi="encodeSpecialCharacters",wi="onChangeClientState",Ti="titleTemplate",_i="prioritizeSeoTags",Si=(e,t)=>{for(let i=e.length-1;i>=0;i-=1){const n=e[i];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},Ei=e=>{let t=Si(e,"title");const i=Si(e,Ti);if(Array.isArray(t)&&(t=t.join("")),i&&t)return i.replace(/%s/g,()=>t);const n=Si(e,yi);return t||n||void 0},Ci=e=>Si(e,wi)||(()=>{}),Ai=(e,t)=>t.filter(t=>"undefined"!==typeof t[e]).map(t=>t[e]).reduce((e,t)=>m(m({},e),t),{}),ki=(e,t)=>t.filter(e=>"undefined"!==typeof e.base).map(e=>e.base).reverse().reduce((t,i)=>{if(!t.length){const n=Object.keys(i);for(let r=0;r<n.length;r+=1){const s=n[r].toLowerCase();if(-1!==e.indexOf(s)&&i[s])return t.concat(i)}}return t},[]),Ri=(e,t,i)=>{const n={};return i.filter(t=>{return!!Array.isArray(t[e])||("undefined"!==typeof t[e]&&(i="Helmet: ".concat(e,' should be of type "Array". Instead found type "').concat(typeof t[e],'"'),console&&"function"===typeof console.warn&&console.warn(i)),!1);var i}).map(t=>t[e]).reverse().reduce((e,i)=>{const r={};i.filter(e=>{let i;const s=Object.keys(e);for(let n=0;n<s.length;n+=1){const r=s[n],a=r.toLowerCase();-1===t.indexOf(a)||"rel"===i&&"canonical"===e[i].toLowerCase()||"rel"===a&&"stylesheet"===e[a].toLowerCase()||(i=a),-1===t.indexOf(r)||"innerHTML"!==r&&"cssText"!==r&&"itemprop"!==r||(i=r)}if(!i||!e[i])return!1;const a=e[i].toLowerCase();return n[i]||(n[i]={}),r[i]||(r[i]={}),!n[i][a]&&(r[i][a]=!0,!0)}).reverse().forEach(t=>e.push(t));const s=Object.keys(r);for(let t=0;t<s.length;t+=1){const e=s[t],i=m(m({},n[e]),r[e]);n[e]=i}return e},[]).reverse()},Oi=(e,t)=>{if(Array.isArray(e)&&e.length)for(let i=0;i<e.length;i+=1){if(e[i][t])return!0}return!1},Pi=e=>Array.isArray(e)?e.join(""):e,Mi=(e,t)=>Array.isArray(e)?e.reduce((e,i)=>(((e,t)=>{const i=Object.keys(e);for(let n=0;n<i.length;n+=1)if(t[i[n]]&&t[i[n]].includes(e[i[n]]))return!0;return!1})(i,t)?e.priority.push(i):e.default.push(i),e),{priority:[],default:[]}):{default:e,priority:[]},Ni=(e,t)=>m(m({},e),{},{[t]:void 0}),Ii=["noscript","script","style"],Li=function(e){return!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")},Di=e=>Object.keys(e).reduce((t,i)=>{const n="undefined"!==typeof e[i]?"".concat(i,'="').concat(e[i],'"'):"".concat(i);return t?"".concat(t," ").concat(n):n},""),Fi=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((t,i)=>(t[mi[i]||i]=e[i],t),t)},Bi=(t,i)=>i.map((i,n)=>{const r={key:n,[vi]:!0};
2return Object.keys(i).forEach(e=>{const t=mi[e]||e;if("innerHTML"===t||"cssText"===t){const e=i.innerHTML||i.cssText;r.dangerouslySetInnerHTML={__html:e}}else r[t]=i[e]}),e.createElement(t,r)}),Ui=function(t,i){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];switch(t){case"title":return{toComponent:()=>((t,i,n)=>{const r=Fi(n,{key:i,[vi]:!0});return[e.createElement("title",r,i)]})(0,i.title,i.titleAttributes),toString:()=>((e,t,i,n)=>{const r=Di(i),s=Pi(t);return r?"<".concat(e," ").concat(vi,'="true" ').concat(r,">").concat(Li(s,n),"</").concat(e,">"):"<".concat(e," ").concat(vi,'="true">').concat(Li(s,n),"</").concat(e,">")})(t,i.title,i.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Fi(i),toString:()=>Di(i)};default:return{toComponent:()=>Bi(t,i),toString:()=>function(e,t){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t.reduce((t,n)=>{const r=n,s=Object.keys(r).filter(e=>!("innerHTML"===e||"cssText"===e)).reduce((e,t)=>{const n="undefined"===typeof r[t]?t:"".concat(t,'="').concat(Li(r[t],i),'"');return e?"".concat(e," ").concat(n):n},""),a=r.innerHTML||r.cssText||"",o=-1===Ii.indexOf(e);return"".concat(t,"<").concat(e," ").concat(vi,'="true" ').concat(s).concat(o?"/>":">".concat(a,"</").concat(e,">"))},"")}(t,i,n)}}},zi=e=>{const t=e.baseTag,i=e.bodyAttributes,n=e.encode,r=void 0===n||n,s=e.htmlAttributes,a=e.noscriptTags,o=e.styleTags,l=e.title,h=void 0===l?"":l,u=e.titleAttributes,c=e.prioritizeSeoTags;let d=e.linkTags,f=e.metaTags,p=e.scriptTags,m={toComponent:()=>[],toString:()=>""};if(c){var g=(e=>{let t=e.metaTags,i=e.linkTags,n=e.scriptTags,r=e.encode;const s=Mi(t,fi),a=Mi(i,ci),o=Mi(n,di);return{priorityMethods:{toComponent:()=>[...Bi("meta",s.priority),...Bi("link",a.priority),...Bi("script",o.priority)],toString:()=>"".concat(Ui("meta",s.priority,r)," ").concat(Ui("link",a.priority,r)," ").concat(Ui("script",o.priority,r))},metaTags:s.default,linkTags:a.default,scriptTags:o.default}})(e);m=g.priorityMethods,d=g.linkTags,f=g.metaTags,p=g.scriptTags}return{priority:m,base:Ui("base",t,r),bodyAttributes:Ui("bodyAttributes",i,r),htmlAttributes:Ui("htmlAttributes",s,r),link:Ui("link",d,r),meta:Ui("meta",f,r),noscript:Ui("noscript",a,r),script:Ui("script",p,r),style:Ui("style",o,r),title:Ui("title",{title:h,titleAttributes:u},r)}},Vi=[],Hi=!("undefined"===typeof window||!window.document||!window.document.createElement),ji=class{constructor(e,t){f(this,"instances",[]),f(this,"canUseDOM",Hi),f(this,"context",void 0),f(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Vi:this.instances,add:e=>{(this.canUseDOM?Vi:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Vi:this.instances).indexOf(e);(this.canUseDOM?Vi:this.instances).splice(t,1)}}}),this.context=e,this.canUseDOM=t||!1,t||(e.helmet=zi({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Yi=parseInt(e.version.split(".")[0],10)>=19,Wi=e.createContext({}),Gi=(li=class t extends e.Component{constructor(e){super(e),f(this,"helmetData",void 0),this.helmetData=Yi?null:new ji(this.props.context||{},t.canUseDOM)}render(){return Yi?e.createElement(e.Fragment,null,this.props.children):e.createElement(Wi.Provider,{value:this.helmetData.value},this.props.children)}},f(li,"canUseDOM",Hi),li),Xi=(e,t)=>{const i=document.head||document.querySelector("head"),n=i.querySelectorAll("".concat(e,"[").concat(vi,"]")),r=[].slice.call(n),s=[];let a;return t&&t.length&&t.forEach(t=>{const i=document.createElement(e);for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))if("innerHTML"===e)i.innerHTML=t.innerHTML;else if("cssText"===e){const e=t.cssText;i.appendChild(document.createTextNode(e))}else{const n=e,r="undefined"===typeof t[n]?"":t[n];i.setAttribute(e,r)}i.setAttribute(vi,"true"),r.some((e,t)=>(a=t,i.isEqualNode(e)))?r.splice(a,1):s.push(i)}),r.forEach(e=>{var t;return null===(t=e.parentNode)||void 0===t?void 0:t.removeChild(e)}
2),s.forEach(e=>i.appendChild(e)),{oldTags:r,newTags:s}},qi=(e,t)=>{const i=document.getElementsByTagName(e)[0];if(!i)return;const n=i.getAttribute(vi),r=n?n.split(","):[],s=[...r],a=Object.keys(t);for(const o of a){const e=t[o]||"";i.getAttribute(o)!==e&&i.setAttribute(o,e),-1===r.indexOf(o)&&r.push(o);const n=s.indexOf(o);-1!==n&&s.splice(n,1)}for(let o=s.length-1;o>=0;o-=1)i.removeAttribute(s[o]);r.length===s.length?i.removeAttribute(vi):i.getAttribute(vi)!==a.join(",")&&i.setAttribute(vi,a.join(","))},Ki=(e,t)=>{const i=e.baseTag,n=e.bodyAttributes,r=e.htmlAttributes,s=e.linkTags,a=e.metaTags,o=e.noscriptTags,l=e.onChangeClientState,h=e.scriptTags,u=e.styleTags,c=e.title,d=e.titleAttributes;qi("body",n),qi("html",r),((e,t)=>{"undefined"!==typeof e&&document.title!==e&&(document.title=Pi(e)),qi("title",t)})(c,d);const f={baseTag:Xi("base",i),linkTags:Xi("link",s),metaTags:Xi("meta",a),noscriptTags:Xi("noscript",o),scriptTags:Xi("script",h),styleTags:Xi("style",u)},p={},m={};Object.keys(f).forEach(e=>{const t=f[e],i=t.newTags,n=t.oldTags;i.length&&(p[e]=i),n.length&&(m[e]=f[e].oldTags)}),t&&t(),l(e,p,m)},Qi=null,Ji=e=>{Qi&&cancelAnimationFrame(Qi),e.defer?Qi=requestAnimationFrame(()=>{Ki(e,()=>{Qi=null})}):(Ki(e),Qi=null)},Zi=class extends e.Component{constructor(){super(...arguments),f(this,"rendered",!1)}shouldComponentUpdate(e){return!ti()(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){this.props.context.helmetInstances.remove(this),this.emitChange()}emitChange(){const e=this.props.context,t=e.helmetInstances,i=e.setHelmet;let n=null;const s=(a=t.get().map(e=>{const t=e.props;return t.context,r(t,ii)}),{baseTag:ki(["href"],a),bodyAttributes:Ai("bodyAttributes",a),defer:Si(a,xi),encode:Si(a,bi),htmlAttributes:Ai("htmlAttributes",a),linkTags:Ri("link",["rel","href"],a),metaTags:Ri("meta",["name","charset","http-equiv","property","itemprop"],a),noscriptTags:Ri("noscript",["innerHTML"],a),onChangeClientState:Ci(a),scriptTags:Ri("script",["src","innerHTML"],a),styleTags:Ri("style",["cssText"],a),title:Ei(a),titleAttributes:Ai("titleAttributes",a),prioritizeSeoTags:Oi(a,_i)});var a;Gi.canUseDOM?Ji(s):zi&&(n=zi(s)),i(n)}init(){if(this.rendered)return;this.rendered=!0;this.props.context.helmetInstances.add(this),this.emitChange()}render(){return this.init(),null}},$i=[],en=e=>{const t={};for(const i of Object.keys(e))t[gi[i]||i]=e[i];return t},tn=e=>{const t={};for(const i of Object.keys(e)){t[mi[i]||i]=e[i]}return t},nn=(e,t)=>{if(!Hi)return;const i=document.getElementsByTagName(e)[0];if(!i)return;const n="data-rh-managed",r=i.getAttribute(n),s=r?r.split(","):[],a=Object.keys(t);for(const o of s)a.includes(o)||i.removeAttribute(o);for(const o of a){const e=t[o];void 0===e||null===e||!1===e?i.removeAttribute(o):!0===e?i.setAttribute(o,""):i.setAttribute(o,String(e))}a.length>0?i.setAttribute(n,a.join(",")):i.removeAttribute(n)},rn=()=>{const e={},t={};for(const i of $i){const n=i.props,r=n.htmlAttributes,s=n.bodyAttributes;r&&Object.assign(e,en(r)),s&&Object.assign(t,en(s))}nn("html",e),nn("body",t)},sn=class extends e.Component{componentDidMount(){$i.push(this),rn()}componentDidUpdate(){rn()}componentWillUnmount(){const e=$i.indexOf(this);-1!==e&&$i.splice(e,1),rn()}resolveTitle(){const e=this.props,t=e.title,i=e.titleTemplate,n=e.defaultTitle;return t&&i?i.replace(/%s/g,()=>Array.isArray(t)?t.join(""):t):t||n||void 0}renderTitle(){const t=this.resolveTitle();if(void 0===t)return null;const i=this.props.titleAttributes||{};return e.createElement("title",tn(i),t)}renderBase(){const t=this.props.base;return t?e.createElement("base",tn(t)):null}renderMeta(){const t=this.props.meta;return t&&Array.isArray(t)?t.map((t,i)=>e.createElement("meta",m({key:i},tn(t)))):null}renderLink(){const t=this.props.link;return t&&Array.isArray(t)?t.map((t,i)=>e.createElement("link",m({key:i},tn(t)))):null}renderScript(){const t=this.props.script;return t&&Array.isArray(t)?t.map((t,i)=>{const n=t.innerHTML,s=r(t,ni),a=tn(s);return n&&(a.dangerouslySetInnerHTML={__html:n}),e.createElement("script",m({key:i},a))}):null}renderStyle(){const t=this.props.style;return t&&Array.isArray(t)?t.map((t,i)=>{const n=t.cssText,s=r(t,ri),a=tn(s);return n&&(a.dangerouslySetInnerHTML={__html:n}),e.createElement("style",m({key:i},a))}):null}renderNoscript(){const t=this.props.noscript;return t&&Array.isArray(t)?t.map((t,i)=>{const n=t.innerHTML,s=r(t,si),a=tn(s);return n&&(a.dangerouslySetInnerHTML={__html:n}),e.createElement("noscript",m({key:i},a))}):null}render(){return e.createElement(e.Fragment,null,this.renderTitle(),this.renderBase(),this.renderMeta(),this.renderLink(),this.renderScript(),this.renderStyle(),this.renderNoscript())}},an=(hi=class extends e.Component{shouldComponentUpdate(e){return!Jt()(Ni(this.props,"helmetData"),Ni(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error("<".concat(e.type," /> elements are self-closing and can not contain children. Refer to our API for more information."))}}flattenArrayTypeChildren(e,t,i,n){return m(m({},t),{},{[e.type]:[...t[e.type]||[],m(m({},i),this.mapNestedChildrenToProps(e,n))]})}mapObjectTypeChildren(e,t,i,n){switch(e.type){case"title":return m(m({},t),{},{[e.type]:n,titleAttributes:m({},i)});case"body":return m(m({},t),{},{bodyAttributes:m({},i)});case"html":return m(m({},t),{},{htmlAttributes:m({},i)});default:return m(m({},t),{},{[e.type]:m({},i)})}}mapArrayTypeChildrenToProps(e,t){let i=m({},t);return Object.keys(e).forEach(t=>{i=m(m({},i),{},{[t]:e[t]})}),i}
2warnOnInvalidChildren(e,t){return $t()(pi.some(t=>e.type===t),"function"===typeof e.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":"Only elements types ".concat(pi.join(", ")," are allowed. Helmet does not support rendering <").concat(e.type,"> elements. Refer to our API for more information.")),$t()(!t||"string"===typeof t||Array.isArray(t)&&!t.some(e=>"string"!==typeof e),"Helmet expects a string as a child of <".concat(e.type,">. Did you forget to wrap your children in braces? ( <").concat(e.type,">{``}</").concat(e.type,"> ) Refer to our API for more information.")),!0}mapChildrenToProps(t,i){let n={};return e.Children.forEach(t,e=>{if(!e||!e.props)return;const t=e.props,s=t.children,a=r(t,ai),o=Object.keys(a).reduce((e,t)=>(e[gi[t]||t]=a[t],e),{});let l=e.type;switch("symbol"===typeof l?l=l.toString():this.warnOnInvalidChildren(e,s),l){case"Symbol(react.fragment)":i=this.mapChildrenToProps(s,i);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(e,n,o,s);break;default:i=this.mapObjectTypeChildren(e,i,o,s)}}),this.mapArrayTypeChildrenToProps(n,i)}render(){const t=this.props,i=t.children,n=r(t,oi);let s=m({},n),a=n.helmetData;if(i&&(s=this.mapChildrenToProps(i,s)),a&&!(a instanceof ji)){a=new ji(a.context,!0),delete s.helmetData}return Yi?e.createElement(sn,m({},s)):a?e.createElement(Zi,m(m({},s),{},{context:a.value})):e.createElement(Wi.Consumer,null,t=>e.createElement(Zi,m(m({},s),{},{context:t})))}},f(hi,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),hi),on=i(106),ln=i.n(on);ln().set("notifier","position","bottom-center"),ln().set("notifier","delay",4),ln().defaults.glossary.ok="Evet",ln().defaults.glossary.cancel="Hay\u0131r";const hn=ln(),un=!1,cn=!1,dn="${JSCORE_VERSION}",fn=function(e,t){if(!e)throw pn(t)},pn=function(e){return new Error("Firebase Database ("+dn+") INTERNAL ASSERT FAILED: "+e)},mn=function(e){const t=[];let i=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<128?t[i++]=r:r<2048?(t[i++]=r>>6|192,t[i++]=63&r|128):55296===(64512&r)&&n+1<e.length&&56320===(64512&e.charCodeAt(n+1))?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n)),t[i++]=r>>18|240,t[i++]=r>>12&63|128,t[i++]=r>>6&63|128,t[i++]=63&r|128):(t[i++]=r>>12|224,t[i++]=r>>6&63|128,t[i++]=63&r|128)}return t},gn={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"===typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const i=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[];for(let r=0;r<e.length;r+=3){const t=e[r],s=r+1<e.length,a=s?e[r+1]:0,o=r+2<e.length,l=o?e[r+2]:0,h=t>>2,u=(3&t)<<4|a>>4;let c=(15&a)<<2|l>>6,d=63&l;o||(d=64,s||(c=64)),n.push(i[h],i[u],i[c],i[d])}return n.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(mn(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let i=0,n=0;for(;i<e.length;){const r=e[i++];if(r<128)t[n++]=String.fromCharCode(r);else if(r>191&&r<224){const s=e[i++];t[n++]=String.fromCharCode((31&r)<<6|63&s)}else if(r>239&&r<365){const s=((7&r)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536;t[n++]=String.fromCharCode(55296+(s>>10)),t[n++]=String.fromCharCode(56320+(1023&s))}else{const s=e[i++],a=e[i++];t[n++]=String.fromCharCode((15&r)<<12|(63&s)<<6|63&a)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const i=t?this.charToByteMapWebSafe_:this.charToByteMap_,n=[];for(let r=0;r<e.length;){const t=i[e.charAt(r++)],s=r<e.length?i[e.charAt(r)]:0;++r;const a=r<e.length?i[e.charAt(r)]:64;++r;const o=r<e.length?i[e.charAt(r)]:64;if(++r,null==t||null==s||null==a||null==o)throw new vn;const l=t<<2|s>>4;if(n.push(l),64!==a){const e=s<<4&240|a>>2;if(n.push(e),64!==o){const e=a<<6&192|o;n.push(e)}}}return n},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};
2class vn extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const yn=function(e){const t=mn(e);return gn.encodeByteArray(t,!0)},xn=function(e){return yn(e).replace(/\./g,"")},bn=function(e){try{return gn.decodeString(e,!0)}catch(oT){console.error("base64Decode failed: ",oT)}return null};function wn(e){return Tn(void 0,e)}function Tn(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(const i in t)t.hasOwnProperty(i)&&_n(i)&&(e[i]=Tn(e[i],t[i]));return e}function _n(e){return"__proto__"!==e}function Sn(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof i.g)return i.g;throw new Error("Unable to locate global object.")}const En=()=>{try{return Sn().__FIREBASE_DEFAULTS__||(()=>{if("undefined"===typeof process)return})()||(()=>{if("undefined"===typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(oT){return}const t=e&&bn(e[1]);return t&&JSON.parse(t)})()}catch(oT){return void console.info("Unable to get __FIREBASE_DEFAULTS__ due to: ".concat(oT))}},Cn=e=>{var t;return null===(t=En())||void 0===t||null===(t=t.emulatorHosts)||void 0===t?void 0:t[e]},An=e=>{const t=Cn(e);if(!t)return;const i=t.lastIndexOf(":");if(i<=0||i+1===t.length)throw new Error("Invalid host ".concat(t," with no separate hostname and port!"));const n=parseInt(t.substring(i+1),10);return"["===t[0]?[t.substring(1,i-1),n]:[t.substring(0,i),n]},kn=()=>{var e;return null===(e=En())||void 0===e?void 0:e.config},Rn=e=>{var t;return null===(t=En())||void 0===t?void 0:t["_".concat(e)]};class On{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,i)=>{t?this.reject(t):this.resolve(i),"function"===typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,i))}}}function Pn(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const i=t||"demo-project",n=e.iat||0,r=e.sub||e.user_id;if(!r)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const s=m({iss:"https://securetoken.google.com/".concat(i),aud:i,iat:n,exp:n+3600,auth_time:n,sub:r,user_id:r,firebase:{sign_in_provider:"custom",identities:{}}},e);return[xn(JSON.stringify({alg:"none",type:"JWT"})),xn(JSON.stringify(s)),""].join(".")}function Mn(){return"undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:""}function Nn(){return"undefined"!==typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Mn())}function In(){var e;const t=null===(e=En())||void 0===e?void 0:e.forceEnvironment;if("node"===t)return!0;if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(i.g.process)}catch(oT){return!1}}function Ln(){const e="object"===typeof chrome?chrome.runtime:"object"===typeof browser?browser.runtime:void 0;return"object"===typeof e&&void 0!==e.id}function Dn(){return"object"===typeof navigator&&"ReactNative"===navigator.product}function Fn(){return!0===un||!0===cn}function Bn(){return!In()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function Un(){try{return"object"===typeof indexedDB}catch(oT){return!1}}function zn(){return new Promise((e,t)=>{try{let i=!0;const n="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(n);r.onsuccess=()=>{r.result.close(),i||self.indexedDB.deleteDatabase(n),e(!0)},r.onupgradeneeded=()=>{i=!1},r.onerror=()=>{var e;t((null===(e=r.error)||void 0===e?void 0:e.message)||"")}}catch(_E){t(_E)}})}function Vn(){return!("undefined"===typeof navigator||!navigator.cookieEnabled)}class Hn extends Error{constructor(e,t,i){super(t),this.code=e,this.customData=i,this.name="FirebaseError",Object.setPrototypeOf(this,Hn.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,jn.prototype.create)}}class jn{constructor(e,t,i){this.service=e,this.serviceName=t,this.errors=i}create(e){const t=(arguments.length<=1?void 0:arguments[1])||{},i="".concat(this.service,"/").concat(e),n=this.errors[e],r=n?function(e,t){return e.replace(Yn,(e,i)=>{const n=t[i];return null!=n?String(n):"<".concat(i,"?>")})}(n,t):"Error",s="".concat(this.serviceName,": ").concat(r," (").concat(i,").");return new Hn(i,s,t)}}const Yn=/\{\$([^}]+)}/g;function Wn(e){return JSON.parse(e)}function Gn(e){return JSON.stringify(e)}const Xn=function(e){let t={},i={},n={},r="";try{const s=e.split(".");t=Wn(bn(s[0])||""),i=Wn(bn(s[1])||""),r=s[2],n=i.d||{},delete i.d}catch(oT){}return{header:t,claims:i,data:n,signature:r}};function qn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Kn(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function Qn(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function Jn(e,t,i){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=t.call(i,e[r],r,e));return n}function Zn(e,t){if(e===t)return!0;const i=Object.keys(e),n=Object.keys(t);for(const r of i){if(!n.includes(r))return!1;const i=e[r],s=t[r];
2if($n(i)&&$n(s)){if(!Zn(i,s))return!1}else if(i!==s)return!1}for(const r of n)if(!i.includes(r))return!1;return!0}function $n(e){return null!==e&&"object"===typeof e}function er(e){const t=[];for(const n of Object.entries(e)){var i=u(n,2);const e=i[0],r=i[1];Array.isArray(r)?r.forEach(i=>{t.push(encodeURIComponent(e)+"="+encodeURIComponent(i))}):t.push(encodeURIComponent(e)+"="+encodeURIComponent(r))}return t.length?"&"+t.join("&"):""}function tr(e){const t={};return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){const i=u(e.split("="),2),n=i[0],r=i[1];t[decodeURIComponent(n)]=decodeURIComponent(r)}}),t}function ir(e){const t=e.indexOf("?");if(!t)return"";const i=e.indexOf("#",t);return e.substring(t,i>0?i:void 0)}class nr{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,t){t||(t=0);const i=this.W_;if("string"===typeof e)for(let u=0;u<16;u++)i[u]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(let u=0;u<16;u++)i[u]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(let u=16;u<80;u++){const e=i[u-3]^i[u-8]^i[u-14]^i[u-16];i[u]=4294967295&(e<<1|e>>>31)}let n,r,s=this.chain_[0],a=this.chain_[1],o=this.chain_[2],l=this.chain_[3],h=this.chain_[4];for(let u=0;u<80;u++){u<40?u<20?(n=l^a&(o^l),r=1518500249):(n=a^o^l,r=1859775393):u<60?(n=a&o|l&(a|o),r=2400959708):(n=a^o^l,r=3395469782);const e=(s<<5|s>>>27)+n+h+r+i[u]&4294967295;h=l,l=o,o=4294967295&(a<<30|a>>>2),a=s,s=e}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+a&4294967295,this.chain_[2]=this.chain_[2]+o&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+h&4294967295}update(e,t){if(null==e)return;void 0===t&&(t=e.length);const i=t-this.blockSize;let n=0;const r=this.buf_;let s=this.inbuf_;for(;n<t;){if(0===s)for(;n<=i;)this.compress_(e,n),n+=this.blockSize;if("string"===typeof e){for(;n<t;)if(r[s]=e.charCodeAt(n),++s,++n,s===this.blockSize){this.compress_(r),s=0;break}}else for(;n<t;)if(r[s]=e[n],++s,++n,s===this.blockSize){this.compress_(r),s=0;break}}this.inbuf_=s,this.total_+=t}digest(){const e=[];let t=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let n=this.blockSize-1;n>=56;n--)this.buf_[n]=255&t,t/=256;this.compress_(this.buf_);let i=0;for(let n=0;n<5;n++)for(let t=24;t>=0;t-=8)e[i]=this.chain_[n]>>t&255,++i;return e}}class rr{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,i){let n;if(void 0===e&&void 0===t&&void 0===i)throw new Error("Missing Observer.");n=function(e,t){if("object"!==typeof e||null===e)return!1;for(const i of t)if(i in e&&"function"===typeof e[i])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:i},void 0===n.next&&(n.next=sr),void 0===n.error&&(n.error=sr),void 0===n.complete&&(n.complete=sr);const r=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?n.error(this.finalError):n.complete()}catch(oT){}}),this.observers.push(n),r}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(oT){"undefined"!==typeof console&&console.error&&console.error(oT)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function sr(){}function ar(e,t){return"".concat(e," failed: ").concat(t," argument ")}const or=function(e){let t=0;for(let i=0;i<e.length;i++){const n=e.charCodeAt(i);n<128?t++:n<2048?t+=2:n>=55296&&n<=56319?(t+=4,i++):t+=3}return t};function lr(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;const i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3)*Math.pow(t,e),n=Math.round(.5*i*(Math.random()-.5)*2);return Math.min(144e5,i+n)}function hr(e){return e&&e._delegate?e._delegate:e}function ur(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch(t){return!1}}async function cr(e){return(await fetch(e,{credentials:"include"})).ok}class dr{constructor(e,t,i){this.name=e,this.instanceFactory=t,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const fr="[DEFAULT]";class pr{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new On;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&e.resolve(i)}catch(oT){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const i=this.normalizeInstanceIdentifier(null===e||void 0===e?void 0:e.identifier),n=null!==(t=null===e||void 0===e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(i)&&!this.shouldAutoInitialize()){if(n)return null;throw Error("Service ".concat(this.name," is not available"))}try{return this.getOrInitializeService({instanceIdentifier:i})}catch(oT){if(n)return null;throw oT}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error("Mismatching Component ".concat(e.name," for Provider ").concat(this.name,"."));if(this.component)throw Error("Component for ".concat(this.name," has already been provided"));if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:fr})}catch(oT){}for(const e of this.instancesDeferred.entries()){var t=u(e,2);const i=t[0],n=t[1],r=this.normalizeInstanceIdentifier(i);try{const e=this.getOrInitializeService({instanceIdentifier:r});n.resolve(e)}catch(oT){}}}}clearInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fr;this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fr;return this.instances.has(e)}getOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fr;return this.instancesOptions.get(e)||{}}initialize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.options,i=void 0===t?{}:t,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error("".concat(this.name,"(").concat(n,") has already been initialized"));if(!this.isComponentSet())throw Error("Component ".concat(this.name," has not been registered yet"));const r=this.getOrInitializeService({instanceIdentifier:n,options:i});for(const a of this.instancesDeferred.entries()){var s=u(a,2);const e=s[0],t=s[1];n===this.normalizeInstanceIdentifier(e)&&t.resolve(r)}return r}onInit(e,t){var i;const n=this.normalizeInstanceIdentifier(t),r=null!==(i=this.onInitCallbacks.get(n))&&void 0!==i?i:new Set;r.add(e),this.onInitCallbacks.set(n,r);const s=this.instances.get(n);return s&&e(s,n),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){const i=this.onInitCallbacks.get(t);if(i)for(const r of i)try{r(e,t)}catch(n){}}getOrInitializeService(e){let t=e.instanceIdentifier,i=e.options,n=void 0===i?{}:i,r=this.instances.get(t);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:(s=t,s===fr?void 0:s),options:n}),this.instances.set(t,r),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(r,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,r)}catch(a){}var s;return r||null}normalizeInstanceIdentifier(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fr;return this.component?this.component.multipleInstances?e:fr:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class mr{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component ".concat(e.name," has already been registered with ").concat(this.name));t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new pr(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}const gr=[];var vr;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.E
2RROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(vr||(vr={}));const yr={debug:vr.DEBUG,verbose:vr.VERBOSE,info:vr.INFO,warn:vr.WARN,error:vr.ERROR,silent:vr.SILENT},xr=vr.INFO,br={[vr.DEBUG]:"log",[vr.VERBOSE]:"log",[vr.INFO]:"info",[vr.WARN]:"warn",[vr.ERROR]:"error"},wr=function(e,t){if(t<e.logLevel)return;const i=(new Date).toISOString(),n=br[t];if(!n)throw new Error("Attempted to log a message with an invalid logType (value: ".concat(t,")"));for(var r=arguments.length,s=new Array(r>2?r-2:0),a=2;a<r;a++)s[a-2]=arguments[a];console[n]("[".concat(i,"]  ").concat(e.name,":"),...s)};class Tr{constructor(e){this.name=e,this._logLevel=xr,this._logHandler=wr,this._userLogHandler=null,gr.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in vr))throw new TypeError('Invalid value "'.concat(e,'" assigned to `logLevel`'));this._logLevel=e}setLogLevel(e){this._logLevel="string"===typeof e?yr[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!==typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this._userLogHandler&&this._userLogHandler(this,vr.DEBUG,...t),this._logHandler(this,vr.DEBUG,...t)}log(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this._userLogHandler&&this._userLogHandler(this,vr.VERBOSE,...t),this._logHandler(this,vr.VERBOSE,...t)}info(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this._userLogHandler&&this._userLogHandler(this,vr.INFO,...t),this._logHandler(this,vr.INFO,...t)}warn(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this._userLogHandler&&this._userLogHandler(this,vr.WARN,...t),this._logHandler(this,vr.WARN,...t)}error(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this._userLogHandler&&this._userLogHandler(this,vr.ERROR,...t),this._logHandler(this,vr.ERROR,...t)}}let _r,Sr;const Er=new WeakMap,Cr=new WeakMap,Ar=new WeakMap,kr=new WeakMap,Rr=new WeakMap;let Or={get(e,t,i){if(e instanceof IDBTransaction){if("done"===t)return Cr.get(e);if("objectStoreNames"===t)return e.objectStoreNames||Ar.get(e);if("store"===t)return i.objectStoreNames[1]?void 0:i.objectStore(i.objectStoreNames[0])}return Nr(e[t])},set:(e,t,i)=>(e[t]=i,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Pr(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(Sr||(Sr=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return e.apply(Ir(this),i),Nr(Er.get(this))}:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return Nr(e.apply(Ir(this),i))}:function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];const s=e.call(Ir(this),t,...n);return Ar.set(s,t.sort?t.sort():[t]),Nr(s)}}function Mr(e){return"function"===typeof e?Pr(e):(e instanceof IDBTransaction&&function(e){if(Cr.has(e))return;const t=new Promise((t,i)=>{const n=()=>{e.removeEventListener("complete",r),e.removeEventListener("error",s),e.removeEventListener("abort",s)},r=()=>{t(),n()},s=()=>{i(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",r),e.addEventListener("error",s),e.addEventListener("abort",s)});Cr.set(e,t)}(e),t=e,(_r||(_r=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,Or):e);var t}function Nr(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,i)=>{const n=()=>{e.removeEventListener("success",r),e.removeEventListener("error",s)},r=()=>{t(Nr(e.result)),n()},s=()=>{i(e.error),n()};e.addEventListener("success",r),e.addEventListener("error",s)});return t.then(t=>{t instanceof IDBCursor&&Er.set(t,e)}).catch(()=>{}),Rr.set(t,e),t}(e);if(kr.has(e))return kr.get(e);const t=Mr(e);return t!==e&&(kr.set(e,t),Rr.set(t,e)),t}const Ir=e=>Rr.get(e);function Lr(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.blocked,r=i.upgrade,s=i.blocking,a=i.terminated;const o=indexedDB.open(e,t),l=Nr(o);return r&&o.addEventListener("upgradeneeded",e=>{r(Nr(o.result),e.oldVersion,e.newVersion,Nr(o.transaction),e)}),n&&o.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),l.then(e=>{a&&e.addEventListener("close",()=>a()),s&&e.addEventListener("versionchange",e=>s(e.oldVersion,e.newVersion,e))}).catch(()=>{}),l}const Dr=["get","getKey","getAll","getAllKeys","count"],Fr=["put","add","delete","clear"],Br=new Map;function Ur(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if(Br.get(t))return Br.get(t);const i=t.replace(/FromIndex$/,""),n=t!==i,r=Fr.includes(i);if(!(i in(n?IDBIndex:IDBObjectStore).prototype)||!r&&!Dr.includes(i))return;const s=async function(e){const t=this.transaction(e,r?"readwrite":"readonly");let s=t.store;for(var a=arguments.length,o=new Array(a>1?a-1:0),l=1;l<a;l++)o[l-1]=arguments[l];
2return n&&(s=s.index(o.shift())),(await Promise.all([s[i](...o),r&&t.done]))[0]};return Br.set(t,s),s}Or=(e=>m(m({},e),{},{get:(t,i,n)=>Ur(t,i)||e.get(t,i,n),has:(t,i)=>!!Ur(t,i)||e.has(t,i)}))(Or);class zr{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null===t||void 0===t?void 0:t.type)}(e)){const t=e.getImmediate();return"".concat(t.library,"/").concat(t.version)}return null}).filter(e=>e).join(" ")}}const Vr="@firebase/app",Hr="0.15.1",jr=new Tr("@firebase/app"),Yr="@firebase/app-compat",Wr="@firebase/analytics-compat",Gr="@firebase/analytics",Xr="@firebase/app-check-compat",qr="@firebase/app-check",Kr="@firebase/auth",Qr="@firebase/auth-compat",Jr="@firebase/database",Zr="@firebase/data-connect",$r="@firebase/database-compat",es="@firebase/functions",ts="@firebase/functions-compat",is="@firebase/installations",ns="@firebase/installations-compat",rs="@firebase/messaging",ss="@firebase/messaging-compat",as="@firebase/performance",os="@firebase/performance-compat",ls="@firebase/remote-config",hs="@firebase/remote-config-compat",us="@firebase/storage",cs="@firebase/storage-compat",ds="@firebase/firestore",fs="@firebase/ai",ps="@firebase/firestore-compat",ms="firebase",gs="[DEFAULT]",vs={[Vr]:"fire-core",[Yr]:"fire-core-compat",[Gr]:"fire-analytics",[Wr]:"fire-analytics-compat",[qr]:"fire-app-check",[Xr]:"fire-app-check-compat",[Kr]:"fire-auth",[Qr]:"fire-auth-compat",[Jr]:"fire-rtdb",[Zr]:"fire-data-connect",[$r]:"fire-rtdb-compat",[es]:"fire-fn",[ts]:"fire-fn-compat",[is]:"fire-iid",[ns]:"fire-iid-compat",[rs]:"fire-fcm",[ss]:"fire-fcm-compat",[as]:"fire-perf",[os]:"fire-perf-compat",[ls]:"fire-rc",[hs]:"fire-rc-compat",[us]:"fire-gcs",[cs]:"fire-gcs-compat",[ds]:"fire-fst",[ps]:"fire-fst-compat",[fs]:"fire-vertex","fire-js":"fire-js",[ms]:"fire-js-all"},ys=new Map,xs=new Map,bs=new Map;function ws(e,t){try{e.container.addComponent(t)}catch(oT){jr.debug("Component ".concat(t.name," failed to register with FirebaseApp ").concat(e.name),oT)}}function Ts(e){const t=e.name;if(bs.has(t))return jr.debug("There were multiple attempts to register component ".concat(t,".")),!1;bs.set(t,e);for(const i of ys.values())ws(i,e);for(const i of xs.values())ws(i,e);return!0}function _s(e,t){const i=e.container.getProvider("heartbeat").getImmediate({optional:!0});return i&&i.triggerHeartbeat(),e.container.getProvider(t)}function Ss(e){return null!==e&&void 0!==e&&void 0!==e.settings}const Es=new jn("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
2d-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."});class Cs{constructor(e,t,i){this._isDeleted=!1,this._options=m({},e),this._config=m({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new dr("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Es.create("app-deleted",{appName:this._name})}}const As="12.16.0";function ks(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e;if("object"!==typeof t){t={name:t}}const n=m({name:gs,automaticDataCollectionEnabled:!0},t),r=n.name;if("string"!==typeof r||!r)throw Es.create("bad-app-name",{appName:String(r)});if(i||(i=kn()),!i)throw Es.create("no-options");const s=ys.get(r);if(s){if(Zn(i,s.options)&&Zn(n,s.config))return s;throw Es.create("duplicate-app",{appName:r})}const a=new mr(r);for(const l of bs.values())a.addComponent(l);const o=new Cs(i,n,a);return ys.set(r,o),o}function Rs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gs;const t=ys.get(e);if(!t&&e===gs&&kn())return ks();if(!t)throw Es.create("no-app",{appName:e});return t}function Os(e,t,i){var n;let r=null!==(n=vs[e])&&void 0!==n?n:e;i&&(r+="-".concat(i));const s=r.match(/\s|\//),a=t.match(/\s|\//);if(s||a){const e=['Unable to register library "'.concat(r,'" with version "').concat(t,'":')];return s&&e.push('library name "'.concat(r,'" contains illegal characters (whitespace or "/")')),s&&a&&e.push("and"),a&&e.push('version name "'.concat(t,'" contains illegal characters (whitespace or "/")')),void jr.warn(e.join(" "))}Ts(new dr("".concat(r,"-version"),()=>({library:r,version:t}),"VERSION"))}const Ps="firebase-heartbeat-store";let Ms=null;function Ns(){return Ms||(Ms=Lr("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(Ps)}catch(oT){console.warn(oT)}}}).catch(e=>{throw Es.create("idb-open",{originalErrorMessage:e.message})})),Ms}async function Is(e,t){try{const i=(await Ns()).transaction(Ps,"readwrite"),n=i.objectStore(Ps);await n.put(t,Ls(e)),await i.done}catch(oT){if(oT instanceof Hn)jr.warn(oT.message);else{const t=Es.create("idb-set",{originalErrorMessage:null===oT||void 0===oT?void 0:oT.message});jr.warn(t.message)}}}function Ls(e){return"".concat(e.name,"!").concat(e.options.appId)}class Ds{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Bs(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){try{var e;const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),n=Fs();var t;if(null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats))if(this._heartbeatsCache=await this._heartbeatsCachePromise,null==(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats))return;if(this._heartbeatsCache.lastSentHeartbeatDate===n||this._heartbeatsCache.heartbeats.some(e=>e.date===n))return;if(this._heartbeatsCache.heartbeats.push({date:n,agent:i}),this._heartbeatsCache.heartbeats.length>30){const e=function(e){if(0===e.length)return-1;let t=0,i=e[0].date;for(let n=1;n<e.length;n++)e[n].date<i&&(i=e[n].date,t=n);return t}(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(e,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(oT){jr.warn(oT)}}async getHeartbeatsHeader(){try{var e;if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const t=Fs(),i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024;const i=[];let n=e.slice();for(const r of e){const e=i.find(e=>e.agent===r.agent);if(e){if(e.dates.push(r.date),Us(i)>t){e.dates.pop();break}}else if(i.push({agent:r.agent,dates:[r.date]}),Us(i)>t){i.pop();break}n=n.slice(1)}return{heartbeatsToSend:i,unsentEntries:n}}(this._heartbeatsCache.heartbeats),n=i.heartbeatsToSend,r=i.unsentEntries,s=xn(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(oT){return jr.warn(oT),""}}}function Fs(){return(new Date).toISOString().substring(0,10)}class Bs{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!Un()&&zn().then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await Ns()).transaction(Ps),i=await t.objectStore(Ps).get(Ls(e));return await t.done,i}catch(oT){if(oT instanceof Hn)jr.warn(oT.message);
2else{const t=Es.create("idb-get",{originalErrorMessage:null===oT||void 0===oT?void 0:oT.message});jr.warn(t.message)}}}(this.app);return null!==e&&void 0!==e&&e.heartbeats?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){var t;const i=await this.read();return Is(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){if(await this._canUseIndexedDBPromise){var t;const i=await this.read();return Is(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}}}function Us(e){return xn(JSON.stringify({version:2,heartbeats:e})).length}var zs;zs="",Ts(new dr("platform-logger",e=>new zr(e),"PRIVATE")),Ts(new dr("heartbeat",e=>new Ds(e),"PRIVATE")),Os(Vr,Hr,zs),Os(Vr,Hr,"esm2020"),Os("fire-js","");const Vs=["providerId"],Hs=["uid","auth","stsTokenManager"],js=["providerId","signInMethod"];function Ys(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Ws=Ys,Gs=new jn("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),Xs=new Tr("@firebase/auth");function qs(e){if(Xs.logLevel<=vr.ERROR){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];Xs.error("Auth (".concat(As,"): ").concat(e),...i)}}function Ks(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];throw ea(e,...i)}function Qs(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return ea(e,...i)}function Js(e,t,i){const n=m(m({},Ws()),{},{[t]:i});return new jn("auth","Firebase",n).create(t,{appName:e.name})}function Zs(e){return Js(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function $s(e,t,i){if(!(t instanceof i))throw i.name!==t.constructor.name&&Ks(e,"argument-error"),Js(e,"argument-error","Type of ".concat(t.constructor.name," does not match expected instance.")+"Did you pass a reference from a different Auth SDK?")}function ea(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];if("string"!==typeof e){const t=i[0],n=[...i.slice(1)];return n[0]&&(n[0].appName=e.name),e._errorFactory.create(t,...n)}return Gs.create(e,...i)}function ta(e,t){if(!e){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];throw ea(t,...n)}}function ia(e){const t="INTERNAL ASSERTION FAILED: "+e;throw qs(t),new Error(t)}function na(e,t){e||ia(t)}function ra(){var e;return"undefined"!==typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function sa(){return"http:"===aa()||"https:"===aa()}function aa(){var e;return"undefined"!==typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}class oa{constructor(e,t){this.shortDelay=e,this.longDelay=t,na(t>e,"Short delay should be less than long delay!"),this.isMobile=Nn()||Dn()}get(){return"undefined"!==typeof navigator&&navigator&&"onLine"in navigator&&"boolean"===typeof navigator.onLine&&(sa()||Ln()||"connection"in navigator)&&!navigator.onLine?Math.min(5e3,this.shortDelay):this.isMobile?this.longDelay:this.shortDelay}}function la(e,t){na(e.emulator,"Emulator should always be set here");const i=e.emulator.url;return t?"".concat(i).concat(t.startsWith("/")?t.slice(1):t):i}class ha{static initialize(e,t,i){this.fetchImpl=e,t&&(this.headersImpl=t),i&&(this.responseImpl=i)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!==typeof self&&"fetch"in self?self.fetch:"undefined"!==typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!==typeof fetch?fetch:void ia("Could not find fetch implementation, make sure you call FetchProvi
2der.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!==typeof self&&"Headers"in self?self.Headers:"undefined"!==typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!==typeof Headers?Headers:void ia("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!==typeof self&&"Response"in self?self.Response:"undefined"!==typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!==typeof Response?Response:void ia("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const ua={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},ca=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],da=new oa(3e4,6e4);function fa(e,t){return e.tenantId&&!t.tenantId?m(m({},t),{},{tenantId:e.tenantId}):t}async function pa(e,t,i,n){return ma(e,arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},async()=>{let r={},s={};n&&("GET"===t?s=n:r={body:JSON.stringify(n)});const a=er(m(m({},s),{},{key:e.config.apiKey})).slice(1),o=await e._getAdditionalHeaders();o["Content-Type"]="application/json",e.languageCode&&(o["X-Firebase-Locale"]=e.languageCode);const l=m({method:t,headers:o},r);return"undefined"!==typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||(l.referrerPolicy="strict-origin-when-cross-origin"),e.emulatorConfig&&ur(e.emulatorConfig.host)&&(l.credentials="include"),ha.fetch()(await va(e,e.config.apiHost,i,a),l)})}async function ma(e,t,i){e._canInitEmulator=!1;const n=m(m({},ua),t);try{const t=new xa(e),r=await Promise.race([i(),t.promise]);t.clearNetworkTimeout();const s=await r.json();if("needConfirmation"in s)throw ba(e,"account-exists-with-different-credential",s);if(r.ok&&!("errorMessage"in s))return s;{const t=r.ok?s.errorMessage:s.error.message,i=u(t.split(" : "),2),a=i[0],o=i[1];if("FEDERATED_USER_ID_ALREADY_LINKED"===a)throw ba(e,"credential-already-in-use",s);if("EMAIL_EXISTS"===a)throw ba(e,"email-already-in-use",s);if("USER_DISABLED"===a)throw ba(e,"user-disabled",s);const l=n[a]||a.toLowerCase().replace(/[_\s]+/g,"-");if(o)throw Js(e,l,o);Ks(e,l)}}catch(oT){if(oT instanceof Hn)throw oT;Ks(e,"network-request-failed",{message:String(oT)})}}async function ga(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const s=await pa(e,t,i,n,r);return"mfaPendingCredential"in s&&Ks(e,"multi-factor-auth-required",{_serverResponse:s}),s}async function va(e,t,i,n){const r="".concat(t).concat(i,"?").concat(n),s=e,a=s.config.emulator?la(e.config,r):"".concat(e.config.apiScheme,"://").concat(r);if(ca.includes(i)&&(await s._persistenceManagerAvailable,"COOKIE"===s._getPersistenceType())){return s._getPersistence()._getFinalTarget(a).toString()}return a}function ya(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class xa{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>
2{this.timer=setTimeout(()=>t(Qs(this.auth,"network-request-failed")),da.get())})}}function ba(e,t,i){const n={appName:e.name};i.email&&(n.email=i.email),i.phoneNumber&&(n.phoneNumber=i.phoneNumber);const r=Qs(e,t,n);return r.customData._tokenResponse=i,r}function wa(e){return void 0!==e&&void 0!==e.enterprise}class Ta{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return ya(t.enforcementState);return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function _a(e,t){return pa(e,"GET","/v2/recaptchaConfig",fa(e,t))}async function Sa(e,t){return pa(e,"POST","/v1/accounts:lookup",t)}function Ea(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(oT){}}function Ca(e){return 1e3*Number(e)}function Aa(e){const t=u(e.split("."),3),i=t[0],n=t[1],r=t[2];if(void 0===i||void 0===n||void 0===r)return qs("JWT malformed, contained fewer than 3 sections"),null;try{const e=bn(n);return e?JSON.parse(e):(qs("Failed to decode base64 JWT payload"),null)}catch(oT){return qs("Caught error parsing JWT payload as JSON",null===oT||void 0===oT?void 0:oT.toString()),null}}function ka(e){const t=Aa(e);return ta(t,"internal-error"),ta("undefined"!==typeof t.exp,"internal-error"),ta("undefined"!==typeof t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}async function Ra(e,t){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2])return t;try{return await t}catch(oT){throw oT instanceof Hn&&function(e){let t=e.code;return t==="auth/".concat("user-disabled")||t==="auth/".concat("user-token-expired")}(oT)&&e.auth.currentUser===e&&await e.auth.signOut(),oT}}class Oa{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){if(e){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{var t;this.errorBackoff=3e4;const e=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,e)}}schedule(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(oT){return void((null===oT||void 0===oT?void 0:oT.code)==="auth/".concat("network-request-failed")&&this.schedule(!0))}this.schedule()}}class Pa{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=Ea(this.lastLoginAt),this.creationTime=Ea(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function Ma(e){var t;const i=e.auth,n=await e.getIdToken(),r=await Ra(e,Sa(i,{idToken:n}));ta(null===r||void 0===r?void 0:r.users.length,i,"internal-error");const s=r.users[0];e._notifyReloadListener(s);const a=null!==(t=s.providerUserInfo)&&void 0!==t&&t.length?Na(s.providerUserInfo):[],o=(l=e.providerData,h=a,[...l.filter(e=>!h.some(t=>t.providerId===e.providerId)),...h]);var l,h;const u=e.isAnonymous,c=!(e.email&&s.passwordHash)&&!(null!==o&&void 0!==o&&o.length),d=!!u&&c,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:o,metadata:new Pa(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(e,f)}function Na(e){return e.map(e=>{let t=e.providerId,i=r(e,Vs);
2return{providerId:t,uid:i.rawId||"",displayName:i.displayName||null,email:i.email||null,phoneNumber:i.phoneNumber||null,photoURL:i.photoUrl||null}})}class Ia{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){ta(e.idToken,"internal-error"),ta("undefined"!==typeof e.idToken,"internal-error"),ta("undefined"!==typeof e.refreshToken,"internal-error");const t="expiresIn"in e&&"undefined"!==typeof e.expiresIn?Number(e.expiresIn):ka(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){ta(0!==e.length,"internal-error");const t=ka(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]||!this.accessToken||this.isExpired?(ta(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const i=await async function(e,t){const i=await ma(e,{},async()=>{const i=er({grant_type:"refresh_token",refresh_token:t}).slice(1),n=e.config,r=n.tokenApiHost,s=n.apiKey,a=await va(e,r,"/v1/token","key=".concat(s)),o=await e._getAdditionalHeaders();o["Content-Type"]="application/x-www-form-urlencoded";const l={method:"POST",headers:o,body:i};return e.emulatorConfig&&ur(e.emulatorConfig.host)&&(l.credentials="include"),ha.fetch()(a,l)});return{accessToken:i.access_token,expiresIn:i.expires_in,refreshToken:i.refresh_token}}(e,t),n=i.accessToken,r=i.refreshToken,s=i.expiresIn;this.updateTokensAndExpiration(n,r,Number(s))}updateTokensAndExpiration(e,t,i){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*i}static fromJSON(e,t){const i=t.refreshToken,n=t.accessToken,r=t.expirationTime,s=new Ia;return i&&(ta("string"===typeof i,"internal-error",{appName:e}),s.refreshToken=i),n&&(ta("string"===typeof n,"internal-error",{appName:e}),s.accessToken=n),r&&(ta("number"===typeof r,"internal-error",{appName:e}),s.expirationTime=r),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Ia,this.toJSON())}_performRefresh(){return ia("not implemented")}}function La(e,t){ta("string"===typeof e||"undefined"===typeof e,"internal-error",{appName:t})}class Da{constructor(e){let t=e.uid,i=e.auth,n=e.stsTokenManager,s=r(e,Hs);this.providerId="firebase",this.proactiveRefresh=new Oa(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=i,this.stsTokenManager=n,this.accessToken=n.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new Pa(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await Ra(this,this.stsTokenManager.getToken(this.auth,e));return ta(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=hr(e),n=await i.getIdToken(t),r=Aa(n);ta(r&&r.exp&&r.auth_time&&r.iat,i.auth,"internal-error");const s="object"===typeof r.firebase?r.firebase:void 0,a=null===s||void 0===s?void 0:s.sign_in_provider;return{claims:r,token:n,authTime:Ea(Ca(r.auth_time)),issuedAtTime:Ea(Ca(r.iat)),expirationTime:Ea(Ca(r.exp)),signInProvider:a||null,signInSecondFactor:(null===s||void 0===s?void 0:s.sign_in_second_factor)||null}}(this,e)}reload(){return async function(e){const t=hr(e);await Ma(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(ta(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.ph
2otoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(e=>m({},e)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new Da(m(m({},this),{},{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){ta(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),i=!0),t&&await Ma(this),await this.auth._persistUserIfCurrent(this),i&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Ss(this.auth.app))return Promise.reject(Zs(this.auth));const e=await this.getIdToken();return await Ra(this,async function(e,t){return pa(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return m(m({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>m({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{},{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var i,n,r,s,a,o,l,h;const u=null!==(i=t.displayName)&&void 0!==i?i:void 0,c=null!==(n=t.email)&&void 0!==n?n:void 0,d=null!==(r=t.phoneNumber)&&void 0!==r?r:void 0,f=null!==(s=t.photoURL)&&void 0!==s?s:void 0,p=null!==(a=t.tenantId)&&void 0!==a?a:void 0,g=null!==(o=t._redirectEventId)&&void 0!==o?o:void 0,v=null!==(l=t.createdAt)&&void 0!==l?l:void 0,y=null!==(h=t.lastLoginAt)&&void 0!==h?h:void 0,x=t.uid,b=t.emailVerified,w=t.isAnonymous,T=t.providerData,_=t.stsTokenManager;ta(x&&_,e,"internal-error");const S=Ia.fromJSON(this.name,_);ta("string"===typeof x,e,"internal-error"),La(u,e.name),La(c,e.name),ta("boolean"===typeof b,e,"internal-error"),ta("boolean"===typeof w,e,"internal-error"),La(d,e.name),La(f,e.name),La(p,e.name),La(g,e.name),La(v,e.name),La(y,e.name);const E=new Da({uid:x,auth:e,email:c,emailVerified:b,displayName:u,isAnonymous:w,photoURL:f,phoneNumber:d,tenantId:p,stsTokenManager:S,createdAt:v,lastLoginAt:y});return T&&Array.isArray(T)&&(E.providerData=T.map(e=>m({},e))),g&&(E._redirectEventId=g),E}static async _fromIdTokenResponse(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=new Ia;n.updateFromServerResponse(t);const r=new Da({uid:t.localId,auth:e,stsTokenManager:n,isAnonymous:i});return await Ma(r),r}static async _fromGetAccountInfoResponse(e,t,i){const n=t.users[0];ta(void 0!==n.localId,"internal-error");const r=void 0!==n.providerUserInfo?Na(n.providerUserInfo):[],s=!(n.email&&n.passwordHash)&&!(null!==r&&void 0!==r&&r.length),a=new Ia;a.updateFromIdToken(i);const o=new Da({uid:n.localId,auth:e,stsTokenManager:a,isAnonymous:s}),l={uid:n.localId,displayName:n.displayName||null,photoURL:n.photoUrl||null,email:n.email||null,emailVerified:n.emailVerified||!1,phoneNumber:n.phoneNumber||null,tenantId:n.tenantId||null,providerData:r,metadata:new Pa(n.createdAt,n.lastLoginAt),isAnonymous:!(n.email&&n.passwordHash)&&!(null!==r&&void 0!==r&&r.length)};return Object.assign(o,l),o}}const Fa=new Map;function Ba(e){na(e instanceof Function,"Expected a class definition");let t=Fa.get(e);return t?(na(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Fa.set(e,t),t)}class Ua{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}Ua.type="NONE";const za=Ua;function Va(e,t,i){return"firebase".concat(":",e,":").concat(t,":").concat(i)}class Ha{constructor(e,t,i){this.persistence=e,this.auth=t,this.userKey=i;const n=this.auth,r=n.config,s=n.name;this.fullUserKey=Va(this.userKey,r.apiKey,s),this.fullPersistenceKey=Va("persistence",r.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if("string"===typeof e){const t=await Sa(this.auth,{idToken:e}).catch(()=>{});return t?Da._fromGetAccountInfoResponse(this.auth,t,e):null}return Da._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"authUser";if(!t.length)return new Ha(Ba(za),e,i);const n=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e);let r=n[0]||Ba(za);const s=Va(i,e.config.apiKey,e.name);let a=null;for(const h of t)try{const t=await h._get(s);if(t){let i;if("string"===typeof t){const n=await Sa(e,{idToken:t}).catch(()=>{});if(!n)break;i=await Da._fromGetAccountInfoResponse(e,n,t)}else i=Da._fromJSON(e,t);h!==r&&(a=i),r=h;break}}catch(l){}const o=n.filter(e=>e._shouldAllowMigration);return r._shouldAllowMigration&&o.length?(r=o[0],a&&await r._set(s,a.toJSON()),await Promise.all(t.map(async e=>{if(e!==r)try{await e._remove(s)}catch(t){}})),new Ha(r,e,i)):new Ha(r,e,i)}}function ja(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Xa(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Ya(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Ka(t))return"Blackberry";if(Qa(t))return"Webos";if(Wa(t))return"Safari";if((t.includes("chrome/")||Ga(t))&&!t.includes("edge/"))return"Chrome";if(qa(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,i=e.match(t);if(2===(null===i||void 0===i?void 0:i.length))return i[1]}return"Other"}function Ya(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mn();return/firefox\//i.test(e)}function Wa(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mn()).toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Ga(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mn();return/crios\//i.test(e)}function Xa(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mn();return/iemobile/i.test(e)}function qa(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mn();return/android/i.test(e)}function Ka(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mn();return/blackberry/i.test(e)}function Qa(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mn();return/webos/i.test(e)}function Ja(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mn();return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function Za(){return function(){const e=Mn();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}()&&10===document.documentMode}function $a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mn();return Ja(e)||qa(e)||Qa(e)||Ka(e)||/windows phone/i.test(e)||Xa(e)}function eo(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];switch(e){case"Browser":t=ja(Mn());break;case"Worker":t="".concat(ja(Mn()),"-").concat(e);break;default:t=e}const n=i.length?i.join(","):"FirebaseCore-web";return"".concat(t,"/","JsCore","/").concat(As,"/").concat(n)}class to{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const i=t=>new Promise((i,n)=>{try{i(e(t))}catch(oT){n(oT)}});i.onAbort=t,this.queue.push(i);const n=this.queue.length-1;return()=>{this.queue[n]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const i of this.queue)await i(e),i.onAbort&&t.push(i.onAbort)}catch(oT){t.reverse();for(const n of t)try{n()}catch(i){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null===oT||void 0===oT?void 0:oT.message})}}}class io{constructor(e){var t,i,n,r;const s=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(t=s.minPasswordLength)&&void 0!==t?t:6,s.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=s.maxPasswordLength),void 0!==s.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=s.containsLowercaseCharacter),void 0!==s.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=s.containsUppercaseCharacter),void 0!==s.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=s.containsNumericCharacter),void 0!==s.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=s.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(i=null===(n=e.allowedNonAlphanumericCharacters)||void 0===n?void 0:n.join(""))&&void 0!==i?i:"",this.forceUpgradeOnSignin=null!==(r=e.forceUpgradeOnSignin)&&void 0!==r&&r,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,i,n,r,s,a;const o={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,o),this.validatePasswordCharacterOptions(e,o),o.isValid&&
2(o.isValid=null===(t=o.meetsMinPasswordLength)||void 0===t||t),o.isValid&&(o.isValid=null===(i=o.meetsMaxPasswordLength)||void 0===i||i),o.isValid&&(o.isValid=null===(n=o.containsLowercaseLetter)||void 0===n||n),o.isValid&&(o.isValid=null===(r=o.containsUppercaseLetter)||void 0===r||r),o.isValid&&(o.isValid=null===(s=o.containsNumericCharacter)||void 0===s||s),o.isValid&&(o.isValid=null===(a=o.containsNonAlphanumericCharacter)||void 0===a||a),o}validatePasswordLengthOptions(e,t){const i=this.customStrengthOptions.minPasswordLength,n=this.customStrengthOptions.maxPasswordLength;i&&(t.meetsMinPasswordLength=e.length>=i),n&&(t.meetsMaxPasswordLength=e.length<=n)}validatePasswordCharacterOptions(e,t){let i;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let n=0;n<e.length;n++)i=e.charAt(n),this.updatePasswordCharacterOptionsStatuses(t,i>="a"&&i<="z",i>="A"&&i<="Z",i>="0"&&i<="9",this.allowedNonAlphanumericCharacters.includes(i))}updatePasswordCharacterOptionsStatuses(e,t,i,n,r){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=i)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=n)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=r))}}class no{constructor(e,t,i,n){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=i,this.config=n,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new so(this),this.idTokenSubscription=new so(this),this.beforeStateQueue=new to(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Gs,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=n.sdkClientVersion,this._persistenceManagerAvailable=new Promise(e=>this._resolvePersistenceManagerAvailable=e)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=Ba(t)),this._initializationPromise=this.queue(async()=>{var i,n,r;if(!this._deleted&&(this.persistenceManager=await Ha.create(this,e),null===(i=this._resolvePersistenceManagerAvailable)||void 0===i||i.call(this),!this._deleted)){if(null!==(n=this._popupRedirectResolver)&&void 0!==n&&n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(oT){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(r=this.currentUser)||void 0===r?void 0:r.uid)||null,this._deleted||(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e,!0):void 0}async initializeCurrentUserFromIdToken(e){try{const t=await Sa(this,{idToken:e}),i=await Da._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(i)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(Ss(this.app)){const e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}const t=await this.assertedPersistence.getCurrentUser();let i=t,n=!1;if(e&&this.config.authDomain){var r,s;await this.getOrInitRedirectPersistenceManager();const t=null===(r=this.redirectUser)||void 0===r?void 0:r._redirectEventId,a=null===(s=i)||void 0===s?void 0:s._redirectEventId,o=await this.tryRedirectSignIn(e);t&&t!==a||null===o||void 0===o||!o.user||(i=o.user,n=!0)}if(!i)return this.directlySetCurrentUser(null);
2if(!i._redirectEventId){if(n)try{await this.beforeStateQueue.runMiddleware(i)}catch(oT){i=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(oT))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return ta(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(oT){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await Ma(e)}catch(oT){if((null===oT||void 0===oT?void 0:oT.code)!=="auth/".concat("network-request-failed"))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"===typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Ss(this.app))return Promise.reject(Zs(this));const t=e?hr(e):null;return t&&ta(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this._deleted)return e&&ta(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Ss(this.app)?Promise.reject(Zs(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Ss(this.app)?Promise.reject(Zs(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Ba(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await async function(e){return pa(e,"GET","/v2/passwordPolicy",fa(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}(this),t=new io(e);null===this.tenantId?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new jn("auth","Firebase",e())}onAuthStateChanged(e,t,i){return this.registerStateListener(this.authStateSubscription,e,t,i)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,i){return this.registerStateListener(this.idTokenSubscription,e,t,i)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const i=this.onAuthStateChanged(()=>{i(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await async function(e,t){return pa(e,"POST","/v2/accounts:revokeToken",fa(e,t))}(this,t)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}async _setRedirectUser(e,t){const i=await this.getOrInitRedirectPersistenceManager(t);return null===e?i.removeCurrentUser():i.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&Ba(e)||this._popupRedirectResolver;ta(t,this,"argument-error"),this.redirectPersistenceManager=await Ha.create(this,[Ba(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,i;return this._isInitialized&&await this.queue(async()=>{}),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e?this._currentUser:(null===(i=this.redirectUser)||void 0===i?void 0:i._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return"".concat(this.config.authDomain,":").concat(this.config.apiKey,":").concat(this.name)}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const i=null!==(e=null===(t=this.currentUser)||void 0===t?void 0:t.uid)&&void 0!==e?e:null;this.lastNotifiedUid!==i&&(this.lastNotifiedUid=i,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,i,n){if(this._deleted)return()=>{};const r="function"===typeof t?t:t.next.bind(t);let s=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(ta(a,this,"internal-error"),a.then(()=>{s||r(this.currentUser)}),"function"===typeof t){const r=e.addObserver(t,i,n);return()=>{s=!0,r()}}{const i=e.addObserver(t);return()=>{s=!0,i()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return ta(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=eo(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const i=await(null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader());i&&(t["X-Firebase-Client"]=i);const n=await this._getAppCheckToken();return n&&(t["X-Firebase-AppCheck"]=n),t}async _getAppCheckToken(){var e;if(Ss(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await(null===(e=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getToken());return null!==t&&void 0!==t&&t.error&&function(e){if(Xs.logLevel<=vr.WARN){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];Xs.warn("Auth (".concat(As,"): ").concat(e),...i)}}("Error while retrieving App Check token: ".concat(t.error)),null===t||void 0===t?void 0:t.token}}function ro(e){return hr(e)}class so{constructor(e){this.auth=e,this.observer=null,this.addObserver=function(e,t){const i=new rr(e,t);return i.subscribe.bind(i)}(e=>this.observer=e)}get next(){return ta(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let ao={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function oo(e){return ao.loadJS(e)}function lo(e){return"__".concat(e).concat(Math.floor(1e6*Math.random()))}class ho{constructor(){this.enterprise=new uo}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class uo{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}const co="NO_RECAPTCHA",fo="onFirebaseAuthREInstanceReady";class po{constructor(e){this.type="recaptcha-enterprise",this.auth=ro(e)}async verify(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"verify",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function i(t,i,n){const r=window.grecaptcha;wa(r)?r.enterprise.ready(()=>{r.enterprise.execute(t,{action:e}).then(e=>{i(e)}).catch(()=>{i(co)})}):n(Error("No reCAPTCHA enterprise script loaded."))}if(this.auth.settings.appVerificationDisabledForTesting){return(new ho).execute("siteKey",{action:"verify"})}
2return new Promise((e,n)=>{(async function(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,i)=>{_a(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(n=>{if(void 0!==n.recaptchaKey){const i=new Ta(n);return null==e.tenantId?e._agentRecaptchaConfig=i:e._tenantRecaptchaConfigs[e.tenantId]=i,t(i.siteKey)}i(new Error("recaptcha Enterprise site key undefined"))}).catch(e=>{i(e)})})})(this.auth).then(async r=>{if(!t&&wa(window.grecaptcha)&&po.scriptInjectionDeferred)await po.scriptInjectionDeferred.promise,i(r,e,n);else{if("undefined"===typeof window)return void n(new Error("RecaptchaVerifier is only supported in browser"));let t=ao.recaptchaEnterpriseScript;0!==t.length&&(t+=r+"&onload=".concat(fo)),po.scriptInjectionDeferred=new On,window[fo]=()=>{var e;null===(e=po.scriptInjectionDeferred)||void 0===e||e.resolve()},oo(t).then(()=>{var e;return null===(e=po.scriptInjectionDeferred)||void 0===e?void 0:e.promise}).then(()=>{i(r,e,n)}).catch(e=>{n(e)})}}).catch(e=>{n(e)})})}}async function mo(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s=new po(e);let a;if(r)a=co;else try{a=await s.verify(i)}catch(_E){a=await s.verify(i,!0)}const o=m({},t);if("mfaSmsEnrollment"===i||"mfaSmsSignIn"===i){if("phoneEnrollmentInfo"in o){const e=o.phoneEnrollmentInfo.phoneNumber,t=o.phoneEnrollmentInfo.recaptchaToken;Object.assign(o,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:t,captchaResponse:a,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in o){const e=o.phoneSignInInfo.recaptchaToken;Object.assign(o,{phoneSignInInfo:{recaptchaToken:e,captchaResponse:a,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return o}return n?Object.assign(o,{captchaResp:a}):Object.assign(o,{captchaResponse:a}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function go(e,t,i,n,r){if("EMAIL_PASSWORD_PROVIDER"===r){var s;if(null!==(s=e._getRecaptchaConfig())&&void 0!==s&&s.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const r=await mo(e,t,i,"getOobCode"===i);return n(e,r)}return n(e,t).catch(async r=>{if(r.code==="auth/".concat("missing-recaptcha-token")){console.log("".concat(i," is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow."));const r=await mo(e,t,i,"getOobCode"===i);return n(e,r)}return Promise.reject(r)})}if("PHONE_PROVIDER"===r){var a;if(null!==(a=e._getRecaptchaConfig())&&void 0!==a&&a.isProviderEnabled("PHONE_PROVIDER")){const r=await mo(e,t,i);return n(e,r).catch(async r=>{var s;if("AUDIT"===(null===(s=e._getRecaptchaConfig())||void 0===s?void 0:s.getProviderEnforcementState("PHONE_PROVIDER"))&&(r.code==="auth/".concat("missing-recaptcha-token")||r.code==="auth/".concat("invalid-app-credential"))){console.log("Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ".concat(i," flow."));const r=await mo(e,t,i,!1,!0);return n(e,r)}return Promise.reject(r)})}{const r=await mo(e,t,i,!1,!0);return n(e,r)}}return Promise.reject(r+" provider is not supported.")}async function vo(e){const t=ro(e),i=await _a(t,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),n=new Ta(i);if(null==t.tenantId?t._agentRecaptchaConfig=n:t._tenantRecaptchaConfigs[t.tenantId]=n,n.isAnyProviderEnabled()){new po(t).verify()}}function yo(e,t,i){const n=ro(e);ta(/^https?:\/\//.test(t),n,"invalid-emulator-scheme");const r=!(null===i||void 0===i||!i.disableWarnings),s=xo(t),a=function(e){const t=xo(e),i=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!i)return{host:"",port:null};const n=i[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(n);if(r){const e=r[1];return{host:e,port:bo(n.substr(e.length+1))}}{const e=u(n.split(":"),2);return{host:e[0],port:bo(e[1])}}}(t),o=a.host,l=a.port,h=null===l?"":":".concat(l),c={url:"".concat(s,"//").concat(o).concat(h,"/")},d=Object.freeze({host:o,port:l,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:r})});if(!n._canInitEmulator)return ta(n.config.emulator&&n.emulatorConfig,n,"emulator-config-failed"),void ta(Zn(c,n.config.emulator)&&Zn(d,n.emulatorConfig),n,"emulator-config-failed");n.config.emulator=c,n.emulatorConfig=d,n.settings.appVerificationDisabledForTesting=!0,ur(o)?cr("".concat(s,"//").concat(o).concat(h)):r||function(){function e(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!==typeof console&&"function"===typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials.");"undefined"!==typeof window&&"undefined"!==typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function xo(e){const t=e.indexOf(":");
2return t<0?"":e.substr(0,t+1)}function bo(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}po.scriptInjectionDeferred=null;class wo{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return ia("not implemented")}_getIdTokenResponse(e){return ia("not implemented")}_linkToIdToken(e,t){return ia("not implemented")}_getReauthenticationResolver(e){return ia("not implemented")}}async function To(e,t){return pa(e,"POST","/v1/accounts:signUp",t)}async function _o(e,t){return ga(e,"POST","/v1/accounts:signInWithPassword",fa(e,t))}class So extends wo{constructor(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;super("password",i),this._email=e,this._password=t,this._tenantId=n}static _fromEmailAndPassword(e,t){return new So(e,t,"password")}static _fromEmailAndCode(e,t){return new So(e,t,"emailLink",arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"===typeof e?JSON.parse(e):e;if(null!==t&&void 0!==t&&t.email&&null!==t&&void 0!==t&&t.password){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return go(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",_o,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return async function(e,t){return ga(e,"POST","/v1/accounts:signInWithEmailLink",fa(e,t))}(e,{email:this._email,oobCode:this._password});default:Ks(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return go(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",To,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return async function(e,t){return ga(e,"POST","/v1/accounts:signInWithEmailLink",fa(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:Ks(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function Eo(e,t){return ga(e,"POST","/v1/accounts:signInWithIdp",fa(e,t))}class Co extends wo{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Co(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):Ks("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
2once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"===typeof e?JSON.parse(e):e,i=t.providerId,n=t.signInMethod,s=r(t,js);if(!i||!n)return null;const a=new Co(i,n);return a.idToken=s.idToken||void 0,a.accessToken=s.accessToken||void 0,a.secret=s.secret,a.nonce=s.nonce,a.pendingToken=s.pendingToken||null,a}_getIdTokenResponse(e){return Eo(e,this.buildRequest())}_linkToIdToken(e,t){const i=this.buildRequest();return i.idToken=t,Eo(e,i)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Eo(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=er(t)}return e}}async function Ao(e,t){return pa(e,"POST","/v1/accounts:sendVerificationCode",fa(e,t))}const ko={USER_NOT_FOUND:"user-not-found"};class Ro extends wo{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new Ro({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new Ro({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return async function(e,t){return ga(e,"POST","/v1/accounts:signInWithPhoneNumber",fa(e,t))}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return async function(e,t){const i=await ga(e,"POST","/v1/accounts:signInWithPhoneNumber",fa(e,t));if(i.temporaryProof)throw ba(e,"account-exists-with-different-credential",i);return i}(e,m({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return async function(e,t){return ga(e,"POST","/v1/accounts:signInWithPhoneNumber",fa(e,m(m({},t),{},{operation:"REAUTH"})),ko)}(e,this._makeVerificationRequest())}_makeVerificationRequest(){const e=this.params,t=e.temporaryProof,i=e.phoneNumber,n=e.verificationId,r=e.verificationCode;return t&&i?{temporaryProof:t,phoneNumber:i}:{sessionInfo:n,code:r}}toJSON(){const e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"===typeof e&&(e=JSON.parse(e));const t=e,i=t.verificationId,n=t.verificationCode,r=t.phoneNumber,s=t.temporaryProof;return n||i||r||s?new Ro({verificationId:i,verificationCode:n,phoneNumber:r,temporaryProof:s}):null}}class Oo{constructor(e){var t,i,n,r,s,a;const o=tr(ir(e)),l=null!==(t=o.apiKey)&&void 0!==t?t:null,h=null!==(i=o.oobCode)&&void 0!==i?i:null,u=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(n=o.mode)&&void 0!==n?n:null);ta(l&&h&&u,"argument-error"),this.apiKey=l,this.operation=u,this.code=h,this.continueUrl=null!==(r=o.continueUrl)&&void 0!==r?r:null,this.languageCode=null!==(s=o.lang)&&void 0!==s?s:null,this.tenantId=null!==(a=o.tenantId)&&void 0!==a?a:null}static parseLink(e){const t=function(e){const t=tr(ir(e)).link,i=t?tr(ir(t)).deep_link_id:null,n=tr(ir(e)).deep_link_id;return(n?tr(ir(n)).link:null)||n||i||t||e}(e);try{return new Oo(t)}catch(i){return null}}}class Po{constructor(){this.providerId=Po.PROVIDER_ID}static credential(e,t){return So._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const i=Oo.parseLink(t);return ta(i,"argument-error"),So._fromEmailAndCode(e,i.code,i.tenantId)}}Po.PROVIDER_ID="password",Po.EMAIL_PASSWORD_SIGN_IN_METHOD="password",Po.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class Mo{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class No extends Mo{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class Io extends No{constructor(){super("facebook.com")}static credential(e){return Co._fromParams({providerId:Io.PROVIDER_ID,signInMethod:Io.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Io.credentialFromTaggedObject(e)}static credentialFromError(e){return Io.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let t=e._tokenResponse;if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return Io.credential(t.oauthAccessToken)}catch(i){return null}}}Io.FACEBOOK_SIGN_IN_METHOD="facebook.com",Io.PROVIDER_ID="facebook.com";class Lo extends No{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Co._fromParams({providerId:Lo.PROVIDER_ID,signInMethod:Lo.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return Lo.credentialFromTaggedObject(e)}static credentialFromError(e){return Lo.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let t=e._tokenResponse;if(!t)return null;const i=t.oauthIdToken,n=t.oauthAccessToken;if(!i&&!n)return null;try{return Lo.credential(i,n)}catch(r){return null}}}Lo.GOOGLE_SIGN_IN_METHOD="google.com",Lo.PROVIDER_ID="google.com";class Do extends No{constructor(){super("github.com")}static credential(e){return Co._fromParams({providerId:Do.PROVIDER_ID,signInMethod:Do.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Do.credentialFromTaggedObject(e)}static credentialFromError(e){return Do.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let t=e._tokenResponse;if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return Do.credential(t.oauthAccessToken)}catch(i){return null}}}Do.GITHUB_SIGN_IN_METHOD="github.com",Do.PROVIDER_ID="github.com";class Fo extends No{constructor(){super("twitter.com")}static credential(e,t){return Co._fromParams({providerId:Fo.PROVIDER_ID,signInMethod:Fo.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return Fo.credentialFromTaggedObject(e)}static credentialFromError(e){return Fo.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let t=e._tokenResponse;if(!t)return null;const i=t.oauthAccessToken,n=t.oauthTokenSecret;if(!i||!n)return null;try{return Fo.credential(i,n)}catch(r){return null}}}Fo.TWITTER_SIGN_IN_METHOD="twitter.com",Fo.PROVIDER_ID="twitter.com";class Bo{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=await Da._fromIdTokenResponse(e,i,n),s=Uo(i);return new Bo({user:r,providerId:s,_tokenResponse:i,operationType:t})}static async _forOperation(e,t,i){await e._updateTokensIfNecessary(i,!0);const n=Uo(i);return new Bo({user:e,providerId:n,_tokenResponse:i,operationType:t})}}function Uo(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}class zo extends Hn{constructor(e,t,i,n){var r;super(t.code,t.message),this.operationType=i,this.user=n,Object.setPrototypeOf(this,zo.prototype),this.customData={appName:e.n
2ame,tenantId:null!==(r=e.tenantId)&&void 0!==r?r:void 0,_serverResponse:t.customData._serverResponse,operationType:i}}static _fromErrorAndOperation(e,t,i,n){return new zo(e,t,i,n)}}function Vo(e,t,i,n){return("reauthenticate"===t?i._getReauthenticationResolver(e):i._getIdTokenResponse(e)).catch(i=>{if(i.code==="auth/".concat("multi-factor-auth-required"))throw zo._fromErrorAndOperation(e,i,t,n);throw i})}async function Ho(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=await Ra(e,t._linkToIdToken(e.auth,await e.getIdToken()),i);return Bo._forOperation(e,"link",n)}async function jo(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.auth;if(Ss(n.app))return Promise.reject(Zs(n));const r="reauthenticate";try{const s=await Ra(e,Vo(n,r,t,e),i);ta(s.idToken,n,"internal-error");const a=Aa(s.idToken);ta(a,n,"internal-error");const o=a.sub;return ta(e.uid===o,n,"user-mismatch"),Bo._forOperation(e,r,s)}catch(oT){throw(null===oT||void 0===oT?void 0:oT.code)==="auth/".concat("user-not-found")&&Ks(n,"user-mismatch"),oT}}async function Yo(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Ss(e.app))return Promise.reject(Zs(e));const n="signIn",r=await Vo(e,n,t),s=await Bo._fromIdTokenResponse(e,n,r);return i||await e._updateCurrentUser(s.user),s}function Wo(e,t){return pa(e,"POST","/v2/accounts/mfaEnrollment:start",fa(e,t))}new WeakMap;const Go="__sak";class Xo{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Go,"1"),this.storage.removeItem(Go),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class qo extends Xo{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=$a(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const i=this.storage.getItem(t),n=this.localCache[t];i!==n&&e(t,n,i)}}onStorageEvent(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.key)return void this.forAllChangedKeys((e,t,i)=>{this.notifyListeners(e,i)});const i=e.key;t?this.detachListener():this.stopPolling();const n=()=>{const e=this.storage.getItem(i);(t||this.localCache[i]!==e)&&this.notifyListeners(i,e)},r=this.storage.getItem(i);Za()&&r!==e.newValue&&e.newValue!==e.oldValue?setTimeout(n,10):n()}notifyListeners(e,t){this.localCache[e]=t;const i=this.listeners[e];if(i)for(const n of Array.from(i))n(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:i}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}qo.type="LOCAL";const Ko=qo;function Qo(e){var t,i;const n=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),r=RegExp("".concat(n,"=([^;]+)"));return null!==(t=null===(i=document.cookie.match(r))||void 0===i?void 0:i[1])&&void 0!==t?t:null}function Jo(e){const t="http:"===window.location.protocol;return"".concat(t?"__dev_":"__HOST-","FIREBASE_").concat(e.split(":")[3])}class Zo{constructor(){this.type="COOKIE",this.listenerUnsubscribes=new Map}_getFinalTarget(e){if(void 0===typeof window)return e;const t=new URL("".concat(window.location.origin,"/__cookies__"));return t.searchParams.set("finalTarget",e),t}async _isAvailable(){var e;return!("boolean"===typeof isSecureContext&&!isSecureContext)&&("undefined"!==typeof navigator&&"undefined"!==typeof document&&(null===(e=navigator.cookieEnabled)||void 0===e||e))}async _set(e,t){}async _get(e){if(!this._isAvailable())return null;const t=Jo(e);if(window.cookieStore){const e=await window.cookieStore.get(t);return null===e||void 0===e?void 0:e.value}return Qo(t)}async _remove(e){if(!this._isAvailable())return;if(!await this._get(e))return;const t=Jo(e);document.cookie="".concat(t,"=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;
2Priority=High"),await fetch("/__cookies__",{method:"DELETE"}).catch(()=>{})}_addListener(e,t){if(!this._isAvailable())return;const i=Jo(e);if(window.cookieStore){const e=e=>{const n=e.changed.find(e=>e.name===i);n&&t(n.value);e.deleted.find(e=>e.name===i)&&t(null)},n=()=>window.cookieStore.removeEventListener("change",e);return this.listenerUnsubscribes.set(t,n),window.cookieStore.addEventListener("change",e)}let n=Qo(i);const r=setInterval(()=>{const e=Qo(i);e!==n&&(t(e),n=e)},1e3);this.listenerUnsubscribes.set(t,()=>clearInterval(r))}_removeListener(e,t){const i=this.listenerUnsubscribes.get(t);i&&(i(),this.listenerUnsubscribes.delete(t))}}Zo.type="COOKIE";class $o extends Xo{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}$o.type="SESSION";const el=$o;class tl{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;const i=new tl(e);return this.receivers.push(i),i}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,i=t.data,n=i.eventId,r=i.eventType,s=i.data,a=this.handlersMap[r];if(null===a||void 0===a||!a.size)return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const o=Array.from(a).map(async e=>e(t.origin,s)),l=await function(e){return Promise.all(e.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}(o);t.ports[0].postMessage({status:"done",eventId:n,eventType:r,response:l})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function il(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i="";for(let n=0;n<t;n++)i+=Math.floor(10*Math.random());return e+i}tl.receivers=[];class nl{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50;const n="undefined"!==typeof MessageChannel?new MessageChannel:null;if(!n)throw new Error("connection_unavailable");let r,s;return new Promise((a,o)=>{const l=il("",20);n.port1.start();const h=setTimeout(()=>{o(new Error("unsupported_event"))},i);s={messageChannel:n,onMessage(e){const t=e;if(t.data.eventId===l)switch(t.data.status){case"ack":clearTimeout(h),r=setTimeout(()=>{o(new Error("timeout"))},3e3);break;case"done":clearTimeout(r),a(t.data.response);break;default:clearTimeout(h),clearTimeout(r),o(new Error("invalid_response"))}}},this.handlers.add(s),n.port1.addEventListener("message",s.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[n.port2])}).finally(()=>{s&&this.removeMessageHandler(s)})}}function rl(){return window}function sl(){return"undefined"!==typeof rl().WorkerGlobalScope&&"function"===typeof rl().importScripts}const al="firebaseLocalStorageDb",ol="firebaseLocalStorage",ll="fbase_key";class hl{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function ul(e,t){return e.transaction([ol],t?"readwrite":"readonly").objectStore(ol)}function cl(){const e=indexedDB.open(al,1);return new Promise((t,i)=>{e.addEventListener("error",()=>{i(e.error)}),e.addEventListener("upgradeneeded",()=>{const t=e.result;try{t.createObjectStore(ol,{keyPath:ll})}catch(oT){i(oT)}}),e.addEventListener("success",async()=>{const i=e.result;i.objectStoreNames.contains(ol)?t(i):(i.close(),await function(){const e=indexedDB.deleteDatabase(al);
2return new hl(e).toPromise()}(),t(await cl()))})})}async function dl(e,t,i){const n=ul(e,!0).put({[ll]:t,value:i});return new hl(n).toPromise()}function fl(e,t){const i=ul(e,!0).delete(t);return new hl(i).toPromise()}class pl{constructor(){this.type="LOCAL",this.dbPromise=null,this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.dbPromise||(this.dbPromise=cl(),this.dbPromise.catch(()=>{this.dbPromise=null})),this.dbPromise}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(oT){if(t++>3)throw oT;if(this.dbPromise){(await this.dbPromise).close(),this.dbPromise=null}}}async initializeServiceWorkerMessaging(){return sl()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=tl._getInstance(sl()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await async function(){var e;if(null===(e=navigator)||void 0===e||!e.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch(t){return null}}(),!this.activeServiceWorker)return;this.sender=new nl(this.activeServiceWorker);const i=await this.sender._send("ping",{},800);i&&null!==(e=i[0])&&void 0!==e&&e.fulfilled&&null!==(t=i[0])&&void 0!==t&&t.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(this.sender&&this.activeServiceWorker&&function(){var e;return(null===(e=navigator)||void 0===e||null===(e=e.serviceWorker)||void 0===e?void 0:e.controller)||null}()===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(t){}}async _isAvailable(){try{return!!indexedDB&&(await this._withRetries(async e=>{await dl(e,Go,"1"),await fl(e,Go)}),!0)}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(i=>dl(i,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(t=>async function(e,t){const i=ul(e,!1).get(t),n=await new hl(i).toPromise();return void 0===n?null:n.value}(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>fl(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(e=>{const t=ul(e,!1).getAll();return new hl(t).toPromise()});if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],i=new Set;if(0!==e.length)for(const n of e){const e=n.fbase_key,r=n.value;i.add(e),JSON.stringify(this.localCache[e])!==JSON.stringify(r)&&(this.notifyListeners(e,r),t.pu
2sh(e))}for(const n of Object.keys(this.localCache))this.localCache[n]&&!i.has(n)&&(this.notifyListeners(n,null),t.push(n));return t}notifyListeners(e,t){this.localCache[e]=t;const i=this.listeners[e];if(i)for(const n of Array.from(i))n(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}pl.type="LOCAL";const ml=pl;function gl(e,t){return pa(e,"POST","/v2/accounts/mfaSignIn:start",fa(e,t))}lo("rcb"),new oa(3e4,6e4);const vl="recaptcha";async function yl(e,t,i){if(!e._getRecaptchaConfig())try{await vo(e)}catch(_E){console.log("Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.")}try{let r;if(r="string"===typeof t?{phoneNumber:t}:t,"session"in r){const t=r.session;if("phoneNumber"in r){ta("enroll"===t.type,e,"internal-error");const n={idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"}},s=go(e,n,"mfaSmsEnrollment",async(e,t)=>{if(t.phoneEnrollmentInfo.captchaResponse===co){ta((null===i||void 0===i?void 0:i.type)===vl,e,"argument-error");return Wo(e,await xl(e,t,i))}return Wo(e,t)},"PHONE_PROVIDER"),a=await s.catch(e=>Promise.reject(e));return a.phoneSessionInfo.sessionInfo}{var n;ta("signin"===t.type,e,"internal-error");const s=(null===(n=r.multiFactorHint)||void 0===n?void 0:n.uid)||r.multiFactorUid;ta(s,e,"missing-multi-factor-info");const a={mfaPendingCredential:t.credential,mfaEnrollmentId:s,phoneSignInInfo:{clientType:"CLIENT_TYPE_WEB"}},o=go(e,a,"mfaSmsSignIn",async(e,t)=>{if(t.phoneSignInInfo.captchaResponse===co){ta((null===i||void 0===i?void 0:i.type)===vl,e,"argument-error");return gl(e,await xl(e,t,i))}return gl(e,t)},"PHONE_PROVIDER"),l=await o.catch(e=>Promise.reject(e));return l.phoneResponseInfo.sessionInfo}}{const t={phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"},n=go(e,t,"sendVerificationCode",async(e,t)=>{if(t.captchaResponse===co){ta((null===i||void 0===i?void 0:i.type)===vl,e,"argument-error");return Ao(e,await xl(e,t,i))}return Ao(e,t)},"PHONE_PROVIDER"),s=await n.catch(e=>Promise.reject(e));return s.sessionInfo}}finally{null===i||void 0===i||i._reset()}}async function xl(e,t,i){ta(i.type===vl,e,"argument-error");const n=await i.verify();ta("string"===typeof n,e,"argument-error");const r=m({},t);if("phoneEnrollmentInfo"in r){const e=r.phoneEnrollmentInfo.phoneNumber,t=r.phoneEnrollmentInfo.captchaResponse,i=r.phoneEnrollmentInfo.clientType,s=r.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(r,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:n,captchaResponse:t,clientType:i,recaptchaVersion:s}}),r}if("phoneSignInInfo"in r){const e=r.phoneSignInInfo.captchaResponse,t=r.phoneSignInInfo.clientType,i=r.phoneSignInInfo.recaptchaVersion;return Object.assign(r,{phoneSignInInfo:{recaptchaToken:n,captchaResponse:e,clientType:t,recaptchaVersion:i}}),r}return Object.assign(r,{recaptchaToken:n}),r}class bl{constructor(e){this.providerId=bl.PROVIDER_ID,this.auth=ro(e)}verifyPhoneNumber(e,t){return yl(this.auth,e,hr(t))}static credential(e,t){return Ro._fromVerification(e,t)}static credentialFromResult(e){const t=e;return bl.credentialFromTaggedObject(t)}static credentialFromError(e){return bl.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let t=e._tokenResponse;if(!t)return null;const i=t.phoneNumber,n=t.temporaryProof;return i&&n?Ro._fromTokenResponse(i,n):null}}function wl(e,t){return t?Ba(t):(ta(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}bl.PROVIDER_ID="phone",bl.PHONE_SIGN_IN_METHOD="phone";class Tl extends wo{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Eo(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Eo(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Eo(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function _l(e){return Yo(e.auth,new Tl(e),e.bypassAuthState)}function Sl(e){const t=e.auth,i=e.user;return ta(i,t,"internal-error"),jo(i,new Tl(e),e.bypassAuthState)}async function El(e){const t=e.auth,i=e.user;return ta(i,t,"internal-error"),Ho(i,new Tl(e),e.bypassAuthState)}class Cl{constructor(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.auth=e,this.resolver=i,this.user=n,this.bypassAuthState=r,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(oT){this.reject(oT)}})}async onAuthEvent(e){const t=e.urlResponse,i=e.sessionId,n=e.postBody,r=e.tenantId,s=e.error,a=e.type;if(s)return void this.reject(s);const o={auth:this.auth,requestUri:t,sessionId:i,tenantId:r||void 0,postBody:n||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(o))}catch(oT){this.reject(oT)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return _l;case"linkViaPopup":case"linkViaRedirect":return El;case"reauthViaPopup":case"reauthViaRedirect":return Sl;default:Ks(this.auth,"internal-error")}}resolve(e){na(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){na(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const Al=new oa(2e3,1e4);class kl extends Cl{constructor(e,t,i,n,r){super(e,t,n,r),this.provider=i,this.authWindow=null,this.pollId=null,kl.currentPopupAction&&kl.currentPopupAction.cancel(),kl.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return ta(e,this.auth,"internal-error"),e}async onExecution(){na(1===this.filter.length,"Popup operations only handle one event");const e=il();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(Qs(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(Qs(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,kl.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t;null!==(t=this.authWindow)&&void 0!==t&&null!==(t=t.window)&&void 0!==t&&t.closed?this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Qs(this.auth,"popup-closed-by-user"))},8e3):this.pollId=window.setTimeout(e,Al.get())};e()}}kl.currentPopupAction=null;const Rl=new Map;class Ol extends Cl{constructor(e,t){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,arguments.length>2&&void 0!==arguments[2]&&arguments[2]),this.eventId=null}async execute(){let e=Rl.get(this.auth._key());if(!e){try{const t=await async function(e,t){const i=Nl(t),n=Ml(e);if(!await n._isAvailable())return!1;const r="true"===await n._get(i);return await n._remove(i),r}(this.resolver,this.auth),i=t?await super.execute():null;e=()=>Promise.resolve(i)}catch(oT){e=()=>Promise.reject(oT)}Rl.set(this.auth._key(),e)}return this.bypassAuthState||Rl.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);
2if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function Pl(e,t){Rl.set(e._key(),t)}function Ml(e){return Ba(e._redirectPersistence)}function Nl(e){return Va("pendingRedirect",e.config.apiKey,e.name)}async function Il(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Ss(e.app))return Promise.reject(Zs(e));const n=ro(e),r=wl(n,t),s=new Ol(n,r,i),a=await s.execute();return a&&!i&&(delete a.user._redirectEventId,await n._persistUserIfCurrent(a.user),await n._setRedirectUser(null,t)),a}class Ll{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(i=>{this.isEventForConsumer(e,i)&&(t=!0,this.sendToConsumer(e,i),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Fl(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){if(e.error&&!Fl(e)){var i;const n=(null===(i=e.error.code)||void 0===i?void 0:i.split("auth/")[1])||"internal-error";t.onError(Qs(this.auth,n))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const i=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&i}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(Dl(e))}saveEventToCache(e){this.cachedEventUids.add(Dl(e)),this.lastProcessedEventTime=Date.now()}}function Dl(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function Fl(e){let t=e.type,i=e.error;return"unknown"===t&&(null===i||void 0===i?void 0:i.code)==="auth/".concat("no-auth-event")}const Bl=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ul=/^https?/;async function zl(e){if(e.config.emulator)return;const t=await async function(e){return pa(e,"GET","/v1/projects",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e),i=t.authorizedDomains;for(const r of i)try{if(Vl(r))return}catch(n){}Ks(e,"unauthorized-domain")}function Vl(e){const t=ra(),i=new URL(t),n=i.protocol,r=i.hostname;if(e.startsWith("chrome-extension://")){const i=new URL(e);return""===i.hostname&&""===r?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&i.hostname===r}if(!Ul.test(n))return!1;if(Bl.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}const Hl=new oa(3e4,6e4);function jl(){const e=rl().___jsl;if(null!==e&&void 0!==e&&e.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let i=0;i<e.CP.length;i++)e.CP[i]=null}function Yl(e){return new Promise((t,i)=>{var n,r;function s(){jl(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{jl(),i(Qs(e,"network-request-failed"))},timeout:Hl.get()})}if(null!==(n=rl().gapi)&&void 0!==n&&null!==(n=n.iframes)&&void 0!==n&&n.Iframe)t(gapi.iframes.getContext());else{if(null===(r=rl().gapi)||void 0===r||!r.load){const t=lo("iframefcb");return rl()[t]=()=>{gapi.load?s():i(Qs(e,"network-request-failed"))},oo("".concat(ao.gapiScript,"?onload=").concat(t)).catch(e=>i(e))}s()}}).catch(e=>{throw Wl=null,e})}let Wl=null;const Gl=new oa(5e3,15e3),Xl={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},ql=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Kl(e){const t=e.config;ta(t.authDomain,e,"auth-domain-config-required");const i=t.emulator?la(t,"emulator/auth/iframe"):"https://".concat(e.config.authDomain,"/").concat("__/auth/iframe"),n={apiKey:t.apiKey,appName:e.n
2ame,v:As},r=ql.get(e.config.apiHost);r&&(n.eid=r);const s=e._getFrameworks();return s.length&&(n.fw=s.join(",")),"".concat(i,"?").concat(er(n).slice(1))}async function Ql(e){const t=await function(e){return Wl=Wl||Yl(e),Wl}(e),i=rl().gapi;return ta(i,e,"internal-error"),t.open({where:document.body,url:Kl(e),messageHandlersFilter:i.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Xl,dontclear:!0},t=>new Promise(async(i,n)=>{await t.restyle({setHideOnLeave:!1});const r=Qs(e,"network-request-failed"),s=rl().setTimeout(()=>{n(r)},Gl.get());function a(){rl().clearTimeout(s),i(t)}t.ping(a).then(a,()=>{n(r)})}))}const Jl={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class Zl{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(oT){}}}function $l(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:500,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:600;const s=Math.max((window.screen.availHeight-r)/2,0).toString(),a=Math.max((window.screen.availWidth-n)/2,0).toString();let o="";const l=m(m({},Jl),{},{width:n.toString(),height:r.toString(),top:s,left:a}),h=Mn().toLowerCase();i&&(o=Ga(h)?"_blank":i),Ya(h)&&(t=t||"http://localhost",l.scrollbars="yes");const c=Object.entries(l).reduce((e,t)=>{let i=u(t,2),n=i[0],r=i[1];return"".concat(e).concat(n,"=").concat(r,",")},"");if(function(){var e;return Ja(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mn())&&!(null===(e=window.navigator)||void 0===e||!e.standalone)}(h)&&"_self"!==o)return function(e,t){const i=document.createElement("a");i.href=e,i.target=t;const n=document.createEvent("MouseEvent");n.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),i.dispatchEvent(n)}(t||"",o),new Zl(null);const d=window.open(t||"",o,c);ta(d,e,"popup-blocked");try{d.focus()}catch(oT){}return new Zl(d)}const eh="__/auth/handler",th="emulator/auth/handler",ih=encodeURIComponent("fac");async function nh(e,t,i,n,r,s){ta(e.config.authDomain,e,"auth-domain-config-required"),ta(e.config.apiKey,e,"invalid-api-key");const a={apiKey:e.config.apiKey,appName:e.name,authType:i,redirectUrl:n,v:As,eventId:r};if(t instanceof Mo){t.setDefaultLanguage(e.languageCode),a.providerId=t.providerId||"",Qn(t.getCustomParameters())||(a.customParameters=JSON.stringify(t.getCustomParameters()));for(const e of Object.entries(s||{})){var o=u(e,2);const t=o[0],i=o[1];a[t]=i}}if(t instanceof No){const e=t.getScopes().filter(e=>""!==e);e.length>0&&(a.scopes=e.join(","))}e.tenantId&&(a.tid=e.tenantId);const l=a;for(const u of Object.keys(l))void 0===l[u]&&delete l[u];const h=await e._getAppCheckToken(),c=h?"#".concat(ih,"=").concat(encodeURIComponent(h)):"";return"".concat(function(e){let t=e.config;if(!t.emulator)return"https://".concat(t.authDomain,"/").concat(eh);return la(t,th)}(e),"?").concat(er(l).slice(1)).concat(c)}const rh="webStorageSupport";const sh=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=el,this._completeRedirectFn=Il,this._overrideRedirectResult=Pl}async _openPopup(e,t,i,n){var r;na(null===(r=this.eventManagers[e._key()])||void 0===r?void 0:r.manager,"_initialize() not called before _openPopup()");
2return $l(e,await nh(e,t,i,ra(),n),il())}async _openRedirect(e,t,i,n){await this._originValidation(e);return function(e){rl().location.href=e}(await nh(e,t,i,ra(),n)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const e=this.eventManagers[t],i=e.manager,n=e.promise;return i?Promise.resolve(i):(na(n,"If manager is not set, promise should be"),n)}const i=this.initAndGetManager(e);return this.eventManagers[t]={promise:i},i.catch(()=>{delete this.eventManagers[t]}),i}async initAndGetManager(e){const t=await Ql(e),i=new Ll(e);return t.register("authEvent",t=>{ta(null===t||void 0===t?void 0:t.authEvent,e,"invalid-auth-event");return{status:i.onEvent(t.authEvent)?"ACK":"ERROR"}},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:i},this.iframes[e._key()]=t,i}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(rh,{type:rh},i=>{var n;const r=null===i||void 0===i||null===(n=i[0])||void 0===n?void 0:n[rh];void 0!==r&&t(!!r),Ks(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=zl(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return $a()||Wa()||Ja()}};var ah="@firebase/auth",oh="1.13.3";class lh{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}async getToken(e){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(e)}}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(t=>{e((null===t||void 0===t?void 0:t.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){ta(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const hh=Rn("authIdTokenMaxAge")||300;let uh=null;var ch,dh;ch={loadJS:e=>new Promise((t,i)=>{const n=document.createElement("script");n.setAttribute("src",e),n.onload=t,n.onerror=e=>{const t=Qs("internal-error");t.customData=e,i(t)},n.type="text/javascript",n.charset="UTF-8",function(){var e,t;return null!==(e=null===(t=document.getElementsByTagName("head"))||void 0===t?void 0:t[0])&&void 0!==e?e:document}().appendChild(n)}),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="},ao=ch,dh="Browser",Ts(new dr("auth",(e,t)=>{let i=t.options;const n=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),a=n.options,o=a.apiKey,l=a.authDomain;ta(o&&!o.includes(":"),"invalid-api-key",{appName:n.name});const h={apiKey:o,authDomain:l,clientPlatform:dh,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:eo(dh)},u=new no(n,r,s,h);return function(e,t){const i=(null===t||void 0===t?void 0:t.persistence)||[],n=(Array.isArray(i)?i:[i]).map(Ba);null!==t&&void 0!==t&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(n,null===t||void 0===t?void 0:t.popupRedirectResolver)}(u,i),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,i)=>{e.getProvider("auth-internal").initialize()})),Ts(new dr("auth-internal",e=>(e=>new lh(e))(ro(e.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),Os(ah,oh,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(dh)),Os(ah,oh,"esm2020");Os("firebase","12.16.0","app");var fh,ph,mh="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof i.g?i.g:"undefined"!==typeof self?self:{},gh={};(function(){var e;function t(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.C=Array(this.blockSize),this.o=this.h=0,this.u()}function i(e,t,i){i||(i=0);const n=Array(16);if("string"===typeof t)for(var r=0;r<16;++r)n[r]=t.charCodeAt(i++)|t.charCodeAt(i++)<<8|t.charCodeAt(i++)<<16|t.charCodeAt(i++)<<24;else for(r=0;r<16;++r)n[r]=t[i++]|t[i++]<<8|t[i++]<<16|t[i++]<<24;t=e.g[0],i=e.g[1],r=e.g[2];let s,a=e.g[3];s=t+(a^i&(r^a))+n[0]+3614090360&4294967295,s=a+(r^(t=i+(s<<7&4294967295|s>>>25))&(i^r))+n[1]+3905402710&4294967295,a=t+(s<<12&4294967295|s>>>20),s=r+(i^a&(t^i))+n[2]+606105819&4294967295,s=i+(t^(r=a+(s<<17&4294967295|s>>>15))&(a^t))+n[3]+3250441966&4294967295,s=t+(a^(i=r+(s<<22&4294967295|s>>>10))&(r^a))+n[4]+4118548399&4294967295,s=a+(r^(t=i+(s<<7&4294967295|s>>>25))&(i^r))+n[5]+1200080426&4294967295,a=t+(s<<12&4294967295|s>>>20),s=r+(i^a&(t^i))+n[6]+2821735955&4294967295,s=i+(t^(r=a+(s<<17&4294967295|s>>>15))&(a^t))+n[7]+4249261313&4294967295,s=t+(a^(i=r+(s<<22&4294967295|s>>>10))&(r^a))+n[8]+1770035416&4294967295,s=a+(r^(t=i+(s<<7&4294967295|s>>>25))&(i^r))+n[9]+2336552879&4294967295,a=t+(s<<12&4294967295|s>>>20),s=r+(i^a&(t^i))+n[10]+4294925233&4294967295,s=i+(t^(r=a+(s<<17&4294967295|s>>>15))&(a^t))+n[11]+2304563134&4294967295,s=t+(a^(i=r+(s<<22&4294967295|s>>>10))&(r^a))+n[12]+1804603682&4294967295,s=a+(r^(t=i+(s<<7&4294967295|s>>>25))&(i^r))+n[13]+4254626195&4294967295,a=t+(s<<12&4294967295|s>>>20),s=r+(i^a&(t^i))+n[14]+2792965006&4294967295,s=i+(t^(r=a+(s<<17&4294967295|s>>>15))&(a^t))+n[15]+1236535329&4294967295,s=t+(r^a&((i=r+(s<<22&4294967295|s>>>
vendor: 5,638 bytes, line 2
210))^r))+n[1]+4129170786&4294967295,s=a+(i^r&((t=i+(s<<5&4294967295|s>>>27))^i))+n[6]+3225465664&4294967295,a=t+(s<<9&4294967295|s>>>23),s=r+(t^i&(a^t))+n[11]+643717713&4294967295,s=i+(a^t&((r=a+(s<<14&4294967295|s>>>18))^a))+n[0]+3921069994&4294967295,s=t+(r^a&((i=r+(s<<20&4294967295|s>>>12))^r))+n[5]+3593408605&4294967295,s=a+(i^r&((t=i+(s<<5&4294967295|s>>>27))^i))+n[10]+38016083&4294967295,a=t+(s<<9&4294967295|s>>>23),s=r+(t^i&(a^t))+n[15]+3634488961&4294967295,s=i+(a^t&((r=a+(s<<14&4294967295|s>>>18))^a))+n[4]+3889429448&4294967295,s=t+(r^a&((i=r+(s<<20&4294967295|s>>>12))^r))+n[9]+568446438&4294967295,s=a+(i^r&((t=i+(s<<5&4294967295|s>>>27))^i))+n[14]+3275163606&4294967295,a=t+(s<<9&4294967295|s>>>23),s=r+(t^i&(a^t))+n[3]+4107603335&4294967295,s=i+(a^t&((r=a+(s<<14&4294967295|s>>>18))^a))+n[8]+1163531501&4294967295,s=t+(r^a&((i=r+(s<<20&4294967295|s>>>12))^r))+n[13]+2850285829&4294967295,s=a+(i^r&((t=i+(s<<5&4294967295|s>>>27))^i))+n[2]+4243563512&4294967295,a=t+(s<<9&4294967295|s>>>23),s=r+(t^i&(a^t))+n[7]+1735328473&4294967295,s=i+(a^t&((r=a+(s<<14&4294967295|s>>>18))^a))+n[12]+2368359562&4294967295,s=t+((i=r+(s<<20&4294967295|s>>>12))^r^a)+n[5]+4294588738&4294967295,s=a+((t=i+(s<<4&4294967295|s>>>28))^i^r)+n[8]+2272392833&4294967295,a=t+(s<<11&4294967295|s>>>21),s=r+(a^t^i)+n[11]+1839030562&4294967295,s=i+((r=a+(s<<16&4294967295|s>>>16))^a^t)+n[14]+4259657740&4294967295,s=t+((i=r+(s<<23&4294967295|s>>>9))^r^a)+n[1]+2763975236&4294967295,s=a+((t=i+(s<<4&4294967295|s>>>28))^i^r)+n[4]+1272893353&4294967295,a=t+(s<<11&4294967295|s>>>21),s=r+(a^t^i)+n[7]+4139469664&4294967295,s=i+((r=a+(s<<16&4294967295|s>>>16))^a^t)+n[10]+3200236656&4294967295,s=t+((i=r+(s<<23&4294967295|s>>>9))^r^a)+n[13]+681279174&4294967295,s=a+((t=i+(s<<4&4294967295|s>>>28))^i^r)+n[0]+3936430074&4294967295,a=t+(s<<11&4294967295|s>>>21),s=r+(a^t^i)+n[3]+3572445317&4294967295,s=i+((r=a+(s<<16&4294967295|s>>>16))^a^t)+n[6]+76029189&4294967295,s=t+((i=r+(s<<23&4294967295|s>>>9))^r^a)+n[9]+3654602809&4294967295,s=a+((t=i+(s<<4&4294967295|s>>>28))^i^r)+n[12]+3873151461&4294967295,a=t+(s<<11&4294967295|s>>>21),s=r+(a^t^i)+n[15]+530742520&4294967295,s=i+((r=a+(s<<16&4294967295|s>>>16))^a^t)+n[2]+3299628645&4294967295,s=t+(r^((i=r+(s<<23&4294967295|s>>>9))|~a))+n[0]+4096336452&4294967295,s=a+(i^((t=i+(s<<6&4294967295|s>>>26))|~r))+n[7]+1126891415&4294967295,a=t+(s<<10&4294967295|s>>>22),s=r+(t^(a|~i))+n[14]+2878612391&4294967295,s=i+(a^((r=a+(s<<15&4294967295|s>>>17))|~t))+n[5]+4237533241&4294967295,s=t+(r^((i=r+(s<<21&4294967295|s>>>11))|~a))+n[12]+1700485571&4294967295,s=a+(i^((t=i+(s<<6&4294967295|s>>>26))|~r))+n[3]+2399980690&4294967295,a=t+(s<<10&4294967295|s>>>22),s=r+(t^(a|~i))+n[10]+4293915773&4294967295,s=i+(a^((r=a+(s<<15&4294967295|s>>>17))|~t))+n[1]+2240044497&4294967295,s=t+(r^((i=r+(s<<21&4294967295|s>>>11))|~a))+n[8]+1873313359&4294967295,s=a+(i^((t=i+(s<<6&4294967295|s>>>26))|~r))+n[15]+4264355552&4294967295,a=t+(s<<10&4294967295|s>>>22),s=r+(t^(a|~i))+n[6]+2734768916&4294967295,s=i+(a^((r=a+(s<<15&4294967295|s>>>17))|~t))+n[13]+1309151649&4294967295,s=t+(r^((i=r+(s<<21&4294967295|s>>>11))|~a))+n[4]+4149444226&4294967295,s=a+(i^((t=i+(s<<6&4294967295|s>>>26))|~r))+n[11]+3174756917&4294967295,a=t+(s<<10&4294967295|s>>>22),s=r+(t^(a|~i))+n[2]+718787259&4294967295,s=i+(a^((r=a+(s<<15&4294967295|s>>>17))|~t))+n[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(r+(s<<21&4294967295|s>>>11))&4294967295,e.g[2]=e.g[2]+r&4294967295,e.g[3]=e.g[3]+a&4294967295}function n(e,t){this.h=t;const i=[];let n=!0;for(let r=e.length-1;r>=0;r--){const s=0|e[r];n&&s==t||(i[r]=s,n=!1)}this.g=i}!function(e,t){function i(){}i.prototype=t.prototype,e.F=t.prototype,e.prototype=new i,e.prototype.constructor=e,e.D=function(e,i,n){for(var r=Array(arguments.length-2),s=2;s<arguments.length;s++)r[s-2]=arguments[s];return t.prototype[i].apply(e,r)}}(t,function(){this.blockSize=-1}),t.prototype.u=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0},t.prototype.v=function(e,t){void 0===t&&(t=e.length);const n=t-this.blockSize,r=this.C;let s=this.h,a=0;for(;a<t;){if(0==s)for(;a<=n;)i(this,e,a),a+=this.blockSize;if("string"===typeof e){for(;a<t;)if(r[s++]=e.charCodeAt(a++),s==this.blockSize){i(this,r),s=0;break}}else for(;a<t;)if(r[s++]=e[a++],s==this.blockSize){i(this,r),s=0;break}}this.h=s,this.o+=t},t.prototype.A=function(){var e=Array((this.h<56?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;t<e.length-8;++t)e[t]=0;t=8*this.o;for(var i=e.length-8;i<e.length;++i)e[i]=255&t,t/=256;for(this.v(e),e=Array(16),t=0,i=0;i<4;++i)for(let n=0;n<32;n+=8)e[t++]=this.g[i]>>>n&255;return e};var r={};function s(e){return-128<=e&&e<128?function(e,t){var i=r;return Object.prototype.hasOwnProperty.call(i,e)?i[e]:i[e]=t(e)}(e,function(e){return new n([0|e],e<0?-1:0)}):new n([0|e],e<0?-1:0)}function a(e){if(isNaN(e)||!isFinite(e))return o;if(e<0)return d(a(-e));const t=[];let i=1;for(let n=0;e>=i;n++)t[n]=e/i|0,i*=4294967296;return new n(t,0)}var o=s(0),l=s(1),h=s(16777216);function u(e){if(0!=e.h)return!1;for(let t=0;t<e.g.length;t++)if(0!=e.g[t])return!1;return!0}function c(e){return-1==e.h}function d(e){const t=e.g.length,i=[];for(let n=0;n<t;n++)i[n]=~e.g[n];return new n(i,~e.h).add(l)}function f(e,t){return e.add(d(t))}function p(e,t){for(;(65535&e[t])!=e[t];)e[t+1]+=e[t]>>>16,e[t]&=65535,t++}function m(e,t){this.g=e,this.h=t}function g(e,t){if(u(t))throw Error("division by zero");if(u(e))return new m(o,o);if(c(e))return t=g(d(e),t),new m(d(t.g),d(t.h));if(c(t))return t=g(e,d(t)),new m(d(t.g),t.h);if(e.g.length>
vendor: 39,882 bytes, line 2
230){if(c(e)||c(t))throw Error("slowDivide_ only works with positive integers.");for(var i=l,n=t;n.l(e)<=0;)i=v(i),n=v(n);var r=y(i,1),s=y(n,1);for(n=y(n,2),i=y(i,2);!u(n);){var h=s.add(n);h.l(e)<=0&&(r=r.add(i),s=h),n=y(n,1),i=y(i,1)}return t=f(e,r.j(t)),new m(r,t)}for(r=o;e.l(t)>=0;){for(i=Math.max(1,Math.floor(e.m()/t.m())),n=(n=Math.ceil(Math.log(i)/Math.LN2))<=48?1:Math.pow(2,n-48),h=(s=a(i)).j(t);c(h)||h.l(e)>0;)h=(s=a(i-=n)).j(t);u(s)&&(s=l),r=r.add(s),e=f(e,h)}return new m(r,e)}function v(e){const t=e.g.length+1,i=[];for(let n=0;n<t;n++)i[n]=e.i(n)<<1|e.i(n-1)>>>31;return new n(i,e.h)}function y(e,t){const i=t>>5;t%=32;const r=e.g.length-i,s=[];for(let n=0;n<r;n++)s[n]=t>0?e.i(n+i)>>>t|e.i(n+i+1)<<32-t:e.i(n+i);return new n(s,e.h)}(e=n.prototype).m=function(){if(c(this))return-d(this).m();let e=0,t=1;for(let i=0;i<this.g.length;i++){const n=this.i(i);e+=(n>=0?n:4294967296+n)*t,t*=4294967296}return e},e.toString=function(e){if((e=e||10)<2||36<e)throw Error("radix out of range: "+e);if(u(this))return"0";if(c(this))return"-"+d(this).toString(e);const t=a(Math.pow(e,6));var i=this;let n="";for(;;){const r=g(i,t).g;let s=(((i=f(i,r.j(t))).g.length>0?i.g[0]:i.h)>>>0).toString(e);if(u(i=r))return s+n;for(;s.length<6;)s="0"+s;n=s+n}},e.i=function(e){return e<0?0:e<this.g.length?this.g[e]:this.h},e.l=function(e){return c(e=f(this,e))?-1:u(e)?0:1},e.abs=function(){return c(this)?d(this):this},e.add=function(e){const t=Math.max(this.g.length,e.g.length),i=[];let r=0;for(let n=0;n<=t;n++){let t=r+(65535&this.i(n))+(65535&e.i(n)),s=(t>>>16)+(this.i(n)>>>16)+(e.i(n)>>>16);r=s>>>16,t&=65535,s&=65535,i[n]=s<<16|t}return new n(i,-2147483648&i[i.length-1]?-1:0)},e.j=function(e){if(u(this)||u(e))return o;if(c(this))return c(e)?d(this).j(d(e)):d(d(this).j(e));if(c(e))return d(this.j(d(e)));if(this.l(h)<0&&e.l(h)<0)return a(this.m()*e.m());const t=this.g.length+e.g.length,i=[];for(var r=0;r<2*t;r++)i[r]=0;for(r=0;r<this.g.length;r++)for(let t=0;t<e.g.length;t++){const n=this.i(r)>>>16,s=65535&this.i(r),a=e.i(t)>>>16,o=65535&e.i(t);i[2*r+2*t]+=s*o,p(i,2*r+2*t),i[2*r+2*t+1]+=n*o,p(i,2*r+2*t+1),i[2*r+2*t+1]+=s*a,p(i,2*r+2*t+1),i[2*r+2*t+2]+=n*a,p(i,2*r+2*t+2)}for(e=0;e<t;e++)i[e]=i[2*e+1]<<16|i[2*e];for(e=t;e<2*t;e++)i[e]=0;return new n(i,0)},e.B=function(e){return g(this,e).h},e.and=function(e){const t=Math.max(this.g.length,e.g.length),i=[];for(let n=0;n<t;n++)i[n]=this.i(n)&e.i(n);return new n(i,this.h&e.h)},e.or=function(e){const t=Math.max(this.g.length,e.g.length),i=[];for(let n=0;n<t;n++)i[n]=this.i(n)|e.i(n);return new n(i,this.h|e.h)},e.xor=function(e){const t=Math.max(this.g.length,e.g.length),i=[];for(let n=0;n<t;n++)i[n]=this.i(n)^e.i(n);return new n(i,this.h^e.h)},t.prototype.digest=t.prototype.A,t.prototype.reset=t.prototype.u,t.prototype.update=t.prototype.v,ph=gh.Md5=t,n.prototype.add=n.prototype.add,n.prototype.multiply=n.prototype.j,n.prototype.modulo=n.prototype.B,n.prototype.compare=n.prototype.l,n.prototype.toNumber=n.prototype.m,n.prototype.toString=n.prototype.toString,n.prototype.getBits=n.prototype.i,n.fromNumber=a,n.fromString=function e(t,i){if(0==t.length)throw Error("number format error: empty string");if((i=i||10)<2||36<i)throw Error("radix out of range: "+i);if("-"==t.charAt(0))return d(e(t.substring(1),i));if(t.indexOf("-")>=0)throw Error('number format error: interior "-" character');const n=a(Math.pow(i,8));let r=o;for(let o=0;o<t.length;o+=8){var s=Math.min(8,t.length-o);const e=parseInt(t.substring(o,o+s),i);s<8?(s=a(Math.pow(i,s)),r=r.j(s).add(a(e))):(r=r.j(n),r=r.add(a(e)))}return r},fh=gh.Integer=n}).apply("undefined"!==typeof mh?mh:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{});var vh,yh,xh,bh,wh,Th,_h,Sh,Eh,Ch,Ah="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof i.g?i.g:"undefined"!==typeof self?self:{},kh={};(function(){var e,t=Object.defineProperty;var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof Ah&&Ah];for(var t=0;t<e.length;++t){var i=e[t];if(i&&i.Math==Math)return i}throw Error("Cannot find global object")}(this);function n(e,n){if(n)e:{var r=i;e=e.split(".");for(var s=0;s<e.length-1;s++){var a=e[s];if(!(a in r))break e;r=r[a]}(n=n(s=r[e=e[e.length-1]]))!=s&&null!=n&&t(r,e,{configurable:!0,writable:!0,value:n})}}n("Symbol.dispose",function(e){return e||Symbol("Symbol.dispose")}),n("Array.prototype.values",function(e){return e||function(){return this[Symbol.iterator]()}}),n("Object.entries",function(e){return e||function(e){var t,i=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&i.push([t,e[t]]);return i}});var r=r||{},s=this||self;function a(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function o(e,t,i){return e.call.apply(e.bind,arguments)}function l(e,t,i){return(l=o).apply(null,arguments)}function h(e,t){var i=Array.prototype.slice.call(arguments,1);return function(){var t=i.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function c(e,t){function i(){}i.prototype=t.prototype,e.Z=t.prototype,e.prototype=new i,e.prototype.constructor=e,e.Ob=function(e,i,n){for(var r=Array(arguments.length-2),s=2;s<arguments.length;s++)r[s-2]=arguments[s];return t.prototype[i].apply(e,r)}}var d="undefined"!==typeof AsyncContext&&"function"===typeof AsyncContext.Snapshot?e=>e&&AsyncContext.Snapshot.wrap(e):e=>e;function f(e){const t=e.length;if(t>0){const i=Array(t);for(let n=0;n<t;n++)i[n]=e[n];return i}return[]}function p(e,t){for(let n=1;n<arguments.length;n++){const t=arguments[n];var i=typeof t;if("array"==(i="object"!=i?i:t?Array.isArray(t)?"array":i:"null")||"object"==i&&"number"==typeof t.length){i=e.length||0;const n=t.length||0;e.length=i+n;for(let r=0;r<n;r++)e[i+r]=t[r]}else e.push(t)}}function m(e){s.setTimeout(()=>{throw e},0)}function g(){var e=w;let t=null;return e.g&&(t=e.g,e.g=e.g.next,e.g||(e.h=null),t.next=null),t}var v=new class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return this.h>0?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}(()=>new y,e=>e.reset());class y{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}let x,b=!1,w=new class{constructor(){this.h=this.g=null}add(e,t){const i=v.get();i.set(e,t),this.h?this.h.next=i:this.g=i,this.h=i}},T=()=>{const e=Promise.resolve(void 0);x=()=>{e.then(_)}};function _(){for(var e;e=g();){try{e.h.call(e.g)}catch(i){m(i)}var t=v;t.j(e),t.h<100&&(t.h++,e.next=t.g,t.g=e)}b=!1}function S(){this.u=this.u,this.C=this.C}function E(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}S.prototype.u=!1,S.prototype.dispose=function(){this.u||(this.u=!0,this.N())},S.prototype[Symbol.dispose]=function(){this.dispose()},S.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},E.prototype.h=function(){this.defaultPrevented=!0};var C=function(){if(!s.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{const e=()=>{};s.addEventListener("test",e,t),s.removeEventListener("test",e,t)}catch(i){}return e}();function A(e){return/^[\s\xa0]*$/.test(e)}function k(e,t){E.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e&&this.init(e,t)}c(k,E),k.prototype.init=function(e,t){const i=this.type=e.type,n=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;this.target=e.target||e.srcElement,this.g=t,(t=e.relatedTarget)||("mouseover"==i?t=e.fromElement:"mouseout"==i&&(t=e.toElement)),this.relatedTarget=t,n?(this.clientX=void 0!==n.clientX?n.clientX:n.pageX,this.clientY=void 0!==n.clientY?n.clientY:n.pageY,this.screenX=n.screenX||0,this.screenY=n.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType=e.pointerType,this.state=e.state,this.i=e,e.defaultPrevented&&k.Z.h.call(this)},k.prototype.h=function(){k.Z.h.call(this);const e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var R="closure_listenable_"+(1e6*Math.random()|0),O=0;function P(e,t,i,n,r){this.listener=e,this.proxy=null,this.src=t,this.type=i,this.capture=!!n,this.ha=r,this.key=++O,this.da=this.fa=!1}function M(e){e.da=!0,e.listener=null,e.proxy=null,e.src=null,e.ha=null}function N(e,t,i){for(const n in e)t.call(i,e[n],n,e)}function I(e){const t={};for(const i in e)t[i]=e[i];return t}const L="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function D(e,t){let i,n;for(let r=1;r<arguments.length;r++){for(i in n=arguments[r],n)e[i]=n[i];for(let t=0;t<L.length;t++)i=L[t],Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}}function F(e){this.src=e,this.g={},this.h=0}function B(e,t){const i=t.type;if(i in e.g){var n,r=e.g[i],s=Array.prototype.indexOf.call(r,t,void 0);(n=s>=0)&&Array.prototype.splice.call(r,s,1),n&&(M(t),0==e.g[i].length&&(delete e.g[i],e.h--))}}function U(e,t,i,n){for(let r=0;r<e.length;++r){const s=e[r];if(!s.da&&s.listener==t&&s.capture==!!i&&s.ha==n)return r}return-1}F.prototype.add=function(e,t,i,n,r){const s=e.toString();(e=this.g[s])||(e=this.g[s]=[],this.h++);const a=U(e,t,n,r);return a>-1?(t=e[a],i||(t.fa=!1)):((t=new P(t,this.src,s,!!n,r)).fa=i,e.push(t)),t};var z="closure_lm_"+(1e6*Math.random()|0),V={};function H(e,t,i,n,r){if(n&&n.once)return Y(e,t,i,n,r);if(Array.isArray(t)){for(let s=0;s<t.length;s++)H(e,t[s],i,n,r);return null}return i=J(i),e&&e[R]?e.J(t,i,a(n)?!!n.capture:!!n,r):j(e,t,i,!1,n,r)}function j(e,t,i,n,r,s){if(!t)throw Error("Invalid event type");const o=a(r)?!!r.capture:!!r;let l=K(e);if(l||(e[z]=l=new F(e)),(i=l.add(t,i,n,o,s)).proxy)return i;if(n=function(){function e(i){return t.call(e.src,e.listener,i)}const t=q;return e}(),i.proxy=n,n.src=e,n.listener=i,e.addEventListener)C||(r=o),void 0===r&&(r=!1),e.addEventListener(t.toString(),n,r);else if(e.attachEvent)e.attachEvent(X(t.toString()),n);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(n)}return i}function Y(e,t,i,n,r){if(Array.isArray(t)){for(let s=0;s<t.length;s++)Y(e,t[s],i,n,r);return null}return i=J(i),e&&e[R]?e.K(t,i,a(n)?!!n.capture:!!n,r):j(e,t,i,!0,n,r)}function W(e,t,i,n,r){if(Array.isArray(t))for(var s=0;s<t.length;s++)W(e,t[s],i,n,r);else n=a(n)?!!n.capture:!!n,i=J(i),e&&e[R]?(e=e.i,(s=String(t).toString())in e.g&&((i=U(t=e.g[s],i,n,r))>-1&&(M(t[i]),Array.prototype.splice.call(t,i,1),0==t.length&&(delete e.g[s],e.h--)))):e&&(e=K(e))&&(t=e.g[t.toString()],e=-1,t&&(e=U(t,i,n,r)),(i=e>-1?t[e]:null)&&G(i))}function G(e){if("number"!==typeof e&&e&&!e.da){var t=e.src;if(t&&t[R])B(t.i,e);else{var i=e.type,n=e.proxy;t.removeEventListener?t.removeEventListener(i,n,e.capture):t.detachEvent?t.detachEvent(X(i),n):t.addListener&&t.removeListener&&t.removeListener(n),(i=K(t))?(B(i,e),0==i.h&&(i.src=null,t[z]=null)):M(e)}}}function X(e){return e in V?V[e]:V[e]="on"+e}function q(e,t){if(e.da)e=!0;else{t=new k(t,this);const i=e.listener,n=e.ha||e.src;e.fa&&G(e),e=i.call(n,t)}return e}function K(e){return(e=e[z])instanceof F?e:null}var Q="__closure_events_fn_"+(1e9*Math.random()>>>0);function J(e){return"function"===typeof e?e:(e[Q]||(e[Q]=function(t){return e.handleEvent(t)}),e[Q])}function Z(){S.call(this),this.i=new F(this),this.M=this,this.G=null}function $(e,t){var i,n=e.G;if(n)for(i=[];n;n=n.G)i.push(n);if(e=e.M,n=t.type||t,"string"===typeof t)t=new E(t,e);else if(t instanceof E)t.target=t.target||e;else{var r=t;D(t=new E(n,e),r)}let s,a;if(r=!0,i)for(a=i.length-1;a>=0;a--)s=t.g=i[a],r=ee(s,n,!0,t)&&r;if(s=t.g=e,r=ee(s,n,!0,t)&&r,r=ee(s,n,!1,t)&&r,i)for(a=0;a<i.length;a++)s=t.g=i[a],r=ee(s,n,!1,t)&&r}function ee(e,t,i,n){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();let r=!0;for(let s=0;s<t.length;++s){const a=t[s];if(a&&!a.da&&a.capture==i){const t=a.listener,i=a.ha||a.src;a.fa&&B(e.i,a),r=!1!==t.call(i,n)&&r}}return r&&!n.defaultPrevented}function te(e){e.g=function(e,t){if("function"!==typeof e){if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=l(e.handleEvent,e)}return Number(t)>2147483647?-1:s.setTimeout(e,t||0)}(()=>{e.g=null,e.i&&(e.i=!1,te(e))},e.l);const t=e.h;e.h=null,e.m.apply(null,t)}c(Z,S),Z.prototype[R]=!0,Z.prototype.removeEventListener=function(e,t,i,n){W(this,e,t,i,n)},Z.prototype.N=function(){if(Z.Z.N.call(this),this.i){var e=this.i;for(const t in e.g){const i=e.g[t];for(let e=0;e<i.length;e++)M(i[e]);delete e.g[t],e.h--}}this.G=null},Z.prototype.J=function(e,t,i,n){return this.i.add(String(e),t,!1,i,n)},Z.prototype.K=function(e,t,i,n){return this.i.add(String(e),t,!0,i,n)};class ie extends S{constructor(e,t){super(),this.m=e,this.l=t,this.h=null,this.i=!1,this.g=null}j(e){this.h=arguments,this.g?this.i=!0:te(this)}N(){super.N(),this.g&&(s.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function ne(e){S.call(this),this.h=e,this.g={}}c(ne,S);var re=[];function se(e){N(e.g,function(e,t){this.g.hasOwnProperty(t)&&G(e)},e),e.g={}}ne.prototype.N=function(){ne.Z.N.call(this),se(this)},ne.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var ae=s.JSON.stringify,oe=s.JSON.parse,le=class{stringify(e){return s.JSON.stringify(e,void 0)}parse(e){return s.JSON.parse(e,void 0)}};function he(){}function ue(){}var ce={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function de(){E.call(this,"d")}function fe(){E.call(this,"c")}c(de,E),c(fe,E);var pe={},me=null;function ge(){return me=me||new Z}function ve(e){E.call(this,pe.Ia,e)}function ye(e){const t=ge();$(t,new ve(t))}function xe(e,t){E.call(this,pe.STAT_EVENT,e),this.stat=t}function be(e){const t=ge();$(t,new xe(t,e))}function we(e,t){E.call(this,pe.Ja,e),this.size=t}function Te(e,t){if("function"!==typeof e)throw Error("Fn must not be null and must be a function");return s.setTimeout(function(){e()},t)}function _e(){this.g=!0}function Se(e,t,i,n){e.info(function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{const s=JSON.parse(t);if(s)for(e=0;e<s.length;e++)if(Array.isArray(s[e])){var i=s[e];if(!(i.length<2)){var n=i[1];if(Array.isArray(n)&&!(n.length<1)){var r=n[0];if("noop"!=r&&"stop"!=r&&"close"!=r)for(let e=1;e<n.length;e++)n[e]=""}}}return ae(s)}catch(s){return t}}(e,i)+(n?" "+n:"")})}pe.Ia="serverreachability",c(ve,E),pe.STAT_EVENT="statevent",c(xe,E),pe.Ja="timingevent",c(we,E),_e.prototype.ua=function(){this.g=!1},_e.prototype.info=function(){};var Ee,Ce={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},Ae={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"};function ke(){}function Re(e){return encodeURIComponent(String(e))}function Oe(e){var t=1;e=e.split(":");const i=[];for(;t>0&&e.length;)i.push(e.shift()),t--;return e.length&&i.push(e.join(":")),i}function Pe(e,t,i,n){this.j=e,this.i=t,this.l=i,this.S=n||1,this.V=new ne(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new Me}function Me(){this.i=null,this.g="",this.h=!1}c(ke,he),ke.prototype.g=function(){return new XMLHttpRequest},Ee=new ke;var Ne={},Ie={};function Le(e,t,i){e.M=1,e.A=at(tt(t)),e.u=i,e.R=!0,De(e,null)}function De(e,t){e.F=Date.now(),Ue(e),e.B=tt(e.A);var i=e.B,n=e.S;Array.isArray(n)||(n=[String(n)]),bt(i.i,"t",n),e.C=0,i=e.j.L,e.h=new Me,e.g=ai(e.j,i?t:null,!e.u),e.P>0&&(e.O=new ie(l(e.Y,e,e.g),e.P)),t=e.V,i=e.g,n=e.ba;var r="readystatechange";Array.isArray(r)||(r&&(re[0]=r.toString()),r=re);for(let s=0;s<r.length;s++){const e=H(i,r[s],n||t.handleEvent,!1,t.h||t);if(!e)break;t.g[e.key]=e}t=e.J?I(e.J):{},e.u?(e.v||(e.v="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ea(e.B,e.v,e.u,t)):(e.v="GET",e.g.ea(e.B,e.v,null,t)),ye(),function(e,t,i,n,r,s){e.info(function(){if(e.g)if(s){var a="",o=s.split("&");for(let e=0;e<o.length;e++){var l=o[e].split("=");if(l.length>1){const e=l[0];l=l[1];const t=e.split("_");a=t.length>=2&&"type"==t[1]?a+(e+"=")+l+"&":a+(e+"=redacted&")}}}else a=null;else a=s;return"XMLHTTP REQ ("+n+") [attempt "+r+"]: "+t+"\n"+i+"\n"+a})}(e.i,e.v,e.B,e.l,e.S,e.u)}function Fe(e){return!!e.g&&("GET"==e.v&&2!=e.M&&e.j.Aa)}function Be(e,t){var i=e.C,n=t.indexOf("\n",i);return-1==n?Ie:(i=Number(t.substring(i,n)),isNaN(i)?Ne:(n+=1)+i>t.length?Ie:(t=t.slice(n,n+i),e.C=n+i,t))}function Ue(e){e.T=Date.now()+e.H,ze(e,e.H)}function ze(e,t){if(null!=e.D)throw Error("WatchDog timer not null");e.D=Te(l(e.aa,e),t)}function Ve(e){e.D&&(s.clearTimeout(e.D),e.D=null)}function He(e){0==e.j.I||e.K||ti(e.j,e)}function je(e){Ve(e);var t=e.O;t&&"function"==typeof t.dispose&&t.dispose(),e.O=null,se(e.V),e.g&&(t=e.g,e.g=null,t.abort(),t.dispose())}function Ye(e,t){try{var i=e.j;if(0!=i.I&&(i.g==e||Ke(i.h,e)))if(!e.L&&Ke(i.h,e)&&3==i.I){try{var n=i.Ba.g.parse(t)}catch(u){n=null}if(Array.isArray(n)&&3==n.length){var r=n;if(0==r[0]){e:if(!i.v){if(i.g){if(!(i.g.F+3e3<e.F))break e;ei(i),Yt(i)}Jt(i),be(18)}}else i.xa=r[1],0<i.xa-i.K&&r[2]<37500&&i.F&&0==i.A&&!i.C&&(i.C=Te(l(i.Va,i),6e3));qe(i.h)<=1&&i.ta&&(i.ta=void 0)}else ni(i,11)}else if((e.L||i.g==e)&&ei(i),!A(t))for(r=i.Ba.g.parse(t),t=0;t<r.length;t++){let l=r[t];const u=l[0];if(!(u<=i.K))if(i.K=u,l=l[1],2==i.I)if("c"==l[0]){i.M=l[1],i.ba=l[2];const t=l[3];null!=t&&(i.ka=t,i.j.info("VER="+i.ka));const r=l[4];null!=r&&(i.za=r,i.j.info("SVER="+i.za));const u=l[5];null!=u&&"number"===typeof u&&u>0&&(n=1.5*u,i.O=n,i.j.info("backChannelRequestTimeoutMs_="+n)),n=i;const c=e.g;if(c){const e=c.g?c.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(e){var s=n.h;s.g||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(s.j=s.l,s.g=new Set,s.h&&(Qe(s,s.h),s.h=null))}if(n.G){const e=c.g?c.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(n.wa=e,st(n.J,n.G,e))}}i.I=3,i.l&&i.l.ra(),i.aa&&(i.T=Date.now()-e.F,i.j.info("Handshake RTT: "+i.T+"ms"));var a=e;if((n=i).na=si(n,n.L?n.ba:null,n.W),a.L){Je(n.h,a);var o=a,h=n.O;h&&(o.H=h),o.D&&(Ve(o),Ue(o)),n.g=a}else Qt(n);i.i.length>0&&Gt(i)}else"stop"!=l[0]&&"close"!=l[0]||ni(i,7);else 3==i.I&&("stop"==l[0]||"close"==l[0]?"stop"==l[0]?ni(i,7):jt(i):"noop"!=l[0]&&i.l&&i.l.qa(l),i.A=0)}ye()}catch(u){}}Pe.prototype.ba=function(e){e=e.target;const t=this.O;t&&3==Ut(e)?t.j():this.Y(e)},Pe.prototype.Y=function(e){try{if(e==this.g)e:{const l=Ut(this.g),h=this.g.ya();this.g.ca();if(!(l<3)&&(3!=l||this.g&&(this.h.h||this.g.la()||zt(this.g)))){this.K||4!=l||7==h||ye(),Ve(this);var t=this.g.ca();this.X=t;var i=function(e){if(!Fe(e))return e.g.la();const t=zt(e.g);if(""===t)return"";let i="";const n=t.length,r=4==Ut(e.g);if(!e.h.i){if("undefined"===typeof TextDecoder)return je(e),He(e),"";e.h.i=new s.TextDecoder}for(let s=0;s<n;s++)e.h.h=!0,i+=e.h.i.decode(t[s],{stream:!(r&&s==n-1)});return t.length=0,e.h.g+=i,e.C=0,e.h.g}(this);if(this.o=200==t,function(e,t,i,n,r,s,a){e.info(function(){return"XMLHTTP RESP ("+n+") [ attempt "+r+"]: "+t+"\n"+i+"\n"+s+" "+a})}(this.i,this.v,this.B,this.l,this.S,l,t),this.o){if(this.U&&!this.L){t:{if(this.g){var n,r=this.g;if((n=r.g?r.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!A(n)){var a=n;break t}}a=null}if(!(e=a)){this.o=!1,this.m=3,be(12),je(this),He(this);break e}Se(this.i,this.l,e,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,Ye(this,e)}if(this.R){let t;for(e=!0;!this.K&&this.C<i.length;){if(t=Be(this,i),t==Ie){4==l&&(this.m=4,be(14),e=!1),Se(this.i,this.l,null,"[Incomplete Response]");break}if(t==Ne){this.m=4,be(15),Se(this.i,this.l,i,"[Invalid Chunk]"),e=!1;break}Se(this.i,this.l,t,null),Ye(this,t)}if(Fe(this)&&0!=this.C&&(this.h.g=this.h.g.slice(this.C),this.C=0),4!=l||0!=i.length||this.h.h||(this.m=1,be(16),e=!1),this.o=this.o&&e,e){if(i.length>0&&!this.W){this.W=!0;var o=this.j;o.g==this&&o.aa&&!o.P&&(o.j.info("Great, no buffering proxy detected. Bytes received: "+i.length),Zt(o),o.P=!0,be(11))}}else Se(this.i,this.l,i,"[Invalid Chunked Response]"),je(this),He(this)}else Se(this.i,this.l,i,null),Ye(this,i);4==l&&je(this),this.o&&!this.K&&(4==l?ti(this.j,this):(this.o=!1,Ue(this)))}else(function(e){const t={};e=(e.g&&Ut(e)>=2&&e.g.getAllResponseHeaders()||"").split("\r\n");for(let n=0;n<e.length;n++){if(A(e[n]))continue;var i=Oe(e[n]);const r=i[0];if("string"!==typeof(i=i[1]))continue;i=i.trim();const s=t[r]||[];t[r]=s,s.push(i)}!function(e,t){for(const i in e)t.call(void 0,e[i],i,e)}(t,function(e){return e.join(", ")})})(this.g),400==t&&i.indexOf("Unknown SID")>0?(this.m=3,be(12)):(this.m=0,be(13)),je(this),He(this)}}}catch(l){}},Pe.prototype.cancel=function(){this.K=!0,je(this)},Pe.prototype.aa=function(){this.D=null;const e=Date.now();e-this.T>=0?(function(e,t){e.info(function(){return"TIMEOUT: "+t})}(this.i,this.B),2!=this.M&&(ye(),be(17)),je(this),this.m=2,He(this)):ze(this,this.T-e)};var We=class{constructor(e,t){this.g=e,this.map=t}};function Ge(e){this.l=e||10,s.PerformanceNavigationTiming?e=(e=s.performance.getEntriesByType("navigation")).length>0&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(s.chrome&&s.chrome.loadTimes&&s.chrome.loadTimes()&&s.chrome.loadTimes().wasFetchedViaSpdy),this.j=e?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function Xe(e){return!!e.h||!!e.g&&e.g.size>=e.j}function qe(e){return e.h?1:e.g?e.g.size:0}function Ke(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function Qe(e,t){e.g?e.g.add(t):e.h=t}function Je(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function Ze(e){if(null!=e.h)return e.i.concat(e.h.G);if(null!=e.g&&0!==e.g.size){let t=e.i;for(const i of e.g.values())t=t.concat(i.G);return t}return f(e.i)}Ge.prototype.cancel=function(){if(this.i=Ze(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const e of this.g.values())e.cancel();this.g.clear()}};var $e=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function et(e){let t;this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1,e instanceof et?(this.l=e.l,it(this,e.j),this.o=e.o,this.g=e.g,nt(this,e.u),this.h=e.h,rt(this,wt(e.i)),this.m=e.m):e&&(t=String(e).match($e))?(this.l=!1,it(this,t[1]||"",!0),this.o=ot(t[2]||""),this.g=ot(t[3]||"",!0),nt(this,t[4]),this.h=ot(t[5]||"",!0),rt(this,t[6]||"",!0),this.m=ot(t[7]||"")):(this.l=!1,this.i=new mt(null,this.l))}function tt(e){return new et(e)}function it(e,t,i){e.j=i?ot(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function nt(e,t){if(t){if(t=Number(t),isNaN(t)||t<0)throw Error("Bad port number "+t);e.u=t}else e.u=null}function rt(e,t,i){t instanceof mt?(e.i=t,function(e,t){t&&!e.j&&(gt(e),e.i=null,e.g.forEach(function(e,t){const i=t.toLowerCase();t!=i&&(vt(this,t),bt(this,i,e))},e)),e.j=t}(e.i,e.l)):(i||(t=lt(t,ft)),e.i=new mt(t,e.l))}function st(e,t,i){e.i.set(t,i)}function at(e){return st(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function ot(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function lt(e,t,i){return"string"===typeof e?(e=encodeURI(e).replace(t,ht),i&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function ht(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}et.prototype.toString=function(){const e=[];var t=this.j;t&&e.push(lt(t,ut,!0),":");var i=this.g;return(i||"file"==t)&&(e.push("//"),(t=this.o)&&e.push(lt(t,ut,!0),"@"),e.push(Re(i).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(i=this.u)&&e.push(":",String(i))),(i=this.h)&&(this.g&&"/"!=i.charAt(0)&&e.push("/"),e.push(lt(i,"/"==i.charAt(0)?dt:ct,!0))),(i=this.i.toString())&&e.push("?",i),(i=this.m)&&e.push("#",lt(i,pt)),e.join("")},et.prototype.resolve=function(e){const t=tt(this);let i=!!e.j;i?it(t,e.j):i=!!e.o,i?t.o=e.o:i=!!e.g,i?t.g=e.g:i=null!=e.u;var n=e.h;if(i)nt(t,e.u);else if(i=!!e.h){if("/"!=n.charAt(0))if(this.g&&!this.h)n="/"+n;else{var r=t.h.lastIndexOf("/");-1!=r&&(n=t.h.slice(0,r+1)+n)}if(".."==(r=n)||"."==r)n="";else if(-1!=r.indexOf("./")||-1!=r.indexOf("/.")){n=0==r.lastIndexOf("/",0),r=r.split("/");const e=[];for(let t=0;t<r.length;){const i=r[t++];"."==i?n&&t==r.length&&e.push(""):".."==i?((e.length>1||1==e.length&&""!=e[0])&&e.pop(),n&&t==r.length&&e.push("")):(e.push(i),n=!0)}n=e.join("/")}else n=r}return i?t.h=n:i=""!==e.i.toString(),i?rt(t,wt(e.i)):i=!!e.m,i&&(t.m=e.m),t};var ut=/[#\/\?@]/g,ct=/[#\?:]/g,dt=/[#\?]/g,ft=/[#\?@]/g,pt=/#/g;function mt(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function gt(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(let i=0;i<e.length;i++){const n=e[i].indexOf("=");let r,s=null;n>=0?(r=e[i].substring(0,n),s=e[i].substring(n+1)):r=e[i],t(r,s?decodeURIComponent(s.replace(/\+/g," ")):"")}}}(e.i,function(t,i){e.add(decodeURIComponent(t.replace(/\+/g," ")),i)}))}function vt(e,t){gt(e),t=Tt(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function yt(e,t){return gt(e),t=Tt(e,t),e.g.has(t)}function xt(e,t){gt(e);let i=[];if("string"===typeof t)yt(e,t)&&(i=i.concat(e.g.get(Tt(e,t))));else for(e=Array.from(e.g.values()),t=0;t<e.length;t++)i=i.concat(e[t]);return i}function bt(e,t,i){vt(e,t),i.length>0&&(e.i=null,e.g.set(Tt(e,t),f(i)),e.h+=i.length)}function wt(e){const t=new mt;return t.i=e.i,e.g&&(t.g=new Map(e.g),t.h=e.h),t}function Tt(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}function _t(e,t,i,n,r){try{r&&(r.onload=null,r.onerror=null,r.onabort=null,r.ontimeout=null),n(i)}catch(s){}}function St(){this.g=new le}function Et(e){this.i=e.Sb||null,this.h=e.ab||!1}function Ct(e,t){Z.call(this),this.H=e,this.o=t,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}function At(e){e.j.read().then(e.Ma.bind(e)).catch(e.ga.bind(e))}function kt(e){e.readyState=4,e.l=null,e.j=null,e.B=null,Rt(e)}function Rt(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function Ot(e){let t="";return N(e,function(e,i){t+=i,t+=":",t+=e,t+="\r\n"}),t}function Pt(e,t,i){e:{for(n in i){var n=!1;break e}n=!0}n||(i=Ot(i),"string"===typeof e?null!=i&&Re(i):st(e,t,i))}function Mt(e){Z.call(this),this.headers=new Map,this.L=e||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}(e=mt.prototype).add=function(e,t){gt(this),this.i=null,e=Tt(this,e);let i=this.g.get(e);return i||this.g.set(e,i=[]),i.push(t),this.h+=1,this},e.forEach=function(e,t){gt(this),this.g.forEach(function(i,n){i.forEach(function(i){e.call(t,i,n,this)},this)},this)},e.set=function(e,t){return gt(this),this.i=null,yt(this,e=Tt(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},e.get=function(e,t){return e&&(e=xt(this,e)).length>0?String(e[0]):t},e.toString=function(){if(this.i)return this.i;if(!this.g)return"";const e=[],t=Array.from(this.g.keys());for(let n=0;n<t.length;n++){var i=t[n];const r=Re(i);i=xt(this,i);for(let t=0;t<i.length;t++){let n=r;""!==i[t]&&(n+="="+Re(i[t])),e.push(n)}}return this.i=e.join("&")},c(Et,he),Et.prototype.g=function(){return new Ct(this.i,this.h)},c(Ct,Z),(e=Ct.prototype).open=function(e,t){if(0!=this.readyState)throw this.abort(),Error("Error reopening a connection");this.F=e,this.D=t,this.readyState=1,Rt(this)},e.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const t={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};e&&(t.body=e),(this.H||s).fetch(new Request(this.D,t)).then(this.Pa.bind(this),this.ga.bind(this))},e.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&4!=this.readyState&&(this.g=!1,kt(this)),this.readyState=0},e.Pa=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,Rt(this)),this.g&&(this.readyState=3,Rt(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if("undefined"!==typeof s.ReadableStream&&"body"in e){if(this.j=e.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;At(this)}else e.text().then(this.Oa.bind(this),this.ga.bind(this))},e.Ma=function(e){if(this.g){if(this.o&&e.value)this.response.push(e.value);else if(!this.o){var t=e.value?e.value:new Uint8Array(0);(t=this.B.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?kt(this):Rt(this),3==this.readyState&&At(this)}},e.Oa=function(e){this.g&&(this.response=this.responseText=e,kt(this))},e.Na=function(e){this.g&&(this.response=e,kt(this))},e.ga=function(){this.g&&kt(this)},e.setRequestHeader=function(e,t){this.A.append(e,t)},e.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},e.getAllResponseHeaders=function(){if(!this.h)return"";const e=[],t=this.h.entries();for(var i=t.next();!i.done;)i=i.value,e.push(i[0]+": "+i[1]),i=t.next();return e.join("\r\n")},Object.defineProperty(Ct.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}}),c(Mt,Z);var Nt=/^https?$/i,It=["POST","PUT"];function Lt(e,t){e.h=!1,e.g&&(e.j=!0,e.g.abort(),e.j=!1),e.l=t,e.o=5,Dt(e),Bt(e)}function Dt(e){e.A||(e.A=!0,$(e,"complete"),$(e,"error"))}function Ft(e){if(e.h&&"undefined"!=typeof r)if(e.v&&4==Ut(e))setTimeout(e.Ca.bind(e),0);else if($(e,"readystatechange"),4==Ut(e)){e.h=!1;try{const r=e.ca();e:switch(r){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t=!0;break e;default:t=!1}var i;if(!(i=t)){var n;if(n=0===r){let t=String(e.D).match($e)[1]||null;!t&&s.self&&s.self.location&&(t=s.self.location.protocol.slice(0,-1)),n=!Nt.test(t?t.toLowerCase():"")}i=n}if(i)$(e,"complete"),$(e,"success");else{e.o=6;try{var a=Ut(e)>2?e.g.statusText:""}catch(o){a=""}e.l=a+" ["+e.ca()+"]",Dt(e)}}finally{Bt(e)}}}function Bt(e,t){if(e.g){e.m&&(clearTimeout(e.m),e.m=null);const n=e.g;e.g=null,t||$(e,"ready");try{n.onreadystatechange=null}catch(i){}}}function Ut(e){return e.g?e.g.readyState:0}function zt(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.F){case"":case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(t){return null}}function Vt(e,t,i){return i&&i.internalChannelParams&&i.internalChannelParams[e]||t}function Ht(e){this.za=0,this.i=[],this.j=new _e,this.ba=this.na=this.J=this.W=this.g=this.wa=this.G=this.H=this.u=this.U=this.o=null,this.Ya=this.V=0,this.Sa=Vt("failFast",!1,e),this.F=this.C=this.v=this.m=this.l=null,this.X=!0,this.xa=this.K=-1,this.Y=this.A=this.D=0,this.Qa=Vt("baseRetryDelayMs",5e3,e),this.Za=Vt("retryDelaySeedMs",1e4,e),this.Ta=Vt("forwardChannelMaxRetries",2,e),this.va=Vt("forwardChannelRequestTimeoutMs",2e4,e),this.ma=e&&e.xmlHttpFactory||void 0,this.Ua=e&&e.Rb||void 0,this.Aa=e&&e.useFetchStreams||!1,this.O=void 0,this.L=e&&e.supportsCrossDomainXhr||!1,this.M="",this.h=new Ge(e&&e.concurrentRequestLimit),this.Ba=new St,this.S=e&&e.fastHandshake||!1,this.R=e&&e.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=e&&e.Pb||!1,e&&e.ua&&this.j.ua(),e&&e.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&e&&e.detectBufferingProxy||!1,this.ia=void 0,e&&e.longPollingTimeout&&e.longPollingTimeout>0&&(this.ia=e.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}function jt(e){if(Wt(e),3==e.I){var t=e.V++,i=tt(e.J);if(st(i,"SID",e.M),st(i,"RID",t),st(i,"TYPE","terminate"),qt(e,i),(t=new Pe(e,e.j,t)).M=2,t.A=at(tt(i)),i=!1,s.navigator&&s.navigator.sendBeacon)try{i=s.navigator.sendBeacon(t.A.toString(),"")}catch(n){}!i&&s.Image&&((new Image).src=t.A,i=!0),i||(t.g=ai(t.j,null),t.g.ea(t.A)),t.F=Date.now(),Ue(t)}ri(e)}function Yt(e){e.g&&(Zt(e),e.g.cancel(),e.g=null)}function Wt(e){Yt(e),e.v&&(s.clearTimeout(e.v),e.v=null),ei(e),e.h.cancel(),e.m&&("number"===typeof e.m&&s.clearTimeout(e.m),e.m=null)}function Gt(e){if(!Xe(e.h)&&!e.m){e.m=!0;var t=e.Ea;x||T(),b||(x(),b=!0),w.add(t,e),e.D=0}}function Xt(e,t){var i;i=t?t.l:e.V++;const n=tt(e.J);st(n,"SID",e.M),st(n,"RID",i),st(n,"AID",e.K),qt(e,n),e.u&&e.o&&Pt(n,e.u,e.o),i=new Pe(e,e.j,i,e.D+1),null===e.u&&(i.J=e.o),t&&(e.i=t.G.concat(e.i)),t=Kt(e,i,1e3),i.H=Math.round(.5*e.va)+Math.round(.5*e.va*Math.random()),Qe(e.h,i),Le(i,n,t)}function qt(e,t){e.H&&N(e.H,function(e,i){st(t,i,e)}),e.l&&N({},function(e,i){st(t,i,e)})}function Kt(e,t,i){i=Math.min(e.i.length,i);const n=e.l?l(e.l.Ka,e.l,e):null;e:{var r=e.i;let t=-1;for(;;){const e=["count="+i];-1==t?i>0?(t=r[0].g,e.push("ofs="+t)):t=0:e.push("ofs="+t);let l=!0;for(let c=0;c<i;c++){var s=r[c].g;const i=r[c].map;if((s-=t)<0)t=Math.max(0,r[c].g-100),l=!1;else try{s="req"+s+"_"||0;try{var o=i instanceof Map?i:Object.entries(i);for(const t of o){var h=u(t,2);const i=h[0],n=h[1];let r=n;a(n)&&(r=ae(n)),e.push(s+i+"="+encodeURIComponent(r))}}catch(_c){throw e.push(s+"type="+encodeURIComponent("_badmap")),_c}}catch(_c){n&&n(i)}}if(l){o=e.join("&");break e}}o=void 0}return e=e.i.splice(0,i),t.G=e,o}function Qt(e){if(!e.g&&!e.v){e.Y=1;var t=e.Da;x||T(),b||(x(),b=!0),w.add(t,e),e.A=0}}function Jt(e){return!(e.g||e.v||e.A>=3)&&(e.Y++,e.v=Te(l(e.Da,e),ii(e,e.A)),e.A++,!0)}function Zt(e){null!=e.B&&(s.clearTimeout(e.B),e.B=null)}function $t(e){e.g=new Pe(e,e.j,"rpc",e.Y),null===e.u&&(e.g.J=e.o),e.g.P=0;var t=tt(e.na);st(t,"RID","rpc"),st(t,"SID",e.M),st(t,"AID",e.K),st(t,"CI",e.F?"0":"1"),!e.F&&e.ia&&st(t,"TO",e.ia),st(t,"TYPE","xmlhttp"),qt(e,t),e.u&&e.o&&Pt(t,e.u,e.o),e.O&&(e.g.H=e.O);var i=e.g;e=e.ba,i.M=1,i.A=at(tt(t)),i.u=null,i.R=!0,De(i,e)}function ei(e){null!=e.C&&(s.clearTimeout(e.C),e.C=null)}function ti(e,t){var i=null;if(e.g==t){ei(e),Zt(e),e.g=null;var n=2}else{if(!Ke(e.h,t))return;i=t.G,Je(e.h,t),n=1}if(0!=e.I)if(t.o)if(1==n){i=t.u?t.u.length:0,t=Date.now()-t.F;var r=e.D;$(n=ge(),new we(n,i)),Gt(e)}else Qt(e);else if(3==(r=t.m)||0==r&&t.X>0||!(1==n&&function(e,t){return!(qe(e.h)>=e.h.j-(e.m?1:0))&&(e.m?(e.i=t.G.concat(e.i),!0):!(1==e.I||2==e.I||e.D>=(e.Sa?0:e.Ta))&&(e.m=Te(l(e.Ea,e,t),ii(e,e.D)),e.D++,!0))}(e,t)||2==n&&Jt(e)))switch(i&&i.length>0&&(t=e.h,t.i=t.i.concat(i)),r){case 1:ni(e,5);break;case 4:ni(e,10);break;case 3:ni(e,6);break;default:ni(e,2)}}function ii(e,t){let i=e.Qa+Math.floor(Math.random()*e.Za);return e.isActive()||(i*=2),i*t}function ni(e,t){if(e.j.info("Error code "+t),2==t){var i=l(e.bb,e),n=e.Ua;const t=!n;n=new et(n||"//www.google.com/images/cleardot.gif"),s.location&&"http"==s.location.protocol||it(n,"https"),at(n),t?function(e,t){const i=new _e;if(s.Image){const n=new Image;n.onload=h(_t,i,"TestLoadImage: loaded",!0,t,n),n.onerror=h(_t,i,"TestLoadImage: error",!1,t,n),n.onabort=h(_t,i,"TestLoadImage: abort",!1,t,n),n.ontimeout=h(_t,i,"TestLoadImage: timeout",!1,t,n),s.setTimeout(function(){n.ontimeout&&n.ontimeout()},1e4),n.src=e}else t(!1)}(n.toString(),i):function(e,t){new _e;const i=new AbortController,n=setTimeout(()=>{i.abort(),_t(0,0,!1,t)},1e4);fetch(e,{signal:i.signal}).then(e=>{clearTimeout(n),e.ok?_t(0,0,!0,t):_t(0,0,!1,t)}).catch(()=>{clearTimeout(n),_t(0,0,!1,t)})}(n.toString(),i)}else be(2);e.I=0,e.l&&e.l.pa(t),ri(e),Wt(e)}function ri(e){if(e.I=0,e.ja=[],e.l){const t=Ze(e.h);0==t.length&&0==e.i.length||(p(e.ja,t),p(e.ja,e.i),e.h.i.length=0,f(e.i),e.i.length=0),e.l.oa()}}function si(e,t,i){var n=i instanceof et?tt(i):new et(i);if(""!=n.g)t&&(n.g=t+"."+n.g),nt(n,n.u);else{var r=s.location;n=r.protocol,t=t?t+"."+r.hostname:r.hostname,r=+r.port;const e=new et(null);n&&it(e,n),t&&(e.g=t),r&&nt(e,r),i&&(e.h=i),n=e}return i=e.G,t=e.wa,i&&t&&st(n,i,t),st(n,"VER",e.ka),qt(e,n),n}function ai(e,t,i){if(t&&!e.L)throw Error("Can't create secondary domain capable XhrIo object.");return(t=e.Aa&&!e.ma?new Mt(new Et({ab:i})):new Mt(e.ma)).Fa(e.L),t}function oi(){}function li(){}function hi(e,t){Z.call(this),this.g=new Ht(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.o=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.sa&&(e?e["X-WebChannel-Client-Profile"]=t.sa:e={"X-WebChannel-Client-Profile":t.sa}),this.g.U=e,(e=t&&t.Qb)&&!A(e)&&(this.g.u=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!A(t)&&(this.g.G=t,null!==(e=this.h)&&t in e&&(t in(e=this.h)&&delete e[t])),this.j=new di(this)}function ui(e){de.call(this),e.__headers__&&(this.headers=e.__headers__,this.statusCode=e.__status__,delete e.__headers__,delete e.__status__);var t=e.__sm__;if(t){e:{for(const i in t){e=i;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function ci(){fe.call(this),this.status=1}function di(e){this.g=e}(e=Mt.prototype).Fa=function(e){this.H=e},e.ea=function(e,t,i,n){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+e);t=t?t.toUpperCase():"GET",this.D=e,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():Ee.g(),this.g.onreadystatechange=d(l(this.Ca,this));try{this.B=!0,this.g.open(t,String(e),!0),this.B=!1}catch(o){return void Lt(this,o)}if(e=i||"",i=new Map(this.headers),n)if(Object.getPrototypeOf(n)===Object.prototype)for(var r in n)i.set(r,n[r]);else{if("function"!==typeof n.keys||"function"!==typeof n.get)throw Error("Unknown input type for opt_headers: "+String(n));for(const e of n.keys())i.set(e,n.get(e))}n=Array.from(i.keys()).find(e=>"content-type"==e.toLowerCase()),r=s.FormData&&e instanceof s.FormData,!(Array.prototype.indexOf.call(It,t,void 0)>=0)||n||r||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const s of i){var a=u(s,2);const e=a[0],t=a[1];this.g.setRequestHeader(e,t)}this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(e),this.v=!1}catch(o){Lt(this,o)}},e.abort=function(e){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=e||7,$(this,"complete"),$(this,"abort"),Bt(this))},e.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Bt(this,!0)),Mt.Z.N.call(this)},e.Ca=function(){this.u||(this.B||this.v||this.j?Ft(this):this.Xa())},e.Xa=function(){Ft(this)},e.isActive=function(){return!!this.g},e.ca=function(){try{return Ut(this)>2?this.g.status:-1}catch(e){return-1}},e.la=function(){try{return this.g?this.g.responseText:""}catch(e){return""}},e.La=function(e){if(this.g){var t=this.g.responseText;
2return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),oe(t)}},e.ya=function(){return this.o},e.Ha=function(){return"string"===typeof this.l?this.l:String(this.l)},(e=Ht.prototype).ka=8,e.I=1,e.connect=function(e,t,i,n){be(0),this.W=e,this.H=t||{},i&&void 0!==n&&(this.H.OSID=i,this.H.OAID=n),this.F=this.X,this.J=si(this,null,this.W),Gt(this)},e.Ea=function(e){if(this.m)if(this.m=null,1==this.I){if(!e){this.V=Math.floor(1e5*Math.random()),e=this.V++;const r=new Pe(this,this.j,e);let s=this.o;if(this.U&&(s?(s=I(s),D(s,this.U)):s=this.U),null!==this.u||this.R||(r.J=s,s=null),this.S)e:{for(var t=0,i=0;i<this.i.length;i++){var n=this.i[i];if(void 0===(n="__data__"in n.map&&"string"===typeof(n=n.map.__data__)?n.length:void 0))break;if((t+=n)>4096){t=i;break e}if(4096===t||i===this.i.length-1){t=i+1;break e}}t=1e3}else t=1e3;t=Kt(this,r,t),st(i=tt(this.J),"RID",e),st(i,"CVER",22),this.G&&st(i,"X-HTTP-Session-Id",this.G),qt(this,i),s&&(this.R?t="headers="+Re(Ot(s))+"&"+t:this.u&&Pt(i,this.u,s)),Qe(this.h,r),this.Ra&&st(i,"TYPE","init"),this.S?(st(i,"$req",t),st(i,"SID","null"),r.U=!0,Le(r,i,null)):Le(r,i,t),this.I=2}}else 3==this.I&&(e?Xt(this,e):0==this.i.length||Xe(this.h)||Xt(this))},e.Da=function(){if(this.v=null,$t(this),this.aa&&!(this.P||null==this.g||this.T<=0)){var e=4*this.T;this.j.info("BP detection timer enabled: "+e),this.B=Te(l(this.Wa,this),e)}},e.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,be(10),Yt(this),$t(this))},e.Va=function(){null!=this.C&&(this.C=null,Yt(this),Jt(this),be(19))},e.bb=function(e){e?(this.j.info("Successfully pinged google.com"),be(2)):(this.j.info("Failed to ping google.com"),be(1))},e.isActive=function(){return!!this.l&&this.l.isActive(this)},(e=oi.prototype).ra=function(){},e.qa=function(){},e.pa=function(){},e.oa=function(){},e.isActive=function(){return!0},e.Ka=function(){},li.prototype.g=function(e,t){return new hi(e,t)},c(hi,Z),hi.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},hi.prototype.close=function(){jt(this.g)},hi.prototype.o=function(e){var t=this.g;if("string"===typeof e){var i={};i.__data__=e,e=i}else this.v&&((i={}).__data__=ae(e),e=i);t.i.push(new We(t.Ya++,e)),3==t.I&&Gt(t)},hi.prototype.N=function(){this.g.l=null,delete this.j,jt(this.g),delete this.g,hi.Z.N.call(this)},c(ui,de),c(ci,fe),c(di,oi),di.prototype.ra=function(){$(this.g,"a")},di.prototype.qa=function(e){$(this.g,new ui(e))},di.prototype.pa=function(e){$(this.g,new ci)},di.prototype.oa=function(){$(this.g,"b")},li.prototype.createWebChannel=li.prototype.g,hi.prototype.send=hi.prototype.o,hi.prototype.open=hi.prototype.m,hi.prototype.close=hi.prototype.close,Sh=kh.createWebChannelTransport=function(){return new li},_h=kh.getStatEventTarget=function(){return ge()},Th=kh.Event=pe,wh=kh.Stat={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},Ce.NO_ERROR=0,Ce.TIMEOUT=8,Ce.HTTP_ERROR=6,bh=kh.ErrorCode=Ce,Ae.COMPLETE="complete",xh=kh.EventType=Ae,ue.EventType=ce,ce.OPEN="a",ce.CLOSE="b",ce.ERROR="c",ce.MESSAGE="d",Z.prototype.listen=Z.prototype.J,yh=kh.WebChannel=ue,kh.FetchXmlHttpFactory=Et,Mt.prototype.listenOnce=Mt.prototype.K,Mt.prototype.getLastError=Mt.prototype.Ha,Mt.prototype.getLastErrorCode=Mt.prototype.ya,Mt.prototype.getStatus=Mt.prototype.ca,Mt.prototype.getResponseJson=Mt.prototype.La,Mt.prototype.getResponseText=Mt.prototype.la,Mt.prototype.send=Mt.prototype.ea,Mt.prototype.setWithCredentials=Mt.prototype.Fa,vh=kh.XhrIo=Mt}).apply("undefined"!==typeof Ah?Ah:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{});class Rh{}Eh=Rh,f(Rh,"FOLD_CASE",1),f(Rh,"LITERAL",2),f(Rh,"CLASS_NL",4),f(Rh,"DOT_NL",8),f(Rh,"ONE_LINE",16),f(Rh,"NON_GREEDY",32),f(Rh,"PERL_X",64),f(Rh,"UNICODE_GROUPS",128),f(Rh,"WAS_DOLLAR",256),f(Rh,"MATCH_NL",Eh.CLASS_NL|Eh.DOT_NL),f(Rh,"PERL",Eh.CLASS_NL|Eh.ONE_LINE|Eh.PERL_X|Eh.UNICODE_GROUPS),f(Rh,"POSIX",0),f(Rh,"UNANCHORED",0),f(Rh,"ANCHOR_START",1),f(Rh,"ANCHOR_BOTH",2);class Oh{static toUpperCase(e){const t=String.fromCodePoint(e).toUpperCase();if(t.length>1)return e;const i=String.fromCodePoint(t.codePointAt(0)).toLowerCase();return i.length>1||i.codePointAt(0)!==e?e:t.codePointAt(0)}static toLowerCase(e){const t=String.fromCodePoint(e).toLowerCase();if(t.length>1)return e;const i=String.fromCodePoint(t.codePointAt(0)).toUpperCase();return i.length>1||i.codePointAt(0)!==e?e:t.codePointAt(0)}}f(Oh,"CODES",new Map([["\x07",7],["\b",8],["\t",9],["\n",10],["\v",11],["\f",12],["\r",13],[" ",32],['"',34],["$",36],["&",38],["(",40],[")",41],["*",42],["+",43],["-",45],[".",46],["0",48],["1",49],["2",50],["3",51],["4",52],["5",53],["6",54],["7",55],["8",56],["9",57],[":",58],["<",60],[">",62],["?",63],["A",65],["B",66],["C",67],["F",70],["P",80],["Q",81],["U",85],["Z",90],["[",91],["\\",92],["]",93],["^",94],["_",95],["a",97],["b",98],["f",102],["i",105],["m",109],["n",110],["r",114],["s",115],["t",116],["v",118],["x",120],["z",122],["{",123],["|",124],["}",125]]));class Ph{}Ch=Ph,f(Ph,"CASE_ORBIT",new Map([[75,107],[107,8490],[8490,75],[83,115],[115,383],[383,83],[181,924],[924,956],[956,181],[197,229],[229,8491],[8491,197],[452,453],[453,454],[454,452],[455,456],[456,457],[457,455],[458,459],[459,460],[460,458],[497,498],[498,499],[499,497],[837,921],[921,953],[953,8126],[8126,837],[914,946],[946,976],[976,914],[917,949],[949,1013],[1013,917],[920,952],[952,977],[977,1012],[1012,920],[922,954],[954,1008],[1008,922],[928,960],[960,982],[982,928],[929,961],[961,1009],[1009,929],[931,962],[962,963],[963,931],[934,966],[966,981],[981,934],[937,969],[969,8486],[8486,937],[1042,1074],[1074,7296],[7296,1042],[1044,1076],[1076,7297],[7297,1044],[1054,1086],[1086,7298],[7298,1054],[1057,1089],[1089,7299],[7299,1057],[1058,1090],[1090,7300],[7300,7301],[7301,1058],[1066,1098],[1098,7302],[7302,1066],[1122,1123],[1123,7303],[7303,1122],[7304,42570],[42570,42571],[42571,7304],[7776,7777],[7777,7835],[7835,7776],[223,7838],[7838,223],[8064,8072],[8072,8064],[8065,8073],[8073,8065],[8066,8074],[8074,8066],[8067,8075],[8075,8067],[8068,8076],[8076,8068],[8069,8077],[8077,8069],[8070,8078],[8078,8070],[8071,8079],[8079,8071],[8080,8088],[8088,8080],[8081,8089],[8089,8081],[8082,8090],[8090,8082],[8083,8091],[8091,8083],[8084,8092],[8092,8084],[8085,8093],[8093,8085],[8086,8094],[8094,8086],[8087,8095],[8095,8087],[8096,8104],[8104,8096],[8097,8105],[8105,8097],[8098,8106],[8106,8098],[8099,8107],[8107,8099],[8100,8108],[8108,8100],[8101,8109],[8109,8101],[8102,8110],[8110,8102],[8103,8111],[8111,8103],[8115,8124],[8124,8115],[8131,8140],[8140,8131],[912,8
2147],[8147,912],[944,8163],[8163,944],[8179,8188],[8188,8179],[64261,64262],[64262,64261],[66560,66600],[66600,66560],[66561,66601],[66601,66561],[66562,66602],[66602,66562],[66563,66603],[66603,66563],[66564,66604],[66604,66564],[66565,66605],[66605,66565],[66566,66606],[66606,66566],[66567,66607],[66607,66567],[66568,66608],[66608,66568],[66569,66609],[66609,66569],[66570,66610],[66610,66570],[66571,66611],[66611,66571],[66572,66612],[66612,66572],[66573,66613],[66613,66573],[66574,66614],[66614,66574],[66575,66615],[66615,66575],[66576,66616],[66616,66576],[66577,66617],[66617,66577],[66578,66618],[66618,66578],[66579,66619],[66619,66579],[66580,66620],[66620,66580],[66581,66621],[66621,66581],[66582,66622],[66622,66582],[66583,66623],[66623,66583],[66584,66624],[66624,66584],[66585,66625],[66625,66585],[66586,66626],[66626,66586],[66587,66627],[66627,66587],[66588,66628],[66628,66588],[66589,66629],[66629,66589],[66590,66630],[66630,66590],[66591,66631],[66631,66591],[66592,66632],[66632,66592],[66593,66633],[66633,66593],[66594,66634],[66634,66594],[66595,66635],[66635,66595],[66596,66636],[66636,66596],[66597,66637],[66637,66597],[66598,66638],[66638,66598],[66599,66639],[66639,66599],[66736,66776],[66776,66736],[66737,66777],[66777,66737],[66738,66778],[66778,66738],[66739,66779],[66779,66739],[66740,66780],[66780,66740],[66741,66781],[66781,66741],[66742,66782],[66782,66742],[66743,66783],[66783,66743],[66744,66784],[66784,66744],[66745,66785],[66785,66745],[66746,66786],[66786,66746],[66747,66787],[66787,66747],[66748,66788],[66788,66748],[66749,66789],[66789,66749],[66750,66790],[66790,66750],[66751,66791],[66791,66751],[66752,66792],[66792,66752],[66753,66793],[66793,66753],[66754,66794],[66794,66754],[66755,66795],[66795,66755],[66756,66796],[66796,66756],[66757,66797],[66797,66757],[66758,66798],[66798,66758],[66759,66799],[66799,66759],[66760,66800],[66800,66760],[66761,66801],[66801,66761],[66762,66802],[66802,66762],[66763,66803],[66803,66763],[66764,66804],[66804,66764],[66765,66805],[66805,66765],[66766,66806],[66806,66766],[66767,66807],[66807,66767],[66768,66808],[66808,66768],[66769,66809],[66809,66769],[66770,66810],[66810,66770],[66771,66811],[66811,66771],[66928,66967],[66967,66928],[66929,66968],[66968,66929],[66930,66969],[66969,66930],[66931,66970],[66970,66931],[66932,66971],[66971,66932],[66933,66972],[66972,66933],[66934,66973],[66973,66934],[66935,66974],[66974,66935],[66936,66975],[66975,66936],[66937,66976],[66976,66937],[66938,66977],[66977,66938],[66940,66979],[66979,66940],[66941,66980],[66980,66941],[66942,66981],[66981,66942],[66943,66982],[66982,66943],[66944,66983],[66983,66944],[66945,66984],[66984,66945],[66946,66985],[66985,66946],[66947,66986],[66986,66947],[66948,66987],[66987,66948],[66949,66988],[66988,66949],[66950,66989],[66989,66950],[66951,66990],[66990,66951],[66952,66991],[66991,66952],[66953,66992],[66992,66953],[66954,66993],[66993,66954],[66956,66995],[66995,66956],[66957,66996],[66996,66957],[66958,66997],[66997,66958],[66959,66998],[66998,66959],[66960,66999],[66999,66960],[66961,67e3],[67e3,66961],[66962,67001],[67001,66962],[66964,67003],[67003,66964],[66965,67004],[67004,66965],[68736,68800],[68800,68736],[68737,68801],[68801,68737],[68738,68802],[68802,68738],[68739,68803],[68803,68739],[68740,68804],[68804,68740],[68741,68805],[68805,68741],[68742,68806],[68806,68742],[68743,68807],[68807,68743],[68744,68808],[68808,68744],[68745,68809],[68809,68745],[68746,68810],[68810,68746],[68747,68811],[68811,68747],[68748,68812],[68812,68748],[68749,68813],[68813,68749],[68750,68814],[68814,68750],[68751,68815],[68815,68751],[68752,68816],[68816,68752],[68753,68817],[68817,68753],[68754,68818],[68818,68754],[68755,68819],[68819,68755],[68756,68820],[68820,68756],[68757,68821],[68821,68757],[68758,68822],[68822,68758],[68759,68823],[68823,68759],[68760,68824],[68824,68760],[68761,68825],[68825,68761],[68762,68826],[68826,68762],[68763,68827],[68827,68763],[68764,68828],[68828,68764],[68765,68829],[68829,68765],[68766,68830],[68830,68766],[68767,68831],[68831,68767],[68768,68832],[68832,68768],[68769,68833],[68833,68769],[68770,68834],[68834,68770],[68771,68835],[68835,68771],[68772,68836],[68836,68772],[68773,68837],[68837,68773],[68774,68838],[68838,68774],[68775,68839],[68839,68775],[68776,68840],[68840,68776],[68777,68841],[68841,68777],[68778,68842],[68842,68778],[68779,68843],[68843,68779],[68780,68844],[68844,68780],[68781,68845],[68845,68781],[68782,68846],[68846,68782],[68783,68847],[68847,68783],[68784,68848],[68848,68784],[68785,68849],[68849,68785],[68786,68850],[68850,68786],[71840,71872],[71872,71840],[71841,71873],[71873,71841],[71842,71874],[71874,71842],[71843,71875],[71875,71843],[71844,71876],[71876,71844],[71845,71877],[71877,71845],[71846,71878],[71878,71846],[71847,71879],[71879,71847],[71848,71880],[71880,71848],[71849,71881],[71881,71849],[71850,71882],[71882,71850],[71851,71883],[71883,71851],[71852,71884],[71884,71852],[71853,71885],[71885,71853],[71854,71886],[71886,71854],[71855,71887],[71887,71855],[71856,71888],[71888,71856],[71857,71889],[71889,71857],[71858,71890],[71890,71858],[71859,71891],[71891,71859],[71860,71892],[71892,71860],[71861,71893],[71893,71861],[71862,71894],[71894,71862],[71863,71895],[71895,71863],[71864,71896],[71896,71864],[71865,71897],[71897,71865],[71866,71898],[71898,71866],[71867,71899],[71899,71867],[71868,71900],[71900,71868],[71869,71901],[71901,71869],[71870,71902],[71902,71870],[71871,71903],[71903,71871],[93760,93792],[93792,93760],[93761,93793],[93793,93761],[93762,93794],[93794,93762],[93763,93795],[93795,93763],[93764,93796],[93796,93764],[93765,93797],[93797,93765],[93766,93798],[93798,93766],[93767,93799],[93799,93767],[93768,93800],[93800,93768],[93769,93801],[93801,93769],[93770,93802],[93802,93770],[937
271,93803],[93803,93771],[93772,93804],[93804,93772],[93773,93805],[93805,93773],[93774,93806],[93806,93774],[93775,93807],[93807,93775],[93776,93808],[93808,93776],[93777,93809],[93809,93777],[93778,93810],[93810,93778],[93779,93811],[93811,93779],[93780,93812],[93812,93780],[93781,93813],[93813,93781],[93782,93814],[93814,93782],[93783,93815],[93815,93783],[93784,93816],[93816,93784],[93785,93817],[93817,93785],[93786,93818],[93818,93786],[93787,93819],[93819,93787],[93788,93820],[93820,93788],[93789,93821],[93821,93789],[93790,93822],[93822,93790],[93791,93823],[93823,93791],[125184,125218],[125218,125184],[125185,125219],[125219,125185],[125186,125220],[125220,125186],[125187,125221],[125221,125187],[125188,125222],[125222,125188],[125189,125223],[125223,125189],[125190,125224],[125224,125190],[125191,125225],[125225,125191],[125192,125226],[125226,125192],[125193,125227],[125227,125193],[125194,125228],[125228,125194],[125195,125229],[125229,125195],[125196,125230],[125230,125196],[125197,125231],[125231,125197],[125198,125232],[125232,125198],[125199,125233],[125233,125199],[125200,125234],[125234,125200],[125201,125235],[125235,125201],[125202,125236],[125236,125202],[125203,125237],[125237,125203],[125204,125238],[125238,125204],[125205,125239],[125239,125205],[125206,125240],[125240,125206],[125207,125241],[125241,125207],[125208,125242],[125242,125208],[125209,125243],[125243,125209],[125210,125244],[125244,125210],[125211,125245],[125245,125211],[125212,125246],[125246,125212],[125213,125247],[125247,125213],[125214,125248],[125248,125214],[125215,125249],[125249,125215],[125216,125250],[125250,125216],[125217,125251],[125251,125217]])),f(Ph,"C",[[0,31,1],[127,159,1],[173,888,715],[889,896,7],[897,899,1],[907,909,2],[930,1328,398],[1367,1368,1],[1419,1420,1],[1424,1480,56],[1481,1487,1],[1515,1518,1],[1525,1541,1],[1564,1757,193],[1806,1807,1],[1867,1868,1],[1970,1983,1],[2043,2044,1],[2094,2095,1],[2111,2140,29],[2141,2143,2],[2155,2159,1],[2191,2199,1],[2274,2436,162],[2445,2446,1],[2449,2450,1],[2473,2481,8],[2483,2485,1],[2490,2491,1],[2501,2502,1],[2505,2506,1],[2511,2518,1],[2520,2523,1],[2526,2532,6],[2533,2559,26],[2560,2564,4],[2571,2574,1],[2577,2578,1],[2601,2609,8],[2612,2618,3],[2619,2621,2],[2627,2630,1],[2633,2634,1],[2638,2640,1],[2642,2648,1],[2653,2655,2],[2656,2661,1],[2679,2688,1],[2692,2702,10],[2706,2729,23],[2737,2740,3],[2746,2747,1],[2758,2766,4],[2767,2769,2],[2770,2783,1],[2788,2789,1],[2802,2808,1],[2816,2820,4],[2829,2830,1],[2833,2834,1],[2857,2865,8],[2868,2874,6],[2875,2885,10],[2886,2889,3],[2890,2894,4],[2895,2900,1],[2904,2907,1],[2910,2916,6],[2917,2936,19],[2937,2945,1],[2948,2955,7],[2956,2957,1],[2961,2966,5],[2967,2968,1],[2971,2973,2],[2976,2978,1],[2981,2983,1],[2987,2989,1],[3002,3005,1],[3011,3013,1],[3017,3022,5],[3023,3025,2],[3026,3030,1],[3032,3045,1],[3067,3071,1],[3085,3089,4],[3113,3130,17],[3131,3141,10],[3145,3150,5],[3151,3156,1],[3159,3163,4],[3164,3166,2],[3167,3172,5],[3173,3184,11],[3185,3190,1],[3213,3217,4],[3241,3252,11],[3258,3259,1],[3269,3273,4],[3278,3284,1],[3287,3292,1],[3295,3300,5],[3301,3312,11],[3316,3327,1],[3341,3345,4],[3397,3401,4],[3408,3411,1],[3428,3429,1],[3456,3460,4],[3479,3481,1],[3506,3516,10],[3518,3519,1],[3527,3529,1],[3531,3534,1],[3541,3543,2],[3552,3557,1],[3568,3569,1],[3573,3584,1],[3643,3646,1],[3676,3712,1],[3715,3717,2],[3723,3748,25],[3750,3774,24],[3775,3781,6],[3783,3791,8],[3802,3803,1],[3808,3839,1],[3912,3949,37],[3950,3952,1],[3992,4029,37],[4045,4059,14],[4060,4095,1],[4294,4296,2],[4297,4300,1],[4302,4303,1],[4681,4686,5],[4687,4695,8],[4697,4702,5],[4703,4745,42],[4750,4751,1],[4785,4790,5],[4791,4799,8],[4801,4806,5],[4807,4823,16],[4881,4886,5],[4887,4955,68],[4956,4989,33],[4990,4991,1],[5018,5023,1],[5110,5111,1],[5118,5119,1],[5789,5791,1],[5881,5887,1],[5910,5918,1],[5943,5951,1],[5972,5983,1],[5997,6001,4],[6004,6015,1],[6110,6111,1],[6122,6127,1],[6138,6143,1],[6158,6170,12],[6171,6175,1],[6265,6271,1],[6315,6319,1],[6390,6399,1],[6431,6444,13],[6445,6447,1],[6460,6463,1],[6465,6467,1],[6510,6511,1],[6517,6527,1],[6572,6575,1],[6602,6607,1],[6619,6621,1],[6684,6685,1],[6751,6781,30],[6782,6794,12],[6795,6799,1],[6810,6815,1],[6830,6831,1],[6863,6911,1],[6989,6991,1],[7039,7156,117],[7157,7163,1],[7224,7226,1],[7242,7244,1],[7305,7311,1],[7355,7356,1],[7368,7375,1],[7419,7423,1],[7958,7959,1],[7966,7967,1],[8006,8007,1],[8014,8015,1],[8024,8030,2],[8062,8063,1],[8117,8133,16],[8148,8149,1],[8156,8176,20],[8177,8181,4],[8191,8203,12],[8204,8207,1],[8234,8238,1],[8288,8303,1],[8306,8307,1],[8335,8349,14],[8350,8351,1],[8385,8399,1],[8433,8447,1],[8588,8591,1],[9255,9279,1],[9291,9311,1],[11124,11125,1],[11158,11508,350],[11509,11512,1],[11558,11560,2],[11561,11564,1],[11566,11567,1],[11624,11630,1],[11633,11646,1],[11671,11679,1],[11687,11743,8],[11870,11903,1],[11930,12020,90],[12021,12031,1],[12246,12271,1],[12352,12439,87],[12440,12544,104],[12545,12548,1],[12592,12687,95],[12772,12782,1],[12831,42125,29294],[42126,42127,1],[42183,42191,1],[42540,42559,1],[42744,42751,1],[42955,42959,1],[42962,42964,2],[42970,42993,1],[43053,43055,1],[43066,43071,1],[43128,43135,1],[43206,43213,1],[43226,43231,1],[43348,43358,1],[43389,43391,1],[43470,43482,12],[43483,43485,1],[43519,43575,56],[43576,43583,1],[43598,43599,1],[43610,43611,1],[43715,43738,1],[43767,43776,1],[43783,43784,1],[43791,43792,1],[43799,43807,1],[43815,43823,8],[43884,43887,1],[44014,44015,1],[44026,44031,1],[55204,55215,1],[55239,55242,1],[55292,63743,1],[64110,64111,1],[64218,64255,1],[64263,64274,1],[64280,64284,1],[64311,64317,6],[64319,64325,3],[64451,64466,1],[64912,64913,1],[64968,64974,1],[64976,65007,1],[65050,65055,1],[65107,65127,20],[65132,65135,1],[65141,65277,136],[65278,65280,1],[65471,65473,1],[65480,65481,1],[65488,65489,1],[65496,65497,1],[65501,65503,1],[65511,65519,8],[65520,65531,1],[65534,65535,1],[65548,65575,27],[65595,65598,3],[65614,65615,1],[65630,65663,1],[65787,65791,1],[65795,65798,1],[65844,65846,1],[65935,65949,14],[65950,65951,1],[65953,65999,1],[66046,66175,1],[66205,66207,1],[66257,66271,1],[66300,66303,1],[66340,66348,1],[66379,66383,1],[66427,66431,1],[66462,66500,38],[66501,66503,1],[66518,66559,1],[66718,66719,1],[66730,66735,1],[66772,66775,1],[66812,66815,1],[66856,66863,1],[66916,66926,1],[66939,66955,16],[66963,66966,3],[66978,66994,16],[67002,67005,3],[67006,67071,1],[67383,67391,1],[67414,67423,1],[67432,67455,1],[67462,67505,43],[67515,67583,1],[67590,67591,1],[67593,67638,45],[67641,67643,1],[67645,67646,1],[67670,67743,73],[67744,67750,1],[67760,67807,1],[67827,67830,3],[67831,67834,1],[67868,67870,1],[67898,67902,1],[67904,67967,1],[68024,68027,1],[68048,68049,1],[68100,68103,3],[68104,68107,1],[68116,68120,4],[68150,68151,1],[68155,68158,1],[68169,68175,1],[68185,68191,1],[68256,68287,1],[68327,68330,1],[68343,68351,1],[68406,68408,1],[68438,68439,1],[68467,68471,1],[68498,68504,1],[68509,68520,1],[68528,68607,1],[68681,68735,1],[68787,68799,1],[68851,68857,1],[68904,68911,1],[68922,69215,1],[69247,69290,43],[69294,69295,1],[69298,69372,1],[69416,69423,1],[69466,69487,1],[69514,69551,1],[69580,69599,1],[69623,69631,1],[69710,69713,1],[69750,69758,1],[69821,69827,6],[69828,69839,1],[69865,69871,1],[69882,69887,1],[69941,69960,19],[69961,69967,1],[70007,70015,1],[70112,70133,21],[70134,70143,1],[70162,70210,48],[70211,70271,1],[70279,70281,2],[70286,70302,16],[70314,70319,1],[70379,70383,1],[70394,70399,1],[70404,70413,9],[70414,70417,3],[70418,70441,23],[70449,70452,3],[70458,70469,11],[70470,70473,3],[70474,70478,4],[70479,70481,2],[70482,70486,1],[70488,70492,1],[70500,70501,1],[70509,70511,
21],[70517,70655,1],[70748,70754,6],[70755,70783,1],[70856,70863,1],[70874,71039,1],[71094,71095,1],[71134,71167,1],[71237,71247,1],[71258,71263,1],[71277,71295,1],[71354,71359,1],[71370,71423,1],[71451,71452,1],[71468,71471,1],[71495,71679,1],[71740,71839,1],[71923,71934,1],[71943,71944,1],[71946,71947,1],[71956,71959,3],[71990,71993,3],[71994,72007,13],[72008,72015,1],[72026,72095,1],[72104,72105,1],[72152,72153,1],[72165,72191,1],[72264,72271,1],[72355,72367,1],[72441,72447,1],[72458,72703,1],[72713,72759,46],[72774,72783,1],[72813,72815,1],[72848,72849,1],[72872,72887,15],[72888,72959,1],[72967,72970,3],[73015,73017,1],[73019,73022,3],[73032,73039,1],[73050,73055,1],[73062,73065,3],[73103,73106,3],[73113,73119,1],[73130,73439,1],[73465,73471,1],[73489,73531,42],[73532,73533,1],[73562,73647,1],[73649,73663,1],[73714,73726,1],[74650,74751,1],[74863,74869,6],[74870,74879,1],[75076,77711,1],[77811,77823,1],[78896,78911,1],[78934,82943,1],[83527,92159,1],[92729,92735,1],[92767,92778,11],[92779,92781,1],[92863,92874,11],[92875,92879,1],[92910,92911,1],[92918,92927,1],[92998,93007,1],[93018,93026,8],[93048,93052,1],[93072,93759,1],[93851,93951,1],[94027,94030,1],[94088,94094,1],[94112,94175,1],[94181,94191,1],[94194,94207,1],[100344,100351,1],[101590,101631,1],[101641,110575,1],[110580,110588,8],[110591,110883,292],[110884,110897,1],[110899,110927,1],[110931,110932,1],[110934,110947,1],[110952,110959,1],[111356,113663,1],[113771,113775,1],[113789,113791,1],[113801,113807,1],[113818,113819,1],[113824,118527,1],[118574,118575,1],[118599,118607,1],[118724,118783,1],[119030,119039,1],[119079,119080,1],[119155,119162,1],[119275,119295,1],[119366,119487,1],[119508,119519,1],[119540,119551,1],[119639,119647,1],[119673,119807,1],[119893,119965,72],[119968,119969,1],[119971,119972,1],[119975,119976,1],[119981,119994,13],[119996,120004,8],[120070,120075,5],[120076,120085,9],[120093,120122,29],[120127,120133,6],[120135,120137,1],[120145,120486,341],[120487,120780,293],[120781,121484,703],[121485,121498,1],[121504,121520,16],[121521,122623,1],[122655,122660,1],[122667,122879,1],[122887,122905,18],[122906,122914,8],[122917,122923,6],[122924,122927,1],[122990,123022,1],[123024,123135,1],[123181,123183,1],[123198,123199,1],[123210,123213,1],[123216,123535,1],[123567,123583,1],[123642,123646,1],[123648,124111,1],[124154,124895,1],[124903,124908,5],[124911,124927,16],[125125,125126,1],[125143,125183,1],[125260,125263,1],[125274,125277,1],[125280,126064,1],[126133,126208,1],[126270,126463,1],[126468,126496,28],[126499,126501,2],[126502,126504,2],[126515,126520,5],[126522,126524,2],[126525,126529,1],[126531,126534,1],[126536,126540,2],[126544,126547,3],[126549,126550,1],[126552,126560,2],[126563,126565,2],[126566,126571,5],[126579,126589,5],[126591,126602,11],[126620,126624,1],[126628,126634,6],[126652,126703,1],[126706,126975,1],[127020,127023,1],[127124,127135,1],[127151,127152,1],[127168,127184,16],[127222,127231,1],[127406,127461,1],[127491,127503,1],[127548,127551,1],[127561,127567,1],[127570,127583,1],[127590,127743,1],[128728,128731,1],[128749,128751,1],[128765,128767,1],[128887,128890,1],[128986,128991,1],[129004,129007,1],[129009,129023,1],[129036,129039,1],[129096,129103,1],[129114,129119,1],[129160,129167,1],[129198,129199,1],[129202,129279,1],[129620,129631,1],[129646,129647,1],[129661,129663,1],[129673,129679,1],[129726,129734,8],[129735,129741,1],[129756,129759,1],[129769,129775,1],[129785,129791,1],[129939,129995,56],[129996,130031,1],[130042,131071,1],[173792,173823,1],[177978,177983,1],[178206,178207,1],[183970,183983,1],[191457,191471,1],[192094,194559,1],[195102,196607,1],[201547,201551,1],[205744,917759,1],[918e3,1114111,1]]),f(Ph,"Cc",[[0,31,1],[127,159,1]]),f(Ph,"Cf",[[173,1536,1363],[1537,1541,1],[1564,1757,193],[1807,2192,385],[2193,2274,81],[6158,8203,2045],[8204,8207,1],[8234,8238,1],[8288,8292,1],[8294,8303,1],[65279,65529,250],[65530,65531,1],[69821,69837,16],[78896,78911,1],[113824,113827,1],[119155,119162,1],[917505,917536,31],[917537,917631,1]]),f(Ph,"Co",[[57344,63743,1],[983040,1048573,1],[1048576,1114109,1]]),f(Ph,"Cs",[[55296,57343,1]]),f(Ph,"L",[[65,90,1],[97,122,1],[170,181,11],[186,192,6],[193,214,1],[216,246,1],[248,705,1],[710,721,1],[736,740,1],[748,750,2],[880,884,1],[886,887,1],[890,893,1],[895,902,7],[904,906,1],[908,910,2],[911,929,1],[931,1013,1],[1015,1153,1],[1162,1327,1],[1329,1366,1],[1369,1376,7
2],[1377,1416,1],[1488,1514,1],[1519,1522,1],[1568,1610,1],[1646,1647,1],[1649,1747,1],[1749,1765,16],[1766,1774,8],[1775,1786,11],[1787,1788,1],[1791,1808,17],[1810,1839,1],[1869,1957,1],[1969,1994,25],[1995,2026,1],[2036,2037,1],[2042,2048,6],[2049,2069,1],[2074,2084,10],[2088,2112,24],[2113,2136,1],[2144,2154,1],[2160,2183,1],[2185,2190,1],[2208,2249,1],[2308,2361,1],[2365,2384,19],[2392,2401,1],[2417,2432,1],[2437,2444,1],[2447,2448,1],[2451,2472,1],[2474,2480,1],[2482,2486,4],[2487,2489,1],[2493,2510,17],[2524,2525,1],[2527,2529,1],[2544,2545,1],[2556,2565,9],[2566,2570,1],[2575,2576,1],[2579,2600,1],[2602,2608,1],[2610,2611,1],[2613,2614,1],[2616,2617,1],[2649,2652,1],[2654,2674,20],[2675,2676,1],[2693,2701,1],[2703,2705,1],[2707,2728,1],[2730,2736,1],[2738,2739,1],[2741,2745,1],[2749,2768,19],[2784,2785,1],[2809,2821,12],[2822,2828,1],[2831,2832,1],[2835,2856,1],[2858,2864,1],[2866,2867,1],[2869,2873,1],[2877,2908,31],[2909,2911,2],[2912,2913,1],[2929,2947,18],[2949,2954,1],[2958,2960,1],[2962,2965,1],[2969,2970,1],[2972,2974,2],[2975,2979,4],[2980,2984,4],[2985,2986,1],[2990,3001,1],[3024,3077,53],[3078,3084,1],[3086,3088,1],[3090,3112,1],[3114,3129,1],[3133,3160,27],[3161,3162,1],[3165,3168,3],[3169,3200,31],[3205,3212,1],[3214,3216,1],[3218,3240,1],[3242,3251,1],[3253,3257,1],[3261,3293,32],[3294,3296,2],[3297,3313,16],[3314,3332,18],[3333,3340,1],[3342,3344,1],[3346,3386,1],[3389,3406,17],[3412,3414,1],[3423,3425,1],[3450,3455,1],[3461,3478,1],[3482,3505,1],[3507,3515,1],[3517,3520,3],[3521,3526,1],[3585,3632,1],[3634,3635,1],[3648,3654,1],[3713,3714,1],[3716,3718,2],[3719,3722,1],[3724,3747,1],[3749,3751,2],[3752,3760,1],[3762,3763,1],[3773,3776,3],[3777,3780,1],[3782,3804,22],[3805,3807,1],[3840,3904,64],[3905,3911,1],[3913,3948,1],[3976,3980,1],[4096,4138,1],[4159,4176,17],[4177,4181,1],[4186,4189,1],[4193,4197,4],[4198,4206,8],[4207,4208,1],[4213,4225,1],[4238,4256,18],[4257,4293,1],[4295,4301,6],[4304,4346,1],[4348,4680,1],[4682,4685,1],[4688,4694,1],[4696,4698,2],[4699,4701,1],[4704,4744,1],[4746,4749,1],[4752,4784,1],[4786,4789,1],[4792,4798,1],[4800,4802,2],[4803,4805,1],[4808,4822,1],[4824,4880,1],[4882,4885,1],[4888,4954,1],[4992,5007,1],[5024,5109,1],[5112,5117,1],[5121,5740,1],[5743,5759,1],[5761,5786,1],[5792,5866,1],[5873,5880,1],[5888,5905,1],[5919,5937,1],[5952,5969,1],[5984,5996,1],[5998,6e3,1],[6016,6067,1],[6103,6108,5],[6176,6264,1],[6272,6276,1],[6279,6312,1],[6314,6320,6],[6321,6389,1],[6400,6430,1],[6480,6509,1],[6512,6516,1],[6528,6571,1],[6576,6601,1],[6656,6678,1],[6688,6740,1],[6823,6917,94],[6918,6963,1],[6981,6988,1],[7043,7072,1],[7086,7087,1],[7098,7141,1],[7168,7203,1],[7245,7247,1],[7258,7293,1],[7296,7304,1],[7312,7354,1],[7357,7359,1],[7401,7404,1],[7406,7411,1],[7413,7414,1],[7418,7424,6],[7425,7615,1],[7680,7957,1],[7960,7965,1],[7968,8005,1],[8008,8013,1],[8016,8023,1],[8025,8031,2],[8032,8061,1],[8064,8116,1],[8118,8124,1],[8126,8130,4],[8131,8132,1],[8134,8140,1],[8144,8147,1],[8150,8155,1],[8160,8172,1],[8178,8180,1],[8182,8188,1],[8305,8319,14],[8336,8348,1],[8450,8455,5],[8458,8467,1],[8469,8473,4],[8474,8477,1],[8484,8490,2],[8491,8493,1],[8495,8505,1],[8508,8511,1],[8517,8521,1],[8526,8579,53],[8580,11264,2684],[11265,11492,1],[11499,11502,1],[11506,11507,1],[11520,11557,1],[11559,11565,6],[11568,11623,1],[11631,11648,17],[11649,11670,1],[11680,11686,1],[11688,11694,1],[11696,11702,1],[11704,11710,1],[11712,11718,1],[11720,11726,1],[11728,11734,1],[11736,11742,1],[11823,12293,470],[12294,12337,43],[12338,12341,1],[12347,12348,1],[12353,12438,1],[12445,12447,1],[12449,12538,1],[12540,12543,1],[12549,12591,1],[12593,12686,1],[12704,12735,1],[12784,12799,1],[13312,19903,1],[19968,42124,1],[42192,42237,1],[42240,42508,1],[42512,42527,1],[42538,42539,1],[42560,42606,1],[42623,42653,1],[42656,42725,1],[42775,42783,1],[42786,42888,1],[42891,42954,1],[42960,42961,1],[42963,42965,2],[42966,42969,1],[42994,43009,1],[43011,43013,1],[43015,43018,1],[43020,43042,1],[43072,43123,1],[43138,43187,1],[43250,43255,1],[43259,43261,2],[43262,43274,12],[43275,43301,1],[43312,43334,1],[43360,43388,1],[43396,43442,1],[43471,43488,17],[43489,43492,1],[43494,43503,1],[43514,43518,1],[43520,43560,1],[43584,43586,1],[43588,43595,1],[43616,43638,1],[43642,43646,4],[43647,43695,1],[43697,43701,4],[43702,43705,3],[43706,43709,1],[43712,43714,2],[43739,43741,1],[43744,43754,1],[43762,43764,1],[43777,43782,1],[43785,43790,1],[43793,43798,1],[43808,43814,1],[43816,43822,1],[43824,43866,1],[43868,43881,1],[43888,44002,1],[44032,55203,1],[55216,55238,1],[55243,5
25291,1],[63744,64109,1],[64112,64217,1],[64256,64262,1],[64275,64279,1],[64285,64287,2],[64288,64296,1],[64298,64310,1],[64312,64316,1],[64318,64320,2],[64321,64323,2],[64324,64326,2],[64327,64433,1],[64467,64829,1],[64848,64911,1],[64914,64967,1],[65008,65019,1],[65136,65140,1],[65142,65276,1],[65313,65338,1],[65345,65370,1],[65382,65470,1],[65474,65479,1],[65482,65487,1],[65490,65495,1],[65498,65500,1],[65536,65547,1],[65549,65574,1],[65576,65594,1],[65596,65597,1],[65599,65613,1],[65616,65629,1],[65664,65786,1],[66176,66204,1],[66208,66256,1],[66304,66335,1],[66349,66368,1],[66370,66377,1],[66384,66421,1],[66432,66461,1],[66464,66499,1],[66504,66511,1],[66560,66717,1],[66736,66771,1],[66776,66811,1],[66816,66855,1],[66864,66915,1],[66928,66938,1],[66940,66954,1],[66956,66962,1],[66964,66965,1],[66967,66977,1],[66979,66993,1],[66995,67001,1],[67003,67004,1],[67072,67382,1],[67392,67413,1],[67424,67431,1],[67456,67461,1],[67463,67504,1],[67506,67514,1],[67584,67589,1],[67592,67594,2],[67595,67637,1],[67639,67640,1],[67644,67647,3],[67648,67669,1],[67680,67702,1],[67712,67742,1],[67808,67826,1],[67828,67829,1],[67840,67861,1],[67872,67897,1],[67968,68023,1],[68030,68031,1],[68096,68112,16],[68113,68115,1],[68117,68119,1],[68121,68149,1],[68192,68220,1],[68224,68252,1],[68288,68295,1],[68297,68324,1],[68352,68405,1],[68416,68437,1],[68448,68466,1],[68480,68497,1],[68608,68680,1],[68736,68786,1],[68800,68850,1],[68864,68899,1],[69248,69289,1],[69296,69297,1],[69376,69404,1],[69415,69424,9],[69425,69445,1],[69488,69505,1],[69552,69572,1],[69600,69622,1],[69635,69687,1],[69745,69746,1],[69749,69763,14],[69764,69807,1],[69840,69864,1],[69891,69926,1],[69956,69959,3],[69968,70002,1],[70006,70019,13],[70020,70066,1],[70081,70084,1],[70106,70108,2],[70144,70161,1],[70163,70187,1],[70207,70208,1],[70272,70278,1],[70280,70282,2],[70283,70285,1],[70287,70301,1],[70303,70312,1],[70320,70366,1],[70405,70412,1],[70415,70416,1],[70419,70440,1],[70442,70448,1],[70450,70451,1],[70453,70457,1],[70461,70480,19],[70493,70497,1],[70656,70708,1],[70727,70730,1],[70751,70753,1],[70784,70831,1],[70852,70853,1],[70855,71040,185],[71041,71086,1],[71128,71131,1],[71168,71215,1],[71236,71296,60],[71297,71338,1],[71352,71424,72],[71425,71450,1],[71488,71494,1],[71680,71723,1],[71840,71903,1],[71935,71942,1],[71945,71948,3],[71949,71955,1],[71957,71958,1],[71960,71983,1],[71999,72001,2],[72096,72103,1],[72106,72144,1],[72161,72163,2],[72192,72203,11],[72204,72242,1],[72250,72272,22],[72284,72329,1],[72349,72368,19],[72369,72440,1],[72704,72712,1],[72714,72750,1],[72768,72818,50],[72819,72847,1],[72960,72966,1],[72968,72969,1],[72971,73008,1],[73030,73056,26],[73057,73061,1],[73063,73064,1],[73066,73097,1],[73112,73440,328],[73441,73458,1],[73474,73476,2],[73477,73488,1],[73490,73523,1],[73648,73728,80],[73729,74649,1],[74880,75075,1],[77712,77808,1],[77824,78895,1],[78913,78918,1],[82944,83526,1],[92160,92728,1],[92736,92766,1],[92784,92862,1],[92880,92909,1],[92928,92975,1],[92992,92995,1],[93027,93047,1],[93053,93071,1],[93760,93823,1],[93952,94026,1],[94032,94099,67],[94100,94111,1],[94176,94177,1],[94179,94208,29],[94209,100343,1],[100352,101589,1],[101632,101640,1],[110576,110579,1],[110581,110587,1],[110589,110590,1],[110592,110882,1],[110898,110928,30],[110929,110930,1],[110933,110948,15],[110949,110951,1],[110960,111355,1],[113664,113770,1],[113776,113788,1],[113792,113800,1],[113808,113817,1],[119808,119892,1],[119894,119964,1],[119966,119967,1],[119970,119973,3],[119974,119977,3],[119978,119980,1],[119982,119993,1],[119995,119997,2],[119998,120003,1],[120005,120069,1],[120071,120074,1],[120077,120084,1],[120086,120092,1],[120094,120121,1],[120123,120126,1],[120128,120132,1],[120134,120138,4],[120139,120144,1],[120146,120485,1],[120488,120512,1],[120514,120538,1],[120540,120570,1],[120572,120596,1],[120598,120628,1],[120630,120654,1],[120656,120686,1],[120688,120712,1],[120714,120744,1],[120746,120770,1],[120772,120779,1],[122624,122654,1],[122661,122666,1],[122928,122989,1],[123136,123180,1],[123191,123197,1],[123214,123536,322],[123537,123565,1],[123584,123627,1],[124112,124139,1],[124896,124902,1],[124904,124907,1],[124909,124910,1],[124912,124926,1],[124928,125124,1],[125184,125251,1],[125259,126464,1205],[126465,126467,1],[126469,126495,1],[126497,126498,1],[126500,126503,3],[126505,126514,1],[126516,126519,1],[126521,126523,2],[126530,126535,5],[126537,126541,2],[126542,126543,1],[126545,126546,1],[126548,126551,3],[126553,126561,2],[126562,126564,2],[126567,126570,1],[126572,126578,1],[126580,126583,1],[126585,126588,1],[126590,126592,2],[126593,126601,1],[126603,126619,1],[126625,126627,1],[126629,126633,1],[126635,126651,1],[131072,173791,1],[173824,177977,1],[177984,178205,1],[178208,183969,1],[183984,191456,1],[191472,192093,1],[194560,195101,1],[196608,201546,1],[201552,205743,1]]),f(Ph,"foldL",[[837,837,1]]),f(Ph,"Ll",[[97,122,1],[181,223,42],[224,246,1],[248,255,1],[257,311,2],[312,328,2],[329,375,2],[378,382,2],[383,384,1],[387,389,2],[392,396,4],[397,402,5],[405,409,4],[410,411,1],[414,417,3],[419,421,2],[424,426,2],[427,429,2],[432,436,4],[438,441,3],[442,445,3],[446,447,1],[454,460,3],[462,476,2],[477,495,2],[496,499,3],[501,505,4],[507,563,2],[564,569,1],[572,575,3],[576,578,2],[583,591,2],[592,659,1],[661,687,1],[881,883,2],[887,891,4],[892,893,1],[912,940,28],[941,974,1],[976,977,1],[981,983,1],[985,1007,2],[1008,1011,1],[1013,1019,3],[1020,1072,52],[1073,1119,1],[1121,1153,2],[1163,1215,2],[1218,1230,2],[1231,1327,2],[1376,1416,1],[4304,4346,1],[4349,4351,1],[5112,5117,1],[7296,7304,1],[7424,7467,1],[7531,7543,1],[7545,7578,1],[7681,7829,2],[7830,7837,1],[7839,7935,2],[7936,7943,1],[7952,7957,1],[7968,7975,1],[7984,7991,1],[8e3,8005,1],[8016,8023,1],[8032,8039,1],[8048,8061,1],[8064,8071,1],[8080,8087,1],[8096,8103,1],[8112,8116,1],[8118,8119,1],[8126,8130,4],[8131,8132,1],[8134,8135,1],[8144,8147,1],[8150,8151,1],[8160,8167,1],[8178,8180,1],[8182,8183,1],[8458,8462,4],[8463,8467,4],[8495,8505,5],[8508,8509,1],[8518,8521,1],[8526,8580,54],[11312,11359,1],[11361,11365,4],[11366,11372,2],[11377,11379,2],[11380,11382,2],[11383,11387,1],[11393,11491,2],[11492,11500,8],[11502,11507,5],[11520,11557,1],[11559,11565,6],[42561,42605,2],[42625,42651,2],[42787,42799,2],[42800,42801,1],[42803,42865,2],[42866,42872,1],[42874,42876,2],[42879,42887,2],[42892,42894,2],[42897,42899,2],[42900,42901,1],[42903,42921,2],[42927,42933,6],[42935,42947,2],[42952,42954,2],[42961,42969,2],[42998,43002,4],[43824,43866,1],[43872,43880,1],[43888,43967,1],[64256,64262,1],[64275,64279,1],[65345,65370,1],[66600,66639,1],[66776,66811,1],[66967,66977,1],[66979,66993,1],[66995,67001,1],[67003,67004,1],[68800,68850,1],[71872,71903,1],[93792,93823,1],[119834,119859,1],[119886,119892,1],[119894,119911,1],[119938,119963,1],[119990,119993,1],[119995,119997,2],[119998,120003,1],[120005,120015,1],[120042,120067,1],[120094,120119,1],[120146,120171,1],[120198,120223,1],[120250,12
20275,1],[120302,120327,1],[120354,120379,1],[120406,120431,1],[120458,120485,1],[120514,120538,1],[120540,120545,1],[120572,120596,1],[120598,120603,1],[120630,120654,1],[120656,120661,1],[120688,120712,1],[120714,120719,1],[120746,120770,1],[120772,120777,1],[120779,122624,1845],[122625,122633,1],[122635,122654,1],[122661,122666,1],[125218,125251,1]]),f(Ph,"foldLl",[[65,90,1],[192,214,1],[216,222,1],[256,302,2],[306,310,2],[313,327,2],[330,376,2],[377,381,2],[385,386,1],[388,390,2],[391,393,2],[394,395,1],[398,401,1],[403,404,1],[406,408,1],[412,413,1],[415,416,1],[418,422,2],[423,425,2],[428,430,2],[431,433,2],[434,435,1],[437,439,2],[440,444,4],[452,453,1],[455,456,1],[458,459,1],[461,475,2],[478,494,2],[497,498,1],[500,502,2],[503,504,1],[506,562,2],[570,571,1],[573,574,1],[577,579,2],[580,582,1],[584,590,2],[837,880,43],[882,886,4],[895,902,7],[904,906,1],[908,910,2],[911,913,2],[914,929,1],[931,939,1],[975,984,9],[986,1006,2],[1012,1015,3],[1017,1018,1],[1021,1071,1],[1120,1152,2],[1162,1216,2],[1217,1229,2],[1232,1326,2],[1329,1366,1],[4256,4293,1],[4295,4301,6],[5024,5109,1],[7312,7354,1],[7357,7359,1],[7680,7828,2],[7838,7934,2],[7944,7951,1],[7960,7965,1],[7976,7983,1],[7992,7999,1],[8008,8013,1],[8025,8031,2],[8040,8047,1],[8072,8079,1],[8088,8095,1],[8104,8111,1],[8120,8124,1],[8136,8140,1],[8152,8155,1],[8168,8172,1],[8184,8188,1],[8486,8490,4],[8491,8498,7],[8579,11264,2685],[11265,11311,1],[11360,11362,2],[11363,11364,1],[11367,11373,2],[11374,11376,1],[11378,11381,3],[11390,11392,1],[11394,11490,2],[11499,11501,2],[11506,42560,31054],[42562,42604,2],[42624,42650,2],[42786,42798,2],[42802,42862,2],[42873,42877,2],[42878,42886,2],[42891,42893,2],[42896,42898,2],[42902,42922,2],[42923,42926,1],[42928,42932,1],[42934,42948,2],[42949,42951,1],[42953,42960,7],[42966,42968,2],[42997,65313,22316],[65314,65338,1],[66560,66599,1],[66736,66771,1],[66928,66938,1],[66940,66954,1],[66956,66962,1],[66964,66965,1],[68736,68786,1],[71840,71871,1],[93760,93791,1],[125184,125217,1]]),f(Ph,"Lm",[[688,705,1],[710,721,1],[736,740,1],[748,750,2],[884,890,6],[1369,1600,231],[1765,1766,1],[2036,2037,1],[2042,2074,32],[2084,2088,4],[2249,2417,168],[3654,3782,128],[4348,6103,1755],[6211,6823,612],[7288,7293,1],[7468,7530,1],[7544,7579,35],[7580,7615,1],[8305,8319,14],[8336,8348,1],[11388,11389,1],[11631,11823,192],[12293,12337,44],[12338,12341,1],[12347,12445,98],[12446,12540,94],[12541,12542,1],[40981,42232,1251],[42233,42237,1],[42508,42623,115],[42652,42653,1],[42775,42783,1],[42864,42888,24],[42994,42996,1],[43e3,43001,1],[43471,43494,23],[43632,43741,109],[43763,43764,1],[43868,43871,1],[43881,65392,21511],[65438,65439,1],[67456,67461,1],[67463,67504,1],[67506,67514,1],[92992,92995,1],[94099,94111,1],[94176,94177,1],[94179,110576,16397],[110577,110579,1],[110581,110587,1],[110589,110590,1],[122928,122989,1],[123191,123197,1],[124139,125259,1120]]),f(Ph,"Lo",[[170,186,16],[443,448,5],[449,451,1],[660,1488,828],[1489,1514,1],[1519,1522,1],[1568,1599,1],[1601,1610,1],[1646,1647,1],[1649,1747,1],[1749,1774,25],[1775,1786,11],[1787,1788,1],[1791,1808,17],[1810,1839,1],[1869,1957,1],[1969,1994,25],[1995,2026,1],[2048,2069,1],[2112,2136,1],[2144,2154,1],[2160,2183,1],[2185,2190,1],[2208,2248,1],[2308,2361,1],[2365,2384,19],[2392,2401,1],[2418,2432,1],[2437,2444,1],[2447,2448,1],[2451,2472,1],[2474,2480,1],[2482,2486,4],[2487,2489,1],[2493,2510,17],[2524,2525,1],[2527,2529,1],[2544,2545,1],[2556,2565,9],[2566,2570,1],[2575,2576,1],[2579,2600,1],[2602,2608,1],[2610,2611,1],[2613,2614,1],[2616,2617,1],[2649,2652,1],[2654,2674,20],[2675,2676,1],[2693,2701,1],[2703,2705,1],[2707,2728,1],[2730,2736,1],[2738,2739,1],[2741,2745,1],[2749,2768,19],[2784,2785,1],[2809,2821,12],[2822,2828,1],[2831,2832,1],[2835,2856,1],[2858,2864,1],[2866,2867,1],[2869,2873,1],[2877,2908,31],[2909,2911,2],[2912,2913,1],[2929,2947,18],[2949,2954,1],[2958,2960,1],[2962,2965,1],[2969,2970,1],[2972,2974,2],[2975,2979,4],[2980,2984,4],[2985,2986,1],[2990,3001,1],[3024,3077,53],[3078,3084,1],[3086,3088,1],[3090,3112,1],[3114,3129,1],[3133,3160,27],[3161,3162,1],[3165,3168,3],[3169,3200,31],[3205,3212,1],[3214,3216,1],[3218,3240,1],[3242,3251,1],[3253,3257,1],[3261,3293,32],[3294,3296,2],[3297,3313,16],[3314,3332,18],[3333,3340,1],[3342,3344,1],[3346,3386,1],[3389,3406,17],[3412,3414,1],[3423,3425,1],[3450,3455,1],[3461,3478,1],[3482,3505,1],[3507,3515,1],[3517,3520,3],[3521,3526,1],[3585,3632,1],[3634,3635,1],[3648,3653,1],[3713,3714,1],[3716,3718,2],[3719,3722,1],[3724,3747,1],[3749,3751,2],[3752,3760,1],[3762,3763,1],[3773,3776,3],[3777,3780,1],[3804,3807,1],[3840,3904,64],[3905,3911,1],[3913,3948,1],[3976,3980,1],[4096,4138,1],[4159,4176,17],[4177,4181,1],[4186,4189,1],[4193,4197,4],[4198,4206,8],[4207,4208,1],[4213,4225,1],[4238,4352,114],[4353,4680,1],[4682,4685,1],[4688,4694,1],[4696,4698,2],[4699,4701,1],[4704,4744,1],[4746,4749,1],[4752,4784,1],[4786,4789,1],[4792,4798,1],[4800,4802,2],[4803,4805,1],[4808,4822,1],[4824,4880,1],[4882,4885,1],[4888,4954,1],[4992,5007,1],[5121,5740,1],[5743,5759,1],[5761,5786,1],[5792,5866,1],[5873,5880,1],[5888,5905,1],[5919,5937,1],[5952,5969,1],[5984,5996,1],[5998,6e3,1],[6016,6067,1],[6108,6176,68],[6177,6210,1],[6212,6264,1],[6272,6276,1],[6279,6312,1],[6314,6320,6],[6321,6389,1],[6400,6430,1],[6480,6509,1],[6512,6516,1],[6528,6571,1],[6576,6601,1],[6656,6678,1],[6688,6740,1],[6917,6963,1],[6981,6988,1],[7043,7072,1],[7086,7087,1],[7098,7141,1],[7168,7203,1],[7245,7247,1],[7258,7287,1],[7401,7404,1],[7406,7411,1],[7413,7414,1],[7418,8501,1083],[8502,8504,1],[11568,11623,1],[11648,11670,1],[11680,11686,1],[11688,11694,1],[11696,11702,1],[11704,11710,1],[11712,11718,1],[11720,11726,1],[11728,11734,1],[11736,11
2742,1],[12294,12348,54],[12353,12438,1],[12447,12449,2],[12450,12538,1],[12543,12549,6],[12550,12591,1],[12593,12686,1],[12704,12735,1],[12784,12799,1],[13312,19903,1],[19968,40980,1],[40982,42124,1],[42192,42231,1],[42240,42507,1],[42512,42527,1],[42538,42539,1],[42606,42656,50],[42657,42725,1],[42895,42999,104],[43003,43009,1],[43011,43013,1],[43015,43018,1],[43020,43042,1],[43072,43123,1],[43138,43187,1],[43250,43255,1],[43259,43261,2],[43262,43274,12],[43275,43301,1],[43312,43334,1],[43360,43388,1],[43396,43442,1],[43488,43492,1],[43495,43503,1],[43514,43518,1],[43520,43560,1],[43584,43586,1],[43588,43595,1],[43616,43631,1],[43633,43638,1],[43642,43646,4],[43647,43695,1],[43697,43701,4],[43702,43705,3],[43706,43709,1],[43712,43714,2],[43739,43740,1],[43744,43754,1],[43762,43777,15],[43778,43782,1],[43785,43790,1],[43793,43798,1],[43808,43814,1],[43816,43822,1],[43968,44002,1],[44032,55203,1],[55216,55238,1],[55243,55291,1],[63744,64109,1],[64112,64217,1],[64285,64287,2],[64288,64296,1],[64298,64310,1],[64312,64316,1],[64318,64320,2],[64321,64323,2],[64324,64326,2],[64327,64433,1],[64467,64829,1],[64848,64911,1],[64914,64967,1],[65008,65019,1],[65136,65140,1],[65142,65276,1],[65382,65391,1],[65393,65437,1],[65440,65470,1],[65474,65479,1],[65482,65487,1],[65490,65495,1],[65498,65500,1],[65536,65547,1],[65549,65574,1],[65576,65594,1],[65596,65597,1],[65599,65613,1],[65616,65629,1],[65664,65786,1],[66176,66204,1],[66208,66256,1],[66304,66335,1],[66349,66368,1],[66370,66377,1],[66384,66421,1],[66432,66461,1],[66464,66499,1],[66504,66511,1],[66640,66717,1],[66816,66855,1],[66864,66915,1],[67072,67382,1],[67392,67413,1],[67424,67431,1],[67584,67589,1],[67592,67594,2],[67595,67637,1],[67639,67640,1],[67644,67647,3],[67648,67669,1],[67680,67702,1],[67712,67742,1],[67808,67826,1],[67828,67829,1],[67840,67861,1],[67872,67897,1],[67968,68023,1],[68030,68031,1],[68096,68112,16],[68113,68115,1],[68117,68119,1],[68121,68149,1],[68192,68220,1],[68224,68252,1],[68288,68295,1],[68297,68324,1],[68352,68405,1],[68416,68437,1],[68448,68466,1],[68480,68497,1],[68608,68680,1],[68864,68899,1],[69248,69289,1],[69296,69297,1],[69376,69404,1],[69415,69424,9],[69425,69445,1],[69488,69505,1],[69552,69572,1],[69600,69622,1],[69635,69687,1],[69745,69746,1],[69749,69763,14],[69764,69807,1],[69840,69864,1],[69891,69926,1],[69956,69959,3],[69968,70002,1],[70006,70019,13],[70020,70066,1],[70081,70084,1],[70106,70108,2],[70144,70161,1],[70163,70187,1],[70207,70208,1],[70272,70278,1],[70280,70282,2],[70283,70285,1],[70287,70301,1],[70303,70312,1],[70320,70366,1],[70405,70412,1],[70415,70416,1],[70419,70440,1],[70442,70448,1],[70450,70451,1],[70453,70457,1],[70461,70480,19],[70493,70497,1],[70656,70708,1],[70727,70730,1],[70751,70753,1],[70784,70831,1],[70852,70853,1],[70855,71040,185],[71041,71086,1],[71128,71131,1],[71168,71215,1],[71236,71296,60],[71297,71338,1],[71352,71424,72],[71425,71450,1],[71488,71494,1],[71680,71723,1],[71935,71942,1],[71945,71948,3],[71949,71955,1],[71957,71958,1],[71960,71983,1],[71999,72001,2],[72096,72103,1],[72106,72144,1],[72161,72163,2],[72192,72203,11],[72204,72242,1],[72250,72272,22],[72284,72329,1],[72349,72368,19],[72369,72440,1],[72704,72712,1],[72714,72750,1],[72768,72818,50],[72819,72847,1],[72960,72966,1],[72968,72969,1],[72971,73008,1],[73030,73056,26],[73057,73061,1],[73063,73064,1],[73066,73097,1],[73112,73440,328],[73441,73458,1],[73474,73476,2],[73477,73488,1],[73490,73523,1],[73648,73728,80],[73729,74649,1],[74880,75075,1],[77712,77808,1],[77824,78895,1],[78913,78918,1],[82944,83526,1],[92160,92728,1],[92736,92766,1],[92784,92862,1],[92880,92909,1],[92928,92975,1],[93027,93047,1],[93053,93071,1],[93952,94026,1],[94032,94208,176],[94209,100343,1],[100352,101589,1],[101632,101640,1],[110592,110882,1],[110898,110928,30],[110929,110930,1],[110933,110948,15],[110949,110951,1],[110960,111355,1],[113664,113770,1],[113776,113788,1],[113792,113800,1],[113808,113817,1],[122634,123136,502],[123137,123180,1],[123214,123536,322],[123537,123565,1],[123584,123627,1],[124112,124138,1],[124896,124902,1],[124904,124907,1],[124909,124910,1],[124912,124926,1],[124928,125124,1],[126464,126467,1],[126469,126495,1],[126497,126498,1],[126500,126503,3],[126505,126514,1],[126516,126519,1],[126521,126523,2],[126530,126535,5],[126537,126541,2],[126542,126543,1],[126545,126546,1],[126548,126551,3],[126553,126561,2],[126562,126564,2],[126567,126570,1],[126572,126578,1],[126580,126583,1],[126585,126588,1],[126590,126592,2],[126593,126601,1],[126603,126619,1],[126625,126627,1],[126629,126633,1],[126635,126651,1],[131072,173791,1],[173824,177977,1],[177984,178205,1],[178208,183969,1],[183984,191456,1],[191472,192093,1],[194560,195101,1],[196608,201546,1],[201552,205743,1]]),f(Ph,"Lt",[[453,459,3],[498,8072,7574],[8073,8079,1],[8088,8095,1],[8104,8111,1],[8124,8140,16],[8188,8188,1]]),f(Ph,"foldLt",[[452,454,2],[455,457,2],[458,460,2],[497,499,2],[8064,8071,1],[8080,8087,1],[8096,8103,1],[8115,8131,16],[8179,8179,1]]),f(Ph,"Lu",[[65,90,1],[192,214,1],[216,222,1],[256,310,2],[313,327,2],[330,376,2],[377,381,2],[385,386,1],[388,390,2],[391,393,2],[394,395,1],[398,401,1],[403,404,1],[406,408,1],[412,413,1],[415,416,1],[418,422,2],[423,425,2],[428,430,2],[431,433,2],[434,435,1],[437,439,2],[440,444,4],[452,461,3],[463,475,2],[478,494,2],[497,500,3],[502,504,1],[506,562,2],[570,571,1],[573,574,1],[577,579,2],[580,582,1],[584,590,2],[880,882,2],[886,895,9],[902,904,2],[905,906,1],[908,910,2],[911,913,2],[914,929,1],[931,939,1],[975,978,3],[979,980,1],[984,1006,2],[1012,1015,3],[1017,1018,1],[1021,10
271,1],[1120,1152,2],[1162,1216,2],[1217,1229,2],[1232,1326,2],[1329,1366,1],[4256,4293,1],[4295,4301,6],[5024,5109,1],[7312,7354,1],[7357,7359,1],[7680,7828,2],[7838,7934,2],[7944,7951,1],[7960,7965,1],[7976,7983,1],[7992,7999,1],[8008,8013,1],[8025,8031,2],[8040,8047,1],[8120,8123,1],[8136,8139,1],[8152,8155,1],[8168,8172,1],[8184,8187,1],[8450,8455,5],[8459,8461,1],[8464,8466,1],[8469,8473,4],[8474,8477,1],[8484,8490,2],[8491,8493,1],[8496,8499,1],[8510,8511,1],[8517,8579,62],[11264,11311,1],[11360,11362,2],[11363,11364,1],[11367,11373,2],[11374,11376,1],[11378,11381,3],[11390,11392,1],[11394,11490,2],[11499,11501,2],[11506,42560,31054],[42562,42604,2],[42624,42650,2],[42786,42798,2],[42802,42862,2],[42873,42877,2],[42878,42886,2],[42891,42893,2],[42896,42898,2],[42902,42922,2],[42923,42926,1],[42928,42932,1],[42934,42948,2],[42949,42951,1],[42953,42960,7],[42966,42968,2],[42997,65313,22316],[65314,65338,1],[66560,66599,1],[66736,66771,1],[66928,66938,1],[66940,66954,1],[66956,66962,1],[66964,66965,1],[68736,68786,1],[71840,71871,1],[93760,93791,1],[119808,119833,1],[119860,119885,1],[119912,119937,1],[119964,119966,2],[119967,119973,3],[119974,119977,3],[119978,119980,1],[119982,119989,1],[120016,120041,1],[120068,120069,1],[120071,120074,1],[120077,120084,1],[120086,120092,1],[120120,120121,1],[120123,120126,1],[120128,120132,1],[120134,120138,4],[120139,120144,1],[120172,120197,1],[120224,120249,1],[120276,120301,1],[120328,120353,1],[120380,120405,1],[120432,120457,1],[120488,120512,1],[120546,120570,1],[120604,120628,1],[120662,120686,1],[120720,120744,1],[120778,125184,4406],[125185,125217,1]]),f(Ph,"Upper",Ch.Lu),f(Ph,"foldLu",[[97,122,1],[181,223,42],[224,246,1],[248,255,1],[257,303,2],[307,311,2],[314,328,2],[331,375,2],[378,382,2],[383,384,1],[387,389,2],[392,396,4],[402,405,3],[409,410,1],[414,417,3],[419,421,2],[424,429,5],[432,436,4],[438,441,3],[445,447,2],[453,454,1],[456,457,1],[459,460,1],[462,476,2],[477,495,2],[498,499,1],[501,505,4],[507,543,2],[547,563,2],[572,575,3],[576,578,2],[583,591,2],[592,596,1],[598,599,1],[601,603,2],[604,608,4],[609,613,2],[614,616,2],[617,620,1],[623,625,2],[626,629,3],[637,640,3],[642,643,1],[647,652,1],[658,669,11],[670,837,167],[881,883,2],[887,891,4],[892,893,1],[940,943,1],[945,974,1],[976,977,1],[981,983,1],[985,1007,2],[1008,1011,1],[1013,1019,3],[1072,1119,1],[1121,1153,2],[1163,1215,2],[1218,1230,2],[1231,1327,2],[1377,1414,1],[4304,4346,1],[4349,4351,1],[5112,5117,1],[7296,7304,1],[7545,7549,4],[7566,7681,115],[7683,7829,2],[7835,7841,6],[7843,7935,2],[7936,7943,1],[7952,7957,1],[7968,7975,1],[7984,7991,1],[8e3,8005,1],[8017,8023,2],[8032,8039,1],[8048,8061,1],[8112,8113,1],[8126,8144,18],[8145,8160,15],[8161,8165,4],[8526,8580,54],[11312,11359,1],[11361,11365,4],[11366,11372,2],[11379,11382,3],[11393,11491,2],[11500,11502,2],[11507,11520,13],[11521,11557,1],[11559,11565,6],[42561,42605,2],[42625,42651,2],[42787,42799,2],[42803,42863,2],[42874,42876,2],[42879,42887,2],[42892,42897,5],[42899,42900,1],[42903,42921,2],[42933,42947,2],[42952,42954,2],[42961,42967,6],[42969,42998,29],[43859,43888,29],[43889,43967,1],[65345,65370,1],[66600,66639,1],[66776,66811,1],[66967,66977,1],[66979,66993,1],[66995,67001,1],[67003,67004,1],[68800,68850,1],[71872,71903,1],[93792,93823,1],[125218,125251,1]]),f(Ph,"M",[[768,879,1],[1155,1161,1],[1425,1469,1],[1471,1473,2],[1474,1476,2],[1477,1479,2],[1552,1562,1],[1611,1631,1],[1648,1750,102],[1751,1756,1],[1759,1764,1],[1767,1768,1],[1770,1773,1],[1809,1840,31],[1841,1866,1],[1958,1968,1],[2027,2035,1],[2045,2070,25],[2071,2073,1],[2075,2083,1],[2085,2087,1],[2089,2093,1],[2137,2139,1],[2200,2207,1],[2250,2273,1],[2275,2307,1],[2362,2364,1],[2366,2383,1],[2385,2391,1],[2402,2403,1],[2433,2435,1],[2492,2494,2],[2495,2500,1],[2503,2504,1],[2507,2509,1],[2519,2530,11],[2531,2558,27],[2561,2563,1],[2620,2622,2],[2623,2626,1],[2631,2632,1],[2635,2637,1],[2641,2672,31],[2673,2677,4],[2689,2691,1],[2748,2750,2],[2751,2757,1],[2759,2761,1],[2763,2765,1],[2786,2787,1],[2810,2815,1],[2817,2819,1],[2876,2878,2],[2879,2884,1],[2887,2888,1],[2891,2893,1],[2901,2903,1],[2914,2915,1],[2946,3006,60],[3007,3010,1],[3014,3016,1],[3018,3021,1],[3031,3072,41],[3073,3076,1],[3132,3134,2],[3135,3140,1],[3142,3144,1],[3146,3149,1],[3157,3158,1],[3170,3171,1],[3201,3203,1],[3260,3262,2],[3263,3268,1],[3270,3272,1],[3274,3277,1],[3285,3286,1],[3298,3299,1],[3315,3328,13],[3329,3331,1],[3387,3388,1],[3390,3396,1],[3398,3400,1],[3402,3405,1],[3415,3426,11],[3427,3457,30],[3458,3459,1],[3530,3535,5],[3536,3540,1],[3542,3544,2],[3545,3551,1],[3570,3571,1],[3633,3636,3],[3637,3642,1],[3655,3662,1],[3761,3764,3],[3765,3772,1],[3784,3790,1],[3864,3865,1],[3893,3897,2],[3902,3903,1],[3953,3972,1],[3974,3975,1],[3981,3991,1],[3993,4028,1],[4038,4139,101],[4140,4158,1],[4182,4185,1],[4190,4192,1],[4194,4196,1],[4199,4205,1],[4209,4212,1],[4226,4237,1],[4239,4250,11],[4251,4253,1],[4957,4959,1],[5906,5909,1],[5938,5940,1],[5970,5971,1],[6002,6003,1],[6068,6099,1],[6109,6155,46],[6156,6157,1],[6159,6277,118],[6278,6313,35],[6432,6443,1],[6448,6459,1],[6679,6683,1],[6741,6750,1],[6752,6780,1],[6783,6832,49],[6833,6862,1],[6912,6916,1],[6964,6980,1],[7019,7027,1],[7040,7042,1],[7073,7085,
21],[7142,7155,1],[7204,7223,1],[7376,7378,1],[7380,7400,1],[7405,7412,7],[7415,7417,1],[7616,7679,1],[8400,8432,1],[11503,11505,1],[11647,11744,97],[11745,11775,1],[12330,12335,1],[12441,12442,1],[42607,42610,1],[42612,42621,1],[42654,42655,1],[42736,42737,1],[43010,43014,4],[43019,43043,24],[43044,43047,1],[43052,43136,84],[43137,43188,51],[43189,43205,1],[43232,43249,1],[43263,43302,39],[43303,43309,1],[43335,43347,1],[43392,43395,1],[43443,43456,1],[43493,43561,68],[43562,43574,1],[43587,43596,9],[43597,43643,46],[43644,43645,1],[43696,43698,2],[43699,43700,1],[43703,43704,1],[43710,43711,1],[43713,43755,42],[43756,43759,1],[43765,43766,1],[44003,44010,1],[44012,44013,1],[64286,65024,738],[65025,65039,1],[65056,65071,1],[66045,66272,227],[66422,66426,1],[68097,68099,1],[68101,68102,1],[68108,68111,1],[68152,68154,1],[68159,68325,166],[68326,68900,574],[68901,68903,1],[69291,69292,1],[69373,69375,1],[69446,69456,1],[69506,69509,1],[69632,69634,1],[69688,69702,1],[69744,69747,3],[69748,69759,11],[69760,69762,1],[69808,69818,1],[69826,69888,62],[69889,69890,1],[69927,69940,1],[69957,69958,1],[70003,70016,13],[70017,70018,1],[70067,70080,1],[70089,70092,1],[70094,70095,1],[70188,70199,1],[70206,70209,3],[70367,70378,1],[70400,70403,1],[70459,70460,1],[70462,70468,1],[70471,70472,1],[70475,70477,1],[70487,70498,11],[70499,70502,3],[70503,70508,1],[70512,70516,1],[70709,70726,1],[70750,70832,82],[70833,70851,1],[71087,71093,1],[71096,71104,1],[71132,71133,1],[71216,71232,1],[71339,71351,1],[71453,71467,1],[71724,71738,1],[71984,71989,1],[71991,71992,1],[71995,71998,1],[72e3,72002,2],[72003,72145,142],[72146,72151,1],[72154,72160,1],[72164,72193,29],[72194,72202,1],[72243,72249,1],[72251,72254,1],[72263,72273,10],[72274,72283,1],[72330,72345,1],[72751,72758,1],[72760,72767,1],[72850,72871,1],[72873,72886,1],[73009,73014,1],[73018,73020,2],[73021,73023,2],[73024,73029,1],[73031,73098,67],[73099,73102,1],[73104,73105,1],[73107,73111,1],[73459,73462,1],[73472,73473,1],[73475,73524,49],[73525,73530,1],[73534,73538,1],[78912,78919,7],[78920,78933,1],[92912,92916,1],[92976,92982,1],[94031,94033,2],[94034,94087,1],[94095,94098,1],[94180,94192,12],[94193,113821,19628],[113822,118528,4706],[118529,118573,1],[118576,118598,1],[119141,119145,1],[119149,119154,1],[119163,119170,1],[119173,119179,1],[119210,119213,1],[119362,119364,1],[121344,121398,1],[121403,121452,1],[121461,121476,15],[121499,121503,1],[121505,121519,1],[122880,122886,1],[122888,122904,1],[122907,122913,1],[122915,122916,1],[122918,122922,1],[123023,123184,161],[123185,123190,1],[123566,123628,62],[123629,123631,1],[124140,124143,1],[125136,125142,1],[125252,125258,1],[917760,917999,1]]),f(Ph,"foldM",[[921,953,32],[8126,8126,1]]),f(Ph,"Mc",[[2307,2363,56],[2366,2368,1],[2377,2380,1],[2382,2383,1],[2434,2435,1],[2494,2496,1],[2503,2504,1],[2507,2508,1],[2519,2563,44],[2622,2624,1],[2691,2750,59],[2751,2752,1],[2761,2763,2],[2764,2818,54],[2819,2878,59],[2880,2887,7],[2888,2891,3],[2892,2903,11],[3006,3007,1],[3009,3010,1],[3014,3016,1],[3018,3020,1],[3031,3073,42],[3074,3075,1],[3137,3140,1],[3202,3203,1],[3262,3264,2],[3265,3268,1],[3271,3272,1],[3274,3275,1],[3285,3286,1],[3315,3330,15],[3331,3390,59],[3391,3392,1],[3398,3400,1],[3402,3404,1],[3415,3458,43],[3459,3535,76],[3536,3537,1],[3544,3551,1],[3570,3571,1],[3902,3903,1],[3967,4139,172],[4140,4145,5],[4152,4155,3],[4156,4182,26],[4183,4194,11],[4195,4196,1],[4199,4205,1],[4227,4228,1],[4231,4236,1],[4239,4250,11],[4251,4252,1],[5909,5940,31],[6070,6078,8],[6079,6085,1],[6087,6088,1],[6435,6438,1],[6441,6443,1],[6448,6449,1],[6451,6456,1],[6681,6682,1],[6741,6743,2],[6753,6755,2],[6756,6765,9],[6766,6770,1],[6916,6965,49],[6971,6973,2],[6974,6977,1],[6979,6980,1],[7042,7073,31],[7078,7079,1],[7082,7143,61],[7146,7148,1],[7150,7154,4],[7155,7204,49],[7205,7211,1],[7220,7221,1],[7393,7415,22],[12334,12335,1],[43043,43044,1],[43047,43136,89],[43137,43188,51],[43189,43203,1],[43346,43347,1],[43395,43444,49],[43445,43450,5],[43451,43454,3],[43455,43456,1],[43567,43568,1],[43571,43572,1],[43597,43643,46],[43645,43755,110],[43758,43759,1],[43765,44003,238],[44004,44006,2],[44007,44009,2],[44010,44012,2],[69632,69634,2],[69762,69808,46],[69809,69810,1],[69815,69816,1],[69932,69957,25],[69958,70018,60],[70067,70069,1],[70079,70080,1],[70094,70188,94],[70189,70190,1],[70194,70195,1],[70197,70368,171],[70369,70370,1],[70402,70403,1],[70462,70463,1],[70465,70468,1],[70471,70472,1],[70475,70477,1],[70487,70498,11],[70499,70709,210],[70710,70711,1],[70720,70721,1],[70725,70832,107],[70833,70834,1],[70841,70843,2],[70844,70846,1],[70849,71087,238],[71088,71089,1],[71096,71099,1],[71102,71216,114],[71217,71218,1],[71227,71228,1],[71230,71340,110],[71342,71343,1],[71350,71456,106],[71457,71462,5],[71724,71726,1],[71736,71984,248],[71985,71989,1],[71991,71992,1],[71997,72e3,3],[72002,72145,143],[72146,72147,1],[72156,72159,1],[72164,72249,85],[72279,72280,1],[72343,72751,408],[72766,72873,107],[72881,72884,3],[73098,73102,1],[73107,73108,1],[73110,73461,351],[73462,73475,13],[73524,73525,1],[73534,73535,1],[73537,94033,20496],[94034,94087,1],[94192,94193,1],[119141,119142,1],[119149,119154,1]]),f(Ph,"Me",[[1160,1161,1],[6846,8413,1567],[8414,8416,1],[8418,8420,1],[42608,42610,1]]),f(Ph,"Mn",[[768,879,1],[1155,1159,1],[1425,1469,1],[1471,1473,2],[1474,1476,2],[1477,1479,2],[1552,1562,1],[1611,1631,1],[1648,1750,102],[1751,1756,1],[1759,1764,1],[1767,1768,1],[1770,1773,1],[1809,1840,31],[1841,1866,1],[1958,1968,1],[2027,2035,1],[2045,2070,25],[2071,2073,1],[2075,2083,1],[2085,2087,
21],[2089,2093,1],[2137,2139,1],[2200,2207,1],[2250,2273,1],[2275,2306,1],[2362,2364,2],[2369,2376,1],[2381,2385,4],[2386,2391,1],[2402,2403,1],[2433,2492,59],[2497,2500,1],[2509,2530,21],[2531,2558,27],[2561,2562,1],[2620,2625,5],[2626,2631,5],[2632,2635,3],[2636,2637,1],[2641,2672,31],[2673,2677,4],[2689,2690,1],[2748,2753,5],[2754,2757,1],[2759,2760,1],[2765,2786,21],[2787,2810,23],[2811,2815,1],[2817,2876,59],[2879,2881,2],[2882,2884,1],[2893,2901,8],[2902,2914,12],[2915,2946,31],[3008,3021,13],[3072,3076,4],[3132,3134,2],[3135,3136,1],[3142,3144,1],[3146,3149,1],[3157,3158,1],[3170,3171,1],[3201,3260,59],[3263,3270,7],[3276,3277,1],[3298,3299,1],[3328,3329,1],[3387,3388,1],[3393,3396,1],[3405,3426,21],[3427,3457,30],[3530,3538,8],[3539,3540,1],[3542,3633,91],[3636,3642,1],[3655,3662,1],[3761,3764,3],[3765,3772,1],[3784,3790,1],[3864,3865,1],[3893,3897,2],[3953,3966,1],[3968,3972,1],[3974,3975,1],[3981,3991,1],[3993,4028,1],[4038,4141,103],[4142,4144,1],[4146,4151,1],[4153,4154,1],[4157,4158,1],[4184,4185,1],[4190,4192,1],[4209,4212,1],[4226,4229,3],[4230,4237,7],[4253,4957,704],[4958,4959,1],[5906,5908,1],[5938,5939,1],[5970,5971,1],[6002,6003,1],[6068,6069,1],[6071,6077,1],[6086,6089,3],[6090,6099,1],[6109,6155,46],[6156,6157,1],[6159,6277,118],[6278,6313,35],[6432,6434,1],[6439,6440,1],[6450,6457,7],[6458,6459,1],[6679,6680,1],[6683,6742,59],[6744,6750,1],[6752,6754,2],[6757,6764,1],[6771,6780,1],[6783,6832,49],[6833,6845,1],[6847,6862,1],[6912,6915,1],[6964,6966,2],[6967,6970,1],[6972,6978,6],[7019,7027,1],[7040,7041,1],[7074,7077,1],[7080,7081,1],[7083,7085,1],[7142,7144,2],[7145,7149,4],[7151,7153,1],[7212,7219,1],[7222,7223,1],[7376,7378,1],[7380,7392,1],[7394,7400,1],[7405,7412,7],[7416,7417,1],[7616,7679,1],[8400,8412,1],[8417,8421,4],[8422,8432,1],[11503,11505,1],[11647,11744,97],[11745,11775,1],[12330,12333,1],[12441,12442,1],[42607,42612,5],[42613,42621,1],[42654,42655,1],[42736,42737,1],[43010,43014,4],[43019,43045,26],[43046,43052,6],[43204,43205,1],[43232,43249,1],[43263,43302,39],[43303,43309,1],[43335,43345,1],[43392,43394,1],[43443,43446,3],[43447,43449,1],[43452,43453,1],[43493,43561,68],[43562,43566,1],[43569,43570,1],[43573,43574,1],[43587,43596,9],[43644,43696,52],[43698,43700,1],[43703,43704,1],[43710,43711,1],[43713,43756,43],[43757,43766,9],[44005,44008,3],[44013,64286,20273],[65024,65039,1],[65056,65071,1],[66045,66272,227],[66422,66426,1],[68097,68099,1],[68101,68102,1],[68108,68111,1],[68152,68154,1],[68159,68325,166],[68326,68900,574],[68901,68903,1],[69291,69292,1],[69373,69375,1],[69446,69456,1],[69506,69509,1],[69633,69688,55],[69689,69702,1],[69744,69747,3],[69748,69759,11],[69760,69761,1],[69811,69814,1],[69817,69818,1],[69826,69888,62],[69889,69890,1],[69927,69931,1],[69933,69940,1],[70003,70016,13],[70017,70070,53],[70071,70078,1],[70089,70092,1],[70095,70191,96],[70192,70193,1],[70196,70198,2],[70199,70206,7],[70209,70367,158],[70371,70378,1],[70400,70401,1],[70459,70460,1],[70464,70502,38],[70503,70508,1],[70512,70516,1],[70712,70719,1],[70722,70724,1],[70726,70750,24],[70835,70840,1],[70842,70847,5],[70848,70850,2],[70851,71090,239],[71091,71093,1],[71100,71101,1],[71103,71104,1],[71132,71133,1],[71219,71226,1],[71229,71231,2],[71232,71339,107],[71341,71344,3],[71345,71349,1],[71351,71453,102],[71454,71455,1],[71458,71461,1],[71463,71467,1],[71727,71735,1],[71737,71738,1],[71995,71996,1],[71998,72003,5],[72148,72151,1],[72154,72155,1],[72160,72193,33],[72194,72202,1],[72243,72248,1],[72251,72254,1],[72263,72273,10],[72274,72278,1],[72281,72283,1],[72330,72342,1],[72344,72345,1],[72752,72758,1],[72760,72765,1],[72767,72850,83],[72851,72871,1],[72874,72880,1],[72882,72883,1],[72885,72886,1],[73009,73014,1],[73018,73020,2],[73021,73023,2],[73024,73029,1],[73031,73104,73],[73105,73109,4],[73111,73459,348],[73460,73472,12],[73473,73526,53],[73527,73530,1],[73536,73538,2],[78912,78919,7],[78920,78933,1],[92912,92916,1],[92976,92982,1],[94031,94095,64],[94096,94098,1],[94180,113821,19641],[113822,118528,4706],[118529,118573,1],[118576,118598,1],[119143,119145,1],[119163,119170,1],[119173,119179,1],[119210,119213,1],[119362,119364,1],[121344,121398,1],[121403,121452,1],[121461,121476,15],[121499,121503,1],[121505,121519,1],[122880,122886,1],[122888,122904,1],[122907,122913,1],[122915,122916,1],[122918,122922,1],[123023,123184,161],[123185,123190,1],[123566,123628,62],[123629,123631,1],[124140,124143,1],[125136,125142,1],[125252,125258,1],[917760,917999,1]]),f(Ph,"foldMn",[[921,953,32],[8126,8126,1]]),f(Ph,"N",[[48,57,1],[178,179,1],[185,188,3],[189,190,1],[1632,1641,1],[1776,1785,1],[1984,1993,1],[2406,2415,1],[2534,2543,1],[2548,2553,1],[2662,2671,1],[2790,2799,1],[2918,2927,1],[2930,2935,1],[3046,3058,1],[3174,3183,1],[3192,3198,1],[3302,3311,1],[3416,3422,1],[3430,3448,1],[3558,3567,1],[3664,3673,1],[3792,3801,1],[3872,3891,1],[4160,4169,1],[4240,4249,1],[4969,4988,1],[5870,5872,1],[6112,6121,1],[6128,6137,1],[6160,6169,1],[6470,6479,1],[6608,6618,1],[6784,6793,1],[6800,6809,1],[6992,7001,1],[7088,7097,1],[7232,7241,1],[7248,7257,1],[8304,8308,4],[8309,8313,1],[8320,8329,1],[8528,8578,1],[8581,8585,1],[9312,9371,1],[9450,9471,1],[10102,10131,1],[11517,12295,778],[12321,12329,1],[12344,12346,1],[12690,12693,1],[12832,12841,1],[12872,12879,1],[12881,12895,1],[12928,12937,1],[12977,12991,1],[42528,42537,1],[42726,42735,1],[43056,43061,1],[43216,43225,1],[43264,43273,1],[43472,43481,1],[43504,43513,1],[43600,43609,1],[44016,44025,1],[65296,65305,1],[65799,65843,1],[65856,65912,1],[65930,65931,1],[66273,66299,1],[66336,66339,1],[66369,66378,9],[66513,66517,1],[66720,66729,1],[67672,67679,1],[67705,67711,1],[67751,67759,1],[67835,67839,1],[67862,67867,1],[68028,68029,1],[68032,68047,1],[68050,68095,1],[68160,68168,1],[68221,68222,1],[68253,68255,1],[68331,68335,1],[68440,68447,1],[68472,68479,1],[68521,68527,1],[68858,68863,1],[68912,68921,1],[69216,69246,1],[69405,69414,1],[69457,69460,1],[69573,69579,1],[69714,69743,1],[69872,69881,1],[69942,69951,1],[70096,70105,1],[70113,70132,1],[70384,70393,1],[70736,70745,1],[70864,70873,1],[71248,71257,1],[71360,71369,1],[71472,71483,1],[71904,71922,1],[72016,72025,1],[72784,72812,1],[73040,73049,1],[73120,73129,1],[73552,73561,1],[73664,73684,1],[74752,74862,1],[92768,92777,1],[92864,92873,1],[93008,93017,1],[93019,93025,1],[93824,93846,1],[119488,119507,1],[119520,119539,1],[119648,119672,1],[120782,120831,1],[123200,123209,1],[123632,123641,1],[124144,124153,1],[125127,125135,1],[125264,125273,1],[126065,126123,1],[126125,126127,1],[126129,126132,1],[126209,126253,1],[126255,126269,1],[127232,127244,1],[130032,130041,1]]),f(Ph,"Nd",[[48,57,1],[1632,1641,1],[1776,1785,1],[1984,1993,1],[2406,2415,1],[2534,2543,1],[2662,2671,1],[2790,2799,1],[2918,2927,1],[3046,3055,1],[3174,3183,1],[3302,3311,1],[3430,3439,1],[3558,3567,1],[3664,3673,1],[3792,3801,1],[3872,3881,1],[4160,4169,1],[4240,4249,1],[6112,6121,1],[6160,6169,1],[6470,6479,1],[6608,6617,1],[6784,6793,1],[6800,6809,1],[6992,7001,1],[7088,7097,1],[7232,7241,1],[7248,7257,1],[42528,42537,1],[43216,43225,1],[43264,43273,1],[43472,43481,1],[43504,43513,1],[43600,43609,1],[44016,44025,1],[65296,65305,1],[66720,66729,1],[68912,68921,1],[69734,69743,1],[69872,69881,1],[69942,69951,1],[70096,70105,1],[70384,70393,1],[70736,70745,1],[70864,70873,1],[71248,71257,1],[71360,71369,1],[71472,71481,1],[71904,71913,1],[72016,72025,1],[72784,72793,1],[73040,73049,1],[73120,73129,1],[73552,73561,1],[92768,92777,1],[92864,92873,1],[93008,93017,1],[120782,120831,1],[123200,123209,1],[123632,123641,1],[124144,124153,1],[125264,125273,1],[130032,130041,1]]),f(Ph,"Nl",[[5870,5872,1],[8544,8578,1],[8581,8584,1],[12295,12321,26],[12322,12329,1],[12344,12346,1],[42726,42735,1],[65856,65908,1],[66369,66378,9],[66513,66517,1],[74752,74862,1]]),f(Ph,"No",[[178,179,1],[185,188,3],[189,190,1],[2548,2553,1],[2930,2935,1],[3056,3058,1],[3192,3198,1],[3416,3422,1],[3440,3448,1],[3882,3891,1],[4969,4988,1],[6128,6137,1],[6618,8304,1686],[8308,8313,1],[8320,8329,1],[8528,8543,1],[8585,9312,727],[9313,9371,1],[9450,9471,1],[10102,10131,1],[11517,12690,1173],[12691,12693,1],[12832,12841,1],[12872,12879,1],[12881,12895,1],[12928,12937,1],[12977,12991,1],[43056,43061,1],[65799,65843,1],[65909,65912,1],[65930,65931,1],[66273,66299,1],[66336,66339,1],[67672,67679,1],[67705,67711,1],[67751,67759,1],[67835,67839,1],[67862,67867,1],[68028,68029,1],[68032,68047,1],[68050,68095,1],[68160,68168,1],[68221,68222,1],[68253,68255,1],[68331,68335,1],[68440,68447,1],[68472,68479,1],[68521,68527,1],[68858,68863,1],[69216,69246,1],[69405,69414,1],[69457,69460,1],[69573,69579,1],[69714,69733,1],[70113,70132,1],[71482,71483,1],[71914,71922,1],[72794,72812,1],[73664,73684,1],[93019,93025,1],[93824,93846,1],[119488,119507,1],[119520,119539,1],[119648,119672,1],[125127,125135,1],[126065,126123,1],[126125,126127,1],[126129,126132,1],[126209,126253,1],[126255,126269,1],[127232,127244,1]]),f(Ph,"P",[[33,35,1],[37,42,1],[44,47,1],[58,59,1],[63,64,1],[91,93,1],[95,123,28],[125,161,36],[167,171,4],[182,183,1],[187,191,4],[894,903,9],[1370,1375,1],[1417,1418,1],[1470,1472,2],[1475,1478,3],[1523,1524,1],[1545,1546,1],[1548,1549,1],[1563,1565,2],[1566,1567,1],[1642,1645,1],[1748,1792,44],[1793,1805,1],[2039,2041,1],[2096,2110,1],[2142,2404,262],[2405,2416,11],[2557,2678,121],[2800,3191,391],[3204,3572,3
268],[3663,3674,11],[3675,3844,169],[3845,3858,1],[3860,3898,38],[3899,3901,1],[3973,4048,75],[4049,4052,1],[4057,4058,1],[4170,4175,1],[4347,4960,613],[4961,4968,1],[5120,5742,622],[5787,5788,1],[5867,5869,1],[5941,5942,1],[6100,6102,1],[6104,6106,1],[6144,6154,1],[6468,6469,1],[6686,6687,1],[6816,6822,1],[6824,6829,1],[7002,7008,1],[7037,7038,1],[7164,7167,1],[7227,7231,1],[7294,7295,1],[7360,7367,1],[7379,8208,829],[8209,8231,1],[8240,8259,1],[8261,8273,1],[8275,8286,1],[8317,8318,1],[8333,8334,1],[8968,8971,1],[9001,9002,1],[10088,10101,1],[10181,10182,1],[10214,10223,1],[10627,10648,1],[10712,10715,1],[10748,10749,1],[11513,11516,1],[11518,11519,1],[11632,11776,144],[11777,11822,1],[11824,11855,1],[11858,11869,1],[12289,12291,1],[12296,12305,1],[12308,12319,1],[12336,12349,13],[12448,12539,91],[42238,42239,1],[42509,42511,1],[42611,42622,11],[42738,42743,1],[43124,43127,1],[43214,43215,1],[43256,43258,1],[43260,43310,50],[43311,43359,48],[43457,43469,1],[43486,43487,1],[43612,43615,1],[43742,43743,1],[43760,43761,1],[44011,64830,20819],[64831,65040,209],[65041,65049,1],[65072,65106,1],[65108,65121,1],[65123,65128,5],[65130,65131,1],[65281,65283,1],[65285,65290,1],[65292,65295,1],[65306,65307,1],[65311,65312,1],[65339,65341,1],[65343,65371,28],[65373,65375,2],[65376,65381,1],[65792,65794,1],[66463,66512,49],[66927,67671,744],[67871,67903,32],[68176,68184,1],[68223,68336,113],[68337,68342,1],[68409,68415,1],[68505,68508,1],[69293,69461,168],[69462,69465,1],[69510,69513,1],[69703,69709,1],[69819,69820,1],[69822,69825,1],[69952,69955,1],[70004,70005,1],[70085,70088,1],[70093,70107,14],[70109,70111,1],[70200,70205,1],[70313,70731,418],[70732,70735,1],[70746,70747,1],[70749,70854,105],[71105,71127,1],[71233,71235,1],[71264,71276,1],[71353,71484,131],[71485,71486,1],[71739,72004,265],[72005,72006,1],[72162,72255,93],[72256,72262,1],[72346,72348,1],[72350,72354,1],[72448,72457,1],[72769,72773,1],[72816,72817,1],[73463,73464,1],[73539,73551,1],[73727,74864,1137],[74865,74868,1],[77809,77810,1],[92782,92783,1],[92917,92983,66],[92984,92987,1],[92996,93847,851],[93848,93850,1],[94178,113823,19645],[121479,121483,1],[125278,125279,1]]),f(Ph,"Pc",[[95,8255,8160],[8256,8276,20],[65075,65076,1],[65101,65103,1],[65343,65343,1]]),f(Ph,"Pd",[[45,1418,1373],[1470,5120,3650],[6150,8208,2058],[8209,8213,1],[11799,11802,3],[11834,11835,1],[11840,11869,29],[12316,12336,20],[12448,65073,52625],[65074,65112,38],[65123,65293,170],[69293,69293,1]]),f(Ph,"Pe",[[41,93,52],[125,3899,3774],[3901,5788,1887],[8262,8318,56],[8334,8969,635],[8971,9002,31],[10089,10101,2],[10182,10215,33],[10217,10223,2],[10628,10648,2],[10713,10715,2],[10749,11811,1062],[11813,11817,2],[11862,11868,2],[12297,12305,2],[12309,12315,2],[12318,12319,1],[64830,65048,218],[65078,65092,2],[65096,65114,18],[65116,65118,2],[65289,65341,52],[65373,65379,3]]),f(Ph,"Pf",[[187,8217,8030],[8221,8250,29],[11779,11781,2],[11786,11789,3],[11805,11809,4]]),f(Ph,"Pi",[[171,8216,8045],[8219,8220,1],[8223,8249,26],[11778,11780,2],[11785,11788,3],[11804,11808,4]]),f(Ph,"Po",[[33,35,1],[37,39,1],[42,46,2],[47,58,11],[59,63,4],[64,92,28],[161,167,6],[182,183,1],[191,894,703],[903,1370,467],[1371,1375,1],[1417,1472,55],[1475,1478,3],[1523,1524,1],[1545,1546,1],[1548,1549,1],[1563,1565,2],[1566,1567,1],[1642,1645,1],[1748,1792,44],[1793,1805,1],[2039,2041,1],[2096,2110,1],[2142,2404,262],[2405,2416,11],[2557,2678,121],[2800,3191,391],[3204,3572,368],[3663,3674,11],[3675,3844,169],[3845,3858,1],[3860,3973,113],[4048,4052,1],[4057,4058,1],[4170,4175,1],[4347,4960,613],[4961,4968,1],[5742,5867,125],[5868,5869,1],[5941,5942,1],[6100,6102,1],[6104,6106,1],[6144,6149,1],[6151,6154,1],[6468,6469,1],[6686,6687,1],[6816,6822,1],[6824,6829,1],[7002,7008,1],[7037,7038,1],[7164,7167,1],[7227,7231,1],[7294,7295,1],[7360,7367,1],[7379,8214,835],[8215,8224,9],[8225,8231,1],[8240,8248,1],[8251,8254,1],[8257,8259,1],[8263,8273,1],[8275,8277,2],[8278,8286,1],[11513,11516,1],[11518,11519,1],[11632,11776,144],[11777,11782,5],[11783,11784,1],[11787,11790,3],[11791,11798,1],[11800,11801,1],[11803,11806,3],[11807,11818,11],[11819,11822,1],[11824,11833,1],[11836,11839,1],[11841,11843,2],[11844,11855,1],[11858,11860,1],[12289,12291,1],[12349,12539,190],[42238,42239,1],[42509,42511,1],[42611,42622,11],[42738,42743,1],[43124,43127,1],[43214,43215,1],[43256,43258,1],[43260,43310,50],[43311,43359,48],[43457,43469,1],[43486,43487,1],[43612,43615,1],[43742,43743,1],[43760,43761,1],[44011,65040,21029],[65041,65046,1],[65049,65072,23],[65093,65094,1],[65097,65100,1],[65104,65106,1],[65108,65111,1],[65119,65121,1],[65128,65130,2],[65131,65281,150],[65282,65283,1],[65285,65287,1],[65290,65294,2],[65295,65306,11],[65307,65311,4],[65312,65340,28],[65377,65380,3],[65381,65792,411],[65793,65794,1],[66463,66512,49],[66927,67671,744],[67871,67903,32],[68176,68184,1],[68223,68336,113],[68337,
268342,1],[68409,68415,1],[68505,68508,1],[69461,69465,1],[69510,69513,1],[69703,69709,1],[69819,69820,1],[69822,69825,1],[69952,69955,1],[70004,70005,1],[70085,70088,1],[70093,70107,14],[70109,70111,1],[70200,70205,1],[70313,70731,418],[70732,70735,1],[70746,70747,1],[70749,70854,105],[71105,71127,1],[71233,71235,1],[71264,71276,1],[71353,71484,131],[71485,71486,1],[71739,72004,265],[72005,72006,1],[72162,72255,93],[72256,72262,1],[72346,72348,1],[72350,72354,1],[72448,72457,1],[72769,72773,1],[72816,72817,1],[73463,73464,1],[73539,73551,1],[73727,74864,1137],[74865,74868,1],[77809,77810,1],[92782,92783,1],[92917,92983,66],[92984,92987,1],[92996,93847,851],[93848,93850,1],[94178,113823,19645],[121479,121483,1],[125278,125279,1]]),f(Ph,"Ps",[[40,91,51],[123,3898,3775],[3900,5787,1887],[8218,8222,4],[8261,8317,56],[8333,8968,635],[8970,9001,31],[10088,10100,2],[10181,10214,33],[10216,10222,2],[10627,10647,2],[10712,10714,2],[10748,11810,1062],[11812,11816,2],[11842,11861,19],[11863,11867,2],[12296,12304,2],[12308,12314,2],[12317,64831,52514],[65047,65077,30],[65079,65091,2],[65095,65113,18],[65115,65117,2],[65288,65339,51],[65371,65375,4],[65378,65378,1]]),f(Ph,"S",[[36,43,7],[60,62,1],[94,96,2],[124,126,2],[162,166,1],[168,169,1],[172,174,2],[175,177,1],[180,184,4],[215,247,32],[706,709,1],[722,735,1],[741,747,1],[749,751,2],[752,767,1],[885,900,15],[901,1014,113],[1154,1421,267],[1422,1423,1],[1542,1544,1],[1547,1550,3],[1551,1758,207],[1769,1789,20],[1790,2038,248],[2046,2047,1],[2184,2546,362],[2547,2554,7],[2555,2801,246],[2928,3059,131],[3060,3066,1],[3199,3407,208],[3449,3647,198],[3841,3843,1],[3859,3861,2],[3862,3863,1],[3866,3871,1],[3892,3896,2],[4030,4037,1],[4039,4044,1],[4046,4047,1],[4053,4056,1],[4254,4255,1],[5008,5017,1],[5741,6107,366],[6464,6622,158],[6623,6655,1],[7009,7018,1],[7028,7036,1],[8125,8127,2],[8128,8129,1],[8141,8143,1],[8157,8159,1],[8173,8175,1],[8189,8190,1],[8260,8274,14],[8314,8316,1],[8330,8332,1],[8352,8384,1],[8448,8449,1],[8451,8454,1],[8456,8457,1],[8468,8470,2],[8471,8472,1],[8478,8483,1],[8485,8489,2],[8494,8506,12],[8507,8512,5],[8513,8516,1],[8522,8525,1],[8527,8586,59],[8587,8592,5],[8593,8967,1],[8972,9e3,1],[9003,9254,1],[9280,9290,1],[9372,9449,1],[9472,10087,1],[10132,10180,1],[10183,10213,1],[10224,10626,1],[10649,10711,1],[10716,10747,1],[10750,11123,1],[11126,11157,1],[11159,11263,1],[11493,11498,1],[11856,11857,1],[11904,11929,1],[11931,12019,1],[12032,12245,1],[12272,12287,1],[12292,12306,14],[12307,12320,13],[12342,12343,1],[12350,12351,1],[12443,12444,1],[12688,12689,1],[12694,12703,1],[12736,12771,1],[12783,12800,17],[12801,12830,1],[12842,12871,1],[12880,12896,16],[12897,12927,1],[12938,12976,1],[12992,13311,1],[19904,19967,1],[42128,42182,1],[42752,42774,1],[42784,42785,1],[42889,42890,1],[43048,43051,1],[43062,43065,1],[43639,43641,1],[43867,43882,15],[43883,64297,20414],[64434,64450,1],[64832,64847,1],[64975,65020,45],[65021,65023,1],[65122,65124,2],[65125,65126,1],[65129,65284,155],[65291,65308,17],[65309,65310,1],[65342,65344,2],[65372,65374,2],[65504,65510,1],[65512,65518,1],[65532,65533,1],[65847,65855,1],[65913,65929,1],[65932,65934,1],[65936,65948,1],[65952,66e3,48],[66001,66044,1],[67703,67704,1],[68296,71487,3191],[73685,73713,1],[92988,92991,1],[92997,113820,20823],[118608,118723,1],[118784,119029,1],[119040,119078,1],[119081,119140,1],[119146,119148,1],[119171,119172,1],[119180,119209,1],[119214,119274,1],[119296,119361,1],[119365,119552,187],[119553,119638,1],[120513,120539,26],[120571,120597,26],[120629,120655,26],[120687,120713,26],[120745,120771,26],[120832,121343,1],[121399,121402,1],[121453,121460,1],[121462,121475,1],[121477,121478,1],[123215,123647,432],[126124,126128,4],[126254,126704,450],[126705,126976,271],[126977,127019,1],[127024,127123,1],[127136,127150,1],[127153,127167,1],[127169,127183,1],[127185,127221,1],[127245,127405,1],[127462,127490,1],[127504,127547,1],[127552,127560,1],[127568,127569,1],[127584,127589,1],[127744,128727,1],[128732,128748,1],[128752,128764,1],[128768,128886,1],[128891,128985,1],[128992,129003,1],[129008,129024,16],[129025,129035,1],[129040,129
2095,1],[129104,129113,1],[129120,129159,1],[129168,129197,1],[129200,129201,1],[129280,129619,1],[129632,129645,1],[129648,129660,1],[129664,129672,1],[129680,129725,1],[129727,129733,1],[129742,129755,1],[129760,129768,1],[129776,129784,1],[129792,129938,1],[129940,129994,1]]),f(Ph,"Sc",[[36,162,126],[163,165,1],[1423,1547,124],[2046,2047,1],[2546,2547,1],[2555,2801,246],[3065,3647,582],[6107,8352,2245],[8353,8384,1],[43064,65020,21956],[65129,65284,155],[65504,65505,1],[65509,65510,1],[73693,73696,1],[123647,126128,2481]]),f(Ph,"Sk",[[94,96,2],[168,175,7],[180,184,4],[706,709,1],[722,735,1],[741,747,1],[749,751,2],[752,767,1],[885,900,15],[901,2184,1283],[8125,8127,2],[8128,8129,1],[8141,8143,1],[8157,8159,1],[8173,8175,1],[8189,8190,1],[12443,12444,1],[42752,42774,1],[42784,42785,1],[42889,42890,1],[43867,43882,15],[43883,64434,20551],[64435,64450,1],[65342,65344,2],[65507,127995,62488],[127996,127999,1]]),f(Ph,"Sm",[[43,60,17],[61,62,1],[124,126,2],[172,177,5],[215,247,32],[1014,1542,528],[1543,1544,1],[8260,8274,14],[8314,8316,1],[8330,8332,1],[8472,8512,40],[8513,8516,1],[8523,8592,69],[8593,8596,1],[8602,8603,1],[8608,8614,3],[8622,8654,32],[8655,8658,3],[8660,8692,32],[8693,8959,1],[8992,8993,1],[9084,9115,31],[9116,9139,1],[9180,9185,1],[9655,9665,10],[9720,9727,1],[9839,10176,337],[10177,10180,1],[10183,10213,1],[10224,10239,1],[10496,10626,1],[10649,10711,1],[10716,10747,1],[10750,11007,1],[11056,11076,1],[11079,11084,1],[64297,65122,825],[65124,65126,1],[65291,65308,17],[65309,65310,1],[65372,65374,2],[65506,65513,7],[65514,65516,1],[120513,120539,26],[120571,120597,26],[120629,120655,26],[120687,120713,26],[120745,120771,26],[126704,126705,1]]),f(Ph,"So",[[166,169,3],[174,176,2],[1154,1421,267],[1422,1550,128],[1551,1758,207],[1769,1789,20],[1790,2038,248],[2554,2928,374],[3059,3064,1],[3066,3199,133],[3407,3449,42],[3841,3843,1],[3859,3861,2],[3862,3863,1],[3866,3871,1],[3892,3896,2],[4030,4037,1],[4039,4044,1],[4046,4047,1],[4053,4056,1],[4254,4255,1],[5008,5017,1],[5741,6464,723],[6622,6655,1],[7009,7018,1],[7028,7036,1],[8448,8449,1],[8451,8454,1],[8456,8457,1],[8468,8470,2],[8471,8478,7],[8479,8483,1],[8485,8489,2],[8494,8506,12],[8507,8522,15],[8524,8525,1],[8527,8586,59],[8587,8597,10],[8598,8601,1],[8604,8607,1],[8609,8610,1],[8612,8613,1],[8615,8621,1],[8623,8653,1],[8656,8657,1],[8659,8661,2],[8662,8691,1],[8960,8967,1],[8972,8991,1],[8994,9e3,1],[9003,9083,1],[9085,9114,1],[9140,9179,1],[9186,9254,1],[9280,9290,1],[9372,9449,1],[9472,9654,1],[9656,9664,1],[9666,9719,1],[9728,9838,1],[9840,10087,1],[10132,10175,1],[10240,10495,1],[11008,11055,1],[11077,11078,1],[11085,11123,1],[11126,11157,1],[11159,11263,1],[11493,11498,1],[11856,11857,1],[11904,11929,1],[11931,12019,1],[12032,12245,1],[12272,12287,1],[12292,12306,14],[12307,12320,13],[12342,12343,1],[12350,12351,1],[12688,12689,1],[12694,12703,1],[12736,12771,1],[12783,12800,17],[12801,12830,1],[12842,12871,1],[12880,12896,16],[12897,12927,1],[12938,12976,1],[12992,13311,1],[19904,19967,1],[42128,42182,1],[43048,43051,1],[43062,43063,1],[43065,43639,574],[43640,43641,1],[64832,64847,1],[64975,65021,46],[65022,65023,1],[65508,65512,4],[65517,65518,1],[65532,65533,1],[65847,65855,1],[65913,65929,1],[65932,65934,1],[65936,65948,1],[65952,66e3,48],[66001,66044,1],[67703,67704,1],[68296,71487,3191],[73685,73692,1],[73697,73713,1],[92988,92991,1],[92997,113820,20823],[118608,118723,1],[118784,119029,1],[119040,119078,1],[119081,119140,1],[119146,119148,1],[119171,119172,1],[119180,119209,1],[119214,119274,1],[119296,119361,1],[119365,119552,187],[119553,119638,1],[120832,121343,1],[121399,121402,1],[121453,121460,1],[121462,121475,1],[121477,121478,1],[123215,126124,2909],[126254,126976,722],[126977,127019,1],[127024,127123,1],[127136,127150,1],[127153,127167,1],[127169,127183,1],[127185,127221,1],[127245,127405,1],[127462,127490,1],[127504,127547,1],[127552,127560,1],[127568,127569,1],[127584,127589,1],[127744,127994,1],[128e3,128727,1],[128732,128748,1],[128752,128764,1],[128768,128886,1],[128891,128985,1],[128992,129003,1],[129008,129024,16],[129025,129035,1],[129040,129
2095,1],[129104,129113,1],[129120,129159,1],[129168,129197,1],[129200,129201,1],[129280,129619,1],[129632,129645,1],[129648,129660,1],[129664,129672,1],[129680,129725,1],[129727,129733,1],[129742,129755,1],[129760,129768,1],[129776,129784,1],[129792,129938,1],[129940,129994,1]]),f(Ph,"Z",[[32,160,128],[5760,8192,2432],[8193,8202,1],[8232,8233,1],[8239,8287,48],[12288,12288,1]]),f(Ph,"Zl",[[8232,8232,1]]),f(Ph,"Zp",[[8233,8233,1]]),f(Ph,"Zs",[[32,160,128],[5760,8192,2432],[8193,8202,1],[8239,8287,48],[12288,12288,1]]),f(Ph,"Adlam",[[125184,125259,1],[125264,125273,1],[125278,125279,1]]),f(Ph,"Ahom",[[71424,71450,1],[71453,71467,1],[71472,71494,1]]),f(Ph,"Anatolian_Hieroglyphs",[[82944,83526,1]]),f(Ph,"Arabic",[[1536,1540,1],[1542,1547,1],[1549,1562,1],[1564,1566,1],[1568,1599,1],[1601,1610,1],[1622,1647,1],[1649,1756,1],[1758,1791,1],[1872,1919,1],[2160,2190,1],[2192,2193,1],[2200,2273,1],[2275,2303,1],[64336,64450,1],[64467,64829,1],[64832,64911,1],[64914,64967,1],[64975,65008,33],[65009,65023,1],[65136,65140,1],[65142,65276,1],[69216,69246,1],[69373,69375,1],[126464,126467,1],[126469,126495,1],[126497,126498,1],[126500,126503,3],[126505,126514,1],[126516,126519,1],[126521,126523,2],[126530,126535,5],[126537,126541,2],[126542,126543,1],[126545,126546,1],[126548,126551,3],[126553,126561,2],[126562,126564,2],[126567,126570,1],[126572,126578,1],[126580,126583,1],[126585,126588,1],[126590,126592,2],[126593,126601,1],[126603,126619,1],[126625,126627,1],[126629,126633,1],[126635,126651,1],[126704,126705,1]]),f(Ph,"Armenian",[[1329,1366,1],[1369,1418,1],[1421,1423,1],[64275,64279,1]]),f(Ph,"Avestan",[[68352,68405,1],[68409,68415,1]]),f(Ph,"Balinese",[[6912,6988,1],[6992,7038,1]]),f(Ph,"Bamum",[[42656,42743,1],[92160,92728,1]]),f(Ph,"Bassa_Vah",[[92880,92909,1],[92912,92917,1]]),f(Ph,"Batak",[[7104,7155,1],[7164,7167,1]]),f(Ph,"Bengali",[[2432,2435,1],[2437,2444,1],[2447,2448,1],[2451,2472,1],[2474,2480,1],[2482,2486,4],[2487,2489,1],[2492,2500,1],[2503,2504,1],[2507,2510,1],[2519,2524,5],[2525,2527,2],[2528,2531,1],[2534,2558,1]]),f(Ph,"Bhaiksuki",[[72704,72712,1],[72714,72758,1],[72760,72773,1],[72784,72812,1]]),f(Ph,"Bopomofo",[[746,747,1],[12549,12591,1],[12704,12735,1]]),f(Ph,"Brahmi",[[69632,69709,1],[69714,69749,1],[69759,69759,1]]),f(Ph,"Braille",[[10240,10495,1]]),f(Ph,"Buginese",[[6656,6683,1],[6686,6687,1]]),f(Ph,"Buhid",[[5952,5971,1]]),f(Ph,"Canadian_Aboriginal",[[5120,5759,1],[6320,6389,1],[72368,72383,1]]),f(Ph,"Carian",[[66208,66256,1]]),f(Ph,"Caucasian_Albanian",[[66864,66915,1],[66927,66927,1]]),f(Ph,"Chakma",[[69888,69940,1],[69942,69959,1]]),f(Ph,"Cham",[[43520,43574,1],[43584,43597,1],[43600,43609,1],[43612,43615,1]]),f(Ph,"Cherokee",[[5024,5109,1],[5112,5117,1],[43888,43967,1]]),f(Ph,"Chorasmian",[[69552,69579,1]]),f(Ph,"Common",[[0,64,1],[91,96,1],[123,169,1],[171,185,1],[187,191,1],[215,247,32],[697,735,1],[741,745,1],[748,767,1],[884,894,10],[901,903,2],[1541,1548,7],[1563,1567,4],[1600,1757,157],[2274,2404,130],[2405,3647,1242],[4053,4056,1],[4347,5867,1520],[5868,5869,1],[5941,5942,1],[6146,6147,1],[6149,7379,1230],[7393,7401,8],[7402,7404,1],[7406,7411,1],[7413,7415,1],[7418,8192,774],[8193,8203,1],[8206,8292,1],[8294,8304,1],[8308,8318,1],[8320,8334,1],[8352,8384,1],[8448,8485,1],[8487,8489,1],[8492,8497,1],[8499,8525,1],[8527,8543,1],[8585,8587,1],[8592,9254,1],[9280,9290,1],[9312,10239,1],[10496,11123,1],[11126,11157,1],[11159,11263,1],[11776,11869,1],[12272,12292,1],[12294,12296,2],[12297,12320,1],[12336,12343,1],[12348,12351,1],[12443,12444,1],[12448,12539,91],[12540,12688,148],[12689,12703,1],[12736,12771,1],[12783,12832,49],[12833,12895,1],[12927,13007,1],[13055,13144,89],[13145,13311,1],[19904,19967,1],[42752,42785,1],[42888,42890,1],[43056,43065,1],[43310,43471,161],[43867,43882,15],[43883,64830,20947],[64831,65040,209],[65041,65049,1],[65072,65106,1],[65108,65126,1],[65128,65131,1],[65279,65281,2],[65282,65312,1],[65339,65344,1],[65371,65381,1],[65392,65438,46],[65439,65504,65],[65505,65510,1],[65512,65518,1],[65529,65533,1],[65792,65794,1],[65799,65843,1],[65847,65855,1],[65936,65948,1],[66e3,66044,1],[66273,66299,1],[113824,113827,1],[118608,118723,1],[118784,119029,1],[119040,119078,1],[119081,119142,1],[119146,119162,1],[119171,119172,1],[119180,119209,1],[119214,119274,1],[119488,119507,1],[119520,119539,1],[119552,119638,1],[119648,119672,1],[119808,119892,1],[119894,119964,1],[119966,119967,1],[119970,
2119973,3],[119974,119977,3],[119978,119980,1],[119982,119993,1],[119995,119997,2],[119998,120003,1],[120005,120069,1],[120071,120074,1],[120077,120084,1],[120086,120092,1],[120094,120121,1],[120123,120126,1],[120128,120132,1],[120134,120138,4],[120139,120144,1],[120146,120485,1],[120488,120779,1],[120782,120831,1],[126065,126132,1],[126209,126269,1],[126976,127019,1],[127024,127123,1],[127136,127150,1],[127153,127167,1],[127169,127183,1],[127185,127221,1],[127232,127405,1],[127462,127487,1],[127489,127490,1],[127504,127547,1],[127552,127560,1],[127568,127569,1],[127584,127589,1],[127744,128727,1],[128732,128748,1],[128752,128764,1],[128768,128886,1],[128891,128985,1],[128992,129003,1],[129008,129024,16],[129025,129035,1],[129040,129095,1],[129104,129113,1],[129120,129159,1],[129168,129197,1],[129200,129201,1],[129280,129619,1],[129632,129645,1],[129648,129660,1],[129664,129672,1],[129680,129725,1],[129727,129733,1],[129742,129755,1],[129760,129768,1],[129776,129784,1],[129792,129938,1],[129940,129994,1],[130032,130041,1],[917505,917536,31],[917537,917631,1]]),f(Ph,"foldCommon",[[924,956,32]]),f(Ph,"Coptic",[[994,1007,1],[11392,11507,1],[11513,11519,1]]),f(Ph,"Cuneiform",[[73728,74649,1],[74752,74862,1],[74864,74868,1],[74880,75075,1]]),f(Ph,"Cypriot",[[67584,67589,1],[67592,67594,2],[67595,67637,1],[67639,67640,1],[67644,67647,3]]),f(Ph,"Cypro_Minoan",[[77712,77810,1]]),f(Ph,"Cyrillic",[[1024,1156,1],[1159,1327,1],[7296,7304,1],[7467,7544,77],[11744,11775,1],[42560,42655,1],[65070,65071,1],[122928,122989,1],[123023,123023,1]]),f(Ph,"Deseret",[[66560,66639,1]]),f(Ph,"Devanagari",[[2304,2384,1],[2389,2403,1],[2406,2431,1],[43232,43263,1],[72448,72457,1]]),f(Ph,"Dives_Akuru",[[71936,71942,1],[71945,71948,3],[71949,71955,1],[71957,71958,1],[71960,71989,1],[71991,71992,1],[71995,72006,1],[72016,72025,1]]),f(Ph,"Dogra",[[71680,71739,1]]),f(Ph,"Duployan",[[113664,113770,1],[113776,113788,1],[113792,113800,1],[113808,113817,1],[113820,113823,1]]),f(Ph,"Egyptian_Hieroglyphs",[[77824,78933,1]]),f(Ph,"Elbasan",[[66816,66855,1]]),f(Ph,"Elymaic",[[69600,69622,1]]),f(Ph,"Ethiopic",[[4608,4680,1],[4682,4685,1],[4688,4694,1],[4696,4698,2],[4699,4701,1],[4704,4744,1],[4746,4749,1],[4752,4784,1],[4786,4789,1],[4792,4798,1],[4800,4802,2],[4803,4805,1],[4808,4822,1],[4824,4880,1],[4882,4885,1],[4888,4954,1],[4957,4988,1],[4992,5017,1],[11648,11670,1],[11680,11686,1],[11688,11694,1],[11696,11702,1],[11704,11710,1],[11712,11718,1],[11720,11726,1],[11728,11734,1],[11736,11742,1],[43777,43782,1],[43785,43790,1],[43793,43798,1],[43808,43814,1],[43816,43822,1],[124896,124902,1],[124904,124907,1],[124909,124910,1],[124912,124926,1]]),f(Ph,"Georgian",[[4256,4293,1],[4295,4301,6],[4304,4346,1],[4348,4351,1],[7312,7354,1],[7357,7359,1],[11520,11557,1],[11559,11565,6]]),f(Ph,"Glagolitic",[[11264,11359,1],[122880,122886,1],[122888,122904,1],[122907,122913,1],[122915,122916,1],[122918,122922,1]]),f(Ph,"Gothic",[[66352,66378,1]]),f(Ph,"Grantha",[[70400,70403,1],[70405,70412,1],[70415,70416,1],[70419,70440,1],[70442,70448,1],[70450,70451,1],[70453,70457,1],[70460,70468,1],[70471,70472,1],[70475,70477,1],[70480,70487,7],[70493,70499,1],[70502,70508,1],[70512,70516,1]]),f(Ph,"Greek",[[880,883,1],[885,887,1],[890,893,1],[895,900,5],[902,904,2],[905,906,1],[908,910,2],[911,929,1],[931,993,1],[1008,1023,1],[7462,7466,1],[7517,7521,1],[7526,7530,1],[7615,7936,321],[7937,7957,1],[7960,7965,1],[7968,8005,1],[8008,8013,1],[8016,8023,1],[8025,8031,2],[8032,8061,1],[8064,8116,1],[8118,8132,1],[8134,8147,1],[8150,8155,1],[8157,8175,1],[8178,8180,1],[8182,8190,1],[8486,43877,35391],[65856,65934,1],[65952,119296,53344],[119297,119365,1]]),f(Ph,"foldGreek",[[181,837,656]]),f(Ph,"Gujarati",[[2689,2691,1],[2693,2701,1],[2703,2705,1],[2707,2728,1],[2730,2736,1],[2738,2739,1],[2741,2745,1],[2748,2757,1],[2759,2761,1],[2763,2765,1],[2768,2784,16],[2785,2787,1],[2790,2801,1],[2809,2815,1]]),f(Ph,"Gunjala_Gondi",[[73056,73061,1],[73063,73064,1],[73066,73102,1],[73104,73105,1],[73107,73112,1],[73120,73129,1]]),f(Ph,"Gurmukhi",[[2561,2563,1],[2565,2570,1],[2575,2576,1],[2579,2600,1],[2602,2608,1],[2610,2611,1],[2613,2614,1],[2616,2617,1],[2620,2622,2],[2623,2626,1],[2631,2632,1],[2635,2637,1],[2641,2649,8],[2650,2652,1],[2654,2662,8],[2663,2678,1]]),f(Ph,"Han",[[11904,11929,1],[11931,12019,1],[12032,12245,1],[12293,12295,2],[12321,12329,1],[12344,12347,1],[13312,19903,1],[19968,40959,1],[63744,64109,1],[64112,64217,1],[94178,94179,1],[94192,94193,1],[131072,173791,1],[173824,177977,1],[177984,178205,1],[178208,183969,1],[183984,191456,1],[191472,192093,1],[194560,195101,1],[196608,201546,1],[201552,205743,1]]),f(Ph,"Hangul",[[4352,4607,1],[12334,12335,1],[12593,12
2686,1],[12800,12830,1],[12896,12926,1],[43360,43388,1],[44032,55203,1],[55216,55238,1],[55243,55291,1],[65440,65470,1],[65474,65479,1],[65482,65487,1],[65490,65495,1],[65498,65500,1]]),f(Ph,"Hanifi_Rohingya",[[68864,68903,1],[68912,68921,1]]),f(Ph,"Hanunoo",[[5920,5940,1]]),f(Ph,"Hatran",[[67808,67826,1],[67828,67829,1],[67835,67839,1]]),f(Ph,"Hebrew",[[1425,1479,1],[1488,1514,1],[1519,1524,1],[64285,64310,1],[64312,64316,1],[64318,64320,2],[64321,64323,2],[64324,64326,2],[64327,64335,1]]),f(Ph,"Hiragana",[[12353,12438,1],[12445,12447,1],[110593,110879,1],[110898,110928,30],[110929,110930,1],[127488,127488,1]]),f(Ph,"Imperial_Aramaic",[[67648,67669,1],[67671,67679,1]]),f(Ph,"Inherited",[[768,879,1],[1157,1158,1],[1611,1621,1],[1648,2385,737],[2386,2388,1],[6832,6862,1],[7376,7378,1],[7380,7392,1],[7394,7400,1],[7405,7412,7],[7416,7417,1],[7616,7679,1],[8204,8205,1],[8400,8432,1],[12330,12333,1],[12441,12442,1],[65024,65039,1],[65056,65069,1],[66045,66272,227],[70459,118528,48069],[118529,118573,1],[118576,118598,1],[119143,119145,1],[119163,119170,1],[119173,119179,1],[119210,119213,1],[917760,917999,1]]),f(Ph,"foldInherited",[[921,953,32],[8126,8126,1]]),f(Ph,"Inscriptional_Pahlavi",[[68448,68466,1],[68472,68479,1]]),f(Ph,"Inscriptional_Parthian",[[68416,68437,1],[68440,68447,1]]),f(Ph,"Javanese",[[43392,43469,1],[43472,43481,1],[43486,43487,1]]),f(Ph,"Kaithi",[[69760,69826,1],[69837,69837,1]]),f(Ph,"Kannada",[[3200,3212,1],[3214,3216,1],[3218,3240,1],[3242,3251,1],[3253,3257,1],[3260,3268,1],[3270,3272,1],[3274,3277,1],[3285,3286,1],[3293,3294,1],[3296,3299,1],[3302,3311,1],[3313,3315,1]]),f(Ph,"Katakana",[[12449,12538,1],[12541,12543,1],[12784,12799,1],[13008,13054,1],[13056,13143,1],[65382,65391,1],[65393,65437,1],[110576,110579,1],[110581,110587,1],[110589,110590,1],[110592,110880,288],[110881,110882,1],[110933,110948,15],[110949,110951,1]]),f(Ph,"Kawi",[[73472,73488,1],[73490,73530,1],[73534,73561,1]]),f(Ph,"Kayah_Li",[[43264,43309,1],[43311,43311,1]]),f(Ph,"Kharoshthi",[[68096,68099,1],[68101,68102,1],[68108,68115,1],[68117,68119,1],[68121,68149,1],[68152,68154,1],[68159,68168,1],[68176,68184,1]]),f(Ph,"Khitan_Small_Script",[[94180,101120,6940],[101121,101589,1]]),f(Ph,"Khmer",[[6016,6109,1],[6112,6121,1],[6128,6137,1],[6624,6655,1]]),f(Ph,"Khojki",[[70144,70161,1],[70163,70209,1]]),f(Ph,"Khudawadi",[[70320,70378,1],[70384,70393,1]]),f(Ph,"Lao",[[3713,3714,1],[3716,3718,2],[3719,3722,1],[3724,3747,1],[3749,3751,2],[3752,3773,1],[3776,3780,1],[3782,3784,2],[3785,3790,1],[3792,3801,1],[3804,3807,1]]),f(Ph,"Latin",[[65,90,1],[97,122,1],[170,186,16],[192,214,1],[216,246,1],[248,696,1],[736,740,1],[7424,7461,1],[7468,7516,1],[7522,7525,1],[7531,7543,1],[7545,7614,1],[7680,7935,1],[8305,8319,14],[8336,8348,1],[8490,8491,1],[8498,8526,28],[8544,8584,1],[11360,11391,1],[42786,42887,1],[42891,42954,1],[42960,42961,1],[42963,42965,2],[42966,42969,1],[42994,43007,1],[43824,43866,1],[43868,43876,1],[43878,43881,1],[64256,64262,1],[65313,65338,1],[65345,65370,1],[67456,67461,1],[67463,67504,1],[67506,67514,1],[122624,122654,1],[122661,122666,1]]),f(Ph,"Lepcha",[[7168,7223,1],[7227,7241,1],[7245,7247,1]]),f(Ph,"Limbu",[[6400,6430,1],[6432,6443,1],[6448,6459,1],[6464,6468,4],[6469,6479,1]]),f(Ph,"Linear_A",[[67072,67382,1],[67392,67413,1],[67424,67431,1]]),f(Ph,"Linear_B",[[65536,65547,1],[65549,65574,1],[65576,65594,1],[65596,65597,1],[65599,65613,1],[65616,65629,1],[65664,65786,1]]),f(Ph,"Lisu",[[42192,42239,1],[73648,73648,1]]),f(Ph,"Lycian",[[66176,66204,1]]),f(Ph,"Lydian",[[67872,67897,1],[67903,67903,1]]),f(Ph,"Mahajani",[[69968,70006,1]]),f(Ph,"Makasar",[[73440,73464,1]]),f(Ph,"Malayalam",[[3328,3340,1],[3342,3344,1],[3346,3396,1],[3398,3400,1],[3402,3407,1],[3412,3427,1],[3430,3455,1]]),f(Ph,"Mandaic",[[2112,2139,1],[2142,2142,1]]),f(Ph,"Manichaean",[[68288,68326,1],[68331,68342,1]]),f(Ph,"Marchen",[[72816,72847,1],[72850,72871,1],[72873,72886,1]]),f(Ph,"Masaram_Gondi",[[72960,72966,1],[72968,72969,1],[72971,73014,1],[73018,73020,2],[73021,73023,2],[73024,73031,1],[73040,73049,1]]),f(Ph,"Medefaidrin",[[93760,93850,1]]),f(Ph,"Meetei_Mayek",[[43744,43766,1],[43968,44013,1],[44016,44025,1]]),f(Ph,"Me
2nde_Kikakui",[[124928,125124,1],[125127,125142,1]]),f(Ph,"Meroitic_Cursive",[[68e3,68023,1],[68028,68047,1],[68050,68095,1]]),f(Ph,"Meroitic_Hieroglyphs",[[67968,67999,1]]),f(Ph,"Miao",[[93952,94026,1],[94031,94087,1],[94095,94111,1]]),f(Ph,"Modi",[[71168,71236,1],[71248,71257,1]]),f(Ph,"Mongolian",[[6144,6145,1],[6148,6150,2],[6151,6169,1],[6176,6264,1],[6272,6314,1],[71264,71276,1]]),f(Ph,"Mro",[[92736,92766,1],[92768,92777,1],[92782,92783,1]]),f(Ph,"Multani",[[70272,70278,1],[70280,70282,2],[70283,70285,1],[70287,70301,1],[70303,70313,1]]),f(Ph,"Myanmar",[[4096,4255,1],[43488,43518,1],[43616,43647,1]]),f(Ph,"Nabataean",[[67712,67742,1],[67751,67759,1]]),f(Ph,"Nag_Mundari",[[124112,124153,1]]),f(Ph,"Nandinagari",[[72096,72103,1],[72106,72151,1],[72154,72164,1]]),f(Ph,"New_Tai_Lue",[[6528,6571,1],[6576,6601,1],[6608,6618,1],[6622,6623,1]]),f(Ph,"Newa",[[70656,70747,1],[70749,70753,1]]),f(Ph,"Nko",[[1984,2042,1],[2045,2047,1]]),f(Ph,"Nushu",[[94177,110960,16783],[110961,111355,1]]),f(Ph,"Nyiakeng_Puachue_Hmong",[[123136,123180,1],[123184,123197,1],[123200,123209,1],[123214,123215,1]]),f(Ph,"Ogham",[[5760,5788,1]]),f(Ph,"Ol_Chiki",[[7248,7295,1]]),f(Ph,"Old_Hungarian",[[68736,68786,1],[68800,68850,1],[68858,68863,1]]),f(Ph,"Old_Italic",[[66304,66339,1],[66349,66351,1]]),f(Ph,"Old_North_Arabian",[[68224,68255,1]]),f(Ph,"Old_Permic",[[66384,66426,1]]),f(Ph,"Old_Persian",[[66464,66499,1],[66504,66517,1]]),f(Ph,"Old_Sogdian",[[69376,69415,1]]),f(Ph,"Old_South_Arabian",[[68192,68223,1]]),f(Ph,"Old_Turkic",[[68608,68680,1]]),f(Ph,"Old_Uyghur",[[69488,69513,1]]),f(Ph,"Oriya",[[2817,2819,1],[2821,2828,1],[2831,2832,1],[2835,2856,1],[2858,2864,1],[2866,2867,1],[2869,2873,1],[2876,2884,1],[2887,2888,1],[2891,2893,1],[2901,2903,1],[2908,2909,1],[2911,2915,1],[2918,2935,1]]),f(Ph,"Osage",[[66736,66771,1],[66776,66811,1]]),f(Ph,"Osmanya",[[66688,66717,1],[66720,66729,1]]),f(Ph,"Pahawh_Hmong",[[92928,92997,1],[93008,93017,1],[93019,93025,1],[93027,93047,1],[93053,93071,1]]),f(Ph,"Palmyrene",[[67680,67711,1]]),f(Ph,"Pau_Cin_Hau",[[72384,72440,1]]),f(Ph,"Phags_Pa",[[43072,43127,1]]),f(Ph,"Phoenician",[[67840,67867,1],[67871,67871,1]]),f(Ph,"Psalter_Pahlavi",[[68480,68497,1],[68505,68508,1],[68521,68527,1]]),f(Ph,"Rejang",[[43312,43347,1],[43359,43359,1]]),f(Ph,"Runic",[[5792,5866,1],[5870,5880,1]]),f(Ph,"Samaritan",[[2048,2093,1],[2096,2110,1]]),f(Ph,"Saurashtra",[[43136,43205,1],[43214,43225,1]]),f(Ph,"Sharada",[[70016,70111,1]]),f(Ph,"Shavian",[[66640,66687,1]]),f(Ph,"Siddham",[[71040,71093,1],[71096,71133,1]]),f(Ph,"SignWriting",[[120832,121483,1],[121499,121503,1],[121505,121519,1]]),f(Ph,"Sinhala",[[3457,3459,1],[3461,3478,1],[3482,3505,1],[3507,3515,1],[3517,3520,3],[3521,3526,1],[3530,3535,5],[3536,3540,1],[3542,3544,2],[3545,3551,1],[3558,3567,1],[3570,3572,1],[70113,70132,1]]),f(Ph,"Sogdian",[[69424,69465,1]]),f(Ph,"Sora_Sompeng",[[69840,69864,1],[69872,69881,1]]),f(Ph,"Soyombo",[[72272,72354,1]]),f(Ph,"Sundanese",[[7040,7103,1],[7360,7367,1]]),f(Ph,"Syloti_Nagri",[[43008,43052,1]]),f(Ph,"Syriac",[[1792,1805,1],[1807,1866,1],[1869,1871,1],[2144,2154,1]]),f(Ph,"Tagalog",[[5888,5909,1],[5919,5919,1]]),f(Ph,"Tagbanwa",[[5984,5996,1],[5998,6e3,1],[6002,6003,1]]),f(Ph,"Tai_Le",[[6480,6509,1],[6512,6516,1]]),f(Ph,"Tai_Tham",[[6688,6750,1],[6752,6780,1],[6783,6793,1],[6800,6809,1],[6816,6829,1]]),f(Ph,"Tai_Viet",[[43648,43714,1],[43739,43743,1]]),f(Ph,"Takri",[[71296,71353,1],[71360,71369,1]]),f(Ph,"Tamil",[[2946,2947,1],[2949,2954,1],[2958,2960,1],[2962,2965,1],[2969,2970,1],[2972,2974,2],[2975,2979,4],[2980,2984,4],[2985,2986,1],[2990,3001,1],[3006,3010,1],[3014,3016,1],[3018,3021,1],[3024,3031,7],[3046,3066,1],[73664,73713,1],[73727,73727,1]]),f(Ph,"Tangsa",[[92784,92862,1],[92864,92873,1]]),f(Ph,"Tangut",[[94176,94208,32],[94209,100343,1],[100352,101119,1],[101632,101640,1]]),f(Ph,"Telugu",[[3072,3084,1],[3086,3088,1],[3090,3112,1],[3114,3129,1],[3132,3140,1],[3142,3144,1],[3146,3149,1],[3157,3158,1],[3160,3162,1],[3165,3168,3],[3169,3171,1],[3174,3183,1],[3191,3199,1]]),f(Ph,"Thaana",[[1920,1969,1]]),f(Ph,"Thai",[[3585,3642,1],[3648,3675,1]]),f(Ph,"Tibetan",[[3840,3911,1],[3913,3948,1],[3953,3991,1],[3993,4028,1],[4030,4044,1],[4046,4052,1],[4057,4058,1]]),f(Ph,"Tifinagh",[[11568,11623,1],[11631,11632,1],[11647,11647,1]]),f(Ph,"Tirhuta",[[70784,70855,1],[70864,70873,1]]),f(Ph,"Toto",[[123536,123566,1]]),f(Ph,"Ugaritic",[[66432,66461,1],[66463,66463,1]]),f(Ph,"Vai",[[42240,42539,1]]),f(Ph,"Vithkuqi",[[66928,66938,1],[66940,66954,1],[66956,66962,1],[66964,66965,1],[66967,66977,1],[66979,66993,1],[66995,67001,1],[67003,67004,1]]),f(Ph,"Wancho",[[123584,123641,1],[123647,123647,1]]),f(Ph,"Warang_Citi",[[71840,71922,1],[71935,71935,1]]),f(Ph,"Yezidi",[[69248,69289,1],[69291,69293,1],[69296,69297,1]]),f(Ph,"Yi",[[40960,42124,1],[42128,42182,1]]),f(Ph,"Zanabazar_Square",[[72192,72263,1]]),f(Ph,"CATEGORIES",new Map([["C",Ch.C],["Cc",Ch.Cc],["Cf",Ch.Cf],["Co",Ch.Co],["Cs",Ch.Cs],["L",Ch.L],["Ll",Ch.Ll],["Lm",Ch.Lm],["Lo",Ch.Lo],["Lt",Ch.Lt],["Lu",Ch.Lu],["M",Ch.M],["Mc",Ch.Mc],["Me",Ch.Me],["Mn",Ch.Mn],["N",Ch.N],["Nd",Ch.Nd],["Nl",Ch.Nl],["No",Ch.No],["P",Ch.P],["Pc",Ch.Pc],["Pd",Ch.Pd],["Pe",Ch.Pe],["Pf",Ch.Pf],["Pi",Ch.Pi],["Po",Ch.Po],["Ps",Ch.Ps],["S",Ch.S],["Sc",Ch.Sc],["Sk",Ch.Sk],["Sm",Ch.Sm],["So",Ch.So],["Z",Ch.Z],["Zl",Ch.Zl],["Zp",Ch.Zp],["Zs",Ch.Zs]])),f(Ph,"SCRIPTS",new Map([["Adlam",Ch.Adlam],["Ahom",Ch.Ahom],["Anatolian_Hieroglyphs",Ch.Anatolian_Hieroglyphs],["Arabic",Ch.Arabic],["Armenian",Ch.Armenian],["Avestan",Ch.Avestan],["Balinese",Ch.Balinese],["Bamum",Ch.Bamum],["Bassa_Vah",Ch.Bassa_Vah],["Batak",Ch.Batak],["Bengali",Ch.Bengali],["Bhaiksuki",Ch.Bhaiksuki],["Bopomofo",Ch.Bopomofo],["Brahmi",Ch.Brahmi],["Braille",Ch.Braille],["Buginese",Ch.Buginese],["Buhid",Ch.Buhid],["Canadian_Aboriginal",Ch.
2Canadian_Aboriginal],["Carian",Ch.Carian],["Caucasian_Albanian",Ch.Caucasian_Albanian],["Chakma",Ch.Chakma],["Cham",Ch.Cham],["Cherokee",Ch.Cherokee],["Chorasmian",Ch.Chorasmian],["Common",Ch.Common],["Coptic",Ch.Coptic],["Cuneiform",Ch.Cuneiform],["Cypriot",Ch.Cypriot],["Cypro_Minoan",Ch.Cypro_Minoan],["Cyrillic",Ch.Cyrillic],["Deseret",Ch.Deseret],["Devanagari",Ch.Devanagari],["Dives_Akuru",Ch.Dives_Akuru],["Dogra",Ch.Dogra],["Duployan",Ch.Duployan],["Egyptian_Hieroglyphs",Ch.Egyptian_Hieroglyphs],["Elbasan",Ch.Elbasan],["Elymaic",Ch.Elymaic],["Ethiopic",Ch.Ethiopic],["Georgian",Ch.Georgian],["Glagolitic",Ch.Glagolitic],["Gothic",Ch.Gothic],["Grantha",Ch.Grantha],["Greek",Ch.Greek],["Gujarati",Ch.Gujarati],["Gunjala_Gondi",Ch.Gunjala_Gondi],["Gurmukhi",Ch.Gurmukhi],["Han",Ch.Han],["Hangul",Ch.Hangul],["Hanifi_Rohingya",Ch.Hanifi_Rohingya],["Hanunoo",Ch.Hanunoo],["Hatran",Ch.Hatran],["Hebrew",Ch.Hebrew],["Hiragana",Ch.Hiragana],["Imperial_Aramaic",Ch.Imperial_Aramaic],["Inherited",Ch.Inherited],["Inscriptional_Pahlavi",Ch.Inscriptional_Pahlavi],["Inscriptional_Parthian",Ch.Inscriptional_Parthian],["Javanese",Ch.Javane
2se],["Kaithi",Ch.Kaithi],["Kannada",Ch.Kannada],["Katakana",Ch.Katakana],["Kawi",Ch.Kawi],["Kayah_Li",Ch.Kayah_Li],["Kharoshthi",Ch.Kharoshthi],["Khitan_Small_Script",Ch.Khitan_Small_Script],["Khmer",Ch.Khmer],["Khojki",Ch.Khojki],["Khudawadi",Ch.Khudawadi],["Lao",Ch.Lao],["Latin",Ch.Latin],["Lepcha",Ch.Lepcha],["Limbu",Ch.Limbu],["Linear_A",Ch.Linear_A],["Linear_B",Ch.Linear_B],["Lisu",Ch.Lisu],["Lycian",Ch.Lycian],["Lydian",Ch.Lydian],["Mahajani",Ch.Mahajani],["Makasar",Ch.Makasar],["Malayalam",Ch.Malayalam],["Mandaic",Ch.Mandaic],["Manichaean",Ch.Manichaean],["Marchen",Ch.Marchen],["Masaram_Gondi",Ch.Masaram_Gondi],["Medefaidrin",Ch.Medefaidrin],["Meetei_Mayek",Ch.Meetei_Mayek],["Mende_Kikakui",Ch.Mende_Kikakui],["Meroitic_Cursive",Ch.Meroitic_Cursive],["Meroitic_Hieroglyphs",Ch.Meroitic_Hieroglyphs],["Miao",Ch.Miao],["Modi",Ch.Modi],["Mongolian",Ch.Mongolian],["Mro",Ch.Mro],["Multani",Ch.Multani],["Myanmar",Ch.Myanmar],["Nabataean",Ch.Nabataean],["Nag_Mundari",Ch.Nag_Mundari],["Nandinagari",Ch.Nandinagari],["New_Tai_Lue",Ch.New_Tai_Lue],["Newa",Ch.Newa],["Nko",Ch.Nko],["Nushu",Ch.Nushu],["Nyiakeng_Puachue_Hmong",Ch.Nyiakeng_Puachue_Hmong],["Ogham",Ch.Ogham],["Ol_Chiki",Ch.Ol_Chiki],["Old_Hungarian",Ch.Old_Hungarian],["Old_Italic",Ch.Old_Italic],["Old_North_Arabian",Ch.Old_North_Arabian],["Old_Permic",Ch.Old_Permic],["Old_Persian",Ch.Old_Persian],["Old_Sogdian",Ch.Old_Sogdian],["Old_South_Arabian",Ch.Old_South_Arabian],["Old_Turkic",Ch.Old_Turkic],["Old_Uyghur",Ch.Old_Uyghur],["Oriya",Ch.Oriya],["Osage",Ch.Osage],["Osmanya",Ch.Osmanya],["Pahawh_Hmong",Ch.Pahawh_Hmong],["Palmyrene",Ch.Palmyrene],["Pau_Cin_Hau",Ch.Pau_Cin_Hau],["Phags_Pa",Ch.Phags_Pa],["Phoenician",Ch.Phoenician],["Psalter_Pahlavi",Ch.Psalter_Pahlavi],["Rejang",Ch.Rejang],["Runic",Ch.Runic],["Samaritan",Ch.Samaritan],["Saurashtra",Ch.Saurashtra],["Sharada",Ch.Sharada],["Shavian",Ch.Shavian],["Siddham",Ch.Siddham],["SignWriting",Ch.SignWriting],["Sinhala",Ch.Sinhala],["Sogdian",Ch.Sogdian],["Sora_Sompeng",Ch.Sora_Sompeng],["Soyombo",Ch.Soyombo],["Sundanese",Ch.Sundanese],["Syloti_Nagri",Ch.Syloti_Nagri],["Syriac",Ch.Syriac],["Tagalog",Ch.Tagalog],["Tagbanwa",Ch.Tagbanwa],["Tai_Le",Ch.Tai_Le],["Tai_Tham",Ch.Tai_Tham],["Tai_Viet",Ch.Tai_Viet],["Takri",Ch.Takri],["Tamil",Ch.Tamil],["Tangsa",Ch.Tangsa],["Tangut",Ch.Tangut],["Telugu",Ch.Telugu],["Thaana",Ch.Thaana],["Thai",Ch.Thai],["Tibetan",Ch.Tibetan],["Tifinagh",Ch.Tifinagh],["Tirhuta",Ch.Tirhuta],["Toto",Ch.Toto],["Ugaritic",Ch.Ugaritic],["Vai",Ch.Vai],["Vithkuqi",Ch.Vithkuqi],["Wancho",Ch.Wancho],["Warang_Citi",Ch.Warang_Citi],["Yezidi",Ch.Yezidi],["Yi",Ch.Yi],["Zanabazar_Square",Ch.Zanabazar_Square]])),f(Ph,"FOLD_CATEGORIES",new Map([["L",Ch.foldL],["Ll",Ch.foldLl],["Lt",Ch.foldLt],["Lu",Ch.foldLu],["M",Ch.foldM],["Mn",Ch.foldMn]])),f(Ph,"FOLD_SCRIPT",new Map([["Common",Ch.foldCommon],["Greek",Ch.foldGreek],["Inherited",Ch.foldInherited]]));class Mh{static is32(e,t){let i=0,n=e.length;for(;i<n;){let r=i+Math.floor((n-i)/2),s=e[r];if(s[0]<=t&&t<=s[1])return(t-s[0])%s[2]===0;t<s[0]?n=r:i=r+1}return!1}static is(e,t){if(t<=this.MAX_LATIN1){for(let i of e)if(!(t>i[1]))return!(t<i[0])&&(t-i[0])%i[2]===0;return!1}return e.length>0&&t>=e[0][0]&&this.is32(e,t)}static isUpper(e){if(e<=this.MAX_LATIN1){const t=String.fromCodePoint(e);return t.toUpperCase()===t&&t.toLowerCase()!==t}return this.is(Ph.Upper,e)}static isPrint(e){return e<=this.MAX_LATIN1?e>=32&&e<127||e>=161&&173!==e:this.is(Ph.L,e)||this.is(Ph.M,e)||this.is(Ph.N,e)||this.is(Ph.P,e)||this.is(Ph.S,e)}static simpleFold(e){if(Ph.CASE_ORBIT.has(e))return Ph.CASE_ORBIT.get(e);const t=Oh.toLowerCase(e);return t!==e?t:Oh.toUpperCase(e)}static equalsIgnoreCase(e,t){if(e<0||t<0||e===t)return!0;if(e<=this.MAX_ASCII&&t<=this.MAX_ASCII)return Oh.CODES.get("A")<=e&&e<=Oh.CODES.get("Z")&&(e|=32),Oh.CODES.get("A")<=t&&t<=Oh.CODES.get("Z")&&(t|=32),e===t;for(let i=this.simpleFold(e);i!==e;i=this.simpleFold(i))if(i===t)return!0;return!1}}f(Mh,"MAX_RUNE",1114111),f(Mh,"MAX_ASCII",127),f(Mh,"MAX_LATIN1",255),f(Mh,"MAX_BMP",65535),f(Mh,"MIN_FOLD",65),f(Mh,"MAX_FOLD",125251);class Nh{static emptyInts(){return[]}static isalnum(e){return Oh.CODES.get("0")<=e&&e<=Oh.CODES.get("9")||Oh.CODES.get("a")<=e&&e<=Oh.CODES.get("z")||Oh.CODES.get("A")<=e&&e<=Oh.CODES.get("Z")}static unhex(e){return Oh.CODES.get("0")<=e&&e<=Oh.CODES.get("9")?e-Oh.CODES.get("0"):Oh.CODES.get("a")<=e&&e<=Oh.CODES.get("f")?e-Oh.CODES.get("a")+10:Oh.CODES.get("A")<=e&&e<=Oh.CODES.get("F")?e-Oh.CODES.get("A")+10:-1}static escapeRune(e){let t="";if(Mh.isPrint(e))this.METACHARACTERS.indexOf(String.fromCodePoint(e))>=0&&(t+="\\"),t+=String.fromCodePoint(e);else switch(e){case Oh.CODES.get('"'):t+='\\"';break;case Oh.CODES.get("\\"):t+="\\\\";break;case Oh.CODES.get("\t"):t+="\\t";break;case Oh.CODES.get("\n"):t+="\\n";break;case Oh.CODES.get("\r"):t+="\\r";break;case Oh.CODES.get("\b"):t+="\\b";break;case Oh.CODES.get("\f"):t+="\\f";break;default:{let i=e.toString(16);e<256?(t+="\\x",1===i.length&&(t+="0"),t+=i):t+="\\x{".concat(i,"}");break}}return t}static stringToRunes(e){return String(e).split("").map(e=>e.codePointAt(0))}static runeToString(e){return String.fromCodePoint(e)}static isWordRune(e){return Oh.CODES.get("a")<=e&&e<=Oh.CODES.get("z")||Oh.CODES.get("A")<=e&&e<=Oh.CODES.get("Z")||Oh.CODES.get("0")<=e&&e<=Oh.CODES.get("9")||e===Oh.CODES.get("_")}static emptyOpContext(e,t){let i=0;return e<0&&(i|=this.EMPTY_BEGIN_TEXT|this.EMPTY_BEGIN_LINE),e===Oh.CODES.get("\n")&&(i|=this.EMPTY_BEGIN_LINE),t<0&&(i|=this.EMPTY_END_TEXT|this.EMPTY_END_LINE),t===Oh.CODES.get("\n")&&(i|=this.EMPTY_END_LINE),this.isWordRune(e)!==this.isWordRune(t)?i|=this.EMPTY_WORD_BOUNDARY:i|=this.EMPTY_NO_WORD_BOUNDARY,i}static quoteMeta(e){return e.split("").map(e=>this.METACHARACTERS.indexOf(e)>=0?"\\".concat(e):e).join("")}static charCount(e){return e>Mh.MAX_BMP?2:1}static stringToUtf8ByteArray(e){if(globalThis.TextEncoder)return Array.from((new TextEncoder).encode(e));{let t=[],i=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<128?t[i++]=r:r<2048?(t[i++]=r>>6|192,t[i++]=63&r|128):55296===(64512&r)&&n+1<e.length&&56320===(64512&e.charCodeAt(n+1))?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n)),t[i++]=r>>18|240,t[i++]=r>>12&63|128,t[i++]=r>>6&63|128,t[i++]=63&r|128):(t[i++]=r>>12|224,t[i++]=r>>6&63|128,t[i++]=63&r|128)}return t}}static utf8ByteArrayToString(e){if(globalThis.TextDecoder)return new TextDecoder("utf-8").decode(new Uint8Array(e));{let t=[],i=0,n=0;for(;i<e.length;){let r=e[i++];if(r<128)t[n++]=String.fromCharCode(r);else if(r>191&&r<224){let s=e[i++];t[n++]=String.fromCharCode((31&r)<<6|63&s)}else if(r>239&&r<365){let s=((7&r)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536;t[n++]=String.fromCharCode(55296+(s>>10)),t[n++]=String.fromCharCode(56320+(1023&s))}else{let s=e[i++],a=e[i++];
2t[n++]=String.fromCharCode((15&r)<<12|(63&s)<<6|63&a)}}return t.join("")}}}f(Nh,"METACHARACTERS","\\.+*?()|[]{}^$"),f(Nh,"EMPTY_BEGIN_LINE",1),f(Nh,"EMPTY_END_LINE",2),f(Nh,"EMPTY_BEGIN_TEXT",4),f(Nh,"EMPTY_END_TEXT",8),f(Nh,"EMPTY_WORD_BOUNDARY",16),f(Nh,"EMPTY_NO_WORD_BOUNDARY",32),f(Nh,"EMPTY_ALL",-1);const Ih=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i={};for(let n=0;n<e.length;n++){const r=e[n],s=t+n;i[r]=s,i[s]=r}return Object.freeze(i)};class Lh{getEncoding(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===Lh.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===Lh.Encoding.UTF_16}}f(Lh,"Encoding",Ih(["UTF_16","UTF_8"]));class Dh extends Lh{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;super(),this.bytes=e}getEncoding(){return Lh.Encoding.UTF_8}asCharSequence(){return Nh.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}}class Fh extends Lh{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;super(),this.charSequence=e}getEncoding(){return Lh.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return this.charSequence.toString().split("").map(e=>e.codePointAt(0))}length(){return this.charSequence.length}}class Bh{static utf16(e){return new Fh(e)}static utf8(e){return Array.isArray(e)?new Dh(e):new Dh(Nh.stringToUtf8ByteArray(e))}}class Uh extends Error{constructor(e){super(e),this.name="RE2JSException"}}class zh extends Uh{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i="error parsing regexp: ".concat(e);t&&(i+=": `".concat(t,"`")),super(i),this.name="RE2JSSyntaxException",this.message=i,this.error=e,this.input=t}getDescription(){return this.error}getPattern(){return this.input}}class Vh extends Uh{constructor(e){super(e),this.name="RE2JSCompileException"}}class Hh extends Uh{constructor(e){super(e),this.name="RE2JSGroupException"}}class jh extends Uh{constructor(e){super(e),this.name="RE2JSFlagsException"}}class Yh{static quoteReplacement(e){return e.indexOf("\\")<0&&e.indexOf("$")<0?e:e.split("").map(e=>{const t=e.codePointAt(0);return t===Oh.CODES["\\"]||t===Oh.CODES.$?"\\".concat(e):e}).join("")}constructor(e,t){if(null===e)throw new Error("pattern is null");this.patternInput=e;const i=this.patternInput.re2();this.patternGroupCount=i.numberOfCapturingGroups(),this.groups=[],this.namedGroups=i.namedGroups,t instanceof Lh?this.resetMatcherInput(t):Array.isArray(t)?this.resetMatcherInput(Bh.utf8(t)):this.resetMatcherInput(Bh.utf16(t))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(e){if(null===e)throw new Error("input is null");return this.matcherInput=e,this.reset(),this}start(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if("string"===typeof e){const t=this.namedGroups[e];if(!Number.isFinite(t))throw new Hh("group '".concat(e,"' not found"));e=t}return this.loadGroup(e),this.groups[2*e]}end(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if("string"===typeof e){const t=this.namedGroups[e];if(!Number.isFinite(t))throw new Hh("group '".concat(e,"' not found"));e=t}return this.loadGroup(e),this.groups[2*e+1]}group(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if("string"===typeof e){const t=this.namedGroups[e];if(!Number.isFinite(t))throw new Hh("group '".concat(e,"' not found"));e=t}const t=this.start(e),i=this.end(e);return t<0&&i<0?null:this.substring(t,i)}groupCount(){return this.patternGroupCount}loadGroup(e){if(e<0||e>this.patternGroupCount)throw new Hh("Group index out of bounds: ".concat(e));if(!this.hasMatch)throw new Hh("perhaps no match attempted");if(0===e||this.hasGroups)return;let t=this.groups[1]+1;t>this.matcherInputLength&&(t=this.matcherInputLength);const i=this.patternInput.re2().matchMachineInput(this.matcherIn
2put,this.groups[0],t,this.anchorFlag,1+this.patternGroupCount);if(!i[0])throw new Hh("inconsistency in matching group data");this.groups=i[1],this.hasGroups=!0}matches(){return this.genMatch(0,Rh.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,Rh.ANCHOR_START)}find(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(null!==e){if(e<0||e>this.matcherInputLength)throw new Hh("start index out of bounds: ".concat(e));return this.reset(),this.genMatch(e,0)}return e=0,this.hasMatch&&(e=this.groups[1],this.groups[0]===this.groups[1]&&e++),this.genMatch(e,Rh.UNANCHORED)}genMatch(e,t){const i=this.patternInput.re2().matchMachineInput(this.matcherInput,e,this.matcherInputLength,t,1);return!!i[0]&&(this.groups=i[1],this.hasMatch=!0,this.hasGroups=!1,this.anchorFlag=t,!0)}substring(e,t){return this.matcherInput.isUTF8Encoding()?Nh.utf8ByteArrayToString(this.matcherInput.asBytes().slice(e,t)):this.matcherInput.asCharSequence().substring(e,t).toString()}inputLength(){return this.matcherInputLength}appendReplacement(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i="";const n=this.start(),r=this.end();return this.appendPos<n&&(i+=this.substring(this.appendPos,n)),this.appendPos=r,i+=t?this.appendReplacementInternalPerl(e):this.appendReplacementInternal(e),i}appendReplacementInternal(e){let t="",i=0;const n=e.length;for(let r=0;r<n-1;r++)if(e.codePointAt(r)!==Oh.CODES.get("\\")){if(e.codePointAt(r)===Oh.CODES.get("$")){let s=e.codePointAt(r+1);if(Oh.CODES.get("0")<=s&&s<=Oh.CODES.get("9")){let a=s-Oh.CODES.get("0");for(i<r&&(t+=e.substring(i,r)),r+=2;r<n&&(s=e.codePointAt(r),!(s<Oh.CODES.get("0")||s>Oh.CODES.get("9")||10*a+s-Oh.CODES.get("0")>this.patternGroupCount));r++)a=10*a+s-Oh.CODES.get("0");if(a>this.patternGroupCount)throw new Hh("n > number of groups: ".concat(a));const o=this.group(a);null!==o&&(t+=o),i=r,r--;continue}if(s===Oh.CODES.get("{")){i<r&&(t+=e.substring(i,r)),r++;let n=r+1;for(;n<e.length&&e.codePointAt(n)!==Oh.CODES.get("}")&&e.codePointAt(n)!==Oh.CODES.get(" ");)n++;if(n===e.length||e.codePointAt(n)!==Oh.CODES.get("}"))throw new Hh("named capture group is missing trailing '}'");const s=e.substring(r+1,n);t+=this.group(s),i=n+1}}}else i<r&&(t+=e.substring(i,r)),r++,i=r;return i<n&&(t+=e.substring(i,n)),t}appendReplacementInternalPerl(e){let t="",i=0;const n=e.length;for(let r=0;r<n-1;r++)if(e.codePointAt(r)===Oh.CODES.get("$")){let s=e.codePointAt(r+1);if(Oh.CODES.get("$")===s){i<r&&(t+=e.substring(i,r)),t+="$",r++,i=r+1;continue}if(Oh.CODES.get("&")===s){i<r&&(t+=e.substring(i,r));const n=this.group(0);t+=null!==n?n:"$&",r++,i=r+1;continue}if(Oh.CODES.get("1")<=s&&s<=Oh.CODES.get("9")){let a=s-Oh.CODES.get("0");for(i<r&&(t+=e.substring(i,r)),r+=2;r<n&&(s=e.codePointAt(r),!(s<Oh.CODES.get("0")||s>Oh.CODES.get("9")||10*a+s-Oh.CODES.get("0")>this.patternGroupCount));r++)a=10*a+s-Oh.CODES.get("0");if(a>this.patternGroupCount){t+="$".concat(a),i=r,r--;continue}const o=this.group(a);null!==o&&(t+=o),i=r,r--;continue}if(s===Oh.CODES.get("<")){i<r&&(t+=e.substring(i,r)),r++;let n=r+1;for(;n<e.length&&e.codePointAt(n)!==Oh.CODES.get(">")&&e.codePointAt(n)!==Oh.CODES.get(" ");)n++;if(n===e.length||e.codePointAt(n)!==Oh.CODES.get(">")){t+=e.substring(r-1,n+1),i=n+1;continue}const s=e.substring(r+1,n);Object.prototype.hasOwnProperty.call(this.namedGroups,s)?t+=this.group(s):t+="$<".concat(s,">"),i=n+1}}return i<n&&(t+=e.substring(i,n)),t}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.replace(e,!0,t)}replaceFirst(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.replace(e,!1,t)}replace(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n="";for(this.reset();this.find()&&(n+=this.appendReplacement(e,i),t););return n+=this.appendTail(),n}}class Wh{static EOF(){return-8}canCheckPrefix(){return!0}endPos(){return this.end}}class Gh extends Wh{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;super(),this.bytes=e,this.start=t,this.end=i}step(e){if((e+=this.start)>=this.end)return Wh.EOF();let t=255&this.bytes[e++];return 0===(128&t)?t<<3|1:192===(224&t)?(t&=31,e>=this.end?Wh.EOF():(t=t<<6|63&this.bytes[e++],t<<3|2)):224===(240&t)?(t&=15,e+1>=this.end?Wh.EOF():(t=t<<6|63&this.bytes[e++],t=t<<6|63&this.bytes[e++],t<<3|3)):(t&=7,e+2>=this.end?Wh.EOF():(t=t<<6|63&this.bytes[e++],t=t<<6|63&this.bytes[e++],t=t<<6|63&this.bytes[e++],t<<3|4))}index(e,t){t+=this.start;const i=this.indexOf(this.bytes,e.prefixUTF8,t);return i<0?i:i-t}context(e){let t=-1;if((e+=this.start)>this.start&&e<=this.end){let i=e-1;if(t=this.bytes[i--],t>=128){let n=e-4;for(n<this.start&&(n=this.start);i>=n&&128===(192&this.bytes[i]);)i--;i<this.start&&(i=this.start),t=this.step(i)>>3}}const i=e<this.end?this.step(e)>>3:-1;return Nh.emptyOpContext(t,i)}indexOf(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.length;if(0===n)return-1;let r=e.length;for(let s=i;s<=r-n;s++)for(let i=0;i<n&&e[s+i]===t[i];i++)if(i===n-1)return s;return-1}}class Xh extends Wh{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;super(),this.charSequence=e,this.start=t,this.end=i}step(e){if((e+=this.start)<this.end){const t=this.charSequence.codePointAt(e);return t<<3|Nh.charCount(t)}return Wh.EOF()}index(e,t){t+=this.start;const i=this.charSequence.indexOf(e.prefix,t);return i<0?i:i-t}context(e){const t=(e+=this.start)>0&&e<=this.charSequence.length?this.charSequence.codePointAt(e-1):-1,i=e<this.charSequence.length?this.charSequence.codePointAt(e):-1;return Nh.emptyOpContext(t,i)}}class qh{static fromUTF8(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;return new Gh(e,t,i)}static fromUTF16(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;return new Xh(e,t,i)}}class Kh{static isPseudoOp(e){return e>=Kh.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(e){return e===Oh.CODES.get("-")?"\\":""}static fromRegexp(e){const t=new Kh(e.op);return t.flags=e.flags,t.subs=e.subs,t.runes=e.runes,t.cap=e.cap,t.min=e.min,t.max=e.max,t.name=e.name,t.namedGroups=e.namedGroups,t}constructor(e){this.op=e,this.flags=0,this.subs=Kh.emptySubs(),this.runes=null,this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups={}}reinit(){this.flags=0,this.subs=Kh.emptySubs(),this.runes=null,this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups={}}toString(){return this.appendTo()}appendTo(){let e="";switch(this.op){case Kh.Op.NO_MATCH:e+="[^\\x00-\\x{10FFFF}]";break;case Kh.Op.EMPTY_MATCH:e+="(?:)";break;case Kh.Op.STAR:case Kh.Op.PLUS:case Kh.Op.QUEST:case Kh.Op.REPEAT:{const t=this.subs[
20];switch(t.op>Kh.Op.CAPTURE||t.op===Kh.Op.LITERAL&&t.runes.length>1?e+="(?:".concat(t.appendTo(),")"):e+=t.appendTo(),this.op){case Kh.Op.STAR:e+="*";break;case Kh.Op.PLUS:e+="+";break;case Kh.Op.QUEST:e+="?";break;case Kh.Op.REPEAT:e+="{".concat(this.min),this.min!==this.max&&(e+=",",this.max>=0&&(e+=this.max)),e+="}"}0!==(this.flags&Rh.NON_GREEDY)&&(e+="?");break}case Kh.Op.CONCAT:for(let t of this.subs)t.op===Kh.Op.ALTERNATE?e+="(?:".concat(t.appendTo(),")"):e+=t.appendTo();break;case Kh.Op.ALTERNATE:{let t="";for(let i of this.subs)e+=t,t="|",e+=i.appendTo();break}case Kh.Op.LITERAL:0!==(this.flags&Rh.FOLD_CASE)&&(e+="(?i:");for(let t of this.runes)e+=Nh.escapeRune(t);0!==(this.flags&Rh.FOLD_CASE)&&(e+=")");break;case Kh.Op.ANY_CHAR_NOT_NL:e+="(?-s:.)";break;case Kh.Op.ANY_CHAR:e+="(?s:.)";break;case Kh.Op.CAPTURE:null===this.name||0===this.name.length?e+="(":e+="(?P<".concat(this.name,">"),this.subs[0].op!==Kh.Op.EMPTY_MATCH&&(e+=this.subs[0].appendTo()),e+=")";break;case Kh.Op.BEGIN_TEXT:e+="\\A";break;case Kh.Op.END_TEXT:0!==(this.flags&Rh.WAS_DOLLAR)?e+="(?-m:$)":e+="\\z";break;case Kh.Op.BEGIN_LINE:e+="^";break;case Kh.Op.END_LINE:e+="$";break;case Kh.Op.WORD_BOUNDARY:e+="\\b";break;case Kh.Op.NO_WORD_BOUNDARY:e+="\\B";break;case Kh.Op.CHAR_CLASS:if(this.runes.length%2!==0){e+="[invalid char class]";break}if(e+="[",0===this.runes.length)e+="^\\x00-\\x{10FFFF}";else if(0===this.runes[0]&&this.runes[this.runes.length-1]===Mh.MAX_RUNE){e+="^";for(let t=1;t<this.runes.length-1;t+=2){const i=this.runes[t]+1,n=this.runes[t+1]-1;e+=Kh.quoteIfHyphen(i),e+=Nh.escapeRune(i),i!==n&&(e+="-",e+=Kh.quoteIfHyphen(n),e+=Nh.escapeRune(n))}}else for(let t=0;t<this.runes.length;t+=2){const i=this.runes[t],n=this.runes[t+1];e+=Kh.quoteIfHyphen(i),e+=Nh.escapeRune(i),i!==n&&(e+="-",e+=Kh.quoteIfHyphen(n),e+=Nh.escapeRune(n))}e+="]";break;default:e+=this.op}return e}maxCap(){let e=0;if(this.op===Kh.Op.CAPTURE&&(e=this.cap),null!==this.subs)for(let t of this.subs){const i=t.maxCap();e<i&&(e=i)}return e}equals(e){if(!(null!==e&&e instanceof Kh))return!1;if(this.op!==e.op)return!1;switch(this.op){case Kh.Op.END_TEXT:if((this.flags&Rh.WAS_DOLLAR)!==(e.flags&Rh.WAS_DOLLAR))return!1;break;case Kh.Op.LITERAL:case Kh.Op.CHAR_CLASS:if(null===this.runes&&null===e.runes)break;if(null===this.runes||null===e.runes)return!1;if(this.runes.length!==e.runes.length)return!1;for(let t=0;t<this.runes.length;t++)if(this.runes[t]!==e.runes[t])return!1;break;case Kh.Op.ALTERNATE:case Kh.Op.CONCAT:if(this.subs.length!==e.subs.length)return!1;for(let t=0;t<this.subs.length;++t)if(!this.subs[t].equals(e.subs[t]))return!1;break;case Kh.Op.STAR:case Kh.Op.PLUS:case Kh.Op.QUEST:if((this.flags&Rh.NON_GREEDY)!==(e.flags&Rh.NON_GREEDY)||!this.subs[0].equals(e.subs[0]))return!1;break;case Kh.Op.REPEAT:if((this.flags&Rh.NON_GREEDY)!==(e.flags&Rh.NON_GREEDY)||this.min!==e.min||this.max!==e.max||!this.subs[0].equals(e.subs[0]))return!1;break;case Kh.Op.CAPTURE:if(this.cap!==e.cap||(null===this.name?null!==e.name:this.name!==e.name)||!this.subs[0].equals(e.subs[0]))return!1}return!0}}f(Kh,"Op",Ih(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","LEFT_PAREN","VERTICAL_BAR"]));class Qh{static isRuneOp(e){return Qh.RUNE<=e&&e<=Qh.RUNE_ANY_NOT_NL}static escapeRunes(e){let t='"';for(let i of e)t+=Nh.escapeRune(i);return t+='"',t}constructor(e){this.op=e,this.out=0,this.arg=0,this.runes=null}matchRune(e){if(1===this.runes.length){const t=this.runes[0];return 0!==(this.arg&Rh.FOLD_CASE)?Mh.equalsIgnoreCase(t,e):e===t}for(let n=0;n<this.runes.length&&n<=8;n+=2){if(e<this.runes[n])return!1;if(e<=this.runes[n+1])return!0}let t=0,i=this.runes.length/2|0;for(;t<i;){const n=t+((i-t)/2|0);if(this.runes[2*n]<=e){if(e<=this.runes[2*n+1])return!0;t=n+1}else i=n}return!1}toString(){switch(this.op){case Qh.ALT:return"alt -> ".concat(this.out,", ").concat(this.arg);case Qh.ALT_MATCH:return"altmatch -> ".concat(this.out,", ").concat(this.arg);case Qh.CAPTURE:return"cap ".concat(this.arg," -> ").concat(this.out);case Qh.EMPTY_WIDTH:return"empty ".concat(this.arg," -> ").concat(this.out);case Qh.MATCH:return"match";case Qh.FAIL:return"fail";case Qh.NOP:return"nop -> ".concat(this.out);case Qh.RUNE:return null===this.runes?"rune <null>":["rune ",Qh.escapeRunes(this.runes),0!==(this.arg&Rh.FOLD_CASE)?"/i":""," -> ",this.out].join("");case Qh.RUNE1:return"rune1 ".concat(Qh.escapeRunes(this.runes)," -> ").concat(this.out);case Qh.RUNE_ANY:return"any -> ".concat(this.out);case Qh.RUNE_ANY_NOT_NL:return"anynotnl -> ".concat(this.out);default:throw new Error("unhandled case in Inst.toString")}}}f(Qh,"ALT",1),f(Qh,"ALT_MATCH",2),f(Qh,"CAPTURE",3),f(Qh,"EMPTY_WIDTH",4),f(Qh,"FAIL",5),f(Qh,"MATCH",6),f(Qh,"NOP",7),f(Qh,"RUNE",8),f(Qh,"RUNE1",9),f(Qh,"RUNE_ANY",10),f(Qh,"RUNE_ANY_NOT_NL",11);class Jh{constructor(){this.inst=[],this.start=0,this.numCap=2}getInst(e){return this.inst[e]}numInst(){return this.inst.length}addInst(e){this.inst.push(new Qh(e))}skipNop(e){let t=this.inst[e];for(;t.op===Qh.NOP||t.op===Qh.CAPTURE;)t=this.inst[e],e=t.out;return t}prefix(){let e="",t=this.skipNop(this.start);if(!Qh.isRuneOp(t.op)||1!==t.runes.length)return[t.op===Qh.MATCH,e];for(;Qh.isRuneOp(t.op)&&1===t.runes.length&&0===(t.arg&Rh.FOLD_CASE);)e+=String.fromCodePoint(t.runes[0]),t=this.skipNop(t.out);return[t.op===Qh.MATCH,e]}startCond(){let e=0,t=this.start;e:for(;;){const i=this.inst[t];switch(i.op){case Qh.EMPTY_WIDTH:e|=i.arg;break;case Qh.FAIL:return-1;case Qh.CAPTURE:case Qh.NOP:break;default:break e}t=i.out}return e}next(e){const t=this.inst[e>>1];return 0===(1&e)?t.out:t.arg}patch(e,t){for(;0!==e;){const i=this.inst[e>>1];0===(1&e)?(e=i.out,i.out=t):(e=i.arg,i.arg=t)}}append(e,t){if(0===e)return t;if(0===t)return e;let i=e;for(;;){const e=this.next(i);if(0===e)break;i=e}const n=this.inst[i>>1];return 0===(1&i)?n.out=t:n.arg=t,e}toString(){let e="";for(let t=0;t<this.inst.length;t++){const i=e.length;e+=t,t===this.start&&(e+="*"),e+="        ".substring(e.length-i),e+=this.inst[t],e+="\n"}return e}}class Zh{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.i=e,this.out=t,this.nullable=i}}class $h{static ANY_RUNE_NOT_NL(){return[0,Oh.CODES.get("\n")-1,Oh.CODES.get("\n")+1,Mh.MAX_RUNE]}static ANY_RUNE(){return[0,Mh.MAX_RUNE]}static compileRegexp(e){const t=new $h,i=t.compile(e);return t.prog.patch(i.out,t.newInst(Qh.MATCH).i),t.prog.start=i.i,t.prog}constructor(){this.prog=new Jh,this.newInst(Qh.FAIL)}newInst(e){return this.prog.addInst(e),new Zh(this.prog.numInst()-1,0,!0)}nop(){const e=this.newInst(Qh.NOP);return e.out=e.i<<1,e}fail(){return new Zh}cap(e){const t=this.newInst(Qh.CAPTURE);return t.out=t.i<<1,this.prog.getInst(t.i).arg=e,this.prog.numCap<e+1&&(this.prog.numCap=e+1),t}cat(e,t){return 0===e.i||0===t.i?this.fail():(this.prog.patch(e.out,t.i),new Zh(e.i,t.out,e.nullable&&t.nullable))}alt(e,t){if(0===e.i)return t;if(0===t.i)return e;const i=this.newInst(Qh.ALT),n=this.prog.getInst(i.i);return n.out=e.i,n.arg=t.i,i.out=this.prog.append(e.out,t.out),i.nullable=e.nullable||t.nullable,i}loop(e,t){const i=this.newInst(Qh.ALT),n=this.prog.getInst(i.i);return t?(n.arg=e.i,i.out=i.i<<1):(n.out=e.i,i.out=i.i<<1|1),this.prog.patch(e.out,i.i),i}quest(e,t){const i=this.newInst(Qh.ALT),n=this.prog.getInst(i.i);return t?(n.arg=e.i,i.out=i.i<<1):(n.out=e.i,i.out=i.i<<1|1),i.out=this.prog.append(i.out,e.out),i}star(e,t){return e.nullable?this.quest(this.plus(e,t),t):this.loop(e,t)}plus(e,t){return new Zh(e.i,this.loop(e,t).out,e.nullable)}empty(e){const t=this.newInst(Qh.EMPTY_WIDTH);return this.prog.getInst(t.i).arg=e,t.out=t.i<<1,t}rune(e,t){const i=this.newInst(Qh.RUNE);i.nullable=!1;const n=this.prog.getInst(i.i);return n.runes=e,t&=Rh.FOLD_CASE,1===e.length&&Mh.simpleFold(e[0])!==e[0]||(t&=~Rh.FOLD_CASE),n.arg=t,i.out=i.i<<1,0===(t&Rh.FOLD_CASE)&&1===e.length||2===e.length&&e[0]===e[1]?n.op=Qh.RUNE1:2===e.length&&0===e[0]&&e[1]===Mh.MAX_RUNE?n.op=Qh.RUNE_ANY:4===e.length&&0===e[0]&&e[1]===Oh.CODES.get("\n")-1&&e[2]===Oh.CODES.get("\n")+1&&e[3]===Mh.MAX_RUNE&&(n.op=Qh.RUNE_ANY_NOT_NL),i}compile(e){switch(e.op){case Kh.Op.NO_MATCH:return this.fail();case Kh.Op.EMPTY_MATCH:return this.nop();case Kh.Op.LITERAL:if(0===e.runes.length)return this.nop();{let t=null;for(let i of e.runes){const n=this.rune([i],e.flags);t=null===t?n:this.cat(t,n)}return t}case Kh.Op.CHAR_CLASS:return this.rune(e.runes,e.flags);case Kh.Op.ANY_CHAR_NOT_NL:return this.rune($h.ANY_RUNE_NOT_NL(),0);case Kh.Op.ANY_CHAR:return this.rune($h.ANY_RUNE(),0);case Kh.Op.BEGIN_LINE:return this.empty(Nh.EMPTY_BEGIN_LINE);case Kh.Op.END_LINE:return this.empty(Nh.EMPTY_END_LINE);case Kh.Op.BEGIN_TEXT:return this.empty(Nh.EMPTY_BEGIN_TEXT);case Kh.Op.END_TEXT:return this.empty(Nh.EMPTY_END_TEXT);case Kh.Op.WORD_BOUNDARY:return this.empty(Nh.EMPTY_WORD_BOUNDARY);case Kh.Op.NO_WORD_BOUNDARY:return this.empty(Nh.EMPTY_NO_WORD_BOUNDARY);case Kh.Op.CAPTURE:{const t=this.cap(e.cap<<1),i=this.compile(e.subs[0]),n=this.cap(e.cap<<1|1);return this.cat(this.cat(t,i),n)}case Kh.Op.STAR:return this.star(this.compile(e.subs[0]),0!==(e.flags&Rh.NON_GREEDY));case Kh.Op.PLUS:return this.plus(this.compile(e.subs[0]),0!==(e.flags&Rh.NON_GREEDY));case Kh.Op.QUEST:return this.quest(this.compile(e.subs[0]),0!==(e.flags&Rh.NON_GREEDY));case Kh.Op.CONCAT:if(0===e.subs.length)return this.nop();{let t=null;for(let i of e.subs){const e=this.compile(i);t=null===t?e:this.cat(t,e)}return t}case Kh.Op.ALTERNATE:if(0===e.subs.length)return this.nop();{let t=null;for(let i of e.subs){const e=this.compile(i);t=null===t?e:this.alt(t,e)}return t}default:throw new Vh("regexp: unhandled case in compile")}}}class eu{static simplify(e){if(null===e)return null;switch(e.op){case Kh.Op.CAPTURE:case Kh.Op.CONCAT:case Kh.Op.ALTERNATE:{let t=e;for(let i=0;i<e.subs.length;
2i++){const n=e.subs[i],r=eu.simplify(n);t===e&&r!==n&&(t=Kh.fromRegexp(e),t.runes=null,t.subs=e.subs.slice(0,e.subs.length)),t!==e&&(t.subs[i]=r)}return t}case Kh.Op.STAR:case Kh.Op.PLUS:case Kh.Op.QUEST:{const t=eu.simplify(e.subs[0]);return eu.simplify1(e.op,e.flags,t,e)}case Kh.Op.REPEAT:{if(0===e.min&&0===e.max)return new Kh(Kh.Op.EMPTY_MATCH);const t=eu.simplify(e.subs[0]);if(-1===e.max){if(0===e.min)return eu.simplify1(Kh.Op.STAR,e.flags,t,null);if(1===e.min)return eu.simplify1(Kh.Op.PLUS,e.flags,t,null);const i=new Kh(Kh.Op.CONCAT),n=[];for(let r=0;r<e.min-1;r++)n.push(t);return n.push(eu.simplify1(Kh.Op.PLUS,e.flags,t,null)),i.subs=n.slice(0),i}if(1===e.min&&1===e.max)return t;let i=null;if(e.min>0){i=[];for(let n=0;n<e.min;n++)i.push(t)}if(e.max>e.min){let n=eu.simplify1(Kh.Op.QUEST,e.flags,t,null);for(let i=e.min+1;i<e.max;i++){const i=new Kh(Kh.Op.CONCAT);i.subs=[t,n],n=eu.simplify1(Kh.Op.QUEST,e.flags,i,null)}if(null===i)return n;i.push(n)}if(null!==i){const e=new Kh(Kh.Op.CONCAT);return e.subs=i.slice(0),e}return new Kh(Kh.Op.NO_MATCH)}}return e}static simplify1(e,t,i,n){return i.op===Kh.Op.EMPTY_MATCH||e===i.op&&(t&Rh.NON_GREEDY)===(i.flags&Rh.NON_GREEDY)?i:(null!==n&&n.op===e&&(n.flags&Rh.NON_GREEDY)===(t&Rh.NON_GREEDY)&&i===n.subs[0]||((n=new Kh(e)).flags=t,n.subs=[i]),n)}}class tu{constructor(e,t){this.sign=e,this.cls=t}}const iu=[48,57],nu=[9,10,12,13,32,32],ru=[48,57,65,90,95,95,97,122],su=new Map([["\\d",new tu(1,iu)],["\\D",new tu(-1,iu)],["\\s",new tu(1,nu)],["\\S",new tu(-1,nu)],["\\w",new tu(1,ru)],["\\W",new tu(-1,ru)]]),au=[48,57,65,90,97,122],ou=[65,90,97,122],lu=[0,127],hu=[9,9,32,32],uu=[0,31,127,127],cu=[48,57],du=[33,126],fu=[97,122],pu=[32,126],mu=[33,47,58,64,91,96,123,126],gu=[9,13,32,32],vu=[65,90],yu=[48,57,65,90,95,95,97,122],xu=[48,57,65,70,97,102],bu=new Map([["[:alnum:]",new tu(1,au)],["[:^alnum:]",new tu(-1,au)],["[:alpha:]",new tu(1,ou)],["[:^alpha:]",new tu(-1,ou)],["[:ascii:]",new tu(1,lu)],["[:^ascii:]",new tu(-1,lu)],["[:blank:]",new tu(1,hu)],["[:^blank:]",new tu(-1,hu)],["[:cntrl:]",new tu(1,uu)],["[:^cntrl:]",new tu(-1,uu)],["[:digit:]",new tu(1,cu)],["[:^digit:]",new tu(-1,cu)],["[:graph:]",new tu(1,du)],["[:^graph:]",new tu(-1,du)],["[:lower:]",new tu(1,fu)],["[:^lower:]",new tu(-1,fu)],["[:print:]",new tu(1,pu)],["[:^print:]",new tu(-1,pu)],["[:punct:]",new tu(1,mu)],["[:^punct:]",new tu(-1,mu)],["[:space:]",new tu(1,gu)],["[:^space:]",new tu(-1,gu)],["[:upper:]",new tu(1,vu)],["[:^upper:]",new tu(-1,vu)],["[:word:]",new tu(1,yu)],["[:^word:]",new tu(-1,yu)],["[:xdigit:]",new tu(1,xu)],["[:^xdigit:]",new tu(-1,xu)]]);class wu{static charClassToString(e,t){let i="[";for(let n=0;n<t;n+=2){n>0&&(i+=" ");const t=e[n],r=e[n+1];i+=t===r?"0x".concat(t.toString(16)):"0x".concat(t.toString(16),"-0x").concat(r.toString(16))}return i+="]",i}static cmp(e,t,i,n){const r=e[t]-i;return 0!==r?r:n-e[t+1]}static qsortIntPair(e,t,i){const n=(t+i)/2&-2,r=e[n],s=e[n+1];let a=t,o=i;for(;a<=o;){for(;a<i&&wu.cmp(e,a,r,s)<0;)a+=2;for(;o>t&&wu.cmp(e,o,r,s)>0;)o-=2;if(a<=o){if(a!==o){let t=e[a];e[a]=e[o],e[o]=t,t=e[a+1],e[a+1]=e[o+1],e[o+1]=t}a+=2,o-=2}}t<o&&wu.qsortIntPair(e,t,o),a<i&&wu.qsortIntPair(e,a,i)}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Nh.emptyInts();this.r=e,this.len=e.length}toArray(){return this.len===this.r.length?this.r:this.r.slice(0,this.len)}cleanClass(){if(this.len<4)return this;wu.qsortIntPair(this.r,0,this.len-2);let e=2;for(let t=2;t<this.len;t+=2){const i=this.r[t],n=this.r[t+1];if(i<=this.r[e-1]+1){n>this.r[e-1]&&(this.r[e-1]=n);continue}this.r[e]=i,this.r[e+1]=n,e+=2}return this.len=e,this}appendLiteral(e,t){return 0!==(t&Rh.FOLD_CASE)?this.appendFoldedRange(e,e):this.appendRange(e,e)}appendRange(e,t){if(this.len>0)for(let i=2;i<=4;i+=2)if(this.len>=i){const n=this.r[this.len-i],r=this.r[this.len-i+1];if(e<=r+1&&n<=t+1)return e<n&&(this.r[this.len-i]=e),t>r&&(this.r[this.len-i+1]=t),this}return this.r[this.len++]=e,this.r[this.len++]=t,this}appendFoldedRange(e,t){if(e<=Mh.MIN_FOLD&&t>=Mh.MAX_FOLD)return this.appendRange(e,t);if(t<Mh.MIN_FOLD||e>Mh.MAX_FOLD)return this.appendRange(e,t);e<Mh.MIN_FOLD&&(this.appendRange(e,Mh.MIN_FOLD-1),e=Mh.MIN_FOLD),t>Mh.MAX_FOLD&&(this.appendRange(Mh.MAX_FOLD+1,t),t=Mh.MAX_FOLD);for(let i=e;i<=t;i++){this.appendRange(i,i);for(let e=Mh.simpleFold(i);e!==i;e=Mh.simpleFold(e))this.appendRange(e,e)}return this}appendClass(e){for(let t=0;t<e.length;t+=2)this.appendRange(e[t],e[t+1]);return this}appendFoldedClass(e){for(let t=0;t<e.length;t+=2)this.appendFoldedRange(e[t],e[t+1]);return this}appendNegatedClass(e){let t=0;for(let i=0;i<e.length;i+=2){const n=e[i],r=e[i+1];t<=n-1&&this.appendRange(t,n-1),t=r+1}return t<=Mh.MAX_RUNE&&this.appendRange(t,Mh.MAX_RUNE),this}appendTable(e){for(let t of e){const e=t[0],i=t[1],n=t[2];if(1!==n)for(let t=e;t<=i;t+=n)this.appendRange(t,t);else this.appendRange(e,i)}return this}appendNegatedTable(e){let t=0;for(let i of e){const e=i[0],n=i[1],r=i[2];if(1!==r)for(let i=e;i<=n;i+=r)t<=i-1&&this.appendRange(t,i-1),t=i+1;else t<=e-1&&this.appendRange(t,e-1),t=n+1}return t<=Mh.MAX_RUNE&&this.appendRange(t,Mh.MAX_RUNE),this}appendTableWithSign(e,t){return t<0?this.appendNegatedTable(e):this.appendTable(e)}negateClass(){let e=0,t=0;for(let i=0;i<this.len;i+=2){const n=this.r[i],r=this.r[i+1];
vendor: 3,906 bytes, line 2
2e<=n-1&&(this.r[t]=e,this.r[t+1]=n-1,t+=2),e=r+1}return this.len=t,e<=Mh.MAX_RUNE&&(this.r[this.len++]=e,this.r[this.len++]=Mh.MAX_RUNE),this}appendClassWithSign(e,t){return t<0?this.appendNegatedClass(e):this.appendClass(e)}appendGroup(e,t){let i=e.cls;return t&&(i=(new wu).appendFoldedClass(i).cleanClass().toArray()),this.appendClassWithSign(i,e.sign)}toString(){return wu.charClassToString(this.r,this.len)}}class Tu{static of(e,t){return new Tu(e,t)}constructor(e,t){this.first=e,this.second=t}}class _u{constructor(e){this.str=e,this.position=0}pos(){return this.position}rewindTo(e){this.position=e}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(e){this.position+=e}skipString(e){this.position+=e.length}pop(){const e=this.str.codePointAt(this.position);return this.position+=Nh.charCount(e),e}lookingAt(e){return this.rest().startsWith(e)}rest(){return this.str.substring(this.position)}from(e){return this.str.substring(e,this.position)}toString(){return this.rest()}}class Su{static ANY_TABLE(){return[[0,Mh.MAX_RUNE,1]]}static unicodeTable(e){return"Any"===e?Tu.of(Su.ANY_TABLE(),Su.ANY_TABLE()):Ph.CATEGORIES.has(e)?Tu.of(Ph.CATEGORIES.get(e),Ph.FOLD_CATEGORIES.get(e)):Ph.SCRIPTS.has(e)?Tu.of(Ph.SCRIPTS.get(e),Ph.FOLD_SCRIPT.get(e)):null}static minFoldRune(e){if(e<Mh.MIN_FOLD||e>Mh.MAX_FOLD)return e;let t=e;const i=e;for(e=Mh.simpleFold(e);e!==i;e=Mh.simpleFold(e))t>e&&(t=e);return t}static leadingRegexp(e){if(e.op===Kh.Op.EMPTY_MATCH)return null;if(e.op===Kh.Op.CONCAT&&e.subs.length>0){const t=e.subs[0];return t.op===Kh.Op.EMPTY_MATCH?null:t}return e}static literalRegexp(e,t){const i=new Kh(Kh.Op.LITERAL);return i.flags=t,i.runes=Nh.stringToRunes(e),i}static parse(e,t){return new Su(e,t).parseInternal()}static parseRepeat(e){const t=e.pos();if(!e.more()||!e.lookingAt("{"))return-1;e.skip(1);const i=Su.parseInt(e);if(-1===i)return-1;if(!e.more())return-1;let n;if(e.lookingAt(",")){if(e.skip(1),!e.more())return-1;if(e.lookingAt("}"))n=-1;else if(-1===(n=Su.parseInt(e)))return-1}else n=i;if(!e.more()||!e.lookingAt("}"))return-1;if(e.skip(1),i<0||i>1e3||-2===n||n>1e3||n>=0&&i>n)throw new zh(Su.ERR_INVALID_REPEAT_SIZE,e.from(t));return i<<16|n&Mh.MAX_BMP}static isValidCaptureName(e){if(0===e.length)return!1;for(let t=0;t<e.length;t++){const i=e.codePointAt(t);if(i!==Oh.CODES.get("_")&&!Nh.isalnum(i))return!1}return!0}static parseInt(e){const t=e.pos();for(;e.more()&&e.peek()>=Oh.CODES.get("0")&&e.peek()<=Oh.CODES.get("9");)e.skip(1);const i=e.from(t);return 0===i.length||i.length>1&&i.codePointAt(0)===Oh.CODES.get("0")?-1:i.length>8?-2:parseFloat(i,10)}static isCharClass(e){return e.op===Kh.Op.LITERAL&&1===e.runes.length||e.op===Kh.Op.CHAR_CLASS||e.op===Kh.Op.ANY_CHAR_NOT_NL||e.op===Kh.Op.ANY_CHAR}static matchRune(e,t){switch(e.op){case Kh.Op.LITERAL:return 1===e.runes.length&&e.runes[0]===t;case Kh.Op.CHAR_CLASS:for(let i=0;i<e.runes.length;i+=2)if(e.runes[i]<=t&&t<=e.runes[i+1])return!0;return!1;case Kh.Op.ANY_CHAR_NOT_NL:return t!==Oh.CODES.get("\n");case Kh.Op.ANY_CHAR:return!0}return!1}static mergeCharClass(e,t){switch(e.op){case Kh.Op.ANY_CHAR:break;case Kh.Op.ANY_CHAR_NOT_NL:Su.matchRune(t,Oh.CODES.get("\n"))&&(e.op=Kh.Op.ANY_CHAR);break;case Kh.Op.CHAR_CLASS:t.op===Kh.Op.LITERAL?e.runes=new wu(e.runes).appendLiteral(t.runes[0],t.flags).toArray():e.runes=new wu(e.runes).appendClass(t.runes).toArray();break;case Kh.Op.LITERAL:if(t.runes[0]===e.runes[0]&&t.flags===e.flags)break;e.op=Kh.Op.CHAR_CLASS,e.runes=(new wu).appendLiteral(e.runes[0],e.flags).appendLiteral(t.runes[0],t.flags).toArray()}}static parseEscape(e){const t=e.pos();if(e.skip(1),!e.more())throw new zh(Su.ERR_TRAILING_BACKSLASH);let i=e.pop();e:switch(i){case Oh.CODES.get("1"):case Oh.CODES.get("2"):case Oh.CODES.get("3"):case Oh.CODES.get("4"):case Oh.CODES.get("5"):case Oh.CODES.get("6"):case Oh.CODES.get("7"):if(!e.more(
2)||e.peek()<Oh.CODES.get("0")||e.peek()>Oh.CODES.get("7"))break;case Oh.CODES.get("0"):{let t=i-Oh.CODES.get("0");for(let i=1;i<3&&!(!e.more()||e.peek()<Oh.CODES.get("0")||e.peek()>Oh.CODES.get("7"));i++)t=8*t+e.peek()-Oh.CODES.get("0"),e.skip(1);return t}case Oh.CODES.get("x"):{if(!e.more())break;if(i=e.pop(),i===Oh.CODES.get("{")){let t=0,n=0;for(;;){if(!e.more())break e;if(i=e.pop(),i===Oh.CODES.get("}"))break;const r=Nh.unhex(i);if(r<0)break e;if(n=16*n+r,n>Mh.MAX_RUNE)break e;t++}if(0===t)break e;return n}const t=Nh.unhex(i);if(!e.more())break;i=e.pop();const n=Nh.unhex(i);if(t<0||n<0)break;return 16*t+n}case Oh.CODES.get("a"):return Oh.CODES.get("\x07");case Oh.CODES.get("f"):return Oh.CODES.get("\f");case Oh.CODES.get("n"):return Oh.CODES.get("\n");case Oh.CODES.get("r"):return Oh.CODES.get("\r");case Oh.CODES.get("t"):return Oh.CODES.get("\t");case Oh.CODES.get("v"):return Oh.CODES.get("\v");default:if(!Nh.isalnum(i))return i}throw new zh(Su.ERR_INVALID_ESCAPE,e.from(t))}static parseClassChar(e,t){if(!e.more())throw new zh(Su.ERR_MISSING_BRACKET,e.from(t));return e.lookingAt("\\")?Su.parseEscape(e):e.pop()}static concatRunes(e,t){return[...e,...t]}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.wholeRegexp=e,this.flags=t,this.numCap=0,this.namedGroups={},this.stack=[],this.free=null}newRegexp(e){let t=this.free;return null!==t&&null!==t.subs&&t.subs.length>0?(this.free=t.subs[0],t.reinit(),t.op=e):t=new Kh(e),t}reuse(e){null!==e.subs&&e.subs.length>0&&(e.subs[0]=this.free),this.free=e}pop(){return this.stack.pop()}popToPseudo(){const e=this.stack.length;let t=e;for(;t>0&&!Kh.isPseudoOp(this.stack[t-1].op);)t--;const i=this.stack.slice(t,e);return this.stack=this.stack.slice(0,t),i}push(e){if(e.op===Kh.Op.CHAR_CLASS&&2===e.runes.length&&e.runes[0]===e.runes[1]){if(this.maybeConcat(e.runes[0],this.flags&~Rh.FOLD_CASE))return null;e.op=Kh.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags&~Rh.FOLD_CASE}else if(e.op===Kh.Op.CHAR_CLASS&&4===e.runes.length&&e.runes[0]===e.runes[1]&&e.runes[2]===e.runes[3]&&Mh.simpleFold(e.runes[0])===e.runes[2]&&Mh.simpleFold(e.runes[2])===e.runes[0]||e.op===Kh.Op.CHAR_CLASS&&2===e.runes.length&&e.runes[0]+1===e.runes[1]&&Mh.simpleFold(e.runes[0])===e.runes[1]&&Mh.simpleFold(e.runes[1])===e.runes[0]){if(this.maybeConcat(e.runes[0],this.flags|Rh.FOLD_CASE))return null;e.op=Kh.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags|Rh.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(e),e}maybeConcat(e,t){const i=this.stack.length;if(i<2)return!1;const n=this.stack[i-1],r=this.stack[i-2];return n.op===Kh.Op.LITERAL&&r.op===Kh.Op.LITERAL&&(n.flags&Rh.FOLD_CASE)===(r.flags&Rh.FOLD_CASE)&&(r.runes=Su.concatRunes(r.runes,n.runes),e>=0?(n.runes=[e],n.flags=t,!0):(this.pop(),this.reuse(n),!1))}newLiteral(e,t){const i=this.newRegexp(Kh.Op.LITERAL);return i.flags=t,0!==(t&Rh.FOLD_CASE)&&(e=Su.minFoldRune(e)),i.runes=[e],i}literal(e){this.push(this.newLiteral(e,this.flags))}op(e){const t=this.newRegexp(e);return t.flags=this.flags,this.push(t)}repeat(e,t,i,n,r,s){let a=this.flags;if(0!==(a&Rh.PERL_X)&&(r.more()&&r.lookingAt("?")&&(r.skip(1),a^=Rh.NON_GREEDY),-1!==s))throw new zh(Su.ERR_INVALID_REPEAT_OP,r.from(s));const o=this.stack.length;if(0===o)throw new zh(Su.ERR_MISSING_REPEAT_ARGUMENT,r.from(n));const l=this.stack[o-1];if(Kh.isPseudoOp(l.op))throw new zh(Su.ERR_MISSING_REPEAT_ARGUMENT,r.from(n));const h=this.newRegexp(e);h.min=t,h.max=i,h.flags=a,h.subs=[l],this.stack[o-1]=h}concat(){this.maybeConcat(-1,0);const e=this.popToPseudo();return 0===e.length?this.push(this.newRegexp(Kh.Op.EMPTY_MATCH)):this.push(this.collapse(e,Kh.Op.CONCAT))}alternate(){const e=this.popToPseudo();return e.length>0&&this.cleanAlt(e[e.length-1]),0===e.length?this.push(this.newRegexp(Kh.Op.NO_MATCH)):this.push(this.collapse(e,Kh.Op.ALTERNATE))}cleanAlt(e){e.op===Kh.Op.CHAR_CLASS&&(e.runes=new wu(e.runes).cleanClass().toArray(),2===e.runes.length&&0===e.runes[0]&&e.runes[1]===Mh.MAX_RUNE?(e.runes=null,e.op=Kh.Op.ANY_CHAR):4===e.runes.length&&0===e.runes[0]&&e.runes[1]===Oh.CODES.get("\n")-1&&e.runes[2]===Oh.CODES.get("\n")+1&&e.runes[3]===Mh.MAX_RUNE&&(e.runes=null,e.op=Kh.Op.ANY_CHAR_NOT_NL))}collapse(e,t){if(1===e.length)return e[0];let i=0;for(let a of e)i+=a.op===t?a.subs.length:1;let n=new Array(i).fill(null),r=0;for(let a of e)a.op===t?(n.splice(r,a.subs.length,...a.subs),r+=a.subs.length,this.reuse(a)):n[r++]=a;let s=this.newRegexp(t);if(s.subs=n,t===Kh.Op.ALTERNATE&&(s.subs=this.factor(s.subs),1===s.subs.length)){const e=s;
vendor: 5,252 bytes, line 2
2s=s.subs[0],this.reuse(e)}return s}factor(e){if(e.length<2)return e;let t=0,i=e.length,n=0,r=null,s=0,a=0,o=0;for(let h=0;h<=i;h++){let l=null,u=0,c=0;if(h<i){let i=e[t+h];if(i.op===Kh.Op.CONCAT&&i.subs.length>0&&(i=i.subs[0]),i.op===Kh.Op.LITERAL&&(l=i.runes,u=i.runes.length,c=i.flags&Rh.FOLD_CASE),c===a){let e=0;for(;e<s&&e<u&&r[e]===l[e];)e++;if(e>0){s=e;continue}}}if(h===o);else if(h===o+1)e[n++]=e[t+o];else{const i=this.newRegexp(Kh.Op.LITERAL);i.flags=a,i.runes=r.slice(0,s);for(let n=o;n<h;n++)e[t+n]=this.removeLeadingString(e[t+n],s);const l=this.collapse(e.slice(t+o,t+h),Kh.Op.ALTERNATE),u=this.newRegexp(Kh.Op.CONCAT);u.subs=[i,l],e[n++]=u}o=h,r=l,s=u,a=c}i=n,t=0,o=0,n=0;let l=null;for(let h=0;h<=i;h++){let r=null;if(!(h<i&&(r=Su.leadingRegexp(e[t+h]),null!==l&&l.equals(r)&&(Su.isCharClass(l)||l.op===Kh.Op.REPEAT&&l.min===l.max&&Su.isCharClass(l.subs[0]))))){if(h===o);else if(h===o+1)e[n++]=e[t+o];else{const i=l;for(let n=o;n<h;n++){const i=n!==o;e[t+n]=this.removeLeadingRegexp(e[t+n],i)}const r=this.collapse(e.slice(t+o,t+h),Kh.Op.ALTERNATE),s=this.newRegexp(Kh.Op.CONCAT);s.subs=[i,r],e[n++]=s}o=h,l=r}}i=n,t=0,o=0,n=0;for(let h=0;h<=i;h++)if(!(h<i&&Su.isCharClass(e[t+h]))){if(h===o);else if(h===o+1)e[n++]=e[t+o];else{let i=o;for(let n=o+1;n<h;n++){const r=e[t+i],s=e[t+n];(r.op<s.op||r.op===s.op&&(null!==r.runes?r.runes.length:0)<(null!==s.runes?s.runes.length:0))&&(i=n)}const r=e[t+o];e[t+o]=e[t+i],e[t+i]=r;for(let n=o+1;n<h;n++)Su.mergeCharClass(e[t+o],e[t+n]),this.reuse(e[t+n]);this.cleanAlt(e[t+o]),e[n++]=e[t+o]}h<i&&(e[n++]=e[t+h]),o=h+1}i=n,t=0,o=0,n=0;for(let h=0;h<i;++h)h+1<i&&e[t+h].op===Kh.Op.EMPTY_MATCH&&e[t+h+1].op===Kh.Op.EMPTY_MATCH||(e[n++]=e[t+h]);return i=n,t=0,e.slice(t,i)}removeLeadingString(e,t){if(e.op===Kh.Op.CONCAT&&e.subs.length>0){const i=this.removeLeadingString(e.subs[0],t);if(e.subs[0]=i,i.op===Kh.Op.EMPTY_MATCH)switch(this.reuse(i),e.subs.length){case 0:case 1:e.op=Kh.Op.EMPTY_MATCH,e.subs=null;break;case 2:{const t=e;e=e.subs[1],this.reuse(t);break}default:e.subs=e.subs.slice(1,e.subs.length)}return e}return e.op===Kh.Op.LITERAL&&(e.runes=e.runes.slice(t,e.runes.length),0===e.runes.length&&(e.op=Kh.Op.EMPTY_MATCH)),e}removeLeadingRegexp(e,t){if(e.op===Kh.Op.CONCAT&&e.subs.length>0){switch(t&&this.reuse(e.subs[0]),e.subs=e.subs.slice(1,e.subs.length),e.subs.length){case 0:e.op=Kh.Op.EMPTY_MATCH,e.subs=Kh.emptySubs();break;case 1:{const t=e;e=e.subs[0],this.reuse(t);break}}return e}return t&&this.reuse(e),this.newRegexp(Kh.Op.EMPTY_MATCH)}parseInternal(){if(0!==(this.flags&Rh.LITERAL))return Su.literalRegexp(this.wholeRegexp,this.flags);let e=-1,t=-1,i=-1;const n=new _u(this.wholeRegexp);for(;n.more();){let r=-1;e:switch(n.peek()){case Oh.CODES.get("("):if(0!==(this.flags&Rh.PERL_X)&&n.lookingAt("(?")){this.parsePerlFlags(n);break}this.op(Kh.Op.LEFT_PAREN).cap=++this.numCap,n.skip(1);break;case Oh.CODES.get("|"):this.parseVerticalBar(),n.skip(1);break;case Oh.CODES.get(")"):this.parseRightParen(),n.skip(1);break;case Oh.CODES.get("^"):0!==(this.flags&Rh.ONE_LINE)?this.op(Kh.Op.BEGIN_TEXT):this.op(Kh.Op.BEGIN_LINE),n.skip(1);break;case Oh.CODES.get("$"):0!==(this.flags&Rh.ONE_LINE)?this.op(Kh.Op.END_TEXT).flags|=Rh.WAS_DOLLAR:this.op(Kh.Op.END_LINE),n.skip(1);break;case Oh.CODES.get("."):0!==(this.flags&Rh.DOT_NL)?this.op(Kh.Op.ANY_CHAR):this.op(Kh.Op.ANY_CHAR_NOT_NL),n.skip(1);break;case Oh.CODES.get("["):this.parseClass(n);break;case Oh.CODES.get("*"):case Oh.CODES.get("+"):case Oh.CODES.get("?"):{r=n.pos();let s=null;switch(n.pop()){case Oh.CODES.get("*"):s=Kh.Op.STAR;break;case Oh.CODES.get("+"):s=Kh.Op.PLUS;break;case Oh.CODES.get("?"):s=Kh.Op.QUEST}this.repeat(s,t,i,r,n,e);break}case Oh.CODES.get("{"):{r=n.pos();const s=Su.parseRepeat(n);if(s<0){n.rewindTo(r),this.literal(n.pop());break}t=s>>16,i=(s&Mh.MAX_BMP)<<16>>16,this.repeat(Kh.Op.REPEAT,t,i,r,n,e);break}case Oh.CODES.get("\\"):{const e=n.pos();if(n.skip(1),0!==(this.flags&Rh.PERL_X)&&n.more()){switch(n.pop()){case Oh.CODES.get("A"):this.op(Kh.Op.BEGIN_TEXT);break e;case Oh.CODES.get("b"):this.op(Kh.Op.WORD_BOUNDARY);break e;case Oh.CODES.get("B"):this.op(Kh.Op.NO_WORD_BOUNDARY);break e;case Oh.CODES.get("C"):throw new zh(Su.ERR_INVALID_ESCAPE,"\\C");case Oh.CODES.get("Q"):{let e=n.rest();const t=e.indexOf("\\E");t>=0&&(e=e.substring(0,t)),n.skipString(e),n.skipString("\\E");let i=0;for(;i<e.length;){const t=e.codePointAt(i);this.literal(t),i+=Nh.charCount(t)}break e}case Oh.CODES.get("z"):this.op(Kh.Op.END_TEXT);break e;default:n.rewindTo(e)}}const t=this.newRegexp(Kh.Op.CHAR_CLASS);if(t.flags=this.flags,n.lookingAt("\\p")||n.lookingAt("\\P")){const e=new wu;if(this.parseUnicodeClass(n,e)){t.runes=e.toArray(),this.push(t);break e}}const i=new wu;if(this.parsePerlClassEscape(n,i)){t.runes=i.toArray(),this.push(t);break e}n.rewindTo(e),this.reuse(t),this.literal(Su.parseEscape(n));break}default:this.literal(n.pop())}e=r}this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate();if(1!==this.stack.length)throw new zh(Su.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}parsePerlFlags(e){const t=e.pos(),i=e.rest();if(i.startsWith("(?P<")||i.startsWith("(?<")){const t="P"===i.charAt(2)?4:3,n=i.indexOf(">");
2if(n<0)throw new zh(Su.ERR_INVALID_NAMED_CAPTURE,i);const r=i.substring(t,n);if(e.skipString(r),e.skip(t+1),!Su.isValidCaptureName(r))throw new zh(Su.ERR_INVALID_NAMED_CAPTURE,i.substring(0,n+1));const s=this.op(Kh.Op.LEFT_PAREN);if(s.cap=++this.numCap,this.namedGroups[r])throw new zh(Su.ERR_DUPLICATE_NAMED_CAPTURE,r);return this.namedGroups[r]=this.numCap,void(s.name=r)}e.skip(2);let n=this.flags,r=1,s=!1;e:for(;e.more();){const t=e.pop();switch(t){case Oh.CODES.get("i"):n|=Rh.FOLD_CASE,s=!0;break;case Oh.CODES.get("m"):n&=~Rh.ONE_LINE,s=!0;break;case Oh.CODES.get("s"):n|=Rh.DOT_NL,s=!0;break;case Oh.CODES.get("U"):n|=Rh.NON_GREEDY,s=!0;break;case Oh.CODES.get("-"):if(r<0)break e;r=-1,n=~n,s=!1;break;case Oh.CODES.get(":"):case Oh.CODES.get(")"):if(r<0){if(!s)break e;n=~n}return t===Oh.CODES.get(":")&&this.op(Kh.Op.LEFT_PAREN),void(this.flags=n);default:break e}}throw new zh(Su.ERR_INVALID_PERL_OP,e.from(t))}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(Kh.Op.VERTICAL_BAR)}swapVerticalBar(){const e=this.stack.length;if(e>=3&&this.stack[e-2].op===Kh.Op.VERTICAL_BAR&&Su.isCharClass(this.stack[e-1])&&Su.isCharClass(this.stack[e-3])){let t=this.stack[e-1],i=this.stack[e-3];if(t.op>i.op){const n=i;i=t,t=n,this.stack[e-3]=i}return Su.mergeCharClass(i,t),this.reuse(t),this.pop(),!0}if(e>=2){const t=this.stack[e-1],i=this.stack[e-2];if(i.op===Kh.Op.VERTICAL_BAR)return e>=3&&this.cleanAlt(this.stack[e-3]),this.stack[e-2]=t,this.stack[e-1]=i,!0}return!1}parseRightParen(){this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate();if(this.stack.length<2)throw new zh(Su.ERR_INTERNAL_ERROR,"stack underflow");const e=this.pop(),t=this.pop();if(t.op!==Kh.Op.LEFT_PAREN)throw new zh(Su.ERR_MISSING_PAREN,this.wholeRegexp);this.flags=t.flags,0===t.cap?this.push(e):(t.op=Kh.Op.CAPTURE,t.subs=[e],this.push(t))}parsePerlClassEscape(e,t){const i=e.pos();if(0===(this.flags&Rh.PERL_X)||!e.more()||e.pop()!==Oh.CODES.get("\\")||!e.more())return!1;e.pop();const n=e.from(i),r=su.has(n)?su.get(n):null;return null!==r&&(t.appendGroup(r,0!==(this.flags&Rh.FOLD_CASE)),!0)}parseNamedClass(e,t){const i=e.rest(),n=i.indexOf(":]");if(n<0)return!1;const r=i.substring(0,n+2);e.skipString(r);const s=bu.has(r)?bu.get(r):null;if(null===s)throw new zh(Su.ERR_INVALID_CHAR_RANGE,r);return t.appendGroup(s,0!==(this.flags&Rh.FOLD_CASE)),!0}parseUnicodeClass(e,t){const i=e.pos();if(0===(this.flags&Rh.UNICODE_GROUPS)||!e.lookingAt("\\p")&&!e.lookingAt("\\P"))return!1;e.skip(1);let n,r=1,s=e.pop();if(s===Oh.CODES.get("P")&&(r=-1),!e.more())throw e.rewindTo(i),new zh(Su.ERR_INVALID_CHAR_RANGE,e.rest());if(s=e.pop(),s!==Oh.CODES.get("{"))n=Nh.runeToString(s);else{const t=e.rest(),r=t.indexOf("}");if(r<0)throw e.rewindTo(i),new zh(Su.ERR_INVALID_CHAR_RANGE,e.rest());n=t.substring(0,r),e.skipString(n),e.skip(1)}0!==n.length&&n.codePointAt(0)===Oh.CODES.get("^")&&(r=0-r,n=n.substring(1));const a=Su.unicodeTable(n);if(null===a)throw new zh(Su.ERR_INVALID_CHAR_RANGE,e.from(i));const o=a.first,l=a.second;if(0===(this.flags&Rh.FOLD_CASE)||null===l)t.appendTableWithSign(o,r);else{const e=(new wu).appendTable(o).appendTable(l).cleanClass().toArray();t.appendClassWithSign(e,r)}return!0}parseClass(e){const t=e.pos();e.skip(1);const i=this.newRegexp(Kh.Op.CHAR_CLASS);i.flags=this.flags;const n=new wu;let r=1;e.more()&&e.lookingAt("^")&&(r=-1,e.skip(1),0===(this.flags&Rh.CLASS_NL)&&n.appendRange(Oh.CODES.get("\n"),Oh.CODES.get("\n")));let s=!0;for(;!e.more()||e.peek()!==Oh.CODES.get("]")||s;){if(e.more()&&e.lookingAt("-")&&0===(this.flags&Rh.PERL_X)&&!s){const i=e.rest();if("-"===i||!i.startsWith("-]"))throw e.rewindTo(t),new zh(Su.ERR_INVALID_CHAR_RANGE,e.rest())}s=!1;const i=e.pos();if(e.lookingAt("[:")){if(this.parseNamedClass(e,n))continue;e.rewindTo(i)}if(this.parseUnicodeClass(e,n))continue;if(this.parsePerlClassEscape(e,n))continue;e.rewindTo(i);const r=Su.parseClassChar(e,t);let a=r;if(e.more()&&e.lookingAt("-"))if(e.skip(1),e.more()&&e.lookingAt("]"))e.skip(-1);else if(a=Su.parseClassChar(e,t),a<r)throw new zh(Su.ERR_INVALID_CHAR_RANGE,e.from(i));0===(this.flags&Rh.FOLD_CASE)?n.appendRange(r,a):n.appendFoldedRange(r,a)}e.skip(1),n.cleanClass(),r<0&&n.negateClass(),i.runes=n.toArray(),this.push(i)}}f(Su,"ERR_INTERNAL_ERROR","regexp/syntax: internal error"),f(Su,"ERR_INVALID_CHAR_RANGE","invali
2d character class range"),f(Su,"ERR_INVALID_ESCAPE","invalid escape sequence"),f(Su,"ERR_INVALID_NAMED_CAPTURE","invalid named capture"),f(Su,"ERR_INVALID_PERL_OP","invalid or unsupported Perl syntax"),f(Su,"ERR_INVALID_REPEAT_OP","invalid nested repetition operator"),f(Su,"ERR_INVALID_REPEAT_SIZE","invalid repeat count"),f(Su,"ERR_MISSING_BRACKET","missing closing ]"),f(Su,"ERR_MISSING_PAREN","missing closing )"),f(Su,"ERR_MISSING_REPEAT_ARGUMENT","missing argument to repetition operator"),f(Su,"ERR_TRAILING_BACKSLASH","trailing backslash at end of expression"),f(Su,"ERR_DUPLICATE_NAMED_CAPTURE","duplicate capture group name");class Eu{constructor(){this.inst=null,this.cap=[]}}class Cu{constructor(){this.sparse=[],this.densePcs=[],this.denseThreads=[],this.size=0}contains(e){const t=this.sparse[e];return t<this.size&&this.densePcs[t]===e}isEmpty(){return 0===this.size}add(e){const t=this.size++;return this.sparse[e]=t,this.denseThreads[t]=null,this.densePcs[t]=e,t}clear(){this.sparse=[],this.densePcs=[],this.denseThreads=[],this.size=0}toString(){let e="{";for(let t=0;t<this.size;t++)0!==t&&(e+=", "),e+=this.densePcs[t];return e+="}",e}}class Au{static fromRE2(e){const t=new Au;return t.prog=e.prog,t.re2=e,t.q0=new Cu(t.prog.numInst()),t.q1=new Cu(t.prog.numInst()),t.pool=[],t.poolSize=0,t.matched=!1,t.matchcap=Array(t.prog.numCap<2?2:t.prog.numCap).fill(0),t.ncap=0,t}static fromMachine(e){const t=new Au;return t.re2=e.re2,t.prog=e.prog,t.q0=e.q0,t.q1=e.q1,t.pool=e.pool,t.poolSize=e.poolSize,t.matched=e.matched,t.matchcap=e.matchcap,t.ncap=e.ncap,t}init(e){this.ncap=e,e>this.matchcap.length?this.initNewCap(e):this.resetCap(e)}resetCap(e){for(let t=0;t<this.poolSize;t++){this.pool[t].cap=Array(e).fill(0)}}initNewCap(e){for(let t=0;t<this.poolSize;t++){this.pool[t].cap=Array(e).fill(0)}this.matchcap=Array(e).fill(0)}submatches(){return 0===this.ncap?Nh.emptyInts():this.matchcap.slice(0,this.ncap)}alloc(e){let t;return this.poolSize>0?(this.poolSize--,t=this.pool[this.poolSize]):t=new Eu,t.inst=e,t}freeQueue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=e.size-t,n=this.poolSize+i;this.pool.length<n&&(this.pool=this.pool.slice(0,Math.max(2*this.pool.length,n)));for(let r=t;r<e.size;r++){const t=e.denseThreads[r];null!==t&&(this.pool[this.poolSize]=t,this.poolSize++)}e.clear()}freeThread(e){this.pool.length<=this.poolSize&&(this.pool=this.pool.slice(0,2*this.pool.length)),this.pool[this.poolSize]=e,this.poolSize++}match(e,t,i){const n=this.re2.cond;if(n===Nh.EMPTY_ALL)return!1;if((i===Rh.ANCHOR_START||i===Rh.ANCHOR_BOTH)&&0!==t)return!1;this.matched=!1,this.matchcap=Array(this.prog.numCap).fill(-1);let r,s=this.q0,a=this.q1,o=e.step(t),l=o>>3,h=7&o,u=-1,c=0;for(o!==Wh.EOF()&&(o=e.step(t+h),u=o>>3,c=7&o),r=0===t?Nh.emptyOpContext(-1,l):e.context(t);;){if(s.isEmpty()){if(0!==(n&Nh.EMPTY_BEGIN_TEXT)&&0!==t)break;if(this.matched)break;if(0!==this.re2.prefix.length&&u!==this.re2.prefixRune&&e.canCheckPrefix()){const i=e.index(this.re2,t);if(i<0)break;t+=i,o=e.step(t),l=o>>3,h=7&o,o=e.step(t+h),u=o>>3,c=7&o}}this.matched||0!==t&&i!==Rh.UNANCHORED||(this.ncap>0&&(this.matchcap[0]=t),this.add(s,this.prog.start,t,this.matchcap,r,null));const d=t+h;if(r=e.context(d),this.step(s,a,t,d,l,r,i,t===e.endPos()),0===h)break;if(0===this.ncap&&this.matched)break;t+=h,l=u,h=c,-1!==l&&(o=e.step(t+h),u=o>>3,c=7&o);const f=s;s=a,a=f}return this.freeQueue(a),this.matched}step(e,t,i,n,r,s,a,o){const l=this.re2.longest;for(let h=0;h<e.size;h++){let u=e.denseThreads[h];if(null===u)continue;if(l&&this.matched&&this.ncap>0&&this.matchcap[0]<u.cap[0]){this.freeThread(u);continue}const c=u.inst;let d=!1;switch(c.op){case Qh.MATCH:if(a===Rh.ANCHOR_BOTH&&!o)break;this.ncap>0&&(!l||!this.matched||this.matchcap[1]<i)&&(u.cap[1]=i,this.matchcap=u.cap.slice(0,this.ncap)),l||this.freeQueue(e,h+1),this.matched=!0;break;case Qh.RUNE:d=c.matchRune(r);break;case Qh.RUNE1:d=r===c.runes[0];break;case Qh.RUNE_ANY:d=!0;break;case Qh.RUNE_ANY_NOT_NL:d=r!==Oh.CODES.get("\n");break;default:throw new Error("bad inst")}d&&(u=this.add(t,c.out,n,u.cap,s,u)),null!==u&&(this.freeThread(u),e.denseThreads[h]=null)}e.clear()}add(e,t,i,n,r,s){if(0===t)return s;if(e.contains(t))return s;const a=e.add(t),o=this.prog.inst[t];switch(o.op){case Qh.FAIL:break;case Qh.ALT:case Qh.ALT_MATCH:s=this.add(e,o.out,i,n,r,s),s=this.add(e,o.arg,i,n,r,s);break;case Qh.EMPTY_WIDTH:0===(o.arg&~r)&&(s=this.add(e,o.out,i,n,r,s));break;case Qh.NOP:s=this.add(e,o.out,i,n,r,s);break;case Qh.CAPTURE:if(o.arg<this.ncap){const t=n[o.arg];n[o.arg]=i,this.add(e,o.out,i,n,r,null),n[o.arg]=t}else s=this.add(e,o.out,i,n,r,s);break;case Qh.MATCH:case Qh.RUNE:case Qh.RUNE1:case Qh.RUNE_ANY:case Qh.RUNE_ANY_NOT_NL:null===s?s=this.alloc(o):s.inst=o,this.ncap>0&&s.cap!==n&&(s.cap=n.slice(0,this.ncap)),e.denseThreads[a]=s,s=null;break;default:throw new Error("unhandled")}return s}}
2class ku{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}compareAndSet(e,t){return this.value===e&&(this.value=t,!0)}}class Ru{static initTest(e){const t=Ru.compile(e),i=new Ru(t.expr,t.prog,t.numSubexp,t.longest);return i.cond=t.cond,i.prefix=t.prefix,i.prefixUTF8=t.prefixUTF8,i.prefixComplete=t.prefixComplete,i.prefixRune=t.prefixRune,i}static compile(e){return Ru.compileImpl(e,Rh.PERL,!1)}static compilePOSIX(e){return Ru.compileImpl(e,Rh.POSIX,!0)}static compileImpl(e,t,i){let n=Su.parse(e,t);const r=n.maxCap();n=eu.simplify(n);const s=$h.compileRegexp(n),a=new Ru(e,s,r,i),o=u(s.prefix(),2),l=o[0],h=o[1];return a.prefixComplete=l,a.prefix=h,a.prefixUTF8=Nh.stringToUtf8ByteArray(a.prefix),a.prefix.length>0&&(a.prefixRune=a.prefix.codePointAt(0)),a.namedGroups=n.namedGroups,a}static match(e,t){return Ru.compile(e).match(t)}constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.expr=e,this.prog=t,this.numSubexp=i,this.longest=n,this.cond=t.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.pooled=new ku}numberOfCapturingGroups(){return this.numSubexp}get(){let e;do{e=this.pooled.get()}while(e&&!this.pooled.compareAndSet(e,e.next));return e}reset(){this.pooled.set(null)}put(e,t){let i=this.pooled.get();do{i=this.pooled.get(),!t&&i&&(e=Au.fromMachine(e),t=!0),e.next!==i&&(e.next=i)}while(!this.pooled.compareAndSet(i,e))}toString(){return this.expr}doExecute(e,t,i,n){let r=this.get(),s=!1;r?null!==r.next&&(r=Au.fromMachine(r),s=!0):(r=Au.fromRE2(this),s=!0),r.init(n);const a=r.match(e,t,i)?r.submatches():null;return this.put(r,s),a}match(e){return null!==this.doExecute(qh.fromUTF16(e),0,Rh.UNANCHORED,0)}matchWithGroup(e,t,i,n,r){return e instanceof Lh||(e=Bh.utf16(e)),this.matchMachineInput(e,t,i,n,r)}matchMachineInput(e,t,i,n,r){if(t>i)return[!1,null];const s=e.isUTF16Encoding()?qh.fromUTF16(e.asCharSequence(),0,i):qh.fromUTF8(e.asBytes(),0,i),a=this.doExecute(s,t,n,2*r);return null===a?[!1,null]:[!0,a]}matchUTF8(e){return null!==this.doExecute(qh.fromUTF8(e),0,Rh.UNANCHORED,0)}replaceAll(e,t){return this.replaceAllFunc(e,()=>t,2*e.length+1)}replaceFirst(e,t){return this.replaceAllFunc(e,()=>t,1)}replaceAllFunc(e,t,i){let n=0,r=0,s="";const a=qh.fromUTF16(e);let o=0;for(;r<=e.length;){const l=this.doExecute(a,r,Rh.UNANCHORED,2);if(null===l||0===l.length)break;s+=e.substring(n,l[0]),(l[1]>n||0===l[0])&&(s+=t(e.substring(l[0],l[1])),o++),n=l[1];
2const h=7&a.step(r);if(r+h>l[1]?r+=h:r+1>l[1]?r++:r=l[1],o>=i)break}return s+=e.substring(n),s}pad(e){if(null===e)return null;let t=2*(1+this.numSubexp);if(e.length<t){let i=new Array(t).fill(-1);for(let t=0;t<e.length;t++)i[t]=e[t];e=i}return e}allMatches(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e,n=[];const r=e.endPos();t<0&&(t=r+1);let s=0,a=0,o=-1;for(;a<t&&s<=r;){const t=this.doExecute(e,s,Rh.UNANCHORED,this.prog.numCap);if(null===t||0===t.length)break;let l=!0;if(t[1]===s){t[0]===o&&(l=!1);const i=e.step(s);i<0?s=r+1:s+=7&i}else s=t[1];o=t[1],l&&(n.push(i(this.pad(t))),a++)}return n}findUTF8(e){const t=this.doExecute(qh.fromUTF8(e),0,Rh.UNANCHORED,2);return null===t?null:e.slice(t[0],t[1])}findUTF8Index(e){const t=this.doExecute(qh.fromUTF8(e),0,Rh.UNANCHORED,2);return null===t?null:t.slice(0,2)}find(e){const t=this.doExecute(qh.fromUTF16(e),0,Rh.UNANCHORED,2);return null===t?"":e.substring(t[0],t[1])}findIndex(e){return this.doExecute(qh.fromUTF16(e),0,Rh.UNANCHORED,2)}findUTF8Submatch(e){const t=this.doExecute(qh.fromUTF8(e),0,Rh.UNANCHORED,this.prog.numCap);if(null===t)return null;const i=new Array(1+this.numSubexp).fill(null);for(let n=0;n<i.length;n++)2*n<t.length&&t[2*n]>=0&&(i[n]=e.slice(t[2*n],t[2*n+1]));return i}findUTF8SubmatchIndex(e){return this.pad(this.doExecute(qh.fromUTF8(e),0,Rh.UNANCHORED,this.prog.numCap))}findSubmatch(e){const t=this.doExecute(qh.fromUTF16(e),0,Rh.UNANCHORED,this.prog.numCap);if(null===t)return null;const i=new Array(1+this.numSubexp).fill(null);for(let n=0;n<i.length;n++)2*n<t.length&&t[2*n]>=0&&(i[n]=e.substring(t[2*n],t[2*n+1]));return i}findSubmatchIndex(e){return this.pad(this.doExecute(qh.fromUTF16(e),0,Rh.UNANCHORED,this.prog.numCap))}findAllUTF8(e,t){const i=this.allMatches(qh.fromUTF8(e),t,t=>e.slice(t[0],t[1]));return 0===i.length?null:i}findAllUTF8Index(e,t){const i=this.allMatches(qh.fromUTF8(e),t,e=>e.slice(0,2));return 0===i.length?null:i}findAll(e,t){const i=this.allMatches(qh.fromUTF16(e),t,t=>e.substring(t[0],t[1]));return 0===i.length?null:i}findAllIndex(e,t){const i=this.allMatches(qh.fromUTF16(e),t,e=>e.slice(0,2));return 0===i.length?null:i}findAllUTF8Submatch(e,t){const i=this.allMatches(qh.fromUTF8(e),t,t=>{let i=new Array(t.length/2|0).fill(null);for(let n=0;n<i.length;n++)t[2*n]>=0&&(i[n]=e.slice(t[2*n],t[2*n+1]));return i});return 0===i.length?null:i}findAllUTF8SubmatchIndex(e,t){const i=this.allMatches(qh.fromUTF8(e),t);return 0===i.length?null:i}findAllSubmatch(e,t){const i=this.allMatches(qh.fromUTF16(e),t,t=>{let i=new Array(t.length/2|0).fill(null);for(let n=0;n<i.length;n++)t[2*n]>=0&&(i[n]=e.substring(t[2*n],t[2*n+1]));return i});return 0===i.length?null:i}findAllSubmatchIndex(e,t){const i=this.allMatches(qh.fromUTF16(e),t);return 0===i.length?null:i}}class Ou{static quote(e){return Nh.quoteMeta(e)}static compile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=e;if(0!==(t&Ou.CASE_INSENSITIVE)&&(i="(?i)".concat(i)),0!==(t&Ou.DOTALL)&&(i="(?s)".concat(i)),0!==(t&Ou.MULTILINE)&&(i="(?m)".concat(i)),0!==(t&~(Ou.MULTILINE|Ou.DOTALL|Ou.CASE_INSENSITIVE|Ou.DISABLE_UNICODE_GROUPS|Ou.LONGEST_MATCH)))throw new jh("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH");let n=Rh.PERL;0!==(t&Ou.DISABLE_UNICODE_GROUPS)&&(n&=~Rh.UNICODE_GROUPS);const r=new Ou(e,t);return r.re2Input=Ru.compileImpl(i,n,0!==(t&Ou.LONGEST_MATCH)),r}static matches(e,t){return Ou.compile(e).matcher(t).matches()}static initTest(e,t,i){if(null==e)throw new Error("pattern is null");if(null==i)throw new Error("re2 is null");const n=new Ou(e,t);return n.re2Input=i,n}constructor(e,t){this.patternInput=e,this.flagsInput=t}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(e){return this.matcher(e).matches()}matcher(e){return Array.isArray(e)&&(e=Bh.utf8(e)),new Yh(this,e)}split(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=this.matcher(e),n=[];let r=0,s=0;for(;i.find();)if(0!==s||0!==i.end()){if(t>0&&n.length===t-1)break;if(s===i.start()){if(0===t){r+=1,s=i.end();continue}}else for(;r>0;)n.push(""),r-=1;n.push(i.substring(s,i.start())),s=i.end()}else s=i.end();if(0===t&&s!==i.inputLength()){for(;r>0;)n.push(""),r-=1;n.push(i.substring(s,i.inputLength()))}return 0===t&&0!==n.length||n.push(i.substring(s,i.inputLength())),n}toString(){return this.patternInput}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(e){return this===e||null!==e&&this.constructor===e.constructor&&(this.flagsInput===e.flagsInput&&this.patternInput
2===e.patternInput)}}f(Ou,"CASE_INSENSITIVE",1),f(Ou,"DOTALL",2),f(Ou,"MULTILINE",4),f(Ou,"DISABLE_UNICODE_GROUPS",8),f(Ou,"LONGEST_MATCH",16);const Pu=["rawOptions"];class Mu{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}Mu.UNAUTHENTICATED=new Mu(null),Mu.GOOGLE_CREDENTIALS=new Mu("google-credentials-uid"),Mu.FIRST_PARTY=new Mu("first-party-uid"),Mu.MOCK_USER=new Mu("mock-user");let Nu="12.15.0";const Iu=new Tr("@firebase/firestore");function Lu(){return Iu.logLevel}function Du(e){if(Iu.logLevel<=vr.DEBUG){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];const r=i.map(Uu);Iu.debug("Firestore (".concat(Nu,"): ").concat(e),...r)}}function Fu(e){if(Iu.logLevel<=vr.ERROR){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];const r=i.map(Uu);Iu.error("Firestore (".concat(Nu,"): ").concat(e),...r)}}function Bu(e){if(Iu.logLevel<=vr.WARN){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];const r=i.map(Uu);Iu.warn("Firestore (".concat(Nu,"): ").concat(e),...r)}}function Uu(e){if("string"==typeof e)return e;try{return function(e){return JSON.stringify(e)}(e)}catch(t){return e}}function zu(e,t,i){let n="Unexpected state";"string"==typeof t?n=t:i=t,Vu(e,n,i)}function Vu(e,t,i){let n="FIRESTORE (".concat(Nu,") INTERNAL ASSERTION FAILED: ").concat(t," (ID: ").concat(e.toString(16),")");if(void 0!==i)try{n+=" CONTEXT: "+JSON.stringify(i)}catch(e){n+=" CONTEXT: "+i}throw Fu(n),new Error(n)}function Hu(e,t,i,n){let r="Unexpected state";"string"==typeof i?r=i:n=i,e||Vu(t,r,n)}function ju(e,t){return e}const Yu={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class Wu extends Hn{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>"".concat(this.name,": [code=").concat(this.code,"]: ").concat(this.message)}}class Gu{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class Xu{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization","Bearer ".concat(e))}}class qu{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(Mu.UNAUTHENTICATED))}shutdown(){}}class Ku{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class Qu{constructor(e){this.t=e,this.currentUser=Mu.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){Hu(void 0===this.o,42304);let i=this.i;const n=e=>this.i!==i?(i=this.i,t(e)):Promise.resolve();let r=new Gu;this.o=()=>{this.i++,this.currentUser=this.u(),r.resolve(),r=new Gu,e.enqueueRetryable(()=>n(this.currentUser))};const s=()=>{const t=r;e.enqueueRetryable(async()=>{await t.promise,await n(this.currentUser)})},a=e=>{Du("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.o&&(this.auth.addAuthTokenListener(this.o),s())};this.t.onInit(e=>a(e)),setTimeout(()=>{if(!this.auth){const e=this.t.getImmediate({optional:!0});e?a(e):(Du("FirebaseAuthCredentialsProvider","Auth not yet detected"),r.resolve(),r=new Gu)}},0),s()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(t=>this.i!==e?(Du("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?(Hu("string"==typeof t.accessToken,31837,{l:t}),new Xu(t.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return Hu(null===e||"string"==typeof e,2055,{h:e}),new Mu(e)}}class Ju{constructor(e,t,i){this.T=e,this.P=t,this.R=i,this.type="FirstParty",this.user=Mu.FIRST_PARTY,this.I=new Map}A(){return this.R?this.R():null}get headers(){this.I.set("X-Goog-AuthUser",this.T);const e=this.A();return e&&this.I.set("Authorization",e),this.P&&this.I.set("X-Goog-Iam-Authorization-Token",this.P),this.I}}class Zu{constructor(e,t,i){this.T=e,this.P=t,this.R=i}getToken(){return Promise.resolve(new Ju(this.T,this.P,this.R))}start(e,t){e.enqueueRetryable(()=>t(Mu.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class $u{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class ec{constructor(e,t){this.V=t,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,Ss(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,t){Hu(void 0===this.o,3512);const i=e=>{null!=e.error&&Du("FirebaseAppCheckTokenProvider","Error getting App Check token; using placeholder token instead. Error: ".concat(e.error.message));const i=e.token!==this.m;return this.m=e.token,Du("FirebaseAppCheckTokenProvider","Received ".concat(i?"new":"existing"," token.")),i?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable(()=>i(t))};const n=e=>{Du("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(e=>n(e)),setTimeout(()=>{if(!this.appCheck){const e=this.V.getImmediate({optional:!0});e?n(e):Du("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new $u(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>e?(Hu("string"==typeof e.token,44558,{tokenResult:e}),this.m=e.token,new $u(e.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}function tc(e){const t="undefined"!=typeof self&&(self.crypto||self.msCrypto),i=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(i);else for(let n=0;n<e;
2n++)i[n]=Math.floor(256*Math.random());return i}class ic{static newId(){const e=62*Math.floor(256/62);let t="";for(;t.length<20;){const i=tc(40);for(let n=0;n<i.length;++n)t.length<20&&i[n]<e&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(i[n]%62))}return t}}function nc(e,t){return e<t?-1:e>t?1:0}function rc(e,t){const i=Math.min(e.length,t.length);for(let n=0;n<i;n++){const i=e.charAt(n),r=t.charAt(n);if(i!==r)return oc(i)===oc(r)?nc(i,r):oc(i)?1:-1}return nc(e.length,t.length)}const sc=55296,ac=57343;function oc(e){const t=e.charCodeAt(0);return t>=sc&&t<=ac}function lc(e,t,i){return e.length===t.length&&e.every((e,n)=>i(e,t[n]))}const hc="__name__";class uc{constructor(e,t,i){void 0===t?t=0:t>e.length&&zu(637,{offset:t,range:e.length}),void 0===i?i=e.length-t:i>e.length-t&&zu(1746,{length:i,range:e.length-t}),this.segments=e,this.offset=t,this.len=i}get length(){return this.len}isEqual(e){return 0===uc.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof uc?e.forEach(e=>{t.push(e)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,i=this.limit();t<i;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const i=Math.min(e.length,t.length);for(let n=0;n<i;n++){const i=uc.compareSegments(e.get(n),t.get(n));if(0!==i)return i}return nc(e.length,t.length)}static compareSegments(e,t){const i=uc.isNumericId(e),n=uc.isNumericId(t);return i&&!n?-1:!i&&n?1:i&&n?uc.extractNumericId(e).compare(uc.extractNumericId(t)):rc(e,t)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return fh.fromString(e.substring(4,e.length-2))}}class cc extends uc{construct(e,t,i){return new cc(e,t,i)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toStringWithLeadingSlash(){return"/".concat(this.canonicalString())}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(){const e=[];for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];for(const r of i){if(r.indexOf("//")>=0)throw new Wu(Yu.INVALID_ARGUMENT,"Invalid segment (".concat(r,"). Paths must not contain // in them."));e.push(...r.split("/").filter(e=>e.length>0))}return new cc(e)}static emptyPath(){return new cc([])}}const dc=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class fc extends uc{construct(e,t,i){return new fc(e,t,i)}static isValidIdentifier(e){return dc.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),fc.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&this.get(0)===hc}static keyField(){return new fc([hc])}static fromServerFormat(e){const t=[];let i="",n=0;const r=()=>{if(0===i.length)throw new Wu(Yu.INVALID_ARGUMENT,"Invalid field path (".concat(e,"). Paths must not be empty, begin with '.', end with '.', or contain '..'"));t.push(i),i=""};let s=!1;for(;n<e.length;){const t=e[n];if("\\"===t){if(n+1===e.length)throw new Wu(Yu.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const t=e[n+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new Wu(Yu.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);i+=t,n+=2}else"`"===t?(s=!s,n++):"."!==t||s?(i+=t,n++):(r(),n++)}if(r(),s)throw new Wu(Yu.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new fc(t)}static emptyPath(){return new fc([])}}class pc{constructor(e){this.path=e}static fromPath(e){return new pc(cc.fromString(e))}static fromName(e){return new pc(cc.fromString(e).popFirst(5))}static empty(){return new pc(cc.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===cc.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return cc.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new pc(new cc(e.slice()))}}function mc(e,t,i){if(!i)throw new Wu(Yu.INVALID_ARGUMENT,"Function ".concat(e,"() cannot be called with an empty ").concat(t,"."))}function gc(e){if(!pc.isDocumentKey(e))throw new Wu(Yu.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but ".concat(e," has ").concat(e.length,"."))}function vc(e){if(pc.isDocumentKey(e))throw new Wu(Yu.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but ".concat(e," has ").concat(e.length,"."))}function yc(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}function xc(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e="".concat(e.substring(0,20),"...")),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";{const t=function(e){return e.constructor?e.constructor.name:null}(e);return t?"a custom ".concat(t," object"):"an object"}}return"function"==typeof e?"a function":zu(12329,{type:typeof e})}function bc(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new Wu(Yu.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const i=xc(e);throw new Wu(Yu.INVALID_ARGUMENT,"Expected type '".concat(t.name,"', but it was: ").concat(i))}}return e}function wc(e,t){const i={typeString:e};return t&&(i.value=t),i}function Tc(e,t){if(!yc(e))throw new Wu(Yu.INVALID_ARGUMENT,"JSON must be an object");let i;for(const n in t)if(t[n]){const r=t[n].typeString,s="value"in t[n]?{value:t[n].value}:void 0;if(!(n in e)){i="JSON missing required field: '".concat(n,"'");break}const a=e[n];if(r&&typeof a!==r){i="JSON field '".concat(n,"' must be a ").concat(r,".");break}if(void 0!==s&&a!==s.value){i="Expected '".concat(n,"' field to equal '").concat(s.value,"'");break}}if(i)throw new Wu(Yu.INVALID_ARGUMENT,i);return!0}const _c=-62135596800,Sc=1e6;class Ec{static now(){return Ec.fromMillis(Date.now())}static fromDate(e){return Ec.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),i=Math.floor((e-1e3*t)*Sc);return new Ec(t,i)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new Wu(Yu.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new Wu(Yu.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<_c)throw new Wu(Yu.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new Wu(Yu.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/Sc}_compareTo(e){return this.seconds===e.seconds?nc(this.nanoseconds,e.nanoseconds):nc(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:Ec._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(Tc(e,Ec._jsonSchema))return new Ec(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-_c;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}
2}Ec._jsonSchemaVersion="firestore/timestamp/1.0",Ec._jsonSchema={type:wc("string",Ec._jsonSchemaVersion),seconds:wc("number"),nanoseconds:wc("number")};class Cc{static fromTimestamp(e){return new Cc(e)}static min(){return new Cc(new Ec(0,0))}static max(){return new Cc(new Ec(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}const Ac=-1;class kc{constructor(e,t,i,n){this.indexId=e,this.collectionGroup=t,this.fields=i,this.indexState=n}}kc.UNKNOWN_ID=-1;function Rc(e,t){const i=e.toTimestamp().seconds,n=e.toTimestamp().nanoseconds+1,r=Cc.fromTimestamp(1e9===n?new Ec(i+1,0):new Ec(i,n));return new Pc(r,pc.empty(),t)}function Oc(e){return new Pc(e.readTime,e.key,Ac)}class Pc{constructor(e,t,i){this.readTime=e,this.documentKey=t,this.largestBatchId=i}static min(){return new Pc(Cc.min(),pc.empty(),Ac)}static max(){return new Pc(Cc.max(),pc.empty(),Ac)}}function Mc(e,t){let i=e.readTime.compareTo(t.readTime);return 0!==i?i:(i=pc.comparator(e.documentKey,t.documentKey),0!==i?i:nc(e.largestBatchId,t.largestBatchId))}const Nc="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class Ic{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}async function Lc(e){if(e.code!==Yu.FAILED_PRECONDITION||e.message!==Nc)throw e;Du("LocalStore","Unexpectedly lost primary lease")}class Dc{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)},e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&zu(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new Dc((i,n)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(i,n)},this.catchCallback=e=>{this.wrapFailure(t,e).next(i,n)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{const t=e();return t instanceof Dc?t:Dc.resolve(t)}catch(e){return Dc.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):Dc.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):Dc.reject(t)}static resolve(e){return new Dc((t,i)=>{t(e)})}static reject(e){return new Dc((t,i)=>{i(e)})}static waitFor(e){return new Dc((t,i)=>{let n=0,r=0,s=!1;e.forEach(e=>{++n,e.next(()=>{++r,s&&r===n&&t()},e=>i(e))}),s=!0,r===n&&t()})}static or(e){let t=Dc.resolve(!1);for(const i of e)t=t.next(e=>e?Dc.resolve(e):i());return t}static forEach(e,t){const i=[];return e.forEach((e,n)=>{i.push(t.call(this,e,n))}),this.waitFor(i)}static mapArray(e,t){return new Dc((i,n)=>{const r=e.length,s=new Array(r);let a=0;for(let o=0;o<r;o++){const l=o;t(e[l]).next(e=>{s[l]=e,++a,a===r&&i(s)},e=>n(e))}})}static doWhile(e,t){return new Dc((i,n)=>{const r=()=>{!0===e()?t().next(()=>{r()},n):i()};r()})}}function Fc(e){const t=e.match(/Android ([\d.]+)/i),i=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(i)}function Bc(e){return"IndexedDbTransactionError"===e.name}class Uc{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.ae(e),this.ue=e=>t.writeSequenceNumber(e))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ue&&this.ue(e),e}}Uc.ce=-1;const zc=-1;function Vc(e){return null==e}function Hc(e){return 0===e&&1/e==-1/0}function jc(e){return"number"==typeof e&&Number.isInteger(e)&&!Hc(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}function Yc(e){return"string"==typeof e}const Wc="\x01";function Gc(e){let t="";for(let i=0;i<e.length;i++)t.length>0&&(t=qc(t)),t=Xc(e.get(i),t);return qc(t)}function Xc(e,t){let i=t;const n=e.length;for(let r=0;r<n;r++){const t=e.charAt(r);switch(t){case"\0":i+="\x01\x10";break;case Wc:i+="\x01\x11";break;default:i+=t}}return i}function qc(e){return e+Wc+"\x01"}
vendor: 5,251 bytes, line 2
2const Kc="remoteDocuments",Qc="owner",Jc="mutationQueues",Zc="mutations";const $c="documentMutations",ed="remoteDocumentsV14",td="remoteDocumentGlobal",id="targets",nd="targetDocuments",rd="targetGlobal",sd="collectionParents",ad="clientMetadata",od="bundles",ld="namedQueries",hd="indexConfiguration",ud="indexState",cd="indexEntries",dd="documentOverlays",fd="globals",pd=[Jc,Zc,$c,Kc,id,Qc,rd,nd,ad,td,sd,od,ld],md=[Jc,Zc,$c,ed,id,Qc,rd,nd,ad,td,sd,od,ld,dd],gd=md,vd=[...gd,hd,ud,cd];class yd{constructor(e,t){this.comparator=e,this.root=t||bd.EMPTY}insert(e,t){return new yd(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,bd.BLACK,null,null))}remove(e){return new yd(this.comparator,this.root.remove(e,this.comparator).copy(null,null,bd.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const i=this.comparator(e,t.key);if(0===i)return t.value;i<0?t=t.left:i>0&&(t=t.right)}return null}indexOf(e){let t=0,i=this.root;for(;!i.isEmpty();){const n=this.comparator(e,i.key);if(0===n)return t+i.left.size;n<0?i=i.left:(t+=i.left.size+1,i=i.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,i)=>(e(t,i),!1))}toString(){const e=[];return this.inorderTraversal((t,i)=>(e.push("".concat(t,":").concat(i)),!1)),"{".concat(e.join(", "),"}")}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new xd(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new xd(this.root,e,this.comparator,!1)}getReverseIterator(){return new xd(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new xd(this.root,e,this.comparator,!0)}}class xd{constructor(e,t,i,n){this.isReverse=n,this.nodeStack=[];let r=1;for(;!e.isEmpty();)if(r=t?i(e.key,t):1,t&&n&&(r*=-1),r<0)e=this.isReverse?e.left:e.right;else{if(0===r){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class bd{constructor(e,t,i,n,r){this.key=e,this.value=t,this.color=null!=i?i:bd.RED,this.left=null!=n?n:bd.EMPTY,this.right=null!=r?r:bd.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,i,n,r){return new bd(null!=e?e:this.key,null!=t?t:this.value,null!=i?i:this.color,null!=n?n:this.left,null!=r?r:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,i){let n=this;const r=i(e,n.key);return n=r<0?n.copy(null,null,null,n.left.insert(e,t,i),null):0===r?n.copy(null,t,null,null,null):n.copy(null,null,null,null,n.right.insert(e,t,i)),n.fixUp()}removeMin(){if(this.left.isEmpty())return bd.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let i,n=this;if(t(e,n.key)<0)n.left.isEmpty()||n.left.isRed()||n.left.left.isRed()||(n=n.moveRedLeft()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed()&&(n=n.rotateRight()),n.right.isEmpty()||n.right.isRed()||n.right.left.isRed()||(n=n.moveRedRight()),0===t(e,n.key)){if(n.right.isEmpty())return bd.EMPTY;i=n.right.min(),n=n.copy(i.key,i.value,null,null,n.right.removeMin())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,bd.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,bd.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw zu(43730,{key:this.key,value:this.value});if(this.right.isRed())throw zu(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw zu(27949);return e+(this.isRed()?0:1)}}
2bd.EMPTY=null,bd.RED=!0,bd.BLACK=!1,bd.EMPTY=new class{constructor(){this.size=0}get key(){throw zu(57766)}get value(){throw zu(16141)}get color(){throw zu(16727)}get left(){throw zu(29726)}get right(){throw zu(36894)}copy(e,t,i,n,r){return this}insert(e,t,i){return new bd(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class wd{constructor(e){this.comparator=e,this.data=new yd(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,i)=>(e(t),!1))}forEachInRange(e,t){const i=this.data.getIteratorFrom(e[0]);for(;i.hasNext();){const n=i.getNext();if(this.comparator(n.key,e[1])>=0)return;t(n.key)}}forEachWhile(e,t){let i;for(i=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();i.hasNext();)if(!e(i.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new Td(this.data.getIterator())}getIteratorFrom(e){return new Td(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach(e=>{t=t.add(e)}),t}isEqual(e){if(!(e instanceof wd))return!1;if(this.size!==e.size)return!1;const t=this.data.getIterator(),i=e.data.getIterator();for(;t.hasNext();){const e=t.getNext().key,n=i.getNext().key;if(0!==this.comparator(e,n))return!1}return!0}toArray(){const e=[];return this.forEach(t=>{e.push(t)}),e}toString(){const e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){const t=new wd(this.comparator);return t.data=e,t}}class Td{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}class _d{constructor(e){this.fields=e,e.sort(fc.comparator)}static empty(){return new _d([])}unionWith(e){let t=new wd(fc.comparator);for(const i of this.fields)t=t.add(i);for(const i of e)t=t.add(i);return new _d(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return lc(this.fields,e.fields,(e,t)=>e.isEqual(t))}}function Sd(e){let t=0;for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&t++;return t}function Ed(e,t){for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&t(i,e[i])}function Cd(e,t){const i=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&i.push(t(e[n],n,e));return i}function Ad(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}class kd extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class Rd{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(e){try{return atob(e)}catch(e){throw"undefined"!=typeof DOMException&&e instanceof DOMException?new kd("Invalid base64 string: "+e):e}}(e);return new Rd(t)}static fromUint8Array(e){const t=function(e){let t="";for(let i=0;i<e.length;++i)t+=String.fromCharCode(e[i]);return t}(e);return new Rd(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return e=this.binaryString,btoa(e);var e}toUint8Array(){return function(e){const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return nc(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Rd.EMPTY_BYTE_STRING=new Rd("");const Od=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Pd(e){if(Hu(!!e,39018),"string"==typeof e){let t=0;const i=Od.exec(e);if(Hu(!!i,46558,{timestamp:e}),i[1]){let e=i[1];e=(e+"000000000").substr(0,9),t=Number(e)}const n=new Date(e);return{seconds:Math.floor(n.getTime()/1e3),nanos:t}}return{seconds:Md(e.seconds),nanos:Md(e.nanos)}}function Md(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function Nd(e){return"string"==typeof e?Rd.fromBase64String(e):Rd.fromUint8Array(e)}const Id="server_timestamp",Ld="__type__",Dd="__previous_value__",Fd="__local_write_time__";function Bd(e){var t,i;return(null===(t=((null===e||void 0===e||null===(i=e.mapValue)||void 0===i?void 0:i.fields)||{})[Ld])||void 0===t?void 0:t.stringValue)===Id}function Ud(e){const t=e.mapValue.fields[Dd];return Bd(t)?Ud(t):t}function zd(e){const t=Pd(e.mapValue.fields[Fd].timestampValue);return new Ec(t.seconds,t.nanos)}class Vd{constructor(e,t,i,n,r,s,a,o,l,h,u){this.databaseId=e,this.appId=t,this.persistenceKey=i,this.host=n,this.ssl=r,this.forceLongPolling=s,this.autoDetectLongPolling=a,this.longPollingOptions=o,this.useFetchStreams=l,this.isUsingEmulator=h,this.apiKey=u}}const Hd="(default)";class jd{constructor(e,t){this.projectId=e,this.database=t||Hd}static empty(){return new jd("","")}get isDefaultDatabase(){return this.database===Hd}isEqual(e){return e instanceof jd&&e.projectId===this.projectId&&e.database===this.database}}const Yd="__type__",Wd="__max__",Gd={mapValue:{fields:{__type__:{stringValue:Wd}}}},Xd="__vector__",qd="value",Kd={nullValue:"NULL_VALUE"},Qd={booleanValue:!0},Jd={booleanValue:!1};function Zd(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?Bd(e)?4:xf(e)?9007199254740991:gf(e)?10:11:zu(28295,{value:e})}function $d(e,t,i){if(e===t)return!0;const n=Zd(e);if(n!==Zd(t))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return zd(e).isEqual(zd(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;const i=Pd(e.timestampValue),n=Pd(t.timestampValue);return i.seconds===n.seconds&&i.nanos===n.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(e,t){return Nd(e.bytesValue).isEqual(Nd(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return Md(e.geoPointValue.latitude)===Md(t.geoPointValue.latitude)&&Md(e.geoPointValue.longitude)===Md(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t,i){if("integerValue"in e&&"integerValue"in t)return Md(e.integerValue)===Md(t.integerValue);let n,r;if("doubleValue"in e&&"doubleValue"in t)n=Md(e.doubleValue),r=Md(t.doubleValue);else{var s,a;if(null===i||void 0===i||!i.Ee)return!1;n=Md(null!==(s=e.integerValue)&&void 0!==s?s:e.doubleValue),r=Md(null!==(a=t.integerValue)&&void 0!==a?a:t.doubleValue)}return n===r?!(null===i||void 0===i||!i.he)||Hc(n)===Hc(r):!(void 0!==i&&!i.Te)&&isNaN(n)&&isNaN(r)}(e,t,i);case 9:return lc(e.arrayValue.values||[],t.arrayValue.values||[],(e,t)=>$d(e,t,i));case 10:case 11:return function(e,t,i){const n=e.mapValue.fields||{},r=t.mapValue.fields||{};if(Sd(n)!==Sd(r))return!1;for(const s in n)if(n.hasOwnProperty(s)&&(void 0===r[s]||!$d(n[s],r[s],i)))return!1;return!0}(e,t,i);default:return zu(52216,{left:e})}}function ef(e,t){return void 0!==(e.values||[]).find(e=>$d(e,t))}function tf(e,t){if(e===t)return 0;const i=Zd(e),n=Zd(t);if(i!==n)return nc(i,n);switch(i){case 0:case 9007199254740991:return 0;case 1:return nc(e.booleanValue,t.booleanValue);case 2:return function(e,t){const i=Md(e.integerValue||e.doubleValue),n=Md(t.integerValue||t.doubleValue);return i<n?-1:i>n?1:i===n?0:isNaN(i)?isNaN(n)?0:-1:1}(e,t);case 3:return nf(e.timestampValue,t.timestampValue);case 4:return nf(zd(e),zd(t));case 5:return rc(e.stringValue,t.stringValue);case 6:return function(e,t){const i=Nd(e),n=Nd(t);return i.compareTo(n)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){const i=e.split("/"),n=t.split("/");for(let r=0;r<i.length&&r<n.length;r++){const e=nc(i[r],n[r]);if(0!==e)return e}return nc(i.length,n.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){const i=nc(Md(e.latitude),Md(t.latitude));return 0!==i?i:nc(Md(e.longitude),Md(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return rf(e.arrayValue,t.arrayValue);case 10:return function(e,t){var i,n,r,s;const a=e.fields||{},o=t.fields||{},l=null===(i=a[qd])||void 0===i?void 0:i.arrayValue,h=null===(n=o[qd])||void 0===n?void 0:n.arrayValue,u=nc((null===l||void 0===l||null===(r=l.values)||void 0===r?void 0:r.length)||0,(null===h||void 0===h||null===(s=h.values)||void 0===s?void 0:s.length)||0);return 0!==u?u:rf(l,h)}(e.mapValue,t.mapValue);case 11:return function(e,t){if(e===Gd.mapValue&&t===Gd.mapValue)return 0;if(e===Gd.mapValue)return 1;if(t===Gd.mapValue)return-1;const i=e.fields||{},n=Object.keys(i),r=t.fields||{},s=Object.keys(r);n.sort(),s.sort();for(let a=0;a<n.length&&a<s.length;++a){const e=rc(n[a],s[a]);if(0!==e)return e;const t=tf(i[n[a]],r[s[a]]);if(0!==t)return t}return nc(n.length,s.length)}(e.mapValue,t.mapValue);default:throw zu(23264,{Pe:i})}}function nf(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return nc(e,t);const i=Pd(e),n=Pd(t),r=nc(i.seconds,n.seconds);return 0!==r?r:nc(i.nanos,n.nanos)}function rf(e,t){const i=e.values||[],n=t.values||[];for(let r=0;r<i.length&&r<n.length;++r){const e=tf(i[r],n[r]);if(void 0!==e&&0!==e)return e}return nc(i.length,n.length)}function sf(e){return af(e)}function af(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(e){const t=Pd(e);return"time(".concat(t.seconds,",").concat(t.nanos,")")}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?function(e){return Nd(e).toBase64()}(e.bytesValue):"referenceValue"in e?function(e){return pc.fromName(e).toString()}(e.referenceValue):"geoPointValue"in e?function(e){return"geo(".concat(e.latitude,",").concat(e.longitude,")")}(e.geoPointValue):"arrayValue"in e?function(e){let t="[",i=!0;for(const n of e.values||[])i?i=!1:t+=",",t+=af(n);return t+"]"}(e.arrayValue):"mapValue"in e?function(e){const t=Object.keys(e.fields||{}).sort();let i="{",n=!0;for(const r of t)n?n=!1:i+=",",i+="".concat(r,":").concat(af(e.fields[r]));return i+"}"}(e.mapValue):zu(61005,{value:e})}function of(e){switch(Zd(e)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const t=Ud(e);return t?16+of(t):16;case 5:return 2*e.stringValue.length;case 6:return Nd(e.bytesValue).approximateByteSize();case 7:return e.referenceValue.length;case 9:return function(e){return(e.values||[]).reduce((e,t)=>
2e+of(t),0)}(e.arrayValue);case 10:case 11:return function(e){let t=0;return Ed(e.fields,(e,i)=>{t+=e.length+of(i)}),t}(e.mapValue);default:throw zu(13486,{value:e})}}function lf(e,t){return{referenceValue:"projects/".concat(e.projectId,"/databases/").concat(e.database,"/documents/").concat(t.path.canonicalString())}}function hf(e){return!!e&&"integerValue"in e}function uf(e){return!!e&&"doubleValue"in e}function cf(e){return hf(e)||uf(e)}function df(e){return!!e&&"arrayValue"in e}function ff(e){return!!e&&"nullValue"in e}function pf(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function mf(e){return!!e&&"mapValue"in e}function gf(e){var t,i;return(null===(t=((null===e||void 0===e||null===(i=e.mapValue)||void 0===i?void 0:i.fields)||{})[Yd])||void 0===t?void 0:t.stringValue)===Xd}function vf(e){var t,i;return null===(t=((null===e||void 0===e||null===(i=e.mapValue)||void 0===i?void 0:i.fields)||{})[qd])||void 0===t?void 0:t.arrayValue}function yf(e){if(e.geoPointValue)return{geoPointValue:m({},e.geoPointValue)};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:m({},e.timestampValue)};if(e.mapValue){const t={mapValue:{fields:{}}};return Ed(e.mapValue.fields,(e,i)=>t.mapValue.fields[e]=yf(i)),t}if(e.arrayValue){const t={arrayValue:{values:[]}};for(let i=0;i<(e.arrayValue.values||[]).length;++i)t.arrayValue.values[i]=yf(e.arrayValue.values[i]);return t}return m({},e)}function xf(e){return(((e.mapValue||{}).fields||{}).__type__||{}).stringValue===Wd}class bf{constructor(e){this.value=e}static empty(){return new bf({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let i=0;i<e.length-1;++i)if(t=(t.mapValue.fields||{})[e.get(i)],!mf(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=yf(t)}setAll(e){let t=fc.emptyPath(),i={},n=[];e.forEach((e,r)=>{if(!t.isImmediateParentOf(r)){const e=this.getFieldsMap(t);this.applyChanges(e,i,n),i={},n=[],t=r.popLast()}e?i[r.lastSegment()]=yf(e):n.push(r.lastSegment())});const r=this.getFieldsMap(t);this.applyChanges(r,i,n)}delete(e){const t=this.field(e.popLast());mf(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return $d(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let i=0;i<e.length;++i){let n=t.mapValue.fields[e.get(i)];mf(n)&&n.mapValue.fields||(n={mapValue:{fields:{}}},t.mapValue.fields[e.get(i)]=n),t=n}return t.mapValue.fields}applyChanges(e,t,i){Ed(t,(t,i)=>e[t]=i);for(const n of i)delete e[n]}clone(){return new bf(yf(this.value))}}function wf(e){const t=[];return Ed(e.fields,(e,i)=>{const n=new fc([e]);if(mf(i)){const e=wf(i.mapValue).fields;if(0===e.length)t.push(n);else for(const i of e)t.push(n.child(i))}else t.push(n)}),new _d(t)}function Tf(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Hc(t)?"-0":t}}function _f(e){return{integerValue:""+e}}function Sf(e,t,i){return Number.isInteger(t)&&null!==i&&void 0!==i&&i.preferIntegers||jc(t)?_f(t):Tf(e,t)}class Ef{constructor(){this._=void 0}}function Cf(e,t,i){return e instanceof Rf?function(e,t){const i={fields:{[Ld]:{stringValue:Id},[Fd]:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&Bd(t)&&(t=Ud(t)),t&&(i.fields[Dd]=t),{mapValue:i}}(i,t):e instanceof Of?Pf(e,t):e instanceof Mf?Nf(e,t):e instanceof Lf?function(e,t){const i=kf(e,t),n=Uf(i)+Uf(e.Re);return hf(i)&&hf(e.Re)?_f(n):Tf(e.serializer,n)}(e,t):e instanceof Df?function(e,t){return Bf(e,t,Math.min)}(e,t):e instanceof Ff?function(e,t){return Bf(e,t,Math.max)}(e,t):void 0}function Af(e,t,i){return e instanceof Of?Pf(e,t):e instanceof Mf?Nf(e,t):i}function kf(e,t){return e instanceof Lf?cf(t)?t:{integerValue:0}:null}class Rf extends Ef{}class Of extends Ef{constructor(e){super(),this.elements=e}}function Pf(e,t){const i=zf(t);for(const n of e.elements)i.some(e=>$d(e,n))||i.push(n);return{arrayValue:{values:i}}}
2class Mf extends Ef{constructor(e){super(),this.elements=e}}function Nf(e,t){let i=zf(t);for(const n of e.elements)i=i.filter(e=>!$d(e,n));return{arrayValue:{values:i}}}class If extends Ef{constructor(e,t){super(),this.serializer=e,this.Re=t}}class Lf extends If{}class Df extends If{}class Ff extends If{}function Bf(e,t,i){if(!cf(t))return e.Re;const n=i(Uf(t),Uf(e.Re));return hf(t)&&hf(e.Re)?_f(n):Tf(e.serializer,n)}function Uf(e){return Md(e.integerValue||e.doubleValue)}function zf(e){return df(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class Vf{constructor(e,t){this.field=e,this.transform=t}}class Hf{constructor(e,t){this.version=e,this.transformResults=t}}class jf{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new jf}static exists(e){return new jf(void 0,e)}static updateTime(e){return new jf(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Yf(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class Wf{}function Gf(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new ip(e.key,jf.none()):new Jf(e.key,e.data,jf.none());{const i=e.data,n=bf.empty();let r=new wd(fc.comparator);for(let e of t.fields)if(!r.has(e)){let t=i.field(e);null===t&&e.length>1&&(e=e.popLast(),t=i.field(e)),null===t?n.delete(e):n.set(e,t),r=r.add(e)}return new Zf(e.key,n,new _d(r.toArray()),jf.none())}}function Xf(e,t,i){e instanceof Jf?function(e,t,i){const n=e.value.clone(),r=ep(e.fieldTransforms,t,i.transformResults);n.setAll(r),t.convertToFoundDocument(i.version,n).setHasCommittedMutations()}(e,t,i):e instanceof Zf?function(e,t,i){if(!Yf(e.precondition,t))return void t.convertToUnknownDocument(i.version);const n=ep(e.fieldTransforms,t,i.transformResults),r=t.data;r.setAll($f(e)),r.setAll(n),t.convertToFoundDocument(i.version,r).setHasCommittedMutations()}(e,t,i):function(e,t,i){t.convertToNoDocument(i.version).setHasCommittedMutations()}(0,t,i)}function qf(e,t,i,n){return e instanceof Jf?function(e,t,i,n){if(!Yf(e.precondition,t))return i;const r=e.value.clone(),s=tp(e.fieldTransforms,n,t);return r.setAll(s),t.convertToFoundDocument(t.version,r).setHasLocalMutations(),null}(e,t,i,n):e instanceof Zf?function(e,t,i,n){if(!Yf(e.precondition,t))return i;const r=tp(e.fieldTransforms,n,t),s=t.data;return s.setAll($f(e)),s.setAll(r),t.convertToFoundDocument(t.version,s).setHasLocalMutations(),null===i?null:i.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map(e=>e.field))}(e,t,i,n):function(e,t,i){return Yf(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):i}(e,t,i)}function Kf(e,t){let i=null;for(const n of e.fieldTransforms){const e=t.data.field(n.field),r=kf(n.transform,e||null);null!=r&&(null===i&&(i=bf.empty()),i.set(n.field,r))}return i||null}function Qf(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(e,t){return void 0===e&&void 0===t||!(!e||!t)&&lc(e,t,(e,t)=>function(e,t){return e.field.isEqual(t.field)&&function(e,t){return e instanceof Of&&t instanceof Of||e instanceof Mf&&t instanceof Mf?lc(e.elements,t.elements,$d):e instanceof Lf&&t instanceof Lf||e instanceof Df&&t instanceof Df||e instanceof Ff&&t instanceof Ff?$d(e.Re,t.Re):e instanceof Rf&&t instanceof Rf}(e.transform,t.transform)}(e,t))}(e.fieldTransforms,t.fieldTransforms)&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class Jf extends Wf{constructor(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];super(),this.key=e,this.value=t,this.precondition=i,this.fieldTransforms=n,this.type=0}getFieldMask(){return null}}class Zf extends Wf{constructor(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];super(),this.key=e,this.data=t,this.fieldMask=i,this.precondition=n,this.fieldTransforms=r,this.type=1}getFieldMask(){return this.fieldMask}}function $f(e){const t=new Map;return e.fieldMask.fields.forEach(i=>
2{if(!i.isEmpty()){const n=e.data.field(i);t.set(i,n)}}),t}function ep(e,t,i){const n=new Map;Hu(e.length===i.length,32656,{Ie:i.length,Ae:e.length});for(let r=0;r<i.length;r++){const s=e[r],a=s.transform,o=t.data.field(s.field);n.set(s.field,Af(a,o,i[r]))}return n}function tp(e,t,i){const n=new Map;for(const r of e){const e=r.transform,s=i.data.field(r.field);n.set(r.field,Cf(e,s,t))}return n}class ip extends Wf{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class np extends Wf{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class rp{constructor(e,t){this.position=e,this.inclusive=t}}function sp(e,t,i){let n=0;for(let r=0;r<e.position.length;r++){const s=t[r],a=e.position[r];if(n=s.field.isKeyField()?pc.comparator(pc.fromName(a.referenceValue),i.key):tf(a,i.data.field(s.field)),"desc"===s.dir&&(n*=-1),0!==n)break}return n}function ap(e,t){if(null===e)return null===t;if(null===t)return!1;if(e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(let i=0;i<e.position.length;i++)if(!$d(e.position[i],t.position[i]))return!1;return!0}class op{}class lp extends op{constructor(e,t,i){super(),this.field=e,this.op=t,this.value=i}static create(e,t,i){return e.isKeyField()?"in"===t||"not-in"===t?this.createKeyFieldInFilter(e,t,i):new gp(e,t,i):"array-contains"===t?new bp(e,i):"in"===t?new wp(e,i):"not-in"===t?new Tp(e,i):"array-contains-any"===t?new _p(e,i):new lp(e,t,i)}static createKeyFieldInFilter(e,t,i){return"in"===t?new vp(e,i):new yp(e,i)}matches(e){const t=e.data.field(this.field);return"!="===this.op?null!==t&&void 0===t.nullValue&&this.matchesComparison(tf(t,this.value)):null!==t&&Zd(this.value)===Zd(t)&&this.matchesComparison(tf(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return zu(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class hp extends op{constructor(e,t){super(),this.filters=e,this.op=t,this.Ve=null}static create(e,t){return new hp(e,t)}matches(e){return up(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.Ve||(this.Ve=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.Ve}getFilters(){return Object.assign([],this.filters)}}function up(e){return"and"===e.op}function cp(e){return dp(e)&&up(e)}function dp(e){for(const t of e.filters)if(t instanceof hp)return!1;return!0}function fp(e){if(e instanceof lp)return e.field.canonicalString()+e.op.toString()+sf(e.value);if(cp(e))return e.filters.map(e=>fp(e)).join(",");{const t=e.filters.map(e=>fp(e)).join(",");return"".concat(e.op,"(").concat(t,")")}}function pp(e,t){return e instanceof lp?function(e,t){return t instanceof lp&&e.op===t.op&&e.field.isEqual(t.field)&&$d(e.value,t.value)}(e,t):e instanceof hp?function(e,t){return t instanceof hp&&e.op===t.op&&e.filters.length===t.filters.length&&e.filters.reduce((e,i,n)=>e&&pp(i,t.filters[n]),!0)}(e,t):void zu(19439)}function mp(e){return e instanceof lp?function(e){return"".concat(e.field.canonicalString()," ").concat(e.op," ").concat(sf(e.value))}(e):e instanceof hp?function(e){return e.op.toString()+" {"+e.getFilters().map(mp).join(" ,")+"}"}(e):"Filter"}class gp extends lp{constructor(e,t,i){super(e,t,i),this.key=pc.fromName(i.referenceValue)}matches(e){const t=pc.comparator(e.key,this.key);return this.matchesComparison(t)}}class vp extends lp{constructor(e,t){super(e,"in",t),this.keys=xp("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class yp extends lp{constructor(e,t){super(e,"not-in",t),this.keys=xp("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function xp(e,t){var i;return((null===(i=t.arrayValue)||void 0===i?void 0:i.values)||[]).map(e=>pc.fromName(e.referenceValue))}class bp extends lp{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return df(t)&&ef(t.arrayValue,this.value)}}class wp extends lp{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return null!==t&&ef(this.value.arrayValue,t)}}class Tp extends lp{constructor(e,t){super(e,"not-in",t)}matches(e){if(ef(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return null!==t&&void 0===t.nullValue&&!ef(this.value.arrayValue,t)}}class _p extends lp{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!df(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>ef(this.value.arrayValue,e))}}class Sp{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asc";this.field=e,this.dir=t}}function Ep(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}class Cp{constructor(e,t,i,n,r,s,a){this.key=e,this.documentType=t,this.version=i,this.readTime=n,this.createTime=r,this.data=s,this.documentState=a}static newInvalidDocument(e){return new Cp(e,0,Cc.min(),Cc.min(),Cc.min(),bf.empty(),0)}static newFoundDocument(e,t,i,n){return new Cp(e,1,t,Cc.min(),i,n,0)}static newNoDocument(e,t){return new Cp(e,2,t,Cc.min(),Cc.min(),bf.empty(),0)}static newUnknownDocument(e,t){return new Cp(e,3,t,Cc.min(),Cc.min(),bf.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(Cc.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=bf.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=bf.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=Cc.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof Cp&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new Cp(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return"Document(".concat(this.key,", ").concat(this.version,", ").concat(JSON.stringify(this.data.value),", {createTime: ").concat(this.createTime,"}), {documentType: ").concat(this.documentType,"}), {documentState: ").concat(this.documentState,"})")}}class Ap{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;this.path=e,this.collectionGroup=t,this.orderBy=i,this.filters=n,this.limit=r,this.startAt=s,this.endAt=a,this.de=null}}function kp(e){return new Ap(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,arguments.length>6&&void 0!==arguments[6]?arguments[6]:null)}function Rp(e){const t=ju(e);if(null===t.de){let e=t.path.canonicalString();null!==t.collectionGroup&&(e+="|cg:"+t.collectionGroup),e+="|f:",e+=t.filters.map(e=>fp(e)).join(","),e+="|ob:",e+=t.orderBy.map(e=>function(e){return e.field.canonicalString()+e.dir}(e)).join(","),Vc(t.limit)||(e+="|l:",e+=t.limit),t.startAt&&(e+="|lb:",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map(e=>sf(e)).join(",")),t.endAt&&(e+="|ub:",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map(e=>sf(e)).join(",")),t.de=e}return t.de}function Op(e,t){if(e.limit!==t.limit)return!1;if(e.orderBy.length!==t.orderBy.length)return!1;for(let i=0;i<e.orderBy.length;i++)if(!Ep(e.orderBy[i],t.orderBy[i]))return!1;if(e.filters.length!==t.filters.length)return!1;for(let i=0;i<e.filters.length;i++)if(!pp(e.filters[i],t.filters[i]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!ap(e.startAt,t.startAt)&&ap(e.endAt,t.endAt)}function Pp(e){return!!e.isCorePipeline}function Mp(e){return!!e.path&&pc.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}class Np{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"F",a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;this.path=e,this.collectionGroup=t,this.explicitOrderBy=i,this.filters=n,this.limit=r,this.limitType=s,this.startAt=a,this.endAt=o,this.fe=null,this.me=null,this.pe=null,this.startAt,this.endAt}}function Ip(e,t,i,n,r,s,a,o){return new Np(e,t,i,n,r,s,a,o)}function Lp(e){return new Np(e)}function Dp(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function Fp(e){return pc.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}function Bp(e){return null!==e.collectionGroup}function Up(e){const t=ju(e);if(null===t.fe){t.fe=[];const e=new Set;for(const r of t.explicitOrderBy)t.fe.push(r),e.add(r.field.canonicalString());const i=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc",n=function(e){let t=new wd(fc.comparator);
2return e.filters.forEach(e=>{e.getFlattenedFilters().forEach(e=>{e.isInequality()&&(t=t.add(e.field))})}),t}(t);n.forEach(n=>{e.has(n.canonicalString())||n.isKeyField()||t.fe.push(new Sp(n,i))}),e.has(fc.keyField().canonicalString())||t.fe.push(new Sp(fc.keyField(),i))}return t.fe}function zp(e){const t=ju(e);return t.me||(t.me=Vp(t,Up(e))),t.me}function Vp(e,t){if("F"===e.limitType)return kp(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(e=>{const t="desc"===e.dir?"asc":"desc";return new Sp(e.field,t)});const i=e.endAt?new rp(e.endAt.position,e.endAt.inclusive):null,n=e.startAt?new rp(e.startAt.position,e.startAt.inclusive):null;return kp(e.path,e.collectionGroup,t,e.filters,e.limit,i,n)}}function Hp(e,t){const i=e.filters.concat([t]);return new Np(e.path,e.collectionGroup,e.explicitOrderBy.slice(),i,e.limit,e.limitType,e.startAt,e.endAt)}function jp(e,t,i){return new Np(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,i,e.startAt,e.endAt)}function Yp(e,t){return Op(zp(e),zp(t))&&e.limitType===t.limitType}function Wp(e){return"Query(target=".concat(function(e){let t=e.path.canonicalString();return null!==e.collectionGroup&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=", filters: [".concat(e.filters.map(e=>mp(e)).join(", "),"]")),Vc(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=", orderBy: [".concat(e.orderBy.map(e=>function(e){return"".concat(e.field.canonicalString()," (").concat(e.dir,")")}(e)).join(", "),"]")),e.startAt&&(t+=", startAt: ",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(e=>sf(e)).join(",")),e.endAt&&(t+=", endAt: ",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(e=>sf(e)).join(",")),"Target(".concat(t,")")}(zp(e)),"; limitType=").concat(e.limitType,")")}function Gp(e,t){return t.isFoundDocument()&&function(e,t){const i=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(i):pc.isDocumentKey(e.path)?e.path.isEqual(i):e.path.isImmediateParentOf(i)}(e,t)&&function(e,t){for(const i of Up(e))if(!i.field.isKeyField()&&null===t.data.field(i.field))return!1;return!0}(e,t)&&function(e,t){for(const i of e.filters)if(!i.matches(t))return!1;return!0}(e,t)&&function(e,t){return!(e.startAt&&!function(e,t,i){const n=sp(e,t,i);return e.inclusive?n<=0:n<0}(e.startAt,Up(e),t))&&!(e.endAt&&!function(e,t,i){const n=sp(e,t,i);return e.inclusive?n>=0:n>0}(e.endAt,Up(e),t))}(e,t)}function Xp(e){return(t,i)=>{let n=!1;for(const r of Up(e)){const e=qp(r,t,i);if(0!==e)return e;n=n||r.field.isKeyField()}return 0}}function qp(e,t,i){const n=e.field.isKeyField()?pc.comparator(t.key,i.key):function(e,t,i){const n=t.data.field(e),r=i.data.field(e);return null!==n&&null!==r?tf(n,r):zu(42886)}(e.field,t,i);switch(e.dir){case"asc":return n;case"desc":return-1*n;default:return zu(19790,{direction:e.dir})}}class Kp{constructor(e,t){this.count=e,this.unchangedNames=t}}var Qp,Jp;function Zp(e){switch(e){case Yu.OK:return zu(64938);case Yu.CANCELLED:case Yu.UNKNOWN:case Yu.DEADLINE_EXCEEDED:case Yu.RESOURCE_EXHAUSTED:case Yu.INTERNAL:case Yu.UNAVAILABLE:case Yu.UNAUTHENTICATED:return!1;case Yu.INVALID_ARGUMENT:case Yu.NOT_FOUND:case Yu.ALREADY_EXISTS:case Yu.PERMISSION_DENIED:case Yu.FAILED_PRECONDITION:case Yu.ABORTED:case Yu.OUT_OF_RANGE:case Yu.UNIMPLEMENTED:case Yu.DATA_LOSS:return!0;default:return zu(15467,{code:e})}}function $p(e){if(void 0===e)return Fu("GRPC error has no .code"),Yu.UNKNOWN;switch(e){case Qp.OK:return Yu.OK;case Qp.CANCELLED:return Yu.CANCELLED;case Qp.UNKNOWN:return Yu.UNKNOWN;case Qp.DEADLINE_EXCEEDED:return Yu.DEADLINE_EXCEEDED;case Qp.RESOURCE_EXHAUSTED:return Yu.RESOURCE_EXHAUSTED;case Qp.INTERNAL:return Yu.INTERNAL;case Qp.UNAVAILABLE:return Yu.UNAVAILABLE;case Qp.UNAUTHENTICATED:return Yu.UNAUTHENTICATED;case Qp.INVALID_ARGUMENT:return Yu.INVALID_ARGUMENT;case Qp.NOT_FOUND:return Yu.NOT_FOUND;case Qp.ALREADY_EXISTS:return Yu.ALREADY_EXISTS;case Qp.PERMISSION_DENIED:return Yu.PERMISSION_DENIED;case Qp.FAILED_PRECONDITION:return Yu.FAILED_PRECONDITION;case Qp.ABORTED:return Yu.ABORTED;case Qp.OUT_OF_RANGE:return Yu.OUT_OF_RANGE;
2case Qp.UNIMPLEMENTED:return Yu.UNIMPLEMENTED;case Qp.DATA_LOSS:return Yu.DATA_LOSS;default:return zu(39323,{code:e})}}(Jp=Qp||(Qp={}))[Jp.OK=0]="OK",Jp[Jp.CANCELLED=1]="CANCELLED",Jp[Jp.UNKNOWN=2]="UNKNOWN",Jp[Jp.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Jp[Jp.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Jp[Jp.NOT_FOUND=5]="NOT_FOUND",Jp[Jp.ALREADY_EXISTS=6]="ALREADY_EXISTS",Jp[Jp.PERMISSION_DENIED=7]="PERMISSION_DENIED",Jp[Jp.UNAUTHENTICATED=16]="UNAUTHENTICATED",Jp[Jp.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Jp[Jp.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Jp[Jp.ABORTED=10]="ABORTED",Jp[Jp.OUT_OF_RANGE=11]="OUT_OF_RANGE",Jp[Jp.UNIMPLEMENTED=12]="UNIMPLEMENTED",Jp[Jp.INTERNAL=13]="INTERNAL",Jp[Jp.UNAVAILABLE=14]="UNAVAILABLE",Jp[Jp.DATA_LOSS=15]="DATA_LOSS";class em{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),i=this.inner[t];if(void 0!==i)for(const r of i){var n=u(r,2);const t=n[0],i=n[1];if(this.equalsFn(t,e))return i}}has(e){return void 0!==this.get(e)}set(e,t){const i=this.mapKeyFn(e),n=this.inner[i];if(void 0===n)return this.inner[i]=[[e,t]],void this.innerSize++;for(let r=0;r<n.length;r++)if(this.equalsFn(n[r][0],e))return void(n[r]=[e,t]);n.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),i=this.inner[t];if(void 0===i)return!1;for(let n=0;n<i.length;n++)if(this.equalsFn(i[n][0],e))return 1===i.length?delete this.inner[t]:i.splice(n,1),this.innerSize--,!0;return!1}forEach(e){Ed(this.inner,(t,i)=>{for(const r of i){var n=u(r,2);const t=n[0],i=n[1];e(t,i)}})}isEmpty(){return Ad(this.inner)}size(){return this.innerSize}}const tm=new yd(pc.comparator);function im(){return tm}const nm=new yd(pc.comparator);function rm(){let e=nm;for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];for(const r of i)e=e.insert(r.key,r);return e}function sm(e){let t=nm;return e.forEach((e,i)=>t=t.insert(e,i.overlayedDocument)),t}function am(){return lm()}function om(){return lm()}function lm(){return new em(e=>e.toString(),(e,t)=>e.isEqual(t))}const hm=new yd(pc.comparator),um=new wd(pc.comparator);function cm(){let e=um;for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];for(const r of i)e=e.add(r);return e}const dm=new wd(nc);function fm(){return dm}let pm=null;function mm(){return new TextEncoder}const gm=new fh([4294967295,4294967295],0);function vm(e){const t=mm().encode(e),i=new ph;return i.update(t),new Uint8Array(i.digest())}function ym(e){const t=new DataView(e.buffer),i=t.getUint32(0,!0),n=t.getUint32(4,!0),r=t.getUint32(8,!0),s=t.getUint32(12,!0);return[new fh([i,n],0),new fh([r,s],0)]}class xm{constructor(e,t,i){if(this.bitmap=e,this.padding=t,this.hashCount=i,t<0||t>=8)throw new bm("Invalid padding: ".concat(t));if(i<0)throw new bm("Invalid hash count: ".concat(i));if(e.length>0&&0===this.hashCount)throw new bm("Invalid hash count: ".concat(i));if(0===e.length&&0!==t)throw new bm("Invalid padding when bitmap length is 0: ".concat(t));this.ge=8*e.length-t,this.ye=fh.fromNumber(this.ge)}we(e,t,i){let n=e.add(t.multiply(fh.fromNumber(i)));return 1===n.compare(gm)&&(n=new fh([n.getBits(0),n.getBits(1)],0)),n.modulo(this.ye).toNumber()}be(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(0===this.ge)return!1;const t=u(ym(vm(e)),2),i=t[0],n=t[1];for(let r=0;r<this.hashCount;r++){const e=this.we(i,n,r);if(!this.be(e))return!1}return!0}static create(e,t,i){const n=e%8==0?0:8-e%8,r=new Uint8Array(Math.ceil(e/8)),s=new xm(r,n,t);return i.forEach(e=>s.insert(e)),s}insert(e){if(0===this.ge)return;const t=u(ym(vm(e)),2),i=t[0],n=t[1];for(let r=0;r<this.hashCount;r++){const e=this.we(i,n,r);this.ve(e)}}ve(e){const t=Math.floor(e/8),i=e%8;this.bitmap[t]|=1<<i}}class bm extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}class wm{constructor(e,t,i,n,r,s){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=i,this.documentUpdates=n,this.augmentedDocumentUpdates=r,this.resolvedLimboDocuments=s}static createSynthesizedRemoteEventForCurrentChange(e,t,i){const n=new Map;return n.set(e,Tm.createSynthesizedTargetChangeForCurrentChange(e,t,i)),new wm(Cc.min(),n,new yd(nc),im(),im(),cm())}}class Tm{constructor(e,t,i,n,r){this.resumeToken=e,this.current=t,this.addedDocuments=i,this.modifiedDocuments=n,this.removedDocuments=r}static createSynthesizedTargetChangeForCurrentChange(e,t,i){return new Tm(i,t,cm(),cm(),cm())}}class _m{constructor(e,t,i,n){this.Se=e,this.removedTargetIds=t,this.key=i,this.De=n}
2}class Sm{constructor(e,t){this.targetId=e,this.xe=t}}class Em{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Rd.EMPTY_BYTE_STRING,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.state=e,this.targetIds=t,this.resumeToken=i,this.cause=n}}class Cm{constructor(e){this.targetId=e,this.Ce=0,this.Fe=Om(),this.Oe=Rd.EMPTY_BYTE_STRING,this.Me=!1,this.Ne=!0}get current(){return this.Me}get resumeToken(){return this.Oe}get Le(){return 0!==this.Ce}get Be(){return this.Ne}Ue(e){e.approximateByteSize()>0&&(this.Ne=!0,this.Oe=e)}ke(){let e=cm(),t=cm(),i=cm();return this.Fe.forEach((n,r)=>{switch(r){case 0:e=e.add(n);break;case 2:t=t.add(n);break;case 1:i=i.add(n);break;default:zu(38017,{changeType:r})}}),new Tm(this.Oe,this.Me,e,t,i)}qe(){this.Ne=!1,this.Fe=Om()}$e(e,t){this.Ne=!0,this.Fe=this.Fe.insert(e,t)}Ke(e){this.Ne=!0,this.Fe=this.Fe.remove(e)}We(){this.Ce+=1}Qe(){this.Ce-=1,Hu(this.Ce>=0,3241,{Ce:this.Ce,targetId:this.targetId})}Ge(){this.Ne=!0,this.Me=!0}}const Am="WatchChangeAggregator";class km{constructor(e){this.ze=e,this.je=new Map,this.He=im(),this.Je=Rm(),this.Ye=im(),this.Ze=Rm(),this.Xe=new yd(nc)}et(e){for(const t of e.Se)e.De&&e.De.isFoundDocument()?this.tt(t,e.De):this.nt(t,e.key,e.De);for(const t of e.removedTargetIds)this.nt(t,e.key,e.De)}rt(e){this.forEachTarget(e,t=>{const i=this.je.get(t);if(i)switch(e.state){case 0:this.it(t)&&i.Ue(e.resumeToken);break;case 1:i.Qe(),i.Le||i.qe(),i.Ue(e.resumeToken);break;case 2:i.Qe(),i.Le||this.removeTarget(t);break;case 3:this.it(t)&&(i.Ge(),i.Ue(e.resumeToken));break;case 4:this.it(t)&&(this.st(t),i.Ue(e.resumeToken));break;default:zu(56790,{state:e.state})}else Du(Am,"handleTargetChange received targetChange for untracked target ID (".concat(t,") with state (").concat(e.state,")"))})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.je.forEach((e,i)=>{this.it(i)&&t(i)})}_t(e){var t;return Pp(e)?"documents"===e.getPipelineSourceType()&&1===(null===(t=e.getPipelineDocuments())||void 0===t?void 0:t.length):Mp(e)}ot(e){const t=e.targetId,i=e.xe.count,n=this.ut(t);if(n){const s=n.target;if(this._t(s))if(0===i){const e=new pc(Pp(s)?cc.fromString(s.getPipelineDocuments()[0]):s.path);this.nt(t,e,Cp.newNoDocument(e,Cc.min()))}else Hu(1===i,20013,"Single document existence filter with count: "+i);else{const n=this.ct(t);if(n!==i){var r;const i=this.lt(e),s=i?this.Et(i,e,n):1;if(0!==s){this.st(t);const e=2===s?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Xe=this.Xe.insert(t,e)}null===(r=pm)||void 0===r||r.u(function(e,t,i,n,r){var s,a,o,l,h;const u={localCacheCount:e,existenceFilterCount:t.count,databaseId:i.database,projectId:i.projectId},c=t.unchangedNames;return c&&(u.bloomFilter={applied:0===r,hashCount:null!==(s=null===c||void 0===c?void 0:c.hashCount)&&void 0!==s?s:0,bitmapLength:null!==(a=null===c||void 0===c||null===(o=c.bits)||void 0===o||null===(o=o.bitmap)||void 0===o?void 0:o.length)&&void 0!==a?a:0,padding:null!==(l=null===c||void 0===c||null===(h=c.bits)||void 0===h?void 0:h.padding)&&void 0!==l?l:0,mightContain:e=>{var t;return null!==(t=null===n||void 0===n?void 0:n.mightContain(e))&&void 0!==t&&t}}),u}(n,e.xe,this.ze.Tt(),i,s))}}}}lt(e){const t=e.xe.unchangedNames;if(!t||!t.bits)return null;const i=t.bits,n=i.bitmap,r=void 0===n?"":n,s=i.padding,a=void 0===s?0:s,o=t.hashCount,l=void 0===o?0:o;let h,u;try{h=Nd(r).toUint8Array()}catch(e){if(e instanceof kd)return Bu("Decoding the base64 bloom filter in existence filter failed ("+e.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw e}try{u=new xm(h,a,l)}catch(e){return Bu(e instanceof bm?"BloomFilter error: ":"Applying bloom filter failed: ",e),null}return 0===u.ge?null:u}Et(e,t,i){return t.xe.count===i-this.Pt(e,t.targetId)?0:2}Pt(e,t){const i=this.ze.getRemoteKeysForTarget(t);let n=0;return i.forEach(i=>{const r=this.ze.Tt(),s="projects/".concat(r.projectId,"/databases/").concat(r.database,"/documents/").concat(i.path.canonicalString());e.mightContain(s)||(this.nt(t,i,null),n++)}),n}Rt(e){const t=new Map;this.je.forEach((i,n)=>{const r=this.ut(n);if(r){if(i.current&&this._t(r.target)){const t=Pp(r.target)?cc.fromString(r.target.getPipelineDocuments()[0]):r.target.path,i=new pc(t);this.It(i).has(n)||this.At(n,i)||this.nt(n,i,Cp.newNoDocument(i,e))}i.Be&&(t.set(n,i.ke()),i.qe())}});let i=cm();this.Ze.forEach((e,t)=>{let n=!0;t.forEachWhile(e=>{const t=this.ut(e);return!t||"TargetPurposeLimboResolution"===t.purpose||(n=!1,!1)}),n&&(i=i.add(e))}),this.He.forEach((t,i)=>i.setReadTime(e)),this.Ye.forEach((t,i)=>i.setReadTime(e));const n=new wm(e,t,this.Xe,this.He,this.Ye,i);return this.He=im(),this.Je=Rm(),this.Ye=im(),this.Ze=Rm(),this.Xe=new yd(nc),n}tt(e,t){const i=this.je.get(e);if(!i||!this.it(e))return void Du(Am,"addDocumentToTarget received document for unknown inactive target (".concat(e,")"));const n=this.At(e,t.key)?2:0;i.$e(t.key,n),Pp(this.ut(e).target)&&"exact"!==this.ut(e).target.getPipelineFlavor()?this.Ye=this.Ye.insert(t.key,t):this.He=this.He.insert(t.key,t),this.Je=this.Je.insert(t.key,this.It(t.key).add(e)),this.Ze=this.Ze.insert(t.key,this.Vt(t.key).add(e))}nt(e,t,i){const n=this.je.get(e);n&&this.it(e)?(this.At(e,t)?n.$e(t,1):n.Ke(t),this.Ze=this.Ze.insert(t,this.Vt(t).delete(e)),this.Ze=this.Ze.insert(t,this.Vt(t).add(e)),i&&(Pp(this.ut(e).target)&&"exact"!==this.ut(e).target.getPipelineFlavor()?this.Ye=this.Ye.insert(t,i):this.He=this.He.insert(t,i))):Du(Am,"removeDocumentFromTarget received document for unknown or inactive target (".concat(e,")"))}removeTarget(e){this.je.delete(e)}ct(e){const t=this.je.get(e);if(!t)return 0;const i=t.ke();return this.ze.getRemoteKeysForTarget(e).size+i.addedDocuments.size-i.removedDocuments.size}We(e){let t=this.je.get(e);t||(Du(Am,"recordPendingTargetRequest set up tracking for target ID ".concat(e)),t=new Cm(e),this.je.set(e,t)),t.We()}Vt(e){let t=this.Ze.get(e);return t||(t=new wd(nc),this.Ze=this.Ze.insert(e,t)),t}It(e){let t=this.Je.get(e);return t||(t=new wd(nc),this.Je=this.Je.insert(e,t)),t}it(e){const t=null!==this.ut(e);return t||Du(Am,"Detected inactive target",e),t}ut(e){const t=this.je.get(e);return void 0===t||t.Le?null:this.ze.dt(e)}st(e){this.je.set(e,new Cm(e)),this.ze.getRemoteKeysForTarget(e).forEach(t=>{this.nt(e,t,null)})}At(e,t){return this.ze.getRemoteKeysForTarget(e).has(t)}}function Rm(){return new yd(pc.comparator)}
2function Om(){return new yd(pc.comparator)}const Pm={asc:"ASCENDING",desc:"DESCENDING"},Mm={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},Nm={and:"AND",or:"OR"};class Im{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function Lm(e,t){return e.useProto3Json||Vc(t)?t:{value:t}}function Dm(e,t){return e.useProto3Json?"".concat(new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z",""),".").concat(("000000000"+t.nanoseconds).slice(-9),"Z"):{seconds:""+t.seconds,nanos:t.nanoseconds}}function Fm(e){const t=Pd(e);return new Ec(t.seconds,t.nanos)}function Bm(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function Um(e,t){return Dm(e,t.toTimestamp())}function zm(e){return Hu(!!e,49232),Cc.fromTimestamp(Fm(e))}function Vm(e,t){return Hm(e,t).canonicalString()}function Hm(e,t){const i=function(e){return new cc(["projects",e.projectId,"databases",e.database])}(e).child("documents");return void 0===t?i:i.child(t)}function jm(e){const t=cc.fromString(e);return Hu(ug(t),10190,{key:t.toString()}),t}function Ym(e,t){return Vm(e.databaseId,t.path)}function Wm(e,t){const i=jm(t);if(i.get(1)!==e.databaseId.projectId)throw new Wu(Yu.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+i.get(1)+" vs "+e.databaseId.projectId);if(i.get(3)!==e.databaseId.database)throw new Wu(Yu.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+i.get(3)+" vs "+e.databaseId.database);return new pc(Km(i))}function Gm(e,t){return Vm(e.databaseId,t)}function Xm(e){const t=jm(e);return 4===t.length?cc.emptyPath():Km(t)}function qm(e){return new cc(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function Km(e){return Hu(e.length>4&&"documents"===e.get(4),29091,{key:e.toString()}),e.popFirst(5)}function Qm(e,t,i){return{name:Ym(e,t),fields:i.value.mapValue.fields}}function Jm(e,t){let i;if(t instanceof Jf)i={update:Qm(e,t.key,t.value)};else if(t instanceof ip)i={delete:Ym(e,t.key)};else if(t instanceof Zf)i={update:Qm(e,t.key,t.data),updateMask:hg(t.fieldMask)};else{if(!(t instanceof np))return zu(16599,{gt:t.type});i={verify:Ym(e,t.key)}}return t.fieldTransforms.length>0&&(i.updateTransforms=t.fieldTransforms.map(e=>function(e,t){const i=t.transform;if(i instanceof Rf)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(i instanceof Of)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:i.elements}};if(i instanceof Mf)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:i.elements}};if(i instanceof Lf)return{fieldPath:t.field.canonicalString(),increment:i.Re};if(i instanceof Df)return{fieldPath:t.field.canonicalString(),minimum:i.Re};if(i instanceof Ff)return{fieldPath:t.field.canonicalString(),maximum:i.Re};throw zu(20930,{transform:t.transform})}(0,e))),t.precondition.isNone||(i.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:Um(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:zu(27497)}(e,t.precondition)),i}function Zm(e,t){return{documents:[Gm(e,t.path)]}}function $m(e,t){const i={structuredQuery:{}},n=t.path;let r;null!==t.collectionGroup?(r=n,i.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(r=n.popLast(),i.structuredQuery.from=[{collectionId:n.lastSegment()}]),i.parent=Gm(e,r);const s=function(e){if(0!==e.length)return lg(hp.create(e,"and"))}(t.filters);s&&(i.structuredQuery.where=s);const a=function(e){if(0!==e.length)return e.map(e=>function(e){return{field:ag(e.field),direction:ng(e.dir)}}(e))}(t.orderBy);a&&(i.structuredQuery.orderBy=a);const o=Lm(e,t.limit);return null!==o&&(i.structuredQuery.limit=o),t.startAt&&(i.structuredQuery.startAt=function(e){return{before:e.inclusive,values:e.position}}(t.startAt)),t.endAt&&(i.structuredQuery.endAt=function(e){return{before:!e.inclusive,values:e.position}}(t.endAt)),{yt:i,parent:r}}function eg(e){let t=Xm(e.parent);const i=e.structuredQuery,n=i.from?i.from.length:0;let r=null;if(n>0){Hu(1===n,65062);const e=i.from[0];e.allDescendants?r=e.collectionId:t=t.child(e.collectionId)}let s=[];i.where&&(s=function(e){const t=ig(e);return t instanceof hp&&cp(t)?t.getFilters():[t]}(i.where));let a=[];i.orderBy&&(a=function(e){return e.map(e=>function(e){return new Sp(og(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))}(e))}(i.orderBy));let o=null;i.limit&&(o=function(e){let t;return t="object"==typeof e?e.value:e,Vc(t)?null:t}(i.limit));let l=null;i.startAt&&(l=function(e){const t=!!e.before,i=e.values||[];return new rp(i,t)}(i.startAt));let h=null;return i.endAt&&(h=function(e){const t=!e.before,i=e.values||[];return new rp(i,t)}(i.endAt)),Ip(t,r,a,s,o,"F",l,h)}function tg(e,t){return{structuredPipeline:{pipeline:{stages:t.stages.map(t=>t._toProto(e))}}}}function ig(e){return void 0!==e.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":const t=og(e.unaryFilter.field);return lp.create(t,"==",{doubleValue:NaN});case"IS_NULL":const i=og(e.unaryFilter.field);return lp.create(i,"==",{nullValue:"NULL_VALUE"});
2case"IS_NOT_NAN":const n=og(e.unaryFilter.field);return lp.create(n,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const r=og(e.unaryFilter.field);return lp.create(r,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return zu(61313);default:return zu(60726)}}(e):void 0!==e.fieldFilter?function(e){return lp.create(og(e.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return zu(58110);default:return zu(50506)}}(e.fieldFilter.op),e.fieldFilter.value)}(e):void 0!==e.compositeFilter?function(e){return hp.create(e.compositeFilter.filters.map(e=>ig(e)),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return zu(1026)}}(e.compositeFilter.op))}(e):zu(30097,{filter:e})}function ng(e){return Pm[e]}function rg(e){return Mm[e]}function sg(e){return Nm[e]}function ag(e){return{fieldPath:e.canonicalString()}}function og(e){return fc.fromServerFormat(e.fieldPath)}function lg(e){return e instanceof lp?function(e){if("=="===e.op){if(pf(e.value))return{unaryFilter:{field:ag(e.field),op:"IS_NAN"}};if(ff(e.value))return{unaryFilter:{field:ag(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(pf(e.value))return{unaryFilter:{field:ag(e.field),op:"IS_NOT_NAN"}};if(ff(e.value))return{unaryFilter:{field:ag(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:ag(e.field),op:rg(e.op),value:e.value}}}(e):e instanceof hp?function(e){const t=e.getFilters().map(e=>lg(e));return 1===t.length?t[0]:{compositeFilter:{op:sg(e.op),filters:t}}}(e):zu(54877,{filter:e})}function hg(e){const t=[];return e.fields.forEach(e=>t.push(e.canonicalString())),{fieldPaths:t}}function ug(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}function cg(e){return!!e&&"function"==typeof e._toProto&&"ProtoValue"===e._protoValueType}function dg(e,t){const i={fields:{}};return t.forEach((t,n)=>{if("string"!=typeof n)throw new Error("Cannot encode map with non-string key: ".concat(n));i.fields[n]=t._toProto(e)}),{mapValue:i}}function fg(e){return{stringValue:e}}function pg(e){return new Im(e,!0)}class mg{constructor(e){this._byteString=e}static fromBase64String(e){try{return new mg(Rd.fromBase64String(e))}catch(e){throw new Wu(Yu.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}}static fromUint8Array(e){return new mg(Rd.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:mg._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(Tc(e,mg._jsonSchema))return mg.fromBase64String(e.bytes)}}mg._jsonSchemaVersion="firestore/bytes/1.0",mg._jsonSchema={type:wc("string",mg._jsonSchemaVersion),bytes:wc("string")};class gg{constructor(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(let n=0;n<t.length;++n)if(0===t[n].length)throw new Wu(Yu.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new fc(t)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}class vg{constructor(e){this._methodName=e}}class yg{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new Wu(Yu.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new Wu(Yu.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return nc(this._lat,e._lat)||nc(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:yg._jsonSchemaVersion}}static fromJSON(e){if(Tc(e,yg._jsonSchema))return new yg(e.latitude,e.longitude)}}function xg(e){const t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}yg._jsonSchemaVersion="firestore/geoPoint/1.0",yg._jsonSchema={type:wc("string",yg._jsonSchemaVersion),latitude:wc("number"),longitude:wc("number")};class bg{bt(e){}shutdown(){}}const wg="ConnectivityMonitor";class Tg{constructor(){this.vt=()=>this.St(),this.Dt=()=>this.xt(),this.Ct=[],this.Ft()}bt(e){this.Ct.push(e)}shutdown(){window.removeEventListener("online",this.vt),window.removeEventListener("offline",this.Dt)}Ft(){window.addEventListener("online",this.vt),window.addEventListener("offline",this.Dt)}St(){Du(wg,"Network connectivity changed: AVAILABLE");for(const e of this.Ct)e(0)}xt(){Du(wg,"Network connectivity changed: UNAVAILABLE");for(const e of this.Ct)e(1)}static C(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let _g=null;function Sg(){return null===_g?_g=268435456+Math.round(2147483648*Math.random()):_g++,"0x"+_g.toString(16)}const Eg="RestConnection",Cg={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregation
2Query:"runAggregationQuery",ExecutePipeline:"executePipeline"};class Ag{get Ot(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",i=encodeURIComponent(this.databaseId.projectId),n=encodeURIComponent(this.databaseId.database);this.Mt=t+"://"+e.host,this.Nt="projects/".concat(i,"/databases/").concat(n),this.Lt=this.databaseId.database===Hd?"project_id=".concat(i):"project_id=".concat(i,"&database_id=").concat(n)}Bt(e,t,i,n,r){const s=Sg(),a=this.Ut(e,t.toUriEncodedString());Du(Eg,"Sending RPC '".concat(e,"' ").concat(s,":"),a,i);const o={"google-cloud-resource-prefix":this.Nt,"x-goog-request-params":this.Lt};this.kt(o,n,r);const l=ur(new URL(a).host);return this.qt(e,a,o,i,l).then(t=>(Du(Eg,"Received RPC '".concat(e,"' ").concat(s,": "),t),t),t=>{throw Bu(Eg,"RPC '".concat(e,"' ").concat(s," failed with error: "),t,"url: ",a,"request:",i),t})}$t(e,t,i,n,r,s){return this.Bt(e,t,i,n,r)}kt(e,t,i){e["X-Goog-Api-Client"]="gl-js/ fire/"+Nu,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((t,i)=>e[i]=t),i&&i.headers.forEach((t,i)=>e[i]=t)}Ut(e,t){const i=Cg[e];let n="".concat(this.Mt,"/v1/").concat(t,":").concat(i);return this.databaseInfo.apiKey&&(n="".concat(n,"?key=").concat(encodeURIComponent(this.databaseInfo.apiKey))),n}terminate(){}}class kg{constructor(e){this.Kt=e.Kt,this.Wt=e.Wt}Qt(e){this.Gt=e}zt(e){this.jt=e}Ht(e){this.Jt=e}onMessage(e){this.Yt=e}close(){this.Wt()}send(e){this.Kt(e)}Zt(){this.Gt()}Xt(){this.jt()}en(e){this.Jt(e)}tn(e){this.Yt(e)}}const Rg="WebChannelConnection",Og=(e,t,i)=>{e.listen(t,e=>{try{i(e)}catch(e){setTimeout(()=>{throw e},0)}})};class Pg extends Ag{constructor(e){super(e),this.nn=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}static rn(){if(!Pg.sn){const e=_h();Og(e,Th.STAT_EVENT,e=>{e.stat===wh.PROXY?Du(Rg,"STAT_EVENT: detected buffering proxy"):e.stat===wh.NOPROXY&&Du(Rg,"STAT_EVENT: detected no buffering proxy")}),Pg.sn=!0}}qt(e,t,i,n,r){const s=Sg();return new Promise((r,a)=>{const o=new vh;o.setWithCredentials(!0),o.listenOnce(xh.COMPLETE,()=>{try{switch(o.getLastErrorCode()){case bh.NO_ERROR:const i=o.getResponseJson();Du(Rg,"XHR for RPC '".concat(e,"' ").concat(s," received:"),JSON.stringify(i)),r(i);break;case bh.TIMEOUT:Du(Rg,"RPC '".concat(e,"' ").concat(s," timed out")),a(new Wu(Yu.DEADLINE_EXCEEDED,"Request time out"));break;case bh.HTTP_ERROR:const n=o.getStatus();if(Du(Rg,"RPC '".concat(e,"' ").concat(s," failed with status:"),n,"response text:",o.getResponseText()),n>0){var t;let e=o.getResponseJson();Array.isArray(e)&&(e=e[0]);const i=null===(t=e)||void 0===t?void 0:t.error;if(i&&i.status&&i.message){const e=function(e){const t=e.toLowerCase().replace(/_/g,"-");return Object.values(Yu).indexOf(t)>=0?t:Yu.UNKNOWN}(i.status);a(new Wu(e,i.message))}else a(new Wu(Yu.UNKNOWN,"Server responded with status "+o.getStatus()))}else a(new Wu(Yu.UNAVAILABLE,"Connection failed."));break;default:zu(9055,{_n:e,streamId:s,an:o.getLastErrorCode(),un:o.getLastError()})}}finally{Du(Rg,"RPC '".concat(e,"' ").concat(s," completed."))}});const l=JSON.stringify(n);Du(Rg,"RPC '".concat(e,"' ").concat(s," sending request:"),n),o.send(t,"POST",l,i,15)})}cn(e,t,i){const n=Sg(),r=[this.Mt,"/","google.firestore.v1.Firestore","/",e,"/channel"],s=this.createWebChannelTransport(),a={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/".concat(this.databaseId.projectId,"/databases/").concat(this.databaseId.database)},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},o=this.longPollingOptions.timeoutSeconds;void 0!==o&&(a.longPollingTimeout=Math.round(1e3*o)),this.useFetchStreams&&(a.useFetchStreams=!0),this.kt(a.initMessageHeaders,t,i),a.encodeInitMessageHeaders=!0;const l=r.join("");Du(Rg,"Creating RPC '".concat(e,"' stream ").concat(n,": ").concat(l),a);const h=s.createWebChannel(l,a);this.En(h);
2let u=!1,c=!1;const d=new kg({Kt:t=>{c?Du(Rg,"Not sending because RPC '".concat(e,"' stream ").concat(n," is closed:"),t):(u||(Du(Rg,"Opening RPC '".concat(e,"' stream ").concat(n," transport.")),h.open(),u=!0),Du(Rg,"RPC '".concat(e,"' stream ").concat(n," sending:"),t),h.send(t))},Wt:()=>h.close()});return Og(h,yh.EventType.OPEN,()=>{c||(Du(Rg,"RPC '".concat(e,"' stream ").concat(n," transport opened.")),d.Zt())}),Og(h,yh.EventType.CLOSE,()=>{c||(c=!0,Du(Rg,"RPC '".concat(e,"' stream ").concat(n," transport closed")),d.en(),this.hn(h))}),Og(h,yh.EventType.ERROR,t=>{c||(c=!0,Bu(Rg,"RPC '".concat(e,"' stream ").concat(n," transport errored. Name:"),t.name,"Message:",t.message),d.en(new Wu(Yu.UNAVAILABLE,"The operation could not be completed")))}),Og(h,yh.EventType.MESSAGE,t=>{if(!c){var i;const r=t.data[0];Hu(!!r,16349);const s=r,a=(null===s||void 0===s?void 0:s.error)||(null===(i=s[0])||void 0===i?void 0:i.error);if(a){Du(Rg,"RPC '".concat(e,"' stream ").concat(n," received error:"),a);const t=a.status;let i=function(e){const t=Qp[e];if(void 0!==t)return $p(t)}(t),r=a.message;"NOT_FOUND"===t&&r.includes("database")&&r.includes("does not exist")&&r.includes(this.databaseId.database)&&Bu("Database '".concat(this.databaseId.database,"' not found. Please check your project configuration.")),void 0===i&&(i=Yu.INTERNAL,r="Unknown error status: "+t+" with message "+a.message),c=!0,d.en(new Wu(i,r)),h.close()}else Du(Rg,"RPC '".concat(e,"' stream ").concat(n," received:"),r),d.tn(r)}}),Pg.rn(),setTimeout(()=>{d.Xt()},0),d}terminate(){this.nn.forEach(e=>e.close()),this.nn=[]}En(e){this.nn.push(e)}hn(e){this.nn=this.nn.filter(t=>t===e)}kt(e,t,i){super.kt(e,t,i),this.databaseInfo.apiKey&&(e["x-goog-api-key"]=this.databaseInfo.apiKey)}createWebChannelTransport(){return Sh()}}function Mg(e){return new Pg(e)}Pg.sn=!1;class Ng{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.5,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:6e4;this.Tn=e,this.timerId=t,this.Pn=i,this.Rn=n,this.In=r,this.An=0,this.Vn=null,this.dn=Date.now(),this.reset()}reset(){this.An=0}fn(){this.An=this.In}mn(e){this.cancel();const t=Math.floor(this.An+this.pn()),i=Math.max(0,Date.now()-this.dn),n=Math.max(0,t-i);n>0&&Du("ExponentialBackoff","Backing off for ".concat(n," ms (base delay: ").concat(this.An," ms, delay with jitter: ").concat(t," ms, last attempt: ").concat(i," ms ago)")),this.Vn=this.Tn.enqueueAfterDelay(this.timerId,n,()=>(this.dn=Date.now(),e())),this.An*=this.Rn,this.An<this.Pn&&(this.An=this.Pn),this.An>this.In&&(this.An=this.In)}gn(){null!==this.Vn&&(this.Vn.skipDelay(),this.Vn=null)}cancel(){null!==this.Vn&&(this.Vn.cancel(),this.Vn=null)}pn(){return(Math.random()-.5)*this.An}}const Ig="PersistentStream";class Lg{constructor(e,t,i,n,r,s,a,o){this.Tn=e,this.yn=i,this.wn=n,this.connection=r,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=a,this.listener=o,this.state=0,this.bn=0,this.vn=null,this.Sn=null,this.stream=null,this.Dn=0,this.xn=new Ng(e,t)}Cn(){return 1===this.state||5===this.state||this.Fn()}Fn(){return 2===this.state||3===this.state}start(){this.Dn=0,4!==this.state?this.auth():this.On()}async stop(){this.Cn()&&await this.close(0)}Mn(){this.state=0,this.xn.reset()}Nn(){this.Fn()&&null===this.vn&&(this.vn=this.Tn.enqueueAfterDelay(this.yn,6e4,()=>this.Ln()))}Bn(e){this.Un(),this.stream.send(e)}async Ln(){if(this.Fn())return this.close(0)}Un(){this.vn&&(this.vn.cancel(),this.vn=null)}kn(){this.Sn&&(this.Sn.cancel(),this.Sn=null)}async close(e,t){this.Un(),this.kn(),this.xn.cancel(),this.bn++,4!==e?this.xn.reset():t&&t.code===Yu.RESOURCE_EXHAUSTED?(Fu(t.toString()),Fu("Using maximum backoff delay to prevent overloading the backend."),this.xn.fn()):t&&t.code===Yu.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.qn(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Ht(t)}qn(){}auth(){this.state=1;
2const e=this.$n(this.bn),t=this.bn;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(e=>{let i=u(e,2),n=i[0],r=i[1];this.bn===t&&this.Kn(n,r)},t=>{e(()=>{const e=new Wu(Yu.UNKNOWN,"Fetching auth token failed: "+t.message);return this.Wn(e)})})}Kn(e,t){const i=this.$n(this.bn);this.stream=this.Qn(e,t),this.stream.Qt(()=>{i(()=>this.listener.Qt())}),this.stream.zt(()=>{i(()=>(this.state=2,this.Sn=this.Tn.enqueueAfterDelay(this.wn,1e4,()=>(this.Fn()&&(this.state=3),Promise.resolve())),this.listener.zt()))}),this.stream.Ht(e=>{i(()=>this.Wn(e))}),this.stream.onMessage(e=>{i(()=>1==++this.Dn?this.Gn(e):this.onNext(e))})}On(){this.state=5,this.xn.mn(async()=>{this.state=0,this.start()})}Wn(e){return Du(Ig,"close with error: ".concat(e)),this.stream=null,this.close(4,e)}$n(e){return t=>{this.Tn.enqueueAndForget(()=>this.bn===e?t():(Du(Ig,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class Dg extends Lg{constructor(e,t,i,n,r,s){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,i,n,s),this.serializer=r}Qn(e,t){return this.connection.cn("Listen",e,t)}Gn(e){return this.onNext(e)}onNext(e){this.xn.reset();const t=function(e,t){let i;if("targetChange"in t){t.targetChange;const n=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:zu(39313,{state:e})}(t.targetChange.targetChangeType||"NO_CHANGE"),r=t.targetChange.targetIds||[],s=function(e,t){return e.useProto3Json?(Hu(void 0===t||"string"==typeof t,58123),Rd.fromBase64String(t||"")):(Hu(void 0===t||t instanceof Buffer||t instanceof Uint8Array,16193),Rd.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),a=t.targetChange.cause,o=a&&function(e){const t=void 0===e.code?Yu.UNKNOWN:$p(e.code);return new Wu(t,e.message||"")}(a);i=new Em(n,r,s,o||null)}else if("documentChange"in t){t.documentChange;const n=t.documentChange;n.document,n.document.name,n.document.updateTime;const r=Wm(e,n.document.name),s=zm(n.document.updateTime),a=n.document.createTime?zm(n.document.createTime):Cc.min(),o=new bf({mapValue:{fields:n.document.fields}}),l=Cp.newFoundDocument(r,s,a,o),h=n.targetIds||[],u=n.removedTargetIds||[];i=new _m(h,u,l.key,l)}else if("documentDelete"in t){t.documentDelete;const n=t.documentDelete;n.document;const r=Wm(e,n.document),s=n.readTime?zm(n.readTime):Cc.min(),a=Cp.newNoDocument(r,s),o=n.removedTargetIds||[];i=new _m([],o,a.key,a)}else if("documentRemove"in t){t.documentRemove;const n=t.documentRemove;n.document;const r=Wm(e,n.document),s=n.removedTargetIds||[];i=new _m([],s,r,null)}else{if(!("filter"in t))return zu(11601,{ft:t});{t.filter;const e=t.filter;e.targetId;const n=e.count,r=void 0===n?0:n,s=e.unchangedNames,a=new Kp(r,s),o=e.targetId;i=new Sm(o,a)}}return i}(this.serializer,e),i=function(e){if(!("targetChange"in e))return Cc.min();const t=e.targetChange;return t.targetIds&&t.targetIds.length?Cc.min():t.readTime?zm(t.readTime):Cc.min()}(e);return this.listener.zn(t,i)}jn(e){const t={};t.database=qm(this.serializer),t.addTarget=function(e,t){let i;const n=t.target;if(i=Pp(n)?{pipelineQuery:tg(e,n)}:Mp(n)?{documents:Zm(e,n)}:{query:$m(e,n).yt},i.targetId=t.targetId,t.resumeToken.approximateByteSize()>0){i.resumeToken=Bm(e,t.resumeToken);const n=Lm(e,t.expectedCount);null!==n&&(i.expectedCount=n)}else if(t.snapshotVersion.compareTo(Cc.min())>0){i.readTime=Dm(e,t.snapshotVersion.toTimestamp());const n=Lm(e,t.expectedCount);null!==n&&(i.expectedCount=n)}return i}(this.serializer,e);const i=function(e,t){const i=function(e){switch(e){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return zu(28987,{purpose:e})}}(t.purpose);return null==i?null:{"goog-listen-tags":i}}(this.serializer,e);i&&(t.labels=i),this.Bn(t)}Hn(e){const t={};t.database=qm(this.serializer),t.removeTarget=e,this.Bn(t)}}class Fg extends Lg{constructor(e,t,i,n,r,s){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,i,n,s),this.serializer
2=r}get Jn(){return this.Dn>0}start(){this.lastStreamToken=void 0,super.start()}qn(){this.Jn&&this.Yn([])}Qn(e,t){return this.connection.cn("Write",e,t)}Gn(e){return Hu(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,Hu(!e.writeResults||0===e.writeResults.length,55816),this.listener.Zn()}onNext(e){Hu(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.xn.reset();const t=function(e,t){return e&&e.length>0?(Hu(void 0!==t,14353),e.map(e=>function(e,t){let i=e.updateTime?zm(e.updateTime):zm(t);return i.isEqual(Cc.min())&&(i=zm(t)),new Hf(i,e.transformResults||[])}(e,t))):[]}(e.writeResults,e.commitTime),i=zm(e.commitTime);return this.listener.Xn(i,t)}er(){const e={};e.database=qm(this.serializer),this.Bn(e)}Yn(e){const t={streamToken:this.lastStreamToken,writes:e.map(e=>Jm(this.serializer,e))};this.Bn(t)}}class Bg{}class Ug extends Bg{constructor(e,t,i,n){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=i,this.serializer=n,this.tr=!1}nr(){if(this.tr)throw new Wu(Yu.FAILED_PRECONDITION,"The client has already been terminated.")}Bt(e,t,i,n){return this.nr(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(r=>{let s=u(r,2),a=s[0],o=s[1];return this.connection.Bt(e,Hm(t,i),n,a,o)}).catch(e=>{throw"FirebaseError"===e.name?(e.code===Yu.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new Wu(Yu.UNKNOWN,e.toString())})}$t(e,t,i,n,r){return this.nr(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(s=>{let a=u(s,2),o=a[0],l=a[1];return this.connection.$t(e,Hm(t,i),n,o,l,r)}).catch(e=>{throw"FirebaseError"===e.name?(e.code===Yu.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new Wu(Yu.UNKNOWN,e.toString())})}terminate(){this.tr=!0,this.connection.terminate()}}function zg(e,t,i,n){return new Ug(e,t,i,n)}const Vg="ComponentProvider",Hg=new Map;function jg(e,t,i,n,r){return new Vd(e,t,i,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,xg(r.experimentalLongPollingOptions),r.useFetchStreams,r.isUsingEmulator,n)}const Yg={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},Wg=41943040;class Gg{static withCacheSize(e){return new Gg(e,Gg.DEFAULT_COLLECTION_PERCENTILE,Gg.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,i){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=i}}Gg.DEFAULT_COLLECTION_PERCENTILE=10,Gg.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Gg.DEFAULT=new Gg(Wg,Gg.DEFAULT_COLLECTION_PERCENTILE,Gg.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Gg.DISABLED=new Gg(-1,0,0);const Xg="LruGarbageCollector",qg=1048576;function Kg(e,t){let i=u(e,2),n=i[0],r=i[1],s=u(t,2),a=s[0],o=s[1];const l=nc(n,a);return 0===l?nc(r,o):l}class Qg{constructor(e){this.rr=e,this.buffer=new wd(Kg),this.ir=0}sr(){return++this.ir}_r(e){const t=[e,this.sr()];if(this.buffer.size<this.rr)this.buffer=this.buffer.add(t);else{const e=this.buffer.last();Kg(t,e)<0&&(this.buffer=this.buffer.delete(e).add(t))}}get maxValue(){return this.buffer.last()[0]}}class Jg{constructor(e,t,i){this.garbageCollector=e,this.asyncQueue=t,this.localStore=i,this.ar=null}start(){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.ur(6e4)}stop(){this.ar&&(this.ar.cancel(),this.ar=null)}get started(){return null!==this.ar}ur(e){Du(Xg,"Garbage collection scheduled in ".concat(e,"ms")),this.ar=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,async()=>{this.ar=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(e){Bc(e)?Du(Xg,"Ignoring IndexedDB error during garbage collection: ",e):await Lc(e)}await this.ur(3e5)})}}class Zg{constructor(e,t){this.cr=e,this.params=t}calculateTargetCount(e,t){return this.cr.lr(e).next(e=>Math.floor(t/100*e))}nthSequenceNumber(e,t){if(0===t)return Dc.resolve(Uc.ce);const i=new Qg(t);return this.cr.forEachTarget(e,e=>i._r(e.sequenceNumber)).next(()=>this.cr.Er(e,e=>i._r(e))).next(()=>i.maxValue)}removeTargets(e,t,i){return this.cr.removeTargets(e,t,i)}removeOrphanedDocuments(e,t){return this.cr.removeOrphanedDocuments(e,t)}collect(e,t){return-1===this.params.cacheSizeCollectionThreshold?(Du("LruGarbageCollector","Garbage collection skipped; disabled"),Dc.resolve(Yg)):this.getCacheSize(e).next(i=>i<this.params.cacheSizeCollectionThreshold?(Du("LruGarbageCollector","Garbage collection skipped; Cache size ".concat(i," is lower than threshold ").concat(this.params.cacheSizeCollectionThreshold)),Yg):this.hr(e,t))}getCacheSize(e){return this.cr.getCacheSize(e)}hr(e,t){let i,n,r,s,a,o,l;const h=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(t=>(t>this.params.maximumSequenceNumbersToCollect?(Du("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of ".concat(this.params.maximumSequenceNumbersToCollect," from ").concat(t)),n=this.params.maximumSequenceNumbersToCollect):n=t,
2s=Date.now(),this.nthSequenceNumber(e,n))).next(n=>(i=n,a=Date.now(),this.removeTargets(e,i,t))).next(t=>(r=t,o=Date.now(),this.removeOrphanedDocuments(e,i))).next(e=>(l=Date.now(),Lu()<=vr.DEBUG&&Du("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in ".concat(s-h,"ms\n\tDetermined least recently used ").concat(n," in ")+(a-s)+"ms\n"+"\tRemoved ".concat(r," targets in ")+(o-a)+"ms\n"+"\tRemoved ".concat(e," documents in ")+(l-o)+"ms\n"+"Total Duration: ".concat(l-h,"ms")),Dc.resolve({didRun:!0,sequenceNumbersCollected:n,targetsRemoved:r,documentsRemoved:e})))}}function $g(e,t){return new Zg(e,t)}const ev="firestore.googleapis.com",tv=!0;class iv{constructor(e){var t,i;if(void 0===e.host){if(void 0!==e.ssl)throw new Wu(Yu.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=ev,this.ssl=tv}else this.host=e.host,this.ssl=null!==(t=e.ssl)&&void 0!==t?t:tv;if(this.isUsingEmulator=void 0!==e.emulatorOptions,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=Wg;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<qg)throw new Wu(Yu.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}(function(e,t,i,n){if(!0===t&&!0===n)throw new Wu(Yu.INVALID_ARGUMENT,"".concat(e," and ").concat(i," cannot be used together."))})("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=xg(null!==(i=e.experimentalLongPollingOptions)&&void 0!==i?i:{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new Wu(Yu.INVALID_ARGUMENT,"invalid long polling timeout: ".concat(e.timeoutSeconds," (must not be NaN)"));if(e.timeoutSeconds<5)throw new Wu(Yu.INVALID_ARGUMENT,"invalid long polling timeout: ".concat(e.timeoutSeconds," (minimum allowed value is 5)"));if(e.timeoutSeconds>30)throw new Wu(Yu.INVALID_ARGUMENT,"invalid long polling timeout: ".concat(e.timeoutSeconds," (maximum allowed value is 30)"))}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(e,t){return e.timeoutSeconds===t.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class nv{constructor(e,t,i,n){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=i,this._app=n,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new iv({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new Wu(Yu.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return"notTerminated"!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new Wu(Yu.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new iv(e),this._emulatorOptions=e.emulatorOptions||{},void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new qu;switch(e.type){case"firstParty":return new Zu(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new Wu(Yu.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invali
2d credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return"notTerminated"===this._terminateTask&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){"notTerminated"===this._terminateTask?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){const t=Hg.get(e);t&&(Du(Vg,"Removing Datastore"),Hg.delete(e),t.terminate())}(this),Promise.resolve()}}class rv{constructor(e,t,i){this.converter=t,this._query=i,this.type="query",this.firestore=e}withConverter(e){return new rv(this.firestore,e,this._query)}}class sv{constructor(e,t,i){this.converter=t,this._key=i,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new av(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new sv(this.firestore,e,this._key)}toJSON(){return{type:sv._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,i){if(Tc(t,sv._jsonSchema))return new sv(e,i||null,new pc(cc.fromString(t.referencePath)))}}sv._jsonSchemaVersion="firestore/documentReference/1.0",sv._jsonSchema={type:wc("string",sv._jsonSchemaVersion),referencePath:wc("string")};class av extends rv{constructor(e,t,i){super(e,t,Lp(i)),this._path=i,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new sv(this.firestore,null,new pc(e))}withConverter(e){return new av(this.firestore,e,this._path)}}function ov(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];if(e=hr(e),mc("collection","path",t),e instanceof nv){const i=cc.fromString(t,...n);return vc(i),new av(e,null,i)}{if(!(e instanceof sv||e instanceof av))throw new Wu(Yu.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const i=e._path.child(cc.fromString(t,...n));return vc(i),new av(e.firestore,null,i)}}function lv(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];if(e=hr(e),1===arguments.length&&(t=ic.newId()),mc("doc","path",t),e instanceof nv){const i=cc.fromString(t,...n);return gc(i),new sv(e,null,new pc(i))}{if(!(e instanceof sv||e instanceof av))throw new Wu(Yu.INVALID_ARGUMENT,"Expected first argument to doc() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const i=e._path.child(cc.fromString(t,...n));return gc(i),new sv(e.firestore,e instanceof av?e.converter:null,new pc(i))}}class hv{constructor(e){this._values=(e||[]).map(e=>e)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}(this._values,e._values)}toJSON(){return{type:hv._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(e){if(Tc(e,hv._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every(e=>"number"==typeof e))return new hv(e.vectorValues);throw new Wu(Yu.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}hv._jsonSchemaVersion="firestore/vectorValue/1.0",hv._jsonSchema={type:wc("string",hv._jsonSchemaVersion),vectorValues:wc("object")};const uv=/^__.*__$/;class cv{constructor(e,t,i){this.data=e,this.fieldMask=t,this.fieldTransforms=i}toMutation(e,t){return null!==this.fieldMask?new Zf(e,this.data,this.fieldMask,t,this.fieldTransforms):new Jf(e,this.data,t,this.fieldTransforms)}}class dv{constructor(e,t,i){this.data=e,this.fieldMask=t,this.fieldTransforms=i}toMutation(e,t){return new Zf(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function fv(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw zu(40011,{dataSource:e})}}class pv{constructor(e,t,i,n,r,s){this.settings=e,this.databaseId=t,this.serializer
2=i,this.ignoreUndefinedProperties=n,void 0===r&&this.validatePath(),this.fieldTransforms=r||[],this.fieldMask=s||[]}get path(){return this.settings.path}get dataSource(){return this.settings.dataSource}contextWith(e){return new pv(m(m({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}childContextForField(e){var t;const i=null===(t=this.path)||void 0===t?void 0:t.child(e),n=this.contextWith({path:i,arrayElement:!1});return n.validatePathSegment(e),n}childContextForFieldPath(e){var t;const i=null===(t=this.path)||void 0===t?void 0:t.child(e),n=this.contextWith({path:i,arrayElement:!1});return n.validatePath(),n}childContextForArray(e){return this.contextWith({path:void 0,arrayElement:!0})}createError(e){return Ov(e,this.settings.methodName,this.settings.hasConverter||!1,this.path,this.settings.targetDoc)}contains(e){return void 0!==this.fieldMask.find(t=>e.isPrefixOf(t))||void 0!==this.fieldTransforms.find(t=>e.isPrefixOf(t.field))}validatePath(){if(this.path)for(let e=0;e<this.path.length;e++)this.validatePathSegment(this.path.get(e))}validatePathSegment(e){if(0===e.length)throw this.createError("Document fields must not be empty");if(fv(this.dataSource)&&uv.test(e))throw this.createError('Document fields cannot begin and end with "__"')}}class mv{constructor(e,t,i){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=i||pg(e)}createContext(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return new pv({dataSource:e,methodName:t,targetDoc:i,path:fc.emptyPath(),arrayElement:!1,hasConverter:n},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function gv(e){const t=e._freezeSettings(),i=pg(e._databaseId);return new mv(e._databaseId,!!t.ignoreUndefinedProperties,i)}function vv(e,t,i,n,r){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const a=e.createContext(s.merge||s.mergeFields?2:0,t,i,r);Cv("Data must be an object, but it was:",a,n);const o=Sv(n,a);let l,h;if(s.merge)l=new _d(a.fieldMask),h=a.fieldTransforms;else if(s.mergeFields){const e=[];for(const n of s.mergeFields){const r=Av(t,n,i);if(!a.contains(r))throw new Wu(Yu.INVALID_ARGUMENT,"Field '".concat(r,"' is specified in your field mask but missing from your input data."));Pv(e,r)||e.push(r)}l=new _d(e),h=a.fieldTransforms.filter(e=>l.covers(e.field))}else l=null,h=a.fieldTransforms;return new cv(new bf(o),l,h)}class yv extends vg{_toFieldTransform(e){if(2!==e.dataSource)throw 1===e.dataSource?e.createError("".concat(this._methodName,"() can only appear at the top level of your update data")):e.createError("".concat(this._methodName,"() cannot be used with set() unless you pass {merge:true}"));return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof yv}}class xv extends vg{_toFieldTransform(e){return new Vf(e.path,new Rf)}isEqual(e){return e instanceof xv}}function bv(e,t,i,n){const r=e.createContext(1,t,i);Cv("Data must be an object, but it was:",r,n);const s=[],a=bf.empty();Ed(n,(e,n)=>{const o=Rv(t,e,i);n=hr(n);const l=r.childContextForFieldPath(o);if(n instanceof yv)s.push(o);else{const e=_v(n,l);null!=e&&(s.push(o),a.set(o,e))}});const o=new _d(s);return new dv(a,o,r.fieldTransforms)}function wv(e,t,i,n,r,s){const a=e.createContext(1,t,i),o=[Av(t,n,i)],l=[r];if(s.length%2!=0)throw new Wu(Yu.INVALID_ARGUMENT,"Function ".concat(t,"() needs to be called with an even number of arguments that alternate between field names and values."));for(let d=0;d<s.length;d+=2)o.push(Av(t,s[d])),l.push(s[d+1]);const h=[],u=bf.empty();for(let d=o.length-1;d>=0;--d)if(!Pv(h,o[d])){const e=o[d];let t=l[d];t=hr(t);const i=a.childContextForFieldPath(e);if(t instanceof yv)h.push(e);else{const n=_v(t,i);null!=n&&(h.push(e),u.set(e,n))}}const c=new _d(h);return new dv(u,c,a.fieldTransforms)}function Tv(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return _v(i,e.createContext(n?4:3,t))}function _v(e,t,i){if(Ev(e=hr(e)))return Cv("Unsupported field value:",t,e),Sv(e,t);if(e instanceof vg)return function(e,t){if(!fv(t.dataSource))throw t.createError("".concat(e._methodName,"() can only be used with update(
2) and set()"));if(!t.path)throw t.createError("".concat(e._methodName,"() is not currently supported inside arrays"));const i=e._toFieldTransform(t);i&&t.fieldTransforms.push(i)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.arrayElement&&4!==t.dataSource)throw t.createError("Nested arrays are not supported");return function(e,t){const i=[];let n=0;for(const r of e){let e=_v(r,t.childContextForArray(n));null==e&&(e={nullValue:"NULL_VALUE"}),i.push(e),n++}return{arrayValue:{values:i}}}(e,t)}return function(e,t,i){if(null===(e=hr(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return Sf(t.serializer,e,i);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){const i=Ec.fromDate(e);return{timestampValue:Dm(t.serializer,i)}}if(e instanceof Ec){const i=new Ec(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:Dm(t.serializer,i)}}if(e instanceof yg)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof mg)return{bytesValue:Bm(t.serializer,e._byteString)};if(e instanceof sv){const i=t.databaseId,n=e.firestore._databaseId;if(!n.isEqual(i))throw t.createError("Document reference is for database ".concat(n.projectId,"/").concat(n.database," but should be for database ").concat(i.projectId,"/").concat(i.database));return{referenceValue:Vm(e.firestore._databaseId||t.databaseId,e._key.path)}}if(e instanceof hv)return function(e,t){const i=e instanceof hv?e.toArray():e,n={fields:{[Yd]:{stringValue:Xd},[qd]:{arrayValue:{values:i.map(e=>{if("number"!=typeof e)throw t.createError("VectorValues must only contain numeric values.");return Tf(t.serializer,e)})}}}};return{mapValue:n}}(e,t);if(cg(e))return e._toProto(t.serializer);throw t.createError("Unsupported field value: ".concat(xc(e)))}(e,t,i)}function Sv(e,t){const i={};return Ad(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):Ed(e,(e,n)=>{const r=_v(n,t.childContextForField(e));null!=r&&(i[e]=r)}),{mapValue:{fields:i}}}function Ev(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof Ec||e instanceof yg||e instanceof mg||e instanceof sv||e instanceof vg||e instanceof hv||cg(e))}function Cv(e,t,i){if(!Ev(i)||!yc(i)){const n=xc(i);throw"an object"===n?t.createError(e+" a custom object"):t.createError(e+" "+n)}}function Av(e,t,i){if((t=hr(t))instanceof gg)return t._internalPath;if("string"==typeof t)return Rv(e,t);throw Ov("Field path arguments must be of type string or ",e,!1,void 0,i)}const kv=new RegExp("[~\\*/\\[\\]]");function Rv(e,t,i){if(t.search(kv)>=0)throw Ov("Invalid field path (".concat(t,"). Paths must not contain '~', '*', '/', '[', or ']'"),e,!1,void 0,i);try{return new gg(...t.split("."))._internalPath}catch(n){throw Ov("Invalid field path (".concat(t,"). Paths must not be empty, begin with '.', end with '.', or contain '..'"),e,!1,void 0,i)}}function Ov(e,t,i,n,r){const s=n&&!n.isEmpty(),a=void 0!==r;let o="Function ".concat(t,"() called with invalid data");i&&(o+=" (via `toFirestore()`)"),o+=". ";let l="";return(s||a)&&(l+=" (found",s&&(l+=" in field ".concat(n)),a&&(l+=" in document ".concat(r)),l+=")"),new Wu(Yu.INVALID_ARGUMENT,o+e+l)}function Pv(e,t){return e.some(e=>e.isEqual(t))}function Mv(e){return"function"==typeof e._readUserData}class Nv{constructor(e){this.optionDefinitions=e}_getKnownOptions(e,t){const i=bf.empty();for(const r in this.optionDefinitions)if(this.optionDefinitions.hasOwnProperty(r)){const s=this.optionDefinitions[r];if(r in e){var n;const a=e[r];let o;s.nestedOptions&&yc(a)?o={mapValue:{fields:new Nv(s.nestedOptions).getOptionsProto(t,a)}}:a&&(o=null!==(n=_v(a,t))&&void 0!==n?n:void 0),o&&i.set(fc.fromServerFormat(s.serverName),o)}}return i}getOptionsProto(e,t,i){var n;const r=this._getKnownOptions(t,e);if(i){const t=new Map(Cd(i,(t,i)=>[fc.fromServerFormat(i),void 0!==t?_v(t,e):null]));r.setAll(t)}return null!==(n=r.value.mapValue.fields)&&void 0!==n?n:{}}}function Iv(){return new xv("serverTimestamp")}function Lv(e){let t;return e instanceof Bv?e:(t=yc(e)?$v(e):e instanceof Array?function(e){return function(e,t){return new qv("array",e.map(e=>Lv(e)),t)}(e,"array")}(e):Xv(e,void 0),t)}function Dv(e){if(e instanceof Bv)return e;if(e instanceof hv)return Gv(e);
vendor: 9,354 bytes, line 2
2if(Array.isArray(e))return Gv(function(e){return new hv(e)}(e));throw new Error("Unsupported value: "+typeof e)}function Fv(e){return Yc(e)?Yv(e):Lv(e)}class Bv{constructor(){this._protoValueType="ProtoValue"}add(e){return new qv("add",[this,Lv(e)],"add")}asBoolean(){if(this instanceof Kv)return this;if(this instanceof Wv)return new Jv(this);if(this instanceof jv)return new Zv(this);if(this instanceof qv)return new Qv(this);throw new Wu("invalid-argument","Conversion of type ".concat(typeof this," to BooleanExpression not supported."))}subtract(e){return new qv("subtract",[this,Lv(e)],"subtract")}multiply(e){return new qv("multiply",[this,Lv(e)],"multiply")}divide(e){return new qv("divide",[this,Lv(e)],"divide")}mod(e){return new qv("mod",[this,Lv(e)],"mod")}equal(e){return new qv("equal",[this,Lv(e)],"equal").asBoolean()}notEqual(e){return new qv("not_equal",[this,Lv(e)],"notEqual").asBoolean()}lessThan(e){return new qv("less_than",[this,Lv(e)],"lessThan").asBoolean()}lessThanOrEqual(e){return new qv("less_than_or_equal",[this,Lv(e)],"lessThanOrEqual").asBoolean()}greaterThan(e){return new qv("greater_than",[this,Lv(e)],"greaterThan").asBoolean()}greaterThanOrEqual(e){return new qv("greater_than_or_equal",[this,Lv(e)],"greaterThanOrEqual").asBoolean()}arrayConcat(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];const r=[e,...i].map(e=>Lv(e));return new qv("array_concat",[this,...r],"arrayConcat")}arrayContains(e){return new qv("array_contains",[this,Lv(e)],"arrayContains").asBoolean()}arrayContainsAll(e){const t=Array.isArray(e)?new Hv(e.map(Lv),"arrayContainsAll"):e;return new qv("array_contains_all",[this,t],"arrayContainsAll").asBoolean()}arrayContainsAny(e){const t=Array.isArray(e)?new Hv(e.map(Lv),"arrayContainsAny"):e;return new qv("array_contains_any",[this,t],"arrayContainsAny").asBoolean()}arrayReverse(){return new qv("array_reverse",[this])}arrayLength(){return new qv("array_length",[this],"arrayLength")}equalAny(e){const t=Array.isArray(e)?new Hv(e.map(Lv),"equalAny"):e;return new qv("equal_any",[this,t],"equalAny").asBoolean()}notEqualAny(e){const t=Array.isArray(e)?new Hv(e.map(Lv),"notEqualAny"):e;return new qv("not_equal_any",[this,t],"notEqualAny").asBoolean()}exists(){return new qv("exists",[this],"exists").asBoolean()}charLength(){return new qv("char_length",[this],"charLength")}like(e){return new qv("like",[this,Lv(e)],"like").asBoolean()}regexContains(e){return new qv("regex_contains",[this,Lv(e)],"regexContains").asBoolean()}regexFind(e){return new qv("regex_find",[this,Lv(e)],"regexFind")}regexFindAll(e){return new qv("regex_find_all",[this,Lv(e)],"regexFindAll")}regexMatch(e){return new qv("regex_match",[this,Lv(e)],"regexMatch").asBoolean()}stringContains(e){return new qv("string_contains",[this,Lv(e)],"stringContains").asBoolean()}startsWith(e){return new qv("starts_with",[this,Lv(e)],"startsWith").asBoolean()}endsWith(e){return new qv("ends_with",[this,Lv(e)],"endsWith").asBoolean()}toLower(){return new qv("to_lower",[this],"toLower")}toUpper(){return new qv("to_upper",[this],"toUpper")}trim(e){const t=[this];return e&&t.push(Lv(e)),new qv("trim",t,"trim")}ltrim(e){const t=[this];return e&&t.push(Lv(e)),new qv("ltrim",t,"ltrim")}rtrim(e){const t=[this];return e&&t.push(Lv(e)),new qv("rtrim",t,"rtrim")}type(){return new qv("type",[this])}isType(e){return new qv("is_type",[this,Gv(e)],"isType").asBoolean()}stringConcat(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];const r=[e,...i].map(Lv);return new qv("string_concat",[this,...r],"stringConcat")}stringIndexOf(e){return new qv("string_index_of",[this,Lv(e)],"stringIndexOf")}stringRepeat(e){return new qv("string_repeat",[this,Lv(e)],"stringRepeat")}stringReplaceAll(e,t){return new qv("string_replace_all",[this,Lv(e),Lv(t)],"stringReplaceAll")}stringReplaceOne(e,t){return new qv("string_replace_one",[this,Lv(e),Lv(t)],"stringReplaceOne")}concat(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];const r=[e,...i].map(Lv);return new qv("concat",[this,...r],"concat")}reverse(){return new qv("reverse",[this],"reverse")}arrayFilter(e,t){return new qv("array_filter",[this,Lv(e),t],"arrayFilter")}arrayTransform(e,t){return new qv("array_transform",[this,Lv(e),t],"arrayTransform")}arrayTransformWithIndex(e,t,i){return new qv("array_transform",[this,Lv(e),Lv(t),i],"arrayTransformWithIndex")}arraySlice(e,t){const i=[this,Lv(e)];return void 0!==t&&i.push(Lv(t)),new qv("array_slice",i,"arraySlice")}arrayFirst(){return new qv("array_first",[this],"arrayFirst")}arrayFirstN(e){return new qv("array_first_n",[this,Lv(e)],"arrayFirstN")}arrayLast(){return new qv("array_last",[this],"arrayLast")}arrayLastN(e){return new qv("array_last_n",[this,Lv(e)],"arrayLastN")}arrayMaximum(){return new qv("maximum",[this],"arrayMaximum")}arrayMaximumN(e){return new qv("maximum_n",[this,Lv(e)],"arrayMaximumN")}arrayMinimum(){return new qv("minimum",[this],"arrayMinimum")}arrayMinimumN(e){return new qv("minimum_n",[this,Lv(e)],"arrayMinimumN")}arrayIndexOf(e){return new qv("array_index_of",[this,Lv(e),Lv("first")],"arrayIndexOf")}arrayLastIndexOf(e){return new qv("array_index_of",[this,Lv(e),Lv("last")],"arrayLastIndexOf")}arrayIndexOfAll(e){return new qv("array_index_of_all",[this,Lv(e)],"arrayIndexOfAll")}byteLength(){return new qv("byte_length",[this],"byteLength")}ceil(){return new qv("ceil",[this])}floor(){return new qv("floor",[this])}abs(){return new qv("abs",[this])}exp(){return new qv("exp",[this])}mapGet(e){return new qv("map_get",[this,Gv(e)],"mapGet")}mapSet(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];const s=[this,Lv(e),Lv(t),...n.map(Lv)];return new qv("map_set",s,"mapSet")}mapKeys(){return new qv("map_keys",[this],"mapKeys")}mapValues(){return new qv("map_values",[this],"mapValues")}mapEntries(){return new qv("map_entries",[this],"mapEntries")}getField(e){return new qv("get_field",[this,Lv(e)],"get_field")}count(){return Uv._create("count",[this],"count")}sum(){return Uv._create("sum",[this],"sum")}average(){return Uv._create("average",[this],"average")}minimum(){return Uv._create("minimum",[this],"minimum")}maximum(){return Uv._create("maximum",[this],"maximum")}first(){return Uv._create("first",[this],"first")}last(){return Uv._create("last",[this],"last")}arrayAgg(){return Uv._create("array_agg",[this],"arrayAgg")}arrayAggDistinct(){return Uv._create("array_agg_distinct",[this],"arrayAggDistinct")}countDistinct(){return Uv._create("count_distinct",[this],"countDistinct")}logicalMaximum(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];const r=[e,...i];return new qv("maximum",[this,...r.map(Lv)],"logicalMaximum")}logicalMinimum(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];const r=[e,...i];return new qv("minimum",[this,...r.map(Lv)],"minimum")}vectorLength(){return new qv("vector_length",[this],"vectorLength")}cosineDistance(e){return new qv("cosine_distance",[this,Dv(e)],"cosineDistance")}dotProduct(e){return new qv("dot_product",[this,Dv(e)],"dotProduct")}euclideanDistance(e){return new qv("euclidean_distance",[this,Dv(e)],"euclideanDistance")}unixMicrosToTimestamp(){return new qv("unix_micros_to_timestamp",[this],"unixMicrosToTimestamp")}timestampToUnixMicros(){return new qv("timestamp_to_unix_micros",[this],"timestampToUnixMicros")}unixMillisToTimestamp(){return new qv("unix_millis_to_timestamp",[this],"unixMillisToTimestamp")}timestampToUnixMillis(){return new qv("timestamp_to_unix_millis",[this],"timestampToUnixMillis")}unixSecondsToTimestamp(){return new qv("unix_seconds_to_timestamp",[this],"unixSecondsToTimestamp")}timestampToUnixSeconds(){return new qv("timestamp_to_unix_seconds",[this],"timestampToUnixSeconds")}timestampAdd(e,t){return new qv("timestamp_add",[this,Lv(e),Lv(t)],"timestampAdd")}timestampSubtract(e,t){return new qv("timestamp_subtract",[this,Lv(e),Lv(t)],"timestampSubtract")}timestampDiff(e,t){return new qv("timestamp_diff",[this,Fv(e),Lv(t)],"timestampDiff")}timestampExtract(e,t){const i=[this,Lv(e)];return t&&i.push(Lv(t)),new qv("timestamp_extract",i,"timestampExtract")}documentId(){return new qv("document_id",[this],"documentId")}parent(){return new qv("parent",[this],"parent")}substring(e,t){const i=Lv(e);return new qv("substring",void 0===t?[this,i]:[this,i,Lv(t)],"substring")}arrayGet(e){return new qv("array_get",[this,Lv(e)],"arrayGet")}isError(){return new qv("is_error",[this],"isError").asBoolean()}ifError(e){const t=new qv("if_error",[this,Lv(e)],"ifError");return e instanceof Kv?t.asBoolean():t}isAbsent(){return new qv("is_absent",[this],"isAbsent").asBoolean()}mapRemove(e){return new qv("map_remove",[this,Lv(e)],"mapRemove")}mapMerge(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];const r=Lv(e),s=i.map(Lv);return new qv("map_merge",[this,r,...s],"mapMerge")}pow(e){return new qv("pow",[this,Lv(e)])}trunc(e){return void 0===e?new qv("trunc",[this]):new qv("trunc",[this,Lv(e)],"trunc")}round(e){return void 0===e?new qv("round",[this]):new qv("round",[this,Lv(e)],"round")}collectionId(){return new qv("collection_id",[this])}length(){return new qv("length",[this])}ln(){return new qv("ln",[this])}sqrt(){return new qv("sqrt",[this])}
2stringReverse(){return new qv("string_reverse",[this])}ifAbsent(e){return new qv("if_absent",[this,Lv(e)],"ifAbsent")}ifNull(e){return new qv("if_null",[this,Lv(e)],"ifNull")}coalesce(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return new qv("coalesce",[this,Lv(e),...i.map(Lv)],"coalesce")}join(e){return new qv("join",[this,Lv(e)],"join")}log10(){return new qv("log10",[this])}arraySum(){return new qv("sum",[this])}split(e){return new qv("split",[this,Lv(e)])}timestampTruncate(e,t){const i=[this,Lv(e)];return t&&i.push(Lv(t)),new qv("timestamp_trunc",i)}ascending(){return new ey(Fv(this),"ascending","ascending")}descending(){return new ey(Fv(this),"descending","descending")}as(e){return new Vv(this,e,"as")}}class Uv{constructor(e,t){this.name=e,this.params=t,this.exprType="AggregateFunction",this._protoValueType="ProtoValue"}static _create(e,t,i){const n=new Uv(e,t);return n._methodName=i,n}as(e){return new zv(this,e,"as")}_toProto(e){return{functionValue:{name:this.name,args:this.params.map(t=>t._toProto(e))}}}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}):e,this.params.forEach(t=>t._readUserData(e))}}class zv{constructor(e,t,i){this.aggregate=e,this.alias=t,this._methodName=i}_readUserData(e){this.aggregate._readUserData(e)}}class Vv{constructor(e,t,i){this.expr=e,this.alias=t,this._methodName=i,this.exprType="AliasedExpression",this.selectable=!0}_readUserData(e){this.expr._readUserData(e)}}class Hv extends Bv{constructor(e,t){super(),this.Rr=e,this._methodName=t,this.expressionType="ListOfExpressions"}_toProto(e){return{arrayValue:{values:this.Rr.map(t=>t._toProto(e))}}}_readUserData(e){this.Rr.forEach(t=>t._readUserData(e))}}class jv extends Bv{constructor(e,t){super(),this.fieldPath=e,this._methodName=t,this.expressionType="Field",this.selectable=!0}get _fieldPath(){return this.fieldPath}get fieldName(){return this.fieldPath.canonicalString()}get alias(){return this.fieldName}get expr(){return this}geoDistance(e){return new qv("geo_distance",[this,Lv(e)],"geoDistance")}_toProto(e){return{fieldReferenceValue:this.fieldPath.canonicalString()}}_readUserData(e){}}function Yv(e){return function(e,t){return new jv("string"==typeof e?hc===e?new gg(hc)._internalPath:Av("field",e):e._internalPath,t)}(e,"field")}class Wv extends Bv{constructor(e,t){super(),this.value=e,this._methodName=t,this.expressionType="Constant"}static _fromProto(e){const t=new Wv(e,void 0);return t._protoValue=e,t}_toProto(e){return Hu(void 0!==this._protoValue,237),this._protoValue}_getValue(){return this._protoValue}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}):e,function(e){return"object"==typeof e&&null!==e&&!!("nullValue"in e&&(null===e.nullValue||"NULL_VALUE"===e.nullValue)||"booleanValue"in e&&(null===e.booleanValue||"boolean"==typeof e.booleanValue)||"integerValue"in e&&(null===e.integerValue||"number"==typeof e.integerValue||"string"==typeof e.integerValue)||"doubleValue"in e&&(null===e.doubleValue||"number"==typeof e.doubleValue)||"timestampValue"in e&&(null===e.timestampValue||function(e){return"object"==typeof e&&null!==e&&"seconds"in e&&(null===e.seconds||"number"==typeof e.seconds||"string"==typeof e.seconds)&&"nanos"in e&&(null===e.nanos||"number"==typeof e.nanos)}(e.timestampValue))||"stringValue"in e&&(null===e.stringValue||"string"==typeof e.stringValue)||"bytesValue"in e&&(null===e.bytesValue||e.bytesValue instanceof Uint8Array)||"referenceValue"in e&&(null===e.referenceValue||"string"==typeof e.referenceValue)||"geoPointValue"in e&&(null===e.geoPointValue||function(e){return"object"==typeof e&&null!==e&&"latitude"in e&&(null===e.latitude||"number"==typeof e.latitude)&&"longitude"in e&&(null===e.longitude||"number"==typeof e.longitude)}(e.geoPointValue))||"arrayValue"in e&&(null===e.arrayValue||function(e){return"object"==typeof e&&null!==e&&!(!("values"in e)||null!==e.values&&!Array.isArray(e.values))}(e.arrayValue))||"mapValue"in e&&(null===e.mapValue||function(e){return"object"==typeof e&&null!==e&&!(!("fields"in e)||null!==e.fields&&!yc(e.fields))}(e.mapValue))||"fieldReferenceValue"in e&&(null===e.fieldReferenceValue||"string"==typeof e.fieldReferenceValue)||"functionValue"in e&&(null===e.functionValue||function(e){return"object"==typeof e&&null!==e&&!(!("name"in e)||null!==e.name&&"string"!=typeof e.name||!("args"in e)||null!==e.args&&!Array.isArray(e.args))}(e.functionValue))||"pipelineValue"in e&&(null===e.pipelineValue||function(e){return"object"==typeof e&&null!==e&&!(!("stages"in e)||null!==e.stages&&!Array.isArray(e.stages))}(e.pipelineValue)))}(this._protoValue)||(this._protoValue=_v(this.value,e))}}function Gv(e,t){return Xv(e,"constant")}function Xv(e,t){const i=new Wv(e,t);return"boolean"==typeof e?new Jv(i):i}class qv extends Bv{constructor(e,t,i,n){super(),this.name=e,this.params=t,this.expressionType="Function",this._optionsProto=void 0,void 0!==i&&(this._methodName=i),void 0!==n&&(this._options=n)}get _optionsUtil(){return new Nv({})}_toProto(e){const t={functionValue:{name:this.name,args:this.params.map(t=>t._toProto(e))}};return this._optionsProto&&(t.functionValue.options=this._optionsProto),t}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}
2):e,this.params.forEach(t=>t._readUserData(e)),this._options&&(this._optionsProto=this._optionsUtil.getOptionsProto(e,this._options))}}class Kv extends Bv{get _methodName(){return this._expr._methodName}countIf(){return Uv._create("count_if",[this],"countIf")}not(){return new qv("not",[this],"not").asBoolean()}conditional(e,t){return new qv("conditional",[this,e,t],"conditional")}ifError(e){const t=Lv(e),i=new qv("if_error",[this,t],"ifError");return t instanceof Kv?i.asBoolean():i}_toProto(e){return this._expr._toProto(e)}_readUserData(e){this._expr._readUserData(e)}}class Qv extends Kv{constructor(e){super(),this._expr=e,this.expressionType="Function"}}class Jv extends Kv{constructor(e){super(),this._expr=e,this.expressionType="Constant"}_getValue(){return this._expr._getValue()}}class Zv extends Kv{constructor(e){super(),this._expr=e,this.expressionType="Field"}}function $v(e,t){const i=[];for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const t=e[n];i.push(Gv(n)),i.push(Lv(t))}return new qv("map",i,"map")}class ey{constructor(e,t,i){this.expr=e,this.direction=t,this._methodName=i,this._protoValueType="ProtoValue"}_toProto(e){return{mapValue:{fields:{direction:fg(this.direction),expression:this.expr._toProto(e)}}}}_readUserData(e){this.expr._readUserData(e)}}class ty{constructor(e){var t;this.optionsProto=void 0,t=e,this.rawOptions=t.rawOptions,this.knownOptions=r(t,Pu)}_readUserData(e){this.optionsProto=this._optionsUtil.getOptionsProto(e,this.knownOptions,this.rawOptions)}_toProto(e){return{name:this._name,options:this.optionsProto}}}class iy extends ty{get _name(){return"add_fields"}get _optionsUtil(){return new Nv({})}constructor(e,t){super(t),this.fields=e}_toProto(e){return m(m({},super._toProto(e)),{},{args:[dg(e,this.fields)]})}_readUserData(e){super._readUserData(e),my(this.fields,e)}}class ny extends ty{get _name(){return"aggregate"}get _optionsUtil(){return new Nv({})}constructor(e,t,i){super(i),this.groups=e,this.accumulators=t}_toProto(e){return m(m({},super._toProto(e)),{},{args:[dg(e,this.accumulators),dg(e,this.groups)]})}_readUserData(e){super._readUserData(e),my(this.groups,e),my(this.accumulators,e)}}class ry extends ty{get _name(){return"distinct"}get _optionsUtil(){return new Nv({})}constructor(e,t){super(t),this.groups=e}_toProto(e){return m(m({},super._toProto(e)),{},{args:[dg(e,this.groups)]})}_readUserData(e){super._readUserData(e),my(this.groups,e)}}class sy extends ty{get _name(){return"collection"}get _optionsUtil(){return new Nv({forceIndex:{serverName:"force_index"}})}constructor(e,t){super(t),this.Vr=e.startsWith("/")?e:"/"+e}_toProto(e){return m(m({},super._toProto(e)),{},{args:[{referenceValue:this.Vr}]})}_readUserData(e){super._readUserData(e)}}class ay extends ty{get _name(){return"collection_group"}get _optionsUtil(){return new Nv({forceIndex:{serverName:"force_index"}})}constructor(e,t){super(t),this.collectionId=e}_toProto(e){return m(m({},super._toProto(e)),{},{args:[{referenceValue:""},{stringValue:this.collectionId}]})}_readUserData(e){super._readUserData(e)}}class oy extends ty{get _name(){return"database"}get _optionsUtil(){return new Nv({})}_toProto(e){return m({},super._toProto(e))}_readUserData(e){super._readUserData(e)}}class ly extends ty{get _name(){return"documents"}get _optionsUtil(){return new Nv({})}constructor(e,t){if(super(t),!e||0===e.length)throw new Wu(Yu.INVALID_ARGUMENT,"Empty document paths are not allowed in DocumentsSource");const i=e.map(e=>e.startsWith("/")?e:"/"+e),n=new Set(i);if(n.size!==i.length)throw new Wu(Yu.INVALID_ARGUMENT,"Duplicate document paths are not allowed in DocumentsSource");this.dr=i,this.mr=n}_toProto(e){return m(m({},super._toProto(e)),{},{args:this.dr.map(e=>({referenceValue:e}))})}_readUserData(e){super._readUserData(e)}}class hy extends ty{get _name(){return"where"}get _optionsUtil(){return new Nv({})}constructor(e,t){super(t),this.condition=e}_toProto(e){return m(m({},super._toProto(e)),{},{args:[this.condition._toProto(e)]})}_readUserData(e){super._readUserData(e),my(this.condition,e)}}class uy extends ty{get _name(){return"limit"}get _optionsUtil(){return new Nv({})}constructor(e,t){Hu(!isNaN(e)&&e!==1/0&&e!==-1/0,34860),super(t),this.limit=e}_toProto(e){return m(m({},super._toProto(e)),{},{args:[Sf(e,this.limit)]})}}class cy extends ty{get _name(){return"offset"}get _optionsUtil(){return new Nv({})}constructor(e,t){super(t),this.offset=e}_toProto(e){return m(m({},super._toProto(e)),{},{args:[Sf(e,this.offset)]})}}class dy extends ty{get _name(){return"select"}get _optionsUtil(){return new Nv({})}constructor(e,t){super(t),this.selections=e}_toProto(e){return m(m({},super._toProto(e)),{},{args:[dg(e,this.selections)]})}_readUserData(e){super._readUserData(e),my(this.selections,e)}}class fy extends ty{get _name(){return"sort"}get _optionsUtil(){return new Nv({})}constructor(e,t){super(t),this.orderings=e}_toProto(e){return m(m({},super._toProto(e)),{},{args:this.orderings.map(t=>t._toProto(e))})}_readUserData(e){super._readUserData(e),my(this.orderings,e)}}class py extends ty{get _name(){return"replace_with"}get _optionsUtil(){return new Nv({})}constructor(e,t){super(t),this.map=e}_toProto(e){return m(m({},super._toProto(e)),{},{args:[this.map._toProto(e),fg(py.pr)]})}_readUserData(e){super._readUserData(e),my(this.map,e)}}py.pr="full_replace";function my(e,t){return Mv(e)?e._readUserData(t):Array.isArray(e)||e instanceof Map?e.forEach(e
2=>e._readUserData(t)):Object.values(e).forEach(e=>e._readUserData(t)),e}class gy{constructor(e,t,i){this.serializer=e,this.stages=t,this.listenOptions=i,this.isCorePipeline=!0}getPipelineCollection(){return yy(this)}getPipelineCollectionGroup(){return xy(this)}getPipelineCollectionId(){return by(this)}getPipelineDocuments(){return wy(this)}getPipelineFlavor(){return function(e){let t="exact";return e.stages.forEach((i,n)=>{i._name!==ry.name&&i._name!==ny.name||(t="keyless"),i._name===dy.name&&"exact"===t&&(t="augmented"),i._name===iy.name&&n<e.stages.length-1&&"exact"===t&&(t="augmented")}),t}(this)}getPipelineSourceType(){return vy(this)}}function vy(e){const t=e.stages[0];return t instanceof sy||t instanceof ay||t instanceof oy||t instanceof ly?t._name:"unknown"}function yy(e){if("collection"===vy(e))return e.stages[0].Vr}function xy(e){if("collection_group"===vy(e))return e.stages[0].collectionId}function by(e){switch(vy(e)){case"collection":return cc.fromString(yy(e)).lastSegment();case"collection_group":return xy(e);default:return}}function wy(e){if("documents"===vy(e))return e.stages[0].dr}class Ty{constructor(e,t,i,n){this._db=e,this.userDataReader=t,this._userDataWriter=i,this.stages=n}wr(e,t){const i=this.userDataReader.createContext(3,e);return Mv(t)?t._readUserData(i):(Array.isArray(t),t.forEach(e=>e._readUserData(i))),t}where(e){const t=this.stages.map(e=>e);return this.wr("where",e),t.push(new hy(e,{})),new Ty(this._db,this.userDataReader,this._userDataWriter,t)}limit(e){const t=this.stages.map(e=>e);return t.push(new uy(e,{})),new Ty(this._db,this.userDataReader,this._userDataWriter,t)}sort(e){const t=this.stages.map(e=>e);for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return"orderings"in e?t.push(new fy(this.wr("sort",e.orderings),{})):t.push(new fy(this.wr("sort",[e,...n]),{})),new Ty(this._db,this.userDataReader,this._userDataWriter,t)}br(e){return{pipeline:{stages:this.stages.map(t=>t._toProto(e))}}}}class _y{constructor(e,t){this.type=e,this.value=t}static vr(){return new _y("ERROR",void 0)}static Sr(){return new _y("UNSET",void 0)}static Dr(){return new _y("NULL",Kd)}static newValue(e){return ff(e)?new _y("NULL",Kd):function(e){return!!e&&"booleanValue"in e}(e)?new _y("BOOLEAN",e):hf(e)?new _y("INT",e):uf(e)?new _y("DOUBLE",e):function(e){return!!e&&"timestampValue"in e&&!!e.timestampValue}(e)?new _y("TIMESTAMP",e):function(e){return!!e&&"stringValue"in e}(e)?new _y("STRING",e):function(e){return!!e&&"bytesValue"in e}(e)?new _y("BYTES",e):e.referenceValue?new _y("REFERENCE",e):e.geoPointValue?new _y("GEO_POINT",e):df(e)?new _y("ARRAY",e):gf(e)?new _y("VECTOR",e):mf(e)?new _y("MAP",e):new _y("ERROR",void 0)}Cr(){return"ERROR"===this.type||"UNSET"===this.type}Fr(){return"NULL"===this.type}}function Sy(e){if(!e.Cr())return e.value}function Ey(e){return e instanceof Kv?e._expr:e}function Cy(e){if((e=Ey(e))instanceof jv)return new Ay(e);if(e instanceof Wv)return new ky(e);if(e instanceof Hv)return new Ry(e);if(e instanceof qv){if("add"===e.name)return new Dy(e);if("subtract"===e.name)return new Fy(e);if("multiply"===e.name)return new By(e);if("divide"===e.name)return new Uy(e);if("mod"===e.name)return new zy(e);if("and"===e.name)return new Vy(e);if("equal"===e.name)return new nx(e);if("not_equal"===e.name)return new rx(e);if("less_than"===e.name)return new sx(e);if("less_than_or_equal"===e.name)return new ax(e);if("greater_than"===e.name)return new ox(e);if("greater_than_or_equal"===e.name)return new lx(e);if("array_concat"===e.name)return new hx(e);if("array_reverse"===e.name)return new ux(e);if("array_contains"===e.name)return new cx(e);if("array_contains_all"===e.name)return new dx(e);if("array_contains_any"===e.name)return new fx(e);if("array_length"===e.name)return new px(e);if("array_element"===e.name)return new mx(e);if("equal_any"===e.name)return new Wy(e);if("not_equal_any"===e.name)return new Gy(e);if("is_nan"===e.name)return new Xy(e);if("is_not_nan"===e.name)return new qy(e);if("is_null"===e.name)return new Ky(e);if("is_not_null"===e.name)return new Qy(e);if("is_error"===e.name)return new Jy(e);if("exists"===e.name)return new Zy(e);if("not"===e.name)return new Hy(e);if("or"===e.name)return new jy(e);if("xor"===e.name)return new Yy(e);if("conditional"===e.name)return new $y(e);if("maximum"===e.name)return new ex(e);if("minimum"===e.name)return new tx(e);if("reverse"===e.name)return new gx(e);if("replace_first"===e.name)return new vx(e);if("replace_all"===e.name)return new yx(e);if("char_length"===e.name)return new xx(e);if("byte_length"===e.name)return new bx(e);if("like"===e.name)return new Tx(e);if("regex_contains"===e.name)return new _x(e);if("regex_match"===e.name)return new Sx(e);if("string_contains"===e.name)return new Ex(e);if("starts_with"===e.name)return new Cx(e);if("ends_with"===e.name)return new Ax(e);if("to_lower"===e.name)return new kx(e);if("to_upper"===e.name)return new Rx(e);if("trim"===e.name)return new Ox(e);if("string_concat"===e.name)return new Px(e);if("map_get"===e.name)return new Mx(e);if("cosine_distance"===e.name)return new Ix(e);if("dot_product"===e.name)return new Lx(e);if("euclidean_distance"===e.name)return new Dx(e);if("vector_length"===e.name)return new Fx(e);if("unix_micros_to_timestamp"===e.name)return new Zx(e);if("timestamp_to_unix_micros"===e.name)return new ib(e);
2if("unix_millis_to_timestamp"===e.name)return new $x(e);if("timestamp_to_unix_millis"===e.name)return new nb(e);if("unix_seconds_to_timestamp"===e.name)return new eb(e);if("timestamp_to_unix_seconds"===e.name)return new rb(e);if("timestamp_add"===e.name)return new ab(e);if("timestamp_subtract"===e.name)return new ob(e)}throw new Error("Unknown Expr : ".concat(e))}class Ay{constructor(e){this.expr=e}evaluate(e,t){if(this.expr.fieldName===hc)return _y.newValue({referenceValue:Ym(e.serializer,t.key)});if("__update_time__"===this.expr.fieldName)return _y.newValue({timestampValue:Um(e.serializer,t.version)});if("__create_time__"===this.expr.fieldName)return _y.newValue({timestampValue:Um(e.serializer,t.createTime)});const i=t.data.field(this.expr._fieldPath);return i?Bd(i)?_y.newValue(function(e,t){if("estimate"===e.serverTimestampBehavior)return{timestampValue:Um(e.serializer,Cc.fromTimestamp(zd(t)))};if("previous"===e.serverTimestampBehavior){const e=Ud(t);if(e)return e}return{nullValue:"NULL_VALUE"}}(e,i)):_y.newValue(i):_y.Sr()}}class ky{constructor(e){this.expr=e}evaluate(e,t){return _y.newValue(this.expr._getValue())}}class Ry{constructor(e){this.expr=e}evaluate(e,t){const i=this.expr.Rr.map(i=>Cy(i).evaluate(e,t));return i.some(e=>e.Cr())?_y.vr():_y.newValue({arrayValue:{values:i.map(e=>e.value)}})}}function Oy(e){return uf(e)?Number(e.doubleValue):Number(e.integerValue)}function Py(e){return BigInt(e.integerValue)}const My=BigInt("0x7fffffffffffffff"),Ny=-BigInt("0x8000000000000000");class Iy{constructor(e){this.expr=e}evaluate(e,t){Hu(this.expr.params.length>=2,24778);const i=Cy(this.expr.params[0]).evaluate(e,t),n=Cy(this.expr.params[1]).evaluate(e,t);let r=this.Or(i,n);for(const s of this.expr.params.slice(2)){const i=Cy(s).evaluate(e,t);r=this.Or(r,i)}return r}Or(e,t){if(e.Cr()||t.Cr())return _y.vr();if(e.Fr()||t.Fr())return _y.Dr();const i=e.value,n=t.value;if(!uf(i)&&!hf(i)||!uf(n)&&!hf(n))return _y.vr();if(uf(i)||uf(n)){const e=this.Mr(i,n);return e?_y.newValue(e):_y.vr()}if(hf(i)&&hf(n)){const e=this.Nr(i,n);return void 0===e?_y.vr():"number"==typeof e?_y.newValue({doubleValue:e}):e<Ny||e>My?_y.vr():_y.newValue({integerValue:"".concat(e)})}return _y.vr()}}function Ly(e,t){return Zd(e)!==Zd(t)?"TYPE_MISMATCH":pf(e)||pf(t)?"NOT_EQ":ff(e)&&ff(t)?"EQ":ff(e)||ff(t)?"NULL":df(e)&&df(t)?function(e,t){var i,n;if((null===(i=e.values)||void 0===i?void 0:i.length)!==(null===(n=t.values)||void 0===n?void 0:n.length))return"NOT_EQ";let r=!1;for(let o=0;o<(null!==(s=null===(a=e.values)||void 0===a?void 0:a.length)&&void 0!==s?s:0);o++){var s,a;const i=e.values[o],n=t.values[o];switch(Ly(i,n)){case"EQ":break;case"NOT_EQ":case"TYPE_MISMATCH":return"NOT_EQ";case"NULL":r=!0;break;default:zu(44609,{Lr:i,Br:n})}}return r?"NULL":"EQ"}(e.arrayValue,t.arrayValue):gf(e)&&gf(t)||mf(e)&&mf(t)?function(e,t){const i=e.fields||{},n=t.fields||{};if(Sd(i)!==Sd(n))return"NOT_EQ";let r=!1;for(const s in i)if(i.hasOwnProperty(s)){if(void 0===n[s])return"NOT_EQ";switch(Ly(i[s],n[s])){case"NOT_EQ":case"TYPE_MISMATCH":return"NOT_EQ";case"NULL":r=!0}}return r?"NULL":"EQ"}(e.mapValue,t.mapValue):function(e,t){return $d(e,t,{Te:!1,Ee:!0,he:!0})}(e,t)?"EQ":"NOT_EQ"}class Dy extends Iy{Nr(e,t){return Py(e)+Py(t)}Mr(e,t){return{doubleValue:Oy(e)+Oy(t)}}}class Fy extends Iy{constructor(e){super(e),this.expr=e}Nr(e,t){return Py(e)-Py(t)}Mr(e,t){return{doubleValue:Oy(e)-Oy(t)}}}class By extends Iy{constructor(e){super(e),this.expr=e}Nr(e,t){return Py(e)*Py(t)}Mr(e,t){return{doubleValue:Oy(e)*Oy(t)}}}class Uy extends Iy{constructor(e){super(e),this.expr=e}Nr(e,t){const i=Py(t);if(i!==BigInt(0))return Py(e)/i}Mr(e,t){const i=Oy(t);return 0===i?{doubleValue:Hc(i)?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY}:{doubleValue:Oy(e)/i}}}class zy extends Iy{constructor(e){super(e),this.expr=e}Nr(e,t){const i=Py(t);if(i!==BigInt(0))return Py(e)%i}Mr(e,t){const i=Oy(t);if(0!==i)return{doubleValue:Oy(e)%i}}}class Vy{constructor(e){this.expr=e}evaluate(e,t){var i;let n=!1,r=!1;for(const s of this.expr.params){const a=Cy(s).evaluate(e,t);switch(a.type){case"BOOLEAN":if(null===(i=a.value)||void 0===i||!i.booleanValue)return _y.newValue(Jd);break;case"NULL":r=!0;break;default:n=!0}
2}return n?_y.vr():r?_y.Dr():_y.newValue(Qd)}}class Hy{constructor(e){this.expr=e}evaluate(e,t){var i;Hu(1===this.expr.params.length,9634);const n=Cy(this.expr.params[0]).evaluate(e,t);switch(n.type){case"BOOLEAN":return _y.newValue({booleanValue:!(null!==(i=n.value)&&void 0!==i&&i.booleanValue)});case"NULL":return _y.Dr();default:return _y.vr()}}}class jy{constructor(e){this.expr=e}evaluate(e,t){var i;let n=!1,r=!1;for(const s of this.expr.params){const a=Cy(s).evaluate(e,t);switch(a.type){case"BOOLEAN":if(null!==(i=a.value)&&void 0!==i&&i.booleanValue)return _y.newValue(Qd);break;case"NULL":r=!0;break;default:n=!0}}return n?_y.vr():r?_y.Dr():_y.newValue(Jd)}}class Yy{constructor(e){this.expr=e}evaluate(e,t){var i;let n=!1,r=!1;for(const s of this.expr.params){const a=Cy(s).evaluate(e,t);switch(a.type){case"BOOLEAN":n=Yy.xor(n,!(null===(i=a.value)||void 0===i||!i.booleanValue));break;case"NULL":r=!0;break;default:return _y.vr()}}return r?_y.Dr():_y.newValue({booleanValue:n})}static xor(e,t){return(e||t)&&!(e&&t)}}class Wy{constructor(e){this.expr=e}evaluate(e,t){Hu(2===this.expr.params.length,55094);let i=!1;const n=Cy(this.expr.params[0]).evaluate(e,t);switch(n.type){case"NULL":i=!0;break;case"ERROR":case"UNSET":return _y.vr()}const r=Cy(this.expr.params[1]).evaluate(e,t);switch(r.type){case"ARRAY":break;case"NULL":i=!0;break;default:return _y.vr()}if(i)return _y.Dr();for(const o of null!==(s=null===(a=r.value)||void 0===a||null===(a=a.arrayValue)||void 0===a?void 0:a.values)&&void 0!==s?s:[]){var s,a;switch(ff(n.value)&&ff(o)?"EQ":Ly(n.value,o)){case"EQ":return _y.newValue(Qd);case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":i=!0;break;default:zu(44608,{value:n.value,candidate:o})}}return i?_y.Dr():_y.newValue(Jd)}}class Gy{constructor(e){this.expr=e}evaluate(e,t){return new Hy(new qv("not",[new qv("equal_any",this.expr.params)])).evaluate(e,t)}}class Xy{constructor(e){this.expr=e}evaluate(e,t){Hu(1===this.expr.params.length,23322);const i=Cy(this.expr.params[0]).evaluate(e,t);switch(i.type){case"INT":return _y.newValue(Jd);case"DOUBLE":return _y.newValue({booleanValue:isNaN(Oy(i.value))});case"NULL":return _y.Dr();default:return _y.vr()}}}class qy{constructor(e){this.expr=e}evaluate(e,t){return Hu(1===this.expr.params.length,50406),new Hy(new qv("not",[new qv("is_nan",this.expr.params)])).evaluate(e,t)}}class Ky{constructor(e){this.expr=e}evaluate(e,t){switch(Hu(1===this.expr.params.length,23123),Cy(this.expr.params[0]).evaluate(e,t).type){case"NULL":return _y.newValue(Qd);case"UNSET":case"ERROR":return _y.vr();default:return _y.newValue(Jd)}}}class Qy{constructor(e){this.expr=e}evaluate(e,t){return Hu(1===this.expr.params.length,23167),new Hy(new qv("not",[new qv("is_null",this.expr.params)])).evaluate(e,t)}}class Jy{constructor(e){this.expr=e}evaluate(e,t){return Hu(1===this.expr.params.length,5228),"ERROR"===Cy(this.expr.params[0]).evaluate(e,t).type?_y.newValue(Qd):_y.newValue(Jd)}}class Zy{constructor(e){this.expr=e}evaluate(e,t){switch(Hu(1===this.expr.params.length,6877),Cy(this.expr.params[0]).evaluate(e,t).type){case"ERROR":return _y.vr();case"UNSET":return _y.newValue(Jd);default:return _y.newValue(Qd)}}}class $y{constructor(e){this.expr=e}evaluate(e,t){var i;Hu(3===this.expr.params.length,11706);const n=Cy(this.expr.params[0]).evaluate(e,t);switch(n.type){case"BOOLEAN":return null!==(i=n.value)&&void 0!==i&&i.booleanValue?Cy(this.expr.params[1]).evaluate(e,t):Cy(this.expr.params[2]).evaluate(e,t);case"NULL":return Cy(this.expr.params[2]).evaluate(e,t);default:return _y.vr()}}}class ex{constructor(e){this.expr=e}evaluate(e,t){const i=this.expr.params.map(i=>Cy(i).evaluate(e,t));let n;for(const r of i)switch(r.type){case"ERROR":case"UNSET":case"NULL":continue;default:n=void 0===n||tf(r.value,n.value)>0?r:n}return void 0===n?_y.Dr():n}}class tx{constructor(e){this.expr=e}evaluate(e,t){const i=this.expr.params.map(i=>Cy(i).evaluate(e,t));let n;for(const r of i)switch(r.type){case"ERROR":case"UNSET":case"NULL":continue;default:n=void 0===n||tf(r.value,n.value)<0?r:n}return void 0===n?_y.Dr():n}}class ix{constructor(e){this.expr=e}evaluate(e,t){Hu(2===this.expr.params.length,31033,"".concat(this.expr.name,"() function should have exactly 2 params"));const i=Cy(this.expr.params[0]).evaluate(e,t);switch(i.type){case"ERROR":case"UNSET":return _y.vr()}const n=Cy(this.expr.params[1]).evaluate(e,t);switch(n.type){case"ERROR":case"UNSET":return _y.vr()}return this.Ur(i,n)}}class nx extends ix{constructor(e){super(e),this.expr=e}Ur(e,t){if(e.Fr()&&t.Fr())return _y.newValue(Qd);if(e.Fr()||t.Fr())return _y.newValue(Jd);if(pf(e.value)||pf(t.value))return _y.newValue(Jd);if(Zd(e.value)!==Zd(t.value))return _y.newValue(Jd);switch(Ly(e.value,t.value)){case"EQ":return _y.newValue(Qd);case"NOT_EQ":return _y.newValue(Jd);case"NULL":return _y.Dr();default:zu(44615,{left:e,right:t})}}}class rx extends ix{constructor(e){super(e),this.expr=e}Ur(e,t){switch(Ly(e.value,t.value)){case"EQ":return _y.newValue(Jd);case"NOT_EQ":case"TYPE_MISMATCH":return _y.newValue(Qd);case"NULL":return _y.Dr();default:zu(44614,{left:e,right:t})}}}class sx extends ix{constructor(e){super(e),this.expr=e}Ur(e,t){return Zd(e.value)!==Zd(t.value)||pf(e.value)||pf(t.value)?_y.newValue(Jd):_y.newValue({booleanValue:tf(e.value,t.value)<0})}}class ax extends ix{constructor(e){super(e),this.expr=e}Ur(e,t){return Zd(e.value)!==Zd(t.value)||pf(e.value)||pf(t.value)?_y.newValue(Jd):"EQ"===Ly(e.value,t.value)?_y.newValue(Qd):_y.newValue({booleanValue:tf(e.value,t.value)<0})}}class ox extends ix{constructor(e){super(e),this.expr=e}Ur(e,t){return Zd(e.value)!==Zd(t.value)||pf(e.value)||pf(t.value)?_y.newValue(Jd):_y.newValue({booleanValue:tf(e.value,t.value)>0})}}class lx extends ix{constructor(e){super(e),this.expr=e}Ur(e,t){return Zd(e.value)!==Zd(t.value)||pf(e.value)||pf(t.value)?_y.newValue(Jd):"EQ"===Ly(e.value,t.value)?_y.newValue(Qd):_y.newValue({booleanValue:tf(e.value,t.value)>0})}}class hx{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class ux{constructor(e){this.expr=e}evaluate(e,t){Hu(1===this.expr.params.length,216);const i=Cy(this.expr.params[0]).evaluate(e,t);switch(i.type){case"NULL":return _y.Dr();case"ARRAY":{var n,r;const e=null!==(n=null===(r=i.value.arrayValue)||void 0===r?void 0:r.values)&&void 0!==n?n:[];return _y.newValue({arrayValue:{values:[...e].reverse()}})}default:return _y.vr()}}}class cx{constructor(e){this.expr=e}evaluate(e,t){return Hu(2===this.expr.params.length,52884),new Wy(new qv("eq_any",[this.expr.params[1],this.expr.params[0]])).evaluate(e,t)}}class dx{constructor(e){this.expr=e}evaluate(e,t){var i,n,r,s;Hu(2===this.expr.params.length,1392);let a=!1;const o=Cy(this.expr.params[0]).evaluate(e,t);switch(o.type){case"ARRAY":break;case"NULL":a=!0;break;default:return _y.vr()}const l=Cy(this.expr.params[1]).evaluate(e,t);switch(l.type){case"ARRAY":break;case"NULL":a=!0;break;default:return _y.vr()}if(a)return _y.Dr();const h=null!==(i=null===(n=l.value)||void 0===n||null===(n=n.arrayValue)||void 0===n?void 0:n.values)&&void 0!==i?i:[],u=null!==(r=null===(s=o.value)||void 0===s||null===(s=s.arrayValue)||void 0===s?void 0:s.values)&&void 0!==r?r:[];for(const c of h){let e=!1;a=!1;for(const t of u){switch(ff(c)&&ff(t)?"EQ":Ly(c,t)){case"EQ":e=!0;break;case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":a=!0;break;default:zu(44613,{value:t,search:c})}if(e)break}if(!e)return _y.newValue(Jd)}return _y.newValue(Qd)}}class fx{constructor(e){this.expr=e}evaluate(e,t){var i,n,r,s;Hu(2===this.expr.params.length,2680);let a=!1;const o=Cy(this.expr.params[0]).evaluate(e,t);switch(o.type){case"ARRAY":break;case"NULL":a=!0;break;default:return _y.vr()}const l=Cy(this.expr.params[1]).evaluate(e,t);switch(l.type){case"ARRAY":break;case"NULL":a=!0;break;default:return _y.vr()}if(a)return _y.Dr();const h=null!==(i=null===(n=l.value)||void 0===n||null===(n=n.arrayValue)||void 0===n?void 0:n.values)&&void 0!==i?i:[],u=null!==(r=null===(s=o.value)||void 0===s||null===(s=s.arrayValue)||void 0===s?void 0:s.values)&&void 0!==r?r:[];for(const c of u)for(const e of h)switch(ff(c)&&ff(e)?"EQ":Ly(c,e)){case"EQ":return _y.newValue(Qd);case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":a=!0;break;default:zu(44608,{value:c,search:e})}return a?_y.Dr():_y.newValue(Jd)}}class px{constructor(e){this.expr=e}evaluate(e,t){var i,n;Hu(1===this.expr.params.length,38605);const r=Cy(this.expr.params[0]).evaluate(e,t);switch(r.type){case"NULL":return _y.Dr();case"ARRAY":return _y.newValue({integerValue:"".concat(null!==(i=null===(n=r.value)||void 0===n||null===(n=n.arrayValue)||void 0===n||null===(n=n.values)||void 0===n?void 0:n.length)&&void 0!==i?i:0)});default:return _y.vr()}}}class mx{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class gx{constructor(e){this.expr=e}evaluate(e,t){Hu(1===this.expr.params.length,1508);const i=Cy(this.expr.params[0]).evaluate(e,t);switch(i.type){case"NULL":return _y.Dr();case"BYTES":{var n;const e=null===(n=i.value)||void 0===n?void 0:n.bytesValue;if("string"==typeof e){const t=Rd.fromBase64String(e).toUint8Array();return t.reverse(),_y.newValue({bytesValue:Rd.fromUint8Array(t).toBase64()})}return _y.newValue({bytesValue:new Uint8Array(e).reverse()})}case"STRING":{var r;const e=null===(r=i.value)||void 0===r?void 0:r.stringValue,t=new Intl.__PRIVATE_Segmenter(void 0,{granularity:"grapheme"}).segment(e),n=Array.from(t,e=>e.segment).reverse();return _y.newValue({stringValue:n.join("")})}default:return _y.vr()}}}class vx{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class yx{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class xx{constructor(e){this.expr=e}evaluate(e,t){Hu(1===this.expr.params.length,19400);const i=Cy(this.expr.params[0]).evaluate(e,t);switch(i.type){case"NULL":return _y.Dr();case"STRING":{const e=function(e){let t=0;for(let i=0;i<e.length;i++){const n=e.codePointAt(i);if(void 0===n)return;if(n<=65535)if(n>=55296&&n<=57343)if(n<=56319){const n=e.codePointAt(i+1);void 0!==n&&n>=56320&&n<=57343?(t+=1,i++):t+=1}else t+=1;else t+=1;else{if(!(n<=1114111))return;t+=1,i++}}return t}(i.value.stringValue);return void 0===e?_y.vr():_y.newValue({integerValue:e})}default:return _y.vr()}}}class bx{constructor(e){this.expr=e}evaluate(e,t){Hu(1===this.expr.params.length,8486);const i=Cy(this.expr.params[0]).evaluate(e,t);switch(i.type){case"BYTES":{var n;const e=null===(n=i.value)||void 0===n?void 0:n.bytesValue;return"string"==typeof e?_y.newValue({integerValue:Rd.fromBase64String(e).toUint8Array().length}):_y.newValue({integerValue:new Uint8Array(e).length})}case"STRING":{var r;const e=function(e){let t=0;for(let i=0;i<e.length;i++){const n=e.codePointAt(i);if(void 0===n)return;if(n>=55296&&n<=57343){if(!(n<=56319))return;{const n=e.codePointAt(i+1);if(void 0===n||!(n>=56320&&n<=57343))return;t+=4,i++}}else if(n<=127)t+=1;else if(n<=2047)t+=2;else if(n<=65535)t+=3;else{if(!(n<=1114111))return;t+=4,i++}}return t}(null===(r=i.value)||void 0===r?void 0:r.stringValue);return void 0===e?_y.vr():_y.newValue({integerValue:e})}case"NULL":return _y.Dr();default:return _y.vr()}}}class wx{constructor(e){this.expr=e}evaluate(e,t){var i,n;Hu(2===this.expr.params.length,39773,"".concat(this.expr.name,"() function should have exactly two parameters"));let r=!1;const s=Cy(this.expr.params[0]).evaluate(e,t);switch(s.type){case"STRING":break;case"NULL":r=!0;break;default:return _y.vr()}const a=Cy(this.expr.params[1]).evaluate(e,t);switch(a.type){case"STRING":break;case"NULL":r=!0;break;default:return _y.vr()}return r?_y.Dr():this.kr(null===(i=s.value)||void 0===i?void 0:i.stringValue,null===(n=a.value)||void 0===n?void 0:n.stringValue)}}class Tx extends wx{kr(e,t){try{const i=function(e){let t="";for(let i=0;i<e.length;i++){const n=e.charAt(i);switch(n){case"_":t+=".";break;case"%":t+=".*";break;case"\\":case".":case"*":case"?":case"+":case"^":case"$":case"|":case"(":case")":case"[":case"]":case"{":case"}":t+="\\"+n;break;default:t+=n}}return"^"+t+"$"}(t),n=Ou.compile(i);return _y.newValue({booleanValue:n.matches(e)})}catch(e){return Bu("Invalid LIKE pattern converted to regex: ".concat(t,", returning error. Error: ").concat(e)),_y.vr()}}}class _x extends wx{kr(e,t){try{const i=Ou.compile(t);return _y.newValue({booleanValue:i.matcher(e).find()})}catch(e){return Bu("Invalid regex pattern found in regex_contains: ".concat(t,", returning error")),_y.vr()}}}class Sx extends wx{kr(e,t){try{return _y.newValue({booleanValue:Ou.compile(t).matches(e)})}catch(e){return Bu("Invalid regex pattern found in regex_match: ".concat(t,", returning error")),_y.vr()}}}class Ex extends wx{kr(e,t){return _y.newValue({booleanValue:e.includes(t)})}}class Cx extends wx{kr(e,t){return _y.newValue({booleanValue:e.startsWith(t)})}}class Ax extends wx{kr(e,t){return _y.newValue({booleanValue:e.endsWith(t)})}}class kx{constructor(e){this.expr=e}evaluate(e,t){var i;Hu(1===this.expr.params.length,29079);const n=Cy(this.expr.params[0]).evaluate(e,t);switch(n.type){case"STRING":return _y.newValue({stringValue:null===(i=n.value)||void 0===i||null===(i=i.stringValue)||void 0===i?void 0:i.toLowerCase()});case"NULL":return _y.Dr();default:return _y.vr()}}}class Rx{constructor(e){this.expr=e}evaluate(e,t){var i;Hu(1===this.expr.params.length,60487);const n=Cy(this.expr.params[0]).evaluate(e,t);switch(n.type){case"STRING":return _y.newValue({stringValue:null===(i=n.value)||void 0===i||null===(i=i.stringValue)||void 0===i?void 0:i.toUpperCase()});case"NULL":return _y.Dr();default:return _y.vr()}}}class Ox{constructor(e){this.expr=e}evaluate(e,t){var i;Hu(1===this.expr.params.length,28544);const n=Cy(this.expr.params[0]).evaluate(e,t);switch(n.type){case"STRING":return _y.newValue({stringValue:null===(i=n.value)||void 0===i||null===(i=i.stringValue)||void 0===i?void 0:i.trim()});case"NULL":return _y.Dr();default:return _y.vr()}}}class Px{constructor(e){this.expr=e}evaluate(e,t){const i=this.expr.params.map(i=>Cy(i).evaluate(e,t));let n="",r=!1;for(const s of i)switch(s.type){case"STRING":n+=s.value.stringValue;break;case"NULL":r=!0;break;default:return _y.vr()}return r?_y.Dr():_y.newValue({stringValue:n})}}class Mx{constructor(e){this.expr=e}evaluate(e,t){var i,n;Hu(2===this.expr.params.length,4483);const r=Cy(this.expr.params[0]).evaluate(e,t);switch(r.type){case"UNSET":return _y.Sr();case"MAP":break;default:return _y.vr()}const s=Cy(this.expr.params[1]).evaluate(e,t);if("STRING"!==s.type)return _y.vr();const a=null===(i=r.value)||void 0===i||null===(i=i.mapValue)||void 0===i||null===(i=i.fields)||void 0===i?void 0:i[null===(n=s.value)||void 0===n?void 0:n.stringValue];return void 0===a?_y.Sr():_y.newValue(a)}}class Nx{constructor(e){this.expr=e}evaluate(e,t){var i,n;Hu(2===this.expr.params.length,25231,"".concat(this.expr.name,"() function should have exactly 2 params"));let r=!1;const s=Cy(this.expr.params[0]).evaluate(e,t);switch(s.type){case"VECTOR":break;case"NULL":r=!0;break;default:return _y.vr()}const a=Cy(this.expr.params[1]).evaluate(e,t);switch(a.type){case"VECTOR":break;case"NULL":r=!0;break;default:return _y.vr()}if(r)return _y.Dr();const o=vf(s.value),l=vf(a.value);if(void 0===o||void 0===l||(null===(i=o.values)||void 0===i?void 0:i.length)!==(null===(n=l.values)||void 0===n?void 0:n.length))return _y.vr();const h=this.qr(o,l);return void 0===h||isNaN(h)?_y.vr():_y.newValue({doubleValue:h})}}class Ix extends Nx{qr(e,t){var i,n;const r=null!==(i=null===e||void 0===e?void 0:e.values)&&void 0!==i?i:[],s=null!==(n=null===t||void 0===t?void 0:t.values)&&void 0!==n?n:[];if(0===r.length)return;let a=0,o=0,l=0;for(let u=0;u<r.length;u++){if(!cf(r[u])||!cf(s[u]))return;const e=Oy(r[u]),t=Oy(s[u]);a+=e*t,o+=e*e,l+=t*t}const h=Math.sqrt(o)*Math.sqrt(l);return 0!==h?1-Math.max(-1,Math.min(1,a/h)):void 0}}class Lx extends Nx{qr(e,t){var i,n;const r=null!==(i=null===e||void 0===e?void 0:e.values)&&void 0!==i?i:[],s=null!==(n=null===t||void 0===t?void 0:t.values)&&void 0!==n?n:[];if(0===r.length)return 0;let a=0;for(let o=0;o<r.length;o++){if(!cf(r[o])||!cf(s[o]))return;a+=Oy(r[o])*Oy(s[o])}return a}}class Dx extends Nx{qr(e,t){var i,n;const r=null!==(i=null===e||void 0===e?void 0:e.values)&&void 0!==i?i:[],s=null!==(n=null===t||void 0===t?void 0:t.values)&&void 0!==n?n:[];if(0===r.length)return 0;let a=0;for(let o=0;o<r.length;o++){if(!c
2f(r[o])||!cf(s[o]))return;const e=Oy(r[o]),t=Oy(s[o]);a+=Math.pow(e-t,2)}return Math.sqrt(a)}}class Fx{constructor(e){this.expr=e}evaluate(e,t){Hu(1===this.expr.params.length,39044);const i=Cy(this.expr.params[0]).evaluate(e,t);switch(i.type){case"VECTOR":{var n,r;const e=vf(i.value);return _y.newValue({integerValue:null!==(n=null===e||void 0===e||null===(r=e.values)||void 0===r?void 0:r.length)&&void 0!==n?n:0})}case"NULL":return _y.Dr();default:return _y.vr()}}}const Bx=BigInt(-62135596800),Ux=BigInt(253402300799),zx=BigInt(1e3),Vx=BigInt(1e6),Hx=Bx*zx,jx=Ux*zx+BigInt(999),Yx=Bx*Vx,Wx=Ux*Vx+BigInt(999999);function Gx(e){return e>=Yx&&e<=Wx}function Xx(e){return e>=Bx&&e<=Ux}function qx(e,t){const i=BigInt(e);return!(i<Bx||i>Ux)&&!(t<0||t>=1e9)&&(i!==Bx||0===t)&&!(i===Ux&&t>999999999)}function Kx(e,t){return t<0?{seconds:e-1,nanos:t+1e9}:{seconds:e,nanos:t}}function Qx(e){return BigInt(e.seconds)*Vx+BigInt(Math.trunc(e.nanoseconds/1e3))}class Jx{constructor(e){this.expr=e}evaluate(e,t){Hu(1===this.expr.params.length,49262,"".concat(this.expr.name,"() function should have exactly one parameter"));const i=Cy(this.expr.params[0]).evaluate(e,t);switch(i.type){case"INT":return this.toTimestamp(BigInt(i.value.integerValue));case"NULL":return _y.Dr();default:return _y.vr()}}}class Zx extends Jx{toTimestamp(e){if(!Gx(e))return _y.vr();let t=Number(e/Vx),i=Number(e%Vx*BigInt(1e3));const n=Kx(t,i);return t=n.seconds,i=n.nanos,qx(t,i)?_y.newValue({timestampValue:{seconds:t,nanos:i}}):_y.vr()}}class $x extends Jx{toTimestamp(e){if(!function(e){return e>=Hx&&e<=jx}(e))return _y.vr();let t=Number(e/zx),i=Number(e%zx*BigInt(1e6));const n=Kx(t,i);return t=n.seconds,i=n.nanos,qx(t,i)?_y.newValue({timestampValue:{seconds:t,nanos:i}}):_y.vr()}}class eb extends Jx{toTimestamp(e){if(!Xx(e))return _y.vr();const t=Number(e);return _y.newValue({timestampValue:{seconds:t,nanos:0}})}}class tb{constructor(e){this.expr=e}evaluate(e,t){Hu(1===this.expr.params.length,1265,"".concat(this.expr.name,"() function should have exactly one parameter"));const i=Cy(this.expr.params[0]).evaluate(e,t);switch(i.type){case"TIMESTAMP":break;case"NULL":return _y.Dr();default:return _y.vr()}const n=Fm(i.value.timestampValue);return qx(n.seconds,n.nanoseconds)?this.$r(n):_y.vr()}}class ib extends tb{$r(e){const t=Qx(e);return Gx(t)?_y.newValue({integerValue:"".concat(t.toString())}):_y.vr()}}class nb extends tb{$r(e){const t=Qx(e),i=t/BigInt(1e3),n=t%BigInt(1e3);return i>BigInt(0)||n===BigInt(0)?_y.newValue({integerValue:i.toString()}):_y.newValue({integerValue:(i-BigInt(1)).toString()})}}class rb extends tb{$r(e){const t=BigInt(e.seconds);return Xx(t)?_y.newValue({integerValue:t.toString()}):_y.vr()}}class sb{constructor(e){this.expr=e}evaluate(e,t){Hu(3===this.expr.params.length,2775,"".concat(this.expr.name,"() function should have exactly 3 parameters"));let i=!1;const n=Cy(this.expr.params[0]).evaluate(e,t);switch(n.type){case"TIMESTAMP":break;case"NULL":i=!0;break;default:return _y.vr()}const r=Cy(this.expr.params[1]).evaluate(e,t);let s;switch(r.type){case"STRING":if(s=function(e){switch(e){case"microsecond":return"microsecond";case"millisecond":return"millisecond";case"second":return"second";case"minute":return"minute";case"hour":return"hour";case"day":return"day";default:return}}(r.value.stringValue),void 0===s)return _y.vr();break;case"NULL":i=!0;break;default:return _y.vr()}const a=Cy(this.expr.params[2]).evaluate(e,t);switch(a.type){case"INT":break;case"NULL":i=!0;break;default:return _y.vr()}if(i)return _y.Dr();const o=BigInt(a.value.integerValue);let l;try{switch(s){case"microsecond":l=o;break;case"millisecond":l=o*BigInt(1e3);break;case"second":l=o*BigInt(1e6);break;case"minute":l=o*BigInt(6e7);break;case"hour":l=o*BigInt(36e8);break;case"day":l=o*BigInt(864e8);break;default:return _y.vr()}if("microsecond"!==s&&o!==BigInt(0)&&l/o!==BigInt(this.Kr(s)))return _y.vr()}catch(e){return Bu("Error during timestamp arithmetic: ".concat(e)),_y.vr()}const h=Fm(n.value.timestampValue);if(!qx(h.seconds,h.nanoseconds))return _y.vr();const u=Qx(h),c=this.Wr(u,l);if(!Gx(c))return _y.vr();const d=Number(c/Vx),f=c%Vx,p=Number((f<0?f+Vx:f)*BigInt(1e3)),m=f<0?d-1:d;return qx(m,p)?_y.newValue({timestampValue:{seconds:m,nanos:p}}):_y.vr()}Kr(e){switch(e){case"millisecond":return 1e3;case"second":return 1e6;case"minute":return 6e7;case"hour":return 36e8;case"day":return 864e8;default:return 1}}}class ab extends sb{Wr(e,t){return e+t}}class ob extends sb{Wr(e,t){return e-t}}function lb(e){if((e=Ey(e))instanceof jv)return"fld(".concat(e.fieldName,")");if(e instanceof Wv)return"cst(".concat(function(e){return null===e?"null":"number"==typeof e?e.toString():"string"==typeof e?'"'.concat(e,'"'):e instanceof sv?"ref(".concat(e.path,")"):e instanceof hv?"vec(".concat(JSON.stringify(e),")"):JSON.stringify(e)}(e.value),")");if(e instanceof qv)return"fn(".concat(e.name,",[").concat(e.params.map(lb).join(","),"])");if("ListOfExpressions"===e.expressionType)return"list([".concat(e.Rr.map(lb).join(","),"])");throw new Error("Unrecognized expr ".concat(JSON.stringify(e,null,2)))}function hb(e){return"".concat(Array.from(e.entries()).sort().map(e=>{let t=u(e,2),i=t[0],n=t[1];return"".concat(i,"=").concat(lb(n))}).join(","))}function ub(e){return e.stages.map(e=>function(e){if(e instanceof iy)return"".concat(e._name,"(").concat(hb(e.fields),")");
2if(e instanceof ny){let t="".concat(e._name,"(").concat(hb(e.accumulators),")");return e.groups.size>0&&(t+="grouping(".concat(hb(e.groups),")")),t}if(e instanceof ry)return"".concat(e._name,"(").concat(hb(e.groups),")");if(e instanceof sy)return"".concat(e._name,"(").concat(e.Vr,")");if(e instanceof ay)return"".concat(e._name,"(").concat(e.collectionId,")");if(e instanceof oy)return"".concat(e._name,"()");if(e instanceof ly)return"".concat(e._name,"(").concat(e.dr.sort(),")");if(e instanceof hy)return"".concat(e._name,"(").concat(lb(e.condition),")");if(e instanceof uy)return"".concat(e._name,"(").concat(e.limit,")");if(e instanceof fy)return"".concat(e._name,"(").concat(function(e){return e.map(e=>"".concat(lb(e.expr)).concat(e.direction)).join(",")}(e.orderings),")");throw new Error("Unrecognized stage ".concat(e._name))}(e)).join("|")}function cb(e,t){return ub(e)===ub(t)}function db(e){return e instanceof gy}function fb(e){return db(e)?ub(e):Wp(e)}function pb(e){return db(e)?ub(e):function(e){return"".concat(Rp(zp(e)),"|lt:").concat(e.limitType)}(e)}function mb(e,t){return e instanceof gy&&t instanceof gy?cb(e,t):!(e instanceof gy&&!(t instanceof gy)||!(e instanceof gy)&&t instanceof gy)&&Yp(e,t)}function gb(e){return Pp(e)?ub(e):Rp(e)}function vb(e,t){return e instanceof gy&&t instanceof gy?cb(e,t):!(e instanceof gy&&!(t instanceof gy)||!(e instanceof gy)&&t instanceof gy)&&Op(e,t)}class yb{constructor(e,t,i,n){this.batchId=e,this.localWriteTime=t,this.baseMutations=i,this.mutations=n}applyToRemoteDocument(e,t){const i=t.mutationResults;for(let n=0;n<this.mutations.length;n++){const t=this.mutations[n];t.key.isEqual(e.key)&&Xf(t,e,i[n])}}applyToLocalView(e,t){for(const i of this.baseMutations)i.key.isEqual(e.key)&&(t=qf(i,e,t,this.localWriteTime));for(const i of this.mutations)i.key.isEqual(e.key)&&(t=qf(i,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const i=om();return this.mutations.forEach(n=>{const r=e.get(n.key),s=r.overlayedDocument;let a=this.applyToLocalView(s,r.mutatedFields);a=t.has(n.key)?null:a;const o=Gf(s,a);null!==o&&i.set(n.key,o),s.isValidDocument()||s.convertToNoDocument(Cc.min())}),i}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),cm())}isEqual(e){return this.batchId===e.batchId&&lc(this.mutations,e.mutations,(e,t)=>Qf(e,t))&&lc(this.baseMutations,e.baseMutations,(e,t)=>Qf(e,t))}}class xb{constructor(e,t,i,n){this.batch=e,this.commitVersion=t,this.mutationResults=i,this.docVersions=n}static from(e,t,i){Hu(e.mutations.length===i.length,58842,{Qr:e.mutations.length,Gr:i.length});let n=hm;const r=e.mutations;for(let s=0;s<r.length;s++)n=n.insert(r[s].key,i[s].version);return new xb(e,t,i,n)}}class bb{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return null!==e&&this.mutation===e.mutation}toString(){return"Overlay{\n      largestBatchId: ".concat(this.largestBatchId,",\n      mutation: ").concat(this.mutation.toString(),"\n    }")}}class wb{constructor(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Cc.min(),s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Cc.min(),a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Rd.EMPTY_BYTE_STRING,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;this.target=e,this.targetId=t,this.purpose=i,this.sequenceNumber=n,this.snapshotVersion=r,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=a,this.expectedCount=o}withSequenceNumber(e){return new wb(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new wb(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new wb(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new wb(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}
2class Tb{constructor(e){this.zr=e}}function _b(e){const t=eg({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?jp(t,t.limit,"L"):t}class Sb{constructor(){}Yr(e,t){this.Zr(e,t),t.Xr()}Zr(e,t){if("nullValue"in e)this.ei(t,5);else if("booleanValue"in e)this.ei(t,10),t.ti(e.booleanValue?1:0);else if("integerValue"in e)this.ei(t,15),t.ti(Md(e.integerValue));else if("doubleValue"in e){const i=Md(e.doubleValue);isNaN(i)?this.ei(t,13):(this.ei(t,15),Hc(i)?t.ti(0):t.ti(i))}else if("timestampValue"in e){let i=e.timestampValue;this.ei(t,20),"string"==typeof i&&(i=Pd(i)),t.ni("".concat(i.seconds||"")),t.ti(i.nanos||0)}else if("stringValue"in e)this.ri(e.stringValue,t),this.ii(t);else if("bytesValue"in e)this.ei(t,30),t.si(Nd(e.bytesValue)),this.ii(t);else if("referenceValue"in e)this._i(e.referenceValue,t);else if("geoPointValue"in e){const i=e.geoPointValue;this.ei(t,45),t.ti(i.latitude||0),t.ti(i.longitude||0)}else"mapValue"in e?xf(e)?this.ei(t,Number.MAX_SAFE_INTEGER):gf(e)?this.oi(e.mapValue,t):(this.ai(e.mapValue,t),this.ii(t)):"arrayValue"in e?(this.ui(e.arrayValue,t),this.ii(t)):zu(19022,{ci:e})}ri(e,t){this.ei(t,25),this.li(e,t)}li(e,t){t.ni(e)}ai(e,t){const i=e.fields||{};this.ei(t,55);for(const n of Object.keys(i))this.ri(n,t),this.Zr(i[n],t)}oi(e,t){var i;const n=e.fields||{};this.ei(t,53);const r=qd,s=(null===(i=n[r].arrayValue)||void 0===i||null===(i=i.values)||void 0===i?void 0:i.length)||0;this.ei(t,15),t.ti(Md(s)),this.ri(r,t),this.Zr(n[r],t)}ui(e,t){const i=e.values||[];this.ei(t,50);for(const n of i)this.Zr(n,t)}_i(e,t){this.ei(t,37),pc.fromName(e).path.forEach(e=>{this.ei(t,60),this.li(e,t)})}ei(e,t){e.ti(t)}ii(e){e.ti(2)}}Sb.Ei=new Sb;class Eb{constructor(){this.Hi=new Cb}addToCollectionParentIndex(e,t){return this.Hi.add(t),Dc.resolve()}getCollectionParents(e,t){return Dc.resolve(this.Hi.getEntries(t))}addFieldIndex(e,t){return Dc.resolve()}deleteFieldIndex(e,t){return Dc.resolve()}deleteAllFieldIndexes(e){return Dc.resolve()}createTargetIndexes(e,t){return Dc.resolve()}getDocumentsMatchingTarget(e,t){return Dc.resolve(null)}getIndexType(e,t){return Dc.resolve(0)}getFieldIndexes(e,t){return Dc.resolve([])}getNextCollectionGroupToUpdate(e){return Dc.resolve(null)}getMinOffset(e,t){return Dc.resolve(Pc.min())}getMinOffsetFromCollectionGroup(e,t){return Dc.resolve(Pc.min())}updateCollectionGroup(e,t,i){return Dc.resolve()}updateIndexEntries(e,t){return Dc.resolve()}}class Cb{constructor(){this.index={}}add(e){const t=e.lastSegment(),i=e.popLast(),n=this.index[t]||new wd(cc.comparator),r=!n.has(i);return this.index[t]=n.add(i),r}has(e){const t=e.lastSegment(),i=e.popLast(),n=this.index[t];return n&&n.has(i)}getEntries(e){return(this.index[e]||new wd(cc.comparator)).toArray()}}new Uint8Array(0);
2class Ab{constructor(e){this.Ds=e}next(){return this.Ds+=2,this.Ds}static xs(){return new Ab(0)}static Cs(){return new Ab(-1)}}function kb(e,t){let i=t;for(const r of e.stages){var n;i=Pb({serializer:e.serializer,serverTimestampBehavior:null===(n=e.listenOptions)||void 0===n?void 0:n.serverTimestampBehavior},r,i)}return i}function Rb(e,t){return kb(e,[t]).length>0}function Ob(e,t){return db(e)?Rb(e,t):Gp(e,t)}function Pb(e,t,i){if(t instanceof sy)return function(e,t,i){return i.filter(e=>e.isFoundDocument()&&"/".concat(e.key.getCollectionPath().canonicalString())===t.Vr)}(0,t,i);if(t instanceof hy)return function(e,t,i){return i.filter(i=>{const n=Sy(Cy(t.condition).evaluate(e,i));return void 0!==n&&$d(n,Qd)})}(e,t,i);if(t instanceof ay)return function(e,t,i){return i.filter(e=>e.isFoundDocument()&&e.key.getCollectionPath().lastSegment()===t.collectionId)}(0,t,i);if(t instanceof oy)return function(e,t,i){return i.filter(e=>e.isFoundDocument())}(0,0,i);if(t instanceof ly)return function(e,t,i){return i.filter(e=>e.isFoundDocument()&&t.mr.has(e.key.path.toStringWithLeadingSlash()))}(0,t,i);if(t instanceof uy)return function(e,t,i){return i.slice(0,t.limit)}(0,t,i);if(t instanceof fy)return function(e,t,i){const n=t.orderings.map(e=>({ks:Cy(e.expr),direction:e.direction}));return[...i].sort((t,i)=>{for(const r of n){const n=r.ks,s=r.direction;{const r=Sy(n.evaluate(e,t)),a=Sy(n.evaluate(e,i)),o=tf(null!==r&&void 0!==r?r:Kd,null!==a&&void 0!==a?a:Kd);if(0!==o)return"ascending"===s?o:-o}}return 0})}(e,t,i);throw new Error("Unknown stage: ".concat(t._name))}function Mb(e){const t=function(e){for(let t=e.stages.length-1;t>=0;t--){const i=e.stages[t];if(i instanceof fy)return i.orderings}throw new Error("Pipeline must contain at least one Sort stage")}(e);return(i,n)=>{for(const r of t){const t=Sy(Cy(r.expr).evaluate({serializer:e.serializer},i)),s=Sy(Cy(r.expr).evaluate({serializer:e.serializer},n)),a=tf(t||Kd,s||Kd);if(0!==a)return"ascending"===r.direction?a:-a}return 0}}function Nb(e){for(let t=e.stages.length-1;t>=0;t--){const i=e.stages[t];if(i instanceof uy)return{limit:i.limit}}}class Ib{constructor(){this.changes=new em(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,Cp.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const i=this.changes.get(t);return void 0!==i?Dc.resolve(i):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class Lb{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}class Db{constructor(e,t,i,n){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=i,this.indexManager=n}getDocument(e,t){let i=null;return this.documentOverlayCache.getOverlay(e,t).next(n=>(i=n,this.remoteDocumentCache.getEntry(e,t))).next(e=>(null!==i&&qf(i.mutation,e,_d.empty(),Ec.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,cm()).next(()=>t))}getLocalViewOfDocuments(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:cm();const n=am();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,i).next(e=>{let t=rm();return e.forEach((e,i)=>{t=t.insert(e,i.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){const i=am();return this.populateOverlays(e,i,t).next(()=>this.computeViews(e,t,i,cm()))}populateOverlays(e,t,i){const n=[];return i.forEach(e=>{t.has(e)||n.push(e)}),this.documentOverlayCache.getOverlays(e,n).next(e=>{e.forEach((e,i)=>{t.set(e,i)})})}computeViews(e,t,i,n){let r=im();const s=lm(),a=lm();return t.forEach((e,t)=>{const a=i.get(t.key);n.has(t.key)&&(void 0===a||a.mutation instanceof Zf)?r=r.insert(t.key,t):void 0!==a?(s.set(t.key,a.mutation.getFieldMask()),qf(a.mutation,t,a.mutation.getFieldMask(),Ec.now())):s.set(t.key,_d.empty())}),this.recalculateAndSaveOverlays(e,r).next(e=>(e.forEach((e,t)=>s.set(e,t)),t.forEach((e,t)=>{var i;return a.set(e,new Lb(t,null!==(i=s.get(e))&&void 0!==i?i:null))}),a))}recalculateAndSaveOverlays(e,t){const i=lm();let n=new yd((e,t)=>e-t),r=cm();
2return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(e=>{for(const r of e)r.keys().forEach(e=>{const s=t.get(e);if(null===s)return;let a=i.get(e)||_d.empty();a=r.applyToLocalView(s,a),i.set(e,a);const o=(n.get(r.batchId)||cm()).add(e);n=n.insert(r.batchId,o)})}).next(()=>{const s=[],a=n.getReverseIterator();for(;a.hasNext();){const n=a.getNext(),o=n.key,l=n.value,h=om();l.forEach(e=>{if(!r.has(e)){const n=Gf(t.get(e),i.get(e));null!==n&&h.set(e,n),r=r.add(e)}}),s.push(this.documentOverlayCache.saveOverlays(e,o,h))}return Dc.waitFor(s)}).next(()=>i)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,i,n){return db(t)?this.getDocumentsMatchingPipeline(e,t,i,n):Fp(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):Bp(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,i,n):this.getDocumentsMatchingCollectionQuery(e,t,i,n)}getNextDocuments(e,t,i,n){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,i,n).next(r=>{const s=n-r.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,i.largestBatchId,n-r.size):Dc.resolve(am());let a=Ac,o=r;return s.next(t=>Dc.forEach(t,(t,i)=>(a<i.largestBatchId&&(a=i.largestBatchId),r.get(t)?Dc.resolve():this.remoteDocumentCache.getEntry(e,t).next(e=>{o=o.insert(t,e)}))).next(()=>this.populateOverlays(e,t,r)).next(()=>this.computeViews(e,o,t,cm())).next(e=>({batchId:a,changes:sm(e)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new pc(t)).next(e=>{let t=rm();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,i,n){const r=t.collectionGroup;let s=rm();return this.indexManager.getCollectionParents(e,r).next(a=>Dc.forEach(a,a=>{const o=function(e,t){return new Np(t,null,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(t,a.child(r));return this.getDocumentsMatchingCollectionQuery(e,o,i,n).next(e=>{e.forEach((e,t)=>{s=s.insert(e,t)})})}).next(()=>s))}getDocumentsMatchingCollectionQuery(e,t,i,n){let r;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,i.largestBatchId).next(s=>(r=s,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,i,r,n))).next(e=>this.retrieveMatchingLocalDocuments(r,e,e=>Gp(t,e)))}getDocumentsMatchingPipeline(e,t,i,n){if("collection_group"===vy(t)){const r=xy(t);let s=rm();return this.indexManager.getCollectionParents(e,r).next(a=>Dc.forEach(a,a=>{const o=function(e,t){const i=e.stages.map(e=>e instanceof ay?new sy(t.canonicalString(),{}):e);return new gy(e.serializer,i)}(t,a.child(r));return this.getDocumentsMatchingPipeline(e,o,i,n).next(e=>{e.forEach((e,t)=>{s=s.insert(e,t)})})}).next(()=>s))}{let r;return this.getOverlaysForPipeline(e,t,i.largestBatchId).next(s=>{switch(r=s,vy(t)){case"collection":return this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,i,r,n);case"documents":let s=cm();for(const e of wy(t))s=s.add(pc.fromPath(e));return this.remoteDocumentCache.getEntries(e,s);case"database":return this.remoteDocumentCache.getAllEntries(e);default:throw new Wu("invalid-argument","Invalid pipeline source to execute offline: ".concat(ub(t)))}}).next(e=>this.retrieveMatchingLocalDocuments(r,e,e=>Rb(t,e)))}}retrieveMatchingLocalDocuments(e,t,i){e.forEach((e,i)=>{const n=i.getKey();null===t.get(n)&&(t=t.insert(n,Cp.newInvalidDocument(n)))});let n=rm();return t.forEach((t,r)=>{const s=e.get(t);void 0!==s&&qf(s.mutation,r,_d.empty(),Ec.now()),i(r)&&(n=n.insert(t,r))}),n}getOverlaysForPipeline(e,t,i){switch(vy(t)){case"collection":return this.documentOverlayCache.getOverlaysForCollection(e,cc.fromString(yy(t)),i);case"collection_group":throw new Wu("invalid-argument","Unexpected collection group pipeline: ".concat(ub(t)));case"documents":return this.documentOverlayCache.getOverlays(e,wy(t).map(e=>pc.fromPath(e)));case"database":return this.documentOverlayCache.getAllOverlays(e,i);default:throw new Wu("invalid-argument","Failed to get overlays for pipeline: ".concat(ub(t)))}}}
2class Fb{constructor(e){this.serializer=e,this.Hs=new Map,this.Js=new Map}getBundleMetadata(e,t){return Dc.resolve(this.Hs.get(t))}saveBundleMetadata(e,t){return this.Hs.set(t.id,function(e){return{id:e.id,version:e.version,createTime:zm(e.createTime)}}(t)),Dc.resolve()}getNamedQuery(e,t){return Dc.resolve(this.Js.get(t))}saveNamedQuery(e,t){return this.Js.set(t.name,function(e){return{name:e.name,query:_b(e.bundledQuery),readTime:zm(e.readTime)}}(t)),Dc.resolve()}}class Bb{constructor(){this.overlays=new yd(pc.comparator),this.Ys=new Map}getOverlay(e,t){return Dc.resolve(this.overlays.get(t))}getOverlays(e,t){const i=am();return Dc.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&i.set(t,e)})).next(()=>i)}getAllOverlays(e,t){const i=am();return this.overlays.forEach((e,n)=>{n.largestBatchId>t&&i.set(e,n)}),Dc.resolve(i)}saveOverlays(e,t,i){return i.forEach((i,n)=>{this.Hr(e,t,n)}),Dc.resolve()}removeOverlaysForBatchId(e,t,i){const n=this.Ys.get(i);return void 0!==n&&(n.forEach(e=>this.overlays=this.overlays.remove(e)),this.Ys.delete(i)),Dc.resolve()}getOverlaysForCollection(e,t,i){const n=am(),r=t.length+1,s=new pc(t.child("")),a=this.overlays.getIteratorFrom(s);for(;a.hasNext();){const e=a.getNext().value,s=e.getKey();if(!t.isPrefixOf(s.path))break;s.path.length===r&&e.largestBatchId>i&&n.set(e.getKey(),e)}return Dc.resolve(n)}getOverlaysForCollectionGroup(e,t,i,n){let r=new yd((e,t)=>e-t);const s=this.overlays.getIterator();for(;s.hasNext();){const e=s.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>i){let t=r.get(e.largestBatchId);null===t&&(t=am(),r=r.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}const a=am(),o=r.getIterator();for(;o.hasNext()&&(o.getNext().value.forEach((e,t)=>a.set(e,t)),!(a.size()>=n)););return Dc.resolve(a)}Hr(e,t,i){const n=this.overlays.get(i.key);if(null!==n){const e=this.Ys.get(n.largestBatchId).delete(i.key);this.Ys.set(n.largestBatchId,e)}this.overlays=this.overlays.insert(i.key,new bb(t,i));let r=this.Ys.get(t);void 0===r&&(r=cm(),this.Ys.set(t,r)),this.Ys.set(t,r.add(i.key))}}class Ub{constructor(){this.sessionToken=Rd.EMPTY_BYTE_STRING}getSessionToken(e){return Dc.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,Dc.resolve()}}class zb{constructor(){this.Zs=new wd(Vb.Xs),this.e_=new wd(Vb.t_)}isEmpty(){return this.Zs.isEmpty()}addReference(e,t){const i=new Vb(e,t);this.Zs=this.Zs.add(i),this.e_=this.e_.add(i)}n_(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.r_(new Vb(e,t))}i_(e,t){e.forEach(e=>this.removeReference(e,t))}s_(e){const t=new pc(new cc([])),i=new Vb(t,e),n=new Vb(t,e+1),r=[];return this.e_.forEachInRange([i,n],e=>{this.r_(e),r.push(e.key)}),r}__(){this.Zs.forEach(e=>this.r_(e))}r_(e){this.Zs=this.Zs.delete(e),this.e_=this.e_.delete(e)}o_(e){const t=new pc(new cc([])),i=new Vb(t,e),n=new Vb(t,e+1);let r=cm();return this.e_.forEachInRange([i,n],e=>{r=r.add(e.key)}),r}containsKey(e){const t=new Vb(e,0),i=this.Zs.firstAfterOrEqual(t);return null!==i&&e.isEqual(i.key)}}class Vb{constructor(e,t){this.key=e,this.a_=t}static Xs(e,t){return pc.comparator(e.key,t.key)||nc(e.a_,t.a_)}static t_(e,t){return nc(e.a_,t.a_)||pc.comparator(e.key,t.key)}}class Hb{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.gs=1,this.u_=new wd(Vb.Xs)}checkEmpty(e){return Dc.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,i,n){const r=this.gs;this.gs++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];
2const s=new yb(r,t,i,n);this.mutationQueue.push(s);for(const a of n)this.u_=this.u_.add(new Vb(a.key,r)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return Dc.resolve(s)}lookupMutationBatch(e,t){return Dc.resolve(this.c_(t))}getNextMutationBatchAfterBatchId(e,t){const i=t+1,n=this.l_(i),r=n<0?0:n;return Dc.resolve(this.mutationQueue.length>r?this.mutationQueue[r]:null)}getHighestUnacknowledgedBatchId(){return Dc.resolve(0===this.mutationQueue.length?zc:this.gs-1)}getAllMutationBatches(e){return Dc.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const i=new Vb(t,0),n=new Vb(t,Number.POSITIVE_INFINITY),r=[];return this.u_.forEachInRange([i,n],e=>{const t=this.c_(e.a_);r.push(t)}),Dc.resolve(r)}getAllMutationBatchesAffectingDocumentKeys(e,t){let i=new wd(nc);return t.forEach(e=>{const t=new Vb(e,0),n=new Vb(e,Number.POSITIVE_INFINITY);this.u_.forEachInRange([t,n],e=>{i=i.add(e.a_)})}),Dc.resolve(this.E_(i))}getAllMutationBatchesAffectingQuery(e,t){const i=t.path,n=i.length+1;let r=i;pc.isDocumentKey(r)||(r=r.child(""));const s=new Vb(new pc(r),0);let a=new wd(nc);return this.u_.forEachWhile(e=>{const t=e.key.path;return!!i.isPrefixOf(t)&&(t.length===n&&(a=a.add(e.a_)),!0)},s),Dc.resolve(this.E_(a))}E_(e){const t=[];return e.forEach(e=>{const i=this.c_(e);null!==i&&t.push(i)}),t}removeMutationBatch(e,t){Hu(0===this.h_(t.batchId,"removed"),55003),this.mutationQueue.shift();let i=this.u_;return Dc.forEach(t.mutations,n=>{const r=new Vb(n.key,t.batchId);return i=i.delete(r),this.referenceDelegate.markPotentiallyOrphaned(e,n.key)}).next(()=>{this.u_=i})}bs(e){}containsKey(e,t){const i=new Vb(t,0),n=this.u_.firstAfterOrEqual(i);return Dc.resolve(t.isEqual(n&&n.key))}performConsistencyCheck(e){return this.mutationQueue.length,Dc.resolve()}h_(e,t){return this.l_(e)}l_(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}c_(e){const t=this.l_(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class jb{constructor(e){this.T_=e,this.docs=new yd(pc.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const i=t.key,n=this.docs.get(i),r=n?n.size:0,s=this.T_(t);return this.docs=this.docs.insert(i,{document:t.mutableCopy(),size:s}),this.size+=s-r,this.indexManager.addToCollectionParentIndex(e,i.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const i=this.docs.get(t);return Dc.resolve(i?i.document.mutableCopy():Cp.newInvalidDocument(t))}getEntries(e,t){let i=im();return t.forEach(e=>{const t=this.docs.get(e);i=i.insert(e,t?t.document.mutableCopy():Cp.newInvalidDocument(e))}),Dc.resolve(i)}getAllEntries(e){let t=im();return this.docs.forEach((e,i)=>{t=t.insert(e,i.document)}),Dc.resolve(t)}getDocumentsMatchingQuery(e,t,i,n){let r,s;db(t)?(r=cc.fromString(yy(t)),s=e=>Rb(t,e)):(r=t.path,s=e=>Gp(t,e));let a=im();const o=new pc(r.child("__id-9223372036854775808__")),l=this.docs.getIteratorFrom(o);for(;l.hasNext();){const e=l.getNext(),t=e.key,o=e.value.document;if(!r.isPrefixOf(t.path))break;t.path.length>r.length+1||Mc(Oc(o),i)<=0||(n.has(o.key)||s(o))&&(a=a.insert(o.key,o.mutableCopy()))}return Dc.resolve(a)}getAllFromCollectionGroup(e,t,i,n){zu(9500)}P_(e,t){return Dc.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new Yb(this)}getSize(e){return Dc.resolve(this.size)}}class Yb extends Ib{constructor(e){super(),this.zs=e}applyChanges(e){const t=[];
vendor: 4,778 bytes, line 2
2return this.changes.forEach((i,n)=>{n.isValidDocument()?t.push(this.zs.addEntry(e,n)):this.zs.removeEntry(i)}),Dc.waitFor(t)}getFromCache(e,t){return this.zs.getEntry(e,t)}getAllFromCache(e,t){return this.zs.getEntries(e,t)}}class Wb{constructor(e){this.persistence=e,this.R_=new em(e=>gb(e),vb),this.lastRemoteSnapshotVersion=Cc.min(),this.highestTargetId=0,this.I_=0,this.A_=new zb,this.targetCount=0,this.V_=Ab.xs()}forEachTarget(e,t){return this.R_.forEach((e,i)=>t(i)),Dc.resolve()}getLastRemoteSnapshotVersion(e){return Dc.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return Dc.resolve(this.I_)}allocateTargetId(e){return this.highestTargetId=this.V_.next(),Dc.resolve(this.highestTargetId)}setTargetsMetadata(e,t,i){return i&&(this.lastRemoteSnapshotVersion=i),t>this.I_&&(this.I_=t),Dc.resolve()}Ms(e){this.R_.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.V_=new Ab(t),this.highestTargetId=t),e.sequenceNumber>this.I_&&(this.I_=e.sequenceNumber)}addTargetData(e,t){return this.Ms(t),this.targetCount+=1,Dc.resolve()}updateTargetData(e,t){return this.Ms(t),Dc.resolve()}removeTargetData(e,t){return this.R_.delete(t.target),this.A_.s_(t.targetId),this.targetCount-=1,Dc.resolve()}removeTargets(e,t,i){let n=0;const r=[];return this.R_.forEach((s,a)=>{a.sequenceNumber<=t&&null===i.get(a.targetId)&&(this.R_.delete(s),r.push(this.removeMatchingKeysForTargetId(e,a.targetId)),n++)}),Dc.waitFor(r).next(()=>n)}getTargetCount(e){return Dc.resolve(this.targetCount)}getTargetData(e,t){const i=this.R_.get(t)||null;return Dc.resolve(i)}addMatchingKeys(e,t,i){return this.A_.n_(t,i),Dc.resolve()}removeMatchingKeys(e,t,i){this.A_.i_(t,i);const n=this.persistence.referenceDelegate,r=[];return n&&t.forEach(t=>{r.push(n.markPotentiallyOrphaned(e,t))}),Dc.waitFor(r)}removeMatchingKeysForTargetId(e,t){return this.A_.s_(t),Dc.resolve()}getMatchingKeysForTargetId(e,t){const i=this.A_.o_(t);return Dc.resolve(i)}containsKey(e,t){return Dc.resolve(this.A_.containsKey(t))}}class Gb{constructor(e,t){this.d_={},this.overlays={},this.f_=new Uc(0),this.m_=!1,this.m_=!0,this.p_=new Ub,this.referenceDelegate=e(this),this.g_=new Wb(this),this.indexManager=new Eb,this.remoteDocumentCache=function(e){return new jb(e)}(e=>this.referenceDelegate.y_(e)),this.serializer=new Tb(t),this.w_=new Fb(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.m_=!1,Promise.resolve()}get started(){return this.m_}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new Bb,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let i=this.d_[e.toKey()];return i||(i=new Hb(t,this.referenceDelegate),this.d_[e.toKey()]=i),i}getGlobalsCache(){return this.p_}getTargetCache(){return this.g_}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.w_}runTransaction(e,t,i){Du("MemoryPersistence","Starting transaction:",e);const n=new Xb(this.f_.next());return this.referenceDelegate.b_(),i(n).next(e=>this.referenceDelegate.v_(n).next(()=>e)).toPromise().then(e=>(n.raiseOnCommittedEvent(),e))}S_(e,t){return Dc.or(Object.values(this.d_).map(i=>()=>i.containsKey(e,t)))}}class Xb extends Ic{constructor(e){super(),this.currentSequenceNumber=e}}class qb{constructor(e){this.persistence=e,this.D_=new zb,this.x_=null}static C_(e){return new qb(e)}get F_(){if(this.x_)return this.x_;throw zu(60996)}addReference(e,t,i){return this.D_.addReference(i,t),this.F_.delete(i.toString()),Dc.resolve()}removeReference(e,t,i){return this.D_.removeReference(i,t),this.F_.add(i.toString()),Dc.resolve()}markPotentiallyOrphaned(e,t){return this.F_.add(t.toString()),Dc.resolve()}removeTarget(e,t){this.D_.s_(t.targetId).forEach(e=>this.F_.add(e.toString()));const i=this.persistence.getTargetCache();return i.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.F_.add(e.toString()))}).next(()=>i.removeTargetData(e,t))}b_(){this.x_=new Set}v_(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return Dc.forEach(this.F_,i=>{const n=pc.fromPath(i);return this.O_(e,n).next(e=>{e||t.removeEntry(n,Cc.min())})}).next(()=>(this.x_=null,t.apply(e)))}updateLimboDocument(e,t){return this.O_(e,t).next(e=>{e?this.F_.delete(t.toString()):this.F_.add(t.toString())})}y_(e){return 0}O_(e,t){return Dc.or([()=>Dc.resolve(this.D_.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.S_(e,t)])}}class Kb{constructor(e,t){this.persistence=e,this.M_=new em(e=>Gc(e.path),(e,t)=>e.isEqual(t)),this.garbageCollector=$g(this,t)}static C_(e,t){return new Kb(e,t)}b_(){}v_(e){return Dc.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEac
2hTarget(e,t)}lr(e){const t=this.Ls(e);return this.persistence.getTargetCache().getTargetCount(e).next(e=>t.next(t=>e+t))}Ls(e){let t=0;return this.Er(e,e=>{t++}).next(()=>t)}Er(e,t){return Dc.forEach(this.M_,(i,n)=>this.Us(e,i,n).next(e=>e?Dc.resolve():t(n)))}removeTargets(e,t,i){return this.persistence.getTargetCache().removeTargets(e,t,i)}removeOrphanedDocuments(e,t){let i=0;const n=this.persistence.getRemoteDocumentCache(),r=n.newChangeBuffer();return n.P_(e,n=>this.Us(e,n,t).next(e=>{e||(i++,r.removeEntry(n,Cc.min()))})).next(()=>r.apply(e)).next(()=>i)}markPotentiallyOrphaned(e,t){return this.M_.set(t,e.currentSequenceNumber),Dc.resolve()}removeTarget(e,t){const i=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,i)}addReference(e,t,i){return this.M_.set(i,e.currentSequenceNumber),Dc.resolve()}removeReference(e,t,i){return this.M_.set(i,e.currentSequenceNumber),Dc.resolve()}updateLimboDocument(e,t){return this.M_.set(t,e.currentSequenceNumber),Dc.resolve()}y_(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=of(e.data.value)),t}Us(e,t,i){return Dc.or([()=>this.persistence.S_(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const e=this.M_.get(t);return Dc.resolve(void 0!==e&&e>i)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}class Qb{constructor(e,t,i,n){this.targetId=e,this.fromCache=t,this.wo=i,this.bo=n}static vo(e,t){let i=cm(),n=cm();for(const r of t.docChanges)switch(r.type){case 0:i=i.add(r.doc.key);break;case 1:n=n.add(r.doc.key)}return new Qb(e,t.fromCache,i,n)}}function Jb(e,t){return pc.comparator(e.key,t.key)}class Zb{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class $b{constructor(){this.So=!1,this.Do=!1,this.xo=100,this.Co=Bn()?8:Fc(Mn())>0?6:4}initialize(e,t){this.Fo=e,this.indexManager=t,this.So=!0}getDocumentsMatchingQuery(e,t,i,n){const r={result:null};return this.Oo(e,t).next(e=>{r.result=e}).next(()=>{if(!r.result)return this.Mo(e,t,n,i).next(e=>{r.result=e})}).next(()=>{if(r.result)return;const i=new Zb;return this.No(e,t,i).next(n=>{if(r.result=n,this.Do)return this.Lo(e,t,i,n.size)})}).next(()=>r.result)}Lo(e,t,i,n){return db(t)?Dc.resolve():i.documentReadCount<this.xo?(Lu()<=vr.DEBUG&&Du("QueryEngine","SDK will not create cache indexes for query:",Wp(t),"since it only creates cache indexes for collection contains","more than or equal to",this.xo,"documents"),Dc.resolve()):(Lu()<=vr.DEBUG&&Du("QueryEngine","Query:",Wp(t),"scans",i.documentReadCount,"local documents and returns",n,"documents as results."),i.documentReadCount>this.Co*n?(Lu()<=vr.DEBUG&&Du("QueryEngine","The SDK decides to create cache indexes for query:",Wp(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,zp(t))):Dc.resolve())}Oo(e,t){if(db(t))return Dc.resolve(null);let i=t;if(Dp(i))return Dc.resolve(null);let n=zp(i);return this.indexManager.getIndexType(e,n).next(t=>0===t?null:(null!==i.limit&&1===t&&(i=jp(i,null,"F"),n=zp(i)),this.indexManager.getDocumentsMatchingTarget(e,n).next(t=>{const r=cm(...t);return this.Fo.getDocuments(e,r).next(t=>this.indexManager.getMinOffset(e,n).next(n=>{const s=this.Bo(i,t);return this.Uo(i,s,r,n.readTime)?this.Oo(e,jp(i,null,"F")):this.ko(e,s,i,n)}))})))}Mo(e,t,i,n){return(db(t)?function(e){for(const t of e.stages){if(t instanceof uy||t instanceof cy)return!1;if(t instanceof hy){if(t.condition instanceof Qv&&"exists"===t.condition._expr.name&&t.condition._expr.params[0]instanceof jv&&t.condition._expr.params[0].fieldName===hc)continue;return!1}}return!0}(t):Dp(t))||n.isEqual(Cc.min())?Dc.resolve(null):this.Fo.getDocuments(e,i).next(r=>{const s=this.Bo(t,r);return this.Uo(t,s,i,n)?Dc.resolve(null):(Lu()<=vr.DEBUG&&Du("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),fb(t)),this.ko(e,s,t,Rc(n,Ac)).next(e=>e))})}Bo(e,t){let i,n;return db(e)?(i=new wd(Jb),n=t=>Rb(e,t)):(i=new wd(Xp(e)),n=t=>Gp(e,t)),t.forEach((e,t)=>{n(t)&&(i=i.add(t))}),i}Uo(e,t,i,n){if(db(e))return function(e){return e.stages.some(e=>e instanceof uy||e instanceof cy)}(e);if(null===e.limit)return!1;if(i.size!==t.size)return!0;const r="F"===e.limitType?t.last():t.first();return!!r&&(r.hasPendingWrites||r.version.compareTo(n)>0)}No(e,t,i){return Lu()<=vr.DEBUG&&Du("QueryEngine","Using full collection scan to execute query:",fb(t)),this.Fo.getDocumentsMatchingQuery(e,t,Pc.min(),i)}ko(e,t,i,n){return this.Fo.getDocumentsMatchingQuery(e,i,n).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}}const ew="LocalStore";class tw{constructor(e,t,i,n){this.persistence=e,this.qo=t,this.serializer
2=n,this.$o=new yd(nc),this.Ko=new em(e=>gb(e),vb),this.Wo=new Map,this.Qo=e.getRemoteDocumentCache(),this.g_=e.getTargetCache(),this.w_=e.getBundleCache(),this.Go(i)}Go(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new Db(this.Qo,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Qo.setIndexManager(this.indexManager),this.qo.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.$o))}}function iw(e,t,i,n){return new tw(e,t,i,n)}async function nw(e,t){const i=ju(e);return await i.persistence.runTransaction("Handle user change","readonly",e=>{let n;return i.mutationQueue.getAllMutationBatches(e).next(r=>(n=r,i.Go(t),i.mutationQueue.getAllMutationBatches(e))).next(t=>{const r=[],s=[];let a=cm();for(const e of n){r.push(e.batchId);for(const t of e.mutations)a=a.add(t.key)}for(const e of t){s.push(e.batchId);for(const t of e.mutations)a=a.add(t.key)}return i.localDocuments.getDocuments(e,a).next(e=>({zo:e,removedBatchIds:r,addedBatchIds:s}))})})}function rw(e){const t=ju(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",e=>t.g_.getLastRemoteSnapshotVersion(e))}function sw(e,t,i){let n=cm(),r=cm();return i.forEach(e=>n=n.add(e)),t.getEntries(e,n).next(e=>{let n=im();return i.forEach((i,s)=>{const a=e.get(i);s.isFoundDocument()!==a.isFoundDocument()&&(r=r.add(i)),s.isNoDocument()&&s.version.isEqual(Cc.min())?(t.removeEntry(i,s.readTime),n=n.insert(i,s)):!a.isValidDocument()||s.version.compareTo(a.version)>0||0===s.version.compareTo(a.version)&&a.hasPendingWrites?(t.addEntry(s),n=n.insert(i,s)):Du(ew,"Ignoring outdated watch update for ",i,". Current version:",a.version," Watch version:",s.version)}),{jo:n,Ho:r}})}function aw(e,t){const i=ju(e);return i.persistence.runTransaction("Get next mutation batch","readonly",e=>(void 0===t&&(t=zc),i.mutationQueue.getNextMutationBatchAfterBatchId(e,t)))}function ow(e,t){const i=ju(e);return i.persistence.runTransaction("Allocate target","readwrite",e=>{let n;return i.g_.getTargetData(e,t).next(r=>r?(n=r,Dc.resolve(n)):i.g_.allocateTargetId(e).next(r=>(n=new wb(t,r,"TargetPurposeListen",e.currentSequenceNumber),i.g_.addTargetData(e,n).next(()=>n))))}).then(e=>{const n=i.$o.get(e.targetId);return(null===n||e.snapshotVersion.compareTo(n.snapshotVersion)>0)&&(i.$o=i.$o.insert(e.targetId,e),i.Ko.set(t,e.targetId)),e})}async function lw(e,t,i){const n=ju(e),r=n.$o.get(t),s=i?"readwrite":"readwrite-primary";try{i||await n.persistence.runTransaction("Release target",s,e=>n.persistence.referenceDelegate.removeTarget(e,r))}catch(e){if(!Bc(e))throw e;Du(ew,"Failed to update sequence numbers for target ".concat(t,": ").concat(e))}n.$o=n.$o.remove(t),n.Ko.delete(r.target)}function hw(e,t,i){const n=ju(e);let r=Cc.min(),s=cm();return n.persistence.runTransaction("Execute query","readwrite",e=>function(e,t,i){const n=ju(e),r=n.Ko.get(i);return void 0!==r?Dc.resolve(n.$o.get(r)):n.g_.getTargetData(t,i)}(n,e,db(t)?t:zp(t)).next(t=>{if(t)return r=t.lastLimboFreeSnapshotVersion,n.g_.getMatchingKeysForTargetId(e,t.targetId).next(e=>{s=e})}).next(()=>n.qo.getDocumentsMatchingQuery(e,t,i?r:Cc.min(),i?s:cm())).next(e=>(uw(n,e),{documents:e,Jo:s})))}function uw(e,t){t.forEach((t,i)=>{const n=i.key.getCollectionGroup(),r=e.Wo.get(n)||Cc.min();i.readTime.compareTo(r)>0&&e.Wo.set(n,i.readTime)})}class cw{constructor(){this.activeTargetIds=fm()}na(e){this.activeTargetIds=this.activeTargetIds.add(e)}ra(e){this.activeTargetIds=this.activeTargetIds.delete(e)}ta(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class dw{constructor(){this.Ua=new cw,this.ka={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,i){}addLocalQueryTarget(e){return(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&this.Ua.na(e),this.ka[e]||"not-current"}updateQueryState(e,t,i){this.ka[e]=t}removeLocalQueryTarget(e){this.Ua.ra(e)}isLocalQueryTarget(e){return this.Ua.activeTargetIds.has(e)}clearQueryState(e){delete this.ka[e]}getAllActiveQueryTargets(){return this.Ua.activeTargetIds}isActiveQueryTarget(e){return this.Ua.activeTargetIds.has(e)}start(){return this.Ua=new cw,Promise.resolve()}handleUserChange(e,t,i){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}function fw(){return"undefined"!=typeof document?document:null}class pw{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.qa=0,this.$a=null,this.Ka=!0}Wa(){0===this.qa&&(this.Qa("Unknown"),this.$a=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.$a=null,this.Ga("Backend didn't respond within 10 seconds."),this.Qa("Offline"),Promise.resolve())))}za(e){"Online"===this.state?this.Qa("Unknown"):(this.qa++,this.qa>
2=1&&(this.ja(),this.Ga("Connection failed 1 times. Most recent error: ".concat(e.toString())),this.Qa("Offline")))}set(e){this.ja(),this.qa=0,"Online"===e&&(this.Ka=!1),this.Qa(e)}Qa(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}Ga(e){const t="Could not reach Cloud Firestore backend. ".concat(e,"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.");this.Ka?(Fu(t),this.Ka=!1):Du("OnlineStateTracker",t)}ja(){null!==this.$a&&(this.$a.cancel(),this.$a=null)}}const mw="RemoteStore";class gw{constructor(e,t,i,n,r){this.localStore=e,this.datastore=t,this.asyncQueue=i,this.remoteSyncer={},this.Ha=[],this.Ja=new Map,this.Ya=new Map,this.Za=new Map,this.Xa=new Ab(1e3),this.eu=new Ab(1001),this.tu=new Set,this.nu=[],this.ru=r,this.ru.bt(e=>{i.enqueueAndForget(async()=>{Cw(this)&&(Du(mw,"Restarting streams for network reachability change."),await async function(e){const t=ju(e);t.tu.add(4),await yw(t),t.iu.set("Unknown"),t.tu.delete(4),await vw(t)}(this))})}),this.iu=new pw(i,n)}}async function vw(e){if(Cw(e))for(const t of e.nu)await t(!0)}async function yw(e){for(const t of e.nu)await t(!1)}function xw(e,t){return e.Ya.get(t)||void 0}function bw(e,t){const i=ju(e),n=xw(i,t.targetId);if(void 0!==n&&i.Ja.has(n))return;const r=function(e,t){const i=xw(e,t);void 0!==i&&e.Za.delete(i);const n=function(e,t){return t%2!=0?e.eu.next():e.Xa.next()}(e,t);return e.Ya.set(t,n),e.Za.set(n,t),n}(i,t.targetId);Du(mw,"remoteStoreListen mapping SDK target ID to remote",t.targetId,r);const s=new wb(t.target,r,t.purpose,t.sequenceNumber,t.snapshotVersion,t.lastLimboFreeSnapshotVersion,t.resumeToken);i.Ja.set(r,s),Ew(i)?Sw(i):Ww(i).Fn()&&Tw(i,s)}function ww(e,t){const i=ju(e),n=Ww(i),r=xw(i,t);Du(mw,"remoteStoreUnlisten removing mapping of SDK target ID to remote",t,r),i.Ja.delete(r),i.Ya.delete(t),i.Za.delete(r),n.Fn()&&_w(i,r),0===i.Ja.size&&(n.Fn()?n.Nn():Cw(i)&&i.iu.set("Unknown"))}function Tw(e,t){if(e.su.We(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(Cc.min())>0){const i=e.Za.get(t.targetId);if(void 0===i)return void Du(mw,"SDK target ID not found for remote ID: "+t.targetId);const n=e.remoteSyncer.getRemoteKeysForTarget(i).size;t=t.withExpectedCount(n)}Ww(e).jn(t)}function _w(e,t){e.su.We(t),Ww(e).Hn(t)}function Sw(e){e.su=new km({getRemoteKeysForTarget:t=>{const i=e.Za.get(t);return void 0!==i?e.remoteSyncer.getRemoteKeysForTarget(i):cm()},dt:t=>e.Ja.get(t)||null,Tt:()=>e.datastore.serializer.databaseId}),Ww(e).start(),e.iu.Wa()}function Ew(e){return Cw(e)&&!Ww(e).Cn()&&e.Ja.size>0}function Cw(e){return 0===ju(e).tu.size}function Aw(e){e.su=void 0}async function kw(e){e.iu.set("Online")}async function Rw(e){e.Ja.forEach((t,i)=>{Tw(e,t)})}async function Ow(e,t){Aw(e),Ew(e)?(e.iu.za(t),Sw(e)):e.iu.set("Unknown")}async function Pw(e,t,i){if(e.iu.set("Online"),t instanceof Em&&2===t.state&&t.cause)try{await async function(e,t){const i=t.cause;for(const n of t.targetIds){if(e.Ja.has(n)){const t=e.Za.get(n);void 0!==t&&(await e.remoteSyncer.rejectListen(t,i),e.Ya.delete(t),e.Za.delete(n)),e.Ja.delete(n)}e.su.removeTarget(n)}}(e,t)}catch(i){Du(mw,"Failed to remove targets %s: %s ",t.targetIds.join(","),i),await Mw(e,i)}else if(t instanceof _m?e.su.et(t):t instanceof Sm?e.su.ot(t):e.su.rt(t),!i.isEqual(Cc.min()))try{const t=await rw(e.localStore);i.compareTo(t)>=0&&await function(e,t){const i=e.su.Rt(t);
2i.targetChanges.forEach((i,n)=>{if(i.resumeToken.approximateByteSize()>0){const r=e.Ja.get(n);r&&e.Ja.set(n,r.withResumeToken(i.resumeToken,t))}}),i.targetMismatches.forEach((t,i)=>{const n=e.Ja.get(t);if(!n)return;e.Ja.set(t,n.withResumeToken(Rd.EMPTY_BYTE_STRING,n.snapshotVersion)),_w(e,t);const r=new wb(n.target,t,i,n.sequenceNumber);Tw(e,r)});const n=function(e,t){const i=new Map;t.targetChanges.forEach((t,n)=>{const r=e.Za.get(n);void 0!==r&&i.set(r,t)});let n=new yd(nc);return t.targetMismatches.forEach((t,i)=>{const r=e.Za.get(t);void 0!==r&&(n=n.insert(r,i))}),new wm(t.snapshotVersion,i,n,t.documentUpdates,t.augmentedDocumentUpdates,t.resolvedLimboDocuments)}(e,i);return e.remoteSyncer.applyRemoteEvent(n)}(e,i)}catch(t){Du(mw,"Failed to raise snapshot:",t),await Mw(e,t)}}async function Mw(e,t,i){if(!Bc(t))throw t;e.tu.add(1),await yw(e),e.iu.set("Offline"),i||(i=()=>rw(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{Du(mw,"Retrying IndexedDB access"),await i(),e.tu.delete(1),await vw(e)})}function Nw(e,t){return t().catch(i=>Mw(e,i,t))}async function Iw(e){const t=ju(e),i=Gw(t);let n=t.Ha.length>0?t.Ha[t.Ha.length-1].batchId:zc;for(;Lw(t);)try{const e=await aw(t.localStore,n);if(null===e){0===t.Ha.length&&i.Nn();break}n=e.batchId,Dw(t,e)}catch(e){await Mw(t,e)}Fw(t)&&Bw(t)}function Lw(e){return Cw(e)&&e.Ha.length<10}function Dw(e,t){e.Ha.push(t);const i=Gw(e);i.Fn()&&i.Jn&&i.Yn(t.mutations)}function Fw(e){return Cw(e)&&!Gw(e).Cn()&&e.Ha.length>0}function Bw(e){Gw(e).start()}async function Uw(e){Gw(e).er()}async function zw(e){const t=Gw(e);for(const i of e.Ha)t.Yn(i.mutations)}async function Vw(e,t,i){const n=e.Ha.shift(),r=xb.from(n,t,i);await Nw(e,()=>e.remoteSyncer.applySuccessfulWrite(r)),await Iw(e)}async function Hw(e,t){t&&Gw(e).Jn&&await async function(e,t){if(function(e){return Zp(e)&&e!==Yu.ABORTED}(t.code)){const i=e.Ha.shift();Gw(e).Mn(),await Nw(e,()=>e.remoteSyncer.rejectFailedWrite(i.batchId,t)),await Iw(e)}}(e,t),Fw(e)&&Bw(e)}async function jw(e,t){const i=ju(e);i.asyncQueue.verifyOperationInProgress(),Du(mw,"RemoteStore received new credentials");const n=Cw(i);i.tu.add(3),await yw(i),n&&i.iu.set("Unknown"),await i.remoteSyncer.handleCredentialChange(t),i.tu.delete(3),await vw(i)}async function Yw(e,t){const i=ju(e);t?(i.tu.delete(2),await vw(i)):t||(i.tu.add(2),await yw(i),i.iu.set("Unknown"))}function Ww(e){return e._u||(e._u=function(e,t,i){const n=ju(e);return n.nr(),new Dg(t,n.connection,n.authCredentials,n.appCheckCredentials,n.serializer,i)}(e.datastore,e.asyncQueue,{Qt:kw.bind(null,e),zt:Rw.bind(null,e),Ht:Ow.bind(null,e),zn:Pw.bind(null,e)}
2),e.nu.push(async t=>{t?(e._u.Mn(),Ew(e)?Sw(e):e.iu.set("Unknown")):(await e._u.stop(),Aw(e))})),e._u}function Gw(e){return e.ou||(e.ou=function(e,t,i){const n=ju(e);return n.nr(),new Fg(t,n.connection,n.authCredentials,n.appCheckCredentials,n.serializer,i)}(e.datastore,e.asyncQueue,{Qt:()=>Promise.resolve(),zt:Uw.bind(null,e),Ht:Hw.bind(null,e),Zn:zw.bind(null,e),Xn:Vw.bind(null,e)}),e.nu.push(async t=>{t?(e.ou.Mn(),await Iw(e)):(await e.ou.stop(),e.Ha.length>0&&(Du(mw,"Stopping write stream with ".concat(e.Ha.length," pending writes")),e.Ha=[]))})),e.ou}class Xw{constructor(e,t,i,n,r){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=i,this.op=n,this.removalCallback=r,this.deferred=new Gu,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(e=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,i,n,r){const s=Date.now()+i,a=new Xw(e,t,s,n,r);return a.start(i),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new Wu(Yu.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function qw(e,t){if(Fu("AsyncQueue","".concat(t,": ").concat(e)),Bc(e))return new Wu(Yu.UNAVAILABLE,"".concat(t,": ").concat(e));throw e}class Kw{static emptySet(e){return new Kw(e.comparator)}constructor(e){this.comparator=e?(t,i)=>e(t,i)||pc.comparator(t.key,i.key):(e,t)=>pc.comparator(e.key,t.key),this.keyedMap=rm(),this.sortedSet=new yd(this.comparator)}has(e){return null!=this.keyedMap.get(e)}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,i)=>(e(t),!1))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof Kw))return!1;if(this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),i=e.sortedSet.getIterator();for(;t.hasNext();){const e=t.getNext().key,n=i.getNext().key;if(!e.isEqual(n))return!1}return!0}toString(){const e=[];return this.forEach(t=>{e.push(t.toString())}),0===e.length?"DocumentSet ()":"DocumentSet (\n  "+e.join("  \n")+"\n)"}copy(e,t){const i=new Kw;return i.comparator=this.comparator,i.keyedMap=e,i.sortedSet=t,i}}class Qw{constructor(){this.au=new yd(pc.comparator)}track(e){const t=e.doc.key,i=this.au.get(t);i?0!==e.type&&3===i.type?this.au=this.au.insert(t,e):3===e.type&&1!==i.type?this.au=this.au.insert(t,{type:i.type,doc:e.doc}):2===e.type&&2===i.type?this.au=this.au.insert(t,{type:2,doc:e.doc}):2===e.type&&0===i.type?this.au=this.au.insert(t,{type:0,doc:e.doc}):1===e.type&&0===i.type?this.au=this.au.remove(t):1===e.type&&2===i.type?this.au=this.au.insert(t,{type:1,doc:i.doc}):0===e.type&&1===i.type?this.au=this.au.insert(t,{type:2,doc:e.doc}):zu(63341,{ft:e,uu:i}):this.au=this.au.insert(t,e)}cu(){const e=[];return this.au.inorderTraversal((t,i)=>{e.push(i)}),e}}class Jw{constructor(e,t,i,n,r,s,a,o,l){this.query=e,this.docs=t,this.oldDocs=i,this.docChanges=n,this.mutatedKeys=r,this.fromCache=s,this.syncStateChanged=a,this.excludesMetadataChanges=o,this.hasCachedResults=l}static fromInitialDocuments(e,t,i,n,r){const s=[];return t.forEach(e=>{s.push({type:0,doc:e})}),new Jw(e,t,Kw.emptySet(t),s,i,n,!0,!1,r)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&mb(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,i=e.docChanges;if(t.length!==i.length)return!1;for(let n=0;n<t.length;n++)if(t[n].type!==i[n].type||!t[n].doc.isEqual(i[n].doc))return!1;return!0}}class Zw{constructor(){this.lu=void 0,this.Eu=[]}hu(){return this.Eu.some(e=>e.Tu())}}class $w{constructor(){this.queries=eT(),this.onlineState="Unknown",this.Pu=new Set}terminate(){!function(e,t){const i=ju(e),n=i.queries;
2i.queries=eT(),n.forEach((e,i)=>{for(const n of i.Eu)n.onError(t)})}(this,new Wu(Yu.ABORTED,"Firestore shutting down"))}}function eT(){return new em(e=>pb(e),mb)}async function tT(e,t){const i=ju(e);let n=3;const r=t.query;let s=i.queries.get(r);s?!s.hu()&&t.Tu()&&(n=2):(s=new Zw,n=t.Tu()?0:1);try{switch(n){case 0:s.lu=await i.onListen(r,!0);break;case 1:s.lu=await i.onListen(r,!1);break;case 2:await i.onFirstRemoteStoreListen(r)}}catch(e){const i=qw(e,"Initialization of query '".concat(db(t.query)?ub(t.query):Wp(t.query),"' failed"));return void t.onError(i)}i.queries.set(r,s),s.Eu.push(t),t.Ru(i.onlineState),s.lu&&t.Iu(s.lu)&&sT(i)}async function iT(e,t){const i=ju(e),n=t.query;let r=3;const s=i.queries.get(n);if(s){const e=s.Eu.indexOf(t);e>=0&&(s.Eu.splice(e,1),0===s.Eu.length?r=t.Tu()?0:1:!s.hu()&&t.Tu()&&(r=2))}switch(r){case 0:return i.queries.delete(n),i.onUnlisten(n,!0);case 1:return i.queries.delete(n),i.onUnlisten(n,!1);case 2:return i.onLastRemoteStoreUnlisten(n);default:return}}function nT(e,t){const i=ju(e);let n=!1;for(const r of t){const e=r.query,t=i.queries.get(e);if(t){for(const e of t.Eu)e.Iu(r)&&(n=!0);t.lu=r}}n&&sT(i)}function rT(e,t,i){const n=ju(e),r=n.queries.get(t);if(r)for(const s of r.Eu)s.onError(i);n.queries.delete(t)}function sT(e){e.Pu.forEach(e=>{e.next()})}var aT,oT;(oT=aT||(aT={})).Default="default",oT.Cache="cache";class lT{constructor(e,t,i){this.query=e,this.Au=t,this.Vu=!1,this.du=null,this.onlineState="Unknown",this.options=i||{}}Iu(e){if(!this.options.includeMetadataChanges){const t=[];for(const i of e.docChanges)3!==i.type&&t.push(i);e=new Jw(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.Vu?this.fu(e)&&(this.Au.next(e),t=!0):this.mu(e,this.onlineState)&&(this.pu(e),t=!0),this.du=e,t}onError(e){this.Au.error(e)}Ru(e){this.onlineState=e;let t=!1;return this.du&&!this.Vu&&this.mu(this.du,e)&&(this.pu(this.du),t=!0),t}mu(e,t){if(!e.fromCache)return!0;if(!this.Tu())return!0;const i="Offline"!==t;return(!this.options.waitForSyncWhenOnline||!i)&&(!e.docs.isEmpty()||e.hasCachedResults||"Offline"===t)}fu(e){if(e.docChanges.length>0)return!0;const t=this.du&&this.du.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}pu(e){e=Jw.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Vu=!0,this.Au.next(e)}Tu(){return this.options.source!==aT.Cache}}class hT{constructor(e){this.key=e}}class uT{constructor(e){this.key=e}}class cT{constructor(e,t){this.query=e,this.Ou=t,this.Mu=null,this.hasCachedResults=!1,this.current=!1,this.Nu=cm(),this.mutatedKeys=cm(),this.Lu=db(e)?Mb(e):Xp(e),this.Bu=new Kw(this.Lu)}get Uu(){return this.Ou}ku(e,t){const i=t?t.qu:new Qw,n=t?t.Bu:this.Bu;let r=t?t.mutatedKeys:this.mutatedKeys,s=n,a=!1;const o=u(this.$u(this.query,n),2),l=o[0],h=o[1];e.inorderTraversal((e,t)=>{const o=n.get(e),u=Ob(this.query,t)?t:null,c=!!o&&this.mutatedKeys.has(o.key),d=!!u&&(u.hasLocalMutations||this.mutatedKeys.has(u.key)&&u.hasCommittedMutations);let f=!1;o&&u?o.data.isEqual(u.data)?c!==d&&(i.track({type:3,doc:u}),f=!0):this.Ku(o,u)||(i.track({type:2,doc:u}),f=!0,(l&&this.Lu(u,l)>0||h&&this.Lu(u,h)<0)&&(a=!0)):!o&&u?(i.track({type:0,doc:u}),f=!0):o&&!u&&(i.track({type:1,doc:o}),f=!0,(l||h)&&(a=!0)),f&&(u?(s=s.add(u),r=d?r.add(e):r.delete(e)):(s=s.delete(e),r=r.delete(e)))});const c=this.Wu(this.query);if(c)if(db(this.query)){const e=[];s.forEach(t=>e.push(t));const t=kb(this.query,e);let n=new Kw(Mb(this.query));for(const i of t)n=n.add(i);s.forEach(e=>{n.has(e.key)||(r=r.delete(e.key),i.track({type:1,doc:e}))}),s=n}else{const e=this.Qu(this.query);for(;s.size>c;){const t="F"===e?s.last():s.first();s=s.delete(t.key),r=r.delete(t.key),i.track({type:1,doc:t})}}return{Bu:s,qu:i,Uo:a,mutatedKeys:r}}Wu(e){var t;return db(e)?null===(t=Nb(e))||void 0===t?void 0:t.limit:e.limit||void 0}Qu(e){if(db(e)){const t=Nb(e);return t&&t.limit<0?"L":"F"}return e.limitType}$u(e,t){if(db(e)){var i;const n=null===(i=Nb(e))||void 0===i?void 0:i.limit;return[t.size===n?t.last():null,null]}return["F"===e.limitType&&t.size===this.Wu(this.query)?t.last():null,"L"===e.limitType&&t.size===this.Wu(this.query)?t.first():null]}Ku(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}
2applyChanges(e,t,i,n){const r=this.Bu;this.Bu=e.Bu,this.mutatedKeys=e.mutatedKeys;const s=e.qu.cu();s.sort((e,t)=>function(e,t){const i=e=>{switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return zu(20277,{ft:e})}};return i(e)-i(t)}(e.type,t.type)||this.Lu(e.doc,t.doc)),this.Gu(i),n=null!==n&&void 0!==n&&n;const a=t&&!n?this.zu():[],o=0===this.Nu.size&&this.current&&!n?1:0,l=o!==this.Mu;return this.Mu=o,0!==s.length||l?{snapshot:new Jw(this.query,e.Bu,r,s,e.mutatedKeys,0===o,l,!1,!!i&&i.resumeToken.approximateByteSize()>0),ju:a}:{ju:a}}Ru(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({Bu:this.Bu,qu:new Qw,mutatedKeys:this.mutatedKeys,Uo:!1},!1)):{ju:[]}}Hu(e){return!this.Ou.has(e)&&!!this.Bu.has(e)&&!this.Bu.get(e).hasLocalMutations}Gu(e){e&&(e.addedDocuments.forEach(e=>this.Ou=this.Ou.add(e)),e.modifiedDocuments.forEach(e=>{}),e.removedDocuments.forEach(e=>this.Ou=this.Ou.delete(e)),this.current=e.current)}zu(){if(!this.current)return[];const e=this.Nu;this.Nu=cm(),this.Bu.forEach(e=>{this.Hu(e.key)&&(this.Nu=this.Nu.add(e.key))});const t=[];return e.forEach(e=>{this.Nu.has(e)||t.push(new uT(e))}),this.Nu.forEach(i=>{e.has(i)||t.push(new hT(i))}),t}Ju(e){this.Ou=e.Jo,this.Nu=cm();const t=this.ku(e.documents);return this.applyChanges(t,!0)}Yu(){return Jw.fromInitialDocuments(this.query,this.Bu,this.mutatedKeys,0===this.Mu,this.hasCachedResults)}}const dT="SyncEngine";class fT{constructor(e,t,i){this.query=e,this.targetId=t,this.view=i}}class pT{constructor(e){this.key=e,this.Zu=!1}}class mT{constructor(e,t,i,n,r,s){this.localStore=e,this.remoteStore=t,this.eventManager=i,this.sharedClientState=n,this.currentUser=r,this.maxConcurrentLimboResolutions=s,this.Xu={},this.ec=new em(e=>pb(e),mb),this.tc=new Map,this.nc=new Set,this.rc=new yd(pc.comparator),this.sc=new Map,this._c=new zb,this.oc={},this.ac=new Map,this.uc=Ab.Cs(),this.onlineState="Unknown",this.cc=void 0}get isPrimaryClient(){return!0===this.cc}}async function gT(e,t){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=FT(e);let r;const s=n.ec.get(t);return s?(n.sharedClientState.addLocalQueryTarget(s.targetId),r=s.view.Yu()):r=await yT(n,t,i,!0),r}async function vT(e,t){const i=FT(e);await yT(i,t,!0,!1)}async function yT(e,t,i,n){const r=await ow(e.localStore,db(t)?t:zp(t)),s=r.targetId,a=e.sharedCl
2ientState.addLocalQueryTarget(s,i);let o;return n&&(o=await xT(e,t,s,"current"===a,r.resumeToken)),e.isPrimaryClient&&i&&bw(e.remoteStore,r),o}async function xT(e,t,i,n,r){e.lc=(t,i,n)=>async function(e,t,i,n){let r=t.view.ku(i);r.Uo&&(r=await hw(e.localStore,t.query,!1).then(e=>{let i=e.documents;return t.view.ku(i,r)}));const s=n&&n.targetChanges.get(t.targetId),a=n&&null!=n.targetMismatches.get(t.targetId),o=t.view.applyChanges(r,e.isPrimaryClient,s,a);return PT(e,t.targetId,o.ju),o.snapshot}(e,t,i,n);const s=await hw(e.localStore,t,!0),a=new cT(t,s.Jo),o=a.ku(s.documents),l=Tm.createSynthesizedTargetChangeForCurrentChange(i,n&&"Offline"!==e.onlineState,r),h=a.applyChanges(o,e.isPrimaryClient,l);PT(e,i,h.ju);const u=new fT(t,i,a);return e.ec.set(t,u),e.tc.has(i)?e.tc.get(i).push(t):e.tc.set(i,[t]),h.snapshot}async function bT(e,t,i){const n=ju(e),r=n.ec.get(t),s=n.tc.get(r.targetId);if(s.length>1)return n.tc.set(r.targetId,s.filter(e=>!mb(e,t))),void n.ec.delete(t);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(r.targetId),n.sharedClientState.isActiveQueryTarget(r.targetId)||await lw(n.localStore,r.targetId,!1).then(()=>{n.sharedClientState.clearQueryState(r.targetId),i&&ww(n.remoteStore,r.targetId),RT(n,r.targetId)}).catch(Lc)):(RT(n,r.targetId),await lw(n.localStore,r.targetId,!0))}async function wT(e,t){const i=ju(e),n=i.ec.get(t),r=i.tc.get(n.targetId);i.isPrimaryClient&&1===r.length&&(i.sharedClientState.removeLocalQueryTarget(n.targetId),ww(i.remoteStore,n.targetId))}async function TT(e,t){const i=ju(e);try{const e=await function(e,t){const i=ju(e),n=t.snapshotVersion;let r=i.$o;return i.persistence.runTransaction("Apply remote event","readwrite-primary",e=>{const s=i.Qo.newChangeBuffer({trackRemovals:!0});r=i.$o;const a=[];
2t.targetChanges.forEach((s,o)=>{const l=r.get(o);if(!l)return;a.push(i.g_.removeMatchingKeys(e,s.removedDocuments,o).next(()=>i.g_.addMatchingKeys(e,s.addedDocuments,o)));let h=l.withSequenceNumber(e.currentSequenceNumber);null!==t.targetMismatches.get(o)?h=h.withResumeToken(Rd.EMPTY_BYTE_STRING,Cc.min()).withLastLimboFreeSnapshotVersion(Cc.min()):s.resumeToken.approximateByteSize()>0&&(h=h.withResumeToken(s.resumeToken,n)),r=r.insert(o,h),function(e,t,i){return 0===e.resumeToken.approximateByteSize()||(t.snapshotVersion.toMicroseconds()-e.snapshotVersion.toMicroseconds()>=3e8||i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size>0)}(l,h,s)&&a.push(i.g_.updateTargetData(e,h))});let o=im(),l=cm();if(t.documentUpdates.forEach(n=>{t.resolvedLimboDocuments.has(n)&&a.push(i.persistence.referenceDelegate.updateLimboDocument(e,n))}),a.push(sw(e,s,t.documentUpdates).next(e=>{o=e.jo,l=e.Ho})),!n.isEqual(Cc.min())){const t=i.g_.getLastRemoteSnapshotVersion(e).next(t=>i.g_.setTargetsMetadata(e,e.currentSequenceNumber,n));a.push(t)}return Dc.waitFor(a).next(()=>s.apply(e)).next(()=>i.localDocuments.getLocalViewOfDocuments(e,o,l)).next(()=>o)}).then(e=>(i.$o=r,e))}(i.localStore,t);
2t.targetChanges.forEach((e,t)=>{const n=i.sc.get(t);n&&(Hu(e.addedDocuments.size+e.modifiedDocuments.size+e.removedDocuments.size<=1,22616),e.addedDocuments.size>0?n.Zu=!0:e.modifiedDocuments.size>0?Hu(n.Zu,14607):e.removedDocuments.size>0&&(Hu(n.Zu,42227),n.Zu=!1))}),await IT(i,e,t)}catch(e){await Lc(e)}}function _T(e,t,i){const n=ju(e);if(n.isPrimaryClient&&0===i||!n.isPrimaryClient&&1===i){const e=[];n.ec.forEach((i,n)=>{const r=n.view.Ru(t);r.snapshot&&e.push(r.snapshot)}),function(e,t){const i=ju(e);i.onlineState=t;let n=!1;i.queries.forEach((e,i)=>{for(const r of i.Eu)r.Ru(t)&&(n=!0)}),n&&sT(i)}(n.eventManager,t),e.length&&n.Xu.zn(e),n.onlineState=t,n.isPrimaryClient&&n.sharedClientState.setOnlineState(t)}}async function ST(e,t,i){const n=ju(e);n.sharedClientState.updateQueryState(t,"rejected",i);const r=n.sc.get(t),s=r&&r.key;if(s){let e=new yd(pc.comparator);e=e.insert(s,Cp.newNoDocument(s,Cc.min()));const i=cm().add(s),r=new wm(Cc.min(),new Map,new yd(nc),e,im(),i);await TT(n,r),n.rc=n.rc.remove(s),n.sc.delete(t),NT(n)}else await lw(n.localStore,t,!1).then(()=>RT(n,t,i)).catch(Lc)}async function ET(e,t){const i=ju(e),n=t.batch.batchId;try{const e=await function(e,t){const i=ju(e);return i.persistence.runTransaction("Acknowledge batch","readwrite-primary",e=>{const n=t.batch.keys(),r=i.Qo.newChangeBuffer({trackRemovals:!0});return function(e,t,i,n){const r=i.batch,s=r.keys();let a=Dc.resolve();return s.forEach(e=>{a=a.next(()=>n.getEntry(t,e)).next(t=>{const s=i.docVersions.get(e);Hu(null!==s,48541),t.version.compareTo(s)<0&&(r.applyToRemoteDocument(t,i),t.isValidDocument()&&(t.setReadTime(i.commitVersion),n.addEntry(t)))})}),a.next(()=>e.mutationQueue.removeMutationBatch(t,r))}(i,e,t,r).next(()=>r.apply(e)).next(()=>i.mutationQueue.performConsistencyCheck(e)).next(()=>i.documentOverlayCache.removeOverlaysForBatchId(e,n,t.batch.batchId)).next(()=>i.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,function(e){let t=cm();for(let i=0;i<e.mutationResults.length;++i)e.mutationResults[i].transformResults.length>0&&(t=t.add(e.batch.mutations[i].key));return t}(t))).next(()=>i.localDocuments.getDocuments(e,n))})}(i.localStore,t);kT(i,n,null),AT(i,n),i.sharedClientState.updateMutationState(n,"acknowledged"),await IT(i,e)}catch(e){await Lc(e)}}async function CT(e,t,i){const n=ju(e);try{const e=await function(e,t){const i=ju(e);return i.persistence.runTransaction("Reject batch","readwrite-primary",e=>{let n;
2return i.mutationQueue.lookupMutationBatch(e,t).next(t=>(Hu(null!==t,37113),n=t.keys(),i.mutationQueue.removeMutationBatch(e,t))).next(()=>i.mutationQueue.performConsistencyCheck(e)).next(()=>i.documentOverlayCache.removeOverlaysForBatchId(e,n,t)).next(()=>i.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,n)).next(()=>i.localDocuments.getDocuments(e,n))})}(n.localStore,t);kT(n,t,i),AT(n,t),n.sharedClientState.updateMutationState(t,"rejected",i),await IT(n,e)}catch(i){await Lc(i)}}function AT(e,t){(e.ac.get(t)||[]).forEach(e=>{e.resolve()}),e.ac.delete(t)}function kT(e,t,i){const n=ju(e);let r=n.oc[n.currentUser.toKey()];if(r){const e=r.get(t);e&&(i?e.reject(i):e.resolve(),r=r.remove(t)),n.oc[n.currentUser.toKey()]=r}}function RT(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e.sharedClientState.removeLocalQueryTarget(t);for(const n of e.tc.get(t))e.ec.delete(n),i&&e.Xu.Ec(n,i);e.tc.delete(t),e.isPrimaryClient&&e._c.s_(t).forEach(t=>{e._c.containsKey(t)||OT(e,t)})}function OT(e,t){e.nc.delete(t.path.canonicalString());const i=e.rc.get(t);null!==i&&(ww(e.remoteStore,i),e.rc=e.rc.remove(t),e.sc.delete(i),NT(e))}function PT(e,t,i){for(const n of i)n instanceof hT?(e._c.addReference(n.key,t),MT(e,n)):n instanceof uT?(Du(dT,"Document no longer in limbo: "+n.key),e._c.removeReference(n.key,t),e._c.containsKey(n.key)||OT(e,n.key)):zu(19791,{hc:n})}function MT(e,t){const i=t.key,n=i.path.canonicalString();e.rc.get(i)||e.nc.has(n)||(Du(dT,"New document in limbo: "+i),e.nc.add(n),NT(e))}function NT(e){for(;e.nc.size>0&&e.rc.size<e.maxConcurrentLimboResolutions;){const t=e.nc.values().next().value;e.nc.delete(t);const i=new pc(cc.fromString(t)),n=e.uc.next();e.sc.set(n,new pT(i)),e.rc=e.rc.insert(i,n),bw(e.remoteStore,new wb(zp(Lp(i.path)),n,"TargetPurposeLimboResolution",Uc.ce))}}async function IT(e,t,i){const n=ju(e),r=[],s=[],a=[];n.ec.isEmpty()||(n.ec.forEach((e,o)=>{a.push(n.lc(o,t,i).then(e=>{if((e||i)&&n.isPrimaryClient){var t;const r=e?!e.fromCache:null===i||void 0===i||null===(t=i.targetChanges.get(o.targetId))||void 0===t?void 0:t.current;n.sharedClientState.updateQueryState(o.targetId,r?"current":"not-current")}if(e){r.push(e);const t=Qb.vo(o.targetId,e);s.push(t)}}))}),await Promise.all(a),n.Xu.zn(r),await async function(e,t){const i=ju(e);try{await i.persistence.runTransaction("notifyLocalViewChanges","readwrite",e=>Dc.forEach(t,t=>Dc.forEach(t.wo,n=>i.persistence.referenceDelegate.addReference(e,t.targetId,n)).next(()=>Dc.forEach(t.bo,n=>i.persistence.referenceDelegate.removeReference(e,t.targetId,n)))))}catch(e){if(!Bc(e))throw e;Du(ew,"Failed to update sequence numbers: "+e)}for(const n of t){const e=n.targetId;if(!n.fromCache){const t=i.$o.get(e),n=t.snapshotVersion,r=t.withLastLimboFreeSnapshotVersion(n);i.$o=i.$o.insert(e,r)}}}(n.localStore,s))}async function LT(e,t){const i=ju(e);if(!i.currentUser.isEqual(t)){Du(dT,"User change. New user:",t.toKey());const e=await nw(i.localStore,t);i.currentUser=t,function(e,t){e.ac.forEach(e=>{e.forEach(e=>{e.reject(new Wu(Yu.CANCELLED,t))})}),e.ac.clear()}(i,"'waitForPendingWrites' promise is rejected due to a user change."),i.sharedClientState.handleUserChange(t,e.removedBatchIds,e.addedBatchIds),await IT(i,e.zo)}}function DT(e,t){const i=ju(e),n=i.sc.get(t);if(n&&n.Zu)return cm().add(n.key);{let e=cm();const n=i.tc.get(t);if(!n)return e;for(const t of null!==n&&void 0!==n?n:[]){const n=i.ec.get(t);e=e.unionWith(n.view.Uu)}return e}}function FT(e){const t=ju(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=TT.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=DT.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=ST.bind(null,t),t.Xu.zn=nT.bind(null,t.eventManager),t.Xu.Ec=rT.bind(null,t.eventManager),t}function BT(e){const t=ju(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=ET.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=CT.bind(null,t),t}class UT{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=pg(e.databaseInfo.databaseId),this.sharedClientState=this.Rc(e),this.persistence=this.Ic(e),await this.persistence.start(),this.localStore=this.Ac(e),this.gcScheduler
2=this.Vc(e,this.localStore),this.indexBackfillerScheduler=this.dc(e,this.localStore)}Vc(e,t){return null}dc(e,t){return null}Ac(e){return iw(this.persistence,new $b,e.initialUser,this.serializer)}Ic(e){return new Gb(qb.C_,this.serializer)}Rc(e){return new dw}async terminate(){var e,t;null!==(e=this.gcScheduler)&&void 0!==e&&e.stop(),null!==(t=this.indexBackfillerScheduler)&&void 0!==t&&t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}UT.provider={build:()=>new UT};class zT extends UT{constructor(e){super(),this.cacheSizeBytes=e}Vc(e,t){Hu(this.persistence.referenceDelegate instanceof Kb,46915);const i=this.persistence.referenceDelegate.garbageCollector;return new Jg(i,e.asyncQueue,t)}Ic(e){const t=void 0!==this.cacheSizeBytes?Gg.withCacheSize(this.cacheSizeBytes):Gg.DEFAULT;return new Gb(e=>Kb.C_(e,t),this.serializer)}}class VT{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=e=>_T(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=LT.bind(null,this.syncEngine),await Yw(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new $w}createDatastore(e){const t=pg(e.databaseInfo.databaseId),i=Mg(e.databaseInfo);return zg(e.authCredentials,e.appCheckCredentials,i,t)}createRemoteStore(e){return function(e,t,i,n,r){return new gw(e,t,i,n,r)}(this.localStore,this.datastore,e.asyncQueue,e=>_T(this.syncEngine,e,0),Tg.C()?new Tg:new bg)}createSyncEngine(e,t){return function(e,t,i,n,r,s,a){const o=new mT(e,t,i,n,r,s);return a&&(o.cc=!0),o}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e,t;await async function(e){const t=ju(e);Du(mw,"RemoteStore shutting down."),t.tu.add(5),await yw(t),t.ru.shutdown(),t.iu.set("Unknown")}(this.remoteStore),null!==(e=this.datastore)&&void 0!==e&&e.terminate(),null===(t=this.eventManager)||void 0===t||t.terminate()}}VT.provider={build:()=>new VT};class HT{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.mc(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.mc(this.observer.error,e):Fu("Uncaught Error in snapshot listener:",e.toString()))}gc(){this.muted=!0}mc(e,t){setTimeout(()=>{this.muted||e(t)},0)}}const jT="FirestoreClient";class YT{constructor(e,t,i,n,r){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=i,this._databaseInfo=n,this.user=Mu.UNAUTHENTICATED,this.clientId=ic.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=r,this.authCredentials.start(i,async e=>{Du(jT,"Received user=",e.uid),await this.authCredentialListener(e),this.user=e}),this.appCheckCredentials.start(i,e=>(Du(jT,"Received new app check token=",e),this.appCheckCredentialListener(e,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this._databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Gu;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const i=qw(t,"Failed to shutdown persistence");e.reject(i)}}),e.promise}}async function WT(e,t){e.asyncQueue.verifyOperationInProgress(),Du(jT,"Initializing OfflineComponentProvider");const i=e.configuration;await t.initialize(i);let n=i.initialUser;e.setCredentialChangeListener(async e=>{n.isEqual(e)||(await nw(t.localStore,e),n=e)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function GT(e,t){e.asyncQueue.verifyOperationInProgress();const i=await XT(e);Du(jT,"Initializing OnlineComponentProvider"),await t.initialize(i,e.configuration),e.setCredentialChangeListener(e=>jw(t.remoteStore,e)),e.setAppCheckTokenChangeListener((e,i)=>jw(t.remoteStore,i)),e._onlineComponents=t}async function XT(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){Du(jT,"Using user provided OfflineComponentProvider");try{await WT(e,e._uninitializedComponentsProvider._offline)}catch(t){const i=t;if(!function(e){return"FirebaseError"===e.name?e.code===Yu.FAILED_PRECONDITION||e.code===Yu.UNIMPLEMENT
2ED:!("undefined"!=typeof DOMException&&e instanceof DOMException)||22===e.code||20===e.code||11===e.code}(i))throw i;Bu("Error using user provided cache. Falling back to memory cache: "+i),await WT(e,new UT)}}else Du(jT,"Using default OfflineComponentProvider"),await WT(e,new zT(void 0));return e._offlineComponents}async function qT(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(Du(jT,"Using user provided OnlineComponentProvider"),await GT(e,e._uninitializedComponentsProvider._online)):(Du(jT,"Using default OnlineComponentProvider"),await GT(e,new VT))),e._onlineComponents}function KT(e){return qT(e).then(e=>e.syncEngine)}async function QT(e){const t=await qT(e),i=t.eventManager;return i.onListen=gT.bind(null,t.syncEngine),i.onUnlisten=bT.bind(null,t.syncEngine),i.onFirstRemoteStoreListen=vT.bind(null,t.syncEngine),i.onLastRemoteStoreUnlisten=wT.bind(null,t.syncEngine),i}function JT(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=new Gu;return e.asyncQueue.enqueueAndForget(async()=>function(e,t,i,n,r){const s=new HT({next:i=>{s.gc(),t.enqueueAndForget(()=>iT(e,a)),i.fromCache&&"server"===n.source?r.reject(new Wu(Yu.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):r.resolve(i)},error:e=>r.reject(e)}),a=new lT(i instanceof Ty?function(e,t){const i=function(e){let t=!1;const i=[];for(const n of e)if(n instanceof fy)if(t=!0,n.orderings.some(e=>e.expr instanceof jv&&e.expr.fieldName===hc))i.push(n);else{const e=n.orderings.map(e=>e);e.push(Yv(hc).ascending()),i.push(new fy(e,{}))}else n instanceof uy?(t||(i.push(new fy([Yv(hc).ascending()],{})),t=!0),i.push(n)):i.push(n);return t||i.push(new fy([Yv(hc).ascending()],{})),i}(e.stages);if(e.userDataReader){const t=e.userDataReader.createContext(3,"toCorePipeline");i.forEach(e=>e._readUserData(t))}return new gy(e.userDataReader.serializer,i,t)}(i):i,s,{includeMetadataChanges:!0,waitForSyncWhenOnline:!0});return tT(e,a)}(await QT(e),e.asyncQueue,t,i,n)),n.promise}function ZT(e,t){const i=new Gu;return e.asyncQueue.enqueueAndForget(async()=>async function(e,t,i){const n=BT(e);try{const e=await function(e,t){const i=ju(e),n=Ec.now(),r=t.reduce((e,t)=>e.add(t.key),cm());let s,a;return i.persistence.runTransaction("Locally write mutations","readwrite",e=>{let o=im(),l=cm();return i.Qo.getEntries(e,r).next(e=>{o=e,o.forEach((e,t)=>{t.isValidDocument()||(l=l.add(e))})}).next(()=>i.localDocuments.getOverlayedDocuments(e,o)).next(r=>{s=r;const a=[];for(const e of t){const t=Kf(e,s.get(e.key).overlayedDocument);null!=t&&a.push(new Zf(e.key,t,wf(t.value.mapValue),jf.exists(!0)))}
2return i.mutationQueue.addMutationBatch(e,n,a,t)}).next(t=>{a=t;const n=t.applyToLocalDocumentSet(s,l);return i.documentOverlayCache.saveOverlays(e,t.batchId,n)})}).then(()=>({batchId:a.batchId,changes:sm(s)}))}(n.localStore,t);n.sharedClientState.addPendingMutation(e.batchId),function(e,t,i){let n=e.oc[e.currentUser.toKey()];n||(n=new yd(nc)),n=n.insert(t,i),e.oc[e.currentUser.toKey()]=n}(n,e.batchId,i),await IT(n,e.changes),await Iw(n.remoteStore)}catch(e){const t=qw(e,"Failed to persist write");i.reject(t)}}(await KT(e),t,i)),i.promise}const $T="AsyncQueue";class e_{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Promise.resolve();this.qc=[],this.$c=!1,this.Kc=[],this.Wc=null,this.Qc=!1,this.Gc=!1,this.zc=[],this.xn=new Ng(this,"async_queue_retry"),this.jc=()=>{const e=fw();e&&Du($T,"Visibility state changed to "+e.visibilityState),this.xn.gn()},this.Hc=e;const t=fw();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.jc)}get isShuttingDown(){return this.$c}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Jc(),this.Yc(e)}enterRestrictedMode(e){if(!this.$c){this.$c=!0,this.Gc=e||!1;const t=fw();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.jc)}}enqueue(e){if(this.Jc(),this.$c)return new Promise(()=>{});const t=new Gu;return this.Yc(()=>this.$c&&this.Gc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.qc.push(e),this.Zc()))}async Zc(){if(0!==this.qc.length){try{await this.qc[0](),this.qc.shift(),this.xn.reset()}catch(oT){if(!Bc(oT))throw oT;Du($T,"Operation failed with retryable error: "+oT)}this.qc.length>0&&this.xn.mn(()=>this.Zc())}}Yc(e){const t=this.Hc.then(()=>(this.Qc=!0,e().catch(e=>{throw this.Wc=e,this.Qc=!1,Fu("INTERNAL UNHANDLED ERROR: ",t_(e)),e}).then(e=>(this.Qc=!1,e))));return this.Hc=t,t}enqueueAfterDelay(e,t,i){this.Jc(),this.zc.indexOf(e)>-1&&(t=0);const n=Xw.createAndSchedule(this,e,t,i,e=>this.Xc(e));return this.Kc.push(n),n}Jc(){this.Wc&&zu(47125,{el:t_(this.Wc)})}verifyOperationInProgress(){}async tl(){let e;do{e=this.Hc,await e}while(e!==this.Hc)}nl(e){for(const t of this.Kc)if(t.timerId===e)return!0;return!1}rl(e){return this.tl().then(()=>{this.Kc.sort((e,t)=>e.targetTimeMs-t.targetTimeMs);for(const t of this.Kc)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.tl()})}il(e){this.zc.push(e)}Xc(e){const t=this.Kc.indexOf(e);this.Kc.splice(t,1)}}function t_(e){let t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}class i_ extends nv{constructor(e,t,i,n){super(e,t,i,n),this.type="firestore",this._queue=new e_,this._persistenceKey=(null===n||void 0===n?void 0:n.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new e_(e),this._firestoreClient=void 0,await e}}}function n_(e){if(e._terminated)throw new Wu(Yu.FAILED_PRECONDITION,"The client has already been terminated.");return e._firestoreClient||r_(e),e._firestoreClient}function r_(e){var t,i,n,r;const s=e._freezeSettings(),a=jg(e._databaseId,(null===(t=e._app)||void 0===t?void 0:t.options.appId)||"",e._persistenceKey,null===(i=e._app)||void 0===i?void 0:i.options.apiKey,s);e._componentsProvider||null!==(n=s.localCache)&&void 0!==n&&n._offlineComponentProvider&&null!==(r=s.localCache)&&void 0!==r&&r._onlineComponentProvider&&(e._componentsProvider={_offline:s.localCache._offlineComponentProvider,_online:s.localCache._onlineComponentProvider}),e._firestoreClient=new YT(e._authCredentials,e._appCheckCredentials,e._queue,a,e._componentsProvider&&function(e){const t=null===e||void 0===e?void 0:e._online.build();return{_offline:null===e||void 0===e?void 0:e._offline.build(t),_online:t}}(e._componentsProvider))}class s_{convertValue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";switch(Zd(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Md(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(Nd(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw zu(62114,{value:e})}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";const i={};return Ed(e,(e,n)=>{i[e]=this.convertValue(n,t)}),i}convertVectorValue(e){var t;const i=null===(t=e.fields)||void 0===t||null===(t=t[qd].arrayValue)||void 0===t||null===(t=t.values)||void 0===t?void 0:t.map(e=>Md(e.doubleValue));return new hv(i)}convertGeoPoint(e){return new yg(Md(e.latitude),Md(e.longitude))}convertArray(e,t){return(e.values||[]).map(e=>this.convertValue(e,t))}convertServerTimestamp(e,t){switch(t){case"previous":const i=Ud(e);return null==i?null:this.convertValue(i,t);case"estimate":return this.convertTimestamp(zd(e));default:return null}}convertTimestamp(e){const t=Pd(e);return new Ec(t.seconds,t.nanos)}convertDocumentKey(e,t){const i=cc.fromString(e);Hu(ug(i),9688,{name:e});const n=new jd(i.get(1),i.get(3)),r=new pc(i.popFirst(5));return n.isEqual(t)||Fu("Document ".concat(r," contains a document reference within a different database (").concat(n.projectId,"/").concat(n.database,") which is not supported. It will be treated as a reference in the current database (").concat(t.projectId,"/").concat(t.database,") instead.")),r}}class a_ extends s_{constructor(e){super(),this.firestore=e}convertBytes(e){return new mg(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);
2return new sv(this.firestore,null,t)}}const o_="@firebase/firestore",l_="4.16.0";function h_(e){return function(e,t){if("object"!=typeof e||null===e)return!1;const i=e;for(const n of t)if(n in i&&"function"==typeof i[n])return!0;return!1}(e,["next","error","complete"])}class u_{constructor(e,t,i,n,r){this._firestore=e,this._userDataWriter=t,this._key=i,this._document=n,this._converter=r}get id(){return this._key.path.lastSegment()}get ref(){return new sv(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new c_(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}_fieldsProto(){var e,t;return null!==(e=null===(t=this._document)||void 0===t?void 0:t.data.clone().value.mapValue.fields)&&void 0!==e?e:void 0}get(e){if(this._document){const t=this._document.data.field(Av("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class c_ extends u_{data(){return super.data()}}function d_(e){if("L"===e.limitType&&0===e.explicitOrderBy.length)throw new Wu(Yu.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class f_{}class p_ extends f_{}function m_(e,t){let i=[];for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];t instanceof f_&&i.push(t),i=i.concat(r),function(e){const t=e.filter(e=>e instanceof v_).length,i=e.filter(e=>e instanceof g_).length;if(t>1||t>0&&i>0)throw new Wu(Yu.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(i);for(const a of i)e=a._apply(e);return e}class g_ extends p_{constructor(e,t,i){super(),this._field=e,this._op=t,this._value=i,this.type="where"}static _create(e,t,i){return new g_(e,t,i)}_apply(e){const t=this._parse(e);return S_(e._query,t),new rv(e.firestore,e.converter,Hp(e._query,t))}_parse(e){const t=gv(e.firestore),i=function(e,t,i,n,r,s,a){let o;if(r.isKeyField()){if("array-contains"===s||"array-contains-any"===s)throw new Wu(Yu.INVALID_ARGUMENT,"Invalid Query. You can't perform '".concat(s,"' queries on documentId()."));if("in"===s||"not-in"===s){__(a,s);const t=[];for(const i of a)t.push(T_(n,e,i));o={arrayValue:{values:t}}}else o=T_(n,e,a)}else"in"!==s&&"not-in"!==s&&"array-contains-any"!==s||__(a,s),o=Tv(i,t,a,"in"===s||"not-in"===s);return lp.create(r,s,o)}(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value);return i}}class v_ extends f_{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new v_(e,t)}_parse(e){const t=this._queryConstraints.map(t=>t._parse(e)).filter(e=>e.getFilters().length>0);return 1===t.length?t[0]:hp.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return 0===t.getFilters().length?e:(function(e,t){let i=e;const n=t.getFlattenedFilters();for(const r of n)S_(i,r),i=Hp(i,r)}(e._query,t),new rv(e.firestore,e.converter,Hp(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return"and"===this.type?"and":"or"}}class y_ extends p_{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new y_(e,t)}_apply(e){const t=function(e,t,i){if(null!==e.startAt)throw new Wu(Yu.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new Wu(Yu.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new Sp(t,i)}(e._query,this._field,this._direction);return new rv(e.firestore,e.converter,function(e,t){const i=e.explicitOrderBy.concat([t]);return new Np(e.path,e.collectionGroup,i,e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(e._query,t))}}function x_(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asc",i=Av("orderBy",e);return y_._create(i,t)}class b_ extends p_{constructor(e,t,i){super(),this.type=e,this._limit=t,this._limitType=i}static _create(e,t,i){return new b_(e,t,i)}_apply(e){return new rv(e.firestore,e.converter,jp(e._query,this._limit,this._limitType))}}function w_(e){return function(e,t){if(t<=0)throw new Wu(Yu.INVALID_ARGUMENT,"Function ".concat(e,"() requires a positive number, but it was: ").concat(t,"."))}("limit",e),b_._create("limit",e,"F")}function T_(e,t,i){if("string"==typeof(i=hr(i))){if(""===i)throw new Wu(Yu.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!Bp(t)&&-1!==i.indexOf("/"))throw new Wu(Yu.INVALID_ARGUMENT,"Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '".concat(i,"' contains a '/' character."));const n=t.path.child(cc.fromString(i));if(!pc.isDocumentKey(n))throw new Wu(Yu.INVALID_ARGUMENT,"Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '".concat(n,"' is not because it has an odd number of segments (").concat(n.length,")."));return lf(e,new pc(n))}if(i instanceof sv)return lf(e,i._key);throw new Wu(Yu.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ".concat(xc(i),"."))}function __(e,t){if(!Array.isArray(e)||0===e.length)throw new Wu(Yu.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '".concat(t.toString(),"' filters."))}function S_(e,t){const i=function(e,t){for(const i of e)for(const e of i.getFlattenedFilters())if(t.indexOf(e.op)>=0)return e.op;return null}(e.filters,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==i)throw i===t.op?new Wu(Yu.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '".concat(t.op.toString(),"' filter.")):new Wu(Yu.INVALID_ARGUMENT,"Invalid query. You cannot use '".concat(t.op.toString(),"' filters with '").concat(i.toString(),"' filters."))}function E_(e,t,i){let n;return n=e?i&&(i.merge||i.mergeFields)?e.toFirestore(t,i):e.toFirestore(t):t,n}class C_{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class A_ extends u_{constructor(e,t,i,n,r,s){super(e,t,i,n,s),this._firestore=e,this._firestoreImpl=e,this.metadata=r}exists(){return super.exists()}data(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._document){if(this._converter){const t=new k_(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._document){const i=this._document.data.field(Av("DocumentSnapshot.get",e));if(null!==i)return this._userDataWriter.convertValue(i,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new Wu(Yu.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,t={};return t.type=A_._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),e&&e.isValidDocument()&&e.isFoundDocument()?(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),t.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),t):t}}A_._jsonSchemaVersion="firestore/documentSnapshot/1.0",A_._jsonSchema={type:wc("string",A_._jsonSchemaVersion),bundleSource:wc("string","DocumentSnapshot"),bundleName:wc("string"),bundle:wc("string")};class k_ extends A_{data(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return super.data(e)}}class R_{constructor(e,t,i,n){this._firestore=e,this._userDataWriter=t,this._snapshot=n,this.metadata=new C_(n.hasPendingWrites,n.fromCache),this.query=i}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(i=>
2{e.call(t,new k_(this._firestore,this._userDataWriter,i.key,i,new C_(this._snapshot.mutatedKeys.has(i.key),this._snapshot.fromCache),this.query.converter))})}docChanges(){const e=!!(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new Wu(Yu.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){let t=0;return e._snapshot.docChanges.map(i=>{db(e._snapshot.query)?Mb(e._snapshot.query):Xp(e.query._query);const n=new k_(e._firestore,e._userDataWriter,i.doc.key,i.doc,new C_(e._snapshot.mutatedKeys.has(i.doc.key),e._snapshot.fromCache),e.query.converter);return i.doc,{type:"added",doc:n,oldIndex:-1,newIndex:t++}})}{let i=e._snapshot.oldDocs;return e._snapshot.docChanges.filter(e=>t||3!==e.type).map(t=>{const n=new k_(e._firestore,e._userDataWriter,t.doc.key,t.doc,new C_(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter);let r=-1,s=-1;return 0!==t.type&&(r=i.indexOf(t.doc.key),i=i.delete(t.doc.key)),1!==t.type&&(i=i.add(t.doc),s=i.indexOf(t.doc.key)),{type:O_(t.type),doc:n,oldIndex:r,newIndex:s}})}}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new Wu(Yu.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=R_._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=ic.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const t=[],i=[],n=[];return this.docs.forEach(e=>{null!==e._document&&(t.push(e._document),i.push(this._userDataWriter.convertObjectMap(e._document.data.value.mapValue.fields,"previous")),n.push(e.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function O_(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return zu(61501,{type:e})}}R_._jsonSchemaVersion="firestore/querySnapshot/1.0",R_._jsonSchema={type:wc("string",R_._jsonSchemaVersion),bundleSource:wc("string","QuerySnapshot"),bundleName:wc("string"),bundle:wc("string")};function P_(e){e=bc(e,sv);const t=bc(e.firestore,i_);return function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=new Gu;return e.asyncQueue.enqueueAndForget(async()=>function(e,t,i,n,r){const s=new HT({next:o=>{s.gc(),t.enqueueAndForget(()=>iT(e,a));const l=o.docs.has(i);!l&&o.fromCache?r.reject(new Wu(Yu.UNAVAILABLE,"Failed to get document because the client is offline.")):l&&o.fromCache&&n&&"server"===n.source?r.reject(new Wu(Yu.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):r.resolve(o)},error:e=>r.reject(e)}),a=new lT(Lp(i.path),s,{includeMetadataChanges:!0,waitForSyncWhenOnline:!0});return tT(e,a)}(await QT(e),e.asyncQueue,t,i,n)),n.promise}(n_(t),e._key).then(i=>D_(t,e,i))}function M_(e){e=bc(e,rv);const t=bc(e.firestore,i_),i=n_(t),n=new a_(t);return d_(e._query),JT(i,e._query).then(i=>new R_(t,n,e,i))}function N_(e,t,i){e=bc(e,sv);const n=bc(e.firestore,i_),r=gv(n);let s;for(var a=arguments.length,o=new Array(a>3?a-3:0),l=3;l<a;l++)o[l-3]=arguments[l];return s="string"==typeof(t=hr(t))||t instanceof gg?wv(r,"updateDoc",e._key,t,i,o):bv(r,"updateDoc",e._key,t),L_(n,[s.toMutation(e._key,jf.exists(!0))])}function I_(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];e=hr(e);let r={includeMetadataChanges:!1,source:"default"},s=0;"object"!=typeof i[s]||h_(i[s])||(r=i[s++]);const a={includeMetadataChanges:r.includeMetadataChanges,source:r.source};if(h_(i[s])){var o,l,h;const e=i[s];i[s]=null===(o=e.next)||void 0===o?void 0:o.bind(e),i[s+1]=null===(l=e.error)||void 0===l?void 0:l.bind(e),i[s+2]=null===(h=e.complete)||void 0===h?void 0:h.bind(e)}let u,c,d;if(e instanceof sv)c=bc(e.firestore,i_),d=Lp(e._key.path),u={next:t=>{i[s]&&i[s](D_(c,e,t))}
2,error:i[s+1],complete:i[s+2]};else{const t=bc(e,rv);c=bc(t.firestore,i_),d=t._query;const n=new a_(c);u={next:e=>{i[s]&&i[s](new R_(c,n,t,e))},error:i[s+1],complete:i[s+2]},d_(e._query)}return function(e,t,i,n){const r=new HT(n),s=new lT(t,r,i);return e.asyncQueue.enqueueAndForget(async()=>tT(await QT(e),s)),()=>{r.gc(),e.asyncQueue.enqueueAndForget(async()=>iT(await QT(e),s))}}(n_(c),d,a,u)}function L_(e,t){return ZT(n_(e),t)}function D_(e,t,i){const n=i.docs.get(t._key),r=new a_(e);return new A_(e,r,t._key,n,new C_(i.hasPendingWrites,i.fromCache),t.converter)}new WeakMap;!function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];(function(e){Nu=e})(As),Ts(new dr("firestore",(e,i)=>{let n=i.instanceIdentifier,r=i.options;const s=e.getProvider("app").getImmediate(),a=new i_(new Qu(e.getProvider("auth-internal")),new ec(s,e.getProvider("app-check-internal")),function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new Wu(Yu.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new jd(e.options.projectId,t)}(s,n),s);return r=m({useFetchStreams:t},r),a._setSettings(r),a},"PUBLIC").setMultipleInstances(!0)),Os(o_,l_,e),Os(o_,l_,"esm2020")}();const F_="@firebase/installations",B_="0.6.22",U_=1e4,z_="w:".concat(B_),V_="FIS_v2",H_=36e5,j_=new jn("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function Y_(e){return e instanceof Hn&&e.code.includes("request-failed")}function W_(e){let t=e.projectId;return"".concat("https://firebaseinstallations.googleapis.com/v1","/projects/").concat(t,"/installations")}function G_(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function X_(e,t){const i=(await t.json()).error;return j_.create("request-failed",{requestName:e,serverCode:i.code,serverMessage:i.message,serverStatus:i.status})}function q_(e){let t=e.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function K_(e,t){let i=t.refreshToken;const n=q_(e);return n.append("Authorization",function(e){return"".concat(V_," ").concat(e)}(i)),n}async function Q_(e){const t=await e();return t.status>=500&&t.status<600?e():t}function J_(e){return new Promise(t=>{setTimeout(t,e)})}const Z_=/^[cdef][\w-]{21}$/;function $_(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const t=function(e){const t=function(e){return btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_")}(e);return t.substr(0,22)}(e);return Z_.test(t)?t:""}catch(e){return""}}function eS(e){return"".concat(e.appName,"!").concat(e.appId)}const tS=new Map;function iS(e,t){const i=eS(e);nS(i,t),function(e,t){const i=sS();i&&i.postMessage({key:e,fid:t});aS()}(i,t)}function nS(e,t){const i=tS.get(e);if(i)for(const n of i)n(t)}let rS=null;function sS(){return!rS&&"BroadcastChannel"in self&&(rS=new BroadcastChannel("[Firebase] FID Change"),rS.onmessage=e=>{nS(e.data.key,e.data.fid)}),rS}function aS(){0===tS.size&&rS&&(rS.close(),rS=null)}const oS="firebase-installations-store";let lS=null;function hS(){return lS||(lS=Lr("firebase-installations-database",1,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(oS)}})),lS}async function uS(e,t){const i=eS(e),n=(await hS()).transaction(oS,"readwrite"),r=n.objectStore(oS),s=await r.get(i);return await r.put(t,i),await n.done,s&&s.fid===t.fid||iS(e,t.fid),t}async function cS(e){const t=eS(e),i=(await hS()).transaction(oS,"readwrite");await i.objectStore(oS).delete(t),await i.done}async function dS(e,t){const i=eS(e),n=(await hS()).transaction(oS,"readwrite"),r=n.objectStore(oS),s=await r.get(i),a=t(s);return void 0===a?await r.delete(i):await r.put(a,i),await n.done,!a||s&&s.fid===a.fid||iS(e,a.fid),a}async function fS(e){let t;const i=await dS(e.appConfig,i=>{const n=function(e){const t=e||{fid:$_(),registrationStatus:0};return gS(t)}(i),r=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine){return{installationEntry:t,registrationPromise:Promise.reject(j_.create("app-offline"))}}const i={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=async function(e,t){try{const i=await async function(e,t){let i=e.appConfig,n=e.heartbeatServiceProvider,r=t.fid;const s=W_(i),a=q_(i),o=n.getImmediate({optional:!0});if(o){const e=await o.getHeartbeatsHeader();e&&a.append("x-firebase-client",e)}const l={fid:r,authVersion:V_,appId:i.appId,sdkVersion:z_},h={method:"POST",headers:a,body:JSON.stringify(l)},u=await Q_(()=>fetch(s,h));if(u.ok){const e=await u.json();return{fid:e.fid||r,registrationStatus:2,refreshToken:e.refreshToken,authToken:G_(e.authToken)}}throw await X_("Create Installation",u)}(e,t);return uS(e.appConfig,i)}catch(oT){throw Y_(oT)&&409===oT.customData.serverCode?await cS(e.appConfig):await uS(e.appConfig,{fid:t.fid,registrationStatus:0}),oT}}(e,i);return{installationEntry:i,registrationPromise:n}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:pS(e)}:{installationEntry:t}}(e,n);return t=r.registrationPromise,r.installationEntry});return""===i.fid?{installationEntry:await t}:{installationEntry:i,registrationPromise:t}}async function pS(e){let t=await mS(e.appConfig);for(;1===t.registrationStatus;)await J_(100),t=await mS(e.appConfig);if(0===t.registrationStatus){const t=await fS(e),i=t.installationEntry,n=t.registrationPromise;return n||i}return t}function mS(e){return dS(e,e=>{if(!e)throw j_.create("installation-not-found");return gS(e)})}function gS(e){return 1===(t=e).registrationStatus&&t.registrationTime+U_<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}async function vS(e,t){let i=e.appConfig,n=e.heartbeatServiceProvider;const r=function(e,t){let i=t.fid;return"".concat(W_(e),"/").concat(i,"/authTokens:generate")}(i,t),s=K_(i,t),a=n.getImmediate({optional:!0});if(a){const e=await a.getHeartbeatsHeader();e&&s.append("x-firebase-client",e)}const o={installation:{sdkVersion:z_,appId:i.appId}},l={method:"POST",headers:s,body:JSON.stringify(o)},h=await Q_(()=>fetch(r,l));if(h.ok){return G_(await h.json())}throw await X_("Generate Auth Token",h)}async function yS(e){let t,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=await dS(e.appConfig,n=>{if(!bS(n))throw j_.create("not-registered");const r=n.authToken;if(!i&&function(e){return 2===e.requestStatus&&!function(e){const t=Date.now();
2return t<e.creationTime||e.creationTime+e.expiresIn<t+H_}(e)}(r))return n;if(1===r.requestStatus)return t=async function(e,t){let i=await xS(e.appConfig);for(;1===i.authToken.requestStatus;)await J_(100),i=await xS(e.appConfig);const n=i.authToken;return 0===n.requestStatus?yS(e,t):n}(e,i),n;{if(!navigator.onLine)throw j_.create("app-offline");const i=function(e){const t={requestStatus:1,requestTime:Date.now()};return m(m({},e),{},{authToken:t})}(n);return t=async function(e,t){try{const i=await vS(e,t),n=m(m({},t),{},{authToken:i});return await uS(e.appConfig,n),i}catch(oT){if(!Y_(oT)||401!==oT.customData.serverCode&&404!==oT.customData.serverCode){const i=m(m({},t),{},{authToken:{requestStatus:0}});await uS(e.appConfig,i)}else await cS(e.appConfig);throw oT}}(e,i),i}});return t?await t:n.authToken}function xS(e){return dS(e,e=>{if(!bS(e))throw j_.create("not-registered");const t=e.authToken;return 1===(i=t).requestStatus&&i.requestTime+U_<Date.now()?m(m({},e),{},{authToken:{requestStatus:0}}):e;var i})}function bS(e){return void 0!==e&&2===e.registrationStatus}async function wS(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=e;await async function(e){const t=await fS(e),i=t.registrationPromise;i&&await i}(i);return(await yS(i,t)).token}function TS(e){return j_.create("missing-app-config-values",{valueName:e})}const _S="installations",SS=e=>{const t=e.getProvider("app").getImmediate(),i=function(e){if(!e||!e.options)throw TS("App Configuration");if(!e.name)throw TS("App Name");const t=["projectId","apiKey","appId"];for(const i of t)if(!e.options[i])throw TS(i);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:i,heartbeatServiceProvider:_s(t,"heartbeat"),_delete:()=>Promise.resolve()}},ES=e=>{const t=_s(e.getProvider("app").getImmediate(),_S).getImmediate();return{getId:()=>async function(e){const t=e,i=await fS(t),n=i.installationEntry,r=i.registrationPromise;return r?r.catch(console.error):yS(t).catch(console.error),n.fid}(t),getToken:e=>wS(t,e)}};Ts(new dr(_S,SS,"PUBLIC")),Ts(new dr("installations-internal",ES,"PRIVATE")),Os(F_,B_),Os(F_,B_,"esm2020");const CS="analytics",AS="https://www.googletagmanager.com/gtag/js",kS=new Tr("@firebase/analytics"),RS=new jn("analytics","Analytics",{"already-exists":"A Firebase Analytics instance with the appId {$id}  already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"no-client-id":'The "client_id" field is empty.',"invali
2d-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."});function OS(e){if(!e.startsWith(AS)){const t=RS.create("invalid-gtag-resource",{gtagURL:e});return kS.warn(t.message),""}return e}function PS(e){return Promise.all(e.map(e=>e.catch(e=>e)))}function MS(e,t){const i=function(e,t){let i;return window.trustedTypes&&(i=window.trustedTypes.createPolicy(e,t)),i}("firebase-js-sdk-policy",{createScriptURL:OS}),n=document.createElement("script"),r="".concat(AS,"?l=").concat(e,"&id=").concat(t);n.src=i?null===i||void 0===i?void 0:i.createScriptURL(r):r,n.async=!0,document.head.appendChild(n)}function NS(e,t,i,n){return async function(r){try{for(var s=arguments.length,a=new Array(s>1?s-1:0),o=1;o<s;o++)a[o-1]=arguments[o];if("event"===r){const n=a[0],r=a[1];await async function(e,t,i,n,r){try{let s=[];if(r&&r.send_to){let e=r.send_to;Array.isArray(e)||(e=[e]);const n=await PS(i);for(const i of e){const e=n.find(e=>e.measurementId===i),r=e&&t[e.appId];if(!r){s=[];break}s.push(r)}}0===s.length&&(s=Object.values(t)),await Promise.all(s),e("event",n,r||{})}catch(oT){kS.error(oT)}}(e,t,i,n,r)}else if("config"===r){const r=a[0],s=a[1];await async function(e,t,i,n,r,s){const a=n[r];try{if(a)await t[a];else{const e=(await PS(i)).find(e=>e.measurementId===r);e&&await t[e.appId]}}catch(oT){kS.error(oT)}e("config",r,s)}(e,t,i,n,r,s)}else if("consent"===r){const t=a[0],i=a[1];e("consent",t,i)}else if("get"===r){const t=a[0],i=a[1],n=a[2];e("get",t,i,n)}else if("set"===r){const t=a[0];e("set",t)}else e(r,...a)}catch(oT){kS.error(oT)}}}const IS=new class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;this.throttleMetadata=e,this.intervalMillis=t}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,t){this.throttleMetadata[e]=t}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}};function LS(e){return new Headers({Accept:"application/json","x-goog-api-key":e})}async function DS(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:IS,i=arguments.length>2?arguments[2]:void 0;
2const n=e.options,r=n.appId,s=n.apiKey,a=n.measurementId;if(!r)throw RS.create("no-app-id");if(!s){if(a)return{measurementId:a,appId:r};throw RS.create("no-api-key")}const o=t.getThrottleMetadata(r)||{backoffCount:0,throttleEndTimeMillis:Date.now()},l=new BS;return setTimeout(async()=>{l.abort()},void 0!==i?i:6e4),FS({appId:r,apiKey:s,measurementId:a},o,l,t)}async function FS(e,t,i){let n=t.throttleEndTimeMillis,r=t.backoffCount,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:IS;const a=e.appId,o=e.measurementId;try{await function(e,t){return new Promise((i,n)=>{const r=Math.max(t-Date.now(),0),s=setTimeout(i,r);e.addEventListener(()=>{clearTimeout(s),n(RS.create("fetch-throttle",{throttleEndTimeMillis:t}))})})}(i,n)}catch(oT){if(o)return kS.warn("Timed out fetching this Firebase app's measurement ID from the server."+" Falling back to the measurement ID ".concat(o)+' provided in the "measurementId" field in the local Firebase config. ['.concat(null===oT||void 0===oT?void 0:oT.message,"]")),{appId:a,measurementId:o};throw oT}try{const t=await async function(e){const t=e.appId,i={method:"GET",headers:LS(e.apiKey)},n="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",t),r=await fetch(n,i);if(200!==r.status&&304!==r.status){let e="";try{var s;const t=await r.json();null!==(s=t.error)&&void 0!==s&&s.message&&(e=t.error.message)}catch(a){}throw RS.create("config-fetch-failed",{httpStatus:r.status,responseMessage:e})}return r.json()}(e);return s.deleteThrottleMetadata(a),t}catch(oT){var l;const n=oT;if(!function(e){if(!(e instanceof Hn)||!e.customData)return!1;const t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(n)){if(s.deleteThrottleMetadata(a),o)return kS.warn("Failed to fetch this Firebase app's measurement ID from the server."+" Falling back to the measurement ID ".concat(o)+' provided in the "measurementId" field in the local Firebase config. ['.concat(null===n||void 0===n?void 0:n.message,"]")),{appId:a,measurementId:o};throw oT}const h=503===Number(null===n||void 0===n||null===(l=n.customData)||void 0===l?void 0:l.httpStatus)?lr(r,s.intervalMillis,30):lr(r,s.intervalMillis),u={throttleEndTimeMillis:Date.now()+h,backoffCount:r+1};return s.setThrottleMetadata(a,u),kS.debug("Calling attemptFetch again in ".concat(h," millis")),FS(e,u,i,s)}}class BS{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}let US,zS;function VS(e){zS=e}function HS(e){US=e}async function jS(e,t,i,n,r,s,a){var o;const l=DS(e);l.then(t=>{i[t.measurementId]=t.appId,e.options.measurementId&&t.measurementId!==e.options.measurementId&&kS.warn("The measurement ID in the local Firebase config (".concat(e.options.measurementId,")")+" does not match the measurement ID fetched from the server (".concat(t.measurementId,").")+" To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.")}).catch(e=>kS.error(e)),t.push(l);const h=async function(){if(!Un())return kS.warn(RS.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await zn()}catch(oT){return kS.warn(RS.create("indexeddb-unavailable",{errorInfo:null===oT||void 0===oT?void 0:oT.toString()}).message),!1}return!0}().then(e=>e?n.getId():void 0),c=u(await Promise.all([l,h]),2),d=c[0],f=c[1];(function(e){const t=window.document.getElementsByTagName("script");for(const i of Object.values(t))if(i.src&&i.src.includes(AS)&&i.src.includes(e))return i;return null})(s)||MS(s,d.measurementId),zS&&(r("consent","default",zS),VS(void 0)),r("js",new Date);const p=null!==(o=null===a||void 0===a?void 0:a.config)&&void 0!==o?o:{};return p.origin="firebase",p.update=!0,null!=f&&(p.firebase_id=f),r("config",d.measurementId,p),US&&(r("set",US),HS(void 0)),d.measurementId}class YS{constructor(e){this.app=e}_delete(){return delete WS[this.app.options.appId],Promise.resolve()}}let WS={},GS=[];const XS={};let qS,KS,QS="dataLayer",JS="gtag",ZS=!1;function $S(e,t,i){!function(){const e=[];
2if(Ln()&&e.push("This is a browser extension environment."),Vn()||e.push("Cookies are not available."),e.length>0){const t=e.map((e,t)=>"(".concat(t+1,") ").concat(e)).join(" "),i=RS.create("invalid-analytics-context",{errorInfo:t});kS.warn(i.message)}}();const n=e.options.appId;if(!n)throw RS.create("no-app-id");if(!e.options.apiKey){if(!e.options.measurementId)throw RS.create("no-api-key");kS.warn('The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest'+" measurement ID for this Firebase app. Falling back to the measurement ID ".concat(e.options.measurementId)+' provided in the "measurementId" field in the local Firebase config.')}if(null!=WS[n])throw RS.create("already-exists",{id:n});if(!ZS){!function(e){let t=[];Array.isArray(window[e])?t=window[e]:window[e]=t}(QS);const e=function(e,t,i,n,r){let s=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];window[n].push(arguments)};return window[r]&&"function"===typeof window[r]&&(s=window[r]),window[r]=NS(s,e,t,i),{gtagCore:s,wrappedGtag:window[r]}}(WS,GS,XS,QS,JS),t=e.wrappedGtag,i=e.gtagCore;KS=t,qS=i,ZS=!0}WS[n]=jS(e,GS,XS,t,qS,QS,i);return new YS(e)}function eE(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rs();e=hr(e);const t=_s(e,CS);return t.isInitialized()?t.getImmediate():function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=_s(e,CS);if(i.isInitialized()){const e=i.getImmediate();if(Zn(t,i.getOptions()))return e;throw RS.create("already-initialized")}const n=i.initialize({options:t});return n}(e)}function tE(e,t,i){e=hr(e),async function(e,t,i,n){if(n&&n.global){const t={};for(const e of Object.keys(i))t["user_properties.".concat(e)]=i[e];return e("set",t),Promise.resolve()}e("config",await t,{update:!0,user_properties:i})}(KS,WS[e.app.options.appId],t,i).catch(e=>kS.error(e))}function iE(e,t,i,n){e=hr(e),async function(e,t,i,n,r){if(r&&r.global)e("event",i,n);else{const r=await t;e("event",i,m(m({},n),{},{send_to:r}))}}(KS,WS[e.app.options.appId],t,i,n).catch(e=>kS.error(e))}const nE="@firebase/analytics",rE="0.10.22";Ts(new dr(CS,(e,t)=>{let i=t.options;return $S(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),i)},"PUBLIC")),Ts(new dr("analytics-internal",function(e){try{const t=e.getProvider(CS).getImmediate();return{logEvent:(e,i,n)=>iE(t,e,i,n),setUserProperties:(e,i)=>tE(t,e,i)}}catch(oT){throw RS.create("interop-component-reg-failed",{reason:oT})}},"PRIVATE")),Os(nE,rE),Os(nE,rE,"esm2020");const sE="@firebase/database",aE="1.1.3";let oE="";function lE(e){oE=e}class hE{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,t){null==t?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),Gn(t))}get(e){const t=this.domStorage_.getItem(this.prefixedName_(e));return null==t?null:Wn(t)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}}class uE{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,t){null==t?delete this.cache_[e]:this.cache_[e]=t}get(e){return qn(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}}const cE=function(e){try{if("undefined"!==typeof window&&"undefined"!==typeof window[e]){const t=window[e];return t.setItem("firebase:sentinel","cache"),t.removeItem("firebase:sentinel"),new hE(t)}}catch(oT){}return new uE},dE=cE("localStorage"),fE=cE("sessionStorage"),pE=new Tr("@firebase/database"),mE=function(){let e=1;return function(){return e++}}(),gE=function(e){const t=function(e){const t=[];let i=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=55296&&r<=56319){const t=r-55296;n++,fn(n<e.length,"Surrogate pair missing trail surrogate."),r=65536+(t<<10)+(e.charCodeAt(n)-56320)}r<128?t[i++]=r:r<2048?(t[i++]=r>>6|192,t[i++]=63&r|128):r<65536?(t[i++]=r>>12|224,t[i++]=r>>6&63|128,t[i++]=63&r|128):(t[i++]=r>>18|240,t[i++]=r>>12&63|128,t[i++]=r>>6&63|128,t[i++]=63&r|128)}return t}(e),i=new nr;i.update(t);const n=i.digest();return gn.encodeByteArray(n)},vE=function(){let e="";for(let t=0;t<arguments.length;t++){const i=t<0||arguments.length<=t?void 0:arguments[t];Array.isArray(i)||i&&"object"===typeof i&&"number"===typeof i.length?e+=vE.apply(null,i):e+="object"===typeof i?Gn(i):i,e+=" "}return e};let yE=null,xE=!0;const bE=function(e,t){fn(!t||!0===e||!1===e,"Can't turn on custom loggers persistently."),!0===e?(pE.logLevel=vr.VERBOSE,yE=pE.log.bind(pE),t&&fE.set("logging_enabled",!0)):"function"===typeof e?yE=e:(yE=null,fE.remove("logging_enabled"))},wE=function(){if(!0===xE&&(xE=!1,null===yE&&!0===fE.get("logging_enabled")&&bE(!0)),yE){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=vE.apply(null,t);yE(n)}},TE=function(e){return function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];wE(e,...i)}},_E=function(){const e="FIREBASE INTERNAL ERROR: "+vE(...arguments);pE.error(e)},SE=function(){const e="FIREBASE FATAL ERROR: ".concat(vE(...arguments));throw pE.error(e),new Error(e)},EE=function(){const e="FIREBASE WARNING: "+vE(...arguments);pE.warn(e)},CE=function(e){return"number"===typeof e&&(e!==e||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY)},AE="[MIN_NAME]",kE="[MAX_NAME]",RE=function(e,t){if(e===t)return 0;if(e===AE||t===kE)return-1;if(t===AE||e===kE)return 1;{const i=FE(e),n=FE(t);return null!==i?null!==n?i-n===0?e.length-t.length:i-n:-1:null!==n?1:e<t?-1:1}},OE=function(e,t){return e===t?0:e<t?-1:1},PE=function(e,t){if(t&&e in t)return t[e];throw new Error("Missing required key ("+e+") in object: "+Gn(t))},ME=function(e){if("object"!==typeof e||null===e)return Gn(e);const t=[];for(const n in e)t.push(n);
2t.sort();let i="{";for(let n=0;n<t.length;n++)0!==n&&(i+=","),i+=Gn(t[n]),i+=":",i+=ME(e[t[n]]);return i+="}",i},NE=function(e,t){const i=e.length;if(i<=t)return[e];const n=[];for(let r=0;r<i;r+=t)r+t>i?n.push(e.substring(r,i)):n.push(e.substring(r,r+t));return n};function IE(e,t){for(const i in e)e.hasOwnProperty(i)&&t(i,e[i])}const LE=function(e){fn(!CE(e),"Invalid JSON number");const t=1023;let i,n,r,s,a;0===e?(n=0,r=0,i=1/e===-1/0?1:0):(i=e<0,(e=Math.abs(e))>=Math.pow(2,-1022)?(s=Math.min(Math.floor(Math.log(e)/Math.LN2),t),n=s+t,r=Math.round(e*Math.pow(2,52-s)-Math.pow(2,52))):(n=0,r=Math.round(e/Math.pow(2,-1074))));const o=[];for(a=52;a;a-=1)o.push(r%2?1:0),r=Math.floor(r/2);for(a=11;a;a-=1)o.push(n%2?1:0),n=Math.floor(n/2);o.push(i?1:0),o.reverse();const l=o.join("");let h="";for(a=0;a<64;a+=8){let e=parseInt(l.substr(a,8),2).toString(16);1===e.length&&(e="0"+e),h+=e}return h.toLowerCase()};const DE=new RegExp("^-?(0*)\\d{1,10}$"),FE=function(e){if(DE.test(e)){const t=Number(e);if(t>=-2147483648&&t<=2147483647)return t}return null},BE=function(e){try{e()}catch(oT){setTimeout(()=>{const t=oT.stack||"";throw EE("Exception was thrown by user callback.",t),oT},Math.floor(0))}},UE=function(e,t){const i=setTimeout(e,t);return"number"===typeof i&&"undefined"!==typeof Deno&&Deno.unrefTimer?Deno.unrefTimer(i):"object"===typeof i&&i.unref&&i.unref(),i};class zE{constructor(e,t){this.appCheckProvider=t,this.appName=e.name,Ss(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.appCheck=null===t||void 0===t?void 0:t.getImmediate({optional:!0}),this.appCheck||null===t||void 0===t||t.get().then(e=>this.appCheck=e)}getToken(e){if(this.serverAppAppCheckToken){if(e)throw new Error("Attempted reuse of `FirebaseServerApp.appCheckToken` after previous usage failed.");return Promise.resolve({token:this.serverAppAppCheckToken})}return this.appCheck?this.appCheck.getToken(e):new Promise((t,i)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(t,i):t(null)},0)})}addTokenChangeListener(e){var t;null===(t=this.appCheckProvider)||void 0===t||t.get().then(t=>t.addTokenListener(e))}notifyForInvalidToken(){EE('Provided AppCheck credentials for the app named "'.concat(this.appName,'" ')+"are invalid. This usually indicates your app was not initialized correctly.")}}class VE{constructor(e,t,i){this.appName_=e,this.firebaseOptions_=t,this.authProvider_=i,this.auth_=null,this.auth_=i.getImmediate({optional:!0}),this.auth_||i.onInit(e=>this.auth_=e)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(e=>e&&"auth/token-not-initialized"===e.code?(wE("Got auth/token-not-initialized error.  Treating as null token."),null):Promise.reject(e)):new Promise((t,i)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(t,i):t(null)},0)})}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(t=>t.addAuthTokenListener(e))}removeTokenChangeListener(e){this.authProvider_.get().then(t=>t.removeAuthTokenListener(e))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',EE(e)}}class HE{constructor(e){this.accessToken=e}getToken(e){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(e){e(this.accessToken)}removeTokenChangeListener(e){}notifyForInvalidToken(){}}HE.OWNER="owner";const jE="5",YE=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,WE="ac",GE="websocket",XE="long_polling";class qE{constructor(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",a=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7&&void 0!==arguments[7]&&arguments[7],l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null;this.secure=t,this.namespace=i,this.webSocketOnly=n,this.nodeAdmin=r,this.persistenceKey=s,this.includeNamespaceInQueryParams=a,this.isUsingEmulator=o,this.emulatorOptions=l,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=dE.get("host:"+e)||this._host}isCacheableHost(){return"s-"===this.internalHost.substr(0,2)}isCustomHost(){return"firebaseio.com"!==this._domain&&"firebaseio-demo.com"!==this._domain}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&dE.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){const e=this.secure?"https://":"http://",t=this.includeNamespaceInQueryParams?"?ns=".concat(this.namespace):"";return"".concat(e).concat(this.host,"/").concat(t)}}function KE(e,t,i){let n;if(fn("string"===typeof t,"typeof type must == string"),fn("object"===typeof i,"typeof params must == object"),t===GE)n=(e.secure?"wss://":"ws://")+e.internalHost+"/.ws?";else{if(t!==XE)throw new Error("Unknown connection type: "+t);n=(e.secure?"https://":"http://")+e.internalHost+"/.lp?"}(function(e){return e.host!==e.internalHost||e.isCustomHost()||e.includeNamespaceInQueryParams})(e)&&(i.ns=e.namespace);const r=[];return IE(i,(e,t)=>{r.push(e+"="+t)}
2),n+r.join("&")}class QE{constructor(){this.counters_={}}incrementCounter(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;qn(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t}get(){return wn(this.counters_)}}const JE={},ZE={};function $E(e){const t=e.toString();return JE[t]||(JE[t]=new QE),JE[t]}class eC{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)}handleResponse(e,t){for(this.pendingResponses[e]=t;this.pendingResponses[this.currentResponseNum];){const e=this.pendingResponses[this.currentResponseNum];delete this.pendingResponses[this.currentResponseNum];for(let t=0;t<e.length;++t)e[t]&&BE(()=>{this.onMessage_(e[t])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}}const tC="start";class iC{constructor(e,t,i,n,r,s,a){this.connId=e,this.repoInfo=t,this.applicationId=i,this.appCheckToken=n,this.authToken=r,this.transportSessionId=s,this.lastSessionId=a,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=TE(e),this.stats_=$E(t),this.urlFn=e=>(this.appCheckToken&&(e[WE]=this.appCheckToken),KE(t,XE,e))}open(e,t){var i=this;this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new eC(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(3e4)),function(e){if(Fn()||"complete"===document.readyState)e();else{let t=!1;const i=function(){document.body?t||(t=!0,e()):setTimeout(i,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",i,!1),window.addEventListener("load",i,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&i()}),window.attachEvent("onload",i))}}(()=>{if(this.isClosed_)return;this.scriptTagHolder=new nC(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t[0],s=t[1],a=t[2];t[3],t[4];if(i.incrementIncomingBytes_(t),i.scriptTagHolder)if(i.connectTimeoutTimer_&&(clearTimeout(i.connectTimeoutTimer_),i.connectTimeoutTimer_=null),i.everConnected_=!0,r===tC)i.id=s,i.password=a;else{if("close"!==r)throw new Error("Unrecognized command received: "+r);s?(i.scriptTagHolder.sendNewPolls=!1,i.myPacketOrderer.closeAfter(s,()=>{i.onClosed_()})):i.onClosed_()}},function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t[0],s=t[1];i.incrementIncomingBytes_(t),i.myPacketOrderer.handleResponse(r,s)},()=>{this.onClosed_()},this.urlFn);const e={};e[tC]="t",e.ser=Math.floor(1e8*Math.random()),this.scriptTagHolder.uniqueCallbackIdentifier&&(e.cb=this.scriptTagHolder.uniqueCallbackIdentifier),e.v=jE,this.transportSessionId&&(e.s=this.transportSessionId),this.lastSessionId&&(e.ls=this.lastSessionId),this.applicationId&&(e.p=this.applicationId),this.appCheckToken&&(e[WE]=this.appCheckToken),"undefined"!==typeof location&&location.hostname&&YE.test(location.hostname)&&(e.r="f");const t=this.urlFn(e);this.log_("Connecting via long-poll to "+t),this.scriptTagHolder.addTag(t,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){iC.forceAllow_=!0}static forceDisallow(){iC.forceDisallow_=!0}static isAvailable(){return!Fn()&&(!!iC.forceAllow_||!iC.forceDisallow_&&"undefined"!==typeof document&&null!=document.createElement&&!("object"===typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))&&!("object"===typeof Windows&&"object"===typeof Windows.UI))}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){const t=Gn(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);const i=yn(t),n=NE(i,1840);for(let r=0;r<n.length;r++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,n.length,n[r]),this.curSegmentNum++}addDisconnectPingFrame(e,t){if(Fn())return;this.myDisconnFrame=document.createElement("iframe");const i={dframe:"t"};i.id=e,i.pw=t,this.myDisconnFrame.src=this.urlFn(i),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}incrementIncomingBytes_(e){const t=Gn(e).length;this.bytesReceived+=t,this.stats_.incrementCounter("bytes_received",t)}}class nC{constructor(e,t,i,n){if(this.onDisconnect=i,this.urlFn=n,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0,Fn())this.commandCB=e,this.onMessageCB=t;else{this.uniqueCallbackIdentifier=mE(),window["pLPCommand"+this.uniqueCallbackIdentifier]=e,window["pRTLPCB"+this.uniqueCallbackIdentifier]=t,this.myIFrame=nC.createIFrame_();let i="";if(this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,11)){i='<script>document.domain="'+document.domain+'";<\/script>'}const n="<html><body>"+i+"</body></html>";
2try{this.myIFrame.doc.open(),this.myIFrame.doc.write(n),this.myIFrame.doc.close()}catch(oT){wE("frame writing exception"),oT.stack&&wE(oT.stack),wE(oT)}}}static createIFrame_(){const e=document.createElement("iframe");if(e.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(e);try{e.contentWindow.document||wE("No IE domain setting required")}catch(oT){const i=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+i+"';document.close();})())"}return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout(()=>{null!==this.myIFrame&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));const e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;const e={};e.id=this.myID,e.pw=this.myPW,e.ser=this.currentSerial;let t=this.urlFn(e),i="",n=0;for(;this.pendingSegs.length>0;){if(!(this.pendingSegs[0].d.length+30+i.length<=1870))break;{const e=this.pendingSegs.shift();i=i+"&seg"+n+"="+e.seg+"&ts"+n+"="+e.ts+"&d"+n+"="+e.d,n++}}return t+=i,this.addLongPollTag_(t,this.currentSerial),!0}return!1}enqueueSegment(e,t,i){this.pendingSegs.push({seg:e,ts:t,d:i}),this.alive&&this.newRequest_()}addLongPollTag_(e,t){this.outstandingRequests.add(t);const i=()=>{this.outstandingRequests.delete(t),this.newRequest_()},n=setTimeout(i,Math.floor(25e3));this.addTag(e,()=>{clearTimeout(n),i()})}addTag(e,t){Fn()?this.doNodeLongPoll(e,t):setTimeout(()=>{try{if(!this.sendNewPolls)return;const i=this.myIFrame.doc.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){const e=i.readyState;e&&"loaded"!==e&&"complete"!==e||(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),t())},i.onerror=()=>{wE("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(i)}catch(oT){}},Math.floor(1))}}let rC=null;"undefined"!==typeof MozWebSocket?rC=MozWebSocket:"undefined"!==typeof WebSocket&&(rC=WebSocket);class sC{constructor(e,t,i,n,r,s,a){this.connId=e,this.applicationId=i,this.appCheckToken=n,this.authToken=r,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=TE(this.connId),this.stats_=$E(t),this.connURL=sC.connectionURL_(t,s,a,n,i),this.nodeAdmin=t.nodeAdmin}static connectionURL_(e,t,i,n,r){const s={};return s.v=jE,!Fn()&&"undefined"!==typeof location&&location.hostname&&YE.test(location.hostname)&&(s.r="f"),t&&(s.s=t),i&&(s.ls=i),n&&(s[WE]=n),r&&(s.p=r),KE(e,GE,s)}open(e,t){this.onDisconnect=t,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,dE.set("previous_websocket_failure",!0);try{let e;if(Fn()){const t=this.nodeAdmin?"AdminNode":"Node";e={headers:{"User-Agent":"Firebase/".concat(jE,"/").concat(oE,"/").concat(process.platform,"/").concat(t),"X-Firebase-GMPID":this.applicationId||""}},this.authToken&&(e.headers.Authorization="Bearer ".concat(this.authToken)),this.appCheckToken&&(e.headers["X-Firebase-AppCheck"]=this.appCheckToken);
vendor: 6,831 bytes, line 2
2const i={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0},n=0===this.connURL.indexOf("wss://")?i.HTTPS_PROXY||i.https_proxy:i.HTTP_PROXY||i.http_proxy;n&&(e.proxy={origin:n})}this.mySock=new rC(this.connURL,[],e)}catch(oT){this.log_("Error instantiating WebSocket.");const t=oT.message||oT.data;return t&&this.log_(t),void this.onClosed_()}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=e=>{this.handleIncomingFrame(e)},this.mySock.onerror=e=>{this.log_("WebSocket error.  Closing connection.");const t=e.message||e.data;t&&this.log_(t),this.onClosed_()}}start(){}static forceDisallow(){sC.forceDisallow_=!0}static isAvailable(){let e=!1;if("undefined"!==typeof navigator&&navigator.userAgent){const t=/Android ([0-9]{0,}\.[0-9]{0,})/,i=navigator.userAgent.match(t);i&&i.length>1&&parseFloat(i[1])<4.4&&(e=!0)}return!e&&null!==rC&&!sC.forceDisallow_}static previouslyFailed(){return dE.isInMemoryStorage||!0===dE.get("previous_websocket_failure")}markConnectionHealthy(){dE.remove("previous_websocket_failure")}appendFrame_(e){if(this.frames.push(e),this.frames.length===this.totalFrames){const e=this.frames.join("");this.frames=null;const t=Wn(e);this.onMessage(t)}}handleNewFrameCount_(e){this.totalFrames=e,this.frames=[]}extractFrameCount_(e){if(fn(null===this.frames,"We already have a frame buffer"),e.length<=6){const t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e}handleIncomingFrame(e){if(null===this.mySock)return;const t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(t);else{const e=this.extractFrameCount_(t);null!==e&&this.appendFrame_(e)}}send(e){this.resetKeepAlive();const t=Gn(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);const i=NE(t,16384);i.length>1&&this.sendString_(String(i.length));for(let n=0;n<i.length;n++)this.sendString_(i[n])}shutdown_(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)}onClosed_(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))}close(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())}resetKeepAlive(){clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(()=>{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(45e3))}sendString_(e){try{this.mySock.send(e)}catch(oT){this.log_("Exception thrown from WebSocket.send():",oT.message||oT.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}sC.responsesRequiredToBeHealthy=2,sC.healthyTimeout=3e4;class aC{static get ALL_TRANSPORTS(){return[iC,sC]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(e){this.initTransports_(e)}initTransports_(e){const t=sC&&sC.isAvailable();let i=t&&!sC.previouslyFailed();if(e.webSocketOnly&&(t||EE("wss:// URL used, but browser isn't known to support websockets.  Trying anyway."),i=!0),i)this.transports_=[sC];else{const e=this.transports_=[];for(const t of aC.ALL_TRANSPORTS)t&&t.isAvailable()&&e.push(t);aC.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}aC.globalTransportInitialized_=!1;class oC{constructor(e,t,i,n,r,s,a,o,l,h){this.id=e,this.repoInfo_=t,this.applicationId_=i,this.appCheckToken_=n,this.authToken_=r,this.onMessage_=s,this.onReady_=a,this.onDisconnect_=o,this.onKill_=l,this.lastSessionId=h,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=TE("c:"+this.id+":"),this.transportManager_=new aC(t),this.log_("Connection created"),this.start_()}start_(){const e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const t=this.connReceiver_(this.conn_),i=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(t,i)},Math.floor(0));const n=e.healthyTimeout||0;n>0&&(this.healthyTimeout_=UE(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>102400?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes.  Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>10240?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes.  Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(n)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return t=>{e===this.conn_?this.onConnectionLost_(t):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return t=>{2!==this.state_&&(e===this.rx_?this.onPrimaryMessageReceived_(t):e===this.secondaryConn_?this.onSecondaryMessageReceived_(t):this.log_("message on old connection"))}}sendRequest(e){const t={t:"d",d:e};this.sendData_(t)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if("t"in e){const t=e.t;"a"===t?this.upgradeIfSecondaryHealthy_():"r"===t?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===t&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){const t=PE("t",e),i=PE("d",e);if("c"===t)this.onSecondaryControl_(i);else{if("d"!==t)throw new Error("Unknown protocol layer: "+t);this.pendingDataMessages.push(i)}}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t
vendor: 4,399 bytes, line 2
2:"c",d:{t:"p",d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){const t=PE("t",e),i=PE("d",e);"c"===t?this.onControl_(i):"d"===t&&this.onDataMessage_(i)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){const t=PE("t",e);if("d"in e){const i=e.d;if("h"===t){const e=m({},i);this.repoInfo_.isUsingEmulator&&(e.h=this.repoInfo_.host),this.onHandshake_(e)}else if("n"===t){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let e=0;e<this.pendingDataMessages.length;++e)this.onDataMessage_(this.pendingDataMessages[e]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===t?this.onConnectionShutdown_(i):"r"===t?this.onReset_(i):"e"===t?_E("Server Error: "+i):"o"===t?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):_E("Unknown control packet command: "+t)}}onHandshake_(e){const t=e.ts,i=e.v,n=e.h;this.sessionId=e.s,this.repoInfo_.host=n,0===this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,t),jE!==i&&EE("Protocol version mismatch detected"),this.tryStartUpgrade_())}tryStartUpgrade_(){const e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)}startUpgrade_(e){this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const t=this.connReceiver_(this.secondaryConn_),i=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(t,i),UE(()=>{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(6e4))}onReset_(e){this.log_("Reset packet received.  New host: "+e),this.repoInfo_.host=e,1===this.state_?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,t){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):UE(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(5e3))}sendPingOnPrimaryIfNecessary_(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))}onSecondaryConnectionLost_(){const e=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==e&&this.rx_!==e||this.close()}onConnectionLost_(e){this.conn_=null,e||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(dE.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(e)}close(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}}class lC{put(e,t,i,n){}merge(e,t,i,n){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,t,i){}onDisconnectMerge(e,t,i){}onDisconnectCancel(e,t){}reportStats(e){}}class hC{constructor(e){this.allowedEvents_=e,this.listeners_={},fn(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e){if(Array.isArray(this.listeners_[e])){const r=[...this.listeners_[e]];for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];for(let e=0;e<r.length;
vendor: 13,269 bytes, line 2
2e++)r[e].callback.apply(r[e].context,i)}}on(e,t,i){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:t,context:i});const n=this.getInitialEvent(e);n&&t.apply(i,n)}off(e,t,i){this.validateEventType_(e);const n=this.listeners_[e]||[];for(let r=0;r<n.length;r++)if(n[r].callback===t&&(!i||i===n[r].context))return void n.splice(r,1)}validateEventType_(e){fn(this.allowedEvents_.find(t=>t===e),"Unknown event: "+e)}}class uC extends hC{static getInstance(){return new uC}constructor(){super(["online"]),this.online_=!0,"undefined"===typeof window||"undefined"===typeof window.addEventListener||Nn()||(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}getInitialEvent(e){return fn("online"===e,"Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}}class cC{constructor(e,t){if(void 0===t){this.pieces_=e.split("/");let t=0;for(let e=0;e<this.pieces_.length;e++)this.pieces_[e].length>0&&(this.pieces_[t]=this.pieces_[e],t++);this.pieces_.length=t,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}toString(){let e="";for(let t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+this.pieces_[t]);return e||"/"}}function dC(){return new cC("")}function fC(e){return e.pieceNum_>=e.pieces_.length?null:e.pieces_[e.pieceNum_]}function pC(e){return e.pieces_.length-e.pieceNum_}function mC(e){let t=e.pieceNum_;return t<e.pieces_.length&&t++,new cC(e.pieces_,t)}function gC(e){return e.pieceNum_<e.pieces_.length?e.pieces_[e.pieces_.length-1]:null}function vC(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.pieces_.slice(e.pieceNum_+t)}function yC(e){if(e.pieceNum_>=e.pieces_.length)return null;const t=[];for(let i=e.pieceNum_;i<e.pieces_.length-1;i++)t.push(e.pieces_[i]);return new cC(t,0)}function xC(e,t){const i=[];for(let n=e.pieceNum_;n<e.pieces_.length;n++)i.push(e.pieces_[n]);if(t instanceof cC)for(let n=t.pieceNum_;n<t.pieces_.length;n++)i.push(t.pieces_[n]);else{const e=t.split("/");for(let t=0;t<e.length;t++)e[t].length>0&&i.push(e[t])}return new cC(i,0)}function bC(e){return e.pieceNum_>=e.pieces_.length}function wC(e,t){const i=fC(e),n=fC(t);if(null===i)return t;if(i===n)return wC(mC(e),mC(t));throw new Error("INTERNAL ERROR: innerPath ("+t+") is not within outerPath ("+e+")")}function TC(e,t){const i=vC(e,0),n=vC(t,0);for(let r=0;r<i.length&&r<n.length;r++){const e=RE(i[r],n[r]);if(0!==e)return e}return i.length===n.length?0:i.length<n.length?-1:1}function _C(e,t){if(pC(e)!==pC(t))return!1;for(let i=e.pieceNum_,n=t.pieceNum_;i<=e.pieces_.length;i++,n++)if(e.pieces_[i]!==t.pieces_[n])return!1;return!0}function SC(e,t){let i=e.pieceNum_,n=t.pieceNum_;if(pC(e)>pC(t))return!1;for(;i<e.pieces_.length;){if(e.pieces_[i]!==t.pieces_[n])return!1;++i,++n}return!0}class EC{constructor(e,t){this.errorPrefix_=t,this.parts_=vC(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(let i=0;i<this.parts_.length;i++)this.byteLength_+=or(this.parts_[i]);CC(this)}}function CC(e){if(e.byteLength_>768)throw new Error(e.errorPrefix_+"has a key path longer than 768 bytes ("+e.byteLength_+").");if(e.parts_.length>32)throw new Error(e.errorPrefix_+"path specified exceeds the maximum depth that can be written (32) or object contains a cycle "+AC(e))}function AC(e){return 0===e.parts_.length?"":"in property '"+e.parts_.join(".")+"'"}class kC extends hC{static getInstance(){return new kC}constructor(){let e,t;super(["visible"]),"undefined"!==typeof document&&"undefined"!==typeof document.addEventListener&&("undefined"!==typeof document.hidden?(t="visibilitychange",e="hidden"):"undefined"!==typeof document.mozHidden?(t="mozvisibilitychange",e="mozHidden"):"undefined"!==typeof document.msHidden?(t="msvisibilitychange",e="msHidden"):"undefined"!==typeof document.webkitHidden&&(t="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,t&&document.addEventListener(t,()=>{const t=!document[e];t!==this.visible_&&(this.visible_=t,this.trigger("visible",t))},!1)}getInitialEvent(e){return fn("visible"===e,"Unknown event type: "+e),[this.visible_]}}const RC=1e3;class OC extends lC{constructor(e,t,i,n,r,s,a,o){if(super(),this.repoInfo_=e,this.applicationId_=t,this.onDataUpdate_=i,this.onConnectStatus_=n,this.onServerInfoUpdate_=r,this.authTokenProvider_=s,this.appCheckTokenProvider_=a,this.authOverride_=o,this.id=OC.nextPersistentConnectionId_++,this.log_=TE("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=RC,this.maxReconnectDelay_=3e5,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,o&&!Fn())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");kC.getInstance().on("visible",this.onVisible_,this),-1===e.host.indexOf("fblocal")&&uC.getInstance().on("online",this.onOnline_,this)}sendRequest(e,t,i){const n=++this.requestNumber_,r={r:n,a:e,b:t};this.log_(Gn(r)),fn(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(r),i&&(this.requestCBHash_[n]=i)}get(e){this.initConnection_();const t=new On,i={action:"g",request:{p:e._path.toString(),q:e._queryObject},onComplete:e=>{const i=e.d;"ok"===e.s?t.resolve(i):t.reject(i)}};this.outstandingGets_.push(i),this.outstandingGetCount_++;const n=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(n),t.promise}listen(e,t,i,n){this.initConnection_();const r=e._queryIdentifier,s=e._path.toString();this.log_("Listen called for "+s+" "+r),this.listens.has(s)||this.listens.set(s,new Map),fn(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),fn(!this.listens.get(s).has(r),"listen() called twice for same path/queryId.");const a={onComplete:n,hashFn:t,query:e,tag:i};this.listens.get(s).set(r,a),this.connected_&&this.sendListen_(a)}sendGet_(e){const t=this.outstandingGets_[e];this.sendRequest("g",t.request,i=>{delete this.outstandingGets_[e],this.outstandingGetCount_--,0===this.outstandingGetCount_&&(this.outstandingGets_=[]),t.onComplete&&t.onComplete(i)})}sendListen_(e){const t=e.query,i=t._path.toString(),n=t._queryIdentifier;this.log_("Listen on "+i+" for "+n);const r={p:i};e.tag&&(r.q=t._queryObject,r.t=e.tag),r.h=e.hashFn(),this.sendRequest("q",r,r=>{const s=r.d,a=r.s;OC.warnOnListenWarnings_(s,t);(this.listens.get(i)&&this.listens.get(i).get(n))===e&&(this.log_("listen response",r),"ok"!==a&&this.removeListen_(i,n),e.onComplete&&e.onComplete(a,s))})}static warnOnListenWarnings_(e,t){if(e&&"object"===typeof e&&qn(e,"w")){const i=Kn(e,"w");if(Array.isArray(i)&&~i.indexOf("no_index")){const e='".indexOn": "'+t._queryParams.getIndex().toString()+'"',i=t._path.toString();EE("Using an unspecified index. Your data will be downloaded and "+"filtered on the client. Consider adding ".concat(e," at ")+"".concat(i," to your security rules for better performance."))}}}refreshAuthToken(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(e)}reduceReconnectDelayIfAdminCredential_(e){(e&&40===e.length||function(e){const t=Xn(e).claims;return"object"===typeof t&&!0===t.admin}(e))&&(this.log_("Admin auth credential detected.  Reducing max reconnect time."),this.maxReconnectDelay_=3e4)}refreshAppCheckToken(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){const e=this.authToken_,t=function(e){const t=Xn(e).claims;return!!t&&"object"===typeof t&&t.hasOwnProperty("iat")}(e)?"auth":"gauth",i={cred:e};null===this.authOverride_?i.noauth=!0:"object"===typeof this.authOverride_&&(i.authvar=this.authOverride_),this.sendRequest(t,i,t=>{const i=t.s,n=t.d||"error";this.authToken_===e&&("ok"===i?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(i,n))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},e=>{const t=e.s,i=e.d||"error";"ok"===t?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(t,i)})}unlisten(e,t){const i=e._path.toString(),n=e._queryIdentifier;this.log_("Unlisten called for "+i+" "+n),fn(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query");this.removeListen_(i,n)&&this.connected_&&this.sendUnlisten_(i,n,e._queryObject,t)}sendUnlisten_(e,t,i,n){this.log_("Unlisten on "+e+" for "+t);const r={p:e};n&&(r.q=i,r.t=n),this.sendRequest("n",r)}onDisconnectPut(e,t,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,t,i):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:i})}onDisconnectMerge(e,t,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,t,i):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:i})}onDisconnectCancel(e,t){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})}sendOnDisconnect_(e,t,i,n){const r={p:t,d:i};this.log_("onDisconnect "+e,r),this.sendRequest(e,r,e=>{n&&setTimeout(()=>{n(e.s,e.d)},Math.floor(0))})}put(e,t,i,n){this.putInternal("p",e,t,i,n)}merge(e,t,i,n){this.putInternal("m",e,t,i,n)}putInternal(e,t,i,n,r){this.initConnection_();const s={p:t,d:i};void 0!==r&&(s.h=r),this.outstandingPuts_.push({action:e,request:s,onComplete:n}),this.outstandingPutCount_++;const a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+t)}sendPut_(e){const t=this.outstandingPuts_[e].action,i=this.outstandingPuts_[e].request,n=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(t,i,i=>{this.log_(t+" response",i),delete this.outstandingPuts_[e],this.outstandingPutCount_--,0===this.outstandingPutCount_&&(this.outstandingPuts_=[]),n&&n(i.s,i.d)})}reportStats(e){if(this.connected_){const t={c:e};this.log_("reportStats",t),this.sendRequest("s",t,e=>{if("ok"!==e.s){const t=e.d;this.log_("reportStats","Error sending stats: "+t)}})}}onDataMessage_(e){if("r"in e){this.log_("from server: "+Gn(e));const t=e.r,i=this.requestCBHash_[t];i&&(delete this.requestCBHash_[t],i(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}}onDataPush_(e,t){this.log_("handleServerMessage",e,t),"d"===e?this.onDataUpdate_(t.p,t.d,!1,t.t):"m"===e?this.onDataUpdate_(t.p,t.d,!0,t.t):"c"===e?this.onListenRevoked_(t.p,t.q):"ac"===e?this.onAuthRevoked_(t.s,t.d):"apc"===e?this.onAppCheckRevoked_(t.s,t.d):"sd"===e?this.onSecurityDebugPacket_(t):_E("Unrecognized action received from server: "+Gn(e)+"\nAre you using the latest client?")}onReady_(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){fn(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible.  Reducing delay."),this.reconnectDelay_=RC,this.realtime_||this.scheduleConnect_(0)),this.visible_=e}onOnline_(e){e?(this.log_("Browser went online."),this.reconnectDelay_=RC,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline.  Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){(new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=RC),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible.  Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();const e=Math.max(0,(new Date).getTime()-this.lastConnectionAttemptTime_);let t=Math.max(0,this.reconnectDelay_-e);
2t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;const e=this.onDataMessage_.bind(this),t=this.onReady_.bind(this),i=this.onRealtimeDisconnect_.bind(this),n=this.id+":"+OC.nextConnectionId_++,r=this.lastSessionId;let s=!1,a=null;const o=function(){a?a.close():(s=!0,i())},l=function(e){fn(a,"sendRequest call when we're not connected not allowed."),a.sendRequest(e)};this.realtime_={close:o,sendRequest:l};const h=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const o=u(await Promise.all([this.authTokenProvider_.getToken(h),this.appCheckTokenProvider_.getToken(h)]),2),l=o[0],c=o[1];s?wE("getToken() completed but was canceled"):(wE("getToken() completed. Creating connection."),this.authToken_=l&&l.accessToken,this.appCheckToken_=c&&c.token,a=new oC(n,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,t,i,e=>{EE(e+" ("+this.repoInfo_.toString()+")"),this.interrupt("server_kill")},r))}catch(_E){this.log_("Failed to get token: "+_E),s||(this.repoInfo_.nodeAdmin&&EE(_E),o())}}}interrupt(e){wE("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(e){wE("Resuming connection for reason: "+e),delete this.interruptReasons_[e],Qn(this.interruptReasons_)&&(this.reconnectDelay_=RC,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(e){const t=e-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:t})}cancelSentTransactions_(){for(let e=0;e<this.outstandingPuts_.length;e++){const t=this.outstandingPuts_[e];t&&"h"in t.request&&t.queued&&(t.onComplete&&t.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])}onListenRevoked_(e,t){let i;i=t?t.map(e=>ME(e)).join("$"):"default";const n=this.removeListen_(e,i);n&&n.onComplete&&n.onComplete("permission_denied")}removeListen_(e,t){const i=new cC(e).toString();let n;if(this.listens.has(i)){const e=this.listens.get(i);n=e.get(t),e.delete(t),0===e.size&&this.listens.delete(i)}else n=void 0;return n}onAuthRevoked_(e,t){wE("Auth token revoked: "+e+"/"+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(e,t){wE("App check token revoked: "+e+"/"+t),this.appCheckToken_=null,this.forceTokenRefresh_=!0,"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=3&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace("\n","\nFIREBASE: "))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of this.listens.values())for(const t of e.values())this.sendListen_(t);for(let e=0;e<this.outstandingPuts_.length;e++)this.outstandingPuts_[e]&&this.sendPut_(e);for(;this.onDisconnectRequestQueue_.length;){const e=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(e.action,e.pathString,e.data,e.onComplete)}for(let e=0;e<this.outstandingGets_.length;e++)this.outstandingGets_[e]&&this.sendGet_(e)}sendConnectStats_(){const e={};let t="js";Fn()&&(t=this.repoInfo_.nodeAdmin?"admin_node":"node"),e["sdk."+t+"."+oE.replace(/\./g,"-")]=1,Nn()?e["framework.cordova"]=1:Dn()&&(e["framework.reactnative"]=1),this.reportStats(e)}shouldReconnect_(){const e=uC.getInstance().currentlyOnline();return Qn(this.interruptReasons_)&&e}}OC.nextPersistentConnectionId_=0,OC.nextConnectionId_=0;class PC{constructor(e,t){this.name=e,this.node=t}static Wrap(e,t){return new PC(e,t)}}class MC{getCompare(){return this.compare.bind(this)}indexedValueChanged(e,t){const i=new PC(AE,e),n=new PC(AE,t);return 0!==this.compare(i,n)}
vendor: 13,358 bytes, line 2
2minPost(){return PC.MIN}}let NC;class IC extends MC{static get __EMPTY_NODE(){return NC}static set __EMPTY_NODE(e){NC=e}compare(e,t){return RE(e.name,t.name)}isDefinedOn(e){throw pn("KeyIndex.isDefinedOn not expected to be called.")}indexedValueChanged(e,t){return!1}minPost(){return PC.MIN}maxPost(){return new PC(kE,NC)}makePost(e,t){return fn("string"===typeof e,"KeyIndex indexValue must always be a string."),new PC(e,NC)}toString(){return".key"}}const LC=new IC;class DC{constructor(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;this.isReverse_=n,this.resultGenerator_=r,this.nodeStack_=[];let s=1;for(;!e.isEmpty();)if(s=t?i(e.key,t):1,n&&(s*=-1),s<0)e=this.isReverse_?e.left:e.right;else{if(0===s){this.nodeStack_.push(e);break}this.nodeStack_.push(e),e=this.isReverse_?e.right:e.left}}getNext(){if(0===this.nodeStack_.length)return null;let e,t=this.nodeStack_.pop();if(e=this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value},this.isReverse_)for(t=t.left;!t.isEmpty();)this.nodeStack_.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack_.push(t),t=t.left;return e}hasNext(){return this.nodeStack_.length>0}peek(){if(0===this.nodeStack_.length)return null;const e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}}class FC{constructor(e,t,i,n,r){this.key=e,this.value=t,this.color=null!=i?i:FC.RED,this.left=null!=n?n:BC.EMPTY_NODE,this.right=null!=r?r:BC.EMPTY_NODE}copy(e,t,i,n,r){return new FC(null!=e?e:this.key,null!=t?t:this.value,null!=i?i:this.color,null!=n?n:this.left,null!=r?r:this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,i){let n=this;const r=i(e,n.key);return n=r<0?n.copy(null,null,null,n.left.insert(e,t,i),null):0===r?n.copy(null,t,null,null,null):n.copy(null,null,null,null,n.right.insert(e,t,i)),n.fixUp_()}removeMin_(){if(this.left.isEmpty())return BC.EMPTY_NODE;let e=this;return e.left.isRed_()||e.left.left.isRed_()||(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()}remove(e,t){let i,n;if(i=this,t(e,i.key)<0)i.left.isEmpty()||i.left.isRed_()||i.left.left.isRed_()||(i=i.moveRedLeft_()),i=i.copy(null,null,null,i.left.remove(e,t),null);else{if(i.left.isRed_()&&(i=i.rotateRight_()),i.right.isEmpty()||i.right.isRed_()||i.right.left.isRed_()||(i=i.moveRedRight_()),0===t(e,i.key)){if(i.right.isEmpty())return BC.EMPTY_NODE;n=i.right.min_(),i=i.copy(n.key,n.value,null,null,i.right.removeMin_())}i=i.copy(null,null,null,null,i.right.remove(e,t))}return i.fixUp_()}isRed_(){return this.color}fixUp_(){let e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e}moveRedLeft_(){let e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e}moveRedRight_(){let e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e}rotateLeft_(){const e=this.copy(null,null,FC.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight_(){const e=this.copy(null,null,FC.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip_(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth_(){const e=this.check_();return Math.pow(2,e)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");const e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)}}FC.RED=!0,FC.BLACK=!1;class BC{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:BC.EMPTY_NODE;this.comparator_=e,this.root_=t}insert(e,t){return new BC(this.comparator_,this.root_.insert(e,t,this.comparator_).copy(null,null,FC.BLACK,null,null))}remove(e){return new BC(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,FC.BLACK,null,null))}get(e){let t,i=this.root_;for(;!i.isEmpty();){if(t=this.comparator_(e,i.key),0===t)return i.value;t<0?i=i.left:t>0&&(i=i.right)}return null}getPredecessorKey(e){let t,i=this.root_,n=null;for(;!i.isEmpty();){if(t=this.comparator_(e,i.key),0===t){if(i.left.isEmpty())return n?n.key:null;for(i=i.left;!i.right.isEmpty();)i=i.right;return i.key}t<0?i=i.left:t>0&&(n=i,i=i.right)}throw new Error("Attempted to find predecessor key for a nonexistent key.  What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new DC(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,t){return new DC(this.root_,e,this.comparator_,!1,t)}getReverseIteratorFrom(e,t){return new DC(this.root_,e,this.comparator_,!0,t)}getReverseIterator(e){return new DC(this.root_,null,this.comparator_,!0,e)}}function UC(e,t){return RE(e.name,t.name)}function zC(e,t){return RE(e,t)}let VC;BC.EMPTY_NODE=new class{copy(e,t,i,n,r){return this}insert(e,t,i){return new FC(e,t,null)}remove(e,t){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}};const HC=function(e){return"number"===typeof e?"number:"+LE(e):"string:"+e},jC=function(e){if(e.isLeafNode()){const t=e.val();fn("string"===typeof t||"number"===typeof t||"object"===typeof t&&qn(t,".sv"),"Priority must be a string or number.")}else fn(e===VC||e.isEmpty(),"priority of unexpected type.");fn(e===VC||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};let YC,WC,GC;class XC{static set __childrenNodeConstructor(e){YC=e}static get __childrenNodeConstructor(){return YC}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:XC.__childrenNodeConstructor.EMPTY_NODE;this.value_=e,this.priorityNode_=t,this.lazyHash_=null,fn(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),jC(this.priorityNode_)}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(e){return new XC(this.value_,e)}getImmediateChild(e){return".priority"===e?this.priorityNode_:XC.__childrenNodeConstructor.EMPTY_NODE}getChild(e){return bC(e)?this:".priority"===fC(e)?this.priorityNode_:XC.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(e,t){return null}updateImmediateChild(e,t){return".priority"===e?this.updatePriority(t):t.isEmpty()&&".priority"!==e?this:XC.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,t).updatePriority(this.priorityNode_)}updateChild(e,t){const i=fC(e);return null===i?t:t.isEmpty()&&".priority"!==i?this:(fn(".priority"!==i||1===pC(e),".priority must be the last token in a path"),this.updateImmediateChild(i,XC.__childrenNodeConstructor.EMPTY_NODE.updateChild(mC(e),t)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(e,t){return!1}val(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(null===this.lazyHash_){let e="";this.priorityNode_.isEmpty()||(e+="priority:"+HC(this.priorityNode_.val())+":");const t=typeof this.value_;e+=t+":",e+="number"===t?LE(this.value_):this.value_,this.lazyHash_=gE(e)}return this.lazyHash_}getValue(){return this.value_}compareTo(e){return e===XC.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof XC.__childrenNodeConstructor?-1:(fn(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))}compareToLeafNode_(e){const t=typeof e.value_,i=typeof this.value_,n=XC.VALUE_TYPE_ORDER.indexOf(t),r=XC.VALUE_TYPE_ORDER.indexOf(i);return fn(n>=0,"Unknown leaf type: "+t),fn(r>=0,"Unknown leaf type: "+i),n===r?"object"===i?0:this.value_<e.value_?-1:this.value_===e.value_?0:1:r-n}withIndex(){return this}isIndexed(){return!0}equals(e){if(e===this)return!0;if(e.isLeafNode()){const t=e;return this.value_===t.value_&&this.priorityNode_.equals(t.priorityNode_)}return!1}}XC.VALUE_TYPE_ORDER=["object","boolean","number","string"];const qC=new class extends MC{compare(e,t){const i=e.node.getPriority(),n=t.node.getPriority(),r=i.compareTo(n);return 0===r?RE(e.name,t.name):r}isDefinedOn(e){return!e.getPriority().isEmpty()}indexedValueChanged(e,t){return!e.getPriority().equals(t.getPriority())}minPost(){return PC.MIN}maxPost(){return new PC(kE,new XC("[PRIORITY-POST]",GC))}makePost(e,t){const i=WC(e);return new PC(t,new XC("[PRIORITY-POST]",i))}toString(){return".priority"}},KC=Math.log(2);class QC{constructor(e){var t;this.count=(t=e+1,parseInt(Math.log(t)/KC,10)),this.current_=this.count-1;const i=(n=this.count,parseInt(Array(n+1).join("1"),2));var n;this.bits_=e+1&i}nextBitIsOne(){const e=!(this.bits_&1<<this.current_);return this.current_--,e}}const JC=function(e,t,i,n){e.sort(t);const r=function(t,n){const s=n-t;let a,o;if(0===s)return null;if(1===s)return a=e[t],o=i?i(a):a,new FC(o,a.node,FC.BLACK,null,null);{const l=parseInt(s/2,10)+t,h=r(t,l),u=r(l+1,n);return a=e[l],o=i?i(a):a,new FC(o,a.node,FC.BLACK,h,u)}},s=function(t){let n=null,s=null,a=e.length;const o=function(t,n){const s=a-t,o=a;a-=t;const h=r(s+1,o),u=e[s],c=i?i(u):u;l(new FC(c,u.node,n,null,h))},l=function(e){n?(n.left=e,n=e):(s=e,n=e)};for(let e=0;e<t.count;++e){const i=t.nextBitIsOne(),n=Math.pow(2,t.count-(e+1));i?o(n,FC.BLACK):(o(n,FC.BLACK),o(n,FC.RED))}return s}(new QC(e.length));return new BC(n||t,s)};let ZC;const $C={};class eA{static get Default(){return fn($C&&qC,"ChildrenNode.ts has not been loaded"),ZC=ZC||new eA({".priority":$C},{".priority":qC}),ZC}constructor(e,t){this.indexes_=e,this.indexSet_=t}get(e){const t=Kn(this.indexes_,e);if(!t)throw new Error("No index defined for "+e);return t instanceof BC?t:null}hasIndex(e){return qn(this.indexSet_,e.toString())}addIndex(e,t){fn(e!==LC,"KeyIndex always exists and isn't meant to be added to the IndexMap.");const i=[];let n=!1;const r=t.getIterator(PC.Wrap);let s,a=r.getNext();for(;a;)n=n||e.isDefinedOn(a.node),i.push(a),a=r.getNext();s=n?JC(i,e.getCompare()):$C;const o=e.toString(),l=m({},this.indexSet_);l[o]=e;const h=m({},this.indexes_);return h[o]=s,new eA(h,l)}addToIndexes(e,t){const i=Jn(this.indexes_,(i,n)=>{const r=Kn(this.indexSet_,n);if(fn(r,"Missing index implementation for "+n),i===$C){if(r.isDefinedOn(e.node)){const i=[],n=t.getIterator(PC.Wrap);let s=n.getNext();for(;s;)s.name!==e.name&&i.push(s),s=n.getNext();return i.push(e),JC(i,r.getCompare())}return $C}{const n=t.get(e.name);let r=i;return n&&(r=r.remove(new PC(e.name,n))),r.insert(e,e.node)}});return new eA(i,this.indexSet_)}removeFromIndexes(e,t){const i=Jn(this.indexes_,i=>{if(i===$C)return i;{const n=t.get(e.name);return n?i.remove(new PC(e.name,n)):i}});return new eA(i,this.indexSet_)}}let tA;class iA{static get EMPTY_NODE(){return tA||(tA=new iA(new BC(zC),null,eA.Default))}constructor(e,t,i){this.children_=e,this.priorityNode_=t,this.indexMap_=i,this.lazyHash_=null,this.priorityNode_&&jC(this.priorityNode_),this.children_.isEmpty()&&fn(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}isLeafNode(){return!1}getPriority(){return this.priorityNode_||tA}updatePriority(e){return this.children_.isEmpty()?this:new iA(this.children_,e,this.indexMap_)}getImmediateChild(e){if(".priority"===e)return this.getPriority();{const t=this.children_.get(e);return null===t?tA:t}}getChild(e){const t=fC(e);return null===t?this:this.getImmediateChild(t).getChild(mC(e))}hasChild(e){return null!==this.children_.get(e)}updateImmediateChild(e,t){if(fn(t,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(t);{const i=new PC(e,t);let n,r;t.isEmpty()?(n=this.children_.remove(e),r=this.indexMap_.removeFromIndexes(i,this.children_)):(n=this.children_.insert(e,t),r=this.indexMap_.addToIndexes(i,this.children_));const s=n.isEmpty()?tA:this.priorityNode_;return new iA(n,s,r)}}updateChild(e,t){const i=fC(e);if(null===i)return t;{fn(".priority"!==fC(e)||1===pC(e),".priority must be the last token in a path");const n=this.getImmediateChild(i).updateChild(mC(e),t);return this.updateImmediateChild(i,n)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(e){if(this.isEmpty())return null;const t={};let i=0,n=0,r=!0;if(this.forEachChild(qC,(s,a)=>{t[s]=a.val(e),i++,r&&iA.INTEGER_REGEXP_.test(s)?n=Math.max(n,Number(s)):r=!1}),!e&&r&&n<2*i){const e=[];for(const i in t)e[i]=t[i];return e}
2return e&&!this.getPriority().isEmpty()&&(t[".priority"]=this.getPriority().val()),t}hash(){if(null===this.lazyHash_){let e="";this.getPriority().isEmpty()||(e+="priority:"+HC(this.getPriority().val())+":"),this.forEachChild(qC,(t,i)=>{const n=i.hash();""!==n&&(e+=":"+t+":"+n)}),this.lazyHash_=""===e?"":gE(e)}return this.lazyHash_}getPredecessorChildName(e,t,i){const n=this.resolveIndex_(i);if(n){const i=n.getPredecessorKey(new PC(e,t));return i?i.name:null}return this.children_.getPredecessorKey(e)}getFirstChildName(e){const t=this.resolveIndex_(e);if(t){const e=t.minKey();return e&&e.name}return this.children_.minKey()}getFirstChild(e){const t=this.getFirstChildName(e);return t?new PC(t,this.children_.get(t)):null}getLastChildName(e){const t=this.resolveIndex_(e);if(t){const e=t.maxKey();return e&&e.name}return this.children_.maxKey()}getLastChild(e){const t=this.getLastChildName(e);return t?new PC(t,this.children_.get(t)):null}forEachChild(e,t){const i=this.resolveIndex_(e);return i?i.inorderTraversal(e=>t(e.name,e.node)):this.children_.inorderTraversal(t)}getIterator(e){return this.getIteratorFrom(e.minPost(),e)}getIteratorFrom(e,t){const i=this.resolveIndex_(t);if(i)return i.getIteratorFrom(e,e=>e);{const i=this.children_.getIteratorFrom(e.name,PC.Wrap);let n=i.peek();for(;null!=n&&t.compare(n,e)<0;)i.getNext(),n=i.peek();return i}}getReverseIterator(e){return this.getReverseIteratorFrom(e.maxPost(),e)}getReverseIteratorFrom(e,t){const i=this.resolveIndex_(t);if(i)return i.getReverseIteratorFrom(e,e=>e);{const i=this.children_.getReverseIteratorFrom(e.name,PC.Wrap);let n=i.peek();for(;null!=n&&t.compare(n,e)>0;)i.getNext(),n=i.peek();return i}}compareTo(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===nA?-1:0}withIndex(e){if(e===LC||this.indexMap_.hasIndex(e))return this;{const t=this.indexMap_.addIndex(e,this.children_);return new iA(this.children_,this.priorityNode_,t)}}isIndexed(e){return e===LC||this.indexMap_.hasIndex(e)}equals(e){if(e===this)return!0;if(e.isLeafNode())return!1;{const t=e;if(this.getPriority().equals(t.getPriority())){if(this.children_.count()===t.children_.count()){const e=this.getIterator(qC),i=t.getIterator(qC);let n=e.getNext(),r=i.getNext();for(;n&&r;){if(n.name!==r.name||!n.node.equals(r.node))return!1;n=e.getNext(),r=i.getNext()}return null===n&&null===r}return!1}return!1}}resolveIndex_(e){return e===LC?null:this.indexMap_.get(e.toString())}}iA.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;const nA=new class extends iA{constructor(){super(new BC(zC),iA.EMPTY_NODE,eA.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return iA.EMPTY_NODE}isEmpty(){return!1}};Object.defineProperties(PC,{MIN:{value:new PC(AE,iA.EMPTY_NODE)},MAX:{value:new PC(kE,nA)}}),IC.__EMPTY_NODE=iA.EMPTY_NODE,XC.__childrenNodeConstructor=iA,VC=nA,function(e){GC=e}(nA);function rA(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===e)return iA.EMPTY_NODE;if("object"===typeof e&&".priority"in e&&(t=e[".priority"]),fn(null===t||"string"===typeof t||"number"===typeof t||"object"===typeof t&&".sv"in t,"Invalid priority type found: "+typeof t),"object"===typeof e&&".value"in e&&null!==e[".value"]&&(e=e[".value"]),"object"!==typeof e||".sv"in e){return new XC(e,rA(t))}if(e instanceof Array){let i=iA.EMPTY_NODE;return IE(e,(t,n)=>{if(qn(e,t)&&"."!==t.substring(0,1)){const e=rA(n);!e.isLeafNode()&&e.isEmpty()||(i=i.updateImmediateChild(t,e))}}),i.updatePriority(rA(t))}{const i=[];let n=!1;if(IE(e,(e,t)=>{if("."!==e.substring(0,1)){const r=rA(t);r.isEmpty()||(n=n||!r.getPriority().isEmpty(),i.push(new PC(e,r)))}}),0===i.length)return iA.EMPTY_NODE;const r=JC(i,UC,e=>e.name,zC);if(n){const e=JC(i,qC.getCompare());return new iA(r,rA(t),new eA({".priority":e},{".priority":qC}))}return new iA(r,rA(t),eA.Default)}}!function(e){WC=e}(rA);class sA extends MC{constructor(e){super(),this.indexPath_=e,fn(!bC(e)&&".priority"!==fC(e),"Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,t){const i=this.extractChild(e.node),n=this.extractChild(t.node),r=i.compareTo(n);return 0===r?RE(e.name,t.name):r}makePost(e,t){const i=rA(e),n=iA.EMPTY_NODE.updateChild(this.indexPath_,i);return new PC(t,n)}maxPost(){const e=iA.EMPTY_NODE.updateChild(this.indexPath_,nA);return new PC(kE,e)}toString(){return vC(this.indexPath_,0).join("/")}}const aA=new class extends MC{compare(e,t){const i=e.node.compareTo(t.node);return 0===i?RE(e.name,t.name):i}isDefinedOn(e){return!0}indexedValueChanged(e,t){return!e.equals(t)}
vendor: 11,154 bytes, line 2
2minPost(){return PC.MIN}maxPost(){return PC.MAX}makePost(e,t){const i=rA(e);return new PC(t,i)}toString(){return".value"}};function oA(e){return{type:"value",snapshotNode:e}}function lA(e,t){return{type:"child_added",snapshotNode:t,childName:e}}function hA(e,t){return{type:"child_removed",snapshotNode:t,childName:e}}function uA(e,t,i){return{type:"child_changed",snapshotNode:t,childName:e,oldSnap:i}}class cA{constructor(e){this.index_=e}updateChild(e,t,i,n,r,s){fn(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");const a=e.getImmediateChild(t);return a.getChild(n).equals(i.getChild(n))&&a.isEmpty()===i.isEmpty()?e:(null!=s&&(i.isEmpty()?e.hasChild(t)?s.trackChildChange(hA(t,a)):fn(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?s.trackChildChange(lA(t,i)):s.trackChildChange(uA(t,i,a))),e.isLeafNode()&&i.isEmpty()?e:e.updateImmediateChild(t,i).withIndex(this.index_))}updateFullNode(e,t,i){return null!=i&&(e.isLeafNode()||e.forEachChild(qC,(e,n)=>{t.hasChild(e)||i.trackChildChange(hA(e,n))}),t.isLeafNode()||t.forEachChild(qC,(t,n)=>{if(e.hasChild(t)){const r=e.getImmediateChild(t);r.equals(n)||i.trackChildChange(uA(t,n,r))}else i.trackChildChange(lA(t,n))})),t.withIndex(this.index_)}updatePriority(e,t){return e.isEmpty()?iA.EMPTY_NODE:e.updatePriority(t)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}}class dA{constructor(e){this.indexedFilter_=new cA(e.getIndex()),this.index_=e.getIndex(),this.startPost_=dA.getStartPost_(e),this.endPost_=dA.getEndPost_(e),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(e){const t=this.startIsInclusive_?this.index_.compare(this.getStartPost(),e)<=0:this.index_.compare(this.getStartPost(),e)<0,i=this.endIsInclusive_?this.index_.compare(e,this.getEndPost())<=0:this.index_.compare(e,this.getEndPost())<0;return t&&i}updateChild(e,t,i,n,r,s){return this.matches(new PC(t,i))||(i=iA.EMPTY_NODE),this.indexedFilter_.updateChild(e,t,i,n,r,s)}updateFullNode(e,t,i){t.isLeafNode()&&(t=iA.EMPTY_NODE);let n=t.withIndex(this.index_);n=n.updatePriority(iA.EMPTY_NODE);const r=this;return t.forEachChild(qC,(e,t)=>{r.matches(new PC(e,t))||(n=n.updateImmediateChild(e,iA.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,n,i)}updatePriority(e,t){return e}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(e){if(e.hasStart()){const t=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),t)}return e.getIndex().minPost()}static getEndPost_(e){if(e.hasEnd()){const t=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),t)}return e.getIndex().maxPost()}}class fA{constructor(e){this.withinDirectionalStart=e=>this.reverse_?this.withinEndPost(e):this.withinStartPost(e),this.withinDirectionalEnd=e=>this.reverse_?this.withinStartPost(e):this.withinEndPost(e),this.withinStartPost=e=>{const t=this.index_.compare(this.rangedFilter_.getStartPost(),e);return this.startIsInclusive_?t<=0:t<0},this.withinEndPost=e=>{const t=this.index_.compare(e,this.rangedFilter_.getEndPost());return this.endIsInclusive_?t<=0:t<0},this.rangedFilter_=new dA(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft(),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}updateChild(e,t,i,n,r,s){return this.rangedFilter_.matches(new PC(t,i))||(i=iA.EMPTY_NODE),e.getImmediateChild(t).equals(i)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,t,i,n,r,s):this.fullLimitUpdateChild_(e,t,i,r,s)}updateFullNode(e,t,i){let n;if(t.isLeafNode()||t.isEmpty())n=iA.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<t.numChildren()&&t.isIndexed(this.index_)){let e;n=iA.EMPTY_NODE.withIndex(this.index_),e=this.reverse_?t.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):t.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);let i=0;for(;e.hasNext()&&i<this.limit_;){const t=e.getNext();if(this.withinDirectionalStart(t)){if(!this.withinDirectionalEnd(t))break;n=n.updateImmediateChild(t.name,t.node),i++}}}else{let e;n=t.withIndex(this.index_),n=n.updatePriority(iA.EMPTY_NODE),e=this.reverse_?n.getReverseIterator(this.index_):n.getIterator(this.index_);let i=0;for(;e.hasNext();){const t=e.getNext();i<this.limit_&&this.withinDirectionalStart(t)&&this.withinDirectionalEnd(t)?i++:n=n.updateImmediateChild(t.name,iA.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,n,i)}updatePriority(e,t){return e}filtersNodes(){return!0}getIndexedFilter(){return this.rangedFilter_.getIndexedFilter()}getIndex(){return this.index_}fullLimitUpdateChild_(e,t,i,n,r){let s;if(this.reverse_){const e=this.index_.getCompare();s=(t,i)=>e(i,t)}else s=this.index_.getCompare();const a=e;fn(a.numChildren()===this.limit_,"");const o=new PC(t,i),l=this.reverse_?a.getFirstChild(this.index_):a.getLastChild(this.index_),h=this.rangedFilter_.matches(o);if(a.hasChild(t)){const e=a.getImmediateChild(t);let u=n.getChildAfterChild(this.index_,l,this.reverse_);for(;null!=u&&(u.name===t||a.hasChild(u.name));)u=n.getChildAfterChild(this.index_,u,this.reverse_);const c=null==u?1:s(u,o);if(h&&!i.isEmpty()&&c>=0)return null!=r&&r.trackChildChange(uA(t,i,e)),a.updateImmediateChild(t,i);{null!=r&&r.trackChildChange(hA(t,e));const i=a.updateImmediateChild(t,iA.EMPTY_NODE);return null!=u&&this.rangedFilter_.matches(u)?(null!=r&&r.trackChildChange(lA(u.name,u.node)),i.updateImmediateChild(u.name,u.node)):i}}return i.isEmpty()?e:h&&s(l,o)>=0?(null!=r&&(r.trackChildChange(hA(l.name,l.node)),r.trackChildChange(lA(t,i))),a.updateImmediateChild(t,i).updateImmediateChild(l.name,iA.EMPTY_NODE)):e}}class pA{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=qC}hasStart(){return this.startSet_}isViewFromLeft(){return""===this.viewFrom_?this.startSet_:"l"===this.viewFrom_}getIndexStartValue(){return fn(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return fn(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:AE}hasEnd(){return this.endSet_}getIndexEndValue(){return fn(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return fn(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:kE}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&""!==this.viewFrom_}getLimit(){return fn(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===qC}copy(){const e=new pA;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}}function mA(e){const t={};if(e.isDefault())return t;let i;if(e.index_===qC?i="$priority":e.index_===aA?i="$value":e.index_===LC?i="$key":(fn(e.index_ instanceof sA,"Unrecognized index type!"),i=e.index_.toString()),t.orderBy=Gn(i),e.startSet_){const i=e.startAfterSet_?"startAfter":"startAt";t[i]=Gn(e.indexStartValue_),e.startNameSet_&&(t[i]+=","+Gn(e.indexStartName_))}if(e.endSet_){const i=e.endBeforeSet_?"endBefore":"endAt";t[i]=Gn(e.indexEndValue_),e.endNameSet_&&(t[i]+=","+Gn(e.indexEndName_))}return e.limitSet_&&(e.isViewFromLeft()?t.limitToFirst=e.limit_:t.limitToLast=e.limit_),t}function gA(e){const t={};if(e.startSet_&&(t.sp=e.indexStartValue_,e.startNameSet_&&(t.sn=e.indexStartName_),t.sin=!e.startAfterSet_),e.endSet_&&(t.ep=e.indexEndValue_,e.endNameSet_&&(t.en=e.indexEndName_),t.ein=!e.endBeforeSet_),e.limitSet_){t.l=e.limit_;let i=e.viewFrom_;""===i&&(i=e.isViewFromLeft()?"l":"r"),t.vf=i}return e.index_!==qC&&(t.i=e.index_.toString()),t}class vA extends lC{reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,t){return void 0!==t?"tag$"+t:(fn(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}constructor(e,t,i,n){super(),this.repoInfo_=e,this.onDataUpdate_=t,this.authTokenProvider_=i,this.appCheckTokenProvider_=n,this.log_=TE("p:rest:"),this.listens_={}}listen(e,t,i,n){const r=e._path.toString();this.log_("Listen called for "+r+" "+e._queryIdentifier);const s=vA.getListenId_(e,i),a={};this.listens_[s]=a;const o=mA(e._queryParams);this.restRequest_(r+".json",o,(e,t)=>{let o=t;if(404===e&&(o=null,e=null),null===e&&this.onDataUpdate_(r,o,!1,i),Kn(this.listens_,s)===a){let t;t=e?401===e?"permission_denied":"rest_error:"+e:"ok",n(t,null)}})}unlisten(e,t){const i=vA.getListenId_(e,t);delete this.listens_[i]}get(e){const t=mA(e._queryParams),i=e._path.toString(),n=new On;return this.restRequest_(i+".json",t,(e,t)=>{let r=t;404===e&&(r=null,e=null),null===e?(this.onDataUpdate_(i,r,!1,null),n.resolve(r)):n.reject(new Error(r))}),n.promise}refreshAuthToken(e){}restRequest_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return t.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(n=>{let r=u(n,2),s=r[0],a=r[1];s&&s.accessToken&&(t.auth=s.accessToken),a&&a.token&&(t.ac=a.token);const o=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+er(t);this.log_("Sending REST request for "+o);const l=new XMLHttpRequest;l.onreadystatechange=()=>{if(i&&4===l.readyState){this.log_("REST Response for "+o+" received. status:",l.status,"response:",l.responseText);let e=null;if(l.status>=200&&l.status<300){try{e=Wn(l.responseText)}catch(oT){EE("Failed to parse JSON response for "+o+": "+l.responseText)}i(null,e)}else 401!==l.status&&404!==l.status&&EE("Got unsuccessful REST response for "+o+" Status: "+l.status),i(l.status);i=null}},l.open("GET",o,!0),l.send()})}}class yA{constructor(){this.rootNode_=iA.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)}}function xA(){return{value:null,children:new Map}}function bA(e,t,i){if(bC(t))e.value=i,e.children.clear();else if(null!==e.value)e.value=e.value.updateChild(t,i);else{const n=fC(t);e.children.has(n)||e.children.set(n,xA());bA(e.children.get(n),t=mC(t),i)}}function wA(e,t){if(bC(t))return e.value=null,e.children.clear(),!0;if(null!==e.value){if(e.value.isLeafNode())return!1;{const i=e.value;
2return e.value=null,i.forEachChild(qC,(t,i)=>{bA(e,new cC(t),i)}),wA(e,t)}}if(e.children.size>0){const i=fC(t);if(t=mC(t),e.children.has(i)){wA(e.children.get(i),t)&&e.children.delete(i)}return 0===e.children.size}return!0}function TA(e,t,i){null!==e.value?i(t,e.value):function(e,t){e.children.forEach((e,i)=>{t(i,e)})}(e,(e,n)=>{TA(n,new cC(t.toString()+"/"+e),i)})}class _A{constructor(e){this.collection_=e,this.last_=null}get(){const e=this.collection_.get(),t=m({},e);return this.last_&&IE(this.last_,(e,i)=>{t[e]=t[e]-i}),this.last_=e,t}}class SA{constructor(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new _A(e);const i=1e4+2e4*Math.random();UE(this.reportStats_.bind(this),Math.floor(i))}reportStats_(){const e=this.statsListener_.get(),t={};let i=!1;IE(e,(e,n)=>{n>0&&qn(this.statsToReport_,e)&&(t[e]=n,i=!0)}),i&&this.server_.reportStats(t),UE(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))}}var EA;function CA(e){return{fromUser:!1,fromServer:!0,queryId:e,tagged:!0}}!function(e){e[e.OVERWRITE=0]="OVERWRITE",e[e.MERGE=1]="MERGE",e[e.ACK_USER_WRITE=2]="ACK_USER_WRITE",e[e.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(EA||(EA={}));class AA{constructor(e,t,i){this.path=e,this.affectedTree=t,this.revert=i,this.type=EA.ACK_USER_WRITE,this.source={fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}operationForChild(e){if(bC(this.path)){if(null!=this.affectedTree.value)return fn(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{const t=this.affectedTree.subtree(new cC(e));return new AA(dC(),t,this.revert)}}return fn(fC(this.path)===e,"operationForChild called for unrelated child."),new AA(mC(this.path),this.affectedTree,this.revert)}}class kA{constructor(e,t){this.source=e,this.path=t,this.type=EA.LISTEN_COMPLETE}operationForChild(e){return bC(this.path)?new kA(this.source,dC()):new kA(this.source,mC(this.path))}}class RA{constructor(e,t,i){this.source=e,this.path=t,this.snap=i,this.type=EA.OVERWRITE}operationForChild(e){return bC(this.path)?new RA(this.source,dC(),this.snap.getImmediateChild(e)):new RA(this.source,mC(this.path),this.snap)}}class OA{constructor(e,t,i){this.source=e,this.path=t,this.children=i,this.type=EA.MERGE}operationForChild(e){if(bC(this.path)){const t=this.children.subtree(new cC(e));return t.isEmpty()?null:t.value?new RA(this.source,dC(),t.value):new OA(this.source,dC(),t)}return fn(fC(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new OA(this.source,mC(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}}class PA{constructor(e,t,i){this.node_=e,this.fullyInitialized_=t,this.filtered_=i}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(bC(e))return this.isFullyInitialized()&&!this.filtered_;const t=fC(e);return this.isCompleteForChild(t)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}}class MA{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}}function NA(e,t,i,n,r,s){const a=n.filter(e=>e.type===i);a.sort((t,i)=>function(e,t,i){if(null==t.childName||null==i.childName)throw pn("Should only compare child_ events.");const n=new PC(t.childName,t.snapshotNode),r=new PC(i.childName,i.snapshotNode);return e.index_.compare(n,r)}(e,t,i)),a.forEach(i=>{const n=function(e,t,i){return"value"===t.type||"child_removed"===t.type||(t.prevName=i.getPredecessorChildName(t.childName,t.snapshotNode,e.index_)),t}(e,i,s);r.forEach(r=>{r.respondsTo(i.type)&&t.push(r.createEvent(n,e.query_))})})}function IA(e,t){return{eventCache:e,serverCache:t}}function LA(e,t,i,n){return IA(new PA(t,i,n),e.serverCache)}function DA(e,t,i,n){return IA(e.eventCache,new PA(t,i,n))}function FA(e){return e.eventCache.isFullyInitialized()?e.eventCache.getNode():null}function BA(e){return e.serverCache.isFullyInitialized()?e.serverCache.getNode():null}let UA;class zA{static fromObject(e){let t=new zA(null);return IE(e,(e,i)=>{t=t.set(new cC(e),i)}),t}constructor(e){let t=arguments.length>
21&&void 0!==arguments[1]?arguments[1]:(UA||(UA=new BC(OE)),UA);this.value=e,this.children=t}isEmpty(){return null===this.value&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,t){if(null!=this.value&&t(this.value))return{path:dC(),value:this.value};if(bC(e))return null;{const i=fC(e),n=this.children.get(i);if(null!==n){const r=n.findRootMostMatchingPathAndValue(mC(e),t);if(null!=r){return{path:xC(new cC(i),r.path),value:r.value}}return null}return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(e){if(bC(e))return this;{const t=fC(e),i=this.children.get(t);return null!==i?i.subtree(mC(e)):new zA(null)}}set(e,t){if(bC(e))return new zA(t,this.children);{const i=fC(e),n=(this.children.get(i)||new zA(null)).set(mC(e),t),r=this.children.insert(i,n);return new zA(this.value,r)}}remove(e){if(bC(e))return this.children.isEmpty()?new zA(null):new zA(null,this.children);{const t=fC(e),i=this.children.get(t);if(i){const n=i.remove(mC(e));let r;return r=n.isEmpty()?this.children.remove(t):this.children.insert(t,n),null===this.value&&r.isEmpty()?new zA(null):new zA(this.value,r)}return this}}get(e){if(bC(e))return this.value;{const t=fC(e),i=this.children.get(t);return i?i.get(mC(e)):null}}setTree(e,t){if(bC(e))return t;{const i=fC(e),n=(this.children.get(i)||new zA(null)).setTree(mC(e),t);let r;return r=n.isEmpty()?this.children.remove(i):this.children.insert(i,n),new zA(this.value,r)}}fold(e){return this.fold_(dC(),e)}fold_(e,t){const i={};return this.children.inorderTraversal((n,r)=>
2{i[n]=r.fold_(xC(e,n),t)}),t(e,this.value,i)}findOnPath(e,t){return this.findOnPath_(e,dC(),t)}findOnPath_(e,t,i){const n=!!this.value&&i(t,this.value);if(n)return n;if(bC(e))return null;{const n=fC(e),r=this.children.get(n);return r?r.findOnPath_(mC(e),xC(t,n),i):null}}foreachOnPath(e,t){return this.foreachOnPath_(e,dC(),t)}foreachOnPath_(e,t,i){if(bC(e))return this;{this.value&&i(t,this.value);const n=fC(e),r=this.children.get(n);return r?r.foreachOnPath_(mC(e),xC(t,n),i):new zA(null)}}foreach(e){this.foreach_(dC(),e)}foreach_(e,t){this.children.inorderTraversal((i,n)=>{n.foreach_(xC(e,i),t)}),this.value&&t(e,this.value)}foreachChild(e){this.children.inorderTraversal((t,i)=>{i.value&&e(t,i.value)})}}class VA{constructor(e){this.writeTree_=e}static empty(){return new VA(new zA(null))}}function HA(e,t,i){if(bC(t))return new VA(new zA(i));{const n=e.writeTree_.findRootMostValueAndPath(t);if(null!=n){const r=n.path;let s=n.value;const a=wC(r,t);return s=s.updateChild(a,i),new VA(e.writeTree_.set(r,s))}{const n=new zA(i),r=e.writeTree_.setTree(t,n);return new VA(r)}}}function jA(e,t,i){let n=e;return IE(i,(e,i)=>{n=HA(n,xC(t,e),i)}),n}function YA(e,t){if(bC(t))return VA.empty();{const i=e.writeTree_.setTree(t,new zA(null));return new VA(i)}}function WA(e,t){return null!=GA(e,t)}function GA(e,t){const i=e.writeTree_.findRootMostValueAndPath(t);return null!=i?e.writeTree_.get(i.path).getChild(wC(i.path,t)):null}function XA(e){const t=[],i=e.writeTree_.value;return null!=i?i.isLeafNode()||i.forEachChild(qC,(e,i)=>{t.push(new PC(e,i))}):e.writeTree_.children.inorderTraversal((e,i)=>{null!=i.value&&t.push(new PC(e,i.value))}),t}function qA(e,t){if(bC(t))return e;{const i=GA(e,t);return new VA(null!=i?new zA(i):e.writeTree_.subtree(t))}}function KA(e){return e.writeTree_.isEmpty()}function QA(e,t){return JA(dC(),e.writeTree_,t)}function JA(e,t,i){if(null!=t.value)return i.updateChild(e,t.value);{let n=null;return t.children.inorderTraversal((t,r)=>{".priority"===t?(fn(null!==r.value,"Priority writes must always be leaf nodes"),n=r.value):i=JA(xC(e,t),r,i)}),i.getChild(e).isEmpty()||null===n||(i=i.updateChild(xC(e,".priority"),n)),i}}function ZA(e,t){return ck(t,e)}function $A(e,t){const i=e.allWrites.findIndex(e=>e.writeId===t);fn(i>=0,"removeWrite called with nonexistent writeId.");const n=e.allWrites[i];e.allWrites.splice(i,1);let r=n.visible,s=!1,a=e.allWrites.length-1;for(;r&&a>=0;){const t=e.allWrites[a];t.visible&&(a>=i&&ek(t,n.path)?r=!1:SC(n.path,t.path)&&(s=!0)),a--}if(r){if(s)return function(e){e.visibleWrites=ik(e.allWrites,tk,dC()),e.allWrites.length>0?e.lastWriteId=e.allWrites[e.allWrites.length-1].writeId:e.lastWriteId=-1}(e),!0;if(n.snap)e.visibleWrites=YA(e.visibleWrites,n.path);else{IE(n.children,t=>{e.visibleWrites=YA(e.visibleWrites,xC(n.path,t))})}return!0}return!1}function ek(e,t){if(e.snap)return SC(e.path,t);for(const i in e.children)if(e.children.hasOwnProperty(i)&&SC(xC(e.path,i),t))return!0;return!1}function tk(e){return e.visible}function ik(e,t,i){let n=VA.empty();for(let r=0;r<e.length;++r){const s=e[r];if(t(s)){const e=s.path;let t;if(s.snap)SC(i,e)?(t=wC(i,e),n=HA(n,t,s.snap)):SC(e,i)&&(t=wC(e,i),n=HA(n,dC(),s.snap.getChild(t)));else{if(!s.children)throw pn("WriteRecord should have .snap or .children");if(SC(i,e))t=wC(i,e),n=jA(n,t,s.children);else if(SC(e,i))if(t=wC(e,i),bC(t))n=jA(n,dC(),s.children);else{const e=Kn(s.children,fC(t));if(e){const i=e.getChild(mC(t));n=HA(n,dC(),i)}}}}}return n}function nk(e,t,i,n,r){if(n||r){const s=qA(e.visibleWrites,t);if(!r&&KA(s))return i;if(r||null!=i||WA(s,dC())){const s=function(e){return(e.visible||r)&&(!n||!~n.indexOf(e.writeId))&&(SC(e.path,t)||SC(t,e.path))};return QA(ik(e.allWrites,s,t),i||iA.EMPTY_NODE)}return null}{const n=GA(e.visibleWrites,t);if(null!=n)return n;{const n=qA(e.visibleWrites,t);if(KA(n))return i;if(null!=i||WA(n,dC())){return QA(n,i||iA.EMPTY_NODE)}return null}}}function rk(e,t,i,n){return nk(e.writeTree,e.treePath,t,i,n)}function sk(e,t){return function(e,t,i){let n=iA.EMPTY_NODE;const r=GA(e.visibleWrites,t);if(r)return r.isLeafNode()||r.forEachChild(qC,(e,t)=>{n=n.updateImmediateChild(e,t)}),n;if(i){const r=qA(e.visibleWrites,t);
vendor: 9,538 bytes, line 2
2return i.forEachChild(qC,(e,t)=>{const i=QA(qA(r,new cC(e)),t);n=n.updateImmediateChild(e,i)}),XA(r).forEach(e=>{n=n.updateImmediateChild(e.name,e.node)}),n}return XA(qA(e.visibleWrites,t)).forEach(e=>{n=n.updateImmediateChild(e.name,e.node)}),n}(e.writeTree,e.treePath,t)}function ak(e,t,i,n){return function(e,t,i,n,r){fn(n||r,"Either existingEventSnap or existingServerSnap must exist");const s=xC(t,i);if(WA(e.visibleWrites,s))return null;{const t=qA(e.visibleWrites,s);return KA(t)?r.getChild(i):QA(t,r.getChild(i))}}(e.writeTree,e.treePath,t,i,n)}function ok(e,t){return function(e,t){return GA(e.visibleWrites,t)}(e.writeTree,xC(e.treePath,t))}function lk(e,t,i,n,r,s){return function(e,t,i,n,r,s,a){let o;const l=qA(e.visibleWrites,t),h=GA(l,dC());if(null!=h)o=h;else{if(null==i)return[];o=QA(l,i)}if(o=o.withIndex(a),o.isEmpty()||o.isLeafNode())return[];{const e=[],t=a.getCompare(),i=s?o.getReverseIteratorFrom(n,a):o.getIteratorFrom(n,a);let l=i.getNext();for(;l&&e.length<r;)0!==t(l,n)&&e.push(l),l=i.getNext();return e}}(e.writeTree,e.treePath,t,i,n,r,s)}function hk(e,t,i){return function(e,t,i,n){const r=xC(t,i),s=GA(e.visibleWrites,r);if(null!=s)return s;if(n.isCompleteForChild(i))return QA(qA(e.visibleWrites,r),n.getNode().getImmediateChild(i));return null}(e.writeTree,e.treePath,t,i)}function uk(e,t){return ck(xC(e.treePath,t),e.writeTree)}function ck(e,t){return{treePath:e,writeTree:t}}class dk{constructor(){this.changeMap=new Map}trackChildChange(e){const t=e.type,i=e.childName;fn("child_added"===t||"child_changed"===t||"child_removed"===t,"Only child changes supported for tracking"),fn(".priority"!==i,"Only non-priority child changes can be tracked.");const n=this.changeMap.get(i);if(n){const r=n.type;if("child_added"===t&&"child_removed"===r)this.changeMap.set(i,uA(i,e.snapshotNode,n.snapshotNode));else if("child_removed"===t&&"child_added"===r)this.changeMap.delete(i);else if("child_removed"===t&&"child_changed"===r)this.changeMap.set(i,hA(i,n.oldSnap));else if("child_changed"===t&&"child_added"===r)this.changeMap.set(i,lA(i,e.snapshotNode));else{if("child_changed"!==t||"child_changed"!==r)throw pn("Illegal combination of changes: "+e+" occurred after "+n);this.changeMap.set(i,uA(i,e.snapshotNode,n.oldSnap))}}else this.changeMap.set(i,e)}getChanges(){return Array.from(this.changeMap.values())}}const fk=new class{getCompleteChild(e){return null}getChildAfterChild(e,t,i){return null}};class pk{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.writes_=e,this.viewCache_=t,this.optCompleteServerCache_=i}getCompleteChild(e){const t=this.viewCache_.eventCache;if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);{const t=null!=this.optCompleteServerCache_?new PA(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return hk(this.writes_,e,t)}}getChildAfterChild(e,t,i){const n=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:BA(this.viewCache_),r=lk(this.writes_,n,t,1,i,e);return 0===r.length?null:r[0]}}function mk(e,t,i,n,r){const s=new dk;let a,o;if(i.type===EA.OVERWRITE){const l=i;l.source.fromUser?a=yk(e,t,l.path,l.snap,n,r,s):(fn(l.source.fromServer,"Unknown source."),o=l.source.tagged||t.serverCache.isFiltered()&&!bC(l.path),a=vk(e,t,l.path,l.snap,n,r,o,s))}else if(i.type===EA.MERGE){const l=i;l.source.fromUser?a=function(e,t,i,n,r,s,a){let o=t;return n.foreach((n,l)=>{const h=xC(i,n);xk(t,fC(h))&&(o=yk(e,o,h,l,r,s,a))}),n.foreach((n,l)=>{const h=xC(i,n);xk(t,fC(h))||(o=yk(e,o,h,l,r,s,a))}),o}(e,t,l.path,l.children,n,r,s):(fn(l.source.fromServer,"Unknown source."),o=l.source.tagged||t.serverCache.isFiltered(),a=wk(e,t,l.path,l.children,n,r,o,s))}else if(i.type===EA.ACK_USER_WRITE){const o=i;a=o.revert?function(e,t,i,n,r,s){let a;if(null!=ok(n,i))return t;{const o=new pk(n,t,r),l=t.eventCache.getNode();let h;if(bC(i)||".priority"===fC(i)){let i;if(t.serverCache.isFullyInitialized())i=rk(n,BA(t));else{const e=t.serverCache.getNode();fn(e instanceof iA,"serverChildren would be complete if leaf node"),i=sk(n,e)}h=e.filter.updateFullNode(l,i,s)}else{const r=fC(i);let u=hk(n,r,t.serverCache);null==u&&t.serverCache.isCompleteForChild(r)&&(u=l.getImmediateChild(r)),h=null!=u?e.filter.updateChild(l,r,u,mC(i),o,s):t.eventCache.getNode().hasChild(r)?e.filter.updateChild(l,r,iA.EMPTY_NODE,mC(i),o,s):l,h.isEmpty()&&t.serverCache.isFullyInitialized()&&(a=rk(n,BA(t)),a.isLeafNode()&&(h=e.filter.updateFullNode(h,a,s)))}return a=t.serverCache.isFullyInitialized()||null!=ok(n,dC()),LA(t,h,a,e.filter.filtersNodes())}}(e,t,o.path,n,r,s):function(e,t,i,n,r,s,a){if(null!=ok(r,i))return t;const o=t.serverCache.isFiltered(),l=t.serverCache;if(null!=n.value){if(bC(i)&&l.isFullyInitialized()||l.isCompleteForPath(i))return vk(e,t,i,l.getNode().getChild(i),r,s,o,a);if(bC(i)){let n=new zA(null);return l.getNode().forEachChild(LC,(e,t)=>{n=n.set(new cC(e),t)}),wk(e,t,i,n,r,s,o,a)}return t}{let h=new zA(null);return n.foreach((e,t)=>{const n=xC(i,e);l.isCompleteForPath(n)&&(h=h.set(e,l.getNode().getChild(n)))}),wk(e,t,i,h,r,s,o,a)}}(e,t,o.path,o.affectedTree,n,r,s)}else{if(i.type!==EA.LISTEN_COMPLETE)throw pn("Unknown operation type: "+i.type);a=function(e,t,i,n,r){const s=t.serverCache,a=DA(t,s.getNode(),s.isFullyInitialized()||bC(i),s.isFiltered());return gk(e,a,i,n,fk,r)}(e,t,i.path,n,s)}const l=s.getChanges();return function(e,t,i){const n=t.eventCache;if(n.isFullyInitialized()){const r=n.getNode().isLeafNode()||n.getNode().isEmpty(),s=FA(e);(i.length>0||!e.eventCache.isFullyInitialized()||r&&!n.getNode().equals(s)||!n.getNode().getPriority().equals(s.getPriority()))&&i.push(oA(FA(t)))}}(t,a,l),{viewCache:a,changes:l}}function gk(e,t,i,n,r,s){const a=t.eventCache;if(null!=ok(n,i))return t;{let o,l;if(bC(i))if(fn(t.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),t.serverCache.isFiltered()){const i=BA(t),r=sk(n,i instanceof iA?i:iA.EMPTY_NODE);o=e.filter.updateFullNode(t.eventCache.getNode(),r,s)}else{const i=rk(n,BA(t));o=e.filter.updateFullNode(t.eventCache.getNode(),i,s)}else{const h=fC(i);if(".priority"===h){fn(1===pC(i),"Can't have a priority with additional path components");const r=a.getNode();l=t.serverCache.getNode();const s=ak(n,i,r,l);o=null!=s?e.filter.updatePriority(r,s):a.getNode()}else{const u=mC(i);let c;if(a.isCompleteForChild(h)){l=t.serverCache.getNode();const e=ak(n,i,a.getNode(),l);c=null!=e?a.getNode().getImmediateChild(h).updateChild(u,e):a.getNode().getImmediateChild(h)}else c=hk(n,h,t.serverCache);o=null!=c?e.filter.updateChild(a.getNode(),h,c,u,r,s):a.getNode()}}return LA(t,o,a.isFullyInitialized()||bC(i),e.filter.filtersNodes())}}function vk(e,t,i,n,r,s,a,o){const l=t.serverCache;let h;const u=a?e.filter:e.filter.getIndexedFilter();if(bC(i))h=u.updateFullNode(l.getNode(),n,null);else if(u.filtersNodes()&&!l.isFiltered()){const e=l.getNode().updateChild(i,n);h=u.updateFullNode(l.getNode(),e,null)}else{const e=fC(i);if(!l.isCompleteForPath(i)&&pC(i)>1)return t;const r=mC(i),s=l.getNode().getImmediateChild(e).updateChild(r,n);h=".priority"===e?u.updatePriority(l.getNode(),s):u.updateChild(l.getNode(),e,s,r,fk,null)}const c=DA(t,h,l.isFullyInitialized()||bC(i),u.filtersNodes());return gk(e,c,i,r,new pk(r,c,s),o)}function yk(e,t,i,n,r,s,a){const o=t.eventCache;let l,h;const u=new pk(r,t,s);if(bC(i))h=e.filter.updateFullNode(t.eventCache.getNode(),n,a),l=LA(t,h,!0,e.filter.filtersNodes());else{const r=fC(i);if(".priority"===r)h=e.filter.updatePriority(t.eventCache.getNode(),n),l=LA(t,h,o.isFullyInitialized(),o.isFiltered());else{const s=mC(i),h=o.getNode().getImmediateChild(r);let c;if(bC(s))c=n;else{const e=u.getCompleteChild(r);c=null!=e?".priority"===gC(s)&&e.getChild(yC(s)).isEmpty()?e:e.updateChild(s,n):iA.EMPTY_NODE}if(h.equals(c))l=t;else{l=LA(t,e.filter.updateChild(o.getNode(),r,c,s,u,a),o.isFullyInitialized(),e.filter.filtersNodes())}}}return l}function xk(e,t){return e.eventCache.isCompleteForChild(t)}function bk(e,t,i){return i.foreach((e,i)=>{t=t.updateChild(e,i)}),t}function wk(e,t,i,n,r,s,a,o){if(t.serverCache.getNode().isEmpty()&&!t.serverCache.isFullyInitialized())return t;let l,h=t;l=bC(i)?n:new zA(null).setTree(i,n);const u=t.serverCache.getNode();return l.children.inorderTraversal((i,n)=>{if(u.hasChild(i)){const l=bk(0,t.serverCache.getNode().getImmediateChild(i),n);h=vk(e,h,new cC(i),l,r,s,a,o)}}),l.children.inorderTraversal((i,n)=>{const l=!t.serverCache.isCompleteForChild(i)&&null===n.value;if(!u.hasChild(i)&&!l){const l=bk(0,t.serverCache.getNode().getImmediateChild(i),n);h=vk(e,h,new cC(i),l,r,s,a,o)}}),h}class Tk{constructor(e,t){this.query_=e,this.eventRegistrations_=[];const i=this.query_._queryParams,n=new cA(i.getIndex()),r=(s=i).loadsAllData()?new cA(s.getIndex()):s.hasLimit()?new fA(s):new dA(s);var s;this.processor_=function(e){return{filter:e}}(r);const a=t.serverCache,o=t.eventCache,l=n.updateFullNode(iA.EMPTY_NODE,a.getNode(),null),h=r.updateFullNode(iA.EMPTY_NODE,o.getNode(),null),u=new PA(l,a.isFullyInitialized(),n.filtersNodes()),c=new PA(h,o.isFullyInitialized(),r.filtersNodes());this.viewCache_=IA(c,u),this.eventGenerator_=new MA(this.query_)}get query(){return this.query_}}function _k(e,t){const i=BA(e.viewCache_);return i&&(e.query._queryParams.loadsAllData()||!bC(t)&&!i.getImmediateChild(fC(t)).isEmpty())?i.getChild(t):null}function Sk(e){return 0===e.eventRegistrations_.length}function Ek(e,t,i){const n=[];if(i){fn(null==t,"A cancel should cancel all event registrations.");const r=e.query._path;
2e.eventRegistrations_.forEach(e=>{const t=e.createCancelEvent(i,r);t&&n.push(t)})}if(t){let i=[];for(let n=0;n<e.eventRegistrations_.length;++n){const r=e.eventRegistrations_[n];if(r.matches(t)){if(t.hasAnyCallback()){i=i.concat(e.eventRegistrations_.slice(n+1));break}}else i.push(r)}e.eventRegistrations_=i}else e.eventRegistrations_=[];return n}function Ck(e,t,i,n){t.type===EA.MERGE&&null!==t.source.queryId&&(fn(BA(e.viewCache_),"We should always have a full cache before handling merges"),fn(FA(e.viewCache_),"Missing event cache, even though we have a server cache"));const r=e.viewCache_,s=mk(e.processor_,r,t,i,n);var a,o;return a=e.processor_,o=s.viewCache,fn(o.eventCache.getNode().isIndexed(a.filter.getIndex()),"Event snap not indexed"),fn(o.serverCache.getNode().isIndexed(a.filter.getIndex()),"Server snap not indexed"),fn(s.viewCache.serverCache.isFullyInitialized()||!r.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),e.viewCache_=s.viewCache,Ak(e,s.changes,s.viewCache.eventCache.getNode(),null)}function Ak(e,t,i,n){const r=n?[n]:e.eventRegistrations_;return function(e,t,i,n){const r=[],s=[];return t.forEach(t=>{var i;"child_changed"===t.type&&e.index_.indexedValueChanged(t.oldSnap,t.snapshotNode)&&s.push((i=t.childName,{type:"child_moved",snapshotNode:t.snapshotNode,childName:i}))}),NA(e,r,"child_removed",t,n,i),NA(e,r,"child_added",t,n,i),NA(e,r,"child_moved",s,n,i),NA(e,r,"child_changed",t,n,i),NA(e,r,"value",t,n,i),r}(e.eventGenerator_,t,i,r)}let kk,Rk;class Ok{constructor(){this.views=new Map}}function Pk(e,t,i,n){const r=t.source.queryId;if(null!==r){const s=e.views.get(r);return fn(null!=s,"SyncTree gave us an op for an invalid query."),Ck(s,t,i,n)}{let r=[];for(const s of e.views.values())r=r.concat(Ck(s,t,i,n));return r}}function Mk(e,t,i,n,r){const s=t._queryIdentifier,a=e.views.get(s);if(!a){let e=rk(i,r?n:null),s=!1;e?s=!0:n instanceof iA?(e=sk(i,n),s=!1):(e=iA.EMPTY_NODE,s=!1);const a=IA(new PA(e,s,!1),new PA(n,r,!1));return new Tk(t,a)}return a}function Nk(e,t,i,n,r,s){const a=Mk(e,t,n,r,s);return e.views.has(t._queryIdentifier)||e.views.set(t._queryIdentifier,a),function(e,t){e.eventRegistrations_.push(t)}(a,i),function(e,t){const i=e.viewCache_.eventCache,n=[];i.getNode().isLeafNode()||i.getNode().forEachChild(qC,(e,t)=>{n.push(lA(e,t))});return i.isFullyInitialized()&&n.push(oA(i.getNode())),Ak(e,n,i.getNode(),t)}(a,i)}function Ik(e,t,i,n){const r=t._queryIdentifier,s=[];let a=[];const o=Uk(e);if("default"===r)for(const h of e.views.entries()){var l=u(h,2);const t=l[0],r=l[1];a=a.concat(Ek(r,i,n)),Sk(r)&&(e.views.delete(t),r.query._queryParams.loadsAllData()||s.push(r.query))}else{const t=e.views.get(r);t&&(a=a.concat(Ek(t,i,n)),Sk(t)&&(e.views.delete(r),t.query._queryParams.loadsAllData()||s.push(t.query)))}return o&&!Uk(e)&&s.push(new(fn(kk,"Reference.ts has not been loaded"),kk)(t._repo,t._path)),{removed:s,events:a}}function Lk(e){const t=[];for(const i of e.views.values())i.query._queryParams.loadsAllData()||t.push(i);return t}function Dk(e,t){let i=null;for(const n of e.views.values())i=i||_k(n,t);return i}function Fk(e,t){if(t._queryParams.loadsAllData())return zk(e);{const i=t._queryIdentifier;return e.views.get(i)}}function Bk(e,t){return null!=Fk(e,t)}function Uk(e){return null!=zk(e)}function zk(e){for(const t of e.views.values())if(t.query._queryParams.loadsAllData())return t;return null}let Vk=1;class Hk{constructor(e){this.listenProvider_=e,this.syncPointTree_=new zA(null),this.pendingWriteTree_={visibleWrites:VA.empty(),allWrites:[],lastWriteId:-1},this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}function jk(e,t,i,n,r){return function(e,t,i,n,r){fn(n>e.lastWriteId,"Stacking an older write on top of newer ones"),void 0===r&&(r=!0),e.allWrites.push({path:t,snap:i,writeId:n,visible:r}),r&&(e.visibleWrites=HA(e.visibleWrites,t,i)),e.lastWriteId=n}(e.pendingWriteTree_,t,i,n,r),r?Zk(e,new RA({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},t,i)):[]}function Yk(e,t,i,n){!function(e,t,i,n){fn(n>e.lastWriteId,"Stacking an older merge on top of newer ones"),e.allWrites.push({path:t,children:i,writeId:n,visible:!0}),e.visibleWrites=jA(e.visibleWrites,t,i),e.lastWriteId=n}(e.pendingWriteTree_,t,i,n);const r=zA.fromObject(i);return Zk(e,new OA({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},t,r))}function Wk(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=function(e,t){for(let i=0;i<e.allWrites.length;i++){const n=e.allWrites[i];if(n.writeId===t)return n}return null}(e.pendingWriteTree_,t);if($A(e.pendingWriteTree_,t)){let t=new zA(null);return null!=n.snap?t=t.set(dC(),!0):IE(n.children,e=>{t=t.set(new cC(e),!0)}),Zk(e,new AA(n.path,t,i))}return[]}function Gk(e,t,i){return Zk(e,new RA({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t,i))}function Xk(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s=t._path,a=e.syncPointTree_.get(s);let o=[];
2if(a&&("default"===t._queryIdentifier||Bk(a,t))){const l=Ik(a,t,i,n);0===a.views.size&&(e.syncPointTree_=e.syncPointTree_.remove(s));const h=l.removed;if(o=l.events,!r){const i=-1!==h.findIndex(e=>e._queryParams.loadsAllData()),r=e.syncPointTree_.findOnPath(s,(e,t)=>Uk(t));if(i&&!r){const t=e.syncPointTree_.subtree(s);if(!t.isEmpty()){const i=function(e){return e.fold((e,t,i)=>{if(t&&Uk(t)){return[zk(t)]}{let e=[];return t&&(e=Lk(t)),IE(i,(t,i)=>{e=e.concat(i)}),e}})}(t);for(let t=0;t<i.length;++t){const n=i[t],r=n.query,s=tR(e,n);e.listenProvider_.startListening(oR(r),iR(e,r),s.hashFn,s.onComplete)}}}if(!r&&h.length>0&&!n)if(i){const i=null;e.listenProvider_.stopListening(oR(t),i)}else h.forEach(t=>{const i=e.queryToTagMap.get(nR(t));e.listenProvider_.stopListening(oR(t),i)})}!function(e,t){for(let i=0;i<t.length;++i){const n=t[i];if(!n._queryParams.loadsAllData()){const t=nR(n),i=e.queryToTagMap.get(t);e.queryToTagMap.delete(t),e.tagToQueryMap.delete(i)}}}(e,h)}return o}function qk(e,t,i,n){const r=rR(e,n);if(null!=r){const n=sR(r),s=n.path,a=n.queryId,o=wC(s,t);return aR(e,s,new RA(CA(a),o,i))}return[]}function Kk(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=t._path;let s=null,a=!1;e.syncPointTree_.foreachOnPath(r,(e,t)=>{const i=wC(e,r);s=s||Dk(t,i),a=a||Uk(t)});let o,l=e.syncPointTree_.get(r);if(l?(a=a||Uk(l),s=s||Dk(l,dC())):(l=new Ok,e.syncPointTree_=e.syncPointTree_.set(r,l)),null!=s)o=!0;else{o=!1,s=iA.EMPTY_NODE;e.syncPointTree_.subtree(r).foreachChild((e,t)=>{const i=Dk(t,dC());i&&(s=s.updateImmediateChild(e,i))})}const h=Bk(l,t);if(!h&&!t._queryParams.loadsAllData()){const i=nR(t);fn(!e.queryToTagMap.has(i),"View does not exist, but we have a tag");const n=Vk++;e.queryToTagMap.set(i,n),e.tagToQueryMap.set(n,i)}let u=Nk(l,t,i,ZA(e.pendingWriteTree_,r),s,o);if(!h&&!a&&!n){const i=Fk(l,t);u=u.concat(function(e,t,i){const n=t._path,r=iR(e,t),s=tR(e,i),a=e.listenProvider_.startListening(oR(t),r,s.hashFn,s.onComplete),o=e.syncPointTree_.subtree(n);if(r)fn(!Uk(o.value),"If we're adding a query, it shouldn't be shadowed");else{const t=o.fold((e,t,i)=>{if(!bC(e)&&t&&Uk(t))return[zk(t).query];{let e=[];return t&&(e=e.concat(Lk(t).map(e=>e.query))),IE(i,(t,i)=>{e=e.concat(i)}),e}});for(let i=0;i<t.length;++i){const n=t[i];e.listenProvider_.stopListening(oR(n),iR(e,n))}}return a}(e,t,i))}return u}function Qk(e,t,i){const n=e.pendingWriteTree_,r=e.syncPointTree_.findOnPath(t,(e,i)=>{const n=Dk(i,wC(e,t));if(n)return n});return nk(n,t,r,i,!0)}function Jk(e,t){const i=t._path;let n=null;e.syncPointTree_.foreachOnPath(i,(e,t)=>{const r=wC(e,i);n=n||Dk(t,r)});let r=e.syncPointTree_.get(i);r?n=n||Dk(r,dC()):(r=new Ok,e.syncPointTree_=e.syncPointTree_.set(i,r));const s=null!=n,a=s?new PA(n,!0,!1):null;return function(e){return FA(e.viewCache_)}(Mk(r,t,ZA(e.pendingWriteTree_,t._path),s?a.getNode():iA.EMPTY_NODE,s))}function Zk(e,t){return $k(t,e.syncPointTree_,null,ZA(e.pendingWriteTree_,dC()))}function $k(e,t,i,n){if(bC(e.path))return eR(e,t,i,n);{const r=t.get(dC());null==i&&null!=r&&(i=Dk(r,dC()));let s=[];const a=fC(e.path),o=e.operationForChild(a),l=t.children.get(a);if(l&&o){const e=i?i.getImmediateChild(a):null,t=uk(n,a);s=s.concat($k(o,l,e,t))}return r&&(s=s.concat(Pk(r,e,n,i))),s}}function eR(e,t,i,n){const r=t.get(dC());null==i&&null!=r&&(i=Dk(r,dC()));let s=[];return t.children.inorderTraversal((t,r)=>{const a=i?i.getImmediateChild(t):null,o=uk(n,t),l=e.operationForChild(t);l&&(s=s.concat(eR(l,r,a,o)))}),r&&(s=s.concat(Pk(r,e,n,i))),s}function tR(e,t){const i=t.query,n=iR(e,i);return{hashFn:()=>{const e=function(e){return e.viewCache_.serverCache.getNode()}(t)||iA.EMPTY_NODE;return e.hash()},onComplete:t=>{if("ok"===t)return n?function(e,t,i){const n=rR(e,i);if(n){const i=sR(n),r=i.path,s=i.queryId,a=wC(r,t);return aR(e,r,new kA(CA(s),a))}return[]}(e,i._path,n):function(e,t){return Zk(e,new kA({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t))}(e,i._path);{const n=function(e,t){let i="Unknown Error";"too_big"===e?i="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"===e?i="Client doesn't have permission to access the desired data.":"unavailable"===e&&(i="The service is unavailable");const n=new Error(e+" at "+t._path.toString()+": "+i);return n.code=e.toUpperCase(),n}(t,i);return Xk(e,i,null,n)}}}}function iR(e,t){const i=nR(t);return e.queryToTagMap.get(i)}function nR(e){return e._path.toString()+"$"+e._queryIdentifier}function rR(e,t){return e.tagToQueryMap.get(t)}function sR(e){const t=e.indexOf("$");return fn(-1!==t&&t<e.length-1,"Bad queryKey."),{queryId:e.substr(t+1),path:new cC(e.substr(0,t))}}function aR(e,t,i){const n=e.syncPointTree_.get(t);fn(n,"Missing sync point for query tag that we're tracking");return Pk(n,i,ZA(e.pendingWriteTree_,t),null)}
2function oR(e){return e._queryParams.loadsAllData()&&!e._queryParams.isDefault()?new(fn(Rk,"Reference.ts has not been loaded"),Rk)(e._repo,e._path):e}class lR{constructor(e){this.node_=e}getImmediateChild(e){const t=this.node_.getImmediateChild(e);return new lR(t)}node(){return this.node_}}class hR{constructor(e,t){this.syncTree_=e,this.path_=t}getImmediateChild(e){const t=xC(this.path_,e);return new hR(this.syncTree_,t)}node(){return Qk(this.syncTree_,this.path_)}}const uR=function(e,t,i){return e&&"object"===typeof e?(fn(".sv"in e,"Unexpected leaf node or priority contents"),"string"===typeof e[".sv"]?cR(e[".sv"],t,i):"object"===typeof e[".sv"]?dR(e[".sv"],t):void fn(!1,"Unexpected server value: "+JSON.stringify(e,null,2))):e},cR=function(e,t,i){if("timestamp"===e)return i.timestamp;fn(!1,"Unexpected server value: "+e)},dR=function(e,t,i){e.hasOwnProperty("increment")||fn(!1,"Unexpected server value: "+JSON.stringify(e,null,2));const n=e.increment;"number"!==typeof n&&fn(!1,"Unexpected increment value: "+n);const r=t.node();if(fn(null!==r&&"undefined"!==typeof r,"Expected ChildrenNode.EMPTY_NODE for nulls"),!r.isLeafNode())return n;const s=r.getValue();return"number"!==typeof s?n:s+n},fR=function(e,t,i,n){return mR(t,new hR(i,e),n)},pR=function(e,t,i){return mR(e,new lR(t),i)};function mR(e,t,i){const n=e.getPriority().val(),r=uR(n,t.getImmediateChild(".priority"),i);let s;if(e.isLeafNode()){const n=e,s=uR(n.getValue(),t,i);return s!==n.getValue()||r!==n.getPriority().val()?new XC(s,rA(r)):e}{const n=e;return s=n,r!==n.getPriority().val()&&(s=s.updatePriority(new XC(r))),n.forEachChild(qC,(e,n)=>{const r=mR(n,t.getImmediateChild(e),i);r!==n&&(s=s.updateImmediateChild(e,r))}),s}}class gR{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{children:{},childCount:0};this.name=e,this.parent=t,this.node=i}}function vR(e,t){let i=t instanceof cC?t:new cC(t),n=e,r=fC(i);for(;null!==r;){const e=Kn(n.node.children,r)||{children:{},childCount:0};n=new gR(r,n,e),i=mC(i),r=fC(i)}return n}function yR(e){return e.node.value}function xR(e,t){e.node.value=t,SR(e)}function bR(e){return e.node.childCount>0}function wR(e,t){IE(e.node.children,(i,n)=>{t(new gR(i,e,n))})}function TR(e,t,i,n){i&&!n&&t(e),wR(e,e=>{TR(e,t,!0,n)}),i&&n&&t(e)}function _R(e){return new cC(null===e.parent?e.name:_R(e.parent)+"/"+e.name)}function SR(e){null!==e.parent&&function(e,t,i){const n=function(e){return void 0===yR(e)&&!bR(e)}(i),r=qn(e.node.children,t);n&&r?(delete e.node.children[t],e.node.childCount--,SR(e)):n||r||(e.node.children[t]=i.node,e.node.childCount++,SR(e))}(e.parent,e.name,e)}const ER=/[\[\].#$\/\u0000-\u001F\u007F]/,CR=/[\[\].#$\u0000-\u001F\u007F]/,AR=10485760,kR=function(e){return"string"===typeof e&&0!==e.length&&!ER.test(e)},RR=function(e){return"string"===typeof e&&0!==e.length&&!CR.test(e)},OR=function(e){return null===e||"string"===typeof e||"number"===typeof e&&!CE(e)||e&&"object"===typeof e&&qn(e,".sv")},PR=function(e,t,i,n){n&&void 0===t||MR(ar(e,"value"),t,i)},MR=function(e,t,i){const n=i instanceof cC?new EC(i,e):i;if(void 0===t)throw new Error(e+"contains undefined "+AC(n));if("function"===typeof t)throw new Error(e+"contains a function "+AC(n)+" with contents = "+t.toString());if(CE(t))throw new Error(e+"contains "+t.toString()+" "+AC(n));if("string"===typeof t&&t.length>AR/3&&or(t)>AR)throw new Error(e+"contains a string greater than "+AR+" utf8 bytes "+AC(n)+" ('"+t.substring(0,50)+"...')");if(t&&"object"===typeof t){let i=!1,r=!1;if(IE(t,(t,s)=>{if(".value"===t)i=!0;else if(".priority"!==t&&".sv"!==t&&(r=!0,!kR(t)))throw new Error(e+" contains an invalid key ("+t+") "+AC(n)+'.  Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');!function(e,t){e.parts_.length>0&&(e.byteLength_+=1),e.parts_.push(t),e.byteLength_+=or(t),CC(e)}(n,t),MR(e,s,n),function(e){const t=e.parts_.pop();e.byteLength_-=or(t),e.parts_.length>0&&(e.byteLength_-=1)}(n)}),i&&r)throw new Error(e+' contains ".value" child '+AC(n)+" in addition to actual children.")}},NR=function(e,t,i,n){if(n&&void 0===t)return;const r=ar(e,"values");if(!t||"object"!==typeof t||Array.isArray(t))throw new Error(r+" must be an object c
2ontaining the children to replace.");const s=[];IE(t,(e,t)=>{const n=new cC(e);if(MR(r,t,xC(i,n)),".priority"===gC(n)&&!OR(t))throw new Error(r+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");s.push(n)}),function(e,t){let i,n;for(i=0;i<t.length;i++){n=t[i];const r=vC(n);for(let t=0;t<r.length;t++)if(".priority"===r[t]&&t===r.length-1);else if(!kR(r[t]))throw new Error(e+"contains an invalid key ("+r[t]+") in path "+n.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"')}t.sort(TC);let r=null;for(i=0;i<t.length;i++){if(n=t[i],null!==r&&SC(r,n))throw new Error(e+"contains a path "+r.toString()+" that is ancestor of another path "+n.toString());r=n}}(r,s)},IR=function(e,t,i){if(!i||void 0!==t){if(CE(t))throw new Error(ar(e,"priority")+"is "+t.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!OR(t))throw new Error(ar(e,"priority")+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},LR=function(e,t,i,n){if((!n||void 0!==i)&&!RR(i))throw new Error(ar(e,t)+'was an invalid path = "'+i+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},DR=function(e,t){if(".info"===fC(t))throw new Error(e+" failed = Can't modify data under /.info/")},FR=function(e,t){const i=t.path.toString();if("string"!==typeof t.repoInfo.host||0===t.repoInfo.host.length||!kR(t.repoInfo.namespace)&&"localhost"!==t.repoInfo.host.split(":")[0]||0!==i.length&&!function(e){return e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),RR(e)}(i))throw new Error(ar(e,"url")+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')};class BR{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function UR(e,t){let i=null;for(let n=0;n<t.length;n++){const r=t[n],s=r.getPath();null===i||_C(s,i.path)||(e.eventLists_.push(i),i=null),null===i&&(i={events:[],path:s}),i.events.push(r)}i&&e.eventLists_.push(i)}function zR(e,t,i){UR(e,i),HR(e,e=>_C(e,t))}function VR(e,t,i){UR(e,i),HR(e,e=>SC(e,t)||SC(t,e))}function HR(e,t){e.recursionDepth_++;let i=!0;for(let n=0;n<e.eventLists_.length;n++){const r=e.eventLists_[n];if(r){t(r.path)?(jR(e.eventLists_[n]),e.eventLists_[n]=null):i=!1}}i&&(e.eventLists_=[]),e.recursionDepth_--}function jR(e){for(let t=0;t<e.events.length;t++){const i=e.events[t];if(null!==i){e.events[t]=null;const n=i.getEventRunner();yE&&wE("event: "+i.toString()),BE(n)}}}const YR="repo_interrupt";class WR{constructor(e,t,i,n){this.repoInfo_=e,this.forceRestClient_=t,this.authTokenProvider_=i,this.appCheckProvider_=n,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new BR,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=xA(),this.transactionQueueTree_=new gR,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host}}function GR(e,t,i){if(e.stats_=$E(e.repoInfo_),e.forceRestClient_||("object"===typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0)e.server_=new vA(e.repoInfo_,(t,i,n,r)=>{KR(e,t,i,n,r)},e.authTokenProvider_,e.appCheckProvider_),setTimeout(()=>QR(e,!0),0);else{if("undefined"!==typeof i&&null!==i){if("object"!==typeof i)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{Gn(i)}catch(oT){throw new Error("Invalid authOverride provided: "+oT)}}e.persistentConnection_=new OC(e.repoInfo_,t,(t,i,n,r)=>{KR(e,t,i,n,r)},t=>{QR(e,t)},t=>{!function(e,t){IE(t,(t,i)=>{JR(e,t,i)})}(e,t)},e.authTokenProvider_,e.appCheckProvider_,i),e.server_=e.persistentConnection_}e.authTokenProvider_.addTokenChangeListener(t=>{e.server_.refreshAuthToken(t)}),e.appCheckProvider_.addTokenChangeListener(t=>{e.server_.refreshAppCheckToken(t.token)}),e.statsReporter_=function(e,t){const i=e.toString();return ZE[i]||(ZE[i]=t()),ZE[i]}(e.repoInfo_,()=>new SA(e.stats_,e.server_)),e.infoData_=new yA,e.infoSyncTree_=new Hk({startListening:(t,i,n,r)=>{let s=[];const a=e.infoData_.getNode(t._path);return a.isEmpty()||(s=Gk(e.infoSyncTree_,t._path,a),setTimeout(()=>{r("ok")},0)),s},stopListening:()=>{}}),JR(e,"connected",!1),e.serverSyncTree_=new Hk({startListening:(t,i,n,r)=>(e.server_.listen(t,n,i,(i,n)=>{const s=r(i,n);VR(e.eventQueue_,t._path,s)}),[]),stopListening:(t,i)=>{e.server_.unlisten(t,i)}})}function XR(e){const t=e.infoData_.getNode(new cC(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+t}function qR(e){return(t=(t={timestamp:XR(e)})||{}).timestamp=t.timestamp||(new Date).getTime(),t;var t}function KR(e,t,i,n,r){e.dataUpdateCount++;const s=new cC(t);i=e.interceptServerDataCallback_?e.interceptServerDataCallback_(t,i):i;let a=[];if(r)if(n){const t=Jn(i,e=>rA(e));a=function(e,t,i,n){const r=rR(e,n);if(r){const n=sR(r),s=n.path,a=n.queryId,o=wC(s,t),l=zA.fromObject(i);return aR(e,s,new OA(CA(a),o,l))}return[]}(e.serverSyncTree_,s,t,r)}else{const t=rA(i);a=qk(e.serverSyncTree_,s,t,r)}else if(n){const t=Jn(i,e=>rA(e));a=function(e,t,i){const n=zA.fromObject(i);return Zk(e,new OA({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t,n))}(e.serverSyncTree_,s,t)}else{const t=rA(i);a=Gk(e.serverSyncTree_,s,t)}let o=s;a.length>0&&(o=lO(e,s)),VR(e.eventQueue_,o,a)}function QR(e,t){JR(e,"connected",t),!1===t&&function(e){rO(e,"onDisconnectEvents");const t=qR(e),i=xA();TA(e.onDisconnect_,dC(),(n,r)=>{const s=fR(n,r,e.serverSyncTree_,t);bA(i,n,s)});let n=[];TA(i,dC(),(t,i)=>{n=n.concat(Gk(e.serverSyncTree_,t,i));const r=fO(e,t);lO(e,r)}),e.onDisconnect_=xA(),VR(e.eventQueue_,dC(),n)}(e)}function JR(e,t,i){const n=new cC("/.info/"+t),r=rA(i);e.infoData_.updateSnapshot(n,r);const s=Gk(e.infoSyncTree_,n,r);VR(e.eventQueue_,n,s)}function ZR(e){return e.nextWriteId_++}function $R(e,t,i,n,r){rO(e,"set",{path:t.toString(),value:i,priority:n});const s=qR(e),a=rA(i,n),o=Qk(e.serverSyncTree_,t),l=pR(a,o,s),h=ZR(e),u=jk(e.serverSyncTree_,t,l,h,!0);UR(e.eventQueue_,u),e.server_.put(t.toString(),a.val(!0),(i,n)=>{const s="ok"===i;s||EE("set at "+t+" failed: "+i);const a=Wk(e.serverSyncTree_,h,!s);VR(e.eventQueue_,t,a),sO(e,r,i,n)});const c=fO(e,t);lO(e,c),VR(e.eventQueue_,c,[])}function eO(e,t,i){e.server_.onDisconnectCancel(t.toString(),(n,r)=>{"ok"===n&&wA(e.onDisconnect_,t),sO(e,i,n,r)})}function tO(e,t,i,n){const r=rA(i);e.server_.onDisconnectPut(t.toString(),r.val(!0),(i,s)=>{"ok"===i&&bA(e.onDisconnect_,t,r),sO(e,n,i,s)})}function iO(e,t,i){let n;n=".info"===fC(t._path)?Xk(e.infoSyncTree_,t,i):Xk(e.serverSyncTree_,t,i),zR(e.eventQueue_,t._path,n)}function nO(e){e.persistentConnection_&&e.persistentConnection_.interrupt(YR)}function rO(e){let t="";e.persistentConnection_&&(t=e.persistentConnection_.id+":");for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];wE(t,...n)}function sO(e,t,i,n){t&&BE(()=>
2{if("ok"===i)t(null);else{const e=(i||"error").toUpperCase();let r=e;n&&(r+=": "+n);const s=new Error(r);s.code=e,t(s)}})}function aO(e,t,i){return Qk(e.serverSyncTree_,t,i)||iA.EMPTY_NODE}function oO(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.transactionQueueTree_;if(t||dO(e,t),yR(t)){const i=uO(e,t);fn(i.length>0,"Sending zero length transaction queue");i.every(e=>0===e.status)&&function(e,t,i){const n=i.map(e=>e.currentWriteId),r=aO(e,t,n);let s=r;const a=r.hash();for(let h=0;h<i.length;h++){const e=i[h];fn(0===e.status,"tryToSendTransactionQueue_: items in queue should all be run."),e.status=1,e.retryCount++;const n=wC(t,e.path);s=s.updateChild(n,e.currentOutputSnapshotRaw)}const o=s.val(!0),l=t;e.server_.put(l.toString(),o,n=>{rO(e,"transaction put response",{path:l.toString(),status:n});let r=[];if("ok"===n){const n=[];for(let t=0;t<i.length;t++)i[t].status=2,r=r.concat(Wk(e.serverSyncTree_,i[t].currentWriteId)),i[t].onComplete&&n.push(()=>i[t].onComplete(null,!0,i[t].currentOutputSnapshotResolved)),i[t].unwatcher();dO(e,vR(e.transactionQueueTree_,t)),oO(e,e.transactionQueueTree_),VR(e.eventQueue_,t,r);for(let e=0;e<n.length;e++)BE(n[e])}else{if("datastale"===n)for(let e=0;e<i.length;e++)3===i[e].status?i[e].status=4:i[e].status=0;else{EE("transaction at "+l.toString()+" failed: "+n);for(let e=0;e<i.length;e++)i[e].status=4,i[e].abortReason=n}lO(e,t)}},a)}(e,_R(t),i)}else bR(t)&&wR(t,t=>{oO(e,t)})}function lO(e,t){const i=hO(e,t),n=_R(i);return function(e,t,i){if(0===t.length)return;const n=[];let r=[];const s=t.filter(e=>0===e.status),a=s.map(e=>e.currentWriteId);for(let o=0;o<t.length;o++){const s=t[o],l=wC(i,s.path);let h,u=!1;if(fn(null!==l,"rerunTransactionsUnderNode_: relativePath should not be null."),4===s.status)u=!0,h=s.abortReason,r=r.concat(Wk(e.serverSyncTree_,s.currentWriteId,!0));else if(0===s.status)if(s.retryCount>=25)u=!0,h="maxretry",r=r.concat(Wk(e.serverSyncTree_,s.currentWriteId,!0));else{const i=aO(e,s.path,a);s.currentInputSnapshot=i;const n=t[o].update(i.val());if(void 0!==n){MR("transaction failed: Data returned ",n,s.path);let t=rA(n);"object"===typeof n&&null!=n&&qn(n,".priority")||(t=t.updatePriority(i.getPriority()));const o=s.currentWriteId,l=qR(e),h=pR(t,i,l);s.currentOutputSnapshotRaw=t,s.currentOutputSnapshotResolved=h,s.currentWriteId=ZR(e),a.splice(a.indexOf(o),1),r=r.concat(jk(e.serverSyncTree_,s.path,h,s.currentWriteId,s.applyLocally)),r=r.concat(Wk(e.serverSyncTree_,o,!0))}else u=!0,h="nodata",r=r.concat(Wk(e.serverSyncTree_,s.currentWriteId,!0))}VR(e.eventQueue_,i,r),r=[],u&&(t[o].status=2,function(e){setTimeout(e,Math.floor(0))}(t[o].unwatcher),t[o].onComplete&&("nodata"===h?n.push(()=>t[o].onComplete(null,!1,t[o].currentInputSnapshot)):n.push(()=>t[o].onComplete(new Error(h),!1,null))))}dO(e,e.transactionQueueTree_);for(let o=0;o<n.length;o++)BE(n[o]);oO(e,e.transactionQueueTree_)}(e,uO(e,i),n),n}function hO(e,t){let i,n=e.transactionQueueTree_;for(i=fC(t);null!==i&&void 0===yR(n);)n=vR(n,i),i=fC(t=mC(t));return n}function uO(e,t){const i=[];return cO(e,t,i),i.sort((e,t)=>e.order-t.order),i}function cO(e,t,i){const n=yR(t);if(n)for(let r=0;r<n.length;r++)i.push(n[r]);wR(t,t=>{cO(e,t,i)})}function dO(e,t){const i=yR(t);if(i){let e=0;for(let t=0;t<i.length;t++)2!==i[t].status&&(i[e]=i[t],e++);i.length=e,xR(t,i.length>0?i:void 0)}wR(t,t=>{dO(e,t)})}function fO(e,t){const i=_R(hO(e,t)),n=vR(e.transactionQueueTree_,t);return function(e,t,i){let n=i?e:e.parent;for(;null!==n;){if(t(n))return!0;n=n.parent}}(n,t=>{pO(e,t)}),pO(e,n),TR(n,t=>{pO(e,t)}),i}function pO(e,t){const i=yR(t);if(i){const n=[];let r=[],s=-1;for(let t=0;t<i.length;t++)3===i[t].status||(1===i[t].status?(fn(s===t-1,"All SENT items should be at beginning of queue."),s=t,i[t].status=3,i[t].abortReason="set"):(fn(0===i[t].status,"Unexpected transaction status in abort"),i[t].unwatcher(),r=r.concat(Wk(e.serverSyncTree_,i[t].currentWriteId,!0)),i[t].onComplete&&n.push(i[t].onComplete.bind(null,new Error("set"),!1,null))));-1===s?xR(t,void 0):i.length=s+1,VR(e.eventQueue_,_R(t),r);for(let e=0;e<n.length;e++)BE(n[e])}}const mO=function(e,t){const i=gO(e),n=i.namespace;"firebase.com"===i.domain&&SE(i.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),n&&"undefined"!==n||"localhost"===i.domain||SE("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),i.secure||"undefined"!==typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&EE("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");const r="ws"===i.scheme||"wss"===i.scheme;return{repoInfo:new qE(i.host,i.secure,n,r,t,"",n!==i.subdomain),path:new cC(i.pathString)}},gO=function(e){let t="",i="",n="",r="",s="",a=!0,o="https",l=443;if("string"===typeof e){let h=e.indexOf("//");h>=0&&(o=e.substring(0,h-1),e=e.substring(h+2));let u=e.indexOf("/");-1===u&&(u=e.length);let c=e.indexOf("?");-1===c&&(c=e.length),t=e.substring(0,Math.min(u,c)),u<c&&(r=function(e){let t="";const i=e.split("/");for(let n=0;n<i.length;n++)if(i[n].length>0){let e=i[n];try{e=decodeURIComponent(e.replace(/\+/g," "))}catch(oT){}t+="/"+e}return t}(e.substring(u,c)));const d=function(e){const t={};"?"===e.charAt(0)&&(e=e.substring(1));for(const i of e.split("&")){if(0===i.length)continue;const n=i.split("=");
22===n.length?t[decodeURIComponent(n[0])]=decodeURIComponent(n[1]):EE("Invalid query segment '".concat(i,"' in query '").concat(e,"'"))}return t}(e.substring(Math.min(e.length,c)));h=t.indexOf(":"),h>=0?(a="https"===o||"wss"===o,l=parseInt(t.substring(h+1),10)):h=t.length;const f=t.slice(0,h);if("localhost"===f.toLowerCase())i="localhost";else if(f.split(".").length<=2)i=f;else{const e=t.indexOf(".");n=t.substring(0,e).toLowerCase(),i=t.substring(e+1),s=n}"ns"in d&&(s=d.ns)}return{host:t,port:l,domain:i,subdomain:n,secure:a,scheme:o,pathString:r,namespace:s}},vO="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",yO=function(){let e=0;const t=[];return function(i){const n=i===e;let r;e=i;const s=new Array(8);for(r=7;r>=0;r--)s[r]=vO.charAt(i%64),i=Math.floor(i/64);fn(0===i,"Cannot push at time == 0");let a=s.join("");if(n){for(r=11;r>=0&&63===t[r];r--)t[r]=0;t[r]++}else for(r=0;r<12;r++)t[r]=Math.floor(64*Math.random());for(r=0;r<12;r++)a+=vO.charAt(t[r]);return fn(20===a.length,"nextPushId: Length should be 20."),a}}();class xO{constructor(e,t,i,n){this.eventType=e,this.eventRegistration=t,this.snapshot=i,this.prevName=n}getPath(){const e=this.snapshot.ref;return"value"===this.eventType?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+Gn(this.snapshot.exportVal())}}class bO{constructor(e,t,i){this.eventRegistration=e,this.error=t,this.path=i}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}}class wO{constructor(e,t){this.snapshotCallback=e,this.cancelCallback=t}onValue(e,t){this.snapshotCallback.call(null,e,t)}onCancel(e){return fn(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,e)}get hasCancelCallback(){return!!this.cancelCallback}matches(e){return this.snapshotCallback===e.snapshotCallback||void 0!==this.snapshotCallback.userCallback&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context}}class TO{constructor(e,t){this._repo=e,this._path=t}cancel(){const e=new On;return eO(this._repo,this._path,e.wrapCallback(()=>{})),e.promise}remove(){DR("OnDisconnect.remove",this._path);const e=new On;return tO(this._repo,this._path,null,e.wrapCallback(()=>{})),e.promise}set(e){DR("OnDisconnect.set",this._path),PR("OnDisconnect.set",e,this._path,!1);const t=new On;return tO(this._repo,this._path,e,t.wrapCallback(()=>{})),t.promise}setWithPriority(e,t){DR("OnDisconnect.setWithPriority",this._path),PR("OnDisconnect.setWithPriority",e,this._path,!1),IR("OnDisconnect.setWithPriority",t,!1);const i=new On;return function(e,t,i,n,r){const s=rA(i,n);e.server_.onDisconnectPut(t.toString(),s.val(!0),(i,n)=>{"ok"===i&&bA(e.onDisconnect_,t,s),sO(0,r,i,n)})}(this._repo,this._path,e,t,i.wrapCallback(()=>{})),i.promise}update(e){DR("OnDisconnect.update",this._path),NR("OnDisconnect.update",e,this._path,!1);const t=new On;return function(e,t,i,n){if(Qn(i))return wE("onDisconnect().update() called with empty data.  Don't do anything."),void sO(0,n,"ok",void 0);e.server_.onDisconnectMerge(t.toString(),i,(r,s)=>{"ok"===r&&IE(i,(i,n)=>{const r=rA(n);bA(e.onDisconnect_,xC(t,i),r)}),sO(0,n,r,s)})}(this._repo,this._path,e,t.wrapCallback(()=>{})),t.promise}}class _O{constructor(e,t,i,n){this._repo=e,this._path=t,this._queryParams=i,this._orderByCalled=n}get key(){return bC(this._path)?null:gC(this._path)}get ref(){return new SO(this._repo,this._path)}get _queryIdentifier(){const e=gA(this._queryParams),t=ME(e);return"{}"===t?"default":t}get _queryObject(){return gA(this._queryParams)}isEqual(e){if(!((e=hr(e))instanceof _O))return!1;const t=this._repo===e._repo,i=_C(this._path,e._path),n=this._queryIdentifier===e._queryIdentifier;return t&&i&&n}toJSON(){return this.toString()}toString(){return this._repo.toString()+function(e){let t="";for(let i=e.pieceNum_;i<e.pieces_.length;i++)""!==e.pieces_[i]&&(t+="/"+encodeURIComponent(String(e.pieces_[i])));return t||"/"}(this._path)}}class SO extends _O{constructor(e,t){super(e,t,new pA,!1)}get parent(){const e=yC(this._path);return null===e?null:new SO(this._repo,e)}get root(){let e=this;for(;null!==e.parent;)e=e.parent;return e}}class EO{constructor(e,t,i){this._node=e,this.ref=t,this._index=i}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(e){const t=new cC(e),i=AO(this.ref,e);return new EO(this._node.getChild(t),i,qC)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(e){if(this._node.isLeafNode())return!1;return!!this._node.forEachChild(this._index,(t,i)=>e(new EO(i,AO(this.ref,t),qC)))}hasChild(e){const t=new cC(e);return!this._node.getChild(t).isEmpty()}hasChildren(){return!this._node.isLeafNode()&&!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}}function CO(e,t){return(e=hr(e))._checkNotDeleted("ref"),void 0!==t?AO(e._root,t):e._root}function AO(e,t){var i,n,r,s;return null===fC((e=hr(e))._path)?(i="child",n="path",s=!1,(r=t)&&(r=r.replace(/^\/*\.info(\/|$)/,"/")),LR(i,n,r,s)):LR("child","path",t,!1),new SO(e._repo,xC(e._path,t))}function kO(e){return DR("remove",e._path),RO(e,null)}function RO(e,t){e=hr(e),DR("set",e._path),PR("set",t,e._path,!1);const i=new On;return $R(e._repo,e._path,t,null,i.wrapCallback(()=>{})),i.promise}function OO(e,t){NR("update",t,e._path,!1);const i=new On;return function(e,t,i,n){rO(e,"update",{path:t.toString(),value:i});let r=!0;const s=qR(e),a={};if(IE(i,(i,n)=>{r=!1,a[i]=fR(xC(t,i),rA(n),e.serverSyncTree_,s)}),r)wE("update() called with empty data.  Don't do anything."),sO(0,n,"ok",void 0);else{const r=ZR(e),s=Yk(e.serverSyncTree_,t,a,r);UR(e.eventQueue_,s),e.server_.merge(t.toString(),i,(i,s)=>{const a="ok"===i;a||EE("update at "+t+" failed: "+i);const o=Wk(e.serverSyncTree_,r,!a),l=o.length>0?lO(e,t):t;VR(e.eventQueue_,l,o),sO(0,n,i,s)}),IE(i,i=>{const n=fO(e,xC(t,i));lO(e,n)}),VR(e.eventQueue_,t,[])}}(e._repo,e._path,t,i.wrapCallback(()=>{})),i.promise}function PO(e){e=hr(e);const t=new wO(()=>{}),i=new MO(t);return function(e,t,i){const n=Jk(e.serverSyncTree_,t);return null!=n?Promise.resolve(n):e.server_.get(t).then(n=>{const r=rA(n).withIndex(t._queryParams.getIndex());let s;if(Kk(e.serverSyncTree_,t,i,!0),t._queryParams.loadsAllData())s=Gk(e.serverSyncTree_,t._path,r);else{const i=iR(e.serverSyncTree_,t);s=qk(e.serverSyncTree_,t._path,r,i)}return VR(e.eventQueue_,t._path,s),Xk(e.serverSyncTree_,t,i,null,!0),r},i=>(rO(e,"get for query "+Gn(t)+" failed: "+i),Promise.reject(new Error(i))))}(e._repo,e,i).then(t=>new EO(t,new SO(e._repo,e._path),e._queryParams.getIndex()))}class MO{constructor(e){this.callbackContext=e}respondsTo(e){return"value"===e}createEvent(e,t){const i=t._queryParams.getIndex();return new xO("value",this,new EO(e.snapshotNode,new SO(t._repo,t._path),i))}getEventRunner(e){return"cancel"===e.getEventType()?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,null)}createCancelEvent(e,t){return this.callbackContext.hasCancelCallback?new bO(this,e,t):null}matches(e){return e instanceof MO&&(!e.callbackContext||!this.callbackContext||e.callbackContext.matches(this.callbackContext))}hasAnyCallback(){return null!==this.callbackContext}}class NO{constructor(e,t){this.eventType=e,this.callbackContext=t}respondsTo(e){let t="children_added"===e?"child_added":e;return t="children_removed"===t?"child_removed":t,this.eventType===t}createCancelEvent(e,t){return this.callbackContext.hasCancelCallback?new bO(this,e,t):null}createEvent(e,t){fn(null!=e.childName,"Child events should have a childName.");const i=AO(new SO(t._repo,t._path),e.childName),n=t._queryParams.getIndex();return new xO(e.type,this,new EO(e.snapshotNode,i,n),e.prevName)}getEventRunner(e){return"cancel"===e.getEventType()?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,e.prevName)}matches(e){return e instanceof NO&&(this.eventType===e.eventType&&(!this.callbackContext||!e.callbackContext||this.callbackContext.matches(e.callbackContext)))}hasAnyCallback(){return!!this.callbackContext}}function IO(e,t,i,n,r){let s;if("object"===typeof n&&(s=void 0,r=n),"function"===typeof n&&(s=n),r&&r.onlyOnce){const t=i,n=(i,n)=>{iO(e._repo,e,o),t(i,n)};n.userCallback=i.userCallback,n.context=i.context,i=n}const a=new wO(i,s||void 0),o="value"===t?new MO(a):new NO(t,a);return function(e,t,i){let n;n=".info"===fC(t._path)?Kk(e.infoSyncTree_,t,i):Kk(e.serverSyncTree_,t,i),zR(e.eventQueue_,t._path,n)}(e._repo,e,o),()=>iO(e._repo,e,o)}function LO(e,t,i,n){return IO(e,"value",t,i,n)}function DO(e,t,i){let n=null;const r=i?new wO(i):null;"value"===t?n=new MO(r):t&&(n=new NO(t,r)),iO(e._repo,e,n)}!function(e){fn(!kk,"__referenceConstructor has already been defined"),kk=e}(SO),function(e){fn(!Rk,"__referenceConstructor has already been defined"),Rk=e}(SO);const FO={};let BO=!1;function UO(e,t,i,n,r){let s=n||e.options.databaseURL;void 0===s&&(e.options.projectId||SE("Can't determine Firebase Database URL. Be sure to include  a Project ID when calling firebase.initializeApp()."),wE("Using default host for project ",e.options.projectId),s="".concat(e.options.projectId,"-default-rtdb.firebaseio.com"));let a,o,l=mO(s,r),h=l.repoInfo;"undefined"!==typeof process&&(o={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.FIREBASE_DATABASE_EMULATOR_HOST),o?(a=!0,s="http://".concat(o,"?ns=").concat(h.namespace),l=mO(s,r),h=l.repoInfo):a=!l.repoInfo.secure;const u=r&&a?new HE(HE.OWNER):new VE(e.name,e.options,t);FR("Invalid Firebase Database URL",l),bC(l.path)||SE("Database URL must point to the root of a Firebase Database (not including a child path).");const c=function(e,t,i,n){let r=FO[t.name];r||(r={},FO[t.name]=r);let s=r[e.toURLString()];s&&SE("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.");return s=new WR(e,BO,i,n),r[e.toURLString()]=s,s}(h,e,u,new zE(e,i));return new zO(c,e)}class zO{constructor(e,t){this._repoInternal=e,this.app=t,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(GR(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new SO(this._repo,dC())),this._rootInternal}_delete(){return null!==this._rootInternal&&(!function(e,t){const i=FO[t];i&&i[e.key]===e||SE("Database ".concat(t,"(").concat(e.repoInfo_,") has already been deleted.")),nO(e),delete i[e.key]}(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){null===this._rootInternal&&SE("Cannot call "+e+" on a deleted database.")}}function VO(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rs(),t=arguments.length>1?arguments[1]:void 0;const i=_s(e,"database").getImmediate({identifier:t});if(!i._instanceStarted){const e=An("database");e&&function(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e=hr(e),e._checkNotDeleted("useEmulator");const r="".concat(t,":").concat(i),s=e._repoInternal;if(e._instanceStarted){if(r===e._repoInternal.repoInfo_.host&&Zn(n,s.repoInfo_.emulatorOptions))return;
2SE("connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.")}let a;if(s.repoInfo_.nodeAdmin)n.mockUserToken&&SE('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),a=new HE(HE.OWNER);else if(n.mockUserToken){const t="string"===typeof n.mockUserToken?n.mockUserToken:Pn(n.mockUserToken,e.app.options.projectId);a=new HE(t)}ur(t)&&cr(t);!function(e,t,i,n){const r=t.lastIndexOf(":"),s=ur(t.substring(0,r));e.repoInfo_=new qE(t,s,e.repoInfo_.namespace,e.repoInfo_.webSocketOnly,e.repoInfo_.nodeAdmin,e.repoInfo_.persistenceKey,e.repoInfo_.includeNamespaceInQueryParams,!0,i),n&&(e.authTokenProvider_=n)}(s,r,n,a)}(i,...e)}return i}OC.prototype.simpleListen=function(e,t){this.sendRequest("q",{p:e},t)},OC.prototype.echo=function(e,t){this.sendRequest("echo",{d:e},t)};!function(e){lE(As),Ts(new dr("database",(e,t)=>{let i=t.instanceIdentifier;return UO(e.getProvider("app").getImmediate(),e.getProvider("auth-internal"),e.getProvider("app-check-internal"),i)},"PUBLIC").setMultipleInstances(!0)),Os(sE,aE,e),Os(sE,aE,"esm2020")}();const HO=ks({apiKey:"AIzaSyAfEQrBiXATvOsr3ET7UT-DKDAWqWAB7rQ",authDomain:"sogioyna.firebaseapp.com",databaseURL:"https://sogioyna-default-rtdb.europe-west1.firebasedatabase.app/",projectId:"sogioyna",storageBucket:"sogioyna.firebasestorage.app",messagingSenderId:"263432863930",appId:"1:263432863930:web:a5f47e64e7d1ec86284283",measurementId:"G-HETCL6YKQK"}),jO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rs();const t=_s(e,"auth");if(t.isInitialized())return t.getImmediate();const i=function(e,t){const i=_s(e,"auth");if(i.isInitialized()){const e=i.getImmediate();if(Zn(i.getOptions(),null!==t&&void 0!==t?t:{}))return e;Ks(e,"already-initialized")}return i.initialize({options:t})}(e,{popupRedirectResolver:sh,persistence:[ml,Ko,el]}),n=Rn("authTokenSyncURL");if(n&&"boolean"===typeof isSecureContext&&isSecureContext){const e=new URL(n,location.origin);if(location.origin===e.origin){const t=(r=e.toString(),async e=>{const t=e&&await e.getIdTokenResult(),i=t&&((new Date).getTime()-Date.parse(t.issuedAtTime))/1e3;if(i&&i>hh)return;const n=null===t||void 0===t?void 0:t.token;uh!==n&&(uh=n,await fetch(r,{method:n?"POST":"DELETE",headers:n?{Authorization:"Bearer ".concat(n)}:{}}))});!function(e,t,i){hr(e).beforeAuthStateChanged(t,i)}(i,t,()=>t(i.currentUser)),function(e,t,i,n){hr(e).onIdTokenChanged(t,i,n)}(i,e=>t(e))}}var r;const s=Cn("auth");return s&&yo(i,"http://".concat(s)),i}(HO);(function(e,t){return hr(e).setPersistence(t)})(jO,Ko).catch(e=>console.error(e));const YO=function(e,t){const i="object"==typeof e?e:Rs(),n="string"==typeof e?e:t||Hd,r=_s(i,"firestore").getImmediate({identifier:n});if(!r._initialized){const e=An("firestore");e&&function(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e=bc(e,nv);const r=ur(t),s=e._getSettings(),a=m(m({},s),{},{emulatorOptions:e._getEmulatorOptions()}),o="".concat(t,":").concat(i);r&&cr("https://".concat(o)),s.host!==ev&&s.host!==o&&Bu("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const l=m(m({},s),{},{host:o,ssl:r,emulatorOptions:n});if(!Zn(l,a)&&(e._setSettings(l),n.mockUserToken)){let t,i;if("string"==typeof n.mockUserToken)t=n.mockUserToken,i=Mu.MOCK_USER;else{var h;t=Pn(n.mockUserToken,null===(h=e._app)||void 0===h?void 0:h.options.projectId);const r=n.mockUserToken.sub||n.mockUserToken.user_id;if(!r)throw new Wu(Yu.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");i=new Mu(r)}e._authCredentials=new Ku(new Xu(t,i))}}(r,...e)}return r}(HO),WO=(VO(HO),new Lo);WO.setCustomParameters({prompt:"select_account"});let GO=null;function XO(e){GO&&iE(GO,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}async function qO(e){const t=lv(YO,"users",e.uid),i=await P_(t),n=(new Date).toISOString().split("T")[0];if(i.exists()){const e=i.data(),r=e.lastLoginDate;if(r!==n){let i=1;if(r){const t=new Date(r),s=new Date(n),a=Math.abs(s-t),o=Math.ceil(a/864e5);1===o?i=(e.streak||0)+1:o>1&&(i=1)}const s=function(e,t){const i=[...e];t>=10&&!i.some(e=>"streak_10"===e.id)&&i.push({id:"streak_10",title:"10 G\xfcnl\xfck Seri",icon:"\ud83d\udd25",desc:"10 g\xfcn aral\u0131ks\u0131z giri\u015f yap\u0131ld\u0131."});return i}(e.ribbons||[],i);await N_(t,{streak:i,lastLoginDate:n,ribbons:s,updatedAt:Iv()})}}else await function(e,t,i){e=bc(e,sv);const n=bc(e.firestore,i_),r=E_(e.converter,t,i);return L_(n,[vv(gv(n),"setDoc",e._key,r,null!==e.converter,i).toMutation(e._key,jf.none())])}(t,{nickname:e.displayName||"Oyuncu",email:e.email||"",photoURL:e.ph
2otoURL||"",nicknameChanged:!1,gamesPlayed:0,wins:0,draws:0,losses:0,score:0,streak:1,lastLoginDate:n,ribbons:[],createdAt:Iv(),updatedAt:Iv()})}async function KO(e,t){let i=t.result,n=t.reason,r=t.history,s=t.opponentNickname,a=t.isMultiplayer,o=void 0!==a&&a;const l=lv(YO,"users",e),h=ov(YO,"users",e,"games");await function(e,t){const i=bc(e.firestore,i_),n=lv(e),r=E_(e.converter,t);return L_(i,[vv(gv(e.firestore),"addDoc",n._key,r,null!==e.converter,{}).toMutation(n._key,jf.exists(!1))]).then(()=>n)}(h,{result:i,reason:n||null,moveCount:r.length,history:r||[],opponentNickname:s||"Bilgisayar",isMultiplayer:o,playedAt:Iv()});const u=await P_(l),c=u.exists()?u.data():{gamesPlayed:0,wins:0,draws:0,losses:0,score:0,ribbons:[]},d=(c.gamesPlayed||0)+1,f=(c.wins||0)+("win"===i?1:0),p=(c.draws||0)+("draw"===i?1:0),m=(c.losses||0)+("loss"===i?1:0);let g=0;o?"win"===i?g=5:"draw"===i?g=1:"loss"===i&&(g=-2):"win"===i?g=2:"draw"===i?g=1:"loss"===i&&(g=0);const v=c.score||0,y=Math.max(0,v+g),x=function(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;const s=new Set(e.map(e=>e.id)),a=e=>{s.has(e)||s.add(e)};t>=1&&a("streak_1");t>=3&&a("streak_3");t>=7&&a("streak_7");t>=10&&a("streak_10");t>=25&&a("streak_25");t>=50&&a("streak_50");i>=1&&a("games_1");i>=3&&a("games_3");i>=10&&a("games_10");i>=25&&a("games_25");i>=50&&a("games_50");i>=100&&a("games_100");n>=1&&a("wins_1");n>=3&&a("wins_3");n>=5&&a("wins_5");n>=10&&a("wins_10");n>=25&&a("wins_25");r>=1&&a("mp_1");r>=3&&a("mp_3");r>=10&&a("mp_10");return Array.from(s).map(e=>({id:e}))}(c.ribbons||[],c.streak||1,d,f);await N_(l,{gamesPlayed:d,wins:f,draws:p,losses:m,score:y,ribbons:x,updatedAt:Iv()})}(async function(){if(Ln())return!1;if(!Vn())return!1;if(!Un())return!1;try{return await zn()}catch(_E){return!1}})().then(e=>{e&&(GO=eE(HO))}).catch(e=>console.error("Analytics desteklenmiyor:",e));var QO=i(579);const JO=(0,e.createContext)(null);function ZO(t){let i=t.children;const n=u((0,e.useState)(null),2),r=n[0],s=n[1],a=u((0,e.useState)(null),2),o=a[0],l=a[1],h=u((0,e.useState)(!0),2),c=h[0],d=h[1],f=u((0,e.useState)(!1),2),p=f[0],g=f[1];(0,e.useEffect)(()=>{const e=function(e,t,i,n){return hr(e).onAuthStateChanged(t,i,n)}(jO,async e=>{if(s(e),e)try{await qO(e)}catch(oT){console.error("Profil hatas\u0131:",oT)}else l(null);d(!1),g(!1)});return e},[]),(0,e.useEffect)(()=>{if(!r)return;const e=function(e,t){return I_(lv(YO,"users",e),e=>{t(e.exists()?m({id:e.id},e.data()):null)})}(r.uid,l);return e},[r]);return(0,QO.jsx)(JO.Provider,{value:{user:r,profile:o,loading:c,loggingIn:p,login:async()=>{if(!p){g(!0);try{await async function(e,t,i){if(Ss(e.app))return Promise.reject(Qs(e,"operation-not-supported-in-this-environment"));const n=ro(e);$s(e,t,Mo);const r=wl(n,i);return new kl(n,"signInViaPopup",t,r).executeNotNull()}(jO,WO),hn.success("Giri\u015f ba\u015far\u0131l\u0131!"),XO("login",{method:"Google"})}catch(e){g(!1),console.error("Giri\u015f hatas\u0131:",e),"auth/popup-closed-by-user"!==e.code&&"auth/cancelled-popup-request"!==e.code&&hn.error("Giri\u015f yap\u0131c\u0131 hata: ".concat(e.code||e.message))}}},logout:()=>(XO("logout"),function(e){return hr(e).signOut()}(jO))},children:i})}function $O(){return(0,e.useContext)(JO)}function eP(t){let i=t.onNavigate,n=void 0===i?()=>{}:i;const r=$O(),s=r.user,a=r.profile,o=r.loading,l=r.loggingIn,h=r.login,c=r.logout,d=u((0,e.useState)(!1),2),f=d[0],p=d[1],m=(0,e.useRef)(null);if((0,e.useEffect)(()=>{const e=e=>{m.current&&!m.current.contains(e.target)&&p(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[]),o)return(0,QO.jsx)("span",{className:"navbar-text text-light small px-2",children:"Y\xfckleniyor\u2026"});if(!s)return(0,QO.jsx)("button",{type:"button",className:"btn btn-light btn-sm ms-lg-2 my-2 my-lg-0",disabled:l,onClick:async()=>{try{await h()}catch(e){console.error("Giri\u015f ba\u015far\u0131s\u0131z:",e),hn.error("Giri\u015f ba\u015far\u0131s\u0131z: ".concat(e.code||e.message||"bilinmeyen hata"))}},children:l?"Giri\u015f yap\u0131l\u0131yor\u2026":"Gmail ile Giri\u015f Yap"});const g=(null===a||void 0===a?void 0:a.nickname)||s.displayName||"Oyuncu",v=(null===a||void 0===a?void 0:a.streak)||1;return(0,QO.jsxs)("div",{className:"d-flex align-items-center gap-2 ms-lg-2 my-2 my-lg-0",ref:m,children:[(0,QO.jsxs)("div",{className:"badge bg-warning text-dark d-flex align-items-center gap-1 py-1 px-2 shadow-sm",title:"".concat(v," g\xfcn aral\u0131ks\u0131z giri\u015f yap\u0131ld\u0131!"),style:{fontSize:"0.85rem"},children:[(0,QO.jsx)("span",{children:"\ud83d\udd25"}),(0,QO.jsxs)("span",{className:"fw-bold",children:[v," G\xfcn"]})]}),(0,QO.jsxs)("div",{className:"position-relative",children:[(0,QO.jsxs)("button",{type:"button",className:"btn btn-outline-light btn-sm d-flex align-items-center gap-2",onClick:()=>p(e=>!e),children:[s.photoURL&&(0,QO.jsx)("img",{src:s.photoURL,alt:"",width:22,height:22,className:"rounded-circle",referrerPolicy:"no-referrer"}),(0,QO.jsx)("span",{children:g})]}),f&&(0,QO.jsxs)("div",{className:"dropdown-menu dropdown-menu-end show mt-1",style:{position:"absolute",right:0,left:"auto",zIndex:1e3},children:[(0,QO.jsx)(Ht,{className:"dropdown-item",to:"/profil",onClick:()=>{p(!1),n()},children:"Profilim & Rozetlerim"}),(0,QO.jsx)("button",{type:"button",className:"dropdown-item",onClick:()=>{p(!1),n(),c()},children:"\xc7\u0131k\u0131\u015f Yap"})]})]})]})}const tP=[{to:"/arena",label:"\u015eogi Arena"},{to:"/nasil-oynanir",label:"\u015eogi Nas\u0131l Oynan\u0131r?"},{to:"/taslar",label:"\u015eogi Ta\u015flar\u0131"},{to:"/kurallar",label:"\u015eogi Kurallar\u0131"},{to:"/oyna",label:"\u015eogi Oyna"},{to:"/liderlik-tablosu",label:"Liderlik Tablosu"}];function iP(){const t=u((0,e.useState)(!1),2),i=t[0],n=t[1],r=e=>"nav-link"+(e.isActive?" active fw-bold":"");return(0,QO.jsx)("nav",{className:"navbar navbar-expand-lg sticky-top shadow-sm",children:(0,QO.jsxs)("div",{className:"container-fluid",children:[(0,QO.jsx)(jt,{className:"navbar-brand fw-bold",to:"/",onClick:()=>n(!1),children:"\u5c06\u68cb \u015eogi T\xfcrkiye"}),(0,QO.jsx)("button",{className:"navbar-toggler",type:"button",onClick:()=>n(e=>!e),"aria-controls":"mainNavbar","aria-expanded":i,"aria-label":"Men\xfcy\xfc a\xe7/kapat",children:(0,QO.jsx)("span",{className:"navbar-toggler-icon"})}),(0,QO.jsx)("div",{className:"collapse navbar-collapse ".concat(i?"show":""),id:"mainNavbar",children:(0,QO.jsxs)("ul",{className:"navbar-nav ms-auto mb-2 mb-lg-0 text-center align-items-lg-center",children:[tP.map(e=>
2(0,QO.jsx)("li",{className:"nav-item",children:(0,QO.jsx)(jt,{className:r,to:e.to,end:"/"===e.to,onClick:()=>n(!1),children:e.label})},e.to)),(0,QO.jsx)("li",{className:"nav-item",children:(0,QO.jsx)(eP,{onNavigate:()=>n(!1)})})]})})]})})}function nP(){const e=(new Date).getFullYear();return(0,QO.jsx)("footer",{className:"custom-footer mt-auto py-4 border-top footer-border",children:(0,QO.jsx)("div",{className:"container",children:(0,QO.jsxs)("div",{className:"row g-4",children:[(0,QO.jsxs)("div",{className:"col-12 col-md-5",children:[(0,QO.jsx)("h5",{className:"fw-bold footer-title mb-2",children:"\u5c06\u68cb \u015eogi T\xfcrkiye"}),(0,QO.jsx)("p",{className:"footer-text small mb-3",children:"T\xfcrkiye'nin ilk ve tek kapsaml\u0131 \u015eogi platformu. Japon satran\xe7 k\xfclt\xfcr\xfcn\xfc tan\u0131tmak, \xf6\u011fretmek ve sporseverleri turnuvalarda bir araya getirmek amac\u0131yla kurulmu\u015ftur."}),(0,QO.jsxs)("div",{className:"d-flex align-items-center gap-2 mb-3",children:[(0,QO.jsx)("a",{href:"https://www.youtube.com/@\u015eogiT\xfcrkiye",target:"_blank",rel:"noopener noreferrer",className:"btn btn-sm btn-danger d-inline-flex align-items-center gap-1",children:(0,QO.jsx)("span",{children:"YouTube"})}),(0,QO.jsx)("a",{href:"https://instagram.com/sogiturkiye",target:"_blank",rel:"noopener noreferrer",className:"btn btn-sm btn-warning text-dark fw-semibold d-inline-flex align-items-center gap-1",children:(0,QO.jsx)("span",{children:"Instagram"})})]}),(0,QO.jsxs)("div",{className:"footer-text small",children:["\xa9 ",e," ",(0,QO.jsx)("strong",{children:"\u015eogi T\xfcrkiye"}),". T\xfcm haklar\u0131 sakl\u0131d\u0131r."]})]}),(0,QO.jsxs)("div",{className:"col-6 col-md-3",children:[(0,QO.jsx)("h6",{className:"fw-bold footer-title mb-3",children:"H\u0131zl\u0131 Ba\u011flant\u0131lar"}),(0,QO.jsxs)("ul",{className:"list-unstyled small mb-0 d-flex flex-column gap-2",children:[(0,QO.jsx)("li",{children:(0,QO.jsx)(Ht,{to:"/",className:"footer-link",children:"Ana Sayfa"})}),(0,QO.jsx)("li",{children:(0,QO.jsx)(Ht,{to:"/akademi",className:"footer-link",children:"\u015eogi Akademi"})}),(0,QO.jsx)("li",{children:(0,QO.jsx)(Ht,{to:"/arena",className:"footer-link",children:"\u015eogi Arena"})}),(0,QO.jsx)("li",{children:(0,QO.jsx)(Ht,{to:"/oyna",className:"footer-link",children:"Hemen Oyna"})}),(0,QO.jsx)("li",{children:(0,QO.jsx)(Ht,{to:"/liderlik-tablosu",className:"footer-link",children:"Liderlik Tablosu"})}),(0,QO.jsx)("li",{children:(0,QO.jsx)(Ht,{to:"/iletisim",className:"footer-link fw-semibold text-warning",children:"\u0130leti\u015fim"})})]})]}),(0,QO.jsxs)("div",{className:"col-6 col-md-4",children:[(0,QO.jsx)("h6",{className:"fw-bold footer-title mb-3",children:"Rehber ve Topluluk"}),(0,QO.jsxs)("ul",{className:"list-unstyled small mb-3 d-flex flex-column gap-2",children:[(0,QO.jsx)("li",{children:(0,QO.jsx)(Ht,{to:"/nasil-oynanir",className:"footer-link",children:"\u015eogi Nas\u0131l Oynan\u0131r?"})}),(0,QO.jsx)("li",{children:(0,QO.jsx)(Ht,{to:"/taslar",className:"footer-link",children:"\u015eogi Ta\u015flar\u0131 ve Hareketleri"})}),(0,QO.jsx)("li",{children:(0,QO.jsx)(Ht,{to:"/kurallar",className:"footer-link",children:"Kural ve Terfi Esaslar\u0131"})}),(0,QO.jsx)("li",{children:(0,QO.jsx)(Ht,{to:"/sss",className:"footer-link fw-semibold text-warning",children:"S\u0131k\xe7a Sorulan Sorular (SSS)"})}),(0,QO.jsx)("li",{children:(0,QO.jsx)(Ht,{to:"https://blog.sogiturkiye.com",className:"footer-link fw-semibold text-warning",children:"\u015eogi T\xfcrkiye Blog"})})]}),(0,QO.jsx)("div",{className:"pt-2 border-top footer-border",children:(0,QO.jsx)("span",{className:"badge footer-badge me-2",children:"SogiTurkiye.com"})})]})]})})})}const rP=i.p+"static/media/sogioyna.fff822419a3da4cc0020.jpg",sP=i.p+"static/media/sogiakademi.a3d2c64eab90fddf1ab6.jpg",aP=i.p+"static/media/sogiarena.88f5385ce9542c416135.jpg",oP=VO(HO);async function lP(e,t){const i=CO(oP,"lobby"),n=CO(oP,"lobby/".concat(e.uid));try{const r=(await PO(i)).val()||{},s=Object.keys(r).find(t=>t!==e.uid&&!r[t].roomId);if(s){const i=r[s],a=function(e,t){e=hr(e),DR("push",e._path),PR("push",t,e._path,!0);
2const i=XR(e._repo),n=yO(i),r=AO(e,n),s=AO(e,n);let a;return a=null!=t?RO(s,t).then(()=>s):Promise.resolve(s),r.then=a.then.bind(a),r.catch=a.then.bind(a,void 0),r}(CO(oP,"rooms")),o=a.key,l=Math.random()<.5,h={status:"playing",createdAt:Date.now(),turn:"sente",players:{sente:l?e:{uid:i.uid,nickname:i.nickname,photoURL:i.photoURL},gote:l?{uid:i.uid,nickname:i.nickname,photoURL:i.photoURL}:e},lastMove:null,winner:null};await RO(a,h),await OO(CO(oP,"lobby/".concat(s)),{roomId:o,role:l?"gote":"sente"}),await kO(n),t({roomId:o,role:l?"sente":"gote"})}else{await RO(n,{uid:e.uid,nickname:e.nickname,photoURL:e.photoURL||"",createdAt:Date.now(),roomId:null}),function(e){return e=hr(e),new TO(e._repo,e._path)}(n).remove();LO(n,e=>{const i=e.val();i&&i.roomId&&(DO(n),kO(n),t({roomId:i.roomId,role:i.role}))})}}catch(_E){console.error("Matchmaking Hatas\u0131:",_E)}}function hP(e){const t=CO(oP,"lobby");return LO(t,t=>{const i=t.val()||{},n=Object.keys(i).filter(e=>!i[e].roomId);e(n.length>0,n.length)}),()=>DO(t)}async function uP(e,t,i){const n=CO(oP,"rooms/".concat(e));await OO(n,{lastMove:t,turn:i,updatedAt:Date.now()})}function cP(){const t=u((0,e.useState)(!1),2),i=t[0],n=t[1],r=u((0,e.useState)(0),2),s=r[0],a=r[1];return(0,e.useEffect)(()=>{let e=()=>{};try{e=hP((e,t)=>{n(e),a(t)})}catch(_E){console.error("Lobi dinleme hatas\u0131:",_E)}return()=>{"function"===typeof e&&e()}},[]),(0,QO.jsxs)("div",{className:"container py-4 py-md-5",children:[(0,QO.jsxs)(an,{children:[(0,QO.jsx)("title",{children:"\u015eogi T\xfcrkiye \u2014 Japon Satranc\u0131 \xd6\u011fren ve Oyna"}),(0,QO.jsx)("meta",{name:"description",content:"T\xfcrkiye'nin resmi \u015eogi toplulu\u011fu. Japon satran\xe7 kurallar\u0131n\u0131 \xf6\u011frenin, ta\u015f hareketlerini inceleyin, bilgisayara kar\u015f\u0131 pratik yap\u0131n ve turnuvalara kat\u0131l\u0131n."}),(0,QO.jsx)("link",{rel:"canonical",href:"https://sogiturkiye.com/"})]}),(0,QO.jsxs)("div",{className:"text-center mb-5",children:[(0,QO.jsx)("h1",{className:"display-5 fw-bold",children:(0,QO.jsx)("img",{src:rP,alt:"\u5c06\u68cb \u2014 \u015eogi",className:"w-25 img-fluid"})}),(0,QO.jsxs)("p",{className:"lead text-muted",children:['Japonya\'n\u0131n "General Oyunu"',(0,QO.jsx)("br",{}),"Satranc\u0131n en \xf6zg\xfcn varyant\u0131"]})]}),(0,QO.jsxs)("div",{className:"row g-4 mb-5",children:[(0,QO.jsx)("div",{className:"col-12 col-md-6",children:(0,QO.jsxs)("div",{className:"card h-100 shadow border-primary border-2 overflow-hidden",children:[(0,QO.jsx)("div",{className:"text-center p-2 bg-light",children:(0,QO.jsx)("img",{src:sP,alt:"\u5c06\u68cb \u2014 \u015eogi Akademi",className:"img-fluid rounded"})}),(0,QO.jsxs)("div",{className:"card-body d-flex flex-column text-center",children:[(0,QO.jsx)("h3",{className:"card-title fw-bold text-primary mb-2",children:"\u015eogi Akademi"}),(0,QO.jsx)("p",{className:"card-text text-muted flex-grow-1",children:"\u015eogiyi s\u0131f\u0131rdan \xf6\u011frenin! Ta\u015flar\u0131n hareketleri, a\xe7\u0131l\u0131\u015f stratejileri ve Tsume Shogi (bulmaca) mod\xfclleri ile kendinizi geli\u015ftirin."}),(0,QO.jsx)("div",{className:"position-relative d-inline-block mt-3 mx-auto",children:(0,QO.jsx)(Ht,{to:"/akademi",className:"btn btn-primary btn-lg fw-semibold px-4",children:"Akademiye Git"})})]})]})}),(0,QO.jsx)("div",{className:"col-12 col-md-6",children:(0,QO.jsxs)("div",{className:"card h-100 shadow border-danger border-2 overflow-hidden",children:[(0,QO.jsx)("div",{className:"text-center p-2 bg-light",children:(0,QO.jsx)("img",{src:aP,alt:"\u5c06\u68cb \u2014 \u015eogi Arena",className:"img-fluid rounded"})}),(0,QO.jsxs)("div",{className:"card-body d-flex flex-column text-center",children:[(0,QO.jsx)("h3",{className:"card-title fw-bold text-danger mb-2",children:"\u015eogi Arena"}),(0,QO.jsx)("p",{className:"card-text text-muted flex-grow-1",children:"Rekabete haz\u0131r m\u0131s\u0131n? Ger\xe7ek rakiplere kar\u015f\u0131 oynay\u0131n, topluluk turnuvalar\u0131na kat\u0131l\u0131n ve \xfcst s\u0131ralara t\u0131rman\u0131n."}),(0,QO.jsxs)("div",{className:"position-relative d-inline-block mt-3 mx-auto",children:[(0,QO.jsx)(Ht,{to:"/arena",className:"btn btn-danger btn-lg fw-semibold px-4",children:"Arenaya Gir"}),i&&(0,QO.jsxs)("span",{className:"position-absolute top-0 start-100 translate-middle badge rounded-pill bg-warning text-dark shadow-sm d-flex align-items-center gap-1",style:{fontSize:"0.75rem",border:"2px s
2olid white",zIndex:10,animation:"pulse 1.5s infinite",whiteSpace:"nowrap"},children:[(0,QO.jsx)("span",{className:"bg-danger rounded-circle d-inline-block",style:{width:"8px",height:"8px"}}),s>1?"".concat(s," Rakip Bekliyor!"):"Rakip Var!"]})]})]})]})})]}),(0,QO.jsx)("hr",{className:"my-5"}),(0,QO.jsx)("div",{className:"card shadow-sm mb-4",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("h5",{className:"card-title",children:"\u015eoginin K\xf6keni"}),(0,QO.jsx)("p",{className:"card-text",children:"\u015eogi : Japon Satranc\u0131, k\xf6kleri Hindistan'da do\u011fan ve zamanla Asya'n\u0131n d\xf6rt bir yan\u0131na yay\u0131lan eski bir satran\xe7 ailesi oyunu olan \xe7aturanga'ya dayan\u0131r. Bu oyun, \u0130pek Yolu \xfczerinden \xc7in'e ula\u015ft\u0131\u011f\u0131nda xiangqi'ye (\xc7in satranc\u0131), G\xfcneydo\u011fu Asya'ya ula\u015ft\u0131\u011f\u0131nda makruk gibi varyantlara d\xf6n\xfc\u015ft\xfc. Japonya'ya muhtemelen 8. ile 10. y\xfczy\u0131llar aras\u0131nda ula\u015fan bu oyun ailesi, y\xfczy\u0131llar i\xe7inde g\xfcn\xfcm\xfczdeki \u015fogi haline evrildi."}),(0,QO.jsx)("p",{className:"card-text mb-0",children:"En eski yaz\u0131l\u0131 kay\u0131tlar 11. y\xfczy\u0131la, Heian d\xf6neminin saray k\xfclt\xfcr\xfcne kadar uzan\u0131r. Oyun, Muromachi ve Edo d\xf6nemleri boyunca kurallar\u0131nda \xf6nemli de\u011fi\u015fiklikler ge\xe7irdi; bug\xfcn oynanan modern \u015fogi bi\xe7imi b\xfcy\xfck \xf6l\xe7\xfcde 16. y\xfczy\u0131lda \u015fekillenmi\u015ftir."})]})}),(0,QO.jsx)("div",{className:"card shadow-sm mb-4",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("h5",{className:"card-title",children:"Ele Ge\xe7irilen Ta\u015flar\u0131 Yeniden Kullanma"}),(0,QO.jsx)("p",{className:"card-text mb-0",children:'\u015eoginin, d\xfcnya genelindeki neredeyse t\xfcm di\u011fer satran\xe7 varyantlar\u0131ndan ayr\u0131ld\u0131\u011f\u0131 en \xf6nemli \xf6zellik, 16. y\xfczy\u0131lda eklendi\u011fi d\xfc\u015f\xfcn\xfclen "elden ta\u015f s\xfcrme" kural\u0131d\u0131r. Bu kuralla birlikte ele ge\xe7irilen bir ta\u015f oyundan tamamen \xe7\u0131kmaz; rengini de\u011fi\u015ftirip onu alan oyuncunun emrine ge\xe7er ve tekrar tahtaya s\xfcr\xfclebilir. Bu, oyuna satran\xe7 ve xiangqi\'de bulunmayan, s\xfcrekli materyal d\xf6ng\xfcs\xfcne dayal\u0131, son derece taktiksel ve sald\u0131rgan bir karakter kazand\u0131r\u0131r.'})]})}),(0,QO.jsx)("div",{className:"card shadow-sm mb-4",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("h5",{className:"card-title",children:"Japonya'da ve D\xfcnyada \u015eogi"}),(0,QO.jsx)("p",{className:"card-text",children:'\u015eogi bir di\u011fer ad\u0131yla Japon Satranc\u0131, Japonya\'da satran\xe7 ve go ile birlikte en pop\xfcler zihin oyunlar\u0131ndan biridir. Japonya \u015eogi Birli\u011fi (\u65e5\u672c\u5c06\u68cb\u9023\u76df), profesyonel oyuncular\u0131 (\u68cb\u58eb, kishi) derecelendiren, turnuvalar d\xfczenleyen ve oyunun kurallar\u0131n\u0131 koruyan resmi kurumdur. Profesyonel \u015fogi oyuncusu olmak, gen\xe7lik ya\u015flar\u0131ndan itibaren y\u0131llar s\xfcren zorlu bir "deshi" (\xe7\u0131rak) sisteminden ge\xe7meyi gerektirir.'}),(0,QO.jsx)("p",{className:"card-text mb-0",children:"Son y\u0131llarda yapay zeka destekli \u015fogi motorlar\u0131 (\xf6r. YaneuraOu, Bonanza'n\u0131n miras\xe7\u0131lar\u0131), profesyonel oyuncular\u0131n analiz ve haz\u0131rl\u0131k y\xf6ntemlerini k\xf6kten de\u011fi\u015ftirmi\u015f; \u015fogi de t\u0131pk\u0131 satran\xe7ta oldu\u011fu gibi bilgisayar destekli bir \xe7a\u011fa girmi\u015ftir."})]})}),(0,QO.jsx)("div",{className:"card shadow-sm",children:(0,QO.jsxs)("div",{className:"card-body text-center",children:[(0,QO.jsx)("h5",{className:"card-title",children:"\xd6\u011fren ve Oyna"}),(0,QO.jsxs)("p",{className:"card-text",children:["Japon Satranc\u0131 Kurallar\u0131 ve ta\u015f hareketlerini ad\u0131m ad\u0131m \xf6\u011frenmek i\xe7in"," ",(0,QO.jsx)(Ht,{to:"/nasil-oynanir",children:"\u015eogi, Japon Satranc\u0131 Nas\u0131l Oynan\u0131r?"}),","," ",(0,QO.jsx)(Ht,{to:"/taslar",children:"\u015eogi Ta\u015flar\u0131"})," ve ",(0,QO.jsx)(Ht,{to:"/kurallar",children:"Japon Satranc\u0131 Kurallar\u0131"})," ","sayfalar\u0131na g\xf6z atabilir, haz\u0131r oldu\u011funda ",(0,QO.jsx)(Ht,{to:"/oyna",children:"\u015eogi Oyna"})," ","sayfas\u0131ndan rakibi bilgisayar\u0131n oynatt\u0131\u011f\u0131 bir oyuna hemen ba\u015flayabilirsin."]}),(0,QO.jsx)(Ht,{to:"/oyna",className:"btn btn-primary mt-2",children:"Hemen Oyna"})]})}),(0,QO.jsx)("style",{children:"\n        @keyframes pulse {\n          0% {\n            transform: translate(0, -50%) scale(1);\n            box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);\n          }\n          70% {\n            transform: translate(0, -50%) scale(1.08);\n            box-shadow: 0 0 0 8px rgba(255, 193, 7, 0);\n          }\n          100% {\n            transform: translate(0, -50%) scale(1);\n            box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);\n          }\n        }\n      "})]})}function dP(){return(0,QO.jsxs)("div",{className:"container py-4 py-md-5",children:[(0,QO.jsx)("h1",{className:"mb-4",children:"\u015eogi Nas\u0131l Oynan\u0131r?"}),(0,QO.jsx)("div",{className:"card shadow-sm mb-4",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("h5",{className:"card-title",children:"Ama\xe7 ve S\u0131ra"}),(0,QO.jsx)("p",{className:"card-text",children:'\u015eogi (Japon Satranc\u0131), iki ki\u015filik bir Japon satran\xe7 varyant\u0131d\u0131r. Ama\xe7, rakibin \u015eah (\u738b/\u7389) ta\u015f\u0131n\u0131 ka\xe7acak yeri kalmayacak \u015fekilde tehdit alt\u0131na almakt\u0131r (mat). Oyuncular s\u0131rayla bir hamle yapar: 
2ya tahtadaki bir ta\u015f\u0131n\u0131 hareket ettirir, ya da elinde tuttu\u011fu (daha \xf6nce ele ge\xe7irdi\u011fi) bir ta\u015f\u0131 bo\u015f bir kareye "atar".'}),(0,QO.jsxs)("p",{className:"card-text mb-0",children:[(0,QO.jsx)("strong",{children:"Sente"})," (\u5148\u624b, ilk oynayan) genellikle tahtan\u0131n alt taraf\u0131nda,"," ",(0,QO.jsx)("strong",{children:"Gote"})," (\u5f8c\u624b, ikinci oynayan) \xfcst taraf\u0131nda oturur. Uygulamam\u0131zda rakip ta\u015flar\u0131, ger\xe7ek \u015fogi setlerinde oldu\u011fu gibi 180\xb0 d\xf6nd\xfcr\xfclerek g\xf6sterilir."]})]})}),(0,QO.jsx)("div",{className:"card shadow-sm mb-4",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("h5",{className:"card-title",children:"Ad\u0131m Ad\u0131m Nas\u0131l Oynan\u0131r"}),(0,QO.jsxs)("ol",{className:"mb-0",children:[(0,QO.jsx)("li",{className:"mb-2",children:"S\u0131ra sende ise, tahtadaki bir ta\u015f\u0131na t\u0131klayarak se\xe7 \u2014 ge\xe7erli hareket kareleri ye\u015fil noktalarla vurgulan\u0131r."}),(0,QO.jsx)("li",{className:"mb-2",children:"Vurgulanan bir kareye t\u0131klayarak ta\u015f\u0131n\u0131 oraya oynat. Ta\u015f\u0131n terfi b\xf6lgesine giriyorsa terfi edip etmeyece\u011fin sorulur."}),(0,QO.jsx)("li",{className:"mb-2",children:'Alternatif olarak, elinde (daha \xf6nce ele ge\xe7irdi\u011fin) bir ta\u015f varsa \xfczerine t\u0131klay\u0131p ge\xe7erli bir bo\u015f kareye "atabilirsin".'}),(0,QO.jsx)("li",{className:"mb-0",children:"Rakibinin \u015eah ta\u015f\u0131n\u0131 ka\xe7acak yeri kalmayacak \u015fekilde tehdit alt\u0131na ald\u0131\u011f\u0131nda oyunu kazan\u0131rs\u0131n."})]})]})}),(0,QO.jsx)("div",{className:"card shadow-sm",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("h5",{className:"card-title",children:"Daha Fazlas\u0131"}),(0,QO.jsxs)("p",{className:"mb-0",children:["Ta\u015f \xe7e\u015fitlerini ve nas\u0131l hareket ettiklerini"," ",(0,QO.jsx)(Ht,{to:"/taslar",children:"\u015eogi Ta\u015flar\u0131"})," sayfas\u0131nda, tahta \xf6zelliklerini ve elden ta\u015f s\xfcrme gibi ayr\u0131nt\u0131l\u0131 kurallar\u0131 ise ",(0,QO.jsx)(Ht,{to:"/kurallar",children:"Kurallar"})," ","sayfas\u0131nda bulabilirsin. Haz\u0131r oldu\u011funda ",(0,QO.jsx)(Ht,{to:"/oyna",children:"\u015eogi Oyna"})," ","sayfas\u0131ndan, rakibi bilgisayar\u0131n oynatt\u0131\u011f\u0131 bir oyuna hemen ba\u015flayabilirsin."]})]})})]})}const fP=[{kanji:"\u738b/\u7389",name:"\u015eah (\u014c / Gyoku)",desc:"Her y\xf6ne bir kare hareket eder. Bu ta\u015f al\u0131n\u0131rsa oyun biter. Terfi etmez."},{kanji:"\u98db",name:"Kale (Hisha)",desc:'Yatay/dikey, istedi\u011fi kadar kare gider. Terfi edince "Ejderha" (\u9f8d) olur ve \xe7apraz tek kare hareketi de kazan\u0131r.'},{kanji:"\u89d2",name:"Fil (Kaku)",desc:'\xc7apraz, istedi\u011fi kadar kare gider. Terfi edince "At" (\u99ac) olur ve d\xfcz tek kare hareketi de kazan\u0131r.'},{kanji:"\u91d1",name:"Alt\u0131n General (Kin)",desc:"\xd6ne, yanlara, arkaya d\xfcz ve \xf6ne \xe7apraz \u2014 6 y\xf6ne bir kare gider. Terfi etmez."},{kanji:"\u9280",name:"G\xfcm\xfc\u015f General (Gin)",desc:"\xd6ne d\xfcz ve her y\xf6ne \xe7apraz \u2014 5 y\xf6ne bir kare gider. Terfi edince Alt\u0131n General gibi hareket eder."},{kanji:"\u6842",name:"At/\u015e\xf6valye (Kei)",desc:"Tam iki kare ileri, bir kare yana z\u0131plar (araya giren ta\u015flar\u0131 atlar). Terfi edince Alt\u0131n General gibi hareket eder."},{kanji:"\u9999",name:"M\u0131zrak (Kyo)",desc:"Sadece \xf6ne, istedi\u011fi kadar kare gider. Terfi edince Alt\u0131n General gibi hareket eder."},{kanji:"\u6b69",name:"Piyade (Fu)",desc:'Sadece bir kare \xf6ne gider. Terfi edince "Tokin" (\u3068) olur ve Alt\u0131n General gibi hareket eder.'}];function pP(){return(0,QO.jsxs)("div",{className:"container py-4 py-md-5",children:[(0,QO.jsx)("h1",{className:"mb-4",children:"\u015eogi Ta\u015flar\u0131"}),(0,QO.jsxs)("p",{className:"lead",children:["\u015eogide 8 farkl\u0131 ta\u015f \xe7e\u015fidi vard\u0131r; bunlardan \u015eah ve Alt\u0131n General d\u0131\u015f\u0131ndaki 6 ta\u015f, oyun s\u0131ras\u0131nda rakip taraf\u0131n 3 s\u0131ral\u0131k b\xf6lgesine girdi\u011finde ",(0,QO.jsx)("strong",{children:"terfi"})," ","edip daha g\xfc\xe7l\xfc bir \u015fekle d\xf6n\xfc\u015febilir."]}),(0,QO.jsx)("div",{className:"card shadow-sm",children:(0,QO.jsx)("div",{className:"card-body",children:(0,QO.jsx)("div",{className:"table-responsive",children:(0,QO.jsxs)("table",{className:"table table-sm align-middle mb-0",children:[(0,QO.jsx)("thead",{children:(0,QO.jsxs)("tr",{children:[(0,QO.jsx)("th",{style:{width:70},children:"Ta\u015f"}),(0,QO.jsx)("th",{style:{width:220},children:"Ad\u0131"}),(0,QO.jsx)("th",{children:"Hareket / Terfi"})]})}),(0,QO.jsx)("tbody",{children:fP.map(e=>
2(0,QO.jsxs)("tr",{children:[(0,QO.jsx)("td",{className:"fs-3 fs-md-2 text-center",children:e.kanji}),(0,QO.jsx)("td",{children:e.name}),(0,QO.jsx)("td",{className:"small",children:e.desc})]},e.kanji))})]})})})}),(0,QO.jsx)("p",{className:"small text-muted mt-3 mb-0",children:"Terfi, bir ta\u015f kendi terfi b\xf6lgesine girdi\u011finde, o b\xf6lgeden \xe7\u0131kt\u0131\u011f\u0131nda ya da o b\xf6lge i\xe7inde hareket etti\u011finde iste\u011fe ba\u011fl\u0131 olarak ger\xe7ekle\u015fir. Piyade/M\u0131zrak son s\u0131raya, At ise son iki s\u0131raya giderse terfi zorunludur \u2014 aksi halde bir daha hi\xe7 hareket edemezler."})]})}function mP(){return(0,QO.jsxs)("div",{className:"container py-4 py-md-5",children:[(0,QO.jsxs)(an,{children:[(0,QO.jsx)("title",{children:"\u015eogi Kurallar\u0131 ve Terfi Esaslar\u0131 \u2014 \u015eogi T\xfcrkiye"}),(0,QO.jsx)("meta",{name:"description",content:"\u015eogi (Japon Satranc\u0131) kurallar\u0131n\u0131 T\xfcrk\xe7e \xf6\u011frenin. Terfi (promotion) b\xf6lgesi, elden ta\u015f s\xfcrme (drop), Nifu yasa\u011f\u0131 ve \u015fah \xe7ekme kurallar\u0131n\u0131n detaylar\u0131."})]}),(0,QO.jsx)("h1",{className:"mb-4",children:"\u015eogi (Japon Satranc\u0131) Kurallar\u0131"}),(0,QO.jsxs)("div",{className:"row g-4",children:[(0,QO.jsx)("div",{className:"col-md-6",children:(0,QO.jsx)("div",{className:"card h-100 shadow-sm",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("h5",{className:"card-title",children:"Tahta \xd6zellikleri"}),(0,QO.jsxs)("ul",{className:"mb-0",children:[(0,QO.jsxs)("li",{children:["Tahta ",(0,QO.jsx)("strong",{children:"9\xd79 kareden"})," olu\u015fur (satran\xe7tan farkl\u0131 olarak kareler tek renktir, dama gibi de\u011fildir)."]}),(0,QO.jsxs)("li",{children:["Her oyuncunun kendi taraf\u0131na en yak\u0131n ",(0,QO.jsx)("strong",{children:"3 s\u0131ra"}),', o oyuncu i\xe7in "terfi b\xf6lgesi"dir.']}),(0,QO.jsx)("li",{children:'Ta\u015flar dama pulu gibi d\xfcz de\u011fil, sivri be\u015fgen \u015feklindedir; sivri u\xe7 ta\u015f\u0131n "ileri" y\xf6n\xfcn\xfc g\xf6sterir.'}),(0,QO.jsxs)("li",{children:["Satran\xe7tan farkl\u0131 olarak ",(0,QO.jsx)("strong",{children:"ele ge\xe7irilen ta\u015flar oyundan \xe7\u0131kmaz"}),' \u2014 bkz. a\u015fa\u011f\u0131daki "Elden Ta\u015f S\xfcrme".']})]})]})})}),(0,QO.jsx)("div",{className:"col-md-6",children:(0,QO.jsx)("div",{className:"card h-100 shadow-sm",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("h5",{className:"card-title",children:"Terfi (Promotion)"}),(0,QO.jsx)("p",{className:"card-text",children:"\u015eah ve Alt\u0131n General hari\xe7 t\xfcm ta\u015flar, kendi terfi b\xf6lgesine girdi\u011finde, o b\xf6lgeden \xe7\u0131kt\u0131\u011f\u0131nda ya da b\xf6lge i\xe7inde hareket etti\u011finde iste\u011fe ba\u011fl\u0131 olarak terfi edebilir."}),(0,QO.jsxs)("p",{className:"card-text mb-0",children:["Piyade ve M\u0131zrak son s\u0131raya, At ise son iki s\u0131raya giderse terfi"," ",(0,QO.jsx)("strong",{children:"zorunludur"})," \u2014 aksi halde o ta\u015f bir daha hi\xe7 hareket edemez. Uygulama bu durumu otomatik tespit eder ve se\xe7enek sormadan terfi ettirir."]})]})})}),(0,QO.jsx)("div",{className:"col-12",children:(0,QO.jsx)("div",{className:"card shadow-sm",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("h5",{className:"card-title",children:"Elden Ta\u015f S\xfcrme (Ele Ge\xe7irilen Ta\u015flar\u0131 Yeniden Oyuna Sokma)"}),(0,QO.jsxs)("p",{className:"card-text",children:['\u015eogiyi satran\xe7 ve di\u011fer varyantlardan ay\u0131ran en \xf6nemli kural budur: bir ta\u015f ele ge\xe7irildi\u011finde tahtadan tamamen \xe7\u0131kmaz; onu alan oyuncunun "eli"ne (koma-dai) ge\xe7er ve ',(0,QO.jsx)("strong",{children:"renk de\u011fi\u015ftirip o oyuncunun ta\u015f\u0131 olur"}),". Oyuncu, s\u0131ras\u0131 geldi\u011finde tahtada bir ta\u015f oynamak yerine, elindeki bu ta\u015flardan birini bo\u015f bir kareye ",(0,QO.jsx)("strong",{children:"b\u0131rakabilir (drop)"}),". At\u0131lan ta\u015f her zaman terfi etmemi\u015f haliyle konur."]}),(0,QO.jsxs)("p",{className:"card-text mb-0",children:["Birka\xe7 k\u0131s\u0131tlama vard\u0131r: ayn\u0131 s\xfctunda zaten a\xe7\u0131k (terfi etmemi\u015f) bir piyaden varsa o s\xfctuna ikinci bir piyade atamazs\u0131n (iki piyade / ",(0,QO.jsx)("em",{children:"nifu"})," yasa\u011f\u0131); Piyade ve M\u0131zrak son s\u0131raya, At ise son iki s\u0131raya at\u0131lamaz \u2014 \xe7\xfcnk\xfc orada hi\xe7 hareket edemezler. Uygulamada bu k\u0131s\u0131tlamalar otomatik uygulan\u0131r; elindeki ta\u015flardan birine t\u0131klad\u0131\u011f\u0131nda yaln\u0131zca ge\xe7erli kareler vurgulan\u0131r."]})]})})}),(0,QO.jsx)("div",{className:"col-12",children:(0,QO.jsx)("div",{className:"card shadow-sm border-warning-subtle",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("h5",{className:"card-title",children:"\u015eu Anki S\u0131n\u0131rlamalar"}),(0,QO.jsx)("p",{className:"card-text mb-0 small text-muted",children:"Bu uygulamadaki kural motoru bilin\xe7li olarak basit tutulmu\u015ftur: bir hamlenin kendi \u015fah\u0131n\u0131 tehdide a\xe7\u0131k b\u0131rak\u0131p b\u0131rakmad\u0131\u011f\u0131n\u0131 hen\xfcz kontrol etmez, ve uchifuzume (piyade atarak mat etme yasa\u011f\u0131) ile sennichite (d\xf6rt kez tekrar = berabere) kurallar\u0131 hen\xfcz uygulanmaz."})]})})})]})]})}var gP={50792(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,n,s,a){if("function"!==typeof n)throw new TypeError("The listener must be a function");var o=new r(n,s||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},o.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,a=new Array(s);r<s;r++)a[r]=n[r].fn;return a},o.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},o.prototype.emit=function(e,t,n,r,s,a){var o=i?i+e:e;if(!this._events[o])return!1;var l,h,u=this._events[o],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;
vendor: 74,841 bytes, line 2
2case 5:return u.fn.call(u.context,t,n,r,s),!0;case 6:return u.fn.call(u.context,t,n,r,s,a),!0}for(h=1,l=new Array(c-1);h<c;h++)l[h-1]=arguments[h];u.fn.apply(u.context,l)}else{var d,f=u.length;for(h=0;h<f;h++)switch(u[h].once&&this.removeListener(e,u[h].fn,void 0,!0),c){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,t);break;case 3:u[h].fn.call(u[h].context,t,n);break;case 4:u[h].fn.call(u[h].context,t,n,r);break;default:if(!l)for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];u[h].fn.apply(u[h].context,l)}}return!0},o.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},o.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},o.prototype.removeListener=function(e,t,n,r){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||r&&!o.once||n&&o.context!==n||a(this,s);else{for(var l=0,h=[],u=o.length;l<u;l++)(o[l].fn!==t||r&&!o[l].once||n&&o[l].context!==n)&&h.push(o[l]);h.length?this._events[s]=1===h.length?h[0]:h:a(this,s)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,e.exports=o},93300(e,t,i){var n=i(10312);e.exports=function(e,t){Array.isArray(e)||(e=[e]),t||(t={});for(var i=void 0===t.threshold?.5:t.threshold,r=void 0===t.blurRadius?2:t.blurRadius,s=void 0===t.blurSteps?4:t.blurSteps,a=void 0===t.blurQuality?0:t.blurQuality,o=void 0===t.blendAmount?1:t.blendAmount,l=void 0===t.blendMode?n.ADD:t.blendMode,h=[],u=0;u<e.length;u++){var c=e[u];c.enableFilters&&c.enableFilters();var d=(t.useInternal?c.filters.internal:c.filters.external).addParallelFilters(),f=d.top.addThreshold(i,1),p=d.top.addBlur(a,r,r,1,16777215,s);d.blend.blendMode=l,d.blend.amount=o,h.push({item:c,parallelFilters:d,threshold:f,blur:p})}return h}},56704(e,t,i){var n=i(16438),r=i(10312),s=i(41337),a=i(95643),o=i(45650);e.exports=function(e,t){t||(t={}),Array.isArray(e)||(e=[e]);var i=e[0],l=i.scene,h=void 0===t.direction?.5:t.direction%(2*Math.PI),u=void 0===t.scale?2:t.scale,c=(t.radius||.5)/u,d=t.width||i.width||128,f=t.height||i.height||128,p={x:0,y:0};h<0&&(h+=2*Math.PI),h>3*Math.PI/2?p.y=1:h>Math.PI?(p.x=1,p.y=1):h>Math.PI/2&&(p.x=1);for(var m=[],g=0;g<e.length;g++){var v=e[g],y={origin:0,width:d,height:f,config:{offset:-c,repeatMode:3,shapeMode:0,direction:h,length:u,start:p,bands:t.bands||[{interpolation:2,colorStart:16777215,colorEnd:[1,1,1,0],size:c},{colorStart:[1,1,1,0],size:1-c}]}},x=l.make.gradient(y,!1);if(t.displacementMap){var b=t.displacement||.1;x.enableFilters().filters.internal.addDisplacement(t.displacementMap,b,b)}for(var w=o(),T=l.textures;T.exists(w);)w=o();var _=T.addDynamicTexture(w,x.width,x.height),S=l.tweens.add({targets:x,offset:1+c,repeat:-1,yoyo:!!t.yoyo,ease:t.ease,duration:t.duration||2e3,repeatDelay:t.repeatDelay||0,onUpdate:function(){_.clear().draw(x).render()}});v instanceof a&&v.enableFilters();var E,C,A=t.useExternal?v.filters.external:v.filters.internal,k=t.colorFactor||[1.15,.85,.85,1];t.reveal?E=A.addBlend(w,r.MULTIPLY,1,k):(E=(C=A.addParallelFilters()).top.addBlend(w,r.MULTIPLY,1,k),C.blend.blendMode=r.ADD);var R=function(){S.destroy(),_.destroy()};v instanceof a?v.on(s,R):v.on(n,R),m.push({item:v,dynamicTexture:_,gradient:x,tween:S,parallelFilters:C,blendFilter:E})}return m}},245(e,t,i){var n=i(95643),r=i(93232),s=i(94591);e.exports=function(e,t){Array.isArray(e)||(e=[e]),t||(t={});for(var i=void 0===t.aspectRatio?1:t.aspectRatio,a=t.padding||0,o=e[0].scene,l=[],h=0;h<e.length;h++){var u,c=e[h],d=t.region;switch(d||(d=t.useInternal&&c._sizeComponent?new r(0,0,c.width,c.height):new r(0,0,o.scale.width,o.scale.height)),t.shape){case"ellipse":u=o.add.ellipse(0,0,i,1,16777215);break;case"square":u=o.add.rectangle(0,0,1,1,16777215);break;case"rectangle":u=o.add.rectangle(0,0,i,1,16777215);break;default:u=o.add.circle(0,0,1,16777215)}o.children.remove(u),a&&(d=new r(d.x+a,d.y+a,d.width-2*a,d.height-2*a)),s(u,t.scaleMode,d),t.blurRadius>0&&u.enableFilters().filters.external.addBlur(t.blurQuality,t.blurRadius,t.blurRadius,1,void 0,t.blurSteps),c instanceof n&&c.enableFilters();var f=(t.useInternal?c.filters.internal:c.filters.external).addMask(u,t.invert);l.push(f)}return l}},11517(e,t,i){var n=i(38829);e.exports=function(e,t,i,r){for(var s=e[0],a=1;a<e.length;a++){var o=e[a];n(o,s,t,i,r),s=o}return e}},80318(e,t,i){var n=i(66979);e.exports=function(e,t,i,r,s){return n(e,"angle",t,i,r,s)}},60757(e){e.exports=function(e,t,i){for(var n=0;n<e.length;n++){var r=e[n];t.call(i,r)}return e}},94591(e,t,i){var n=i(87841),r=i(95540);e.exports=function(e,t,i,s){if(Array.isArray(e)||(e=[e]),void 0===t&&(t=0),!i){var a=e[0].scene;i=new n(0,0,a.scale.width,a.scale.height)}s||(s={});for(var o=0;o<e.length;o++){var l=e[o],h=r(s,"width",r(l,"width",1)),u=r(s,"height",r(l,"height",1)),c=r(s,"originX",r(l,"originX",.5)),d=r(s,"originY",r(l,"originY",.5));l.x=i.x+i.width*c,l.y=i.y+i.height*d;var f=i.width/h,p=i.height/u;switch(t){case-1:l.setScale(Math.min(f,p));break;case 0:l.setScale(f,p);break;case 1:l.setScale(Math.max(f,p))}}return l}},69927(e){e.exports=function(e,t,i){void 0===i&&(i=0);for(var n=i;n<e.length;n++){var r=e[n],s=!0;for(var a in t)r[a]!==t[a]&&(s=!1);if(s)return r}return null}},32265(e){e.exports=function(e,t,i){void 0===i&&(i=0);for(var n=e.length-1;n>=i;n--){var r=e[n],s=!0;for(var a in t)r[a]!==t[a]&&(s=!1);if(s)return r}return null}},94420(e,t,i){var n=i(11879),r=i(60461),s=i(95540),a=i(29747),o=new(i(41481))({sys:{queueDepthSort:a,events:{once:a}}},0,0,1,1).setOrigin(0,0);e.exports=function(e,t){void 0===t&&(t={});var i=t.hasOwnProperty("width"),a=t.hasOwnProperty("height"),l=s(t,"width",-1),h=s(t,"height",-1),u=s(t,"cellWidth",1),c=s(t,"cellHeight",u),d=s(t,"position",r.TOP_LEFT),f=s(t,"x",0),p=s(t,"y",0),m=0,g=0,v=l*u,y=h*c;o.setPosition(f,p),o.setSize(u,c);for(var x=0;x<e.length;x++)if(n(e[x],o,d),i&&-1===l)o.x+=u;else if(a&&-1===h)o.y+=c;else if(a&&!i){if(g+=c,o.y+=c,g===y&&(g=0,m+=u,o.y=p,o.x+=u,m===v))break}else if(m+=u,o.x+=u,m===v&&(m=0,g+=c,o.x=f,o.y+=c,g===y))break;return e}},41721(e,t,i){var n=i(66979);e.exports=function(e,t,i,r,s){return n(e,"alpha",t,i,r,s)}},67285(e,t,i){var n=i(66979);e.exports=function(e,t,i,r,s){return n(e,"x",t,i,r,s)}},9074(e,t,i){var n=i(66979);e.exports=function(e,t,i,r,s,a,o){return void 0!==i&&null!==i||(i=t),n(e,"x",t,r,a,o),n(e,"y",i,s,a,o)}},75222(e,t,i){var n=i(66979);e.exports=function(e,t,i,r,s){return n(e,"y",t,i,r,s)}},22983(e){e.exports=function(e,t,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var r=i,s=(n-i)/e.length,a=t.x,o=t.y,l=t.radius,h=0;h<e.length;h++)e[h].x=a+l*Math.cos(r),e[h].y=o+l*Math.sin(r),r+=s;return e}},95253(e){e.exports=function(e,t,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var r=i,s=(n-i)/e.length,a=t.width/2,o=t.height/2,l=0;l<e.length;l++)e[l].x=t.x+a*Math.cos(r),e[l].y=t.y+o*Math.sin(r),r+=s;return e}},88505(e,t,i){var n=i(15258),r=i(26708);e.exports=function(e,t,i){var s;s=i?r(t,i,e.length):n(t,e.length);for(var a=0;a<e.length;a++){var o=e[a],l=s[a];o.x=l.x,o.y=l.y}return e}},41346(e,t,i){var n=i(14649),r=i(86003),s=i(49498);e.exports=function(e,t,i){void 0===i&&(i=0);var a=n(t,!1,e.length);i>0?r(a,i):i<0&&s(a,Math.abs(i));for(var o=0;o<e.length;o++)e[o].x=a[o].x,e[o].y=a[o].y;return e}},11575(e,t,i){var n=i(84993);e.exports=function(e,t,i){var r=n({x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2},i),s=n({x1:t.x2,y1:t.y2,x2:t.x3,y2:t.y3},i),a=n({x1:t.x3,y1:t.y3,x2:t.x1,y2:t.y1},i);r.pop(),s.pop(),a.pop();for(var o=(r=r.concat(s,a)).length/e.length,l=0,h=0;h<e.length;h++){var u=e[h],c=r[Math.floor(l)];u.x=c.x,u.y=c.y,l+=o}return e}},29953(e){e.exports=function(e,t,i){for(var n=0;n<e.length;n++){var r=e[n];r.anims&&r.anims.play(t,i)}return e}},66979(e){e.exports=function(e,t,i,n,r,s){var a;void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=1);var o=0,l=e.length;if(1===s)for(a=r;a<l;a++)e[a][t]+=i+o*n,o++;else for(a=r;a>=0;a--)e[a][t]+=i+o*n,o++;return e}},43967(e){e.exports=function(e,t,i,n,r,s){var a;void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=1);var o=0,l=e.length;if(1===s)for(a=r;a<l;a++)e[a][t]=i+o*n,o++;else for(a=r;a>=0;a--)e[a][t]=i+o*n,o++;return e}},88926(e,t,i){var n=i(28176);e.exports=function(e,t){for(var i=0;i<e.length;i++)n(t,e[i]);return e}},33286(e,t,i){var n=i(24820);e.exports=function(e,t){for(var i=0;i<e.length;i++)n(t,e[i]);return e}},96e3(e,t,i){var n=i(65822);e.exports=function(e,t){for(var i=0;i<e.length;i++)n(t,e[i]);return e}},28789(e,t,i){var n=i(26597);e.exports=function(e,t){for(var i=0;i<e.length;i++)n(t,e[i]);return e}},97154(e,t,i){var n=i(90260);e.exports=function(e,t){for(var i=0;i<e.length;i++)n(t,e[i]);return e}},20510(e,t,i){var n=i(66979);e.exports=function(e,t,i,r,s){return n(e,"rotation",t,i,r,s)}},91051(e,t,i){var n=i(1163),r=i(20339);e.exports=function(e,t,i){for(var s=t.x,a=t.y,o=0;o<e.length;o++){var l=e[o];n(l,s,a,i,Math.max(1,r(l.x,l.y,s,a)))}return e}},76332(e,t,i){var n=i(1163);e.exports=function(e,t,i,r){var s=t.x,a=t.y;if(0===r)return e;for(var o=0;o<e.length;o++)n(e[o],s,a,i,r);return e}},61619(e,t,i){var n=i(66979);e.exports=function(e,t,i,r,s){return n(e,"scaleX",t,i,r,s)}},94868(e,t,i){var n=i(66979);e.exports=function(e,t,i,r,s,a,o){return void 0!==i&&null!==i||(i=t),n(e,"scaleX",t,r,a,o),n(e,"scaleY",i,s,a,o)}},95532(e,t,i){var n=i(66979);e.exports=function(e,t,i,r,s){return n(e,"scaleY",t,i,r,s)}},8689(e,t,i){var n=i(43967);e.exports=function(e,t,i,r,s){return n(e,"alpha",t,i,r,s)}},2645(e,t,i){var n=i(43967);e.exports=function(e,t,i,r){return n(e,"blendMode",t,0,i,r)}},32372(e,t,i){var n=i(43967);e.exports=function(e,t,i,r,s){return n(e,"depth",t,i,r,s)}},85373(e){e.exports=function(e,t,i){for(var n=0;n<e.length;n++)e[n].setInteractive(t,i);return e}},81583(e,t,i){var n=i(43967);e.exports=function(e,t,i,r,s,a,o){return void 0!==i&&null!==i||(i=t),n(e,"originX",t,r,a,o),n(e,"originY",i,s,a,o),e.forEach(function(e){e.updateDisplayOrigin()}),e}},79939(e,t,i){var n=i(43967);e.exports=function(e,t,i,r,s){return n(e,"rotation",t,i,r,s)}},2699(e,t,i){var n=i(43967);e.exports=function(e,t,i,r,s,a,o){return void 0!==i&&null!==i||(i=t),n(e,"scaleX",t,r,a,o),n(e,"scaleY",i,s,a,o)}},98739(e,t,i){var n=i(43967);e.exports=function(e,t,i,r,s){return n(e,"scaleX",t,i,r,s)}},98476(e,t,i){var n=i(43967);e.exports=function(e,t,i,r,s){return n(e,"scaleY",t,i,r,s)}},6207(e,t,i){var n=i(43967);e.exports=function(e,t,i,r,s,a,o){return void 0!==i&&null!==i||(i=t),n(e,"scrollFactorX",t,r,a,o),n(e,"scrollFactorY",i,s,a,o)}},6607(e,t,i){var n=i(43967);e.exports=function(e,t,i,r,s){return n(e,"scrollFactorX",t,i,r,s)}},72248(e,t,i){var n=i(43967);e.exports=function(e,t,i,r,s){return n(e,"scrollFactorY",t,i,r,s)}},14036(e){e.exports=function(e,t,i,n,r){for(var s=0;s<e.length;s++)e[s].setTint(t,i,n,r);return e}},50159(e,t,i){var n=i(43967);e.exports=function(e,t,i,r){return n(e,"visible",t,0,i,r)}},77597(e,t,i){var n=i(43967);e.exports=function(e,t,i,r,s){return n(e,"x",t,i,r,s)}},83194(e,t,i){var n=i(43967);e.exports=function(e,t,i,r,s,a,o){return void 0!==i&&null!==i||(i=t),n(e,"x",t,r,a,o),n(e,"y",i,s,a,o)}},67678(e,t,i){var n=i(43967);e.exports=function(e,t,i,r,s){return n(e,"y",t,i,r,s)}},35850(e,t,i){var n=i(26099);e.exports=function(e,t,i,r,s){var a,o;void 0===r&&(r=0),void 0===s&&(s=new n);var l=e.length;if(1===l)a=e[0].x,o=e[0].y,e[0].x=t,e[0].y=i;else{var h=1,u=0;0===r&&(u=l-1,h=l-2),a=e[u].x,o=e[u].y,e[u].x=t,e[u].y=i;for(var c=0;c<l;c++)if(!(h>=l||-1===h)){var d=e[h],f=d.x,p=d.y;d.x=a,d.y=o,a=f,o=p,0===r?h--:h++}}return s.x=a,s.y=o,s}},8628(e,t,i){var n=i(33680);e.exports=function(e){return n(e)}},21837(e,t,i){var n=i(7602);e.exports=function(e,t,i,r,s){void 0===s&&(s=!1);var a,o=Math.abs(r-i)/e.length;if(s)for(a=0;a<e.length;a++)e[a][t]+=n(a*o,i,r);else for(a=0;a<e.length;a++)e[a][t]=n(a*o,i,r);return e}},21910(e,t,i){var n=i(54261);e.exports=function(e,t,i,r,s){void 0===s&&(s=!1);var a,o=Math.abs(r-i)/e.length;if(s)for(a=0;a<e.length;a++)e[a][t]+=n(a*o,i,r);else for(a=0;a<e.length;a++)e[a][t]=n(a*o,i,r);return e}},62054(e){e.exports=function(e,t,i,n,r){if(void 0===r&&(r=!1),0===e.length)return e;if(1===e.length)return r?e[0][t]+=(n+i)/2:e[0][t]=(n+i)/2,e;var s,a=Math.abs(n-i)/(e.length-1);if(r)for(s=0;s<e.length;s++)e[s][t]+=s*a+i;else for(s=0;s<e.length;s++)e[s][t]=s*a+i;return e}},79815(e){e.exports=function(e){for(var t=0;t<e.length;t++)e[t].visible=!e[t].visible;return e}},39665(e,t,i){var n=i(15994);e.exports=function(e,t,i){void 0===i&&(i=0);for(var r=0;r<e.length;r++){var s=e[r];s.x=n(s.x,t.left-i,t.right+i),s.y=n(s.y,t.top-i,t.bottom+i)}return e}},61061(e,t,i){e.exports={AddEffectBloom:i(93300),AddEffectShine:i(56704),AddMaskShape:i(245),AlignTo:i(11517),Angle:i(80318),Call:i(60757),FitToRegion:i(94591),GetFirst:i(69927),GetLast:i(32265),GridAlign:i(94420),IncAlpha:i(41721),IncX:i(67285),IncXY:i(9074),IncY:i(75222),PlaceOnCircle:i(22983),PlaceOnEllipse:i(95253),PlaceOnLine:i(88505),PlaceOnRectangle:i(41346),PlaceOnTriangle:i(11575),PlayAnimation:i(29953),PropertyValueInc:i(66979),PropertyValueSet:i(43967),RandomCircle:i(88926),RandomEllipse:i(33286),RandomLine:i(96e3),RandomRectangle:i(28789),RandomTriangle:i(97154),Rotate:i(20510),RotateAround:i(91051),RotateAroundDistance:i(76332),ScaleX:i(61619),ScaleXY:i(94868),ScaleY:i(95532),SetAlpha:i(8689),SetBlendMode:i(2645),SetDepth:i(32372),SetHitArea:i(85373),SetOrigin:i(81583),SetRotation:i(79939),SetScale:i(2699),SetScaleX:i(98739),SetScaleY:i(98476),SetScrollFactor:i(6207),SetScrollFactorX:i(6607),SetScrollFactorY:i(72248),SetTint:i(14036),SetVisible:i(50159),SetX:i(77597),SetXY:i(83194),SetY:i(67678),ShiftPosition:i(35850),Shuffle:i(8628),SmootherStep:i(21910),SmoothStep:i(21837),Spread:i(62054),ToggleVisible:i(79815),WrapInRectangle:i(39665)}},42099(e,t,i){var n=i(45319),r=i(83419),s=i(74943),a=i(81957),o=i(41138),l=i(35154),h=i(90126),u=new r({initialize:function(e,t,i){this.manager=e,this.key=t,this.type="frame",this.frames=this.getFrames(e.textureManager,l(i,"frames",[]),l(i,"defaultTextureKey",null),l(i,"sortFrames",!0)),this.frameRate=l(i,"frameRate",null),this.duration=l(i,"duration",null),this.msPerFrame,this.skipMissedFrames=l(i,"skipMissedFrames",!0),this.delay=l(i,"delay",0),this.repeat=l(i,"repeat",0),this.repeatDelay=l(i,"repeatDelay",0),this.yoyo=l(i,"yoyo",!1),this.showBeforeDelay=l(i,"showBeforeDelay",!1),this.showOnStart=l(i,"showOnStart",!1),this.hideOnComplete=l(i,"hideOnComplete",!1),this.randomFrame=l(i,"randomFrame",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(s.PAUSE_ALL,this.pause,this),this.manager.on(s.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(e,t,i,n){null===i&&null===n?(e.frameRate=24,e.duration=24/t*1e3):i&&null===n?(e.duration=i,e.frameRate=t/(i/1e3)):(e.frameRate=n,e.duration=t/n*1e3),e.msPerFrame=1e3/e.frameRate},addFrame:function(e){return this.addFrameAt(this.frames.length,e)},addFrameAt:function(e,t){var i=this.getFrames(this.manager.textureManager,t);if(i.length>0){if(0===e)this.frames=i.concat(this.frames);else if(e===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,e),r=this.frames.slice(e);this.frames=n.concat(i,r)}this.updateFrameSequence()}return this},checkFrame:function(e){return e>=0&&e<this.frames.length},getFirstTick:function(e){e.accumulator=0,e.nextTick=e.frameRate===e.currentAnim.frameRate&&e.currentFrame.duration||e.msPerFrame},getFrameAt:function(e){return this.frames[e]},getFrames:function(e,t,i,n){void 0===n&&(n=!0);var r,s,a,u,c=[],d=1;if("string"===typeof t){if(u=t,!e.exists(u))return console.warn('Texture "%s" not found',u),c;var f=e.get(u).getFrameNames();n&&h(f),t=[],f.forEach(function(e){t.push({key:u,frame:e})})}if(!Array.isArray(t)||0===t.length)return c;for(a=0;a<t.length;a++){var p=t[a],m=l(p,"key",i);if(m){var g=l(p,"frame",0),v=e.getFrame(m,g);v?((s=new o(m,g,d,v)).duration=l(p,"duration",0),s.isFirst=!r,r&&(r.nextFrame=s,s.prevFrame=r),c.push(s),r=s,d++):console.warn('Texture "%s" not found',m)}}if(c.length>0){s.isLast=!0,s.nextFrame=c[0],c[0].prevFrame=s;var y=1/(c.length-1);for(a=0;a<c.length;a++)c[a].progress=a*y}return c},getNextTick:function(e){e.accumulator-=e.nextTick,e.nextTick=e.frameRate===e.currentAnim.frameRate&&e.currentFrame.duration||e.msPerFrame},getFrameByProgress:function(e){return e=n(e,0,1),a(e,this.frames,"progress")},nextFrame:function(e){var t=e.currentFrame;t.isLast?e.yoyo?this.handleYoyoFrame(e,!1):e.repeatCounter>0?e.inReverse&&e.forward?e.forward=!1:this.repeatAnimation(e):e.complete():this.updateAndGetNextTick(e,t.nextFrame)},handleYoyoFrame:function(e,t){if(t||(t=!1),e.inReverse===!t&&e.repeatCounter>0)return(0===e.repeatDelay||e.pendingRepeat)&&(e.forward=t),void this.repeatAnimation(e);if(e.inReverse===t||0!==e.repeatCounter){e.forward=t;var i=t?e.currentFrame.nextFrame:e.currentFrame.prevFrame;this.updateAndGetNextTick(e,i)}else e.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(e){var t=e.currentFrame;t.isFirst?e.yoyo?this.handleYoyoFrame(e,!0):e.repeatCounter>0?(e.inReverse&&!e.forward||(e.forward=!0),this.repeatAnimation(e)):e.complete():this.updateAndGetNextTick(e,t.prevFrame)},updateAndGetNextTick:function(e,t){e.setCurrentFrame(t),this.getNextTick(e)},removeFrame:function(e){var t=this.frames.indexOf(e);return-1!==t&&this.removeFrameAt(t),this},removeFrameAt:function(e){return this.frames.splice(e,1),this.updateFrameSequence(),this},repeatAnimation:function(e){if(2===e._pendingStop){if(0===e._pendingStopValue)return e.stop();e._pendingStopValue--}e.repeatDelay>0&&!e.pendingRepeat?(e.pendingRepeat=!0,e.accumulator-=e.nextTick,e.nextTick+=e.repeatDelay):(e.repeatCounter--,e.forward?e.setCurrentFrame(e.currentFrame.nextFrame):e.setCurrentFrame(e.currentFrame.prevFrame),e.isPlaying&&(this.getNextTick(e),e.handleRepeat()))},toJSON:function(){var e={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(t){e.frames.push(t.toJSON())}),e},updateFrameSequence:function(){for(var e,t=this.frames.length,i=1/(t-1),n=0;n<t;n++)(e=this.frames[n]).index=n+1,e.isFirst=!1,e.isLast=!1,e.progress=n*i,0===n?(e.isFirst=!0,1===t?(e.isLast=!0,e.nextFrame=e,e.prevFrame=e):(e.isLast=!1,e.prevFrame=this.frames[t-1],e.nextFrame=this.frames[n+1])):n===t-1&&t>1?(e.isLast=!0,e.prevFrame=this.frames[t-2],e.nextFrame=this.frames[0]):t>1&&(e.prevFrame=this.frames[n-1],e.nextFrame=this.frames[n+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(s.PAUSE_ALL,this.pause,this),this.manager.off(s.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var e=0;e<this.frames.length;e++)this.frames[e].destroy();this.frames=[],this.manager=null}});e.exports=u},41138(e,t,i){var n=new(i(83419))({initialize:function(e,t,i,n,r){void 0===r&&(r=!1),this.textureKey=e,this.textureFrame=t,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=r},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});e.exports=n},60848(e,t,i){var n=i(42099),r=i(83419),s=i(90330),a=i(50792),o=i(74943),l=i(8443),h=i(95540),u=i(35154),c=i(36383),d=i(20283),f=i(41836),p=new r({Extends:a,initialize:function(e){a.call(this),this.game=e,this.textureManager=null,this.globalTimeScale=1,this.anims=new s,this.mixes=new s,this.paused=!1,this.name="AnimationManager",e.events.once(l.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(l.DESTROY,this.destroy,this)},addMix:function(e,t,i){var n=this.anims,r=this.mixes,s="string"===typeof e?e:e.key,a="string"===typeof t?t:t.key;if(n.has(s)&&n.has(a)){var o=r.get(s);o||(o={}),o[a]=i,r.set(s,o)}return this},removeMix:function(e,t){var i=this.mixes,n="string"===typeof e?e:e.key,r=i.get(n);if(r)if(t){var s="string"===typeof t?t:t.key;r.hasOwnProperty(s)&&delete r[s]}else t||i.delete(n);return this},getMix:function(e,t){var i=this.mixes,n="string"===typeof e?e:e.key,r="string"===typeof t?t:t.key,s=i.get(n);return s&&s.hasOwnProperty(r)?s[r]:0},add:function(e,t){return this.anims.has(e)?(console.warn("Animation key exists: "+e),this):(t.key=e,this.anims.set(e,t),this.emit(o.ADD_ANIMATION,e,t),this)},exists:function(e){return this.anims.has(e)},createFromAseprite:function(e,t,i){var n=[],r=this.game.cache.json.get(e);if(!r)return console.warn("No Aseprite data found for: "+e),n;var s=this,a=u(r,"meta",null),o=u(r,"frames",null);a&&o&&u(a,"frameTags",[]).forEach(function(r){var a=[],l=h(r,"name",null),u=h(r,"from",0),d=h(r,"to",0),f=h(r,"direction","forward");if(l&&(!t||t&&t.indexOf(l)>-1)){for(var p=0,m=u;m<=d;m++){var g=m.toString(),v=o[g];if(v){var y=h(v,"duration",c.MAX_SAFE_INTEGER);a.push({key:e,frame:g,duration:y}),p+=y}}"reverse"===f&&(a=a.reverse());var x,b={key:l,frames:a,duration:p,yoyo:"pingpong"===f};i?i.anims&&(x=i.anims.create(b)):x=s.create(b),x&&n.push(x)}});return n},create:function(e){var t=e.key,i=!1;return t&&((i=this.get(t))?console.warn("AnimationManager key already exists: "+t):(i=new n(this,t,e),this.anims.set(t,i),this.emit(o.ADD_ANIMATION,t,i))),i},fromJSON:function(e,t){void 0===t&&(t=!1),t&&this.anims.clear(),"string"===typeof e&&(e=JSON.parse(e));var i=[];if(e.hasOwnProperty("anims")&&Array.isArray(e.anims)){for(var n=0;n<e.anims.length;n++)i.push(this.create(e.anims[n]));e.hasOwnProperty("globalTimeScale")&&(this.globalTimeScale=e.globalTimeScale)}else e.hasOwnProperty("key")&&"frame"===e.type&&i.push(this.create(e));return i},generateFrameNames:function(e,t){var i=u(t,"prefix",""),n=u(t,"start",0),r=u(t,"end",0),s=u(t,"suffix",""),a=u(t,"zeroPad",0),o=u(t,"outputArray",[]),l=u(t,"frames",!1);if(!this.textureManager.exists(e))return console.warn('Texture "%s" not found',e),o;var h,c=this.textureManager.get(e);if(!c)return o;if(t)for(l||(l=d(n,r)),h=0;h<l.length;h++){var p=i+f(l[h],a,"0",1)+s;c.has(p)?o.push({key:e,frame:p}):console.warn('Frame "%s" not found in texture "%s"',p,e)}else for(l=c.getFrameNames(),h=0;h<l.length;h++)o.push({key:e,frame:l[h]});return o},generateFrameNumbers:function(e,t){var i=u(t,"start",0),n=u(t,"end",-1),r=u(t,"first",!1),s=u(t,"outputArray",[]),a=u(t,"frames",!1);if(!this.textureManager.exists(e))return console.warn('Texture "%s" not found',e),s;var o=this.textureManager.get(e);if(!o)return s;r&&o.has(r)&&s.push({key:e,frame:r}),a||(-1===n&&(n=o.frameTotal-2),a=d(i,n));for(var l=0;l<a.length;l++){var h=a[l];o.has(h)?s.push({key:e,frame:h}):console.warn('Frame "%s" not found in texture "%s"',h,e)}return s},get:function(e){return this.anims.get(e)},getAnimsFromTexture:function(e){for(var t=this.textureManager.get(e).key,i=this.anims.getArray(),n=[],r=0;r<i.length;r++)for(var s=i[r],a=s.frames,o=0;o<a.length;o++)if(a[o].textureKey===t){n.push(s.key);break}return n},pauseAll:function(){return this.paused||(this.paused=!0,this.emit(o.PAUSE_ALL)),this},play:function(e,t){Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++)t[i].anims.play(e);return this},staggerPlay:function(e,t,i,n){void 0===i&&(i=0),void 0===n&&(n=!0),Array.isArray(t)||(t=[t]);var r=t.length;n||r--;for(var s=0;s<t.length;s++){var a=i<0?Math.abs(i)*(r-s):i*s;t[s].anims.playAfterDelay(e,a)}return this},remove:function(e){var t=this.get(e);return t&&(this.emit(o.REMOVE_ANIMATION,e,t),this.anims.delete(e),this.removeMix(e)),t},resumeAll:function(){return this.paused&&(this.paused=!1,this.emit(o.RESUME_ALL)),this},toJSON:function(e){var t={anims:[],globalTimeScale:this.globalTimeScale};return void 0!==e&&""!==e?t.anims.push(this.anims.get(e).toJSON()):this.anims.each(function(e,i){t.anims.push(i.toJSON())}),t},destroy:function(){this.anims.clear(),this.mixes.clear(),this.textureManager=null,this.game=null}});e.exports=p},9674(e,t,i){var n=i(42099),r=i(30976),s=i(83419),a=i(90330),o=i(74943),l=i(95540),h=new s({initialize:function(e){this.parent=e,this.animationManager=e.scene.sys.anims,this.animationManager.on(o.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(e){var t=this.parent;if(void 0===e)return this.nextAnimsQueue.length=0,this.nextAnim=null,t;Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var n=e[i];this.nextAnim?this.nextAnimsQueue.push(n):this.nextAnim=n}return this.parent},getName:function(){return this.currentAnim?this.currentAnim.key:""},getFrameName:function(){return this.currentFrame?this.currentFrame.textureFrame:""},load:function(e){this.isPlaying&&this.stop();var t=this.animationManager,i="string"===typeof e?e:l(e,"key",null),n=this.exists(i)?this.get(i):t.get(i);if(n){this.currentAnim=n;var s=n.getTotalFrames(),a=l(e,"frameRate",n.frameRate),o=l(e,"duration",n.duration);n.calculateDuration(this,s,o,a),this.delay=l(e,"delay",n.delay),this.repeat=l(e,"repeat",n.repeat),this.repeatDelay=l(e,"repeatDelay",n.repeatDelay),this.yoyo=l(e,"yoyo",n.yoyo),this.showBeforeDelay=l(e,"showBeforeDelay",n.showBeforeDelay),this.showOnStart=l(e,"showOnStart",n.showOnStart),this.hideOnComplete=l(e,"hideOnComplete",n.hideOnComplete),this.skipMissedFrames=l(e,"skipMissedFrames",n.skipMissedFrames),this.randomFrame=l(e,"randomFrame",n.randomFrame),this.timeScale=l(e,"timeScale",this.timeScale);var h=l(e,"startFrame",0);h>s&&(h=0),this.randomFrame&&(h=r(0,s-1));var u=n.frames[h];0!==h||this.forward||(u=n.getLastFrame()),this.currentFrame=u}else console.warn("Missing animation: "+i);return this.parent},pause:function(e){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==e&&this.setCurrentFrame(e),this.parent},resume:function(e){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==e&&this.setCurrentFrame(e),this.parent},playAfterDelay:function(e,t){if(this.isPlaying){var i=this.nextAnim,n=this.nextAnimsQueue;i&&n.unshift(i),this.nextAnim=e,this._pendingStop=1,this._pendingStopValue=t}else this.delayCounter=t,this.play(e,!0);return this.parent},playAfterRepeat:function(e,t){if(void 0===t&&(t=1),this.isPlaying){var i=this.nextAnim,n=this.nextAnimsQueue;i&&n.unshift(i),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this.nextAnim=e,this._pendingStop=2,this._pendingStopValue=t}else this.play(e);return this.parent},play:function(e,t){void 0===t&&(t=!1);var i=this.currentAnim,n=this.parent,r="string"===typeof e?e:e.key;if(t&&this.isPlaying&&i.key===r)return n;if(i&&this.isPlaying){var s=this.animationManager.getMix(i.key,e);if(s>0)return this.playAfterDelay(e,s)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(e)},playReverse:function(e,t){void 0===t&&(t=!1);var i="string"===typeof e?e:e.key;return t&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(e))},startAnimation:function(e){this.load(e);var t=this.currentAnim,i=this.parent;return t?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,t.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter?this.handleStart():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(e,t){var i=this.currentAnim;if(i){var n=this.currentFrame,r=this.parent,s=n.textureFrame;r.emit(e,i,n,r,s),t&&r.emit(t+i.key,i,n,r,s)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var e=this.currentFrame;if(!e)return 0;var t=e.progress;return this.inReverse&&(t*=-1),t},setProgress:function(e){return this.forward||(e=1-e),this.setCurrentFrame(this.currentAnim.getFrameByProgress(e)),this.parent},setRepeat:function(e){return this.repeatCounter=-1===e?Number.MAX_VALUE:e,this.parent},globalRemove:function(e,t){void 0===t&&(t=this.currentAnim),this.isPlaying&&t.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(e,t){void 0===e&&(e=!1),void 0===t&&(t=!1);var i=this.currentAnim,n=this.parent;return i?(t&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!e,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):n},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var e=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(e)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var e=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(e)}return this.parent},stopAfterDelay:function(e){return this._pendingStop=1,this._pendingStopValue=e,this.parent},stopAfterRepeat:function(e){return void 0===e&&(e=1),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=e,this.parent},stopOnFrame:function(e){return this._pendingStop=3,this._pendingStopValue=e,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(e,t){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=t*this.timeScale*this.animationManager.globalTimeScale,1===this._pendingStop&&(this._pendingStopValue-=t,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var n=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),n++}while(this.isPlaying&&this.accumulator>this.nextTick&&n<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(e){var t=this.parent;return this.currentFrame=e,t.texture=e.frame.texture,t.frame=e.frame,t.isCropped&&t.frame.updateCropUVs(t._crop,t.flipX,t.flipY),e.setAlpha&&(t.alpha=e.alpha),t.setSizeToFrame(),t._originComponent&&(e.frame.customPivot?t.setOrigin(e.frame.pivotX,e.frame.pivotY):t.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===e&&this.stop()),t},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(e){return this.anims?this.anims.get(e):null},exists:function(e){return!!this.anims&&this.anims.has(e)},create:function(e){var t=e.key,i=!1;return t&&((i=this.get(t))?console.warn("Animation key already exists: "+t):(i=new n(this,t,e),this.anims||(this.anims=new a),this.anims.set(t,i))),i},createFromAseprite:function(e,t){return this.animationManager.createFromAseprite(e,t,this.parent)},generateFrameNames:function(e,t){return this.animationManager.generateFrameNames(e,t)},generateFrameNumbers:function(e,t){return this.animationManager.generateFrameNumbers(e,t)},remove:function(e){var t=this.get(e);return t&&(this.currentAnim===t&&this.stop(),this.anims.delete(e)),t},destroy:function(){this.animationManager.off(o.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}}});e.exports=h},57090(e){e.exports="add"},25312(e){e.exports="animationcomplete"},89580(e){e.exports="animationcomplete-"},52860(e){e.exports="animationrepeat"},63850(e){e.exports="animationrestart"},99085(e){e.exports="animationstart"},28087(e){e.exports="animationstop"},1794(e){e.exports="animationupdate"},52562(e){e.exports="pauseall"},57953(e){e.exports="remove"},68339(e){e.exports="resumeall"},74943(e,t,i){e.exports={ADD_ANIMATION:i(57090),ANIMATION_COMPLETE:i(25312),ANIMATION_COMPLETE_KEY:i(89580),ANIMATION_REPEAT:i(52860),ANIMATION_RESTART:i(63850),ANIMATION_START:i(99085),ANIMATION_STOP:i(28087),ANIMATION_UPDATE:i(1794),PAUSE_ALL:i(52562),REMOVE_ANIMATION:i(57953),RESUME_ALL:i(68339)}},60421(e,t,i){e.exports={Animation:i(42099),AnimationFrame:i(41138),AnimationManager:i(60848),AnimationState:i(9674),Events:i(74943)}},2161(e,t,i){var n=i(83419),r=i(90330),s=i(50792),a=i(24736),o=new n({initialize:function(){this.entries=new r,this.events=new s},add:function(e,t){return this.entries.set(e,t),this.events.emit(a.ADD,this,e,t),this},has:function(e){return this.entries.has(e)},exists:function(e){return this.entries.has(e)},get:function(e){return this.entries.get(e)},remove:function(e){var t=this.get(e);return t&&(this.entries.delete(e),this.events.emit(a.REMOVE,this,e,t.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});e.exports=o},24047(e,t,i){var n=i(2161),r=i(83419),s=i(8443),a=new r({initialize:function(e){this.game=e,this.binary=new n,this.bitmapFont=new n,this.json=new n,this.physics=new n,this.shader=new n,this.audio=new n,this.video=new n,this.text=new n,this.html=new n,this.tilemap=new n,this.xml=new n,this.atlas=new n,this.custom={},this.game.events.once(s.DESTROY,this.destroy,this)},addCustom:function(e){return this.custom.hasOwnProperty(e)||(this.custom[e]=new n),this.custom[e]},destroy:function(){for(var e=["binary","bitmapFont","json","physics","shader","audio","video","text","html","tilemap","xml","atlas"],t=0;t<e.length;t++)this[e[t]].destroy(),this[e[t]]=null;for(var i in this.custom)this.custom[i].destroy();this.custom=null,this.game=null}});e.exports=a},51464(e){e.exports="add"},59261(e){e.exports="remove"},24736(e,t,i){e.exports={ADD:i(51464),REMOVE:i(59261)}},83388(e,t,i){e.exports={BaseCache:i(2161),CacheManager:i(24047),Events:i(24736)}},71911(e,t,i){var n=i(83419),r=i(39506),s=i(50792),a=i(19715),o=i(87841),l=i(88509),h=i(61340),u=i(59715),c=i(80333),d=i(26099),f=new n({Extends:s,Mixins:[l,u],initialize:function(e,t,i,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),s.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new o,this.dirty=!0,this._x=e,this._y=t,this._width=i,this._height=n,this._bounds=new o,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new h,this.matrixCombined=new h,this.matrixExternal=new h,this.transparent=!0,this.backgroundColor=c("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new d(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[],this.isSceneCamera=!0,this.forceComposite=!1,this.renderRoundPixels=!0},addToRenderList:function(e){this.renderList.push(e)},setOrigin:function(e,t){return void 0===e&&(e=.5),void 0===t&&(t=e),this.originX=e,this.originY=t,this},getScroll:function(e,t,i){void 0===i&&(i=new d);var n=.5*this.width,r=.5*this.height;return i.x=e-n,i.y=t-r,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(e){var t=.5*this.width;return this.midPoint.x=e,this.scrollX=e-t,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(e){var t=.5*this.height;return this.midPoint.y=e,this.scrollY=e-t,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(e,t){return this.centerOnX(e),this.centerOnY(t),this},centerToBounds:function(){if(this.useBounds){var e=this._bounds,t=.5*this.width,i=.5*this.height;this.midPoint.set(e.centerX,e.centerY),this.scrollX=e.centerX-t,this.scrollY=e.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(e){if(this.disableCull)return e;var t=this.matrix.matrix,i=t[0],n=t[1],r=t[2],s=t[3],a=i*s-n*r;if(!a)return e;var o=this.scrollX,l=this.scrollY,h=this.width,u=this.height,c=this.y,d=c+u,f=this.x,p=f+h,m=this.culledObjects,g=e.length;a=1/a,m.length=0;for(var v=0;v<g;++v){var y=e[v];if(y.hasOwnProperty("width")&&!y.parentContainer){var x=y.width,b=y.height,w=y.x-o*y.scrollFactorX-x*y.originX,T=y.y-l*y.scrollFactorY-b*y.originY;(w+x)*i+(T+b)*r>f&&w*i+T*r<p&&(w+x)*n+(T+b)*s>c&&w*n+T*s<d&&m.push(y)}else m.push(y)}return m},getWorldPoint:function(e,t,i){void 0===i&&(i=new d);var n=this.matrixCombined.matrix,r=n[0],s=n[1],a=n[2],o=n[3],l=n[4],h=n[5],u=r*o-s*a;if(!u)return i.x=e,i.y=t,i;var c=o*(u=1/u),f=-s*u,p=-a*u,m=r*u,g=(a*h-o*l)*u,v=(s*l-r*h)*u;return i.x=e*c+t*p+g,i.y=e*f+t*m+v,i},ignore:function(e){var t=this.id;Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var n=e[i];Array.isArray(n)?this.ignore(n):n.isParent?this.ignore(n.getChildren()):n.cameraFilter|=t}return this},clampX:function(e){var t=this._bounds,i=this.displayWidth,n=t.x+(i-this.width)/2,r=Math.max(n,n+t.width-i);return e<n?e=n:e>r&&(e=r),e},clampY:function(e){var t=this._bounds,i=this.displayHeight,n=t.y+(i-this.height)/2,r=Math.max(n,n+t.height-i);return e<n?e=n:e>r&&(e=r),e},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(e){return void 0===e&&(e=0),this.rotation=r(e),this},setBackgroundColor:function(e){return void 0===e&&(e="rgba(0,0,0,0)"),this.backgroundColor=c(e),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(e,t,i,n,r){return void 0===r&&(r=!1),this._bounds.setTo(e,t,i,n),this.dirty=!0,this.useBounds=!0,r?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setForceComposite:function(e){return this.forceComposite=e,this},getBounds:function(e){void 0===e&&(e=new o);var t=this._bounds;return e.setTo(t.x,t.y,t.width,t.height),e},setName:function(e){return void 0===e&&(e=""),this.name=e,this},setPosition:function(e,t){return void 0===t&&(t=e),this.x=e,this.y=t,this},setRotation:function(e){return void 0===e&&(e=0),this.rotation=e,this},setRoundPixels:function(e){return this.roundPixels=e,this},setScene:function(e,t){void 0===t&&(t=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=e,this.isSceneCamera=t;var i=e.sys;return this.sceneManager=i.game.scene,this.scaleManager=i.scale,this.cameraManager=i.cameras,this.updateSystem(),this},setScroll:function(e,t){return void 0===t&&(t=e),this.scrollX=e,this.scrollY=t,this},setSize:function(e,t){return void 0===t&&(t=e),this.width=e,this.height=t,this},setViewport:function(e,t,i,n){return this.x=e,this.y=t,this.width=i,this.height=n,this},setZoom:function(e,t){return void 0===e&&(e=1),void 0===t&&(t=e),0===e&&(e=.001),0===t&&(t=.001),this.zoomX=e,this.zoomY=t,this},setMask:function(e,t){return void 0===t&&(t=!0),this.mask=e,this._maskCamera=t?this.cameraManager.default:this,this},clearMask:function(e){return void 0===e&&(e=!1),e&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var e={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&&(e.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),e},update:function(){},setIsSceneCamera:function(e){return this.isSceneCamera=e,this},updateSystem:function(){if(this.scaleManager&&this.isSceneCamera){var e=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,t=this.sceneManager;e&&!this._customViewport?t.customViewports++:!e&&this._customViewport&&t.customViewports--,this.dirty=!0,this._customViewport=e}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.matrixCombined.destroy(),this.matrixExternal.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(e){this._x=e,this.updateSystem()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.updateSystem()}},width:{get:function(){return this._width},set:function(e){this._width=e,this.updateSystem()}},height:{get:function(){return this._height},set:function(e){this._height=e,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(e){e!==this._scrollX&&(this._scrollX=e,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(e){e!==this._scrollY&&(this._scrollY=e,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(e){this._zoomX=e,this._zoomY=e,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(e){this._zoomX=e,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(e){this._zoomY=e,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation=e,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}}});e.exports=f},38058(e,t,i){var n=i(71911),r=i(67502),s=i(45319),a=i(83419),o=i(31401),l=i(20052),h=i(19715),u=i(28915),c=i(87841),d=i(26099),f=new a({Extends:n,initialize:function(e,t,i,r){n.call(this,e,t,i,r),this.filters={internal:new o.FilterList(this),external:new o.FilterList(this)},this.isObjectInversion=!1,this.inputEnabled=!0,this.fadeEffect=new l.Fade(this),this.flashEffect=new l.Flash(this),this.shakeEffect=new l.Shake(this),this.panEffect=new l.Pan(this),this.rotateToEffect=new l.RotateTo(this),this.zoomEffect=new l.Zoom(this),this.lerp=new d(1,1),this.followOffset=new d,this.deadzone=null,this._follow=null},setDeadzone:function(e,t){if(void 0===e)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=e,this.deadzone.height=t):this.deadzone=new c(0,0,e,t),this._follow){var i=this.width/2,n=this.height/2,s=this._follow.x-this.followOffset.x,a=this._follow.y-this.followOffset.y;this.midPoint.set(s,a),this.scrollX=s-i,this.scrollY=a-n}r(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(e,t,i,n,r,s){return this.fadeEffect.start(!1,e,t,i,n,!0,r,s)},fadeOut:function(e,t,i,n,r,s){return this.fadeEffect.start(!0,e,t,i,n,!0,r,s)},fadeFrom:function(e,t,i,n,r,s,a){return this.fadeEffect.start(!1,e,t,i,n,r,s,a)},fade:function(e,t,i,n,r,s,a){return this.fadeEffect.start(!0,e,t,i,n,r,s,a)},flash:function(e,t,i,n,r,s,a){return this.flashEffect.start(e,t,i,n,r,s,a)},shake:function(e,t,i,n,r){return this.shakeEffect.start(e,t,i,n,r)},pan:function(e,t,i,n,r,s,a){return this.panEffect.start(e,t,i,n,r,s,a)},rotateTo:function(e,t,i,n,r,s,a){return this.rotateToEffect.start(e,t,i,n,r,s,a)},zoomTo:function(e,t,i,n,r,s){return this.zoomEffect.start(e,t,i,n,r,s)},preRender:function(){this.renderList.length=0;var e=this.width,t=this.height,i=.5*e,n=.5*t,s=this.zoomX,a=this.zoomY;this.renderRoundPixels=this.roundPixels&&Number.isInteger(s)&&Number.isInteger(a);var o=e*this.originX,l=t*this.originY,c=this._follow,d=this.deadzone,f=this.scrollX,p=this.scrollY;d&&r(d,this.midPoint.x,this.midPoint.y);var m=!1;if(c&&!this.panEffect.isRunning){var g=this.lerp,v=c.x-this.followOffset.x,y=c.y-this.followOffset.y;d?(v<d.x?f=u(f,f-(d.x-v),g.x):v>d.right&&(f=u(f,f+(v-d.right),g.x)),y<d.y?p=u(p,p-(d.y-y),g.y):y>d.bottom&&(p=u(p,p+(y-d.bottom),g.y))):(f=u(f,v-o,g.x),p=u(p,y-l,g.y)),m=!0}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.scrollX=f,this.scrollY=p;var x=f+i,b=p+n;this.midPoint.set(x,b);var w=e/s,T=t/a,_=x-w/2,S=b-T/2;this.worldView.setTo(_,S,w,T);var E=this.matrix,C=this.matrixExternal;this.isObjectInversion?(E.loadIdentity(),E.translate(o,l),E.scale(s,a),E.rotate(this.rotation),E.translate(-f-o,-p-l)):(E.applyITRS(o,l,this.rotation,s,a),E.translate(-f-o,-p-l)),C.applyITRS(this.x,this.y,0,1,1),this.shakeEffect.preRender(),C.multiply(E,this.matrixCombined),m&&this.emit(h.FOLLOW_UPDATE,this,c)},getViewMatrix:function(e){return e||this.forceComposite||this.filters.external.length>0||this.filters.internal.length>0?this.matrix:this.matrixCombined},getPaddingWrapper:function(e){var t={padding:0},i=new Proxy(this,{get:function(e,i){switch(i){case"padding":return t.padding;case"x":case"y":case"scrollX":case"scrollY":return e[i]+t.padding;case"width":case"height":return e[i]-2*t.padding;default:return e[i]}},set:function(i,n,r){switch(n){case"padding":var s=t.padding;t.padding=r;var a=t.padding-s;return i.x-=a,i.y-=a,i.width+=2*a,i.height+=2*a,i.scrollX-=a,i.scrollY-=a,e;case"x":case"y":case"scrollX":case"scrollY":return i[n]=r-t.padding;case"width":case"height":return i[n]=r+2*t.padding;default:return i[n]=r}}});return i.padding=e||0,i},setLerp:function(e,t){return void 0===e&&(e=1),void 0===t&&(t=e),this.lerp.set(e,t),this},setFollowOffset:function(e,t){return void 0===e&&(e=0),void 0===t&&(t=0),this.followOffset.set(e,t),this},startFollow:function(e,t,i,n,r,a){void 0===t&&(t=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===r&&(r=0),void 0===a&&(a=r),this._follow=e,this.roundPixels=t,i=s(i,0,1),n=s(n,0,1),this.lerp.set(i,n),this.followOffset.set(r,a);var o=this.width/2,l=this.height/2,h=e.x-r,u=e.y-a;return this.midPoint.set(h,u),this.scrollX=h-o,this.scrollY=u-l,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(e,t){this.visible&&(this.rotateToEffect.update(e,t),this.panEffect.update(e,t),this.zoomEffect.update(e,t),this.shakeEffect.update(e,t),this.flashEffect.update(e,t),this.fadeEffect.update(e,t))},destroy:function(){this.resetFX(),this.filters.internal.destroy(),this.filters.external.destroy(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});e.exports=f},32743(e,t,i){var n=i(38058),r=i(83419),s=i(95540),a=i(37277),o=i(37303),l=i(97480),h=i(44594),u=new r({initialize:function(e){this.scene=e,this.systems=e.sys,this.roundPixels=e.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,e.sys.events.once(h.BOOT,this.boot,this),e.sys.events.on(h.START,this.start,this)},boot:function(){var e=this.systems;e.settings.cameras?this.fromJSON(e.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new n(0,0,e.scale.width,e.scale.height).setScene(this.scene),e.game.scale.on(l.RESIZE,this.onResize,this),this.systems.events.once(h.DESTROY,this.destroy,this)},start:function(){if(!this.main){var e=this.systems;e.settings.cameras?this.fromJSON(e.settings.cameras):this.add(),this.main=this.cameras[0]}var t=this.systems.events;t.on(h.UPDATE,this.update,this),t.once(h.SHUTDOWN,this.shutdown,this)},add:function(e,t,i,r,s,a){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===r&&(r=this.scene.sys.scale.height),void 0===s&&(s=!1),void 0===a&&(a="");var o=new n(e,t,i,r);return o.setName(a),o.setScene(this.scene),o.setRoundPixels(this.roundPixels),o.id=this.getNextID(),this.cameras.push(o),s&&(this.main=o),o},addExisting:function(e,t){return void 0===t&&(t=!1),-1===this.cameras.indexOf(e)?(e.id=this.getNextID(),e.setRoundPixels(this.roundPixels),this.cameras.push(e),t&&(this.main=e),e):null},getNextID:function(){for(var e=this.cameras,t=1,i=0;i<32;i++){for(var n=!1,r=0;r<e.length;r++){var s=e[r];s&&s.id===t&&(n=!0)}if(!n)return t;t<<=1}return 0},getTotal:function(e){void 0===e&&(e=!1);for(var t=0,i=this.cameras,n=0;n<i.length;n++){var r=i[n];(!e||e&&r.visible)&&t++}return t},fromJSON:function(e){Array.isArray(e)||(e=[e]);for(var t=this.scene.sys.scale.width,i=this.scene.sys.scale.height,n=0;n<e.length;n++){var r=e[n],a=s(r,"x",0),o=s(r,"y",0),l=s(r,"width",t),h=s(r,"height",i),u=this.add(a,o,l,h);u.name=s(r,"name",""),u.zoom=s(r,"zoom",1),u.rotation=s(r,"rotation",0),u.scrollX=s(r,"scrollX",0),u.scrollY=s(r,"scrollY",0),u.roundPixels=s(r,"roundPixels",!1),u.visible=s(r,"visible",!0);var c=s(r,"backgroundColor",!1);c&&u.setBackgroundColor(c);var d=s(r,"bounds",null);if(d){var f=s(d,"x",0),p=s(d,"y",0),m=s(d,"width",t),g=s(d,"height",i);u.setBounds(f,p,m,g)}}return this},getCamera:function(e){for(var t=this.cameras,i=0;i<t.length;i++)if(t[i].name===e)return t[i];return null},getCamerasBelowPointer:function(e){for(var t=this.cameras,i=e.x,n=e.y,r=[],s=0;s<t.length;s++){var a=t[s];a.visible&&a.inputEnabled&&o(a,i,n)&&r.unshift(a)}return r},remove:function(e,t){void 0===t&&(t=!0),Array.isArray(e)||(e=[e]);for(var i=0,n=this.cameras,r=0;r<e.length;r++){var s=n.indexOf(e[r]);-1!==s&&(t?n[s].destroy():n[s].renderList=[],n.splice(s,1),i++)}return!this.main&&n[0]&&(this.main=n[0]),i},render:function(e,t){for(var i=this.scene,n=this.cameras,r=0;r<n.length;r++){var s=n[r];if(s.visible&&s.alpha>0){s.preRender();var a=this.getVisibleChildren(t.getChildren(),s);e.render(i,a,s)}}},getVisibleChildren:function(e,t){return e.filter(function(e){return e.willRender(t)})},resetAll:function(){for(var e=0;e<this.cameras.length;e++)this.cameras[e].destroy();return this.cameras=[],this.main=this.add(),this.main},update:function(e,t){for(var i=0;i<this.cameras.length;i++)this.cameras[i].update(e,t)},onResize:function(e,t,i,n,r){for(var s=0;s<this.cameras.length;s++){var a=this.cameras[s];0===a._x&&0===a._y&&a._width===n&&a._height===r&&a.setSize(t.width,t.height)}},resize:function(e,t){for(var i=0;i<this.cameras.length;i++)this.cameras[i].setSize(e,t)},shutdown:function(){this.main=void 0;for(var e=0;e<this.cameras.length;e++)this.cameras[e].destroy();this.cameras=[];var t=this.systems.events;t.off(h.UPDATE,this.update,this),t.off(h.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.default.destroy(),this.systems.events.off(h.START,this.start,this),this.systems.events.off(h.DESTROY,this.destroy,this),this.systems.game.scale.off(l.RESIZE,this.onResize,this),this.scene=null,this.systems=null}});a.register("CameraManager",u,"cameras"),e.exports=u},5020(e,t,i){var n=i(45319),r=i(83419),s=i(19715),a=new r({initialize:function(e){this.camera=e,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(e,t,i,n,r,a,o,l){if(void 0===e&&(e=!0),void 0===t&&(t=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===a&&(a=!1),void 0===o&&(o=null),void 0===l&&(l=this.camera.scene),!a&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=t,this.direction=e,this.progress=0,this.red=i,this.green=n,this.blue=r,this.alpha=e?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=l;var h=e?s.FADE_OUT_START:s.FADE_IN_START;return this.camera.emit(h,this.camera,this,t,i,n,r),this.camera},update:function(e,t){this.isRunning&&(this._elapsed+=t,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=this.direction?this.progress:1-this.progress:(this.alpha=this.direction?1:0,this.effectComplete()))},postRenderCanvas:function(e){if(!this.isRunning&&!this.isComplete)return!1;var t=this.camera;return e.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",e.fillRect(t.x,t.y,t.width,t.height),!0},postRenderWebGL:function(){return this.isRunning||this.isComplete},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.isComplete=!0;var e=this.direction?s.FADE_OUT_COMPLETE:s.FADE_IN_COMPLETE;this.camera.emit(e,this.camera,this)},reset:function(){this.isRunning=!1,this.isComplete=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});e.exports=a},10662(e,t,i){var n=i(45319),r=i(83419),s=i(19715),a=new r({initialize:function(e){this.camera=e,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(e,t,i,n,r,a,o){return void 0===e&&(e=250),void 0===t&&(t=255),void 0===i&&(i=255),void 0===n&&(n=255),void 0===r&&(r=!1),void 0===a&&(a=null),void 0===o&&(o=this.camera.scene),!r&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.red=t,this.green=i,this.blue=n,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=o,this.camera.emit(s.FLASH_START,this.camera,this,e,t,i,n)),this.camera},update:function(e,t){this.isRunning&&(this._elapsed+=t,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=this._alpha*(1-this.progress):this.effectComplete())},postRenderCanvas:function(e){if(!this.isRunning)return!1;var t=this.camera;return e.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",e.fillRect(t.x,t.y,t.width,t.height),!0},postRenderWebGL:function(){return this.isRunning},effectComplete:function(){this.alpha=this._alpha,this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(s.FLASH_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});e.exports=a},20359(e,t,i){var n=i(45319),r=i(83419),s=i(62640),a=i(19715),o=i(26099),l=new r({initialize:function(e){this.camera=e,this.isRunning=!1,this.duration=0,this.source=new o,this.current=new o,this.destination=new o,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(e,t,i,n,r,o,l){void 0===i&&(i=1e3),void 0===n&&(n=s.Linear),void 0===r&&(r=!1),void 0===o&&(o=null),void 0===l&&(l=this.camera.scene);var h=this.camera;return!r&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(h.scrollX,h.scrollY),this.destination.set(e,t),h.getScroll(e,t,this.current),"string"===typeof n&&s.hasOwnProperty(n)?this.ease=s[n]:"function"===typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=o,this._onUpdateScope=l,this.camera.emit(a.PAN_START,this.camera,this,i,e,t)),h},update:function(e,t){if(this.isRunning){this._elapsed+=t;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var r=this.camera;if(this._elapsed<this.duration){var s=this.ease(i);r.getScroll(this.destination.x,this.destination.y,this.current);var a=this.source.x+(this.current.x-this.source.x)*s,o=this.source.y+(this.current.y-this.source.y)*s;r.setScroll(a,o),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,a,o)}else r.centerOn(this.destination.x,this.destination.y),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,r.scrollX,r.scrollY),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(a.PAN_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}});e.exports=l},34208(e,t,i){var n=i(45319),r=i(83419),s=i(19715),a=i(62640),o=i(86554),l=new r({initialize:function(e){this.camera=e,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(e,t,i,n,r,l,h){void 0===i&&(i=1e3),void 0===n&&(n=a.Linear),void 0===r&&(r=!1),void 0===l&&(l=null),void 0===h&&(h=this.camera.scene),void 0===t&&(t=!1);var u=this.camera;if(!r&&this.isRunning)return u;if(this.shortestPath=t,this.isRunning=!0,this.duration=i,this.progress=0,this.source=u.rotation,this.destination=e,"string"===typeof n&&a.hasOwnProperty(n)?this.ease=a[n]:"function"===typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=l,this._onUpdateScope=h,this.shortestPath){var c=o(this.destination-this.source);this.destination=this.source+c,this.clockwise=c>=0}else this.clockwise=this.destination>=this.source;return this.camera.emit(s.ROTATE_START,this.camera,this,i,this.destination),u},update:function(e,t){if(this.isRunning){this._elapsed+=t;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var r=this.camera;if(this._elapsed<this.duration){var s=this.ease(i),a=this.source+s*(this.destination-this.source);r.rotation=a,this.current=a,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,a)}else r.rotation=this.destination,this.current=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(s.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}});e.exports=l},30330(e,t,i){var n=i(45319),r=i(83419),s=i(19715),a=i(26099),o=new r({initialize:function(e){this.camera=e,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(e,t,i,n,r){return void 0===e&&(e=100),void 0===t&&(t=.05),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===r&&(r=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,"number"===typeof t?this.intensity.set(t):this.intensity.set(t.x,t.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=n,this._onUpdateScope=r,this.camera.emit(s.SHAKE_START,this.camera,this,e,t)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(e,t){if(this.isRunning)if(this._elapsed+=t,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration){var i=this.intensity,r=this.camera.width,s=this.camera.height,a=this.camera.zoom;this._offsetX=(Math.random()*i.x*r*2-i.x*r)*a,this._offsetY=(Math.random()*i.y*s*2-i.y*s)*a,this.camera.roundPixels&&(this._offsetX=Math.round(this._offsetX),this._offsetY=Math.round(this._offsetY))}else this.effectComplete()},effectComplete:function(){this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(s.SHAKE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.intensity=null}});e.exports=o},45641(e,t,i){var n=i(45319),r=i(83419),s=i(62640),a=i(19715),o=new r({initialize:function(e){this.camera=e,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(e,t,i,n,r,o){void 0===t&&(t=1e3),void 0===i&&(i=s.Linear),void 0===n&&(n=!1),void 0===r&&(r=null),void 0===o&&(o=this.camera.scene);var l=this.camera;return!n&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.source=l.zoom,this.destination=e,"string"===typeof i&&s.hasOwnProperty(i)?this.ease=s[i]:"function"===typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=r,this._onUpdateScope=o,this.camera.emit(a.ZOOM_START,this.camera,this,t,e)),l},update:function(e,t){this.isRunning&&(this._elapsed+=t,this.progress=n(this._elapsed/this.duration,0,1),this._elapsed<this.duration?(this.camera.zoom=this.source+(this.destination-this.source)*this.ease(this.progress),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.camera.zoom)):(this.camera.zoom=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.destination),this.effectComplete()))},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(a.ZOOM_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});e.exports=o},20052(e,t,i){e.exports={Fade:i(5020),Flash:i(10662),Pan:i(20359),Shake:i(30330),RotateTo:i(34208),Zoom:i(45641)}},16438(e){e.exports="cameradestroy"},32726(e){e.exports="camerafadeincomplete"},87807(e){e.exports="camerafadeinstart"},45917(e){e.exports="camerafadeoutcomplete"},95666(e){e.exports="camerafadeoutstart"},47056(e){e.exports="cameraflashcomplete"},91261(e){e.exports="cameraflashstart"},45047(e){e.exports="followupdate"},81927(e){e.exports="camerapancomplete"},74264(e){e.exports="camerapanstart"},54419(e){e.exports="postrender"},79330(e){e.exports="prerender"},93183(e){e.exports="camerarotatecomplete"},80112(e){e.exports="camerarotatestart"},62252(e){e.exports="camerashakecomplete"},86017(e){e.exports="camerashakestart"},539(e){e.exports="camerazoomcomplete"},51892(e){e.exports="camerazoomstart"},19715(e,t,i){e.exports={DESTROY:i(16438),FADE_IN_COMPLETE:i(32726),FADE_IN_START:i(87807),FADE_OUT_COMPLETE:i(45917),FADE_OUT_START:i(95666),FLASH_COMPLETE:i(47056),FLASH_START:i(91261),FOLLOW_UPDATE:i(45047),PAN_COMPLETE:i(81927),PAN_START:i(74264),POST_RENDER:i(54419),PRE_RENDER:i(79330),ROTATE_COMPLETE:i(93183),ROTATE_START:i(80112),SHAKE_COMPLETE:i(62252),SHAKE_START:i(86017),ZOOM_COMPLETE:i(539),ZOOM_START:i(51892)}},87969(e,t,i){e.exports={Camera:i(38058),BaseCamera:i(71911),CameraManager:i(32743),Effects:i(20052),Events:i(19715)}},63091(e,t,i){var n=i(83419),r=i(35154),s=new n({initialize:function(e){this.camera=r(e,"camera",null),this.left=r(e,"left",null),this.right=r(e,"right",null),this.up=r(e,"up",null),this.down=r(e,"down",null),this.zoomIn=r(e,"zoomIn",null),this.zoomOut=r(e,"zoomOut",null),this.zoomSpeed=r(e,"zoomSpeed",.01),this.minZoom=r(e,"minZoom",.001),this.maxZoom=r(e,"maxZoom",1e3),this.speedX=0,this.speedY=0;var t=r(e,"speed",null);"number"===typeof t?(this.speedX=t,this.speedY=t):(this.speedX=r(e,"speed.x",0),this.speedY=r(e,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(e){return this.camera=e,this},update:function(e){if(this.active){void 0===e&&(e=1);var t=this.camera;this.up&&this.up.isDown?t.scrollY-=this.speedY*e|0:this.down&&this.down.isDown&&(t.scrollY+=this.speedY*e|0),this.left&&this.left.isDown?t.scrollX-=this.speedX*e|0:this.right&&this.right.isDown&&(t.scrollX+=this.speedX*e|0),this.zoomIn&&this.zoomIn.isDown?(t.zoom-=this.zoomSpeed,t.zoom<this.minZoom&&(t.zoom=this.minZoom)):this.zoomOut&&this.zoomOut.isDown&&(t.zoom+=this.zoomSpeed,t.zoom>this.maxZoom&&(t.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}});e.exports=s},58818(e,t,i){var n=i(83419),r=i(35154),s=new n({initialize:function(e){this.camera=r(e,"camera",null),this.left=r(e,"left",null),this.right=r(e,"right",null),this.up=r(e,"up",null),this.down=r(e,"down",null),this.zoomIn=r(e,"zoomIn",null),this.zoomOut=r(e,"zoomOut",null),this.zoomSpeed=r(e,"zoomSpeed",.01),this.minZoom=r(e,"minZoom",.001),this.maxZoom=r(e,"maxZoom",1e3),this.accelX=0,this.accelY=0;var t=r(e,"acceleration",null);"number"===typeof t?(this.accelX=t,this.accelY=t):(this.accelX=r(e,"acceleration.x",0),this.accelY=r(e,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=r(e,"drag",null);"number"===typeof i?(this.dragX=i,this.dragY=i):(this.dragX=r(e,"drag.x",0),this.dragY=r(e,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var n=r(e,"maxSpeed",null);"number"===typeof n?(this.maxSpeedX=n,this.maxSpeedY=n):(this.maxSpeedX=r(e,"maxSpeed.x",0),this.maxSpeedY=r(e,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(e){return this.camera=e,this},update:function(e){if(this.active){void 0===e&&(e=1);var t=this.camera;this._speedX>0?(this._speedX-=this.dragX*e,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*e,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*e,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*e,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(t.scrollX-=this._speedX*e|0),0!==this._speedY&&(t.scrollY-=this._speedY*e|0),0!==this._zoom&&(t.zoom+=this._zoom,t.zoom<this.minZoom?t.zoom=this.minZoom:t.zoom>this.maxZoom&&(t.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}});e.exports=s},38865(e,t,i){e.exports={FixedKeyControl:i(63091),SmoothedKeyControl:i(58818)}},26638(e,t,i){e.exports={Controls:i(38865),Scene2D:i(87969)}},8054(e,t,i){var n={VERSION:"4.2.1",LOG_VERSION:"v4021",BlendModes:i(10312),ScaleModes:i(29795),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};e.exports=n},69547(e,t,i){var n=i(83419),r=i(8054),s=i(42363),a=i(82264),o=i(95540),l=i(35154),h=i(41212),u=i(29747),c=i(75508),d=i(80333),f=new n({initialize:function(e){void 0===e&&(e={});var t=l(e,"scale",null);this.width=l(t,"width",1024,e),this.height=l(t,"height",768,e),this.zoom=l(t,"zoom",1,e),this.parent=l(t,"parent",void 0,e),this.scaleMode=l(t,t?"mode":"scaleMode",0,e),this.expandParent=l(t,"expandParent",!0,e),this.autoRound=l(t,"autoRound",!1,e),this.autoCenter=l(t,"autoCenter",0,e),this.resizeInterval=l(t,"resizeInterval",500,e),this.fullscreenTarget=l(t,"fullscreenTarget",null,e),this.minWidth=l(t,"min.width",0,e),this.maxWidth=l(t,"max.width",0,e),this.minHeight=l(t,"min.height",0,e),this.maxHeight=l(t,"max.height",0,e),this.snapWidth=l(t,"snap.width",0,e),this.snapHeight=l(t,"snap.height",0,e),this.renderType=l(e,"type",r.AUTO),this.canvas=l(e,"canvas",null),this.context=l(e,"context",null),this.canvasStyle=l(e,"canvasStyle",null),this.customEnvironment=l(e,"customEnvironment",!1),this.sceneConfig=l(e,"scene",null),this.seed=l(e,"seed",[(Date.now()*Math.random()).toString()]),c.RND=new c.RandomDataGenerator(this.seed),this.gameTitle=l(e,"title",""),this.gameURL=l(e,"url","https://phaser.io/"+r.LOG_VERSION),this.gameVersion=l(e,"version",""),this.autoFocus=l(e,"autoFocus",!0),this.stableSort=l(e,"stableSort",-1),-1===this.stableSort&&(this.stableSort=a.browser.es2019?1:0),a.features.stableSort=this.stableSort,this.domCreateContainer=l(e,"dom.createContainer",!1),this.domPointerEvents=l(e,"dom.pointerEvents","none"),this.inputKeyboard=l(e,"input.keyboard",!0),this.inputKeyboardEventTarget=l(e,"input.keyboard.target",window),this.inputKeyboardCapture=l(e,"input.keyboard.capture",[]),this.inputMouse=l(e,"input.mouse",!0),this.inputMouseEventTarget=l(e,"input.mouse.target",null),this.inputMousePreventDefaultDown=l(e,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=l(e,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=l(e,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=l(e,"input.mouse.preventDefaultWheel",!0),this.inputTouch=l(e,"input.touch",a.input.touch),this.inputTouchEventTarget=l(e,"input.touch.target",null),this.inputTouchCapture=l(e,"input.touch.capture",!0),this.inputActivePointers=l(e,"input.activePointers",1),this.inputSmoothFactor=l(e,"input.smoothFactor",0),this.inputWindowEvents=l(e,"input.windowEvents",!0),this.inputGamepad=l(e,"input.gamepad",!1),this.inputGamepadEventTarget=l(e,"input.gamepad.target",window),this.disableContextMenu=l(e,"disableContextMenu",!1),this.audio=l(e,"audio",{}),this.hideBanner=!1===l(e,"banner",null),this.hidePhaser=l(e,"banner.hidePhaser",!1),this.bannerTextColor=l(e,"banner.text","#ffffff"),this.bannerBackgroundColor=l(e,"banner.background",["#000814","#001d3d","#003566"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=l(e,"fps",null);var i=l(e,"render",null);this.autoMobileTextures=l(i,"autoMobileTextures",!0,e),this.antialias=l(i,"antialias",!0,e),this.antialiasGL=l(i,"antialiasGL",!0,e),this.mipmapFilter=l(i,"mipmapFilter","",e),this.mipmapRegeneration=l(i,"mipmapRegeneration",!1,e),this.desynchronized=l(i,"desynchronized",!1,e),this.roundPixels=l(i,"roundPixels",!1,e),this.selfShadow=l(i,"selfShadow",!1,e),this.pathDetailThreshold=l(i,"pathDetailThreshold",1,e),this.pixelArt=l(i,"pixelArt",!1,e),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.smoothPixelArt=l(i,"smoothPixelArt",!1,e),this.smoothPixelArt&&(this.antialias=!0,this.antialiasGL=!0,this.pixelArt=!1),this.transparent=l(i,"transparent",!1,e),this.alphaStrategy=l(i,"alphaStrategy","keep",e),this.stencil=l(i,"stencil",!0,e),this.stencilAlphaStrategy=l(i,"stencilAlphaStrategy","dither",e),this.clearBeforeRender=l(i,"clearBeforeRender",!0,e),this.preserveDrawingBuffer=l(i,"preserveDrawingBuffer",!1,e),this.premultipliedAlpha=l(i,"premultipliedAlpha",!0,e),this.skipUnreadyShaders=l(i,"skipUnreadyShaders",!1,e),this.failIfMajorPerformanceCaveat=l(i,"failIfMajorPerformanceCaveat",!1,e),this.powerPreference=l(i,"powerPreference","default",e),this.batchSize=l(i,"batchSize",16384,e),this.maxTextures=l(i,"maxTextures",-1,e),this.maxLights=l(i,"maxLights",10,e),this.renderNodes=l(i,"renderNodes",{},e);var n=l(e,"backgroundColor",0);this.backgroundColor=d(n),this.transparent&&(this.backgroundColor=d(0),this.backgroundColor.alpha=0),this.preBoot=l(e,"callbacks.preBoot",u),this.postBoot=l(e,"callbacks.postBoot",u),this.physics=l(e,"physics",{}),this.defaultPhysicsSystem=l(this.physics,"default",!1),this.loaderBaseURL=l(e,"loader.baseURL",""),this.loaderPath=l(e,"loader.path",""),this.loaderMaxParallelDownloads=l(e,"loader.maxParallelDownloads",a.os.android?6:32),this.loaderCrossOrigin=l(e,"loader.crossOrigin",void 0),this.loaderResponseType=l(e,"loader.responseType",""),this.loaderAsync=l(e,"loader.async",!0),this.loaderUser=l(e,"loader.user",""),this.loaderPassword=l(e,"loader.password",""),this.loaderTimeout=l(e,"loader.timeout",0),this.loaderMaxRetries=l(e,"loader.maxRetries",2),this.loaderWithCredentials=l(e,"loader.withCredentials",!1),this.loaderImageLoadType=l(e,"loader.imageLoadType","XHR"),this.loaderLocalScheme=l(e,"loader.localScheme",["file://","capacitor://"]),this.glowQuality=l(e,"filters.glow.quality",10),this.glowDistance=l(e,"filters.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=l(e,"plugins",null),p=s.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var m="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=l(e,"images.default",m+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=l(e,"images.missing",m+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=l(e,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=r.WEBGL:window.FORCE_CANVAS&&(this.renderType=r.CANVAS))}});e.exports=f},86054(e,t,i){var n=i(20623),r=i(27919),s=i(8054),a=i(89357);e.exports=function(e){var t=e.config;if((t.customEnvironment||t.canvas)&&t.renderType===s.AUTO)throw new Error("Mu
2st set explicit renderType in custom environment");if(!t.customEnvironment&&!t.canvas&&t.renderType!==s.HEADLESS)if(t.renderType===s.AUTO&&(t.renderType=a.webGL?s.WEBGL:s.CANVAS),t.renderType===s.WEBGL){if(!a.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(t.renderType!==s.CANVAS)throw new Error("Unknown value for renderer type: "+t.renderType);if(!a.canvas)throw new Error("Cannot create Canvas context, aborting.")}t.antialias||r.disableSmoothing();var o,l,h=e.scale.baseSize,u=h.width,c=h.height;(t.canvas?(e.canvas=t.canvas,e.canvas.width=u,e.canvas.height=c):e.canvas=r.create(e,u,c,t.renderType),t.canvasStyle&&(e.canvas.style=t.canvasStyle),t.antialias||n.setCrisp(e.canvas),t.renderType!==s.HEADLESS)&&(o=i(68627),l=i(74797),t.renderType===s.WEBGL?e.renderer=new l(e):(e.renderer=new o(e),e.context=e.renderer.gameContext))}},96391(e,t,i){var n=i(8054);e.exports=function(e){var t=e.config;if(!t.hideBanner){var i="WebGL";t.renderType===n.CANVAS?i="Canvas":t.renderType===n.HEADLESS&&(i="Headless");var r,s=t.audio,a=e.device.audio;if(r=a.webAudio&&!s.disableWebAudio?"Web Audio":s.noAudio||!a.webAudio&&!a.audioData?"No Audio":"HTML5 Audio",e.device.browser.ie)window.console&&console.log("Phaser v"+n.VERSION+" / https://phaser.io");else{var o="color: "+t.bannerTextColor+";",l=Array.isArray(t.bannerBackgroundColor)?t.bannerBackgroundColor:[t.bannerBackgroundColor];1===l.length&&(l=[l[0],l[0]]),o+=' background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAARBJREFUeNpi/P//P0OHsPB/BiCoePuWkYFEwALSXJElzMBgLwE2CNkQxgWr/yMr/p8QimlBu5DQ//+8vBBco/ofzAe6imH+qv/53/6jYJAYSA4ZoxoANYTPKhiuCQZwGcJU+e4dqpMmvsDq14krV2MPAxDha2CMKvoXoiE/PBQUDgQD8j82UFae9B9bOIC8B9UD9gIjjIMN7Ns6lWHn4XMoYu62RgxO3tkMjIyMII2MYAOAtmFVhA+ADHf2ycGMRhANjUq8YO+WKWCvgAORIV8CkpDCrzIwsLIymC1qAtuAD4Bsh3sBmqAY3qcGwL2AC4DCpKtzHlgzOLWihwEuzTCN0GhDJHeYC4gByBphACDAAH2dDIxdjr+VAAAAAElFTkSuQmCC"), '+("linear-gradient(to bottom, "+l.join(", ")+")")+";",o+=" background-repeat: no-repeat;",o+=" background-position: 4px center, 0 0;";var h="%c",u=[null,o+=" padding: 2px 6px 2px 24px;"];u.push("background: transparent"),t.gameTitle&&(h=h.concat(t.gameTitle),t.gameVersion&&(h=h.concat(" v"+t.gameVersion)),t.hidePhaser||(h=h.concat(" / "))),t.hidePhaser||(h=h.concat("Phaser v"+n.VERSION+" ("+i+" | "+r+")")),h=h.concat("%c "+t.gameURL),u[0]=h,console.log.apply(console,u)}}}},50127(e,t,i){var n=i(40366),r=i(60848),s=i(24047),a=i(27919),o=i(83419),l=i(69547),h=i(83719),u=i(86054),c=i(45893),d=i(96391),f=i(82264),p=i(57264),m=i(50792),g=i(8443),v=i(7003),y=i(37277),x=i(77332),b=i(76531),w=i(60903),T=i(69442),_=i(17130),S=i(65898),E=i(51085),C=i(14747),A=new o({initialize:function(e){this.config=new l(e),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 r(this),this.textures=new _(this),this.cache=new s(this),this.registry=new c(this,new m),this.input=new v(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new b(this,this.config),this.sound=null,this.sound=C.create(this),this.loop=new S(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),h(this),d(this),n(this.canvas,this.config.parent),this.textures.once(T.READY,this.texturesReady,this),this.events.emit(g.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(g.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)),E(this);var e=this.events;e.on(g.HIDDEN,this.onHidden,this),e.on(g.VISIBLE,this.onVisible,this),e.on(g.BLUR,this.onBlur,this),e.on(g.FOCUS,this.onFocus,this)},step:function(e,t){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(g.PRE_STEP,e,t),i.emit(g.STEP,e,t),this.scene.update(e,t),i.emit(g.POST_STEP,e,t);var n=this.renderer;n.preRender(),i.emit(g.PRE_RENDER,n,e,t),this.scene.render(n),n.postRender(),i.emit(g.POST_RENDER,n,e,t)}},headlessStep:function(e,t){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(g.PRE_STEP,e,t),i.emit(g.STEP,e,t),this.scene.update(e,t),i.emit(g.POST_STEP,e,t),this.scene.isProcessing=!1,i.emit(g.PRE_RENDER,null,e,t),i.emit(g.POST_RENDER,null,e,t)}},onHidden:function(){this.loop.pause(),this.events.emit(g.PAUSE)},pause:function(){var e=this.isPaused;this.isPaused=!0,e||this.events.emit(g.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(g.RESUME,this.loop.pauseDuration)},resume:function(){var e=this.isPaused;this.isPaused=!1,e&&this.events.emit(g.RESUME,0)},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(e,t){void 0===t&&(t=!1),this.pendingDestroy=!0,this.removeCanvas=e,this.noReturn=t},runDestroy:function(){this.scene.destroy(),this.events.emit(g.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}});e.exports=A},65898(e,t,i){var n=i(83419),r=i(35154),s=i(29747),a=i(43092),o=new n({initialize:function(e,t){this.game=e,this.raf=new a,this.started=!1,this.running=!1,this.minFps=r(t,"min",5),this.targetFps=r(t,"target",60),this.fpsLimit=r(t,"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=s,this.forceSetTimeOut=r(t,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this.pauseDuration=0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=r(t,"deltaHistory",10),this.panicMax=r(t,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=r(t,"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.pauseDuration=this.time-this._pauseTime,this.startTime+=this.pauseDuration},resetDelta:function(){var e=window.performance.now();this.time=e,this.lastTime=e,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0;for(var t=0;t<this.deltaSmoothingMax;t++)this.deltaHistory[t]=Math.min(this._target,this.deltaHistory[t]);this.delta=0,this.deltaIndex=0,this._coolDown=this.panicMax},start:function(e){if(this.started)return this;this.started=!0,this.running=!0;for(var t=0;t<this.deltaSmoothingMax;t++)this.deltaHistory[t]=this._target;this.resetDelta(),this.startTime=window.performance.now(),this.callback=e;var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target)},smoothDelta:function(e){var t=this.deltaIndex,i=this.deltaHistory,n=this.deltaSmoothingMax;(this._coolDown>0||!this.inFocus)&&(this._coolDown--,e=Math.min(e,this._target)),e>this._min&&(e=i[t],e=Math.min(e,this._min)),i[t]=e,this.deltaIndex++,this.deltaIndex>=n&&(this.deltaIndex=0);for(var r=0,s=0;s<n;s++)r+=i[s];return r/=n},updateFPS:function(e){this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0},stepLimitFPS:function(e){this.now=e;var t=Math.max(0,e-this.lastTime);this.rawDelta=t,this.time+=this.rawDelta,this.smoothStep&&(t=this.smoothDelta(t)),this.delta+=t,e>=this.nextFpsUpdate&&this.updateFPS(e),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(e,this.delta),this.delta%=this._limitRate),this.lastTime=e,this.frame++},step:function(e){this.now=e;var t=Math.max(0,e-this.lastTime);this.rawDelta=t,this.time+=this.rawDelta,this.smoothStep&&(t=this.smoothDelta(t)),this.delta=t,e>=this.nextFpsUpdate&&this.updateFPS(e),this.framesThisSecond++,this.callback(e,t),this.lastTime=e,this.frame++},tick:function(){var e=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(e):this.step(e)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(e){void 0===e&&(e=!1);var t=window.performance.now();if(!this.running){e&&(this.startTime+=-this.lastTime+(this.lastTime+t));var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=t+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)},setFPSLimit:function(e){if(this.fpsLimit=e,this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this.running){var t=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.stop(),this.raf.start(t,this.forceSetTimeOut,this._limitRate)}return this},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}});e.exports=o},51085(e,t,i){var n=i(8443);e.exports=function(e){var t,i=e.events;if(void 0!==document.hidden)t="visibilitychange";else{["webkit","moz","ms"].forEach(function(e){void 0!==document[e+"Hidden"]&&(document.hidden=function(){return document[e+"Hidden"]},t=e+"visibilitychange")})}t&&document.addEventListener(t,function(e){document.hidden||"pause"===e.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)}
vendor: 20,652 bytes, line 2
2,!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&e.config.autoFocus&&window.focus()}},97217(e){e.exports="blur"},47548(e){e.exports="boot"},19814(e){e.exports="contextlost"},68446(e){e.exports="destroy"},41700(e){e.exports="focus"},25432(e){e.exports="hidden"},65942(e){e.exports="pause"},59211(e){e.exports="postrender"},47789(e){e.exports="poststep"},39066(e){e.exports="prerender"},460(e){e.exports="prestep"},16175(e){e.exports="ready"},42331(e){e.exports="resume"},11966(e){e.exports="step"},32969(e){e.exports="systemready"},94830(e){e.exports="visible"},8443(e,t,i){e.exports={BLUR:i(97217),BOOT:i(47548),CONTEXT_LOST:i(19814),DESTROY:i(68446),FOCUS:i(41700),HIDDEN:i(25432),PAUSE:i(65942),POST_RENDER:i(59211),POST_STEP:i(47789),PRE_RENDER:i(39066),PRE_STEP:i(460),READY:i(16175),RESUME:i(42331),STEP:i(11966),SYSTEM_READY:i(32969),VISIBLE:i(94830)}},42857(e,t,i){e.exports={Config:i(69547),CreateRenderer:i(86054),DebugHeader:i(96391),Events:i(8443),TimeStep:i(65898),VisibilityHandler:i(51085)}},46728(e,t,i){var n=i(83419),r=i(36316),s=i(80021),a=i(26099),o=new n({Extends:s,initialize:function(e,t,i,n){s.call(this,"CubicBezierCurve"),Array.isArray(e)&&(n=new a(e[6],e[7]),i=new a(e[4],e[5]),t=new a(e[2],e[3]),e=new a(e[0],e[1])),this.p0=e,this.p1=t,this.p2=i,this.p3=n},getStartPoint:function(e){return void 0===e&&(e=new a),e.copy(this.p0)},getResolution:function(e){return e},getPoint:function(e,t){void 0===t&&(t=new a);var i=this.p0,n=this.p1,s=this.p2,o=this.p3;return t.set(r(e,i.x,n.x,s.x,o.x),r(e,i.y,n.y,s.y,o.y))},draw:function(e,t){void 0===t&&(t=32);var i=this.getPoints(t);e.beginPath(),e.moveTo(this.p0.x,this.p0.y);for(var n=1;n<i.length;n++)e.lineTo(i[n].x,i[n].y);return e.strokePath(),e},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y,this.p3.x,this.p3.y]}}});o.fromJSON=function(e){var t=e.points,i=new a(t[0],t[1]),n=new a(t[2],t[3]),r=new a(t[4],t[5]),s=new a(t[6],t[7]);return new o(i,n,r,s)},e.exports=o},80021(e,t,i){var n=i(83419),r=i(19217),s=i(87841),a=i(26099),o=new n({initialize:function(e){this.type=e,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new a,this._tmpVec2B=new a},draw:function(e,t){return void 0===t&&(t=32),e.strokePoints(this.getPoints(t))},getBounds:function(e,t){e||(e=new s),void 0===t&&(t=16);var i=this.getLength();t>i&&(t=i/2);var n=Math.max(1,Math.round(i/t));return r(this.getSpacedPoints(n),e)},getDistancePoints:function(e){var t=this.getLength(),i=Math.max(1,t/e);return this.getSpacedPoints(i)},getEndPoint:function(e){return void 0===e&&(e=new a),this.getPointAt(1,e)},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,i=[],n=this.getPoint(0,this._tmpVec2A),r=0;i.push(0);for(var s=1;s<=e;s++)r+=(t=this.getPoint(s/e,this._tmpVec2B)).distance(n),i.push(r),n.copy(t);return this.cacheArcLengths=i,i},getPointAt:function(e,t){var i=this.getUtoTmapping(e);return this.getPoint(i,t)},getPoints:function(e,t,i){void 0===i&&(i=[]),e||(e=t?this.getLength()/t:this.defaultDivisions);for(var n=0;n<=e;n++)i.push(this.getPoint(n/e));return i},getRandomPoint:function(e){return void 0===e&&(e=new a),this.getPoint(Math.random(),e)},getSpacedPoints:function(e,t,i){void 0===i&&(i=[]),e||(e=t?this.getLength()/t:this.defaultDivisions);for(var n=0;n<=e;n++){var r=this.getUtoTmapping(n/e,null,e);i.push(this.getPoint(r))}return i},getStartPoint:function(e){return void 0===e&&(e=new a),this.getPointAt(0,e)},getTangent:function(e,t){void 0===t&&(t=new a);var i=1e-4,n=e-i,r=e+i;return n<0&&(n=0),r>1&&(r=1),this.getPoint(n,this._tmpVec2A),this.getPoint(r,t),t.subtract(this._tmpVec2A).normalize()},getTangentAt:function(e,t){var i=this.getUtoTmapping(e);return this.getTangent(i,t)},getTFromDistance:function(e,t){return e<=0?0:this.getUtoTmapping(0,e,t)},getUtoTmapping:function(e,t,i){var n,r=this.getLengths(i),s=0,a=r.length;n=t?Math.min(t,r[a-1]):e*r[a-1];for(var o,l=0,h=a-1;l<=h;)if((o=r[s=Math.floor(l+(h-l)/2)]-n)<0)l=s+1;else{if(!(o>0)){h=s;break}h=s-1}if(r[s=h]===n)return s/(a-1);var u=r[s];return(s+(n-u)/(r[s+1]-u))/(a-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});e.exports=o},73825(e,t,i){var n=i(83419),r=i(80021),s=i(39506),a=i(35154),o=i(43396),l=i(26099),h=new n({Extends:r,initialize:function(e,t,i,n,o,h,u,c){if("object"===typeof e){var d=e;e=a(d,"x",0),t=a(d,"y",0),i=a(d,"xRadius",0),n=a(d,"yRadius",i),o=a(d,"startAngle",0),h=a(d,"endAngle",360),u=a(d,"clockwise",!1),c=a(d,"rotation",0)}else void 0===n&&(n=i),void 0===o&&(o=0),void 0===h&&(h=360),void 0===u&&(u=!1),void 0===c&&(c=0);r.call(this,"EllipseCurve"),this.p0=new l(e,t),this._xRadius=i,this._yRadius=n,this._startAngle=s(o),this._endAngle=s(h),this._clockwise=u,this._rotation=s(c)},getStartPoint:function(e){return void 0===e&&(e=new l),this.getPoint(0,e)},getResolution:function(e){return 2*e},getPoint:function(e,t){void 0===t&&(t=new l);for(var i=2*Math.PI,n=this._endAngle-this._startAngle,r=Math.abs(n)<Number.EPSILON;n<0;)n+=i;for(;n>i;)n-=i;n<Number.EPSILON&&(n=r?0:i),this._clockwise&&!r&&(n===i?n=-i:n-=i);var s=this._startAngle+e*n,a=this.p0.x+this._xRadius*Math.cos(s),o=this.p0.y+this._yRadius*Math.sin(s);if(0!==this._rotation){var h=Math.cos(this._rotation),u=Math.sin(this._rotation),c=a-this.p0.x,d=o-this.p0.y;a=c*h-d*u+this.p0.x,o=c*u+d*h+this.p0.y}return t.set(a,o)},setXRadius:function(e){return this.xRadius=e,this},setYRadius:function(e){return this.yRadius=e,this},setWidth:function(e){return this.xRadius=e/2,this},setHeight:function(e){return this.yRadius=e/2,this},setStartAngle:function(e){return this.startAngle=e,this},setEndAngle:function(e){return this.endAngle=e,this},setClockwise:function(e){return this.clockwise=e,this},setRotation:function(e){return this.rotation=e,this},x:{get:function(){return this.p0.x},set:function(e){this.p0.x=e}},y:{get:function(){return this.p0.y},set:function(e){this.p0.y=e}},xRadius:{get:function(){return this._xRadius},set:function(e){this._xRadius=e}},yRadius:{get:function(){return this._yRadius},set:function(e){this._yRadius=e}},startAngle:{get:function(){return o(this._startAngle)},set:function(e){this._startAngle=s(e)}},endAngle:{get:function(){return o(this._endAngle)},set:function(e){this._endAngle=s(e)}},clockwise:{get:function(){return this._clockwise},set:function(e){this._clockwise=e}},angle:{get:function(){return o(this._rotation)},set:function(e){this._rotation=s(e)}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation=e}},toJSON:function(){return{type:this.type,x:this.p0.x,y:this.p0.y,xRadius:this._xRadius,yRadius:this._yRadius,startAngle:o(this._startAngle),endAngle:o(this._endAngle),clockwise:this._clockwise,rotation:o(this._rotation)}}});h.fromJSON=function(e){return new h(e)},e.exports=h},33951(e,t,i){var n=i(83419),r=i(80021),s=i(19217),a=i(87841),o=i(26099),l=new n({Extends:r,initialize:function(e,t){r.call(this,"LineCurve"),Array.isArray(e)&&(t=new o(e[2],e[3]),e=new o(e[0],e[1])),this.p0=e,this.p1=t,this.arcLengthDivisions=1},getBounds:function(e){return void 0===e&&(e=new a),s([this.p0,this.p1],e)},getStartPoint:function(e){return void 0===e&&(e=new o),e.copy(this.p0)},getResolution:function(e){return void 0===e&&(e=1),e},getPoint:function(e,t){return void 0===t&&(t=new o),1===e?t.copy(this.p1):(t.copy(this.p1).subtract(this.p0).scale(e).add(this.p0),t)},getPointAt:function(e,t){return this.getPoint(e,t)},getTangent:function(e,t){return void 0===t&&(t=new o),t.copy(this.p1).subtract(this.p0).normalize(),t},getUtoTmapping:function(e,t,i){var n;if(t){var r=this.getLengths(i),s=r[r.length-1];n=Math.min(t,s)/s}else n=e;return n},draw:function(e){return e.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),e},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});l.fromJSON=function(e){var t=e.points,i=new o(t[0],t[1]),n=new o(t[2],t[3]);return new l(i,n)},e.exports=l},14744(e,t,i){var n=i(83419),r=i(80021),s=i(32112),a=i(26099),o=new n({Extends:r,initialize:function(e,t,i){r.call(this,"QuadraticBezierCurve"),Array.isArray(e)&&(i=new a(e[4],e[5]),t=new a(e[2],e[3]),e=new a(e[0],e[1])),this.p0=e,this.p1=t,this.p2=i},getStartPoint:function(e){return void 0===e&&(e=new a),e.copy(this.p0)},getResolution:function(e){return e},getPoint:function(e,t){void 0===t&&(t=new a);var i=this.p0,n=this.p1,r=this.p2;return t.set(s(e,i.x,n.x,r.x),s(e,i.y,n.y,r.y))},draw:function(e,t){void 0===t&&(t=32);var i=this.getPoints(t);e.beginPath(),e.moveTo(this.p0.x,this.p0.y);for(var n=1;n<i.length;n++)e.lineTo(i[n].x,i[n].y);return e.strokePath(),e},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y]}}});o.fromJSON=function(e){var t=e.points,i=new a(t[0],t[1]),n=new a(t[2],t[3]),r=new a(t[4],t[5]);return new o(i,n,r)},e.exports=o},42534(e,t,i){var n=i(87842),r=i(83419),s=i(80021),a=i(26099),o=new r({Extends:s,initialize:function(e){void 0===e&&(e=[]),s.call(this,"SplineCurve"),this.points=[],this.addPoints(e)},addPoints:function(e){for(var t=0;t<e.length;t++){var i=new a;"number"===typeof e[t]?(i.x=e[t],i.y=e[t+1],t++):Array.isArray(e[t])?(i.x=e[t][0],i.y=e[t][1]):(i.x=e[t].x,i.y=e[t].y),this.points.push(i)}return this},addPoint:function(e,t){var i=new a(e,t);return this.points.push(i),i},getStartPoint:function(e){return void 0===e&&(e=new a),e.copy(this.points[0])},getResolution:function(e){return e*this.points.length},getPoint:function(e,t){void 0===t&&(t=new a);var i=this.points,r=(i.length-1)*e,s=Math.floor(r),o=r-s,l=i[0===s?s:s-1],h=i[s],u=i[s>i.length-2?i.length-1:s+1],c=i[s>i.length-3?i.length-1:s+2];return t.set(n(o,l.x,h.x,u.x,c.x),n(o,l.y,h.y,u.y,c.y))},toJSON:function(){for(var e=[],t=0;t<this.points.length;t++)e.push(this.points[t].x),e.push(this.points[t].y);return{type:this.type,points:e}}});o.fromJSON=function(e){return new o(e.points)},e.exports=o},25410(e,t,i){e.exports={Path:i(46669),MoveTo:i(68618),CubicBezier:i(46728),Curve:i(80021),Ellipse:i(73825),Line:i(33951),QuadraticBezier:i(14744),Spline:i(42534)}},68618(e,t,i){var n=i(83419),r=i(26099),s=new n({initialize:function(e,t){this.active=!1,this.p0=new r(e,t)},getPoint:function(e,t){return void 0===t&&(t=new r),t.copy(this.p0)},getPointAt:function(e,t){return this.getPoint(e,t)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});e.exports=s},46669(e,t,i){var n=i(83419),r=i(46728),s=i(73825),a=i(39429),o=i(33951),l=i(68618),h=i(14744),u=i(87841),c=i(42534),d=i(26099),f=i(36383),p=new n({initialize:function(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.name="",this.defaultDivisions=12,this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"===typeof e?this.fromJSON(e):this.startPoint.set(e,t)},add:function(e){return this.curves.push(e),this},circleTo:function(e,t,i){return void 0===t&&(t=!1),this.ellipseTo(e,e,0,360,t,i)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);return e.equals(t)||this.curves.push(new o(t,e)),this},cubicBezierTo:function(e,t,i,n,s,a){var o,l,h,u=this.getEndPoint();return e instanceof d?(o=e,l=t,h=i):(o=new d(i,n),l=new d(s,a),h=new d(e,t)),this.add(new r(u,o,l,h))},quadraticBezierTo:function(e,t,i,n){var r,s,a=this.getEndPoint();return e instanceof d?(r=e,s=t):(r=new d(i,n),s=new d(e,t)),this.add(new h(a,r,s))},draw:function(e,t){for(var i=0;i<this.curves.length;i++){var n=this.curves[i];n.active&&n.draw(e,t)}return e},ellipseTo:function(e,t,i,n,r,a){var o=new s(0,0,e,t,i,n,r,a),l=this.getEndPoint(this._tmpVec2A),h=o.getStartPoint(this._tmpVec2B);return l.subtract(h),o.x=l.x,o.y=l.y,this.add(o)},fromJSON:function(e){this.curves=[],this.cacheLengths=[],this.startPoint.set(e.x,e.y),this.autoClose=e.autoClose;for(var t=0;t<e.curves.length;t++){var i=e.curves[t];switch(i.type){case"LineCurve":this.add(o.fromJSON(i));break;case"EllipseCurve":this.add(s.fromJSON(i));break;case"SplineCurve":this.add(c.fromJSON(i));break;case"CubicBezierCurve":this.add(r.fromJSON(i));break;case"QuadraticBezierCurve":this.add(h.fromJSON(i))}}return this},getBounds:function(e,t){void 0===e&&(e=new u),void 0===t&&(t=16),e.x=Number.MAX_VALUE,e.y=Number.MAX_VALUE;for(var i=new u,n=f.MIN_SAFE_INTEGER,r=f.MIN_SAFE_INTEGER,s=0;s<this.curves.length;s++){var a=this.curves[s];a.active&&(a.getBounds(i,t),e.x=Math.min(e.x,i.x),e.y=Math.min(e.y,i.y),n=Math.max(n,i.right),r=Math.max(r,i.bottom))}return e.right=n,e.bottom=r,e},getCurveLengths:function(){if(this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,i=0;i<this.curves.length;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e},getCurveAt:function(e){for(var t=e*this.getLength(),i=this.getCurveLengths(),n=0;n<i.length;){if(i[n]>=t)return this.curves[n];n++}return null},getEndPoint:function(e){return void 0===e&&(e=new d),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,e):e.copy(this.startPoint),e},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},getPoint:function(e,t){void 0===t&&(t=new d);for(var i=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=i){var s=n[r]-i,a=this.curves[r],o=a.getLength(),l=0===o?0:1-s/o;return a.getPointAt(l,t)}r++}return null},getPoints:function(e,t){e||t||(e=this.defaultDivisions);for(var i,n=[],r=0;r<this.curves.length;r++){var s=this.curves[r];if(s.active)for(var a=s.getResolution(e),o=s.getPoints(a,t),l=0;l<o.length;l++){var h=o[l];i&&i.equals(h)||(n.push(h),i=h)}}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},getRandomPoint:function(e){return void 0===e&&(e=new d),this.getPoint(Math.random(),e)},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t},getStartPoint:function(e){return void 0===e&&(e=new d),e.copy(this.startPoint)},getTangent:function(e,t){void 0===t&&(t=new d);for(var i=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=i){var s=n[r]-i,a=this.curves[r],o=a.getLength(),l=0===o?0:1-s/o;return a.getTangentAt(l,t)}r++}return null},lineTo:function(e,t){e instanceof d?this._tmpVec2B.copy(e):"object"===typeof e?this._tmpVec2B.setFromObject(e):this._tmpVec2B.set(e,t);var i=this.getEndPoint(this._tmpVec2A);return this.add(new o([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(e){return e.unshift(this.getEndPoint()),this.add(new c(e))},moveTo:function(e,t){return e instanceof d?this.add(new l(e.x,e.y)):this.add(new l(e,t))},toJSON:function(){for(var e=[],t=0;t<this.curves.length;t++)e.push(this.curves[t].toJSON());return{type:"Path",x:this.startPoint.x,y:this.startPoint.y,autoClose:this.autoClose,curves:e}},updateArcLengths:function(){this.cacheLengths=[],this.getCurveLengths()},destroy:function(){this.curves.length=0,this.cacheLengths.length=0,this.startPoint=void 0}});a.register("path",function(e,t){return new p(e,t)}),e.exports=p},45893(e,t,i){var n=i(83419),r=i(24882),s=new n({initialize:function(e,t){this.parent=e,this.events=t,t||(this.events=e.events?e.events:e),this.list={},this.values={},this._frozen=!1,!e.hasOwnProperty("sys")&&this.events&&this.events.once(r.DESTROY,this.destroy,this)},get:function(e){var t=this.list;if(Array.isArray(e)){for(var i=[],n=0;n<e.length;n++)i.push(t[e[n]]);return i}return t[e]},getAll:function(){var e={};for(var t in this.list)this.list.hasOwnProperty(t)&&(e[t]=this.list[t]);return e},query:function(e){var t={};for(var i in this.list)this.list.hasOwnProperty(i)&&i.match(e)&&(t[i]=this.list[i]);return t},set:function(e,t){if(this._frozen)return this;if("string"===typeof e)return this.setValue(e,t);for(var i in e)this.setValue(i,e[i]);return this},inc:function(e,t){if(this._frozen)return this;void 0===t&&(t=1);var i=this.get(e);return void 0===i&&(i=0),this.set(e,i+t),this},toggle:function(e){return this._frozen||this.set(e,!this.get(e)),this},setValue:function(e,t){if(this._frozen)return this;if(this.has(e))this.values[e]=t;else{var i=this,n=this.list,s=this.events,a=this.parent;Object.defineProperty(this.values,e,{enumerable:!0,configurable:!0,get:function(){return n[e]},set:function(t){if(!i._frozen){var o=n[e];n[e]=t,s.emit(r.CHANGE_DATA,a,e,t,o),s.emit(r.CHANGE_DATA_KEY+e,a,t,o)}}}),n[e]=t,s.emit(r.SET_DATA,a,e,t)}return this},each:function(e,t){for(var i=[this.parent,null,void 0],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var r in this.list)i[1]=r,i[2]=this.list[r],e.apply(t,i);return this},merge:function(e,t){for(var i in void 0===t&&(t=!0),e)e.hasOwnProperty(i)&&(t||!t&&!this.has(i))&&this.setValue(i,e[i]);return this},remove:function(e){if(this._frozen)return this;if(!Array.isArray(e))return this.removeValue(e);for(var t=0;t<e.length;t++)this.removeValue(e[t]);return this},removeValue:function(e){if(this.has(e)){var t=this.list[e];delete this.list[e],delete this.values[e],this.events.emit(r.REMOVE_DATA,this.parent,e,t)}return this},pop:function(e){var t=void 0;return!this._frozen&&this.has(e)&&(t=this.list[e],delete this.list[e],delete this.values[e],this.events.emit(r.REMOVE_DATA,this.parent,e,t)),t},has:function(e){return this.list.hasOwnProperty(e)},setFreeze:function(e){return this._frozen=e,this},reset:function(){for(var e in this.list)delete this.list[e],delete this.values[e];return this._frozen=!1,this},destroy:function(){this.reset(),this.events.off(r.CHANGE_DATA),this.events.off(r.SET_DATA),this.events.off(r.REMOVE_DATA),this.parent=null},freeze:{get:function(){return this._frozen},set:function(e){this._frozen=!!e}},count:{get:function(){var e=0;for(var t in this.list)void 0!==this.list[t]&&e++;return e}}});e.exports=s},63646(e,t,i){var n=i(83419),r=i(45893),s=i(37277),a=i(44594),o=new n({Extends:r,initialize:function(e){r.call(this,e,e.sys.events),this.scene=e,this.systems=e.sys,e.sys.events.once(a.BOOT,this.boot,this),e.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(){r.prototype.destroy.call(this),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null}});s.register("DataManagerPlugin",o,"data"),e.exports=o},10700(e){e.exports="changedata"},93608(e){e.exports="changedata-"},60883(e){e.exports="destroy"},69780(e){e.exports="removedata"},22166(e){e.exports="setdata"},24882(e,t,i){e.exports={CHANGE_DATA:i(10700),CHANGE_DATA_KEY:i(93608),DESTROY:i(60883),REMOVE_DATA:i(69780),SET_DATA:i(22166)}},44965(e,t,i){e.exports={DataManager:i(45893),DataManagerPlugin:i(63646),Events:i(24882)}},7098(e,t,i){var n=i(84148),r={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};e.exports=function(){if("function"===typeof importScripts)return r;r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var e=document.createElement("audio"),t=!!e.canPlayType;try{if(t){var i=function(t,i){var n=e.canPlayType("audio/"+t).replace(/^no$/,"");return i?Boolean(n||e.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(n)};if(r.ogg=i('ogg; codecs="vorbis"'),r.opus=i('ogg; codecs="opus"',"opus"),r.mp3=i("mpeg"),r.wav=i("wav"),r.m4a=i("x-m4a"),r.aac=i("aac"),r.flac=i("flac","x-flac"),r.webm=i('webm; codecs="vorbis"'),""!==e.canPlayType('audio/mp4; codecs="ec-3"'))if(n.edge)r.dolby=!0;else if(n.safari&&n.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var s=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===s&&a>=11||s>10)&&(r.dolby=!0)}}}catch(oT){}return r}()},84148(e,t,i){var n=i(25892),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};e.exports=function(){var e=navigator.userAgent;return/Edg\/\d+/.test(e)?(r.edge=!0,r.es2019=!0):/OPR/.test(e)?(r.opera=!0,r.es2019=!0):/Chrome\/(\d+)/.test(e)&&!n.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10),r.es2019=r.chromeVersion>69):/Firefox\D+(\d+)/.test(e)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10),r.es2019=r.firefoxVersion>
210):/AppleWebKit\/(?!.*CriOS)/.test(e)&&n.iOS?(r.mobileSafari=!0,r.es2019=!0):/MSIE (\d+\.\d+);/.test(e)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(e)&&!n.windowsPhone?(r.safari=!0,r.safariVersion=parseInt(RegExp.$1,10),r.es2019=r.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(e)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(e)&&(r.silk=!0),r}()},89289(e,t,i){var n=i(27919),r={supportInverseAlpha:!1,supportNewBlendModes:!1};e.exports=("function"!==typeof importScripts&&void 0!==document&&(r.supportNewBlendModes=function(){var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",t="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",i=new Image;return i.onload=function(){var s=new Image;s.onload=function(){var e=n.create2D(s,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(i,0,0),e.drawImage(s,2,0),!e.getImageData(2,0,1,1))return!1;var t=e.getImageData(2,0,1,1).data;n.remove(s),r.supportNewBlendModes=255===t[0]&&0===t[1]&&0===t[2]},s.src=e+"/wCKxvRF"+t},i.src=e+"AP804Oa6"+t,!1}(),r.supportInverseAlpha=function(){var e=n.create2D(this,2).getContext("2d",{willReadFrequently:!0});e.fillStyle="rgba(10, 20, 30, 0.5)",e.fillRect(0,0,1,1);var t=e.getImageData(0,0,1,1);if(null===t)return!1;e.putImageData(t,1,0);var i=e.getImageData(1,0,1,1),r=i.data[0]===t.data[0]&&i.data[1]===t.data[1]&&i.data[2]===t.data[2]&&i.data[3]===t.data[3];return n.remove(this),r}()),r)},89357(e,t,i){var n=i(25892),r=i(84148),s=i(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};e.exports=function(){if("function"===typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(_E){a.localStorage=!1}a.file=!!window.File&&!!window.FileReader&&!!window.FileList&&!!window.Blob,a.fileSystem=!!window.requestFileSystem;var e=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=s.createWebGL(this),i=t.getContext("webgl")||t.getContext("experimental-webgl"),n=s.create2D(this),r=n.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return e=r.data instanceof Uint8ClampedArray,s.remove(t),s.remove(n),!!i}catch(oT){return!1}return!1}(),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,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!n.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!==typeof ArrayBuffer&&"undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint32Array&&(a.littleEndian=function(){var e=new ArrayBuffer(4),t=new Uint8Array(e),i=new Uint32Array(e);return t[0]=161,t[1]=178,t[2]=195,t[3]=212,3569595041===i[0]||2712847316!==i[0]&&null}()),a.support32bit="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof Uint8ClampedArray&&"undefined"!==typeof Int32Array&&null!==a.littleEndian&&e,a}()},91639(e){var t={available:!1,cancel:"",keyboard:!1,request:""};e.exports=function(){if("function"===typeof importScripts)return t;var e,i="Fullscreen",n="FullScreen",r=["request"+i,"request"+n,"webkitRequest"+i,"webkitRequest"+n,"msRequest"+i,"msRequest"+n,"mozRequest"+n,"mozRequest"+i];for(e=0;e<r.length;e++)if(document.documentElement[r[e]]){t.available=!0,t.request=r[e];break}var s=["cancel"+n,"exit"+i,"webkitCancel"+n,"webkitExit"+i,"msCancel"+n,"msExit"+i,"mozCancel"+n,"mozExit"+i];if(t.available)for(e=0;e<s.length;e++)if(document[s[e]]){t.cancel=s[e];break}return window.Element&&Element.ALLOW_KEYBOARD_INPUT&&!/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)&&(t.keyboard=!0),Object.defineProperty(t,"active",{get:function(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}}),t}()},31784(e,t,i){var n=i(84148),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};e.exports=("function"===typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||n.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mou
2sewheel":n.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},25892(e){var t={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};e.exports=function(){if("function"===typeof importScripts)return t;var e=navigator.userAgent;/Windows/.test(e)?t.windows=!0:/Mac OS/.test(e)&&!/like Mac OS/.test(e)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(t.iOS=!0,t.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),t.iOSVersion=parseInt(RegExp.$1,10)):t.macOS=!0:/Android/.test(e)?t.android=!0:/Linux/.test(e)?t.linux=!0:/iP[ao]d|iPhone/i.test(e)?(t.iOS=!0,navigator.appVersion.match(/OS (\d+)/),t.iOSVersion=parseInt(RegExp.$1,10),t.iPhone=-1!==e.toLowerCase().indexOf("iphone"),t.iPad=-1!==e.toLowerCase().indexOf("ipad")):/Kindle/.test(e)||/\bKF[A-Z][A-Z]+/.test(e)||/Silk.*Mobile Safari/.test(e)?t.kindle=!0:/CrOS/.test(e)&&(t.chromeOS=!0),(/Windows Phone/i.test(e)||/IEMobile/i.test(e))&&(t.android=!1,t.iOS=!1,t.macOS=!1,t.windows=!0,t.windowsPhone=!0);var i=/Silk/.test(e);return(t.windows||t.macOS||t.linux&&!i||t.chromeOS)&&(t.desktop=!0),(t.windowsPhone||/Windows NT/i.test(e)&&/Touch/i.test(e))&&(t.desktop=!1),navigator.standalone&&(t.webApp=!0),"function"!==typeof importScripts&&(void 0!==window.cordova&&(t.cordova=!0),void 0!==window.ejecta&&(t.ejecta=!0)),"undefined"!==typeof process&&process.versions&&process.versions.node&&(t.node=!0),t.node&&"object"===typeof process.versions&&(t.nodeWebkit=!!process.versions["node-webkit"],t.electron=!!process.versions.electron),/Crosswalk/.test(e)&&(t.crosswalk=!0),t.pixelRatio=window.devicePixelRatio||1,t}()},43267(e,t,i){var n=i(95540),r={h264:!1,hls:!1,mov:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};e.exports=function(){if("function"===typeof importScripts)return r;var e=document.createElement("video"),t=!!e.canPlayType,i=/^no$/;try{t&&(e.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(r.ogg=!0),e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(r.h264=!0,r.mp4=!0),e.canPlayType('video/quicktime4; codecs="avc1.42E01E"').replace(i,"")&&(r.mov=!0),e.canPlayType("video/x-m4v").replace(i,"")&&(r.m4v=!0),e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(r.webm=!0),e.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(r.vp9=!0),e.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(r.hls=!0))}catch(oT){}return e.parentNode&&e.parentNode.removeChild(e),r.getVideoURL=function(e){Array.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++){var i,s=n(e[t],"url",e[t]);if(0===s.indexOf("blob:"))return{url:s,type:""};if(i=0===s.indexOf("data:")?s.split(",")[0].match(/\/(.*?);/):s.match(/\.([a-zA-Z0-9]+)($|\?)/),i=n(e[t],"type",i?i[1]:"").toLowerCase(),r[i])return{url:s,type:i}}return null},r}()},82264(e,t,i){e.exports={os:i(25892),browser:i(84148),features:i(89357),input:i(31784),audio:i(7098),video:i(43267),fullscreen:i(91639),canvasFeatures:i(89289)}},34664(e,t,i){var n=i(79980),r=i(28915),s=i(83419),a=i(40987),o=i(13699),l=new s({initialize:function(e){e||(e={}),this.isColorBand=!0,this.colorStart=new a,this.colorEnd=new a,this.start=e.start||0,this.middle=void 0===e.middle?.5:e.middle,this.end=1,void 0!==e.end?this.end=e.end:void 0!==e.size&&(this.end=this.start+e.size),this.interpolation=e.interpolation||0,this.colorSpace=e.colorSpace||0,this.setColors(e.colorStart,e.colorEnd)},setColors:function(e,t){var i;return void 0===e&&(e=0),void 0===t&&(t=e),"number"===typeof e?a.IntegerToColor(e,this.colorStart):"string"===typeof e?a.HexStringToColor(e,this.colorStart):Array.isArray(e)?(i=void 0===e[3]?1:e[3],this.colorStart.setGLTo(e[0],e[1],e[2],i)):e instanceof a&&this.colorStart.setTo(e.red,e.green,e.blue,e.alpha),"number"===typeof t?a.IntegerToColor(t,this.colorEnd):"string"===typeof t?a.HexStringToColor(t,this.colorEnd):Array.isArray(t)?(i=void 0===t[3]?1:t[3],this.colorEnd.setGLTo(t[0],t[1],t[2],i)):t instanceof a&&this.colorEnd.setTo(t.red,t.green,t.blue,t.alpha),this},getColor:function(e){var t=Math.log(.5)/Math.log(this.middle);switch(e=Math.pow(e,t),e=Math.min(Math.max(0,e),1),this.interpolation){case 1:(e*=2)<1?e=.5*Math.sqrt(1- --e*e):(e=1-e,e=1-.5*Math.sqrt(1-e*e));break;case 2:e=n.InOut(e);break;case 3:e=n.Out(e);break;case 4:e=n.In(e)}var i=0;2===this.colorSpace?i=1:3===this.colorSpace&&(i=-1);var s=o.ColorWithColor(this.colorStart,this.colorEnd,1,e,0!==this.colorSpace,i);return s.a=r(this.colorStart.alpha,this.colorEnd.alpha,e),s}});e.exports=l},89422(e,t,i){var n=i(83419),r=new Float32Array(20),s=new n({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(e){return this._matrix.set(e),this._dirty=!0,this},reset:function(){var e=this._matrix;return e.fill(0),e[0]=1,e[6]=1,e[12]=1,e[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var e=this._data;return this._dirty&&(e.set(this._matrix),e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,this._dirty=!1),e},brightness:function(e,t){void 0===e&&(e=0),void 0===t&&(t=!1);var i=e;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],t)},saturate:function(e,t){void 0===e&&(e=0),void 0===t&&(t=!1);var i=2*e/3+1,n=-.5*(i-1);return this.multiply([i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0],t)},desaturate:function(e){return void 0===e&&(e=!1),this.saturate(-1,e)},hue:function(e,t){void 0===e&&(e=0),void 0===t&&(t=!1),e=e/180*Math.PI;
vendor: 149,162 bytes, line 2
2var i=Math.cos(e),n=Math.sin(e),r=.213,s=.715,a=.072;return this.multiply([r+.787*i+n*-r,s+i*-s+n*-s,a+i*-a+.928*n,0,0,r+i*-r+.143*n,s+i*(1-s)+.14*n,a+i*-a+-.283*n,0,0,r+i*-r+-.787*n,s+i*-s+n*s,a+.928*i+n*a,0,0,0,0,0,1,0],t)},grayscale:function(e,t){return void 0===e&&(e=1),void 0===t&&(t=!1),this.saturate(-e,t)},blackWhite:function(e){return void 0===e&&(e=!1),this.multiply(s.BLACK_WHITE,e)},black:function(e){return this.multiply(s.BLACK,e)},contrast:function(e,t){void 0===e&&(e=0),void 0===t&&(t=!1);var i=e+1,n=-.5*(i-1);return this.multiply([i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0],t)},negative:function(e){return void 0===e&&(e=!1),this.multiply(s.NEGATIVE,e)},desaturateLuminance:function(e){return void 0===e&&(e=!1),this.multiply(s.DESATURATE_LUMINANCE,e)},sepia:function(e){return void 0===e&&(e=!1),this.multiply(s.SEPIA,e)},night:function(e,t){return void 0===e&&(e=.1),void 0===t&&(t=!1),this.multiply([-2*e,-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0],t)},lsd:function(e){return void 0===e&&(e=!1),this.multiply(s.LSD,e)},brown:function(e){return void 0===e&&(e=!1),this.multiply(s.BROWN,e)},vintagePinhole:function(e){return void 0===e&&(e=!1),this.multiply(s.VINTAGE,e)},kodachrome:function(e){return void 0===e&&(e=!1),this.multiply(s.KODACHROME,e)},technicolor:function(e){return void 0===e&&(e=!1),this.multiply(s.TECHNICOLOR,e)},polaroid:function(e){return void 0===e&&(e=!1),this.multiply(s.POLAROID,e)},alphaToBrightness:function(e){return void 0===e&&(e=!1),this.multiply(s.ALPHA_TO_BRIGHTNESS,e)},alphaToBrightnessInverse:function(e){return void 0===e&&(e=!1),this.multiply(s.ALPHA_TO_BRIGHTNESS_INVERSE,e)},brightnessToAlpha:function(e){return void 0===e&&(e=!1),this.multiply(s.BRIGHTNESS_TO_ALPHA,e)},brightnessToAlphaInverse:function(e){return void 0===e&&(e=!1),this.multiply(s.BRIGHTNESS_TO_ALPHA_INVERSE,e)},shiftToBGR:function(e){return void 0===e&&(e=!1),this.multiply(s.SHIFT_BGR,e)},multiply:function(e,t){void 0===t&&(t=!1),t||this.reset();var i=this._matrix,n=r;return n.set(i),i.set([n[0]*e[0]+n[1]*e[5]+n[2]*e[10]+n[3]*e[15],n[0]*e[1]+n[1]*e[6]+n[2]*e[11]+n[3]*e[16],n[0]*e[2]+n[1]*e[7]+n[2]*e[12]+n[3]*e[17],n[0]*e[3]+n[1]*e[8]+n[2]*e[13]+n[3]*e[18],n[0]*e[4]+n[1]*e[9]+n[2]*e[14]+n[3]*e[19]+n[4],n[5]*e[0]+n[6]*e[5]+n[7]*e[10]+n[8]*e[15],n[5]*e[1]+n[6]*e[6]+n[7]*e[11]+n[8]*e[16],n[5]*e[2]+n[6]*e[7]+n[7]*e[12]+n[8]*e[17],n[5]*e[3]+n[6]*e[8]+n[7]*e[13]+n[8]*e[18],n[5]*e[4]+n[6]*e[9]+n[7]*e[14]+n[8]*e[19]+n[9],n[10]*e[0]+n[11]*e[5]+n[12]*e[10]+n[13]*e[15],n[10]*e[1]+n[11]*e[6]+n[12]*e[11]+n[13]*e[16],n[10]*e[2]+n[11]*e[7]+n[12]*e[12]+n[13]*e[17],n[10]*e[3]+n[11]*e[8]+n[12]*e[13]+n[13]*e[18],n[10]*e[4]+n[11]*e[9]+n[12]*e[14]+n[13]*e[19]+n[14],n[15]*e[0]+n[16]*e[5]+n[17]*e[10]+n[18]*e[15],n[15]*e[1]+n[16]*e[6]+n[17]*e[11]+n[18]*e[16],n[15]*e[2]+n[16]*e[7]+n[17]*e[12]+n[18]*e[17],n[15]*e[3]+n[16]*e[8]+n[17]*e[13]+n[18]*e[18],n[15]*e[4]+n[16]*e[9]+n[17]*e[14]+n[18]*e[19]+n[19]]),this._dirty=!0,this}});s.BLACK=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0],s.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],s.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],s.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],s.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],s.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],s.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],s.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],s.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],s.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],s.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],s.ALPHA_TO_BRIGHTNESS=[0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,255],s.ALPHA_TO_BRIGHTNESS_INVERSE=[0,0,0,-1,255,0,0,0,-1,255,0,0,0,-1,255,0,0,0,0,255],s.BRIGHTNESS_TO_ALPHA=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,.3,.6,.1,0,0],s.BRIGHTNESS_TO_ALPHA_INVERSE=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,-.3,-.6,-.1,0,255],s.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],e.exports=s},73043(e,t,i){var n=i(28915),r=i(70554),s=i(83419),a=i(45650),o=i(34664),l=r.getTintFromFloats,h=new s({initialize:function(e,t,i){void 0===i&&(i=!0),this.scene=e,this.bands=[],this.gpuEncode=i,this.dataTexture=null,this.glTexture=null,this.dataTextureFirstBand=0,this.bandTreeDepth=0,this.dataTextureResolution=[0,0],this.setBands(t)},setBands:function(e,t){this.bands.length=0,Array.isArray(e)||(e=[e]);for(var i=0,n=0;n<e.length;n++){var r=e[n];if(r.isColorBand)this.bands.push(r),i=r.end;else{void 0===r.start&&(r=Object.assign({start:i},r));var s=new o(r);this.bands.push(s),i=s.end}}return!1!==t&&this.gpuEncode&&this.encode(),this},encode:function(){var e=this.bands.length,t=Math.ceil(Math.log2(e));this.bandTreeDepth=t;var i=Math.pow(2,t)-1,n=(8+4*i+12*e)/4,r=1;n>4096&&(r=Math.ceil(n/4096),n=4096),this.dataTextureResolution[0]=n,this.dataTextureResolution[1]=r;var s=new ArrayBuffer(n*r*4),o=new Uint32Array(s),h=new Uint8Array(s),u=0,c=65536;o[u++]=Math.round(this.bands[0].start*c),o[u++]=Math.round(this.bands[this.bands.length-1].end*c);for(var d=0;d<=t;d++)for(var f=Math.pow(2,d),p=1;p<f;p+=2){var m=Math.floor(i*p/f),g=this.bands[Math.min(m,e-1)];o[u++]=Math.round(g.end*c)}this.dataTextureFirstBand=u;for(var v=0;v<e;v++){var y=(g=this.bands[v]).colorStart,x=g.colorEnd;o[u++]=l(y.blueGL,y.greenGL,y.redGL,y.alphaGL),o[u++]=l(x.blueGL,x.greenGL,x.redGL,x.alphaGL);var b=255*g.colorSpace,w=g.interpolation,T=g.middle/2;o[u++]=c*(b+w+T)}if(this.glTexture){var _=this.glTexture;_.update(h,n,r,_.flipY,_.wrapS,_.wrapT,_.minFilter,_.magFilter,_.format)}else{var S=this.scene.renderer.createUint8ArrayTexture(h,n,r,!1,!1);this.glTexture=S;for(var E=a();this.scene.textures.exists(E);)E=a();this.dataTexture=this.scene.textures.addGLTexture(E,S)}},fixFit:function(e,t,i,n){var r=this.bands;if(0===r.length)return this;void 0===i&&(i=!0),void 0===n&&(n=!0),void 0!==e&&(r[0].start=e),void 0!==t&&(r[r.length-1].end=t);for(var s=0;s<r.length-1;s++){var a=r[s],o=r[s+1];o.start=a.end,o.start>o.end&&(o.end=o.start)}return i&&(this.bands=r.filter(function(e){return e.start<e.end})),n&&this.encode(),this},splitBand:function(e,t,i,r){if(0===t)return this;void 0===t&&(t=2),void 0===r&&(r=!0);var s=0;if("number"===typeof e)s=e,e=this.bands[e];else if(-1===(s=this.bands.indexOf(e)))return this;if(!e)return this;this.bands.splice(s,1);for(var a=0;a<t;a++){var l=a/t,h=(a+1)/t;i&&(l=a/(t-1),h=(a+1)/(t-1));var u=e.getColor(l),c=e.getColor(h);i&&(c=u);var d=new o({colorStart:[u.r/255,u.g/255,u.b/255,u.a/255],colorEnd:[c.r/255,c.g/255,c.b/255,c.a/255],start:n(e.start,e.end,l),end:n(e.start,e.end,h),middle:e.middle,interpolation:e.interpolation,colorSpace:e.colorSpace});this.bands.splice(s++,0,d)}return r&&this.encode(),this},getColor:function(e){for(var t,i=0;i<this.bands.length;i++){var n=this.bands[i];if(n.start<=e&&n.end>=e){t=n;break}}return t?(e=(e-t.start)/(t.end-t.start),t.getColor(e)):{r:0,g:0,b:0,a:0,color:0}},destroy:function(){this.scene=null,this.dataTexture&&this.dataTexture.destroy()}});e.exports=h},51767(e,t,i){var n=i(83419),r=i(29747),s=new n({initialize:function(e,t,i){this._rgb=[0,0,0],this.onChangeCallback=r,this.dirty=!1,this.set(e,t,i)},set:function(e,t,i){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),this._rgb=[e,t,i],this.onChange(),this},equals:function(e,t,i){var n=this._rgb;return n[0]===e&&n[1]===t&&n[2]===i},onChange:function(){this.dirty=!0;var e=this._rgb;this.onChangeCallback.call(this,e[0],e[1],e[2])},r:{get:function(){return this._rgb[0]},set:function(e){this._rgb[0]=e,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(e){this._rgb[1]=e,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(e){this._rgb[2]=e,this.onChange()}},destroy:function(){this.onChangeCallback=null}});e.exports=s},60461(e){e.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},54312(e,t,i){var n=i(62235),r=i(35893),s=i(86327),a=i(88417);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(e,r(t)+i),s(e,n(t)+o),e}},46768(e,t,i){var n=i(62235),r=i(26541),s=i(86327),a=i(385);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(e,r(t)-i),s(e,n(t)+o),e}},35827(e,t,i){var n=i(62235),r=i(54380),s=i(86327),a=i(40136);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(e,r(t)+i),s(e,n(t)+o),e}},46871(e,t,i){var n=i(66786),r=i(35893),s=i(7702);e.exports=function(e,t,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),n(e,r(t)+i,s(t)+a),e}},5198(e,t,i){var n=i(7702),r=i(26541),s=i(20786),a=i(385);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(e,r(t)-i),s(e,n(t)+o),e}},11879(e,t,i){var n=i(60461),r=[];r[n.BOTTOM_CENTER]=i(54312),r[n.BOTTOM_LEFT]=i(46768),r[n.BOTTOM_RIGHT]=i(35827),r[n.CENTER]=i(46871),r[n.LEFT_CENTER]=i(5198),r[n.RIGHT_CENTER]=i(80503),r[n.TOP_CENTER]=i(89698),r[n.TOP_LEFT]=i(922),r[n.TOP_RIGHT]=i(21373),r[n.LEFT_BOTTOM]=r[n.BOTTOM_LEFT],r[n.LEFT_TOP]=r[n.TOP_LEFT],r[n.RIGHT_BOTTOM]=r[n.BOTTOM_RIGHT],r[n.RIGHT_TOP]=r[n.TOP_RIGHT];e.exports=function(e,t,i,n,s){return r[i](e,t,n,s)}},80503(e,t,i){var n=i(7702),r=i(54380),s=i(20786),a=i(40136);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(e,r(t)+i),s(e,n(t)+o),e}},89698(e,t,i){var n=i(35893),r=i(17717),s=i(88417),a=i(66737);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),s(e,n(t)+i),a(e,r(t)-o),e}},922(e,t,i){var n=i(26541),r=i(17717),s=i(385),a=i(66737);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),s(e,n(t)-i),a(e,r(t)-o),e}},21373(e,t,i){var n=i(54380),r=i(17717),s=i(40136),a=i(66737);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),s(e,n(t)+i),a(e,r(t)-o),e}},91660(e,t,i){e.exports={BottomCenter:i(54312),BottomLeft:i(46768),BottomRight:i(35827),Center:i(46871),LeftCenter:i(5198),QuickSet:i(11879),RightCenter:i(80503),TopCenter:i(89698),TopLeft:i(922),TopRight:i(21373)}},71926(e,t,i){var n=i(60461),r=i(79291),s={In:i(91660),To:i(16694)};s=r(!1,s,n),e.exports=s},21578(e,t,i){var n=i(62235),r=i(35893),s=i(88417),a=i(66737);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),s(e,r(t)+i),a(e,n(t)+o),e}},10210(e,t,i){var n=i(62235),r=i(26541),s=i(385),a=i(66737);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),s(e,r(t)-i),a(e,n(t)+o),e}},82341(e,t,i){var n=i(62235),r=i(54380),s=i(40136),a=i(66737);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),s(e,r(t)+i),a(e,n(t)+o),e}},87958(e,t,i){var n=i(62235),r=i(26541),s=i(86327),a=i(40136);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(e,r(t)-i),s(e,n(t)+o),e}},40080(e,t,i){var n=i(7702),r=i(26541),s=i(20786),a=i(40136);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(e,r(t)-i),s(e,n(t)+o),e}},88466(e,t,i){var n=i(26541),r=i(17717),s=i(40136),a=i(66737);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),s(e,n(t)-i),a(e,r(t)-o),e}},38829(e,t,i){var n=i(60461),r=[];r[n.BOTTOM_CENTER]=i(21578),r[n.BOTTOM_LEFT]=i(10210),r[n.BOTTOM_RIGHT]=i(82341),r[n.LEFT_BOTTOM]=i(87958),r[n.LEFT_CENTER]=i(40080),r[n.LEFT_TOP]=i(88466),r[n.RIGHT_BOTTOM]=i(19211),r[n.RIGHT_CENTER]=i(34609),r[n.RIGHT_TOP]=i(48741),r[n.TOP_CENTER]=i(49440),r[n.TOP_LEFT]=i(81288),r[n.TOP_RIGHT]=i(61323);e.exports=function(e,t,i,n,s){return r[i](e,t,n,s)}},19211(e,t,i){var n=i(62235),r=i(54380),s=i(86327),a=i(385);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(e,r(t)+i),s(e,n(t)+o),e}},34609(e,t,i){var n=i(7702),r=i(54380),s=i(20786),a=i(385);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(e,r(t)+i),s(e,n(t)+o),e}},48741(e,t,i){var n=i(54380),r=i(17717),s=i(385),a=i(66737);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),s(e,n(t)+i),a(e,r(t)-o),e}},49440(e,t,i){var n=i(35893),r=i(17717),s=i(86327),a=i(88417);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(e,n(t)+i),s(e,r(t)-o),e}},81288(e,t,i){var n=i(26541),r=i(17717),s=i(86327),a=i(385);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(e,n(t)-i),s(e,r(t)-o),e}},61323(e,t,i){var n=i(54380),r=i(17717),s=i(86327),a=i(40136);e.exports=function(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(e,n(t)+i),s(e,r(t)-o),e}},16694(e,t,i){e.exports={BottomCenter:i(21578),BottomLeft:i(10210),BottomRight:i(82341),LeftBottom:i(87958),LeftCenter:i(40080),LeftTop:i(88466),QuickSet:i(38829),RightBottom:i(19211),RightCenter:i(34609),RightTop:i(48741),TopCenter:i(49440),TopLeft:i(81288),TopRight:i(61323)}},66786(e,t,i){var n=i(88417),r=i(20786);e.exports=function(e,t,i){return n(e,t),r(e,i)}},62235(e){e.exports=function(e){return e.y+e.height-e.height*e.originY}},72873(e,t,i){var n=i(62235),r=i(26541),s=i(54380),a=i(17717),o=i(87841);e.exports=function(e,t){void 0===t&&(t=new o);var i=r(e),l=a(e);return t.x=i,t.y=l,t.width=s(e)-i,t.height=n(e)-l,t}},35893(e){e.exports=function(e){return e.x-e.width*e.originX+.5*e.width}},7702(e){e.exports=function(e){return e.y-e.height*e.originY+.5*e.height}},26541(e){e.exports=function(e){return e.x-e.width*e.originX}},87431(e){e.exports=function(e){return e.width*e.originX}},46928(e){e.exports=function(e){return e.height*e.originY}},54380(e){e.exports=function(e){return e.x+e.width-e.width*e.originX}},17717(e){e.exports=function(e){return e.y-e.height*e.originY}},86327(e){e.exports=function(e,t){return e.y=t-e.height+e.height*e.originY,e}},88417(e){e.exports=function(e,t){var i=e.width*e.originX;return e.x=t+i-.5*e.width,e}},20786(e){e.exports=function(e,t){var i=e.height*e.originY;return e.y=t+i-.5*e.height,e}},385(e){e.exports=function(e,t){return e.x=t+e.width*e.originX,e}},40136(e){e.exports=function(e,t){return e.x=t-e.width+e.width*e.originX,e}},66737(e){e.exports=function(e,t){return e.y=t+e.height*e.originY,e}},58724(e,t,i){e.exports={CenterOn:i(66786),GetBottom:i(62235),GetBounds:i(72873),GetCenterX:i(35893),GetCenterY:i(7702),GetLeft:i(26541),GetOffsetX:i(87431),GetOffsetY:i(46928),GetRight:i(54380),GetTop:i(17717),SetBottom:i(86327),SetCenterX:i(88417),SetCenterY:i(20786),SetLeft:i(385),SetRight:i(40136),SetTop:i(66737)}},20623(e){e.exports={setCrisp:function(e){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach(function(t){e.style["image-rendering"]=t}),e.style.msInterpolationMode="nearest-neighbor",e},setBicubic:function(e){return e.style["image-rendering"]="auto",e.style.msInterpolationMode="bicubic",e}}},27919(e,t,i){var n=i(8054),r=i(68703),s=[],a=!1;e.exports=function(){var e=function(e,i,o,l,h){var u;void 0===i&&(i=1),void 0===o&&(o=1),void 0===l&&(l=n.CANVAS),void 0===h&&(h=!1);var c=t(l);return null===c?(c={parent:e,canvas:document.createElement("canvas"),type:l},l===n.CANVAS&&s.push(c),u=c.canvas):(c.parent=e,u=c.canvas),h&&(c.parent=u),u.width=i,u.height=o,a&&l===n.CANVAS&&r.disable(u.getContext("2d",{willReadFrequently:!1})),u},t=function(e){if(void 0===e&&(e=n.CANVAS),e===n.WEBGL)return null;for(var t=0;t<s.length;t++){var i=s[t];if(!i.parent&&i.type===e)return i}return null},i=function(){var e=0;return s.forEach(function(t){t.parent&&e++}),e};return{create2D:function(t,i,r){return e(t,i,r,n.CANVAS)},create:e,createWebGL:function(t,i,r){return e(t,i,r,n.WEBGL)},disableSmoothing:function(){a=!0},enableSmoothing:function(){a=!1},first:t,free:function(){return s.length-i()},pool:s,remove:function(e){var t=e instanceof HTMLCanvasElement;s.forEach(function(i){(t&&i.canvas===e||!t&&i.parent===e)&&(i.parent=null,i.canvas.width=1,i.canvas.height=1)})},total:i}}()},68703(e){var t="";e.exports=function(){var e=function(e){for(var t=["i","webkitI","msI","mozI","oI"],i=0;i<t.length;i++){var n=t[i]+"mageSmoothingEnabled";if(n in e)return n}return null};return{disable:function(i){return""===t&&(t=e(i)),t&&(i[t]=!1),i},enable:function(i){return""===t&&(t=e(i)),t&&(i[t]=!0),i},getPrefix:e,isEnabled:function(e){return null!==t?e[t]:null}}}()},65208(e){e.exports=function(e,t){return void 0===t&&(t="none"),e.style.msTouchAction=t,e.style["ms-touch-action"]=t,e.style["touch-action"]=t,e}},91610(e){e.exports=function(e,t){void 0===t&&(t="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach(function(i){e.style[i+"user-select"]=t}),e.style["-webkit-touch-callout"]=t,e.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",e}},26253(e,t,i){e.exports={CanvasInterpolation:i(20623),CanvasPool:i(27919),Smoothing:i(68703),TouchAction:i(65208),UserSelect:i(91610)}},40987(e,t,i){var n=i(83419),r=i(37589),s=i(1e3),a=i(7537),o=i(87837),l=new n({initialize:function(e,t,i,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=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(e,t,i,n)},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(e,t,i,n,r){return void 0===n&&(n=255),void 0===r&&(r=!0),this._locked=!0,this.red=e,this.green=t,this.blue=i,this.alpha=n,this._locked=!1,this.update(r)},setGLTo:function(e,t,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=e,this.greenGL=t,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(e){return this._locked=!0,this.red=e.r,this.green=e.g,this.blue=e.b,e.hasOwnProperty("a")&&(this.alpha=e.a),this._locked=!1,this.update(!0)},setFromHSV:function(e,t,i){return a(e,t,i,this)},update:function(e){if(void 0===e&&(e=!1),this._locked)return this;var t=this.r,i=this.g,n=this.b,a=this.a;return this._color=r(t,i,n),this._color32=s(t,i,n,a),this._rgba="rgba("+t+","+i+","+n+","+a/255+")",e&&o(t,i,n,this),this},updateHSV:function(){var e=this.r,t=this.g,i=this.b;return o(e,t,i,this),this},clone:function(){return new l(this.r,this.g,this.b,this.a)},gray:function(e){return this.setTo(e,e,e)},random:function(e,t){void 0===e&&(e=0),void 0===t&&(t=255);var i=Math.floor(e+Math.random()*(t-e)),n=Math.floor(e+Math.random()*(t-e)),r=Math.floor(e+Math.random()*(t-e));return this.setTo(i,n,r)},randomGray:function(e,t){void 0===e&&(e=0),void 0===t&&(t=255);var i=Math.floor(e+Math.random()*(t-e));return this.setTo(i,i,i)},saturate:function(e){return this.s+=e/100,this},desaturate:function(e){return this.s-=e/100,this},lighten:function(e){return this.v+=e/100,this},darken:function(e){return this.v-=e/100,this},brighten:function(e){var t=this.r,i=this.g,n=this.b;return t=Math.max(0,Math.min(255,t-Math.round(-e/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-e/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-e/100*255))),this.setTo(t,i,n)},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(e){this.gl[0]=Math.min(Math.abs(e),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(e){this.gl[1]=Math.min(Math.abs(e),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(e){this.gl[2]=Math.min(Math.abs(e),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(e){this.gl[3]=Math.min(Math.abs(e),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(e){e=Math.floor(Math.abs(e)),this.r=Math.min(e,255),this.gl[0]=e/255,this.update(!0)}},green:{get:function(){return this.g},set:function(e){e=Math.floor(Math.abs(e)),this.g=Math.min(e,255),this.gl[1]=e/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(e){e=Math.floor(Math.abs(e)),this.b=Math.min(e,255),this.gl[2]=e/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(e){e=Math.floor(Math.abs(e)),this.a=Math.min(e,255),this.gl[3]=e/255,this.update()}},h:{get:function(){return this._h},set:function(e){this._h=e,a(e,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(e){this._s=e,a(this._h,e,this._v,this)}},v:{get:function(){return this._v},set:function(e){this._v=e,a(this._h,this._s,e,this)}}});e.exports=l},92728(e,t,i){var n=i(37589);e.exports=function(e){void 0===e&&(e=1024);var t,i=[],r=255,s=255,a=0,o=0;for(t=0;t<=r;t++)i.push({r:s,g:t,b:o,color:n(s,t,o)});for(a=255,t=r;t>=0;t--)i.push({r:t,g:a,b:o,color:n(t,a,o)});for(s=0,t=0;t<=r;t++,a--)i.push({r:s,g:a,b:t,color:n(s,a,t)});for(a=0,o=255,t=0;t<=r;t++,o--,s++)i.push({r:s,g:a,b:o,color:n(s,a,o)});if(1024===e)return i;var l=[],h=0,u=1024/e;for(t=0;t<e;t++)l.push(i[Math.floor(h)]),h+=u;return l}},91588(e){e.exports=function(e){var t={r:e>>16&255,g:e>>8&255,b:255&e,a:255};return e>16777215&&(t.a=e>>>24),t}},62957(e){e.exports=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t}},37589(e){e.exports=function(e,t,i){return e<<16|t<<8|i}},1e3(e){e.exports=function(e,t,i,n){return n<<24|e<<16|t<<8|i}},62183(e,t,i){var n=i(40987),r=i(89528);e.exports=function(e,t,i,s){s||(s=new n);var a=i,o=i,l=i;if(0!==t){var h=i<.5?i*(1+t):i+t-i*t,u=2*i-h;a=r(u,h,e+1/3),o=r(u,h,e),l=r(u,h,e-1/3)}return s.setGLTo(a,o,l,1)}},27939(e,t,i){var n=i(7537);e.exports=function(e,t){void 0===e&&(e=1),void 0===t&&(t=1);for(var i=[],r=0;r<=359;r++)i.push(n(r/359,e,t));return i}},7537(e,t,i){var n=i(37589);function r(e,t,i,n){var r=(e+6*t)%6,s=Math.min(r,4-r,1);return Math.round(255*(n-n*i*Math.max(0,s)))}e.exports=function(e,t,i,s){void 0===t&&(t=1),void 0===i&&(i=1);var a=r(5,e,t,i),o=r(3,e,t,i),l=r(1,e,t,i);return s?s.setTo?s.setTo(a,o,l,s.alpha,!0):(s.r=a,s.g=o,s.b=l,s.color=n(a,o,l),s):{r:a,g:o,b:l,color:n(a,o,l)}}},70238(e,t,i){var n=i(40987);e.exports=function(e,t){t||(t=new n),e=e.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,i,n){return t+t+i+i+n+n});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(i){var r=parseInt(i[1],16),s=parseInt(i[2],16),a=parseInt(i[3],16);t.setTo(r,s,a)}return t}},89528(e){e.exports=function(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}},30100(e,t,i){var n=i(40987),r=i(90664);e.exports=function(e,t){var i=r(e);return t?t.setTo(i.r,i.g,i.b,i.a):new n(i.r,i.g,i.b,i.a)}},90664(e){e.exports=function(e){return e>16777215?{a:e>>>24,r:e>>16&255,g:e>>8&255,b:255&e}:{a:255,r:e>>16&255,g:e>>8&255,b:255&e}}},13699(e,t,i){var n=i(28915),r=i(37589),s=i(7537),a=function(e,t,i,s,a,o,l,h){void 0===l&&(l=100),void 0===h&&(h=0);var u=h/l,c=n(e,s,u),d=n(t,a,u),f=n(i,o,u);return{r:c,g:d,b:f,a:255,color:r(c,d,f)}},o=function(e,t,i,r,a,o,l,h,u){if(void 0===u&&(u=0),0===u){var c=e-r;c>.5?e-=1:c<-.5&&(e+=1)}else u>0?e>r&&(e-=1):e<r&&(e+=1);var d=h/l,f=n(e,r,d),p=n(t,a,d),m=n(i,o,d);return s(f,p,m)};e.exports={RGBWithRGB:a,HSVWithHSV:o,ColorWithRGB:function(e,t,i,n,r,s){return void 0===r&&(r=100),void 0===s&&(s=0),a(e.r,e.g,e.b,t,i,n,r,s)},ColorWithColor:function(e,t,i,n,r,s){return void 0===i&&(i=100),void 0===n&&(n=0),r?o(e.h,e.s,e.v,t.h,t.s,t.v,i,n,s):a(e.r,e.g,e.b,t.r,t.g,t.b,i,n)}}},68957(e,t,i){var n=i(40987);e.exports=function(e,t){return t?t.setTo(e.r,e.g,e.b,e.a):new n(e.r,e.g,e.b,e.a)}},87388(e,t,i){var n=i(40987);e.exports=function(e,t){t||(t=new n);var i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(e.toLowerCase());if(i){var r=parseInt(i[1],10),s=parseInt(i[2],10),a=parseInt(i[3],10),o=void 0!==i[4]?parseFloat(i[4]):1;t.setTo(r,s,a,255*o)}return t}},87837(e){e.exports=function(e,t,i,n){void 0===n&&(n={h:0,s:0,v:0}),e/=255,t/=255,i/=255;var r=Math.min(e,t,i),s=Math.max(e,t,i),a=s-r,o=0,l=0===s?0:a/s,h=s;return s!==r&&(s===e?o=(t-i)/a+(t<i?6:0):s===t?o=(i-e)/a+2:s===i&&(o=(e-t)/a+4),o/=6),n.hasOwnProperty("_h")?(n._h=o,n._s=l,n._v=h):(n.h=o,n.s=l,n.v=h),n}},75723(e,t,i){var n=i(62957);e.exports=function(e,t,i,r,s){return void 0===r&&(r=255),void 0===s&&(s="#"),"#"===s?"#"+((1<<24)+(e<<16)+(t<<8)+i).toString(16).slice(1,7):"0x"+n(r)+n(e)+n(t)+n(i)}},85386(e,t,i){var n=i(30976),r=i(40987);e.exports=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=255),new r(n(e,t),n(e,t),n(e,t))}},80333(e,t,i){var n=i(70238),r=i(30100),s=i(68957),a=i(87388);e.exports=function(e,t){switch(typeof e){case"string":return"rgb"===e.substr(0,3).toLowerCase()?a(e,t):n(e,t);case"number":return r(e,t);case"object":return s(e,t)}}},3956(e,t,i){var n=i(40987);n.ColorSpectrum=i(92728),n.ColorToRGBA=i(91588),n.ComponentToHex=i(62957),n.GetColor=i(37589),n.GetColor32=i(1e3),n.HexStringToColor=i(70238),n.HSLToColor=i(62183),n.HSVColorWheel=i(27939),n.HSVToRGB=i(7537),n.HueToComponent=i(89528),n.IntegerToColor=i(30100),n.IntegerToRGB=i(90664),n.Interpolate=i(13699),n.ObjectToColor=i(68957),n.RandomRGB=i(85386),n.RGBStringToColor=i(87388),n.RGBToHSV=i(87837),n.RGBToString=i(75723),n.ValueToColor=i(80333),e.exports=n},27460(e,t,i){e.exports={Align:i(71926),BaseShader:i(73894),Bounds:i(58724),Canvas:i(26253),Color:i(3956),ColorBand:i(34664),ColorMatrix:i(89422),ColorRamp:i(73043),Masks:i(69781),RGB:i(51767)}},80661(e,t,i){var n=new(i(83419))({initialize:function(e,t){this.geometryMask=t},setShape:function(e){return this.geometryMask=e,this},preRenderCanvas:function(e,t,i){var n=this.geometryMask;e.currentContext.save(),n.renderCanvas(e,n,i,null,null,!0),e.currentContext.clip()},postRenderCanvas:function(e){e.currentContext.restore()},destroy:function(){this.geometryMask=null}});e.exports=n},69781(e,t,i){e.exports={GeometryMask:i(80661)}},73894(e,t,i){var n=new(i(83419))({initialize:function(e,t,i){void 0===i&&(i={}),this.key=e,this.glsl=t,this.metadata=i}});e.exports=n},40366(e){e.exports=function(e,t){var i;if(t)"string"===typeof t?i=document.getElementById(t):"object"===typeof t&&1===t.nodeType&&(i=t);else if(e.parentElement||null===t)return e;return i||(i=document.body),i.appendChild(e),e}},83719(e,t,i){var n=i(40366);e.exports=function(e){var t=e.config;if(t.parent&&t.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+e.scale.width+"px;","height: "+e.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+t.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),e.domContainer=i,n(i,t.parent)}}},57264(e,t,i){var n=i(25892);e.exports=function(e){if("complete"!==document.readyState&&"interactive"!==document.readyState){var t=function(){document.removeEventListener("deviceready",t,!0),document.removeEventListener("DOMContentLoaded",t,!0),window.removeEventListener("load",t,!0),e()};document.body?n.cordova?document.addEventListener("deviceready",t,!1):(document.addEventListener("DOMContentLoaded",t,!0),window.addEventListener("load",t,!0)):window.setTimeout(t,20)}else e()}},57811(e){e.exports=function(e){if(!e)return window.innerHeight;var t=Math.abs(window.orientation),i={w:0,h:0},n=document.createElement("div");return n.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(n),i.w=90===t?n.offsetHeight:window.innerWidth,i.h=90===t?window.innerWidth:n.offsetHeight,document.documentElement.removeChild(n),n=null,90!==Math.abs(window.orientation)?i.h:i.w}},45818(e,t,i){var n=i(13560);e.exports=function(e,t){var i=window.screen,r=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);return r&&"string"===typeof r.type?r.type:"string"===typeof r?r:"number"===typeof window.orientation?0===window.orientation||180===window.orientation?n.ORIENTATION.PORTRAIT:n.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?n.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?n.ORIENTATION.LANDSCAPE:void 0:t>e?n.ORIENTATION.PORTRAIT:n.ORIENTATION.LANDSCAPE}},74403(e){e.exports=function(e){var t;return""!==e&&("string"===typeof e?t=document.getElementById(e):e&&1===e.nodeType&&(t=e)),t||(t=document.body),t}},56836(e){e.exports=function(e){var t="";try{if(window.DOMParser)t=(new DOMParser).parseFromString(e,"text/xml");else(t=new ActiveXObject("Microsoft.XMLDOM")).loadXML(e)}catch(oT){t=null}return t&&t.documentElement&&!t.getElementsByTagName("parsererror").length?t:null}},35846(e){e.exports=function(e){e.parentNode&&e.parentNode.removeChild(e)}},43092(e,t,i){var n=i(83419),r=i(29747),s=new n({initialize:function(){this.isRunning=!1,this.callback=r,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var e=this;this.step=function t(i){e.callback(i),e.isRunning&&(e.timeOutID=window.requestAnimationFrame(t))},this.stepTimeout=function t(){e.isRunning&&(e.timeOutID=window.setTimeout(t,e.delay)),e.callback(window.performance.now())}},start:function(e,t,i){this.isRunning||(this.callback=e,this.isSetTimeOut=t,this.delay=i,this.isRunning=!0,this.timeOutID=t?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=r}});e.exports=s},84902(e,t,i){var n={AddToDOM:i(40366),DOMContentLoaded:i(57264),GetInnerHeight:i(57811),GetScreenOrientation:i(45818),GetTarget:i(74403),ParseXML:i(56836),RemoveFromDOM:i(35846),RequestAnimationFrame:i(43092)};e.exports=n},47565(e,t,i){var n=i(83419),r=i(50792),s=i(37277),a=new n({Extends:r,initialize:function(){r.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});s.register("EventEmitter",a,"events"),e.exports=a},93055(e,t,i){e.exports={EventEmitter:i(47565)}},10189(e,t,i){var n=i(83419),r=i(13045),s=new n({Extends:r,initialize:function(e,t){void 0===t&&(t=1),r.call(this,e,"FilterBarrel"),this.amount=t}});e.exports=s},16762(e,t,i){var n=i(83419),r=i(13045),s=new n({Extends:r,initialize:function(e,t,i,n,s){void 0===t&&(t="__WHITE"),void 0===i&&(i=0),void 0===n&&(n=1),void 0===s&&(s=[1,1,1,1]),r.call(this,e,"FilterBlend"),this.glTexture,this.blendMode=i,this.amount=n,this.color=s,this.setTexture(t)},setTexture:function(e){var t=this.camera.scene.sys.textures.getFrame(e);return t&&(this.glTexture=t.glTexture),this}});e.exports=s},37597(e,t,i){var n=i(83419),r=i(13045),s=new n({Extends:r,initialize:function(e,t){r.call(this,e,"FilterBlocky"),this.size={x:4,y:4},this.offset={x:0,y:0},t&&(void 0!==t.size&&("number"===typeof t.size?(this.size.x=t.size,this.size.y=t.size):(this.size.x=t.size.x,this.size.y=t.size.y)),void 0!==t.offset&&("number"===typeof t.offset?(this.offset.x=t.offset,this.offset.y=t.offset):(this.offset.x=t.offset.x,this.offset.y=t.offset.y)))}});e.exports=s},88344(e,t,i){var n=i(83419),r=i(13045),s=new n({Extends:r,initialize:function(e,t,i,n,s,a,o){void 0===t&&(t=0),void 0===i&&(i=2),void 0===n&&(n=2),void 0===s&&(s=1),void 0===o&&(o=4),r.call(this,e,"FilterBlur"),this.quality=t,this.x=i,this.y=n,this.strength=s,this.glcolor=[1,1,1],void 0!==a&&null!==a&&(this.color=a),this.steps=o},color:{get:function(){var e=this.glcolor;return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)},set:function(e){var t=this.glcolor;t[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255}},getPadding:function(){var e=this.paddingOverride;if(e)return this.currentPadding.setTo(e.x,e.y,e.width,e.height),e;var t=this.quality,i=0===t?1.333:1===t?3.2307692308:5.176470588235294,n=this.steps*this.strength*i,r=Math.ceil(this.x*n),s=Math.ceil(this.y*n);return this.currentPadding.setTo(-r,-s,2*r,2*s),this.currentPadding}});e.exports=s},47564(e,t,i){var n=i(83419),r=i(13045),s=new n({Extends:r,initialize:function(e,t,i,n,s,a,o,l){void 0===t&&(t=.5),void 0===i&&(i=1),void 0===n&&(n=.2),void 0===s&&(s=!1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===l&&(l=1),r.call(this,e,"FilterBokeh"),this.radius=t,this.amount=i,this.contrast=n,this.isTiltShift=s,this.blurX=a,this.blurY=o,this.strength=l},getPadding:function(){var e=this.paddingOverride;if(e)return this.currentPadding.setTo(e.x,e.y,e.width,e.height),e;var t=Math.ceil(this.camera.height*this.radius*.021426096060426905);return this.currentPadding.setTo(-t,-t,2*t,2*t),this.currentPadding}});e.exports=s},77011(e,t,i){var n=i(83419),r=i(13045),s=i(89422),a=new n({Extends:r,initialize:function(e){r.call(this,e,"FilterColorMatrix"),this.colorMatrix=new s},destroy:function(){this.colorMatrix=null,r.prototype.destroy.call(this)}});e.exports=a},95200(e,t,i){var n=i(83419),r=i(13045),s=i(89422),a=i(79237),o=new n({Extends:r,initialize:function(e,t){r.call(this,e,"FilterCombineColorMatrix"),this.glTexture,this.colorMatrixSelf=new s,this.colorMatrixTransfer=new s,this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],this.setTexture(t||"__WHITE")},setTexture:function(e){var t=e instanceof a?e:this.camera.scene.sys.textures.getFrame(e);return t&&(this.glTexture=t.glTexture),this},setupAlphaTransfer:function(e,t,i,n,r,s){var a=this.colorMatrixSelf,o=this.colorMatrixTransfer;a.reset(),o.reset(),this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],e||a.black(),t||o.black(),r?a.brightnessToAlphaInverse(!0):i&&a.brightnessToAlpha(!0),s?o.brightnessToAlphaInverse(!0):n&&o.brightnessToAlpha(!0)},destroy:function(){this.colorMatrixSelf=null,this.colorMatrixTransfer=null,r.prototype.destroy.call(this)}});e.exports=o},13045(e,t,i){var n=i(83419),r=i(87841),s=new n({initialize:function(e,t){this.active=!0,this.camera=e,this.renderNode=t,this.paddingOverride=new r,this.currentPadding=new r,this.allowBaseDraw=!0,this.ignoreDestroy=!1},getPadding:function(){return this.paddingOverride||this.currentPadding},getPaddingCeil:function(){var e=this.getPadding(),t=new r(Math.ceil(e.x),Math.ceil(e.y),Math.ceil(e.width),Math.ceil(e.height));return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t},setPaddingOverride:function(e,t,i,n){return null===e?(this.paddingOverride=null,this):(void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),this.paddingOverride=new r(e,t,i-e,n-t),this)},setActive:function(e){return this.active=e,this},destroy:function(){this.active=!1,this.renderNode=null,this.camera=null}});e.exports=s},16898(e,t,i){var n=i(83419),r=i(13045),s=new n({Extends:r,initialize:function(e,t,i,n){void 0===t&&(t="__WHITE"),void 0===i&&(i=.005),void 0===n&&(n=.005),r.call(this,e,"FilterDisplacement"),this.x=i,this.y=n,this.glTexture,this.setTexture(t)},setTexture:function(e){var t=this.camera.scene.sys.textures.getFrame(e);return t&&(this.glTexture=t.glTexture),this},getPadding:function(){var e=this.paddingOverride;if(e)return this.currentPadding.setTo(e.x,e.y,e.width,e.height),e;var t=this.camera,i=Math.ceil(t.width*this.x*.5),n=Math.ceil(t.height*this.y*.5);return this.currentPadding.setTo(-i,-n,2*i,2*n),this.currentPadding}});e.exports=s},42652(e,t,i){var n=i(83419),r=i(13045),s=new n({Extends:r,initialize:function(e,t,i,n,s,a,o,l){void 0===i&&(i=4),void 0===n&&(n=0),void 0===s&&(s=1),void 0===a&&(a=!1),void 0===o&&(o=e.scene.sys.game.config.glowQuality),void 0===l&&(l=e.scene.sys.game.config.glowDistance),r.call(this,e,"FilterGlow"),this.outerStrength=i,this.innerStrength=n,this.scale=s,this.knockout=a,this._quality=Math.max(Math.round(o),1),this._distance=Math.max(Math.round(l),1),this.glcolor=[1,1,1,1],void 0!==t&&(this.color=t)},color:{get:function(){var e=this.glcolor;return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)},set:function(e){var t=this.glcolor;t[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255}},distance:{get:function(){return this._distance}},quality:{get:function(){return this._quality}},getPadding:function(){var e=this.paddingOverride;if(e)return this.currentPadding.setTo(e.x,e.y,e.width,e.height),e;var t=this.currentPadding,i=Math.ceil(this.distance*this.scale);return t.left=-i,t.top=-i,t.right=i,t.bottom=i,t}});e.exports=s},43927(e,t,i){var n=i(83419),r=i(13045),s=i(73043),a=new n({Extends:r,initialize:function(e,t){t||(t={});var i=e.scene;r.call(this,e,"FilterGradientMap");var n=t.ramp;n||(n={colorStart:0,colorEnd:16777215}),n instanceof s||(n=new s(i,n,!0)),this.ramp=n,this.dither=!!t.dither,this.color=[0,0,0,0],t.color&&(this.color[0]=t.color[0]||0,this.color[1]=t.color[1]||0,this.color[2]=t.color[2]||0,this.color[3]=t.color[3]||0),this.colorFactor=[.3,.6,.1,0],t.colorFactor&&(this.colorFactor[0]=t.colorFactor[0]||0,this.colorFactor[1]=t.colorFactor[1]||0,this.colorFactor[2]=t.colorFactor[2]||0,this.colorFactor[3]=t.colorFactor[3]||0),this.unpremultiply=void 0===t.unpremultiply||t.unpremultiply,this.alpha=void 0===t.alpha?1:t.alpha}});e.exports=a},84714(e,t,i){var n=i(83419),r=i(13045),s=i(37867),a=i(61340),o=i(79237),l=new n({Extends:r,initialize:function(e,t){r.call(this,e,"FilterImageLight"),this.normalGlTexture,this.environmentGlTexture,this.viewMatrix=new s,this.modelRotation=t.modelRotation||0,this.modelRotationSource=t.modelRotationSource||null,this.bulge=t.bulge||0,this.colorFactor=t.colorFactor||[1,1,1],this._tempMatrix=new a,this._tempParentMatrix=new a,this.setEnvironmentMap(t.environmentMap||"__WHITE"),this.setNormalMap(t.normalMap||"__NORMAL"),t.viewMatrix&&this.viewMatrix.set(t.viewMatrix)},setEnvironmentMap:function(e){var t=e instanceof o?e:this.camera.scene.sys.textures.getFrame(e);return t&&(this.environmentGlTexture=t.glTexture),this},setNormalMap:function(e){var t=e instanceof o?e:this.camera.scene.sys.textures.getFrame(e);return t&&(this.normalGlTexture=t.glTexture),this},setNormalMapFromGameObject:function(e){var t=e.texture.dataSource[0];return t&&(this.normalGlTexture=t.glTexture),this},getModelRotation:function(){return this.modelRotationSource?"function"===typeof this.modelRotationSource?this.modelRotationSource():this.modelRotationSource.hasTransformComponent?this.modelRotationSource.getWorldTransformMatrix(this._tempMatrix,this._tempParentMatrix).rotationNormalized:this.modelRotation:this.modelRotation}});e.exports=l},51890(e,t,i){var n=i(83419),r=i(13045),s=i(40987),a=new n({Extends:r,initialize:function(e,t){void 0===t&&(t={}),r.call(this,e,"FilterKey"),this.color=[1,1,1,1],void 0!==t.color&&this.setColor(t.color),void 0!==t.alpha&&this.setAlpha(t.alpha),this.isolate=!1,void 0!==t.isolate&&(this.isolate=t.isolate),this.threshold=.0625,void 0!==t.threshold&&(this.threshold=t.threshold),this.feather=0,void 0!==t.feather&&(this.feather=t.feather)},setAlpha:function(e){return this.color[3]=e,this},setColor:function(e){var t=this.color[3];if("number"===typeof e){var i=s.IntegerToRGB(e);this.color=[i.r/255,i.g/255,i.b/255,t]}else if("string"===typeof e){var n=s.HexStringToColor(e);this.color=[n.redGL,n.greenGL,n.blueGL,t]}else Array.isArray(e)?this.color=[e[0],e[1],e[2],t]:e instanceof s&&(this.color=[e.redGL,e.greenGL,e.blueGL,t]);return this}});e.exports=a},97797(e,t,i){var n=i(83419),r=i(45650),s=i(13045),a=new n({Extends:s,initialize:function(e,t,i,n,r,a){void 0===t&&(t="__WHITE"),void 0===i&&(i=!1),void 0===a&&(a=1),s.call(this,e,"FilterMask"),this.glTexture,this._dynamicTexture=null,this.maskGameObject=null,this.invert=i,this.autoUpdate=!0,this.needsUpdate=!1,this.viewTransform=r||"world",this.viewCamera=n,this.scaleFactor=a,"string"===typeof t?this.setTexture(t):this.setGameObject(t)},updateDynamicTexture:function(e,t){var i=this.scaleFactor,n=e*i,s=t*i,a=this.maskGameObject;if(a){if(this._dynamicTexture)this._dynamicTexture.width!==n||this._dynamicTexture.height!==s?this._dynamicTexture.setSize(n,s,!1):this._dynamicTexture.clear();else{var o=this.camera.scene.sys.textures;this._dynamicTexture=o.addDynamicTexture(r(),n,s,!1)}this.glTexture=this._dynamicTexture.get().glTexture;var l=this.viewCamera||a.scene.renderer.currentViewCamera;this._dynamicTexture.capture(a,{transform:this.viewTransform,camera:l}),this._dynamicTexture.render(),this.needsUpdate=!1}},setGameObject:function(e){return this.maskGameObject=e,this.needsUpdate=!0,this},setTexture:function(e){var t=this.camera.scene.sys.textures.getFrame(e);return t&&(this.maskGameObject=null,this.glTexture=t.glTexture),this},destroy:function(){this._dynamicTexture&&this._dynamicTexture.destroy(),this.maskGameObject=null,this._dynamicTexture=null,s.prototype.destroy.call(this)}});e.exports=a},37911(e,t,i){var n=i(83419),r=i(13045),s=i(37867),a=i(25836),o=new n({Extends:r,initialize:function(e,t){t=t||{},r.call(this,e,"FilterNormalTools"),this._rotation=0,this.viewMatrix=new s,this.setRotation(t.rotation||0),this.rotationSource=t.rotationSource||null,this.facingPower=t.facingPower||1,this.outputRatio=t.outputRatio||!1,this.ratioVector=new a(0,0,1),t.ratioVector&&this.ratioVector.set(t.ratioVector[0],t.ratioVector[1],t.ratioVector[2]),this.ratioRadius=t.ratioRadius||1},getRotation:function(){if(this.rotationSource){if("function"===typeof this.rotationSource)return this.rotationSource();if(this.rotationSource.hasTransformComponent)return this.rotationSource.getWorldTransformMatrix().rotationNormalized}return this._rotation},setRotation:function(e){return this.viewMatrix.identity().rotateZ(e),this._rotation=e,this},updateRotation:function(){if(this.rotationSource){var e=this.getRotation();this.viewMatrix.identity().rotateZ(e),this._rotation=e}return this}});e.exports=o},6379(e,t,i){var n=i(83419),r=i(13045),s=new n({Extends:r,initialize:function(e,t){void 0===t&&(t={}),r.call(this,e,"FilterPanoramaBlur"),this.radius=t.radius||1,this.samplesX=t.samplesX||32,this.samplesY=t.samplesY||16,this.power=t.power||1}});e.exports=s},2195(e,t,i){var n=i(83419),r=i(53427),s=i(13045),a=i(16762),o=new n({Extends:s,initialize:function(e){s.call(this,e,"FilterParallelFilters"),this.top=new r(e),this.bottom=new r(e),this.blend=new a(e)}});r.prototype.addParallelFilters=function(){return this.add(new o(this.camera))},e.exports=o},29861(e,t,i){var n=i(83419),r=i(13045),s=new n({Extends:r,initialize:function(e,t){void 0===t&&(t=1),r.call(this,e,"FilterPixelate"),this.amount=t}});e.exports=s},14366(e,t,i){var n=i(83419),r=i(13045),s=new n({Extends:r,initialize:function(e,t){t||(t={}),r.call(this,e,"FilterQuantize"),this.steps=[8,8,8,8],t.steps&&(this.steps[0]=t.steps[0],this.steps[1]=t.steps[1],this.steps[2]=t.steps[2],this.steps[3]=t.steps[3]),this.gamma=[1,1,1,1],t.gamma&&(this.gamma[0]=t.gamma[0],this.gamma[1]=t.gamma[1],this.gamma[2]=t.gamma[2],this.gamma[3]=t.gamma[3]),this.offset=[0,0,0,0],t.offset&&(this.offset[0]=t.offset[0],this.offset[1]=t.offset[1],this.offset[2]=t.offset[2],this.offset[3]=t.offset[3]),this.mode=t.mode||0,this.dither=!!t.dither}});e.exports=s},63785(e,t,i){var n=i(83419),r=i(13045),s=new n({Extends:r,initialize:function(e,t,i){void 0===i&&(i=null),r.call(this,e,"FilterSampler"),this.allowBaseDraw=!1,this.callback=t,this.region=i}});e.exports=s},62229(e,t,i){var n=i(83419),r=i(13045),s=new n({Extends:r,initialize:function(e,t,i,n,s,a,o,l){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=.1),void 0===s&&(s=1),void 0===o&&(o=6),void 0===l&&(l=1),r.call(this,e,"FilterShadow"),this.x=t,this.y=i,this.decay=n,this.power=s,this.glcolor=[0,0,0,1],this.samples=o,this.intensity=l,void 0!==a&&(this.color=a)},color:{get:function(){var e=this.glcolor;return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)},set:function(e){var t=this.glcolor;t[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255}},getPadding:function(){var e=this.paddingOverride;if(e)return this.currentPadding.setTo(e.x,e.y,e.width,e.height),e;var t=this.camera,i=this.decay*this.intensity,n=Math.ceil(Math.abs(this.x)*t.width*i),r=Math.ceil(Math.abs(this.y)*t.height*i);return this.currentPadding.setTo(-n,-r,2*n,2*r),this.currentPadding}});e.exports=s},99534(e,t,i){var n=i(83419),r=i(13045),s=new n({Extends:r,initialize:function(e,t,i,n){r.call(this,e,"FilterThreshold"),this.edge1=[.5,.5,.5,.5],this.edge2=[.5,.5,.5,.5],this.invert=[!1,!1,!1,!1],this.setEdge(t,i),this.setInvert(n)},setEdge:function(e,t){void 0===e&&(e=.5),"number"===typeof e&&(e=[e,e,e,e]),this.edge1[0]=e[0],this.edge1[1]=e[1],this.edge1[2]=e[2],this.edge1[3]=e[3],void 0===t&&(t=e),"number"===typeof t&&(t=[t,t,t,t]),this.edge2[0]=t[0],this.edge2[1]=t[1],this.edge2[2]=t[2],this.edge2[3]=t[3];for(var i=0;i<4;i++)if(this.edge1[i]>this.edge2[i]){var n=this.edge1[i];this.edge1[i]=this.edge2[i],this.edge2[i]=n}return this},setInvert:function(e){return void 0===e&&(e=!1),"boolean"===typeof e&&(e=[e,e,e,e]),this.invert[0]=e[0],this.invert[1]=e[1],this.invert[2]=e[2],this.invert[3]=e[3],this}});e.exports=s},20263(e,t,i){var n=i(83419),r=i(13045),s=i(40987),a=new n({Extends:r,initialize:function(e,t,i,n,a,o,l){void 0===t&&(t=.5),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===a&&(a=.5),void 0===o&&(o=0),void 0===l&&(l=0),r.call(this,e,"FilterVignette"),this.x=t,this.y=i,this.radius=n,this.strength=a,this.color=new s,this.blendMode=l,this.setColor(o)},setColor:function(e){return"number"===typeof e?s.IntegerToColor(e,this.color):"string"===typeof e?s.HexStringToColor(e,this.color):e.setTo?this.color.setTo(e.red,e.green,e.blue,e.alpha):e?this.color.setTo(e.r||0,e.g||0,e.b||0,e.a||255):this.color.setTo(0,0,0,255),this}});e.exports=a},90002(e,t,i){var n=i(83419),r=i(13045),s=i(79237),a=new n({Extends:r,initialize:function(e,t,i,n,s,a){void 0===t&&(t=.1),r.call(this,e,"FilterWipe"),this.progress=0,this.wipeWidth=t,this.direction=i||0,this.axis=n||0,this.reveal=s||0,this.wipeTexture=null,this.setTexture(a)},setWipeWidth:function(e){return void 0===e&&(e=.1),this.wipeWidth=e,this},setLeftToRight:function(){return this.direction=0,this.axis=0,this},setRightToLeft:function(){return this.direction=1,this.axis=0,this},setTopToBottom:function(){return this.direction=1,this.axis=1,this},setBottomToTop:function(){return this.direction=0,this.axis=1,this},setWipeEffect:function(){return this.reveal=0,this.progress=0,this},setRevealEffect:function(){return this.setTexture(),this.reveal=1,this.progress=0,this},setTexture:function(e){return void 0===e&&(e="__DEFAULT"),this.wipeTexture=e instanceof s?e:this.camera.scene.sys.textures.get(e)||this.camera.scene.sys.textures.get("__DEFAULT"),this},setProgress:function(e){return this.progress=e,this}});e.exports=a},11889(e,t,i){var n={Controller:i(13045),Barrel:i(10189),Blend:i(16762),Blocky:i(37597),Blur:i(88344),Bokeh:i(47564),ColorMatrix:i(77011),CombineColorMatrix:i(95200),Displacement:i(16898),Glow:i(42652),GradientMap:i(43927),ImageLight:i(84714),Key:i(51890),Mask:i(97797),NormalTools:i(37911),PanoramaBlur:i(6379),ParallelFilters:i(2195),Pixelate:i(29861),Quantize:i(14366),Sampler:i(63785),Shadow:i(62229),Threshold:i(99534),Vignette:i(20263),Wipe:i(90002)};e.exports=n},25305(e,t,i){var n=i(10312),r=i(23568);e.exports=function(e,t,i){t.x=r(i,"x",0),t.y=r(i,"y",0),t.depth=r(i,"depth",0),t.flipX=r(i,"flipX",!1),t.flipY=r(i,"flipY",!1);var s=r(i,"scale",null);"number"===typeof s?t.setScale(s):null!==s&&(t.scaleX=r(s,"x",1),t.scaleY=r(s,"y",1));var a=r(i,"scrollFactor",null);"number"===typeof a?t.setScrollFactor(a):null!==a&&(t.scrollFactorX=r(a,"x",1),t.scrollFactorY=r(a,"y",1)),t.rotation=r(i,"rotation",0);var o=r(i,"angle",null);null!==o&&(t.angle=o),t.alpha=r(i,"alpha",1);var l=r(i,"origin",null);if("number"===typeof l)t.setOrigin(l);else if(null!==l){var h=r(l,"x",.5),u=r(l,"y",.5);t.setOrigin(h,u)}return t.blendMode=r(i,"blendMode",n.NORMAL),t.visible=r(i,"visible",!0),r(i,"add",!0)&&e.sys.displayList.add(t),t.preUpdate&&e.sys.updateList.add(t),t}},13059(e,t,i){var n=i(23568);e.exports=function(e,t){var i=n(t,"anims",null);if(null===i)return e;if("string"===typeof i)e.anims.play(i);else if("object"===typeof i){var r=e.anims,s=n(i,"key",void 0);if(s){var a=n(i,"startFrame",void 0),o=n(i,"delay",0),l=n(i,"repeat",0),h=n(i,"repeatDelay",0),u=n(i,"yoyo",!1),c=n(i,"play",!1),d=n(i,"delayedPlay",0),f={key:s,delay:o,repeat:l,repeatDelay:h,yoyo:u,startFrame:a};c?r.play(f):d>0?r.playAfterDelay(f,d):r.load(f)}}return e}},8050(e,t,i){var n=i(83419),r=i(73162),s=i(37277),a=i(51708),o=i(44594),l=i(19186),h=new n({Extends:r,initialize:function(e){r.call(this,e),this.sortChildrenFlag=!1,this.scene=e,this.systems=e.sys,this.events=e.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(o.BOOT,this.boot,this),this.events.on(o.START,this.start,this)},boot:function(){this.events.once(o.DESTROY,this.destroy,this)},addChildCallback:function(e){e.displayList&&e.displayList!==this&&e.removeFromDisplayList(),e.parentContainer&&e.parentContainer.remove(e),e.displayList||(this.queueDepthSort(),e.displayList=this,e.emit(a.ADDED_TO_SCENE,e,this.scene),this.events.emit(o.ADDED_TO_SCENE,e,this.scene))},removeChildCallback:function(e){this.queueDepthSort(),e.displayList=null,e.emit(a.REMOVED_FROM_SCENE,e,this.scene),this.events.emit(o.REMOVED_FROM_SCENE,e,this.scene)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(l(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(e,t){return e._depth-t._depth},getChildren:function(){return this.list},shutdown:function(){for(var e=this.list,t=e.length;t--;)e[t]&&e[t].destroy(!0);e.length=0,this.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});s.register("DisplayList",h,"displayList"),e.exports=h},95643(e,t,i){var n=i(83419),r=i(31401),s=i(53774),a=i(45893),o=i(50792),l=i(51708),h=i(44594),u=new n({Extends:o,Mixins:[r.Filters,r.RenderSteps],initialize:function(e,t){o.call(this),this.scene=e,this.displayList=null,this.type=t,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.vertexRoundMode="safeAuto",this.input=null,this.body=null,this.ignoreDestroy=!1,this.isDestroyed=!1,this.addRenderStep&&this.addRenderStep(this.renderWebGL),this.on(l.ADDED_TO_SCENE,this.addedToScene,this),this.on(l.REMOVED_FROM_SCENE,this.removedFromScene,this),e.sys.queueDepthSort()},setActive:function(e){return this.active=e,this},setName:function(e){return this.name=e,this},setState:function(e){return this.state=e,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(e,t){return this.data||(this.data=new a(this)),this.data.set(e,t),this},incData:function(e,t){return this.data||(this.data=new a(this)),this.data.inc(e,t),this},toggleData:function(e){return this.data||(this.data=new a(this)),this.data.toggle(e),this},getData:function(e){return this.data||(this.data=new a(this)),this.data.get(e)},setInteractive:function(e,t,i){return this.scene.sys.input.enable(this,e,t,i),this},disableInteractive:function(e){return void 0===e&&(e=!1),this.scene.sys.input.disable(this,e),this},removeInteractive:function(e){return void 0===e&&(e=!1),this.scene.sys.input.clear(this),e&&this.scene.sys.input.resetCursor(),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return s(this)},willRender:function(e){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(e))||u.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&e.id)},willRoundVertices:function(e,t){switch(this.vertexRoundMode){case"safe":return t;case"safeAuto":return t&&e.roundPixels;case"full":return!0;case"fullAuto":return e.roundPixels;default:return!1}},setVertexRoundMode:function(e){return this.vertexRoundMode=e,this},getIndexList:function(){for(var e=this,t=this.parentContainer,i=[];t&&(i.unshift(t.getIndex(e)),e=t,t.parentContainer);)t=t.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(e)):i.unshift(this.scene.sys.displayList.getIndex(e)),i},addToDisplayList:function(e){return void 0===e&&(e=this.scene.sys.displayList),this.displayList&&this.displayList!==e&&this.removeFromDisplayList(),e.exists(this)||(this.displayList=e,e.add(this,!0),e.queueDepthSort(),this.emit(l.ADDED_TO_SCENE,this,this.scene),e.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var e=this.displayList||this.scene.sys.displayList;return e&&e.exists(this)&&(e.remove(this,!0),e.queueDepthSort(),this.displayList=null,this.emit(l.REMOVED_FROM_SCENE,this,this.scene),e.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},getDisplayList:function(){var e=null;return this.parentContainer?e=this.parentContainer.list:this.displayList&&(e=this.displayList.list),e},destroy:function(e){this.scene&&!this.ignoreDestroy&&(void 0===e&&(e=!1),this.isDestroyed=!0,this.preDestroy&&this.preDestroy.call(this),this.emit(l.DESTROY,this,e),this.removeAllListeners(),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.filterCamera&&(this.filterCamera.destroy(),this.filterCamera=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});u.RENDER_MASK=15,e.exports=u},44603(e,t,i){var n=i(83419),r=i(37277),s=i(44594),a=new n({initialize:function(e){this.scene=e,this.systems=e.sys,this.events=e.sys.events,this.displayList,this.updateList,this.events.once(s.BOOT,this.boot,this),this.events.on(s.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(s.DESTROY,this.destroy,this)},start:function(){this.events.once(s.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(e,t){a.prototype.hasOwnProperty(e)||(a.prototype[e]=t)},a.remove=function(e){a.prototype.hasOwnProperty(e)&&delete a.prototype[e]},r.register("GameObjectCreator",a,"make"),e.exports=a},39429(e,t,i){var n=i(83419),r=i(37277),s=i(44594),a=new n({initialize:function(e){this.scene=e,this.systems=e.sys,this.events=e.sys.events,this.displayList,this.updateList,this.events.once(s.BOOT,this.boot,this),this.events.on(s.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(s.DESTROY,this.destroy,this)},start:function(){this.events.once(s.SHUTDOWN,this.shutdown,this)},existing:function(e){return(e.renderCanvas||e.renderWebGL)&&this.displayList.add(e),e.preUpdate&&this.updateList.add(e),e},shutdown:function(){this.events.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(e,t){a.prototype.hasOwnProperty(e)||(a.prototype[e]=t)},a.remove=function(e){a.prototype.hasOwnProperty(e)&&delete a.prototype[e]},r.register("GameObjectFactory",a,"add"),e.exports=a},91296(e,t,i){var n=i(61340),r=new n,s=new n,a=new n,o=new n,l={camera:r,sprite:s,calc:a,cameraExternal:o};e.exports=function(e,t,i,n){return n?o.loadIdentity():o.copyFrom(t.matrixExternal),r.copyWithScrollFactorFrom(n?t.matrix:t.matrixCombined,t.scrollX,t.scrollY,e.scrollFactorX,e.scrollFactorY),a.copyFrom(r),i&&a.multiply(i),s.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.multiply(s),l}},45027(e,t,i){var n=i(83419),r=i(25774),s=i(37277),a=i(44594),o=new n({Extends:r,initialize:function(e){r.call(this),this.checkQueue=!0,this.scene=e,this.systems=e.sys,e.sys.events.once(a.BOOT,this.boot,this),e.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var e=this.systems.events;e.on(a.PRE_UPDATE,this.update,this),e.on(a.UPDATE,this.sceneUpdate,this),e.once(a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(e,t){for(var i=this._active,n=i.length,r=0;r<n;r++){var s=i[r];s.active&&s.preUpdate.call(s,e,t)}},shutdown:function(){for(var e=this._active.length;e--;)this._active[e].destroy(!0);for(e=this._pending.length;e--;)this._pending[e].destroy(!0);for(e=this._destroy.length;e--;)this._destroy[e].destroy(!0);this._toProcess=0,this._pending=[],this._active=[],this._destroy=[],this.removeAllListeners();var t=this.systems.events;t.off(a.PRE_UPDATE,this.update,this),t.off(a.UPDATE,this.sceneUpdate,this),t.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.systems.events.off(a.START,this.start,this),this.scene=null,this.systems=null}});s.register("UpdateList",o,"updateList"),e.exports=o},3217(e){var t={frame:null,uvSource:null},i={quad:new Float32Array(8)};e.exports=function(e,n,r,s,a,o,l,h,u){t.frame=r.frame,t.uvSource=a;var c=s.x-r.displayOriginX+o,d=s.y-r.displayOriginY+l,f=c+s.w,p=d+s.h,m=h.a,g=h.b,v=h.c,y=h.d,x=h.e,b=h.f,w=c*m+d*v+x,T=c*g+d*y+b,_=c*m+p*v+x,S=c*g+p*y+b,E=f*m+p*v+x,C=f*g+p*y+b,A=f*m+d*v+x,k=f*g+d*y+b;i.quad[0]=w,i.quad[1]=T,i.quad[2]=_,i.quad[3]=S,i.quad[4]=E,i.quad[5]=C,i.quad[6]=A,i.quad[7]=k,n.run(e,r,void 0,0,t,i,u)}},53048(e){e.exports=function(e,t,i,n){if(void 0===i&&(i=!1),void 0===n)return n={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0};var r,s,a,o=e.text,l=o.length,h=e.maxWidth,u=e.wordWrapCharCode,c=Number.MAX_VALUE,d=Number.MAX_VALUE,f=0,p=0,m=e.fontData.chars,g=e.fontData.lineHeight,v=e.letterSpacing,y=e.lineSpacing,x=0,b=0,w=0,T=null,_=e._align,S=0,E=0,C=e.fontSize/e.fontData.size,A=C*e.scaleX,k=C*e.scaleY,R=null,O=0,P=[],M=Number.MAX_VALUE,N=0,I=0,L=0,D=[],F=[],B=null,U=function(e,t){for(var i=0,n=0;n<e.length;n++){var r=e.charCodeAt(n),s=t.chars[r];s&&(i+=s.xAdvance)}return i*A};if(h>0){a=o.split("\n");var z=[];for(r=0;r<a.length;r++){var V=a[r],H="",j="",Y="",W="";for(s=0;s<V.length;s++){if(w=V.charCodeAt(s),H+=V[s],w===u||s===V.length-1)U(W=Y+H,e.fontData)<=h?Y=W:(j=j.slice(0,-1),j+=(j?"\n":"")+Y,Y=H),H=""}j=j.slice(0,-1),j+=(j?"\n":"")+Y,z.push(j)}o=z.join("\n"),n.wrappedText=o,l=o.length}var G=0;for(r=0;r<l;r++)if(10!==(w=o.charCodeAt(r))){if(T=m[w]){if(S=x,E=b,null!==R){var X=T.kerning[O];S+=void 0!==X?X:0}c>S&&(c=S),d>E&&(d=E);var q=S+T.xAdvance,K=E+g;f<q&&(f=q),p<K&&(p=K);var Q=T.xOffset+T.xAdvance+(void 0!==X?X:0);w===u?null!==B&&(D.push({word:B.word,i:B.i,x:B.x*A,y:B.y*k,w:B.w*A,h:B.h*k}),B=null):(null===B&&(B={word:"",i:G,x:x,y:b,w:0,h:g}),B.word=B.word.concat(o[r]),B.w+=Q),F.push({i:G,idx:r,char:o[r],code:w,x:(T.xOffset+S)*C,y:(T.yOffset+b)*C,w:T.width*C,h:T.height*C,t:b*C,r:q*C,b:g*C,line:I,glyph:T}),x+=T.xAdvance+v+(void 0!==X?X:0),R=T,O=w,L=q*C,G++}}else null!==B&&(D.push({word:B.word,i:B.i,x:B.x*A,y:B.y*k,w:B.w*A,h:B.h*k}),B=null),R=null,P[I]=L,L>N&&(N=L),L<M&&(M=L),L=0,x=0,b=(g+y)*++I;if(null!==B&&D.push({word:B.word,i:B.i,x:B.x*A,y:B.y*k,w:B.w*A,h:B.h*k}),P[I]=L,L>N&&(N=L),L<M&&(M=L),_>0)for(var J=0;J<F.length;J++){var Z=F[J];if(1===_){var $=(N-P[Z.line])/2;Z.x+=$,Z.r+=$}else if(2===_){var ee=N-P[Z.line];Z.x+=ee,Z.r+=ee}}var te=n.local,ie=n.global;return a=n.lines,te.x=c*C,te.y=d*C,te.width=f*C,te.height=p*C,ie.x=e.x-e._displayOriginX+c*A,ie.y=e.y-e._displayOriginY+d*k,ie.width=f*A,ie.height=p*k,a.shortest=M,a.longest=N,a.lengths=P,t&&(te.x=Math.ceil(te.x),te.y=Math.ceil(te.y),te.width=Math.ceil(te.width),te.height=Math.ceil(te.height),ie.x=Math.ceil(ie.x),ie.y=Math.ceil(ie.y),ie.width=Math.ceil(ie.width),ie.height=Math.ceil(ie.height),a.shortest=Math.ceil(M),a.longest=Math.ceil(N)),i&&(e._displayOriginX=e.originX*te.width,e._displayOriginY=e.originY*te.height,ie.x=e.x-e._displayOriginX*e.scaleX,ie.y=e.y-e._displayOriginY*e.scaleY,t&&(ie.x=Math.ceil(ie.x),ie.y=Math.ceil(ie.y))),n.words=D,n.characters=F,n.lines.height=g,n.scale=C,n.scaleX=e.scaleX,n.scaleY=e.scaleY,n}},61327(e,t,i){var n=i(21859);e.exports=function(e,t,i,r,s,a,o){var l=e.sys.textures.get(i),h=l.get(r),u=e.sys.cache.xml.get(s);if(h&&u){var c=n(u,h,a,o,l);return e.sys.cache.bitmapFont.add(t,{data:c,texture:i,frame:r,fromAtlas:!0}),!0}return!1}},6925(e,t,i){var n=i(35154);e.exports=function(e,t){var i=t.width,r=t.height,s=Math.floor(i/2),a=Math.floor(r/2),o=n(t,"chars","");if(""!==o){var l=n(t,"image",""),h=e.sys.textures.getFrame(l),u=h.cutX,c=h.cutY,d=h.source.width,f=h.source.height,p=n(t,"offset.x",0),m=n(t,"offset.y",0),g=n(t,"spacing.x",0),v=n(t,"spacing.y",0),y=n(t,"lineSpacing",0),x=n(t,"charsPerRow",null);null===x&&(x=d/i)>o.length&&(x=o.length);for(var b=p,w=m,T={retroFont:!0,font:l,size:i,lineHeight:r+y,chars:{}},_=0,S=0;S<o.length;S++){var E=o.charCodeAt(S),C=(u+b)/d,A=1-(c+w)/f,k=(u+b+i)/d,R=1-(c+w+r)/f;T.chars[E]={x:b,y:w,width:i,height:r,centerX:s,centerY:a,xOffset:0,yOffset:0,xAdvance:i,data:{},kerning:{},u0:C,v0:A,u1:k,v1:R},++_===x?(_=0,b=p,w+=r+v):b+=i+g}return{data:T,frame:null,texture:l}}}},21859(e){function t(e,t){return parseInt(e.getAttribute(t),10)}e.exports=function(e,i,n,r,s){void 0===n&&(n=0),void 0===r&&(r=0);var a=i.cutX,o=i.cutY,l=i.source.width,h=i.source.height,u=i.sourceIndex,c={},d=e.getElementsByTagName("info")[0],f=e.getElementsByTagName("common")[0];c.font=d.getAttribute("face"),c.size=t(d,"size"),c.lineHeight=t(f,"lineHeight")+r,c.chars={};var p=e.getElementsByTagName("char"),m=void 0!==i&&i.trimmed;if(m)var g=i.data.spriteSourceSize.x,v=i.data.spriteSourceSize.y;for(var y=0;y<p.length;y++){var x=p[y],b=t(x,"id"),w=String.fromCharCode(b),T=t(x,"x"),_=t(x,"y"),S=t(x,"width"),E=t(x,"height");m&&(T-=g,_-=v);var C=(a+T)/l,A=1-(o+_)/h,k=(a+T+S)/l,R=1-(o+_+E)/h;c.chars[b]={x:T,y:_,width:S,height:E,centerX:Math.floor(S/2),centerY:Math.floor(E/2),xOffset:t(x,"xoffset"),yOffset:t(x,"yoffset"),xAdvance:t(x,"xadvance")+n,data:{},kerning:{},u0:C,v0:A,u1:k,v1:R},s&&0!==S&&0!==E&&s.add(w,u,T+i.data.cut.x,_+i.data.cut.y,S,E)}var O=e.getElementsByTagName("kerning");for(y=0;y<O.length;y++){var P=O[y],M=t(P,"first"),N=t(P,"second"),I=t(P,"amount");c.chars[N].kerning[M]=I}return c}},196(e,t,i){var n=i(87662),r=i(79291),s={Parse:i(6925)};s=r(!1,s,n),e.exports=s},87662(e){e.exports={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},2638(e,t,i){var n=i(22186),r=i(83419),s=i(12310),a=new r({Extends:n,Mixins:[s],initialize:function(e,t,i,r,s,a,o){n.call(this,e,t,i,r,s,a,o),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(e,t){return this.cropWidth=e,this.cropHeight=t,this},setDisplayCallback:function(e){return this.displayCallback=e,this},setScrollX:function(e){return this.scrollX=e,this},setScrollY:function(e){return this.scrollY=e,this}});e.exports=a},86741(e,t,i){var n=i(20926);e.exports=function(e,t,i,r){var s=t._text,a=s.length,o=e.currentContext;if(0!==a&&n(e,o,t,i,r)){i.addToRenderList(t);var l=t.fromAtlas?t.frame:t.texture.frames.__BASE,h=t.displayCallback,u=t.callbackData,c=t.fontData.chars,d=t.fontData.lineHeight,f=t._letterSpacing,p=0,m=0,g=0,v=null,y=0,x=0,b=0,w=0,T=0,_=0,S=null,E=0,C=t.frame.source.image,A=l.cutX,k=l.cutY,R=0,O=0,P=t._fontSize/t.fontData.size,M=t._align,N=0,I=0;t.getTextBounds(!1);var L=t._bounds.lines;1===M?I=(L.longest-L.lengths[0])/2:2===M&&(I=L.longest-L.lengths[0]),o.translate(-t.displayOriginX,-t.displayOriginY);var D=i.roundPixels;t.cropWidth>0&&t.cropHeight>0&&(o.beginPath(),o.rect(0,0,t.cropWidth,t.cropHeight),o.clip());for(var F=0;F<a;F++)if(O=P,R=0,10!==(g=s.charCodeAt(F))){if(v=c[g]){if(y=A+v.x,x=k+v.y,b=v.width,w=v.height,T=v.xOffset+p-t.scrollX,_=v.yOffset+m-t.scrollY,null!==S){var B=v.kerning[E];T+=void 0!==B?B:0}if(h){u.index=F,u.charCode=g,u.x=T,u.y=_,u.scale=O,u.rotation=R,u.data=v.data;var U=h(u);T=U.x,_=U.y,O=U.scale,R=U.rotation}T*=O,_*=O,T+=I,p+=v.xAdvance+f+(void 0!==B?B:0),S=v,E=g,0!==b&&0!==w&&32!==g&&(D&&(T=Math.round(T),_=Math.round(_)),o.save(),o.translate(T,_),o.rotate(R),o.scale(O,O),o.drawImage(C,y,x,b,w,0,0,b,w),o.restore())}}else N++,1===M?I=(L.longest-L.lengths[N])/2:2===M&&(I=L.longest-L.lengths[N]),p=0,m+=d,S=null;o.restore()}}},11164(e,t,i){var n=i(2638),r=i(25305),s=i(44603),a=i(23568);s.register("dynamicBitmapText",function(e,t){void 0===e&&(e={});var i=a(e,"font",""),s=a(e,"text",""),o=a(e,"size",!1),l=new n(this.scene,0,0,i,s,o);return void 0!==t&&(e.add=t),r(this.scene,l,e),l})},72566(e,t,i){var n=i(2638);i(39429).register("dynamicBitmapText",function(e,t,i,r,s){return this.displayList.add(new n(this.scene,e,t,i,r,s))})},12310(e,t,i){var n=i(29747),r=n,s=n;r=i(73482),s=i(86741),e.exports={renderWebGL:r,renderCanvas:s}},73482(e,t,i){var n=i(91296),r=i(84322),s=i(61340),a=i(70554),o=new s,l={frame:null,uvSource:null},h={tintEffect:r.MULTIPLY,tintTopLeft:0,tintTopRight:0,tintBottomLeft:0,tintBottomRight:0};e.exports=function(e,t,i,s){var u=t.text,c=u.length;if(0!==c){var d=i.camera;d.addToRenderList(t);var f=i,p=t.customRenderNodes.Submitter||t.defaultRenderNodes.Submitter,m=n(t,d,s,!i.useCanvas),g=m.sprite,v=m.calc,y=o,x=t.cropWidth>0||t.cropHeight>0;x&&((f=i.getClone()).setScissorEnable(!0),f.setScissorBox(v.tx,v.ty,t.cropWidth*v.scaleX,t.cropHeight*v.scaleY),f.use()),l.frame=t.frame;var b,w,T=r.MULTIPLY,_=a.getTintAppendFloatAlpha(t.tintTopLeft,t._alphaTL),S=a.getTintAppendFloatAlpha(t.tintTopRight,t._alphaTR),E=a.getTintAppendFloatAlpha(t.tintBottomLeft,t._alphaBL),C=a.getTintAppendFloatAlpha(t.tintBottomRight,t._alphaBR),A=0,k=0,R=0,O=0,P=t.letterSpacing,M=0,N=0,I=t.scrollX,L=t.scrollY,D=t.fontData,F=D.chars,B=D.lineHeight,U=t.fontSize/D.size,z=0,V=t._align,H=0,j=0,Y=t.getTextBounds(!1);t.maxWidth>0&&(c=(u=Y.wrappedText).length);var W=t._bounds.lines;1===V?j=(W.longest-W.lengths[0])/2:2===V&&(j=W.longest-W.lengths[0]);for(var G=t.displayCallback,X=t.callbackData,q=0;q<c;q++)if(10!==(R=u.charCodeAt(q))){if(b=F[R]){l.uvSource=b,M=b.width,N=b.height;var K=b.xOffset+A-I,Q=b.yOffset+k-L;if(null!==w){var J=b.kerning[O]||0;K+=J,A+=J}if(A+=b.xAdvance+P,w=b,O=R,0!==M&&0!==N&&32!==R){if(U=t.fontSize/t.fontData.size,z=0,G){X.color=0,X.tintMode=T,X.tint.topLeft=_,X.tint.topRight=S,X.tint.bottomLeft=E,X.tint.bottomRight=C,X.index=q,X.charCode=R,X.x=K,X.y=Q,X.scale=U,X.rotation=z,X.data=b.data;var Z=G(X);K=Z.x,Q=Z.y,U=Z.scale,z=Z.rotation,Z.color?(_=Z.color,S=Z.color,E=Z.color,C=Z.color):(_=Z.tint.topLeft,S=Z.tint.topRight,E=Z.tint.bottomLeft,C=Z.tint.bottomRight),T=Z.tintMode,_=a.getTintAppendFloatAlpha(_,t._alphaTL),S=a.getTintAppendFloatAlpha(S,t._alphaTR),E=a.getTintAppendFloatAlpha(E,t._alphaBL),C=a.getTintAppendFloatAlpha(C,t._alphaBR)}h.tintEffect=T,h.tintTopLeft=_,h.tintTopRight=S,h.tintBottomLeft=E,h.tintBottomRight=C,K*=U,Q*=U,K-=t.displayOriginX,Q-=t.displayOriginY,K+=j,y.applyITRS(K,Q,z,U,U),v.multiply(y,g);var $=M,ee=N,te=g.e,ie=g.f,ne=ee*g.c+g.e,re=ee*g.d+g.f,se=$*g.a+ee*g.c+g.e,ae=$*g.b+ee*g.d+g.f,oe=$*g.a+g.e,le=$*g.b+g.f;p.run(f,t,void 0,0,l,{quad:[te,ie,ne,re,se,ae,oe,le]},h)}}}else H++,1===V?j=(W.longest-W.lengths[H])/2:2===V&&(j=W.longest-W.lengths[H]),A=0,k+=B,w=null;x&&i.use()}}},22186(e,t,i){var n=i(70972),r=i(83419),s=i(45319),a=i(31401),o=i(95643),l=i(53048),h=i(61327),u=i(21859),c=i(87841),d=i(18658),f=i(84322),p=new r({Extends:o,Mixins:[a.Alpha,a.BlendMode,a.Depth,a.GetBounds,a.Lighting,a.Mask,a.Origin,a.RenderNodes,a.ScrollFactor,a.Texture,a.Tint,a.Transform,a.Visible,d],initialize:function(e,t,i,n,r,s,a){void 0===r&&(r=""),void 0===a&&(a=0),o.call(this,e,"BitmapText"),this.font=n;var h=this.scene.sys.cache.bitmapFont.get(n);h||console.warn("Invalid BitmapText key: "+n),this.fontData=h.data,this._text="",this._fontSize=s||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=h.fromAtlas,this.setTexture(h.texture,h.frame),this.setPosition(t,i),this.setOrigin(0,0),this.initRenderNodes(this._defaultRenderNodesMap),this.setText(r)},_defaultRenderNodesMap:{get:function(){return n}},setLeftAlign:function(){return this._align=p.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=p.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=p.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(e){return this._fontSize=e,this._dirty=!0,this},setLetterSpacing:function(e){return void 0===e&&(e=0),this._letterSpacing=e,this._dirty=!0,this},setLineSpacing:function(e){return void 0===e&&(e=0),this.lineSpacing=e,this},setText:function(e){return e||0===e||(e=""),Array.isArray(e)&&(e=e.join("\n")),e!==this.text&&(this._text=e.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(e,t,i,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=.5),this.dropShadowX=e,this.dropShadowY=t,this.dropShadowColor=i,this.dropShadowAlpha=n,this},setCharacterTint:function(e,t,i,n,r,a,o){void 0===e&&(e=0),void 0===t&&(t=1),void 0===i&&(i=f.MULTIPLY),void 0===n&&(n=-1),void 0===r&&(r=n,a=n,o=n);var l=this.text.length;-1===t&&(t=l),e<0&&(e=l+e),e=s(e,0,l-1);for(var h=s(e+t,e,l),u=this.charColors,c=e;c<h;c++){var d=u[c];if(-1===n)u[c]=null;else{var p=i;d?(d.tintEffect=p,d.tintTL=n,d.tintTR=r,d.tintBL=a,d.tintBR=o):u[c]={tintEffect:p,tintTL:n,tintTR:r,tintBL:a,tintBR:o}}}return this},setWordTint:function(e,t,i,n,r,s,a){void 0===t&&(t=1);for(var o=this.getTextBounds().words,l="number"===typeof e,h=0,u=0;u<o.length;u++){var c=o[u];if((l&&u===e||!l&&c.word===e)&&(this.setCharacterTint(c.i,c.word.length,i,n,r,s,a),++h===t))return this}return this},getTextBounds:function(e){var t=this._bounds;return(this._dirty||e||this.scaleX!==t.scaleX||this.scaleY!==t.scaleY)&&(l(this,e,!0,t),this._dirty=!1),t},getCharacterAt:function(e,t,i){for(var n=this.getLocalPoint(e,t,null,i),r=this.getTextBounds().characters,s=new c,a=0;a<r.length;a++){var o=r[a];if(s.setTo(o.x,o.t,o.r-o.x,o.b),s.contains(n.x,n.y))return o}return null},updateDisplayOrigin:function(){return this._dirty=!0,this.getTextBounds(!1),this},setFont:function(e,t,i){void 0===t&&(t=this._fontSize),void 0===i&&(i=this._align);var n=this.scene.sys.cache.bitmapFont.get(e);return n&&(this.font=e,this.fontData=n.data,this._fontSize=t,this._align=i,this.fromAtlas=!0===n.fromAtlas,this.setTexture(n.texture,n.frame),l(this,!1,!0,this._bounds)),this},setMaxWidth:function(e,t){return this._maxWidth=e,this._dirty=!0,void 0!==t&&(this.wordWrapCharCode=t),this},setDisplaySize:function(e,t){this.setScale(1,1),this.getTextBounds(!1);var i=e/this.width,n=t/this.height;return this.setScale(i,n),this},align:{set:function(e){this._align=e,this._dirty=!0},get:function(){return this._align}},text:{set:function(e){this.setText(e)},get:function(){return this._text}},fontSize:{set:function(e){this._fontSize=e,this._dirty=!0},get:function(){return this._fontSize}},letterSpacing:{set:function(e){this._letterSpacing=e,this._dirty=!0},get:function(){return this._letterSpacing}},lineSpacing:{set:function(e){this._lineSpacing=e,this._dirty=!0},get:function(){return this._lineSpacing}},maxWidth:{set:function(e){this._maxWidth=e,this._dirty=!0},get:function(){return this._maxWidth}},width:{get:function(){return this.getTextBounds(!1),this._bounds.global.width}},height:{get:function(){return this.getTextBounds(!1),this._bounds.global.height}},displayWidth:{set:function(e){this.setScaleX(1),this.getTextBounds(!1);var t=e/this.width;this.setScaleX(t)},get:function(){return this.width}},displayHeight:{set:function(e){this.setScaleY(1),this.getTextBounds(!1);var t=e/this.height;this.setScaleY(t)},get:function(){return this.height}},toJSON:function(){var e=a.ToJSON(this),t={font:this.font,text:this.text,fontSize:this.fontSize,letterSpacing:this.letterSpacing,lineSpacing:this.lineSpacing,align:this.align};return e.data=t,e},preDestroy:function(){this.charColors.length=0,this._bounds=null,this.fontData=null}});p.ALIGN_LEFT=0,p.ALIGN_CENTER=1,p.ALIGN_RIGHT=2,p.ParseFromAtlas=h,p.ParseXMLBitmapFont=u,e.exports=p},37289(e,t,i){var n=i(20926);e.exports=function(e,t,i,r){var s=t._text,a=s.length,o=e.currentContext;if(0!==a&&n(e,o,t,i,r)){i.addToRenderList(t);var l=t.fromAtlas?t.frame:t.texture.frames.__BASE,h=t.fontData.chars,u=t.fontData.lineHeight,c=t._letterSpacing,d=t._lineSpacing,f=0,p=0,m=0,g=null,v=0,y=0,x=0,b=0,w=0,T=0,_=null,S=0,E=l.source.image,C=l.cutX,A=l.cutY,k=t._fontSize/t.fontData.size,R=t._align,O=0,P=0,M=t.getTextBounds(!1);t.maxWidth>0&&(a=(s=M.wrappedText).length);var N=t._bounds.lines;1===R?P=(N.longest-N.lengths[0])/2:2===R&&(P=N.longest-N.lengths[0]),o.translate(-t.displayOriginX,-t.displayOriginY);for(var I=i.roundPixels,L=0;L<a;L++)if(10!==(m=s.charCodeAt(L))){if(g=h[m]){if(v=C+g.x,y=A+g.y,x=g.width,b=g.height,w=g.xOffset+f,T=g.yOffset+p,null!==_){var D=g.kerning[S];w+=void 0!==D?D:0}w*=k,T*=k,w+=P,f+=g.xAdvance+c+(void 0!==D?D:0),_=g,S=m,0!==x&&0!==b&&32!==m&&(I&&(w=Math.round(w),T=Math.round(T)),o.save(),o.translate(w,T),o.scale(k,k),o.drawImage(E,v,y,x,b,0,0,x,b),o.restore())}}else O++,1===R?P=(N.longest-N.lengths[O])/2:2===R&&(P=N.longest-N.lengths[O]),f=0,p+=u+d,_=null;o.restore()}}},57336(e,t,i){var n=i(22186),r=i(25305),s=i(44603),a=i(23568),o=i(35154);s.register("bitmapText",function(e,t){void 0===e&&(e={});var i=o(e,"font",""),s=a(e,"text",""),l=a(e,"size",!1),h=o(e,"align",0),u=new n(this.scene,0,0,i,s,l,h);return void 0!==t&&(e.add=t),r(this.scene,u,e),u})},34914(e,t,i){var n=i(22186);i(39429).register("bitmapText",function(e,t,i,r,s,a){return this.displayList.add(new n(this.scene,e,t,i,r,s,a))})},18658(e,t,i){var n=i(29747),r=n,s=n;r=i(33590),s=i(37289),e.exports={renderWebGL:r,renderCanvas:s}},33590(e,t,i){var n=i(3217),r=i(91296),s=i(70554),a={tintEffect:0,tintTopLeft:0,tintTopRight:0,tintBottomLeft:0,tintBottomRight:0},o={tintEffect:0,tintTopLeft:0,tintTopRight:0,tintBottomLeft:0,tintBottomRight:0};e.exports=function(e,t,i,l){if(0!==t._text.length){var h=i.camera;h.addToRenderList(t);var u=t.customRenderNodes.Submitter||t.defaultRenderNodes.Submitter,c=r(t,h,l,!i.useCanvas).calc,d=t.charColors,f=s.getTintAppendFloatAlpha;a.tintEffect=t.tintMode,a.tintTopLeft=f(t.tintTopLeft,t._alphaTL),a.tintTopRight=f(t.tintTopRight,t._alphaTR),a.tintBottomLeft=f(t.tintBottomLeft,t._alphaBL),a.tintBottomRight=f(t.tintBottomRight,t._alphaBR);var p,m,g,v=t.getTextBounds(!1).characters,y=t.dropShadowX,x=t.dropShadowY;if(0!==y||0!==x){var b=t.dropShadowColor,w=t.dropShadowAlpha;for(o.tintEffect=1,o.tintTopLeft=f(b,w*t._alphaTL),o.tintTopRight=f(b,w*t._alphaTR),o.tintBottomLeft=f(b,w*t._alphaBL),o.tintBottomRight=f(b,w*t._alphaBR),p=0;p<v.length;p++)g=(m=v[p]).glyph,32!==m.code&&0!==g.width&&0!==g.height&&n(i,u,t,m,g,y,x,c,o)}for(p=0;p<v.length;p++)if(g=(m=v[p]).glyph,32!==m.code&&0!==g.width&&0!==g.height)if(d[m.i]){var T=d[m.i];o.tintEffect=T.tintEffect,o.tintTopLeft=f(T.tintTL,t._alphaTL),o.tintTopRight=f(T.tintTR,t._alphaTR),o.tintBottomLeft=f(T.tintBL,t._alphaBL),o.tintBottomRight=f(T.tintBR,t._alphaBR),n(i,u,t,m,g,0,0,c,o)}else n(i,u,t,m,g,0,0,c,a)}}},6107(e,t,i){var n=i(48011),r=i(46590),s=i(98682),a=i(83419),o=i(31401),l=i(4327),h=i(95643),u=i(73162),c=new a({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Lighting,o.Mask,o.RenderNodes,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,n],initialize:function(e,t,i,n,r){h.call(this,e,"Blitter"),this.setTexture(n,r),this.setPosition(t,i),this.initRenderNodes(this._defaultRenderNodesMap),this.children=new u,this.renderList=[],this.dirty=!1},_defaultRenderNodesMap:{get:function(){return s}},create:function(e,t,i,n,s){void 0===n&&(n=!0),void 0===s&&(s=this.children.length),void 0===i?i=this.frame:i instanceof l||(i=this.texture.get(i));var a=new r(this,e,t,i,n);return this.children.addAt(a,s,!1),this.dirty=!0,a},createFromCallback:function(e,t,i,n){for(var r=this.createMultiple(t,i,n),s=0;s<r.length;s++){var a=r[s];e.call(this,a,s)}return r},createMultiple:function(e,t,i){void 0===t&&(t=this.frame.name),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);var n=[],r=this;return t.forEach(function(t){for(var s=0;s<e;s++)n.push(r.create(0,0,t,i))}),n},childCanRender:function(e){return e.visible&&e.alpha>0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(e){if(e)for(var t=this.children.list,i=t.length;i--;)t[i].destroy();else this.children.removeAll();this.dirty=!0},preDestroy:function(){this.clear(!0),this.children.destroy(),this.renderList=[]}});e.exports=c},72396(e){e.exports=function(e,t,i,n){var r=t.getRenderList();if(0!==r.length){var s=e.currentContext,a=i.alpha*t.alpha;if(0!==a){i.addToRenderList(t),s.globalCompositeOperation=e.blendModes[t.blendMode],s.imageSmoothingEnabled=!t.frame.source.scaleMode;var o=t.x-i.scrollX*t.scrollFactorX,l=t.y-i.scrollY*t.scrollFactorY;s.save(),n&&n.copyToContext(s);for(var h=i.roundPixels,u=0;u<r.length;u++){var c=r[u],d=c.flipX||c.flipY,f=c.frame,p=f.canvasData,m=f.x,g=f.y,v=1,y=1,x=c.alpha*a;0!==x&&(s.globalAlpha=x,d?(c.flipX&&(v=-1,m-=p.width),c.flipY&&(y=-1,g-=p.height),p.width>0&&p.height>0&&(s.save(),s.translate(c.x+o,c.y+l),s.scale(v,y),s.drawImage(f.source.image,p.x,p.y,p.width,p.height,m,g,p.width,p.height),s.restore())):(h&&(m=Math.round(m),g=Math.round(g)),p.width>0&&p.height>0&&s.drawImage(f.source.image,p.x,p.y,p.width,p.height,m+c.x+o,g+c.y+l,p.width,p.height)))}s.restore()}}}},9403(e,t,i){var n=i(6107),r=i(25305),s=i(44603),a=i(23568);s.register("blitter",function(e,t){void 0===e&&(e={});var i=a(e,"key",null),s=a(e,"frame",null),o=new n(this.scene,0,0,i,s);return void 0!==t&&(e.add=t),r(this.scene,o,e),o})},12709(e,t,i){var n=i(6107);i(39429).register("blitter",function(e,t,i,r){return this.displayList.add(new n(this.scene,e,t,i,r))})},48011(e,t,i){var n=i(29747),r=n,s=n;r=i(99485),s=i(72396),e.exports={renderWebGL:r,renderCanvas:s}},99485(e,t,i){var n=i(61340),r=i(70554),s=new n,a={quad:new Float32Array(8)},o={},l={};e.exports=function(e,t,i,n){var h=t.getRenderList(),u=i.camera,c=t.alpha;if(0!==h.length&&0!==c){u.addToRenderList(t);var d=s.copyWithScrollFactorFrom(u.getViewMatrix(!i.useCanvas),u.scrollX,u.scrollY,t.scrollFactorX,t.scrollFactorY);n&&d.multiply(n);for(var f=t.x,p=t.y,m=t.customRenderNodes,g=t.defaultRenderNodes,v=0;v<h.length;v++){var y=h[v],x=y.frame,b=y.alpha*c;if(0!==b){var w=x.width,T=x.height,_=f+y.x+x.x,S=p+y.y+x.y;y.flipX&&(w*=-1,_+=x.width),y.flipY&&(T*=-1,S+=x.height),d.setQuad(_,S,_+w,S+T,a.quad),o.frame=x,o.uvSource=x;var E=r.getTintAppendFloatAlpha(y.tint,b);l.tintTopLeft=E,l.tintBottomLeft=E,l.tintTopRight=E,l.tintBottomRight=E,(m.Submitter||g.Submitter).run(i,t,n,0,o,a,l,void 0,0)}}}}},46590(e,t,i){var n=i(83419),r=i(4327),s=new n({initialize:function(e,t,i,n,r){this.parent=e,this.x=t,this.y=i,this.frame=n,this.data={},this.tint=16777215,this._visible=r,this._alpha=1,this.flipX=!1,this.flipY=!1,this.hasTransformComponent=!0},setFrame:function(e){return void 0===e?this.frame=this.parent.frame:e instanceof r&&e.texture===this.parent.texture?this.frame=e:this.frame=this.parent.texture.get(e),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(e,t,i){return this.x=e,this.y=t,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),this},setPosition:function(e,t){return this.x=e,this.y=t,this},setFlipX:function(e){return this.flipX=e,this},setFlipY:function(e){return this.flipY=e,this},setFlip:function(e,t){return this.flipX=e,this.flipY=t,this},setVisible:function(e){return this.visible=e,this},setAlpha:function(e){return this.alpha=e,this},setTint:function(e){return this.tint=e,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(e){this.parent.dirty|=this._visible!==e,this._visible=e}},alpha:{get:function(){return this._alpha},set:function(e){this.parent.dirty|=this._alpha>0!==e>0,this._alpha=e}}});e.exports=s},43451(e,t,i){var n=i(87774),r=i(30529),s=i(83419),a=i(31401),o=i(95643),l=i(36683),h=new s({Extends:o,Mixins:[a.BlendMode,a.Depth,a.RenderNodes,a.Visible,l],initialize:function(e,t){o.call(this,e,"CaptureFrame");var i=e.renderer;this.drawingContext=new n(i,{width:i.width,height:i.height}),this.captureTexture=e.sys.textures.addGLTexture(t,this.drawingContext.texture),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}},setAlpha:function(e){return this},setScrollFactor:function(e,t){return this}});e.exports=h},23675(e,t,i){var n=i(44603),r=i(23568),s=i(43451);n.register("captureFrame",function(e,t){void 0===e&&(e={});var i=r(e,"depth",0),n=r(e,"key",null),a=r(e,"visible",!0),o=new s(this.scene,n);return void 0!==t&&(e.add=t),o.setDepth(i).setVisible(a),e.add&&this.scene.sys.displayList.add(o),o})},20421(e,t,i){var n=i(43451);i(39429).register("captureFrame",function(e){return this.displayList.add(new n(this.scene,e))})},36683(e,t,i){var n=i(29747),r=n,s=n;r=i(82237),e.exports={renderWebGL:r,renderCanvas:s}},82237(e){var t=!1;e.exports=function(e,i,n){if(n.useCanvas)t||(t=!0,console.warn("CaptureFrame: Cannot capture from main canvas. Activate `forceComposite` on the camera to use this feature. This warning will now mute."));else{n.camera.addToRenderList(i);var r=n.width,s=n.height,a=i.customRenderNodes,o=i.defaultRenderNodes;i.drawingContext.resize(r,s),i.drawingContext.use(),(a.BatchHandler||o.BatchHandler).batch(i.drawingContext,n.texture,0,s,0,0,r,s,r,0,0,0,1,1,!1,4294967295,4294967295,4294967295,4294967295,{}),i.drawingContext.release()}}},16005(e,t,i){var n=i(45319),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(e,t,i,r){return void 0===e&&(e=1),void 0===t?this.alpha=e:(this._alphaTL=n(e,0,1),this._alphaTR=n(t,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(e){var t=n(e,0,1);this._alpha=t,this._alphaTL=t,this._alphaTR=t,this._alphaBL=t,this._alphaBR=t,0===t?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(e){var t=n(e,0,1);this._alphaTL=t,0!==t&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(e){var t=n(e,0,1);this._alphaTR=t,0!==t&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(e){var t=n(e,0,1);this._alphaBL=t,0!==t&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(e){var t=n(e,0,1);this._alphaBR=t,0!==t&&(this.renderFlags|=2)}}};e.exports=r},88509(e,t,i){var n=i(45319),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(e){return void 0===e&&(e=1),this.alpha=e,this},alpha:{get:function(){return this._alpha},set:function(e){var t=n(e,0,1);this._alpha=t,0===t?this.renderFlags&=-3:this.renderFlags|=2}}};e.exports=r},90065(e,t,i){var n=i(10312),r={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(e){"string"===typeof e&&(e=n[e]),(e|=0)>=-1&&(this._blendMode=e)}},setBlendMode:function(e){return this.blendMode=e,this}};e.exports=r},94215(e){e.exports={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,t){return this.width=e,this.height=t,this},setDisplaySize:function(e,t){return this.displayWidth=e,this.displayHeight=t,this}}},61683(e){var t={texture:null,frame:null,isCropped:!1,setCrop:function(e,t,i,n){if(void 0===e)this.isCropped=!1;else if(this.frame){if("number"===typeof e)this.frame.setCropUVs(this._crop,e,t,i,n,this.flipX,this.flipY);else{var r=e;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.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}}};e.exports=t},89272(e,t,i){var n=i(37105),r={_depth:0,depth:{get:function(){return this._depth},set:function(e){this.displayList&&this.displayList.queueDepthSort(),this._depth=e}},setDepth:function(e){return void 0===e&&(e=0),this.depth=e,this},setToTop:function(){var e=this.getDisplayList();return e&&n.BringToTop(e,this),this},setToBack:function(){var e=this.getDisplayList();return e&&n.SendToBack(e,this),this},setAbove:function(e){var t=this.getDisplayList();return t&&e&&n.MoveAbove(t,this,e),this},setBelow:function(e){var t=this.getDisplayList();return t&&e&&n.MoveBelow(t,this,e),this}};e.exports=r},3248(e){var t={timeElapsed:0,timeElapsedResetPeriod:36e5,timePaused:!1,setTimerResetPeriod:function(e){return this.timeElapsedResetPeriod=e,this},setTimerPaused:function(e){return this.timePaused=!!e,this},resetTimer:function(e){return void 0===e&&(e=0),this.timeElapsed=e,this},updateTimer:function(e,t){return this.timePaused||(this.timeElapsed+=t,this.timeElapsed>=this.timeElapsedResetPeriod&&(this.timeElapsed-=this.timeElapsedResetPeriod)),this}};e.exports=t},53427(e,t,i){var n=i(83419),r=i(10189),s=i(16762),a=i(37597),o=i(88344),l=i(47564),h=i(77011),u=i(95200),c=i(16898),d=i(42652),f=i(43927),p=i(84714),m=i(51890),g=i(97797),v=i(37911),y=i(6379),x=i(29861),b=i(14366),w=i(63785),T=i(62229),_=i(99534),S=i(20263),E=i(90002),C=new n({initialize:function(e){this.camera=e,this.list=[]},clear:function(){for(var e=0;e<this.list.length;e++){var t=this.list[e];t.ignoreDestroy||t.destroy()}return this.list.length=0,this},add:function(e,t){return void 0===t?this.list.push(e):this.list.splice(t,0,e),e},remove:function(e,t){var i=this.list.indexOf(e);return-1!==i&&(this.list.splice(i,1),e.ignoreDestroy&&!t||e.destroy()),this},getActive:function(){return this.list.filter(A)},addBarrel:function(e){return this.add(new r(this.camera,e))},addBlend:function(e,t,i,n){return this.add(new s(this.camera,e,t,i,n))},addBlocky:function(e){return this.add(new a(this.camera,e))},addBlur:function(e,t,i,n,r,s){return this.add(new o(this.camera,e,t,i,n,r,s))},addBokeh:function(e,t,i){return this.add(new l(this.camera,e,t,i))},addColorMatrix:function(){return this.add(new h(this.camera))},addCombineColorMatrix:function(e){return this.add(new u(this.camera,e))},addDisplacement:function(e,t,i){return this.add(new c(this.camera,e,t,i))},addGlow:function(e,t,i,n,r,s,a){return this.add(new d(this.camera,e,t,i,n,r,s,a))},addGradientMap:function(e){return this.add(new f(this.camera,e))},addImageLight:function(e){return this.add(new p(this.camera,e))},addKey:function(e){return this.add(new m(this.camera,e))},addMask:function(e,t,i,n,r){return this.add(new g(this.camera,e,t,i,n,r))},addNormalTools:function(e){return this.add(new v(this.camera,e))},addPanoramaBlur:function(e){return this.add(new y(this.camera,e))},addPixelate:function(e){return this.add(new x(this.camera,e))},addQuantize:function(e){return this.add(new b(this.camera,e))},addSampler:function(e,t){return this.add(new w(this.camera,e,t))},addShadow:function(e,t,i,n,r,s,a){return this.add(new T(this.camera,e,t,i,n,r,s,a))},addThreshold:function(e,t,i){return this.add(new _(this.camera,e,t,i))},addTiltShift:function(e,t,i,n,r,s){return this.add(new l(this.camera,e,t,i,!0,n,r,s))},addVignette:function(e,t,i,n,r,s){return this.add(new S(this.camera,e,t,i,n,r,s))},addWipe:function(e,t,i,n,r){return this.add(new E(this.camera,e,t,i,n,r))},destroy:function(){this.clear(),this.camera=null}});function A(e){return e.active}e.exports=C},43102(e,t,i){var n=null,r=i(26099),s=i(61340),a={};a={filterCamera:null,filters:{get:function(){return this.filterCamera?this.filterCamera.filters:null}},renderFilters:!0,maxFilterSize:null,filtersAutoFocus:!0,filtersFocusContext:!1,filtersForceComposite:!1,_filtersMatrix:null,_filtersViewMatrix:null,willRenderFilters:function(){return this.renderFilters&&this.filters&&(this.filters.internal.getActive().length>0||this.filters.external.getActive().length>0||this.filtersForceComposite)},enableFilters:function(){if(this.filterCamera||!this.scene.renderer.gl)return this;var e=this.scene;if(n||(n=i(38058)),this.filterCamera=new n(0,0,1,1).setScene(e,!1),this.filterCamera.isObjectInversion=!0,e.game.config.roundPixels&&(this.filterCamera.roundPixels=!0),!this.maxFilterSize){var t=e.renderer.getMaxTextureSize();this.maxFilterSize=new r(t,t)}this._filtersMatrix=new s,this._filtersViewMatrix=new s,this.getBounds&&void 0!==this.width&&void 0!==this.height&&0!==this.width&&0!==this.height||(this.filtersFocusContext=!0);var a=this._renderSteps.indexOf(this.renderWebGL);return this.addRenderStep(this.renderWebGLFilters,a),this},renderWebGLFilters:function(e,t,i,n,r){if(t.willRenderFilters()){var s=i.camera,a=t.filtersAutoFocus,o=t.filtersFocusContext;a&&(o?t.focusFiltersOnCamera(s):t.focusFilters());var l=t.filterCamera;l.preRender();var h=l.roundPixels;if(l.roundPixels=t.willRoundVertices(l,t.rotation%(2*Math.PI)===0&&(t.scaleX,1===t.scaleY)),a&&o){var u=t.parentContainer;if(u){var c=u.getWorldTransformMatrix();l.matrix.multiply(c)}}var d=t._filtersMatrix,f=t._filtersViewMatrix.copyWithScrollFactorFrom(s.getViewMatrix(!i.useCanvas),s.scrollX,s.scrollY,t.scrollFactorX,t.scrollFactorY);if(n&&f.multiply(n),o)d.loadIdentity();else{if("Layer"===t.type)d.loadIdentity();else{var p=t.flipX?-1:1,m=t.flipY?-1:1;d.applyITRS(t.x,t.y,t.rotation,t.scaleX*p,t.scaleY*m)}var g=l.width,v=l.height;d.translate(-g*l.originX,-v*l.originY),f.multiply(d,d)}var y=t.scrollFactorX,x=t.scrollFactorY;t.scrollFactorX=1,t.scrollFactorY=1,e.cameraRenderNode.run(i,[t],l,d,!0,r+1),t.scrollFactorX=y,t.scrollFactorY=x,l.roundPixels=h;for(var b=l.renderList.length,w=0;w<b;w++)s.addToRenderList(l.renderList[w])}else t.renderWebGLStep(e,t,i,n,r+1)},focusFilters:function(){var e=this.x,t=this.y,i=this.originX,n=this.originY,r=this.width,s=this.height;if("Layer"===this.type||isNaN(e)||isNaN(t)||isNaN(r)||isNaN(s)||isNaN(i)||isNaN(n)||0===r||0===s)return this.filtersFocusContext=!0,this;var a=this.rotation,o=this.scaleX,l=this.scaleY;this.flipX&&(o*=-1,i=1-i),this.flipY&&(l*=-1,n=1-n);var h=e+r*(.5-i),u=t+s*(.5-n);return this.setFilterSize(r,s),this.filterCamera.centerOn(h,u).setRotation(-a).setOrigin(i,n).setZoom(1/o,1/l),this},focusFiltersOnCamera:function(e){var t=e.width,i=e.height,n=e.scrollX,r=e.scrollY,s=e.rotation,a=e.zoomX,o=e.zoomY;return this.setFilterSize(t,i),this.filterCamera.setScroll(n,r),this.filterCamera.setRotation(s),this.filterCamera.setZoom(a,o),this},focusFiltersOverride:function(e,t,i,n){var r=this.filterCamera;void 0===i&&(i=r.width),void 0===n&&(n=r.height),void 0===e&&(e=i/2),void 0===t&&(t=n/2);var s=this.x,a=this.y;this.setFilterSize(i,n),r.setScroll(s-e,a-t);var o=e/i,l=t/n;return r.setOrigin(o,l),this.filtersAutoFocus=!1,this},setFilterSize:function(e,t){e=Math.max(1,Math.min(Math.ceil(e),this.maxFilterSize.x)),t=Math.max(1,Math.min(Math.ceil(t),this.maxFilterSize.y));var i=this.filterCamera;return i?(i.setSize(e,t),this):this},setFiltersAutoFocus:function(e){return this.filtersAutoFocus=e,this},setFiltersFocusContext:function(e){return this.filtersFocusContext=e,this},setFiltersForceComposite:function(e){return this.filtersForceComposite=e,this},setRenderFilters:function(e){return this.renderFilters=e,this}},e.exports=a},54434(e){e.exports={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,t){return this.flipX=e,this.flipY=t,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},8004(e,t,i){var n=i(87841),r=i(11520),s=i(26099),a={prepareBoundsOutput:function(e,t){(void 0===t&&(t=!1),0!==this.rotation&&r(e,this.x,this.y,this.rotation),t&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(e.x,e.y,e);return e},getCenter:function(e,t){return void 0===e&&(e=new s),e.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,e.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(e,t)},getTopLeft:function(e,t){return e||(e=new s),e.x=this.x-this.displayWidth*this.originX,e.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(e,t)},getTopCenter:function(e,t){return e||(e=new s),e.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,e.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(e,t)},getTopRight:function(e,t){return e||(e=new s),e.x=this.x-this.displayWidth*this.originX+this.displayWidth,e.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(e,t)},getLeftCenter:function(e,t){return e||(e=new s),e.x=this.x-this.displayWidth*this.originX,e.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(e,t)},getRightCenter:function(e,t){return e||(e=new s),e.x=this.x-this.displayWidth*this.originX+this.displayWidth,e.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(e,t)},getBottomLeft:function(e,t){return e||(e=new s),e.x=this.x-this.displayWidth*this.originX,e.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(e,t)},getBottomCenter:function(e,t){return e||(e=new s),e.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,e.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(e,t)},getBottomRight:function(e,t){return e||(e=new s),e.x=this.x-this.displayWidth*this.originX+this.displayWidth,e.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(e,t)},getBounds:function(e){var t,i,r,s,a,o,l,h;if(void 0===e&&(e=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(e),u.transformPoint(e.x,e.y,e),t=e.x,i=e.y,this.getTopRight(e),u.transformPoint(e.x,e.y,e),r=e.x,s=e.y,this.getBottomLeft(e),u.transformPoint(e.x,e.y,e),a=e.x,o=e.y,this.getBottomRight(e),u.transformPoint(e.x,e.y,e),l=e.x,h=e.y}else this.getTopLeft(e),t=e.x,i=e.y,this.getTopRight(e),r=e.x,s=e.y,this.getBottomLeft(e),a=e.x,o=e.y,this.getBottomRight(e),l=e.x,h=e.y;return e.x=Math.min(t,r,a,l),e.y=Math.min(i,s,o,h),e.width=Math.max(t,r,a,l)-e.x,e.height=Math.max(i,s,o,h)-e.y,e}};e.exports=a},73629(e){var t={lighting:!1,selfShadow:{enabled:null,penumbra:.5,diffuseFlatThreshold:1/3},setLighting:function(e){return this.lighting=e,this},setSelfShadow:function(e,t,i){return void 0!==e&&(this.selfShadow.enabled=null===e?this.scene.sys.game.config.selfShadow:e),void 0!==t&&(this.selfShadow.penumbra=t),void 0!==i&&(this.selfShadow.diffuseFlatThreshold=i),this}};e.exports=t},8573(e,t,i){var n=i(8054),r=i(80661),s={mask:null,setMask:function(e){return this.scene.renderer.type===n.WEBGL?(console.warn("Phaser.GameObjects.Components.Mask.setMask: This method is not supported in WebGL. Create a Mask filter instead."),this):(this.mask=e,this)},clearMask:function(e){return void 0===e&&(e=!1),e&&this.mask&&this.mask.destroy(),this.mask=null,this},createGeometryMask:function(e){return void 0!==e||"Graphics"!==this.type&&!this.geom||(e=this),new r(this.scene,e)}};e.exports=s},27387(e){var t={_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,t){return void 0===e&&(e=.5),void 0===t&&(t=e),this.originX=e,this.originY=t,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this.displayOriginX=e,this.displayOriginY=t,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};e.exports=t},37640(e,t,i){var n=i(39506),r=i(57355),s=i(35154),a=i(86353),o=i(26099),l={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(e,t){void 0===t&&(t=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=e,t&&this.startFollow(t),this},setRotateToPath:function(e,t){return void 0===t&&(t=0),this.rotateToPath=e,this.pathRotationOffset=t,this},isFollowing:function(){var e=this.pathTween;return e&&e.isPlaying()},startFollow:function(e,t){void 0===e&&(e={}),void 0===t&&(t=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"===typeof e&&(e={duration:e}),e.from=s(e,"from",0),e.to=s(e,"to",1);var l=r(e,"positionOnPath",!1);this.rotateToPath=r(e,"rotateToPath",!1),this.pathRotationOffset=s(e,"rotationOffset",0);var h=s(e,"startAt",t);if(h&&(e.onStart=function(e){var t=e.data[0];t.progress=h,t.elapsed=t.duration*h;var i=t.ease(t.progress);t.current=t.start+(t.end-t.start)*i,t.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),e.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(e),this.path.getStartPoint(this.pathOffset),l&&(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 u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+n(this.pathRotationOffset)}return this.pathConfig=e,this},pauseFollow:function(){var e=this.pathTween;return e&&e.isPlaying()&&e.pause(),this},resumeFollow:function(){var e=this.pathTween;return e&&e.isPaused()&&e.resume(),this},stopFollow:function(){var e=this.pathTween;return e&&e.isPlaying()&&e.stop(),this},pathUpdate:function(){var e=this.pathTween;if(e&&e.data){var t=e.data[0],i=this.pathDelta,r=this.pathVector;if(i.copy(r).negate(),t.state===a.COMPLETE)return this.path.getPoint(t.end,r),i.add(r),r.add(this.pathOffset),void this.setPosition(r.x,r.y);if(t.state!==a.PLAYING_FORWARD&&t.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(e.getValue(),r),i.add(r),r.add(this.pathOffset);var s=this.x,o=this.y;this.setPosition(r.x,r.y);var l=this.x-s,h=this.y-o;if(0===l&&0===h)return;if(t.state!==this._prevDirection)return void(this._prevDirection=t.state);this.rotateToPath&&(this.rotation=Math.atan2(h,l)+n(this.pathRotationOffset))}}};e.exports=l},68680(e,t,i){var n=i(62644),r={customRenderNodes:null,defaultRenderNodes:null,renderNodeData:null,initRenderNodes:function(e){this.customRenderNodes={},this.defaultRenderNodes={},this.renderNodeData={};var t=this.scene.sys.renderer;if(t){var i=t.renderNodes;if(i&&e){var n=this.defaultRenderNodes;e.each(function(e,t){n[e]=i.getNode(t)})}}},setRenderNodeRole:function(e,t,i,r){var s=this.scene.sys.renderer;if(!s)return this;var a=s.renderNodes;if(!a)return this;if(null!==t){if("string"===typeof t&&(t=a.getNode(t)),!t)return this;this.customRenderNodes[e]=t,this.renderNodeData[t.name]=i?r?n(i):i:{}}else{var o=this.customRenderNodes[e];o&&(delete this.renderNodeData[o.name],delete this.customRenderNodes[e])}return this},setRenderNodeData:function(e,t,i){var n=e;"string"!==typeof e&&(n=e.name);var r=this.renderNodeData[n];return void 0===i?delete r[t]:r[t]=i,this}};e.exports=r},86038(e){var t={};t={_renderSteps:null,renderWebGLStep:function(e,t,i,n,r,s,a){void 0===r&&(r=0);var o=t._renderSteps[r];o&&(s?void 0===a&&(a=0):(s=[t],a=0),o(e,t,i,n,r,s,a))},addRenderStep:function(e,t){return this._renderSteps||(this._renderSteps=[]),void 0===t?(this._renderSteps.push(e),this):(this._renderSteps.splice(t,0,e),this)}},e.exports=t},80227(e){var t={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(e,t){return void 0===t&&(t=e),this.scrollFactorX=e,this.scrollFactorY=t,this}};e.exports=t},16736(e){var t={_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 t=this.input;return t&&!t.customHitArea&&(t.hitArea.width=this.width,t.hitArea.height=this.height),this},setSize:function(e,t){return this.width=e,this.height=t,this},setDisplaySize:function(e,t){return this.displayWidth=e,this.displayHeight=t,this}};e.exports=t},43520(e){e.exports={stencilLayerMode:"addLayer",stencilInvert:!1,stencilAlphaStrategy:"dither",stencilCompositeCheck:"auto",stencilClearValue:0,stencilValueWrap:!0,isStencilModifier:{get:function(){return!0},set:function(e){}},setStencilAlphaStrategy:function(e){return this.stencilAlphaStrategy=e,this},setStencilClearValue:function(e){return this.stencilClearValue=e,this},setStencilCompositeCheck:function(e){return this.stencilCompositeCheck=e,this},setStencilInvert:function(e){return this.stencilInvert=e,this},setStencilLayerMode:function(e){return this.stencilLayerMode=e,this},setStencilValueWrap:function(e){return this.stencilValueWrap=e,this}}},37726(e,t,i){var n=i(4327),r={texture:null,frame:null,isCropped:!1,setTexture:function(e,t,i,n){return this.texture=this.scene.sys.textures.get(e),this.setFrame(t,i,n)},setFrame:function(e,t,i){return void 0===t&&(t=!0),void 0===i&&(i=!0),e instanceof n?(this.texture=this.scene.sys.textures.get(e.texture.key),this.frame=e):this.frame=this.texture.get(e),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&t&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};e.exports=r},79812(e,t,i){var n=i(4327),r={texture:null,frame:null,isCropped:!1,setCrop:function(e,t,i,n){if(void 0===e)this.isCropped=!1;else if(this.frame){if("number"===typeof e)this.frame.setCropUVs(this._crop,e,t,i,n,this.flipX,this.flipY);else{var r=e;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(e,t){return this.texture=this.scene.sys.textures.get(e),this.setFrame(t)},setFrame:function(e,t,i){return void 0===t&&(t=!0),void 0===i&&(i=!0),e instanceof n?(this.texture=this.scene.sys.textures.get(e.texture.key),this.frame=e):this.frame=this.texture.get(e),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&t&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};e.exports=r},27472(e,t,i){var n=i(84322),r={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tint2TopLeft:0,tint2TopRight:0,tint2BottomLeft:0,tint2BottomRight:0,tintMode:n.MULTIPLY,clearTint:function(){return this.setTint(16777215),this.setTint2(0),this.setTintMode(n.MULTIPLY),this},setTint:function(e,t,i,n){return void 0===e&&(e=16777215),void 0===t&&(t=e,i=e,n=e),this.tintTopLeft=e,this.tintTopRight=t,this.tintBottomLeft=i,this.tintBottomRight=n,this},setTint2:function(e,t,i,n){return void 0===e&&(e=0),void 0===t&&(t=e,i=e,n=e),this.tint2TopLeft=e,this.tint2TopRight=t,this.tint2BottomLeft=i,this.tint2BottomRight=n,this},setTintMode:function(e){return this.tintMode=e,this},setTintFill:function(){console.error("`setTintFill(color)` is removed as of Phaser 4. Use setTint(color).setTintMode(Phaser.TintModes.FILL)` instead.")},tint:{get:function(){return this.tintTopLeft},set:function(e){this.setTint(e,e,e,e)}},isTinted:{get:function(){var e=16777215;return this.tintMode!==n.MULTIPLY||this.tintTopLeft!==e||this.tintTopRight!==e||this.tintBottomLeft!==e||this.tintBottomRight!==e||0!==this.tint2TopLeft||0!==this.tint2TopRight||0!==this.tint2BottomLeft||0!==this.tint2BottomRight}}};e.exports=r},53774(e){e.exports=function(e){var t={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&&(t.textureKey=e.texture.key,t.frameKey=e.frame.name),t}},16901(e,t,i){var n=i(36383),r=i(61340),s=i(85955),a=i(86554),o=i(30954),l=i(26099),h={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(e){this._scaleX=e,this._scaleY=e,0===e?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(e){this._scaleX=e,0===e?this.renderFlags&=-5:0!==this._scaleY&&(this.renderFlags|=4)}},scaleY:{get:function(){return this._scaleY},set:function(e){this._scaleY=e,0===e?this.renderFlags&=-5:0!==this._scaleX&&(this.renderFlags|=4)}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(e){this.rotation=o(e)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation=a(e)}},setPosition:function(e,t,i,n){return void 0===e&&(e=0),void 0===t&&(t=e),void 0===i&&(i=0),void 0===n&&(n=0),this.x=e,this.y=t,this.z=i,this.w=n,this},copyPosition:function(e){return void 0!==e.x&&(this.x=e.x),void 0!==e.y&&(this.y=e.y),void 0!==e.z&&(this.z=e.z),void 0!==e.w&&(this.w=e.w),this},setRandomPosition:function(e,t,i,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=e+Math.random()*i,this.y=t+Math.random()*n,this},setRotation:function(e){return void 0===e&&(e=0),this.rotation=e,this},setAngle:function(e){return void 0===e&&(e=0),this.angle=e,this},setScale:function(e,t){return void 0===e&&(e=1),void 0===t&&(t=e),this.scaleX=e,this.scaleY=t,this},setX:function(e){return void 0===e&&(e=0),this.x=e,this},setY:function(e){return void 0===e&&(e=0),this.y=e,this},setZ:function(e){return void 0===e&&(e=0),this.z=e,this},setW:function(e){return void 0===e&&(e=0),this.w=e,this},getLocalTransformMatrix:function(e){return void 0===e&&(e=new r),e.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(e,t){void 0===e&&(e=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(e);var n=!1;for(t||(t=new r,n=!0),e.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)t.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),t.multiply(e,e),i=i.parentContainer;return n&&t.destroy(),e},getLocalPoint:function(e,t,i,n){i||(i=new l),n||(n=this.scene.sys.cameras.main);var r=n.scrollX,a=n.scrollY,o=e+r*this.scrollFactorX-r,h=t+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,h,i):s(o,h,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getWorldPoint:function(e,t,i){if(void 0===e&&(e=new l),!this.parentContainer)return e.x=this.x,e.y=this.y,e;var n=this.getWorldTransformMatrix(t,i);return e.x=n.tx,e.y=n.ty,e},getParentRotation:function(){for(var e=0,t=this.parentContainer;t;)e+=t.rotation,t=t.parentContainer;return e}};e.exports=h},61340(e,t,i){var n=i(83419),r=i(36383),s=i(26099),a=new n({initialize:function(e,t,i,n,r,s){void 0===e&&(e=1),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([e,t,i,n,r,s,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(e){this.matrix[0]=e}},b:{get:function(){return this.matrix[1]},set:function(e){this.matrix[1]=e}},c:{get:function(){return this.matrix[2]},set:function(e){this.matrix[2]=e}},d:{get:function(){return this.matrix[3]},set:function(e){this.matrix[3]=e}},e:{get:function(){return this.matrix[4]},set:function(e){this.matrix[4]=e}},f:{get:function(){return this.matrix[5]},set:function(e){this.matrix[5]=e}},tx:{get:function(){return this.matrix[4]},set:function(e){this.matrix[4]=e}},ty:{get:function(){return this.matrix[5]},set:function(e){this.matrix[5]=e}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var e=this.matrix,t=e[0],i=e[1],n=e[2],s=e[3];return t||i?i>0?Math.acos(t/this.scaleX):-Math.acos(t/this.scaleX):n||s?r.PI_OVER_2-(s>0?Math.acos(-n/this.scaleY):-Math.acos(n/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 e=this.matrix;return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,this},translate:function(e,t){var i=this.matrix;return i[4]=i[0]*e+i[2]*t+i[4],i[5]=i[1]*e+i[3]*t+i[5],this},scale:function(e,t){var i=this.matrix;return i[0]*=e,i[1]*=e,i[2]*=t,i[3]*=t,this},rotate:function(e){var t=Math.sin(e),i=Math.cos(e),n=this.matrix,r=n[0],s=n[1],a=n[2],o=n[3];return n[0]=r*i+a*t,n[1]=s*i+o*t,n[2]=r*-t+a*i,n[3]=s*-t+o*i,this},multiply:function(e,t){var i=this.matrix,n=e.matrix,r=i[0],s=i[1],a=i[2],o=i[3],l=i[4],h=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],m=n[5],g=void 0===t?i:t.matrix;return g[0]=u*r+c*a,g[1]=u*s+c*o,g[2]=d*r+f*a,g[3]=d*s+f*o,g[4]=p*r+m*a+l,g[5]=p*s+m*o+h,g},multiplyWithOffset:function(e,t,i){var n=this.matrix,r=e.matrix,s=n[0],a=n[1],o=n[2],l=n[3],h=t*s+i*o+n[4],u=t*a+i*l+n[5],c=r[0],d=r[1],f=r[2],p=r[3],m=r[4],g=r[5];return n[0]=c*s+d*o,n[1]=c*a+d*l,n[2]=f*s+p*o,n[3]=f*a+p*l,n[4]=m*s+g*o+h,n[5]=m*a+g*l+u,this},transform:function(e,t,i,n,r,s){var a=this.matrix,o=a[0],l=a[1],h=a[2],u=a[3],c=a[4],d=a[5];return a[0]=e*o+t*h,a[1]=e*l+t*u,a[2]=i*o+n*h,a[3]=i*l+n*u,a[4]=r*o+s*h+c,a[5]=r*l+s*u+d,this},transformPoint:function(e,t,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,r=n[0],s=n[1],a=n[2],o=n[3],l=n[4],h=n[5];return i.x=e*r+t*a+l,i.y=e*s+t*o+h,i},invert:function(){var e=this.matrix,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],a=e[5],o=t*r-i*n;return e[0]=r/o,e[1]=-i/o,e[2]=-n/o,e[3]=t/o,e[4]=(n*a-r*s)/o,e[5]=-(t*a-i*s)/o,this},copyFrom:function(e){var t=this.matrix;return t[0]=e.a,t[1]=e.b,t[2]=e.c,t[3]=e.d,t[4]=e.e,t[5]=e.f,this},copyFromArray:function(e){var t=this.matrix;return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],this},copyWithScrollFactorFrom:function(e,t,i,n,r){var s=this.matrix;s[0]=e.a,s[1]=e.b,s[2]=e.c,s[3]=e.d;var a=t*(1-n),o=i*(1-r);return s[4]=e.a*a+e.c*o+e.e,s[5]=e.b*a+e.d*o+e.f,this},copyToContext:function(e){var t=this.matrix;return e.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e},setToContext:function(e){return e.setTransform(this.a,this.b,this.c,this.d,this.e,this.f),e},copyToArray:function(e){var t=this.matrix;return void 0===e?e=[t[0],t[1],t[2],t[3],t[4],t[5]]:(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5]),e},setTransform:function(e,t,i,n,r,s){var a=this.matrix;return a[0]=e,a[1]=t,a[2]=i,a[3]=n,a[4]=r,a[5]=s,this},decomposeMatrix:function(){var e=this.decomposedMatrix,t=this.matrix,i=t[0],n=t[1],r=t[2],s=t[3],a=i*s-n*r;if(e.translateX=t[4],e.translateY=t[5],i||n){var o=Math.sqrt(i*i+n*n);e.rotation=n>0?Math.acos(i/o):-Math.acos(i/o),e.scaleX=o,e.scaleY=a/o}else if(r||s){var l=Math.sqrt(r*r+s*s);e.rotation=.5*Math.PI-(s>0?Math.acos(-r/l):-Math.acos(r/l)),e.scaleX=a/l,e.scaleY=l}else e.rotation=0,e.scaleX=0,e.scaleY=0;return e},applyITRS:function(e,t,i,n,r){var s=this.matrix,a=Math.sin(i),o=Math.cos(i);return s[4]=e,s[5]=t,s[0]=o*n,s[1]=a*n,s[2]=-a*r,s[3]=o*r,this},applyInverse:function(e,t,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],a=n[1],o=n[2],l=n[3],h=n[4],u=n[5],c=1/(r*l+o*-a);return i.x=l*c*e+-o*c*t+(u*o-h*l)*c,i.y=r*c*t+-a*c*e+(-u*r+h*a)*c,i},setQuad:function(e,t,i,n,r){void 0===r&&(r=this.quad);var s=this.matrix,a=s[0],o=s[1],l=s[2],h=s[3],u=s[4],c=s[5];return r[0]=e*a+t*l+u,r[1]=e*o+t*h+c,r[2]=e*a+n*l+u,r[3]=e*o+n*h+c,r[4]=i*a+n*l+u,r[5]=i*o+n*h+c,r[6]=i*a+t*l+u,r[7]=i*o+t*h+c,r},getX:function(e,t){return e*this.a+t*this.c+this.e},getY:function(e,t){return e*this.b+t*this.d+this.f},getXRound:function(e,t,i){var n=this.getX(e,t);return i&&(n=Math.floor(n+.5)),n},getYRound:function(e,t,i){var n=this.getY(e,t);return i&&(n=Math.floor(n+.5)),n},getCSSMatrix:function(){var e=this.matrix;return"matrix("+e[0]+","+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});e.exports=a},59715(e){var t={_visible:!0,visible:{get:function(){return this._visible},set:function(e){e?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(e){return this.visible=e,this}};e.exports=t},31401(e,t,i){e.exports={Alpha:i(16005),AlphaSingle:i(88509),BlendMode:i(90065),ComputedSize:i(94215),Crop:i(61683),Depth:i(89272),ElapseTimer:i(3248),FilterList:i(53427),Filters:i(43102),Flip:i(54434),GetBounds:i(8004),Lighting:i(73629),Mask:i(8573),Origin:i(27387),PathFollower:i(37640),RenderNodes:i(68680),RenderSteps:i(86038),ScrollFactor:i(80227),Size:i(16736),StencilModifier:i(43520),Texture:i(37726),TextureCrop:i(79812),Tint:i(27472),ToJSON:i(53774),Transform:i(16901),TransformMatrix:i(61340),Visible:i(59715)}},31559(e,t,i){var n=i(37105),r=i(10312),s=i(83419),a=i(31401),o=i(51708),l=i(95643),h=i(87841),u=i(29959),c=i(36899),d=i(26099),f=i(93595),p=new a.TransformMatrix,m=new s({Extends:l,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Transform,a.Visible,u],initialize:function(e,t,i,n){l.call(this,e,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this._sortKey="",this._sysEvents=e.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.setPosition(t,i),this.setBlendMode(r.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(e){return void 0===e&&(e=!0),this.exclusive=e,this},getBounds:function(e){if(void 0===e&&(e=new h),e.setTo(this.x,this.y,0,0),this.parentContainer){var t=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);e.setTo(t.x,t.y,0,0)}if(this.list.length>0){var i=this.list,n=new h,r=!1;e.setEmpty();for(var s=0;s<i.length;s++){var a=i[s];a.getBounds&&(a.getBounds(n),r?c(n,e,e):(e.setTo(n.x,n.y,n.width,n.height),r=!0))}}return e},addHandler:function(e){e.once(o.DESTROY,this.onChildDestroyed,this),this.exclusive&&(e.parentContainer&&e.parentContainer.remove(e),e.parentContainer=this,e.removeFromDisplayList(),e.addedToScene())},removeHandler:function(e){e.off(o.DESTROY,this.remove,this),this.exclusive&&(e.parentContainer=null,e.removedFromScene(),e.addToDisplayList())},pointToContainer:function(e,t){void 0===t&&(t=new d),this.parentContainer?this.parentContainer.pointToContainer(e,t):(t.x=e.x,t.y=e.y);var i=p;return i.applyITRS(this.x,this.y,this.rotation,this.scaleX,this.scaleY),i.invert(),i.transformPoint(e.x,e.y,t),t},getBoundsTransformMatrix:function(){return this.getWorldTransformMatrix(p,this.localTransform)},add:function(e){if(Array.isArray(e))e.forEach(function(e){if(e&&e instanceof f)throw new Error("Tried to add a Layer to a Container: this is not allowed")});else if(e&&e instanceof f)throw new Error("Tried to add a Layer to a Container: this is not allowed");return n.Add(this.list,e,this.maxSize,this.addHandler,this),this},addAt:function(e,t){return n.AddAt(this.list,e,t,this.maxSize,this.addHandler,this),this},getAt:function(e){return this.list[e]},getIndex:function(e){return this.list.indexOf(e)},sort:function(e,t){return e?(void 0===t&&(t=function(t,i){return t[e]-i[e]}),n.StableSort(this.list,t),this):this},getByName:function(e){return n.GetFirst(this.list,"name",e)},getRandom:function(e,t){return n.GetRandom(this.list,e,t)},getFirst:function(e,t,i,r){return n.GetFirst(this.list,e,t,i,r)},getAll:function(e,t,i,r){return n.GetAll(this.list,e,t,i,r)},count:function(e,t,i,r){return n.CountAllMatching(this.list,e,t,i,r)},swap:function(e,t){return n.Swap(this.list,e,t),this},moveTo:function(e,t){return n.MoveTo(this.list,e,t),this},moveAbove:function(e,t){return n.MoveAbove(this.list,e,t),this},moveBelow:function(e,t){return n.MoveBelow(this.list,e,t),this},remove:function(e,t){var i=n.Remove(this.list,e,this.removeHandler,this);if(t&&i){Array.isArray(i)||(i=[i]);for(var r=0;r<i.length;r++)i[r].destroy()}return this},removeAt:function(e,t){var i=n.RemoveAt(this.list,e,this.removeHandler,this);return t&&i&&i.destroy(),this},removeBetween:function(e,t,i){var r=n.RemoveBetween(this.list,e,t,this.removeHandler,this);if(i)for(var s=0;s<r.length;s++)r[s].destroy();return this},removeAll:function(e){var t=this.list;if(e){for(var i=0;i<t.length;i++)t[i]&&t[i].scene&&(t[i].off(o.DESTROY,this.onChildDestroyed,this),t[i].destroy());this.list=[]}else n.RemoveBetween(t,0,t.length,this.removeHandler,this);return this},bringToTop:function(e){return n.BringToTop(this.list,e),this},sendToBack:function(e){return n.SendToBack(this.list,e),this},moveUp:function(e){return n.MoveUp(this.list,e),this},moveDown:function(e){return n.MoveDown(this.list,e),this},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(e,t,i){return n.Replace(this.list,e,t)&&(this.addHandler(t),this.removeHandler(e),i&&e.destroy()),this},exists:function(e){return this.list.indexOf(e)>-1},setAll:function(e,t,i,r){return n.SetAll(this.list,e,t,i,r),this},each:function(e,t){var i,n=[null],r=this.list.slice(),s=r.length;for(i=2;i<arguments.length;i++)n.push(arguments[i]);for(i=0;i<s;i++)n[0]=r[i],e.apply(t,n);return this},iterate:function(e,t){var i,n=[null];for(i=2;i<arguments.length;i++)n.push(arguments[i]);for(i=0;i<this.list.length;i++)n[0]=this.list[i],e.apply(t,n);return this},setScrollFactor:function(e,t,i){return void 0===t&&(t=e),void 0===i&&(i=!1),this.scrollFactorX=e,this.scrollFactorY=t,i&&(n.SetAll(this.list,"scrollFactorX",e),n.SetAll(this.list,"scrollFactorY",t)),this},length:{get:function(){return this.list.length}},first:{get:function(){return this.position=0,this.list.length>0?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.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return this.position>0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.list=[]},onChildDestroyed:function(e){n.Remove(this.list,e),this.exclusive&&(e.parentContainer=null,e.removedFromScene())}});e.exports=m},53584(e){e.exports=function(e,t,i,n){i.addToRenderList(t);var r=t.list;if(0!==r.length){var s=t.localTransform;n?(s.loadIdentity(),s.multiply(n),s.translate(t.x,t.y),s.rotate(t.rotation),s.scale(t.scaleX,t.scaleY)):s.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY);var a=-1!==t.blendMode;a||e.setBlendMode(0);var o=t._alpha,l=t.scrollFactorX,h=t.scrollFactorY;t.mask&&t.mask.preRenderCanvas(e,null,i);for(var u=0;u<r.length;u++){var c=r[u];if(c.willRender(i)){var d=c.alpha,f=c.scrollFactorX,p=c.scrollFactorY;a||c.blendMode===e.currentBlendMode||e.setBlendMode(c.blendMode),c.setScrollFactor(f*l,p*h),c.setAlpha(d*o),c.renderCanvas(e,c,i,s),c.setAlpha(d),c.setScrollFactor(f,p)}}t.mask&&t.mask.postRenderCanvas(e)}}},77143(e,t,i){var n=i(25305),r=i(31559),s=i(44603),a=i(23568),o=i(95540);s.register("container",function(e,t){void 0===e&&(e={});var i=a(e,"x",0),s=a(e,"y",0),l=o(e,"children",null),h=new r(this.scene,i,s,l);return void 0!==t&&(e.add=t),n(this.scene,h,e),h})},24961(e,t,i){var n=i(31559);i(39429).register("container",function(e,t,i){return this.displayList.add(new n(this.scene,e,t,i))})},29959(e,t,i){var n=i(29747),r=n,s=n;r=i(72249),s=i(53584),e.exports={renderWebGL:r,renderCanvas:s}},72249(e,t,i){var n=i(8054);e.exports=function(e,t,i,r,s,a,o){var l=i.camera;l.addToRenderList(t);var h=t.list,u=h.length;if(0!==u){var c=i,d=t.localTransform;r?(d.loadIdentity(),d.multiply(r),d.translate(t.x,t.y),d.rotate(t.rotation),d.scale(t.scaleX,t.scaleY)):d.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY);var f=-1!==t.blendMode;f||0===c.blendMode||((c=c.getClone()).setBlendMode(0),c.use());for(var p=c,m=t.alpha,g=t.scrollFactorX,v=t.scrollFactorY,y=0;y<u;y++){var x=h[y];if(x.willRender(l)){var b,w,T,_;if(void 0!==x.alphaTopLeft)b=x.alphaTopLeft,w=x.alphaTopRight,T=x.alphaBottomLeft,_=x.alphaBottomRight;else{var S=x.alpha;b=S,w=S,T=S,_=S}var E=x.scrollFactorX,C=x.scrollFactorY;f||x.blendMode===p.blendMode||x.blendMode===n.BlendModes.SKIP_CHECK||((p=c.getClone()).setBlendMode(x.blendMode),p.use()),x.setScrollFactor&&x.setScrollFactor(E*g,C*v),x.setAlpha&&x.setAlpha(b*m,w*m,T*m,_*m),x.renderWebGLStep(e,x,p,d,void 0,h,y),x.setAlpha&&x.setAlpha(b,w,T,_),x.setScrollFactor&&x.setScrollFactor(E,C)}}p!==i&&p.release()}}},55327(e,t,i){var n=i(83419),r=i(31559),s=new n({Extends:r,initialize:function(e,t,i,n,s){r.call(this,e,t,i,n),this.customContextCallback=s||null,this.addRenderStep(this.customContextRenderStep,0)},customContextRenderStep:function(e,t,i,n,r,s,a){if(void 0===r&&(r=0),t.customContextCallback){var o=i.getClone();t.customContextCallback(o),o.use(),t.renderWebGLStep(e,t,o,n,r+1,s,a),o.release()}else t.renderWebGLStep(e,t,i,n,r+1,s,a)}});e.exports=s},90255(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(55327);r.register("customContext",function(e,t){void 0===e&&(e={});var i=s(e,"x",0),r=s(e,"y",0),o=s(e,"children",null),l=s(e,"customContextCallback",void 0),h=new a(this.scene,i,r,o,l);return void 0!==t&&(e.add=t),n(this.scene,h,e),h})},4745(e,t,i){var n=i(55327);i(39429).register("customcontext",function(e,t,i,r){return this.displayList.add(new n(this.scene,e,t,i,r))})},47407(e){e.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},3069(e,t,i){var n=i(83419),r=i(31401),s=i(441),a=i(95643),o=i(41212),l=i(35846),h=i(44594),u=i(61369),c=new n({Extends:a,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Origin,r.ScrollFactor,r.Transform,r.Visible,s],initialize:function(e,t,i,n,r,s){if(a.call(this,e,"DOMElement"),this.parent=e.sys.game.domContainer,!this.parent)throw new Error("No DOM Container set in game config");this.cache=e.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new u,this.rotate3dAngle="deg",this.pointerEvents="auto",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(t,i),"string"===typeof n?"#"===n[0]?this.setElement(n.substr(1),r,s):this.createElement(n,r,s):n&&this.setElement(n,r,s),e.sys.events.on(h.SLEEP,this.handleSceneEvent,this),e.sys.events.on(h.WAKE,this.handleSceneEvent,this),e.sys.events.on(h.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(e){var t=this.node,i=t.style;t&&(i.display=e.settings.visible?"block":"none")},setSkew:function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this.skewX=e,this.skewY=t,this},setPerspective:function(e){return this.parent.style.perspective=e+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(e){this.parent.style.perspective=e+"px"}},addListener:function(e){if(this.node){e=e.split(" ");for(var t=0;t<e.length;t++)this.node.addEventListener(e[t],this.handler,!1)}return this},removeListener:function(e){if(this.node){e=e.split(" ");for(var t=0;t<e.length;t++)this.node.removeEventListener(e[t],this.handler)}return this},dispatchNativeEvent:function(e){this.emit(e.type,e)},createElement:function(e,t,i){return this.setElement(document.createElement(e),t,i)},setElement:function(e,t,i){var n;if(this.removeElement(),"string"===typeof e?("#"===e[0]&&(e=e.substr(1)),n=document.getElementById(e)):"object"===typeof e&&1===e.nodeType&&(n=e),!n)return this;if(this.node=n,t&&o(t))for(var r in t)n.style[r]=t[r];else"string"===typeof t&&(n.style=t);return n.style.zIndex="0",n.style.display="inline",n.style.position="absolute",n.phaser=this,this.parent.appendChild(n),i&&(n.innerText=i),this.updateSize()},createFromCache:function(e,t){var i=this.cache.get(e);return i&&this.createFromHTML(i,t),this},createFromHTML:function(e,t){void 0===t&&(t="div"),this.removeElement();var i=document.createElement(t);return this.node=i,i.style.zIndex="0",i.style.display="inline",i.style.position="absolute",i.phaser=this,this.parent.appendChild(i),i.innerHTML=e,this.updateSize()},removeElement:function(){return this.node&&(l(this.node),this.node=null),this},updateSize:function(){var e=this.node;return this.width=e.clientWidth,this.height=e.clientHeight,this.displayWidth=this.width*this.scaleX,this.displayHeight=this.height*this.scaleY,this},getChildByProperty:function(e,t){if(this.node)for(var i=this.node.querySelectorAll("*"),n=0;n<i.length;n++)if(i[n][e]===t)return i[n];return null},getChildByID:function(e){return this.getChildByProperty("id",e)},getChildByName:function(e){return this.getChildByProperty("name",e)},setClassName:function(e){return this.node&&(this.node.className=e,this.updateSize()),this},setText:function(e){return this.node&&(this.node.innerText=e,this.updateSize()),this},setHTML:function(e){return this.node&&(this.node.innerHTML=e,this.updateSize()),this},preRender:function(){var e=this.parentContainer,t=this.node;t&&e&&!e.willRender()&&(t.style.display="none")},willRender:function(){return!0},preDestroy:function(){this.removeElement(),this.scene.sys.events.off(h.SLEEP,this.handleSceneEvent,this),this.scene.sys.events.off(h.WAKE,this.handleSceneEvent,this),this.scene.sys.events.off(h.PRE_RENDER,this.preRender,this)}});e.exports=c},49381(e,t,i){var n=i(47407),r=i(95643),s=i(61340),a=new s,o=new s,l=new s;e.exports=function(e,t,i,s){if(t.node){i.camera&&(i=i.camera);var h=t.node.style,u=t.scene.sys.settings;if(!h||!u.visible||r.RENDER_MASK!==t.renderFlags||0!==t.cameraFilter&&t.cameraFilter&i.id||t.parentContainer&&!t.parentContainer.willRender())h.display="none";else{var c=t.parentContainer,d=i.alpha*t.alpha;c&&(d*=c.alpha);var f=a,p=o,m=l,g=t.width*t.originX,v=t.height*t.originY,y="0%",x="0%";f.copyWithScrollFactorFrom(i.matrix,i.scrollX,i.scrollY,t.scrollFactorX,t.scrollFactorY),s?(f.multiply(s),g*=t.scaleX,v*=t.scaleY):(y=100*t.originX+"%",x=100*t.originY+"%"),f.translate(-g,-v),p.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),f.multiply(p,m),t.transformOnly||(h.display="block",h.opacity=d,h.zIndex=t._depth,h.pointerEvents=t.pointerEvents,h.mixBlendMode=n[t._blendMode]),h.transform=m.getCSSMatrix()+" skew("+t.skewX+"rad, "+t.skewY+"rad) rotate3d("+t.rotate3d.x+","+t.rotate3d.y+","+t.rotate3d.z+","+t.rotate3d.w+t.rotate3dAngle+")",h.transformOrigin=y+" "+x}}}},2611(e,t,i){var n=i(3069);i(39429).register("dom",function(e,t,i,r,s){var a=new n(this.scene,e,t,i,r,s);return this.displayList.add(a),a})},441(e,t,i){var n=i(29747),r=n,s=n;r=i(49381),s=i(49381),e.exports={renderWebGL:r,renderCanvas:s}},62980(e){e.exports="addedtoscene"},41337(e){e.exports="destroy"},44947(e){e.exports="removedfromscene"},49358(e){e.exports="complete"},35163(e){e.exports="created"},97249(e){e.exports="error"},19483(e){e.exports="locked"},56059(e){e.exports="loop"},26772(e){e.exports="metadata"},64437(e){e.exports="playing"},83411(e){e.exports="play"},75780(e){e.exports="seeked"},67799(e){e.exports="seeking"},63500(e){e.exports="stalled"},55541(e){e.exports="stop"},53208(e){e.exports="textureready"},4992(e){e.exports="unlocked"},12(e){e.exports="unsupported"},51708(e,t,i){e.exports={ADDED_TO_SCENE:i(62980),DESTROY:i(41337),REMOVED_FROM_SCENE:i(44947),VIDEO_COMPLETE:i(49358),VIDEO_CREATED:i(35163),VIDEO_ERROR:i(97249),VIDEO_LOCKED:i(19483),VIDEO_LOOP:i(56059),VIDEO_METADATA:i(26772),VIDEO_PLAY:i(83411),VIDEO_PLAYING:i(64437),VIDEO_SEEKED:i(75780),VIDEO_SEEKING:i(67799),VIDEO_STALLED:i(63500),VIDEO_STOP:i(55541),VIDEO_TEXTURE:i(53208),VIDEO_UNLOCKED:i(4992),VIDEO_UNSUPPORTED:i(12)}},42421(e,t,i){var n=i(83419),r=i(31401),s=i(95643),a=i(64993),o=new n({Extends:s,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.Origin,r.ScrollFactor,r.Size,r.Texture,r.Tint,r.Transform,r.Visible,a],initialize:function(e){s.call(this,e,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});e.exports=o},70217(){},56315(e,t,i){var n=i(42421);i(39429).register("extern",function(){var e=new n(this.scene);return this.displayList.add(e),e})},64993(e,t,i){var n=i(29747),r=n,s=n;r=i(80287),s=i(70217),e.exports={renderWebGL:r,renderCanvas:s}},80287(e,t,i){var n=i(91296);e.exports=function(e,t,i,r,s,a,o){e.renderNodes.getNode("YieldContext").run(i);var l=n(t,i.camera,r,!i.useCanvas).calc;t.render.call(t,e,i,l,a,o),e.renderNodes.getNode("RebindContext").run(i)}},34637(e,t,i){var n=i(73043),r=i(26099),s=i(41509),a=i(68589),o=i(83419),l=i(20071),h=new o({Extends:l,initialize:function(e,t,i,o,h,u){t||(t={});var c={name:"gradient",fragmentSource:s,shaderAdditions:[{name:"RAMP_0",tags:"RAMP",additions:{fragmentHeader:a}}],initialUniforms:{uRampTexture:0},setupUniforms:this._setupUniforms,updateShaderConfig:this._updateShaderConfig};if(l.call(this,e,c,i,o,h,u),this.type="Gradient",this.ramp=new n(this.scene,t.bands||{colorStart:0,colorEnd:16777215}),this.offset=t.offset||0,this.repeatMode=t.repeatMode||0,this.shapeMode=t.shapeMode||0,this.start=new r(0,0),t.start&&this.start.copy(t.start),this.shape=new r(1,0),t.shape)this.shape.copy(t.shape);else{var d=void 0===t.length?1:t.length,f=t.direction||0;this.shape.setTo(d*Math.cos(f),d*Math.sin(f))}this.dither=!!t.dither,this.setTextures([this.ramp.dataTexture])},_setupUniforms:function(e,t){e("uRampResolution",this.ramp.dataTextureResolution),e("uRampBandStart",this.ramp.dataTextureFirstBand),e("uOffset",this.offset),e("uRepeatMode",this.repeatMode),e("uShapeMode",this.shapeMode),e("uStart",[this.start.x,1-this.start.y]),e("uShape",[this.shape.x,-this.shape.y]),e("uDither",this.dither)},_updateShaderConfig:function(e,t,i){var n=t.ramp.bandTreeDepth,r=i.programManager.getAdditionsByTag("RAMP")[0];r.name="RAMP_"+n,r.additions.fragmentHeader=a.replace("#define BAND_TREE_DEPTH 0.0","#define BAND_TREE_DEPTH "+n+".0")},preDestroy:function(){this.ramp.destroy(),l.prototype.preDestroy.call(this)}});e.exports=h},26353(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(34637);r.register("gradient",function(e,t){void 0===e&&(e={});var i=s(e,"config",null),r=s(e,"x",0),o=s(e,"y",0),l=s(e,"width",128),h=s(e,"height",128),u=new a(this.scene,i,r,o,l,h);return void 0!==t&&(e.add=t),n(this.scene,u,e),u})},69315(e,t,i){var n=i(34637);i(39429).register("gradient",function(e,t,i,r,s){return this.displayList.add(new n(this.scene,e,t,i,r,s))})},85592(e){e.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(e,t,i){var n=i(71911),r=i(83419),s=i(85592),a=i(31401),o=i(8497),l=i(95643),h=i(87891),u=i(95540),c=i(35154),d=i(36383),f=i(84503),p=new r({Extends:l,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Lighting,a.Mask,a.RenderNodes,a.Transform,a.Visible,a.ScrollFactor,f],initialize:function(e,t){var i=c(t,"x",0),n=c(t,"y",0);l.call(this,e,"Graphics"),this.setPosition(i,n),this.initRenderNodes(this._defaultRenderNodesMap),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.pathDetailThreshold=-1,this.lineStyle(1,0,0),this.fillStyle(0,0),this.setDefaultStyles(t)},_defaultRenderNodesMap:{get:function(){return h}},setDefaultStyles:function(e){return c(e,"lineStyle",null)&&(this.defaultStrokeWidth=c(e,"lineStyle.width",1),this.defaultStrokeColor=c(e,"lineStyle.color",16777215),this.defaultStrokeAlpha=c(e,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),c(e,"fillStyle",null)&&(this.defaultFillColor=c(e,"fillStyle.color",16777215),this.defaultFillAlpha=c(e,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(e,t,i){return void 0===i&&(i=1),this.commandBuffer.push(s.LINE_STYLE,e,t,i),this._lineWidth=e,this},fillStyle:function(e,t){return void 0===t&&(t=1),this.commandBuffer.push(s.FILL_STYLE,e,t),this},fillGradientStyle:function(e,t,i,n,r,a,o,l){return void 0===r&&(r=1),void 0===a&&(a=r),void 0===o&&(o=r),void 0===l&&(l=r),this.commandBuffer.push(s.GRADIENT_FILL_STYLE,r,a,o,l,e,t,i,n),this},lineGradientStyle:function(e,t,i,n,r,a){return void 0===a&&(a=1),this.commandBuffer.push(s.GRADIENT_LINE_STYLE,e,a,t,i,n,r),this},beginPath:function(){return this.commandBuffer.push(s.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(s.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(s.FILL_PATH),this},fill:function(){return this.commandBuffer.push(s.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(s.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(s.STROKE_PATH),this},fillCircleShape:function(e){return this.fillCircle(e.x,e.y,e.radius)},strokeCircleShape:function(e){return this.strokeCircle(e.x,e.y,e.radius)},fillCircle:function(e,t,i){return this.beginPath(),this.arc(e,t,i,0,d.TAU),this.fillPath(),this},strokeCircle:function(e,t,i){return this.beginPath(),this.arc(e,t,i,0,d.TAU),this.strokePath(),this},fillRectShape:function(e){return this.fillRect(e.x,e.y,e.width,e.height)},strokeRectShape:function(e){return this.strokeRect(e.x,e.y,e.width,e.height)},fillRect:function(e,t,i,n){return this.commandBuffer.push(s.FILL_RECT,e,t,i,n),this},strokeRect:function(e,t,i,n){var r=this._lineWidth/2,s=e-r,a=e+r;return this.beginPath(),this.moveTo(e,t),this.lineTo(e,t+n),this.strokePath(),this.beginPath(),this.moveTo(e+i,t),this.lineTo(e+i,t+n),this.strokePath(),this.beginPath(),this.moveTo(s,t),this.lineTo(a+i,t),this.strokePath(),this.beginPath(),this.moveTo(s,t+n),this.lineTo(a+i,t+n),this.strokePath(),this},fillRoundedRect:function(e,t,i,n,r){void 0===r&&(r=20);var s=r,a=r,o=r,l=r;"number"!==typeof r&&(s=u(r,"tl",20),a=u(r,"tr",20),o=u(r,"bl",20),l=u(r,"br",20));var h=s>=0,c=a>=0,f=o>=0,p=l>=0;return s=Math.abs(s),a=Math.abs(a),o=Math.abs(o),l=Math.abs(l),this.beginPath(),this.moveTo(e+s,t),this.lineTo(e+i-a,t),c?this.arc(e+i-a,t+a,a,-d.PI_OVER_2,0):this.arc(e+i,t,a,Math.PI,d.PI_OVER_2,!0),this.lineTo(e+i,t+n-l),p?this.arc(e+i-l,t+n-l,l,0,d.PI_OVER_2):this.arc(e+i,t+n,l,-d.PI_OVER_2,Math.PI,!0),this.lineTo(e+o,t+n),f?this.arc(e+o,t+n-o,o,d.PI_OVER_2,Math.PI):this.arc(e,t+n,o,0,-d.PI_OVER_2,!0),this.lineTo(e,t+s),h?this.arc(e+s,t+s,s,-Math.PI,-d.PI_OVER_2):this.arc(e,t,s,d.PI_OVER_2,0,!0),this.fillPath(),this},strokeRoundedRect:function(e,t,i,n,r){void 0===r&&(r=20);var s=r,a=r,o=r,l=r,h=Math.min(i,n)/2;"number"!==typeof r&&(s=u(r,"tl",20),a=u(r,"tr",20),o=u(r,"bl",20),l=u(r,"br",20));var c=s>=0,f=a>=0,p=o>=0,m=l>=0;return s=Math.min(Math.abs(s),h),a=Math.min(Math.abs(a),h),o=Math.min(Math.abs(o),h),l=Math.min(Math.abs(l),h),this.beginPath(),this.moveTo(e+s,t),this.lineTo(e+i-a,t),this.moveTo(e+i-a,t),f?this.arc(e+i-a,t+a,a,-d.PI_OVER_2,0):this.arc(e+i,t,a,Math.PI,d.PI_OVER_2,!0),this.lineTo(e+i,t+n-l),this.moveTo(e+i,t+n-l),m?this.arc(e+i-l,t+n-l,l,0,d.PI_OVER_2):this.arc(e+i,t+n,l,-d.PI_OVER_2,Math.PI,!0),this.lineTo(e+o,t+n),this.moveTo(e+o,t+n),p?this.arc(e+o,t+n-o,o,d.PI_OVER_2,Math.PI):this.arc(e,t+n,o,0,-d.PI_OVER_2,!0),this.lineTo(e,t+s),this.moveTo(e,t+s),c?this.arc(e+s,t+s,s,-Math.PI,-d.PI_OVER_2):this.arc(e,t,s,d.PI_OVER_2,0,!0),this.strokePath(),this},fillPointShape:function(e,t){return this.fillPoint(e.x,e.y,t)},fillPoint:function(e,t,i){return!i||i<1?i=1:(e-=i/2,t-=i/2),this.commandBuffer.push(s.FILL_RECT,e,t,i,i),this},fillTriangleShape:function(e){return this.fillTriangle(e.x1,e.y1,e.x2,e.y2,e.x3,e.y3)},strokeTriangleShape:function(e){return this.strokeTriangle(e.x1,e.y1,e.x2,e.y2,e.x3,e.y3)},fillTriangle:function(e,t,i,n,r,a){return this.commandBuffer.push(s.FILL_TRIANGLE,e,t,i,n,r,a),this},strokeTriangle:function(e,t,i,n,r,a){return this.commandBuffer.push(s.STROKE_TRIANGLE,e,t,i,n,r,a),this},strokeLineShape:function(e){return this.lineBetween(e.x1,e.y1,e.x2,e.y2)},lineBetween:function(e,t,i,n){return this.beginPath(),this.moveTo(e,t),this.lineTo(i,n),this.strokePath(),this},lineTo:function(e,t){return this.commandBuffer.push(s.LINE_TO,e,t),this},moveTo:function(e,t){return this.commandBuffer.push(s.MOVE_TO,e,t),this},strokePoints:function(e,t,i,n){void 0===t&&(t=!1),void 0===i&&(i=!1),void 0===n&&(n=e.length),this.beginPath(),this.moveTo(e[0].x,e[0].y);for(var r=1;r<n;r++)this.lineTo(e[r].x,e[r].y);return t&&this.lineTo(e[0].x,e[0].y),i&&this.closePath(),this.strokePath(),this},fillPoints:function(e,t,i,n){void 0===t&&(t=!1),void 0===i&&(i=!1),void 0===n&&(n=e.length),this.beginPath(),this.moveTo(e[0].x,e[0].y);for(var r=1;r<n;r++)this.lineTo(e[r].x,e[r].y);return t&&this.lineTo(e[0].x,e[0].y),i&&this.closePath(),this.fillPath(),this},strokeEllipseShape:function(e,t){void 0===t&&(t=32);var i=e.getPoints(t);return this.strokePoints(i,!0)},strokeEllipse:function(e,t,i,n,r){void 0===r&&(r=32);var s=new o(e,t,i,n).getPoints(r);return this.strokePoints(s,!0)},fillEllipseShape:function(e,t){void 0===t&&(t=32);var i=e.getPoints(t);return this.fillPoints(i,!0)},fillEllipse:function(e,t,i,n,r){void 0===r&&(r=32);var s=new o(e,t,i,n).getPoints(r);return this.fillPoints(s,!0)},arc:function(e,t,i,n,r,a,o){return void 0===a&&(a=!1),void 0===o&&(o=0),this.commandBuffer.push(s.ARC,e,t,i,n,r,a,o),this},slice:function(e,t,i,n,r,a,o){return void 0===a&&(a=!1),void 0===o&&(o=0),this.commandBuffer.push(s.BEGIN_PATH),this.commandBuffer.push(s.MOVE_TO,e,t),this.commandBuffer.push(s.ARC,e,t,i,n,r,a,o),this.commandBuffer.push(s.CLOSE_PATH),this},save:function(){return this.commandBuffer.push(s.SAVE),this},restore:function(){return this.commandBuffer.push(s.RESTORE),this},translateCanvas:function(e,t){return this.commandBuffer.push(s.TRANSLATE,e,t),this},scaleCanvas:function(e,t){return this.commandBuffer.push(s.SCALE,e,t),this},rotateCanvas:function(e){return this.commandBuffer.push(s.ROTATE,e),this},clear:function(){return this.commandBuffer.length=0,this.defaultFillColor>-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(e,t,i){var n,r,s=this.scene.sys,a=s.game.renderer;void 0===t&&(t=s.scale.width),void 0===i&&(i=s.scale.height),p.TargetCamera.setScene(this.scene),p.TargetCamera.setViewport(0,0,t,i),p.TargetCamera.scrollX=this.x,p.TargetCamera.scrollY=this.y;var o={willReadFrequently:!0};if("string"===typeof e)if(s.textures.exists(e)){var l=(n=s.textures.get(e)).getSourceImage();l instanceof HTMLCanvasElement&&(r=l.getContext("2d",o))}else r=(n=s.textures.createCanvas(e,t,i)).getSourceImage().getContext("2d",o);else e instanceof HTMLCanvasElement&&(r=e.getContext("2d",o));return r&&(this.renderCanvas(a,this,p.TargetCamera,null,r,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});p.TargetCamera=new n,e.exports=p},32768(e,t,i){var n=i(85592),r=i(20926);e.exports=function(e,t,i,s,a,o){var l=t.commandBuffer,h=l.length,u=a||e.currentContext;if(0!==h&&r(e,u,t,i,s)){i.addToRenderList(t);var c=1,d=1,f=0,p=0,m=1,g=0,v=0,y=0;u.beginPath();for(var x=0;x<h;++x){switch(l[x]){case n.ARC:u.arc(l[x+1],l[x+2],l[x+3],l[x+4],l[x+5],l[x+6]),x+=7;break;case n.LINE_STYLE:m=l[x+1],f=l[x+2],c=l[x+3],g=(16711680&f)>>>16,v=(65280&f)>>>8,y=255&f,u.strokeStyle="rgba("+g+","+v+","+y+","+c+")",u.lineWidth=m,x+=3;break;case n.FILL_STYLE:p=l[x+1],d=l[x+2],g=(16711680&p)>>>16,v=(65280&p)>>>8,y=255&p,u.fillStyle="rgba("+g+","+v+","+y+","+d+")",x+=2;break;case n.BEGIN_PATH:u.beginPath();break;case n.CLOSE_PATH:u.closePath();break;case n.FILL_PATH:o||u.fill();break;case n.STROKE_PATH:o||u.stroke();break;case n.FILL_RECT:o?u.rect(l[x+1],l[x+2],l[x+3],l[x+4]):u.fillRect(l[x+1],l[x+2],l[x+3],l[x+4]),x+=4;break;case n.FILL_TRIANGLE:u.beginPath(),u.moveTo(l[x+1],l[x+2]),u.lineTo(l[x+3],l[x+4]),u.lineTo(l[x+5],l[x+6]),u.closePath(),o||u.fill(),x+=6;break;case n.STROKE_TRIANGLE:u.beginPath(),u.moveTo(l[x+1],l[x+2]),u.lineTo(l[x+3],l[x+4]),u.lineTo(l[x+5],l[x+6]),u.closePath(),o||u.stroke(),x+=6;break;case n.LINE_TO:u.lineTo(l[x+1],l[x+2]),x+=2;break;case n.MOVE_TO:u.moveTo(l[x+1],l[x+2]),x+=2;break;case n.LINE_FX_TO:u.lineTo(l[x+1],l[x+2]),x+=5;break;case n.MOVE_FX_TO:u.moveTo(l[x+1],l[x+2]),x+=5;break;case n.SAVE:u.save();break;case n.RESTORE:u.restore();break;case n.TRANSLATE:u.translate(l[x+1],l[x+2]),x+=2;break;case n.SCALE:u.scale(l[x+1],l[x+2]),x+=2;break;case n.ROTATE:u.rotate(l[x+1]),x+=1;break;case n.GRADIENT_FILL_STYLE:x+=5;break;case n.GRADIENT_LINE_STYLE:x+=6}}u.restore()}}},87079(e,t,i){var n=i(44603),r=i(43831);n.register("graphics",function(e,t){void 0===e&&(e={}),void 0!==t&&(e.add=t);var i=new r(this.scene,e);return e.add&&this.scene.sys.displayList.add(i),i})},1201(e,t,i){var n=i(43831);i(39429).register("graphics",function(e){return this.displayList.add(new n(this.scene,e))})},84503(e,t,i){var n=i(29747),r=n,s=n;r=i(77545),s=i(32768),s=i(32768),e.exports={renderWebGL:r,renderCanvas:s}},77545(e,t,i){var n=i(85592),r=i(91296),s=i(70554),a=i(61340),o=function(e,t,i){this.x=e,this.y=t,this.width=i},l=function(e,t,i){this.points=[],this.points[0]=new o(e,t,i),this.addPoint=function(e,t,i){var n=this.points[this.points.length-1];n.x===e&&n.y===t||this.points.push(new o(e,t,i))}},h=[],u=new a,c=new a,d={TL:0,TR:0,BL:0,BR:0},f={TL:0,TR:0,BL:0,BR:0},p=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}];e.exports=function(e,t,i,a){if(0!==t.commandBuffer.length){var o=t.customRenderNodes,m=t.defaultRenderNodes,g=o.Submitter||m.Submitter,v=t.lighting,y=i,x=y.camera;x.addToRenderList(t);for(var b=r(t,x,a,!i.useCanvas).calc,w=u.loadIdentity(),T=t.commandBuffer,_=t.alpha,S=Math.max(t.pathDetailThreshold,e.config.pathDetailThreshold,0),E=1,C=0,A=0,k=0,R=2*Math.PI,O=[],P=0,M=!0,N=null,I=s.getTintAppendFloatAlpha,L=0;L<T.length;L++)switch(T[L]){case n.BEGIN_PATH:O.length=0,N=null,M=!0;break;case n.CLOSE_PATH:M=!1,N&&N.points.length&&N.points.push(N.points[0]);break;case n.FILL_PATH:for(b.multiply(w,c),P=0;P<O.length;P++)(o.FillPath||m.FillPath).run(y,c,g,O[P].points,d.TL,d.TR,d.BL,S,v);break;case n.STROKE_PATH:for(b.multiply(w,c),P=0;P<O.length;P++)(o.StrokePath||m.StrokePath).run(y,g,O[P].points,E,M,c,f.TL,f.TR,f.BL,f.BR,S,v);break;case n.LINE_STYLE:E=T[++L];var D=I(T[++L],T[++L]*_);f.TL=D,f.TR=D,f.BL=D,f.BR=D;break;case n.FILL_STYLE:var F=I(T[++L],T[++L]*_);d.TL=F,d.TR=F,d.BL=F,d.BR=F;break;case n.GRADIENT_FILL_STYLE:var B=T[++L]*_,U=T[++L]*_,z=T[++L]*_,V=T[++L]*_;d.TL=I(T[++L],B),d.TR=I(T[++L],U),d.BL=I(T[++L],z),d.BR=I(T[++L],V);break;case n.GRADIENT_LINE_STYLE:E=T[++L];var H=T[++L]*_;f.TL=I(T[++L],H),f.TR=I(T[++L],H),f.BL=I(T[++L],H),f.BR=I(T[++L],H);break;case n.ARC:var j=0,Y=T[++L],W=T[++L],G=T[++L],X=T[++L],q=T[++L],K=T[++L],Q=T[++L];for(q-=X,K?q<-R?q=-R:q>0&&(q=q%R-R):q>R?q=R:q<0&&(q=R+q%R),null===N&&(N=new l(Y+Math.cos(X)*G,W+Math.sin(X)*G,E),O.push(N),j+=.01);j<1+Q;)k=q*j+X,C=Y+Math.cos(k)*G,A=W+Math.sin(k)*G,N.addPoint(C,A,E),j+=.01;k=q+X,C=Y+Math.cos(k)*G,A=W+Math.sin(k)*G,N.addPoint(C,A,E);break;case n.FILL_RECT:b.multiply(w,c),(o.FillRect||m.FillRect).run(y,c,g,T[++L],T[++L],T[++L],T[++L],d.TL,d.TR,d.BL,d.BR,v);break;case n.FILL_TRIANGLE:b.multiply(w,c),(o.FillTri||m.FillTri).run(y,c,g,T[++L],T[++L],T[++L],T[++L],T[++L],T[++L],d.TL,d.TR,d.BL,v);break;case n.STROKE_TRIANGLE:b.multiply(w,c),p[0].x=T[++L],p[0].y=T[++L],p[0].width=E,p[1].x=T[++L],p[1].y=T[++L],p[1].width=E,p[2].x=T[++L],p[2].y=T[++L],p[2].width=E,p[3].x=p[0].x,p[3].y=p[0].y,p[3].width=E,(o.StrokePath||m.StrokePath).run(y,g,p,E,!1,c,f.TL,f.TR,f.BL,f.BR,v);break;case n.LINE_TO:Y=T[++L],W=T[++L],null!==N?N.addPoint(Y,W,E):(N=new l(Y,W,E),O.push(N));break;case n.MOVE_TO:N=new l(T[++L],T[++L],E),O.push(N);break;case n.SAVE:h.push(w.copyToArray());break;case n.RESTORE:w.copyFromArray(h.pop());break;case n.TRANSLATE:Y=T[++L],W=T[++L],w.translate(Y,W);break;case n.SCALE:Y=T[++L],W=T[++L],w.scale(Y,W);break;case n.ROTATE:w.rotate(T[++L])}}}},26479(e,t,i){var n=i(61061),r=i(83419),s=i(51708),a=i(50792),o=i(46710),l=i(95540),h=i(35154),u=i(97022),c=i(41212),d=i(88492),f=i(68287),p=new r({Extends:a,initialize:function(e,t,i){a.call(this),i?t&&!Array.isArray(t)&&(t=[t]):Array.isArray(t)?c(t[0])&&(i=t,t=null):c(t)&&(i=t,t=null),this.scene=e,this.children=new Set,this.isParent=!0,this.type="Group",this.classType=l(i,"classType",f),this.name=l(i,"name",""),this.active=l(i,"active",!0),this.maxSize=l(i,"maxSize",-1),this.defaultKey=l(i,"defaultKey",null),this.defaultFrame=l(i,"defaultFrame",null),this.runChildUpdate=l(i,"runChildUpdate",!1),this.createCallback=l(i,"createCallback",null),this.removeCallback=l(i,"removeCallback",null),this.createMultipleCallback=l(i,"createMultipleCallback",null),this.internalCreateCallback=l(i,"internalCreateCallback",null),this.internalRemoveCallback=l(i,"internalRemoveCallback",null),t&&this.addMultiple(t),i&&this.createMultiple(i),this.on(s.ADDED_TO_SCENE,this.addedToScene,this),this.on(s.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(e,t,i,n,r,s){if(void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===r&&(r=!0),void 0===s&&(s=!0),this.isFull())return null;var a=new this.classType(this.scene,e,t,i,n);return a.addToDisplayList(this.scene.sys.displayList),a.addToUpdateList(),a.visible=r,a.setActive(s),this.add(a),a},createMultiple:function(e){if(this.isFull())return[];Array.isArray(e)||(e=[e]);var t=[];if(e[0].key)for(var i=0;i<e.length;i++){var n=this.createFromConfig(e[i]);t=t.concat(n)}return t},createFromConfig:function(e){if(this.isFull())return[];this.classType=l(e,"classType",this.classType);var t=l(e,"key",void 0),i=l(e,"frame",null),r=l(e,"visible",!0),s=l(e,"active",!0),a=[];if(void 0===t)return a;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);var o=l(e,"repeat",0),c=l(e,"randomKey",!1),f=l(e,"randomFrame",!1),p=l(e,"y
2oyo",!1),m=l(e,"quantity",!1),g=l(e,"frameQuantity",1),v=l(e,"max",0),y=d(t,i,{max:v,qty:m||g,random:c,randomB:f,repeat:o,yoyo:p});e.createCallback&&(this.createCallback=e.createCallback),e.removeCallback&&(this.removeCallback=e.removeCallback),e.internalCreateCallback&&(this.internalCreateCallback=e.internalCreateCallback),e.internalRemoveCallback&&(this.internalRemoveCallback=e.internalRemoveCallback);for(var x=0;x<y.length;x++){var b=this.create(0,0,y[x].a,y[x].b,r,s);if(!b)break;a.push(b)}if(u(e,"setXY")){var w=h(e,"setXY.x",0),T=h(e,"setXY.y",0),_=h(e,"setXY.stepX",0),S=h(e,"setXY.stepY",0);n.SetXY(a,w,T,_,S)}if(u(e,"setRotation")){var E=h(e,"setRotation.value",0),C=h(e,"setRotation.step",0);n.SetRotation(a,E,C)}if(u(e,"setScale")){var A=h(e,"setScale.x",1),k=h(e,"setScale.y",A),R=h(e,"setScale.stepX",0),O=h(e,"setScale.stepY",0);n.SetScale(a,A,k,R,O)}if(u(e,"setOrigin")){var P=h(e,"setOrigin.x",.5),M=h(e,"setOrigin.y",P),N=h(e,"setOrigin.stepX",0),I=h(e,"setOrigin.stepY",0);n.SetOrigin(a,P,M,N,I)}if(u(e,"setAlpha")){var L=h(e,"setAlpha.value",1),D=h(e,"setAlpha.step",0);n.SetAlpha(a,L,D)}if(u(e,"setDepth")){var F=h(e,"setDepth.value",0),B=h(e,"setDepth.step",0);n.SetDepth(a,F,B)}if(u(e,"setScrollFactor")){var U=h(e,"setScrollFactor.x",1),z=h(e,"setScrollFactor.y",U),V=h(e,"setScrollFactor.stepX",0),H=h(e,"setScrollFactor.stepY",0);n.SetScrollFactor(a,U,z,V,H)}var j=l(e,"hitArea",null),Y=l(e,"hitAreaCallback",null);j&&n.SetHitArea(a,j,Y);var W=l(e,"gridAlign",!1);return W&&n.GridAlign(a,W),this.createMultipleCallback&&this.createMultipleCallback.call(this,a),a},preUpdate:function(e,t){this.runChildUpdate&&0!==this.children.size&&this.children.forEach(function(i){i.active&&i.update(e,t)})},add:function(e,t){return void 0===t&&(t=!1),this.isFull()||(this.children.add(e),this.internalCreateCallback&&this.internalCreateCallback.call(this,e),this.createCallback&&this.createCallback.call(this,e),t&&(e.addToDisplayList(this.scene.sys.displayList),e.addToUpdateList()),e.on(s.DESTROY,this.remove,this)),this},addMultiple:function(e,t){if(void 0===t&&(t=!1),Array.isArray(e))for(var i=0;i<e.length;i++)this.add(e[i],t);return this},remove:function(e,t,i){return void 0===t&&(t=!1),void 0===i&&(i=!1),this.children.has(e)?(this.children.delete(e),this.internalRemoveCallback&&this.internalRemoveCallback.call(this,e),this.removeCallback&&this.removeCallback.call(this,e),e.off(s.DESTROY,this.remove,this),i?e.destroy():t&&(e.removeFromDisplayList(),e.removeFromUpdateList()),this):this},clear:function(e,t){void 0===e&&(e=!1),void 0===t&&(t=!1);var i=this.children;return i.forEach(function(i){i.off(s.DESTROY,this.remove,this),t?i.destroy():e&&(i.removeFromDisplayList(),i.removeFromUpdateList())},this),i.clear(),this},contains:function(e){return this.children.has(e)},getChildren:function(){return Array.from(this.children)},getLength:function(){return this.children.size},getMatching:function(e,t,i,n){return o(Array.from(this.children),e,t,i,n)},getFirst:function(e,t,i,n,r,s,a){return this.getHandler(!0,1,e,t,i,n,r,s,a)},getFirstNth:function(e,t,i,n,r,s,a,o){return this.getHandler(!0,e,t,i,n,r,s,a,o)},getLast:function(e,t,i,n,r,s,a){return this.getHandler(!1,1,e,t,i,n,r,s,a)},getLastNth:function(e,t,i,n,r,s,a,o){return this.getHandler(!1,e,t,i,n,r,s,a,o)},getHandler:function(e,t,i,n,r,s,a,o,l){var h,u;void 0===i&&(i=!1),void 0===n&&(n=!1);var c=0,d=Array.from(this.children);if(e)for(u=0;u<d.length;u++)if((h=d[u]).active===i){if(++c===t)break}else h=null;else for(u=d.length-1;u>=0;u--)if((h=d[u]).active===i){if(++c===t)break}else h=null;return h?("number"===typeof r&&(h.x=r),"number"===typeof s&&(h.y=s),h):n?this.create(r,s,a,o,l):null},get:function(e,t,i,n,r){return this.getFirst(!1,!0,e,t,i,n,r)},getFirstAlive:function(e,t,i,n,r,s){return this.getFirst(!0,e,t,i,n,r,s)},getFirstDead:function(e,t,i,n,r,s){return this.getFirst(!1,e,t,i,n,r,s)},playAnimation:function(e,t){return n.PlayAnimation(Array.from(this.children),e,t),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(e){void 0===e&&(e=!0);var t=0;
vendor: 26,582 bytes, line 2
2return this.children.forEach(function(i){i.active===e&&t++}),t},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var e=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-e},setActive:function(e){return this.active=e,this},setName:function(e){return this.name=e,this},propertyValueSet:function(e,t,i,r,s){return n.PropertyValueSet(Array.from(this.children),e,t,i,r,s),this},propertyValueInc:function(e,t,i,r,s){return n.PropertyValueInc(Array.from(this.children),e,t,i,r,s),this},setX:function(e,t){return n.SetX(Array.from(this.children),e,t),this},setY:function(e,t){return n.SetY(Array.from(this.children),e,t),this},setXY:function(e,t,i,r){return n.SetXY(Array.from(this.children),e,t,i,r),this},incX:function(e,t){return n.IncX(Array.from(this.children),e,t),this},incY:function(e,t){return n.IncY(Array.from(this.children),e,t),this},incXY:function(e,t,i,r){return n.IncXY(Array.from(this.children),e,t,i,r),this},shiftPosition:function(e,t,i){return n.ShiftPosition(Array.from(this.children),e,t,i),this},angle:function(e,t){return n.Angle(Array.from(this.children),e,t),this},rotate:function(e,t){return n.Rotate(Array.from(this.children),e,t),this},rotateAround:function(e,t){return n.RotateAround(Array.from(this.children),e,t),this},rotateAroundDistance:function(e,t,i){return n.RotateAroundDistance(Array.from(this.children),e,t,i),this},setAlpha:function(e,t){return n.SetAlpha(Array.from(this.children),e,t),this},setTint:function(e,t,i,r){return n.SetTint(Array.from(this.children),e,t,i,r),this},setOrigin:function(e,t,i,r){return n.SetOrigin(Array.from(this.children),e,t,i,r),this},scaleX:function(e,t){return n.ScaleX(Array.from(this.children),e,t),this},scaleY:function(e,t){return n.ScaleY(Array.from(this.children),e,t),this},scaleXY:function(e,t,i,r){return n.ScaleXY(Array.from(this.children),e,t,i,r),this},setDepth:function(e,t){return n.SetDepth(Array.from(this.children),e,t),this},setBlendMode:function(e){return n.SetBlendMode(Array.from(this.children),e),this},setHitArea:function(e,t){return n.SetHitArea(Array.from(this.children),e,t),this},shuffle:function(){return n.Shuffle(Array.from(this.children)),this},kill:function(e){this.children.has(e)&&e.setActive(!1)},killAndHide:function(e){this.children.has(e)&&(e.setActive(!1),e.setVisible(!1))},setVisible:function(e,t,i){return n.SetVisible(Array.from(this.children),e,t,i),this},toggleVisible:function(){return n.ToggleVisible(Array.from(this.children)),this},destroy:function(e,t){void 0===e&&(e=!1),void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy&&(this.emit(s.DESTROY,this),this.removeAllListeners(),this.scene.sys.updateList.remove(this),this.clear(t,e),this.scene=void 0,this.children=void 0)}});e.exports=p},94975(e,t,i){var n=i(44603),r=i(26479);n.register("group",function(e){return new r(this.scene,null,e)})},3385(e,t,i){var n=i(26479);i(39429).register("group",function(e,t){return this.updateList.add(new n(this.scene,e,t))})},88571(e,t,i){var n=i(40939),r=i(83419),s=i(31401),a=i(95643),o=i(59819),l=new r({Extends:a,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Lighting,s.Mask,s.Origin,s.RenderNodes,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(e,t,i,n,r){a.call(this,e,"Image"),this._crop=this.resetCropObject(),this.setTexture(n,r),this.setPosition(t,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return n}}});e.exports=l},40652(e){e.exports=function(e,t,i,n){i.addToRenderList(t),e.batchSprite(t,t.frame,i,n)}},82459(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(88571);r.register("image",function(e,t){void 0===e&&(e={});var i=s(e,"key",null),r=s(e,"frame",null),o=new a(this.scene,0,0,i,r);return void 0!==t&&(e.add=t),n(this.scene,o,e),o})},2117(e,t,i){var n=i(88571);i(39429).register("image",function(e,t,i,r){return this.displayList.add(new n(this.scene,e,t,i,r))})},59819(e,t,i){var n=i(29747),r=n,s=n;r=i(99517),s=i(40652),e.exports={renderWebGL:r,renderCanvas:s}},99517(e){e.exports=function(e,t,i,n){i.camera.addToRenderList(t);var r=t.customRenderNodes,s=t.defaultRenderNodes;(r.Submitter||s.Submitter).run(i,t,n,0,r.Texturer||s.Texturer,r.Transformer||s.Transformer)}},77856(e,t,i){var n={Events:i(51708),DisplayList:i(8050),GameObjectCreator:i(44603),GameObjectFactory:i(39429),UpdateList:i(45027),Components:i(31401),GetCalcMatrix:i(91296),BuildGameObject:i(25305),BuildGameObjectAnimation:i(13059),GameObject:i(95643),BitmapText:i(22186),Blitter:i(6107),Bob:i(46590),Container:i(31559),DOMElement:i(3069),DynamicBitmapText:i(2638),Extern:i(42421),Graphics:i(43831),Group:i(26479),Image:i(88571),Layer:i(93595),Particles:i(18404),PathFollower:i(1159),RenderTexture:i(591),RetroFont:i(196),Rope:i(77757),Sprite:i(68287),Stamp:i(14727),Text:i(50171),GetTextSize:i(14220),MeasureText:i(79557),TextStyle:i(35762),TileSprite:i(20839),Zone:i(41481),Video:i(18471),Shape:i(17803),Arc:i(23629),Curve:i(89),Ellipse:i(19921),Grid:i(30479),IsoBox:i(61475),IsoTriangle:i(16933),Line:i(57847),Polygon:i(24949),Rectangle:i(74561),Star:i(55911),Triangle:i(36931),Factories:{Blitter:i(12709),Container:i(24961),DOMElement:i(2611),DynamicBitmapText:i(72566),Extern:i(56315),Graphics:i(1201),Group:i(3385),Image:i(2117),Layer:i(20005),Particles:i(676),PathFollower:i(90145),RenderTexture:i(60505),Rope:i(96819),Sprite:i(46409),Stamp:i(85326),StaticBitmapText:i(34914),Text:i(68005),TileSprite:i(91681),Zone:i(84175),Video:i(89025),Arc:i(42563),Curve:i(40511),Ellipse:i(1543),Grid:i(34137),IsoBox:i(3933),IsoTriangle:i(49803),Line:i(2481),Polygon:i(64827),Rectangle:i(87959),Star:i(93697),Triangle:i(45245)},Creators:{Blitter:i(9403),Container:i(77143),DynamicBitmapText:i(11164),Graphics:i(87079),Group:i(94975),Image:i(82459),Layer:i(25179),Particles:i(92730),RenderTexture:i(34495),Rope:i(26209),Sprite:i(15567),Stamp:i(31479),StaticBitmapText:i(57336),Text:i(71259),TileSprite:i(14167),Zone:i(95261),Video:i(11511)}};n.CaptureFrame=i(43451),n.CustomContext=i(55327),n.Gradient=i(34637),n.Mesh2D=i(76435),n.Noise=i(35387),n.NoiseCell2D=i(51513),n.NoiseCell3D=i(15686),n.NoiseCell4D=i(41946),n.NoiseSimplex2D=i(1792),n.NoiseSimplex3D=i(51098),n.Shader=i(20071),n.NineSlice=i(28103),n.PointLight=i(80321),n.SpriteGPULayer=i(76573),n.Stencil=i(84423),n.StencilReference=i(63911),n.Factories.CaptureFrame=i(20421),n.Factories.CustomContext=i(4745),n.Factories.Gradient=i(69315),n.Factories.Mesh2D=i(2317),n.Factories.Noise=i(34757),n.Factories.NoiseCell2D=i(26590),n.Factories.NoiseCell3D=i(89918),n.Factories.NoiseCell4D=i(65874),n.Factories.NoiseSimplex2D=i(80308),n.Factories.NoiseSimplex3D=i(73810),n.Factories.Shader=i(74177),n.Factories.NineSlice=i(47521),n.Factories.PointLight=i(71255),n.Factories.SpriteGPULayer=i(96019),n.Factories.Stencil=i(67841),n.Factories.StencilReference=i(37889),n.Creators.CaptureFrame=i(23675),n.Creators.CustomContext=i(90255),n.Creators.Gradient=i(26353),n.Creators.Mesh2D=i(2227),n.Creators.Noise=i(39931),n.Creators.NoiseCell2D=i(98292),n.Creators.NoiseCell3D=i(97044),n.Creators.NoiseCell4D=i(20136),n.Creators.NoiseSimplex2D=i(51754),n.Creators.NoiseSimplex3D=i(71112),n.Creators.Shader=i(54935),n.Creators.NineSlice=i(28279),n.Creators.PointLight=i(39829),n.Creators.SpriteGPULayer=i(16193),n.Creators.Stencil=i(32247),n.Creators.StencilReference=i(44023),n.Light=i(41432),n.LightsManager=i(61356),n.LightsPlugin=i(88992),e.exports=n},93595(e,t,i){var n=i(10312),r=i(83419),s=i(31401),a=i(50792),o=i(95643),l=i(51708),h=i(73162),u=i(33963),c=i(44594),d=i(19186),f=new r({Extends:h,Mixins:[a,o,s.AlphaSingle,s.BlendMode,s.Depth,s.Mask,s.Visible,u],initialize:function(e,t){h.call(this,e),a.call(this),o.call(this,e,"Layer"),this.scene=e,this.systems=e.sys,this.events=e.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.clearAlpha(),this.setBlendMode(n.SKIP_CHECK),t&&this.add(t),e.sys.queueDepthSort()},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},willRender:function(e){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&e.id)},addChildCallback:function(e){var t=e.displayList;t&&t!==this&&e.removeFromDisplayList(),e.displayList||(this.queueDepthSort(),e.displayList=this,e.emit(l.ADDED_TO_SCENE,e,this.scene),this.events.emit(c.ADDED_TO_SCENE,e,this.scene))},removeChildCallback:function(e){this.queueDepthSort(),e.displayList=null,e.emit(l.REMOVED_FROM_SCENE,e,this.scene),this.events.emit(c.REMOVED_FROM_SCENE,e,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(d(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(e,t){return e._depth-t._depth},getChildren:function(){return this.list},destroy:function(e){if(this.scene&&!this.ignoreDestroy){o.prototype.destroy.call(this,e);for(var t=this.list;t.length;)t[0].destroy(e);this.list=void 0,this.systems=void 0,this.events=void 0}}});e.exports=f},2956(e){e.exports=function(e,t,i){var n=t.list;if(0!==n.length){t.depthSort();var r=-1!==t.blendMode;r||e.setBlendMode(0);var s=t._alpha;t.mask&&t.mask.preRenderCanvas(e,null,i);for(var a=0;a<n.length;a++){var o=n[a];if(o.willRender(i)){var l=o.alpha;r||o.blendMode===e.currentBlendMode||e.setBlendMode(o.blendMode),o.setAlpha(l*s),o.renderCanvas(e,o,i),o.setAlpha(l)}}t.mask&&t.mask.postRenderCanvas(e)}}},25179(e,t,i){var n=i(25305),r=i(93595),s=i(44603),a=i(23568);s.register("layer",function(e,t){void 0===e&&(e={});var i=a(e,"children",null),s=new r(this.scene,i);return void 0!==t&&(e.add=t),n(this.scene,s,e),s})},20005(e,t,i){var n=i(93595);i(39429).register("layer",function(e){return this.displayList.add(new n(this.scene,e))})},33963(e,t,i){var n=i(29747),r=n,s=n;r=i(15869),s=i(2956),e.exports={renderWebGL:r,renderCanvas:s}},15869(e,t,i){var n=i(8054);e.exports=function(e,t,i,r,s,a,o){var l=t.list,h=l.length;if(0!==h){var u=i,c=u.camera;t.depthSort();var d=t.blendMode!==n.BlendModes.SKIP_CHECK;d||0===u.blendMode||((u=u.getClone()).setBlendMode(0),u.use());for(var f=t.alpha,p=0;p<h;p++){var m=l[p];if(m.willRender(c)){var g,v,y,x;if(void 0!==m.alphaTopLeft)g=m.alphaTopLeft,v=m.alphaTopRight,y=m.alphaBottomLeft,x=m.alphaBottomRight;else{var b=m.alpha;g=b,v=b,y=b,x=b}d||m.blendMode===u.blendMode||m.blendMode===n.BlendModes.SKIP_CHECK||((u=u.getClone()).setBlendMode(m.blendMode),u.use()),m.setAlpha(g*f,v*f,y*f,x*f),m.renderWebGLStep(e,m,u,void 0,void 0,l,p),m.setAlpha(g,v,y,x)}}u!==i&&u.release()}}},41432(e,t,i){var n=i(96503),r=i(83419),s=i(31401),a=i(51767),o=i(70554),l=new r({Extends:n,Mixins:[s.Origin,s.ScrollFactor,s.Visible],initialize:function(e,t,i,r,s,o,l,h){n.call(this,e,t,i),this.color=new a(r,s,o),this.intensity=l,this.z=void 0===h?.1*i:h,this.coneEnabled=!1,this.coneRotation=0,this.coneInnerAngle=0,this.coneOuterAngle=0,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1),this.setOrigin(),this.setDisplayOrigin(i)},displayWidth:{get:function(){return this.diameter},set:function(e){this.diameter=e}},displayHeight:{get:function(){return this.diameter},set:function(e){this.diameter=e}},width:{get:function(){return this.diameter},set:function(e){this.diameter=e}},height:{get:function(){return this.diameter},set:function(e){this.diameter=e}},zNormal:{get:function(){return this.z/this.radius},set:function(e){this.z=e*this.radius}},willRender:function(e){return!(l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&e.id)},setColor:function(e){var t=o.getFloatsFromUintRGB(e);return this.color.set(t[0],t[1],t[2]),this},setIntensity:function(e){return this.intensity=e,this},setRadius:function(e){return this.radius=e,this},setZ:function(e){return this.z=e,this},setZNormal:function(e){return this.z=e*this.radius,this},setCone:function(e,t,i){return void 0===i&&(i=t),t=Math.max(0,Math.min(2*Math.PI,t)),(i=Math.max(0,Math.min(2*Math.PI,i)))<t&&(i=t),this.coneEnabled=!0,this.coneRotation=e,this.coneInnerAngle=t,this.coneOuterAngle=i,this},setConeRotation:function(e){return this.coneRotation=e,this},setConeAngles:function(e,t){return void 0===t&&(t=e),e=Math.max(0,Math.min(2*Math.PI,e)),(t=Math.max(0,Math.min(2*Math.PI,t)))<e&&(t=e),this.coneInnerAngle=e,this.coneOuterAngle=t,this},disableCone:function(){return this.coneEnabled=!1,this}});l.RENDER_MASK=15,e.exports=l},61356(e,t,i){var n=i(81491),r=i(83419),s=i(20339),a=i(41432),o=i(80321),l=i(51767),h=i(19133),u=i(19186),c=i(70554),d=new r({initialize:function(){this.lights=[],this.ambientColor=new l(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(e,t,i,n,r,s){return this.systems.displayList.add(new o(this.scene,e,t,i,n,r,s))},enable:function(){return-1===this.maxLights&&(this.maxLights=this.systems.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(e){for(var t=this.lights,i=e.worldView,r=[],a=0;a<t.length;a++){var o=t[a];o.willRender(e)&&n(o,i)&&r.push({light:o,distance:s(o.x,o.y,i.centerX,i.centerY)})}return r.length>this.maxLights&&(u(r,this.sortByDistance),r=r.slice(0,this.maxLights)),this.visibleLights=r.length,r},sortByDistance:function(e,t){return e.distance>=t.distance},setAmbientColor:function(e){var t=c.getFloatsFromUintRGB(e);return this.ambientColor.set(t[0],t[1],t[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(e,t,i,n,r,s){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=128),void 0===n&&(n=16777215),void 0===r&&(r=1),void 0===s&&(s=.1*i);var o=c.getFloatsFromUintRGB(n),l=new a(e,t,i,o[0],o[1],o[2],r,s);return this.lights.push(l),l},addConeLight:function(e,t,i,n,r,s,a,o,l){return void 0===s&&(s=0),void 0===a&&(a=Math.PI/4),this.addLight(e,t,i,n,r,l).setCone(s,a,o)},removeLight:function(e){var t=this.lights.indexOf(e);return t>=0&&h(this.lights,t),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});e.exports=d},88992(e,t,i){var n=i(83419),r=i(61356),s=i(37277),a=i(44594),o=new n({Extends:r,initialize:function(e){this.scene=e,this.systems=e.sys,e.sys.settings.isBooted||e.sys.events.once(a.BOOT,this.boot,this),r.call(this)},boot:function(){var e=this.systems.events;e.on(a.SHUTDOWN,this.shutdown,this),e.on(a.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});s.register("LightsPlugin",o,"lights"),e.exports=o},76435(e,t,i){var n=i(84322),r=i(2389),s=i(83419),a=i(31401),o=i(95643),l=i(63635),h=new s({Extends:o,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Lighting,a.Origin,a.RenderNodes,a.ScrollFactor,a.TextureCrop,a.Transform,a.Visible,l],initialize:function(e,t,i,r,s,a,l){o.call(this,e,"Mesh2D"),this.setTexture(r),this.setPosition(t,i),this.initRenderNodes(this._defaultRenderNodesMap),this.vertices=s,this.indices=a,this.indicesOrdered=null,this.useOrderedIndices=!1,this.renderAsTriangles=!1,this.flipV=!!l,this.tintMode=n.MULTIPLY,this.tint=16777215,this.tint2=0},_defaultRenderNodesMap:{get:function(){return r}},clearTint:function(){return this.tintMode=n.MULTIPLY,this.tint=16777215,this.tint2=0,this},setTint:function(e){return this.tint=e,this},setTint2:function(e){return this.tint2=e,this},setTintMode:function(e){return this.tintMode=e,this},isTinted:function(){return 16777215!==this.tint||0!==this.tint2||this.tintMode!==n.MULTIPLY},setFlipV:function(e){return this.flipV=!!e,this},setUseOrderedIndices:function(e){return this.useOrderedIndices=!!e,this},setRenderAsTriangles:function(e){return this.renderAsTriangles=!!e,this},buildOrderedIndices:function(e,t){void 0===e&&(e=0),void 0!==t&&(this.useOrderedIndices=!!t);var i=this.indices,n=i.length/4|0,r=this.vertices.length/4|0,s=[];return 1===e?this._buildOrderedIndicesNext(i,n,r,s):2===e?this._buildOrderedIndicesAll(i,n,r,s):this._buildOrderedIndicesFast(i,n,s),this.indicesOrdered=s,this},_buildOrderedIndicesFast:function(e,t,i){for(var n=0;n<t;n++){var r=4*n;this._pushDegenerateQuad(i,e[r],e[r+1],e[r+2],e[r+3])}},_buildOrderedIndicesNext:function(e,t,i,n){for(var r=0;r<t;r++){var s=4*r,a=e[s],o=e[s+1],l=e[s+2],h=e[s+3],u=!1,c=r+1;if(c<t){var d=4*c;if(h===e[d+3]){var f=this._sharedEdgeQuad(a,o,l,e[d],e[d+1],e[d+2],i);f&&(this._pushQuad(n,f[0],f[1],f[2],f[3],h),r=c,u=!0)}}u||this._pushDegenerateQuad(n,a,o,l,h)}},_buildOrderedIndicesAll:function(e,t,i,n){var r,s,a,o,l,h,u={};for(r=0;r<t;r++)a=e[s=4*r],o=e[s+1],l=e[s+2],h=e[s+3],this._addEdge(u,a,o,l,r,h,i),this._addEdge(u,o,l,a,r,h,i),this._addEdge(u,l,a,o,r,h,i);var c=[];for(r=0;r<t;r++){if(!c[r])a=e[s=4*r],o=e[s+1],l=e[s+2],h=e[s+3],c[r]=!0,this._matchEdge(u,c,n,r,a,o,l,h,i)||this._matchEdge(u,c,n,r,o,l,a,h,i)||this._matchEdge(u,c,n,r,l,a,o,h,i)||this._pushDegenerateQuad(n,a,o,l,h)}},_addEdge:function(e,t,i,n,r,s,a){var o=t<i?t*a+i:i*a+t,l=e[o];l||(l=e[o]=[]),l.push({tri:r,opp:n,page:s})},_matchEdge:function(e,t,i,n,r,s,a,o,l){var h=e[s<a?s*l+a:a*l+s];if(!h)return!1;for(var u=0;u<h.length;u++){var c=h[u];if(c.tri!==n&&!t[c.tri]&&c.page===o)return t[c.tri]=!0,this._pushQuad(i,r,s,a,c.opp,o),!0}return!1},_sharedEdgeQuad:function(e,t,i,n,r,s,a){for(var o=[[this._edgeKey(e,t,a),i,e,t],[this._edgeKey(t,i,a),e,t,i],[this._edgeKey(i,e,a),t,i,e]],l=[[this._edgeKey(n,r,a),s],[this._edgeKey(r,s,a),n],[this._edgeKey(s,n,a),r]],h=0;h<3;h++)for(var u=0;u<3;u++)if(o[h][0]===l[u][0])return[o[h][1],o[h][2],o[h][3],l[u][1]];return null},_edgeKey:function(e,t,i){return e<t?e*i+t:t*i+e},_pushQuad:function(e,t,i,n,r,s){e.push(t,i,n,s,i,n,r,s)},_pushDegenerateQuad:function(e,t,i,n,r){e.push(t,i,n,r,i,n,n,r)}});e.exports=h},2227(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(76435);r.register("mesh2d",function(e,t){void 0===e&&(e={});var i=s(e,"key",null),r=s(e,"vertices",[]),o=s(e,"indices",[]),l=s(e,"flipV",!1),h=new a(this.scene,0,0,i,r,o,l);return void 0!==t&&(e.add=t),n(this.scene,h,e),h})},2317(e,t,i){var n=i(76435);i(39429).register("mesh2d",function(e,t,i,r,s,a){return this.displayList.add(new n(this.scene,e,t,i,r,s,a))})},63635(e,t,i){var n=i(29747),r=i(43909),s=n;e.exports={renderWebGL:r,renderCanvas:s}},43909(e){e.exports=function(e,t,i,n){i.camera.addToRenderList(t);var r=t.customRenderNodes,s=t.defaultRenderNodes,a=r.Transformer||s.Transformer,o=r.Submitter||s.Submitter;if(t.renderAsTriangles){var l=r.BatchHandlerTriangles||s.BatchHandlerTriangles;return o.setRenderOptions(t),void l.batchTriangles(i,t,n,a,t.vertices,t.indices,o._renderOptions)}o.run(i,t,n,a)}},28103(e,t,i){var n=i(30529),r=i(83419),s=i(31401),a=i(95643),o=i(78023),l=i(84322),h=i(82513),u=new r({Extends:a,Mixins:[s.AlphaSingle,s.BlendMode,s.Depth,s.GetBounds,s.Mask,s.Origin,s.RenderNodes,s.ScrollFactor,s.Texture,s.Transform,s.Visible,o],initialize:function(e,t,i,n,r,s,o,u,c,d,f,p,m){a.call(this,e,"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.tileX=p||!1,this.tileY=m||!1,this._repeatCountX=1,this._repeatCountY=1,this.tint=16777215,this.tintMode=l.MULTIPLY;var g=e.textures.getFrame(n,r);this.is3Slice=!d&&!f,g&&g.scale9&&(this.is3Slice=g.is3Slice);for(var v=this.is3Slice?18:54,y=0;y<v;y++)this.vertices.push(new h);this.setPosition(t,i),this.setTexture(n,r),this.setSlices(s,o,u,c,d,f,!1),this.updateDisplayOrigin(),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return n}},setSlices:function(e,t,i,n,r,s,a){void 0===i&&(i=10),void 0===n&&(n=10),void 0===r&&(r=0),void 0===s&&(s=0),void 0===a&&(a=!1);var o=this.frame,l=!1;if(this.is3Slice&&a&&0!==r&&0!==s&&(l=!0),l)console.warn("Cannot change 9 slice to 3 slice");else{if(o&&o.scale9&&!a){var h=o.data.scale9Borders,u=h.x,c=h.y;i=u,n=o.width-h.w-u,r=c,s=o.height-h.h-c,void 0===e&&(e=o.width),void 0===t&&(t=o.height)}else void 0===e&&(e=256),void 0===t&&(t=256);this._width=e,this._height=t,this.leftWidth=i,this.rightWidth=n,this.topHeight=r,this.bottomHeight=s,this.is3Slice&&(t=o.height,this._height=t,this.topHeight=t,this.bottomHeight=0),this.updateVertices(),this.updateUVs()}return this},updateUVs:function(){var e=this.leftWidth,t=this.rightWidth,i=this.topHeight,n=this.bottomHeight,r=this.frame.width,s=this.frame.height,a=e/r,o=1-t/r,l=i/s,h=1-n/s,u=0;if(this.is3Slice)this._updateUVRow(u,a,o,0,l);else{u=this._updateUVRow(u,a,o,0,l);for(var c=0;c<this._repeatCountY;c++)u=this._updateUVRow(u,a,o,l,h);this._updateUVRow(u,a,o,h,1)}},_updateUVRow:function(e,t,i,n,r){this.updateQuadUVs(e,0,n,t,r),e+=6;for(var s=0;s<this._repeatCountX;s++)this.updateQuadUVs(e,t,n,i,r),e+=6;return this.updateQuadUVs(e,i,n,1,r),e+=6},updateVertices:function(){var e=this.leftWidth,t=this.rightWidth,i=this.topHeight,n=this.bottomHeight,r=this.width,s=this.height,a=this.frame,o=this.tileX?this._calcRepeatCount(r-e-t,a.width-e-t):1,l=this.tileY&&!this.is3Slice?this._calcRepeatCount(s-i-n,a.height-i-n):1,h=this._rebuildVertexArray(o,l),u=-.5,c=e/r-.5,d=.5-t/r,f=.5,p=.5-i/s,m=(d-c)/o,g=0;if(this.is3Slice)this._updateVertexRow(g,u,c,d,f,.5,p,m);else{var v=n/s-.5,y=(p-v)/l;g=this._updateVertexRow(g,u,c,d,f,.5,p,m);for(var x=0;x<l;x++){var b=p-x*y,w=p-(x+1)*y;g=this._updateVertexRow(g,u,c,d,f,b,w,m)}this._updateVertexRow(g,u,c,d,f,v,-.5,m)}h&&this.updateUVs()},_calcRepeatCount:function(e,t){return t>0?Math.max(1,Math.floor(e/t)):1},_rebuildVertexArray:function(e,t){if(e===this._repeatCountX&&t===this._repeatCountY)return!1;this._repeatCountX=e,this._repeatCountY=t;var i=(e+2)*(this.is3Slice?1:t+2)*6,n=this.vertices;if(n.length!==i){n.length=0;for(var r=0;r<i;r++)n.push(new h)}return!0},_updateVertexRow:function(e,t,i,n,r,s,a,o){this.updateQuad(e,t,s,i,a),e+=6;for(var l=0;l<this._repeatCountX;l++)this.updateQuad(e,i+l*o,s,i+(l+1)*o,a),e+=6;return this.updateQuad(e,n,s,r,a),e+=6},updateQuad:function(e,t,i,n,r){var s=this.width,a=this.height,o=this.originX,l=this.originY,h=this.vertices;h[e+0].resize(t,i,s,a,o,l),h[e+1].resize(t,r,s,a,o,l),h[e+2].resize(n,i,s,a,o,l),h[e+3].resize(t,r,s,a,o,l),h[e+4].resize(n,r,s,a,o,l),h[e+5].resize(n,i,s,a,o,l)},updateQuadUVs:function(e,t,i,n,r){var s=this.vertices,a=this.frame,o=a.u0,l=a.v0,h=a.u1,u=a.v1;if(0!==o||1!==h){var c=h-o;t=o+t*c,n=o+n*c}if(0!==l||1!==u){var d=u-l;i=l+i*d,r=l+r*d}s[e+0].setUVs(t,i),s[e+1].setUVs(t,r),s[e+2].setUVs(n,i),s[e+3].setUVs(t,r),s[e+4].setUVs(n,r),s[e+5].setUVs(n,i)},clearTint:function(){return this.setTint(16777215),this.setTintMode(),this},setTint:function(e){return void 0===e&&(e=16777215),this.tint=e,this},setTintMode:function(e){return void 0===e&&(e=l.MULTIPLY),this.tintMode=e,this},isTinted:{get:function(){return 16777215!==this.tint||this.tintMode!==l.MULTIPLY}},width:{get:function(){return this._width},set:function(e){this._width=Math.max(e,this.leftWidth+this.rightWidth),this.updateVertices()}},height:{get:function(){return this._height},set:function(e){this.is3Slice||(this._height=Math.max(e,this.topHeight+this.bottomHeight),this.updateVertices())}},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,t){this.width=e,this.height=t,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=this.width,i.hitArea.height=this.height),this},setDisplaySize:function(e,t){return this.displayWidth=e,this.displayHeight=t,this},originX:{get:function(){return this._originX},set:function(e){this._originX=e,this.updateVertices()}},originY:{get:function(){return this._originY},set:function(e){this._originY=e,this.updateVertices()}},setOrigin:function(e,t){return void 0===e&&(e=.5),void 0===t&&(t=e),this._originX=e,this._originY=t,this.updateVertices(),this.updateDisplayOrigin()},setSizeToFrame:function(){if(this.is3Slice){var e=this.frame.height;this._height=e,this.topHeight=e,this.bottomHeight=0}return this.updateUVs(),this},preDestroy:function(){this.vertices=[]}});e.exports=u},28279(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(35154),o=i(28103);r.register("nineslice",function(e,t){void 0===e&&(e={});var i=s(e,"key",null),r=s(e,"frame",null),l=a(e,"width",256),h=a(e,"height",256),u=a(e,"leftWidth",10),c=a(e,"rightWidth",10),d=a(e,"topHeight",0),f=a(e,"bottomHeight",0),p=a(e,"tileX",!1),m=a(e,"tileY",!1),g=new o(this.scene,0,0,i,r,l,h,u,c,d,f,p,m);return void 0!==t&&(e.add=t),n(this.scene,g,e),g})},47521(e,t,i){var n=i(28103);i(39429).register("nineslice",function(e,t,i,r,s,a,o,l,h,u,c,d){return this.displayList.add(new n(this.scene,e,t,i,r,s,a,o,l,h,u,c,d))})},78023(e,t,i){var n=i(29747),r=n,s=n;r=i(52230),e.exports={renderWebGL:r,renderCanvas:s}},82513(e,t,i){var n=i(83419),r=i(26099),s=new n({Extends:r,initialize:function(e,t,i,n){r.call(this,e,t),this.vx=0,this.vy=0,this.u=i,this.v=n},setUVs:function(e,t){return this.u=e,this.v=t,this},resize:function(e,t,i,n,r,s){return this.x=e,this.y=t,this.vx=this.x*i,this.vy=-this.y*n,r<.5?this.vx+=i*(.5-r):r>.5&&(this.vx-=i*(r-.5)),s<.5?this.vy+=n*(.5-s):s>.5&&(this.vy-=n*(s-.5)),this}});e.exports=s},52230(e,t,i){var n=i(91296),r=i(70554),s={multiTexturing:!0};e.exports=function(e,t,i,a){var o=t.vertices,l=o.length;if(0!==l){var h=i.camera;h.addToRenderList(t);for(var u,c,d,f=t.alpha,p=t.customRenderNodes.BatchHandler||t.defaultRenderNodes.BatchHandler,m=n(t,h,a,!i.useCanvas).calc,g=r.getTintAppendFloatAlpha(t.tint,f),v=t.frame.source.glTexture,y=t.tintMode,x=0;x<l;x+=6)c=o[x+1],d=o[x+2],u=m.setQuad(c.vx,c.vy,d.vx,d.vy),p.batch(i,v,u[0],u[1],u[2],u[3],u[6],u[7],u[4],u[5],c.u,c.v,d.u-c.u,d.v-c.v,y,g,g,g,g,s)}}},35387(e,t,i){var n=i(83419),r=i(20071),s=i(40987),a=i(16421),o=new n({Extends:r,initialize:function(e,t,i,n,o,l){t||(t={});var h={name:"noise",fragmentSource:a,setupUniforms:this._setupUniforms};r.call(this,e,h,i,n,o,l),this.type="Noise",this.noiseOffset=[0,0],t.noiseOffset&&(this.noiseOffset=t.noiseOffset),this.noisePower=void 0===t.noisePower?1:t.noisePower,this.noiseColorStart=new s(0,0,0),this.noiseColorEnd=new s(255,255,255),void 0===t.noiseColorStart&&void 0===t.noiseColorEnd||this.setNoiseColor(t.noiseColorStart,t.noiseColorEnd),this.noiseRandomChannels=!!t.noiseRandomChannels,this.noiseRandomNormal=!!t.noiseRandomNormal},setNoiseColor:function(e,t){var i;return void 0===e&&(e=0),void 0===t&&(t=16777215),"number"===typeof e?s.IntegerToColor(e,this.noiseColorStart):"str
2ing"===typeof e?s.HexStringToColor(e,this.noiseColorStart):Array.isArray(e)?(i=void 0===e[3]?1:e[3],this.noiseColorStart.setGLTo(e[0],e[1],e[2],i)):e instanceof s&&this.noiseColorStart.setTo(e.red,e.green,e.blue,e.alpha),"number"===typeof t?s.IntegerToColor(t,this.noiseColorEnd):"string"===typeof t?s.HexStringToColor(t,this.noiseColorEnd):Array.isArray(t)?(i=void 0===t[3]?1:t[3],this.noiseColorEnd.setGLTo(t[0],t[1],t[2],i)):t instanceof s&&this.noiseColorEnd.setTo(t.red,t.green,t.blue,t.alpha),this},_setupUniforms:function(e){e("uOffset",this.noiseOffset),e("uColorStart",this.noiseColorStart.gl),e("uColorEnd",this.noiseColorEnd.gl),e("uPower",this.noisePower);var t=0;this.noiseRandomChannels&&(t=1),this.noiseRandomNormal&&(t=2),e("uMode",t)}});e.exports=o},39931(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(35387);r.register("noise",function(e,t){void 0===e&&(e={});var i=s(e,"config",null),r=s(e,"x",0),o=s(e,"y",0),l=s(e,"width",128),h=s(e,"height",128),u=new a(this.scene,i,r,o,l,h);return void 0!==t&&(e.add=t),n(this.scene,u,e),u})},34757(e,t,i){var n=i(35387);i(39429).register("noise",function(e,t,i,r,s){return this.displayList.add(new n(this.scene,e,t,i,r,s))})},51513(e,t,i){var n=i(83419),r=i(20071),s=i(40987),a=i(17205),o=new n({Extends:r,initialize:function(e,t,i,n,o,l){t||(t={});var h={name:"noiseCell2D",fragmentSource:a,shaderAdditions:[{name:"MODE_DISTANCE",tags:["MODE"],additions:{fragmentMode:"#define MODE_DISTANCE"}},{name:"ITERATION_COUNT_1",tags:["ITERATION_COUNT"],additions:{fragmentIterations:"#define ITERATION_COUNT 1.0"}},{name:"NORMALMAP",tags:["NORMALMAP"],additions:{fragmentNormalMap:"#define NORMAL_MAP\n#extension GL_OES_standard_derivatives : enable"},disable:!t.noiseNormalMap}],setupUniforms:this._setupUniforms,updateShaderConfig:this._updateShaderConfig};r.call(this,e,h,i,n,o,l),this.type="NoiseCell2D",this.noiseCells=[32,32],t.noiseCells&&(this.noiseCells=t.noiseCells),this.noiseWrap=[this.noiseCells[0],this.noiseCells[1]],t.noiseWrap&&(this.noiseWrap=t.noiseWrap),this.noiseOffset=[0,0],t.noiseOffset&&(this.noiseOffset=t.noiseOffset),this.noiseVariation=[1,1],t.noiseVariation&&(this.noiseVariation=t.noiseVariation),this.noiseIterations=1,t.noiseIterations&&(this.noiseIterations=t.noiseIterations),this.noiseMode=0,t.noiseMode&&(this.noiseMode=t.noiseMode),this.noiseSmoothing=1,t.noiseSmoothing&&(this.noiseSmoothing=t.noiseSmoothing),this.noiseNormalMap=!!t.noiseNormalMap,this.noiseNormalScale=1,void 0!==t.noiseNormalScale&&(this.noiseNormalScale=t.noiseNormalScale),this.noiseColorStart=new s(0,0,0),this.noiseColorEnd=new s(255,255,255),void 0===t.noiseColorStart&&void 0===t.noiseColorEnd||this.setNoiseColor(t.noiseColorStart,t.noiseColorEnd),this.noiseSeed=[1,2,3,4,5,6,7,8],t.noiseSeed&&(this.noiseSeed=t.noiseSeed),t.randomizeNoiseSeed&&this.randomizeNoiseSeed(),this.keepAwake=!0},setNoiseColor:function(e,t){var i;return void 0===e&&(e=0),void 0===t&&(t=16777215),"number"===typeof e?s.IntegerToColor(e,this.noiseColorStart):"string"===typeof e?s.HexStringToColor(e,this.noiseColorStart):Array.isArray(e)?(i=void 0===e[3]?1:e[3],this.noiseColorStart.setGLTo(e[0],e[1],e[2],i)):e instanceof s&&this.noiseColorStart.setTo(e.red,e.green,e.blue,e.alpha),"number"===typeof t?s.IntegerToColor(t,this.noiseColorEnd):"string"===typeof t?s.HexStringToColor(t,this.noiseColorEnd):Array.isArray(t)?(i=void 0===t[3]?1:t[3],this.noiseColorEnd.setGLTo(t[0],t[1],t[2],i)):t instanceof s&&this.noiseColorEnd.setTo(t.red,t.green,t.blue,t.alpha),this},randomizeNoiseSeed:function(){for(var e=this.noiseSeed.length,t=0;t<e;t++)this.noiseSeed[t]=Math.random();return this},wrapNoise:function(){for(var e=this.noiseWrap.length,t=0;t<e;t++)this.noiseWrap[t]=this.noiseCells[t];return this},_setupUniforms:function(e){if(this.keepAwake){var t=Math.sin(this.scene.time.now)/4096/256;e("uCellOffset",[this.noiseOffset[0]+t,this.noiseOffset[1]+t])}else e("uCellOffset",this.noiseOffset);e("uSeedX",this.noiseSeed.slice(0,2)),e("uSeedY",this.noiseSeed.slice(2,4)),e("uCells",this.noiseCells),e("uVariation",this.noiseVariation),e("uWrap",this.noiseWrap),e("uSmoothing",this.noiseSmoothing),e("uNormalScale",this.noiseNormalScale),e("uColorStart",this.noiseColorStart.gl),e("uColorEnd",this.noiseColorEnd.gl)},_updateShaderConfig:function(e,t,i){var n=Math.max(1,Math.floor(t.noiseIterations)),r=i.programManager.getAdditionsByTag("ITERATION_COUNT")[0];r.name="ITERATION_COUNT_"+n,r.additions.fragmentIterations="#define ITERATION_COUNT "+n+".0";var s="MODE_DISTANCE";switch(t.noiseMode){case 1:s="MODE_INDEX";break;case 2:s="MODE_DISTANCE_SMOOTH"}var a=i.programManager.getAdditionsByTag("MODE")[0];a.name=s,a.additions.fragmentMode="#define "+s,i.programManager.getAdditionsByTag("NORMALMAP")[0].disable=!t.noiseNormalMap}});e.exports=o},98292(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(51513);r.register("noisecell2d",function(e,t){void 0===e&&(e={});var i=s(e,"config",null),r=s(e,"x",0),o=s(e,"y",0),l=s(e,"width",128),h=s(e,"height",128),u=new a(this.scene,i,r,o,l,h);return void 0!==t&&(e.add=t),n(this.scene,u,e),u})},26590(e,t,i){var n=i(51513);i(39429).register("noisecell2d",function(e,t,i,r,s){return this.displayList.add(new n(this.scene,e,t,i,r,s))})},15686(e,t,i){var n=i(83419),r=i(20071),s=i(40987),a=i(79814),o=new n({Extends:r,initialize:function(e,t,i,n,o,l){t||(t={});var h={name:"noiseCell3D",fragmentSource:a,shaderAdditions:[{name:"MODE_DISTANCE",tags:["MODE"],additions:{fragmentMode:"#define MODE_DISTANCE"}},{name:"ITERATION_COUNT_1",tags:["ITERATION_COUNT"],additions:{fragmentIterations:"#define ITERATION_COUNT 1.0"}},{name:"NORMALMAP",tags:["NORMALMAP"],additions:{fragmentNormalMap:"#define NORMAL_MAP\n#extension GL_OES_standard_derivatives : enable"},disable:!t.noiseNormalMap}],setupUniforms:this._setupUniforms,updateShaderConfig:this._updateShaderConfig};r.call(this,e,h,i,n,o,l),this.type="NoiseCell3D",this.noiseCells=[32,32,32],t.noiseCells&&(this.noiseCells=t.noiseCells),this.noiseWrap=[this.noiseCells[0],this.noiseCells[1],this.noiseCells[2]],t.noiseWrap&&
vendor: 9,568 bytes, line 2
2(this.noiseWrap=t.noiseWrap),this.noiseOffset=[0,0,0],t.noiseOffset&&(this.noiseOffset=t.noiseOffset),this.noiseVariation=[1,1,1],t.noiseVariation&&(this.noiseVariation=t.noiseVariation),this.noiseIterations=1,t.noiseIterations&&(this.noiseIterations=t.noiseIterations),this.noiseMode=0,t.noiseMode&&(this.noiseMode=t.noiseMode),this.noiseSmoothing=1,t.noiseSmoothing&&(this.noiseSmoothing=t.noiseSmoothing),this.noiseNormalMap=!!t.noiseNormalMap,this.noiseNormalScale=1,void 0!==t.noiseNormalScale&&(this.noiseNormalScale=t.noiseNormalScale),this.noiseColorStart=new s(0,0,0),this.noiseColorEnd=new s(255,255,255),void 0===t.noiseColorStart&&void 0===t.noiseColorEnd||this.setNoiseColor(t.noiseColorStart,t.noiseColorEnd),this.noiseSeed=[1,2,3,4,5,6,7,8,9,10,11,12],t.noiseSeed&&(this.noiseSeed=t.noiseSeed),t.randomizeNoiseSeed&&this.randomizeNoiseSeed(),this.keepAwake=!0},setNoiseColor:function(e,t){var i;return void 0===e&&(e=0),void 0===t&&(t=16777215),"number"===typeof e?s.IntegerToColor(e,this.noiseColorStart):"string"===typeof e?s.HexStringToColor(e,this.noiseColorStart):Array.isArray(e)?(i=void 0===e[3]?1:e[3],this.noiseColorStart.setGLTo(e[0],e[1],e[2],i)):e instanceof s&&this.noiseColorStart.setTo(e.red,e.green,e.blue,e.alpha),"number"===typeof t?s.IntegerToColor(t,this.noiseColorEnd):"string"===typeof t?s.HexStringToColor(t,this.noiseColorEnd):Array.isArray(t)?(i=void 0===t[3]?1:t[3],this.noiseColorEnd.setGLTo(t[0],t[1],t[2],i)):t instanceof s&&this.noiseColorEnd.setTo(t.red,t.green,t.blue,t.alpha),this},randomizeNoiseSeed:function(){for(var e=this.noiseSeed.length,t=0;t<e;t++)this.noiseSeed[t]=Math.random();return this},wrapNoise:function(){for(var e=this.noiseWrap.length,t=0;t<e;t++)this.noiseWrap[t]=this.noiseCells[t];return this},_setupUniforms:function(e){if(this.keepAwake){var t=Math.sin(this.scene.time.now)/4096/256;e("uCellOffset",[this.noiseOffset[0]+t,this.noiseOffset[1]+t,this.noiseOffset[2]+t])}else e("uCellOffset",this.noiseOffset);e("uSeedX",this.noiseSeed.slice(0,3)),e("uSeedY",this.noiseSeed.slice(3,6)),e("uSeedZ",this.noiseSeed.slice(6,9)),e("uCells",this.noiseCells),e("uVariation",this.noiseVariation),e("uWrap",this.noiseWrap),e("uSmoothing",this.noiseSmoothing),e("uNormalScale",this.noiseNormalScale),e("uColorStart",this.noiseColorStart.gl),e("uColorEnd",this.noiseColorEnd.gl)},_updateShaderConfig:function(e,t,i){var n=Math.max(1,Math.floor(t.noiseIterations)),r=i.programManager.getAdditionsByTag("ITERATION_COUNT")[0];r.name="ITERATION_COUNT_"+n,r.additions.fragmentIterations="#define ITERATION_COUNT "+n+".0";var s="MODE_DISTANCE";switch(t.noiseMode){case 1:s="MODE_INDEX";break;case 2:s="MODE_DISTANCE_SMOOTH"}var a=i.programManager.getAdditionsByTag("MODE")[0];a.name=s,a.additions.fragmentMode="#define "+s,i.programManager.getAdditionsByTag("NORMALMAP")[0].disable=!t.noiseNormalMap}});e.exports=o},97044(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(15686);r.register("noisecell3d",function(e,t){void 0===e&&(e={});var i=s(e,"config",null),r=s(e,"x",0),o=s(e,"y",0),l=s(e,"width",128),h=s(e,"height",128),u=new a(this.scene,i,r,o,l,h);return void 0!==t&&(e.add=t),n(this.scene,u,e),u})},89918(e,t,i){var n=i(15686);i(39429).register("noisecell3d",function(e,t,i,r,s){return this.displayList.add(new n(this.scene,e,t,i,r,s))})},41946(e,t,i){var n=i(83419),r=i(20071),s=i(40987),a=i(99595),o=new n({Extends:r,initialize:function(e,t,i,n,o,l){t||(t={});var h={name:"noiseCell4D",fragmentSource:a,shaderAdditions:[{name:"MODE_DISTANCE",tags:["MODE"],additions:{fragmentMode:"#define MODE_DISTANCE"}},{name:"ITERATION_COUNT_1",tags:["ITERATION_COUNT"],additions:{fragmentIterations:"#define ITERATION_COUNT 1.0"}},{name:"NORMALMAP",tags:["NORMALMAP"],additions:{fragmentNormalMap:"#define NORMAL_MAP\n#extension GL_OES_standard_derivatives : enable"},disable:!t.noiseNormalMap}],setupUniforms:this._setupUniforms,updateShaderConfig:this._updateShaderConfig};r.call(this,e,h,i,n,o,l),this.type="NoiseCell4D",this.noiseCells=[32,32,32,32],t.noiseCells&&(this.noiseCells=t.noiseCells),this.noiseWrap=[this.noiseCells[0],this.noiseCells[1],this.noiseCells[2],this.noiseCells[3]],t.noiseWrap&&(this.noiseWrap=t.noiseWrap),this.noiseOffset=[0,0,0,0],t.noiseOffset&&(this.noiseOffset=t.noiseOffset),this.noiseVariation=[1,1,1,1],t.noiseVariation&&(this.noiseVariation=t.noiseVariation),this.noiseIterations=1,t.noiseIterations&&(this.noiseIterations=t.noiseIterations),this.noiseMode=0,t.noiseMode&&(this.noiseMode=t.noiseMode),this.noiseSmoothing=1,t.noiseSmoothing&&(this.noiseSmoothing=t.noiseSmoothing),this.noiseNormalMap=!!t.noiseNormalMap,this.noiseNormalScale=1,void 0!==t.noiseNormalScale&&(this.noiseNormalScale=t.noiseNormalScale),this.noiseColorStart=new s(0,0,0),this.noiseColorEnd=new s(255,255,255),void 0===t.noiseColorStart&&void 0===t.noiseColorEnd||this.setNoiseColor(t.noiseColorStart,t.noiseColorEnd),this.noiseSeed=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],t.noiseSeed&&(this.noiseSeed=t.noiseSeed),t.randomizeNoiseSeed&&this.randomizeNoiseSeed(),this.keepAwake=!0},setNoiseColor:function(e,t){var i;return void 0===e&&(e=0),void 0===t&&(t=16777215),"number"===typeof e?s.IntegerToColor(e,this.noiseColorStart):"string"===typeof e?s.HexStringToColor(e,this.noiseColorStart):Array.isArray(e)?(i=void 0===e[3]?1:e[3],this.noiseColorStart.setGLTo(e[0],e[1],e[2],i)):e instanceof s&&this.noiseColorStart.setTo(e.red,e.green,e.blue,e.alpha),"number"===typeof t?s.IntegerToColor(t,this.noiseColorEnd):"string"===typeof t?s.HexStringToColor(t,this.noiseColorEnd):Array.isArray(t)?(i=void 0===t[3]?1:t[3],this.noiseColorEnd.setGLTo(t[0],t[1],t[2],i)):t instanceof s&&this.noiseColorEnd.setTo(t.red,t.green,t.blue,t.alpha),this},randomizeNoiseSeed:function(){for(var e=this.noiseSeed.length,t=0;t<e;t++)this.noiseSeed[t]=Math.random();return this},wrapNoise:function(){for(var e=this.noiseWrap.length,t=0;t<e;t++)this.noiseWrap[t]=this.noiseCells[t];return this},_setupUniforms:function(e){if(this.keepAwake){var t=Math.sin(this.scene.time.now)/4096/256;e("uCellOffset",[this.noiseOffset[0]+t,this.noiseOffset[1]+t,this.noiseOffset[2]+t,this.noiseOffset[3]+t])}else e("uCellOffset",this.noiseOffset);e("uSeedX",this.noiseSeed.slice(0,4)),e("uSeedY",this.noiseSeed.slice(4,8)),e("uSeedZ",this.noiseSeed.slice(8,12)),e("uSeedW",this.noiseSeed.slice(12,16)),e("uCells",this.noiseCells),e("uVariation",this.noiseVariation),e("uWrap",this.noiseWrap),e("uSmoothing",this.noiseSmoothing),e("uNormalScale",this.noiseNormalScale),e("uColorStart",this.noiseColorStart.gl),e("uColorEnd",this.noiseColorEnd.gl)},_updateShaderConfig:function(e,t,i){var n=Math.max(1,Math.floor(t.noiseIterations)),r=i.programManager.getAdditionsByTag("ITERATION_COUNT")[0];r.name="ITERATION_COUNT_"+n,r.additions.fragmentIterations="#define ITERATION_COUNT "+n+".0";var s="MODE_DISTANCE";switch(t.noiseMode){case 1:s="MODE_INDEX";break;case 2:s="MODE_DISTANCE_SMOOTH"}var a=i.programManager.getAdditionsByTag("MODE")[0];a.name=s,a.additions.fragmentMode="#define "+s,i.programManager.getAdditionsByTag("NORMALMAP")[0].disable=!t.noiseNormalMap}});e.exports=o},20136(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(41946);r.register("noisecell4d",function(e,t){void 0===e&&(e={});var i=s(e,"config",null),r=s(e,"x",0),o=s(e,"y",0),l=s(e,"width",128),h=s(e,"height",128),u=new a(this.scene,i,r,o,l,h);return void 0!==t&&(e.add=t),n(this.scene,u,e),u})},65874(e,t,i){var n=i(41946);i(39429).register("noisecell4d",function(e,t,i,r,s){return this.displayList.add(new n(this.scene,e,t,i,r,s))})},1792(e,t,i){var n=i(83419),r=i(20071),s=i(40987),a=i(83587),o=new n({Extends:r,initialize:function(e,t,i,n,o,l){t||(t={});var h={name:"noiseSimplex2D",fragmentSource:a,shaderAdditions:[{name:"ITERATION_COUNT_1_WARP_ITERATION_COUNT_1",tags:["ITERATION_COUNT"],additions:{fragmentIterations:"#define ITERATION_COUNT 1.0\n#define WARP_ITERATION_COUNT 1.0"}},{name:"NORMALMAP",tags:["NORMALMAP"],additions:{fragmentNormalMap:"#define NORMAL_MAP\n#extension GL_OES_standard_derivatives : enable"},disable:!t.noiseNormalMap}],setupUniforms:this._setupUniforms,updateShaderConfig:this._updateShaderConfig};r.call(this,e,h,i,n,o,l),this.type="NoiseSimplex2D",this.noiseCells=t.noiseCells||[32,32],this.noisePeriod=[this.noiseCells[0],this.noiseCells[1]],t.noisePeriod&&(this.noisePeriod=t.noisePeriod),this.noiseOffset=[0,0],t.noiseOffset&&(this.noiseOffset=t.noiseOffset),this.noiseFlow=t.noiseFlow||0,this.noiseWarpAmount=t.noiseWarpAmount||0,this.noiseIterations=t.noiseIterations||1,this.noiseWarpIterations=t.noiseWarpIterations||1,this.noiseDetailPower=t.noiseDetailPower||2,this.noiseFlowPower=t.noiseFlowPower||2,this.noiseContributionPower=t.noiseContributionPower||2,this.noiseWarpDetailPower=t.noiseWarpDetailPower||2,this.noiseWarpFlowPower=t.noiseWarpFlowPower||2,this.noiseWarpContributionPower=t.noiseWarpContributionPower||2,this.noiseNormalMap=!!t.noiseNormalMap,this.noiseNormalScale=1,void 0!==t.noiseNormalScale&&(this.noiseNormalScale=t.noiseNormalScale),this.noiseValueFactor=void 0===t.noiseValueFactor?.5:t.noiseValueFactor,this.noiseValueAdd=void 0===t.noiseValueAdd?.5:t.noiseValueAdd,this.noiseValuePower=void 0===t.noiseValuePower?1:t.noiseValuePower,this.noiseColorStart=new s(0,0,0),this.noiseColorEnd=new s(255,255,255),void 0===t.noiseColorStart&&void 0===t.noiseColorEnd||this.setNoiseColor(t.noiseColorStart,t.noiseColorEnd),this.noiseSeed=t.noiseSeed||[1,2]},setNoiseColor:function(e,t){var i;return void 0===e&&(e=0),void 0===t&&(t=16777215),"number"===typeof e?s.IntegerToColor(e,this.noiseColorStart):"str
2ing"===typeof e?s.HexStringToColor(e,this.noiseColorStart):Array.isArray(e)?(i=void 0===e[3]?1:e[3],this.noiseColorStart.setGLTo(e[0],e[1],e[2],i)):e instanceof s&&this.noiseColorStart.setTo(e.red,e.green,e.blue,e.alpha),"number"===typeof t?s.IntegerToColor(t,this.noiseColorEnd):"string"===typeof t?s.HexStringToColor(t,this.noiseColorEnd):Array.isArray(t)?(i=void 0===t[3]?1:t[3],this.noiseColorEnd.setGLTo(t[0],t[1],t[2],i)):t instanceof s&&this.noiseColorEnd.setTo(t.red,t.green,t.blue,t.alpha),this},randomizeNoiseSeed:function(){for(var e=this.noiseSeed.length,t=0;t<e;t++)this.noiseSeed[t]=Math.random();return this},wrapNoise:function(){for(var e=this.noisePeriod.length,t=0;t<e;t++)this.noisePeriod[t]=this.noiseCells[t];return this},_setupUniforms:function(e){e("uCells",this.noiseCells),e("uPeriod",this.noisePeriod),e("uOffset",this.noiseOffset),e("uFlow",this.noiseFlow),e("uDetailPower",this.noiseDetailPower),e("uFlowPower",this.noiseFlowPower),e("uContributionPower",this.noiseContributionPower),e("uWarpDetailPower",this.noiseWarpDetailPower),e("uWarpFlowPower",this.noiseWarpFlowPower),e("uWarpContributionPower",this.noiseWarpContributionPower),e("uWarpAmount",this.noiseWarpAmount),e("uNormalScale",this.noiseNormalScale),e("uValueFactor",this.noiseValueFactor),e("uValueAdd",this.noiseValueAdd),e("uValuePower",this.noiseValuePower),e("uColorStart",this.noiseColorStart.gl),e("uColorEnd",this.noiseColorEnd.gl),e("uSeed",this.noiseSeed)},_updateShaderConfig:function(e,t,i){var n=Math.max(1,Math.floor(t.noiseIterations)),r=Math.max(1,Math.floor(t.noiseWarpIterations)),s=i.programManager.getAdditionsByTag("ITERATION_COUNT")[0];s.name="ITERATION_COUNT_"+n+"_WARP_ITERATION_COUNT_"+r,s.additions.fragmentIterations="#define ITERATION_COUNT "+n+".0\n#define WARP_ITERATION_COUNT "+r+".0",i.programManager.getAdditionsByTag("NORMALMAP")[0].disable=!t.noiseNormalMap}});e.exports=o},51754(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(1792);r.register("noisesimplex2d",function(e,t){void 0===e&&(e={});var i=s(e,"config",null),r=s(e,"x",0),o=s(e,"y",0),l=s(e,"width",128),h=s(e,"height",128),u=new a(this.scene,i,r,o,l,h);return void 0!==t&&(e.add=t),n(this.scene,u,e),u})},80308(e,t,i){var n=i(1792);i(39429).register("noisesimplex2d",function(e,t,i,r,s){return this.displayList.add(new n(this.scene,e,t,i,r,s))})},51098(e,t,i){var n=i(83419),r=i(20071),s=i(40987),a=i(13460),o=new n({Extends:r,initialize:function(e,t,i,n,o,l){t||(t={});var h={name:"noiseSimplex3D",fragmentSource:a,shaderAdditions:[{name:"ITERATION_COUNT_1_WARP_ITERATION_COUNT_1",tags:["ITERATION_COUNT"],additions:{fragmentIterations:"#define ITERATION_COUNT 1.0\n#define WARP_ITERATION_COUNT 1.0"}},{name:"NORMALMAP",tags:["NORMALMAP"],additions:{fragmentNormalMap:"#define NORMAL_MAP\n#extension GL_OES_standard_derivatives : enable"},disable:!t.noiseNormalMap}],setupUniforms:this._setupUniforms,updateShaderConfig:this._updateShaderConfig};r.call(this,e,h,i,n,o,l),this.type="NoiseSimplex3D",this.noiseCells=t.noiseCells||[32,32,32],this.noisePeriod=[this.noiseCells[0],this.noiseCells[1],this.noiseCells[2]],t.noisePeriod&&(this.noisePeriod=t.noisePeriod),this.noiseOffset=[0,0,0],t.noiseOffset&&(this.noiseOffset=t.noiseOffset),this.noiseFlow=t.noiseFlow||0,this.noiseWarpAmount=t.noiseWarpAmount||0,this.noiseIterations=t.noiseIterations||1,this.noiseWarpIterations=t.noiseWarpIterations||1,this.noiseDetailPower=t.noiseDetailPower||2,this.noiseFlowPower=t.noiseFlowPower||2,this.noiseContributionPower=t.noiseContributionPower||2,this.noiseWarpDetailPower=t.noiseWarpDetailPower||2,this.noiseWarpFlowPower=t.noiseWarpFlowPower||2,this.noiseWarpContributionPower=t.noiseWarpContributionPower||2,this.noiseNormalMap=!!t.noiseNormalMap,this.noiseNormalScale=1,void 0!==t.noiseNormalScale&&(this.noiseNormalScale=t.noiseNormalScale),this.noiseValueFactor=void 0===t.noiseValueFactor?.5:t.noiseValueFactor,this.noiseValueAdd=void 0===t.noiseValueAdd?.5:t.noiseValueAdd,this.noiseValuePower=void 0===t.noiseValuePower?1:t.noiseValuePower,this.noiseColorStart=new s(0,0,0),this.noiseColorEnd=new s(255,255,255),void 0===t.noiseColorStart&&void 0===t.noiseColorEnd||this.setNoiseColor(t.noiseColorStart,t.noiseColorEnd),this.noiseSeed=t.noiseSeed||[1,2,3]},setNoiseColor:function(e,t){var i;return void 0===e&&(e=0),void 0===t&&(t=16777215),"number"===typeof e?s.IntegerToColor(e,this.noiseColorStart):"str
2ing"===typeof e?s.HexStringToColor(e,this.noiseColorStart):Array.isArray(e)?(i=void 0===e[3]?1:e[3],this.noiseColorStart.setGLTo(e[0],e[1],e[2],i)):e instanceof s&&this.noiseColorStart.setTo(e.red,e.green,e.blue,e.alpha),"number"===typeof t?s.IntegerToColor(t,this.noiseColorEnd):"string"===typeof t?s.HexStringToColor(t,this.noiseColorEnd):Array.isArray(t)?(i=void 0===t[3]?1:t[3],this.noiseColorEnd.setGLTo(t[0],t[1],t[2],i)):t instanceof s&&this.noiseColorEnd.setTo(t.red,t.green,t.blue,t.alpha),this},randomizeNoiseSeed:function(){for(var e=this.noiseSeed.length,t=0;t<e;t++)this.noiseSeed[t]=Math.random();return this},wrapNoise:function(){for(var e=this.noisePeriod.length,t=0;t<e;t++)this.noisePeriod[t]=this.noiseCells[t];return this},_setupUniforms:function(e){e("uCells",this.noiseCells),e("uPeriod",this.noisePeriod),e("uOffset",this.noiseOffset),e("uFlow",this.noiseFlow),e("uDetailPower",this.noiseDetailPower),e("uFlowPower",this.noiseFlowPower),e("uContributionPower",this.noiseContributionPower),e("uWarpDetailPower",this.noiseWarpDetailPower),e("uWarpFlowPower",this.noiseWarpFlowPower),e("uWarpContributionPower",this.noiseWarpContributionPower),e("uWarpAmount",this.noiseWarpAmount),e("uNormalScale",this.noiseNormalScale),e("uValueFactor",this.noiseValueFactor),e("uValueAdd",this.noiseValueAdd),e("uValuePower",this.noiseValuePower),e("uColorStart",this.noiseColorStart.gl),e("uColorEnd",this.noiseColorEnd.gl),e("uSeed",this.noiseSeed)},_updateShaderConfig:function(e,t,i){var n=Math.max(1,Math.floor(t.noiseIterations)),r=Math.max(1,Math.floor(t.noiseWarpIterations)),s=i.programManager.getAdditionsByTag("ITERATION_COUNT")[0];s.name="ITERATION_COUNT_"+n+"_WARP_ITERATION_COUNT_"+r,s.additions.fragmentIterations="#define ITERATION_COUNT "+n+".0\n#define WARP_ITERATION_COUNT "+r+".0",i.programManager.getAdditionsByTag("NORMALMAP")[0].disable=!t.noiseNormalMap}});e.exports=o},71112(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(51098);r.register("noisesimplex3d",function(e,t){void 0===e&&(e={});var i=s(e,"config",null),r=s(e,"x",0),o=s(e,"y",0),l=s(e,"width",128),h=s(e,"height",128),u=new a(this.scene,i,r,o,l,h);return void 0!==t&&(e.add=t),n(this.scene,u,e),u})},73810(e,t,i){var n=i(51098);i(39429).register("noisesimplex3d",function(e,t,i,r,s){return this.displayList.add(new n(this.scene,e,t,i,r,s))})},76472(e,t,i){var n=i(83419),r=i(44777),s=i(37589),a=i(6113),o=i(91389),l=i(90664),h=new n({Extends:r,initialize:function(e){r.call(this,e,null,!1),this.active=!1,this.easeName="Linear",this.r=[],this.g=[],this.b=[]},getMethod:function(){return null===this.propertyValue?0:9},setMethods:function(){var e=this.propertyValue,t=e,i=this.defaultEmit,n=this.defaultUpdate;if(9===this.method){this.start=e[0],this.ease=a("Linear"),this.interpolation=o("linear"),i=this.easedValueEmit,n=this.easeValueUpdate,t=e[0],this.active=!0,this.r.length=0,this.g.length=0,this.b.length=0;for(var r=0;r<e.length;r++){var s=l(e[r]);this.r.push(s.r),this.g.push(s.g),this.b.push(s.b)}}return this.onEmit=i,this.onUpdate=n,this.current=t,this},setEase:function(e){this.easeName=e,this.ease=a(e)},easedValueEmit:function(){return this.current=this.start,this.start},easeValueUpdate:function(e,t,i){var n=this.ease(i),r=this.interpolation(this.r,n),a=this.interpolation(this.g,n),o=this.interpolation(this.b,n),l=s(r,a,o);return this.current=l,l}});e.exports=h},44777(e,t,i){var n=i(30976),r=i(45319),s=i(83419),a=i(99472),o=i(6113),l=i(95540),h=i(91389),u=i(77720),c=i(15994),d=new s({initialize:function(e,t,i){void 0===i&&(i=!1),this.propertyKey=e,this.propertyValue=t,this.defaultValue=t,this.steps=0,this.counter=0,this.yoyo=!1,this.direction=0,this.start=0,this.current=0,this.end=0,this.ease=null,this.interpolation=null,this.emitOnly=i,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.active=!0,this.method=0,this._onEmit,this._onUpdate},loadConfig:function(e,t){void 0===e&&(e={}),t&&(this.propertyKey=t),this.propertyValue=l(e,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(e){var t;switch(this.method){case 1:case 3:case 8:t=e;break;case 2:this.propertyValue.indexOf(e)>=0&&(t=e);break;case 4:var i=(this.end-this.start)/this.steps;t=u(e,i),this.counter=t;break;
vendor: 155,942 bytes, line 2
2case 5:case 6:case 7:t=r(e,this.start,this.end);break;case 9:t=this.start[0]}return this.current=t,this},getMethod:function(){var e=this.propertyValue;if(null===e)return 0;var t=typeof e;if("number"===t)return 1;if(Array.isArray(e))return 2;if("function"===t)return 3;if("object"===t){if(this.hasBoth(e,"start","end"))return this.has(e,"steps")?4:5;if(this.hasBoth(e,"min","max"))return 6;if(this.has(e,"random"))return 7;if(this.hasEither(e,"onEmit","onUpdate"))return 8;if(this.hasEither(e,"values","interpolation"))return 9}return 0},setMethods:function(){var e=this.propertyValue,t=e,i=this.defaultEmit,n=this.defaultUpdate;switch(this.method){case 1:i=this.staticValueEmit;break;case 2:i=this.randomStaticValueEmit,t=e[0];break;case 3:this._onEmit=e,i=this.proxyEmit,t=this.defaultValue;break;case 4:this.start=e.start,this.end=e.end,this.steps=e.steps,this.counter=this.start,this.yoyo=!!this.has(e,"yoyo")&&e.yoyo,this.direction=0,i=this.steppedEmit,t=this.start;break;case 5:this.start=e.start,this.end=e.end;var r=this.has(e,"ease")?e.ease:"Linear";this.ease=o(r,e.easeParams),i=this.has(e,"random")&&e.random?this.randomRangedValueEmit:this.easedValueEmit,n=this.easeValueUpdate,t=this.start;break;case 6:this.start=e.min,this.end=e.max,i=this.has(e,"int")&&e.int?this.randomRangedIntEmit:this.randomRangedValueEmit,t=this.start;break;case 7:var s=e.random;Array.isArray(s)&&(this.start=s[0],this.end=s[1]),i=this.randomRangedIntEmit,t=this.start;break;case 8:this._onEmit=this.has(e,"onEmit")?e.onEmit:this.defaultEmit,this._onUpdate=this.has(e,"onUpdate")?e.onUpdate:this.defaultUpdate,i=this.proxyEmit,n=this.proxyUpdate,t=this.defaultValue;break;case 9:this.start=e.values;var a=this.has(e,"ease")?e.ease:"Linear";this.ease=o(a,e.easeParams),this.interpolation=h(e.interpolation),i=this.easedValueEmit,n=this.easeValueUpdate,t=this.start[0]}return this.onEmit=i,this.onUpdate=n,this.current=t,this},has:function(e,t){return e.hasOwnProperty(t)},hasBoth:function(e,t,i){return e.hasOwnProperty(t)&&e.hasOwnProperty(i)},hasEither:function(e,t,i){return e.hasOwnProperty(t)||e.hasOwnProperty(i)},defaultEmit:function(){return this.defaultValue},defaultUpdate:function(e,t,i,n){return n},proxyEmit:function(e,t,i){var n=this._onEmit(e,t,i);return this.current=n,n},proxyUpdate:function(e,t,i,n){var r=this._onUpdate(e,t,i,n);return this.current=r,r},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var e=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[e],this.current},randomRangedValueEmit:function(e,t){var i=a(this.start,this.end);return e&&e.data[t]&&(e.data[t].min=i,e.data[t].max=this.end),this.current=i,i},randomRangedIntEmit:function(e,t){var i=n(this.start,this.end);return e&&e.data[t]&&(e.data[t].min=i,e.data[t].max=this.end),this.current=i,i},steppedEmit:function(){var e,t=this.counter,i=t,n=(this.end-this.start)/this.steps;this.yoyo?(0===this.direction?(i+=n)>=this.end&&(e=i-this.end,i=this.end-e,this.direction=1):(i-=n)<=this.start&&(e=this.start-i,i=this.start+e,this.direction=0),this.counter=i):this.counter=c(i+n,this.start,this.end);return this.current=t,t},easedValueEmit:function(e,t){if(e&&e.data[t]){var i=e.data[t];i.min=this.start,i.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(e,t,i){var n,r=e.data[t],s=this.ease(i);return n=this.interpolation?this.interpolation(this.start,s):(r.max-r.min)*s+r.min,this.current=n,n},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});e.exports=d},24502(e,t,i){var n=i(83419),r=i(95540),s=i(20286),a=new n({Extends:s,initialize:function(e,t,i,n,a){if("object"===typeof e){var o=e;e=r(o,"x",0),t=r(o,"y",0),i=r(o,"power",0),n=r(o,"epsilon",100),a=r(o,"gravity",50)}else void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===a&&(a=50);s.call(this,e,t,!0),this._gravity=a,this._power=i*a,this._epsilon=n*n},update:function(e,t){var i=this.x-e.x,n=this.y-e.y,r=i*i+n*n;if(0!==r){var s=Math.sqrt(r);r<this._epsilon&&(r=this._epsilon);var a=this._power*t/(r*s)*100;e.velocityX+=i*a,e.velocityY+=n*a}},epsilon:{get:function(){return Math.sqrt(this._epsilon)},set:function(e){this._epsilon=e*e}},power:{get:function(){return this._power/this._gravity},set:function(e){this._power=e*this._gravity}},gravity:{get:function(){return this._gravity},set:function(e){var t=this.power;this._gravity=e,this.power=t}}});e.exports=a},56480(e,t,i){var n=i(9674),r=i(45319),s=i(83419),a=i(39506),o=i(87841),l=i(11520),h=i(26099),u=new s({initialize:function(e){this.emitter=e,this.texture=null,this.frame=null,this.x=0,this.y=0,this.worldPosition=new h,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=e.scene,this.anims=null,this.emitter.anims.length>0&&(this.anims=new n(this)),this.bounds=new o},emit:function(e,t,i,n,r,s){return this.emitter.emit(e,t,i,n,r,s)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.x=e,this.y=t},fire:function(e,t){var i=this.emitter,n=i.ops,r=i.getAnim();if(r?this.anims.play(r):(this.frame=i.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(i.getEmitZone(this),void 0===e?this.x+=n.x.onEmit(this,"x"):n.x.steps>0?this.x+=e+n.x.onEmit(this,"x"):this.x+=e,void 0===t?this.y+=n.y.onEmit(this,"y"):n.y.steps>0?this.y+=t+n.y.onEmit(this,"y"):this.y+=t,this.life=n.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=n.delay.onEmit(this,"delay"),this.holdCurrent=n.hold.onEmit(this,"hold"),this.scaleX=n.scaleX.onEmit(this,"scaleX"),this.scaleY=n.scaleY.active?n.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=n.rotate.onEmit(this,"rotate"),this.rotation=a(this.angle),i.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),0===this.delayCurrent&&i.getDeathZone(this))return this.lifeCurrent=0,!1;var s=n.speedX.onEmit(this,"speedX"),o=n.speedY.active?n.speedY.onEmit(this,"speedY"):s;if(i.radial){var l=a(n.angle.onEmit(this,"angle"));this.velocityX=Math.cos(l)*Math.abs(s),this.velocityY=Math.sin(l)*Math.abs(o)}else if(i.moveTo){var h=n.moveToX.onEmit(this,"moveToX"),u=n.moveToY.onEmit(this,"moveToY"),c=this.life/1e3;this.velocityX=(h-this.x)/c,this.velocityY=(u-this.y)/c}else this.velocityX=s,this.velocityY=o;return i.acceleration&&(this.accelerationX=n.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=n.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=n.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=n.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=n.bounce.onEmit(this,"bounce"),this.alpha=n.alpha.onEmit(this,"alpha"),n.color.active?this.tint=n.color.onEmit(this,"tint"):this.tint=n.tint.onEmit(this,"tint"),!0},update:function(e,t,i){if(this.lifeCurrent<=0)return!(this.holdCurrent>0)||(this.holdCurrent-=e,this.holdCurrent<=0);if(this.delayCurrent>0)return this.delayCurrent-=e,!1;this.anims&&this.anims.update(0,e);var n=this.emitter,s=n.ops,o=1-this.lifeCurrent/this.life;if(this.lifeT=o,this.x=s.x.onUpdate(this,"x",o,this.x),this.y=s.y.onUpdate(this,"y",o,this.y),n.moveTo){var l=s.moveToX.onUpdate(this,"moveToX",o,n.moveToX),h=s.moveToY.onUpdate(this,"moveToY",o,n.moveToY),u=this.lifeCurrent/1e3;this.velocityX=(l-this.x)/u,this.velocityY=(h-this.y)/u}return this.computeVelocity(n,e,t,i,o),this.scaleX=s.scaleX.onUpdate(this,"scaleX",o,this.scaleX),s.scaleY.active?this.scaleY=s.scaleY.onUpdate(this,"scaleY",o,this.scaleY):this.scaleY=this.scaleX,this.angle=s.rotate.onUpdate(this,"rotate",o,this.angle),this.rotation=a(this.angle),n.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=r(s.alpha.onUpdate(this,"alpha",o,this.alpha),0,1),s.color.active?this.tint=s.color.onUpdate(this,"color",o,this.tint):this.tint=s.tint.onUpdate(this,"tint",o,this.tint),this.lifeCurrent-=e,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(e,t,i,n,s){var a=e.ops,o=this.velocityX,l=this.velocityY,h=a.accelerationX.onUpdate(this,"accelerationX",s,this.accelerationX),u=a.accelerationY.onUpdate(this,"accelerationY",s,this.accelerationY),c=a.maxVelocityX.onUpdate(this,"maxVelocityX",s,this.maxVelocityX),d=a.maxVelocityY.onUpdate(this,"maxVelocityY",s,this.maxVelocityY);this.bounce=a.bounce.onUpdate(this,"bounce",s,this.bounce),o+=e.gravityX*i+h*i,l+=e.gravityY*i+u*i,o=r(o,-c,c),l=r(l,-d,d),this.velocityX=o,this.velocityY=l,this.x+=o*i,this.y+=l*i,e.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var f=0;f<n.length;f++){var p=n[f];p.active&&p.update(this,t,i,s)}},setSizeToFrame:function(){},getBounds:function(e){void 0===e&&(e=this.emitter.getWorldTransformMatrix());var t=Math.abs(e.scaleX)*this.scaleX,i=Math.abs(e.scaleY)*this.scaleY,n=this.x,r=this.y,s=this.rotation,a=this.frame.width*t/2,o=this.frame.height*i/2,u=this.bounds,c=new h(n-a,r-o),d=new h(n+a,r-o),f=new h(n-a,r+o),p=new h(n+a,r+o);return 0!==s&&(l(c,n,r,s),l(d,n,r,s),l(f,n,r,s),l(p,n,r,s)),e.transformPoint(c.x,c.y,c),e.transformPoint(d.x,d.y,d),e.transformPoint(f.x,f.y,f),e.transformPoint(p.x,p.y,p),u.x=Math.min(c.x,d.x,f.x,p.x),u.y=Math.min(c.y,d.y,f.y,p.y),u.width=Math.max(c.x,d.x,f.x,p.x)-u.x,u.height=Math.max(c.y,d.y,f.y,p.y)-u.y,u},destroy:function(){this.anims&&this.anims.destroy(),this.anims=null,this.emitter=null,this.texture=null,this.frame=null,this.scene=null}});e.exports=u},69601(e,t,i){var n=i(83419),r=i(20286),s=i(87841),a=new n({Extends:r,initialize:function(e,t,i,n,a,o,l,h){void 0===a&&(a=!0),void 0===o&&(o=!0),void 0===l&&(l=!0),void 0===h&&(h=!0),r.call(this,e,t,!0),this.bounds=new s(e,t,i,n),this.collideLeft=a,this.collideRight=o,this.collideTop=l,this.collideBottom=h},update:function(e){var t=this.bounds,i=-e.bounce,n=e.worldPosition;n.x<t.x&&this.collideLeft?(e.x+=t.x-n.x,e.velocityX*=i):n.x>t.right&&this.collideRight&&(e.x-=n.x-t.right,e.velocityX*=i),n.y<t.y&&this.collideTop?(e.y+=t.y-n.y,e.velocityY*=i):n.y>t.bottom&&this.collideBottom&&(e.y-=n.y-t.bottom,e.velocityY*=i)}});e.exports=a},31600(e,t,i){var n=i(68668),r=i(83419),s=i(31401),a=i(53774),o=i(43459),l=i(26388),h=i(19909),u=i(76472),c=i(44777),d=i(20696),f=i(95643),p=i(95540),m=i(26546),g=i(24502),v=i(69036),y=i(1985),x=i(97022),b=i(86091),w=i(73162),T=i(20074),_=i(269),S=i(56480),E=i(69601),C=i(68875),A=i(87841),k=i(59996),R=i(72905),O=i(90668),P=i(19186),M=i(84322),N=i(61340),I=i(26099),L=i(15994),D=["active","advance","blendMode","colorEase","deathCallback","deathCallbackScope","duration","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxAliveParticles","maxParticles","name","emitting","particleBringToTop","particleClass","radial","sortCallback","sortOrderAsc","sortProperty","stopAfter","tintMode","timeScale","trackVisible","visible"],F=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],B=new r({Extends:f,Mixins:[s.AlphaSingle,s.BlendMode,s.Depth,s.Lighting,s.Mask,s.RenderNodes,s.ScrollFactor,s.Texture,s.Transform,s.Visible,O],initialize:function(e,t,i,n,r){f.call(this,e,"ParticleEmitter"),this.particleClass=S,this.config=null,this.ops={accelerationX:new c("accelerationX",0),accelerationY:new c("accelerationY",0),alpha:new c("alpha",1),angle:new c("angle",{min:0,max:360},!0),bounce:new c("bounce",0),color:new u("color"),delay:new c("delay",0,!0),hold:new c("hold",0,!0),lifespan:new c("lifespan",1e3,!0),maxVelocityX:new c("maxVelocityX",1e4),maxVelocityY:new c("maxVelocityY",1e4),moveToX:new c("moveToX",0),moveToY:new c("moveToY",0),quantity:new c("quantity",1,!0),rotate:new c("rotate",0),scaleX:new c("scaleX",1),scaleY:new c("scaleY",1),speedX:new c("speedX",0,!0),speedY:new c("speedY",0,!0),tint:new c("tint",16777215),x:new c("x",0),y:new c("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 I,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 N,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new w(this),this.tintMode=M.MULTIPLY,this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(t,i),this.setTexture(n),r&&this.setConfig(r)},_defaultRenderNodesMap:{get:function(){return n}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(e){if(!e)return this;this.config=e;var t=0,i="",n=this.ops;for(t=0;t<F.length;t++)n[i=F[t]].loadConfig(e);for(t=0;t<D.length;t++)x(e,i=D[t])&&(this[i]=p(e,i));if(this.acceleration=0!==this.accelerationX||0!==this.accelerationY,this.moveTo=v(e,["moveToX","moveToY"]),x(e,"speed")&&(n.speedX.loadConfig(e,"speed"),n.speedY.active=!1),(y(e,["speedX","speedY"])||this.moveTo)&&(this.radial=!1),x(e,"scale")&&(n.scaleX.loadConfig(e,"scale"),n.scaleY.active=!1),x(e,"callbackScope")){var r=p(e,"callbackScope",null);this.emitCallbackScope=r,this.deathCallbackScope=r}if(x(e,"emitZone")&&this.addEmitZone(e.emitZone),x(e,"deathZone")&&this.addDeathZone(e.deathZone),x(e,"bounds")){var s=this.addParticleBounds(e.bounds);s.collideLeft=p(e,"collideLeft",!0),s.collideRight=p(e,"collideRight",!0),s.collideTop=p(e,"collideTop",!0),s.collideBottom=p(e,"collideBottom",!0)}return x(e,"followOffset")&&this.followOffset.setFromObject(p(e,"followOffset",0)),x(e,"texture")&&this.setTexture(e.texture),x(e,"frame")?this.setEmitterFrame(e.frame):x(e,"anim")&&this.setAnim(e.anim),x(e,"reserve")&&this.reserve(e.reserve),x(e,"advance")&&this.fastForward(e.advance),this.resetCounters(this.frequency,this.emitting),this.emitting&&this.emit(d.START,this),this},updateConfig:function(e){return e&&(this.config?this.setConfig(_(this.config,e)):this.setConfig(e)),this},toJSON:function(){var e=a(this),t=0,i="";for(t=0;t<D.length;t++)e[i=D[t]]=this[i];var n=this.ops;for(t=0;t<F.length;t++)n[i=F[t]]&&(e[i]=n[i].toJSON());return n.speedY.active||(delete e.speedX,e.speed=n.speedX.toJSON()),this.scaleX===this.scaleY&&(delete e.scaleX,delete e.scaleY,e.scale=n.scaleX.toJSON()),e},resetCounters:function(e,t){var i=this.counters;i.fill(0),i[0]=e,t&&(i[5]=1)},startFollow:function(e,t,i,n){return void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=!1),this.follow=e,this.followOffset.set(t,i),this.trackVisible=n,this},stopFollow:function(){return this.follow=null,this.followOffset.set(0,0),this.trackVisible=!1,this},getFrame:function(){var e,t=this.frames,i=t.length;return 1===i?e=t[0]:this.randomFrame?e=m(t):(e=t[this.currentFrame],this.frameCounter++,this.frameCounter===this.frameQuantity&&(this.frameCounter=0,this.currentFrame++,this.currentFrame===i&&(this.currentFrame=0))),this.texture.get(e)},setEmitterFrame:function(e,t,i){void 0===t&&(t=!0),void 0===i&&(i=1),this.randomFrame=t,this.frameQuantity=i,this.currentFrame=0;var n=typeof e;if(this.frames.length=0,Array.isArray(e))this.frames=this.frames.concat(e);else if("string"===n||"number"===n)this.frames.push(e);else if("object"===n){var r=e;(e=p(r,"frames",null))&&(this.frames=this.frames.concat(e));var s=p(r,"cycle",!1);this.randomFrame=!s,this.frameQuantity=p(r,"quantity",i)}return 1===this.frames.length&&(this.frameQuantity=1,this.randomFrame=!1),this},getAnim:function(){var e=this.anims,t=e.length;if(0===t)return null;if(1===t)return e[0];if(this.randomAnim)return m(e);var i=e[this.currentAnim];return this.animCounter++,this.animCounter>=this.animQuantity&&(this.animCounter=0,this.currentAnim=L(this.currentAnim+1,0,t)),i},setAnim:function(e,t,i){void 0===t&&(t=!0),void 0===i&&(i=1),this.randomAnim=t,this.animQuantity=i,this.currentAnim=0;var n=typeof e;if(this.anims.length=0,Array.isArray(e))this.anims=this.anims.concat(e);else if("string"===n)this.anims.push(e);else if("object"===n){var r=e;(e=p(r,"anims",null))&&(this.anims=this.anims.concat(e));var s=p(r,"cycle",!1);this.randomAnim=!s,this.animQuantity=p(r,"quantity",i)}return 1===this.anims.length&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(e){return void 0===e&&(e=!0),this.radial=e,this},addParticleBounds:function(e,t,i,n,r,s,a,o){if("object"===typeof e){var l=e;e=l.x,t=l.y,i=x(l,"w")?l.w:l.width,n=x(l,"h")?l.h:l.height}return this.addParticleProcessor(new E(e,t,i,n,r,s,a,o))},setParticleSpeed:function(e,t){return void 0===t&&(t=e),this.ops.speedX.onChange(e),e===t?this.ops.speedY.active=!1:this.ops.speedY.onChange(t),this.radial=!0,this},setParticleScale:function(e,t){return void 0===e&&(e=1),void 0===t&&(t=e),this.ops.scaleX.onChange(e),this.ops.scaleY.onChange(t),this},setParticleGravity:function(e,t){return this.gravityX=e,this.gravityY=t,this},setParticleAlpha:function(e){return this.ops.alpha.onChange(e),this},setParticleTint:function(e){return this.ops.tint.onChange(e),this},setEmitterAngle:function(e){return this.ops.angle.onChange(e),this},setParticleLifespan:function(e){return this.ops.lifespan.onChange(e),this},setQuantity:function(e){return this.quantity=e,this},setFrequency:function(e,t){return this.frequency=e,this.flowCounter=e>0?e:0,t&&(this.quantity=t),this},addDeathZone:function(e){var t;Array.isArray(e)||(e=[e]);for(var i=[],n=0;n<e.length;n++)if((t=e[n])instanceof l)i.push(t);else if("function"===typeof t.contains)t=new l(t,!0),i.push(t);else{var r=p(t,"type","onEnter"),s=p(t,"source",null);if(s&&"function"===typeof s.contains)t=new l(s,"onEnter"===r),i.push(t)}return this.deathZones=this.deathZones.concat(i),i},removeDeathZone:function(e){return R(this.deathZones,e),this},clearDeathZones:function(){return this.deathZones.length=0,this},addEmitZone:function(e){var t;Array.isArray(e)||(e=[e]);for(var i=[],n=0;n<e.length;n++)if((t=e[n])instanceof C||t instanceof h)i.push(t);else{var r=p(t,"source",null);if(r){var s=p(t,"type","random");if("random"===s&&"function"===typeof r.getRandomPoint)t=new C(r),i.push(t);else if("edge"===s&&"function"===typeof r.getPoints){var a=p(t,"quantity",1),o=p(t,"stepRate",0),l=p(t,"yoyo",!1),u=p(t,"seamless",!0),c=p(t,"total",-1);t=new h(r,a,o,l,u,c),i.push(t)}}}return this.emitZones=this.emitZones.concat(i),i},removeEmitZone:function(e){return R(this.emitZones,e),this.zoneIndex=0,this},clearEmitZones:function(){return this.emitZones.length=0,this.zoneIndex=0,this},getEmitZone:function(e){var t=this.emitZones,i=t.length;if(0!==i){var n=t[this.zoneIndex];n.getPoint(e),n.total>-1&&(this.zoneTotal++,this.zoneTotal===n.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===i&&(this.zoneIndex=0)))}},getDeathZone:function(e){for(var t=this.deathZones,i=0;i<t.length;i++){var n=t[i];if(n.willKill(e))return this.emit(d.DEATH_ZONE,this,e,n),!0}return!1},setEmitZone:function(e){var t;return(t=isFinite(e)?e:this.emitZones.indexOf(e))>=0&&(this.zoneIndex=t),this},addParticleProcessor:function(e){return this.processors.exists(e)||(e.emitter&&e.emitter.removeParticleProcessor(e),this.processors.add(e),e.emitter=this),e},removeParticleProcessor:function(e){return this.processors.exists(e)&&(this.processors.remove(e,!0),e.emitter=null),e},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(e){return this.addParticleProcessor(new g(e))},reserve:function(e){var t=this.dead;if(this.maxParticles>0){var i=this.getParticleCount();i+e>this.maxParticles&&(e=this.maxParticles-(i+e))}for(var n=0;n<e;n++)t.push(new this.particleClass(this));return this},getAliveParticleCount:function(){return this.alive.length},getDeadParticleCount:function(){return this.dead.length},getParticleCount:function(){return this.getAliveParticleCount()+this.getDeadParticleCount()},atLimit:function(){return this.maxParticles>0&&this.getParticleCount()>=this.maxParticles||this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(e,t){return void 0===e?(this.emitCallback=null,this.emitCallbackScope=null):"function"===typeof e&&(this.emitCallback=e,t&&(this.emitCallbackScope=t)),this},onParticleDeath:function(e,t){return void 0===e?(this.deathCallback=null,this.deathCallbackScope=null):"function"===typeof e&&(this.deathCallback=e,t&&(this.deathCallbackScope=t)),this},killAll:function(){for(var e=this.dead,t=this.alive;t.length>0;)e.push(t.pop());return this},forEachAlive:function(e,t){for(var i=this.alive,n=i.length,r=0;r<n;r++)e.call(t,i[r],this);return this},forEachDead:function(e,t){for(var i=this.dead,n=i.length,r=0;r<n;r++)e.call(t,i[r],this);return this},start:function(e,t){return void 0===e&&(e=0),this.emitting||(e>0&&this.fastForward(e),this.emitting=!0,this.resetCounters(this.frequency,!0),void 0!==t&&(this.duration=Math.abs(t)),this.emit(d.START,this)),this},stop:function(e){return void 0===e&&(e=!1),this.emitting&&(this.emitting=!1,e&&this.killAll(),this.emit(d.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(e,t){return void 0===e&&(e=""),void 0===t&&(t=this.true),this.sortProperty=e,this.sortOrderAsc=t,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(e){return e=""!==this.sortProperty?this.depthSortCallback:null,this.sortCallback=e,this},depthSort:function(){return P(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(e,t){var i=this.sortProperty;return this.sortOrderAsc?e[i]-t[i]:t[i]-e[i]},flow:function(e,t,i){return void 0===t&&(t=1),this.emitting=!1,this.frequency=e,this.quantity=t,void 0!==i&&(this.stopAfter=i),this.start()},explode:function(e,t,i){this.frequency=-1,this.resetCounters(-1,!0);var n=this.emitParticle(e,t,i);return this.emit(d.EXPLODE,this,n),n},emitParticleAt:function(e,t,i){return this.emitParticle(i,e,t)},emitParticle:function(e,t,i){if(!this.atLimit()){void 0===e&&(e=this.ops.quantity.onEmit());for(var n=this.dead,r=this.stopAfter,s=this.follow?this.follow.x+this.followOffset.x:t,a=this.follow?this.follow.y+this.followOffset.y:i,o=0;o<e;o++){var l=n.pop();if(l||(l=new this.particleClass(this)),l.fire(s,a)?(this.particleBringToTop?this.alive.push(l):this.alive.unshift(l),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,l,this)):this.dead.push(l),r>0&&(this.stopCounter++,this.stopCounter>=r))break;if(this.atLimit())break}return l}},fastForward:function(e,t){void 0===t&&(t=1e3/60);var i=0;for(this.skipping=!0;i<Math.abs(e);)this.preUpdate(0,t),i+=t;return this.skipping=!1,this},preUpdate:function(e,t){var i=(t*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible),this.getWorldTransformMatrix(this.worldMatrix);var n=this.getProcessors(),r=this.alive,s=this.dead,a=0,o=[],l=r.length;for(a=0;a<l;a++){var h=r[a];h.update(t,i,n)&&o.push({index:a,particle:h})}if((l=o.length)>0){var u=this.deathCallback,c=this.deathCallbackScope;for(a=l-1;a>=0;a--){var f=o[a];r.splice(f.index,1),s.push(f.particle),u&&u.call(c,f.particle),f.particle.setPosition()}}if(this.emitting||this.skipping){if(0===this.frequency)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=t;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=t,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())}else 1===this.completeFlag&&0===r.length&&(this.completeFlag=0,this.emit(d.COMPLETE,this))},overlap:function(e){for(var t=this.getWorldTransformMatrix(),i=this.alive,n=i.length,r=[],s=0;s<n;s++){var a=i[s];k(e,a.getBounds(t))&&r.push(a)}return r},getBounds:function(e,t,i,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=1e3/60),void 0===n&&(n=new A);var r,s,a=this.getWorldTransformMatrix(),l=this.alive,h=!1;if(n.setTo(0,0,0,0),t>0){var u=0;for(this.skipping=!0;u<Math.abs(t);){for(this.preUpdate(0,i),r=0;r<l.length;r++)s=l[r].getBounds(a),h?T(n,s):(h=!0,o(s,n));u+=i}this.skipping=!1}else for(r=0;r<l.length;r++)s=l[r].getBounds(a),h?T(n,s):(h=!0,o(s,n));return e>0&&b(n,e,e),n},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(e){this.ops.x.onChange(e)}},particleY:{get:function(){return this.ops.y.current},set:function(e){this.ops.y.onChange(e)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(e){this.ops.accelerationX.onChange(e)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(e){this.ops.accelerationY.onChange(e)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(e){this.ops.maxVelocityX.onChange(e)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(e){this.ops.maxVelocityY.onChange(e)}},speed:{get:function(){return this.ops.speedX.current},set:function(e){this.ops.speedX.onChange(e),this.ops.speedY.onChange(e)}},speedX:{get:function(){return this.ops.speedX.current},set:function(e){this.ops.speedX.onChange(e)}},speedY:{get:function(){return this.ops.speedY.current},set:function(e){this.ops.speedY.onChange(e)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(e){this.ops.moveToX.onChange(e)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(e){this.ops.moveToY.onChange(e)}},bounce:{get:function(){return this.ops.bounce.current},set:function(e){this.ops.bounce.onChange(e)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(e){this.ops.scaleX.onChange(e)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(e){this.ops.scaleY.onChange(e)}},particleColor:{get:function(){return this.ops.color.current},set:function(e){this.ops.color.onChange(e)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(e){this.ops.color.setEase(e)}},particleTint:{get:function(){return this.ops.tint.current},set:function(e){this.ops.tint.onChange(e)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(e){this.ops.alpha.onChange(e)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(e){this.ops.lifespan.onChange(e)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(e){this.ops.angle.onChange(e)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(e){this.ops.rotate.onChange(e)}},quantity:{get:function(){return this.ops.quantity.current},set:function(e){this.ops.quantity.onChange(e)}},delay:{get:function(){return this.ops.delay.current},set:function(e){this.ops.delay.onChange(e)}},hold:{get:function(){return this.ops.hold.current},set:function(e){this.ops.hold.onChange(e)}},flowCounter:{get:function(){return this.counters[0]},set:function(e){this.counters[0]=e}},frameCounter:{get:function(){return this.counters[1]},set:function(e){this.counters[1]=e}},animCounter:{get:function(){return this.counters[2]},set:function(e){this.counters[2]=e}},elapsed:{get:function(){return this.counters[3]},set:function(e){this.counters[3]=e}},stopCounter:{get:function(){return this.counters[4]},set:function(e){this.counters[4]=e}},completeFlag:{get:function(){return this.counters[5]},set:function(e){this.counters[5]=e}},zoneIndex:{get:function(){return this.counters[6]},set:function(e){this.counters[6]=e}},zoneTotal:{get:function(){return this.counters[7]},set:function(e){this.counters[7]=e}},currentFrame:{get:function(){return this.counters[8]},set:function(e){this.counters[8]=e}},currentAnim:{get:function(){return this.counters[9]},set:function(e){this.counters[9]=e}},preDestroy:function(){var e;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 t=this.ops;for(e=0;e<F.length;e++){t[F[e]].destroy()}for(e=0;e<this.alive.length;e++)this.alive[e].destroy();for(e=0;e<this.dead.length;e++)this.dead[e].destroy();this.ops=null,this.alive=[],this.dead=[],this.worldMatrix.destroy()}});e.exports=B},9871(e,t,i){var n=i(59996),r=i(61340),s=new r,a=new r,o=new r,l=new r;e.exports=function(e,t,i,r){i.addToRenderList(t),s.copyWithScrollFactorFrom(i.matrix,i.scrollX,i.scrollY,t.scrollFactorX,t.scrollFactorY),r&&s.multiply(r),l.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.multiply(l);var h=e.currentContext,u=i.roundPixels,c=i.alpha,d=t.alpha,f=t.alive,p=f.length,m=t.viewBounds;if(t.visible&&0!==p&&(!m||n(m,i.worldView))){t.sortCallback&&t.depthSort(),h.save(),h.globalCompositeOperation=e.blendModes[t.blendMode];for(var g=0;g<p;g++){var v=f[g],y=v.alpha*d*c;if(!(y<=0||0===v.scaleX||0===v.scaleY)){o.applyITRS(v.x,v.y,v.rotation,v.scaleX,v.scaleY),s.multiply(o,a);var x=v.frame,b=x.canvasData;if(b.width>0&&b.height>0){var w=-x.halfWidth,T=-x.halfHeight;h.globalAlpha=y,h.save(),a.setToContext(h),u&&(w=Math.round(w),T=Math.round(T)),h.imageSmoothingEnabled=!x.source.scaleMode,h.drawImage(x.source.image,b.x,b.y,b.width,b.height,w,T,b.width,b.height),h.restore()}}}h.restore()}}},92730(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(95540),o=i(31600);r.register("particles",function(e,t){void 0===e&&(e={});var i=s(e,"key",null),r=a(e,"config",null),l=new o(this.scene,0,0,i);return void 0!==t&&(e.add=t),n(this.scene,l,e),r&&l.setConfig(r),l})},676(e,t,i){var n=i(39429),r=i(31600);n.register("particles",function(e,t,i,n){return void 0!==e&&"string"===typeof e&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new r(this.scene,e,t,i,n))})},90668(e,t,i){var n=i(29747),r=n,s=n;r=i(21188),s=i(9871),e.exports={renderWebGL:r,renderCanvas:s}},21188(e,t,i){var n=i(59996),r=i(61340),s=i(70554),a=new r,o=new r,l=new r,h=new r,u={},c={},d={quad:new Float32Array(8)};e.exports=function(e,t,i,r){var f=i.camera;f.addToRenderList(t),a.copyWithScrollFactorFrom(f.getViewMatrix(!i.useCanvas),f.scrollX,f.scrollY,t.scrollFactorX,t.scrollFactorY),r&&a.multiply(r),h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),a.multiply(h);var p=s.getTintAppendFloatAlpha,m=t.alpha,g=t.alive,v=g.length,y=t.viewBounds;if(0!==v&&(!y||n(y,f.worldView))){t.sortCallback&&t.depthSort();for(var x=t.tintMode,b=0;b<v;b++){var w=g[b],T=w.alpha*m;if(!(T<=0||0===w.scaleX||0===w.scaleY)){l.applyITRS(w.x,w.y,w.rotation,w.scaleX,w.scaleY),a.multiply(l,o);var _=w.frame,S=-_.halfWidth,E=-_.halfHeight;o.setQuad(S,E,S+_.width,E+_.height,d.quad),u.frame!==_&&(u.frame=_,u.uvSource=_);var C,A,k=p(w.tint,T);if(c.tintTopLeft=k,c.tintBottomLeft=k,c.tintTopRight=k,c.tintBottomRight=k,c.tintEffect=x,t.lighting)if(w.texture&&(C=_.texture.dataSource[_.sourceIndex]),A=w.rotation,t.parentContainer)A=t.getWorldTransformMatrix(a,o).rotate(w.rotation).rotationNormalized;var R=t.customRenderNodes,O=t.defaultRenderNodes;(R.Submitter||O.Submitter).run(i,t,r,0,u,d,c,C,A)}}}}},20286(e,t,i){var n=new(i(83419))({initialize:function(e,t,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=!0),this.emitter,this.x=e,this.y=t,this.active=i},update:function(){},destroy:function(){this.emitter=null}});e.exports=n},9774(e){e.exports="complete"},812(e){e.exports="deathzone"},30522(e){e.exports="explode"},96695(e){e.exports="start"},18677(e){e.exports="stop"},20696(e,t,i){e.exports={COMPLETE:i(9774),DEATH_ZONE:i(812),EXPLODE:i(30522),START:i(96695),STOP:i(18677)}},18404(e,t,i){e.exports={EmitterColorOp:i(76472),EmitterOp:i(44777),Events:i(20696),GravityWell:i(24502),Particle:i(56480),ParticleBounds:i(69601),ParticleEmitter:i(31600),ParticleProcessor:i(20286),Zones:i(21024)}},26388(e,t,i){var n=new(i(83419))({initialize:function(e,t){this.source=e,this.killOnEnter=t},willKill:function(e){var t=e.worldPosition,i=this.source.contains(t.x,t.y);return i&&this.killOnEnter||!i&&!this.killOnEnter}});e.exports=n},19909(e,t,i){var n=new(i(83419))({initialize:function(e,t,i,n,r,s){void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===s&&(s=-1),this.source=e,this.points=[],this.quantity=t,this.stepRate=i,this.yoyo=n,this.counter=-1,this.seamless=r,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 e=this.points[0],t=this.points[this.points.length-1];e.x===t.x&&e.y===t.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._length<i&&this.counter>this._length&&(this.counter=this._length-1),this},changeSource:function(e){return this.source=e,this.updateSource()},getPoint:function(e){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var t=this.points[this.counter];t&&(e.x=t.x,e.y=t.y)}});e.exports=n},68875(e,t,i){var n=i(83419),r=i(26099),s=new n({initialize:function(e){this.source=e,this._tempVec=new r,this.total=-1},getPoint:function(e){var t=this._tempVec;this.source.getRandomPoint(t),e.x=t.x,e.y=t.y}});e.exports=s},21024(e,t,i){e.exports={DeathZone:i(26388),EdgeZone:i(19909),RandomZone:i(68875)}},1159(e,t,i){var n=i(83419),r=i(31401),s=i(68287),a=new n({Extends:s,Mixins:[r.PathFollower],initialize:function(e,t,i,n,r,a){s.call(this,e,i,n,r,a),this.path=t},preUpdate:function(e,t){this.anims.update(e,t),this.pathUpdate(e)}});e.exports=a},90145(e,t,i){var n=i(39429),r=i(1159);n.register("follower",function(e,t,i,n,s){var a=new r(this.scene,e,t,i,n,s);return this.displayList.add(a),this.updateList.add(a),a})},80321(e,t,i){var n=i(43246),r=i(83419),s=i(31401),a=i(95643),o=i(30100),l=i(67277),h=new r({Extends:a,Mixins:[s.AlphaSingle,s.BlendMode,s.Depth,s.Mask,s.RenderNodes,s.ScrollFactor,s.Transform,s.Visible,l],initialize:function(e,t,i,n,r,s,l){void 0===n&&(n=16777215),void 0===r&&(r=128),void 0===s&&(s=1),void 0===l&&(l=.1),a.call(this,e,"PointLight"),this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(t,i),this.color=o(n),this.intensity=s,this.attenuation=l,this.width=2*r,this.height=2*r,this._radius=r},_defaultRenderNodesMap:{get:function(){return n}},radius:{get:function(){return this._radius},set:function(e){this._radius=e,this.width=2*e,this.height=2*e}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});e.exports=h},39829(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(80321);r.register("pointlight",function(e,t){void 0===e&&(e={});var i=s(e,"color",16777215),r=s(e,"radius",128),o=s(e,"intensity",1),l=s(e,"attenuation",.1),h=new a(this.scene,0,0,i,r,o,l);return void 0!==t&&(e.add=t),n(this.scene,h,e),h})},71255(e,t,i){var n=i(39429),r=i(80321);n.register("pointlight",function(e,t,i,n,s,a){return this.displayList.add(new r(this.scene,e,t,i,n,s,a))})},67277(e,t,i){var n=i(29747),r=n,s=n;r=i(57787),e.exports={renderWebGL:r,renderCanvas:s}},57787(e,t,i){var n=i(91296);e.exports=function(e,t,i,r){var s=i.camera;s.addToRenderList(t);var a=n(t,s,r,!i.useCanvas).calc,o=t.width,l=t.height,h=-t._radius,u=-t._radius,c=h+o,d=u+l,f=a.getX(0,0),p=a.getY(0,0),m=a.getX(h,u),g=a.getY(h,u),v=a.getX(h,d),y=a.getY(h,d),x=a.getX(c,d),b=a.getY(c,d),w=a.getX(c,u),T=a.getY(c,u);(t.customRenderNodes.BatchHandler||t.defaultRenderNodes.BatchHandler).batch(i,t,m,g,v,y,w,T,x,b,f,p)}},591(e,t,i){var n=i(83419),r=i(45650),s=i(88571),a=i(83999),o=i(58855),l=new n({Extends:s,Mixins:[a],initialize:function(e,t,i,n,a,l){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=32),void 0===a&&(a=32),void 0===l&&(l=!0);var h=e.sys.textures.addDynamicTexture(r(),n,a,l);s.call(this,e,t,i,h),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1,this.renderMode=o.RENDER,this.isCurrentlyRendering=!1},setSize:function(e,t){this.width=e,this.height=t,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=e,i.hitArea.height=t),this},resize:function(e,t,i){return this.texture.setSize(e,t,i),this.setSize(this.texture.width,this.texture.height),this},saveTexture:function(e){var t=this.texture,i=t.key,n=t.manager;return n.exists(i)&&n.get(i)===t?(n.renameTexture(i,e),this._saved=!0):(t.key=e,t.manager.addDynamicTexture(t)&&(this._saved=!0)),t},setRenderMode:function(e,t){return this.renderMode=e,t&&this.texture.preserve(!0),this},render:function(){return this.texture.render(),this},fill:function(e,t,i,n,r,s){return this.texture.fill(e,t,i,n,r,s),this},clear:function(e,t,i,n){return this.texture.clear(e,t,i,n),this},stamp:function(e,t,i,n,r){return this.texture.stamp(e,t,i,n,r),this},erase:function(e,t,i){return this.texture.erase(e,t,i),this},draw:function(e,t,i,n,r){return this.texture.draw(e,t,i,n,r),this},capture:function(e,t){return this.texture.capture(e,t),this},repeat:function(e,t,i,n,r,s,a){return this.texture.repeat(e,t,i,n,r,s,a),this},preserve:function(e){return this.texture.preserve(e),this},callback:function(e){return this.texture.callback(e),this},snapshotArea:function(e,t,i,n,r,s,a){return this.texture.snapshotArea(e,t,i,n,r,s,a),this},snapshot:function(e,t,i){return this.texture.snapshot(e,t,i)},snapshotPixel:function(e,t,i){return this.texture.snapshotPixel(e,t,i)},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});e.exports=l},97272(e,t,i){var n=i(40652),r=i(58855);e.exports=function(e,t,i,s){var a=!0,o=!0;t.renderMode===r.REDRAW?o=!1:t.renderMode===r.RENDER&&(a=!1),a&&t.render(),o&&n(e,t,i,s)}},34495(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(591);r.register("renderTexture",function(e,t){void 0===e&&(e={});var i=s(e,"x",0),r=s(e,"y",0),o=s(e,"width",32),l=s(e,"height",32),h=new a(this.scene,i,r,o,l);return void 0!==t&&(e.add=t),n(this.scene,h,e),h})},60505(e,t,i){var n=i(39429),r=i(591);n.register("renderTexture",function(e,t,i,n){return this.displayList.add(new r(this.scene,e,t,i,n))})},83999(e,t,i){var n=i(29747),r=n,s=n;r=i(53937),s=i(97272),e.exports={renderWebGL:r,renderCanvas:s}},58855(e){e.exports={RENDER:"render",REDRAW:"redraw",ALL:"all"}},53937(e,t,i){var n=i(99517),r=i(58855);e.exports=function(e,t,i,s){if(!t.isCurrentlyRendering){t.isCurrentlyRendering=!0;var a=!0,o=!0;t.renderMode===r.REDRAW?o=!1:t.renderMode===r.RENDER&&(a=!1),a&&t.render(),o&&n(e,t,i,s),t.isCurrentlyRendering=!1}}},77757(e,t,i){var n=i(9674),r=i(85760),s=i(83419),a=i(31401),o=i(95643),l=i(38745),h=i(84322),u=i(26099),c=new s({Extends:o,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Flip,a.Mask,a.RenderNodes,a.Size,a.Texture,a.Transform,a.Visible,a.ScrollFactor,l],initialize:function(e,t,i,r,s,a,l,c,d){void 0===r&&(r="__DEFAULT"),void 0===a&&(a=2),void 0===l&&(l=!0),o.call(this,e,"Rope"),this.anims=new n(this),this.points=a,this.vertices,this.uv,this.colors,this.alphas,this.tintMode="__DEFAULT"===r?h.FILL:h.MULTIPLY,this.dirty=!1,this.horizontal=l,this._flipX=!1,this._flipY=!1,this._perp=new u,this.debugCallback=null,this.debugGraphic=null,this.setTexture(r,s),this.setPosition(t,i),this.setSizeToFrame(),this.initRenderNodes(this._defaultRenderNodesMap),Array.isArray(a)&&this.resizeArrays(a.length),this.setPoints(a,c,d),this.updateVertices()},_defaultRenderNodesMap:{get:function(){return r}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(e,t){var i=this.anims.currentFrame;this.anims.update(e,t),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(e,t,i){return this.anims.play(e,t,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(e,t,i){return void 0===e&&(e=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(e,t,i))},setVertical:function(e,t,i){return void 0===e&&(e=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(e,t,i)):this},setTintMode:function(e){return void 0===e&&(e=h.MULTIPLY),this.tintMode=e,this},setAlphas:function(e,t){var i=this.points.length;if(i<1)return this;var n,r=this.alphas;void 0===e?e=[1]:Array.isArray(e)||void 0!==t||(e=[e]);var s=0;if(void 0!==t)for(n=0;n<i;n++)r[s=2*n]=e,r[s+1]=t;else if(e.length===i)for(n=0;n<i;n++)r[s=2*n]=e[n],r[s+1]=e[n];else{var a=e[0];for(n=0;n<i;n++)s=2*n,e.length>s&&(a=e[s]),r[s]=a,e.length>s+1&&(a=e[s+1]),r[s+1]=a}return this},setColors:function(e){var t=this.points.length;if(t<1)return this;var i,n=this.colors;void 0===e?e=[16777215]:Array.isArray(e)||(e=[e]);var r=0;if(e.length===t)for(i=0;i<t;i++)n[r=2*i]=e[i],n[r+1]=e[i];else{var s=e[0];for(i=0;i<t;i++)r=2*i,e.length>r&&(s=e[r]),n[r]=s,e.length>r+1&&(s=e[r+1]),n[r+1]=s}return this},setPoints:function(e,t,i){if(void 0===e&&(e=2),"number"===typeof e){var n,r,s,a=e;if(a<2&&(a=2),e=[],this.horizontal)for(s=-this.frame.halfWidth,r=this.frame.width/(a-1),n=0;n<a;n++)e.push({x:s+n*r,y:0});else for(s=-this.frame.halfHeight,r=this.frame.height/(a-1),n=0;n<a;n++)e.push({x:0,y:s+n*r})}var o=e.length,l=this.points.length;return o<1?(console.warn("Rope: Not enough points given"),this):(1===o&&(e.unshift({x:0,y:0}),o++),l!==o&&this.resizeArrays(o),this.dirty=!0,this.points=e,this.updateUVs(),void 0!==t&&null!==t&&this.setColors(t),void 0!==i&&null!==i&&this.setAlphas(i),this)},updateUVs:function(){for(var e=this.uv,t=this.points.length,i=this.frame.u0,n=this.frame.v0,r=this.frame.u1,s=this.frame.v1,a=(r-i)/(t-1),o=(s-n)/(t-1),l=0;l<t;l++){var h,u,c,d,f=4*l;this.horizontal?(this._flipX?(h=r-l*a,c=r-l*a):(h=i+l*a,c=i+l*a),this._flipY?(u=s,d=n):(u=n,d=s)):(this._flipX?(h=i,c=r):(h=r,c=i),this._flipY?(u=s-l*o,d=s-l*o):(u=n+l*o,d=n+l*o)),e[f+0]=h,e[f+1]=u,e[f+2]=c,e[f+3]=d}return this},resizeArrays:function(e){var t=this.colors,i=this.alphas;this.vertices=new Float32Array(4*e),this.uv=new Float32Array(4*e),t=new Uint32Array(2*e),i=new Float32Array(2*e);for(var n=0;n<2*e;n++)t[n]=16777215,i[n]=1;return this.colors=t,this.alphas=i,this.dirty=!0,this},updateVertices:function(){var e=this._perp,t=this.points,i=this.vertices,n=t.length;if(this.dirty=!1,!(n<1)){for(var r,s=t[0],a=this.horizontal?this.frame.halfHeight:this.frame.halfWidth,o=0;o<n;o++){var l=t[o],h=4*o;r=o<n-1?t[o+1]:l,e.x=r.y-s.y,e.y=-(r.x-s.x);var u=e.length();e.x/=u,e.y/=u,e.x*=a,e.y*=a,i[h]=l.x+e.x,i[h+1]=l.y+e.y,i[h+2]=l.x-e.x,i[h+3]=l.y-e.y,s=l}return this}},setDebug:function(e,t){return this.debugGraphic=e,this.debugCallback=e||t?t||this.renderDebugVerts:null,this},renderDebugVerts:function(e,t,i){var n=e.debugGraphic,r=i[0],s=i[1],a=i[2],o=i[3];n.lineBetween(r,s,a,o);for(var l=4;l<t;l+=4){var h=i[l+0],u=i[l+1],c=i[l+2],d=i[l+3];n.lineBetween(r,s,h,u),n.lineBetween(a,o,c,d),n.lineBetween(a,o,h,u),n.lineBetween(h,u,c,d),r=h,s=u,a=c,o=d}},preDestroy:function(){this.anims.destroy(),this.anims=void 0,this.points=null,this.vertices=null,this.uv=null,this.colors=null,this.alphas=null,this.debugCallback=null,this.debugGraphic=null},flipX:{get:function(){return this._flipX},set:function(e){return this._flipX=e,this.updateUVs()}},flipY:{get:function(){return this._flipY},set:function(e){return this._flipY=e,this.updateUVs()}}});e.exports=c},95262(e){e.exports=function(){}},26209(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(35154),o=i(77757);r.register("rope",function(e,t){void 0===e&&(e={});var i=s(e,"key",null),r=s(e,"frame",null),l=s(e,"horizontal",!0),h=a(e,"points",void 0),u=a(e,"colors",void 0),c=a(e,"alphas",void 0),d=new o(this.scene,0,0,i,r,h,l,u,c);return void 0!==t&&(e.add=t),n(this.scene,d,e),d})},96819(e,t,i){var n=i(77757);i(39429).register("rope",function(e,t,i,r,s,a,o,l){return this.displayList.add(new n(this.scene,e,t,i,r,s,a,o,l))})},38745(e,t,i){var n=i(29747),r=n,s=n;r=i(20439),s=i(95262),e.exports={renderWebGL:r,renderCanvas:s}},20439(e,t,i){var n=i(91296),r={multiTexturing:!1,smoothPixelArt:!1};e.exports=function(e,t,i,s){var a=i.camera;a.addToRenderList(t);var o,l=n(t,a,s,!i.useCanvas).calc;t.dirty&&t.updateVertices();var h=t.texture;o=h&&null!==h.smoothPixelArt?h.smoothPixelArt:t.scene.sys.game.config.smoothPixelArt,r.smoothPixelArt=o,(t.customRenderNodes.BatchHandler||t.defaultRenderNodes.BatchHandler).batchStrip(i,t,l,t.texture.source[0].glTexture,t.vertices,t.uv,t.colors,t.alphas,t.alpha,t.tintMode,r,t.debugCallback)}},20071(e,t,i){var n=i(71911),r=i(26099),s=i(55403),a=i(87774),o=i(83419),l=i(95540),h=i(31401),u=i(95643),c=i(25479),d=new o({Extends:u,Mixins:[h.BlendMode,h.ComputedSize,h.Depth,h.GetBounds,h.Origin,h.ScrollFactor,h.Transform,h.Visible,c],initialize:function(e,t,i,n,a,o,h){void 0===t&&(t={}),"string"===typeof t&&(t={fragmentKey:t}),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=128),void 0===o&&(o=128),u.call(this,e,"Shader");var c=e.sys.renderer;this.textures=[],this.renderNode=new s(c.renderNodes,t),this.setupUniforms=l(t,"setupUniforms",function(){}),t.updateShaderConfig&&(this.renderNode.updateShaderConfig=t.updateShaderConfig);var d=l(t,"initialUniforms",{});Object.entries(d).forEach(function(e){this.setUniform(e[0],e[1])},this),this.drawingContext=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.textureCoordinateTopLeft=new r(0,1),this.textureCoordinateTopRight=new r(1,1),this.textureCoordinateBottomLeft=new r(0,0),this.textureCoordinateBottomRight=new r(1,0),this.setTextures(h),this.setPosition(i,n),this.setSize(a,o),this.setOrigin(.5,.5)},getUniform:function(e){return this.renderNode.programManager.uniforms[e]},setUniform:function(e,t){return this.renderNode.programManager.setUniform(e,t),this},setTextures:function(e){void 0===e&&(e=[]),this.textures.length=0;for(var t=0;t<e.length;t++){var i=e[t];"string"===typeof i&&(i=this.scene.textures.get(i)),this.textures.push(i)}return this},setRenderToTexture:function(e){if(this.renderToTexture)return this;var t=this.width,i=this.height,r=this.scene.sys.renderer,s=this.scene,o=new n(0,0,t,i).setScene(s.game.scene.systemScene,!1);return this.drawingContext=new a(r,{width:t,height:i,camera:o}),this.glTexture=this.drawingContext.texture,e&&(this.texture=s.sys.textures.addGLTexture(e,this.glTexture)),this.renderToTexture=!0,this.renderWebGLStep(r,this,this.drawingContext),this},renderImmediate:function(){return this.renderWebGLStep(this.scene.renderer,this,this.drawingContext),this},setupUniforms:function(e,t){},setAlpha:function(){return this},setTextureCoordinates:function(e,t,i,n,r,s,a,o){return void 0===e&&(e=0),void 0===t&&(t=1),void 0===i&&(i=1),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),void 0===a&&(a=1),void 0===o&&(o=0),this.textureCoordinateTopLeft.set(e,t),this.textureCoordinateTopRight.set(i,n),this.textureCoordinateBottomLeft.set(r,s),this.textureCoordinateBottomRight.set(a,o),this},setTextureCoordinatesFromFrame:function(e,t){"string"===typeof e&&(t?"string"===typeof t&&(t=this.scene.textures.get(t)):t=this.textures[0],e=t.get(e));var i=e.u0,n=e.v0,r=e.u1,s=e.v1;this.setTextureCoordinates(i,n,r,n,i,s,r,s)},preDestroy:function(){this.renderNode=null,this.textures.length=0,this.drawingContext&&(this.drawingContext.destroy(),this.texture&&this.texture.destroy(),this.drawingContext=null,this.glTexture=null,this.texture=null)}});e.exports=d},80464(e){e.exports=function(){}},54935(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(20071);r.register("shader",function(e,t){void 0===e&&(e={});var i=s(e,"config",null),r=s(e,"x",0),o=s(e,"y",0),l=s(e,"width",128),h=s(e,"height",128),u=new a(this.scene,i,r,o,l,h);return void 0!==t&&(e.add=t),n(this.scene,u,e),u})},74177(e,t,i){var n=i(20071);i(39429).register("shader",function(e,t,i,r,s,a){return this.displayList.add(new n(this.scene,e,t,i,r,s,a))})},25479(e,t,i){var n=i(29747),r=n,s=n;r=i(19257),s=i(80464),e.exports={renderWebGL:r,renderCanvas:s}},19257(e){e.exports=function(e,t,i,n){if(i.camera.addToRenderList(t),t.renderToTexture){if((i=t.drawingContext).width!==t.width||i.height!==t.height){var r=t.width,s=t.height;i.resize(r,s),i.camera.setSize(r,s)}i.use()}t.renderNode.run(i,t,n),t.renderToTexture&&i.release()}},10441(e,t,i){var n=i(70554);e.exports=function(e,t,i,r,s,a,o){var l,h,u,c,d,f=n.getTintAppendFloatAlpha(r.fillColor,r.fillAlpha*s),p=r.pathData,m=r.pathIndexes,g=p.length,v=Array(2*g),y=Array(g),x=0,b=0;for(l=0;l<g;l+=2)h=p[l]-a,u=p[l+1]-o,c=i.getX(h,u),d=i.getY(h,u),v[x++]=c,v[x++]=d,y[b++]=f;t.batch(e,m,v,y,r.lighting)}},65960(e){e.exports=function(e,t,i,n){var r=i||t.fillColor,s=n||t.fillAlpha,a=(16711680&r)>>>16,o=(65280&r)>>>8,l=255&r;e.fillStyle="rgba("+a+","+o+","+l+","+s+")"}},75177(e){e.exports=function(e,t,i,n){var r=i||t.strokeColor,s=n||t.strokeAlpha,a=(16711680&r)>>>16,o=(65280&r)>>>8,l=255&r;e.strokeStyle="rgba("+a+","+o+","+l+","+s+")",e.lineWidth=t.lineWidth}},17803(e,t,i){var n=i(87891),r=i(83419),s=i(31401),a=i(95643),o=i(23031),l=new r({Extends:a,Mixins:[s.AlphaSingle,s.BlendMode,s.Depth,s.GetBounds,s.Lighting,s.Mask,s.Origin,s.RenderNodes,s.ScrollFactor,s.Transform,s.Visible],initialize:function(e,t,i){void 0===t&&(t="Shape"),a.call(this,e,t),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.enableFilters&&(this.filtersFocusContext=!0),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return n}},setFillStyle:function(e,t){return void 0===t&&(t=1),void 0===e?this.isFilled=!1:(this.fillColor=e,this.fillAlpha=t,this.isFilled=!0),this},setStrokeStyle:function(e,t,i){return void 0===i&&(i=1),void 0===e?this.isStroked=!1:(this.lineWidth=e,this.strokeColor=t,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(e){return this.closePath=e,this},setSize:function(e,t){return this.width=e,this.height=t,this},setDisplaySize:function(e,t){return this.displayWidth=e,this.displayHeight=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},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}}});e.exports=l},34682(e,t,i){var n=i(70554);e.exports=function(e,t,i,r,s,a,o){var l=n.getTintAppendFloatAlpha(r.strokeColor,r.strokeAlpha*s),h=r.pathData,u=h.length-1,c=r.lineWidth,d=!r.closePath,f=r.customRenderNodes.StrokePath||r.defaultRenderNodes.StrokePath,p=[];d&&(u-=2);for(var m=0;m<u;m+=2){var g=h[m]-a,v=h[m+1]-o;m>0&&g===h[m-2]&&v===h[m-1]||p.push({x:g,y:v,width:c})}f.run(e,t,p,c,d,i,l,l,l,l,void 0,r.lighting)}},23629(e,t,i){var n=i(13609),r=i(83419),s=i(39506),a=i(94811),o=i(96503),l=i(36383),h=i(17803),u=new r({Extends:h,Mixins:[n],initialize:function(e,t,i,n,r,s,a,l,u){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===r&&(r=0),void 0===s&&(s=360),void 0===a&&(a=!1),h.call(this,e,"Arc",new o(0,0,n)),this._startAngle=r,this._endAngle=s,this._anticlockwise=a,this._iterations=.01,this.setPosition(t,i);var c=2*this.geom.radius;this.setSize(c,c),void 0!==l&&this.setFillStyle(l,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(e){this._iterations=e,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(e){this.geom.radius=e;var t=2*e;this.setSize(t,t),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(e){this._startAngle=e,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(e){this._endAngle=e,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(e){this._anticlockwise=e,this.updateData()}},setRadius:function(e){return this.radius=e,this},setIterations:function(e){return void 0===e&&(e=.01),this.iterations=e,this},setStartAngle:function(e,t){return this._startAngle=e,void 0!==t&&(this._anticlockwise=t),this.updateData()},setEndAngle:function(e,t){return this._endAngle=e,void 0!==t&&(this._anticlockwise=t),this.updateData()},updateData:function(){var e=this._iterations,t=e,i=this.geom.radius,n=s(this._startAngle),r=s(this._endAngle),o=i,h=i;r-=n,this._anticlockwise?r<-l.TAU?r=-l.TAU:r>0&&(r=-l.TAU+r%l.TAU):r>l.TAU?r=l.TAU:r<0&&(r=l.TAU+r%l.TAU);for(var u,c=[o+Math.cos(n)*i,h+Math.sin(n)*i];t<1;)u=r*t+n,c.push(o+Math.cos(u)*i,h+Math.sin(u)*i),t+=e;return u=r+n,c.push(o+Math.cos(u)*i,h+Math.sin(u)*i),c.push(o+Math.cos(n)*i,h+Math.sin(n)*i),this.pathIndexes=a(c),this.pathData=c,this}});e.exports=u},42542(e,t,i){var n=i(39506),r=i(65960),s=i(75177),a=i(20926);e.exports=function(e,t,i,o){i.addToRenderList(t);var l=e.currentContext;if(a(e,l,t,i,o)){var h=t.radius;l.beginPath(),l.arc(h-t.originX*(2*h),h-t.originY*(2*h),h,n(t._startAngle),n(t._endAngle),t.anticlockwise),t.closePath&&l.closePath(),t.isFilled&&(r(l,t),l.fill()),t.isStroked&&(s(l,t),l.stroke()),l.restore()}}},42563(e,t,i){var n=i(23629),r=i(39429);r.register("arc",function(e,t,i,r,s,a,o,l){return this.displayList.add(new n(this.scene,e,t,i,r,s,a,o,l))}),r.register("circle",function(e,t,i,r,s){return this.displayList.add(new n(this.scene,e,t,i,0,360,!1,r,s))})},13609(e,t,i){var n=i(29747),r=n,s=n;r=i(41447),s=i(42542),e.exports={renderWebGL:r,renderCanvas:s}},41447(e,t,i){var n=i(91296),r=i(10441),s=i(34682);e.exports=function(e,t,i,a){var o=i.camera;o.addToRenderList(t);var l=n(t,o,a,!i.useCanvas).calc,h=t._displayOriginX,u=t._displayOriginY,c=t.alpha,d=t.customRenderNodes.Submitter||t.defaultRenderNodes.Submitter;t.isFilled&&r(i,d,l,t,c,h,u),t.isStroked&&s(i,d,l,t,c,h,u)}},89(e,t,i){var n=i(83419),r=i(33141),s=i(94811),a=i(87841),o=i(17803),l=new n({Extends:o,Mixins:[r],initialize:function(e,t,i,n,r,s){void 0===t&&(t=0),void 0===i&&(i=0),o.call(this,e,"Curve",n),this._smoothness=32,this._curveBounds=new a,this.closePath=!1,this.setPosition(t,i),void 0!==r&&this.setFillStyle(r,s),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(e){this._smoothness=e,this.updateData()}},setSmoothness:function(e){return this._smoothness=e,this.updateData()},updateData:function(){var e=this._curveBounds,t=this._smoothness;this.geom.getBounds(e,t),this.setSize(e.width,e.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(t),r=0;r<n.length;r++)i.push(n[r].x,n[r].y);return i.push(n[0].x,n[0].y),this.pathIndexes=s(i),this.pathData=i,this}});e.exports=l},3170(e,t,i){var n=i(65960),r=i(75177),s=i(20926);e.exports=function(e,t,i,a){i.addToRenderList(t);var o=e.currentContext;if(s(e,o,t,i,a)){var l=t._displayOriginX+t._curveBounds.x,h=t._displayOriginY+t._curveBounds.y,u=t.pathData,c=u.length-1,d=u[0]-l,f=u[1]-h;o.beginPath(),o.moveTo(d,f),t.closePath||(c-=2);for(var p=2;p<c;p+=2){var m=u[p]-l,g=u[p+1]-h;o.lineTo(m,g)}t.closePath&&o.closePath(),t.isFilled&&(n(o,t),o.fill()),t.isStroked&&(r(o,t),o.stroke()),o.restore()}}},40511(e,t,i){var n=i(39429),r=i(89);n.register("curve",function(e,t,i,n,s){return this.displayList.add(new r(this.scene,e,t,i,n,s))})},33141(e,t,i){var n=i(29747),r=n,s=n;r=i(53987),s=i(3170),e.exports={renderWebGL:r,renderCanvas:s}},53987(e,t,i){var n=i(10441),r=i(91296),s=i(34682);e.exports=function(e,t,i,a){var o=i.camera;o.addToRenderList(t);var l=r(t,o,a,!i.useCanvas).calc,h=t._displayOriginX+t._curveBounds.x,u=t._displayOriginY+t._curveBounds.y,c=t.alpha,d=t.customRenderNodes.Submitter||t.defaultRenderNodes.Submitter;t.isFilled&&n(i,d,l,t,c,h,u),t.isStroked&&s(i,d,l,t,c,h,u)}},19921(e,t,i){var n=i(83419),r=i(94811),s=i(54205),a=i(8497),o=i(17803),l=new n({Extends:o,Mixins:[s],initialize:function(e,t,i,n,r,s,l){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===r&&(r=128),o.call(this,e,"Ellipse",new a(n/2,r/2,n,r)),this._smoothness=64,this.setPosition(t,i),this.width=n,this.height=r,void 0!==s&&this.setFillStyle(s,l),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(e){this._smoothness=e,this.updateData()}},setSize:function(e,t){return this.width=e,this.height=t,this.geom.setPosition(e/2,t/2),this.geom.setSize(e,t),this.updateDisplayOrigin(),this.updateData()},setSmoothness:function(e){return this._smoothness=e,this.updateData()},updateData:function(){for(var e=[],t=this.geom.getPoints(this._smoothness),i=0;i<t.length;i++)e.push(t[i].x,t[i].y);return e.push(t[0].x,t[0].y),this.pathIndexes=r(e),this.pathData=e,this}});e.exports=l},7930(e,t,i){var n=i(65960),r=i(75177),s=i(20926);e.exports=function(e,t,i,a){i.addToRenderList(t);var o=e.currentContext;if(s(e,o,t,i,a)){var l=t._displayOriginX,h=t._displayOriginY,u=t.pathData,c=u.length-1,d=u[0]-l,f=u[1]-h;o.beginPath(),o.moveTo(d,f),t.closePath||(c-=2);for(var p=2;p<c;p+=2){var m=u[p]-l,g=u[p+1]-h;o.lineTo(m,g)}o.closePath(),t.isFilled&&(n(o,t),o.fill()),t.isStroked&&(r(o,t),o.stroke()),o.restore()}}},1543(e,t,i){var n=i(19921);i(39429).register("ellipse",function(e,t,i,r,s,a){return this.displayList.add(new n(this.scene,e,t,i,r,s,a))})},54205(e,t,i){var n=i(29747),r=n,s=n;r=i(19467),s=i(7930),e.exports={renderWebGL:r,renderCanvas:s}},19467(e,t,i){var n=i(10441),r=i(91296),s=i(34682);e.exports=function(e,t,i,a){var o=i.camera;o.addToRenderList(t);var l=r(t,o,a,!i.useCanvas).calc,h=t._displayOriginX,u=t._displayOriginY,c=t.alpha,d=t.customRenderNodes.Submitter||t.defaultRenderNodes.Submitter;t.isFilled&&n(i,d,l,t,c,h,u),t.isStroked&&s(i,d,l,t,c,h,u)}},30479(e,t,i){var n=i(83419),r=i(17803),s=i(26015),a=new n({Extends:r,Mixins:[s],initialize:function(e,t,i,n,s,a,o,l,h,u,c){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===s&&(s=128),void 0===a&&(a=32),void 0===o&&(o=32),r.call(this,e,"Grid",null),this.cellWidth=a,this.cellHeight=o,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.cellPadding=.5,this.strokeOutside=!1,this.strokeOutsideIncomplete=!0,this.setPosition(t,i),this.setSize(n,s),this.setFillStyle(l,h),void 0!==u&&this.setStrokeStyle(1,u,c),this.updateDisplayOrigin()},setAltFillStyle:function(e,t){return void 0===t&&(t=1),void 0===e?this.showAltCells=!1:(this.altFillColor=e,this.altFillAlpha=t,this.showAltCells=!0),this},setCellPadding:function(e){return this.cellPadding=e||0,this},setStrokeOutside:function(e,t){return this.strokeOutside=e,void 0!==t&&(this.strokeOutsideIncomplete=t),this}});e.exports=a},49912(e,t,i){var n=i(65960),r=i(75177),s=i(20926);e.exports=function(e,t,i,a){i.addToRenderList(t);var o=e.currentContext;if(s(e,o,t,i,a)){var l=-t._displayOriginX,h=-t._displayOriginY,u=i.alpha*t.alpha,c=t.width,d=t.height,f=t.cellWidth,p=t.cellHeight,m=Math.ceil(c/f),g=Math.ceil(d/p),v=f,y=p,x=f-(m*f-c),b=p-(g*p-d),w=t.isFilled,T=t.showAltCells,_=t.isStroked,S=t.cellPadding,E=t.lineWidth/2,C=0,A=0,k=0,R=0,O=0;if(S&&(v-=2*S,y-=2*S,x-=2*S,b-=2*S),w&&t.fillAlpha>0)for(n(o,t),A=0;A<g;A++)for(T&&(k=A%2),C=0;C<m;C++)T&&k?k=0:(k++,O=A<g-1?y:b,(R=C<m-1?v:x)>0&&O>0&&o.fillRect(l+C*f+S,h+A*p+S,R,O));if(T&&t.altFillAlpha>0)for(n(o,t,t.altFillColor,t.altFillAlpha*u),A=0;A<g;A++)for(T&&(k=A%2),C=0;C<m;C++)!T||k?(k=0,O=A<g-1?y:b,(R=C<m-1?v:x)>0&&O>0&&o.fillRect(l+C*f+S,h+A*p+S,R,O)):k=1;if(_&&t.strokeAlpha>0){r(o,t,t.strokeColor,t.strokeAlpha*u);var P=t.strokeOutside?0:1;for(C=P;C<m;C++){var M=C*f;o.beginPath(),o.moveTo(M+l,h),o.lineTo(M+l,d+h),o.stroke()}for(A=P;A<g;A++){var N=A*p;o.beginPath(),o.moveTo(l,N+h),o.lineTo(l+c,N+h),o.stroke()}t.strokeOutside&&(c>E&&(o.beginPath(),o.moveTo(c+l,h),o.lineTo(c+l,d+h),o.stroke()),d>E&&(o.beginPath(),o.moveTo(l,d+h),o.lineTo(c+l,d+h),o.stroke()))}o.restore()}}},34137(e,t,i){var n=i(39429),r=i(30479);n.register("grid",function(e,t,i,n,s,a,o,l,h,u){return this.displayList.add(new r(this.scene,e,t,i,n,s,a,o,l,h,u))})},26015(e,t,i){var n=i(29747),r=n,s=n;r=i(46161),s=i(49912),e.exports={renderWebGL:r,renderCanvas:s}},46161(e,t,i){var n=i(91296),r=i(70554);e.exports=function(e,t,i,s){var a=i.camera;a.addToRenderList(t);var o=t.customRenderNodes.FillRect||t.defaultRenderNodes.FillRect,l=t.customRenderNodes.Submitter||t.defaultRenderNodes.Submitter,h=n(t,a,s,!i.useCanvas).calc;h.translate(-t._displayOriginX,-t._displayOriginY);var u,c=t.alpha,d=t.width,f=t.height,p=t.cellWidth,m=t.cellHeight,g=Math.ceil(d/p),v=Math.ceil(f/m),y=p,x=m,b=p-(g*p-d),w=m-(v*m-f),T=t.isFilled,_=t.showAltCells,S=t.isStroked,E=t.cellPadding,C=t.lineWidth,A=C/2,k=0,R=0,O=0,P=0,M=0;if(E&&(y-=2*E,x-=2*E,b-=2*E,w-=2*E),T&&t.fillAlpha>0)for(u=r.getTintAppendFloatAlpha(t.fillColor,t.fillAlpha*c),R=0;R<v;R++)for(_&&(O=R%2),k=0;k<g;k++)_&&O?O=0:(O++,M=R<v-1?x:w,(P=k<g-1?y:b)>0&&M>0&&o.run(i,h,l,k*p+E,R*m+E,P,M,u,u,u,u,t.lighting));if(_&&t.altFillAlpha>0)for(u=r.getTintAppendFloatAlpha(t.altFillColor,t.altFillAlpha*c),R=0;R<v;R++)for(_&&(O=R%2),k=0;k<g;k++)!_||O?(O=0,M=R<v-1?x:w,(P=k<g-1?y:b)>0&&M>0&&o.run(i,h,l,k*p+E,R*m+E,P,M,u,u,u,u)):O=1;if(S&&t.strokeAlpha>0){var N=r.getTintAppendFloatAlpha(t.strokeColor,t.strokeAlpha*c),I=t.strokeOutside?0:1;for(k=I;k<g;k++){var L=k*p-A;o.run(i,h,l,L,0,C,f,N,N,N,N)}for(R=I;R<v;R++){var D=R*m-A;o.run(i,h,l,0,D,d,C,N,N,N,N)}t.strokeOutside&&t.strokeOutsideIncomplete&&(d>A&&o.run(i,h,l,d-A,0,C,f,N,N,N,N),f>A&&o.run(i,h,l,0,f-A,d,C,N,N,N,N))}}},61475(e,t,i){var n=i(99651),r=i(83419),s=i(17803),a=new r({Extends:s,Mixins:[n],initialize:function(e,t,i,n,r,a,o,l){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=48),void 0===r&&(r=32),void 0===a&&(a=15658734),void 0===o&&(o=10066329),void 0===l&&(l=13421772),s.call(this,e,"IsoBox",null),this.projection=4,this.fillTop=a,this.fillLeft=o,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(t,i),this.setSize(n,r),this.updateDisplayOrigin()},setProjection:function(e){return this.projection=e,this},setFaces:function(e,t,i){return void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===i&&(i=!0),this.showTop=e,this.showLeft=t,this.showRight=i,this},setFillStyle:function(e,t,i){return this.fillTop=e,this.fillLeft=t,this.fillRight=i,this.isFilled=!0,this}});e.exports=a},11508(e,t,i){var n=i(65960),r=i(20926);e.exports=function(e,t,i,s){i.addToRenderList(t);var a=e.currentContext;if(r(e,a,t,i,s)&&t.isFilled){var o=t.width,l=t.height,h=o/2,u=o/t.projection;t.showTop&&(n(a,t,t.fillTop),a.beginPath(),a.moveTo(-h,-l),a.lineTo(0,-u-l),a.lineTo(h,-l),a.lineTo(h,-1),a.lineTo(0,u-1),a.lineTo(-h,-1),a.lineTo(-h,-l),a.fill()),t.showLeft&&(n(a,t,t.fillLeft),a.beginPath(),a.moveTo(-h,0),a.lineTo(0,u),a.lineTo(0,u-l),a.lineTo(-h,-l),a.lineTo(-h,0),a.fill()),t.showRight&&(n(a,t,t.fillRight),a.beginPath(),a.moveTo(h,0),a.lineTo(0,u),a.lineTo(0,u-l),a.lineTo(h,-l),a.lineTo(h,0),a.fill()),a.restore()}}},3933(e,t,i){var n=i(39429),r=i(61475);n.register("isobox",function(e,t,i,n,s,a,o){return this.displayList.add(new r(this.scene,e,t,i,n,s,a,o))})},99651(e,t,i){var n=i(29747),r=n,s=n;r=i(68149),s=i(11508),e.exports={renderWebGL:r,renderCanvas:s}},68149(e,t,i){var n=i(91296),r=i(70554);e.exports=function(e,t,i,s){if(t.isFilled){var a=i.camera;a.addToRenderList(t);var o,l,h,u,c,d,f,p,m,g=t.customRenderNodes.FillTri||t.defaultRenderNodes.FillTri,v=t.customRenderNodes.Submitter||t.defaultRenderNodes.Submitter,y=n(t,a,s,!i.useCanvas).calc,x=t.width,b=t.height,w=x/2,T=x/t.projection,_=t.alpha,S=t.lighting;t.showTop&&(o=r.getTintAppendFloatAlpha(t.fillTop,_),l=-w,h=-b,u=0,c=-T-b,d=w,f=-b,p=0,m=T-b,g.run(i,y,v,l,h,u,c,d,f,o,o,o,S),g.run(i,y,v,d,f,p,m,l,h,o,o,o,S)),t.showLeft&&(o=r.getTintAppendFloatAlpha(t.fillLeft,_),l=-w,h=0,u=0,c=T,d=0,f=T-b,p=-w,m=-b,g.run(i,y,v,l,h,u,c,d,f,o,o,o,S),g.run(i,y,v,d,f,p,m,l,h,o,o,o,S)),t.showRight&&(o=r.getTintAppendFloatAlpha(t.fillRight,_),l=w,h=0,u=0,c=T,d=0,f=T-b,p=w,m=-b,g.run(i,y,v,l,h,u,c,d,f,o,o,o,S),g.run(i,y,v,d,f,p,m,l,h,o,o,o,S))}}},16933(e,t,i){var n=i(83419),r=i(60561),s=i(17803),a=new n({Extends:s,Mixins:[r],initialize:function(e,t,i,n,r,a,o,l,h){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=48),void 0===r&&(r=32),void 0===a&&(a=!1),void 0===o&&(o=15658734),void 0===l&&(l=10066329),void 0===h&&(h=13421772),s.call(this,e,"IsoTriangle",null),this.projection=4,this.fillTop=o,this.fillLeft=l,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=a,this.isFilled=!0,this.setPosition(t,i),this.setSize(n,r),this.updateDisplayOrigin()},setProjection:function(e){return this.projection=e,this},setReversed:function(e){return this.isReversed=e,this},setFaces:function(e,t,i){return void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===i&&(i=!0),this.showTop=e,this.showLeft=t,this.showRight=i,this},setFillStyle:function(e,t,i){return this.fillTop=e,this.fillLeft=t,this.fillRight=i,this.isFilled=!0,this}});e.exports=a},79590(e,t,i){var n=i(65960),r=i(20926);e.exports=function(e,t,i,s){i.addToRenderList(t);var a=e.currentContext;if(r(e,a,t,i,s)&&t.isFilled){var o=t.width,l=t.height,h=o/2,u=o/t.projection,c=t.isReversed;t.showTop&&c&&(n(a,t,t.fillTop),a.beginPath(),a.moveTo(-h,-l),a.lineTo(0,-u-l),a.lineTo(h,-l),a.lineTo(0,u-l),a.fill()),t.showLeft&&(n(a,t,t.fillLeft),a.beginPath(),c?(a.moveTo(-h,-l),a.lineTo(0,u),a.lineTo(0,u-l)):(a.moveTo(-h,0),a.lineTo(0,u),a.lineTo(0,u-l)),a.fill()),t.showRight&&(n(a,t,t.fillRight),a.beginPath(),c?(a.moveTo(h,-l),a.lineTo(0,u),a.lineTo(0,u-l)):(a.moveTo(h,0),a.lineTo(0,u),a.lineTo(0,u-l)),a.fill()),a.restore()}}},49803(e,t,i){var n=i(39429),r=i(16933);n.register("isotriangle",function(e,t,i,n,s,a,o,l){return this.displayList.add(new r(this.scene,e,t,i,n,s,a,o,l))})},60561(e,t,i){var n=i(29747),r=n,s=n;r=i(51503),s=i(79590),e.exports={renderWebGL:r,renderCanvas:s}},51503(e,t,i){var n=i(91296),r=i(70554);e.exports=function(e,t,i,s){if(t.isFilled){var a=i.camera;a.addToRenderList(t);var o,l,h,u,c,d,f,p=t.customRenderNodes.FillTri||t.defaultRenderNodes.FillTri,m=t.customRenderNodes.Submitter||t.defaultRenderNodes.Submitter,g=n(t,a,s,!i.useCanvas).calc,v=t.width,y=t.height,x=v/2,b=v/t.projection,w=t.isReversed,T=t.alpha,_=t.lighting;if(t.showTop&&w){o=r.getTintAppendFloatAlpha(t.fillTop,T),l=-x,h=-y,u=0,c=-b-y,d=x,f=-y;var S=b-y;p.run(i,g,m,l,h,u,c,d,f,o,o,o,_),p.run(i,g,m,d,f,0,S,l,h,o,o,o,_)}t.showLeft&&(o=r.getTintAppendFloatAlpha(t.fillLeft,T),w?(l=-x,h=-y,u=0,c=b,d=0,f=b-y):(l=-x,h=0,u=0,c=b,d=0,f=b-y),p.run(i,g,m,l,h,u,c,d,f,o,o,o,_)),t.showRight&&(o=r.getTintAppendFloatAlpha(t.fillRight,T),w?(l=x,h=-y,u=0,c=b,d=0,f=b-y):(l=x,h=0,u=0,c=b,d=0,f=b-y),p.run(i,g,m,l,h,u,c,d,f,o,o,o,_))}}},57847(e,t,i){var n=i(83419),r=i(17803),s=i(23031),a=i(36823),o=new n({Extends:r,Mixins:[a],initialize:function(e,t,i,n,a,o,l,h,u){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=128),void 0===l&&(l=0),r.call(this,e,"Line",new s(n,a,o,l)),this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(t,i),this.updateSize(),void 0!==h&&this.setStrokeStyle(1,h,u),this.updateDisplayOrigin()},setLineWidth:function(e,t){return void 0===t&&(t=e),this._startWidth=e,this._endWidth=t,this.lineWidth=e,this},setTo:function(e,t,i,n){return this.geom.setTo(e,t,i,n),this.updateSize(),this},updateSize:function(){var e=Math.max(1,this.geom.right-this.geom.left),t=Math.max(1,this.geom.bottom-this.geom.top);return this.setSize(e,t),this}});e.exports=o},17440(e,t,i){var n=i(75177),r=i(20926);e.exports=function(e,t,i,s){i.addToRenderList(t);var a=e.currentContext;if(r(e,a,t,i,s)){var o=t._displayOriginX,l=t._displayOriginY;t.isStroked&&(n(a,t),a.beginPath(),a.moveTo(t.geom.x1-o,t.geom.y1-l),a.lineTo(t.geom.x2-o,t.geom.y2-l),a.stroke()),a.restore()}}},2481(e,t,i){var n=i(39429),r=i(57847);n.register("line",function(e,t,i,n,s,a,o,l){return this.displayList.add(new r(this.scene,e,t,i,n,s,a,o,l))})},36823(e,t,i){var n=i(29747),r=n,s=n;r=i(77385),s=i(17440),e.exports={renderWebGL:r,renderCanvas:s}},77385(e,t,i){var n=i(91296),r=i(70554),s=[{x:0,y:0,width:0},{x:0,y:0,width:0}];e.exports=function(e,t,i,a){var o=i.camera;o.addToRenderList(t);var l=n(t,o,a,!i.useCanvas).calc,h=t._displayOriginX,u=t._displayOriginY,c=t.alpha;if(t.isStroked){var d=r.getTintAppendFloatAlpha(t.strokeColor,t.strokeAlpha*c);s[0].x=t.geom.x1-h,s[0].y=t.geom.y1-u,s[0].width=t._startWidth,s[1].x=t.geom.x2-h,s[1].y=t.geom.y2-u,s[1].width=t._endWidth,(t.customRenderNodes.StrokePath||t.defaultRenderNodes.StrokePath).run(i,t.customRenderNodes.Submitter||t.defaultRenderNodes.Submitter,s,1,!0,l,d,d,d,d,void 0,t.lighting)}}},24949(e,t,i){var n=i(90273),r=i(83419),s=i(94811),a=i(13829),o=i(25717),l=i(17803),h=i(5469),u=new r({Extends:l,Mixins:[n],initialize:function(e,t,i,n,r,s){void 0===t&&(t=0),void 0===i&&(i=0),l.call(this,e,"Polygon",new o(n));var h=a(this.geom);this.setPosition(t,i),this.setSize(h.width,h.height),void 0!==r&&this.setFillStyle(r,s),this.updateDisplayOrigin(),this.updateData()},smooth:function(e){void 0===e&&(e=1);for(var t=0;t<e;t++)h(this.geom);return this.updateData()},setTo:function(e){this.geom.setTo(e);var t=a(this.geom);return this.setSize(t.width,t.height),this.updateDisplayOrigin(),this.updateData()},updateData:function(){for(var e=[],t=this.geom.points,i=0;i<t.length;i++)e.push(t[i].x,t[i].y);return e.push(t[0].x,t[0].y),this.pathIndexes=s(e),this.pathData=e,this}});e.exports=u},38710(e,t,i){var n=i(65960),r=i(75177),s=i(20926);e.exports=function(e,t,i,a){i.addToRenderList(t);var o=e.currentContext;if(s(e,o,t,i,a)){var l=t._displayOriginX,h=t._displayOriginY,u=t.pathData,c=u.length-1,d=u[0]-l,f=u[1]-h;o.beginPath(),o.moveTo(d,f),t.closePath||(c-=2);for(var p=2;p<c;p+=2){var m=u[p]-l,g=u[p+1]-h;o.lineTo(m,g)}t.closePath&&o.closePath(),t.isFilled&&(n(o,t),o.fill()),t.isStroked&&(r(o,t),o.stroke()),o.restore()}}},64827(e,t,i){var n=i(39429),r=i(24949);n.register("polygon",function(e,t,i,n,s){return this.displayList.add(new r(this.scene,e,t,i,n,s))})},90273(e,t,i){var n=i(29747),r=n,s=n;r=i(73695),s=i(38710),e.exports={renderWebGL:r,renderCanvas:s}},73695(e,t,i){var n=i(10441),r=i(91296),s=i(34682);e.exports=function(e,t,i,a){var o=i.camera;o.addToRenderList(t);var l=r(t,o,a,!i.useCanvas).calc,h=t._displayOriginX,u=t._displayOriginY,c=t.alpha,d=t.customRenderNodes.Submitter||t.defaultRenderNodes.Submitter;t.isFilled&&n(i,d,l,t,c,h,u),t.isStroked&&s(i,d,l,t,c,h,u)}},74561(e,t,i){var n=i(83419),r=i(94811),s=i(87841),a=i(17803),o=i(95597),l=new n({Extends:a,Mixins:[o],initialize:function(e,t,i,n,r,o,l){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===r&&(r=128),a.call(this,e,"Rectangle",new s(0,0,n,r)),this.radius=20,this.isRounded=!1,this.setPosition(t,i),this.setSize(n,r),void 0!==o&&this.setFillStyle(o,l),this.updateDisplayOrigin(),this.updateData()},setRounded:function(e){return void 0===e&&(e=16),this.radius=e,this.isRounded=e>0,this.updateRoundedData()},setSize:function(e,t){this.width=e,this.height=t,this.geom.setSize(e,t),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=e,i.hitArea.height=t),this},updateData:function(){if(this.isRounded)return this.updateRoundedData();var e=[],t=this.geom,i=this._tempLine;return t.getLineA(i),e.push(i.x1,i.y1,i.x2,i.y2),t.getLineB(i),e.push(i.x2,i.y2),t.getLineC(i),e.push(i.x2,i.y2),t.getLineD(i),e.push(i.x2,i.y2),this.pathData=e,this},updateRoundedData:function(){var e=[],t=this.width/2,i=this.height/2,n=Math.min(t,i),s=Math.min(this.radius,n),a=t,o=i,l=Math.max(4,Math.min(16,Math.ceil(s/2)));return this.arcTo(e,a-t+s,o-i+s,s,Math.PI,1.5*Math.PI,l),e.push(a+t-s,o-i),this.arcTo(e,a+t-s,o-i+s,s,1.5*Math.PI,2*Math.PI,l),e.push(a+t,o+i-s),this.arcTo(e,a+t-s,o+i-s,s,0,.5*Math.PI,l),e.push(a-t+s,o+i),this.arcTo(e,a-t+s,o+i-s,s,.5*Math.PI,Math.PI,l),e.push(a-t,o-i+s),this.pathIndexes=r(e),this.pathData=e,this},arcTo:function(e,t,i,n,r,s,a){for(var o=(s-r)/a,l=0;l<=a;l++){var h=r+o*l;e.push(t+Math.cos(h)*n,i+Math.sin(h)*n)}}});e.exports=l},48682(e,t,i){var n=i(65960),r=i(75177),s=i(20926),a=function(e,t,i,n,r,s){var a=Math.min(n/2,r/2),o=Math.min(s,a);0!==o?(e.moveTo(t+o,i),e.lineTo(t+n-o,i),e.arcTo(t+n,i,t+n,i+o,o),e.lineTo(t+n,i+r-o),e.arcTo(t+n,i+r,t+n-o,i+r,o),e.lineTo(t+o,i+r),e.arcTo(t,i+r,t,i+r-o,o),e.lineTo(t,i+o),e.arcTo(t,i,t+o,i,o),e.closePath()):e.rect(t,i,n,r)};e.exports=function(e,t,i,o){i.addToRenderList(t);var l=e.currentContext;if(s(e,l,t,i,o)){var h=t._displayOriginX,u=t._displayOriginY;t.isFilled&&(n(l,t),t.isRounded?(l.beginPath(),a(l,-h,-u,t.width,t.height,t.radius),l.fill()):l.fillRect(-h,-u,t.width,t.height)),t.isStroked&&(r(l,t),l.beginPath(),t.isRounded?a(l,-h,-u,t.width,t.height,t.radius):l.rect(-h,-u,t.width,t.height),l.stroke()),l.restore()}}},87959(e,t,i){var n=i(39429),r=i(74561);n.register("rectangle",function(e,t,i,n,s,a){return this.displayList.add(new r(this.scene,e,t,i,n,s,a))})},95597(e,t,i){var n=i(29747),r=n,s=n;r=i(52059),s=i(48682),e.exports={renderWebGL:r,renderCanvas:s}},52059(e,t,i){var n=i(10441),r=i(91296),s=i(34682),a=i(70554);e.exports=function(e,t,i,o){var l=i.camera;l.addToRenderList(t);var h=r(t,l,o,!i.useCanvas).calc,u=t._displayOriginX,c=t._displayOriginY,d=t.alpha,f=t.customRenderNodes,p=t.defaultRenderNodes,m=f.Submitter||p.Submitter;if(t.isFilled)if(t.isRounded)n(i,m,h,t,d,u,c);else{var g=a.getTintAppendFloatAlpha(t.fillColor,t.fillAlpha*d);(f.FillRect||p.FillRect).run(i,h,m,-u,-c,t.width,t.height,g,g,g,g,t.lighting)}t.isStroked&&s(i,m,h,t,d,u,c)}},55911(e,t,i){var n=i(81991),r=i(83419),s=i(94811),a=i(17803),o=new r({Extends:a,Mixins:[n],initialize:function(e,t,i,n,r,s,o,l){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===r&&(r=32),void 0===s&&(s=64),a.call(this,e,"Star",null),this._points=n,this._innerRadius=r,this._outerRadius=s,this.setPosition(t,i),this.setSize(2*s,2*s),void 0!==o&&this.setFillStyle(o,l),this.updateDisplayOrigin(),this.updateData()},setPoints:function(e){return this._points=e,this.updateData()},setInnerRadius:function(e){return this._innerRadius=e,this.updateData()},setOuterRadius:function(e){return this._outerRadius=e,this.updateData()},points:{get:function(){return this._points},set:function(e){this._points=e,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this.updateData()}},updateData:function(){var e=[],t=this._points,i=this._innerRadius,n=this._outerRadius,r=Math.PI/2*3,a=Math.PI/t,o=n,l=n;e.push(o,l+-n);for(var h=0;h<t;h++)e.push(o+Math.cos(r)*n,l+Math.sin(r)*n),r+=a,e.push(o+Math.cos(r)*i,l+Math.sin(r)*i),r+=a;return e.push(o,l+-n),this.pathIndexes=s(e),this.pathData=e,this}});e.exports=o},64272(e,t,i){var n=i(65960),r=i(75177),s=i(20926);e.exports=function(e,t,i,a){i.addToRenderList(t);var o=e.currentContext;if(s(e,o,t,i,a)){var l=t._displayOriginX,h=t._displayOriginY,u=t.pathData,c=u.length-1,d=u[0]-l,f=u[1]-h;o.beginPath(),o.moveTo(d,f),t.closePath||(c-=2);for(var p=2;p<c;p+=2){var m=u[p]-l,g=u[p+1]-h;o.lineTo(m,g)}o.closePath(),t.isFilled&&(n(o,t),o.fill()),t.isStroked&&(r(o,t),o.stroke()),o.restore()}}},93697(e,t,i){var n=i(55911);i(39429).register("star",function(e,t,i,r,s,a,o){return this.displayList.add(new n(this.scene,e,t,i,r,s,a,o))})},81991(e,t,i){var n=i(29747),r=n,s=n;r=i(57017),s=i(64272),e.exports={renderWebGL:r,renderCanvas:s}},57017(e,t,i){var n=i(10441),r=i(91296),s=i(34682);e.exports=function(e,t,i,a){var o=i.camera;o.addToRenderList(t);var l=r(t,o,a,!i.useCanvas).calc,h=t._displayOriginX,u=t._displayOriginY,c=t.alpha,d=t.customRenderNodes.Submitter||t.defaultRenderNodes.Submitter;t.isFilled&&n(i,d,l,t,c,h,u),t.isStroked&&s(i,d,l,t,c,h,u)}},36931(e,t,i){var n=i(83419),r=i(17803),s=i(16483),a=i(96195),o=new n({Extends:r,Mixins:[a],initialize:function(e,t,i,n,a,o,l,h,u,c,d){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===a&&(a=128),void 0===o&&(o=64),void 0===l&&(l=0),void 0===h&&(h=128),void 0===u&&(u=128),r.call(this,e,"Triangle",new s(n,a,o,l,h,u));var f=this.geom.right-this.geom.left,p=this.geom.bottom-this.geom.top;this.setPosition(t,i),this.setSize(f,p),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(e,t,i,n,r,s){return this.geom.setTo(e,t,i,n,r,s),this.updateData()},updateData:function(){var e=[],t=this.geom,i=this._tempLine;return t.getLineA(i),e.push(i.x1,i.y1,i.x2,i.y2),t.getLineB(i),e.push(i.x2,i.y2),t.getLineC(i),e.push(i.x2,i.y2),this.pathData=e,this}});e.exports=o},85172(e,t,i){var n=i(65960),r=i(75177),s=i(20926);e.exports=function(e,t,i,a){i.addToRenderList(t);var o=e.currentContext;if(s(e,o,t,i,a)){var l=t._displayOriginX,h=t._displayOriginY,u=t.geom.x1-l,c=t.geom.y1-h,d=t.geom.x2-l,f=t.geom.y2-h,p=t.geom.x3-l,m=t.geom.y3-h;o.beginPath(),o.moveTo(u,c),o.lineTo(d,f),o.lineTo(p,m),o.closePath(),t.isFilled&&(n(o,t),o.fill()),t.isStroked&&(r(o,t),o.stroke()),o.restore()}}},45245(e,t,i){var n=i(39429),r=i(36931);n.register("triangle",function(e,t,i,n,s,a,o,l,h,u){return this.displayList.add(new r(this.scene,e,t,i,n,s,a,o,l,h,u))})},96195(e,t,i){var n=i(29747),r=n,s=n;r=i(83253),s=i(85172),e.exports={renderWebGL:r,renderCanvas:s}},83253(e,t,i){var n=i(91296),r=i(34682),s=i(70554);e.exports=function(e,t,i,a){var o=i.camera;o.addToRenderList(t);var l=n(t,o,a,!i.useCanvas).calc,h=t._displayOriginX,u=t._displayOriginY,c=t.alpha,d=t.customRenderNodes,f=t.defaultRenderNodes,p=d.Submitter||f.Submitter;if(t.isFilled){var m=s.getTintAppendFloatAlpha(t.fillColor,t.fillAlpha*c),g=t.geom.x1-h,v=t.geom.y1-u,y=t.geom.x2-h,x=t.geom.y2-u,b=t.geom.x3-h,w=t.geom.y3-u;(d.FillTri||f.FillTri).run(i,l,p,g,v,y,x,b,w,m,m,m,t.lighting)}t.isStroked&&r(i,p,l,t,c,h,u)}},68287(e,t,i){var n=i(9674),r=i(40939),s=i(83419),a=i(31401),o=i(95643),l=i(92751),h=new s({Extends:o,Mixins:[a.Alpha,a.BlendMode,a.Depth,a.Flip,a.GetBounds,a.Lighting,a.Mask,a.Origin,a.RenderNodes,a.ScrollFactor,a.Size,a.TextureCrop,a.Tint,a.Transform,a.Visible,l],initialize:function(e,t,i,r,s){o.call(this,e,"Sprite"),this._crop=this.resetCropObject(),this.anims=new n(this),this.setTexture(r,s),this.setPosition(t,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(e,t){this.anims.update(e,t)},play:function(e,t){return this.anims.play(e,t)},playReverse:function(e,t){return this.anims.playReverse(e,t)},playAfterDelay:function(e,t){return this.anims.playAfterDelay(e,t)},playAfterRepeat:function(e,t){return this.anims.playAfterRepeat(e,t)},chain:function(e){return this.anims.chain(e)},stop:function(){return this.anims.stop()},stopAfterDelay:function(e){return this.anims.stopAfterDelay(e)},stopAfterRepeat:function(e){return this.anims.stopAfterRepeat(e)},stopOnFrame:function(e){return this.anims.stopOnFrame(e)},toJSON:function(){return a.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});e.exports=h},76552(e){e.exports=function(e,t,i,n){i.addToRenderList(t),e.batchSprite(t,t.frame,i,n)}},15567(e,t,i){var n=i(25305),r=i(13059),s=i(44603),a=i(23568),o=i(68287);s.register("sprite",function(e,t){void 0===e&&(e={});var i=a(e,"key",null),s=a(e,"frame",null),l=new o(this.scene,0,0,i,s);return void 0!==t&&(e.add=t),n(this.scene,l,e),r(l,e),l})},46409(e,t,i){var n=i(39429),r=i(68287);n.register("sprite",function(e,t,i,n){return this.displayList.add(new r(this.scene,e,t,i,n))})},92751(e,t,i){var n=i(29747),r=n,s=n;r=i(9409),s=i(76552),e.exports={renderWebGL:r,renderCanvas:s}},9409(e){e.exports=function(e,t,i,n){i.camera.addToRenderList(t);var r=t.customRenderNodes,s=t.defaultRenderNodes;(r.Submitter||s.Submitter).run(i,t,n,0,r.Texturer||s.Texturer,r.Transformer||s.Transformer)}},18207(e){e.exports={None:0,Power0:1,Power1:10,Power2:20,Power3:30,Power4:40,Linear:1,Gravity:2,Quad:10,"Quad.easeOut":10,"Quad.easeIn":11,"Quad.easeInOut":12,Cubic:20,"Cubic.easeOut":20,"Cubic.easeIn":21,"Cubic.easeInOut":22,Quart:30,"Quart.easeOut":30,"Quart.easeIn":31,"Quart.easeInOut":32,Quint:40,"Quint.easeOut":40,"Quint.easeIn":41,"Quint.easeInOut":42,Sine:50,"Sine.easeOut":50,"Sine.easeIn":51,"Sine.easeInOut":52,Expo:60,"Expo.easeOut":60,"Expo.easeIn":61,"Expo.easeInOut":62,Circ:70,"Circ.easeOut":70,"Circ.easeIn":71,"Circ.easeInOut":72,Back:90,"Back.easeOut":90,"Back.easeIn":91,"Back.easeInOut":92,Bounce:100,"Bounce.easeOut":100,"Bounce.easeIn":101,"Bounce.easeInOut":102,Stepped:110,Smoothstep:120,"Smoothstep.easeOut":120,"Smoothstep.easeIn":121,"Smoothstep.easeInOut":122}},68218(e,t,i){for(var n=i(18207),r={},s=Object.keys(n),a=s.length,o=0;o<a;o++){var l=s[o];r[n[l]]=l}e.exports=r},76573(e,t,i){var n=i(83419),r=i(90330),s=i(31401),a=i(95643),o=i(53384),l=i(70554),h=i(18207),u=i(68218),c=i(71238),d=l.getTintAppendFloatAlpha,f=new n({Extends:a,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.ElapseTimer,s.Lighting,s.RenderNodes,s.TextureCrop,s.Visible,c],initialize:function(e,t,i){a.call(this,e,"SpriteGPULayer"),this.memberCount=0,this.size=Math.max(i,0),this._segments=24,this.MAX_BUFFER_UPDATE_SEGMENTS_FULL=16777215,this.bufferUpdateSegments=0,this.bufferUpdateSegmentSize=Math.ceil(this.size/this._segments),this.gravity=1024,this._animationsEnabled={};for(var n=Object.keys(h),s=n.length,l=0;l<s;l++)this._animationsEnabled[n[l]]=!1;this.EASE=h,this.EASE_CODES=u,this.setTexture(t),this.initRenderNodes(new r),this.frameDataTexture=null,this.frameDataIndices={},this.frameDataIndicesInv={},this.animationData=[],this.animationDataNames={},this.animationDataIndices={},this.generateFrameDataTexture(),this.submitterNode=new o(e.renderer.renderNodes,{},this),this.defaultRenderNodes.Submitter=this.submitterNode,this.renderNodeData[this.submitterNode.name]={},this.resize(this.size),this.nextMember=new ArrayBuffer(this.getDataByteSize()),this.nextMemberF32=new Float32Array(this.nextMember),this.nextMemberU32=new Uint32Array(this.nextMember)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(e,t){this.updateTimer(e,t)},getDataByteSize:function(){return this.submitterNode.instanceBufferLayout.layout.stride},getShaderFeatures:function(){for(var e=[],t=Object.keys(this._animationsEnabled),i=t.length,n=0;n<i;n++)this._animationsEnabled[t[n]]&&e.push(t[n]);return e},setAnimations:function(e){for(var t=e.length,i=this.texture.getFrameNames(!0).length,n=0;n<t;n++){var r=e[n],s={};r.key?(s.name=r.key,s.duration=r.duration,s.frames=r.frames):(s.name=r.name,s.duration=r.duration,s.frames=r.frames.slice()),s.index=i,s.frameCount=s.frames.length,i+=s.frameCount,this.animationData.push(s),this.animationDataNames[s.name]=s,this.animationDataIndices[s.index]=s}return this.generateFrameDataTexture(),this},generateFrameDataTexture:function(){var e=this.texture,t=e.getFrameNames(!0),i=t.length;this.frameDataIndices={},this.frameDataIndicesInv={};for(var n=0;n<i;n++){var r=t[n],s=e.get(r);this.frameDataIndices[r]=n,this.frameDataIndicesInv[n]=r}var a=this.animationData.length;for(n=0;n<a;n++)for(var o=this.animationData[n],l=o.frameCount,h=0;h<l;h++)t.push(o.frames[h]);var u=3*(i=t.length),c=Math.min(u,4096),d=Math.ceil(u/4096),f=c*d*4,p=e.manager,m=new ArrayBuffer(f),g=new Uint16Array(m),v=new Uint8Array(m);for(n=0;n<i;n++){var y=t[n];if("string"===typeof y)s=e.get(t[n]);else if(y&&void 0!==y.key){s=p.get(y.key).get(y.frame)}else s=y.frame;var x=3*n*g.BYTES_PER_ELEMENT;g[x]=s.cutX,g[x+1]=s.cutY,g[x+2]=s.cutWidth,g[x+3]=s.cutHeight;var b=.5,w=.5;s.customPivot&&(b=s.pivotX,w=s.pivotY),g[x+4]=Math.round((b-.5)*s.cutWidth)+32768,g[x+5]=Math.round((w-.5)*s.cutHeight)+32768}this.frameDataTexture&&this.frameDataTexture.destroy(),this.frameDataTexture=this.scene.renderer.createUint8ArrayTexture(v,c,d,!1,!1)},resize:function(e,t){var i=this.submitterNode.instanceBufferLayout,n=i.buffer,r=n.viewU8,s=e*i.layout.stride;if(this.size=e,n.resize(s),t)this.memberCount=0;else{var a=n.viewU8;a.set(r.subarray(0,Math.min(a.byteLength,s))),this.memberCount=Math.min(this.memberCount,e)}return this.bufferUpdateSegmentSize=Math.ceil(this.size/this._segments),this.setAllSegmentsNeedUpdate(),this},setSegmentNeedsUpdate:function(e){if(!(e<0||e>=this.size||this.bufferUpdateSegments===this.MAX_BUFFER_UPDATE_SEGMENTS_FULL)){var t=Math.floor(e/this.bufferUpdateSegmentSize);this.bufferUpdateSegments|=1<<t}},setAllSegmentsNeedUpdate:function(){this.bufferUpdateSegments=this.MAX_BUFFER_UPDATE_SEGMENTS_FULL},clearAllSegmentsNeedUpdate:function(){this.bufferUpdateSegments=0},addData:function(e){if(this.memberCount>=this.size)return this;var t=this.submitterNode.instanceBufferLayout,i=t.buffer.viewF32,n=this.memberCount*t.layout.stride;return i.set(e,n/i.BYTES_PER_ELEMENT),this.setSegmentNeedsUpdate(this.memberCount),this.memberCount++,this},addMember:function(e){if(this.memberCount>=this.size)return this;var t=this.nextMemberF32,i=this.nextMemberU32;e||(e={});var n=this.frame;if(void 0!==e.frame&&(n=e.frame.base?e.frame.base:e.frame),"string"===typeof n&&!(n=this.texture.get(n)))return this;var r=0;this._setAnimatedValue(e.x,r),r+=4,this._setAnimatedValue(e.y,r),r+=4,this._setAnimatedValue(e.rotation,r),r+=4,this._setAnimatedValue(e.scaleX,r,1),r+=4,this._setAnimatedValue(e.scaleY,r,1),r+=4,this._setAnimatedValue(e.alpha,r,1),r+=4;var s=e.animation;if(s){var a;if("string"===typeof s||"number"===typeof s)a="string"===typeof s?this.animationDataNames[s]:this.animationDataIndices[s],this._setAnimatedValue({base:a.index,amplitude:a.frameCount,duration:a.duration,ease:h.Linear,yoyo:!1},r);else{var o=s.base;a="string"===typeof o?this.animationDataNames[o]:"number"===typeof o?this.animationDataIndices[o]:this.animationData[0],this._setAnimatedValue({base:a.index,amplitude:"number"===typeof s.amplitude?s.amplitude:a.frameCount,duration:s.duration||a.duration,delay:s.delay||0,ease:s.ease||h.Linear,yoyo:!!s.yoyo},r)}}else{var l=this.frameDataIndices[n.name],u=e.frame;u&&void 0!==u.base?this._setAnimatedValue({base:l,amplitude:u.amplitude,duration:u.duration,delay:u.delay,ease:u.ease,yoyo:u.yoyo},r):this._setAnimatedValue(l,r)}r+=4,this._setAnimatedValue(e.tintBlend,r,1),r+=4;var c=void 0===e.tintBottomLeft?16777215:e.tintBottomLeft,f=void 0===e.tintTopLeft?16777215:e.tintTopLeft,p=void 0===e.tintBottomRight?16777215:e.tintBottomRight,m=void 0===e.tintTopRight?16777215:e.tintTopRight,g=void 0===e.alphaBottomLeft?1:e.alphaBottomLeft,v=void 0===e.alphaTopLeft?1:e.alphaTopLeft,y=void 0===e.alphaBottomRight?1:e.alphaBottomRight,x=void 0===e.alphaTopRight?1:e.alphaTopRight;return i[r++]=d(c,g),i[r++]=d(f,v),i[r++]=d(p,y),i[r++]=d(m,x),t[r++]=void 0===e.originX?.5:e.originX,t[r++]=void 0===e.originY?.5:e.originY,t[r++]=e.tintMode||0,t[r++]=void 0===e.creationTime?this.timeElapsed:e.creationTime,t[r++]=void 0===e.scrollFactorX?1:e.scrollFactorX,t[r++]=void 0===e.scrollFactorY?1:e.scrollFactorY,this.addData(this.nextMemberF32),this},editMember:function(e,t){if(e<0||e>=this.memberCount)return this;var i=this.memberCount;return this.memberCount=e,this.addMember(t),this.memberCount=i,this},patchMember:function(e,t,i){if(!(e<0||e>=this.memberCount)){var n=this.submitterNode.instanceBufferLayout,r=n.buffer,s=e*n.layout.stride,a=r.viewU32,o=s/4;if(i)for(var l=0;l<t.length;l++)i[l]&&(a[o+l]=t[l]);else a.set(t,o);this.setSegmentNeedsUpdate(e)}},getMember:function(e){if(e<0||e>=this.memberCount)return null;var t=this.submitterNode.instanceBufferLayout,i=t.buffer,n=e*t.layout.stride,r=i.viewF32,s=i.viewU32,a={},o=n/r.BYTES_PER_ELEMENT;a.x=this._getAnimatedValue(o),o+=4,a.y=this._getAnimatedValue(o),o+=4,a.rotation=this._getAnimatedValue(o),o+=4,a.scaleX=this._getAnimatedValue(o),o+=4,a.scaleY=this._getAnimatedValue(o),o+=4,a.alpha=this._getAnimatedValue(o),o+=4;var l=this._getAnimatedValue(o);o+=4,"number"!==typeof l&&(l=l.base);var h=this.frameDataIndicesInv[l];if(void 0===h){var u=this.animationDataIndices[l];u&&(a.animation=u.name)}else a.frame=h;return a.tintBlend=this._getAnimatedValue(o),o+=4,a.tintBottomLeft=s[o++],a.tintTopLeft=s[o++],a.tintBottomRight=s[o++],a.tintTopRight=s[o++],a.alphaBottomLeft=(a.tintBottomLeft>>>24)/255,a.alphaTopLeft=(a.tintTopLeft>>>24)/255,a.alphaBottomRight=(a.tintBottomRight>>>24)/255,a.alphaTopRight=(a.tintTopRight>>>24)/255,a.tintBottomLeft&=16777215,a.tintTopLeft&=16777215,a.tintBottomRight&=16777215,a.tintTopRight&=16777215,a.originX=r[o++],a.originY=r[o++],a.tintMode=r[o++],a.creationTime=r[o++],a.scrollFactorX=r[o++],a.scrollFactorY=r[o++],a},getMemberData:function(e,t){if(e<0||e>=this.memberCount)return null;var i=this.submitterNode.instanceBufferLayout,n=i.buffer,r=i.layout.stride,s=e*r;t||(t=this.nextMemberU32);var a=n.viewU32,o=a.BYTES_PER_ELEMENT;return t.set(a.subarray(s/o,s/o+r/o)),t},removeMembers:function(e,t){if(e<0||e>=this.memberCount)return this;void 0===t&&(t=1),t=Math.min(t,this.memberCount-e);var i=this.submitterNode.instanceBufferLayout,n=i.layout.stride,r=e*n,s=t*n,a=i.buffer.viewU8;a.set(a.subarray(r+s),r);for(var o=e;o<this.memberCount;o+=this.bufferUpdateSegmentSize)this.setSegmentNeedsUpdate(o);return this.memberCount-=t,this},insertMembers:function(e,t){if(e<0||e>this.memberCount)return this;Array.isArray(t)||(t=[t]);var i=this.memberCount,n=this.submitterNode.instanceBufferLayout,r=n.layout.stride,s=e*r,a=t.length*r;n.buffer.viewU8.copyWithin(s+a,s,i*r),this.memberCount=e;for(var o=0;o<t.length;o++)this.addMember(t[o]);for(this.memberCount=Math.min(this.size,i+t.length),o=e;o<this.memberCount;o+=this.bufferUpdateSegmentSize)this.setSegmentNeedsUpdate(o);return this},insertMembersData:function(e,t){if(e<0||e>this.memberCount)return this;var i=t.length*t.BYTES_PER_ELEMENT,n=this.submitterNode.instanceBufferLayout,r=n.layout.stride,s=e*r;n.buffer.viewU8.copyWithin(s+i,s,this.memberCount*r),n.buffer.viewU32.set(t,s/t.BYTES_PER_ELEMENT),this.memberCount=Math.min(this.size,this.memberCount+i/r);for(var a=e;a<this.memberCount;a+=this.bufferUpdateSegmentSize)this.setSegmentNeedsUpdate(a);return this},_setAnimatedValue:function(e,t,i){var n=this.nextMemberF32;if(void 0===i&&(i=0),"number"===typeof e)n[t++]=e,n[t++]=0,n[t++]=0,n[t]=0;else if(void 0===e)n[t++]=i,n[t++]=0,n[t++]=0,n[t]=0;else{var r=e.base||0,s=e.ease||0,a=e.amplitude||0,o=Math.abs(e.duration||0),l=e.delay||0,u=void 0===e.yoyo||e.yoyo,c=void 0===e.loop||e.loop;"string"===typeof s&&(s=this.EASE[s]||0);var d=this.EASE_CODES[s];if(this._animationsEnabled[d]||this.setAnimationEnabled(d,!0),s===h.Gravity){var f=e.velocity||0,p=e.gravityFactor||1;p>=1?p=0:p<-1&&(p=-.999),p=(p+1)/2,a=Math.floor(f)+p}(l=o>0?l/o%2:0)<0&&(l+=2),l/=2,l+=s,u&&(o=-o),c||(l=-l),n[t++]=r,n[t++]=a,n[t++]=o,n[t]=l}},_getAnimatedValue:function(e){var t=this.submitterNode.instanceBufferLayout.buffer.viewF32,i=t[e++],n=t[e++],r=t[e++],s=t[e];if(0===n||0===r||0===o)return i;s>0||(s=-s);var a=r<0;a&&(r=-r);var o=Math.floor(s);if(s=(s-=o)*r*2%r,o===h.Gravity){var l=Math.floor(n),u=2*(n-l)-1;return 0===u&&(u=1),{base:i,ease:o,duration:r,delay:s,yoyo:a,velocity:l,gravityFactor:u}}return{base:i,ease:o,amplitude:n,duration:r,delay:s,yoyo:a}},setAnimationEnabled:function(e,t){return this._animationsEnabled[e]=!!t,this},preDestroy:function(){this.frameDataTexture.destroy()}});e.exports=f},16193(e,t,i){var n=i(10312),r=i(44603),s=i(23568),a=i(76573);r.register("spriteGPULayer",function(e,t){void 0===e&&(e={});var i=s(e,"key",null),r=s(e,"size",1),o=new a(this.scene,i,r);return void 0!==t&&(e.add=t),o.alpha=s(e,"alpha",1),o.blendMode=s(e,"blendMode",n.NORMAL),o.visible=s(e,"visible",!0),t&&this.scene.sys.displayList.add(o),o})},96019(e,t,i){var n=i(76573);i(39429).register("spriteGPULayer",function(e,t){return this.displayList.add(new n(this.scene,e,t))})},71238(e,t,i){var n=i(29747),r=i(97591),s=n;e.exports={renderWebGL:r,renderCanvas:s}},97591(e){e.exports=function(e,t,i,n){i.camera.addToRenderList(t);var r=t.customRenderNodes,s=t.defaultRenderNodes;(r.Submitter||s.Submitter).run(i)}},14727(e,t,i){var n=i(78705),r=i(83419),s=i(88571),a=i(74759),o=new r({Extends:s,Mixins:[a],initialize:function(e,t,i,n,r){s.call(this,e,t,i,n,r),this.type="Stamp"},_defaultRenderNodesMap:{get:function(){return n}}});e.exports=o},656(e,t,i){var n=new(i(61340));e.exports=function(e,t,i){i.addToRenderList(t),n.copyFrom(i.matrix),i.matrix.loadIdentity();var r=i.scrollX,s=i.scrollY;i.scrollX=0,i.scrollY=0,e.batchSprite(t,t.frame,i),i.scrollX=r,i.scrollY=s,i.matrix.copyFrom(n)}},31479(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(14727);r.register("stamp",function(e,t){void 0===e&&(e={});var i=s(e,"key",null),r=s(e,"frame",null),o=new a(this.scene,0,0,i,r);return void 0!==t&&(e.add=t),n(this.scene,o,e),o})},85326(e,t,i){var n=i(14727);i(39429).register("stamp",function(e,t,i,r){return this.displayList.add(new n(this.scene,e,t,i,r))})},74759(e,t,i){var n=i(29747);n=i(656),e.exports={renderCanvas:n}},84423(e,t,i){var n=i(83419),r=i(43520),s=i(31559),a=i(93595),o=new n({Extends:s,Mixins:[r],initialize:function(e,t,i,n,r){s.call(this,e,t,i,n),r?(void 0!==r.stencilAlphaStrategy?this.stencilAlphaStrategy=r.stencilAlphaStrategy:this.stencilAlphaStrategy=e.renderer.config.stencilAlphaStrategy,void 0!==r.stencilClearValue&&(this.stencilClearValue=r.stencilClearValue),void 0!==r.stencilCompositeCheck&&(this.stencilCompositeCheck=r.stencilCompositeCheck),void 0!==r.stencilInvert&&(this.stencilInvert=r.stencilInvert),void 0!==r.stencilLayerMode&&(this.stencilLayerMode=r.stencilLayerMode),void 0!==r.stencilValueWrap&&(this.stencilValueWrap=r.stencilValueWrap)):this.stencilAlphaStrategy=e.renderer.config.stencilAlphaStrategy,this.addRenderStep(this.stencilRenderStep,0)},stencilRenderStep:function(e,t,i,n,r,s,a){switch(t.stencilLayerMode){case"clear":t.stencilRenderStepClear(e,t,i,n,r,s,a);break;case"clearRegion":t.stencilRenderStepClearRegion(e,t,i,n,r,s,a);break;default:t.stencilRenderStepLayers(e,t,i,n,r,s,a)}},stencilRenderStepLayers:function(e,t,i,n,r,s,a){var o=e.gl,l=t.filtersForceComposite;(!0===t.stencilCompositeCheck||"auto"===t.stencilCompositeCheck&&t.hasStencilChildren(t,i.camera))&&t.enableFilters().setFiltersForceComposite(!0);var h=i.getClone();h.setAlphaStrategy(t.stencilAlphaStrategy),h.setColorWritemask(!1,!1,!1,!1);var u=t.stencilValueWrap?o.INCR_WRAP:o.INCR,c=t.stencilValueWrap?o.DECR_WRAP:o.DECR,d=u;"subtractLayer"===t.stencilLayerMode&&(d=c),h.setStencil(!0,o.ALWAYS,0,255,d,d,d,0,255),h.use(),t.stencilInvert&&(e.renderNodes.getNode("FillCamera").run(h,4278190080,i.useCanvas),(h=h.getClone()).use(),d=d===u?c:u,h.setStencil(!0,o.ALWAYS,0,255,d,d,d,0,255)),t.renderWebGLStep(e,t,h,n,r+1,s,a),h.release(),t.setFiltersForceComposite(l)},stencilRenderStepClear:function(e,t,i,n,r,s,a){var o=e.gl,l=i.getClone();l.state.stencil.clear=t.stencilClearValue,l.state.stencil.writeMask=255,l.use(),l.clear(o.STENCIL_BUFFER_BIT)},stencilRenderStepClearRegion:function(e,t,i,n,r,s,a){var o=e.gl,l=t.filtersForceComposite;(!0===t.stencilCompositeCheck||"auto"===t.stencilCompositeCheck&&t.hasStencilChildren(t,i.camera))&&t.enableFilters().setFiltersForceComposite(!0);var h=i.getClone();h.setAlphaStrategy(t.stencilAlphaStrategy),h.setColorWritemask(!1,!1,!1,!1);var u=t.stencilClearValue,c=o.REPLACE;h.setStencil(!0,o.ALWAYS,u,255,c,c,c,u,255),h.use(),t.renderWebGLStep(e,t,h,n,r+1,s,a),h.release(),t.setFiltersForceComposite(l)},hasStencilChildren:function(e,t){if(e instanceof s||e instanceof a)for(var i=0;i<e.list.length;i++){var n=e.list[i];if(n&&n.willRender(t)&&(n.isStencilModifier||this.hasStencilChildren(n,t)))return!0}return!1}});e.exports=o},32247(e,t,i){var n=i(25305),r=i(84423),s=i(44603),a=i(23568),o=i(95540);s.register("stencil",function(e,t){void 0===e&&(e={});var i=a(e,"x",0),s=a(e,"y",0),l=o(e,"children",null),h=a(e,"options",{}),u=new r(this.scene,i,s,l,h);return void 0!==t&&(e.add=t),n(this.scene,u,e),u})},67841(e,t,i){var n=i(84423);i(39429).register("stencil",function(e,t,i,r){return this.displayList.add(new n(this.scene,e,t,i,r))})},63911(e,t,i){var n=i(83419),r=i(10312),s=i(31401),a=i(95643),o=i(4775),l=new n({Extends:a,Mixins:[s.StencilModifier,s.Visible,o],initialize:function(e,t,i){a.call(this,e,"StencilReference"),this.targetStencil=t,i?(void 0!==i.stencilAlphaStrategy?this.stencilAlphaStrategy=i.stencilAlphaStrategy:this.stencilAlphaStrategy=e.renderer.config.stencilAlphaStrategy,void 0!==i.stencilClearValue&&(this.stencilClearValue=i.stencilClearValue),void 0!==i.stencilCompositeCheck&&(this.stencilCompositeCheck=i.stencilCompositeCheck),void 0!==i.stencilInvert&&(this.stencilInvert=i.stencilInvert),void 0!==i.stencilLayerMode&&(this.stencilLayerMode=i.stencilLayerMode),void 0!==i.stencilValueWrap&&(this.stencilValueWrap=i.stencilValueWrap)):this.stencilAlphaStrategy=e.renderer.config.stencilAlphaStrategy},blendMode:{get:function(){return r.SKIP_CHECK},set:function(e){}},preDestroy:function(){this.targetStencil=null}});e.exports=l},44023(e,t,i){var n=i(25305),r=i(63911),s=i(44603),a=i(23568),o=i(95540);s.register("stencilreference",function(e,t){void 0===e&&(e={});var i=o(e,"targetStencil",null),s=a(e,"options",{}),l=new r(this.scene,i,s);return void 0!==t&&(e.add=t),n(this.scene,l,e),l})},37889(e,t,i){var n=i(63911);i(39429).register("stencilreference",function(e,t){return this.displayList.add(new n(this.scene,e,t))})},4775(e,t,i){var n=i(29747),r=i(12217),s=n;e.exports={renderWebGL:r,renderCanvas:s}},12217(e){e.exports=function(e,t,i,n,r,s,a){var o=t.targetStencil;if(o&&!o.isDestroyed){var l=o.stencilAlphaStrategy,h=o.stencilClearValue,u=o.stencilCompositeCheck,c=o.stencilInvert,d=o.stencilLayerMode,f=o.stencilValueWrap;o.stencilAlphaStrategy=t.stencilAlphaStrategy,o.stencilClearValue=t.stencilClearValue,o.stencilCompositeCheck=t.stencilCompositeCheck,o.stencilInvert=t.stencilInvert,o.stencilLayerMode=t.stencilLayerMode,o.stencilValueWrap=t.stencilValueWrap;var p=null;o.parentContainer&&(p=o.parentContainer.getWorldTransformMatrix()),o.renderWebGLStep(e,o,i,p,0),o.stencilAlphaStrategy=l,o.stencilClearValue=h,o.stencilCompositeCheck=u,o.stencilInvert=c,o.stencilLayerMode=d,o.stencilValueWrap=f}}},14220(e){e.exports=function(e,t,i){var n=e.canvas,r=e.context,s=e.style,a=[],o=0,l=i.length;s.maxLines>0&&s.maxLines<i.length&&(l=s.maxLines),s.syncFont(n,r);for(var h=e.letterSpacing,u=0;u<l;u++){var c=s.strokeThickness;if(0===h)c+=r.measureText(i[u]).width;else{for(var d=i[u],f=0;f<d.length;f++)c+=r.measureText(d[f]).width;d.length>1&&(c+=h*(d.length-1))}s.wordWrap&&(c-=r.measureText(" ").width),a[u]=Math.ceil(c),o=Math.max(o,a[u])}var p=t.fontSize+s.strokeThickness,m=p*l,g=e.lineSpacing;return l>1&&(m+=g*(l-1)),{width:o,height:m,lines:l,lineWidths:a,lineSpacing:g,lineHeight:p}}},79557(e,t,i){var n=i(27919);e.exports=function(e){var t=n.create(this),i=t.getContext("2d",{willReadFrequently:!0});e.syncFont(t,i);var r=i.measureText(e.testString);if("actualBoundingBoxAscent"in r){var s=r.actualBoundingBoxAscent,a=r.actualBoundingBoxDescent;return n.remove(t),{ascent:s,descent:a,fontSize:s+a}}var o=Math.ceil(r.width*e.baselineX),l=o,h=2*l;l=l*e.baselineY|0,t.width=o,t.height=h,i.fillStyle="#f00",i.fillRect(0,0,o,h),i.font=e._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(e.testString,0,l);var u={ascent:0,descent:0,fontSize:0},c=i.getImageData(0,0,o,h);if(!c)return u.ascent=l,u.descent=l+6,u.fontSize=u.ascent+u.descent,n.remove(t),u;var d,f,p=c.data,m=p.length,g=4*o,v=0,y=!1;for(d=0;d<l;d++){for(f=0;f<g;f+=4)if(255!==p[v+f]){y=!0;break}if(y)break;v+=g}for(u.ascent=l-d,v=m-g,y=!1,d=h;d>l;d--){for(f=0;f<g;f+=4)if(255!==p[v+f]){y=!0;break}if(y)break;v-=g}return u.descent=d-l,u.fontSize=u.ascent+u.descent,n.remove(t),u}},50171(e,t,i){var n=i(40366),r=i(27919),s=i(40939),a=i(83419),o=i(31401),l=i(95643),h=i(14220),u=i(35154),c=i(35846),d=i(61771),f=i(35762),p=i(45650),m=new a({Extends:l,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Lighting,o.Mask,o.Origin,o.RenderNodes,o.ScrollFactor,o.Tint,o.Transform,o.Visible,d],initialize:function(e,t,i,n,s){void 0===t&&(t=0),void 0===i&&(i=0),l.call(this,e,"Text"),this.renderer=e.sys.renderer,this.setPosition(t,i),this.setOrigin(0,0),this.initRenderNodes(this._defaultRenderNodesMap),this.canvas=r.create(this),this.context,this.style=new f(this,s),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.letterSpacing=0,0===this.style.resolution&&(this.style.resolution=1),this._crop=this.resetCropObject(),this._textureKey=p(),this.texture=e.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(n),s&&s.padding&&this.setPadding(s.padding),s&&s.lineSpacing&&this.setLineSpacing(s.lineSpacing),s&&s.letterSpacing&&this.setLetterSpacing(s.letterSpacing)},_defaultRenderNodesMap:{get:function(){return s}},initRTL:function(){if(!this.style.rtl)return this.canvas.dir="ltr",void(this.context.direction="ltr");this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",n(this.canvas,this.scene.sys.canvas),this.originX=1},runWordWrap:function(e){var t=this.style;if(t.wordWrapCallback){var i=t.wordWrapCallback.call(t.wordWrapCallbackScope,e,this);return Array.isArray(i)&&(i=i.join("\n")),i}return t.wordWrapWidth?t.wordWrapUseAdvanced?this.advancedWordWrap(e,this.context,this.style.wordWrapWidth):this.basicWordWrap(e,this.context,this.style.wordWrapWidth):e},advancedWordWrap:function(e,t,i){for(var n="",r=e.replace(/ +/gi," ").split(this.splitRegExp),s=r.length,a=0;a<s;a++){var o=r[a],l="",h=(o=o.replace(/^ *|\s*$/gi,"")).length*this.letterSpacing;if(t.measureText(o).width+h<i)n+=o+"\n";else{for(var u=i,c=o.split(" "),d=0;d<c.length;d++){var f=c[d],p=f+" ",m=p.length*this.letterSpacing,g=t.measureText(p).width+m;if(g>u){if(0===d){for(var v=p;v.length;){var y=(v=v.slice(0,-1)).length*this.letterSpacing;if((g=t.measureText(v).width+y)<=u)break}if(!v.length)throw new Error("wordWrapWidth < a single character");var x=f.substr(v.length);c[d]=x,l+=v}var b=c[d].length?d:d+1,w=c.slice(b).join(" ").replace(/[ \n]*$/gi,"");r.splice(a+1,0,w),s=r.length;break}l+=p,u-=g}n+=l.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(e,t,i){for(var n="",r=e.split(this.splitRegExp),s=r.length-1,a=t.measureText(" ").width,o=0;o<=s;o++){for(var l=i,h=r[o].split(" "),u=h.length-1,c=0;c<=u;c++){var d=h[c],f=d.length*this.letterSpacing,p=t.measureText(d).width+f,m=p;c<u&&(m+=a),m>l&&c>0&&(n+="\n",l=i),n+=d,c<u?(n+=" ",l-=m):l-=p}o<s&&(n+="\n")}return n},getWrappedText:function(e){return void 0===e&&(e=this._text),this.style.syncFont(this.canvas,this.context),this.runWordWrap(e).split(this.splitRegExp)},setText:function(e){return e||0===e||(e=""),Array.isArray(e)&&(e=e.join("\n")),e!==this._text&&(this._text=e.toString(),this.updateText()),this},appendText:function(e,t){void 0===t&&(t=!0),e||0===e||(e=""),Array.isArray(e)&&(e=e.join("\n")),e=e.toString();var i=this._text.concat(t?"\n"+e:e);return i!==this._text&&(this._text=i,this.updateText()),this},setStyle:function(e){return this.style.setStyle(e)},setFont:function(e){return this.style.setFont(e)},setFontFamily:function(e){return this.style.setFontFamily(e)},setFontSize:function(e){return this.style.setFontSize(e)},setFontStyle:function(e){return this.style.setFontStyle(e)},setFixedSize:function(e,t){return this.style.setFixedSize(e,t)},setBackgroundColor:function(e){return this.style.setBackgroundColor(e)},setFill:function(e){return this.style.setFill(e)},setColor:function(e){return this.style.setColor(e)},setStroke:function(e,t){return this.style.setStroke(e,t)},setShadow:function(e,t,i,n,r,s){return this.style.setShadow(e,t,i,n,r,s)},setShadowOffset:function(e,t){return this.style.setShadowOffset(e,t)},setShadowColor:function(e){return this.style.setShadowColor(e)},setShadowBlur:function(e){return this.style.setShadowBlur(e)},setShadowStroke:function(e){return this.style.setShadowStroke(e)},setShadowFill:function(e){return this.style.setShadowFill(e)},setWordWrapWidth:function(e,t){return this.style.setWordWrapWidth(e,t)},setWordWrapCallback:function(e,t){return this.style.setWordWrapCallback(e,t)},setAlign:function(e){return this.style.setAlign(e)},setResolution:function(e){return this.style.setResolution(e)},setLineSpacing:function(e){return this.lineSpacing=e,this.updateText()},setLetterSpacing:function(e){return this.letterSpacing=e,this.updateText()},setPadding:function(e,t,i,n){if("object"===typeof e){var r=e,s=u(r,"x",null);null!==s?(e=s,i=s):(e=u(r,"left",0),i=u(r,"right",e));var a=u(r,"y",null);null!==a?(t=a,n=a):(t=u(r,"top",0),n=u(r,"bottom",t))}else void 0===e&&(e=0),void 0===t&&(t=e),void 0===i&&(i=e),void 0===n&&(n=t);return this.padding.left=e,this.padding.top=t,this.padding.right=i,this.padding.bottom=n,this.updateText()},setMaxLines:function(e){return this.style.setMaxLines(e)},setRTL:function(e){void 0===e&&(e=!0);var t=this.style;return t.rtl===e||(t.rtl=e,e?(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",n(this.canvas,this.scene.sys.canvas)):(this.canvas.dir="ltr",this.context.direction="ltr"),"left"===t.align?t.align="right":"right"===t.align&&(t.align="left")),this},updateText:function(){var e=this.canvas,t=this.context,i=this.style,n=i.resolution,r=i.metrics;i.syncFont(e,t);var s=this._text;(i.wordWrapWidth||i.wordWrapCallback)&&(s=this.runWordWrap(this._text));var a,o=s.split(this.splitRegExp),l=h(this,r,o),u=this.padding;0===i.fixedWidth?(this.width=l.width+u.left+u.right,a=l.width):(this.width=i.fixedWidth,(a=this.width-u.left-u.right)<l.width&&(a=l.width)),0===i.fixedHeight?this.height=l.height+u.top+u.bottom:this.height=i.fixedHeight;var c,d,f=this.width,p=this.height;this.updateDisplayOrigin(),f*=n,p*=n,f=Math.max(f,1),p=Math.max(p,1),e.width!==f||e.height!==p?(e.width=f,e.height=p,this.frame.setSize(f,p),this.frame.source.updateSize(f,p),this.frame.source.resolution=n,this.frame.updateUVs(),i.syncFont(e,t),i.rtl&&(t.direction="rtl")):t.clearRect(0,0,f,p),t.save(),t.scale(n,n),i.backgroundColor&&(t.fillStyle=i.backgroundColor,t.fillRect(0,0,f,p)),i.syncStyle(e,t),t.translate(u.left,u.top);for(var m=0;m<l.lines;m++){if(c=i.strokeThickness/2,d=i.strokeThickness/2+m*l.lineHeight+r.ascent,m>0&&(d+=l.lineSpacing*m),i.rtl)c=f-c-u.left-u.right;else if("right"===i.align)c+=a-l.lineWidths[m];else if("center"===i.align)c+=(a-l.lineWidths[m])/2;else if("justify"===i.align){if(l.lineWidths[m]/l.width>=.85){var g=l.width-l.lineWidths[m],v=t.measureText(" ").width,y=o[m].trim(),x=y.split(" ");g+=(o[m].length-y.length)*v;for(var b=Math.floor(g/v),w=0;b>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--b;o[m]=x.join(" ")}}this.autoRound&&(c=Math.round(c),d=Math.round(d));var T=this.letterSpacing;if(i.strokeThickness&&0===T&&(i.syncShadow(t,i.shadowStroke),t.strokeText(o[m],c,d)),i.color)if(i.syncShadow(t,i.shadowFill),0!==T)for(var _=0,S=o[m].split(""),E=0;E<S.length;E++)i.strokeThickness&&(i.syncShadow(t,i.shadowStroke),t.strokeText(S[E],c+_,d),i.syncShadow(t,i.shadowFill)),t.fillText(S[E],c+_,d),_+=t.measureText(S[E]).width+T;else t.fillText(o[m],c,d)}t.restore(),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(e,this.frame.source.glTexture,!0));var C=this.input;return C&&!C.customHitArea&&(C.hitArea.width=this.width,C.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(e){this.setText(e)}},toJSON:function(){var e=o.ToJSON(this),t={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return e.data=t,e},preDestroy:function(){c(this.canvas),r.remove(this.canvas);var e=this.texture;e&&e.destroy()}});e.exports=m},79724(e){e.exports=function(e,t,i,n){0!==t.width&&0!==t.height&&(i.addToRenderList(t),e.batchSprite(t,t.frame,i,n))}},71259(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(50171);r.register("text",function(e,t){void 0===e&&(e={});var i=s(e,"text",""),r=s(e,"style",null),o=s(e,"padding",null);null!==o&&(r.padding=o);var l=new a(this.scene,0,0,i,r);return void 0!==t&&(e.add=t),n(this.scene,l,e),l.autoRound=s(e,"autoRound",!0),l.resolution=s(e,"resolution",1),l})},68005(e,t,i){var n=i(50171);i(39429).register("text",function(e,t,i,r){return this.displayList.add(new n(this.scene,e,t,i,r))})},61771(e,t,i){var n=i(29747),r=n,s=n;r=i(34397),s=i(79724),e.exports={renderWebGL:r,renderCanvas:s}},35762(e,t,i){var n=i(83419),r=i(23568),s=i(35154),a=i(79557),o={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\xc3\u2030qgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},l=new n({initialize:function(e,t){this.parent=e,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(t,!1,!0)},setStyle:function(e,t,i){for(var n in void 0===t&&(t=!0),void 0===i&&(i=!1),o){var l=i?o[n][1]:this[n];"wordWrapCallback"===n||"wordWrapCallbackScope"===n?this[n]=s(e,o[n][0],l):e&&"fontSize"===n&&"number"===typeof e.fontSize?this[n]=e.fontSize.toString()+"px":this[n]=r(e,o[n][0],l)}var h=s(e,"font",null);null!==h&&this.setFont(h,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var u=s(e,"fill",null);null!==u&&(this.color=u);var c=s(e,"metrics",!1);return c?this.metrics={ascent:s(c,"ascent",0),descent:s(c,"descent",0),fontSize:s(c,"fontSize",0)}:!t&&this.metrics||(this.metrics=a(this)),t?this.parent.updateText():this.parent},syncFont:function(e,t){t.font=this._font},syncStyle:function(e,t){t.textBaseline="alphabetic",t.fillStyle=this.color,t.strokeStyle=this.stroke,t.lineWidth=this.strokeThickness,t.lineCap="round",t.lineJoin="round"},syncShadow:function(e,t){t?(e.shadowOffsetX=this.shadowOffsetX,e.shadowOffsetY=this.shadowOffsetY,e.shadowColor=this.shadowColor,e.shadowBlur=this.shadowBlur):(e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowColor=0,e.shadowBlur=0)},update:function(e){return e&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=a(this)),this.parent.updateText()},setFont:function(e,t){void 0===t&&(t=!0);var i=e,n="",r="";if("string"!==typeof e)i=s(e,"fontFamily","Courier"),n=s(e,"fontSize","16px"),r=s(e,"fontStyle","");else{var a=e.split(" "),o=0;r=a.length>2?a[o++]:"",n=a[o++]||"16px",i=a[o++]||"Courier"}return i===this.fontFamily&&n===this.fontSize&&r===this.fontStyle||(this.fontFamily=i,this.fontSize=n,this.fontStyle=r,t&&this.update(!0)),this.parent},setFontFamily:function(e){return this.fontFamily!==e&&(this.fontFamily=e,this.update(!0)),this.parent},setFontStyle:function(e){return this.fontStyle!==e&&(this.fontStyle=e,this.update(!0)),this.parent},setFontSize:function(e){return"number"===typeof e&&(e=e.toString()+"px"),this.fontSize!==e&&(this.fontSize=e,this.update(!0)),this.parent},setTestString:function(e){return this.testString=e,this.update(!0)},setFixedSize:function(e,t){return this.fixedWidth=e,this.fixedHeight=t,e&&(this.parent.width=e),t&&(this.parent.height=t),this.update(!1)},setBackgroundColor:function(e){return this.backgroundColor=e,this.update(!1)},setFill:function(e){return this.color=e,this.update(!1)},setColor:function(e){return this.color=e,this.update(!1)},setResolution:function(e){return this.resolution=e,this.update(!1)},setStroke:function(e,t){return void 0===t&&(t=this.strokeThickness),void 0===e&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===e&&this.strokeThickness===t||(this.stroke=e,this.strokeThickness=t,this.update(!0)),this.parent},setShadow:function(e,t,i,n,r,s){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===r&&(r=!1),void 0===s&&(s=!0),this.shadowOffsetX=e,this.shadowOffsetY=t,this.shadowColor=i,this.shadowBlur=n,this.shadowStroke=r,this.shadowFill=s,this.update(!1)},setShadowOffset:function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this.shadowOffsetX=e,this.shadowOffsetY=t,this.update(!1)},setShadowColor:function(e){return void 0===e&&(e="#000"),this.shadowColor=e,this.update(!1)},setShadowBlur:function(e){return void 0===e&&(e=0),this.shadowBlur=e,this.update(!1)},setShadowStroke:function(e){return this.shadowStroke=e,this.update(!1)},setShadowFill:function(e){return this.shadowFill=e,this.update(!1)},setWordWrapWidth:function(e,t){return void 0===t&&(t=!1),this.wordWrapWidth=e,this.wordWrapUseAdvanced=t,this.update(!1)},setWordWrapCallback:function(e,t){return void 0===t&&(t=null),this.wordWrapCallback=e,this.wordWrapCallbackScope=t,this.update(!1)},setAlign:function(e){return void 0===e&&(e="left"),this.align=e,this.update(!1)},setMaxLines:function(e){return void 0===e&&(e=0),this.maxLines=e,this.update(!1)},getTextMetrics:function(){var e=this.metrics;return{ascent:e.ascent,descent:e.descent,fontSize:e.fontSize}},toJSON:function(){var e={};for(var t in o)e[t]=this[t];return e.metrics=this.getTextMetrics(),e},destroy:function(){this.parent=void 0}});e.exports=l},34397(e){e.exports=function(e,t,i,n){if(0!==t.width&&0!==t.height){i.camera.addToRenderList(t);var r=t.customRenderNodes,s=t.defaultRenderNodes;(r.Submitter||s.Submitter).run(i,t,n,0,r.Texturer||s.Texturer,r.Transformer||s.Transformer)}}},20839(e,t,i){var n=i(9674),r=i(27919),s=i(41571),a=i(83419),o=i(31401),l=i(95643),h=i(68703),u=i(56295),c=i(45650),d=i(26099),f=new a({Extends:l,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Flip,o.GetBounds,o.Lighting,o.Mask,o.Origin,o.RenderNodes,o.ScrollFactor,o.Texture,o.Tint,o.Transform,o.Visible,u],initialize:function(e,t,i,s,a,o,h){var u=e.sys.renderer,f=u&&!u.gl;l.call(this,e,"TileSprite");var p=e.sys.textures.get(o).get(h);s=s?Math.floor(s):p.width,a=a?Math.floor(a):p.height,this._tilePosition=new d,this._tileScale=new d(1,1),this._tileRotation=0,this.dirty=!1,this.renderer=u,this.canvas=f?r.create(this,s,a):null,this.context=f?this.canvas.getContext("2d",{willReadFrequently:!1}):null,this._displayTextureKey=c(),this.displayTexture=f?e.sys.textures.addCanvas(this._displayTextureKey,this.canvas):null,this.displayFrame=this.displayTexture?this.displayTexture.get():null,this.currentFrame=null,this.fillCanvas=f?r.create2D(this,p.width,this.displayFrame.height):null,this.fillContext=this.fillCanvas?this.fillCanvas.getContext("2d",{willReadFrequently:!1}):null,this.fillPattern=null,this.anims=new n(this),this.setTexture(o,h),this.setPosition(t,i),this.setSize(s,a),this.setOrigin(.5,.5),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return s}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(e,t){this.anims.update(e,t)},setFrame:function(e){var t=this.texture.get(e);return t.cutWidth&&t.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.frame=t,this.dirty=!0,this},setSizeToFrame:function(){return this},setTilePosition:function(e,t){return void 0!==e&&(this.tilePositionX=e),void 0!==t&&(this.tilePositionY=t),this},setTileRotation:function(e){return void 0===e&&(e=0),this.tileRotation=e,this},setTileScale:function(e,t){return void 0===e&&(e=this.tileScaleX),void 0===t&&(t=e),this.tileScaleX=e,this.tileScaleY=t,this},updateTileTexture:function(){if(this.renderer&&!this.renderer.gl){var e=this.frame,t=this.fillContext,i=this.fillCanvas,n=e.cutWidth,r=e.cutHeight;t.clearRect(0,0,n,r),i.width=n,i.height=r,t.drawImage(e.source.image,e.cutX,e.cutY,e.cutWidth,e.cutHeight,0,0,n,r),this.fillPattern=t.createPattern(i,"repeat"),this.currentFrame=e}},updateCanvas:function(){var e=this.canvas,t=this.width,i=this.height,n=this.currentFrame!==this.frame;if((e.width!==t||e.height!==i||n)&&(e.width=t,e.height=i,this.displayFrame.setSize(t,i),this.updateDisplayOrigin(),n&&this.updateTileTexture(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var r=this.context;this.scene.sys.game.config.antialias||h.disable(r);var s=this._tileScale.x,a=this._tileScale.y,o=this._tilePosition.x,l=this._tilePosition.y;r.clearRect(0,0,t,i),r.save(),r.rotate(this._tileRotation),r.scale(s,a),r.translate(-o,-l),r.fillStyle=this.fillPattern;var u=Math.max(t,Math.abs(t/s)),c=Math.max(i,Math.abs(i/a)),d=Math.sqrt(u*u+c*c);r.fillRect(o-d,l-d,2*d,2*d),r.restore(),this.dirty=!1}},setSize:function(e,t){this.width=e,this.height=t,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=e,i.hitArea.height=t),this},preDestroy:function(){this.canvas&&r.remove(this.canvas),this.fillCanvas&&r.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.renderer=null,this.anims.destroy(),this.anims=void 0},tilePositionX:{get:function(){return this._tilePosition.x},set:function(e){this._tilePosition.x=e,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(e){this._tilePosition.y=e,this.dirty=!0}},tileRotation:{get:function(){return this._tileRotation},set:function(e){this._tileRotation=e,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(e){this._tileScale.x=e,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(e){this._tileScale.y=e,this.dirty=!0}}});e.exports=f},46992(e){e.exports=function(e,t,i,n){t.updateCanvas(),i.addToRenderList(t),e.batchSprite(t,t.displayFrame,i,n)}},14167(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(20839);r.register("tileSprite",function(e,t){void 0===e&&(e={});var i=s(e,"x",0),r=s(e,"y",0),o=s(e,"width",512),l=s(e,"height",512),h=s(e,"key",""),u=s(e,"frame",""),c=new a(this.scene,i,r,o,l,h,u);return void 0!==t&&(e.add=t),n(this.scene,c,e),c})},91681(e,t,i){var n=i(20839);i(39429).register("tileSprite",function(e,t,i,r,s,a){return this.displayList.add(new n(this.scene,e,t,i,r,s,a))})},56295(e,t,i){var n=i(29747),r=n,s=n;r=i(18553),s=i(46992),e.exports={renderWebGL:r,renderCanvas:s}},18553(e){e.exports=function(e,t,i,n){var r=t.width,s=t.height;if(0!==r&&0!==s){i.camera.addToRenderList(t);var a=t.customRenderNodes,o=t.defaultRenderNodes;(a.Submitter||o.Submitter).run(i,t,n,0,a.Texturer||o.Texturer,a.Transformer||o.Transformer)}}},18471(e,t,i){var n=i(45319),r=i(40939),s=i(83419),a=i(31401),o=i(51708),l=i(8443),h=i(95643),u=i(36383),c=i(14463),d=i(45650),f=i(10247),p=new s({Extends:h,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Lighting,a.Mask,a.Origin,a.RenderNodes,a.ScrollFactor,a.TextureCrop,a.Tint,a.Transform,a.Visible,f],initialize:function(e,t,i,n){h.call(this,e,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.glFlipY=!0,this._key=d(),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._getFrame=!1,this._rfvCallbackId=0;var r=e.sys.game;this._device=r.device.video,this.setPosition(t,i),this.setSize(256,256),this.initRenderNodes(this._defaultRenderNodesMap),r.events.on(l.PAUSE,this.globalPause,this),r.events.on(l.RESUME,this.globalResume,this);var s=e.sys.sound;s&&s.on(c.GLOBAL_MUTE,this.globalMute,this),n&&this.load(n)},_defaultRenderNodesMap:{get:function(){return r}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(e){var t=this.scene.sys.cache.video.get(e);return t?(this.cacheKey=e,this.loadHandler(t.url,t.noAudio,t.crossOrigin)):console.warn("No video in cache for key: "+e),this},changeSource:function(e,t,i,n,r){void 0===t&&(t=!0),void 0===i&&(i=!1),this.cacheKey!==e&&(this.load(e),t&&this.play(i,n,r))},getVideoKey:function(){return this.cacheKey},loadURL:function(e,t,i){void 0===t&&(t=!1);var n=this._device.getVideoURL(e);return n?(this.cacheKey="",this.loadHandler(n.url,t,i)):console.warn("No supported video format found for "+e),this},loadMediaStream:function(e,t,i){return this.loadHandler(null,t,i,e)},loadHandler:function(e,t,i,n){t||(t=!1);var r=this.video;if(r?(this.removeLoadEventHandlers(),this.stop()):((r=document.createElement("video")).controls=!1,r.setAttribute("playsinline","playsinline"),r.setAttribute("preload","auto"),r.setAttribute("disablePictureInPicture","true")),t?(r.muted=!0,r.defaultMuted=!0,r.setAttribute("autoplay","autoplay")):(r.muted=!1,r.defaultMuted=!1,r.removeAttribute("autoplay")),i?r.setAttribute("crossorigin",i):r.removeAttribute("crossorigin"),n)if("srcObject"in r)try{r.srcObject=n}catch(a){if("TypeError"!==a.name)throw a;r.src=URL.createObjectURL(n)}else r.src=URL.createObjectURL(n);else r.src=e;this.retry=0,this.video=r,this._playCalled=!1,r.load(),this.addLoadEventHandlers();var s=this.scene.sys.textures.get(this._key);return this.setTexture(s),this},requestVideoFrame:function(e,t){var i=this.video;if(i){var n=t.width,r=t.height,s=this.videoTexture,a=this.videoTextureSource,l=!s||a.source!==i;l?(this._codePaused=i.paused,this._codeMuted=i.muted,s?(a.source=i,a.width=n,a.height=r,s.get().setSize(n,r)):((s=this.scene.sys.textures.create(this._key,i,n,r)).add("__BASE",0,0,0,n,r),this.setTexture(s),this.videoTexture=s,this.videoTextureSource=s.source[0],this.videoTextureSource.setFlipY(this.glFlipY),this.emit(o.VIDEO_TEXTURE,this,s)),this.setSizeToFrame(),this.updateDisplayOrigin()):a.update(),this.isStalled=!1,this.metadata=t;var h=t.mediaTime;l&&(this._lastUpdate=h,this.emit(o.VIDEO_CREATED,this,n,r),this.frameReady||(this.frameReady=!0,this.emit(o.VIDEO_PLAY,this))),this._playingMarker?h>=this._markerOut&&(i.loop?(i.currentTime=this._markerIn,this.emit(o.VIDEO_LOOP,this)):(this.stop(!1),this.emit(o.VIDEO_COMPLETE,this))):h<this._lastUpdate&&this.emit(o.VIDEO_LOOP,this),this._lastUpdate=h,this._getFrame?(this.removeEventHandlers(),i.pause(),this._getFrame=!1):this._rfvCallbackId=this.video.requestVideoFrameCallback(this.requestVideoFrame.bind(this))}},play:function(e,t,i){void 0===t&&(t=-1),void 0===i&&(i=u.MAX_SAFE_INTEGER);var n=this.video;return!n||this.isPlaying()?(n||console.warn("Video not loaded"),this):(void 0===e&&(e=n.loop),n.loop=e,this._markerIn=t,this._markerOut=i,this._playingMarker=t>-1&&i>t&&i<u.MAX_SAFE_INTEGER,this._playCalled||(this._getFrame=!1,this._rfvCallbackId=n.requestVideoFrameCallback(this.requestVideoFrame.bind(this)),this._playCalled=!0,this.createPlayPromise()),this)},getFirstFrame:function(){var e=this.video;return!e||this.isPlaying()?(e||console.warn("Video not loaded"),this):(this._playCalled||(this._getFrame=!0,this._rfvCallbackId=e.requestVideoFrameCallback(this.requestVideoFrame.bind(this)),this.createPlayPromise()),this)},addLoadEventHandlers:function(){var e=this.video;e&&(e.addEventListener("error",this._loadCallbackHandler),e.addEventListener("abort",this._loadCallbackHandler),e.addEventListener("loadedmetadata",this._metadataCallbackHandler))},removeLoadEventHandlers:function(){var e=this.video;e&&(e.removeEventListener("error",this._loadCallbackHandler),e.removeEventListener("abort",this._loadCallbackHandler))},addEventHandlers:function(){var e=this.video;if(e){var t=this._callbacks;for(var i in t)e.addEventListener(i,t[i])}},removeEventHandlers:function(){var e=this.video;if(e){var t=this._callbacks;for(var i in t)e.removeEventListener(i,t[i])}},createPlayPromise:function(e){void 0===e&&(e=!0);var t=this.video,i=t.play();if(void 0!==i){var n=this.playSuccess.bind(this),r=this.playError.bind(this);if(!e){var s=this;r=function(){s.failedPlayAttempts++}}i.then(n).catch(r)}else t.addEventListener("playing",this._callbacks.legacy),e||this.failedPlayAttempts++},addMarker:function(e,t,i){return!isNaN(t)&&t>=0&&!isNaN(i)&&i>t&&(this.markers[e]=[t,i]),this},playMarker:function(e,t){var i=this.markers[e];return i&&this.play(t,i[0],i[1]),this},removeMarker:function(e){return delete this.markers[e],this},snapshot:function(e,t){return void 0===e&&(e=this.width),void 0===t&&(t=this.height),this.snapshotArea(0,0,this.width,this.height,e,t)},snapshotArea:function(e,t,i,n,r,s){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=this.width),void 0===n&&(n=this.height),void 0===r&&(r=i),void 0===s&&(s=n);var a=this.video,o=this.snapshotTexture;return o?(o.setSize(r,s),a&&o.context.drawImage(a,e,t,i,n,0,0,r,s)):(o=this.scene.sys.textures.createCanvas(d(),r,s),this.snapshotTexture=o,a&&o.context.drawImage(a,e,t,i,n,0,0,r,s)),o.update()},saveSnapshotTexture:function(e){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,e):this.snapshotTexture=this.scene.sys.textures.createCanvas(e,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 e=this.scene.sys.sound;e&&e.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(e){var t=e.name;"NotAllowedError"===t?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(o.VIDEO_LOCKED,this)):"NotSupportedError"===t?(this.stop(!1),this.emit(o.VIDEO_UNSUPPORTED,this,e)):(this.stop(!1),this.emit(o.VIDEO_ERROR,this,e))},legacyPlayHandler:function(){var e=this.video;e&&(this.playSuccess(),e.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(o.VIDEO_PLAYING,this)},loadErrorHandler:function(e){this.stop(!1),this.emit(o.VIDEO_ERROR,this,e)},metadataHandler:function(e){this.emit(o.VIDEO_METADATA,this,e)},setSizeToFrame:function(e){e||(e=this.frame),this.width=e.realWidth,this.height=e.realHeight,1!==this.scaleX&&(this.scaleX=this.displayWidth/this.width),1!==this.scaleY&&(this.scaleY=this.displayHeight/this.height);var t=this.input;return t&&!t.customHitArea&&(t.hitArea.width=this.width,t.hitArea.height=this.height),this},stalledHandler:function(e){this.isStalled=!0,this.emit(o.VIDEO_STALLED,this,e)},completeHandler:function(){this._playCalled=!1,this.emit(o.VIDEO_COMPLETE,this)},preUpdate:function(e,t){this.video&&this._playCalled&&this.touchLocked&&this.playWhenUnlocked&&(this.retry+=t,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(e){var t=this.video;if(t){var i=t.duration;if(i!==1/0&&!isNaN(i)){var n=i*e;this.setCurrentTime(n)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(e){var t=this.video;if(t){if("string"===typeof e){var i=e[0],n=parseFloat(e.substr(1));"+"===i?e=t.currentTime+n:"-"===i&&(e=t.currentTime-n)}t.currentTime=e}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 e=this.video;if(e){var t=e.duration;if(t!==1/0&&!isNaN(t))return e.currentTime/t}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(e){void 0===e&&(e=!0),this._codeMuted=e;var t=this.video;return t&&(t.muted=!!this._systemMuted||e),this},isMuted:function(){return this._codeMuted},globalMute:function(e,t){this._systemMuted=t;var i=this.video;i&&(i.muted=!!this._codeMuted||t)},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(e){void 0===e&&(e=!0);var t=this.video;return this._codePaused=e,t&&!t.ended&&(e?t.paused||(this.removeEventHandlers(),t.pause()):e||(this._playCalled?t.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(e){return void 0===e&&(e=1),this.video&&(this.video.volume=n(e,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(e){return this.video&&(this.video.playbackRate=e),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(e){return void 0===e&&(e=!0),this.video&&(this.video.loop=e),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this._playCalled&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(e,t){return void 0===t&&(t=!0),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,e),this.videoTextureSource.setFlipY(t)),this._key=e,this.glFlipY=t,!!this.videoTexture},stop:function(e){void 0===e&&(e=!0);var t=this.video;return t&&(this.removeEventHandlers(),t.cancelVideoFrameCallback(this._rfvCallbackId),t.pause()),this.retry=0,this._playCalled=!1,e&&this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var e=this.video;if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("autoplay"),e.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var e=this.scene.sys.game.events;e.off(l.PAUSE,this.globalPause,this),e.off(l.RESUME,this.globalResume,this);var t=this.scene.sys.sound;t&&t.off(c.GLOBAL_MUTE,this.globalMute,this)}});e.exports=p},58352(e){e.exports=function(e,t,i,n){t.videoTexture&&(i.addToRenderList(t),e.batchSprite(t,t.frame,i,n))}},11511(e,t,i){var n=i(25305),r=i(44603),s=i(23568),a=i(18471);r.register("video",function(e,t){void 0===e&&(e={});var i=s(e,"key",null),r=new a(this.scene,0,0,i);return void 0!==t&&(e.add=t),n(this.scene,r,e),r})},89025(e,t,i){var n=i(18471);i(39429).register("video",function(e,t,i){return this.displayList.add(new n(this.scene,e,t,i))})},10247(e,t,i){var n=i(29747),r=n,s=n;r=i(29849),s=i(58352),e.exports={renderWebGL:r,renderCanvas:s}},29849(e){e.exports=function(e,t,i,n){if(t.videoTexture){i.camera.addToRenderList(t);var r=t.customRenderNodes,s=t.defaultRenderNodes;(r.Submitter||s.Submitter).run(i,t,n,0,r.Texturer||s.Texturer,r.Transformer||s.Transformer)}}},41481(e,t,i){var n=i(10312),r=i(96503),s=i(87902),a=i(83419),o=i(31401),l=i(95643),h=i(87841),u=i(37303),c=new a({Extends:l,Mixins:[o.Depth,o.GetBounds,o.Origin,o.Transform,o.ScrollFactor,o.Visible],initialize:function(e,t,i,r,s){void 0===r&&(r=1),void 0===s&&(s=r),l.call(this,e,"Zone"),this.setPosition(t,i),this.width=r,this.height=s,this.blendMode=n.NORMAL,this.updateDisplayOrigin()},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,t,i){void 0===i&&(i=!0),this.width=e,this.height=t,this.updateDisplayOrigin();var n=this.input;return i&&n&&!n.customHitArea&&(n.hitArea.width=e,n.hitArea.height=t),this},setDisplaySize:function(e,t){return this.displayWidth=e,this.displayHeight=t,this},setCircleDropZone:function(e){return this.setDropZone(new r(0,0,e),s)},setRectangleDropZone:function(e,t){return this.setDropZone(new h(0,0,e,t),u)},setDropZone:function(e,t){return this.input||this.setInteractive(e,t,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(e,t,i){i.addToRenderList(t)},renderWebGL:function(e,t,i){i.camera.addToRenderList(t)}});e.exports=c},95261(e,t,i){var n=i(44603),r=i(23568),s=i(41481);n.register("zone",function(e){var t=r(e,"x",0),i=r(e,"y",0),n=r(e,"width",1),a=r(e,"height",n);return new s(this.scene,t,i,n,a)})},84175(e,t,i){var n=i(41481);i(39429).register("zone",function(e,t,i,r){return this.displayList.add(new n(this.scene,e,t,i,r))})},95166(e){e.exports=function(e){return e.radius>0?Math.PI*e.radius*e.radius:0}},96503(e,t,i){var n=i(83419),r=i(87902),s=i(26241),a=i(79124),o=i(23777),l=i(28176),h=new n({initialize:function(e,t,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),this.type=o.CIRCLE,this.x=e,this.y=t,this._radius=i,this._diameter=2*i},contains:function(e,t){return r(this,e,t)},getPoint:function(e,t){return s(this,e,t)},getPoints:function(e,t,i){return a(this,e,t,i)},getRandomPoint:function(e){return l(this,e)},setTo:function(e,t,i){return this.x=e,this.y=t,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(e,t){return void 0===t&&(t=e),this.x=e,this.y=t,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(e){this._radius=e,this._diameter=2*e}},diameter:{get:function(){return this._diameter},set:function(e){this._diameter=e,this._radius=.5*e}},left:{get:function(){return this.x-this._radius},set:function(e){this.x=e+this._radius}},right:{get:function(){return this.x+this._radius},set:function(e){this.x=e-this._radius}},top:{get:function(){return this.y-this._radius},set:function(e){this.y=e+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(e){this.y=e-this._radius}}});e.exports=h},71562(e){e.exports=function(e){return Math.PI*e.radius*2}},92110(e,t,i){var n=i(26099);e.exports=function(e,t,i){return void 0===i&&(i=new n),i.x=e.x+e.radius*Math.cos(t),i.y=e.y+e.radius*Math.sin(t),i}},42250(e,t,i){var n=i(96503);e.exports=function(e){return new n(e.x,e.y,e.radius)}},87902(e){e.exports=function(e,t,i){return e.radius>0&&t>=e.left&&t<=e.right&&i>=e.top&&i<=e.bottom&&(e.x-t)*(e.x-t)+(e.y-i)*(e.y-i)<=e.radius*e.radius}},5698(e,t,i){var n=i(87902);e.exports=function(e,t){return n(e,t.x,t.y)}},70588(e,t,i){var n=i(87902);e.exports=function(e,t){return n(e,t.x,t.y)&&n(e,t.right,t.y)&&n(e,t.x,t.bottom)&&n(e,t.right,t.bottom)}},26394(e){e.exports=function(e,t){return t.setTo(e.x,e.y,e.radius)}},76278(e){e.exports=function(e,t){return e.x===t.x&&e.y===t.y&&e.radius===t.radius}},2074(e,t,i){var n=i(87841);e.exports=function(e,t){return void 0===t&&(t=new n),t.x=e.left,t.y=e.top,t.width=e.diameter,t.height=e.diameter,t}},26241(e,t,i){var n=i(92110),r=i(62945),s=i(36383),a=i(26099);e.exports=function(e,t,i){void 0===i&&(i=new a);var o=r(t,0,s.TAU);return n(e,o,i)}},79124(e,t,i){var n=i(71562),r=i(92110),s=i(62945),a=i(36383);e.exports=function(e,t,i,o){void 0===o&&(o=[]),!t&&i>0&&(t=n(e)/i);for(var l=0;l<t;l++){var h=s(l/t,0,a.TAU);o.push(r(e,h))}return o}},50884(e){e.exports=function(e,t,i){return e.x+=t,e.y+=i,e}},39212(e){e.exports=function(e,t){return e.x+=t.x,e.y+=t.y,e}},28176(e,t,i){var n=i(26099);e.exports=function(e,t){void 0===t&&(t=new n);var i=2*Math.PI*Math.random(),r=Math.random()+Math.random(),s=r>1?2-r:r,a=s*Math.cos(i),o=s*Math.sin(i);return t.x=e.x+a*e.radius,t.y=e.y+o*e.radius,t}},88911(e,t,i){var n=i(96503);n.Area=i(95166),n.Circumference=i(71562),n.CircumferencePoint=i(92110),n.Clone=i(42250),n.Contains=i(87902),n.ContainsPoint=i(5698),n.ContainsRect=i(70588),n.CopyFrom=i(26394),n.Equals=i(76278),n.GetBounds=i(2074),n.GetPoint=i(26241),n.GetPoints=i(79124),n.Offset=i(50884),n.OffsetPoint=i(39212),n.Random=i(28176),e.exports=n},23777(e){e.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},78874(e){e.exports=function(e){return e.isEmpty()?0:e.getMajorRadius()*e.getMinorRadius()*Math.PI}},92990(e){e.exports=function(e){var t=e.width/2,i=e.height/2,n=Math.pow(t-i,2)/Math.pow(t+i,2);return Math.PI*(t+i)*(1+3*n/(10+Math.sqrt(4-3*n)))}},79522(e,t,i){var n=i(26099);e.exports=function(e,t,i){void 0===i&&(i=new n);var r=e.width/2,s=e.height/2;return i.x=e.x+r*Math.cos(t),i.y=e.y+s*Math.sin(t),i}},58102(e,t,i){var n=i(8497);e.exports=function(e){return new n(e.x,e.y,e.width,e.height)}},81154(e){e.exports=function(e,t,i){if(e.width<=0||e.height<=0)return!1;var n=(t-e.x)/e.width,r=(i-e.y)/e.height;return(n*=n)+(r*=r)<.25}},46662(e,t,i){var n=i(81154);e.exports=function(e,t){return n(e,t.x,t.y)}},1632(e,t,i){var n=i(81154);e.exports=function(e,t){return n(e,t.x,t.y)&&n(e,t.right,t.y)&&n(e,t.x,t.bottom)&&n(e,t.right,t.bottom)}},65534(e){e.exports=function(e,t){return t.setTo(e.x,e.y,e.width,e.height)}},8497(e,t,i){var n=i(83419),r=i(81154),s=i(90549),a=i(48320),o=i(23777),l=i(24820),h=new n({initialize:function(e,t,i,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=o.ELLIPSE,this.x=e,this.y=t,this.width=i,this.height=n},contains:function(e,t){return r(this,e,t)},getPoint:function(e,t){return s(this,e,t)},getPoints:function(e,t,i){return a(this,e,t,i)},getRandomPoint:function(e){return l(this,e)},setTo:function(e,t,i,n){return this.x=e,this.y=t,this.width=i,this.height=n,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(e,t){return void 0===t&&(t=e),this.x=e,this.y=t,this},setSize:function(e,t){return void 0===t&&(t=e),this.width=e,this.height=t,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(e){this.x=e+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(e){this.x=e-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(e){this.y=e+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(e){this.y=e-this.height/2}}});e.exports=h},36146(e){e.exports=function(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}},23694(e,t,i){var n=i(87841);e.exports=function(e,t){return void 0===t&&(t=new n),t.x=e.left,t.y=e.top,t.width=e.width,t.height=e.height,t}},90549(e,t,i){var n=i(79522),r=i(62945),s=i(36383),a=i(26099);e.exports=function(e,t,i){void 0===i&&(i=new a);var o=r(t,0,s.TAU);return n(e,o,i)}},48320(e,t,i){var n=i(92990),r=i(79522),s=i(62945),a=i(36383);e.exports=function(e,t,i,o){void 0===o&&(o=[]),!t&&i>0&&(t=n(e)/i);for(var l=0;l<t;l++){var h=s(l/t,0,a.TAU);o.push(r(e,h))}return o}},73424(e){e.exports=function(e,t,i){return e.x+=t,e.y+=i,e}},44808(e){e.exports=function(e,t){return e.x+=t.x,e.y+=t.y,e}},24820(e,t,i){var n=i(26099);e.exports=function(e,t){void 0===t&&(t=new n);var i=Math.random()*Math.PI*2,r=Math.sqrt(Math.random());return t.x=e.x+r*Math.cos(i)*e.width/2,t.y=e.y+r*Math.sin(i)*e.height/2,t}},49203(e,t,i){var n=i(8497);n.Area=i(78874),n.Circumference=i(92990),n.CircumferencePoint=i(79522),n.Clone=i(58102),n.Contains=i(81154),n.ContainsPoint=i(46662),n.ContainsRect=i(1632),n.CopyFrom=i(65534),n.Equals=i(36146),n.GetBounds=i(23694),n.GetPoint=i(90549),n.GetPoints=i(48320),n.Offset=i(73424),n.OffsetPoint=i(44808),n.Random=i(24820),e.exports=n},55738(e,t,i){var n=i(23777),r=i(79291),s={Circle:i(88911),Ellipse:i(49203),Intersects:i(91865),Line:i(2529),Polygon:i(58423),Rectangle:i(93232),Triangle:i(84435)};s=r(!1,s,n),e.exports=s},2044(e,t,i){var n=i(20339);e.exports=function(e,t){return n(e.x,e.y,t.x,t.y)<=e.radius+t.radius}},81491(e){e.exports=function(e,t){var i=t.width/2,n=t.height/2,r=Math.abs(e.x-t.x-i),s=Math.abs(e.y-t.y-n),a=i+e.radius,o=n+e.radius;if(r>a||s>o)return!1;if(r<=i||s<=n)return!0;var l=r-i,h=s-n;return l*l+h*h<=e.radius*e.radius}},63376(e,t,i){var n=i(26099),r=i(2044);e.exports=function(e,t,i){if(void 0===i&&(i=[]),r(e,t)){var s,a,o,l,h=e.x,u=e.y,c=e.radius,d=t.x,f=t.y,p=t.radius;if(u===f)0===(o=(a=-2*f)*a-4*(s=1)*(d*d+(l=(p*p-c*c-d*d+h*h)/(2*(h-d)))*l-2*d*l+f*f-p*p))?i.push(new n(l,-a/(2*s))):o>0&&(i.push(new n(l,(-a+Math.sqrt(o))/(2*s))),i.push(new n(l,(-a-Math.sqrt(o))/(2*s))));else{var m=(h-d)/(u-f),g=(p*p-c*c-d*d+h*h-f*f+u*u)/(2*(u-f));0===(o=(a=2*u*m-2*g*m-2*h)*a-4*(s=m*m+1)*(h*h+u*u+g*g-c*c-2*u*g))?(l=-a/(2*s),i.push(new n(l,g-l*m))):o>0&&(l=(-a+Math.sqrt(o))/(2*s),i.push(new n(l,g-l*m)),l=(-a-Math.sqrt(o))/(2*s),i.push(new n(l,g-l*m)))}}return i}},97439(e,t,i){var n=i(4042),r=i(81491);e.exports=function(e,t,i){if(void 0===i&&(i=[]),r(e,t)){var s=t.getLineA(),a=t.getLineB(),o=t.getLineC(),l=t.getLineD();n(s,e,i),n(a,e,i),n(o,e,i),n(l,e,i)}return i}},4042(e,t,i){var n=i(26099),r=i(80462);e.exports=function(e,t,i){if(void 0===i&&(i=[]),r(e,t)){var s,a,o=e.x1,l=e.y1,h=e.x2,u=e.y2,c=t.x,d=t.y,f=t.radius,p=h-o,m=u-l,g=o-c,v=l-d,y=p*p+m*m,x=2*(p*g+m*v),b=x*x-4*y*(g*g+v*v-f*f);if(0===b){var w=-x/(2*y);s=o+w*p,a=l+w*m,w>=0&&w<=1&&i.push(new n(s,a))}else if(b>0){var T=(-x-Math.sqrt(b))/(2*y);s=o+T*p,a=l+T*m,T>=0&&T<=1&&i.push(new n(s,a));var _=(-x+Math.sqrt(b))/(2*y);s=o+_*p,a=l+_*m,_>=0&&_<=1&&i.push(new n(s,a))}}return i}},36100(e,t,i){var n=i(25836);e.exports=function(e,t,i,r){void 0===i&&(i=!1);var s,a,o,l=e.x1,h=e.y1,u=e.x2,c=e.y2,d=t.x1,f=t.y1,p=u-l,m=c-h,g=t.x2-d,v=t.y2-f,y=p*v-m*g;if(0===y)return null;if(i){if(s=(p*(f-h)+m*(l-d))/(g*m-v*p),0!==p)a=(d+g*s-l)/p;else{if(0===m)return null;a=(f+v*s-h)/m}if(a<0||s<0||s>1)return null;o=a}else{if(a=((h-f)*p-(l-d)*m)/y,(s=((d-l)*v-(f-h)*g)/y)<0||s>1||a<0||a>1)return null;o=s}return void 0===r&&(r=new n),r.set(l+p*o,h+m*o,o)}},3073(e,t,i){var n=i(36100),r=i(23031),s=i(25836),a=new r,o=new s;e.exports=function(e,t,i,r){void 0===i&&(i=!1),void 0===r&&(r=new s);var l=!1;r.set(),o.set();for(var h=t[t.length-1],u=0;u<t.length;u++){var c=t[u];a.setTo(h.x,h.y,c.x,c.y),h=c,n(e,a,i,o)&&(!l||o.z<r.z)&&(r.copy(o),l=!0)}return l?r:null}},56362(e,t,i){var n=i(25836),r=i(61369),s=i(3073),a=new n;e.exports=function(e,t,i,n){void 0===n&&(n=new r),Array.isArray(t)||(t=[t]);var o=!1;n.set(),a.set();for(var l=0;l<t.length;l++)s(e,t[l].points,i,a)&&(!o||a.z<n.z)&&(n.set(a.x,a.y,a.z,l),o=!0);return o?n:null}},60646(e,t,i){var n=i(26099),r=i(76112),s=i(92773);e.exports=function(e,t,i){if(void 0===i&&(i=[]),s(e,t))for(var a=t.getLineA(),o=t.getLineB(),l=t.getLineC(),h=t.getLineD(),u=[new n,new n,new n,new n],c=[r(a,e,u[0]),r(o,e,u[1]),r(l,e,u[2]),r(h,e,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},71147(e,t,i){var n=i(61369),r=i(56362),s=new(i(23031));function a(e,t,i,a,o){var l=Math.cos(e),h=Math.sin(e);s.setTo(t,i,t+l,i+h);var u=r(s,a,!0);u&&o.push(new n(u.x,u.y,e,u.w))}function o(e,t){return e.z-t.z}e.exports=function(e,t,i){Array.isArray(i)||(i=[i]);for(var n=[],r=[],s=0;s<i.length;s++)for(var l=i[s].points,h=0;h<l.length;h++){var u=Math.atan2(l[h].y-t,l[h].x-e);-1===r.indexOf(u)&&(a(u,e,t,i,n),a(u-1e-5,e,t,i,n),a(u+1e-5,e,t,i,n),r.push(u))}return n.sort(o)}},68389(e,t,i){var n=i(87841),r=i(59996);e.exports=function(e,t,i){return void 0===i&&(i=new n),r(e,t)&&(i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.width=Math.min(e.right,t.right)-i.x,i.height=Math.min(e.bottom,t.bottom)-i.y),i}},52784(e,t,i){var n=i(60646),r=i(59996);e.exports=function(e,t,i){if(void 0===i&&(i=[]),r(e,t)){var s=e.getLineA(),a=e.getLineB(),o=e.getLineC(),l=e.getLineD();n(s,t,i),n(a,t,i),n(o,t,i),n(l,t,i)}return i}},26341(e,t,i){var n=i(89265),r=i(60646);e.exports=function(e,t,i){if(void 0===i&&(i=[]),n(e,t)){var s=t.getLineA(),a=t.getLineB(),o=t.getLineC();r(s,e,i),r(a,e,i),r(o,e,i)}return i}},38720(e,t,i){var n=i(4042),r=i(67636);e.exports=function(e,t,i){if(void 0===i&&(i=[]),r(e,t)){var s=e.getLineA(),a=e.getLineB(),o=e.getLineC();n(s,t,i),n(a,t,i),n(o,t,i)}return i}},13882(e,t,i){var n=i(26099),r=i(2822),s=i(76112);e.exports=function(e,t,i){if(void 0===i&&(i=[]),r(e,t))for(var a=e.getLineA(),o=e.getLineB(),l=e.getLineC(),h=[new n,new n,new n],u=[s(a,t,h[0]),s(o,t,h[1]),s(l,t,h[2])],c=0;c<3;c++)u[c]&&i.push(h[c]);return i}},75636(e,t,i){var n=i(82944),r=i(13882);e.exports=function(e,t,i){if(void 0===i&&(i=[]),n(e,t)){var s=t.getLineA(),a=t.getLineB(),o=t.getLineC();r(e,s,i),r(e,a,i),r(e,o,i)}return i}},80462(e,t,i){var n=i(87902),r=new(i(26099));e.exports=function(e,t,i){if(void 0===i&&(i=r),n(t,e.x1,e.y1))return i.x=e.x1,i.y=e.y1,!0;if(n(t,e.x2,e.y2))return i.x=e.x2,i.y=e.y2,!0;var s=e.x2-e.x1,a=e.y2-e.y1,o=t.x-e.x1,l=t.y-e.y1,h=s*s+a*a,u=s,c=a;if(h>0){var d=(o*s+l*a)/h;u*=d,c*=d}return i.x=e.x1+u,i.y=e.y1+c,u*u+c*c<=h&&u*s+c*a>=0&&n(t,i.x,i.y)}},76112(e){e.exports=function(e,t,i){var n=e.x1,r=e.y1,s=e.x2,a=e.y2,o=t.x1,l=t.y1,h=t.x2,u=t.y2;if(n===s&&r===a||o===h&&l===u)return!1;var c=(u-l)*(s-n)-(h-o)*(a-r);if(0===c)return!1;var d=((h-o)*(r-l)-(u-l)*(n-o))/c,f=((s-n)*(r-l)-(a-r)*(n-o))/c;return!(d<0||d>1||f<0||f>1)&&(i&&(i.x=n+d*(s-n),i.y=r+d*(a-r)),!0)}},92773(e){e.exports=function(e,t){var i=e.x1,n=e.y1,r=e.x2,s=e.y2,a=t.x,o=t.y,l=t.right,h=t.bottom,u=0;if(i>=a&&i<=l&&n>=o&&n<=h||r>=a&&r<=l&&s>=o&&s<=h)return!0;if(i<a&&r>=a){if((u=n+(s-n)*(a-i)/(r-i))>o&&u<=h)return!0}else if(i>l&&r<=l&&(u=n+(s-n)*(l-i)/(r-i))>=o&&u<=h)return!0;if(n<o&&s>=o){if((u=i+(r-i)*(o-n)/(s-n))>=a&&u<=l)return!0}else if(n>h&&s<=h&&(u=i+(r-i)*(h-n)/(s-n))>=a&&u<=l)return!0;return!1}},16204(e){e.exports=function(e,t,i){void 0===i&&(i=1);var n=t.x1,r=t.y1,s=t.x2,a=t.y2,o=e.x,l=e.y,h=(s-n)*(s-n)+(a-r)*(a-r);if(0===h)return!1;var u=((o-n)*(s-n)+(l-r)*(a-r))/h;if(u<0)return Math.sqrt((n-o)*(n-o)+(r-l)*(r-l))<=i;if(u>=0&&u<=1){var c=((r-l)*(s-n)-(n-o)*(a-r))/h;return Math.abs(c)*Math.sqrt(h)<=i}return Math.sqrt((s-o)*(s-o)+(a-l)*(a-l))<=i}},14199(e,t,i){var n=i(16204);e.exports=function(e,t){if(!n(e,t))return!1;var i=Math.min(t.x1,t.x2),r=Math.max(t.x1,t.x2),s=Math.min(t.y1,t.y2),a=Math.max(t.y1,t.y2);return e.x>=i&&e.x<=r&&e.y>=s&&e.y<=a}},59996(e){e.exports=function(e,t){return!(e.width<=0||e.height<=0||t.width<=0||t.height<=0)&&!(e.right<t.x||e.bottom<t.y||e.x>t.right||e.y>t.bottom)}},89265(e,t,i){var n=i(76112),r=i(37303),s=i(48653),a=i(77493);e.exports=function(e,t){if(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)return!1;var i=t.getLineA(),o=t.getLineB(),l=t.getLineC();if(r(e,i.x1,i.y1)||r(e,i.x2,i.y2))return!0;if(r(e,o.x1,o.y1)||r(e,o.x2,o.y2))return!0;if(r(e,l.x1,l.y1)||r(e,l.x2,l.y2))return!0;var h=e.getLineA(),u=e.getLineB(),c=e.getLineC(),d=e.getLineD();if(n(i,h)||n(i,u)||n(i,c)||n(i,d))return!0;if(n(o,h)||n(o,u)||n(o,c)||n(o,d))return!0;if(n(l,h)||n(l,u)||n(l,c)||n(l,d))return!0;var f=a(e);return s(t,f,!0).length>0}},84411(e){e.exports=function(e,t,i,n,r,s){return void 0===s&&(s=0),!(t>e.right+s||i<e.left-s||n>e.bottom+s||r<e.top-s)}},67636(e,t,i){var n=i(80462),r=i(10690);e.exports=function(e,t){return!(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)&&(!!r(e,t.x,t.y)||(!!n(e.getLineA(),t)||(!!n(e.getLineB(),t)||!!n(e.getLineC(),t))))}},2822(e,t,i){var n=i(76112);e.exports=function(e,t){return!(!e.contains(t.x1,t.y1)&&!e.contains(t.x2,t.y2))||(!!n(e.getLineA(),t)||(!!n(e.getLineB(),t)||!!n(e.getLineC(),t)))}},82944(e,t,i){var n=i(48653),r=i(71694),s=i(76112);e.exports=function(e,t){if(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)return!1;var i=e.getLineA(),a=e.getLineB(),o=e.getLineC(),l=t.getLineA(),h=t.getLineB(),u=t.getLineC();if(s(i,l)||s(i,h)||s(i,u))return!0;if(s(a,l)||s(a,h)||s(a,u))return!0;if(s(o,l)||s(o,h)||s(o,u))return!0;var c=r(e),d=n(t,c,!0);return d.length>0||(c=r(t),(d=n(e,c,!0)).length>0)}},91865(e,t,i){e.exports={CircleToCircle:i(2044),CircleToRectangle:i(81491),GetCircleToCircle:i(63376),GetCircleToRectangle:i(97439),GetLineToCircle:i(4042),GetLineToLine:i(36100),GetLineToPoints:i(3073),GetLineToPolygon:i(56362),GetLineToRectangle:i(60646),GetRaysFromPointToPolygon:i(71147),GetRectangleIntersection:i(68389),GetRectangleToRectangle:i(52784),GetRectangleToTriangle:i(26341),GetTriangleToCircle:i(38720),GetTriangleToLine:i(13882),GetTriangleToTriangle:i(75636),LineToCircle:i(80462),LineToLine:i(76112),LineToRectangle:i(92773),PointToLine:i(16204),PointToLineSegment:i(14199),RectangleToRectangle:i(59996),RectangleToTriangle:i(89265),RectangleToValues:i(84411),TriangleToCircle:i(67636),TriangleToLine:i(2822),TriangleToTriangle:i(82944)}},91938(e){e.exports=function(e){return Math.atan2(e.y2-e.y1,e.x2-e.x1)}},84993(e){e.exports=function(e,t,i){void 0===t&&(t=1),void 0===i&&(i=[]);var n=Math.round(e.x1),r=Math.round(e.y1),s=Math.round(e.x2),a=Math.round(e.y2),o=Math.abs(s-n),l=Math.abs(a-r),h=n<s?1:-1,u=r<a?1:-1,c=o-l;i.push({x:n,y:r});for(var d=1;n!==s||r!==a;){var f=c<<1;f>-l&&(c-=l,n+=h),f<o&&(c+=o,r+=u),d%t===0&&i.push({x:n,y:r}),d++}return i}},36469(e){e.exports=function(e,t,i){var n=t-(e.x1+e.x2)/2,r=i-(e.y1+e.y2)/2;return e.x1+=n,e.y1+=r,e.x2+=n,e.y2+=r,e}},31116(e,t,i){var n=i(23031);e.exports=function(e){return new n(e.x1,e.y1,e.x2,e.y2)}},59944(e){e.exports=function(e,t){return t.setTo(e.x1,e.y1,e.x2,e.y2)}},59220(e){e.exports=function(e,t){return e.x1===t.x1&&e.y1===t.y1&&e.x2===t.x2&&e.y2===t.y2}},78177(e,t,i){var n=i(35001);e.exports=function(e,t,i){void 0===i&&(i=t);var r=n(e),s=e.x2-e.x1,a=e.y2-e.y1;return t&&(e.x1=e.x1-s/r*t,e.y1=e.y1-a/r*t),i&&(e.x2=e.x2+s/r*i,e.y2=e.y2+a/r*i),e}},26708(e,t,i){var n=i(52816),r=i(6113),s=i(26099);e.exports=function(e,t,i,a,o){void 0===a&&(a=0),void 0===o&&(o=[]);var l,h,u=[],c=e.x1,d=e.y1,f=e.x2-c,p=e.y2-d,m=r(t,o),g=i-1;for(l=0;l<g;l++)h=m(l/g),u.push(new s(c+f*h,d+p*h));if(h=m(1),u.push(new s(c+f*h,d+p*h)),a>0){var v=u[0],y=[v];for(l=1;l<u.length-1;l++){var x=u[l];n(v,x)>=a&&(y.push(x),v=x)}var b=u[u.length-1];return n(v,b)<a&&y.pop(),y.push(b),y}return u}},32125(e,t,i){var n=i(26099);e.exports=function(e,t){return void 0===t&&(t=new n),t.x=(e.x1+e.x2)/2,t.y=(e.y1+e.y2)/2,t}},99569(e,t,i){var n=i(26099);e.exports=function(e,t,i){void 0===i&&(i=new n);var r=e.x1,s=e.y1,a=e.x2,o=e.y2,l=(a-r)*(a-r)+(o-s)*(o-s);if(0===l)return i;var h=((t.x-r)*(a-r)+(t.y-s)*(o-s))/l;return i.x=r+h*(a-r),i.y=s+h*(o-s),i}},34638(e,t,i){var n=i(36383),r=i(91938),s=i(26099);e.exports=function(e,t){void 0===t&&(t=new s);var i=r(e)-n.PI_OVER_2;return t.x=Math.cos(i),t.y=Math.sin(i),t}},13151(e,t,i){var n=i(26099);e.exports=function(e,t,i){return void 0===i&&(i=new n),i.x=e.x1+(e.x2-e.x1)*t,i.y=e.y1+(e.y2-e.y1)*t,i}},15258(e,t,i){var n=i(35001),r=i(26099);e.exports=function(e,t,i,s){void 0===s&&(s=[]),!t&&i>0&&(t=n(e)/i);for(var a=e.x1,o=e.y1,l=e.x2,h=e.y2,u=0;u<t;u++){var c=u/t,d=a+(l-a)*c,f=o+(h-o)*c;s.push(new r(d,f))}return s}},26408(e){e.exports=function(e,t){var i=e.x1,n=e.y1,r=e.x2,s=e.y2,a=(r-i)*(r-i)+(s-n)*(s-n);if(0===a)return!1;var o=((n-t.y)*(r-i)-(i-t.x)*(s-n))/a;return Math.abs(o)*Math.sqrt(a)}},98770(e){e.exports=function(e){return Math.abs(e.y1-e.y2)}},35001(e){e.exports=function(e){return Math.sqrt((e.x2-e.x1)*(e.x2-e.x1)+(e.y2-e.y1)*(e.y2-e.y1))}},23031(e,t,i){var n=i(83419),r=i(13151),s=i(15258),a=i(23777),o=i(65822),l=i(26099),h=new n({initialize:function(e,t,i,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.LINE,this.x1=e,this.y1=t,this.x2=i,this.y2=n},getPoint:function(e,t){return r(this,e,t)},getPoints:function(e,t,i){return s(this,e,t,i)},getRandomPoint:function(e){return o(this,e)},setTo:function(e,t,i,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=e,this.y1=t,this.x2=i,this.y2=n,this},setFromObjects:function(e,t){return this.x1=e.x,this.y1=e.y,this.x2=t.x,this.y2=t.y,this},getPointA:function(e){return void 0===e&&(e=new l),e.set(this.x1,this.y1),e},getPointB:function(e){return void 0===e&&(e=new l),e.set(this.x2,this.y2),e},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(e){this.x1<=this.x2?this.x1=e:this.x2=e}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(e){this.x1>this.x2?this.x1=e:this.x2=e}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(e){this.y1<=this.y2?this.y1=e:this.y2=e}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(e){this.y1>this.y2?this.y1=e:this.y2=e}}});e.exports=h},64795(e,t,i){var n=i(36383),r=i(15994),s=i(91938);e.exports=function(e){var t=s(e)-n.PI_OVER_2;return r(t,-Math.PI,Math.PI)}},52616(e,t,i){var n=i(36383),r=i(91938);e.exports=function(e){return Math.cos(r(e)-n.PI_OVER_2)}},87231(e,t,i){var n=i(36383),r=i(91938);e.exports=function(e){return Math.sin(r(e)-n.PI_OVER_2)}},89662(e){e.exports=function(e,t,i){return e.x1+=t,e.y1+=i,e.x2+=t,e.y2+=i,e}},71165(e){e.exports=function(e){return-(e.x2-e.x1)/(e.y2-e.y1)}},65822(e,t,i){var n=i(26099);e.exports=function(e,t){void 0===t&&(t=new n);var i=Math.random();return t.x=e.x1+i*(e.x2-e.x1),t.y=e.y1+i*(e.y2-e.y1),t}},69777(e,t,i){var n=i(91938),r=i(64795);e.exports=function(e,t){return 2*r(t)-Math.PI-n(e)}},39706(e,t,i){var n=i(64400);e.exports=function(e,t){var i=(e.x1+e.x2)/2,r=(e.y1+e.y2)/2;return n(e,i,r,t)}},82585(e,t,i){var n=i(64400);e.exports=function(e,t,i){return n(e,t.x,t.y,i)}},64400(e){e.exports=function(e,t,i,n){var r=Math.cos(n),s=Math.sin(n),a=e.x1-t,o=e.y1-i;return e.x1=a*r-o*s+t,e.y1=a*s+o*r+i,a=e.x2-t,o=e.y2-i,e.x2=a*r-o*s+t,e.y2=a*s+o*r+i,e}},62377(e){e.exports=function(e,t,i,n,r){return e.x1=t,e.y1=i,e.x2=t+Math.cos(n)*r,e.y2=i+Math.sin(n)*r,e}},71366(e){e.exports=function(e){return(e.y2-e.y1)/(e.x2-e.x1)}},10809(e){e.exports=function(e){return Math.abs(e.x1-e.x2)}},2529(e,t,i){var n=i(23031);n.Angle=i(91938),n.BresenhamPoints=i(84993),n.CenterOn=i(36469),n.Clone=i(31116),n.
vendor: 4,981 bytes, line 2
2CopyFrom=i(59944),n.Equals=i(59220),n.Extend=i(78177),n.GetEasedPoints=i(26708),n.GetMidPoint=i(32125),n.GetNearestPoint=i(99569),n.GetNormal=i(34638),n.GetPoint=i(13151),n.GetPoints=i(15258),n.GetShortestDistance=i(26408),n.Height=i(98770),n.Length=i(35001),n.NormalAngle=i(64795),n.NormalX=i(52616),n.NormalY=i(87231),n.Offset=i(89662),n.PerpSlope=i(71165),n.Random=i(65822),n.ReflectAngle=i(69777),n.Rotate=i(39706),n.RotateAroundPoint=i(82585),n.RotateAroundXY=i(64400),n.SetToAngle=i(62377),n.Slope=i(71366),n.Width=i(10809),e.exports=n},12306(e,t,i){var n=i(25717);e.exports=function(e){return new n(e.points)}},63814(e){e.exports=function(e,t,i){for(var n=!1,r=-1,s=e.points.length-1;++r<e.points.length;s=r){var a=e.points[r].x,o=e.points[r].y,l=e.points[s].x,h=e.points[s].y;(o<=i&&i<h||h<=i&&i<o)&&t<(l-a)*(i-o)/(h-o)+a&&(n=!n)}return n}},99338(e,t,i){var n=i(63814);e.exports=function(e,t){return n(e,t.x,t.y)}},94811(e){function t(e,t,n){n=n||2;var s,a,o,l,c,d,p,m=t&&t.length,g=m?t[0]*n:e.length,v=i(e,0,g,n,!0),y=[];if(!v||v.next===v.prev)return y;if(m&&(v=function(e,t,n,r){var s,a,o,l=[];for(s=0,a=t.length;s<a;s++)(o=i(e,t[s]*r,s<a-1?t[s+1]*r:e.length,r,!1))===o.next&&(o.steiner=!0),l.push(f(o));for(l.sort(h),s=0;s<l.length;s++)n=u(l[s],n);return n}(e,t,v,n)),e.length>80*n){s=o=e[0],a=l=e[1];for(var x=n;x<g;x+=n)(c=e[x])<s&&(s=c),(d=e[x+1])<a&&(a=d),c>o&&(o=c),d>l&&(l=d);p=0!==(p=Math.max(o-s,l-a))?32767/p:0}return r(v,y,n,s,a,p,0),y}function i(e,t,i,n,r){var s,a;if(r===C(e,t,i,n)>0)for(s=t;s<i;s+=n)a=_(s,e[s],e[s+1],a);else for(s=i-n;s>=t;s-=n)a=_(s,e[s],e[s+1],a);return a&&v(a,a.next)&&(S(a),a=a.next),a}function n(e,t){if(!e)return e;t||(t=e);var i,n=e;do{if(i=!1,n.steiner||!v(n,n.next)&&0!==g(n.prev,n,n.next))n=n.next;else{if(S(n),(n=t=n.prev)===n.next)break;i=!0}}while(i||n!==t);return t}function r(e,t,i,h,u,c,f){if(e){!f&&c&&function(e,t,i,n){var r=e;do{0===r.z&&(r.z=d(r.x,r.y,t,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,i,n,r,s,a,o,l,h=1;do{for(i=e,e=null,s=null,a=0;i;){for(a++,n=i,o=0,t=0;t<h&&(o++,n=n.nextZ);t++);for(l=h;o>0||l>0&&n;)0!==o&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,o--):(r=n,n=n.nextZ,l--),s?s.nextZ=r:e=r,r.prevZ=s,s=r;i=n}s.nextZ=null,h*=2}while(a>1)}(r)}(e,h,u,c);for(var p,m,g=e;e.prev!==e.next;)if(p=e.prev,m=e.next,c?a(e,h,u,c):s(e))t.push(p.i/i|0),t.push(e.i/i|0),t.push(m.i/i|0),S(e),e=m.next,g=m.next;else if((e=m)===g){f?1===f?r(e=o(n(e),t,i),t,i,h,u,c,2):2===f&&l(e,t,i,h,u,c):r(n(e),t,i,h,u,c,1);break}}}function s(e){var t=e.prev,i=e,n=e.next;if(g(t,i,n)>=0)return!1;for(var r=t.x,s=i.x,a=n.x,o=t.y,l=i.y,h=n.y,u=r<s?r<a?r:a:s<a?s:a,c=o<l?o<h?o:h:l<h?l:h,d=r>s?r>a?r:a:s>a?s:a,f=o>l?o>h?o:h:l>h?l:h,m=n.next;m!==t;){if(m.x>=u&&m.x<=d&&m.y>=c&&m.y<=f&&p(r,o,s,l,a,h,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function a(e,t,i,n){var r=e.prev,s=e,a=e.next;if(g(r,s,a)>=0)return!1;for(var o=r.x,l=s.x,h=a.x,u=r.y,c=s.y,f=a.y,m=o<l?o<h?o:h:l<h?l:h,v=u<c?u<f?u:f:c<f?c:f,y=o>l?o>h?o:h:l>h?l:h,x=u>c?u>f?u:f:c>f?c:f,b=d(m,v,t,i,n),w=d(y,x,t,i,n),T=e.prevZ,_=e.nextZ;T&&T.z>=b&&_&&_.z<=w;){if(T.x>=m&&T.x<=y&&T.y>=v&&T.y<=x&&T!==r&&T!==a&&p(o,u,l,c,h,f,T.x,T.y)&&g(T.prev,T,T.next)>=0)return!1;if(T=T.prevZ,_.x>=m&&_.x<=y&&_.y>=v&&_.y<=x&&_!==r&&_!==a&&p(o,u,l,c,h,f,_.x,_.y)&&g(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;T&&T.z>=b;){if(T.x>=m&&T.x<=y&&T.y>=v&&T.y<=x&&T!==r&&T!==a&&p(o,u,l,c,h,f,T.x,T.y)&&g(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;_&&_.z<=w;){if(_.x>=m&&_.x<=y&&_.y>=v&&_.y<=x&&_!==r&&_!==a&&p(o,u,l,c,h,f,_.x,_.y)&&g(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function o(e,t,i){var r=e;do{var s=r.prev,a=r.next.next;!v(s,a)&&y(s,r,r.next,a)&&w(s,a)&&w(a,s)&&(t.push(s.i/i|0),t.push(r.i/i|0),t.push(a.i/i|0),S(r),S(r.next),r=e=a),r=r.next}while(r!==e);return n(r)}function l(e,t,i,s,a,o){var l=e;do{for(var h=l.next.next;h!==l.prev;){if(l.i!==h.i&&m(l,h)){var u=T(l,h);return l=n(l,l.next),u=n(u,u.next),r(l,t,i,s,a,o,0),void r(u,t,i,s,a,o,0)}h=h.next}l=l.next}while(l!==e)}function h(e,t){return e.x-t.x}function u(e,t){var i=function(e,t){var i,n=t,r=e.x,s=e.y,a=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){var o=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(o<=r&&o>a&&(a=o,i=n.x<n.next.x?n:n.next,o===r))return i}n=n.next}while(n!==t);if(!i)return null;var l,h=i,u=i.x,d=i.y,f=1/0;n=i;do{r>=n.x&&n.x>=u&&r!==n.x&&p(s<d?r:a,s,u,d,s<d?a:r,s,n.x,n.y)&&(l=Math.abs(s-n.y)/(r-n.x),w(n,e)&&(l<f||l===f&&(n.x>i.x||n.x===i.x&&c(i,n)))&&(i=n,f=l)),n=n.next}while(n!==h);return i}(e,t);if(!i)return t;var r=T(i,e);return n(r,r.next),n(i,i.next)}function c(e,t){return g(e.prev,e,t.prev)<0&&g(t.next,e,e.next)<0}function d(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function f(e){var t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}
vendor: 119,109 bytes, line 2
2while(t!==e);return i}function p(e,t,i,n,r,s,a,o){return(r-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(n-o)>=(i-a)*(t-o)&&(i-a)*(s-o)>=(r-a)*(n-o)}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&y(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(w(e,t)&&w(t,e)&&function(e,t){var i=e,n=!1,r=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!==i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)&&(g(e.prev,e,t.prev)||g(e,t.prev,t))||v(e,t)&&g(e.prev,e,e.next)>0&&g(t.prev,t,t.next)>0)}function g(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function y(e,t,i,n){var r=b(g(e,t,i)),s=b(g(e,t,n)),a=b(g(i,n,e)),o=b(g(i,n,t));return r!==s&&a!==o||(!(0!==r||!x(e,i,t))||(!(0!==s||!x(e,n,t))||(!(0!==a||!x(i,e,n))||!(0!==o||!x(i,t,n)))))}function x(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function b(e){return e>0?1:e<0?-1:0}function w(e,t){return g(e.prev,e,e.next)<0?g(e,t,e.next)>=0&&g(e,e.prev,t)>=0:g(e,t,e.prev)<0||g(e,e.next,t)<0}function T(e,t){var i=new E(e.i,e.x,e.y),n=new E(t.i,t.x,t.y),r=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function _(e,t,i,n){var r=new E(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function S(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function E(e,t,i){this.i=e,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 C(e,t,i,n){for(var r=0,s=t,a=i-n;s<i;s+=n)r+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return r}t.deviation=function(e,t,i,n){var r=t&&t.length,s=r?t[0]*i:e.length,a=Math.abs(C(e,0,s,i));if(r)for(var o=0,l=t.length;o<l;o++){var h=t[o]*i,u=o<l-1?t[o+1]*i:e.length;a-=Math.abs(C(e,h,u,i))}var c=0;for(o=0;o<n.length;o+=3){var d=n[o]*i,f=n[o+1]*i,p=n[o+2]*i;c+=Math.abs((e[d]-e[p])*(e[f+1]-e[d+1])-(e[d]-e[f])*(e[p+1]-e[d+1]))}return 0===a&&0===c?0:Math.abs((c-a)/a)},t.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},n=0,r=0;r<e.length;r++){for(var s=0;s<e[r].length;s++)for(var a=0;a<t;a++)i.vertices.push(e[r][s][a]);r>0&&(n+=e[r-1].length,i.holes.push(n))}return i},e.exports=t},13829(e,t,i){var n=i(87841);e.exports=function(e,t){void 0===t&&(t=new n);for(var i,r=1/0,s=1/0,a=-r,o=-s,l=0;l<e.points.length;l++)i=e.points[l],r=Math.min(r,i.x),s=Math.min(s,i.y),a=Math.max(a,i.x),o=Math.max(o,i.y);return t.x=r,t.y=s,t.width=a-r,t.height=o-s,t}},26173(e){e.exports=function(e,t){void 0===t&&(t=[]);for(var i=0;i<e.points.length;i++)t.push(e.points[i].x),t.push(e.points[i].y);return t}},9564(e,t,i){var n=i(35001),r=i(23031),s=i(30052);e.exports=function(e,t,i,a){void 0===a&&(a=[]);var o=e.points,l=s(e);!t&&i>0&&(t=l/i);for(var h=0;h<t;h++)for(var u=l*(h/t),c=0,d=0;d<o.length;d++){var f=o[d],p=o[(d+1)%o.length],m=new r(f.x,f.y,p.x,p.y),g=n(m);if(!(u<c||u>c+g)){var v=m.getPoint((u-c)/g);a.push(v);break}c+=g}return a}},30052(e,t,i){var n=i(35001),r=i(23031);e.exports=function(e){for(var t=e.points,i=0,s=0;s<t.length;s++){var a=t[s],o=t[(s+1)%t.length],l=new r(a.x,a.y,o.x,o.y);i+=n(l)}return i}},25717(e,t,i){var n=i(83419),r=i(63814),s=i(9564),a=i(23777),o=new n({initialize:function(e){this.type=a.POLYGON,this.area=0,this.points=[],e&&this.setTo(e)},contains:function(e,t){return r(this,e,t)},setTo:function(e){if(this.area=0,this.points=[],"string"===typeof e&&(e=e.split(" ")),!Array.isArray(e))return this;for(var t,i=0;i<e.length;i++)t={x:0,y:0},"number"===typeof e[i]||"string"===typeof e[i]?(t.x=parseFloat(e[i]),t.y=parseFloat(e[i+1]),i++):Array.isArray(e[i])?(t.x=e[i][0],t.y=e[i][1]):(t.x=e[i].x,t.y=e[i].y),this.points.push(t);return this.calculateArea(),this},calculateArea:function(){if(this.points.length<3)return this.area=0,this.area;for(var e,t,i=0,n=0;n<this.points.length-1;n++)e=this.points[n],i+=((t=this.points[n+1]).x-e.x)*(e.y+t.y);return e=this.points[0],t=this.points[this.points.length-1],i+=(e.x-t.x)*(t.y+e.y),this.area=.5*-i,this.area},getPoints:function(e,t,i){return s(this,e,t,i)}});e.exports=o},8133(e){e.exports=function(e){return e.points.reverse(),e}},29524(e){function t(e,t){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function i(e,t,i){var n=t.x,r=t.y,s=i.x-n,a=i.y-r;if(0!==s||0!==a){var o=((e.x-n)*s+(e.y-r)*a)/(s*s+a*a);o>1?(n=i.x,r=i.y):o>0&&(n+=s*o,r+=a*o)}return(s=e.x-n)*s+(a=e.y-r)*a}function n(e,t,r,s,a){for(var o,l=s,h=t+1;h<r;h++){var u=i(e[h],e[t],e[r]);u>l&&(o=h,l=u)}l>s&&(o-t>1&&n(e,t,o,s,a),a.push(e[o]),r-o>1&&n(e,o,r,s,a))}function r(e,t){var i=e.length-1,r=[e[0]];return n(e,0,i,t,r),r.push(e[i]),r}e.exports=function(e,i,n){void 0===i&&(i=1),void 0===n&&(n=!1);var s=e.points;if(s.length>2){var a=i*i;n||(s=function(e,i){for(var n,r=e[0],s=[r],a=1,o=e.length;a<o;a++)t(n=e[a],r)>i&&(s.push(n),r=n);return r!==n&&s.push(n),s}(s,a)),e.setTo(r(s,a))}return e}},5469(e){var t=function(e,t){return e[0]=t[0],e[1]=t[1],e};e.exports=function(e){var i,n=[],r=e.points;for(i=0;i<r.length;i++)n.push([r[i].x,r[i].y]);var s=[];for(n.length>0&&s.push(t([0,0],n[0])),i=0;i<n.length-1;i++){var a=n[i],o=n[i+1],l=a[0],h=a[1],u=o[0],c=o[1];s.push([.85*l+.15*u,.85*h+.15*c]),s.push([.15*l+.85*u,.15*h+.85*c])}return n.length>1&&s.push(t([0,0],n[n.length-1])),e.setTo(s)}},24709(e){e.exports=function(e,t,i){for(var n=e.points,r=0;r<n.length;r++)n[r].x+=t,n[r].y+=i;return e}},58423(e,t,i){var n=i(25717);n.Clone=i(12306),n.Contains=i(63814),n.ContainsPoint=i(99338),n.Earcut=i(94811),n.GetAABB=i(13829),n.GetNumberArray=i(26173),n.GetPoints=i(9564),n.Perimeter=i(30052),n.Reverse=i(8133),n.Simplify=i(29524),n.Smooth=i(5469),n.Translate=i(24709),e.exports=n},39843(e){e.exports=function(e){return e.width*e.height}},98615(e){e.exports=function(e){return e.x=Math.ceil(e.x),e.y=Math.ceil(e.y),e}},31688(e){e.exports=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}},67502(e){e.exports=function(e,t,i){return e.x=t-e.width/2,e.y=i-e.height/2,e}},65085(e,t,i){var n=i(87841);e.exports=function(e){return new n(e.x,e.y,e.width,e.height)}},37303(e){e.exports=function(e,t,i){return!(e.width<=0||e.height<=0)&&(e.x<=t&&e.x+e.width>=t&&e.y<=i&&e.y+e.height>=i)}},96553(e,t,i){var n=i(37303);e.exports=function(e,t){return n(e,t.x,t.y)}},70273(e){e.exports=function(e,t){return!(t.width*t.height>e.width*e.height)&&(t.x>e.x&&t.x<e.right&&t.right>e.x&&t.right<e.right&&t.y>e.y&&t.y<e.bottom&&t.bottom>e.y&&t.bottom<e.bottom)}},43459(e){e.exports=function(e,t){return t.setTo(e.x,e.y,e.width,e.height)}},77493(e){e.exports=function(e,t){return void 0===t&&(t=[]),t.push({x:e.x,y:e.y}),t.push({x:e.right,y:e.y}),t.push({x:e.right,y:e.bottom}),t.push({x:e.x,y:e.bottom}),t}},9219(e){e.exports=function(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}},53751(e,t,i){var n=i(8249);e.exports=function(e,t){var i=n(e);return i<n(t)?e.setSize(t.height*i,t.height):e.setSize(t.width,t.width/i),e.setPosition(t.centerX-e.width/2,t.centerY-e.height/2)}},16088(e,t,i){var n=i(8249);e.exports=function(e,t){var i=n(e);return i>n(t)?e.setSize(t.height*i,t.height):e.setSize(t.width,t.width/i),e.setPosition(t.centerX-e.width/2,t.centerY-e.height/2)}},80774(e){e.exports=function(e){return e.x=Math.floor(e.x),e.y=Math.floor(e.y),e}},83859(e){e.exports=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}},19217(e,t,i){var n=i(87841),r=i(36383);e.exports=function(e,t){if(void 0===t&&(t=new n),0===e.length)return t;for(var i,s,a,o=Number.MAX_VALUE,l=Number.MAX_VALUE,h=r.MIN_SAFE_INTEGER,u=r.MIN_SAFE_INTEGER,c=0;c<e.length;c++)i=e[c],Array.isArray(i)?(s=i[0],a=i[1]):(s=i.x,a=i.y),o=Math.min(o,s),l=Math.min(l,a),h=Math.max(h,s),u=Math.max(u,a);return t.x=o,t.y=l,t.width=h-o,t.height=u-l,t}},9477(e,t,i){var n=i(87841);e.exports=function(e,t,i,r,s){return void 0===s&&(s=new n),s.setTo(Math.min(e,i),Math.min(t,r),Math.abs(e-i),Math.abs(t-r))}},8249(e){e.exports=function(e){return 0===e.height?NaN:e.width/e.height}},27165(e,t,i){var n=i(26099);e.exports=function(e,t){return void 0===t&&(t=new n),t.x=e.centerX,t.y=e.centerY,t}},20812(e,t,i){var n=i(13019),r=i(26099);e.exports=function(e,t,i){if(void 0===i&&(i=new r),t<=0||t>=1)return i.x=e.x,i.y=e.y,i;var s=n(e)*t;return t>.5?(s-=e.width+e.height)<=e.width?(i.x=e.right-s,i.y=e.bottom):(i.x=e.x,i.y=e.bottom-(s-e.width)):s<=e.width?(i.x=e.x+s,i.y=e.y):(i.x=e.right,i.y=e.y+(s-e.width)),i}},34819(e,t,i){var n=i(20812),r=i(13019);e.exports=function(e,t,i,s){void 0===s&&(s=[]),!t&&i>0&&(t=r(e)/i);for(var a=0;a<t;a++){var o=a/t;s.push(n(e,o))}return s}},51313(e,t,i){var n=i(26099);e.exports=function(e,t){return void 0===t&&(t=new n),t.x=e.width,t.y=e.height,t}},86091(e,t,i){var n=i(67502);e.exports=function(e,t,i){var r=e.centerX,s=e.centerY;return e.setSize(e.width+2*t,e.height+2*i),n(e,r,s)}},53951(e,t,i){var n=i(87841),r=i(59996);e.exports=function(e,t,i){return void 0===i&&(i=new n),r(e,t)?(i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.width=Math.min(e.right,t.right)-i.x,i.height=Math.min(e.bottom,t.bottom)-i.y):i.setEmpty(),i}},14649(e,t,i){var n=i(13019),r=i(26099);e.exports=function(e,t,i,s){if(void 0===s&&(s=[]),!t&&!i)return s;t?i=Math.round(n(e)/t):t=n(e)/i;for(var a=e.x,o=e.y,l=0,h=0;h<i;h++)switch(s.push(new r(a,o)),l){case 0:(a+=t)>=e.right&&(l=1,o+=a-e.right,a=e.right);break;case 1:(o+=t)>=e.bottom&&(l=2,a-=o-e.bottom,o=e.bottom);break;case 2:(a-=t)<=e.left&&(l=3,o-=e.left-a,a=e.left);break;case 3:(o-=t)<=e.top&&(l=0,o=e.top)}return s}},33595(e){e.exports=function(e,t){for(var i=e.x,n=e.right,r=e.y,s=e.bottom,a=0;a<t.length;a++)i=Math.min(i,t[a].x),n=Math.max(n,t[a].x),r=Math.min(r,t[a].y),s=Math.max(s,t[a].y);return e.x=i,e.y=r,e.width=n-i,e.height=s-r,e}},20074(e){e.exports=function(e,t){var i=Math.min(e.x,t.x),n=Math.max(e.right,t.right);e.x=i,e.width=n-i;var r=Math.min(e.y,t.y),s=Math.max(e.bottom,t.bottom);return e.y=r,e.height=s-r,e}},92171(e){e.exports=function(e,t,i){var n=Math.min(e.x,t),r=Math.max(e.right,t);e.x=n,e.width=r-n;var s=Math.min(e.y,i),a=Math.max(e.bottom,i);return e.y=s,e.height=a-s,e}},42981(e){e.exports=function(e,t,i){return e.x+=t,e.y+=i,e}},46907(e){e.exports=function(e,t){return e.x+=t.x,e.y+=t.y,e}},60170(e){e.exports=function(e,t){return e.x<t.right&&e.right>t.x&&e.y<t.bottom&&e.bottom>t.y}},13019(e){e.exports=function(e){return 2*(e.width+e.height)}},85133(e,t,i){var n=i(26099),r=i(39506);e.exports=function(e,t,i){void 0===i&&(i=new n),t=r(t);var s=Math.sin(t),a=Math.cos(t),o=a>0?e.width/2:e.width/-2,l=s>0?e.height/2:e.height/-2;return Math.abs(o*s)<Math.abs(l*a)?l=o*s/a:o=l*a/s,i.x=o+e.centerX,i.y=l+e.centerY,i}},26597(e,t,i){var n=i(26099);e.exports=function(e,t){return void 0===t&&(t=new n),t.x=e.x+Math.random()*e.width,t.y=e.y+Math.random()*e.height,t}},86470(e,t,i){var n=i(30976),r=i(70273),s=i(26099);e.exports=function(e,t,i){if(void 0===i&&(i=new s),r(e,t))switch(n(0,3)){case 0:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.y+Math.random()*(t.top-e.y);break;case 1:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.bottom+Math.random()*(e.bottom-t.bottom);break;case 2:i.x=e.x+Math.random()*(t.x-e.x),i.y=t.y+Math.random()*(e.bottom-t.y);break;case 3:i.x=t.right+Math.random()*(e.right-t.right),i.y=e.y+Math.random()*(t.bottom-e.y)}return i}},87841(e,t,i){var n=i(83419),r=i(37303),s=i(20812),a=i(34819),o=i(23777),l=i(23031),h=i(26597),u=new n({initialize:function(e,t,i,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=o.RECTANGLE,this.x=e,this.y=t,this.width=i,this.height=n},contains:function(e,t){return r(this,e,t)},getPoint:function(e,t){return s(this,e,t)},getPoints:function(e,t,i){return a(this,e,t,i)},getRandomPoint:function(e){return h(this,e)},setTo:function(e,t,i,n){return this.x=e,this.y=t,this.width=i,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(e,t){return void 0===t&&(t=e),this.x=e,this.y=t,this},setSize:function(e,t){return void 0===t&&(t=e),this.width=e,this.height=t,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(e){return void 0===e&&(e=new l),e.setTo(this.x,this.y,this.right,this.y),e},getLineB:function(e){return void 0===e&&(e=new l),e.setTo(this.right,this.y,this.right,this.bottom),e},getLineC:function(e){return void 0===e&&(e=new l),e.setTo(this.right,this.bottom,this.x,this.bottom),e},getLineD:function(e){return void 0===e&&(e=new l),e.setTo(this.x,this.bottom,this.x,this.y),e},left:{get:function(){return this.x},set:function(e){e>=this.right?this.width=0:this.width=this.right-e,this.x=e}},right:{get:function(){return this.x+this.width},set:function(e){e<=this.x?this.width=0:this.width=e-this.x}},top:{get:function(){return this.y},set:function(e){e>=this.bottom?this.height=0:this.height=this.bottom-e,this.y=e}},bottom:{get:function(){return this.y+this.height},set:function(e){e<=this.y?this.height=0:this.height=e-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(e){this.x=e-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(e){this.y=e-this.height/2}}});e.exports=u},94845(e){e.exports=function(e,t){return e.width===t.width&&e.height===t.height}},31730(e){e.exports=function(e,t,i){return void 0===i&&(i=t),e.width*=t,e.height*=i,e}},36899(e,t,i){var n=i(87841);e.exports=function(e,t,i){void 0===i&&(i=new n);var r=Math.min(e.x,t.x),s=Math.min(e.y,t.y),a=Math.max(e.right,t.right)-r,o=Math.max(e.bottom,t.bottom)-s;return i.setTo(r,s,a,o)}},93232(e,t,i){var n=i(87841);n.Area=i(39843),n.Ceil=i(98615),n.CeilAll=i(31688),n.CenterOn=i(67502),n.Clone=i(65085),n.Contains=i(37303),n.ContainsPoint=i(96553),n.ContainsRect=i(70273),n.CopyFrom=i(43459),n.Decompose=i(77493),n.Equals=i(9219),n.FitInside=i(53751),n.FitOutside=i(16088),n.Floor=i(80774),n.FloorAll=i(83859),n.FromPoints=i(19217),n.FromXY=i(9477),n.GetAspectRatio=i(8249),n.GetCenter=i(27165),n.GetPoint=i(20812),n.GetPoints=i(34819),n.GetSize=i(51313),n.Inflate=i(86091),n.Intersection=i(53951),n.MarchingAnts=i(14649),n.MergePoints=i(33595),n.MergeRect=i(20074),n.MergeXY=i(92171),n.Offset=i(42981),n.OffsetPoint=i(46907),n.Overlaps=i(60170),n.Perimeter=i(13019),n.PerimeterPoint=i(85133),n.Random=i(26597),n.RandomOutside=i(86470),n.SameDimensions=i(94845),n.Scale=i(31730),n.Union=i(36899),e.exports=n},41658(e){e.exports=function(e){var t=e.x1,i=e.y1,n=e.x2,r=e.y2,s=e.x3,a=e.y3;return Math.abs(((s-t)*(r-i)-(n-t)*(a-i))/2)}},39208(e,t,i){var n=i(16483);e.exports=function(e,t,i){var r=i*(Math.sqrt(3)/2);return new n(e,t,e+i/2,t+r,e-i/2,t+r)}},39545(e,t,i){var n=i(94811),r=i(16483);e.exports=function(e,t,i,s,a){void 0===t&&(t=null),void 0===i&&(i=1),void 0===s&&(s=1),void 0===a&&(a=[]);for(var o,l,h,u,c,d,f,p,m,g=n(e,t),v=0;v<g.length;v+=3)o=g[v],l=g[v+1],h=g[v+2],u=e[2*o]*i,c=e[2*o+1]*s,d=e[2*l]*i,f=e[2*l+1]*s,p=e[2*h]*i,m=e[2*h+1]*s,a.push(new r(u,c,d,f,p,m));return a}},90301(e,t,i){var n=i(16483);e.exports=function(e,t,i,r){return void 0===r&&(r=i),new n(e,t,e,t-r,e+i,t)}},23707(e,t,i){var n=i(97523),r=i(13584);e.exports=function(e,t,i,s){void 0===s&&(s=n);var a=s(e),o=t-a.x,l=i-a.y;return r(e,o,l)}},97523(e,t,i){var n=i(26099);e.exports=function(e,t){return void 0===t&&(t=new n),t.x=(e.x1+e.x2+e.x3)/3,t.y=(e.y1+e.y2+e.y3)/3,t}},24951(e,t,i){var n=i(26099);function r(e,t,i,n){return e*n-t*i}e.exports=function(e,t){void 0===t&&(t=new n);var i=e.x3,s=e.y3,a=e.x1-i,o=e.y1-s,l=e.x2-i,h=e.y2-s,u=2*r(a,o,l,h),c=r(o,a*a+o*o,h,l*l+h*h),d=r(a,a*a+o*o,l,l*l+h*h);return t.x=i-c/u,t.y=s+d/u,t}},85614(e,t,i){var n=i(96503);e.exports=function(e,t){void 0===t&&(t=new n);var i,r,s=e.x1,a=e.y1,o=e.x2,l=e.y2,h=e.x3,u=e.y3,c=o-s,d=l-a,f=h-s,p=u-a,m=c*(s+o)+d*(a+l),g=f*(s+h)+p*(a+u),v=2*(c*(u-l)-d*(h-o));if(Math.abs(v)<1e-6){var y=Math.min(s,o,h),x=Math.min(a,l,u);i=.5*(Math.max(s,o,h)-y),r=.5*(Math.max(a,l,u)-x),t.x=y+i,t.y=x+r,t.radius=Math.sqrt(i*i+r*r)}else t.x=(p*m-d*g)/v,t.y=(c*g-f*m)/v,i=t.x-s,r=t.y-a,t.radius=Math.sqrt(i*i+r*r);return t}},74422(e,t,i){var n=i(16483);e.exports=function(e){return new n(e.x1,e.y1,e.x2,e.y2,e.x3,e.y3)}},10690(e){e.exports=function(e,t,i){var n=e.x3-e.x1,r=e.y3-e.y1,s=e.x2-e.x1,a=e.y2-e.y1,o=t-e.x1,l=i-e.y1,h=n*n+r*r,u=n*s+r*a,c=n*o+r*l,d=s*s+a*a,f=s*o+a*l,p=h*d-u*u,m=0===p?0:1/p,g=(d*c-u*f)*m,v=(h*f-u*c)*m;return g>=0&&v>=0&&g+v<1}},48653(e){e.exports=function(e,t,i,n){void 0===i&&(i=!1),void 0===n&&(n=[]);for(var r,s,a,o,l,h,u=e.x3-e.x1,c=e.y3-e.y1,d=e.x2-e.x1,f=e.y2-e.y1,p=u*u+c*c,m=u*d+c*f,g=d*d+f*f,v=p*g-m*m,y=0===v?0:1/v,x=e.x1,b=e.y1,w=0;w<t.length&&(s=(p*(h=d*(a=t[w].x-x)+f*(o=t[w].y-b))-m*(l=u*a+c*o))*y,!((r=(g*l-m*h)*y)>=0&&s>=0&&r+s<1&&(n.push({x:t[w].x,y:t[w].y}),i)));w++);return n}},96006(e,t,i){var n=i(10690);e.exports=function(e,t){return n(e,t.x,t.y)}},71326(e){e.exports=function(e,t){return t.setTo(e.x1,e.y1,e.x2,e.y2,e.x3,e.y3)}},71694(e){e.exports=function(e,t){return void 0===t&&(t=[]),t.push({x:e.x1,y:e.y1}),t.push({x:e.x2,y:e.y2}),t.push({x:e.x3,y:e.y3}),t}},33522(e){e.exports=function(e,t){return e.x1===t.x1&&e.y1===t.y1&&e.x2===t.x2&&e.y2===t.y2&&e.x3===t.x3&&e.y3===t.y3}},20437(e,t,i){var n=i(26099),r=i(35001);e.exports=function(e,t,i){void 0===i&&(i=new n);var s=e.getLineA(),a=e.getLineB(),o=e.getLineC();if(t<=0||t>=1)return i.x=s.x1,i.y=s.y1,i;var l=r(s),h=r(a),u=r(o),c=(l+h+u)*t,d=0;return c<l?(d=c/l,i.x=s.x1+(s.x2-s.x1)*d,i.y=s.y1+(s.y2-s.y1)*d):c>l+h?(d=(c-=l+h)/u,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d):(d=(c-=l)/h,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d),i}},80672(e,t,i){var n=i(35001),r=i(26099);e.exports=function(e,t,i,s){void 0===s&&(s=[]);var a=e.getLineA(),o=e.getLineB(),l=e.getLineC(),h=n(a),u=n(o),c=n(l),d=h+u+c;!t&&i>0&&(t=d/i);for(var f=0;f<t;f++){var p=d*(f/t),m=0,g=new r;p<h?(m=p/h,g.x=a.x1+(a.x2-a.x1)*m,g.y=a.y1+(a.y2-a.y1)*m):p>h+u?(m=(p-=h+u)/c,g.x=l.x1+(l.x2-l.x1)*m,g.y=l.y1+(l.y2-l.y1)*m):(m=(p-=h)/u,g.x=o.x1+(o.x2-o.x1)*m,g.y=o.y1+(o.y2-o.y1)*m),s.push(g)}return s}},39757(e,t,i){var n=i(26099);function r(e,t,i,n){var r=e-i,s=t-n,a=r*r+s*s;return Math.sqrt(a)}e.exports=function(e,t){void 0===t&&(t=new n);var i=e.x1,s=e.y1,a=e.x2,o=e.y2,l=e.x3,h=e.y3,u=r(l,h,a,o),c=r(i,s,l,h),d=r(a,o,i,s),f=u+c+d;return t.x=(i*u+a*c+l*d)/f,t.y=(s*u+o*c+h*d)/f,t}},13584(e){e.exports=function(e,t,i){return e.x1+=t,e.y1+=i,e.x2+=t,e.y2+=i,e.x3+=t,e.y3+=i,e}},1376(e,t,i){var n=i(35001);e.exports=function(e){var t=e.getLineA(),i=e.getLineB(),r=e.getLineC();return n(t)+n(i)+n(r)}},90260(e,t,i){var n=i(26099);e.exports=function(e,t){void 0===t&&(t=new n);var i=e.x2-e.x1,r=e.y2-e.y1,s=e.x3-e.x1,a=e.y3-e.y1,o=Math.random(),l=Math.random();return o+l>=1&&(o=1-o,l=1-l),t.x=e.x1+(i*o+s*l),t.y=e.y1+(r*o+a*l),t}},52172(e,t,i){var n=i(99614),r=i(39757);e.exports=function(e,t){var i=r(e);return n(e,i.x,i.y,t)}},49907(e,t,i){var n=i(99614);e.exports=function(e,t,i){return n(e,t.x,t.y,i)}},99614(e){e.exports=function(e,t,i,n){var r=Math.cos(n),s=Math.sin(n),a=e.x1-t,o=e.y1-i;return e.x1=a*r-o*s+t,e.y1=a*s+o*r+i,a=e.x2-t,o=e.y2-i,e.x2=a*r-o*s+t,e.y2=a*s+o*r+i,a=e.x3-t,o=e.y3-i,e.x3=a*r-o*s+t,e.y3=a*s+o*r+i,e}},16483(e,t,i){var n=i(83419),r=i(10690),s=i(20437),a=i(80672),o=i(23777),l=i(23031),h=i(90260),u=new n({initialize:function(e,t,i,n,r,s){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=0),this.type=o.TRIANGLE,this.x1=e,this.y1=t,this.x2=i,this.y2=n,this.x3=r,this.y3=s},contains:function(e,t){return r(this,e,t)},getPoint:function(e,t){return s(this,e,t)},getPoints:function(e,t,i){return a(this,e,t,i)},getRandomPoint:function(e){return h(this,e)},setTo:function(e,t,i,n,r,s){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=0),this.x1=e,this.y1=t,this.x2=i,this.y2=n,this.x3=r,this.y3=s,this},getLineA:function(e){return void 0===e&&(e=new l),e.setTo(this.x1,this.y1,this.x2,this.y2),e},getLineB:function(e){return void 0===e&&(e=new l),e.setTo(this.x2,this.y2,this.x3,this.y3),e},getLineC:function(e){return void 0===e&&(e=new l),e.setTo(this.x3,this.y3,this.x1,this.y1),e},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(e){var t=0;t=this.x1<=this.x2&&this.x1<=this.x3?this.x1-e:this.x2<=this.x1&&this.x2<=this.x3?this.x2-e:this.x3-e,this.x1-=t,this.x2-=t,this.x3-=t}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(e){var t=0;t=this.x1>=this.x2&&this.x1>=this.x3?this.x1-e:this.x2>=this.x1&&this.x2>=this.x3?this.x2-e:this.x3-e,this.x1-=t,this.x2-=t,this.x3-=t}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(e){var t=0;t=this.y1<=this.y2&&this.y1<=this.y3?this.y1-e:this.y2<=this.y1&&this.y2<=this.y3?this.y2-e:this.y3-e,this.y1-=t,this.y2-=t,this.y3-=t}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(e){var t=0;t=this.y1>=this.y2&&this.y1>=this.y3?this.y1-e:this.y2>=this.y1&&this.y2>=this.y3?this.y2-e:this.y3-e,this.y1-=t,this.y2-=t,this.y3-=t}}});e.exports=u},84435(e,t,i){var n=i(16483);n.Area=i(41658),n.BuildEquilateral=i(39208),n.BuildFromPolygon=i(39545),n.BuildRight=i(90301),n.CenterOn=i(23707),n.Centroid=i(97523),n.CircumCenter=i(24951),n.CircumCircle=i(85614),n.Clone=i(74422),n.Contains=i(10690),n.ContainsArray=i(48653),n.ContainsPoint=i(96006),n.CopyFrom=i(71326),n.Decompose=i(71694),n.Equals=i(33522),n.GetPoint=i(20437),n.GetPoints=i(80672),n.InCenter=i(39757),n.Perimeter=i(1376),n.Offset=i(13584),n.Random=i(90260),n.Rotate=i(52172),n.RotateAroundPoint=i(49907),n.RotateAroundXY=i(99614),e.exports=n},74457(e){e.exports=function(e,t,i){return{gameObject:e,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:t,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragStartCamera:null,dragX:0,dragY:0}}},84409(e){e.exports=function(e,t){return function(i,n,r,s){var a=e.getPixelAlpha(n,r,s.texture.key,s.frame.name);return a&&a>=t}}},7003(e,t,i){var n=i(83419),r=i(93301),s=i(50792),a=i(8214),o=i(8443),l=i(78970),h=i(85098),u=i(42515),c=i(36210),d=i(61340),f=i(85955),p=new n({initialize:function(e,t){this.game=e,this.scaleManager,this.canvas,this.config=t,this.enabled=!0,this.events=new s,this.isOver=!0,this.defaultCursor="",this.keyboard=t.inputKeyboard?new l(this):null,this.mouse=t.inputMouse?new h(this):null,this.touch=t.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=t.inputActivePointers;for(var i=0;i<=this.pointersTotal;i++){var n=new u(this,i);n.smoothFactor=t.inputSmoothFactor,this.pointers.push(n)}this.mousePointer=t.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],e.events.once(o.BOOT,this.boot,this)},boot:function(){var e=this.game,t=e.events;this.canvas=e.canvas,this.scaleManager=e.scale,this.events.emit(a.MANAGER_BOOT),t.on(o.PRE_RENDER,this.preRender,this),t.once(o.DESTROY,this.destroy,this)},setCanvasOver:function(e){this.isOver=!0,this.events.emit(a.GAME_OVER,e)},setCanvasOut:function(e){this.isOver=!1,this.events.emit(a.GAME_OUT,e)},preRender:function(){var e=this.game.loop.now,t=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=e,this.events.emit(a.MANAGER_UPDATE);for(var n=0;n<i.length;n++){var r=i[n];if(r.sys.input&&r.sys.input.updatePoll(e,t)&&this.globalTopOnly)return}},setDefaultCursor:function(e){this.defaultCursor=e,this.canvas.style.cursor!==e&&(this.canvas.style.cursor=e)},setCursor:function(e){e.cursor&&(this.canvas.style.cursor=e.cursor)},resetCursor:function(e,t){(t||e&&e.cursor)&&this.canvas&&(this.canvas.style.cursor=this.defaultCursor)},addPointer:function(e){void 0===e&&(e=1);var t=[];this.pointersTotal+e>10&&(e=10-this.pointersTotal);for(var i=0;i<e;i++){var n=this.pointers.length,r=new u(this,n);r.smoothFactor=this.config.inputSmoothFactor,this.pointers.push(r),this.pointersTotal++,t.push(r)}return t},updateInputPlugins:function(e,t){var i=this.game.scene.getScenes(!1,!0);this._tempSkip=!1;for(var n=0;n<i.length;n++){var r=i[n];if(r.sys.input)if(r.sys.input.update(e,t)&&this.globalTopOnly||this._tempSkip)return}},onTouchStart:function(e){for(var t=this.pointers,i=[],n=0;n<e.changedTouches.length;n++)for(var s=e.changedTouches[n],a=1;a<t.length;a++){var o=t[a];if(!o.active){o.touchstart(s,e),this.activePointer=o,i.push(o);break}}this.updateInputPlugins(r.TOUCH_START,i)},onTouchMove:function(e){for(var t=this.pointers,i=[],n=0;n<e.changedTouches.length;n++)for(var s=e.changedTouches[n],a=1;a<t.length;a++){var o=t[a];if(o.active&&o.identifier===s.identifier){var l=document.elementFromPoint(s.clientX,s.clientY)===this.canvas;!this.isOver&&l?this.setCanvasOver(e):this.isOver&&!l&&this.setCanvasOut(e),this.isOver&&(o.touchmove(s,e),this.activePointer=o,i.push(o));break}}this.updateInputPlugins(r.TOUCH_MOVE,i)},onTouchEnd:function(e){for(var t=this.pointers,i=[],n=0;n<e.changedTouches.length;n++)for(var s=e.changedTouches[n],a=1;a<t.length;a++){var o=t[a];if(o.active&&o.identifier===s.identifier){o.touchend(s,e),i.push(o);break}}this.updateInputPlugins(r.TOUCH_END,i)},onTouchCancel:function(e){for(var t=this.pointers,i=[],n=0;n<e.changedTouches.length;n++)for(var s=e.changedTouches[n],a=1;a<t.length;a++){var o=t[a];if(o.active&&o.identifier===s.identifier){o.touchcancel(s,e),i.push(o);break}}this.updateInputPlugins(r.TOUCH_CANCEL,i)},onMouseDown:function(e){var t=this.mousePointer;t.down(e),t.updateMotion(),this.activePointer=t,this.updateInputPlugins(r.MOUSE_DOWN,this.mousePointerContainer)},onMouseMove:function(e){var t=this.mousePointer;t.move(e),t.updateMotion(),this.activePointer=t,this.updateInputPlugins(r.MOUSE_MOVE,this.mousePointerContainer)},onMouseUp:function(e){var t=this.mousePointer;t.up(e),t.updateMotion(),this.activePointer=t,this.updateInputPlugins(r.MOUSE_UP,this.mousePointerContainer)},onMouseWheel:function(e){var t=this.mousePointer;t.wheel(e),this.activePointer=t,this.updateInputPlugins(r.MOUSE_WHEEL,this.mousePointerContainer)},onPointerLockChange:function(e){var t=this.mouse.locked;this.mousePointer.locked=t,this.events.emit(a.POINTERLOCK_CHANGE,e,t)},inputCandidate:function(e,t){var i=e.input;if(!i||!i.enabled||!e.willRender(t))return!1;var n=!0,r=e.parentContainer;if(r)do{if(!r.willRender(t)){n=!1;break}r=r.parentContainer}while(r);return n},hitTest:function(e,t,i,n){void 0===n&&(n=this._tempHitTest);var r=this._tempPoint,s=i.scrollX,a=i.scrollY;n.length=0;var o=e.x,l=e.y;i.getWorldPoint(o,l,r),e.worldX=r.x,e.worldY=r.y;for(var h={x:0,y:0},u=this._tempMatrix,c=this._tempMatrix2,d=0;d<t.length;d++){var p=t[d];if(this.inputCandidate(p,i)){var m=r.x+s*p.scrollFactorX-s,g=r.y+a*p.scrollFactorY-a;p.parentContainer?(p.getWorldTransformMatrix(u,c),u.applyInverse(m,g,h)):f(m,g,p.x,p.y,p.rotation,p.scaleX,p.scaleY,h),this.pointWithinHitArea(p,h.x,h.y)&&n.push(p)}}return n},pointWithinHitArea:function(e,t,i){t+=e.displayOriginX,i+=e.displayOriginY;var n=e.input;return!(!n||!n.hitAreaCallback(n.hitArea,t,i,e))&&(n.localX=t,n.localY=i,!0)},pointWithinInteractiveObject:function(e,t,i){return!!e.hitArea&&(t+=e.gameObject.displayOriginX,i+=e.gameObject.displayOriginY,e.localX=t,e.localY=i,e.hitAreaCallback(e.hitArea,t,i,e))},transformPointer:function(e,t,i,n){var r=e.position,s=e.prevPosition;s.x=r.x,s.y=r.y;var a=this.scaleManager.transformX(t),o=this.scaleManager.transformY(i),l=e.smoothFactor;n&&0!==l?(r.x=a*l+s.x*(1-l),r.y=o*l+s.y*(1-l)):(r.x=a,r.y=o)},destroy:function(){this.events.removeAllListeners(),this.game.events.off(o.PRE_RENDER),this.keyboard&&this.keyboard.destroy(),this.mouse&&this.mouse.destroy(),this.touch&&this.touch.destroy();for(var e=0;e<this.pointers.length;e++)this.pointers[e].destroy();this.pointers=[],this._tempHitTest=[],this._tempMatrix.destroy(),this.canvas=null,this.game=null}});e.exports=p},48205(e,t,i){var n=i(96503),r=i(87902),s=i(83419),a=i(93301),o=i(74457),l=i(84409),h=i(20339),u=i(8497),c=i(81154),d=i(8214),f=i(50792),p=i(95540),m=i(23777),g=i(89639),v=i(41212),y=i(37277),x=i(87841),b=i(37303),w=i(44594),T=i(16483),_=i(10690),S=new s({Extends:f,initialize:function(e){f.call(this),this.scene=e,this.systems=e.sys,this.settings=e.sys.settings,this.manager=e.sys.game.input,this.pluginEvents=new f,this.enabled=!0,this.displayList,this.cameras,g.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var t={cancelled:!1};this._eventContainer={stopPropagation:function(){t.cancelled=!0}},this._eventData=t,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,e.sys.events.once(w.BOOT,this.boot,this),e.sys.events.on(w.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(w.DESTROY,this.destroy,this),this.pluginEvents.emit(d.BOOT)},start:function(){var e=this.systems.events;e.on(w.TRANSITION_START,this.transitionIn,this),e.on(w.TRANSITION_OUT,this.transitionOut,this),e.on(w.TRANSITION_COMPLETE,this.transitionComplete,this),e.on(w.PRE_UPDATE,this.preUpdate,this),e.once(w.SHUTDOWN,this.shutdown,this),this.manager.events.on(d.GAME_OUT,this.onGameOut,this),this.manager.events.on(d.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(d.START)},onGameOver:function(e){this.isActive()&&this.emit(d.GAME_OVER,e.timeStamp,e)},onGameOut:function(e){this.isActive()&&this.emit(d.GAME_OUT,e.timeStamp,e)},preUpdate:function(){this.pluginEvents.emit(d.PRE_UPDATE);var e=this._pendingRemoval,t=this._pendingInsertion,i=e.length,n=t.length;if(0!==i||0!==n){for(var r=this._list,s=0;s<i;s++){var a=e[s],o=r.indexOf(a);o>-1&&(r.splice(o,1),this.clear(a,!0))}this._pendingRemoval.length=0,this._list=r.concat(t.splice(0))}},isActive:function(){return this.manager&&this.manager.enabled&&this.enabled&&this.scene.sys.canInput()},setCursor:function(e){this.manager&&this.manager.setCursor(e)},resetCursor:function(){this.manager&&this.manager.resetCursor(null,!0)},updatePoll:function(e,t){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,e,t),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,n=this.manager.pointers;for(i=0;i<n.length;i++)n[i].updateMotion();if(0===this._list.length)return!1;var r=this.pollRate;if(-1===r)return!1;if(r>0){if(this._pollTimer-=t,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var s=!1;for(i=0;i<n.length;i++){var a=0,o=n[i];this._tempZones=[],this._temp=this.hitTestPointer(o),this.sortGameObjects(this._temp,o),this.sortDropZones(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1)),a+=this.processOverOutEvents(o),2===this.getDragState(o)&&this.processDragThresholdEvent(o,e),a>0&&(s=!0)}return s},update:function(e,t){if(!this.isActive())return!1;for(var i=!1,n=0;n<t.length;n++){var r=0,s=t[n];switch(this._tempZones=[],this._temp=this.hitTestPointer(s),this.sortGameObjects(this._temp,s),this.sortDropZones(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1)),e){case a.MOUSE_DOWN:r+=this.processDragDownEvent(s),r+=this.processDownEvents(s),r+=this.processOverOutEvents(s);break;case a.MOUSE_UP:r+=this.processDragUpEvent(s),r+=this.processUpEvents(s),r+=this.processOverOutEvents(s);break;case a.TOUCH_START:r+=this.processDragDownEvent(s),r+=this.processDownEvents(s),r+=this.processOverEvents(s);break;case a.TOUCH_END:case a.TOUCH_CANCEL:r+=this.processDragUpEvent(s),r+=this.processUpEvents(s),r+=this.processOutEvents(s);break;case a.MOUSE_MOVE:case a.TOUCH_MOVE:r+=this.processDragMoveEvent(s),r+=this.processMoveEvents(s),r+=this.processOverOutEvents(s);break;case a.MOUSE_WHEEL:r+=this.processWheelEvent(s)}r>0&&(i=!0)}return this._updatedThisFrame=!0,i},clear:function(e,t){void 0===t&&(t=!1),this.disable(e);var i=e.input;i&&(this.removeDebug(e),this.manager.resetCursor(i),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,e.input=null),t||this.queueForRemoval(e);var n=this._draggable.indexOf(e);return n>-1&&this._draggable.splice(n,1),e},disable:function(e,t){void 0===t&&(t=!1);var i=e.input;i&&(i.enabled=!1,i.dragState=0);for(var n,r=this._drag,s=this._over,a=this.manager,o=0;o<a.pointers.length;o++)(n=r[o].indexOf(e))>-1&&r[o].splice(n,1),(n=s[o].indexOf(e))>-1&&s[o].splice(n,1);return t&&this.resetCursor(),this},enable:function(e,t,i,n){return void 0===n&&(n=!1),e.input?e.input.enabled=!0:this.setHitArea(e,t,i),e.input&&n&&!e.input.dropZone&&(e.input.dropZone=n),this},hitTestPointer:function(e){for(var t=this.cameras.getCamerasBelowPointer(e),i=0;i<t.length;i++){for(var n=t[i],r=this.manager.hitTest(e,this._list,n),s=0;s<r.length;s++){var a=r[s];a.input.dropZone&&this._tempZones.push(a)}if(r.length>0)return e.camera=n,r}return e.camera=t[0],[]},processDownEvents:function(e){var t=0,i=this._temp,n=this._eventData,r=this._eventContainer;n.cancelled=!1;for(var s=0;s<i.length;s++){var a=i[s];if(a.input&&a.input.enabled){if(t++,a.emit(d.GAMEOBJECT_POINTER_DOWN,e,a.input.localX,a.input.localY,r),n.cancelled||!this.isActive())break;if(a.input&&a.input.enabled&&(this.emit(d.GAMEOBJECT_DOWN,e,a,r),n.cancelled||!this.isActive()))break}}return!n.cancelled&&this.isActive()&&(e.downElement===this.manager.game.canvas?this.emit(d.POINTER_DOWN,e,i):this.emit(d.POINTER_DOWN_OUTSIDE,e)),t},getDragState:function(e){return this._dragState[e.id]},setDragState:function(e,t){this._dragState[e.id]=t},processDragThresholdEvent:function(e,t){var i=!1,n=this.dragTimeThreshold,r=this.dragDistanceThreshold;if((r>0&&h(e.x,e.y,e.downX,e.downY)>=r||n>0&&t>=e.downTime+n)&&(i=!0),i)return this.setDragState(e,3),this.processDragStartList(e)},processDragStartList:function(e){if(3!==this.getDragState(e))return 0;var t=this._drag[e.id];t.length>1&&(t=t.slice(0));for(var i=0;i<t.length;i++){var n=t[i],r=n.input;r.dragState=2,r.dragStartX=n.x,r.dragStartY=n.y,r.dragStartXGlobal=e.worldX,r.dragStartYGlobal=e.worldY,r.dragStartCamera=e.camera,r.dragX=r.dragStartXGlobal-r.dragStartX,r.dragY=r.dragStartYGlobal-r.dragStartY,n.emit(d.GAMEOBJECT_DRAG_START,e,r.dragX,r.dragY),this.emit(d.DRAG_START,e,n)}return this.setDragState(e,4),t.length},processDragDownEvent:function(e){var t=this._temp;if(0===this._draggable.length||0===t.length||!e.primaryDown||0!==this.getDragState(e))return 0;this.setDragState(e,1);for(var i=[],n=0;n<t.length;n++){var r=t[n];r.input.draggable&&0===r.input.dragState&&i.push(r)}return 0===i.length?(this.setDragState(e,0),0):(i.length>1&&(this.sortGameObjects(i,e),this.topOnly&&i.splice(1)),this._drag[e.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(e,3),this.processDragStartList(e)):(this.setDragState(e,2),0))},processDragMoveEvent:function(e){if(2===this.getDragState(e)&&this.processDragThresholdEvent(e,this.manager.game.loop.now),4!==this.getDragState(e))return 0;var t=this._tempZones,i=this._drag[e.id];i.length>1&&(i=i.slice(0));for(var n=0;n<i.length;n++){var r,s,a=i[n],o=a.input,l=o.target;if(l){var h=t.indexOf(l);0===h?(a.emit(d.GAMEOBJECT_DRAG_OVER,e,l),this.emit(d.DRAG_OVER,e,a,l)):h>0?(a.emit(d.GAMEOBJECT_DRAG_LEAVE,e,l),this.emit(d.DRAG_LEAVE,e,a,l),o.target=t[0],l=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,e,l),this.emit(d.DRAG_ENTER,e,a,l)):(a.emit(d.GAMEOBJECT_DRAG_LEAVE,e,l),this.emit(d.DRAG_LEAVE,e,a,l),t[0]?(o.target=t[0],l=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,e,l),this.emit(d.DRAG_ENTER,e,a,l)):o.target=null)}else!l&&t[0]&&(o.target=t[0],l=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,e,l),this.emit(d.DRAG_ENTER,e,a,l));var u=e.positionToCamera(o.dragStartCamera);if(a.parentContainer){var c=u.x-o.dragStartXGlobal,f=u.y-o.dragStartYGlobal,p=a.getParentRotation(),m=c*Math.cos(p)+f*Math.sin(p),g=f*Math.cos(p)-c*Math.sin(p);m*=1/a.parentContainer.scaleX,g*=1/a.parentContainer.scaleY,r=m+o.dragStartX,s=g+o.dragStartY}else r=u.x-o.dragX,s=u.y-o.dragY;a.emit(d.GAMEOBJECT_DRAG,e,r,s),this.emit(d.DRAG,e,a,r,s)}return i.length},processDragUpEvent:function(e){var t=this._drag[e.id];t.length>1&&(t=t.slice(0));for(var i=0;i<t.length;i++){var n=t[i],r=n.input;if(r&&2===r.dragState){r.dragState=0,r.dragX=r.localX-n.displayOriginX,r.dragY=r.localY-n.displayOriginY,r.dragStartCamera=null;var s=!1,a=r.target;a&&(n.emit(d.GAMEOBJECT_DROP,e,a),this.emit(d.DROP,e,n,a),r.target=null,s=!0),n.input&&n.input.enabled&&(n.emit(d.GAMEOBJECT_DRAG_END,e,r.dragX,r.dragY,s),this.emit(d.DRAG_END,e,n,s))}}return this.setDragState(e,0),t.splice(0),0},processMoveEvents:function(e){var t=0,i=this._temp,n=this._eventData,r=this._eventContainer;n.cancelled=!1;for(var s=0;s<i.length;s++){var a=i[s];if(a.input&&a.input.enabled){if(t++,a.emit(d.GAMEOBJECT_POINTER_MOVE,e,a.input.localX,a.input.localY,r),n.cancelled||!this.isActive())break;if(a.input&&a.input.enabled){if(this.emit(d.GAMEOBJECT_MOVE,e,a,r),n.cancelled||!this.isActive())break;if(this.topOnly)break}}}return!n.cancelled&&this.isActive()&&this.emit(d.POINTER_MOVE,e,i),t},processWheelEvent:function(e){var t=0,i=this._temp,n=this._eventData,r=this._eventContainer;n.cancelled=!1;for(var s=e.deltaX,a=e.deltaY,o=e.deltaZ,l=0;l<i.length;l++){var h=i[l];if(h.input&&h.input.enabled){if(t++,h.emit(d.GAMEOBJECT_POINTER_WHEEL,e,s,a,o,r),n.cancelled||!this.isActive())break;if(h.input&&h.input.enabled&&(this.emit(d.GAMEOBJECT_WHEEL,e,h,s,a,o,r),n.cancelled||!this.isActive()))break}}return!n.cancelled&&this.isActive()&&this.emit(d.POINTER_WHEEL,e,i,s,a,o),t},processOverEvents:function(e){var t=this._temp,i=0,n=t.length,r=[];if(n>0){var s=this.manager,a=this._eventData,o=this._eventContainer;a.cancelled=!1;for(var l=0;l<n;l++){var h=t[l];if(h.input&&h.input.enabled){if(r.push(h),s.setCursor(h.input),h.emit(d.GAMEOBJECT_POINTER_OVER,e,h.input.localX,h.input.localY,o),i++,a.cancelled||!this.isActive())break;if(h.input&&h.input.enabled&&(this.emit(d.GAMEOBJECT_OVER,e,h,o),a.cancelled||!this.isActive()))break}}!a.cancelled&&this.isActive()&&this.emit(d.POINTER_OVER,e,r)}return this._over[e.id]=r,i},processOutEvents:function(e){var t=this._over[e.id],i=0,n=t.length;if(n>0){var r=this.manager,s=this._eventData,a=this._eventContainer;s.cancelled=!1,this.sortGameObjects(t,e);for(var o=0;o<n;o++){var l=t[o];if((l=t[o]).input&&l.input.enabled){if(r.resetCursor(l.input),l.emit(d.GAMEOBJECT_POINTER_OUT,e,a),i++,s.cancelled||!this.isActive())break;if(l.input&&l.input.enabled&&(this.emit(d.GAMEOBJECT_OUT,e,l,a),s.cancelled||!this.isActive()))break}}!s.cancelled&&this.isActive()&&this.emit(d.POINTER_OUT,e,t),this._over[e.id]=[]}return i},processOverOutEvents:function(e){var t,i,n=this._temp,r=[],s=[],a=[],o=this._over[e.id],l=this._drag[e.id],h=this.manager;for(t=0;t<o.length;t++)i=o[t],-1===n.indexOf(i)&&-1===l.indexOf(i)?r.push(i):a.push(i);for(t=0;t<n.length;t++)i=n[t],-1===o.indexOf(i)&&s.push(i);var u=r.length,c=0,f=this._eventData,p=this._eventContainer;if(f.cancelled=!1,u>0){for(this.sortGameObjects(r,e),t=0;t<u;t++)if((i=r[t]).input&&i.input.enabled){if(h.resetCursor(i.input),i.emit(d.GAMEOBJECT_POINTER_OUT,e,p),c++,f.cancelled||!this.isActive())break;if(i.input&&i.input.enabled&&(this.emit(d.GAMEOBJECT_OUT,e,i,p),f.cancelled||!this.isActive()))break}f.cancelled&&!this.isActive()||this.emit(d.POINTER_OUT,e,r)}if(u=s.length,f.cancelled=!1,u>0){for(this.sortGameObjects(s,e),t=0;t<u;t++)if((i=s[t]).input&&i.input.enabled){if(h.setCursor(i.input),i.emit(d.GAMEOBJECT_POINTER_OVER,e,i.input.localX,i.input.localY,p),c++,f.cancelled||!this.isActive())break;if(i.input&&i.input.enabled&&(this.emit(d.GAMEOBJECT_OVER,e,i,p),f.cancelled||!this.isActive()))break}!f.cancelled&&this.isActive()&&this.emit(d.POINTER_OVER,e,s)}return o=a.concat(s),this._over[e.id]=this.sortGameObjects(o,e),c},processUpEvents:function(e){var t=this._temp,i=this._eventData,n=this._eventContainer;i.cancelled=!1;for(var r=0;r<t.length;r++){var s=t[r];if(s.input&&s.input.enabled){if(s.emit(d.GAMEOBJECT_POINTER_UP,e,s.input.localX,s.input.localY,n),i.cancelled||!this.isActive())break;if(s.input&&s.input.enabled&&(this.emit(d.GAMEOBJECT_UP,e,s,n),i.cancelled||!this.isActive()))break}}return!i.cancelled&&this.isActive()&&(e.upElement===this.manager.game.canvas?this.emit(d.POINTER_UP,e,t):this.emit(d.POINTER_UP_OUTSIDE,e)),t.length},forceDownState:function(e,t){this.forceState(e,t,d.GAMEOBJECT_POINTER_DOWN,d.GAMEOBJECT_DOWN,!1)},forceUpState:function(e,t){this.forceState(e,t,d.GAMEOBJECT_POINTER_UP,d.GAMEOBJECT_UP,!1)},forceOverState:function(e,t){this.forceState(e,t,d.GAMEOBJECT_POINTER_OVER,d.GAMEOBJECT_OVER,!0)},forceOutState:function(e,t){this.forceState(e,t,d.GAMEOBJECT_POINTER_OUT,d.GAMEOBJECT_OUT,!1)},forceState:function(e,t,i,n,r){var s=this._eventData,a=this._eventContainer;s.cancelled=!1,t.input&&t.input.enabled&&(t.emit(i,e,t.input.localX,t.input.localY,a),r&&this.setCursor(t.input),!s.cancelled&&this.isActive()&&t.input&&t.input.enabled&&this.emit(n,e,t,a))},queueForInsertion:function(e){return-1===this._pendingInsertion.indexOf(e)&&-1===this._list.indexOf(e)&&this._pendingInsertion.push(e),this},queueForRemoval:function(e){return this._pendingRemoval.push(e),this},setDraggable:function(e,t){void 0===t&&(t=!0),Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var n=e[i];n.input.draggable=t;var r=this._draggable.indexOf(n);t&&-1===r?this._draggable.push(n):!t&&r>-1&&this._draggable.splice(r,1)}return this},makePixelPerfect:function(e){void 0===e&&(e=1);var t=this.systems.textures;return l(t,e)},setHitArea:function(e,t,i){if(void 0===t)return this.setHitAreaFromTexture(e);Array.isArray(e)||(e=[e]);var n=!1,r=!1,s=!1,a=!1,l=!1,h=!0;if(v(t)&&Object.keys(t).length){var u=t;t=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),l=p(u,"pixelPerfect",!1);var c=p(u,"alphaTolerance",1);l&&(t={},i=this.makePixelPerfect(c)),n=p(u,"draggable",!1),r=p(u,"dropZone",!1),s=p(u,"cursor",!1),a=p(u,"useHandCursor",!1),t&&i||(this.setHitAreaFromTexture(e),h=!1)}else"function"!==typeof t||i||(i=t,t={});for(var d=0;d<e.length;d++){var f=e[d];if(l&&"Container"===f.type)console.warn("Cannot pixelPerfect test a Container. Use a custom callback.");else{var m=f.input?f.input:o(f,t,i);m.customHitArea=h,m.dropZone=r,m.cursor=a?"pointer":s,f.input=m,n&&this.setDraggable(f),this.queueForInsertion(f)}}return this},setHitAreaCircle:function(e,t,i,s,a){void 0===a&&(a=r);var o=new n(t,i,s);return this.setHitArea(e,o,a)},setHitAreaEllipse:function(e,t,i,n,r,s){void 0===s&&(s=c);var a=new u(t,i,n,r);return this.setHitArea(e,a,s)},setHitAreaFromTexture:function(e,t){void 0===t&&(t=b),Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var n=e[i],r=n.frame,s=0,a=0;n.width?(s=n.width,a=n.height):r&&(s=r.realWidth,a=r.realHeight),"Container"!==n.type||0!==s&&0!==a?0!==s&&0!==a&&(n.input=o(n,new x(0,0,s,a),t),this.queueForInsertion(n)):console.warn("Container.setInteractive must specify a Shape or call setSize() first")}return this},setHitAreaRectangle:function(e,t,i,n,r,s){void 0===s&&(s=b);var a=new x(t,i,n,r);return this.setHitArea(e,a,s)},setHitAreaTriangle:function(e,t,i,n,r,s,a,o){void 0===o&&(o=_);var l=new T(t,i,n,r,s,a);return this.setHitArea(e,l,o)},enableDebug:function(e,t){void 0===t&&(t=65280);var i=e.input;if(!i||!i.hitArea)return this;var n=i.hitArea,r=n.type,s=i.hitAreaDebug,a=this.systems.add,o=this.systems.updateList;s&&(o.remove(s),s.destroy(),s=null);var l=0,h=0;switch(r){case m.CIRCLE:s=a.arc(0,0,n.radius),l=n.x-n.radius,h=n.y-n.radius;break;case m.ELLIPSE:s=a.ellipse(0,0,n.width,n.height),l=n.x-n.width/2,h=n.y-n.height/2;break;case m.LINE:s=a.line(0,0,n.x1,n.y1,n.x2,n.y2);break;case m.POLYGON:s=a.polygon(0,0,n.points);break;case m.RECTANGLE:s=a.rectangle(0,0,n.width,n.height),l=n.x,h=n.y;break;case m.TRIANGLE:s=a.triangle(0,0,n.x1,n.y1,n.x2,n.y2,n.x3,n.y3)}return s&&(s.isFilled=!1,s.strokeColor=t,s.preUpdate=function(){s.setVisible(e.visible),s.setStrokeStyle(1/e.scale,s.strokeColor),s.setDisplayOrigin(e.displayOriginX,e.displayOriginY);var t=e.x,i=e.y,n=e.rotation,r=e.scaleX,a=e.scaleY;if(e.parentContainer){var o=e.getWorldTransformMatrix();t=o.tx,i=o.ty,n=o.rotation,r=o.scaleX,a=o.scaleY}s.setRotation(n),s.setScale(r,a),s.setPosition(t+l*r,i+h*a),s.setScrollFactor(e.scrollFactorX,e.scrollFactorY),s.setDepth(e.depth)},o.add(s),i.hitAreaDebug=s),this},removeDebug:function(e){var t=e.input;t&&t.hitAreaDebug&&(t.hitAreaDebug.destroy(),t.hitAreaDebug=null);return this},setPollAlways:function(){return this.setPollRate(0)},setPollOnMove:function(){return this.setPollRate(-1)},setPollRate:function(e){return this.pollRate=e,this._pollTimer=0,this},setGlobalTopOnly:function(e){return this.manager.globalTopOnly=e,this},setTopOnly:function(e){return this.topOnly=e,this},sortGameObjects:function(e,t){if(e.length<2||!t.camera)return e;var i=t.camera.renderList;return e.sort(function(e,t){var n=Math.max(i.indexOf(e),0);return Math.max(i.indexOf(t),0)-n})},sortDropZones:function(e){return e.length<2?e:(this.scene.sys.depthSort(),e.sort(this.sortDropZoneHandler.bind(this)))},sortDropZoneHandler:function(e,t){if(e.parentContainer||t.parentContainer){if(e.parentContainer===t.parentContainer)return t.parentContainer.getIndex(t)-e.parentContainer.getIndex(e);if(e.parentContainer===t)return-1;if(t.parentContainer===e)return 1;for(var i=e.getIndexList(),n=t.getIndexList(),r=Math.min(i.length,n.length),s=0;s<r;s++){var a=i[s],o=n[s];if(a!==o)return o-a}return n.length-i.length}return this.displayList.getIndex(t)-this.displayList.getIndex(e)},stopPropagation:function(){return this.manager._tempSkip=!0,this},addPointer:function(e){return this.manager.addPointer(e)},setDefaultCursor:function(e){return this.manager.setDefaultCursor(e),this},transitionIn:function(){this.enabled=this.settings.transitionAllowInput},transitionComplete:function(){this.settings.transitionAllowInput||(this.enabled=!0)},transitionOut:function(){this.enabled=this.settings.transitionAllowInput},shutdown:function(){this.pluginEvents.emit(d.SHUTDOWN),this._temp.length=0,this._list.length=0,this._draggable.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0,this._dragState.length=0;for(var e=0;e<10;e++)this._drag[e]=[],this._over[e]=[];this.removeAllListeners();var t=this.manager;t.canvas.style.cursor=t.defaultCursor;var i=this.systems.events;i.off(w.TRANSITION_START,this.transitionIn,this),i.off(w.TRANSITION_OUT,this.transitionOut,this),i.off(w.TRANSITION_COMPLETE,this.transitionComplete,this),i.off(w.PRE_UPDATE,this.preUpdate,this),t.events.off(d.GAME_OUT,this.onGameOut,this),t.events.off(d.GAME_OVER,this.onGameOver,this),i.off(w.SHUTDOWN,this.shutdown,this)},resetPointers:function(){for(var e=this.manager.pointers,t=0;t<e.length;t++)e[t].reset()},destroy:function(){this.shutdown(),this.pluginEvents.emit(d.DESTROY),this.pluginEvents.removeAllListeners(),this.scene.sys.events.off(w.START,this.start,this),this.scene=null,this.cameras=null,this.manager=null,this.events=null,this.mouse=null},x:{get:function(){return this.manager.activePointer.x}},y:{get:function(){return this.manager.activePointer.y}},isOver:{get:function(){return this.manager.isOver}},mousePointer:{get:function(){return this.manager.mousePointer}},activePointer:{get:function(){return this.manager.activePointer}},pointer1:{get:function(){return this.manager.pointers[1]}},pointer2:{get:function(){return this.manager.pointers[2]}},pointer3:{get:function(){return this.manager.pointers[3]}},pointer4:{get:function(){return this.manager.pointers[4]}},pointer5:{get:function(){return this.manager.pointers[5]}},pointer6:{get:function(){return this.manager.pointers[6]}},pointer7:{get:function(){return this.manager.pointers[7]}},pointer8:{get:function(){return this.manager.pointers[8]}},pointer9:{get:function(){return this.manager.pointers[9]}},pointer10:{get:function(){return this.manager.pointers[10]}}});y.register("InputPlugin",S,"input"),e.exports=S},89639(e,t,i){var n=i(35154),r={},s={register:function(e,t,i,n,s){r[e]={plugin:t,mapping:i,settingsKey:n,configKey:s}},getPlugin:function(e){return r[e]},install:function(e){var t=e.scene.sys,i=t.settings.input,s=t.game.config;for(var a in r){var o=r[a].plugin,l=r[a].mapping,h=r[a].settingsKey,u=r[a].configKey;n(i,h,s[u])&&(e[l]=new o(e))}},remove:function(e){r.hasOwnProperty(e)&&delete r[e]}};e.exports=s},42515(e,t,i){var n=i(31040),r=i(83419),s=i(20339),a=i(43855),o=i(47235),l=i(26099),h=i(25892),u=new r({initialize:function(e,t){this.manager=e,this.id=t,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new l,this.prevPosition=new l,this.midPoint=new l(-1,-1),this.velocity=new l,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===t,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(e){var t=e.getWorldPoint(this.x,this.y);return this.worldX=t.x,this.worldY=t.y,this},positionToCamera:function(e,t){return e.getWorldPoint(this.x,this.y,t)},updateMotion:function(){var e=this.position.x,t=this.position.y,i=this.midPoint.x,r=this.midPoint.y;if(e!==i||t!==r){var s=o(this.motionFactor,i,e),l=o(this.motionFactor,r,t);a(s,e,.1)&&(s=e),a(l,t,.1)&&(l=t),this.midPoint.set(s,l);var h=e-s,u=t-l;this.velocity.set(h,u),this.angle=n(s,l,e,t),this.distance=Math.sqrt(h*h+u*u)}},up:function(e){"buttons"in e&&(this.buttons=e.buttons),this.event=e,this.button=e.button,this.upElement=e.target,this.manager.transformPointer(this,e.pageX,e.pageY,!1),0===e.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),0===this.buttons&&(this.isDown=!1,this.upTime=e.timeStamp,this.wasTouch=!1)},down:function(e){"buttons"in e&&(this.buttons=e.buttons),this.event=e,this.button=e.button,this.downElement=e.target,this.manager.transformPointer(this,e.pageX,e.pageY,!1),0===e.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),h.macOS&&e.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=e.timeStamp),this.wasTouch=!1},move:function(e){"buttons"in e&&(this.buttons=e.buttons),this.event=e,this.manager.transformPointer(this,e.pageX,e.pageY,!0),this.locked&&(this.movementX=e.movementX||e.mozMovementX||e.webkitMovementX||0,this.movementY=e.movementY||e.mozMovementY||e.webkitMovementY||0),this.moveTime=e.timeStamp,this.wasTouch=!1},wheel:function(e){"buttons"in e&&(this.buttons=e.buttons),this.event=e,this.manager.transformPointer(this,e.pageX,e.pageY,!1),this.deltaX=e.deltaX,this.deltaY=e.deltaY,this.deltaZ=e.deltaZ,this.wasTouch=!1},touchstart:function(e,t){e.pointerId&&(this.pointerId=e.pointerId),this.identifier=e.identifier,this.target=e.target,this.active=!0,this.buttons=1,this.event=t,this.downElement=e.target,this.manager.transformPointer(this,e.pageX,e.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=t.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(e,t){this.event=t,this.manager.transformPointer(this,e.pageX,e.pageY,!0),this.moveTime=t.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(e,t){this.buttons=0,this.event=t,this.upElement=e.target,this.manager.transformPointer(this,e.pageX,e.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(e,t){this.buttons=0,this.event=t,this.upElement=e.target,this.manager.transformPointer(this,e.pageX,e.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.buttons?0===this.button&&!this.isDown:0===this.button},rightButtonReleased:function(){return 0===this.buttons?2===this.button&&!this.isDown:2===this.button},middleButtonReleased:function(){return 0===this.buttons?1===this.button&&!this.isDown:1===this.button},backButtonReleased:function(){return 0===this.buttons?3===this.button&&!this.isDown:3===this.button},forwardButtonReleased:function(){return 0===this.buttons?4===this.button&&!this.isDown:4===this.button},getDistance:function(){return this.isDown?s(this.downX,this.downY,this.x,this.y):s(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?n(this.downX,this.downY,this.x,this.y):n(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(e,t){void 0===e&&(e=10),void 0===t&&(t=[]);for(var i=this.prevPosition.x,n=this.prevPosition.y,r=this.position.x,s=this.position.y,a=0;a<e;a++){var l=1/e*a;t[a]={x:o(l,i,r),y:o(l,n,s)}}return t},reset:function(){this.event=null,this.downElement=null,this.upElement=null,this.button=0,this.buttons=0,this.position.set(0,0),this.prevPosition.set(0,0),this.midPoint.set(-1,-1),this.velocity.set(0,0),this.angle=0,this.distance=0,this.worldX=0,this.worldY=0,this.downX=0,this.downY=0,this.upX=0,this.upY=0,this.moveTime=0,this.upTime=0,this.downTime=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.deltaX=0,this.deltaY=0,this.deltaZ=0,this.active=0===this.id},destroy:function(){this.camera=null,this.manager=null,this.position=null},x:{get:function(){return this.position.x},set:function(e){this.position.x=e}},y:{get:function(){return this.position.y},set:function(e){this.position.y=e}},time:{get:function(){return this.event?this.event.timeStamp:0}}});e.exports=u},93301(e){e.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8}},7179(e){e.exports="boot"},85375(e){e.exports="destroy"},62224(e){e.exports="dragend"},23388(e){e.exports="dragenter"},16133(e){e.exports="drag"},27829(e){e.exports="dragleave"},53904(e){e.exports="dragover"},56058(e){e.exports="dragstart"},2642(e){e.exports="drop"},88171(e){e.exports="gameobjectdown"},36147(e){e.exports="dragend"},71692(e){e.exports="dragenter"},96149(e){e.exports="drag"},81285(e){e.exports="dragleave"},74048(e){e.exports="dragover"},21322(e){e.exports="dragstart"},49378(e){e.exports="drop"},86754(e){e.exports="gameobjectmove"},86433(e){e.exports="gameobjectout"},60709(e){e.exports="gameobjectover"},24081(e){e.exports="pointerdown"},11172(e){e.exports="pointermove"},18907(e){e.exports="pointerout"},95579(e){e.exports="pointerover"},35368(e){e.exports="pointerup"},26972(e){e.exports="wheel"},47078(e){e.exports="gameobjectup"},73802(e){e.exports="gameobjectwheel"},56718(e){e.exports="gameout"},25936(e){e.exports="gameover"},27503(e){e.exports="boot"},50852(e){e.exports="process"},96438(e){e.exports="update"},59152(e){e.exports="pointerlockchange"},47777(e){e.exports="pointerdown"},27957(e){e.exports="pointerdownoutside"},19444(e){e.exports="pointermove"},54251(e){e.exports="pointerout"},18667(e){e.exports="pointerover"},27192(e){e.exports="pointerup"},24652(e){e.exports="pointerupoutside"},45132(e){e.exports="wheel"},44512(e){e.exports="preupdate"},15757(e){e.exports="shutdown"},41637(e){e.exports="start"},93802(e){e.exports="update"},8214(e,t,i){e.exports={BOOT:i(7179),DESTROY:i(85375),DRAG_END:i(62224),DRAG_ENTER:i(23388),DRAG:i(16133),DRAG_LEAVE:i(27829),DRAG_OVER:i(53904),DRAG_START:i(56058),DROP:i(2642),GAME_OUT:i(56718),GAME_OVER:i(25936),GAMEOBJECT_DOWN:i(88171),GAMEOBJECT_DRAG_END:i(36147),GAMEOBJECT_DRAG_ENTER:i(71692),GAMEOBJECT_DRAG:i(96149),GAMEOBJECT_DRAG_LEAVE:i(81285),GAMEOBJECT_DRAG_OVER:i(74048),GAMEOBJECT_DRAG_START:i(21322),GAMEOBJECT_DROP:i(49378),GAMEOBJECT_MOVE:i(86754),GAMEOBJECT_OUT:i(86433),GAMEOBJECT_OVER:i(60709),GAMEOBJECT_POINTER_DOWN:i(24081),GAMEOBJECT_POINTER_MOVE:i(11172),GAMEOBJECT_POINTER_OUT:i(18907),GAMEOBJECT_POINTER_OVER:i(95579),GAMEOBJECT_POINTER_UP:i(35368),GAMEOBJECT_POINTER_WHEEL:i(26972),GAMEOBJECT_UP:i(47078),GAMEOBJECT_WHEEL:i(73802),MANAGER_BOOT:i(27503),MANAGER_PROCESS:i(50852),MANAGER_UPDATE:i(96438),POINTER_DOWN:i(47777),POINTER_DOWN_OUTSIDE:i(27957),POINTER_MOVE:i(19444),POINTER_OUT:i(54251),POINTER_OVER:i(18667),POINTER_UP:i(27192),POINTER_UP_OUTSIDE:i(24652),POINTER_WHEEL:i(45132),POINTERLOCK_CHANGE:i(59152),PRE_UPDATE:i(44512),SHUTDOWN:i(15757),START:i(41637),UPDATE:i(93802)}},97421(e,t,i){var n=new(i(83419))({initialize:function(e,t){this.pad=e,this.events=e.events,this.index=t,this.value=0,this.threshold=.1},update:function(e){this.value=e},getValue:function(){return Math.abs(this.value)<this.threshold?0:this.value},destroy:function(){this.pad=null,this.events=null}});e.exports=n},28884(e,t,i){var n=i(83419),r=i(92734),s=new n({initialize:function(e,t,i){void 0===i&&(i=!1),this.pad=e,this.events=e.manager,this.index=t,this.value=0,this.threshold=1,this.pressed=i},update:function(e){this.value=e;var t=this.pad,i=this.index;e>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(r.BUTTON_DOWN,t,this,e),this.pad.emit(r.GAMEPAD_BUTTON_DOWN,i,e,this)):this.pressed&&(this.pressed=!1,this.events.emit(r.BUTTON_UP,t,this,e),this.pad.emit(r.GAMEPAD_BUTTON_UP,i,e,this))},destroy:function(){this.pad=null,this.events=null}});e.exports=s},99125(e,t,i){var n=i(97421),r=i(28884),s=i(83419),a=i(50792),o=i(26099),l=new s({Extends:a,initialize:function(e,t){a.call(this),this.manager=e,this.pad=t,this.id=t.id,this.index=t.index;for(var i=[],s=0;s<t.buttons.length;s++)i.push(new r(this,s,t.buttons[s].value>=.5));this.buttons=i;var l=[];for(s=0;s<t.axes.length;s++)l.push(new n(this,s));this.axes=l,this.vibration=t.vibrationActuator;var h={value:0,pressed:!1};this._LCLeft=i[14]?i[14]:h,this._LCRight=i[15]?i[15]:h,this._LCTop=i[12]?i[12]:h,this._LCBottom=i[13]?i[13]:h,this._RCLeft=i[2]?i[2]:h,this._RCRight=i[1]?i[1]:h,this._RCTop=i[3]?i[3]:h,this._RCBottom=i[0]?i[0]:h,this._FBLeftTop=i[4]?i[4]:h,this._FBLeftBottom=i[6]?i[6]:h,this._FBRightTop=i[5]?i[5]:h,this._FBRightBottom=i[7]?i[7]:h;var u={value:0};this._HAxisLeft=l[0]?l[0]:u,this._VAxisLeft=l[1]?l[1]:u,this._HAxisRight=l[2]?l[2]:u,this._VAxisRight=l[3]?l[3]:u,this.leftStick=new o,this.rightStick=new o,this._created=performance.now()},getAxisTotal:function(){return this.axes.length},getAxisValue:function(e){return this.axes[e].getValue()},setAxisThreshold:function(e){for(var t=0;t<this.axes.length;t++)this.axes[t].threshold=e},getButtonTotal:function(){return this.buttons.length},getButtonValue:function(e){return this.buttons[e].value},isButtonDown:function(e){return this.buttons[e].pressed},update:function(e){if(!(e.timestamp<this._created)){var t,i=this.buttons,n=e.buttons,r=i.length;for(t=0;t<r;t++)i[t].update(n[t].value);var s=this.axes,a=e.axes;for(r=s.length,t=0;t<r;t++)s[t].update(a[t]);r>=2&&(this.leftStick.set(s[0].getValue(),s[1].getValue()),r>=4&&this.rightStick.set(s[2].getValue(),s[3].getValue()))}},destroy:function(){var e;for(this.removeAllListeners(),this.manager=null,this.pad=null,e=0;e<this.buttons.length;e++)this.buttons[e].destroy();for(e=0;e<this.axes.length;e++)this.axes[e].destroy();this.buttons=[],this.axes=[]},connected:{get:function(){return this.pad.connected}},timestamp:{get:function(){return this.pad.timestamp}},left:{get:function(){return this._LCLeft.pressed}},right:{get:function(){return this._LCRight.pressed}},up:{get:function(){return this._LCTop.pressed}},down:{get:function(){return this._LCBottom.pressed}},A:{get:function(){return this._RCBottom.pressed}},Y:{get:function(){return this._RCTop.pressed}},X:{get:function(){return this._RCLeft.pressed}},B:{get:function(){return this._RCRight.pressed}},L1:{get:function(){return this._FBLeftTop.value}},L2:{get:function(){return this._FBLeftBottom.value}},R1:{get:function(){return this._FBRightTop.value}},R2:{get:function(){return this._FBRightBottom.value}}});e.exports=l},56654(e,t,i){var n=i(83419),r=i(50792),s=i(92734),a=i(99125),o=i(35154),l=i(89639),h=i(8214),u=new n({Extends:r,initialize:function(e){r.call(this),this.scene=e.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=e,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,e.pluginEvents.once(h.BOOT,this.boot,this),e.pluginEvents.on(h.START,this.start,this)},boot:function(){var e=this.scene.sys.game,t=this.settings.input,i=e.config;this.enabled=o(t,"gamepad",i.inputGamepad)&&e.device.input.gamepads,this.target=o(t,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var e=this,t=this.target,i=function(t){!t.defaultPrevented&&e.isActive()&&(e.refreshPads(),e.queue.push(t))};this.onGamepadHandler=i,t.addEventListener("gamepadconnected",i,!1),t.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on(h.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(h.UPDATE,this.update);for(var e=this.gamepads,t=0;t<e.length;t++)e[t]&&e[t].removeAllListeners()},disconnectAll:function(){for(var e=this.gamepads,t=0;t<e.length;t++)e[t]&&(e[t].pad.connected=!1)},refreshPads:function(){var e=navigator.getGamepads();if(e)for(var t=this.gamepads,i=0;i<e.length;i++){var n=e[i];if(n){var r=n.id,s=n.index,o=t[s];if(o)o.id!==r?(o.destroy(),t[s]=new a(this,n)):o.update(n);else{var l=new a(this,n);t[s]=l,this._pad1?this._pad2?this._pad3?this._pad4||(this._pad4=l):this._pad3=l:this._pad2=l:this._pad1=l}}}else this.disconnectAll()},getAll:function(){for(var e=[],t=this.gamepads,i=0;i<t.length;i++)t[i]&&e.push(t[i]);return e},getPad:function(e){for(var t=this.gamepads,i=0;i<t.length;i++)if(t[i]&&t[i].index===e)return t[i]},update:function(){if(this.enabled){this.refreshPads();var e=this.queue.length;if(0!==e)for(var t=this.queue.splice(0,e),i=0;i<e;i++){var n=t[i],r=this.getPad(n.gamepad.index);"gamepadconnected"===n.type?this.emit(s.CONNECTED,r,n):"gamepaddisconnected"===n.type&&this.emit(s.DISCONNECTED,r,n)}}},shutdown:function(){this.stopListeners(),this.removeAllListeners()},destroy:function(){this.shutdown();for(var e=0;e<this.gamepads.length;e++)this.gamepads[e]&&this.gamepads[e].destroy();this.gamepads=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.target=null},total:{get:function(){return this.gamepads.length}},pad1:{get:function(){return this._pad1}},pad2:{get:function(){return this._pad2}},pad3:{get:function(){return this._pad3}},pad4:{get:function(){return this._pad4}}});l.register("GamepadPlugin",u,"gamepad","gamepad","inputGamepad"),e.exports=u},89651(e){e.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(e){e.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(e){e.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(e,t,i){e.exports={DUALSHOCK_4:i(65294),SNES_USB:i(89651),XBOX_360:i(90089)}},46008(e){e.exports="down"},7629(e){e.exports="up"},42206(e){e.exports="connected"},86544(e){e.exports="disconnected"},94784(e){e.exports="down"},14325(e){e.exports="up"},92734(e,t,i){e.exports={BUTTON_DOWN:i(46008),BUTTON_UP:i(7629),CONNECTED:i(42206),DISCONNECTED:i(86544),GAMEPAD_BUTTON_DOWN:i(94784),GAMEPAD_BUTTON_UP:i(14325)}},48646(e,t,i){e.exports={Axis:i(97421),Button:i(28884),Events:i(92734),Gamepad:i(99125),GamepadPlugin:i(56654),Configs:i(64894)}},14350(e,t,i){var n=i(93301),r=i(79291),s={CreatePixelPerfectHandler:i(84409),CreateInteractiveObject:i(74457),Events:i(8214),Gamepad:i(48646),InputManager:i(7003),InputPlugin:i(48205),InputPluginCache:i(89639),Keyboard:i(51442),Mouse:i(87078),Pointer:i(42515),Touch:i(95618)};s=r(!1,s,n),e.exports=s},78970(e,t,i){var n=i(72905),r=i(83419),s=i(8443),a=i(8214),o=i(46032),l=i(29747),h=new r({initialize:function(e){this.manager=e,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=l,this.onKeyUp=l,e.events.once(a.MANAGER_BOOT,this.boot,this)},boot:function(){var e=this.manager.config;this.enabled=e.inputKeyboard,this.target=e.inputKeyboardEventTarget,this.addCapture(e.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(s.POST_STEP,this.postUpdate,this)},startListeners:function(){var e=this;this.onKeyDown=function(t){if(!t.defaultPrevented&&e.enabled&&e.manager){e.queue.push(t),e.manager.events.emit(a.MANAGER_PROCESS);var i=t.altKey||t.ctrlKey||t.shiftKey||t.metaKey;e.preventDefault&&!i&&e.captures.indexOf(t.keyCode)>-1&&t.preventDefault()}},this.onKeyUp=function(t){if(!t.defaultPrevented&&e.enabled&&e.manager){e.queue.push(t),e.manager.events.emit(a.MANAGER_PROCESS);var i=t.altKey||t.ctrlKey||t.shiftKey||t.metaKey;e.preventDefault&&!i&&e.captures.indexOf(t.keyCode)>-1&&t.preventDefault()}};var t=this.target;t&&(t.addEventListener("keydown",this.onKeyDown,!1),t.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var e=this.target;e.removeEventListener("keydown",this.onKeyDown,!1),e.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(e){"string"===typeof e&&(e=e.split(",")),Array.isArray(e)||(e=[e]);for(var t=this.captures,i=0;i<e.length;i++){var n=e[i];"string"===typeof n&&(n=o[n.trim().toUpperCase()]),-1===t.indexOf(n)&&t.push(n)}this.preventDefault=t.length>0},removeCapture:function(e){"string"===typeof e&&(e=e.split(",")),Array.isArray(e)||(e=[e]);for(var t=this.captures,i=0;i<e.length;i++){var r=e[i];"string"===typeof r&&(r=o[r.toUpperCase()]),n(t,r)}this.preventDefault=t.length>0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(s.POST_STEP,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});e.exports=h},28846(e,t,i){var n=i(83419),r=i(50792),s=i(95922),a=i(8443),o=i(35154),l=i(8214),h=i(89639),u=i(30472),c=i(46032),d=i(87960),f=i(74600),p=i(44594),m=i(56583),g=new n({Extends:r,initialize:function(e){r.call(this),this.game=e.systems.game,this.scene=e.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=e,this.manager=e.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,e.pluginEvents.once(l.BOOT,this.boot,this),e.pluginEvents.on(l.START,this.start,this)},boot:function(){var e=this.settings.input;this.enabled=o(e,"keyboard",!0);var t=o(e,"keyboard.capture",null);t&&this.addCaptures(t),this.sceneInputPlugin.pluginEvents.once(l.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(l.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN,this.shutdown,this),this.game.events.on(a.BLUR,this.resetKeys,this),this.scene.sys.events.on(p.PAUSE,this.resetKeys,this),this.scene.sys.events.on(p.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(e){return this.manager.addCapture(e),this},removeCapture:function(e){return this.manager.removeCapture(e),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(e,t,i){void 0===t&&(t=!0),void 0===i&&(i=!1);var n={};if("string"===typeof e){e=e.split(",");for(var r=0;r<e.length;r++){var s=e[r].trim();s&&(n[s]=this.addKey(s,t,i))}}else for(var a in e)n[a]=this.addKey(e[a],t,i);return n},addKey:function(e,t,i){void 0===t&&(t=!0),void 0===i&&(i=!1);var n=this.keys;if(e instanceof u){var r=n.indexOf(e);return r>-1?n[r]=e:n[e.keyCode]=e,t&&this.addCapture(e.keyCode),e.setEmitOnRepeat(i),e}return"string"===typeof e&&(e=c[e.toUpperCase()]),n[e]||(n[e]=new u(this,e),t&&this.addCapture(e),n[e].setEmitOnRepeat(i)),n[e]},removeKey:function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var n,r=this.keys;if(e instanceof u){var s=r.indexOf(e);s>-1&&(n=this.keys[s],this.keys[s]=void 0)}else"string"===typeof e&&(e=c[e.toUpperCase()]);return r[e]&&(n=r[e],r[e]=void 0),n&&(n.plugin=null,i&&this.removeCapture(n.keyCode),t&&n.destroy()),this},removeAllKeys:function(e,t){void 0===e&&(e=!1),void 0===t&&(t=!1);for(var i=this.keys,n=0;n<i.length;n++){var r=i[n];r&&(i[n]=void 0,t&&this.removeCapture(r.keyCode),e&&r.destroy())}return this},createCombo:function(e,t){return new d(this,e,t)},checkDown:function(e,t){if(void 0===t&&(t=0),this.enabled&&e.isDown){var i=m(this.time-e.timeDown,t);if(i>e._tick)return e._tick=i,!0}return!1},update:function(){var e=this.manager.queue,t=e.length;if(this.isActive()&&0!==t)for(var i=this.keys,n=0;n<t;n++){var r=e[n],a=r.keyCode,o=i[a],l=!1;void 0===r.cancelled&&(r.cancelled=0,r.stopImmediatePropagation=function(){r.cancelled=1},r.stopPropagation=function(){r.cancelled=-1}),-1!==r.cancelled&&(a===this.prevCode&&r.timeStamp===this.prevTime&&r.type===this.prevType||(this.prevCode=a,this.prevTime=r.timeStamp,this.prevType=r.type,"keydown"===r.type?(o&&(l=o.isDown,o.onDown(r)),r.cancelled||o&&l||(f[a]&&this.emit(s.KEY_DOWN+f[a],r),r.cancelled||this.emit(s.ANY_KEY_DOWN,r))):(o&&o.onUp(r),r.cancelled||(f[a]&&this.emit(s.KEY_UP+f[a],r),r.cancelled||this.emit(s.ANY_KEY_UP,r))),1===r.cancelled&&(r.cancelled=0)))}},resetKeys:function(){for(var e=this.keys,t=0;t<e.length;t++)e[t]&&e[t].reset();return this},shutdown:function(){this.removeAllKeys(!0),this.removeAllListeners(),this.sceneInputPlugin.manager.events.off(l.MANAGER_PROCESS,this.update,this),this.game.events.off(a.BLUR,this.resetKeys),this.scene.sys.events.off(p.PAUSE,this.resetKeys,this),this.scene.sys.events.off(p.SLEEP,this.resetKeys,this),this.queue=[]},destroy:function(){this.shutdown();for(var e=this.keys,t=0;t<e.length;t++)e[t]&&e[t].destroy();this.keys=[],this.combos=[],this.queue=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.manager=null},time:{get:function(){return this.sceneInputPlugin.manager.time}}});h.register("KeyboardPlugin",g,"keyboard","keyboard","inputKeyboard"),e.exports=g},66970(e){e.exports=function(e,t){return t.timeLastMatched=e.timeStamp,t.index++,t.index===t.size||(t.current=t.keyCodes[t.index],!1)}},87960(e,t,i){var n=i(83419),r=i(95922),s=i(95540),a=i(68769),o=i(92803),l=new n({initialize:function(e,t,i){if(void 0===i&&(i={}),t.length<2)return!1;this.manager=e,this.enabled=!0,this.keyCodes=[];for(var n=0;n<t.length;n++){var l=t[n];"string"===typeof l?this.keyCodes.push(l.toUpperCase().charCodeAt(0)):"number"===typeof l?this.keyCodes.push(l):l.hasOwnProperty("keyCode")&&this.keyCodes.push(l.keyCode)}this.current=this.keyCodes[0],this.index=0,this.size=this.keyCodes.length,this.timeLastMatched=0,this.matched=!1,this.timeMatched=0,this.resetOnWrongKey=s(i,"resetOnWrongKey",!0),this.maxKeyDelay=s(i,"maxKeyDelay",0),this.resetOnMatch=s(i,"resetOnMatch",!1),this.deleteOnMatch=s(i,"deleteOnMatch",!1);var h=this;this.onKeyDown=function(e){!h.matched&&h.enabled&&(a(e,h)&&(h.manager.emit(r.COMBO_MATCH,h,e),h.resetOnMatch?o(h):h.deleteOnMatch&&h.destroy()))},this.manager.on(r.ANY_KEY_DOWN,this.onKeyDown)},progress:{get:function(){return this.index/this.size}},destroy:function(){this.enabled=!1,this.keyCodes=[],this.manager.off(r.ANY_KEY_DOWN,this.onKeyDown),this.manager=null}});e.exports=l},68769(e,t,i){var n=i(66970);e.exports=function(e,t){if(t.matched)return!0;var i=!1,r=!1;if(e.keyCode===t.current)if(t.index>0&&t.maxKeyDelay>0){var s=t.timeLastMatched+t.maxKeyDelay;e.timeStamp<=s&&(r=!0,i=n(e,t))}else r=!0,i=n(e,t);return!r&&t.resetOnWrongKey&&(t.index=0,t.current=t.keyCodes[0]),i&&(t.timeLastMatched=e.timeStamp,t.matched=!0,t.timeMatched=e.timeStamp),i}},92803(e){e.exports=function(e){return e.current=e.keyCodes[0],e.index=0,e.timeLastMatched=0,e.matched=!1,e.timeMatched=0,e}},92612(e){e.exports="keydown"},23345(e){e.exports="keyup"},21957(e){e.exports="keycombomatch"},44743(e){e.exports="down"},3771(e){e.exports="keydown-"},46358(e){e.exports="keyup-"},75674(e){e.exports="up"},95922(e,t,i){e.exports={ANY_KEY_DOWN:i(92612),ANY_KEY_UP:i(23345),COMBO_MATCH:i(21957),DOWN:i(44743),KEY_DOWN:i(3771),KEY_UP:i(46358),UP:i(75674)}},51442(e,t,i){e.exports={Events:i(95922),KeyboardManager:i(78970),KeyboardPlugin:i(28846),Key:i(30472),KeyCodes:i(46032),KeyCombo:i(87960),AdvanceKeyCombo:i(66970),ProcessKeyCombo:i(68769),ResetKeyCombo:i(92803),JustDown:i(90229),JustUp:i(38796),DownDuration:i(37015),UpDuration:i(41170)}},37015(e){e.exports=function(e,t){void 0===t&&(t=50);var i=e.plugin.game.loop.time-e.timeDown;return e.isDown&&i<t}},90229(e){e.exports=function(e){return!!e._justDown&&(e._justDown=!1,!0)}},38796(e){e.exports=function(e){return!!e._justUp&&(e._justUp=!1,!0)}},30472(e,t,i){var n=i(83419),r=i(50792),s=i(95922),a=new n({Extends:r,initialize:function(e,t){r.call(this),this.plugin=e,this.keyCode=t,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(e){return this.emitOnRepeat=e,this},onDown:function(e){this.originalEvent=e,this.enabled&&(this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.location=e.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(s.DOWN,this,e):(this.isDown=!0,this.isUp=!1,this.timeDown=e.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(s.DOWN,this,e)))},onUp:function(e){this.originalEvent=e,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=e.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(s.UP,this,e))},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}});e.exports=a},46032(e){e.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},74600(e,t,i){var n=i(46032),r={};for(var s in n)r[n[s]]=s;e.exports=r},41170(e){e.exports=function(e,t){void 0===t&&(t=50);var i=e.plugin.game.loop.time-e.timeUp;return e.isUp&&i<t}},85098(e,t,i){var n=i(83419),r=i(89357),s=i(8214),a=i(29747),o=new n({initialize:function(e){this.manager=e,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,e.events.once(s.MANAGER_BOOT,this.boot,this)},boot:function(){var e=this.manager.config;this.enabled=e.inputMouse,this.target=e.inputMouseEventTarget,this.passive=e.inputMousePassive,this.preventDefaultDown=e.inputMousePreventDefaultDown,this.preventDefaultUp=e.inputMousePreventDefaultUp,this.preventDefaultMove=e.inputMousePreventDefaultMove,this.preventDefaultWheel=e.inputMousePreventDefaultWheel,this.target?"string"===typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,e.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",function(e){return e.preventDefault(),!1}),this},requestPointerLock:function(){if(r.pointerLock){var e=this.target;e.requestPointerLock=e.requestPointerLock||e.mozRequestPointerLock||e.webkitRequestPointerLock,e.requestPointerLock()}},releasePointerLock:function(){r.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var e=this.target;if(e){var t=this,i=this.manager,n=i.canvas,s=window&&window.focus&&i.game.config.autoFocus;this.onMouseMove=function(e){!e.defaultPrevented&&t.enabled&&i&&i.enabled&&(i.onMouseMove(e),t.preventDefaultMove&&e.preventDefault())},this.onMouseDown=function(e){s&&window.focus(),!e.defaultPrevented&&t.enabled&&i&&i.enabled&&(i.onMouseDown(e),t.preventDefaultDown&&e.target===n&&e.preventDefault())},this.onMouseDownWindow=function(e){e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents||!e.defaultPrevented&&t.enabled&&i&&i.enabled&&e.target!==n&&i.onMouseDown(e)},this.onMouseUp=function(e){!e.defaultPrevented&&t.enabled&&i&&i.enabled&&(i.onMouseUp(e),t.preventDefaultUp&&e.target===n&&e.preventDefault())},this.onMouseUpWindow=function(e){e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents||!e.defaultPrevented&&t.enabled&&i&&i.enabled&&e.target!==n&&i.onMouseUp(e)},this.onMouseOver=function(e){!e.defaultPrevented&&t.enabled&&i&&i.enabled&&i.setCanvasOver(e)},this.onMouseOut=function(e){!e.defaultPrevented&&t.enabled&&i&&i.enabled&&i.setCanvasOut(e)},this.onMouseWheel=function(e){!e.defaultPrevented&&t.enabled&&i&&i.enabled&&i.onMouseWheel(e),t.preventDefaultWheel&&e.target===n&&e.preventDefault()};var a={passive:!0};if(e.addEventListener("mousemove",this.onMouseMove),e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mouseover",this.onMouseOver,a),e.addEventListener("mouseout",this.onMouseOut,a),this.preventDefaultWheel?e.addEventListener("wheel",this.onMouseWheel,{passive:!1}):e.addEventListener("wheel",this.onMouseWheel,a),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,a),window.top.addEventListener("mouseup",this.onMouseUpWindow,a)}catch(o){window.addEventListener("mousedown",this.onMouseDownWindow,a),window.addEventListener("mouseup",this.onMouseUpWindow,a),this.isTop=!1}r.pointerLock&&(this.pointerLockChange=function(e){var n=t.target;t.locked=document.pointerLockElement===n||document.mozPointerLockElement===n||document.webkitPointerLockElement===n,i.onPointerLockChange(e)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var e=this.target;e.removeEventListener("mousemove",this.onMouseMove),e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mouseover",this.onMouseOver),e.removeEventListener("mouseout",this.onMouseOut),window&&((e=this.isTop?window.top:window).removeEventListener("mousedown",this.onMouseDownWindow),e.removeEventListener("mouseup",this.onMouseUpWindow)),r.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}});e.exports=o},87078(e,t,i){e.exports={MouseManager:i(85098)}},36210(e,t,i){var n=i(83419),r=i(8214),s=i(29747),a=new n({initialize:function(e){this.manager=e,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=s,this.onTouchStartWindow=s,this.onTouchMove=s,this.onTouchEnd=s,this.onTouchEndWindow=s,this.onTouchCancel=s,this.onTouchCancelWindow=s,this.isTop=!0,e.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var e=this.manager.config;this.enabled=e.inputTouch,this.target=e.inputTouchEventTarget,this.capture=e.inputTouchCapture,this.target?"string"===typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,e.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",function(e){return e.preventDefault(),!1}),this},startListeners:function(){var e=this.target;if(e){var t=this,i=this.manager,n=i.canvas,r=window&&window.focus&&i.game.config.autoFocus;this.onTouchMove=function(e){!e.defaultPrevented&&t.enabled&&i&&i.enabled&&(i.onTouchMove(e),t.capture&&e.cancelable&&e.preventDefault())},this.onTouchStart=function(e){r&&window.focus(),!e.defaultPrevented&&t.enabled&&i&&i.enabled&&(i.onTouchStart(e),t.capture&&e.cancelable&&e.target===n&&e.preventDefault())},this.onTouchStartWindow=function(e){!e.defaultPrevented&&t.enabled&&i&&i.enabled&&e.target!==n&&i.onTouchStart(e)},this.onTouchEnd=function(e){!e.defaultPrevented&&t.enabled&&i&&i.enabled&&(i.onTouchEnd(e),t.capture&&e.cancelable&&e.target===n&&e.preventDefault())},this.onTouchEndWindow=function(e){!e.defaultPrevented&&t.enabled&&i&&i.enabled&&e.target!==n&&i.onTouchEnd(e)},this.onTouchCancel=function(e){!e.defaultPrevented&&t.enabled&&i&&i.enabled&&(i.onTouchCancel(e),t.capture&&e.preventDefault())},this.onTouchCancelWindow=function(e){!e.defaultPrevented&&t.enabled&&i&&i.enabled&&i.onTouchCancel(e)};var s=this.capture,a={passive:!0},o={passive:!1};if(e.addEventListener("touchstart",this.onTouchStart,s?o:a),e.addEventListener("touchmove",this.onTouchMove,s?o:a),e.addEventListener("touchend",this.onTouchEnd,s?o:a),e.addEventListener("touchcancel",this.onTouchCancel,s?o:a),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("touchstart",this.onTouchStartWindow,o),window.top.addEventListener("touchend",this.onTouchEndWindow,o),window.top.addEventListener("touchcancel",this.onTouchCancelWindow,o)}catch(l){window.addEventListener("touchstart",this.onTouchStartWindow,o),window.addEventListener("touchend",this.onTouchEndWindow,o),window.addEventListener("touchcancel",this.onTouchCancelWindow,o),this.isTop=!1}this.enabled=!0}},stopListeners:function(){var e=this.target;e.removeEventListener("touchstart",this.onTouchStart),e.removeEventListener("touchmove",this.onTouchMove),e.removeEventListener("touchend",this.onTouchEnd),e.removeEventListener("touchcancel",this.onTouchCancel),window&&((e=this.isTop?window.top:window).removeEventListener("touchstart",this.onTouchStartWindow),e.removeEventListener("touchend",this.onTouchEndWindow),e.removeEventListener("touchcancel",this.onTouchCancelWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});e.exports=a},95618(e,t,i){e.exports={TouchManager:i(36210)}},41299(e,t,i){var n=i(83419),r=i(23906),s=i(54899),a=i(95540),o=i(98356),l=i(3374),h=i(84376),u=i(92638),c=new n({initialize:function(e,t){if(this.loader=e,this.cache=a(t,"cache",!1),this.type=a(t,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(t,"key",!1);var i=this.key;if(e.prefix&&""!==e.prefix&&(this.key=e.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var n=a(t,"url");void 0===n?n=e.path+i+"."+a(t,"extension",""):"string"!==typeof n||n.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(n=e.path+n),this.url=n,this.src="",this.xhrSettings=u(a(t,"responseType",void 0)),a(t,"xhrSettings",!1)&&(this.xhrSettings=l(this.xhrSettings,a(t,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"===typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(t,"config",{}),this.multiFile,this.linkFile,this.base64="string"===typeof n&&0===n.indexOf("data:"),this.retryAttempts=a(t,"maxRetries",e.maxRetries)},setLink:function(e){this.linkFile=e,e.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){if(this.state===r.FILE_POPULATED)this.loader.nextFile(this,!0);else{if(this.state=r.FILE_LOADING,this.src=o(this,this.loader.baseURL),!this.src)throw new Error("URL Error in File: "+this.key+" from: "+this.url);0===this.src.indexOf("data:")&&(this.base64=!0),this.xhrLoader=h(this,this.loader.xhr)}},onLoad:function(e,t){var i=e.responseURL&&this.loader.localSchemes.some(function(t){return 0===e.responseURL.indexOf(t)})&&0===t.target.status,n=!(t.target&&200!==t.target.status)||i;4===e.readyState&&e.status>=400&&e.status<=599&&(n=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,n)},onBase64Load:function(e){this.xhrLoader=e,this.state=r.FILE_LOADED,this.percentComplete=1,this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.retryAttempts>0?(this.retryAttempts--,this.load()):this.loader.nextFile(this,!1)},onProgress:function(e){e.lengthComputable&&(this.bytesLoaded=e.loaded,this.bytesTotal=e.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.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=r.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(e){if(this.state!==r.FILE_PENDING_DESTROY){void 0===e&&(e=this.data);var t=this.key,i=this.type;this.loader.emit(s.FILE_COMPLETE,t,i,e),this.loader.emit(s.FILE_KEY_COMPLETE+i+"-"+t,t,i,e),this.loader.flagForRemoval(this),this.state=r.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(e,t,i){if("function"===typeof URL)e.src=URL.createObjectURL(t);else{var n=new FileReader;n.onload=function(){e.removeAttribute("crossOrigin"),e.src="data:"+(t.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=e.onerror,n.readAsDataURL(t)}},c.revokeObjectURL=function(e){"function"===typeof URL&&URL.revokeObjectURL(e.src)},e.exports=c},74099(e){var t={},i={install:function(e){for(var i in t)e[i]=t[i]},register:function(e,i){t[e]=i},destroy:function(){t={}}};e.exports=i},98356(e){e.exports=function(e,t){return!!e.url&&(e.url.match(/^(?:blob:|data:|capacitor:\/\/|file:\/\/|http:\/\/|https:\/\/|\/\/)/)?e.url:t+e.url)}},74261(e,t,i){var n=i(83419),r=i(23906),s=i(50792),a=i(54899),o=i(74099),l=i(95540),h=i(35154),u=i(41212),c=i(37277),d=i(44594),f=i(92638),p=new n({Extends:s,initialize:function(e){s.call(this);var t=e.sys.game.config,i=e.sys.settings.loader;this.scene=e,this.systems=e.sys,this.cacheManager=e.sys.cache,this.textureManager=e.sys.textures,this.sceneManager=e.sys.game.scene,o.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(l(i,"baseURL",t.loaderBaseURL)),this.setPath(l(i,"path",t.loaderPath)),this.setPrefix(l(i,"prefix",t.loaderPrefix)),this.maxParallelDownloads=l(i,"maxParallelDownloads",t.loaderMaxParallelDownloads),this.xhr=f(l(i,"responseType",t.loaderResponseType),l(i,"async",t.loaderAsync),l(i,"user",t.loaderUser),l(i,"password",t.loaderPassword),l(i,"timeout",t.loaderTimeout),l(i,"withCredentials",t.loaderWithCredentials)),this.crossOrigin=l(i,"crossOrigin",t.loaderCrossOrigin),this.imageLoadType=l(i,"imageLoadType",t.loaderImageLoadType),this.localSchemes=l(i,"localScheme",t.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new Set,this.inflight=new Set,this.queue=new Set,this._deleteQueue=new Set,this.totalFailed=0,this.totalComplete=0,this.state=r.LOADER_IDLE,this.multiKeyIndex=0,this.maxRetries=l(i,"maxRetries",t.loaderMaxRetries),e.sys.events.once(d.BOOT,this.boot,this),e.sys.events.on(d.START,this.pluginStart,this)},boot:function(){this.systems.events.once(d.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(d.SHUTDOWN,this.shutdown,this)},setBaseURL:function(e){return void 0===e&&(e=""),""!==e&&"/"!==e.substr(-1)&&(e=e.concat("/")),this.baseURL=e,this},setPath:function(e){return void 0===e&&(e=""),""!==e&&"/"!==e.substr(-1)&&(e=e.concat("/")),this.path=e,this},setPrefix:function(e){return void 0===e&&(e=""),this.prefix=e,this},setCORS:function(e){return this.crossOrigin=e,this},addFile:function(e){Array.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++){var i=e[t];this.keyExists(i)||(this.list.add(i),this.emit(a.ADD,i.key,i.type,this,i),this.isLoading()&&(this.totalToLoad++,this.updateProgress()))}},keyExists:function(e){var t=e.hasCacheConflict();return t||this.list.forEach(function(i){if(i.type===e.type&&i.key===e.key)return t=!0,!1}),!t&&this.isLoading()&&(this.inflight.forEach(function(i){if(i.type===e.type&&i.key===e.key)return t=!0,!1}),this.queue.forEach(function(i){if(i.type===e.type&&i.key===e.key)return t=!0,!1})),t},addPack:function(e,t){if("string"===typeof t){var i=h(e,t);i&&(e={packKey:i})}var n=0,r=this.baseURL,s=this.path,a=this.prefix;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=e[o],c=l(u,"baseURL",r),d=l(u,"path",s),f=l(u,"prefix",a),p=l(u,"files",null),m=l(u,"defaultType","void");if(Array.isArray(p)){this.setBaseURL(c),this.setPath(d),this.setPrefix(f);for(var g=0;g<p.length;g++){var v=p[g],y=v.hasOwnProperty("type")?v.type:m;this[y]&&(this[y](v),n++)}}}return this.setBaseURL(r),this.setPath(s),this.setPrefix(a),n>0},removePack:function(e,t){var i,n=this.systems.anims,r=this.cacheManager,s=this.textureManager,a={animation:"json",aseprite:"json",audio:"audio",audioSprite:"audio",binary:"binary",bitmapFont:"bitmapFont",css:null,glsl:"shader",html:"html",json:"json",obj:"obj",plugin:null,scenePlugin:null,script:null,spine:"json",text:"text",tilemapCSV:"tilemap",tilemapImpact:"tilemap",tilemapTiledJSON:"tilemap",video:"video",xml:"xml"};if(u(e))i=e;else if(!(i=r.json.get(e)))return void console.warn("Asset Pack not found in JSON cache:",e);for(var o in t&&(i={_:i[t]}),i){var h=i[o],c=l(h,"prefix",""),d=l(h,"files"),f=l(h,"defaultType");if(Array.isArray(d))for(var p=0;p<d.length;p++){var m=d[p],g=m.hasOwnProperty("type")?m.type:f;if(g){var v=c+m.key;if("animation"===g&&n.remove(v),"aseprite"!==g&&"atlas"!==g&&"atlasXML"!==g&&"htmlTexture"!==g&&"image"!==g&&"multiatlas"!==g&&"spritesheet"!==g&&"svg"!==g&&"texture"!==g&&"unityAtlas"!==g||(s.remove(v),a[g]))if("pack"!==g){if("spine"===g){var y=r.custom.spine.get(v);if(!y)continue;var x=void 0===y.prefix?"":y.prefix;r.custom.spine.remove(v);var b=r.custom.spineTextures.get(v);if(!b)continue;r.custom.spineTextures.remove(v);for(var w=0;w<b.pages.length;w++){var T=x+b.pages[w].name,_=v+":"+T;s.exists(_)?s.remove(_):s.remove(T)}}var S=a[g];if(null!==S)if(S)r[S].remove(v);else console.warn("Unknown type:",g)}else this.removePack(v,m.dataKey)}else console.warn("No type:",m)}}},isLoading:function(){return this.state===r.LOADER_LOADING||this.state===r.LOADER_PROCESSING},isReady:function(){return this.state===r.LOADER_IDLE||this.state===r.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=r.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(d.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===r.LOADER_LOADING&&this.list.size>0&&this.inflight.size<this.maxParallelDownloads&&this.checkLoadQueue()},checkLoadQueue:function(){this.list.forEach(function(e){if((e.state===r.FILE_POPULATED||e.state===r.FILE_PENDING&&this.inflight.size<this.maxParallelDownloads)&&(this.inflight.add(e),this.list.delete(e),e.crossOrigin||(e.crossOrigin=this.crossOrigin),e.load()),this.inflight.size===this.maxParallelDownloads)return!1},this)},nextFile:function(e,t){this.inflight&&(this.inflight.delete(e),this.updateProgress(),t?(this.totalComplete++,this.queue.add(e),this.emit(a.FILE_LOAD,e),e.onProcess()):(this.totalFailed++,this._deleteQueue.add(e),this.emit(a.FILE_LOAD_ERROR,e),this.fileProcessComplete(e)))},fileProcessComplete:function(e){this.scene&&this.systems&&this.systems.game&&!this.systems.game.pendingDestroy&&(e.state===r.FILE_ERRORED?e.multiFile&&e.multiFile.onFileFailed(e):e.state===r.FILE_COMPLETE&&(e.multiFile?e.multiFile.isReadyToProcess()&&(e.multiFile.addToCache(),e.multiFile.pendingDestroy()):(e.addToCache(),e.pendingDestroy())),this.queue.delete(e),0===this.list.size&&0===this.inflight.size&&0===this.queue.size&&this.loadComplete())},loadComplete:function(){this.emit(a.POST_PROCESS,this),this.list.clear(),this.inflight.clear(),this.queue.clear(),this.progress=1,this.state=r.LOADER_COMPLETE,this.systems.events.off(d.UPDATE,this.update,this),this._deleteQueue.forEach(function(e){e.destroy()}),this._deleteQueue.clear(),this.emit(a.COMPLETE,this,this.totalComplete,this.totalFailed)},flagForRemoval:function(e){this._deleteQueue.add(e)},saveJSON:function(e,t){return this.save(JSON.stringify(e),t)},save:function(e,t,i){void 0===t&&(t="file.json"),void 0===i&&(i="application/json");var n=new Blob([e],{type:i}),r=URL.createObjectURL(n),s=document.createElement("a");return s.download=t,s.textContent="Download "+t,s.href=r,s.click(),this},reset:function(){this.list.clear(),this.inflight.clear(),this.queue.clear();var e=this.systems.game.config,t=this.systems.settings.loader;this.setBaseURL(l(t,"baseURL",e.loaderBaseURL)),this.setPath(l(t,"path",e.loaderPath)),this.setPrefix(l(t,"prefix",e.loaderPrefix)),this.state=r.LOADER_IDLE},shutdown:function(){this.reset(),this.state=r.LOADER_SHUTDOWN,this.removeAllListeners(),this.systems.events.off(d.UPDATE,this.update,this),this.systems.events.off(d.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.state=r.LOADER_DESTROYED,this.systems.events.off(d.UPDATE,this.update,this),this.systems.events.off(d.START,this.pluginStart,this),this.list=null,this.inflight=null,this.queue=null,this.scene=null,this.systems=null,this.textureManager=null,this.cacheManager=null,this.sceneManager=null}});c.register("Loader",p,"load"),e.exports=p},3374(e,t,i){var n=i(79291),r=i(92638);e.exports=function(e,t){var i=void 0===e?r():n({},e);if(t)for(var s in t)void 0!==t[s]&&(i[s]=t[s]);return i}},26430(e,t,i){var n=i(83419),r=i(23906),s=i(54899),a=new n({initialize:function(e,t,i,n){var s=[];n.forEach(function(e){e&&s.push(e)}),this.loader=e,this.type=t,this.key=i;var a=this.key;e.prefix&&""!==e.prefix&&(this.key=e.prefix+a),this.multiKeyIndex=e.multiKeyIndex++,this.files=s,this.state=r.FILE_PENDING,this.complete=!1,this.pending=s.length,this.failed=0,this.config={},this.baseURL=e.baseURL,this.path=e.path,this.prefix=e.prefix;for(var o=0;o<s.length;o++)s[o].multiFile=this},isReadyToProcess:function(){return 0===this.pending&&0===this.failed&&!this.complete},addToMultiFile:function(e){return this.files.push(e),e.multiFile=this,this.pending++,this.complete=!1,this},onFileComplete:function(e){-1!==this.files.indexOf(e)&&this.pending--},onFileFailed:function(e){-1!==this.files.indexOf(e)&&(this.failed++,console.error('File failed: %s "%s" (via %s "%s")',this.type,this.key,e.type,e.key))},pendingDestroy:function(){if(this.state!==r.FILE_PENDING_DESTROY){var e=this.key,t=this.type;this.loader.emit(s.FILE_COMPLETE,e,t),this.loader.emit(s.FILE_KEY_COMPLETE+t+"-"+e,e,t),this.loader.flagForRemoval(this);for(var i=0;i<this.files.length;i++)this.files[i].pendingDestroy();this.state=r.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.files=null,this.config=null}});e.exports=a},84376(e,t,i){var n=i(3374);e.exports=function(e,t){var i=n(t,e.xhrSettings);if(e.base64){var r,s=e.url.split(";base64,").pop()||e.url.split(",").pop();return r="arraybuffer"===e.xhrSettings.responseType?{response:Uint8Array.from(atob(s),function(e){return e.charCodeAt(0)}).buffer}:{responseText:atob(s)},void e.onBase64Load(r)}var a=new XMLHttpRequest;if(a.open("GET",e.src,i.async,i.user,i.password),a.responseType=e.xhrSettings.responseType,a.timeout=i.timeout,i.headers)for(var o in i.headers)a.setRequestHeader(o,i.headers[o]);return i.header&&i.headerValue&&a.setRequestHeader(i.header,i.headerValue),i.requestedWith&&a.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&a.overrideMimeType(i.overrideMimeType),i.withCredentials&&(a.withCredentials=!0),a.onload=e.onLoad.bind(e,a),a.onerror=e.onError.bind(e,a),a.onprogress=e.onProgress.bind(e),a.ontimeout=e.onError.bind(e,a),a.send(),a}},92638(e){e.exports=function(e,t,i,n,r,s){return void 0===e&&(e=""),void 0===t&&(t=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:e,async:t,user:i,password:n,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},23906(e){e.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},42155(e){e.exports="addfile"},38991(e){e.exports="complete"},27540(e){e.exports="filecomplete"},87464(e){e.exports="filecomplete-"},94486(e){e.exports="loaderror"},13035(e){e.exports="load"},38144(e){e.exports="fileprogress"},97520(e){e.exports="postprocess"},85595(e){e.exports="progress"},55680(e){e.exports="start"},54899(e,t,i){e.exports={ADD:i(42155),COMPLETE:i(38991),FILE_COMPLETE:i(27540),FILE_KEY_COMPLETE:i(87464),FILE_LOAD_ERROR:i(94486),FILE_LOAD:i(13035),FILE_PROGRESS:i(38144),POST_PROCESS:i(97520),PROGRESS:i(85595),START:i(55680)}},14135(e,t,i){var n=i(83419),r=i(74099),s=i(518),a=i(54899),o=new n({Extends:s,initialize:function(e,t,i,n,r){s.call(this,e,t,i,n,r),this.type="animationJSON"},onProcess:function(){this.loader.once(a.POST_PROCESS,this.onLoadComplete,this),s.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});r.register("animation",function(e,t,i,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)this.addFile(new o(this,e[r]));else this.addFile(new o(this,e,t,n,i));return this}),e.exports=o},76272(e,t,i){var n=i(83419),r=i(74099),s=i(95540),a=i(19550),o=i(41212),l=i(518),h=i(26430),u=new n({Extends:h,initialize:function(e,t,i,n,r,u){var c,d;if(o(t)){var f=t;t=s(f,"key"),c=new a(e,{key:t,url:s(f,"textureURL"),extension:s(f,"textureExtension","png"),normalMap:s(f,"normalMap"),xhrSettings:s(f,"textureXhrSettings")}),d=new l(e,{key:t,url:s(f,"atlasURL"),extension:s(f,"atlasExtension","json"),xhrSettings:s(f,"atlasXhrSettings")})}else c=new a(e,t,i,r),d=new l(e,t,n,u);c.linkFile?h.call(this,e,"atlasjson",t,[c,d,c.linkFile]):h.call(this,e,"atlasjson",t,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var e=this.files[0],t=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(e.key,e.data,t.data,i),t.addToCache(),this.complete=!0}}});r.register("aseprite",function(e,t,i,n,r){var s;if(Array.isArray(e))for(var a=0;a<e.length;a++)s=new u(this,e[a]),this.addFile(s.files);else s=new u(this,e,t,i,n,r),this.addFile(s.files);return this}),e.exports=u},38734(e,t,i){var n=i(83419),r=i(74099),s=i(95540),a=i(19550),o=i(41212),l=i(518),h=i(26430),u=new n({Extends:h,initialize:function(e,t,i,n,r,u){var c,d;if(o(t)){var f=t;t=s(f,"key"),c=new a(e,{key:t,url:s(f,"textureURL"),extension:s(f,"textureExtension","png"),normalMap:s(f,"normalMap"),xhrSettings:s(f,"textureXhrSettings")}),d=new l(e,{key:t,url:s(f,"atlasURL"),extension:s(f,"atlasExtension","json"),xhrSettings:s(f,"atlasXhrSettings")})}else c=new a(e,t,i,r),d=new l(e,t,n,u);c.linkFile?h.call(this,e,"atlasjson",t,[c,d,c.linkFile]):h.call(this,e,"atlasjson",t,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var e=this.files[0],t=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(e.key,e.data,t.data,i),this.complete=!0}}});r.register("atlas",function(e,t,i,n,r){var s;if(Array.isArray(e))for(var a=0;a<e.length;a++)s=new u(this,e[a]),this.addFile(s.files);else s=new u(this,e,t,i,n,r),this.addFile(s.files);return this}),e.exports=u},74599(e,t,i){var n=i(83419),r=i(74099),s=i(95540),a=i(19550),o=i(41212),l=i(26430),h=i(57318),u=new n({Extends:l,initialize:function(e,t,i,n,r,u){var c,d;if(o(t)){var f=t;t=s(f,"key"),c=new a(e,{key:t,url:s(f,"textureURL"),extension:s(f,"textureExtension","png"),normalMap:s(f,"normalMap"),xhrSettings:s(f,"textureXhrSettings")}),d=new h(e,{key:t,url:s(f,"atlasURL"),extension:s(f,"atlasExtension","xml"),xhrSettings:s(f,"atlasXhrSettings")})}else c=new a(e,t,i,r),d=new h(e,t,n,u);c.linkFile?l.call(this,e,"atlasxml",t,[c,d,c.linkFile]):l.call(this,e,"atlasxml",t,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var e=this.files[0],t=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(e.key,e.data,t.data,i),this.complete=!0}}});r.register("atlasXML",function(e,t,i,n,r){var s;if(Array.isArray(e))for(var a=0;a<e.length;a++)s=new u(this,e[a]),this.addFile(s.files);else s=new u(this,e,t,i,n,r),this.addFile(s.files);return this}),e.exports=u},21097(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(89749),h=i(41212),u=new n({Extends:s,initialize:function(e,t,i,n,r){if(h(t)){var a=t;t=o(a,"key"),n=o(a,"xhrSettings"),r=o(a,"context",r)}var l={type:"audio",cache:e.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:t,url:i.url,xhrSettings:n,config:{context:r}};s.call(this,e,l)},onProcess:function(){this.state=r.FILE_PROCESSING;var e=this;this.config.context.decodeAudioData(this.xhrLoader.response,function(t){e.data=t,e.onProcessComplete()},function(t){console.error("Error decoding audio: "+e.key+" - ",t?t.message:null),e.onProcessError()}),this.config.context=null}});u.create=function(e,t,i,n,r){var s=e.systems.game,a=s.config.audio,c=s.device.audio;h(t)&&(i=o(t,"url",[]),n=o(t,"config",{}));var d=u.getAudioURL(s,i);return d?c.webAudio&&!a.disableWebAudio?new u(e,t,d,r,s.sound.context):new l(e,t,d,n):(console.warn('No audio URLs for "%s" can play on this device',t),null)},u.getAudioURL=function(e,t){Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=o(t[i],"url",t[i]);if(0===n.indexOf("blob:")||0===n.indexOf("data:"))return{url:n,type:""};var r=n.match(/\.([a-zA-Z0-9]+)($|\?)/);if(r=o(t[i],"type",r?r[1]:"").toLowerCase(),e.device.audio[r])return{url:n,type:r}}return null},a.register("audio",function(e,t,i,n){var r,s=this.systems.game,a=s.config.audio,o=s.device.audio;if(a.noAudio||!o.webAudio&&!o.audioData)return this;if(Array.isArray(e))for(var l=0;l<e.length;l++)(r=u.create(this,e[l]))&&this.addFile(r);else(r=u.create(this,e,t,i,n))&&this.addFile(r);return this}),e.exports=u},89524(e,t,i){var n=i(21097),r=i(83419),s=i(74099),a=i(95540),o=i(41212),l=i(518),h=i(26430),u=new r({Extends:h,initialize:function(e,t,i,r,s,u,c){if(o(t)){var d=t;t=a(d,"key"),i=a(d,"jsonURL"),r=a(d,"audioURL"),s=a(d,"audioConfig"),u=a(d,"audioXhrSettings"),c=a(d,"jsonXhrSettings")}var f;if(r){var p=n.create(e,t,r,s,u);p&&(f=new l(e,t,i,c),h.call(this,e,"audiosprite",t,[p,f]),this.config.resourceLoad=!1)}else f=new l(e,t,i,c),h.call(this,e,"audiosprite",t,[f]),this.config.resourceLoad=!0,this.config.audioConfig=s,this.config.audioXhrSettings=u},onFileComplete:function(e){if(-1!==this.files.indexOf(e)&&(this.pending--,this.config.resourceLoad&&"json"===e.type&&e.data.hasOwnProperty("resources"))){var t=e.data.resources,i=a(this.config,"audioConfig"),r=a(this.config,"audioXhrSettings"),s=n.create(this.loader,e.key,t,i,r);s&&(this.addToMultiFile(s),this.loader.addFile(s))}},addToCache:function(){if(this.isReadyToProcess()){var e=this.files[0],t=this.files[1];e.addToCache(),t.addToCache(),this.complete=!0}}});s.register("audioSprite",function(e,t,i,n,r,s){var a,o=this.systems.game,l=o.config.audio,h=o.device.audio;if(l&&l.noAudio||!h.webAudio&&!h.audioData)return this;if(Array.isArray(e))for(var c=0;c<e.length;c++)(a=new u(this,e[c])).files&&this.addFile(a.files);else(a=new u(this,e,t,i,n,r,s)).files&&this.addFile(a.files);return this})},85722(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(41212),h=new n({Extends:s,initialize:function(e,t,i,n,r){var a="bin";if(l(t)){var h=t;t=o(h,"key"),i=o(h,"url"),n=o(h,"xhrSettings"),a=o(h,"extension",a),r=o(h,"dataType",r)}var u={type:"binary",cache:e.cacheManager.binary,extension:a,responseType:"arraybuffer",key:t,url:i,xhrSettings:n,config:{dataType:r}};s.call(this,e,u)},onProcess:function(){this.state=r.FILE_PROCESSING;var e=this.config.dataType;this.data=e?new e(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});a.register("binary",function(e,t,i,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)this.addFile(new h(this,e[r]));else this.addFile(new h(this,e,t,n,i));return this}),e.exports=h},97025(e,t,i){var n=i(83419),r=i(74099),s=i(95540),a=i(19550),o=i(41212),l=i(26430),h=i(21859),u=i(57318),c=new n({Extends:l,initialize:function(e,t,i,n,r,h){var c,d;if(o(t)){var f=t;t=s(f,"key"),c=new a(e,{key:t,url:s(f,"textureURL"),extension:s(f,"textureExtension","png"),normalMap:s(f,"normalMap"),xhrSettings:s(f,"textureXhrSettings")}),d=new u(e,{key:t,url:s(f,"fontDataURL"),extension:s(f,"fontDataExtension","xml"),xhrSettings:s(f,"fontDataXhrSettings")})}else c=new a(e,t,i,r),d=new u(e,t,n,h);c.linkFile?l.call(this,e,"bitmapfont",t,[c,d,c.linkFile]):l.call(this,e,"bitmapfont",t,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var e=this.files[0],t=this.files[1];e.addToCache();var i=e.cache.get(e.key),n=h(t.data,e.cache.getFrame(e.key),0,0,i);this.loader.cacheManager.bitmapFont.add(e.key,{data:n,texture:e.key,frame:null}),this.complete=!0}}});r.register("bitmapFont",function(e,t,i,n,r){var s;if(Array.isArray(e))for(var a=0;a<e.length;a++)s=new c(this,e[a]),this.addFile(s.files);else s=new c(this,e,t,i,n,r),this.addFile(s.files);return this}),e.exports=c},16024(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(41212),h=new n({Extends:s,initialize:function(e,t,i,n){var r="css";if(l(t)){var a=t;t=o(a,"key"),i=o(a,"url"),n=o(a,"xhrSettings"),r=o(a,"extension",r)}var h={type:"script",cache:!1,extension:r,responseType:"text",key:t,url:i,xhrSettings:n};s.call(this,e,h)},onProcess:function(){this.state=r.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(e,t,i){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.addFile(new h(this,e[n]));else this.addFile(new h(this,e,t,i));return this}),e.exports=h},69559(e,t,i){var n=i(38734),r=i(85722),s=i(83419),a=i(74099),o=i(95540),l=i(19550),h=i(41212),u=i(518),c=i(31403),d=i(46975),f=i(59327),p=i(26430),m=i(82038),g=i(55222),v=new s({Extends:p,initialize:function(e,t,i,n){if(i.multiAtlasURL){var s=new u(e,{key:t,url:i.multiAtlasURL,xhrSettings:n,config:i});p.call(this,e,"texture",t,[s])}else{var a=i.textureURL.substr(i.textureURL.length-3);i.type||(i.type="ktx"===a.toLowerCase()?"KTX":"PVR");var o=new r(e,{key:t,url:i.textureURL,extension:a,xhrSettings:n,config:i});if(i.atlasURL){var l=new u(e,{key:t,url:i.atlasURL,xhrSettings:n,config:i});p.call(this,e,"texture",t,[o,l])}else p.call(this,e,"texture",t,[o])}this.config=i},onFileComplete:function(e){if(-1!==this.files.indexOf(e)){if(this.pending--,!this.config.multiAtlasURL)return;if("json"===e.type&&e.data.hasOwnProperty("textures")){var t=e.data.textures,i=this.config,n=this.loader,s=n.baseURL,a=n.path,l=n.prefix,h=o(i,"multiBaseURL",this.baseURL),u=o(i,"multiPath",this.path),c=o(i,"prefix",this.prefix),d=o(i,"textureXhrSettings");h&&n.setBaseURL(h),u&&n.setPath(u),c&&n.setPrefix(c);for(var f=0;f<t.length;f++){var p=t[f].image,m="CMA"+this.multiKeyIndex+"_"+p,g=new r(n,m,p,d);if(this.addToMultiFile(g),n.addFile(g),t[f].normalMap){var v=new r(n,m,t[f].normalMap,d);v.type="normalMap",g.setLink(v),this.addToMultiFile(v),n.addFile(v)}}n.setBaseURL(s),n.setPath(a),n.setPrefix(l)}}},addToCache:function(){function e(e){console.warn('Compressed Texture Invalid: "'+s.key+'". '+e)}if(this.isReadyToProcess()){var t=this.config;if(t.multiAtlasURL)this.addMultiToCache();else{var i,n=this.loader.systems.renderer,r=this.loader.textureManager,s=this.files[0],a=this.files[1];if("PVR"===t.type?i=m(s.data):"KTX"===t.type&&((i=c(s.data))||e("KTX file contains unsupported format.")),i&&!g(i)&&(e("Texture dimensions failed verification. Check the texture format specifications for "+t.format+" 0x"+i.internalFormat.toString(16)+"."),i=null),i&&!n.supportsCompressedTexture(t.format,i.internalFormat)&&(e("Texture format "+t.format+" with internal format "+i.internalFormat+" not supported by the GPU. Texture invalid. This is often due to the texture using sRGB instead of linear RGB."),i=null),i){i.format=n.getCompressedTextureName(t.format,i.internalFormat);var o=a&&a.data?a.data:null;r.addCompressedTexture(s.key,i,o)}}this.complete=!0}},addMultiToCache:function(){for(var e,t=this.config,i=this.files[0],n=[],r=[],s=[],a=this.loader.systems.renderer,o=this.loader.textureManager,l=1;l<this.files.length;l++){var h=this.files[l];if("normalMap"!==h.type)for(var u=h.key.indexOf("_"),d=h.key.substr(u+1),f=h.data,p=0;p<i.data.textures.length;p++){var g=i.data.textures[p];if(g.image===d){"PVR"===t.type?e=m(f):"KTX"===t.type&&(e=c(f)),e&&a.supportsCompressedTexture(t.format,e.internalFormat)&&(e.format=a.getCompressedTextureName(t.format,e.internalFormat),r.push(e),n.push(g),h.linkFile&&s.push(h.linkFile.data));break}}}0===s.length&&(s=void 0),o.addAtlasJSONArray(this.key,r,n,s),this.complete=!0}});a.register("texture",function(e,t,i){var r=this.systems.renderer,s=function(e,t,i,s){var a={format:null,type:null,textureURL:void 0,atlasURL:void 0,multiAtlasURL:void 0,multiPath:void 0,multiBaseURL:void 0};if(h(t)){var u=t;t=o(u,"key"),i=o(u,"url"),s=o(u,"xhrSettings")}var c=!1;for(var p in i)if(r.supportsCompressedTexture(p)){var m=i[p];"string"===typeof m?a.textureURL=m:a=d(m,a),a.format=p.toUpperCase(),c=!0;break}if(c)if("IMG"===a.format){var g;g=a.multiAtlasURL?new f(e,t,a.multiAtlasURL,a.multiPath,a.multiBaseURL,s).files:a.atlasURL?new n(e,t,a.textureURL,a.atlasURL,s).files:new l(e,t,a.textureURL,s),e.addFile(g)}else{var y=new v(e,t,a,s);e.addFile(y.files)}else console.warn("No supported compressed texture format or IMG fallback",t)};if(Array.isArray(e))for(var a=0;a<e.length;a++)s(this,e[a]);else s(this,e,t,i);return this}),e.exports=v},87674(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(98356),h=i(41212),u=new n({Extends:s,initialize:function(e,t,i,n,a,l){var u="ttf";if(h(t)){var c=t;t=o(c,"key"),i=o(c,"url"),n=o(c,"format","truetype"),a=o(c,"descriptors",null),l=o(c,"xhrSettings"),u=o(c,"extension",u)}else void 0===n&&(n="truetype");var d={type:"font",cache:!1,extension:u,responseType:"text",key:t,url:i,xhrSettings:l};s.call(this,e,d),this.data={format:n,descriptors:a},this.state=r.FILE_POPULATED},onProcess:function(){var e;this.state=r.FILE_PROCESSING,this.src=l(this,this.loader.baseURL);var t=this.key,i="url("+this.src+') format("'+this.data.format+'")';e=this.data.descriptors?new FontFace(t,i,this.data.descriptors):new FontFace(t,i);var n=this;e.load().then(function(){document.fonts.add(e),document.body.classList.add("fonts-loaded"),n.onProcessComplete()}).catch(function(){console.warn("Font failed to load",i),n.onProcessComplete()})}});a.register("font",function(e,t,i,n,r){if(Array.isArray(e))for(var s=0;s<e.length;s++)this.addFile(new u(this,e[s]));else this.addFile(new u(this,e,t,i,n,r));return this}),e.exports=u},47931(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(41212),h=i(73894),u=new n({Extends:s,initialize:function(e,t,i,n){var r="glsl";if(l(t)){var a=t;t=o(a,"key"),i=o(a,"url"),n=o(a,"xhrSettings"),r=o(a,"extension",r)}var h={type:"glsl",cache:e.cacheManager.shader,extension:r,responseType:"text",key:t,url:i,xhrSettings:n};s.call(this,e,h)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){this.cache.add(this.key,new h(this.key,this.data))}});a.register("glsl",function(e,t,i){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.addFile(new u(this,e[n]));else this.addFile(new u(this,e,t,i));return this}),e.exports=u},89749(e,t,i){var n=i(83419),r=i(54899),s=i(41299),a=i(95540),o=i(98356),l=i(41212),h=new n({Extends:s,initialize:function(e,t,i,n){if(l(t)){var r=t;t=a(r,"key"),n=a(r,"config",n)}var o={type:"audio",cache:e.cacheManager.audio,extension:i.type,key:t,url:i.url,config:n};s.call(this,e,o),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 e=0;e<this.data.length;e++){var t=this.data[e];t.oncanplaythrough=null,t.onerror=null}this.loader.nextFile(this,!1)},onProgress:function(e){var t=e.target;t.oncanplaythrough=null,t.onerror=null,this.filesLoaded++,this.percentComplete=Math.min(this.filesLoaded/this.filesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete),this.filesLoaded===this.filesTotal&&this.onLoad()},load:function(){this.data=[];var e=this.config&&this.config.instances||1;this.filesTotal=e,this.filesLoaded=0,this.percentComplete=0;for(var t=0;t<e;t++){var i=new Audio;i.dataset||(i.dataset={}),i.dataset.name=this.key+("0"+t).slice(-2),i.dataset.used="false",this.locked?i.dataset.locked="true":(i.dataset.locked="false",i.preload="auto",i.oncanplaythrough=this.onProgress.bind(this),i.onerror=this.onError.bind(this)),this.data.push(i)}for(t=0;t<this.data.length;t++)(i=this.data[t]).src=o(this,this.loader.baseURL),this.locked||i.load();this.locked&&setTimeout(this.onLoad.bind(this))}});e.exports=h},88470(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(41212),h=new n({Extends:s,initialize:function(e,t,i,n){var r="html";if(l(t)){var a=t;t=o(a,"key"),i=o(a,"url"),n=o(a,"xhrSettings"),r=o(a,"extension",r)}var h={type:"text",cache:e.cacheManager.html,extension:r,responseType:"text",key:t,url:i,xhrSettings:n};s.call(this,e,h)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("html",function(e,t,i){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.addFile(new h(this,e[n]));else this.addFile(new h(this,e,t,i));return this}),e.exports=h},14643(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(41212),h=new n({Extends:s,initialize:function(e,t,i,n,r,a){void 0===n&&(n=512),void 0===r&&(r=512);var h="html";if(l(t)){var u=t;t=o(u,"key"),i=o(u,"url"),a=o(u,"xhrSettings"),h=o(u,"extension",h),n=o(u,"width",n),r=o(u,"height",r)}var c={type:"html",cache:e.textureManager,extension:h,responseType:"text",key:t,url:i,xhrSettings:a,config:{width:n,height:r}};s.call(this,e,c)},onProcess:function(){this.state=r.FILE_PROCESSING;var e=this.config.width,t=this.config.height,i=[];i.push('<svg width="'+e+'px" height="'+t+'px" viewBox="0 0 '+e+" "+t+'" xmlns="http://www.w3.org/2000/svg">'),i.push('<foreignObject width="100%" height="100%">'),i.push('<body xmlns="http://www.w3.org/1999/xhtml">
2'),i.push(this.xhrLoader.responseText),i.push("</body>"),i.push("</foreignObject>"),i.push("</svg>");var n=[i.join("\n")],a=this;try{var o=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(oT){return a.state=r.FILE_ERRORED,void a.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){s.revokeObjectURL(a.data),a.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(a.data),a.onProcessError()},s.createObjectURL(this.data,o,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("htmlTexture",function(e,t,i,n,r){if(Array.isArray(e))for(var s=0;s<e.length;s++)this.addFile(new h(this,e[s]));else this.addFile(new h(this,e,t,i,n,r));return this}),e.exports=h},19550(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(41212),h=i(98356),u=new n({Extends:s,initialize:function e(t,i,n,r,a){var h,u="png";if(l(i)){var c=i;i=o(c,"key"),n=o(c,"url"),h=o(c,"normalMap"),r=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"frameConfig")}Array.isArray(n)&&(h=n[1],n=n[0]);var d={type:"image",cache:t.textureManager,extension:u,responseType:"blob",key:i,url:n,xhrSettings:r,config:a};if(s.call(this,t,d),h){var f=new e(t,this.key,h,r,a);f.type="normalMap",this.setLink(f),t.addFile(f)}this.useImageElementLoad="HTMLImageElement"===t.imageLoadType||this.base64,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var e=this;this.data.onload=function(){s.revokeObjectURL(e.data),e.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(e.data),e.onProcessError()}
vendor: 134,848 bytes, line 2
2,s.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var e=this.state;this.state=r.FILE_PROCESSING,e===r.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){this.state=r.FILE_LOADING,this.src=h(this,this.loader.baseURL),this.data=new Image,this.data.crossOrigin=this.crossOrigin;var e=this;this.data.onload=function(){e.state=r.FILE_LOADED,e.loader.nextFile(e,!0)},this.data.onerror=function(){e.loader.nextFile(e,!1)},this.data.src=this.src},addToCache:function(){var e=this.linkFile;e?e.state>=r.FILE_COMPLETE&&("spritesheet"===e.type?e.addToCache():"normalMap"===this.type?this.cache.addImage(this.key,e.data,this.data):this.cache.addImage(this.key,this.data,e.data)):this.cache.addImage(this.key,this.data)}});a.register("image",function(e,t,i){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.addFile(new u(this,e[n]));else this.addFile(new u(this,e,t,i));return this}),e.exports=u},518(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(35154),h=i(41212),u=new n({Extends:s,initialize:function(e,t,i,n,a){var u="json";if(h(t)){var c=t;t=o(c,"key"),i=o(c,"url"),n=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"dataKey",a)}var d={type:"json",cache:e.cacheManager.json,extension:u,responseType:"text",key:t,url:i,xhrSettings:n,config:a};s.call(this,e,d),h(i)&&(this.data=a?l(i,a):i,this.state=r.FILE_POPULATED)},onProcess:function(){if(this.state!==r.FILE_POPULATED){this.state=r.FILE_PROCESSING;try{var e=JSON.parse(this.xhrLoader.responseText)}catch(oT){throw this.onProcessError(),oT}var t=this.config;this.data="string"===typeof t?l(e,t,e):e}this.onProcessComplete()}});a.register("json",function(e,t,i,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)this.addFile(new u(this,e[r]));else this.addFile(new u(this,e,t,n,i));return this}),e.exports=u},59327(e,t,i){var n=i(83419),r=i(74099),s=i(95540),a=i(19550),o=i(41212),l=i(518),h=i(26430),u=new n({Extends:h,initialize:function(e,t,i,n,r,a,u){if(o(t)){var c=t;t=s(c,"key"),i=s(c,"url",!1)?s(c,"url"):s(c,"atlasURL"),a=s(c,"xhrSettings"),n=s(c,"path"),r=s(c,"baseURL"),u=s(c,"textureXhrSettings")}var d=new l(e,t,i,a);h.call(this,e,"multiatlas",t,[d]),this.config.path=n,this.config.baseURL=r,this.config.textureXhrSettings=u},onFileComplete:function(e){if(-1!==this.files.indexOf(e)&&(this.pending--,"json"===e.type&&e.data.hasOwnProperty("textures"))){var t=e.data.textures,i=this.config,n=this.loader,r=n.baseURL,o=n.path,l=n.prefix,h=s(i,"baseURL",this.baseURL),u=s(i,"path",this.path),c=s(i,"prefix",this.prefix),d=s(i,"textureXhrSettings");n.setBaseURL(h),n.setPath(u),n.setPrefix(c);for(var f=0;f<t.length;f++){var p=t[f].image,m="MA"+this.multiKeyIndex+"_"+p,g=new a(n,m,p,d);if(this.addToMultiFile(g),n.addFile(g),t[f].normalMap){var v=new a(n,m,t[f].normalMap,d);v.type="normalMap",g.setLink(v),this.addToMultiFile(v),n.addFile(v)}}n.setBaseURL(r),n.setPath(o),n.setPrefix(l)}},addToCache:function(){if(this.isReadyToProcess()){for(var e=this.files[0],t=[],i=[],n=[],r=1;r<this.files.length;r++){var s=this.files[r];if("normalMap"!==s.type)for(var a=s.key.indexOf("_"),o=s.key.substr(a+1),l=s.data,h=0;h<e.data.textures.length;h++){var u=e.data.textures[h];if(u.image===o){i.push(l),t.push(u),s.linkFile&&n.push(s.linkFile.data);break}}}0===n.length&&(n=void 0),this.loader.textureManager.addAtlasJSONArray(this.key,i,t,n),this.complete=!0}}});r.register("multiatlas",function(e,t,i,n,r){var s;if(Array.isArray(e))for(var a=0;a<e.length;a++)s=new u(this,e[a]),this.addFile(s.files);else s=new u(this,e,t,i,n,r),this.addFile(s.files);return this}),e.exports=u},99297(e,t,i){var n=i(83419),r=i(74099),s=i(95540),a=i(41212),o=i(26430),l=i(34328),h=new n({Extends:o,initialize:function(e,t,i,n){var r="js",h=[];if(a(t)){var u=t;t=s(u,"key"),i=s(u,"url"),n=s(u,"xhrSettings"),r=s(u,"extension",r)}Array.isArray(i)||(i=[i]);for(var c=0;c<i.length;c++){var d=new l(e,{key:t+"_"+c.toString(),url:i[c],extension:r,xhrSettings:n});d.onProcess=function(){this.onProcessComplete()},h.push(d)}o.call(this,e,"scripts",t,h)},addToCache:function(){if(this.isReadyToProcess()){for(var e=0;e<this.files.length;e++){var t=this.files[e];t.data=document.createElement("script"),t.data.language="javascript",t.data.type="text/javascript",t.data.defer=!1,t.data.text=t.xhrLoader.responseText,document.head.appendChild(t.data)}this.complete=!0}}});r.register("scripts",function(e,t,i){var n;if(Array.isArray(e))for(var r=0;r<e.length;r++)n=new h(this,e[r]),this.addFile(n.files);else n=new h(this,e,t,i),this.addFile(n.files);return this}),e.exports=h},11069(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(19550),h=i(41212),u=i(26430),c=i(39620),d=new n({Extends:s,initialize:function(e,t,i,n){var r={type:"pct",cache:e.cacheManager.atlas,extension:"pct",responseType:"text",key:t,url:i,xhrSettings:n};s.call(this,e,r)},onProcess:function(){this.state=r.FILE_PROCESSING;var e=c(this.xhrLoader.responseText);e?(this.data=e,this.onProcessComplete()):this.onProcessError()}}),f=new n({Extends:u,initialize:function(e,t,i,n,r,s,a){if(h(t)){var l=t;t=o(l,"key"),i=o(l,"url",!1)?o(l,"url"):o(l,"atlasURL"),s=o(l,"xhrSettings"),n=o(l,"path"),r=o(l,"baseURL"),a=o(l,"textureXhrSettings")}var c=new d(e,t,i,s);u.call(this,e,"pctatlas",t,[c]),this.config.path=n,this.config.baseURL=r,this.config.textureXhrSettings=a},onFileComplete:function(e){if(-1!==this.files.indexOf(e)&&(this.pending--,"pct"===e.type&&e.data&&Array.isArray(e.data.pages))){var t=e.data.pages,i=this.config,n=this.loader,r=n.baseURL,s=n.path,a=n.prefix,h=o(i,"baseURL",this.baseURL),u=o(i,"path",this.path),c=o(i,"prefix",this.prefix),d=o(i,"textureXhrSettings");n.setBaseURL(h),n.setPath(u),n.setPrefix(c);for(var f=0;f<t.length;f++){var p=t[f].filename,m="PCT"+this.multiKeyIndex+"_"+p,g=new l(n,m,p,d);this.addToMultiFile(g),n.addFile(g)}n.setBaseURL(r),n.setPath(s),n.setPrefix(a)}},addToCache:function(){if(this.isReadyToProcess()){for(var e=this.files[0].data,t=e.pages,i="PCT"+this.multiKeyIndex+"_",n={},r=1;r<this.files.length;r++){var s=this.files[r],a=s.key,o=a.indexOf(i);n[o>=0?a.substring(o+i.length):a]=s.data}for(var l=[],h=0;h<t.length;h++){var u=n[t[h].filename];u&&l.push(u)}this.loader.cacheManager.atlas.add(this.key,e),this.loader.textureManager.addAtlasPCT(this.key,l,e),this.complete=!0}}});a.register("atlasPCT",function(e,t,i,n,r){var s;if(Array.isArray(e))for(var a=0;a<e.length;a++)s=new f(this,e[a]),this.addFile(s.files);else s=new f(this,e,t,i,n,r),this.addFile(s.files);return this}),e.exports=f},58610(e,t,i){var n=i(83419),r=i(23906),s=i(74099),a=i(518),o=new n({Extends:a,initialize:function(e,t,i,n,r){a.call(this,e,t,i,n,r),this.type="packfile"},onProcess:function(){if(this.state!==r.FILE_POPULATED&&(this.state=r.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.data.hasOwnProperty("files")&&this.config){var e={};e[this.config]=this.data,this.data=e}this.loader.addPack(this.data,this.config),this.onProcessComplete()}});s.register("pack",function(e,t,i,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)this.addFile(new o(this,e[r]));else this.addFile(new o(this,e,t,n,i));return this}),e.exports=o},48988(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(41212),h=new n({Extends:s,initialize:function(e,t,i,n,a,h){var u="js";if(l(t)){var c=t;t=o(c,"key"),i=o(c,"url"),h=o(c,"xhrSettings"),u=o(c,"extension",u),n=o(c,"start"),a=o(c,"mapping")}var d={type:"plugin",cache:!1,extension:u,responseType:"text",key:t,url:i,xhrSettings:h,config:{start:n,mapping:a}};s.call(this,e,d),"function"===typeof i&&(this.data=i,this.state=r.FILE_POPULATED)},onProcess:function(){var e=this.loader.systems.plugins,t=this.config,i=o(t,"start",!1),n=o(t,"mapping",null);if(this.state===r.FILE_POPULATED)e.install(this.key,this.data,i,n);else{this.state=r.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 s=e.install(this.key,window[this.key],i,n);(i||n)&&(this.loader.systems[n]=s,this.loader.scene[n]=s)}this.onProcessComplete()}});a.register("plugin",function(e,t,i,n,r){if(Array.isArray(e))for(var s=0;s<e.length;s++)this.addFile(new h(this,e[s]));else this.addFile(new h(this,e,t,i,n,r));return this}),e.exports=h},67397(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(41212),h=new n({Extends:s,initialize:function(e,t,i,n,r){var a="svg";if(l(t)){var h=t;t=o(h,"key"),i=o(h,"url"),n=o(h,"svgConfig",{}),r=o(h,"xhrSettings"),a=o(h,"extension",a)}var u={type:"svg",cache:e.textureManager,extension:a,responseType:"text",key:t,url:i,xhrSettings:r,config:{width:o(n,"width"),height:o(n,"height"),scale:o(n,"scale")}};s.call(this,e,u)},onProcess:function(){this.state=r.FILE_PROCESSING;var e=this.xhrLoader.responseText,t=[e],i=this.config.width,n=this.config.height,a=this.config.scale;e:if(i&&n||a){var o=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("svg")[0],l=o.hasAttribute("viewBox"),h=parseFloat(o.getAttribute("width")),u=parseFloat(o.getAttribute("height"));if(!l&&h&&u)o.setAttribute("viewBox","0  0 "+h+" "+u);else if(l&&!h&&!u){var c=o.getAttribute("viewBox").split(/\s+|,/);h=c[2],u=c[3]}if(a){if(!h||!u)break e;i=h*a,n=u*a}o.setAttribute("width",i.toString()+"px"),o.setAttribute("height",n.toString()+"px"),t=[(new XMLSerializer).serializeToString(o)]}try{var d=new window.Blob(t,{type:"image/svg+xml;charset=utf-8"})}catch(oT){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var f=this,p=!1;this.data.onload=function(){p||s.revokeObjectURL(f.data),f.onProcessComplete()},this.data.onerror=function(){p?f.onProcessError():(p=!0,s.revokeObjectURL(f.data),f.data.src="data:image/svg+xml,"+encodeURIComponent(t.join("")))},s.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("svg",function(e,t,i,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)this.addFile(new h(this,e[r]));else this.addFile(new h(this,e,t,i,n));return this}),e.exports=h},88423(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(41212),h=new n({Extends:s,initialize:function(e,t,i,n){var r="js";if(l(t)){var a=t;t=o(a,"key"),i=o(a,"url"),n=o(a,"xhrSettings"),r=o(a,"extension",r)}var h={type:"text",extension:r,responseType:"text",key:t,url:i,xhrSettings:n};s.call(this,e,h)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var e=this.data.concat("(function(){\nreturn new "+this.key+"();\n}).call(this);"),t=eval;this.loader.sceneManager.add(this.key,t(e)),this.complete=!0}});a.register("sceneFile",function(e,t,i){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.addFile(new h(this,e[n]));else this.addFile(new h(this,e,t,i));return this}),e.exports=h},56812(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(41212),h=new n({Extends:s,initialize:function(e,t,i,n,a,h){var u="js";if(l(t)){var c=t;t=o(c,"key"),i=o(c,"url"),h=o(c,"xhrSettings"),u=o(c,"extension",u),n=o(c,"systemKey"),a=o(c,"sceneKey")}var d={type:"scenePlugin",cache:!1,extension:u,responseType:"text",key:t,url:i,xhrSettings:h,config:{systemKey:n,sceneKey:a}};s.call(this,e,d),"function"===typeof i&&(this.data=i,this.state=r.FILE_POPULATED)},onProcess:function(){var e=this.loader.systems.plugins,t=this.config,i=this.key,n=o(t,"systemKey",i),s=o(t,"sceneKey",i);this.state===r.FILE_POPULATED?e.installScenePlugin(n,this.data,s,this.loader.scene,!0):(this.state=r.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),e.installScenePlugin(n,window[this.key],s,this.loader.scene,!0)),this.onProcessComplete()}});a.register("scenePlugin",function(e,t,i,n,r){if(Array.isArray(e))for(var s=0;s<e.length;s++)this.addFile(new h(this,e[s]));else this.addFile(new h(this,e,t,i,n,r));return this}),e.exports=h},34328(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(41212),h=new n({Extends:s,initialize:function(e,t,i,n,r){var a="js";if(l(t)){var h=t;t=o(h,"key"),i=o(h,"url"),n=o(h,"type","script"),r=o(h,"xhrSettings"),a=o(h,"extension",a)}else void 0===n&&(n="script");var u={type:n,cache:!1,extension:a,responseType:"text",key:t,url:i,xhrSettings:r};s.call(this,e,u)},onProcess:function(){this.state=r.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(e,t,i,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)this.addFile(new h(this,e[r]));else this.addFile(new h(this,e,t,i,n));return this}),e.exports=h},85035(e,t,i){var n=i(83419),r=i(23906),s=i(74099),a=i(19550),o=new n({Extends:a,initialize:function(e,t,i,n,r){a.call(this,e,t,i,r,n),this.type="spritesheet"},addToCache:function(){var e=this.linkFile;e?e.state>=r.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addSpriteSheet(this.key,e.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,e.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});s.register("spritesheet",function(e,t,i,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)this.addFile(new o(this,e[r]));else this.addFile(new o(this,e,t,i,n));return this}),e.exports=o},78776(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(41212),h=new n({Extends:s,initialize:function(e,t,i,n){var r="text",a="txt",h=e.cacheManager.text;if(l(t)){var u=t;t=o(u,"key"),i=o(u,"url"),n=o(u,"xhrSettings"),a=o(u,"extension",a),r=o(u,"type",r),h=o(u,"cache",h)}var c={type:r,cache:h,extension:a,responseType:"text",key:t,url:i,xhrSettings:n};s.call(this,e,c)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",function(e,t,i){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.addFile(new h(this,e[n]));else this.addFile(new h(this,e,t,i));return this}),e.exports=h},49477(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(41212),h=i(80341),u=new n({Extends:s,initialize:function(e,t,i,n){var r="csv";if(l(t)){var a=t;t=o(a,"key"),i=o(a,"url"),n=o(a,"xhrSettings"),r=o(a,"extension",r)}var u={type:"tilemapCSV",cache:e.cacheManager.tilemap,extension:r,responseType:"text",key:t,url:i,xhrSettings:n};s.call(this,e,u),this.tilemapFormat=h.CSV},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var e={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,e)}});a.register("tilemapCSV",function(e,t,i){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.addFile(new u(this,e[n]));else this.addFile(new u(this,e,t,i));return this}),e.exports=u},40807(e,t,i){var n=i(83419),r=i(74099),s=i(518),a=i(80341),o=new n({Extends:s,initialize:function(e,t,i,n){s.call(this,e,t,i,n),this.type="tilemapJSON",this.cache=e.cacheManager.tilemap},addToCache:function(){var e={format:a.WELTMEISTER,data:this.data};this.cache.add(this.key,e)}});r.register("tilemapImpact",function(e,t,i){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.addFile(new o(this,e[n]));else this.addFile(new o(this,e,t,i));return this}),e.exports=o},56775(e,t,i){var n=i(83419),r=i(74099),s=i(518),a=i(80341),o=new n({Extends:s,initialize:function(e,t,i,n){s.call(this,e,t,i,n),this.type="tilemapJSON",this.cache=e.cacheManager.tilemap},addToCache:function(){var e={format:a.TILED_JSON,data:this.data};this.cache.add(this.key,e)}});r.register("tilemapTiledJSON",function(e,t,i){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.addFile(new o(this,e[n]));else this.addFile(new o(this,e,t,i));return this}),e.exports=o},25771(e,t,i){var n=i(83419),r=i(74099),s=i(95540),a=i(19550),o=i(41212),l=i(26430),h=i(78776),u=new n({Extends:l,initialize:function(e,t,i,n,r,u){var c,d;if(o(t)){var f=t;t=s(f,"key"),c=new a(e,{key:t,url:s(f,"textureURL"),extension:s(f,"textureExtension","png"),normalMap:s(f,"normalMap"),xhrSettings:s(f,"textureXhrSettings")}),d=new h(e,{key:t,url:s(f,"atlasURL"),extension:s(f,"atlasExtension","txt"),xhrSettings:s(f,"atlasXhrSettings")})}else c=new a(e,t,i,r),d=new h(e,t,n,u);c.linkFile?l.call(this,e,"unityatlas",t,[c,d,c.linkFile]):l.call(this,e,"unityatlas",t,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var e=this.files[0],t=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(e.key,e.data,t.data,i),this.complete=!0}}});r.register("unityAtlas",function(e,t,i,n,r){var s;if(Array.isArray(e))for(var a=0;a<e.length;a++)s=new u(this,e[a]),this.addFile(s.files);else s=new u(this,e,t,i,n,r),this.addFile(s.files);return this}),e.exports=u},33720(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(98356),l=i(95540),h=i(41212),u=new n({Extends:s,initialize:function(e,t,i,n){if(void 0===n&&(n=!1),h(t)){var r=t;t=l(r,"key"),i=l(r,"url",[]),n=l(r,"noAudio",!1)}var a=e.systems.game.device.video.getVideoURL(i);a||console.warn("VideoFile: No supported format for "+t);var o={type:"video",cache:e.cacheManager.video,extension:a.type,key:t,url:a.url,config:{noAudio:n}};s.call(this,e,o)},onProcess:function(){this.data={url:this.src,noAudio:this.config.noAudio,crossOrigin:this.crossOrigin},this.onProcessComplete()},load:function(){this.src=o(this,this.loader.baseURL),this.state=r.FILE_LOADED,this.loader.nextFile(this,!0)}});a.register("video",function(e,t,i){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.addFile(new u(this,e[n]));else this.addFile(new u(this,e,t,i));return this}),e.exports=u},57318(e,t,i){var n=i(83419),r=i(23906),s=i(41299),a=i(74099),o=i(95540),l=i(41212),h=i(56836),u=new n({Extends:s,initialize:function(e,t,i,n){var r="xml";if(l(t)){var a=t;t=o(a,"key"),i=o(a,"url"),n=o(a,"xhrSettings"),r=o(a,"extension",r)}var h={type:"xml",cache:e.cacheManager.xml,extension:r,responseType:"text",key:t,url:i,xhrSettings:n};s.call(this,e,h)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=h(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});a.register("xml",function(e,t,i){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.addFile(new u(this,e[n]));else this.addFile(new u(this,e,t,i));return this}),e.exports=u},64589(e,t,i){e.exports={AnimationJSONFile:i(14135),AsepriteFile:i(76272),AtlasJSONFile:i(38734),AtlasXMLFile:i(74599),AudioFile:i(21097),AudioSpriteFile:i(89524),BinaryFile:i(85722),BitmapFontFile:i(97025),CompressedTextureFile:i(69559),CSSFile:i(16024),FontFile:i(87674),GLSLFile:i(47931),HTML5AudioFile:i(89749),HTMLFile:i(88470),HTMLTextureFile:i(14643),ImageFile:i(19550),JSONFile:i(518),MultiAtlasFile:i(59327),MultiScriptFile:i(99297),PackFile:i(58610),PCTAtlasFile:i(11069),PluginFile:i(48988),SceneFile:i(88423),ScenePluginFile:i(56812),ScriptFile:i(34328),SpriteSheetFile:i(85035),SVGFile:i(67397),TextFile:i(78776),TilemapCSVFile:i(49477),TilemapImpactFile:i(40807),TilemapJSONFile:i(56775),UnityAtlasFile:i(25771),VideoFile:i(33720),XMLFile:i(57318)}},57777(e,t,i){var n=i(23906),r=i(79291),s={Events:i(54899),FileTypes:i(64589),File:i(41299),FileTypesManager:i(74099),GetURL:i(98356),LoaderPlugin:i(74261),MergeXHRSettings:i(3374),MultiFile:i(26430),XHRLoader:i(84376),XHRSettings:i(92638)};s=r(!1,s,n),e.exports=s},53307(e){e.exports=function(e){for(var t=0,i=0;i<e.length;i++)t+=+e[i];return t/e.length}},85710(e,t,i){var n=i(6411);e.exports=function(e,t){return n(e)/n(t)/n(e-t)}},30976(e){e.exports=function(e,t){return Math.floor(Math.random()*(t-e+1)+e)}},87842(e){e.exports=function(e,t,i,n,r){var s=.5*(n-t),a=.5*(r-i),o=e*e;return(2*i-2*n+s+a)*(e*o)+(-3*i+3*n-2*s-a)*o+s*e+i}},26302(e){e.exports=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=10);var n=Math.pow(i,-t);return Math.ceil(e*n)/n}},45319(e){e.exports=function(e,t,i){return Math.max(t,Math.min(i,e))}},39506(e,t,i){var n=i(36383);e.exports=function(e){return e*n.DEG_TO_RAD}},61241(e){e.exports=function(e,t){return Math.abs(e-t)}},38857(e,t,i){var n=i(45319),r=i(83419),s=i(37867),a=i(29747),o=new s,l=new r({initialize:function e(t,i,n,r){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=e.DefaultOrder),this._x=t,this._y=i,this._z=n,this._order=r,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(e){this._order=e,this.onChangeCallback(this)}},set:function(e,t,i,n){return void 0===n&&(n=this._order),this._x=e,this._y=t,this._z=i,this._order=n,this.onChangeCallback(this),this},copy:function(e){return this.set(e.x,e.y,e.z,e.order)},setFromQuaternion:function(e,t,i){return void 0===t&&(t=this._order),void 0===i&&(i=!1),o.fromQuat(e),this.setFromRotationMatrix(o,t,i)},setFromRotationMatrix:function(e,t,i){void 0===t&&(t=this._order),void 0===i&&(i=!1);var r=e.val,s=r[0],a=r[4],o=r[8],l=r[1],h=r[5],u=r[9],c=r[2],d=r[6],f=r[10],p=0,m=0,g=0,v=.99999;switch(t){case"XYZ":m=Math.asin(n(o,-1,1)),Math.abs(o)<v?(p=Math.atan2(-u,f),g=Math.atan2(-a,s)):p=Math.atan2(d,h);break;case"YXZ":p=Math.asin(-n(u,-1,1)),Math.abs(u)<v?(m=Math.atan2(o,f),g=Math.atan2(l,h)):m=Math.atan2(-c,s);break;case"ZXY":p=Math.asin(n(d,-1,1)),Math.abs(d)<v?(m=Math.atan2(-c,f),g=Math.atan2(-a,h)):g=Math.atan2(l,s);break;case"ZYX":m=Math.asin(-n(c,-1,1)),Math.abs(c)<v?(p=Math.atan2(d,f),g=Math.atan2(l,s)):g=Math.atan2(-a,h);break;case"YZX":g=Math.asin(n(l,-1,1)),Math.abs(l)<v?(p=Math.atan2(-u,h),m=Math.atan2(-c,s)):m=Math.atan2(o,f);break;case"XZY":g=Math.asin(-n(a,-1,1)),Math.abs(a)<v?(p=Math.atan2(d,h),m=Math.atan2(o,s)):p=Math.atan2(-u,f)}return this._x=p,this._y=m,this._z=g,this._order=t,i&&this.onChangeCallback(this),this}});l.RotationOrders=["XYZ","YXZ","ZXY","ZYX","YZX","XZY"],l.DefaultOrder="XYZ",e.exports=l},6411(e){e.exports=function(e){if(0===e)return 1;for(var t=e;--e;)t*=e;return t}},99472(e){e.exports=function(e,t){return Math.random()*(t-e)+e}},77623(e){e.exports=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=10);var n=Math.pow(i,-t);return Math.floor(e*n)/n}},62945(e,t,i){var n=i(45319);e.exports=function(e,t,i){return(i-t)*(e=n(e,0,1))+t}},2672(e,t,i){var n=i(26099);e.exports=function(e,t){void 0===t&&(t=new n);var i=e.length;if(!Array.isArray(e)||0===i)throw new Error("GetCentroid points be a non-empty array");if(1===i)t.x=e[0].x,t.y=e[0].y;else{for(var r=0;r<i;r++)t.x+=e[r].x,t.y+=e[r].y;t.x/=i,t.y/=i}return t}},38265(e){e.exports=function(e,t){return e/t/1e3}},55133(e,t,i){var n=i(87841);e.exports=function(e,t){void 0===t&&(t=new n);for(var i=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,o=0;o<e.length;o++){var l=e[o];l.x>i&&(i=l.x),l.x<r&&(r=l.x),l.y>s&&(s=l.y),l.y<a&&(a=l.y)}return t.x=r,t.y=a,t.width=i-r,t.height=s-a,t}},72958(e,t,i){var n=i(26099),r=i(25836),s=i(61369),a=new n,o=new r,l=new s,h=new n(12.9898,78.233),u=new r(12.9898,78.233,9441.8953),c=new s(12.9898,78.233,9441.8953,61.99),d=function(e){var t;switch(e.length){case 4:l.set(e[0],e[1],e[2],e[3]),t=43757.5453*Math.sin(l.dot(c));break;case 3:o.set(e[0],e[1],e[2]),t=43757.5453*Math.sin(o.dot(u));break;case 2:a.set(e[0],e[1]),t=43757.5453*Math.sin(a.dot(h));break;default:t=43757.5453*Math.sin(12.9898*e[0])}return t-Math.floor(t)},f=Math.pow(2,32),p=function(e,t){var i;switch(e.length){case 4:i=19*e[0]+47*e[1]+101*e[2]+173*e[3];break;case 3:i=19*e[0]+47*e[1]+101*e[2];break;case 2:i=19*e[0]+47*e[1];break;default:i=19*e[0]}t&&(i*=Math.pow(2,32-Math.floor(Math.log2(i))));var n=747796405*(i>>>0)+2891336453,r=277803737*(n>>>(n>>>28)+4^n),s=(r>>>22^r)>>>0;return s/=f};e.exports=function(e,t){switch("number"===typeof e&&(e=[e]),t){case 2:return p(e,!0);case 1:return p(e);default:return d(e)}}},84854(e,t,i){var n=i(72958),r=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],s=Array(4),a=Array(4),o=Array(4),l=Array(4),h=Array(4),u=Array(4),c=function(e,t,i){var n,r,l,h,u=t.noiseMode||0,c=void 0===t.noiseSmoothing?1:t.noiseSmoothing,p=Math.max(1,Math.min(e.length,4)),m=t.noiseCells||[32,32,32,32].slice(0,p);for(n=0;n<p;n++){var g=e[n]*i*m[n];s[n]=Math.floor(g),a[n]=g%1}var v=0,y=0;0!==u&&1!==u||(v=4*p);var x=Math.pow(3,p);for(h=0;h<x;h++)switch(o[0]=h%3-1,p>1&&(o[1]=Math.floor(h/3)%3-1,p>2&&(o[2]=Math.floor(h/9)%3-1,p>3&&(o[3]=Math.floor(h/27)%3-1))),r=d(p,s,o,t,i),l=f(p,o,a,r),u){case 0:l<v&&(v=l);break;case 1:l<v&&(v=l,y=r[0]);break;case 2:l=Math.sqrt(l),v+=Math.pow(2,-32/c*l)}return 0===u?Math.sqrt(v):1===u?y:-1/32*c*Math.log2(v)},d=function(e,t,i,s,a){var o,u,c=s.noiseWrap?s.noiseWrap:s.noiseCells||[32,32,32,32],d=s.noiseSeed?s.noiseSeed:r;for(o=0;o<e;o++)l[o]=(t[o]+i[o])%(c[o]*a);for(o=0;o<e;o++){var f=Array(e);for(u=0;u<e;u++)f[u]=l[u]+d[o*e+u];h[o]=n(f,s.algorithm)}return h},f=function(e,t,i,n){var r;for(r=0;r<e;r++)u[r]=t[r]-i[r]+n[r];var s=0;for(r=0;r<e;r++)s+=u[r]*u[r];return s};e.exports=function(e,t){"number"===typeof e&&(e=[e]),t||(t={});for(var i=0,n=t.noiseIterations||1,r=0;r<n;r++){var s=Math.pow(2,r);i+=(c(e,t,s)-.5)/s}return i+.5}},84366(e){var t=[0,0,0],i=[0,0,0],n=[0,0,0],r=[11.3,23.7,13.1],s=[29.9,2.3,31.7],a=[0,0,0],o=function(e,t,r,s,a,o,l){for(var h,u=0,c=0,d=s.noiseCells||[32,32,32],f=s.noisePeriod||d,p=s.noiseFlow||0,m=0;m<e;m++){var g=Math.pow(a,m),v=Math.pow(o,m);for(h=0;h<t;h++)i[h]=(r[h]+m)*g;for(h=0;h<t;h++)n[h]=f[h]*g;2===t?c=D(i,n,p*v+m):3===t&&(c=Me(i,n,p*v+m)),u+=c/Math.pow(l,m)}return u},l={x:0,y:0},h={x:0,y:0},u={x:0,y:0},c={x:0,y:0},d={x:0,y:0},f={x:0,y:0},p={x:0,y:0},m={x:0,y:0},g={x:0,y:0},v={x:0,y:0},y={x:0,y:0},x={x:0,y:0},b=[0,0,0],w=[0,0,0],T=[0,0,0],_=[0,0,0],S=[0,0,0],E=[0,0,0],C=[0,0,0],A=[0,0,0],k={x:0,y:0},R={x:0,y:0},O={x:0,y:0},P=[0,0,0],M=[0,0,0],N=[0,0,0],I=[0,0,0];function L(e,t){return e.x*t.x+e.y*t.y}var D=function(e,t,i){var n,r=l,s=h,o=u,D=c,F=d,B=f,U=p,z=m,V=g,H=v,j=y,Y=x,W=b,G=w,X=T,q=_,K=S,Q=E,J=C,Z=A,$=k,ee=R,te=O,ie=P,ne=M,re=N,se=I,ae=e[0],oe=e[1];r.x=ae+.5*oe,r.y=oe,s.x=Math.floor(r.x),s.y=Math.floor(r.y),o.x=r.x-s.x,o.y=r.y-s.y;var le=o.y<=o.x?1:0;if(D.x=le,D.y=1-le,F.x=s.x+D.x,F.y=s.y+D.y,B.x=s.x+1,B.y=s.y+1,U.x=s.x-.5*s.y,U.y=s.y,z.x=U.x+D.x-.5*D.y,z.y=U.y+D.y,V.x=U.x+.5,V.y=U.y+1,H.x=ae-U.x,H.y=oe-U.y,j.x=ae-z.x,j.y=oe-z.y,Y.x=ae-V.x,Y.y=oe-V.y,t[0]>0||t[1]>0)for(X[0]=U.x,X[1]=z.x,X[2]=V.x,q[0]=U.y,q[1]=z.y,q[2]=V.y,t[0]>0&&(X[0]=(U.x%t[0]+t[0])%t[0],X[1]=(z.x%t[0]+t[0])%t[0],X[2]=(V.x%t[0]+t[0])%t[0]),t[1]>0&&(q[0]=(U.y%t[1]+t[1])%t[1],q[1]=(z.y%t[1]+t[1])%t[1],q[2]=(V.y%t[1]+t[1])%t[1]),n=0;n<3;n++)W[n]=Math.floor(X[n]+.5*q[n]+.5),G[n]=Math.floor(q[n]+.5);else W[0]=s.x,W[1]=F.x,W[2]=B.x,G[0]=s.y,G[1]=F.y,G[2]=B.y;for(W[0]+=a[0],W[1]+=a[0],W[2]+=a[0],G[0]+=a[1],G[1]+=a[1],G[2]+=a[1],n=0;n<3;n++)K[n]=W[n]%289,K[n]<0&&(K[n]+=289);for(n=0;n<3;n++)K[n]=((51*K[n]+2)*K[n]+G[n])%289;for(n=0;n<3;n++)K[n]=(34*K[n]+10)*K[n]%289;for(n=0;n<3;n++)Q[n]=.07482*K[n]+i,J[n]=Math.cos(Q[n]),Z[n]=Math.sin(Q[n]);for($.x=J[0],$.y=Z[0],ee.x=J[1],ee.y=Z[1],te.x=J[2],te.y=Z[2],ie[0]=.8-L(H,H),ie[1]=.8-L(j,j),ie[2]=.8-L(Y,Y),n=0;n<3;n++)ie[n]=Math.max(ie[n],0),ne[n]=ie[n]*ie[n],re[n]=ne[n]*ne[n];return se[0]=L($,H),se[1]=L(ee,j),se[2]=L(te,Y),10.9*(re[0]*se[0]+re[1]*se[1]+re[2]*se[2])},F=[0,0,0],B=[0,0,0],U=[0,0,0],z=[0,0,0],V=[0,0,0],H=[0,0,0],j=[0,0,0],Y=[0,0,0],W=[0,0,0],G=[0,0,0],X=[0,0,0],q=[0,0,0],K=[0,0,0],Q=[0,0,0],J=[0,0,0],Z=[0,0,0],$=[0,0,0],ee=[0,0,0],te=[0,0,0],ie=[0,0,0],ne=[0,0,0,0],re=[0,0,0,0],se=[0,0,0,0],ae=[0,0,0,0],oe=[0,0,0,0],le=[0,0,0,0],he=[0,0,0,0],ue=[0,0,0,0],ce=[0,0,0,0],de=[0,0,0,0],fe=[0,0,0,0],pe=[0,0,0,0],me=[0,0,0,0],ge=[0,0,0,0],ve=[0,0,0,0],ye=[0,0,0,0],xe=[0,0,0,0],be=[0,0,0,0],we=[0,0,0,0],Te=[0,0,0,0],_e=[0,0,0,0],Se=[0,0,0,0],Ee=[0,0,0,0],Ce=[0,0,0,0],Ae=[0,0,0,0],ke=[0,0,0,0],Re=[0,0,0,0],Oe=[0,0,0,0],Pe=function(e,t){for(var i=0;i<4;i++){var n=e[i]%289;n<0&&(n+=289),t[i]=(34*n+10)*n%289}},Me=function(e,t,i){var n=F,r=B,s=U,o=z,l=V,h=H,u=j,c=Y,d=W,f=G,p=X,m=q,g=K,v=Q,y=J,x=Z,b=$,w=ee,T=te,_=ie,S=ne,E=re,C=se,A=ae,k=oe,R=le,O=he,P=ue,M=ce,N=de,I=fe,L=pe,D=me,Me=ge,Ne=ve,Ie=ye,Le=xe,De=be,Fe=we,Be=Te,Ue=_e,ze=Se,Ve=Ee,He=Ce,je=Ae,Ye=ke,We=Re,Ge=Oe;n[0]=0*e[0]+1*e[1]+1*e[2],n[1]=1*e[0]+0*e[1]+1*e[2],n[2]=1*e[0]+1*e[1]+0*e[2];for(var Xe=0;Xe<3;Xe++)r[Xe]=Math.floor(n[Xe]),s[Xe]=n[Xe]-r[Xe];for(o[0]=s[0]>s[1]?0:1,o[1]=s[1]>s[2]?0:1,o[2]=s[0]>s[2]?0:1,l[0]=1-o[0],l[1]=1-o[1],l[2]=1-o[2],h[0]=l[2],h[1]=o[0],h[2]=o[1],u[0]=l[0],u[1]=l[1],u[2]=o[2],Xe=0;Xe<3;Xe++)c[Xe]=Math.min(h[Xe],u[Xe]),d[Xe]=Math.max(h[Xe],u[Xe]);for(Xe=0;Xe<3;Xe++)f[Xe]=r[Xe]+c[Xe],p[Xe]=r[Xe]+d[Xe],m[Xe]=r[Xe]+1;var qe=r[0],Ke=r[1],Qe=r[2],Je=f[0],Ze=f[1],$e=f[2],et=p[0],tt=p[1],it=p[2],nt=m[0],rt=m[1],st=m[2];for(g[0]=-.5*qe+.5*Ke+.5*Qe,g[1]=.5*qe-.5*Ke+.5*Qe,g[2]=.5*qe+.5*Ke-.5*Qe,v[0]=-.5*Je+.5*Ze+.5*$e,v[1]=.5*Je-.5*Ze+.5*$e,v[2]=.5*Je+.5*Ze-.5*$e,y[0]=-.5*et+.5*tt+.5*it,y[1]=.5*et-.5*tt+.5*it,y[2]=.5*et+.5*tt-.5*it,x[0]=-.5*nt+.5*rt+.5*st,x[1]=.5*nt-.5*rt+.5*st,x[2]=.5*nt+.5*rt-.5*st,Xe=0;Xe<3;Xe++)b[Xe]=e[Xe]-g[Xe],w[Xe]=e[Xe]-v[Xe],T[Xe]=e[Xe]-y[Xe],_[Xe]=e[Xe]-x[Xe];if(t[0]>0||t[1]>0||t[2]>0){if(S[0]=g[0],S[1]=v[0],S[2]=y[0],S[3]=x[0],E[0]=g[1],E[1]=v[1],E[2]=y[1],E[3]=x[1],C[0]=g[2],C[1]=v[2],C[2]=y[2],C[3]=x[2],t[0]>0)for(Xe=0;Xe<4;Xe++)S[Xe]=(S[Xe]%t[0]+t[0])%t[0];if(t[1]>0)for(Xe=0;Xe<4;Xe++)E[Xe]=(E[Xe]%t[1]+t[1])%t[1];if(t[2]>0)for(Xe=0;Xe<4;Xe++)C[Xe]=(C[Xe]%t[2]+t[2])%t[2];var at=S[0],ot=E[0],lt=C[0],ht=S[1],ut=E[1],ct=C[1],dt=S[2],ft=E[2],pt=C[2],mt=S[3],gt=E[3],vt=C[3];r[0]=Math.floor(0*at+1*ot+1*lt+.5),r[1]=Math.floor(1*at+0*ot+1*lt+.5),r[2]=Math.floor(1*at+1*ot+0*lt+.5),f[0]=Math.floor(0*ht+1*ut+1*ct+.5),f[1]=Math.floor(1*ht+0*ut+1*ct+.5),f[2]=Math.floor(1*ht+1*ut+0*ct+.5),p[0]=Math.floor(0*dt+1*ft+1*pt+.5),p[1]=Math.floor(1*dt+0*ft+1*pt+.5),p[2]=Math.floor(1*dt+1*ft+0*pt+.5),m[0]=Math.floor(0*mt+1*gt+1*vt+.5),m[1]=Math.floor(1*mt+0*gt+1*vt+.5),m[2]=Math.floor(1*mt+1*gt+0*vt+.5)}r[0]+=a[0],r[1]+=a[1],r[2]+=a[2],f[0]+=a[0],f[1]+=a[1],f[2]+=a[2],p[0]+=a[0],p[1]+=a[1],p[2]+=a[2],m[0]+=a[0],m[1]+=a[1],m[2]+=a[2];var yt=ne,xt=re;for(yt[0]=r[2],yt[1]=f[2],yt[2]=p[2],yt[3]=m[2],Pe(yt,xt),xt[0]+=r[1],xt[1]+=f[1],xt[2]+=p[1],xt[3]+=m[1],Pe(xt,yt),yt[0]+=r[0],yt[1]+=f[0],yt[2]+=p[0],yt[3]+=m[0],Pe(yt,A),Xe=0;Xe<4;Xe++)k[Xe]=3.883222077*A[Xe],R[Xe]=.996539792-.006920415*A[Xe],O[Xe]=.108705628*A[Xe],P[Xe]=Math.cos(k[Xe]),M[Xe]=Math.sin(k[Xe]),N[Xe]=Math.sqrt(Math.max(0,1-R[Xe]*R[Xe]));if(0!==i)for(Xe=0;Xe<4;Xe++)Me[Xe]=P[Xe]*N[Xe],Ne[Xe]=M[Xe]*N[Xe],Ie[Xe]=R[Xe],Le[Xe]=Math.sin(O[Xe]),De[Xe]=Math.cos(O[Xe]),Fe[Xe]=M[Xe]*Le[Xe]-P[Xe]*De[Xe],Be[Xe]=(1-R[Xe])*(Fe[Xe]*M[Xe])+R[Xe]*Le[Xe],Ue[Xe]=(1-R[Xe])*(-Fe[Xe]*P[Xe])+R[Xe]*De[Xe],ze[Xe]=-(Ne[Xe]*De[Xe]+Me[Xe]*Le[Xe]),Ve[Xe]=Math.sin(i),He[Xe]=Math.cos(i),I[Xe]=He[Xe]*Me[Xe]+Ve[Xe]*Be[Xe],L[Xe]=He[Xe]*Ne[Xe]+Ve[Xe]*Ue[Xe],D[Xe]=He[Xe]*Ie[Xe]+Ve[Xe]*ze[Xe];else for(Xe=0;Xe<4;Xe++)I[Xe]=P[Xe]*N[Xe],L[Xe]=M[Xe]*N[Xe],D[Xe]=R[Xe];for(Xe=0;Xe<4;Xe++){var bt=0===Xe?b[0]:1===Xe?w[0]:2===Xe?T[0]:_[0],wt=0===Xe?b[1]:1===Xe?w[1]:2===Xe?T[1]:_[1],Tt=0===Xe?b[2]:1===Xe?w[2]:2===Xe?T[2]:_[2],_t=bt*bt+wt*wt+Tt*Tt;je[Xe]=.5-_t,je[Xe]<0&&(je[Xe]=0),Ye[Xe]=je[Xe]*je[Xe],We[Xe]=Ye[Xe]*je[Xe]}for(Xe=0;Xe<4;Xe++){var St=I[Xe],Et=L[Xe],Ct=D[Xe],At=0===Xe?b[0]:1===Xe?w[0]:2===Xe?T[0]:_[0],kt=0===Xe?b[1]:1===Xe?w[1]:2===Xe?T[1]:_[1],Rt=0===Xe?b[2]:1===Xe?w[2]:2===Xe?T[2]:_[2];Ge[Xe]=St*At+Et*kt+Ct*Rt}var Ot=0;for(Xe=0;Xe<4;Xe++)Ot+=We[Xe]*Ge[Xe];return 39.5*Ot};e.exports=function(e,n){"number"===typeof e&&(e=[e]),n||(n={});for(var l=Math.min(3,e.length);l<2;)e.push(0),l++;var h=n.noiseIterations||1,u=n.noiseWarpIterations||1,c=n.noiseDetailPower||2,d=n.noiseFlowPower||2,f=n.noiseContributionPower||2,p=n.noiseWarpDetailPower||2,m=n.noiseWarpFlowPower||2,g=n.noiseWarpContributionPower||2,v=n.noiseCells||[32,32,32],y=n.noiseOffset||[0,0,0],x=n.noiseWarpAmount||0;if(n.noiseSeed)for(var b=[1,2,3],w=0;w<l;w++)a[w]=void 0===n.noiseSeed[w]?b[w]:n.noiseSeed[w];for(w=0;w<l;w++)t[w]=e[w]*v[w]+y[w];if(x>0&&u>0&&l>=2)if(2===l){var T=o(u,2,t,n,p,m,g);i[0]=t[0]+r[0],i[1]=t[1]+r[1];var _=o(u,2,i,n,p,m,g);t[0]+=T*x,t[1]+=_*x}else if(3===l){var S=o(u,3,t,n,p,m,g);i[0]=t[0]+r[0],i[1]=t[1]+r[1],i[2]=t[2]+r[2];var E=o(u,3,i,n,p,m,g);i[0]=t[0]+s[0],i[1]=t[1]+s[1],i[2]=t[2]+s[2];var C=o(u,3,i,n,p,m,g);t[0]+=S*x,t[1]+=E*x,t[2]+=C*x}return o(h,l,t,n,c,d,f)}},78702(e){e.exports=function(e){return e==parseFloat(e)?!(e%2):void 0}},94883(e){e.exports=function(e){return e===parseFloat(e)?!(e%2):void 0}},28915(e){e.exports=function(e,t,i){return(t-e)*i+e}},94908(e){e.exports=function(e,t,i){return void 0===i&&(i=0),e.clone().lerp(t,i)}},94434(e,t,i){var n=new(i(83419))({initialize:function(e){this.val=new Float32Array(9),e?this.copy(e):this.identity()},clone:function(){return new n(this)},set:function(e){return this.copy(e)},copy:function(e){var t=this.val,i=e.val;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this},fromMat4:function(e){var t=e.val,i=this.val;return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[4],i[4]=t[5],i[5]=t[6],i[6]=t[8],i[7]=t[9],i[8]=t[10],this},fromArray:function(e){var t=this.val;return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],this},identity:function(){var e=this.val;return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,this},transpose:function(){var e=this.val,t=e[1],i=e[2],n=e[5];return e[1]=e[3],e[2]=e[6],e[3]=t,e[5]=e[7],e[6]=i,e[7]=n,this},invert:function(){var e=this.val,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],a=e[5],o=e[6],l=e[7],h=e[8],u=h*s-a*l,c=-h*r+a*o,d=l*r-s*o,f=t*u+i*c+n*d;return f?(f=1/f,e[0]=u*f,e[1]=(-h*i+n*l)*f,e[2]=(a*i-n*s)*f,e[3]=c*f,e[4]=(h*t-n*o)*f,e[5]=(-a*t+n*r)*f,e[6]=d*f,e[7]=(-l*t+i*o)*f,e[8]=(s*t-i*r)*f,this):null},adjoint:function(){var e=this.val,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],a=e[5],o=e[6],l=e[7],h=e[8];return e[0]=s*h-a*l,e[1]=n*l-i*h,e[2]=i*a-n*s,e[3]=a*o-r*h,e[4]=t*h-n*o,e[5]=n*r-t*a,e[6]=r*l-s*o,e[7]=i*o-t*l,e[8]=t*s-i*r,this},determinant:function(){var e=this.val,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],a=e[5],o=e[6],l=e[7],h=e[8];return t*(h*s-a*l)+i*(-h*r+a*o)+n*(l*r-s*o)},multiply:function(e){var t=this.val,i=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],h=t[7],u=t[8],c=e.val,d=c[0],f=c[1],p=c[2],m=c[3],g=c[4],v=c[5],y=c[6],x=c[7],b=c[8];return t[0]=d*i+f*s+p*l,t[1]=d*n+f*a+p*h,t[2]=d*r+f*o+p*u,t[3]=m*i+g*s+v*l,t[4]=m*n+g*a+v*h,t[5]=m*r+g*o+v*u,t[6]=y*i+x*s+b*l,t[7]=y*n+x*a+b*h,t[8]=y*r+x*o+b*u,this},translate:function(e){var t=this.val,i=e.x,n=e.y;return t[6]=i*t[0]+n*t[3]+t[6],t[7]=i*t[1]+n*t[4]+t[7],t[8]=i*t[2]+n*t[5]+t[8],this},rotate:function(e){var t=this.val,i=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=Math.sin(e),h=Math.cos(e);return t[0]=h*i+l*s,t[1]=h*n+l*a,t[2]=h*r+l*o,t[3]=h*s-l*i,t[4]=h*a-l*n,t[5]=h*o-l*r,this},scale:function(e){var t=this.val,i=e.x,n=e.y;return t[0]=i*t[0],t[1]=i*t[1],t[2]=i*t[2],t[3]=n*t[3],t[4]=n*t[4],t[5]=n*t[5],this},fromQuat:function(e){var t=e.x,i=e.y,n=e.z,r=e.w,s=t+t,a=i+i,o=n+n,l=t*s,h=t*a,u=t*o,c=i*a,d=i*o,f=n*o,p=r*s,m=r*a,g=r*o,v=this.val;return v[0]=1-(c+f),v[3]=h+g,v[6]=u-m,v[1]=h-g,v[4]=1-(l+f),v[7]=d+p,v[2]=u+m,v[5]=d-p,v[8]=1-(l+c),this},normalFromMat4:function(e){var t=e.val,i=this.val,n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],l=t[5],h=t[6],u=t[7],c=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],x=n*l-r*o,b=n*h-s*o,w=n*u-a*o,T=r*h-s*l,_=r*u-a*l,S=s*u-a*h,E=c*g-d*m,C=c*v-f*m,A=c*y-p*m,k=d*v-f*g,R=d*y-p*g,O=f*y-p*v,P=x*O-b*R+w*k+T*A-_*C+S*E;return P?(P=1/P,i[0]=(l*O-h*R+u*k)*P,i[1]=(h*A-o*O-u*C)*P,i[2]=(o*R-l*A+u*E)*P,i[3]=(s*R-r*O-a*k)*P,i[4]=(n*O-s*A+a*C)*P,i[5]=(r*A-n*R-a*E)*P,i[6]=(g*S-v*_+y*T)*P,i[7]=(v*w-m*S-y*b)*P,i[8]=(m*_-g*w+y*x)*P,this):null}});e.exports=n},37867(e,t,i){var n=i(83419),r=i(25836),s=1e-6,a=new n({initialize:function(e){this.val=new Float32Array(16),e?this.copy(e):this.identity()},clone:function(){return new a(this)},set:function(e){return this.copy(e)},setValues:function(e,t,i,n,r,s,a,o,l,h,u,c,d,f,p,m){var g=this.val;return g[0]=e,g[1]=t,g[2]=i,g[3]=n,g[4]=r,g[5]=s,g[6]=a,g[7]=o,g[8]=l,g[9]=h,g[10]=u,g[11]=c,g[12]=d,g[13]=f,g[14]=p,g[15]=m,this},copy:function(e){var t=e.val;return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},fromArray:function(e){return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(e,t,i){var n=o.fromQuat(i).val,r=t.x,s=t.y,a=t.z;return this.setValues(n[0]*r,n[1]*r,n[2]*r,0,n[4]*s,n[5]*s,n[6]*s,0,n[8]*a,n[9]*a,n[10]*a,0,e.x,e.y,e.z,1)},xyz:function(e,t,i){this.identity();var n=this.val;return n[12]=e,n[13]=t,n[14]=i,this},scaling:function(e,t,i){this.zero();var n=this.val;return n[0]=e,n[5]=t,n[10]=i,n[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 e=this.val,t=e[1],i=e[2],n=e[3],r=e[6],s=e[7],a=e[11];return e[1]=e[4],e[2]=e[8],e[3]=e[12],e[4]=t,e[6]=e[9],e[7]=e[13],e[8]=i,e[9]=r,e[11]=e[14],e[12]=n,e[13]=s,e[14]=a,this},getInverse:function(e){return this.copy(e),this.invert()},invert:function(){var e=this.val,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],a=e[5],o=e[6],l=e[7],h=e[8],u=e[9],c=e[10],d=e[11],f=e[12],p=e[13],m=e[14],g=e[15],v=t*a-i*s,y=t*o-n*s,x=t*l-r*s,b=i*o-n*a,w=i*l-r*a,T=n*l-r*o,_=h*p-u*f,S=h*m-c*f,E=h*g-d*f,C=u*m-c*p,A=u*g-d*p,k=c*g-d*m,R=v*k-y*A+x*C+b*E-w*S+T*_;return R?(R=1/R,this.setValues((a*k-o*A+l*C)*R,(n*A-i*k-r*C)*R,(p*T-m*w+g*b)*R,(c*w-u*T-d*b)*R,(o*E-s*k-l*S)*R,(t*k-n*E+r*S)*R,(m*x-f*T-g*y)*R,(h*T-c*x+d*y)*R,(s*A-a*E+l*_)*R,(i*E-t*A-r*_)*R,(f*w-p*x+g*v)*R,(u*x-h*w-d*v)*R,(a*S-s*C-o*_)*R,(t*C-i*S+n*_)*R,(p*y-f*b-m*v)*R,(h*b-u*y+c*v)*R)):this},adjoint:function(){var e=this.val,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],a=e[5],o=e[6],l=e[7],h=e[8],u=e[9],c=e[10],d=e[11],f=e[12],p=e[13],m=e[14],g=e[15];return this.setValues(a*(c*g-d*m)-u*(o*g-l*m)+p*(o*d-l*c),-(i*(c*g-d*m)-u*(n*g-r*m)+p*(n*d-r*c)),i*(o*g-l*m)-a*(n*g-r*m)+p*(n*l-r*o),-(i*(o*d-l*c)-a*(n*d-r*c)+u*(n*l-r*o)),-(s*(c*g-d*m)-h*(o*g-l*m)+f*(o*d-l*c)),t*(c*g-d*m)-h*(n*g-r*m)+f*(n*d-r*c),-(t*(o*g-l*m)-s*(n*g-r*m)+f*(n*l-r*o)),t*(o*d-l*c)-s*(n*d-r*c)+h*(n*l-r*o),s*(u*g-d*p)-h*(a*g-l*p)+f*(a*d-l*u),-(t*(u*g-d*p)-h*(i*g-r*p)+f*(i*d-r*u)),t*(a*g-l*p)-s*(i*g-r*p)+f*(i*l-r*a),-(t*(a*d-l*u)-s*(i*d-r*u)+h*(i*l-r*a)),-(s*(u*m-c*p)-h*(a*m-o*p)+f*(a*c-o*u)),t*(u*m-c*p)-h*(i*m-n*p)+f*(i*c-n*u),-(t*(a*m-o*p)-s*(i*m-n*p)+f*(i*o-n*a)),t*(a*c-o*u)-s*(i*c-n*u)+h*(i*o-n*a))},determinant:function(){var e=this.val,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],a=e[5],o=e[6],l=e[7],h=e[8],u=e[9],c=e[10],d=e[11],f=e[12],p=e[13],m=e[14],g=e[15];return(t*a-i*s)*(c*g-d*m)-(t*o-n*s)*(u*g-d*p)+(t*l-r*s)*(u*m-c*p)+(i*o-n*a)*(h*g-d*f)-(i*l-r*a)*(h*m-c*f)+(n*l-r*o)*(h*p-u*f)},multiply:function(e){var t=this.val,i=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],h=t[7],u=t[8],c=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],v=t[15],y=e.val,x=y[0],b=y[1],w=y[2],T=y[3];return t[0]=x*i+b*a+w*u+T*p,t[1]=x*n+b*o+w*c+T*m,t[2]=x*r+b*l+w*d+T*g,t[3]=x*s+b*h+w*f+T*v,x=y[4],b=y[5],w=y[6],T=y[7],t[4]=x*i+b*a+w*u+T*p,t[5]=x*n+b*o+w*c+T*m,t[6]=x*r+b*l+w*d+T*g,t[7]=x*s+b*h+w*f+T*v,x=y[8],b=y[9],w=y[10],T=y[11],t[8]=x*i+b*a+w*u+T*p,t[9]=x*n+b*o+w*c+T*m,t[10]=x*r+b*l+w*d+T*g,t[11]=x*s+b*h+w*f+T*v,x=y[12],b=y[13],w=y[14],T=y[15],t[12]=x*i+b*a+w*u+T*p,t[13]=x*n+b*o+w*c+T*m,t[14]=x*r+b*l+w*d+T*g,t[15]=x*s+b*h+w*f+T*v,this},multiplyLocal:function(e){var t=this.val,i=e.val;return this.setValues(t[0]*i[0]+t[1]*i[4]+t[2]*i[8]+t[3]*i[12],t[0]*i[1]+t[1]*i[5]+t[2]*i[9]+t[3]*i[13],t[0]*i[2]+t[1]*i[6]+t[2]*i[10]+t[3]*i[14],t[0]*i[3]+t[1]*i[7]+t[2]*i[11]+t[3]*i[15],t[4]*i[0]+t[5]*i[4]+t[6]*i[8]+t[7]*i[12],t[4]*i[1]+t[5]*i[5]+t[6]*i[9]+t[7]*i[13],t[4]*i[2]+t[5]*i[6]+t[6]*i[10]+t[7]*i[14],t[4]*i[3]+t[5]*i[7]+t[6]*i[11]+t[7]*i[15],t[8]*i[0]+t[9]*i[4]+t[10]*i[8]+t[11]*i[12],t[8]*i[1]+t[9]*i[5]+t[10]*i[9]+t[11]*i[13],t[8]*i[2]+t[9]*i[6]+t[10]*i[10]+t[11]*i[14],t[8]*i[3]+t[9]*i[7]+t[10]*i[11]+t[11]*i[15],t[12]*i[0]+t[13]*i[4]+t[14]*i[8]+t[15]*i[12],t[12]*i[1]+t[13]*i[5]+t[14]*i[9]+t[15]*i[13],t[12]*i[2]+t[13]*i[6]+t[14]*i[10]+t[15]*i[14],t[12]*i[3]+t[13]*i[7]+t[14]*i[11]+t[15]*i[15])},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var i=e.val,n=t.val,r=i[0],s=i[4],a=i[8],o=i[12],l=i[1],h=i[5],u=i[9],c=i[13],d=i[2],f=i[6],p=i[10],m=i[14],g=i[3],v=i[7],y=i[11],x=i[15],b=n[0],w=n[4],T=n[8],_=n[12],S=n[1],E=n[5],C=n[9],A=n[13],k=n[2],R=n[6],O=n[10],P=n[14],M=n[3],N=n[7],I=n[11],L=n[15];return this.setValues(r*b+s*S+a*k+o*M,l*b+h*S+u*k+c*M,d*b+f*S+p*k+m*M,g*b+v*S+y*k+x*M,r*w+s*E+a*R+o*N,l*w+h*E+u*R+c*N,d*w+f*E+p*R+m*N,g*w+v*E+y*R+x*N,r*T+s*C+a*O+o*I,l*T+h*C+u*O+c*I,d*T+f*C+p*O+m*I,g*T+v*C+y*O+x*I,r*_+s*A+a*P+o*L,l*_+h*A+u*P+c*L,d*_+f*A+p*P+m*L,g*_+v*A+y*P+x*L)},translate:function(e){return this.translateXYZ(e.x,e.y,e.z)},translateXYZ:function(e,t,i){var n=this.val;return n[12]=n[0]*e+n[4]*t+n[8]*i+n[12],n[13]=n[1]*e+n[5]*t+n[9]*i+n[13],n[14]=n[2]*e+n[6]*t+n[10]*i+n[14],n[15]=n[3]*e+n[7]*t+n[11]*i+n[15],this},scale:function(e){return this.scaleXYZ(e.x,e.y,e.z)},scaleXYZ:function(e,t,i){var n=this.val;return n[0]=n[0]*e,n[1]=n[1]*e,n[2]=n[2]*e,n[3]=n[3]*e,n[4]=n[4]*t,n[5]=n[5]*t,n[6]=n[6]*t,n[7]=n[7]*t,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this},makeRotationAxis:function(e,t){var i=Math.cos(t),n=Math.sin(t),r=1-i,s=e.x,a=e.y,o=e.z,l=r*s,h=r*a;return this.setValues(l*s+i,l*a-n*o,l*o+n*a,0,l*a+n*o,h*a+i,h*o-n*s,0,l*o-n*a,h*o+n*s,r*o*o+i,0,0,0,0,1)},rotate:function(e,t){var i=this.val,n=t.x,r=t.y,a=t.z,o=Math.sqrt(n*n+r*r+a*a);if(Math.abs(o)<s)return this;n*=o=1/o,r*=o,a*=o;var l=Math.sin(e),h=Math.cos(e),u=1-h,c=i[0],d=i[1],f=i[2],p=i[3],m=i[4],g=i[5],v=i[6],y=i[7],x=i[8],b=i[9],w=i[10],T=i[11],_=i[12],S=i[13],E=i[14],C=i[15],A=n*n*u+h,k=r*n*u+a*l,R=a*n*u-r*l,O=n*r*u-a*l,P=r*r*u+h,M=a*r*u+n*l,N=n*a*u+r*l,I=r*a*u-n*l,L=a*a*u+h;return this.setValues(c*A+m*k+x*R,d*A+g*k+b*R,f*A+v*k+w*R,p*A+y*k+T*R,c*O+m*P+x*M,d*O+g*P+b*M,f*O+v*P+w*M,p*O+y*P+T*M,c*N+m*I+x*L,d*N+g*I+b*L,f*N+v*I+w*L,p*N+y*I+T*L,_,S,E,C)},rotateX:function(e){var t=this.val,i=Math.sin(e),n=Math.cos(e),r=t[4],s=t[5],a=t[6],o=t[7],l=t[8],h=t[9],u=t[10],c=t[11];return t[4]=r*n+l*i,t[5]=s*n+h*i,t[6]=a*n+u*i,t[7]=o*n+c*i,t[8]=l*n-r*i,t[9]=h*n-s*i,t[10]=u*n-a*i,t[11]=c*n-o*i,this},rotateY:function(e){var t=this.val,i=Math.sin(e),n=Math.cos(e),r=t[0],s=t[1],a=t[2],o=t[3],l=t[8],h=t[9],u=t[10],c=t[11];return t[0]=r*n-l*i,t[1]=s*n-h*i,t[2]=a*n-u*i,t[3]=o*n-c*i,t[8]=r*i+l*n,t[9]=s*i+h*n,t[10]=a*i+u*n,t[11]=o*i+c*n,this},rotateZ:function(e){var t=this.val,i=Math.sin(e),n=Math.cos(e),r=t[0],s=t[1],a=t[2],o=t[3],l=t[4],h=t[5],u=t[6],c=t[7];return t[0]=r*n+l*i,t[1]=s*n+h*i,t[2]=a*n+u*i,t[3]=o*n+c*i,t[4]=l*n-r*i,t[5]=h*n-s*i,t[6]=u*n-a*i,t[7]=c*n-o*i,this},fromRotationTranslation:function(e,t){var i=e.x,n=e.y,r=e.z,s=e.w,a=i+i,o=n+n,l=r+r,h=i*a,u=i*o,c=i*l,d=n*o,f=n*l,p=r*l,m=s*a,g=s*o,v=s*l;return this.setValues(1-(d+p),u+v,c-g,0,u-v,1-(h+p),f+m,0,c+g,f-m,1-(h+d),0,t.x,t.y,t.z,1)},fromQuat:function(e){var t=e.x,i=e.y,n=e.z,r=e.w,s=t+t,a=i+i,o=n+n,l=t*s,h=t*a,u=t*o,c=i*a,d=i*o,f=n*o,p=r*s,m=r*a,g=r*o;return this.setValues(1-(c+f),h+g,u-m,0,h-g,1-(l+f),d+p,0,u+m,d-p,1-(l+c),0,0,0,0,1)},frustum:function(e,t,i,n,r,s){var a=1/(t-e),o=1/(n-i),l=1/(r-s);return this.setValues(2*r*a,0,0,0,0,2*r*o,0,0,(t+e)*a,(n+i)*o,(s+r)*l,-1,0,0,s*r*2*l,0)},perspective:function(e,t,i,n){var r=1/Math.tan(e/2),s=1/(i-n);return this.setValues(r/t,0,0,0,0,r,0,0,0,0,(n+i)*s,-1,0,0,2*n*i*s,0)},perspectiveLH:function(e,t,i,n){return this.setValues(2*i/e,0,0,0,0,2*i/t,0,0,0,0,-n/(i-n),1,0,0,i*n/(i-n),0)},ortho:function(e,t,i,n,r,s){var a=e-t,o=i-n,l=r-s;return a=0===a?a:1/a,o=0===o?o:1/o,l=0===l?l:1/l,this.setValues(-2*a,0,0,0,0,-2*o,0,0,0,0,2*l,0,(e+t)*a,(n+i)*o,(s+r)*l,1)},lookAtRH:function(e,t,i){var n=this.val;return c.subVectors(e,t),0===c.lengthSq()&&(c.z=1),c.normalize(),h.crossVectors(i,c),0===h.lengthSq()&&(1===Math.abs(i.z)?c.x+=1e-4:c.z+=1e-4,c.normalize(),h.crossVectors(i,c)),h.normalize(),u.crossVectors(c,h),n[0]=h.x,n[1]=h.y,n[2]=h.z,n[4]=u.x,n[5]=u.y,n[6]=u.z,n[8]=c.x,n[9]=c.y,n[10]=c.z,this},lookAt:function(e,t,i){var n=e.x,r=e.y,a=e.z,o=i.x,l=i.y,h=i.z,u=t.x,c=t.y,d=t.z;if(Math.abs(n-u)<s&&Math.abs(r-c)<s&&Math.abs(a-d)<s)return this.identity();var f=n-u,p=r-c,m=a-d,g=1/Math.sqrt(f*f+p*p+m*m),v=l*(m*=g)-h*(p*=g),y=h*(f*=g)-o*m,x=o*p-l*f;(g=Math.sqrt(v*v+y*y+x*x))?(v*=g=1/g,y*=g,x*=g):(v=0,y=0,x=0);var b=p*x-m*y,w=m*v-f*x,T=f*y-p*v;return(g=Math.sqrt(b*b+w*w+T*T))?(b*=g=1/g,w*=g,T*=g):(b=0,w=0,T=0),this.setValues(v,b,f,0,y,w,p,0,x,T,m,0,-(v*n+y*r+x*a),-(b*n+w*r+T*a),-(f*n+p*r+m*a),1)},yawPitchRoll:function(e,t,i){this.zero(),o.zero(),l.zero();var n=this.val,r=o.val,s=l.val,a=Math.sin(i),h=Math.cos(i);return n[10]=1,n[15]=1,n[0]=h,n[1]=a,n[4]=-a,n[5]=h,a=Math.sin(t),h=Math.cos(t),r[0]=1,r[15]=1,r[5]=h,r[10]=h,r[9]=-a,r[6]=a,a=Math.sin(e),h=Math.cos(e),s[5]=1,s[15]=1,s[0]=h,s[2]=-a,s[8]=a,s[10]=h,this.multiplyLocal(o),this.multiplyLocal(l),this},setWorldMatrix:function(e,t,i,n,r){return this.yawPitchRoll(e.y,e.x,e.z),o.scaling(i.x,i.y,i.z),l.xyz(t.x,t.y,t.z),this.multiplyLocal(o),this.multiplyLocal(l),n&&this.multiplyLocal(n),r&&this.multiplyLocal(r),this},multiplyToMat4:function(e,t){var i=this.val,n=e.val,r=i[0],s=i[1],a=i[2],o=i[3],l=i[4],h=i[5],u=i[6],c=i[7],d=i[8],f=i[9],p=i[10],m=i[11],g=i[12],v=i[13],y=i[14],x=i[15],b=n[0],w=n[1],T=n[2],_=n[3],S=n[4],E=n[5],C=n[6],A=n[7],k=n[8],R=n[9],O=n[10],P=n[11],M=n[12],N=n[13],I=n[14],L=n[15];return t.setValues(b*r+w*l+T*d+_*g,w*s+w*h+T*f+_*v,T*a+w*u+T*p+_*y,_*o+w*c+T*m+_*x,S*r+E*l+C*d+A*g,S*s+E*h+C*f+A*v,S*a+E*u+C*p+A*y,S*o+E*c+C*m+A*x,k*r+R*l+O*d+P*g,k*s+R*h+O*f+P*v,k*a+R*u+O*p+P*y,k*o+R*c+O*m+P*x,M*r+N*l+I*d+L*g,M*s+N*h+I*f+L*v,M*a+N*u+I*p+L*y,M*o+N*c+I*m+L*x)},fromRotationXYTranslation:function(e,t,i){var n=t.x,r=t.y,s=t.z,a=Math.sin(e.x),o=Math.cos(e.x),l=Math.sin(e.y),h=Math.cos(e.y),u=n,c=r,d=s,f=-a,p=0-f*l,m=0-o*l,g=f*h,v=o*h;return i||(u=h*n+l*s,c=p*n+o*r+g*s,d=m*n+a*r+v*s),this.setValues(h,p,m,0,0,o,a,0,l,g,v,0,u,c,d,1)},getMaxScaleOnAxis:function(){var e=this.val,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}}),o=new a,l=new a,h=new r,u=new r,c=new r;e.exports=a},86883(e){e.exports=function(e,t,i){return Math.min(e+t,i)}},50040(e){e.exports=function(e){var t=e.length;if(0===t)return 0;e.sort(function(e,t){return e-t});var i=Math.floor(t/2);return t%2===0?(e[i]+e[i-1])/2:e[i]}},37204(e){e.exports=function(e,t,i){return Math.max(e-t,i)}},65201(e){e.exports=function(e,t,i,n){void 0===i&&(i=t+1);var r=(e-t)/(i-t);return r>1?void 0!==n?(r=(n-e)/(n-i))<0&&(r=0):r=1:r<0&&(r=0),r}},15746(e,t,i){var n=i(83419),r=i(94434),s=i(29747),a=i(25836),o=1e-6,l=new Int8Array([1,2,0]),h=new Float32Array([0,0,0]),u=new a(1,0,0),c=new a(0,1,0),d=new a,f=new r,p=new n({initialize:function(e,t,i,n){this.onChangeCallback=s,this.set(e,t,i,n)},x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback(this)}},copy:function(e){return this.set(e)},set:function(e,t,i,n,r){return void 0===r&&(r=!0),"object"===typeof e?(this._x=e.x||0,this._y=e.y||0,this._z=e.z||0,this._w=e.w||0):(this._x=e||0,this._y=t||0,this._z=i||0,this._w=n||0),r&&this.onChangeCallback(this),this},add:function(e){return this._x+=e.x,this._y+=e.y,this._z+=e.z,this._w+=e.w,this.onChangeCallback(this),this},subtract:function(e){return this._x-=e.x,this._y-=e.y,this._z-=e.z,this._w-=e.w,this.onChangeCallback(this),this},scale:function(e){return this._x*=e,this._y*=e,this._z*=e,this._w*=e,this.onChangeCallback(this),this},length:function(){var e=this.x,t=this.y,i=this.z,n=this.w;return Math.sqrt(e*e+t*t+i*i+n*n)},lengthSq:function(){var e=this.x,t=this.y,i=this.z,n=this.w;return e*e+t*t+i*i+n*n},normalize:function(){var e=this.x,t=this.y,i=this.z,n=this.w,r=e*e+t*t+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this._x=e*r,this._y=t*r,this._z=i*r,this._w=n*r),this.onChangeCallback(this),this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lerp:function(e,t){void 0===t&&(t=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.set(i+t*(e.x-i),n+t*(e.y-n),r+t*(e.z-r),s+t*(e.w-s))},rotationTo:function(e,t){var i=e.x*t.x+e.y*t.y+e.z*t.z;return i<-.999999?(d.copy(u).cross(e).length()<o&&d.copy(c).cross(e),d.normalize(),this.setAxisAngle(d,Math.PI)):i>.999999?this.set(0,0,0,1):(d.copy(e).cross(t),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(e,t,i){var n=f.val;return n[0]=t.x,n[3]=t.y,n[6]=t.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-e.x,n[5]=-e.y,n[8]=-e.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(e,t){t*=.5;var i=Math.sin(t);return this.set(i*e.x,i*e.y,i*e.z,Math.cos(t))},multiply:function(e){var t=this.x,i=this.y,n=this.z,r=this.w,s=e.x,a=e.y,o=e.z,l=e.w;return this.set(t*l+r*s+i*o-n*a,i*l+r*a+n*s-t*o,n*l+r*o+t*a-i*s,r*l-t*s-i*a-n*o)},slerp:function(e,t){var i=this.x,n=this.y,r=this.z,s=this.w,a=e.x,l=e.y,h=e.z,u=e.w,c=i*a+n*l+r*h+s*u;c<0&&(c=-c,a=-a,l=-l,h=-h,u=-u);var d=1-t,f=t;if(1-c>o){var p=Math.acos(c),m=Math.sin(p);d=Math.sin((1-t)*p)/m,f=Math.sin(t*p)/m}return this.set(d*i+f*a,d*n+f*l,d*r+f*h,d*s+f*u)},invert:function(){var e=this.x,t=this.y,i=this.z,n=this.w,r=e*e+t*t+i*i+n*n,s=r?1/r:0;return this.set(-e*s,-t*s,-i*s,n*s)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(e){e*=.5;var t=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(e),a=Math.cos(e);return this.set(t*a+r*s,i*a+n*s,n*a-i*s,r*a-t*s)},rotateY:function(e){e*=.5;var t=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(e),a=Math.cos(e);return this.set(t*a-n*s,i*a+r*s,n*a+t*s,r*a-i*s)},rotateZ:function(e){e*=.5;var t=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(e),a=Math.cos(e);return this.set(t*a+i*s,i*a-t*s,n*a+r*s,r*a-n*s)},calculateW:function(){var e=this.x,t=this.y,i=this.z;return this.w=-Math.sqrt(1-e*e-t*t-i*i),this},setFromEuler:function(e,t){var i=e.x/2,n=e.y/2,r=e.z/2,s=Math.cos(i),a=Math.cos(n),o=Math.cos(r),l=Math.sin(i),h=Math.sin(n),u=Math.sin(r);switch(e.order){case"XYZ":this.set(l*a*o+s*h*u,s*h*o-l*a*u,s*a*u+l*h*o,s*a*o-l*h*u,t);break;case"YXZ":this.set(l*a*o+s*h*u,s*h*o-l*a*u,s*a*u-l*h*o,s*a*o+l*h*u,t);break;case"ZXY":this.set(l*a*o-s*h*u,s*h*o+l*a*u,s*a*u+l*h*o,s*a*o-l*h*u,t);break;case"ZYX":this.set(l*a*o-s*h*u,s*h*o+l*a*u,s*a*u-l*h*o,s*a*o+l*h*u,t);break;case"YZX":this.set(l*a*o+s*h*u,s*h*o+l*a*u,s*a*u-l*h*o,s*a*o-l*h*u,t);break;case"XZY":this.set(l*a*o-s*h*u,s*h*o-l*a*u,s*a*u+l*h*o,s*a*o+l*h*u,t)}return this},setFromRotationMatrix:function(e){var t,i=e.val,n=i[0],r=i[4],s=i[8],a=i[1],o=i[5],l=i[9],h=i[2],u=i[6],c=i[10],d=n+o+c;return d>0?(t=.5/Math.sqrt(d+1),this.set((u-l)*t,(s-h)*t,(a-r)*t,.25/t)):n>o&&n>c?(t=2*Math.sqrt(1+n-o-c),this.set(.25*t,(r+a)/t,(s+h)/t,(u-l)/t)):o>c?(t=2*Math.sqrt(1+o-n-c),this.set((r+a)/t,.25*t,(l+u)/t,(s-h)/t)):(t=2*Math.sqrt(1+c-n-o),this.set((s+h)/t,(l+u)/t,.25*t,(a-r)/t)),this},fromMat3:function(e){var t,i=e.val,n=i[0]+i[4]+i[8];if(n>0)t=Math.sqrt(n+1),this.w=.5*t,t=.5/t,this._x=(i[7]-i[5])*t,this._y=(i[2]-i[6])*t,this._z=(i[3]-i[1])*t;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var s=l[r],a=l[s];t=Math.sqrt(i[3*r+r]-i[3*s+s]-i[3*a+a]+1),h[r]=.5*t,t=.5/t,h[s]=(i[3*s+r]+i[3*r+s])*t,h[a]=(i[3*a+r]+i[3*r+a])*t,this._x=h[0],this._y=h[1],this._z=h[2],this._w=(i[3*a+s]-i[3*s+a])*t}return this.onChangeCallback(this),this}});e.exports=p},43396(e,t,i){var n=i(36383);e.exports=function(e){return e*n.RAD_TO_DEG}},74362(e){e.exports=function(e,t){void 0===t&&(t=1);var i=2*Math.random()*Math.PI;return e.x=Math.cos(i)*t,e.y=Math.sin(i)*t,e}},60706(e){e.exports=function(e,t){void 0===t&&(t=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,r=Math.sqrt(1-n*n)*t;return e.x=Math.cos(i)*r,e.y=Math.sin(i)*r,e.z=n*t,e}},67421(e){e.exports=function(e,t){return void 0===t&&(t=1),e.x=(2*Math.random()-1)*t,e.y=(2*Math.random()-1)*t,e.z=(2*Math.random()-1)*t,e.w=(2*Math.random()-1)*t,e}},36305(e){e.exports=function(e,t){var i=e.x,n=e.y;return e.x=i*Math.cos(t)-n*Math.sin(t),e.y=i*Math.sin(t)+n*Math.cos(t),e}},11520(e){e.exports=function(e,t,i,n){var r=Math.cos(n),s=Math.sin(n),a=e.x-t,o=e.y-i;return e.x=a*r-o*s+t,e.y=a*s+o*r+i,e}},1163(e){e.exports=function(e,t,i,n,r){var s=n+Math.atan2(e.y-i,e.x-t);return e.x=t+r*Math.cos(s),e.y=i+r*Math.sin(s),e}},70336(e){e.exports=function(e,t,i,n,r){return e.x=t+r*Math.cos(n),e.y=i+r*Math.sin(n),e}},72678(e,t,i){var n=i(25836),r=i(37867),s=i(15746),a=new r,o=new s,l=new n;e.exports=function(e,t,i){return o.setAxisAngle(t,i),a.fromRotationTranslation(o,l.set(0,0,0)),e.transformMat4(a)}},2284(e){e.exports=function(e){return e>0?Math.ceil(e):Math.floor(e)}},41013(e){e.exports=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=10);var n=Math.pow(i,-t);return Math.round(e*n)/n}},7602(e){e.exports=function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)}},54261(e){e.exports=function(e,t,i){return(e=Math.max(0,Math.min(1,(e-t)/(i-t))))*e*e*(e*(6*e-15)+10)}},44408(e,t,i){var n=i(26099);e.exports=function(e,t,i,r){void 0===r&&(r=new n);var s=0,a=0;return e>0&&e<=t*i&&(s=e>t-1?e-(a=Math.floor(e/t))*t:e),r.set(s,a)}},85955(e,t,i){var n=i(26099);e.exports=function(e,t,i,r,s,a,o,l){void 0===l&&(l=new n);var h=Math.sin(s),u=Math.cos(s),c=u*a,d=h*a,f=-h*o,p=u*o,m=1/(c*p+f*-d);return l.x=p*m*e+-f*m*t+(r*f-i*p)*m,l.y=c*m*t+-d*m*e+(-r*c+i*d)*m,l}},26099(e,t,i){var n=i(83419),r=i(43855),s=new n({initialize:function(e,t){this.x=0,this.y=0,"object"===typeof e?(this.x=e.x||0,this.y=e.y||0):(void 0===t&&(t=e),this.x=e||0,this.y=t||0)},clone:function(){return new s(this.x,this.y)},copy:function(e){return this.x=e.x||0,this.y=e.y||0,this},setFromObject:function(e){return this.x=e.x||0,this.y=e.y||0,this},set:function(e,t){return void 0===t&&(t=e),this.x=e,this.y=t,this},setTo:function(e,t){return this.set(e,t)},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},invert:function(){return this.set(this.y,this.x)},setToPolar:function(e,t){return null==t&&(t=1),this.x=Math.cos(e)*t,this.y=Math.sin(e)*t,this},equals:function(e){return this.x===e.x&&this.y===e.y},fuzzyEquals:function(e,t){return r(this.x,e.x,t)&&r(this.y,e.y,t)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},setAngle:function(e){return this.setToPolar(e,this.length())},add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.x-=e.x,this.y-=e.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},scale:function(e){return isFinite(e)?(this.x*=e,this.y*=e):(this.x=0,this.y=0),this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(e){var t=e.x-this.x,i=e.y-this.y;return Math.sqrt(t*t+i*i)},distanceSq:function(e){var t=e.x-this.x,i=e.y-this.y;return t*t+i*i},length:function(){var e=this.x,t=this.y;return Math.sqrt(e*e+t*t)},setLength:function(e){return this.normalize().scale(e)},lengthSq:function(){var e=this.x,t=this.y;return e*e+t*t},normalize:function(){var e=this.x,t=this.y,i=e*e+t*t;return i>0&&(i=1/Math.sqrt(i),this.x=e*i,this.y=t*i),this},normalizeRightHand:function(){var e=this.x;return this.x=-1*this.y,this.y=e,this},normalizeLeftHand:function(){var e=this.x;return this.x=this.y,this.y=-1*e,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lerp:function(e,t){void 0===t&&(t=0);var i=this.x,n=this.y;return this.x=i+t*(e.x-i),this.y=n+t*(e.y-n),this},transformMat3:function(e){var t=this.x,i=this.y,n=e.val;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this},transformMat4:function(e){var t=this.x,i=this.y,n=e.val;return this.x=n[0]*t+n[4]*i+n[12],this.y=n[1]*t+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(e){var t=this.length();return t&&t>e&&this.scale(e/t),this},reflect:function(e){return e=e.clone().normalize(),this.subtract(e.scale(2*this.dot(e)))},mirror:function(e){return this.reflect(e).negate()},rotate:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t*this.x-i*this.y,i*this.x+t*this.y)},project:function(e){var t=this.dot(e)/e.dot(e);return this.copy(e).scale(t)},projectUnit:function(e,t){void 0===t&&(t=new s);var i=this.x*e.x+this.y*e.y;return 0!==i&&(t.x=i*e.x,t.y=i*e.y),t}});s.ZERO=new s,s.RIGHT=new s(1,0),s.LEFT=new s(-1,0),s.UP=new s(0,-1),s.DOWN=new s(0,1),s.ONE=new s(1,1),e.exports=s},25836(e,t,i){var n=new(i(83419))({initialize:function(e,t,i){this.x=0,this.y=0,this.z=0,"object"===typeof e?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):(this.x=e||0,this.y=t||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(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:function(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},clone:function(){return new n(this.x,this.y,this.z)},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},crossVectors:function(e,t){var i=e.x,n=e.y,r=e.z,s=t.x,a=t.y,o=t.z;return this.x=n*o-r*a,this.y=r*s-i*o,this.z=i*a-n*s,this},equals:function(e){return this.x===e.x&&this.y===e.y&&this.z===e.z},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z||0,this},set:function(e,t,i){return"object"===typeof e?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):(this.x=e||0,this.y=t||0,this.z=i||0),this},setFromMatrixPosition:function(e){return this.fromArray(e.val,12)},setFromMatrixColumn:function(e,t){return this.fromArray(e.val,4*t)},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},add:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z||0,this},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addScale:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t||0,this},subtract:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z||0,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z||1,this},scale:function(e){return isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):(this.x=0,this.y=0,this.z=0),this},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(e){var t=e.x-this.x,i=e.y-this.y,n=e.z-this.z||0;return Math.sqrt(t*t+i*i+n*n)},distanceSq:function(e){var t=e.x-this.x,i=e.y-this.y,n=e.z-this.z||0;return t*t+i*i+n*n},length:function(){var e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)},lengthSq:function(){var e=this.x,t=this.y,i=this.z;return e*e+t*t+i*i},normalize:function(){var e=this.x,t=this.y,i=this.z,n=e*e+t*t+i*i;return n>0&&(n=1/Math.sqrt(n),this.x=e*n,this.y=t*n,this.z=i*n),this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},cross:function(e){var t=this.x,i=this.y,n=this.z,r=e.x,s=e.y,a=e.z;return this.x=i*a-n*s,this.y=n*r-t*a,this.z=t*s-i*r,this},lerp:function(e,t){void 0===t&&(t=0);var i=this.x,n=this.y,r=this.z;return this.x=i+t*(e.x-i),this.y=n+t*(e.y-n),this.z=r+t*(e.z-r),this},applyMatrix3:function(e){var t=this.x,i=this.y,n=this.z,r=e.val;return this.x=r[0]*t+r[3]*i+r[6]*n,this.y=r[1]*t+r[4]*i+r[7]*n,this.z=r[2]*t+r[5]*i+r[8]*n,this},applyMatrix4:function(e){var t=this.x,i=this.y,n=this.z,r=e.val,s=1/(r[3]*t+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*t+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*t+r[6]*i+r[10]*n+r[14])*s,this},transformMat3:function(e){var t=this.x,i=this.y,n=this.z,r=e.val;return this.x=t*r[0]+i*r[3]+n*r[6],this.y=t*r[1]+i*r[4]+n*r[7],this.z=t*r[2]+i*r[5]+n*r[8],this},transformMat4:function(e){var t=this.x,i=this.y,n=this.z,r=e.val;return this.x=r[0]*t+r[4]*i+r[8]*n+r[12],this.y=r[1]*t+r[5]*i+r[9]*n+r[13],this.z=r[2]*t+r[6]*i+r[10]*n+r[14],this},transformCoordinates:function(e){var t=this.x,i=this.y,n=this.z,r=e.val,s=t*r[0]+i*r[4]+n*r[8]+r[12],a=t*r[1]+i*r[5]+n*r[9]+r[13],o=t*r[2]+i*r[6]+n*r[10]+r[14],l=t*r[3]+i*r[7]+n*r[11]+r[15];return this.x=s/l,this.y=a/l,this.z=o/l,this},transformQuat:function(e){var t=this.x,i=this.y,n=this.z,r=e.x,s=e.y,a=e.z,o=e.w,l=o*t+s*n-a*i,h=o*i+a*t-r*n,u=o*n+r*i-s*t,c=-r*t-s*i-a*n;return this.x=l*o+c*-r+h*-a-u*-s,this.y=h*o+c*-s+u*-r-l*-a,this.z=u*o+c*-a+l*-s-h*-r,this},project:function(e){var t=this.x,i=this.y,n=this.z,r=e.val,s=r[0],a=r[1],o=r[2],l=r[3],h=r[4],u=r[5],c=r[6],d=r[7],f=r[8],p=r[9],m=r[10],g=r[11],v=r[12],y=r[13],x=r[14],b=1/(t*l+i*d+n*g+r[15]);return this.x=(t*s+i*h+n*f+v)*b,this.y=(t*a+i*u+n*p+y)*b,this.z=(t*o+i*c+n*m+x)*b,this},projectViewMatrix:function(e,t){return this.applyMatrix4(e).applyMatrix4(t)},unprojectViewMatrix:function(e,t){return this.applyMatrix4(e).applyMatrix4(t)},unproject:function(e,t){var i=e.x,n=e.y,r=e.z,s=e.w,a=this.x-i,o=s-this.y-1-n,l=this.z;return this.x=2*a/r-1,this.y=2*o/s-1,this.z=2*l-1,this.project(t)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});n.ZERO=new n,n.RIGHT=new n(1,0,0),n.LEFT=new n(-1,0,0),n.UP=new n(0,-1,0),n.DOWN=new n(0,1,0),n.FORWARD=new n(0,0,1),n.BACK=new n(0,0,-1),n.ONE=new n(1,1,1),e.exports=n},61369(e,t,i){var n=new(i(83419))({initialize:function(e,t,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"===typeof e?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0,this.w=e.w||0):(this.x=e||0,this.y=t||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z||0,this.w=e.w||0,this},equals:function(e){return this.x===e.x&&this.y===e.y&&this.z===e.z&&this.w===e.w},set:function(e,t,i,n){return"object"===typeof e?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0,this.w=e.w||0):(this.x=e||0,this.y=t||0,this.z=i||0,this.w=n||0),this},add:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z||0,this.w+=e.w||0,this},subtract:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z||0,this.w-=e.w||0,this},scale:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},length:function(){var e=this.x,t=this.y,i=this.z,n=this.w;return Math.sqrt(e*e+t*t+i*i+n*n)},lengthSq:function(){var e=this.x,t=this.y,i=this.z,n=this.w;return e*e+t*t+i*i+n*n},normalize:function(){var e=this.x,t=this.y,i=this.z,n=this.w,r=e*e+t*t+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this.x=e*r,this.y=t*r,this.z=i*r,this.w=n*r),this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lerp:function(e,t){void 0===t&&(t=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.x=i+t*(e.x-i),this.y=n+t*(e.y-n),this.z=r+t*(e.z-r),this.w=s+t*(e.w-s),this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z||1,this.w*=e.w||1,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z||1,this.w/=e.w||1,this},distance:function(e){var t=e.x-this.x,i=e.y-this.y,n=e.z-this.z||0,r=e.w-this.w||0;return Math.sqrt(t*t+i*i+n*n+r*r)},distanceSq:function(e){var t=e.x-this.x,i=e.y-this.y,n=e.z-this.z||0,r=e.w-this.w||0;return t*t+i*i+n*n+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(e){var t=this.x,i=this.y,n=this.z,r=this.w,s=e.val;return this.x=s[0]*t+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*t+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*t+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*t+s[7]*i+s[11]*n+s[15]*r,this},transformQuat:function(e){var t=this.x,i=this.y,n=this.z,r=e.x,s=e.y,a=e.z,o=e.w,l=o*t+s*n-a*i,h=o*i+a*t-r*n,u=o*n+r*i-s*t,c=-r*t-s*i-a*n;return this.x=l*o+c*-r+h*-a-u*-s,this.y=h*o+c*-s+u*-r-l*-a,this.z=u*o+c*-a+l*-s-h*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,e.exports=n},60417(e){e.exports=function(e,t,i){return Math.abs(e-t)<=i}},15994(e){e.exports=function(e,t,i){var n=i-t;return t+((e-t)%n+n)%n}},31040(e){e.exports=function(e,t,i,n){return Math.atan2(n-t,i-e)}},55495(e){e.exports=function(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}},128(e){e.exports=function(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}},41273(e){e.exports=function(e,t,i,n){return Math.atan2(i-e,n-t)}},1432(e,t,i){var n=i(36383);e.exports=function(e){return e>Math.PI&&(e-=n.TAU),Math.abs(((e+n.PI_OVER_2)%n.TAU-n.TAU)%n.TAU)}},49127(e,t,i){var n=i(12407);e.exports=function(e,t){return n(t-e)}},52285(e,t,i){var n=i(36383),r=i(12407),s=n.TAU;e.exports=function(e,t){var i=r(t-e);return i>0&&(i-=s),i}},67317(e,t,i){var n=i(86554);e.exports=function(e,t){return n(t-e)}},12407(e){e.exports=function(e){return(e%=2*Math.PI)>=0?e:e+2*Math.PI}},53993(e,t,i){var n=i(99472);e.exports=function(){return n(-Math.PI,Math.PI)}},86564(e,t,i){var n=i(99472);e.exports=function(){return n(-180,180)}},90154(e,t,i){var n=i(12407);e.exports=function(e){return n(e+Math.PI)}},48736(e,t,i){var n=i(36383);e.exports=function(e,t,i){return void 0===i&&(i=.05),e===t||(Math.abs(t-e)<=i||Math.abs(t-e)>=n.TAU-i?e=t:(Math.abs(t-e)>Math.PI&&(t<e?t+=n.TAU:t-=n.TAU),t>e?e+=i:t<e&&(e-=i))),e}},61430(e){e.exports=function(e,t){var i=t-e;return 0===i?0:i-360*Math.floor((i- -180)/360)}},86554(e,t,i){var n=i(15994);e.exports=function(e){return n(e,-Math.PI,Math.PI)}},30954(e,t,i){var n=i(15994);e.exports=function(e){return n(e,-180,180)}},25588(e,t,i){e.exports={Between:i(31040),BetweenPoints:i(55495),BetweenPointsY:i(128),BetweenY:i(41273),CounterClockwise:i(1432),GetClockwiseDistance:i(49127),GetCounterClockwiseDistance:i(52285),GetShortestDistance:i(67317),Normalize:i(12407),Random:i(53993),RandomDegrees:i(86564),Reverse:i(90154),RotateTo:i(48736),ShortestBetween:i(61430),Wrap:i(86554),WrapDegrees:i(30954)}},36383(e){var t={TAU:2*Math.PI,PI_OVER_2:Math.PI/2,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};e.exports=t},20339(e){e.exports=function(e,t,i,n){var r=e-i,s=t-n;return Math.sqrt(r*r+s*s)}},52816(e){e.exports=function(e,t){var i=e.x-t.x,n=e.y-t.y;return Math.sqrt(i*i+n*n)}},64559(e){e.exports=function(e,t){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}},82340(e){e.exports=function(e,t,i,n){return Math.max(Math.abs(e-i),Math.abs(t-n))}},14390(e){e.exports=function(e,t,i,n,r){return void 0===r&&(r=2),Math.sqrt(Math.pow(i-e,r)+Math.pow(n-t,r))}},2243(e){e.exports=function(e,t,i,n){return Math.abs(e-i)+Math.abs(t-n)}},89774(e){e.exports=function(e,t,i,n){var r=e-i,s=t-n;return r*r+s*s}},50994(e,t,i){e.exports={Between:i(20339),BetweenPoints:i(52816),BetweenPointsSquared:i(64559),Chebyshev:i(82340),Power:i(14390),Snake:i(2243),Squared:i(89774)}},62640(e,t,i){var n=i(54178),r=i(41521),s=i(79980),a=i(85433),o=i(99140),l=i(48857),h=i(81596),u=i(59133),c=i(98516),d=i(35248),f=i(82500),p=i(49752);e.exports={Power0:h,Power1:u.Out,Power2:a.Out,Power3:c.Out,Power4:d.Out,Linear:h,Quad:u.Out,Cubic:a.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:l.Out,Circ:s.Out,Elastic:o.Out,Back:n.Out,Bounce:r.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":a.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":l.In,"Circ.easeIn":s.In,"Elastic.easeIn":o.In,"Back.easeIn":n.In,"Bounce.easeIn":r.In,"Quad.easeOut":u.Out,"Cubic.easeOut":a.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":l.Out,"Circ.easeOut":s.Out,"Elastic.easeOut":o.Out,"Back.easeOut":n.Out,"Bounce.easeOut":r.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":a.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":l.InOut,"Circ.easeInOut":s.InOut,"Elastic.easeInOut":o.InOut,"Back.easeInOut":n.InOut,"Bounce.easeInOut":r.InOut}},1639(e){e.exports=function(e,t){return void 0===t&&(t=1.70158),e*e*((t+1)*e-t)}},50099(e){e.exports=function(e,t){void 0===t&&(t=1.70158);var i=1.525*t;return(e*=2)<1?e*e*((i+1)*e-i)*.5:.5*((e-=2)*e*((i+1)*e+i)+2)}},41286(e){e.exports=function(e,t){return void 0===t&&(t=1.70158),--e*e*((t+1)*e+t)+1}},54178(e,t,i){e.exports={In:i(1639),Out:i(41286),InOut:i(50099)}},59590(e){e.exports=function(e){return(e=1-e)<1/2.75?1-7.5625*e*e:e<2/2.75?1-(7.5625*(e-=1.5/2.75)*e+.75):e<2.5/2.75?1-(7.5625*(e-=2.25/2.75)*e+.9375):1-(7.5625*(e-=2.625/2.75)*e+.984375)}},41788(e){e.exports=function(e){var t=!1;return e<.5?(e=1-2*e,t=!0):e=2*e-1,e<1/2.75?e*=7.5625*e:e=e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,t?.5*(1-e):.5*e+.5}},69905(e){e.exports=function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}},41521(e,t,i){e.exports={In:i(59590),Out:i(69905),InOut:i(41788)}},91861(e){e.exports=function(e){return 1-Math.sqrt(1-e*e)}},4177(e){e.exports=function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},57512(e){e.exports=function(e){return Math.sqrt(1- --e*e)}},79980(e,t,i){e.exports={In:i(91861),Out:i(57512),InOut:i(4177)}},51150(e){e.exports=function(e){return e*e*e}},82820(e){e.exports=function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},35033(e){e.exports=function(e){return--e*e*e+1}},85433(e,t,i){e.exports={In:i(51150),Out:i(35033),InOut:i(82820)}},69965(e){e.exports=function(e,t,i){if(void 0===t&&(t=.1),void 0===i&&(i=.1),0===e)return 0;if(1===e)return 1;var n=i/4;return t<1?t=1:n=i*Math.asin(1/t)/(2*Math.PI),-t*Math.pow(2,10*(e-=1))*Math.sin((e-n)*(2*Math.PI)/i)}},50665(e){e.exports=function(e,t,i){if(void 0===t&&(t=.1),void 0===i&&(i=.1),0===e)return 0;if(1===e)return 1;var n=i/4;return t<1?t=1:n=i*Math.asin(1/t)/(2*Math.PI),(e*=2)<1?t*Math.pow(2,10*(e-=1))*Math.sin((e-n)*(2*Math.PI)/i)*-.5:t*Math.pow(2,-10*(e-=1))*Math.sin((e-n)*(2*Math.PI)/i)*.5+1}},7744(e){e.exports=function(e,t,i){if(void 0===t&&(t=.1),void 0===i&&(i=.1),0===e)return 0;if(1===e)return 1;var n=i/4;return t<1?t=1:n=i*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*e)*Math.sin((e-n)*(2*Math.PI)/i)+1}},99140(e,t,i){e.exports={In:i(69965),Out:i(7744),InOut:i(50665)}},24590(e){e.exports=function(e){return Math.pow(2,10*(e-1))-.001}},87844(e){e.exports=function(e){return(e*=2)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*(e-1)))}},89433(e){e.exports=function(e){return 1-Math.pow(2,-10*e)}},48857(e,t,i){e.exports={In:i(24590),Out:i(89433),InOut:i(87844)}},48820(e,t,i){e.exports={Back:i(54178),Bounce:i(41521),Circular:i(79980),Cubic:i(85433),Elastic:i(99140),Expo:i(48857),Linear:i(81596),Quadratic:i(59133),Quartic:i(98516),Quintic:i(35248),Sine:i(82500),Stepped:i(49752)}},7147(e){e.exports=function(e){return e}},81596(e,t,i){e.exports=i(7147)},34826(e){e.exports=function(e){return e*e}},20544(e){e.exports=function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},92029(e){e.exports=function(e){return e*(2-e)}},59133(e,t,i){e.exports={In:i(34826),Out:i(92029),InOut:i(20544)}},64413(e){e.exports=function(e){return e*e*e*e}},78137(e){e.exports=function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},45840(e){e.exports=function(e){return 1- --e*e*e*e}},98516(e,t,i){e.exports={In:i(64413),Out:i(45840),InOut:i(78137)}},87745(e){e.exports=function(e){return e*e*e*e*e}},16509(e){e.exports=function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},17868(e){e.exports=function(e){return--e*e*e*e*e+1}},35248(e,t,i){e.exports={In:i(87745),Out:i(17868),InOut:i(16509)}},80461(e){e.exports=function(e){return 0===e?0:1===e?1:1-Math.cos(e*Math.PI/2)}},34025(e){e.exports=function(e){return 0===e?0:1===e?1:.5*(1-Math.cos(Math.PI*e))}},52768(e){e.exports=function(e){return 0===e?0:1===e?1:Math.sin(e*Math.PI/2)}},82500(e,t,i){e.exports={In:i(80461),Out:i(52768),InOut:i(34025)}},72251(e){e.exports=function(e,t){return void 0===t&&(t=1),e<=0?0:e>=1?1:1/t*(1+(t*e|0))}},49752(e,t,i){e.exports=i(72251)},75698(e){e.exports=function(e,t){return void 0===t&&(t=1e-4),Math.ceil(e-t)}},43855(e){e.exports=function(e,t,i){return void 0===i&&(i=1e-4),Math.abs(e-t)<i}},25777(e){e.exports=function(e,t){return void 0===t&&(t=1e-4),Math.floor(e+t)}},5470(e){e.exports=function(e,t,i){return void 0===i&&(i=1e-4),e>t-i}},94977(e){e.exports=function(e,t,i){return void 0===i&&(i=1e-4),e<t+i}},48379(e,t,i){e.exports={Ceil:i(75698),Equal:i(43855),Floor:i(25777),GreaterThan:i(5470),LessThan:i(94977)}},75508(e,t,i){var n=i(36383),r=i(79291),s={Angle:i(25588),Distance:i(50994),Easing:i(48820),Fuzzy:i(48379),Interpolation:i(38289),Pow2:i(49001),Snap:i(73697),RandomDataGenerator:i(28453),Average:i(53307),Bernstein:i(85710),Between:i(30976),CatmullRom:i(87842),CeilTo:i(26302),Clamp:i(45319),DegToRad:i(39506),Difference:i(61241),Euler:i(38857),Factorial:i(6411),FloatBetween:i(99472),FloorTo:i(77623),FromPercent:i(62945),GetCentroid:i(2672),GetSpeed:i(38265),GetVec2Bounds:i(55133),Hash:i(72958),HashCell:i(84854),HashSimplex:i(84366),IsEven:i(78702),IsEvenStrict:i(94883),Linear:i(28915),LinearXY:i(94908),MaxAdd:i(86883),Median:i(50040),MinSub:i(37204),Percent:i(65201),RadToDeg:i(43396),RandomXY:i(74362),RandomXYZ:i(60706),RandomXYZW:i(67421),Rotate:i(36305),RotateAround:i(11520),RotateAroundDistance:i(1163),RotateTo:i(70336),RoundAwayFromZero:i(2284),RoundTo:i(41013),SmootherStep:i(54261),SmoothStep:i(7602),ToXY:i(44408),TransformXY:i(85955),Within:i(60417),Wrap:i(15994),Vector2:i(26099),Vector3:i(25836),Vector4:i(61369),Matrix3:i(94434),Matrix4:i(37867),Quaternion:i(15746),RotateVec3:i(72678)};s=r(!1,s,n),e.exports=s},89318(e,t,i){var n=i(85710);e.exports=function(e,t){for(var i=0,r=e.length-1,s=0;s<=r;s++)i+=Math.pow(1-t,r-s)*Math.pow(t,s)*e[s]*n(r,s);return i}},77259(e,t,i){var n=i(87842);e.exports=function(e,t){var i=e.length-1,r=i*t,s=Math.floor(r);return e[0]===e[i]?(t<0&&(s=Math.floor(r=i*(1+t))),n(r-s,e[(s-1+i)%i],e[s],e[(s+1)%i],e[(s+2)%i])):t<0?e[0]-(n(-r,e[0],e[0],e[1],e[1])-e[0]):t>1?e[i]-(n(r-i,e[i],e[i],e[i-1],e[i-1])-e[i]):n(r-s,e[s?s-1:0],e[s],e[i<s+1?i:s+1],e[i<s+2?i:s+2])}},36316(e){e.exports=function(e,t,i,n,r){return function(e,t){var i=1-e;return i*i*i*t}(e,t)+function(e,t){var i=1-e;return 3*i*i*e*t}(e,i)+function(e,t){return 3*(1-e)*e*e*t}(e,n)+function(e,t){return e*e*e*t}(e,r)}},28392(e,t,i){var n=i(28915);e.exports=function(e,t){var i=e.length-1,r=i*t,s=Math.floor(r);return t<0?n(e[0],e[1],r):t>1?n(e[i],e[i-1],i-r):n(e[s],e[s+1>i?i:s+1],r-s)}},32112(e){e.exports=function(e,t,i,n){return function(e,t){var i=1-e;return i*i*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,i)+function(e,t){return e*e*t}(e,n)}},47235(e,t,i){var n=i(7602);e.exports=function(e,t,i){return t+(i-t)*n(e,0,1)}},50178(e,t,i){var n=i(54261);e.exports=function(e,t,i){return t+(i-t)*n(e,0,1)}},38289(e,t,i){e.exports={Bezier:i(89318),CatmullRom:i(77259),CubicBezier:i(36316),Linear:i(28392),QuadraticBezier:i(32112),SmoothStep:i(47235),SmootherStep:i(50178)}},98439(e){e.exports=function(e){var t=Math.log(e)/.6931471805599453;return 1<<Math.ceil(t)}},50030(e){e.exports=function(e,t){return e>0&&0===(e&e-1)&&t>0&&0===(t&t-1)}},81230(e){e.exports=function(e){return e>0&&0===(e&e-1)}},49001(e,t,i){e.exports={GetNext:i(98439),GetPowerOfTwo:i(98439),IsSize:i(50030),IsSizePowerOfTwo:i(50030),IsValue:i(81230),IsValuePowerOfTwo:i(81230)}},28453(e,t,i){var n=new(i(83419))({initialize:function(e){void 0===e&&(e=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],e&&this.init(e)},rnd:function(){var e=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|e,this.s0=this.s1,this.s1=this.s2,this.s2=e-this.c,this.s2},hash:function(e){var t,i=this.n;e=e.toString();for(var n=0;n<e.length;n++)t=.02519603282416938*(i+=e.charCodeAt(n)),t-=i=t>>>0,i=(t*=i)>>>0,i+=4294967296*(t-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(e){"string"===typeof e?this.state(e):this.sow(e)},sow:function(e){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,e)for(var t=0;t<e.length&&null!=e[t];t++){var i=e[t];this.s0-=this.hash(i),this.s0+=~~(this.s0<0),this.s1-=this.hash(i),this.s1+=~~(this.s1<0),this.s2-=this.hash(i),this.s2+=~~(this.s2<0)}},integer:function(){return 4294967296*this.rnd()},frac:function(){return this.rnd()+11102230246251565e-32*(2097152*this.rnd()|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(e,t){return Math.floor(this.realInRange(0,t-e+1)+e)},between:function(e,t){return Math.floor(this.realInRange(0,t-e+1)+e)},realInRange:function(e,t){return this.frac()*(t-e)+e},normal:function(){return 1-2*this.frac()},uuid:function(){var e="",t="";for(t=e="";e++<36;t+=~e%5|3*e&4?(15^e?8^this.frac()*(20^e?16:4):4).toString(16):"-");return t},pick:function(e){return e[this.integerInRange(0,e.length-1)]},sign:function(){return this.pick(this.signs)},weightedPick:function(e){return e[~~(Math.pow(this.frac(),2)*(e.length-.5)+.5)]},timestamp:function(e,t){return this.realInRange(e||9466848e5,t||1577862e6)},angle:function(){return this.integerInRange(-180,180)},rotation:function(){return this.realInRange(-3.1415926,3.1415926)},state:function(e){return"string"===typeof e&&e.match(/^!rnd/)&&(e=e.split(","),this.c=parseFloat(e[1]),this.s0=parseFloat(e[2]),this.s1=parseFloat(e[3]),this.s2=parseFloat(e[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")},shuffle:function(e){for(var t=e.length-1;t>0;t--){var i=Math.floor(this.frac()*(t+1)),n=e[i];e[i]=e[t],e[t]=n}return e}});e.exports=n},63448(e){e.exports=function(e,t,i,n){return void 0===i&&(i=0),0===t?e:(e-=i,e=t*Math.ceil(e/t),n?(i+e)/t:i+e)}},56583(e){e.exports=function(e,t,i,n){return void 0===i&&(i=0),0===t?e:(e-=i,e=t*Math.floor(e/t),n?(i+e)/t:i+e)}},77720(e){e.exports=function(e,t,i,n){return void 0===i&&(i=0),0===t?e:(e-=i,e=t*Math.round(e/t),n?(i+e)/t:i+e)}},73697(e,t,i){e.exports={Ceil:i(63448),Floor:i(56583),To:i(77720)}},71289(e,t,i){var n=i(83419),r=i(92209),s=i(88571),a=new n({Extends:s,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Collision,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(e,t,i,n,r){s.call(this,e,t,i,n,r),this.body=null}});e.exports=a},86689(e,t,i){var n=i(83419),r=i(39506),s=i(20339),a=i(89774),o=i(66022),l=i(95540),h=i(46975),u=i(72441),c=i(47956),d=i(37277),f=i(44594),p=i(26099),m=i(82248),g=new n({initialize:function(e){this.scene=e,this.systems=e.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,e.sys.events.once(f.BOOT,this.boot,this),e.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new m(this.scene,this.config),this.add=new o(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new m(this.scene,this.config),this.add=new o(this.world));var e=this.systems.events;l(this.config,"customUpdate",!1)||e.on(f.UPDATE,this.world.update,this.world),e.on(f.POST_UPDATE,this.world.postUpdate,this.world),e.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var e=this.systems.game.config.physics,t=this.systems.settings.physics;return h(l(t,"arcade",{}),l(e,"arcade",{}))},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(e,t,i,n,r){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),this.world.collideObjects(e,t,i,n,r,!0)},collide:function(e,t,i,n,r){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),this.world.collideObjects(e,t,i,n,r,!1)},collideTiles:function(e,t,i,n,r){return this.world.collideTiles(e,t,i,n,r)},overlapTiles:function(e,t,i,n,r){return this.world.overlapTiles(e,t,i,n,r)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(e,t,i,n,r,s){void 0===n&&(n=60);var a=Math.atan2(i-e.y,t-e.x);return e.body.acceleration.setToPolar(a,n),void 0!==r&&void 0!==s&&e.body.maxVelocity.set(r,s),a},accelerateToObject:function(e,t,i,n,r){return this.accelerateTo(e,t.x,t.y,i,n,r)},closest:function(e,t){t||(t=Array.from(this.world.bodies));for(var i=Number.MAX_VALUE,n=null,r=e.x,s=e.y,o=t.length,l=0;l<o;l++){var h=t[l],u=h.body||h;if(e!==h&&e!==u&&e!==u.gameObject&&e!==u.center){var c=a(r,s,u.center.x,u.center.y);c<i&&(n=h,i=c)}}return n},furthest:function(e,t){t||(t=Array.from(this.world.bodies));for(var i=-1,n=null,r=e.x,s=e.y,o=t.length,l=0;l<o;l++){var h=t[l],u=h.body||h;if(e!==h&&e!==u&&e!==u.gameObject&&e!==u.center){var c=a(r,s,u.center.x,u.center.y);c>i&&(n=h,i=c)}}return n},moveTo:function(e,t,i,n,r){void 0===n&&(n=60),void 0===r&&(r=0);var a=Math.atan2(i-e.y,t-e.x);return r>0&&(n=s(e.x,e.y,t,i)/(r/1e3)),e.body.velocity.setToPolar(a,n),a},moveToObject:function(e,t,i,n){return this.moveTo(e,t.x,t.y,i,n)},velocityFromAngle:function(e,t,i){return void 0===t&&(t=60),void 0===i&&(i=new p),i.setToPolar(r(e),t)},velocityFromRotation:function(e,t,i){return void 0===t&&(t=60),void 0===i&&(i=new p),i.setToPolar(e,t)},overlapRect:function(e,t,i,n,r,s){return c(this.world,e,t,i,n,r,s)},overlapCirc:function(e,t,i,n,r){return u(this.world,e,t,i,n,r)},shutdown:function(){if(this.world){var e=this.systems.events;e.off(f.UPDATE,this.world.update,this.world),e.off(f.POST_UPDATE,this.world.postUpdate,this.world),e.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null,this._category=1}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});d.register("ArcadePhysics",g,"arcadePhysics"),e.exports=g},13759(e,t,i){var n=i(83419),r=i(92209),s=i(68287),a=new n({Extends:s,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Collision,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(e,t,i,n,r){s.call(this,e,t,i,n,r),this.body=null}});e.exports=a},37742(e,t,i){var n=i(83419),r=i(78389),s=i(37747),a=i(63012),o=i(43396),l=i(87841),h=i(37303),u=i(95829),c=i(26099),d=new n({Mixins:[r],initialize:function(e,t){var i=64,n=64,r=void 0!==t;r&&t.displayWidth&&(i=t.displayWidth,n=t.displayHeight),r||(t={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=e,this.gameObject=r?t:void 0,this.isBody=!0,this.transform={x:t.x,y:t.y,rotation:t.angle,scaleX:t.scaleX,scaleY:t.scaleY,displayOriginX:t.displayOriginX,displayOriginY:t.displayOriginY},this.debugShowBody=e.defaults.debugShowBody,this.debugShowVelocity=e.defaults.debugShowVelocity,this.debugBodyColor=e.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new c,this.position=new c(t.x-t.scaleX*t.displayOriginX,t.y-t.scaleY*t.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=t.angle,this.preRotation=t.angle,this.width=i,this.height=n,this.sourceWidth=i,this.sourceHeight=n,t.frame&&(this.sourceWidth=t.frame.realWidth,this.sourceHeight=t.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(n/2),this.center=new c(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new c,this.newVelocity=new c,this.deltaMax=new c,this.acceleration=new c,this.allowDrag=!0,this.drag=new c,this.allowGravity=!0,this.gravity=new c,this.bounce=new c,this.worldBounce=null,this.customBoundsRectangle=e.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new c(1e4,1e4),this.maxSpeed=-1,this.friction=new c(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=s.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new c(1,1),this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=u(!1),this.touching=u(!0),this.wasTouching=u(!0),this.blocked=u(!0),this.syncBounds=!1,this.physicsType=s.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=t.scaleX,this._sy=t.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new l,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var e=this.gameObject,t=this.transform;if(e.parentContainer){var i=e.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);t.x=i.tx,t.y=i.ty,t.rotation=o(i.rotation),t.scaleX=i.scaleX,t.scaleY=i.scaleY,t.displayOriginX=e.displayOriginX,t.displayOriginY=e.displayOriginY}else t.x=e.x,t.y=e.y,t.rotation=e.angle,t.scaleX=e.scaleX,t.scaleY=e.scaleY,t.displayOriginX=e.displayOriginX,t.displayOriginY=e.displayOriginY;var n=!1;if(this.syncBounds){var r=e.getBounds(this._bounds);this.width=r.width,this.height=r.height,n=!0}else{var s=Math.abs(t.scaleX),a=Math.abs(t.scaleY);this._sx===s&&this._sy===a||(this.width=this.sourceWidth*s,this.height=this.sourceHeight*a,this._sx=s,this._sy=a,n=!0)}n&&(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 e=this.transform;this.position.x=e.x+e.scaleX*(this.offset.x-e.displayOriginX),this.position.y=e.y+e.scaleY*(this.offset.y-e.displayOriginY),this.updateCenter()},resetFlags:function(e){void 0===e&&(e=!1);var t=this.wasTouching,i=this.touching,n=this.blocked;e?u(!0,t):(t.none=i.none,t.up=i.up,t.down=i.down,t.left=i.left,t.right=i.right),u(!0,i),u(!0,n),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(e,t){if(e&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var i=this.position;this.prev.x=i.x,this.prev.y=i.y,this.prevFrame.x=i.x,this.prevFrame.y=i.y}e&&this.update(t)},update:function(e){var t=this.prev,i=this.position,n=this.velocity;if(t.set(i.x,i.y),!this.moves)return this._dx=i.x-t.x,void(this._dy=i.y-t.y);if(this.directControl){var r=this.autoFrame;n.set((i.x-r.x)/e,(i.y-r.y)/e),this.world.updateMotion(this,e),this._dx=i.x-r.x,this._dy=i.y-r.y}else this.world.updateMotion(this,e),this.newVelocity.set(n.x*e,n.y*e),i.add(this.newVelocity),this._dx=i.x-t.x,this._dy=i.y-t.y;var s=n.x,o=n.y;if(this.updateCenter(),this.angle=Math.atan2(o,s),this.speed=Math.sqrt(s*s+o*o),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var l=this.blocked;this.world.emit(a.WORLD_BOUNDS,this,l.up,l.down,l.left,l.right)}},postUpdate:function(){var e=this.position,t=e.x-this.prevFrame.x,i=e.y-this.prevFrame.y,n=this.gameObject;if(this.moves){var r=this.deltaMax.x,a=this.deltaMax.y;0!==r&&0!==t&&(t<0&&t<-r?t=-r:t>0&&t>r&&(t=r)),0!==a&&0!==i&&(i<0&&i<-a?i=-a:i>0&&i>a&&(i=a)),n&&(n.x+=t,n.y+=i)}t<0?this.facing=s.FACING_LEFT:t>0&&(this.facing=s.FACING_RIGHT),i<0?this.facing=s.FACING_UP:i>0&&(this.facing=s.FACING_DOWN),this.allowRotation&&n&&(n.angle+=this.deltaZ()),this._tx=t,this._ty=i,this.autoFrame.set(e.x,e.y)},setBoundsRectangle:function(e){return this.customBoundsRectangle=e||this.world.bounds,this},checkWorldBounds:function(){var e=this.position,t=this.velocity,i=this.blocked,n=this.customBoundsRectangle,r=this.world.checkCollision,s=this.worldBounce?-this.worldBounce.x:-this.bounce.x,a=this.worldBounce?-this.worldBounce.y:-this.bounce.y,o=!1;return e.x<n.x&&r.left?(e.x=n.x,t.x*=s,i.left=!0,o=!0):this.right>n.right&&r.right&&(e.x=n.right-this.width,t.x*=s,i.right=!0,o=!0),e.y<n.y&&r.up?(e.y=n.y,t.y*=a,i.up=!0,o=!0):this.bottom>n.bottom&&r.down&&(e.y=n.bottom-this.height,t.y*=a,i.down=!0,o=!0),o&&(this.blocked.none=!1,this.updateCenter()),o},setOffset:function(e,t){return void 0===t&&(t=e),this.offset.set(e,t),this},setGameObject:function(e,t){if(void 0===t&&(t=!0),!e||!e.hasTransformComponent)return this;var i=this.world;return this.gameObject&&this.gameObject.body&&(i.disable(this.gameObject),this.gameObject.body=null),e.body&&i.disable(e),this.gameObject=e,e.body=this,this.setSize(),this.enable=t,this},setSize:function(e,t,i){void 0===i&&(i=!0);var n=this.gameObject;if(n&&(!e&&n.frame&&(e=n.frame.realWidth),!t&&n.frame&&(t=n.frame.realHeight)),this.sourceWidth=e,this.sourceHeight=t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n&&n.getCenter){var r=(n.width-e)/2,s=(n.height-t)/2;this.offset.set(r,s)}return this.isCircle=!1,this.radius=0,this},setCircle:function(e,t,i){return void 0===t&&(t=this.offset.x),void 0===i&&(i=this.offset.y),e>0?(this.isCircle=!0,this.radius=e,this.sourceWidth=2*e,this.sourceHeight=2*e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(t,i),this.updateCenter()):this.isCircle=!1,this},reset:function(e,t){this.stop();var i=this.gameObject;i&&(i.setPosition(e,t),this.rotation=i.angle,this.preRotation=i.angle);var n=this.position;i&&i.getTopLeft?i.getTopLeft(n):n.set(e,t),this.prev.copy(n),this.prevFrame.copy(n),this.autoFrame.copy(n),i&&this.updateBounds(),this.updateCenter(),this.collideWorldBounds&&this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(e){return e.x=this.x,e.y=this.y,e.right=this.right,e.bottom=this.bottom,e},hitTest:function(e,t){return this.isCircle?this.radius>0&&e>=this.left&&e<=this.right&&t>=this.top&&t<=this.bottom&&(this.center.x-e)*(this.center.x-e)+(this.center.y-t)*(this.center.y-t)<=this.radius*this.radius:h(this,e,t)},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.add(this)},drawDebug:function(e){var t=this.position,i=t.x+this.halfWidth,n=t.y+this.halfHeight;this.debugShowBody&&(e.lineStyle(e.defaultStrokeWidth,this.debugBodyColor),this.isCircle?e.strokeCircle(i,n,this.width/2):(this.checkCollision.up&&e.lineBetween(t.x,t.y,t.x+this.width,t.y),this.checkCollision.right&&e.lineBetween(t.x+this.width,t.y,t.x+this.width,t.y+this.height),this.checkCollision.down&&e.lineBetween(t.x,t.y+this.height,t.x+this.width,t.y+this.height),this.checkCollision.left&&e.lineBetween(t.x,t.y,t.x,t.y+this.height))),this.debugShowVelocity&&(e.lineStyle(e.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),e.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(e){return void 0===e&&(e=!0),this.directControl=e,this},setCollideWorldBounds:function(e,t,i,n){void 0===e&&(e=!0),this.collideWorldBounds=e;var r=void 0!==t,s=void 0!==i;return(r||s)&&(this.worldBounce||(this.worldBounce=new c),r&&(this.worldBounce.x=t),s&&(this.worldBounce.y=i)),void 0!==n&&(this.onWorldBounds=n),this},setVelocity:function(e,t){return this.velocity.set(e,t),e=this.velocity.x,t=this.velocity.y,this.speed=Math.sqrt(e*e+t*t),this},setVelocityX:function(e){return this.setVelocity(e,this.velocity.y)},setVelocityY:function(e){return this.setVelocity(this.velocity.x,e)},setMaxVelocity:function(e,t){return this.maxVelocity.set(e,t),this},setMaxVelocityX:function(e){return this.maxVelocity.x=e,this},setMaxVelocityY:function(e){return this.maxVelocity.y=e,this},setMaxSpeed:function(e){return this.maxSpeed=e,this},setSlideFactor:function(e,t){return this.slideFactor.set(e,t),this},setBounce:function(e,t){return this.bounce.set(e,t),this},setBounceX:function(e){return this.bounce.x=e,this},setBounceY:function(e){return this.bounce.y=e,this},setAcceleration:function(e,t){return this.acceleration.set(e,t),this},setAccelerationX:function(e){return this.acceleration.x=e,this},setAccelerationY:function(e){return this.acceleration.y=e,this},setAllowDrag:function(e){return void 0===e&&(e=!0),this.allowDrag=e,this},setAllowGravity:function(e){return void 0===e&&(e=!0),this.allowGravity=e,this},setAllowRotation:function(e){return void 0===e&&(e=!0),this.allowRotation=e,this},setDrag:function(e,t){return this.drag.set(e,t),this},setDamping:function(e){return this.useDamping=e,this},setDragX:function(e){return this.drag.x=e,this},setDragY:function(e){return this.drag.y=e,this},setGravity:function(e,t){return this.gravity.set(e,t),this},setGravityX:function(e){return this.gravity.x=e,this},setGravityY:function(e){return this.gravity.y=e,this},setFriction:function(e,t){return this.friction.set(e,t),this},setFrictionX:function(e){return this.friction.x=e,this},setFrictionY:function(e){return this.friction.y=e,this},setAngularVelocity:function(e){return this.angularVelocity=e,this},setAngularAcceleration:function(e){return this.angularAcceleration=e,this},setAngularDrag:function(e){return this.angularDrag=e,this},setMass:function(e){return this.mass=e,this},setImmovable:function(e){return void 0===e&&(e=!0),this.immovable=e,this},setEnable:function(e){return void 0===e&&(e=!0),this.enable=e,this},processX:function(e,t,i,n){this.x+=e,this.updateCenter(),null!==t&&(this.velocity.x=t*this.slideFactor.x);var r=this.blocked;i&&(r.left=!0,r.none=!1),n&&(r.right=!0,r.none=!1)},processY:function(e,t,i,n){this.y+=e,this.updateCenter(),null!==t&&(this.velocity.y=t*this.slideFactor.y);var r=this.blocked;i&&(r.up=!0,r.none=!1),n&&(r.down=!0,r.none=!1)},x:{get:function(){return this.position.x},set:function(e){this.position.x=e}},y:{get:function(){return this.position.y},set:function(e){this.position.y=e}},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}}});e.exports=d},79342(e,t,i){var n=new(i(83419))({initialize:function(e,t,i,n,r,s,a){this.world=e,this.name="",this.active=!0,this.overlapOnly=t,this.object1=i,this.object2=n,this.collideCallback=r,this.processCallback=s,this.callbackContext=a},setName:function(e){return this.name=e,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}});e.exports=n},66022(e,t,i){var n=i(71289),r=i(13759),s=i(37742),a=i(83419),o=i(37747),l=i(60758),h=i(72624),u=i(71464),c=new a({initialize:function(e){this.world=e,this.scene=e.scene,this.sys=e.scene.sys},collider:function(e,t,i,n,r){return this.world.addCollider(e,t,i,n,r)},overlap:function(e,t,i,n,r){return this.world.addOverlap(e,t,i,n,r)},existing:function(e,t){var i=t?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(e,i),e},staticImage:function(e,t,i,r){var s=new n(this.scene,e,t,i,r);return this.sys.displayList.add(s),this.world.enableBody(s,o.STATIC_BODY),s},image:function(e,t,i,r){var s=new n(this.scene,e,t,i,r);return this.sys.displayList.add(s),this.world.enableBody(s,o.DYNAMIC_BODY),s},staticSprite:function(e,t,i,n){var s=new r(this.scene,e,t,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),this.world.enableBody(s,o.STATIC_BODY),s},sprite:function(e,t,i,n){var s=new r(this.scene,e,t,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),this.world.enableBody(s,o.DYNAMIC_BODY),s},staticGroup:function(e,t){return this.sys.updateList.add(new u(this.world,this.world.scene,e,t))},group:function(e,t){return this.sys.updateList.add(new l(this.world,this.world.scene,e,t))},body:function(e,t,i,n){var r=new s(this.world);return r.position.set(e,t),i&&n&&r.setSize(i,n),this.world.add(r,o.DYNAMIC_BODY),r},staticBody:function(e,t,i,n){var r=new h(this.world);return r.position.set(e,t),i&&n&&r.setSize(i,n),this.world.add(r,o.STATIC_BODY),r},destroy:function(){this.world=null,this.scene=null,this.sys=null}});e.exports=c},79599(e){e.exports=function(e){var t=0;if(Array.isArray(e))for(var i=0;i<e.length;i++)t|=e[i];else t=e;return t}},64897(e,t,i){var n=i(37747);e.exports=function(e,t,i,r){var s=0,a=e.deltaAbsX()+t.deltaAbsX()+r;return 0===e._dx&&0===t._dx?(e.embedded=!0,t.embedded=!0):e._dx>t._dx?(s=e.right-t.x)>a&&!i||!1===e.checkCollision.right||!1===t.checkCollision.left?s=0:(e.touching.none=!1,e.touching.right=!0,t.touching.none=!1,t.touching.left=!0,t.physicsType!==n.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0),e.physicsType!==n.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0)):e._dx<t._dx&&(-(s=e.x-t.width-t.x)>a&&!i||!1===e.checkCollision.left||!1===t.checkCollision.right?s=0:(e.touching.none=!1,e.touching.left=!0,t.touching.none=!1,t.touching.right=!0,t.physicsType!==n.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0),e.physicsType!==n.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0))),e.overlapX=s,t.overlapX=s,s}},45170(e,t,i){var n=i(37747);e.exports=function(e,t,i,r){var s=0,a=e.deltaAbsY()+t.deltaAbsY()+r;return 0===e._dy&&0===t._dy?(e.embedded=!0,t.embedded=!0):e._dy>t._dy?(s=e.bottom-t.y)>a&&!i||!1===e.checkCollision.down||!1===t.checkCollision.up?s=0:(e.touching.none=!1,e.touching.down=!0,t.touching.none=!1,t.touching.up=!0,t.physicsType!==n.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0),e.physicsType!==n.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0)):e._dy<t._dy&&(-(s=e.y-t.bottom)>a&&!i||!1===e.checkCollision.up||!1===t.checkCollision.down?s=0:(e.touching.none=!1,e.touching.up=!0,t.touching.none=!1,t.touching.down=!0,t.physicsType!==n.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0),e.physicsType!==n.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0))),e.overlapY=s,t.overlapY=s,s}},60758(e,t,i){var n=i(13759),r=i(83419),s=i(78389),a=i(37747),o=i(95540),l=i(26479),h=i(41212),u=new r({Extends:l,Mixins:[s],initialize:function(e,t,i,r){if(i||r)if(h(i))r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&h(i[0])){var s=this;i.forEach(function(e){e.internalCreateCallback=s.createCallbackHandler,e.internalRemoveCallback=s.removeCallbackHandler,e.classType=o(e,"classType",n)}),r=null}else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=e,r&&(r.classType=o(r,"classType",n)),this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=2147483647,this.defaults={setCollideWorldBounds:o(r,"collideWorldBounds",!1),setBoundsRectangle:o(r,"customBoundsRectangle",null),setAccelerationX:o(r,"accelerationX",0),setAccelerationY:o(r,"accelerationY",0),setAllowDrag:o(r,"allowDrag",!0),setAllowGravity:o(r,"allowGravity",!0),setAllowRotation:o(r,"allowRotation",!0),setDamping:o(r,"useDamping",!1),setBounceX:o(r,"bounceX",0),setBounceY:o(r,"bounceY",0),setDragX:o(r,"dragX",0),setDragY:o(r,"dragY",0),setEnable:o(r,"enable",!0),setGravityX:o(r,"gravityX",0),setGravityY:o(r,"gravityY",0),setFrictionX:o(r,"frictionX",0),setFrictionY:o(r,"frictionY",0),setMaxSpeed:o(r,"maxSpeed",-1),setMaxVelocityX:o(r,"maxVelocityX",1e4),setMaxVelocityY:o(r,"maxVelocityY",1e4),setVelocityX:o(r,"velocityX",0),setVelocityY:o(r,"velocityY",0),setAngularVelocity:o(r,"angularVelocity",0),setAngularAcceleration:o(r,"angularAcceleration",0),setAngularDrag:o(r,"angularDrag",0),setMass:o(r,"mass",1),setImmovable:o(r,"immovable",!1)},l.call(this,t,i,r),this.type="PhysicsGroup"},createCallbackHandler:function(e){e.body&&e.body.physicsType===a.DYNAMIC_BODY||(e.body&&(e.body.destroy(),e.body=null),this.world.enableBody(e,a.DYNAMIC_BODY));var t=e.body;for(var i in this.defaults)t[i](this.defaults[i])},removeCallbackHandler:function(e){e.body&&this.world.disableBody(e)},setVelocity:function(e,t,i){void 0===i&&(i=0);for(var n=this.getChildren(),r=0;r<n.length;r++)n[r].body.velocity.set(e+r*i,t+r*i);return this},setVelocityX:function(e,t){void 0===t&&(t=0);for(var i=this.getChildren(),n=0;n<i.length;n++)i[n].body.velocity.x=e+n*t;return this},setVelocityY:function(e,t){void 0===t&&(t=0);for(var i=this.getChildren(),n=0;n<i.length;n++)i[n].body.velocity.y=e+n*t;return this}});e.exports=u},3017(e){var t,i,n,r,s,a,o,l,h,u,c,d,f,p,m,g,v,y=function(){return u&&m&&i.blocked.right?(t.processX(-v,o,!1,!0),1):h&&g&&i.blocked.left?(t.processX(v,o,!0),1):f&&g&&t.blocked.right?(i.processX(-v,l,!1,!0),2):d&&m&&t.blocked.left?(i.processX(v,l,!0),2):0},x=function(e){if(n&&r)v*=.5,0===e||3===e?(t.processX(v,s),i.processX(-v,a)):(t.processX(-v,s),i.processX(v,a));else if(n&&!r)0===e||3===e?t.processX(v,o,!0):t.processX(-v,o,!1,!0);else if(!n&&r)0===e||3===e?i.processX(-v,l,!1,!0):i.processX(v,l,!0);else{var m=.5*v;0===e?p?(t.processX(v,0,!0),i.processX(0,null,!1,!0)):f?(t.processX(m,0,!0),i.processX(-m,0,!1,!0)):(t.processX(m,i.velocity.x,!0),i.processX(-m,null,!1,!0)):1===e?c?(t.processX(0,null,!1,!0),i.processX(v,0,!0)):u?(t.processX(-m,0,!1,!0),i.processX(m,0,!0)):(t.processX(-m,null,!1,!0),i.processX(m,t.velocity.x,!0)):2===e?p?(t.processX(-v,0,!1,!0),i.processX(0,null,!0)):d?(t.processX(-m,0,!1,!0),i.processX(m,0,!0)):(t.processX(-m,i.velocity.x,!1,!0),i.processX(m,null,!0)):3===e&&(c?(t.processX(0,null,!0),i.processX(-v,0,!1,!0)):h?(t.processX(m,0,!0),i.processX(-m,0,!1,!0)):(t.processX(m,i.velocity.x,!0),i.processX(-m,null,!1,!0)))}return!0};e.exports={BlockCheck:y,Check:function(){var e=t.velocity.x,n=i.velocity.x,r=Math.sqrt(n*n*i.mass/t.mass)*(n>0?1:-1),o=Math.sqrt(e*e*t.mass/i.mass)*(e>0?1:-1),l=.5*(r+o);return o-=l,s=l+(r-=l)*t.bounce.x,a=l+o*i.bounce.x,h&&g?x(0):d&&m?x(1):u&&m?x(2):!(!f||!g)&&x(3)},Set:function(e,s,a){i=s;var x=(t=e).velocity.x,b=i.velocity.x;return n=t.pushable,h=t._dx<0,u=t._dx>0,c=0===t._dx,m=Math.abs(t.right-i.x)<=Math.abs(i.right-t.x),o=b-x*t.bounce.x,r=i.pushable,d=i._dx<0,f=i._dx>0,p=0===i._dx,g=!m,l=x-b*i.bounce.x,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(e){if(1===e?i.velocity.x=0:m?i.processX(v,l,!0):i.processX(-v,l,!1,!0),t.moves){var n=t.directControl?t.y-t.autoFrame.y:t.y-t.prev.y;i.y+=n*t.friction.y,i._dy=i.y-i.prev.y}},RunImmovableBody2:function(e){if(2===e?t.velocity.x=0:g?t.processX(v,o,!0):t.processX(-v,o,!1,!0),i.moves){var n=i.directControl?i.y-i.autoFrame.y:i.y-i.prev.y;t.y+=n*i.friction.y,t._dy=t.y-t.prev.y}}}},47962(e){var t,i,n,r,s,a,o,l,h,u,c,d,f,p,m,g,v,y=function(){return u&&m&&i.blocked.down?(t.processY(-v,o,!1,!0),1):h&&g&&i.blocked.up?(t.processY(v,o,!0),1):f&&g&&t.blocked.down?(i.processY(-v,l,!1,!0),2):d&&m&&t.blocked.up?(i.processY(v,l,!0),2):0},x=function(e){if(n&&r)v*=.5,0===e||3===e?(t.processY(v,s),i.processY(-v,a)):(t.processY(-v,s),i.processY(v,a));else if(n&&!r)0===e||3===e?t.processY(v,o,!0):t.processY(-v,o,!1,!0);else if(!n&&r)0===e||3===e?i.processY(-v,l,!1,!0):i.processY(v,l,!0);else{var m=.5*v;0===e?p?(t.processY(v,0,!0),i.processY(0,null,!1,!0)):f?(t.processY(m,0,!0),i.processY(-m,0,!1,!0)):(t.processY(m,i.velocity.y,!0),i.processY(-m,null,!1,!0)):1===e?c?(t.processY(0,null,!1,!0),i.processY(v,0,!0)):u?(t.processY(-m,0,!1,!0),i.processY(m,0,!0)):(t.processY(-m,null,!1,!0),i.processY(m,t.velocity.y,!0)):2===e?p?(t.processY(-v,0,!1,!0),i.processY(0,null,!0)):d?(t.processY(-m,0,!1,!0),i.processY(m,0,!0)):(t.processY(-m,i.velocity.y,!1,!0),i.processY(m,null,!0)):3===e&&(c?(t.processY(0,null,!0),i.processY(-v,0,!1,!0)):h?(t.processY(m,0,!0),i.processY(-m,0,!1,!0)):(t.processY(m,i.velocity.y,!0),i.processY(-m,null,!1,!0)))}return!0};e.exports={BlockCheck:y,Check:function(){var e=t.velocity.y,n=i.velocity.y,r=Math.sqrt(n*n*i.mass/t.mass)*(n>0?1:-1),o=Math.sqrt(e*e*t.mass/i.mass)*(e>0?1:-1),l=.5*(r+o);return o-=l,s=l+(r-=l)*t.bounce.y,a=l+o*i.bounce.y,h&&g?x(0):d&&m?x(1):u&&m?x(2):!(!f||!g)&&x(3)},Set:function(e,s,a){i=s;var x=(t=e).velocity.y,b=i.velocity.y;return n=t.pushable,h=t._dy<0,u=t._dy>0,c=0===t._dy,m=Math.abs(t.bottom-i.y)<=Math.abs(i.bottom-t.y),o=b-x*t.bounce.y,r=i.pushable,d=i._dy<0,f=i._dy>0,p=0===i._dy,g=!m,l=x-b*i.bounce.y,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(e){if(1===e?i.velocity.y=0:m?i.processY(v,l,!0):i.processY(-v,l,!1,!0),t.moves){var n=t.directControl?t.x-t.autoFrame.x:t.x-t.prev.x;i.x+=n*t.friction.x,i._dx=i.x-i.prev.x}},RunImmovableBody2:function(e){if(2===e?t.velocity.y=0:g?t.processY(v,o,!0):t.processY(-v,o,!1,!0),i.moves){var n=i.directControl?i.x-i.autoFrame.x:i.x-i.prev.x;t.x+=n*i.friction.x,t._dx=t.x-t.prev.x}}}},14087(e,t,i){var n=i(64897),r=i(3017);e.exports=function(e,t,i,s,a){void 0===a&&(a=n(e,t,i,s));var o=e.immovable,l=t.immovable;if(i||0===a||o&&l||e.customSeparateX||t.customSeparateX)return 0!==a||e.embedded&&t.embedded;var h=r.Set(e,t,a);return o||l?(o?r.RunImmovableBody1(h):l&&r.RunImmovableBody2(h),!0):h>0||r.Check()}},89936(e,t,i){var n=i(45170),r=i(47962);e.exports=function(e,t,i,s,a){void 0===a&&(a=n(e,t,i,s));var o=e.immovable,l=t.immovable;if(i||0===a||o&&l||e.customSeparateY||t.customSeparateY)return 0!==a||e.embedded&&t.embedded;var h=r.Set(e,t,a);return o||l?(o?r.RunImmovableBody1(h):l&&r.RunImmovableBody2(h),!0):h>0||r.Check()}},95829(e){e.exports=function(e,t){return void 0===t&&(t={}),t.none=e,t.up=!1,t.down=!1,t.left=!1,t.right=!1,e||(t.up=!0,t.down=!0,t.left=!0,t.right=!0),t}},72624(e,t,i){var n=i(87902),r=i(83419),s=i(78389),a=i(37747),o=i(37303),l=i(95829),h=i(26099),u=new r({Mixins:[s],initialize:function(e,t){var i=64,n=64,r=void 0!==t;r&&t.displayWidth&&(i=t.displayWidth,n=t.displayHeight),r||(t={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=e,this.gameObject=r?t:void 0,this.isBody=!0,this.debugShowBody=e.defaults.debugShowStaticBody,this.debugBodyColor=e.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new h,this.position=new h(t.x-i*t.originX,t.y-n*t.originY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new h(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=h.ZERO,this.allowGravity=!1,this.gravity=h.ZERO,this.bounce=h.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=l(!1),this.touching=l(!0),this.wasTouching=l(!0),this.blocked=l(!0),this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!0),!e||!e.hasTransformComponent)return this;var n=this.world;return this.gameObject&&this.gameObject.body&&(n.disable(this.gameObject),this.gameObject.body=null),e.body&&n.disable(e),this.gameObject=e,e.body=this,this.setSize(),t&&this.updateFromGameObject(),this.enable=i,this},updateFromGameObject:function(){this.world.staticTree.remove(this);var e=this.gameObject;return e.getTopLeft(this.position),this.width=e.displayWidth,this.height=e.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(e,t){return void 0===t&&(t=e),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(e,t),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(e,t,i){void 0===i&&(i=!0);var n=this.gameObject;if(n&&n.frame&&(e||(e=n.frame.realWidth),t||(t=n.frame.realHeight)),this.world.staticTree.remove(this),this.width=e,this.height=t,this.halfWidth=Math.floor(e/2),this.halfHeight=Math.floor(t/2),i&&n&&n.getCenter){var r=n.displayWidth/2,s=n.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(r-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(e,t,i){return void 0===t&&(t=this.offset.x),void 0===i&&(i=this.offset.y),e>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=e,this.width=2*e,this.height=2*e,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(t,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(e,t){var i=this.gameObject;void 0===e&&(e=i.x),void 0===t&&(t=i.y),this.world.staticTree.remove(this),i.setPosition(e,t),i.getTopLeft(this.position),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(e){return e.x=this.x,e.y=this.y,e.right=this.right,e.bottom=this.bottom,e},hitTest:function(e,t){return this.isCircle?n(this,e,t):o(this,e,t)},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.add(this)},drawDebug:function(e){var t=this.position,i=t.x+this.halfWidth,n=t.y+this.halfHeight;this.debugShowBody&&(e.lineStyle(e.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?e.strokeCircle(i,n,this.width/2):e.strokeRect(t.x,t.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(e){return e<=0&&(e=.1),this.mass=e,this},x:{get:function(){return this.position.x},set:function(e){this.world.staticTree.remove(this),this.position.x=e,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(e){this.world.staticTree.remove(this),this.position.y=e,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}}});e.exports=u},71464(e,t,i){var n=i(13759),r=i(83419),s=i(78389),a=i(37747),o=i(95540),l=i(26479),h=i(41212),u=new r({Extends:l,Mixins:[s],initialize:function(e,t,i,r){i||r?h(i)?(r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler,r.createMultipleCallback=this.createMultipleCallbackHandler,r.classType=o(r,"classType",n)):Array.isArray(i)&&h(i[0])?(r=i,i=null,r.forEach(function(e){e.internalCreateCallback=this.createCallbackHandler,e.internalRemoveCallback=this.removeCallbackHandler,e.createMultipleCallback=this.createMultipleCallbackHandler,e.classType=o(e,"classType",n)},this)):r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:n},this.world=e,this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,l.call(this,t,i,r),this.type="StaticPhysicsGroup"},createCallbackHandler:function(e){e.body&&e.body.physicsType===a.STATIC_BODY||(e.body&&(e.body.destroy(),e.body=null),this.world.enableBody(e,a.STATIC_BODY))},removeCallbackHandler:function(e){e.body&&this.world.disableBody(e)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var e=Array.from(this.children),t=0;t<e.length;t++)e[t].body.reset();return this}});e.exports=u},82248(e,t,i){var n=i(55495),r=i(37742),s=i(45319),a=i(83419),o=i(79342),l=i(37747),h=i(20339),u=i(52816),c=i(50792),d=i(63012),f=i(43855),p=i(5470),m=i(94977),g=i(64897),v=i(45170),y=i(96523),x=i(35154),b=i(36383),w=i(25774),T=i(96602),_=i(87841),S=i(59542),E=i(40012),C=i(14087),A=i(89936),k=i(72624),R=i(2483),O=i(61340),P=i(26099),M=i(15994),N=new a({Extends:c,initialize:function(e,t){c.call(this),this.scene=e,this.bodies=new Set,this.staticBodies=new Set,this.pendingDestroy=new Set,this.colliders=new w,this.gravity=new P(x(t,"gravity.x",0),x(t,"gravity.y",0)),this.bounds=new _(x(t,"x",0),x(t,"y",0),x(t,"width",e.sys.scale.width),x(t,"height",e.sys.scale.height)),this.checkCollision={up:x(t,"checkCollision.up",!0),down:x(t,"checkCollision.down",!0),left:x(t,"checkCollision.left",!0),right:x(t,"checkCollision.right",!0)},this.fps=x(t,"fps",60),this.fixedStep=x(t,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=x(t,"timeScale",1),this.OVERLAP_BIAS=x(t,"overlapBias",4),this.TILE_BIAS=x(t,"tileBias",16),this.forceX=x(t,"forceX",!1),this.isPaused=x(t,"isPaused",!1),this._total=0,this.drawDebug=x(t,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:x(t,"debugShowBody",!0),debugShowStaticBody:x(t,"debugShowStaticBody",!0),debugShowVelocity:x(t,"debugShowVelocity",!0),bodyDebugColor:x(t,"debugBodyColor",16711935),staticBodyDebugColor:x(t,"debugStaticBodyColor",255),velocityDebugColor:x(t,"debugVelocityColor",65280)},this.maxEntries=x(t,"maxEntries",16),this.useTree=x(t,"useTree",!0),this.tree=new S(this.maxEntries),this.staticTree=new S(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new O,this._tempMatrix2=new O,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(e,t){void 0===t&&(t=l.DYNAMIC_BODY),Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var n=e[i];if(n.isParent)for(var r=n.getChildren(),s=0;s<r.length;s++){var a=r[s];a.isParent?this.enable(a,t):this.enableBody(a,t)}else this.enableBody(n,t)}},enableBody:function(e,t){return void 0===t&&(t=l.DYNAMIC_BODY),e.hasTransformComponent&&(e.body||(t===l.DYNAMIC_BODY?e.body=new r(this,e):t===l.STATIC_BODY&&(e.body=new k(this,e))),this.add(e.body)),e},add:function(e){return e.physicsType===l.DYNAMIC_BODY?this.bodies.add(e):e.physicsType===l.STATIC_BODY&&(this.staticBodies.add(e),this.staticTree.insert(e)),e.enable=!0,e},disable:function(e){Array.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++){var i=e[t];if(i.isParent)for(var n=i.getChildren(),r=0;r<n.length;r++){var s=n[r];s.isParent?this.disable(s):this.disableBody(s.body)}else this.disableBody(i.body)}},disableBody:function(e){this.remove(e),e.enable=!1},remove:function(e){e.physicsType===l.DYNAMIC_BODY?(this.tree.remove(e),this.bodies.delete(e)):e.physicsType===l.STATIC_BODY&&(this.staticBodies.delete(e),this.staticTree.remove(e))},createDebugGraphic:function(){var e=this.scene.sys.add.graphics({x:0,y:0});return e.setDepth(Number.MAX_VALUE),this.debugGraphic=e,this.drawDebug=!0,e},setBounds:function(e,t,i,n,r,s,a,o){return this.bounds.setTo(e,t,i,n),void 0!==r&&this.setBoundsCollision(r,s,a,o),this},setBoundsCollision:function(e,t,i,n){return void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===i&&(i=!0),void 0===n&&(n=!0),this.checkCollision.left=e,this.checkCollision.right=t,this.checkCollision.up=i,this.checkCollision.down=n,this},pause:function(){return this.isPaused=!0,this.emit(d.PAUSE),this},resume:function(){return this.isPaused=!1,this.emit(d.RESUME),this},addCollider:function(e,t,i,n,r){void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i);var s=new o(this,!1,e,t,i,n,r);return this.colliders.add(s),s},addOverlap:function(e,t,i,n,r){void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i);var s=new o(this,!0,e,t,i,n,r);return this.colliders.add(s),s},removeCollider:function(e){return this.colliders.remove(e),this},setFPS:function(e){return this.fps=e,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this},update:function(e,t){if(!this.isPaused&&0!==this.bodies.size){var i=this._frameTime,n=this._frameTimeMS*this.timeScale;this._elapsed+=t;var r=this.bodies,s=this._elapsed>=n;if(this.fixedStep||(i=.001*t,s=!0,this._elapsed=0),r.forEach(function(e){e.enable&&e.preUpdate(s,i)}),s){this._elapsed-=n,this.stepsLastFrame=1,this.useTree&&(this.tree.clear(),this.tree.load(Array.from(r)));for(var a=this.colliders.update(),o=0;o<a.length;o++){var l=a[o];l.active&&l.update()}this.emit(d.WORLD_STEP,i)}for(;this._elapsed>=n;)this._elapsed-=n,this.step(i)}},step:function(e){var t=this.bodies;t.forEach(function(t){t.enable&&t.update(e)}),this.useTree&&(this.tree.clear(),this.tree.load(Array.from(t)));for(var i=this.colliders.update(),n=0;n<i.length;n++){var r=i[n];r.active&&r.update()}this.emit(d.WORLD_STEP,e),this.stepsLastFrame++},singleStep:function(){this.update(0,this._frameTimeMS),this.postUpdate()},postUpdate:function(){var e=this.bodies,t=this.staticBodies;if(this.stepsLastFrame&&(this.stepsLastFrame=0,e.forEach(function(e){e.enable&&e.postUpdate()})),this.drawDebug){var i=this.debugGraphic;i.clear(),e.forEach(function(e){e.willDrawDebug()&&e.drawDebug(i)}),t.forEach(function(e){e.willDrawDebug()&&e.drawDebug(i)})}var n=this.pendingDestroy;if(n.size>0){var r=this.tree,s=this.staticTree;n.forEach(function(i){i.physicsType===l.DYNAMIC_BODY?(r.remove(i),e.delete(i)):i.physicsType===l.STATIC_BODY&&(s.remove(i),t.delete(i)),i.world=void 0,i.gameObject=void 0}),n.clear()}},updateMotion:function(e,t){e.allowRotation&&this.computeAngularVelocity(e,t),this.computeVelocity(e,t)},computeAngularVelocity:function(e,t){var i=e.angularVelocity,n=e.angularAcceleration,r=e.angularDrag,a=e.maxAngular;n?i+=n*t:e.allowDrag&&r&&(p(i-(r*=t),0,.1)?i-=r:m(i+r,0,.1)?i+=r:i=0);var o=(i=s(i,-a,a))-e.angularVelocity;e.angularVelocity+=o,e.rotation+=e.angularVelocity*t},computeVelocity:function(e,t){var i=e.velocity.x,n=e.acceleration.x,r=e.drag.x,a=e.maxVelocity.x,o=e.velocity.y,l=e.acceleration.y,h=e.drag.y,u=e.maxVelocity.y,c=e.speed,d=e.maxSpeed,g=e.allowDrag,v=e.useDamping;e.allowGravity&&(i+=(this.gravity.x+e.gravity.x)*t,o+=(this.gravity.y+e.gravity.y)*t),n?i+=n*t:g&&r&&(v?(i*=r=Math.pow(r,t),c=Math.sqrt(i*i+o*o),f(c,0,.001)&&(i=0)):p(i-(r*=t),0,.01)?i-=r:m(i+r,0,.01)?i+=r:i=0),l?o+=l*t:g&&h&&(v?(o*=h=Math.pow(h,t),c=Math.sqrt(i*i+o*o),f(c,0,.001)&&(o=0)):p(o-(h*=t),0,.01)?o-=h:m(o+h,0,.01)?o+=h:o=0),i=s(i,-a,a),o=s(o,-u,u),e.velocity.set(i,o),d>-1&&e.velocity.length()>d&&(e.velocity.normalize().scale(d),c=d),e.speed=c},separate:function(e,t,i,n,r){var s,a,o=!1,l=!0;if(!e.enable||!t.enable||e.checkCollision.none||t.checkCollision.none||!this.intersects(e,t)||0===(e.collisionMask&t.collisionCategory)||0===(t.collisionMask&e.collisionCategory))return o;if(i&&!1===i.call(n,e.gameObject||e,t.gameObject||t))return o;if(e.isCircle||t.isCircle){var h=this.separateCircle(e,t,r);h.result?(o=!0,l=!1):(s=h.x,a=h.y,l=!0)}if(l){var u=!1,c=!1,f=this.OVERLAP_BIAS;r?(u=C(e,t,r,f,s),c=A(e,t,r,f,a)):this.forceX||Math.abs(this.gravity.y+e.gravity.y)<Math.abs(this.gravity.x+e.gravity.x)?(u=C(e,t,r,f,s),this.intersects(e,t)&&(c=A(e,t,r,f,a))):(c=A(e,t,r,f,a),this.intersects(e,t)&&(u=C(e,t,r,f,s))),o=u||c}return o&&(r?(e.onOverlap||t.onOverlap)&&this.emit(d.OVERLAP,e.gameObject,t.gameObject,e,t):(e.onCollide||t.onCollide)&&this.emit(d.COLLIDE,e.gameObject,t.gameObject,e,t)),o},separateCircle:function(e,t,i){g(e,t,!1,0),v(e,t,!1,0);var r=e.isCircle,s=t.isCircle,a=e.center,o=t.center,l=e.immovable,c=t.immovable,d=e.velocity,f=t.velocity,p=0,m=!0;if(r!==s){m=!1;var y=a.x,x=a.y,w=e.halfWidth,T=t.position.x,_=t.position.y,S=t.right,E=t.bottom;s&&(y=o.x,x=o.y,w=t.halfWidth,T=e.position.x,_=e.position.y,S=e.right,E=e.bottom),x<_?y<T?p=h(y,x,T,_)-w:y>S&&(p=h(y,x,S,_)-w):x>E&&(y<T?p=h(y,x,T,E)-w:y>S&&(p=h(y,x,S,E)-w)),p*=-1}else p=e.halfWidth+t.halfWidth-u(a,o);e.overlapR=p,t.overlapR=p;var C=n(a,o),A=(p+b.EPSILON)*Math.cos(C),k=(p+b.EPSILON)*Math.sin(C),R={overlap:p,result:!1,x:A,y:k};if(i&&(!m||m&&0!==p))return R.result=!0,R;if(!m&&0===p||l&&c||e.customSeparateX||t.customSeparateX)return R.x=void 0,R.y=void 0,R;var O=!e.pushable&&!t.pushable;if(m){var P=a.x-o.x,M=a.y-o.y,N=Math.sqrt(Math.pow(P,2)+Math.pow(M,2)),I=(o.x-a.x)/N||0,L=(o.y-a.y)/N||0,D=2*(d.x*I+d.y*L-f.x*I-f.y*L)/(e.mass+t.mass);!l&&!c&&e.pushable&&t.pushable||(D*=2),!l&&e.pushable&&(d.x=d.x-D/e.mass*I,d.y=d.y-D/e.mass*L,d.multiply(e.bounce)),!c&&t.pushable&&(f.x=f.x+D/t.mass*I,f.y=f.y+D/t.mass*L,f.multiply(t.bounce)),l||c||(A*=.5,k*=.5),(!l||e.pushable||O)&&(e.x-=A,e.y-=k,e.updateCenter()),(!c||t.pushable||O)&&(t.x+=A,t.y+=k,t.updateCenter()),R.result=!0}else l||!e.pushable&&!O||(e.x-=A,e.y-=k,e.updateCenter()),(!c||t.pushable||O)&&(t.x+=A,t.y+=k,t.updateCenter()),R.x=void 0,R.y=void 0;return R},intersects:function(e,t){return e!==t&&(e.isCircle||t.isCircle?e.isCircle?t.isCircle?u(e.center,t.center)<=e.halfWidth+t.halfWidth:this.circleBodyIntersects(e,t):this.circleBodyIntersects(t,e):!(e.right<=t.left||e.bottom<=t.top||e.left>=t.right||e.top>=t.bottom))},circleBodyIntersects:function(e,t){var i=s(e.center.x,t.left,t.right),n=s(e.center.y,t.top,t.bottom);return(e.center.x-i)*(e.center.x-i)+(e.center.y-n)*(e.center.y-n)<=e.halfWidth*e.halfWidth},overlap:function(e,t,i,n,r){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),this.collideObjects(e,t,i,n,r,!0)},collide:function(e,t,i,n,r){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),this.collideObjects(e,t,i,n,r,!1)},collideObjects:function(e,t,i,n,r,s){var a,o;!e.isParent||void 0!==e.physicsType&&void 0!==t&&e!==t||(e=Array.from(e.children)),t&&t.isParent&&void 0===t.physicsType&&(t=Array.from(t.children));var l=Array.isArray(e),h=Array.isArray(t);if(this._total=0,l||h)if(!l&&h)for(a=0;a<t.length;a++)this.collideHandler(e,t[a],i,n,r,s);else if(l&&!h)if(t)for(a=0;a<e.length;a++)this.collideHandler(e[a],t,i,n,r,s);else for(a=0;a<e.length;a++){var u=e[a];for(o=a+1;o<e.length;o++)a!==o&&this.collideHandler(u,e[o],i,n,r,s)}else for(a=0;a<e.length;a++)for(o=0;o<t.length;o++)this.collideHandler(e[a],t[o],i,n,r,s);else this.collideHandler(e,t,i,n,r,s);return this._total>0},collideHandler:function(e,t,i,n,r,s){if(void 0===t&&e.isParent)return this.collideGroupVsGroup(e,e,i,n,r,s);if(!e||!t)return!1;if(e.body||e.isBody){if(t.body||t.isBody)return this.collideSpriteVsSprite(e,t,i,n,r,s);if(t.isParent)return this.collideSpriteVsGroup(e,t,i,n,r,s);if(t.isTilemap)return this.collideSpriteVsTilemapLayer(e,t,i,n,r,s)}else if(e.isParent){if(t.body||t.isBody)return this.collideSpriteVsGroup(t,e,i,n,r,s);if(t.isParent)return this.collideGroupVsGroup(e,t,i,n,r,s);if(t.isTilemap)return this.collideGroupVsTilemapLayer(e,t,i,n,r,s)}else if(e.isTilemap){if(t.body||t.isBody)return this.collideSpriteVsTilemapLayer(t,e,i,n,r,s);if(t.isParent)return this.collideGroupVsTilemapLayer(t,e,i,n,r,s)}},canCollide:function(e,t){return e&&t&&0!==(e.collisionMask&t.collisionCategory)&&0!==(t.collisionMask&e.collisionCategory)},collideSpriteVsSprite:function(e,t,i,n,r,s){var a=e.isBody?e:e.body,o=t.isBody?t:t.body;return!!this.canCollide(a,o)&&(this.separate(a,o,n,r,s)&&(i&&i.call(r,e,t),this._total++),!0)},collideSpriteVsGroup:function(e,t,i,n,r,s){var a,o,h,u=e.isBody?e:e.body;if(0!==t.getLength()&&u&&u.enable&&!u.checkCollision.none&&this.canCollide(u,t))if(this.useTree||t.physicsType===l.STATIC_BODY){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=t.physicsType===l.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(o=d.length,a=0;a<o;a++)u!==(h=d[a])&&h.enable&&!h.checkCollision.none&&t.contains(h.gameObject)&&this.separate(u,h,n,r,s)&&(i&&i.call(r,u.gameObject,h.gameObject),this._total++)}else{var f=t.getChildren(),p=f.indexOf(e);for(o=f.length,a=0;a<o;a++)(h=f[a].body)&&a!==p&&h.enable&&this.separate(u,h,n,r,s)&&(i&&i.call(r,u.gameObject,h.gameObject),this._total++)}},collideGroupVsTilemapLayer:function(e,t,i,n,r,s){if(!this.canCollide(e,t))return!1;var a=e.getChildren();if(0===a.length)return!1;for(var o=!1,l=0;l<a.length;l++)(a[l].body||a[l].isBody)&&this.collideSpriteVsTilemapLayer(a[l],t,i,n,r,s)&&(o=!0);return o},collideTiles:function(e,t,i,n,r){return!(0===t.length||e.body&&!e.body.enable||e.isBody&&!e.enable)&&this.collideSpriteVsTilesHandler(e,t,i,n,r,!1,!1)},overlapTiles:function(e,t,i,n,r){return!(0===t.length||e.body&&!e.body.enable||e.isBody&&!e.enable)&&this.collideSpriteVsTilesHandler(e,t,i,n,r,!0,!1)},collideSpriteVsTilemapLayer:function(e,t,i,n,r,s){var a=e.isBody?e:e.body;if(!a.enable||a.checkCollision.none||!this.canCollide(a,t))return!1;var o=t.layer,l=a.x-o.tileWidth*t.scaleX,h=a.y-o.tileHeight*t.scaleY,u=a.width+o.tileWidth*t.scaleX,c=a.height+o.tileHeight*t.scaleY,d=s?null:this.tileFilterOptions,f=y(l,h,u,c,d,t.scene.cameras.main,t.layer);return 0!==f.length&&this.collideSpriteVsTilesHandler(e,f,i,n,r,s,!0)},collideSpriteVsTilesHandler:function(e,t,i,n,r,s,a){for(var o,l,h=e.isBody?e:e.body,u={left:0,right:0,top:0,bottom:0},c=!1,f=0;f<t.length;f++){var p=(l=(o=t[f]).tilemapLayer).tileToWorldXY(o.x,o.y);u.left=p.x,u.top=p.y,u.right=u.left+o.width*l.scaleX,u.bottom=u.top+o.height*l.scaleY,R(u,h)&&(!n||n.call(r,e,o))&&T(o,e)&&(s||E(f,h,o,u,l,this.TILE_BIAS,a))&&(this._total++,c=!0,i&&i.call(r,e,o),s&&h.onOverlap?this.emit(d.TILE_OVERLAP,e,o,h):h.onCollide&&this.emit(d.TILE_COLLIDE,e,o,h))}return c},collideGroupVsGroup:function(e,t,i,n,r,s){if(0!==e.getLength()&&0!==t.getLength()&&this.canCollide(e,t))for(var a=e.getChildren(),o=0;o<a.length;o++)this.collideSpriteVsGroup(a[o],t,i,n,r,s)},wrap:function(e,t){e.body?this.wrapObject(e,t):e.getChildren?this.wrapArray(e.getChildren(),t):Array.isArray(e)?this.wrapArray(e,t):this.wrapObject(e,t)},wrapArray:function(e,t){for(var i=0;i<e.length;i++)this.wrapObject(e[i],t)},wrapObject:function(e,t){void 0===t&&(t=0),e.x=M(e.x,this.bounds.left-t,this.bounds.right+t),e.y=M(e.y,this.bounds.top-t,this.bounds.bottom+t)},shutdown:function(){this.tree.clear(),this.staticTree.clear(),this.bodies.clear(),this.staticBodies.clear(),this.colliders.destroy(),this.removeAllListeners()},destroy:function(){this.shutdown(),this.scene=null,this.debugGraphic&&(this.debugGraphic.destroy(),this.debugGraphic=null)}});e.exports=N},1093(e){e.exports={setAcceleration:function(e,t){return this.body.acceleration.set(e,t),this},setAccelerationX:function(e){return this.body.acceleration.x=e,this},setAccelerationY:function(e){return this.body.acceleration.y=e,this}}},59023(e){e.exports={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}}},62069(e){e.exports={setBounce:function(e,t){return this.body.bounce.set(e,t),this},setBounceX:function(e){return this.body.bounce.x=e,this},setBounceY:function(e){return this.body.bounce.y=e,this},setCollideWorldBounds:function(e,t,i,n){return this.body.setCollideWorldBounds(e,t,i,n),this}}},78389(e,t,i){var n=i(79599),r={setCollisionCategory:function(e){return(this.body?this.body:this).collisionCategory=e,this},willCollideWith:function(e){return 0!==((this.body?this.body:this).collisionMask&e)},addCollidesWith:function(e){var t=this.body?this.body:this;return t.collisionMask=t.collisionMask|e,this},removeCollidesWith:function(e){var t=this.body?this.body:this;return t.collisionMask=t.collisionMask&~e,this},setCollidesWith:function(e){return(this.body?this.body:this).collisionMask=n(e),this},resetCollisionCategory:function(){var e=this.body?this.body:this;return e.collisionCategory=1,e.collisionMask=2147483647,this}};e.exports=r},87118(e){e.exports={setDebug:function(e,t,i){return this.debugShowBody=e,this.debugShowVelocity=t,this.debugBodyColor=i,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}}}},52819(e){e.exports={setDrag:function(e,t){return this.body.drag.set(e,t),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}}},4074(e){var t={setDirectControl:function(e){return this.body.setDirectControl(e),this},enableBody:function(e,t,i,n,r){return e&&this.body.reset(t,i),n&&(this.body.gameObject.active=!0),r&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(e,t){return void 0===e&&(e=!1),void 0===t&&(t=!1),this.body.stop(),this.body.enable=!1,e&&(this.body.gameObject.active=!1),t&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};e.exports=t},40831(e){e.exports={setFriction:function(e,t){return this.body.friction.set(e,t),this},setFrictionX:function(e){return this.body.friction.x=e,this},setFrictionY:function(e){return this.body.friction.y=e,this}}},26775(e){e.exports={setGravity:function(e,t){return this.body.gravity.set(e,t),this},setGravityX:function(e){return this.body.gravity.x=e,this},setGravityY:function(e){return this.body.gravity.y=e,this}}},9437(e){var t={setImmovable:function(e){return void 0===e&&(e=!0),this.body.immovable=e,this}};e.exports=t},30621(e){e.exports={setMass:function(e){return this.body.mass=e,this}}},72441(e,t,i){var n=i(47956),r=i(96503),s=i(2044),a=i(81491);e.exports=function(e,t,i,o,l,h){var u=n(e,t-o,i-o,2*o,2*o,l,h);if(0===u.length)return u;for(var c=new r(t,i,o),d=new r,f=[],p=0;p<u.length;p++){var m=u[p];m.isCircle?(d.setTo(m.center.x,m.center.y,m.halfWidth),s(c,d)&&f.push(m)):a(c,m)&&f.push(m)}return f}},47956(e){e.exports=function(e,t,i,n,r,s,a){void 0===s&&(s=!0),void 0===a&&(a=!1);var o=[],l=[],h=e.treeMinMax;if(h.minX=t,h.minY=i,h.maxX=t+n,h.maxY=i+r,a&&(l=e.staticTree.search(h)),s&&e.useTree)o=e.tree.search(h);else if(s)for(var u=Array.from(e.bodies),c={position:{x:t,y:i},left:t,top:i,right:t+n,bottom:i+r,isCircle:!1},d=e.intersects,f=0;f<u.length;f++){var p=u[f];d(p,c)&&o.push(p)}return l.concat(o)}},62121(e){var t={setPushable:function(e){return void 0===e&&(e=!0),this.body.pushable=e,this}};e.exports=t},29384(e){e.exports={setOffset:function(e,t){return this.body.setOffset(e,t),this},setSize:function(e,t,i){return this.body.setSize(e,t,i),this},setBodySize:function(e,t,i){return this.body.setSize(e,t,i),this},setCircle:function(e,t,i){return this.body.setCircle(e,t,i),this}}},15098(e){e.exports={setVelocity:function(e,t){return this.body.setVelocity(e,t),this},setVelocityX:function(e){return this.body.setVelocityX(e),this},setVelocityY:function(e){return this.body.setVelocityY(e),this},setMaxVelocity:function(e,t){return this.body.maxVelocity.set(e,t),this}}},92209(e,t,i){e.exports={Acceleration:i(1093),Angular:i(59023),Bounce:i(62069),Collision:i(78389),Debug:i(87118),Drag:i(52819),Enable:i(4074),Friction:i(40831),Gravity:i(26775),Immovable:i(9437),Mass:i(30621),OverlapCirc:i(72441),OverlapRect:i(47956),Pushable:i(62121),Size:i(29384),Velocity:i(15098)}},37747(e){e.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},20009(e){e.exports="collide"},36768(e){e.exports="overlap"},60473(e){e.exports="pause"},89954(e){e.exports="resume"},61804(e){e.exports="tilecollide"},7161(e){e.exports="tileoverlap"},34689(e){e.exports="worldbounds"},16006(e){e.exports="worldstep"},63012(e,t,i){e.exports={COLLIDE:i(20009),OVERLAP:i(36768),PAUSE:i(60473),RESUME:i(89954),TILE_COLLIDE:i(61804),TILE_OVERLAP:i(7161),WORLD_BOUNDS:i(34689),WORLD_STEP:i(16006)}},27064(e,t,i){var n=i(37747),r=i(79291),s={ArcadePhysics:i(86689),Body:i(37742),Collider:i(79342),Components:i(92209),Events:i(63012),Factory:i(66022),GetCollidesWith:i(79599),GetOverlapX:i(64897),GetOverlapY:i(45170),SeparateX:i(14087),SeparateY:i(89936),Group:i(60758),Image:i(71289),Sprite:i(13759),StaticBody:i(72624),StaticGroup:i(71464),Tilemap:i(55173),World:i(82248)};s=r(!1,s,n),e.exports=s},96602(e){e.exports=function(e,t){return e.collisionCallback?!e.collisionCallback.call(e.collisionCallbackContext,t,e):!e.layer.callbacks[e.index]||!e.layer.callbacks[e.index].callback.call(e.layer.callbacks[e.index].callbackContext,t,e)}},36294(e){e.exports=function(e,t){t<0?(e.blocked.none=!1,e.blocked.left=!0):t>0&&(e.blocked.none=!1,e.blocked.right=!0),e.position.x-=t,e.updateCenter(),0===e.bounce.x?e.velocity.x=0:e.velocity.x=-e.velocity.x*e.bounce.x}},67013(e){e.exports=function(e,t){t<0?(e.blocked.none=!1,e.blocked.up=!0):t>0&&(e.blocked.none=!1,e.blocked.down=!0),e.position.y-=t,e.updateCenter(),0===e.bounce.y?e.velocity.y=0:e.velocity.y=-e.velocity.y*e.bounce.y}},40012(e,t,i){var n=i(21329),r=i(53442),s=i(2483);e.exports=function(e,t,i,a,o,l,h){var u=a.left,c=a.top,d=a.right,f=a.bottom,p=i.faceLeft||i.faceRight,m=i.faceTop||i.faceBottom;if(h||(p=!0,m=!0),!p&&!m)return!1;var g=0,v=0,y=0,x=1;if(t.deltaAbsX()>t.deltaAbsY()?y=-1:t.deltaAbsX()<t.deltaAbsY()&&(x=-1),0!==t.deltaX()&&0!==t.deltaY()&&p&&m&&(y=Math.min(Math.abs(t.position.x-d),Math.abs(t.right-u)),x=Math.min(Math.abs(t.position.y-f),Math.abs(t.bottom-c))),y<x){if
vendor: 20,634 bytes, line 2
2(p&&0!==(g=n(t,i,u,d,l,h))&&!s(a,t))return!0;m&&(v=r(t,i,c,f,l,h))}else{if(m&&0!==(v=r(t,i,c,f,l,h))&&!s(a,t))return!0;p&&(g=n(t,i,u,d,l,h))}return 0!==g||0!==v}},21329(e,t,i){var n=i(36294);e.exports=function(e,t,i,r,s,a){var o=0,l=t.faceLeft,h=t.faceRight,u=t.collideLeft,c=t.collideRight;return a||(l=!0,h=!0,u=!0,c=!0),e.deltaX()<0&&c&&e.checkCollision.left?h&&e.x<r&&(o=e.x-r)<-s&&(o=0):e.deltaX()>0&&u&&e.checkCollision.right&&l&&e.right>i&&(o=e.right-i)>s&&(o=0),0!==o&&(e.customSeparateX?e.overlapX=o:n(e,o)),o}},53442(e,t,i){var n=i(67013);e.exports=function(e,t,i,r,s,a){var o=0,l=t.faceTop,h=t.faceBottom,u=t.collideUp,c=t.collideDown;return a||(l=!0,h=!0,u=!0,c=!0),e.deltaY()<0&&c&&e.checkCollision.up?h&&e.y<r&&(o=e.y-r)<-s&&(o=0):e.deltaY()>0&&u&&e.checkCollision.down&&l&&e.bottom>i&&(o=e.bottom-i)>s&&(o=0),0!==o&&(e.customSeparateY?e.overlapY=o:n(e,o)),o}},2483(e){e.exports=function(e,t){return!(t.right<=e.left||t.bottom<=e.top||t.position.x>=e.right||t.position.y>=e.bottom)}},55173(e,t,i){var n={ProcessTileCallbacks:i(96602),ProcessTileSeparationX:i(36294),ProcessTileSeparationY:i(67013),SeparateTile:i(40012),TileCheckX:i(21329),TileCheckY:i(53442),TileIntersectsBody:i(2483)};e.exports=n},44563(e,t,i){e.exports={Arcade:i(27064),Matter:i(3875)}},68174(e,t,i){var n=i(83419),r=i(26099),s=new n({initialize:function(){this.boundsCenter=new r,this.centerDiff=new r},parseBody:function(e){if(!(e=e.hasOwnProperty("body")?e.body:e).hasOwnProperty("bounds")||!e.hasOwnProperty("centerOfMass"))return!1;var t=this.boundsCenter,i=this.centerDiff,n=e.bounds.max.x-e.bounds.min.x,r=e.bounds.max.y-e.bounds.min.y,s=n*e.centerOfMass.x,a=r*e.centerOfMass.y;return t.set(n/2,r/2),i.set(s-t.x,a-t.y),!0},getTopLeft:function(e,t,i){if(void 0===t&&(t=0),void 0===i&&(i=0),this.parseBody(e)){var n=this.boundsCenter,s=this.centerDiff;return new r(t+n.x+s.x,i+n.y+s.y)}return!1},getTopCenter:function(e,t,i){if(void 0===t&&(t=0),void 0===i&&(i=0),this.parseBody(e)){var n=this.boundsCenter,s=this.centerDiff;return new r(t+s.x,i+n.y+s.y)}return!1},getTopRight:function(e,t,i){if(void 0===t&&(t=0),void 0===i&&(i=0),this.parseBody(e)){var n=this.boundsCenter,s=this.centerDiff;return new r(t-(n.x-s.x),i+n.y+s.y)}return!1},getLeftCenter:function(e,t,i){if(void 0===t&&(t=0),void 0===i&&(i=0),this.parseBody(e)){var n=this.boundsCenter,s=this.centerDiff;return new r(t+n.x+s.x,i+s.y)}return!1},getCenter:function(e,t,i){if(void 0===t&&(t=0),void 0===i&&(i=0),this.parseBody(e)){var n=this.centerDiff;return new r(t+n.x,i+n.y)}return!1},getRightCenter:function(e,t,i){if(void 0===t&&(t=0),void 0===i&&(i=0),this.parseBody(e)){var n=this.boundsCenter,s=this.centerDiff;return new r(t-(n.x-s.x),i+s.y)}return!1},getBottomLeft:function(e,t,i){if(void 0===t&&(t=0),void 0===i&&(i=0),this.parseBody(e)){var n=this.boundsCenter,s=this.centerDiff;return new r(t+n.x+s.x,i-(n.y-s.y))}return!1},getBottomCenter:function(e,t,i){if(void 0===t&&(t=0),void 0===i&&(i=0),this.parseBody(e)){var n=this.boundsCenter,s=this.centerDiff;return new r(t+s.x,i-(n.y-s.y))}return!1},getBottomRight:function(e,t,i){if(void 0===t&&(t=0),void 0===i&&(i=0),this.parseBody(e)){var n=this.boundsCenter,s=this.centerDiff;return new r(t-(n.x-s.x),i-(n.y-s.y))}return!1}});e.exports=s},19933(e,t,i){var n=i(6790);n.Body=i(22562),n.Composite=i(69351),n.World=i(4372),n.Collision=i(52284),n.Detector=i(81388),n.Pairs=i(99561),n.Pair=i(4506),n.Query=i(73296),n.Resolver=i(66272),n.Constraint=i(48140),n.Common=i(53402),n.Engine=i(48413),n.Events=i(35810),n.Sleeping=i(53614),n.Plugin=i(73832),n.Bodies=i(66280),n.Composites=i(74116),n.Axes=i(66615),n.Bounds=i(15647),n.Svg=i(74058),n.Vector=i(31725),n.Vertices=i(41598),n.World.add=n.Composite.add,n.World.remove=n.Composite.remove,n.World.addComposite=n.Composite.addComposite,n.World.addBody=n.Composite.addBody,n.World.addConstraint=n.Composite.addConstraint,n.World.clear=n.Composite.clear,e.exports=n},28137(e,t,i){var n=i(66280),r=i(83419),s=i(74116),a=i(48140),o=i(74058),l=i(75803),h=i(23181),u=i(34803),c=i(73834),d=i(19496),f=i(85791),p=i(98713),m=i(41598),g=new r({initialize:function(e){this.world=e,this.scene=e.scene,this.sys=e.scene.sys},rectangle:function(e,t,i,r,s){var a=n.rectangle(e,t,i,r,s);return this.world.add(a),a},trapezoid:function(e,t,i,r,s,a){var o=n.trapezoid(e,t,i,r,s,a);return this.world.add(o),o},circle:function(e,t,i,r,s){var a=n.circle(e,t,i,r,s);return this.world.add(a),a},polygon:function(e,t,i,r,s){var a=n.polygon(e,t,i,r,s);return this.world.add(a),a},fromVertices:function(e,t,i,r,s,a,o){"string"===typeof i&&(i=m.fromPath(i));var l=n.fromVertices(e,t,i,r,s,a,o);return this.world.add(l),l},fromPhysicsEditor:function(e,t,i,n,r){void 0===r&&(r=!0);var s=d.parseBody(e,t,i,n);return r&&!this.world.has(s)&&this.world.add(s),s},fromSVG:function(e,t,i,r,s,a){void 0===r&&(r=1),void 0===s&&(s={}),void 0===a&&(a=!0);for(var l=i.getElementsByTagName("path"),h=[],u=0;u<l.length;u++){var c=o.pathToVertices(l[u],30);1!==r&&m.scale(c,r,r),h.push(c)}var d=n.fromVertices(e,t,h,s);return a&&this.world.add(d),d},fromJSON:function(e,t,i,n,r){void 0===n&&(n={}),void 0===r&&(r=!0);var s=f.parseBody(e,t,i,n);return s&&r&&this.world.add(s),s},imageStack:function(e,t,i,n,r,a,o,l,u){void 0===o&&(o=0),void 0===l&&(l=0),void 0===u&&(u={});var c=this.world,d=this.sys.displayList;u.addToWorld=!1;var f=s.stack(i,n,r,a,o,l,function(i,n){var r=new h(c,i,n,e,t,u);return d.add(r),r.body});return c.add(f),f},stack:function(e,t,i,n,r,a,o){var l=s.stack(e,t,i,n,r,a,o);return this.world.add(l),l},pyramid:function(e,t,i,n,r,a,o){var l=s.pyramid(e,t,i,n,r,a,o);return this.world.add(l),l},chain:function(e,t,i,n,r,a){return s.chain(e,t,i,n,r,a)},mesh:function(e,t,i,n,r){return s.mesh(e,t,i,n,r)},newtonsCradle:function(e,t,i,n,r){var a=s.newtonsCradle(e,t,i,n,r);return this.world.add(a),a},car:function(e,t,i,n,r){var a=s.car(e,t,i,n,r);return this.world.add(a),a},softBody:function(e,t,i,n,r,a,o,l,h,u){var c=s.softBody(e,t,i,n,r,a,o,l,h,u);return this.world.add(c),c},joint:function(e,t,i,n,r){return this.constraint(e,t,i,n,r)},spring:function(e,t,i,n,r){return this.constraint(e,t,i,n,r)},constraint:function(e,t,i,n,r){void 0===n&&(n=1),void 0===r&&(r={}),r.bodyA="body"===e.type?e:e.body,r.bodyB="body"===t.type?t:t.body,isNaN(i)||(r.length=i),r.stiffness=n;var s=a.create(r);return this.world.add(s),s},worldConstraint:function(e,t,i,n){void 0===i&&(i=1),void 0===n&&(n={}),n.bodyB="body"===e.type?e:e.body,isNaN(t)||(n.length=t),n.stiffness=i;var r=a.create(n);return this.world.add(r),r},mouseSpring:function(e){return this.pointerConstraint(e)},pointerConstraint:function(e){void 0===e&&(e={}),e.hasOwnProperty("render")||(e.render={visible:!1});var t=new p(this.scene,this.world,e);return this.world.add(t.constraint),t},image:function(e,t,i,n,r){var s=new h(this.world,e,t,i,n,r);return this.sys.displayList.add(s),s},tileBody:function(e,t){return new c(this.world,e,t)},sprite:function(e,t,i,n,r){var s=new u(this.world,e,t,i,n,r);return this.sys.displayList.add(s),this.sys.updateList.add(s),s},gameObject:function(e,t,i){return l(this.world,e,t,i)},destroy:function(){this.world=null,this.scene=null,this.sys=null}});e.exports=g},75803(e,t,i){var n=i(9503),r=i(95540),s=i(26099);function a(e){return!!e.get&&"function"===typeof e.get||!!e.set&&"function"===typeof e.set}e.exports=function(e,t,i,o){void 0===i&&(i={}),void 0===o&&(o=!0);var l=t.x,h=t.y;if(t.body={temp:!0,position:{x:l,y:h}},[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity].forEach(function(e){for(var i in e)a(e[i])?Object.defineProperty(t,i,{get:e[i].get,set:e[i].set}):Object.defineProperty(t,i,{value:e[i]})}),t.world=e,t._tempVec2=new s(l,h),i.hasOwnProperty("type")&&"body"===i.type)t.setExistingBody(i,o);else{var u=r(i,"shape",null);u||(u="rectangle"),i.addToWorld=o,t.setBody(u,i)}return t}},23181(e,t,i){var n=i(83419),r=i(9503),s=i(95643),a=i(95540),o=i(88571),l=i(26099),h=new n({Extends:o,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity],initialize:function(e,t,i,n,r,o){s.call(this,e.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(n,r),this.setSizeToFrame(),this.setOrigin(),this.initRenderNodes(this._defaultRenderNodesMap),this.world=e,this._tempVec2=new l(t,i);var h=a(o,"shape",null);h?this.setBody(h,o):this.setRectangle(this.width,this.height,o),this.setPosition(t,i)}});e.exports=h},42045(e,t,i){var n=i(60461),r=i(66615),s=i(66280),a=i(22562),o=i(68174),l=i(15647),h=i(83419),u=i(52284),c=i(53402),d=i(69351),f=i(74116),p=i(48140),m=i(81388),g=i(20339),v=i(28137),y=i(95540),x=i(35154),b=i(46975),w=i(4506),T=i(99561),_=i(37277),S=i(73296),E=i(66272),C=i(44594),A=i(74058),k=i(31725),R=i(41598),O=i(68243);c.setDecomp(i(55973));var P=new h({initialize:function(e){this.scene=e,this.systems=e.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=a,this.composite=d,this.collision=u,this.detector=m,this.pair=w,this.pairs=T,this.query=S,this.resolver=E,this.constraint=p,this.bodies=s,this.composites=f,this.axes=r,this.bounds=l,this.svg=A,this.vector=k,this.vertices=R,this.verts=R,this._tempVec2=k.create(),E._restingThresh=x(this.config,"restingThresh",4),E._restingThreshTangent=x(this.config,"restingThreshTangent",6),E._positionDampen=x(this.config,"positionDampen",.9),E._positionWarming=x(this.config,"positionWarming",.8),E._frictionNormalMultiplier=x(this.config,"frictionNormalMultiplier",5),e.sys.events.once(C.BOOT,this.boot,this),e.sys.events.on(C.START,this.start,this)},boot:function(){this.world=new O(this.scene,this.config),this.add=new v(this.world),this.bodyBounds=new o,this.systems.events.once(C.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new O(this.scene,this.config),this.add=new v(this.world));var e=this.systems.events;e.on(C.UPDATE,this.world.update,this.world),e.on(C.POST_UPDATE,this.world.postUpdate,this.world),e.once(C.SHUTDOWN,this.shutdown,this)},getConfig:function(){var e=this.systems.game.config.physics,t=this.systems.settings.physics;return b(y(t,"matter",{}),y(e,"matter",{}))},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(e,t){this.world.step(e,t)},containsPoint:function(e,t,i){e=this.getMatterBodies(e);var n=k.create(t,i);return S.point(e,n).length>0},intersectPoint:function(e,t,i){i=this.getMatterBodies(i);var n=k.create(e,t),r=[];return S.point(i,n).forEach(function(e){-1===r.indexOf(e)&&r.push(e)}),r},intersectRect:function(e,t,i,n,r,s){void 0===r&&(r=!1),s=this.getMatterBodies(s);var a={min:{x:e,y:t},max:{x:e+i,y:t+n}},o=[];return S.region(s,a,r).forEach(function(e){-1===o.indexOf(e)&&o.push(e)}),o},intersectRay:function(e,t,i,n,r,s){void 0===r&&(r=1),s=this.getMatterBodies(s);for(var a=[],o=S.ray(s,k.create(e,t),k.create(i,n),r),l=0;l<o.length;l++)a.push(o[l].body);return a},intersectBody:function(e,t){t=this.getMatterBodies(t);for(var i=[],n=S.collides(e,t),r=0;r<n.length;r++){var s=n[r];s.bodyA===e?i.push(s.bodyB):i.push(s.bodyA)}return i},overlap:function(e,t,i,n,r){void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),Array.isArray(e)||(e=[e]),e=this.getMatterBodies(e),t=this.getMatterBodies(t);for(var s=!1,a=0;a<e.length;a++)for(var o=e[a],l=S.collides(o,t),h=0;h<l.length;h++){var u=l[h],c=u.bodyA.id===o.id?u.bodyB:u.bodyA;if(!n||n.call(r,o,c,u))if(s=!0,i)i.call(r,o,c,u);else if(!n)return!0}return s},setCollisionCategory:function(e,t){return(e=this.getMatterBodies(e)).forEach(function(e){e.collisionFilter.category=t}),this},setCollisionGroup:function(e,t){return(e=this.getMatterBodies(e)).forEach(function(e){e.collisionFilter.group=t}),this},setCollidesWith:function(e,t){e=this.getMatterBodies(e);var i=0;if(Array.isArray(t))for(var n=0;n<t.length;n++)i|=t[n];else i=t;return e.forEach(function(e){e.collisionFilter.mask=i}),this},getMatterBodies:function(e){if(!e)return this.world.getAllBodies();Array.isArray(e)||(e=[e]);for(var t=[],i=0;i<e.length;i++){var n=e[i].hasOwnProperty("body")?e[i].body:e[i];t.push(n)}return t},setVelocity:function(e,t,i){e=this.getMatterBodies(e);var n=this._tempVec2;return n.x=t,n.y=i,e.forEach(function(e){a.setVelocity(e,n)}),this},setVelocityX:function(e,t){e=this.getMatterBodies(e);var i=this._tempVec2;return i.x=t,e.forEach(function(e){i.y=e.velocity.y,a.setVelocity(e,i)}),this},setVelocityY:function(e,t){e=this.getMatterBodies(e);var i=this._tempVec2;return i.y=t,e.forEach(function(e){i.x=e.velocity.x,a.setVelocity(e,i)}),this},setAngularVelocity:function(e,t){return(e=this.getMatterBodies(e)).forEach(function(e){a.setAngularVelocity(e,t)}),this},applyForce:function(e,t){e=this.getMatterBodies(e);var i=this._tempVec2;return e.forEach(function(e){i.x=e.position.x,i.y=e.position.y,a.applyForce(e,i,t)}),this},applyForceFromPosition:function(e,t,i,n){e=this.getMatterBodies(e);var r=this._tempVec2;return e.forEach(function(e){void 0===n&&(n=e.angle),r.x=i*Math.cos(n),r.y=i*Math.sin(n),a.applyForce(e,t,r)}),this},applyForceFromAngle:function(e,t,i){e=this.getMatterBodies(e);var n=this._tempVec2;return e.forEach(function(e){void 0===i&&(i=e.angle),n.x=t*Math.cos(i),n.y=t*Math.sin(i),a.applyForce(e,{x:e.position.x,y:e.position.y},n)}),this},getConstraintLength:function(e){var t=e.pointA.x,i=e.pointA.y,n=e.pointB.x,r=e.pointB.y;return e.bodyA&&(t+=e.bodyA.position.x,i+=e.bodyA.position.y),e.bodyB&&(n+=e.bodyB.position.x,r+=e.bodyB.position.y),g(t,i,n,r)},alignBody:function(e,t,i,r){var s;switch(e=e.hasOwnProperty("body")?e.body:e,r){case n.TOP_LEFT:case n.LEFT_TOP:s=this.bodyBounds.getTopLeft(e,t,i);break;case n.TOP_CENTER:s=this.bodyBounds.getTopCenter(e,t,i);break;case n.TOP_RIGHT:case n.RIGHT_TOP:s=this.bodyBounds.getTopRight(e,t,i);break;case n.LEFT_CENTER:s=this.bodyBounds.getLeftCenter(e,t,i);break;case n.CENTER:s=this.bodyBounds.getCenter(e,t,i);break;case n.RIGHT_CENTER:s=this.bodyBounds.getRightCenter(e,t,i);break;case n.LEFT_BOTTOM:case n.BOTTOM_LEFT:s=this.bodyBounds.getBottomLeft(e,t,i);break;case n.BOTTOM_CENTER:s=this.bodyBounds.getBottomCenter(e,t,i);break;case n.BOTTOM_RIGHT:case n.RIGHT_BOTTOM:s=this.bodyBounds.getBottomRight(e,t,i)}return s&&a.setPosition(e,s),this},shutdown:function(){var e=this.systems.events;this.world&&(e.off(C.UPDATE,this.world.update,this.world),e.off(C.POST_UPDATE,this.world.postUpdate,this.world)),e.off(C.SHUTDOWN,this.shutdown,this),this.add&&this.add.destroy(),this.world&&this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off(C.START,this.start,this),this.scene=null,this.systems=null}});_.register("MatterPhysics",P,"matterPhysics"),e.exports=P},34803(e,t,i){var n=i(9674),r=i(83419),s=i(9503),a=i(95643),o=i(95540),l=i(68287),h=i(26099),u=new r({Extends:l,Mixins:[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity],initialize:function(e,t,i,r,s,l){a.call(this,e.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new n(this),this.setTexture(r,s),this.setSizeToFrame(),this.setOrigin(),this.initRenderNodes(this._defaultRenderNodesMap),this.world=e,this._tempVec2=new h(t,i);var u=o(l,"shape",null);u?this.setBody(u,l):this.setRectangle(this.width,this.height,l),this.setPosition(t,i)}});e.exports=u},73834(e,t,i){var n=i(66280),r=i(22562),s=i(83419),a=i(9503),o=i(62644),l=i(50792),h=i(95540),u=i(97022),c=i(41598),d=new s({Extends:l,Mixins:[a.Bounce,a.Collision,a.Friction,a.Gravity,a.Mass,a.Sensor,a.Sleep,a.Static],initialize:function(e,t,i){l.call(this),this.tile=t,this.world=e,t.physics.matterBody&&t.physics.matterBody.destroy(),t.physics.matterBody=this;var n=h(i,"body",null),s=h(i,"addToWorld",!0);if(n)this.setBody(n,s);else{var a=t.getCollisionGroup();h(a,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i),n=this.body}if(t.flipX||t.flipY){var o={x:t.getCenterX(),y:t.getCenterY()},u=t.flipX?-1:1,c=t.flipY?-1:1;r.scale(n,u,c,o)}},setFromTileRectangle:function(e){void 0===e&&(e={}),u(e,"isStatic")||(e.isStatic=!0),u(e,"addToWorld")||(e.addToWorld=!0);var t=this.tile.getBounds(),i=t.x+t.width/2,r=t.y+t.height/2,s=n.rectangle(i,r,t.width,t.height,e);return this.setBody(s,e.addToWorld),this},setFromTileCollision:function(e){void 0===e&&(e={}),u(e,"isStatic")||(e.isStatic=!0),u(e,"addToWorld")||(e.addToWorld=!0);for(var t=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,s=this.tile.getLeft(),a=this.tile.getTop(),l=this.tile.getCollisionGroup(),d=h(l,"objects",[]),f=[],p=0;p<d.length;p++){var m=d[p],g=s+m.x*t,v=a+m.y*i,y=m.width*t,x=m.height*i,b=null;if(m.rectangle)b=n.rectangle(g+y/2,v+x/2,y,x,e);else if(m.ellipse)b=n.circle(g+y/2,v+x/2,y/2,e);else if(m.polygon||m.polyline){var w=(m.polygon?m.polygon:m.polyline).map(function(e){return{x:e.x*t,y:e.y*i}}),T=c.create(w),_=c.centre(T);g+=_.x,v+=_.y,b=n.fromVertices(g,v,T,e)}b&&f.push(b)}if(1===f.length)this.setBody(f[0],e.addToWorld);else if(f.length>1){var S=o(e);S.parts=f,this.setBody(r.create(S),S.addToWorld)}return this},setBody:function(e,t){return void 0===t&&(t=!0),this.body&&this.removeBody(),this.body=e,this.body.gameObject=this,t&&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()}});e.exports=d},19496(e,t,i){var n=i(66280),r=i(22562),s=i(53402),a=i(95540),o=i(41598),l={parseBody:function(e,t,i,n){void 0===n&&(n={});for(var o=a(i,"fixtures",[]),l=[],h=0;h<o.length;h++)for(var u=this.parseFixture(o[h]),c=0;c<u.length;c++)l.push(u[c]);var d=s.clone(i,!0);s.extend(d,n,!0),delete d.fixtures,delete d.type;var f=r.create(d);return r.setParts(f,l),r.setPosition(f,{x:e,y:t}),f},parseFixture:function(e){var t,i=s.extend({},!1,e);if(delete i.circle,delete i.vertices,e.circle){var r=a(e.circle,"x"),o=a(e.circle,"y"),l=a(e.circle,"radius");t=[n.circle(r,o,l,i)]}else e.vertices&&(t=this.parseVertices(e.vertices,i));return t},parseVertices:function(e,t){void 0===t&&(t={});for(var i=[],a=0;a<e.length;a++)o.clockwiseSort(e[a]),i.push(r.create(s.extend({position:o.centre(e[a]),vertices:e[a]},t)));return n.flagCoincidentParts(i)}};e.exports=l},85791(e,t,i){var n=i(66280),r=i(22562),s={parseBody:function(e,t,i,s){var a;void 0===s&&(s={});var o=i.vertices;if(1===o.length)s.vertices=o[0],a=r.create(s),n.flagCoincidentParts(a.parts);else{for(var l=[],h=0;h<o.length;h++){var u=r.create({vertices:o[h]});l.push(u)}n.flagCoincidentParts(l),s.parts=l,a=r.create(s)}return a.label=i.label,r.setPosition(a,{x:e,y:t}),a}};e.exports=s},98713(e,t,i){var n=i(15647),r=i(83419),s=i(69351),a=i(48140),o=i(81388),l=i(1121),h=i(8214),u=i(46975),c=i(53614),d=i(26099),f=i(41598),p=new r({initialize:function(e,t,i){void 0===i&&(i={});this.scene=e,this.world=t,this.camera=null,this.pointer=null,this.active=!0,this.position=new d,this.body=null,this.part=null,this.constraint=a.create(u(i,{label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}})),this.world.on(l.BEFORE_UPDATE,this.update,this),e.sys.input.on(h.POINTER_DOWN,this.onDown,this),e.sys.input.on(h.POINTER_UP,this.onUp,this)},onDown:function(e){this.pointer||(this.pointer=e,this.camera=e.camera)},onUp:function(e){e===this.pointer&&(this.pointer=null)},getBody:function(e){var t=this.position,i=this.constraint;this.camera.getWorldPoint(e.x,e.y,t);for(var r=s.allBodies(this.world.localWorld),a=0;a<r.length;a++){var h=r[a];if(!h.ignorePointer&&n.contains(h.bounds,t)&&o.canCollide(h.collisionFilter,i.collisionFilter)&&this.hitTestBody(h,t))return this.world.emit(l.DRAG_START,h,this.part,this),!0}return!1},hitTestBody:function(e,t){for(var i=this.constraint,n=e.parts.length,r=n>1?1:0;r<n;r++){var s=e.parts[r];if(f.contains(s.vertices,t))return i.pointA=t,i.pointB={x:t.x-e.position.x,y:t.y-e.position.y},i.bodyB=e,i.angleB=e.angle,c.set(e,!1),this.part=s,this.body=e,!0}return!1},update:function(){var e=this.pointer,t=this.body;if(this.active&&e)if(e.isDown||!t){if(e.isDown){if(!this.camera||!t&&!this.getBody(e))return;t=this.body;var i=this.position,n=this.constraint;this.camera.getWorldPoint(e.x,e.y,i),n.pointA.x=i.x,n.pointA.y=i.y,c.set(t,!1),this.world.emit(l.DRAG,t,this)}}
2else this.stopDrag();else t&&this.stopDrag()},stopDrag:function(){var e=this.body,t=this.constraint;t.bodyB=null,t.pointB=null,this.pointer=null,this.body=null,this.part=null,e&&this.world.emit(l.DRAG_END,e,this)},destroy:function(){this.world.removeConstraint(this.constraint),this.pointer=null,this.constraint=null,this.body=null,this.part=null,this.world.off(l.BEFORE_UPDATE,this.update),this.scene.sys.input.off(h.POINTER_DOWN,this.onDown,this),this.scene.sys.input.off(h.POINTER_UP,this.onUp,this)}});e.exports=p},68243(e,t,i){var n=i(66280),r=i(22562),s=i(83419),a=i(53402),o=i(69351),l=i(48413),h=i(50792),u=i(1121),c=i(95540),d=i(35154),f=i(22562),p=i(35810),m=i(73834),g=i(4372),v=i(13037),y=i(31725),x=new s({Extends:h,initialize:function(e,t){h.call(this),this.scene=e,this.engine=l.create(t),this.localWorld=this.engine.world;var i=d(t,"gravity",null);i?this.setGravity(i.x,i.y,i.scale):!1===i&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=d(t,"enabled",!0),this.getDelta=d(t,"getDelta",this.update60Hz);var n=c(t,"runner",{});c(n,"fps",!1)&&(n.delta=1e3/c(n,"fps",60)),this.runner=v.create(n),this.autoUpdate=d(t,"autoUpdate",!0);var r=d(t,"debug",!1);if(this.drawDebug="object"===typeof r||r,this.debugGraphic,this.debugConfig={showAxes:c(r,"showAxes",!1),showAngleIndicator:c(r,"showAngleIndicator",!1),angleColor:c(r,"angleColor",15208787),showBroadphase:c(r,"showBroadphase",!1),broadphaseColor:c(r,"broadphaseColor",16757760),showBounds:c(r,"showBounds",!1),boundsColor:c(r,"boundsColor",16777215),showVelocity:c(r,"showVelocity",!1),velocityColor:c(r,"velocityColor",44783),showCollisions:c(r,"showCollisions",!1),collisionColor:c(r,"collisionColor",16094476),showSeparations:c(r,"showSeparations",!1),separationColor:c(r,"separationColor",16753920),showBody:c(r,"showBody",!0),showStaticBody:c(r,"showStaticBody",!0),showInternalEdges:c(r,"showInternalEdges",!1),renderFill:c(r,"renderFill",!1),renderLine:c(r,"renderLine",!0),fillColor:c(r,"fillColor",1075465),fillOpacity:c(r,"fillOpacity",1),lineColor:c(r,"lineColor",2678297),lineOpacity:c(r,"lineOpacity",1),lineThickness:c(r,"lineThickness",1),staticFillColor:c(r,"staticFillColor",857979),staticLineColor:c(r,"staticLineColor",1255396),showSleeping:c(r,"showSleeping",!1),staticBodySleepOpacity:c(r,"staticBodySleepOpacity",.7),sleepFillColor:c(r,"sleepFillColor",4605510),sleepLineColor:c(r,"sleepLineColor",10066585),showSensors:c(r,"showSensors",!0),sensorFillColor:c(r,"sensorFillColor",857979),sensorLineColor:c(r,"sensorLineColor",1255396),showPositions:c(r,"showPositions",!0),positionSize:c(r,"positionSize",4),positionColor:c(r,"positionColor",14697178),showJoint:c(r,"showJoint",!0),jointColor:c(r,"jointColor",14737474),jointLineOpacity:c(r,"jointLineOpacity",1),jointLineThickness:c(r,"jointLineThickness",2),pinSize:c(r,"pinSize",4),pinColor:c(r,"pinColor",4382944),springColor:c(r,"springColor",14697184),anchorColor:c(r,"anchorColor",15724527),anchorSize:c(r,"anchorSize",4),showConvexHulls:c(r,"showConvexHulls",!1),hullColor:c(r,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),c(t,"setBounds",!1)){var s=t.setBounds;if("boolean"===typeof s)this.setBounds();else{var a=c(s,"x",0),o=c(s,"y",0),u=c(s,"width",e.sys.scale.width),f=c(s,"height",e.sys.scale.height),p=c(s,"thickness",64),m=c(s,"left",!0),g=c(s,"right",!0),y=c(s,"top",!0),x=c(s,"bottom",!0);this.setBounds(a,o,u,f,p,m,g,y,x)}}},setCompositeRenderStyle:function(e){var t,i,n,r=e.bodies,s=e.constraints,a=e.composites;for(t=0;t<r.length;t++)n=(i=r[t]).render,this.setBodyRenderStyle(i,n.lineColor,n.lineOpacity,n.lineThickness,n.fillColor,n.fillOpacity);for(t=0;t<s.length;t++)n=(i=s[t]).render,this.setConstraintRenderStyle(i,n.lineColor,n.lineOpacity,n.lineThickness,n.pinSize,n.anchorColor,n.anchorSize);for(t=0;t<a.length;t++)i=a[t],this.setCompositeRenderStyle(i);return this},setBodyRenderStyle:function(e,t,i,n,r,s){var a=e.render,o=this.debugConfig;return a?(void 0!==t&&null!==t||(t=e.isStatic?o.staticLineColor:o.lineColor),void 0!==i&&null!==i||(i=o.lineOpacity),void 0!==n&&null!==n||(n=o.lineThickness),void 0!==r&&null!==r||(r=e.isStatic?o.staticFillColor:o.fillColor),void 0!==s&&null!==s||(s=o.fillOpacity),!1!==t&&(a.lineColor=t),!1!==i&&(a.lineOpacity=i),!1!==n&&(a.lineThickness=n),!1!==r&&(a.fillColor=r),!1!==s&&(a.fillOpacity=s),this):this},setConstraintRenderStyle:function(e,t,i,n,r,s,a){var o=e.render,l=this.debugConfig;if(!o)return this;if(void 0===t||null===t){var h=o.type;"line"===h?t=l.jointColor:"pin"===h?t=l.pinColor:"spring"===h&&(t=l.springColor)}
vendor: 86,566 bytes, line 2
2return void 0!==i&&null!==i||(i=l.jointLineOpacity),void 0!==n&&null!==n||(n=l.jointLineThickness),void 0!==r&&null!==r||(r=l.pinSize),void 0!==s&&null!==s||(s=l.anchorColor),void 0!==a&&null!==a||(a=l.anchorSize),!1!==t&&(o.lineColor=t),!1!==i&&(o.lineOpacity=i),!1!==n&&(o.lineThickness=n),!1!==r&&(o.pinSize=r),!1!==s&&(o.anchorColor=s),!1!==a&&(o.anchorSize=a),this},setEventsProxy:function(){var e=this,t=this.engine,i=this.localWorld;this.drawDebug&&(p.on(i,"compositeModified",function(t){e.setCompositeRenderStyle(t)}),p.on(i,"beforeAdd",function(t){for(var i=[].concat(t.object),n=0;n<i.length;n++){var r=i[n],s=r.render;"body"===r.type?e.setBodyRenderStyle(r,s.lineColor,s.lineOpacity,s.lineThickness,s.fillColor,s.fillOpacity):"composite"===r.type?e.setCompositeRenderStyle(r):"constraint"===r.type&&e.setConstraintRenderStyle(r,s.lineColor,s.lineOpacity,s.lineThickness,s.pinSize,s.anchorColor,s.anchorSize)}})),p.on(i,"beforeAdd",function(t){e.emit(u.BEFORE_ADD,t)}),p.on(i,"afterAdd",function(t){e.emit(u.AFTER_ADD,t)}),p.on(i,"beforeRemove",function(t){e.emit(u.BEFORE_REMOVE,t)}),p.on(i,"afterRemove",function(t){e.emit(u.AFTER_REMOVE,t)}),p.on(t,"beforeUpdate",function(t){e.emit(u.BEFORE_UPDATE,t)}),p.on(t,"afterUpdate",function(t){e.emit(u.AFTER_UPDATE,t)}),p.on(t,"collisionStart",function(t){var i,n,r=t.pairs;r.length>0&&r.map(function(e){i=e.bodyA,n=e.bodyB,i.gameObject&&i.gameObject.emit("collide",i,n,e),n.gameObject&&n.gameObject.emit("collide",n,i,e),p.trigger(i,"onCollide",{pair:e}),p.trigger(n,"onCollide",{pair:e}),i.onCollideCallback&&i.onCollideCallback(e),n.onCollideCallback&&n.onCollideCallback(e),i.onCollideWith[n.id]&&i.onCollideWith[n.id](n,e),n.onCollideWith[i.id]&&n.onCollideWith[i.id](i,e)}),e.emit(u.COLLISION_START,t,i,n)}),p.on(t,"collisionActive",function(t){var i,n,r=t.pairs;r.length>0&&r.map(function(e){i=e.bodyA,n=e.bodyB,i.gameObject&&i.gameObject.emit("collideActive",i,n,e),n.gameObject&&n.gameObject.emit("collideActive",n,i,e),p.trigger(i,"onCollideActive",{pair:e}),p.trigger(n,"onCollideActive",{pair:e}),i.onCollideActiveCallback&&i.onCollideActiveCallback(e),n.onCollideActiveCallback&&n.onCollideActiveCallback(e)}),e.emit(u.COLLISION_ACTIVE,t,i,n)}),p.on(t,"collisionEnd",function(t){var i,n,r=t.pairs;r.length>0&&r.map(function(e){i=e.bodyA,n=e.bodyB,i.gameObject&&i.gameObject.emit("collideEnd",i,n,e),n.gameObject&&n.gameObject.emit("collideEnd",n,i,e),p.trigger(i,"onCollideEnd",{pair:e}),p.trigger(n,"onCollideEnd",{pair:e}),i.onCollideEndCallback&&i.onCollideEndCallback(e),n.onCollideEndCallback&&n.onCollideEndCallback(e)}),e.emit(u.COLLISION_END,t,i,n)})},setBounds:function(e,t,i,n,r,s,a,o,l){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),void 0===r&&(r=64),void 0===s&&(s=!0),void 0===a&&(a=!0),void 0===o&&(o=!0),void 0===l&&(l=!0),this.updateWall(s,"left",e-r,t-r,r,n+2*r),this.updateWall(a,"right",e+i,t-r,r,n+2*r),this.updateWall(o,"top",e,t-r,i,r),this.updateWall(l,"bottom",e,t+n,i,r),this},updateWall:function(e,t,i,n,r,s){var a=this.walls[t];e?(a&&g.remove(this.localWorld,a),i+=r/2,n+=s/2,this.walls[t]=this.create(i,n,r,s,{isStatic:!0,friction:0,frictionStatic:0})):(a&&g.remove(this.localWorld,a),this.walls[t]=null)},createDebugGraphic:function(){var e=this.scene.sys.add.graphics({x:0,y:0});return e.setDepth(Number.MAX_VALUE),this.debugGraphic=e,this.drawDebug=!0,e},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(e,t,i){return void 0===e&&(e=0),void 0===t&&(t=1),void 0===i&&(i=.001),this.localWorld.gravity.x=e,this.localWorld.gravity.y=t,this.localWorld.gravity.scale=i,this},create:function(e,t,i,r,s){var a=n.rectangle(e,t,i,r,s);return g.add(this.localWorld,a),a},add:function(e){return g.add(this.localWorld,e),this},remove:function(e,t){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var n=e[i],r=n.body?n.body:n;o.remove(this.localWorld,r,t)}return this},removeConstraint:function(e,t){return o.remove(this.localWorld,e,t),this},convertTilemapLayer:function(e,t){var i=e.layer,n=e.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,t),this},convertTiles:function(e,t){if(0===e.length)return this;for(var i=0;i<e.length;i++)new m(this,e[i],t);return this},nextGroup:function(e){return f.nextGroup(e)},nextCategory:function(){return f.nextCategory()},pause:function(){return this.enabled=!1,this.emit(u.PAUSE),this},resume:function(){return this.enabled=!0,this.runner.timeLastTick=a.now(),this.emit(u.RESUME),this},update:function(e){if(this.enabled&&this.autoUpdate){var t=this.engine,i=this.runner,n=a.now(),r=i.delta,s=0,o=e-i.timeLastTick;if((!o||!i.timeLastTick||o>Math.max(v._maxFrameDelta,i.maxFrameTime))&&(o=i.frameDelta||v._frameDeltaFallback),i.frameDeltaSmoothing){i.frameDeltaHistory.push(o),i.frameDeltaHistory=i.frameDeltaHistory.slice(-i.frameDeltaHistorySize);var h=i.frameDeltaHistory.slice(0).sort(),u=i.frameDeltaHistory.slice(h.length*v._smoothingLowerBound,h.length*v._smoothingUpperBound);o=v._mean(u)||o}i.frameDeltaSnapping&&(o=1e3/Math.round(1e3/o)),i.frameDelta=o,i.timeLastTick=e,i.timeBuffer+=i.frameDelta,i.timeBuffer=a.clamp(i.timeBuffer,0,i.frameDelta+r*v._timeBufferMargin),i.lastUpdatesDeferred=0;for(var c=i.maxUpdates||Math.ceil(i.maxFrameTime/r),d=a.now();r>0&&i.timeBuffer>=r*v._timeBufferMargin;){l.update(t,r),i.timeBuffer-=r,s+=1;var f=a.now()-n,p=a.now()-d,m=f+v._elapsedNextEstimate*p/s;if(s>=c||m>i.maxFrameTime){i.lastUpdatesDeferred=Math.round(Math.max(0,i.timeBuffer/r-v._timeBufferMargin));break}}}},step:function(e){l.update(this.engine,e)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(e){var t=e.hasOwnProperty("body")?e.body:e;return null!==o.get(this.localWorld,t.id,t.type)},getAllBodies:function(){return o.allBodies(this.localWorld)},getAllConstraints:function(){return o.allConstraints(this.localWorld)},getAllComposites:function(){return o.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var e=this.debugConfig,t=this.engine,i=this.debugGraphic,n=o.allBodies(this.localWorld);this.debugGraphic.clear(),e.showBroadphase&&t.broadphase.controller&&this.renderGrid(t.broadphase,i,e.broadphaseColor,.5),e.showBounds&&this.renderBodyBounds(n,i,e.boundsColor,.5),(e.showBody||e.showStaticBody)&&this.renderBodies(n),e.showJoint&&this.renderJoints(),(e.showAxes||e.showAngleIndicator)&&this.renderBodyAxes(n,i,e.showAxes,e.angleColor,.5),e.showVelocity&&this.renderBodyVelocity(n,i,e.velocityColor,1,2),e.showSeparations&&this.renderSeparations(t.pairs.list,i,e.separationColor),e.showCollisions&&this.renderCollisions(t.pairs.list,i,e.collisionColor)}},renderGrid:function(e,t,i,n){t.lineStyle(1,i,n);for(var r=a.keys(e.buckets),s=0;s<r.length;s++){var o=r[s];if(!(e.buckets[o].length<2)){var l=o.split(/C|R/);t.strokeRect(parseInt(l[1],10)*e.bucketWidth,parseInt(l[2],10)*e.bucketHeight,e.bucketWidth,e.bucketHeight)}}return this},renderSeparations:function(e,t,i){t.lineStyle(1,i,1);for(var n=0;n<e.length;n++){var r=e[n];if(r.isActive){var s=r.collision,a=s.bodyA,o=s.bodyB,l=a.position,h=o.position,u=s.penetration,c=a.isStatic||o.isStatic?1:4;o.isStatic&&(c=0),t.lineBetween(h.x,h.y,h.x-u.x*c,h.y-u.y*c),c=a.isStatic||o.isStatic?1:4,a.isStatic&&(c=0),t.lineBetween(l.x,l.y,l.x-u.x*c,l.y-u.y*c)}}return this},renderCollisions:function(e,t,i){var n,r;for(t.lineStyle(1,i,.5),t.fillStyle(i,1),n=0;n<e.length;n++)if((r=e[n]).isActive)for(var s=0;s<r.contactCount;s++){var a=r.contacts[s].vertex;a&&t.fillRect(a.x-2,a.y-2,5,5)}for(n=0;n<e.length;n++)if((r=e[n]).isActive){var o=r.collision,l=r.contacts;if(r.contactCount>0){var h=l[0].vertex.x,u=l[0].vertex.y;2===r.contactCount&&(h=(l[0].vertex.x+l[1].vertex.x)/2,u=(l[0].vertex.y+l[1].vertex.y)/2),o.bodyB===o.supports[0].body||o.bodyA.isStatic?t.lineBetween(h-8*o.normal.x,u-8*o.normal.y,h,u):t.lineBetween(h+8*o.normal.x,u+8*o.normal.y,h,u)}}return this},renderBodyBounds:function(e,t,i,n){t.lineStyle(1,i,n);for(var r=0;r<e.length;r++){var s=e[r];if(s.render.visible){var a=s.bounds;if(a)t.strokeRect(a.min.x,a.min.y,a.max.x-a.min.x,a.max.y-a.min.y);else for(var o=s.parts,l=o.length>1?1:0;l<o.length;l++){var h=o[l];t.strokeRect(h.bounds.min.x,h.bounds.min.y,h.bounds.max.x-h.bounds.min.x,h.bounds.max.y-h.bounds.min.y)}}}return this},renderBodyAxes:function(e,t,i,n,r){t.lineStyle(1,n,r);for(var s=0;s<e.length;s++){var a,o,l,h=e[s],u=h.parts;if(h.render.visible)if(i)for(o=u.length>1?1:0;o<u.length;o++)for(a=u[o],l=0;l<a.axes.length;l++){var c=a.axes[l];t.lineBetween(a.position.x,a.position.y,a.position.x+20*c.x,a.position.y+20*c.y)}else for(o=u.length>1?1:0;o<u.length;o++)for(a=u[o],l=0;l<a.axes.length;l++)t.lineBetween(a.position.x,a.position.y,(a.vertices[0].x+a.vertices[a.vertices.length-1].x)/2,(a.vertices[0].y+a.vertices[a.vertices.length-1].y)/2)}return this},renderBodyVelocity:function(e,t,i,n,r){t.lineStyle(r,i,n);for(var s=0;s<e.length;s++){var a=e[s];a.render.visible&&t.lineBetween(a.position.x,a.position.y,a.position.x+2*(a.position.x-a.positionPrev.x),a.position.y+2*(a.position.y-a.positionPrev.y))}return this},renderBodies:function(e){for(var t=this.debugGraphic,i=this.debugConfig,n=i.showBody,r=i.showStaticBody,s=i.showSleeping,a=i.showInternalEdges,o=i.showConvexHulls,l=i.renderFill,h=i.renderLine,u=i.staticBodySleepOpacity,c=i.sleepFillColor,d=i.sleepLineColor,f=i.hullColor,p=0;p<e.length;p++){var m=e[p];if(m.render.visible&&((r||!m.isStatic)&&(n||m.isStatic))){var g=m.render.lineColor,v=m.render.lineOpacity,y=m.render.lineThickness,x=m.render.fillColor,b=m.render.fillOpacity;s&&m.isSleeping&&(m.isStatic?(v*=u,b*=u):(g=d,x=c)),l||(x=null),h||(g=null),this.renderBody(m,t,a,g,v,y,x,b);var w=m.parts.length;o&&w>1&&this.renderConvexHull(m,t,f,y)}}},renderBody:function(e,t,i,n,r,s,a,o){void 0===n&&(n=null),void 0===r&&(r=null),void 0===s&&(s=1),void 0===a&&(a=null),void 0===o&&(o=null);for(var l=this.debugConfig,h=l.sensorFillColor,u=l.sensorLineColor,c=e.parts,d=c.length,f=d>1?1:0;f<d;f++){var p=c[f],m=p.render,g=m.opacity;if(m.visible&&0!==g&&(!p.isSensor||l.showSensors)){var v=p.circleRadius;if(t.beginPath(),p.isSensor?(null!==a&&t.fillStyle(h,o*g),null!==n&&t.lineStyle(s,u,r*g)):(null!==a&&t.fillStyle(a,o*g),null!==n&&t.lineStyle(s,n,r*g)),v)t.arc(p.position.x,p.position.y,v,0,2*Math.PI);else{var y=p.vertices,x=y.length;t.moveTo(y[0].x,y[0].y);for(var b=1;b<x;b++){var w=y[b];if(!y[b-1].isInternal||i?t.lineTo(w.x,w.y):t.moveTo(w.x,w.y),b<x&&w.isInternal&&!i){var T=(b+1)%x;t.moveTo(y[T].x,y[T].y)}}t.closePath()}null!==a&&t.fillPath(),null!==n&&t.strokePath()}}if(l.showPositions&&!e.isStatic){var _=e.position.x,S=e.position.y,E=Math.ceil(l.positionSize/2);t.fillStyle(l.positionColor,1),t.fillRect(_-E,S-E,l.positionSize,l.positionSize)}return this},renderConvexHull:function(e,t,i,n){if(void 0===n&&(n=1),e.parts.length>1){var r=e.vertices;t.lineStyle(n,i),t.beginPath(),t.moveTo(r[0].x,r[0].y);for(var s=1;s<r.length;s++)t.lineTo(r[s].x,r[s].y);t.lineTo(r[0].x,r[0].y),t.strokePath()}return this},renderJoints:function(){for(var e=this.debugGraphic,t=o.allConstraints(this.localWorld),i=0;i<t.length;i++){var n=t[i].render,r=n.lineColor,s=n.lineOpacity,a=n.lineThickness,l=n.pinSize,h=n.anchorColor,u=n.anchorSize;this.renderConstraint(t[i],e,r,s,a,l,h,u)}},renderConstraint:function(e,t,i,n,r,s,o,l){var h=e.render;if(!h.visible||!e.pointA||!e.pointB)return this;t.lineStyle(r,i,n);var u,c,d=e.bodyA,f=e.bodyB;if(u=d?y.add(d.position,e.pointA):e.pointA,"pin"===h.type)t.strokeCircle(u.x,u.y,s);else{if(c=f?y.add(f.position,e.pointB):e.pointB,t.beginPath(),t.moveTo(u.x,u.y),"spring"===h.type)for(var p,m=y.sub(c,u),g=y.perp(y.normalise(m)),v=Math.ceil(a.clamp(e.length/5,12,20)),x=1;x<v;x+=1)p=x%2===0?1:-1,t.lineTo(u.x+m.x*(x/v)+g.x*p*4,u.y+m.y*(x/v)+g.y*p*4);t.lineTo(c.x,c.y)}return t.strokePath(),h.anchors&&l>0&&(t.fillStyle(o),t.fillCircle(u.x,u.y,l),t.fillCircle(c.x,c.y,l)),this},resetCollisionIDs:function(){return r._nextCollidingGroupId=1,r._nextNonCollidingGroupId=-1,r._nextCategory=1,this},shutdown:function(){p.off(this.engine),this.removeAllListeners(),g.clear(this.localWorld,!1),l.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});e.exports=x},70410(e){e.exports={setBounce:function(e){return this.body.restitution=e,this}}},66968(e){var t={setCollisionCategory:function(e){return this.body.collisionFilter.category=e,this},setCollisionGroup:function(e){return this.body.collisionFilter.group=e,this},setCollidesWith:function(e){var t=0;if(Array.isArray(e))for(var i=0;i<e.length;i++)t|=e[i];else t=e;return this.body.collisionFilter.mask=t,this},setOnCollide:function(e){return this.body.onCollideCallback=e,this},setOnCollideEnd:function(e){return this.body.onCollideEndCallback=e,this},setOnCollideActive:function(e){return this.body.onCollideActiveCallback=e,this},setOnCollideWith:function(e,t){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var n=e[i].hasOwnProperty("body")?e[i].body:e[i];this.body.setOnCollideWith(n,t)}return this}};e.exports=t},51607(e,t,i){var n=i(22562),r={applyForce:function(e){return this._tempVec2.set(this.body.position.x,this.body.position.y),n.applyForce(this.body,this._tempVec2,e),this},applyForceFrom:function(e,t){return n.applyForce(this.body,e,t),this},thrust:function(e){var t=this.body.angle;return this._tempVec2.set(e*Math.cos(t),e*Math.sin(t)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(e){var t=this.body.angle-Math.PI/2;return this._tempVec2.set(e*Math.cos(t),e*Math.sin(t)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(e){var t=this.body.angle+Math.PI/2;return this._tempVec2.set(e*Math.cos(t),e*Math.sin(t)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(e){var t=this.body.angle-Math.PI;return this._tempVec2.set(e*Math.cos(t),e*Math.sin(t)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};e.exports=r},5436(e){var t={setFriction:function(e,t,i){return this.body.friction=e,void 0!==t&&(this.body.frictionAir=t),void 0!==i&&(this.body.frictionStatic=i),this},setFrictionAir:function(e){return this.body.frictionAir=e,this},setFrictionStatic:function(e){return this.body.frictionStatic=e,this}};e.exports=t},39858(e){e.exports={setIgnoreGravity:function(e){return this.body.ignoreGravity=e,this}}},37302(e,t,i){var n=i(22562),r=i(26099),s={setMass:function(e){return n.setMass(this.body,e),this},setDensity:function(e){return n.setDensity(this.body,e),this},centerOfMass:{get:function(){return new r(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};e.exports=s},39132(e){e.exports={setSensor:function(e){return this.body.isSensor=e,this},isSensor:function(){return this.body.isSensor}}},57772(e,t,i){var n=i(66280),r=i(22562),s=i(43855),a=i(95540),o=i(19496),l=i(85791),h=i(41598),u={setRectangle:function(e,t,i){return this.setBody({type:"rectangle",width:e,height:t},i)},setCircle:function(e,t){return this.setBody({type:"circle",radius:e},t)},setPolygon:function(e,t,i){return this.setBody({type:"polygon",sides:t,radius:e},i)},setTrapezoid:function(e,t,i,n){return this.setBody({type:"trapezoid",width:e,height:t,slope:i},n)},setExistingBody:function(e,t){void 0===t&&(t=!0),this.body&&this.world.remove(this.body,!0),this.body=e;for(var i=0;i<e.parts.length;i++)e.parts[i].gameObject=this;var n=this;if(e.destroy=function(){n.world.remove(n.body,!0),n.body.gameObject=null},t&&(this.world.has(e)&&this.world.remove(e,!0),this.world.add(e)),this._originComponent){var r=e.render.sprite.xOffset,a=e.render.sprite.yOffset,o=e.centerOfMass.x,l=e.centerOfMass.y;if(s(o,.5)&&s(l,.5))this.setOrigin(r+.5,a+.5);else{var h=e.centerOffset.x,u=e.centerOffset.y;this.setOrigin(r+h/this.displayWidth,a+u/this.displayHeight)}}return this},setBody:function(e,t){if(!e)return this;var i;"string"===typeof e&&(e={type:e});var s=a(e,"type","rectangle"),u=a(e,"x",this._tempVec2.x),c=a(e,"y",this._tempVec2.y),d=a(e,"width",this.width),f=a(e,"height",this.height);switch(s){case"rectangle":i=n.rectangle(u,c,d,f,t);break;case"circle":var p=a(e,"radius",Math.max(d,f)/2),m=a(e,"maxSides",25);i=n.circle(u,c,p,t,m);break;case"trapezoid":var g=a(e,"slope",.5);i=n.trapezoid(u,c,d,f,g,t);break;case"polygon":var v=a(e,"sides",5),y=a(e,"radius",Math.max(d,f)/2);i=n.polygon(u,c,v,y,t);break;case"fromVertices":case"fromVerts":var x=a(e,"verts",null);if(x)if("string"===typeof x&&(x=h.fromPath(x)),this.body&&!this.body.hasOwnProperty("temp"))r.setVertices(this.body,x),i=this.body;else{var b=a(e,"flagInternal",!1),w=a(e,"removeCollinear",.01),T=a(e,"minimumArea",10);i=n.fromVertices(u,c,x,t,b,w,T)}break;case"fromPhysicsEditor":i=o.parseBody(u,c,e,t);break;case"fromPhysicsTracer":i=l.parseBody(u,c,e,t)}return i&&this.setExistingBody(i,e.addToWorld),this}};e.exports=u},38083(e,t,i){var n=i(1121),r=i(53614),s=i(35810),a={setToSleep:function(){return r.set(this.body,!0),this},setAwake:function(){return r.set(this.body,!1),this},setSleepThreshold:function(e){return void 0===e&&(e=60),this.body.sleepThreshold=e,this},setSleepEvents:function(e,t){return this.setSleepStartEvent(e),this.setSleepEndEvent(t),this},setSleepStartEvent:function(e){if(e){var t=this.world;s.on(this.body,"sleepStart",function(e){t.emit(n.SLEEP_START,e,this)})}else s.off(this.body,"sleepStart");return this},setSleepEndEvent:function(e){if(e){var t=this.world;s.on(this.body,"sleepEnd",function(e){t.emit(n.SLEEP_END,e,this)})}else s.off(this.body,"sleepEnd");return this}};e.exports=a},90556(e,t,i){var n=i(22562),r={setStatic:function(e){return n.setStatic(this.body,e),this},isStatic:function(){return this.body.isStatic}};e.exports=r},85436(e,t,i){var n=i(22562),r=i(36383),s=i(86554),a=i(30954),o={x:{get:function(){return this.body.position.x},set:function(e){this._tempVec2.set(e,this.y),n.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(e){this._tempVec2.set(this.x,e),n.setPosition(this.body,this._tempVec2)}},scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(e){this.setScale(e,e)}},scaleX:{get:function(){return this._scaleX},set:function(e){var t=1/this._scaleX,i=1/this._scaleY;this._scaleX=e,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,n.scale(this.body,t,i),n.scale(this.body,e,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(e){var t=1/this._scaleX,i=1/this._scaleY;this._scaleY=e,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,n.scale(this.body,t,i),n.scale(this.body,this._scaleX,e)}},angle:{get:function(){return a(this.body.angle*r.RAD_TO_DEG)},set:function(e){this.rotation=a(e)*r.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(e){this._rotation=s(e),n.setAngle(this.body,this._rotation)}},setPosition:function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this._tempVec2.set(e,t),n.setPosition(this.body,this._tempVec2),this},setRotation:function(e){return void 0===e&&(e=0),this._rotation=s(e),n.setAngle(this.body,e),this},setFixedRotation:function(){return n.setInertia(this.body,1/0),this},setAngle:function(e){return void 0===e&&(e=0),this.angle=e,n.setAngle(this.body,this.rotation),this},setScale:function(e,t,i){void 0===e&&(e=1),void 0===t&&(t=e);var r=1/this._scaleX,s=1/this._scaleY;return this._scaleX=e,this._scaleY=t,n.scale(this.body,r,s,i),n.scale(this.body,e,t,i),this}};e.exports=o},42081(e,t,i){var n=i(22562),r={setVelocityX:function(e){return this._tempVec2.set(e,this.body.velocity.y),n.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(e){return this._tempVec2.set(this.body.velocity.x,e),n.setVelocity(this.body,this._tempVec2),this},setVelocity:function(e,t){return this._tempVec2.set(e,t),n.setVelocity(this.body,this._tempVec2),this},getVelocity:function(){return n.getVelocity(this.body)},setAngularVelocity:function(e){return n.setAngularVelocity(this.body,e),this},getAngularVelocity:function(){return n.getAngularVelocity(this.body)},setAngularSpeed:function(e){return n.setAngularSpeed(this.body,e),this},getAngularSpeed:function(){return n.getAngularSpeed(this.body)}};e.exports=r},9503(e,t,i){e.exports={Bounce:i(70410),Collision:i(66968),Force:i(51607),Friction:i(5436),Gravity:i(39858),Mass:i(37302),Sensor:i(39132),SetBody:i(57772),Sleep:i(38083),Static:i(90556),Transform:i(85436),Velocity:i(42081)}},85608(e){e.exports="afteradd"},1213(e){e.exports="afterremove"},25968(e){e.exports="afterupdate"},67205(e){e.exports="beforeadd"},39438(e){e.exports="beforeremove"},44823(e){e.exports="beforeupdate"},92593(e){e.exports="collisionactive"},60128(e){e.exports="collisionend"},76861(e){e.exports="collisionstart"},92362(e){e.exports="dragend"},76408(e){e.exports="drag"},93971(e){e.exports="dragstart"},5656(e){e.exports="pause"},47861(e){e.exports="resume"},79099(e){e.exports="sleepend"},35906(e){e.exports="sleepstart"},1121(e,t,i){e.exports={AFTER_ADD:i(85608),AFTER_REMOVE:i(1213),AFTER_UPDATE:i(25968),BEFORE_ADD:i(67205),BEFORE_REMOVE:i(39438),BEFORE_UPDATE:i(44823),COLLISION_ACTIVE:i(92593),COLLISION_END:i(60128),COLLISION_START:i(76861),DRAG_END:i(92362),DRAG:i(76408),DRAG_START:i(93971),PAUSE:i(5656),RESUME:i(47861),SLEEP_END:i(79099),SLEEP_START:i(35906)}},3875(e,t,i){e.exports={BodyBounds:i(68174),Components:i(9503),Events:i(1121),Factory:i(28137),MatterGameObject:i(75803),Image:i(23181),Matter:i(19933),MatterPhysics:i(42045),PolyDecomp:i(55973),Sprite:i(34803),TileBody:i(73834),PhysicsEditorParser:i(19496),PhysicsJSONParser:i(85791),PointerConstraint:i(98713),World:i(68243)}},22562(e,t,i){var n={};e.exports=n;var r=i(41598),s=i(31725),a=i(53614),o=i(53402),l=i(15647),h=i(66615);!function(){n._timeCorrection=!0,n._inertiaScale=4,n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,n._baseDelta=1e3/60,n.create=function(t){var i={id:o.nextId(),type:"body",label:"Body",parts:[],plugin:{},attractors:t.attractors||[],wrapBounds:null,angle:0,vertices:null,position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inverseMass:0,inertia:0,deltaTime:1e3/60,inverseInertia:0,_original:null,render:{visible:!0,opacity:1,sprite:{xOffset:0,yOffset:0},fillColor:null,fillOpacity:null,lineColor:null,lineOpacity:null,lineThickness:null},gameObject:null,scale:{x:1,y:1},centerOfMass:{x:0,y:0},centerOffset:{x:0,y:0},gravityScale:{x:1,y:1},ignoreGravity:!1,ignorePointer:!1,onCollideCallback:null,onCollideEndCallback:null,onCollideActiveCallback:null,onCollideWith:{}};!t.hasOwnProperty("position")&&t.hasOwnProperty("vertices")?t.position=r.centre(t.vertices):t.hasOwnProperty("vertices")||(i.vertices=r.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var n=o.extend(i,t);return e(n,t),n.setOnCollideWith=function(e,t){return t?this.onCollideWith[e.id]=t:delete this.onCollideWith[e.id],this},n},n.nextGroup=function(e){return e?n._nextNonCollidingGroupId--:n._nextCollidingGroupId++},n.nextCategory=function(){return n._nextCategory=n._nextCategory<<1,n._nextCategory};var e=function(e,t){if(t=t||{},n.set(e,{bounds:e.bounds||l.create(e.vertices),positionPrev:e.positionPrev||s.clone(e.position),anglePrev:e.anglePrev||e.angle,vertices:e.vertices,parts:e.parts||[e],isStatic:e.isStatic,isSleeping:e.isSleeping,parent:e.parent||e}),r.rotate(e.vertices,e.angle,e.position),h.rotate(e.axes,e.angle),l.update(e.bounds,e.vertices,e.velocity),n.set(e,{axes:t.axes||e.axes,area:t.area||e.area,mass:t.mass||e.mass,inertia:t.inertia||e.inertia}),1===e.parts.length){var i=e.bounds,a=e.centerOfMass,o=e.centerOffset,u=i.max.x-i.min.x,c=i.max.y-i.min.y;a.x=-(i.min.x-e.position.x)/u,a.y=-(i.min.y-e.position.y)/c,o.x=u*a.x,o.y=c*a.y}};n.set=function(e,t,i){var r;for(r in"string"===typeof t&&(r=t,(t={})[r]=i),t)if(Object.prototype.hasOwnProperty.call(t,r))switch(i=t[r],r){case"isStatic":n.setStatic(e,i);break;case"isSleeping":a.set(e,i);break;case"mass":n.setMass(e,i);break;case"density":n.setDensity(e,i);break;case"inertia":n.setInertia(e,i);break;case"vertices":n.setVertices(e,i);break;case"position":n.setPosition(e,i);break;case"angle":n.setAngle(e,i);break;case"velocity":n.setVelocity(e,i);break;case"angularVelocity":n.setAngularVelocity(e,i);break;case"speed":n.setSpeed(e,i);break;case"angularSpeed":n.setAngularSpeed(e,i);break;case"parts":n.setParts(e,i);break;case"centre":n.setCentre(e,i);break;default:e[r]=i}},n.setStatic=function(e,t){for(var i=0;i<e.parts.length;i++){var n=e.parts[i];t?(n.isStatic||(n._original={restitution:n.restitution,friction:n.friction,mass:n.mass,inertia:n.inertia,density:n.density,inverseMass:n.inverseMass,inverseInertia:n.inverseInertia}),n.restitution=0,n.friction=1,n.mass=n.inertia=n.density=1/0,n.inverseMass=n.inverseInertia=0,n.positionPrev.x=n.position.x,n.positionPrev.y=n.position.y,n.anglePrev=n.angle,n.angularVelocity=0,n.speed=0,n.angularSpeed=0,n.motion=0):n._original&&(n.restitution=n._original.restitution,n.friction=n._original.friction,n.mass=n._original.mass,n.inertia=n._original.inertia,n.density=n._original.density,n.inverseMass=n._original.inverseMass,n.inverseInertia=n._original.inverseInertia,n._original=null),n.isStatic=t}},n.setMass=function(e,t){var i=e.inertia/(e.mass/6);e.inertia=i*(t/6),e.inverseInertia=1/e.inertia,e.mass=t,e.inverseMass=1/e.mass,e.density=e.mass/e.area},n.setDensity=function(e,t){n.setMass(e,t*e.area),e.density=t},n.setInertia=function(e,t){e.inertia=t,e.inverseInertia=1/e.inertia},n.setVertices=function(e,t){t[0].body===e?e.vertices=t:e.vertices=r.create(t,e),e.axes=h.fromVertices(e.vertices),e.area=r.area(e.vertices),n.setMass(e,e.density*e.area);var i=r.centre(e.vertices);r.translate(e.vertices,i,-1),n.setInertia(e,n._inertiaScale*r.inertia(e.vertices,e.mass)),r.translate(e.vertices,e.position),l.update(e.bounds,e.vertices,e.velocity)},n.setParts=function(e,t,i){var s;for(t=t.slice(0),e.parts.length=0,e.parts.push(e),e.parent=e,s=0;s<t.length;s++){var a=t[s];a!==e&&(a.parent=e,e.parts.push(a))}if(1!==e.parts.length){if(i="undefined"===typeof i||i){var o=[];for(s=0;s<t.length;s++)o=o.concat(t[s].vertices);r.clockwiseSort(o);var h=r.hull(o),u=r.centre(h);n.setVertices(e,h),r.translate(e.vertices,u)}var c=n._totalProperties(e),d=c.centre.x,f=c.centre.y,p=e.bounds,m=e.centerOfMass,g=e.centerOffset;l.update(p,e.vertices,e.velocity),m.x=-(p.min.x-d)/(p.max.x-p.min.x),m.y=-(p.min.y-f)/(p.max.y-p.min.y),g.x=d,g.y=f,e.area=c.area,e.parent=e,e.position.x=d,e.position.y=f,e.positionPrev.x=d,e.positionPrev.y=f,n.setMass(e,c.mass),n.setInertia(e,c.inertia),n.setPosition(e,c.centre)}},n.setCentre=function(e,t,i){i?(e.positionPrev.x+=t.x,e.positionPrev.y+=t.y,e.position.x+=t.x,e.position.y+=t.y):(e.positionPrev.x=t.x-(e.position.x-e.positionPrev.x),e.positionPrev.y=t.y-(e.position.y-e.positionPrev.y),e.position.x=t.x,e.position.y=t.y)},n.setPosition=function(e,t,i){var n=s.sub(t,e.position);i?(e.positionPrev.x=e.position.x,e.positionPrev.y=e.position.y,e.velocity.x=n.x,e.velocity.y=n.y,e.speed=s.magnitude(n)):(e.positionPrev.x+=n.x,e.positionPrev.y+=n.y);for(var a=0;a<e.parts.length;a++){var o=e.parts[a];o.position.x+=n.x,o.position.y+=n.y,r.translate(o.vertices,n),l.update(o.bounds,o.vertices,e.velocity)}},n.setAngle=function(e,t,i){var n=t-e.angle;i?(e.anglePrev=e.angle,e.angularVelocity=n,e.angularSpeed=Math.abs(n)):e.anglePrev+=n;for(var a=0;a<e.parts.length;a++){var o=e.parts[a];o.angle+=n,r.rotate(o.vertices,n,e.position),h.rotate(o.axes,n),l.update(o.bounds,o.vertices,e.velocity),a>0&&s.rotateAbout(o.position,n,e.position,o.position)}},n.setVelocity=function(e,t){var i=e.deltaTime/n._baseDelta;e.positionPrev.x=e.position.x-t.x*i,e.positionPrev.y=e.position.y-t.y*i,e.velocity.x=(e.position.x-e.positionPrev.x)/i,e.velocity.y=(e.position.y-e.positionPrev.y)/i,e.speed=s.magnitude(e.velocity)},n.getVelocity=function(e){var t=n._baseDelta/e.deltaTime;return{x:(e.position.x-e.positionPrev.x)*t,y:(e.position.y-e.positionPrev.y)*t}},n.getSpeed=function(e){return s.magnitude(n.getVelocity(e))},n.setSpeed=function(e,t){n.setVelocity(e,s.mult(s.normalise(n.getVelocity(e)),t))},n.setAngularVelocity=function(e,t){var i=e.deltaTime/n._baseDelta;e.anglePrev=e.angle-t*i,e.angularVelocity=(e.angle-e.anglePrev)/i,e.angularSpeed=Math.abs(e.angularVelocity)},n.getAngularVelocity=function(e){return(e.angle-e.anglePrev)*n._baseDelta/e.deltaTime},n.getAngularSpeed=function(e){return Math.abs(n.getAngularVelocity(e))},n.setAngularSpeed=function(e,t){n.setAngularVelocity(e,o.sign(n.getAngularVelocity(e))*t)},n.translate=function(e,t,i){n.setPosition(e,s.add(e.position,t),i)},n.rotate=function(e,t,i,r){if(i){var s=Math.cos(t),a=Math.sin(t),o=e.position.x-i.x,l=e.position.y-i.y;n.setPosition(e,{x:i.x+(o*s-l*a),y:i.y+(o*a+l*s)},r),n.setAngle(e,e.angle+t,r)}else n.setAngle(e,e.angle+t,r)},n.scale=function(e,t,i,s){var a=0,o=0;s=s||e.position;for(var u=e.inertia===1/0,c=0;c<e.parts.length;c++){var d=e.parts[c];d.scale.x=t,d.scale.y=i,r.scale(d.vertices,t,i,s),d.axes=h.fromVertices(d.vertices),d.area=r.area(d.vertices),n.setMass(d,e.density*d.area),r.translate(d.vertices,{x:-d.position.x,y:-d.position.y}),n.setInertia(d,n._inertiaScale*r.inertia(d.vertices,d.mass)),r.translate(d.vertices,{x:d.position.x,y:d.position.y}),c>0&&(a+=d.area,o+=d.inertia),d.position.x=s.x+(d.position.x-s.x)*t,d.position.y=s.y+(d.position.y-s.y)*i,l.update(d.bounds,d.vertices,e.velocity)}e.parts.length>1&&(e.area=a,e.isStatic||(n.setMass(e,e.density*a),n.setInertia(e,o))),e.circleRadius&&(t===i?e.circleRadius*=t:e.circleRadius=null),u&&n.setInertia(e,1/0)},n.update=function(e,t){var i=(t=("undefined"!==typeof t?t:1e3/60)*e.timeScale)*t,a=n._timeCorrection?t/(e.deltaTime||t):1,u=1-e.frictionAir*(t/o._baseDelta),c=(e.position.x-e.positionPrev.x)*a,d=(e.position.y-e.positionPrev.y)*a;e.velocity.x=c*u+e.force.x/e.mass*i,e.velocity.y=d*u+e.force.y/e.mass*i,e.positionPrev.x=e.position.x,e.positionPrev.y=e.position.y,e.position.x+=e.velocity.x,e.position.y+=e.velocity.y,e.deltaTime=t,e.angularVelocity=(e.angle-e.anglePrev)*u*a+e.torque/e.inertia*i,e.anglePrev=e.angle,e.angle+=e.angularVelocity,e.speed=s.magnitude(e.velocity),e.angularSpeed=Math.abs(e.angularVelocity);for(var f=0;f<e.parts.length;f++){var p=e.parts[f];r.translate(p.vertices,e.velocity),f>0&&(p.position.x+=e.velocity.x,p.position.y+=e.velocity.y),0!==e.angularVelocity&&(r.rotate(p.vertices,e.angularVelocity,e.position),h.rotate(p.axes,e.angularVelocity),f>0&&s.rotateAbout(p.position,e.angularVelocity,e.position,p.position)),l.update(p.bounds,p.vertices,e.velocity)}},n.updateVelocities=function(e){var t=n._baseDelta/e.deltaTime,i=e.velocity;i.x=(e.position.x-e.positionPrev.x)*t,i.y=(e.position.y-e.positionPrev.y)*t,e.speed=Math.sqrt(i.x*i.x+i.y*i.y),e.angularVelocity=(e.angle-e.anglePrev)*t,e.angularSpeed=Math.abs(e.angularVelocity)},n.applyForce=function(e,t,i){var n=t.x-e.position.x,r=t.y-e.position.y;e.force.x+=i.x,e.force.y+=i.y,e.torque+=n*i.y-r*i.x},n._totalProperties=function(e){for(var t={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===e.parts.length?0:1;i<e.parts.length;i++){var n=e.parts[i],r=n.mass!==1/0?n.mass:1;t.mass+=r,t.area+=n.area,t.inertia+=n.inertia,t.centre=s.add(t.centre,s.mult(n.position,r))}return t.centre=s.div(t.centre,t.mass),t},n.wrap=function(e,t){var i=l.wrap(e.bounds,t);return i&&n.translate(e,i),i}}()},69351(e,t,i){var n={};e.exports=n;var r=i(35810),s=i(53402),a=i(15647),o=i(22562);n.create=function(e){return s.extend({id:s.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},wrapBounds:null,cache:{allBodies:null,allConstraints:null,allComposites:null}},e)},n.setModified=function(e,t,i,s){if(r.trigger(e,"compositeModified",e),e.isModified=t,t&&e.cache&&(e.cache.allBodies=null,e.cache.allConstraints=null,e.cache.allComposites=null),i&&e.parent&&n.setModified(e.parent,t,i,s),s)for(var a=0;a<e.composites.length;a++){var o=e.composites[a];n.setModified(o,t,i,s)}},n.add=function(e,t){var i=[].concat(t);r.trigger(e,"beforeAdd",{object:t});for(var a=0;a<i.length;a++){var o=i[a];switch(o.type){case"body":if(o.parent!==o){s.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}n.addBody(e,o);break;case"constraint":n.addConstraint(e,o);break;case"composite":n.addComposite(e,o);break;case"mouseConstraint":n.addConstraint(e,o.constraint)}}return r.trigger(e,"afterAdd",{object:t}),e},n.remove=function(e,t,i){var s=[].concat(t);r.trigger(e,"beforeRemove",{object:t});for(var a=0;a<s.length;a++){var o=s[a];switch(o.type){case"body":n.removeBody(e,o,i);break;case"constraint":n.removeConstraint(e,o,i);break;case"composite":n.removeComposite(e,o,i);break;case"mouseConstraint":n.removeConstraint(e,o.constraint)}}return r.trigger(e,"afterRemove",{object:t}),e},n.addComposite=function(e,t){return e.composites.push(t),t.parent=e,n.setModified(e,!0,!0,!1),e},n.removeComposite=function(e,t,i){var r=s.indexOf(e.composites,t);if(-1!==r){var a=n.allBodies(t);n.removeCompositeAt(e,r);for(var o=0;o<a.length;o++)a[o].sleepCounter=0}if(i)for(o=0;o<e.composites.length;o++)n.removeComposite(e.composites[o],t,!0);return e},n.removeCompositeAt=function(e,t){return e.composites.splice(t,1),n.setModified(e,!0,!0,!1),e},n.addBody=function(e,t){return e.bodies.push(t),n.setModified(e,!0,!0,!1),e},n.removeBody=function(e,t,i){var r=s.indexOf(e.bodies,t);if(-1!==r&&(n.removeBodyAt(e,r),t.sleepCounter=0),i)for(var a=0;a<e.composites.length;a++)n.removeBody(e.composites[a],t,!0);return e},n.removeBodyAt=function(e,t){return e.bodies.splice(t,1),n.setModified(e,!0,!0,!1),e},n.addConstraint=function(e,t){return e.constraints.push(t),n.setModified(e,!0,!0,!1),e},n.removeConstraint=function(e,t,i){var r=s.indexOf(e.constraints,t);if(-1!==r&&n.removeConstraintAt(e,r),i)for(var a=0;a<e.composites.length;a++)n.removeConstraint(e.composites[a],t,!0);return e},n.removeConstraintAt=function(e,t){return e.constraints.splice(t,1),n.setModified(e,!0,!0,!1),e},n.clear=function(e,t,i){if(i)for(var r=0;r<e.composites.length;r++)n.clear(e.composites[r],t,!0);return t?e.bodies=e.bodies.filter(function(e){return e.isStatic}):e.bodies.length=0,e.constraints.length=0,e.composites.length=0,n.setModified(e,!0,!0,!1),e},n.allBodies=function(e){if(e.cache&&e.cache.allBodies)return e.cache.allBodies;for(var t=[].concat(e.bodies),i=0;i<e.composites.length;i++)t=t.concat(n.allBodies(e.composites[i]));return e.cache&&(e.cache.allBodies=t),t},n.allConstraints=function(e){if(e.cache&&e.cache.allConstraints)return e.cache.allConstraints;for(var t=[].concat(e.constraints),i=0;i<e.composites.length;i++)t=t.concat(n.allConstraints(e.composites[i]));return e.cache&&(e.cache.allConstraints=t),t},n.allComposites=function(e){if(e.cache&&e.cache.allComposites)return e.cache.allComposites;for(var t=[].concat(e.composites),i=0;i<e.composites.length;i++)t=t.concat(n.allComposites(e.composites[i]));return e.cache&&(e.cache.allComposites=t),t},n.get=function(e,t,i){var r,s;switch(i){case"body":r=n.allBodies(e);break;case"constraint":r=n.allConstraints(e);break;case"composite":r=n.allComposites(e).concat(e)}return r?0===(s=r.filter(function(e){return e.id.toString()===t.toString()})).length?null:s[0]:null},n.move=function(e,t,i){return n.remove(e,t),n.add(i,t),e},n.rebase=function(e){for(var t=n.allBodies(e).concat(n.allConstraints(e)).concat(n.allComposites(e)),i=0;i<t.length;i++)t[i].id=s.nextId();return e},n.translate=function(e,t,i){for(var r=i?n.allBodies(e):e.bodies,s=0;s<r.length;s++)o.translate(r[s],t);return e},n.rotate=function(e,t,i,r){for(var s=Math.cos(t),a=Math.sin(t),l=r?n.allBodies(e):e.bodies,h=0;h<l.length;h++){var u=l[h],c=u.position.x-i.x,d=u.position.y-i.y;o.setPosition(u,{x:i.x+(c*s-d*a),y:i.y+(c*a+d*s)}),o.rotate(u,t)}return e},n.scale=function(e,t,i,r,s){for(var a=s?n.allBodies(e):e.bodies,l=0;l<a.length;l++){var h=a[l],u=h.position.x-r.x,c=h.position.y-r.y;o.setPosition(h,{x:r.x+u*t,y:r.y+c*i}),o.scale(h,t,i)}return e},n.bounds=function(e){for(var t=n.allBodies(e),i=[],r=0;r<t.length;r+=1){var s=t[r];i.push(s.bounds.min,s.bounds.max)}return a.create(i)},n.wrap=function(e,t){var i=a.wrap(n.bounds(e),t);return i&&n.translate(e,i),i}},4372(e,t,i){var n={};e.exports=n;var r=i(69351);n.create=r.create,n.add=r.add,n.remove=r.remove,n.clear=r.clear,n.addComposite=r.addComposite,n.addBody=r.addBody,n.addConstraint=r.addConstraint},52284(e,t,i){var n={};e.exports=n;var r=i(41598),s=i(4506);!function(){var e=[],t={overlap:0,axis:null},i={overlap:0,axis:null};n.create=function(e,t){return{pair:null,collided:!1,bodyA:e,bodyB:t,parentA:e.parent,parentB:t.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[null,null],supportCount:0}},n.collides=function(e,a,o){if(n._overlapAxes(t,e.vertices,a.vertices,e.axes),t.overlap<=0)return null;if(n._overlapAxes(i,a.vertices,e.vertices,a.axes),i.overlap<=0)return null;var l,h,u=o&&o.table[s.id(e,a)];u?l=u.collision:((l=n.create(e,a)).collided=!0,l.bodyA=e.id<a.id?e:a,l.bodyB=e.id<a.id?a:e,l.parentA=l.bodyA.parent,l.parentB=l.bodyB.parent),e=l.bodyA,a=l.bodyB,h=t.overlap<i.overlap?t:i;var c=l.normal,d=l.tangent,f=l.penetration,p=l.supports,m=h.overlap,g=h.axis,v=g.x,y=g.y;v*(a.position.x-e.position.x)+y*(a.position.y-e.position.y)>=0&&(v=-v,y=-y),c.x=v,c.y=y,d.x=-y,d.y=v,f.x=v*m,f.y=y*m,l.depth=m;var x=n._findSupports(e,a,c,1),b=0;if(r.contains(e.vertices,x[0])&&(p[b++]=x[0]),r.contains(e.vertices,x[1])&&(p[b++]=x[1]),b<2){var w=n._findSupports(a,e,c,-1);r.contains(a.vertices,w[0])&&(p[b++]=w[0]),b<2&&r.contains(a.vertices,w[1])&&(p[b++]=w[1])}return 0===b&&(p[b++]=x[0]),l.supportCount=b,l},n._overlapAxes=function(e,t,i,n){var r,s,a,o,l,h,u=t.length,c=i.length,d=t[0].x,f=t[0].y,p=i[0].x,m=i[0].y,g=n.length,v=Number.MAX_VALUE,y=0;for(l=0;l<g;l++){var x=n[l],b=x.x,w=x.y,T=d*b+f*w,_=p*b+m*w,S=T,E=_;for(h=1;h<u;h+=1)(o=t[h].x*b+t[h].y*w)>S?S=o:o<T&&(T=o);for(h=1;h<c;h+=1)(o=i[h].x*b+i[h].y*w)>E?E=o:o<_&&(_=o);if((r=(s=S-_)<(a=E-T)?s:a)<v&&(v=r,y=l,r<=0))break}e.axis=n[y],e.overlap=v},n._findSupports=function(t,i,n,r){var s,a,o,l=i.vertices,h=l.length,u=t.position.x,c=t.position.y,d=n.x*r,f=n.y*r,p=l[0],m=p,g=d*(u-m.x)+f*(c-m.y);for(o=1;o<h;o+=1)(a=d*(u-(m=l[o]).x)+f*(c-m.y))<g&&(g=a,p=m);return g=d*(u-(s=l[(h+p.index-1)%h]).x)+f*(c-s.y),d*(u-(m=l[(p.index+1)%h]).x)+f*(c-m.y)<g?(e[0]=p,e[1]=m,e):(e[0]=p,e[1]=s,e)}}()},43424(e){var t={};e.exports=t,t.create=function(e){return{vertex:e,normalImpulse:0,tangentImpulse:0}}},81388(e,t,i){var n={};e.exports=n;var r=i(53402),s=i(52284);n.create=function(e){return r.extend({bodies:[],collisions:[],pairs:null},e)},n.setBodies=function(e,t){e.bodies=t.slice(0)},n.clear=function(e){e.bodies=[],e.collisions=[]},n.collisions=function(e){var t,i,r=e.pairs,a=e.bodies,o=a.length,l=n.canCollide,h=s.collides,u=e.collisions,c=0;for(a.sort(n._compareBoundsX),t=0;t<o;t++){var d=a[t],f=d.bounds,p=d.bounds.max.x,m=d.bounds.max.y,g=d.bounds.min.y,v=d.isStatic||d.isSleeping,y=d.parts.length,x=1===y;for(i=t+1;i<o;i++){var b=a[i];if((k=b.bounds).min.x>p)break;if(!(m<k.min.y||g>k.max.y)&&(!v||!b.isStatic&&!b.isSleeping)&&l(d.collisionFilter,b.collisionFilter)){var w=b.parts.length;if(x&&1===w)(C=h(d,b,r))&&(u[c++]=C);else for(var T=w>1?1:0,_=y>1?1:0;_<y;_++)for(var S=d.parts[_],E=(f=S.bounds,T);E<w;E++){var C,A=b.parts[E],k=A.bounds;f.min.x>k.max.x||f.max.x<k.min.x||f.max.y<k.min.y||f.min.y>k.max.y||(C=h(S,A,r))&&(u[c++]=C)}}}}return u.length!==c&&(u.length=c),u},n.canCollide=function(e,t){return e.group===t.group&&0!==e.group?e.group>0:0!==(e.mask&t.category)&&0!==(t.mask&e.category)},n._compareBoundsX=function(e,t){return e.bounds.min.x-t.bounds.min.x}},4506(e,t,i){var n={};e.exports=n;var r=i(43424);n.create=function(e,t){var i=e.bodyA,s=e.bodyB,a={id:n.id(i,s),bodyA:i,bodyB:s,collision:e,contacts:[r.create(),r.create()],contactCount:0,separation:0,isActive:!0,isSensor:i.isSensor||s.isSensor,timeCreated:t,timeUpdated:t,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return n.update(a,e,t),a},n.update=function(e,t,i){var n=t.supports,r=t.supportCount,s=e.contacts,a=t.parentA,o=t.parentB;e.isActive=!0,e.timeUpdated=i,e.collision=t,e.separation=t.depth,e.inverseMass=a.inverseMass+o.inverseMass,e.friction=a.friction<o.friction?a.friction:o.friction,e.frictionStatic=a.frictionStatic>o.frictionStatic?a.frictionStatic:o.frictionStatic,e.restitution=a.restitution>o.restitution?a.restitution:o.restitution,e.slop=a.slop>o.slop?a.slop:o.slop,e.contactCount=r,t.pair=e;var l=n[0],h=s[0],u=n[1],c=s[1];c.vertex!==l&&h.vertex!==u||(s[1]=h,s[0]=h=c,c=s[1]),h.vertex=l,c.vertex=u},n.setActive=function(e,t,i){t?(e.isActive=!0,e.timeUpdated=i):(e.isActive=!1,e.contactCount=0)},n.id=function(e,t){return e.id<t.id?e.id.toString(36)+":"+t.id.toString(36):t.id.toString(36)+":"+e.id.toString(36)}},99561(e,t,i){var n={};e.exports=n;var r=i(4506),s=i(53402);n.create=function(e){return s.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},e)},n.update=function(e,t,i){var n,s,a,o=r.update,l=r.create,h=r.setActive,u=e.table,c=e.list,d=c.length,f=d,p=e.collisionStart,m=e.collisionEnd,g=e.collisionActive,v=t.length,y=0,x=0,b=0;for(a=0;a<v;a++)(s=(n=t[a]).pair)?(s.isActive&&(g[b++]=s),o(s,n,i)):(u[(s=l(n,i)).id]=s,p[y++]=s,c[f++]=s);for(f=0,d=c.length,a=0;a<d;a++)(s=c[a]).timeUpdated>=i?c[f++]=s:(h(s,!1,i),s.collision.bodyA.sleepCounter>0&&s.collision.bodyB.sleepCounter>0?c[f++]=s:(m[x++]=s,delete u[s.id]));c.length!==f&&(c.length=f),p.length!==y&&(p.length=y),m.length!==x&&(m.length=x),g.length!==b&&(g.length=b)},n.clear=function(e){return e.table={},e.list.length=0,e.collisionStart.length=0,e.collisionActive.length=0,e.collisionEnd.length=0,e}},73296(e,t,i){var n={};e.exports=n;var r=i(31725),s=i(52284),a=i(15647),o=i(66280),l=i(41598);n.collides=function(e,t){for(var i=[],n=t.length,r=e.bounds,o=s.collides,l=a.overlaps,h=0;h<n;h++){var u=t[h],c=u.parts.length,d=1===c?0:1;if(e!==u&&l(u.bounds,r))for(var f=d;f<c;f++){var p=u.parts[f];if(l(p.bounds,r)){var m=o(p,e);if(m){i.push(m);break}}}}return i},n.ray=function(e,t,i,s){s=s||1e-100;for(var a=r.angle(t,i),l=r.magnitude(r.sub(t,i)),h=.5*(i.x+t.x),u=.5*(i.y+t.y),c=o.rectangle(h,u,l,s,{angle:a}),d=n.collides(c,e),f=0;f<d.length;f+=1){var p=d[f];p.body=p.bodyB=p.bodyA}return d},n.region=function(e,t,i){for(var n=[],r=0;r<e.length;r++){var s=e[r],o=a.overlaps(s.bounds,t);(o&&!i||!o&&i)&&n.push(s)}return n},n.point=function(e,t){for(var i=[],n=0;n<e.length;n++){var r=e[n];if(a.contains(r.bounds,t))for(var s=1===r.parts.length?0:1;s<r.parts.length;s++){var o=r.parts[s];if(a.contains(o.bounds,t)&&l.contains(o.vertices,t)){i.push(r);break}}}return i}},66272(e,t,i){var n={};e.exports=n;var r=i(41598),s=i(53402),a=i(15647);n._restingThresh=2,n._restingThreshTangent=Math.sqrt(6),n._positionDampen=.9,n._positionWarming=.8,n._frictionNormalMultiplier=5,n._frictionMaxStatic=Number.MAX_VALUE,n.preSolvePosition=function(e){var t,i,n,r=e.length;for(t=0;t<r;t++)(i=e[t]).isActive&&(n=i.contactCount,i.collision.parentA.totalContacts+=n,i.collision.parentB.totalContacts+=n)},n.solvePosition=function(e,t,i){var r,a,o,l,h,u,c,d,f=n._positionDampen*(i||1),p=s.clamp(t/s._baseDelta,0,1),m=e.length;for(r=0;r<m;r++)(a=e[r]).isActive&&!a.isSensor&&(l=(o=a.collision).parentA,h=o.parentB,u=o.normal,a.separation=o.depth+u.x*(h.positionImpulse.x-l.positionImpulse.x)+u.y*(h.positionImpulse.y-l.positionImpulse.y));for(r=0;r<m;r++)(a=e[r]).isActive&&!a.isSensor&&(l=(o=a.collision).parentA,h=o.parentB,u=o.normal,d=a.separation-a.slop*p,(l.isStatic||h.isStatic)&&(d*=2),l.isStatic||l.isSleeping||(c=f/l.totalContacts,l.positionImpulse.x+=u.x*d*c,l.positionImpulse.y+=u.y*d*c),h.isStatic||h.isSleeping||(c=f/h.totalContacts,h.positionImpulse.x-=u.x*d*c,h.positionImpulse.y-=u.y*d*c))},n.postSolvePosition=function(e){for(var t=n._positionWarming,i=e.length,s=r.translate,o=a.update,l=0;l<i;l++){var h=e[l],u=h.positionImpulse,c=u.x,d=u.y,f=h.velocity;if(h.totalContacts=0,0!==c||0!==d){for(var p=0;p<h.parts.length;p++){var m=h.parts[p];s(m.vertices,u),o(m.bounds,m.vertices,f),m.position.x+=c,m.position.y+=d}h.positionPrev.x+=c,h.positionPrev.y+=d,c*f.x+d*f.y<0?(u.x=0,u.y=0):(u.x*=t,u.y*=t)}}},n.preSolveVelocity=function(e){var t,i,n=e.length;for(t=0;t<n;t++){var r=e[t];if(r.isActive&&!r.isSensor){var s=r.contacts,a=r.contactCount,o=r.collision,l=o.parentA,h=o.parentB,u=o.normal,c=o.tangent;for(i=0;i<a;i++){var d=s[i],f=d.vertex,p=d.normalImpulse,m=d.tangentImpulse;if(0!==p||0!==m){var g=u.x*p+c.x*m,v=u.y*p+c.y*m;l.isStatic||l.isSleeping||(l.positionPrev.x+=g*l.inverseMass,l.positionPrev.y+=v*l.inverseMass,l.anglePrev+=l.inverseInertia*((f.x-l.position.x)*v-(f.y-l.position.y)*g)),h.isStatic||h.isSleeping||(h.positionPrev.x-=g*h.inverseMass,h.positionPrev.y-=v*h.inverseMass,h.anglePrev-=h.inverseInertia*((f.x-h.position.x)*v-(f.y-h.position.y)*g))}}}}},n.solveVelocity=function(e,t){var i,r,a,o,l=t/s._baseDelta,h=l*l*l,u=-n._restingThresh*l,c=n._restingThreshTangent,d=n._frictionNormalMultiplier*l,f=n._frictionMaxStatic,p=e.length;for(a=0;a<p;a++){var m=e[a];if(m.isActive&&!m.isSensor){var g=m.collision,v=g.parentA,y=g.parentB,x=g.normal.x,b=g.normal.y,w=g.tangent.x,T=g.tangent.y,_=m.inverseMass,S=m.friction*m.frictionStatic*d,E=m.contacts,C=m.contactCount,A=1/C,k=v.position.x-v.positionPrev.x,R=v.position.y-v.positionPrev.y,O=v.angle-v.anglePrev,P=y.position.x-y.positionPrev.x,M=y.position.y-y.positionPrev.y,N=y.angle-y.anglePrev;for(o=0;o<C;o++){var I=E[o],L=I.vertex,D=L.x-v.position.x,F=L.y-v.position.y,B=L.x-y.position.x,U=L.y-y.position.y,z=k-F*O-(P-U*N),V=R+D*O-(M+B*N),H=x*z+b*V,j=w*z+T*V,Y=m.separation+H,W=Math.min(Y,1),G=(W=Y<0?0:W)*S;j<-G||j>G?(r=j>0?j:-j,(i=m.friction*(j>0?1:-1)*h)<-r?i=-r:i>r&&(i=r)):(i=j,r=f);var X=D*b-F*x,q=B*b-U*x,K=A/(_+v.inverseInertia*X*X+y.inverseInertia*q*q),Q=(1+m.restitution)*H*K;if(i*=K,H<u)I.normalImpulse=0;else{var J=I.normalImpulse;I.normalImpulse+=Q,I.normalImpulse>0&&(I.normalImpulse=0),Q=I.normalImpulse-J}if(j<-c||j>c)I.tangentImpulse=0;else{var Z=I.tangentImpulse;I.tangentImpulse+=i,I.tangentImpulse<-r&&(I.tangentImpulse=-r),I.tangentImpulse>r&&(I.tangentImpulse=r),i=I.tangentImpulse-Z}var $=x*Q+w*i,ee=b*Q+T*i;v.isStatic||v.isSleeping||(v.positionPrev.x+=$*v.inverseMass,v.positionPrev.y+=ee*v.inverseMass,v.anglePrev+=(D*ee-F*$)*v.inverseInertia),y.isStatic||y.isSleeping||(y.positionPrev.x-=$*y.inverseMass,y.positionPrev.y-=ee*y.inverseMass,y.anglePrev-=(B*ee-U*$)*y.inverseInertia)}}}}},48140(e,t,i){var n={};e.exports=n;var r=i(41598),s=i(31725),a=i(53614),o=i(15647),l=i(66615),h=i(53402);n._warming=.4,n._torqueDampen=1,n._minLength=1e-6,n.create=function(e){var t=e;t.bodyA&&!t.pointA&&(t.pointA={x:0,y:0}),t.bodyB&&!t.pointB&&(t.pointB={x:0,y:0});var i=t.bodyA?s.add(t.bodyA.position,t.pointA):t.pointA,n=t.bodyB?s.add(t.bodyB.position,t.pointB):t.pointB,r=s.magnitude(s.sub(i,n));t.length="undefined"!==typeof t.length?t.length:r,t.id=t.id||h.nextId(),t.label=t.label||"Constraint",t.type="constraint",t.stiffness=t.stiffness||(t.length>0?1:.7),t.damping=t.damping||0,t.angularStiffness=t.angularStiffness||0,t.angleA=t.bodyA?t.bodyA.angle:t.angleA,t.angleB=t.bodyB?t.bodyB.angle:t.angleB,t.plugin={};var a={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===t.length&&t.stiffness>.1?(a.type="pin",a.anchors=!1):t.stiffness<.9&&(a.type="spring"),t.render=h.extend(a,t.render),t},n.preSolveAll=function(e){for(var t=0;t<e.length;t+=1){var i=e[t],n=i.constraintImpulse;i.isStatic||0===n.x&&0===n.y&&0===n.angle||(i.position.x+=n.x,i.position.y+=n.y,i.angle+=n.angle)}},n.solveAll=function(e,t){for(var i=h.clamp(t/h._baseDelta,0,1),r=0;r<e.length;r+=1){var s=e[r],a=!s.bodyA||s.bodyA&&s.bodyA.isStatic,o=!s.bodyB||s.bodyB&&s.bodyB.isStatic;(a||o)&&n.solve(e[r],i)}for(r=0;r<e.length;r+=1)a=!(s=e[r]).bodyA||s.bodyA&&s.bodyA.isStatic,o=!s.bodyB||s.bodyB&&s.bodyB.isStatic,a||o||n.solve(e[r],i)},n.solve=function(e,t){var i=e.bodyA,r=e.bodyB,a=e.pointA,o=e.pointB;if(i||r){i&&!i.isStatic&&(s.rotate(a,i.angle-e.angleA,a),e.angleA=i.angle),r&&!r.isStatic&&(s.rotate(o,r.angle-e.angleB,o),e.angleB=r.angle);var l=a,h=o;if(i&&(l=s.add(i.position,a)),r&&(h=s.add(r.position,o)),l&&h){var u=s.sub(l,h),c=s.magnitude(u);c<n._minLength&&(c=n._minLength);var d,f,p,m,g,v=(c-e.length)/c,y=e.stiffness>=1||0===e.length?e.stiffness*t:e.stiffness*t*t,x=e.damping*t,b=s.mult(u,v*y),w=(i?i.inverseMass:0)+(r?r.inverseMass:0),T=w+((i?i.inverseInertia:0)+(r?r.inverseInertia:0));if(x>0){var _=s.create();p=s.div(u,c),g=s.sub(r&&s.sub(r.position,r.positionPrev)||_,i&&s.sub(i.position,i.positionPrev)||_),m=s.dot(p,g)}i&&!i.isStatic&&(f=i.inverseMass/w,i.constraintImpulse.x-=b.x*f,i.constraintImpulse.y-=b.y*f,i.position.x-=b.x*f,i.position.y-=b.y*f,x>0&&(i.positionPrev.x-=x*p.x*m*f,i.positionPrev.y-=x*p.y*m*f),d=s.cross(a,b)/T*n._torqueDampen*i.inverseInertia*(1-e.angularStiffness),i.constraintImpulse.angle-=d,i.angle-=d),r&&!r.isStatic&&(f=r.inverseMass/w,r.constraintImpulse.x+=b.x*f,r.constraintImpulse.y+=b.y*f,r.position.x+=b.x*f,r.position.y+=b.y*f,x>0&&(r.positionPrev.x+=x*p.x*m*f,r.positionPrev.y+=x*p.y*m*f),d=s.cross(o,b)/T*n._torqueDampen*r.inverseInertia*(1-e.angularStiffness),r.constraintImpulse.angle+=d,r.angle+=d)}}},n.postSolveAll=function(e){for(var t=0;t<e.length;t++){var i=e[t],h=i.constraintImpulse;if(!(i.isStatic||0===h.x&&0===h.y&&0===h.angle)){a.set(i,!1);for(var u=0;u<i.parts.length;u++){var c=i.parts[u];r.translate(c.vertices,h),u>0&&(c.position.x+=h.x,c.position.y+=h.y),0!==h.angle&&(r.rotate(c.vertices,h.angle,i.position),l.rotate(c.axes,h.angle),u>0&&s.rotateAbout(c.position,h.angle,i.position,c.position)),o.update(c.bounds,c.vertices,i.velocity)}h.angle*=n._warming,h.x*=n._warming,h.y*=n._warming}}},n.pointAWorld=function(e){return{x:(e.bodyA?e.bodyA.position.x:0)+(e.pointA?e.pointA.x:0),y:(e.bodyA?e.bodyA.position.y:0)+(e.pointA?e.pointA.y:0)}},n.pointBWorld=function(e){return{x:(e.bodyB?e.bodyB.position.x:0)+(e.pointB?e.pointB.x:0),y:(e.bodyB?e.bodyB.position.y:0)+(e.pointB?e.pointB.y:0)}},n.currentLength=function(e){var t=(e.bodyA?e.bodyA.position.x:0)+(e.pointA?e.pointA.x:0),i=(e.bodyA?e.bodyA.position.y:0)+(e.pointA?e.pointA.y:0),n=t-((e.bodyB?e.bodyB.position.x:0)+(e.pointB?e.pointB.x:0)),r=i-((e.bodyB?e.bodyB.position.y:0)+(e.pointB?e.pointB.y:0));return Math.sqrt(n*n+r*r)}},53402(e,t,i){var n={};e.exports=n,function(){n._baseDelta=1e3/60,n._nextId=0,n._seed=0,n._nowStartTime=+new Date,n._warnedOnce={},n._decomp=null,n.extend=function(e,t){var i,r;"boolean"===typeof t?(i=2,r=t):(i=1,r=!0);for(var s=i;s<arguments.length;s++){var a=arguments[s];if(a)for(var o in a)r&&a[o]&&a[o].constructor===Object?e[o]&&e[o].constructor!==Object?e[o]=a[o]:(e[o]=e[o]||{},n.extend(e[o],r,a[o])):e[o]=a[o]}return e},n.clone=function(e,t){return n.extend({},t,e)},n.keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var i in e)t.push(i);return t},n.values=function(e){var t=[];if(Object.keys){for(var i=Object.keys(e),n=0;n<i.length;n++)t.push(e[i[n]]);return t}for(var r in e)t.push(e[r]);return t},n.get=function(e,t,i,n){t=t.split(".").slice(i,n);for(var r=0;r<t.length;r+=1)e=e[t[r]];return e},n.set=function(e,t,i,r,s){var a=t.split(".").slice(r,s);return n.get(e,t,0,-1)[a[a.length-1]]=i,i},n.shuffle=function(e){for(var t=e.length-1;t>0;t--){var i=Math.floor(n.random()*(t+1)),r=e[t];e[t]=e[i],e[i]=r}return e},n.choose=function(e){return e[Math.floor(n.random()*e.length)]},n.isElement=function(e){return"undefined"!==typeof HTMLElement?e instanceof HTMLElement:!!(e&&e.nodeType&&e.nodeName)},n.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},n.isFunction=function(e){return"function"===typeof e},n.isPlainObject=function(e){return"object"===typeof e&&e.constructor===Object},n.isString=function(e){return"[object String]"===toString.call(e)},n.clamp=function(e,t,i){return e<t?t:e>i?i:e},n.sign=function(e){return e<0?-1:1},n.now=function(){if("undefined"!==typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-n._nowStartTime},n.random=function(t,i){return i="undefined"!==typeof i?i:1,(t="undefined"!==typeof t?t:0)+e()*(i-t)};var e=function(){return n._seed=(9301*n._seed+49297)%233280,n._seed/233280};n.colorToNumber=function(e){return 3==(e=e.replace("#","")).length&&(e=e.charAt(0)+e.charAt(0)+e.charAt(1)+e.charAt(1)+e.charAt(2)+e.charAt(2)),parseInt(e,16)},n.logLevel=1,n.log=function(){console&&n.logLevel>0&&n.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},n.info=function(){console&&n.logLevel>0&&n.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},n.warn=function(){console&&n.logLevel>0&&n.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},n.warnOnce=function(){var e=Array.prototype.slice.call(arguments).join(" ");n._warnedOnce[e]||(n.warn(e),n._warnedOnce[e]=!0)},n.deprecated=function(e,t,i){e[t]=n.chain(function(){n.warnOnce("\ud83d\udd05 deprecated \ud83d\udd05",i)},e[t])},n.nextId=function(){return n._nextId++},n.indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var i=0;i<e.length;i++)if(e[i]===t)return i;return-1},n.map=function(e,t){if(e.map)return e.map(t);for(var i=[],n=0;n<e.length;n+=1)i.push(t(e[n]));return i},n.topologicalSort=function(e){var t=[],i=[],r=[];for(var s in e)i[s]||r[s]||n._topologicalSort(s,i,r,e,t);return t},n._topologicalSort=function(e,t,i,r,s){var a=r[e]||[];i[e]=!0;for(var o=0;o<a.length;o+=1){var l=a[o];i[l]||(t[l]||n._topologicalSort(l,t,i,r,s))}i[e]=!1,t[e]=!0,s.push(e)},n.chain=function(){for(var e=[],t=0;t<arguments.length;t+=1){var i=arguments[t];i._chained?e.push.apply(e,i._chained):e.push(i)}var n=function(){for(var t,i=new Array(arguments.length),n=0,r=arguments.length;n<r;n++)i[n]=arguments[n];for(n=0;n<e.length;n+=1){var s=e[n].apply(t,i);"undefined"!==typeof s&&(t=s)}return t};return n._chained=e,n},n.chainPathBefore=function(e,t,i){return n.set(e,t,n.chain(i,n.get(e,t)))},n.chainPathAfter=function(e,t,i){return n.set(e,t,n.chain(n.get(e,t),i))},n.setDecomp=function(e){n._decomp=e},n.getDecomp=function(){var e=n._decomp;try{e||"undefined"===typeof window||(e=window.decomp),e||"undefined"===typeof i.g||(e=i.g.decomp)}catch(oT){e=null}return e}}()},48413(e,t,i){var n={};e.exports=n;var r=i(53614),s=i(66272),a=i(81388),o=i(99561),l=i(35810),h=i(69351),u=i(48140),c=i(53402),d=i(22562);n._deltaMax=1e3/60,n.create=function(e){e=e||{};var t=c.extend({positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0,lastUpdatesPerFrame:0}},e);return t.world=e.world||h.create({label:"World"}),t.pairs=e.pairs||o.create(),t.detector=e.detector||a.create(),t.detector.pairs=t.pairs,t.grid={buckets:[]},t.world.gravity=t.gravity,t.broadphase=t.grid,t.metrics={},t},n.update=function(e,t){var i,d=c.now(),f=e.world,p=e.detector,m=e.pairs,g=e.timing,v=g.timestamp;t>n._deltaMax&&c.warnOnce("Matter.Engine.update: delta argument is recommended to be less than or equal to",n._deltaMax.toFixed(3),"ms."),t="undefined"!==typeof t?t:c._baseDelta,t*=g.timeScale,g.timestamp+=t,g.lastDelta=t;var y={timestamp:g.timestamp,delta:t};l.trigger(e,"beforeUpdate",y);var x=h.allBodies(f),b=h.allConstraints(f),w=h.allComposites(f);for(f.isModified&&(a.setBodies(p,x),h.setModified(f,!1,!1,!0)),e.enableSleeping&&r.update(x,t),n._bodiesApplyGravity(x,e.gravity),n.wrap(x,w),n.attractors(x),t>0&&n._bodiesUpdate(x,t),l.trigger(e,"beforeSolve",y),u.preSolveAll(x),i=0;i<e.constraintIterations;i++)u.solveAll(b,t);u.postSolveAll(x);var T=a.collisions(p);o.update(m,T,v),e.enableSleeping&&r.afterCollisions(m.list),m.collisionStart.length>0&&l.trigger(e,"collisionStart",{pairs:m.collisionStart,timestamp:g.timestamp,delta:t});var _=c.clamp(20/e.positionIterations,0,1);for(s.preSolvePosition(m.list),i=0;i<e.positionIterations;i++)s.solvePosition(m.list,t,_);for(s.postSolvePosition(x),u.preSolveAll(x),i=0;i<e.constraintIterations;i++)u.solveAll(b,t);for(u.postSolveAll(x),s.preSolveVelocity(m.list),i=0;i<e.velocityIterations;i++)s.solveVelocity(m.list,t);return n._bodiesUpdateVelocities(x),m.collisionActive.length>0&&l.trigger(e,"collisionActive",{pairs:m.collisionActive,timestamp:g.timestamp,delta:t}),m.collisionEnd.length>0&&l.trigger(e,"collisionEnd",{pairs:m.collisionEnd,timestamp:g.timestamp,delta:t}),n._bodiesClearForces(x),l.trigger(e,"afterUpdate",y),e.timing.lastElapsed=c.now()-d,e},n.merge=function(e,t){if(c.extend(e,t),t.world){e.world=t.world,n.clear(e);for(var i=h.allBodies(e.world),s=0;s<i.length;s++){var a=i[s];r.set(a,!1),a.id=c.nextId()}}},n.clear=function(e){o.clear(e.pairs),a.clear(e.detector)},n._bodiesClearForces=function(e){for(var t=e.length,i=0;i<t;i++){var n=e[i];n.force.x=0,n.force.y=0,n.torque=0}},n._bodiesApplyGravity=function(e,t){var i="undefined"!==typeof t.scale?t.scale:.001,n=e.length;if((0!==t.x||0!==t.y)&&0!==i)for(var r=0;r<n;r++){var s=e[r];s.ignoreGravity||s.isStatic||s.isSleeping||(s.force.y+=s.mass*t.y*i,s.force.x+=s.mass*t.x*i)}},n._bodiesUpdate=function(e,t){for(var i=e.length,n=0;n<i;n++){var r=e[n];r.isStatic||r.isSleeping||d.update(r,t)}},n._bodiesUpdateVelocities=function(e){for(var t=e.length,i=0;i<t;i++)d.updateVelocities(e[i])},n.wrap=function(e,t){for(var i=0;i<e.length;i+=1){var n=e[i];null!==n.wrapBounds&&d.wrap(n,n.wrapBounds)}for(i=0;i<t.length;i+=1){var r=t[i];null!==r.wrapBounds&&h.wrap(r,r.wrapBounds)}},n.attractors=function(e){for(var t=0;t<e.length;t++){var i=e[t],n=i.attractors;if(n&&n.length>0)for(var r=0;r<e.length;r++){var s=e[r];if(t!==r)for(var a=0;a<n.length;a++){var o=n[a],l=o;c.isFunction(o)&&(l=o(i,s)),l&&d.applyForce(s,s.position,l)}}}}},35810(e,t,i){var n={};e.exports=n;var r=i(53402);n.on=function(e,t,i){for(var n,r=t.split(" "),s=0;s<r.length;s++)n=r[s],e.events=e.events||{},e.events[n]=e.events[n]||[],e.events[n].push(i);return i},n.off=function(e,t,i){if(t){"function"===typeof t&&(i=t,t=r.keys(e.events).join(" "));for(var n=t.split(" "),s=0;s<n.length;s++){var a=e.events[n[s]],o=[];if(i&&a)for(var l=0;l<a.length;l++)a[l]!==i&&o.push(a[l]);e.events[n[s]]=o}}else e.events={}},n.trigger=function(e,t,i){var n,s,a,o,l=e.events;if(l&&r.keys(l).length>0){i||(i={}),n=t.split(" ");for(var h=0;h<n.length;h++)if(a=l[s=n[h]]){(o=r.clone(i,!1)).name=s,o.source=e;for(var u=0;u<a.length;u++)a[u].apply(e,[o])}}}},6790(e,t,i){var n={};e.exports=n;var r=i(73832),s=i(53402);n.name="matter-js",n.version="0.20.0",n.uses=[],n.used=[],n.use=function(){r.use(n,Array.prototype.slice.call(arguments))},n.before=function(e,t){return e=e.replace(/^Matter./,""),s.chainPathBefore(n,e,t)},n.after=function(e,t){return e=e.replace(/^Matter./,""),s.chainPathAfter(n,e,t)}},73832(e,t,i){var n={};e.exports=n;var r=i(53402);n._registry={},n.register=function(e){if(n.isPlugin(e)||r.warn("Plugin.register:",n.toString(e),"does not implement all required fields."),e.name in n._registry){var t=n._registry[e.name],i=n.versionParse(e.version).number,s=n.versionParse(t.version).number;i>s?(r.warn("Plugin.register:",n.toString(t),"was upgraded to",n.toString(e)),n._registry[e.name]=e):i<s?r.warn("Plugin.register:",n.toString(t),"can not be downgraded to",n.toString(e)):e!==t&&r.warn("Plugin.register:",n.toString(e),"is already registered to different plugin object")}else n._registry[e.name]=e;return e},n.resolve=function(e){return n._registry[n.dependencyParse(e).name]},n.toString=function(e){return"string"===typeof e?e:(e.name||"anonymous")+"@"+(e.version||e.range||"0.0.0")},n.isPlugin=function(e){return e&&e.name&&e.version&&e.install},n.isUsed=function(e,t){return e.used.indexOf(t)>-1},n.isFor=function(e,t){var i=e.for&&n.dependencyParse(e.for);return!e.for||t.name===i.name&&n.versionSatisfies(t.version,i.range)},n.use=function(e,t){if(e.uses=(e.uses||[]).concat(t||[]),0!==e.uses.length){for(var i=n.dependencies(e),s=r.topologicalSort(i),a=[],o=0;o<s.length;o+=1)if(s[o]!==e.name){var l=n.resolve(s[o]);l?n.isUsed(e,l.name)||(n.isFor(l,e)||(r.warn("Plugin.use:",n.toString(l),"is for",l.for,"but installed on",n.toString(e)+"."),l._warned=!0),l.install?l.install(e):(r.warn("Plugin.use:",n.toString(l),"does not specify an install function."),l._warned=!0),l._warned?(a.push("\ud83d\udd36 "+n.toString(l)),delete l._warned):a.push("\u2705 "+n.toString(l)),e.used.push(l.name)):a.push("\u274c "+s[o])}a.length>0&&!l.silent&&r.info(a.join("  "))}else r.warn("Plugin.use:",n.toString(e),"does not specify any dependencies to install.")},n.dependencies=function(e,t){var i=n.dependencyParse(e),s=i.name;if(!(s in(t=t||{}))){e=n.resolve(e)||e,t[s]=r.map(e.uses||[],function(t){n.isPlugin(t)&&n.register(t);var s=n.dependencyParse(t),a=n.resolve(t);return a&&!n.versionSatisfies(a.version,s.range)?(r.warn("Plugin.dependencies:",n.toString(a),"does not satisfy",n.toString(s),"used by",n.toString(i)+"."),a._warned=!0,e._warned=!0):a||(r.warn("Plugin.dependencies:",n.toString(t),"used by",n.toString(i),"could not be resolved."),e._warned=!0),s.name});for(var a=0;a<t[s].length;a+=1)n.dependencies(t[s][a],t);return t}},n.dependencyParse=function(e){return r.isString(e)?(/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-+]+)?))?$/.test(e)||r.warn("Plugin.dependencyParse:",e,"is not a valid dependency string."),{name:e.split("@")[0],range:e.split("@")[1]||"*"}):{name:e.name,range:e.range||e.version}},n.versionParse=function(e){var t=/^(\*)|(\^|~|>=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;t.test(e)||r.warn("Plugin.versionParse:",e,"is not a valid version or range.");var i=t.exec(e),n=Number(i[4]),s=Number(i[5]),a=Number(i[6]);return{isRange:Boolean(i[1]||i[2]),version:i[3],range:e,operator:i[1]||i[2]||"",major:n,minor:s,patch:a,parts:[n,s,a],prerelease:i[7],number:1e8*n+1e4*s+a}},n.versionSatisfies=function(e,t){t=t||"*";var i=n.versionParse(t),r=n.versionParse(e);if(i.isRange){if("*"===i.operator||"*"===e)return!0;if(">"===i.operator)return r.number>i.number;if(">="===i.operator)return r.number>=i.number;if("~"===i.operator)return r.major===i.major&&r.minor===i.minor&&r.patch>=i.patch;if("^"===i.operator)return i.major>0?r.major===i.major&&r.number>=i.number:i.minor>0?r.minor===i.minor&&r.patch>=i.patch:r.patch===i.patch}return e===t||"*"===e}},13037(e,t,i){var n={};e.exports=n;var r=i(35810),s=i(48413),a=i(53402);!function(){n._maxFrameDelta=1e3/15,n._frameDeltaFallback=1e3/60,n._timeBufferMargin=1.5,n._elapsedNextEstimate=1,n._smoothingLowerBound=.1,n._smoothingUpperBound=.9,n.create=function(e){var t=a.extend({delta:1e3/60,frameDelta:null,frameDeltaSmoothing:!0,frameDeltaSnapping:!0,frameDeltaHistory:[],frameDeltaHistorySize:100,frameRequestId:null,timeBuffer:0,timeLastTick:null,maxUpdates:null,maxFrameTime:1e3/30,lastUpdatesDeferred:0,enabled:!0},e);return t.fps=0,t},n.run=function(e,t){return e.timeBuffer=n._frameDeltaFallback,function i(r){e.frameRequestId=n._onNextFrame(e,i),r&&e.enabled&&n.tick(e,t,r)}(),e},n.tick=function(t,i,o){var l=a.now(),h=t.delta,u=0,c=o-t.timeLastTick;if((!c||!t.timeLastTick||c>Math.max(n._maxFrameDelta,t.maxFrameTime))&&(c=t.frameDelta||n._frameDeltaFallback),t.frameDeltaSmoothing){t.frameDeltaHistory.push(c),t.frameDeltaHistory=t.frameDeltaHistory.slice(-t.frameDeltaHistorySize);var d=t.frameDeltaHistory.slice(0).sort(),f=t.frameDeltaHistory.slice(d.length*n._smoothingLowerBound,d.length*n._smoothingUpperBound);c=e(f)||c}t.frameDeltaSnapping&&(c=1e3/Math.round(1e3/c)),t.frameDelta=c,t.timeLastTick=o,t.timeBuffer+=t.frameDelta,t.timeBuffer=a.clamp(t.timeBuffer,0,t.frameDelta+h*n._timeBufferMargin),t.lastUpdatesDeferred=0;var p=t.maxUpdates||Math.ceil(t.maxFrameTime/h),m={timestamp:i.timing.timestamp};r.trigger(t,"beforeTick",m),r.trigger(t,"tick",m);for(var g=a.now();h>0&&t.timeBuffer>=h*n._timeBufferMargin;){r.trigger(t,"beforeUpdate",m),s.update(i,h),r.trigger(t,"afterUpdate",m),t.timeBuffer-=h,u+=1;var v=a.now()-l,y=a.now()-g,x=v+n._elapsedNextEstimate*y/u;if(u>=p||x>t.maxFrameTime){t.lastUpdatesDeferred=Math.round(Math.max(0,t.timeBuffer/h-n._timeBufferMargin));break}}i.timing.lastUpdatesPerFrame=u,r.trigger(t,"afterTick",m),t.frameDeltaHistory.length>=100&&(t.lastUpdatesDeferred&&Math.round(t.frameDelta/h)>p?a.warnOnce("Matter.Runner: runner reached runner.maxUpdates, see docs."):t.lastUpdatesDeferred&&a.warnOnce("Matter.Runner: runner reached runner.maxFrameTime, see docs."),"undefined"!==typeof t.isFixed&&a.warnOnce("Matter.Runner: runner.isFixed is now redundant, see docs."),(t.deltaMin||t.deltaMax)&&a.warnOnce("Matter.Runner: runner.deltaMin and runner.deltaMax were removed, see docs."),0!==t.fps&&a.warnOnce("Matter.Runner: runner.fps was replaced by runner.delta, see docs."))},n.stop=function(e){n._cancelNextFrame(e)},n._onNextFrame=function(e,t){if("undefined"===typeof window||!window.requestAnimationFrame)throw new Error("Matter.Runner: missing required global window.requestAnimationFrame.");return e.frameRequestId=window.requestAnimationFrame(t),e.frameRequestId},n._cancelNextFrame=function(e){if("undefined"===typeof window||!window.cancelAnimationFrame)throw new Error("Matter.Runner: missing required global window.cancelAnimationFrame.");window.cancelAnimationFrame(e.frameRequestId)};var e=function(e){for(var t=0,i=e.length,n=0;n<i;n+=1)t+=e[n];return t/i||0};n._mean=e}()},53614(e,t,i){var n={};e.exports=n;var r=i(22562),s=i(35810),a=i(53402);n._motionWakeThreshold=.18,n._motionSleepThreshold=.08,n._minBias=.9,n.update=function(e,t){for(var i=t/a._baseDelta,s=n._motionSleepThreshold,o=0;o<e.length;o++){var l=e[o],h=r.getSpeed(l),u=r.getAngularSpeed(l),c=h*h+u*u;if(0===l.force.x&&0===l.force.y){var d=Math.min(l.motion,c),f=Math.max(l.motion,c);l.motion=n._minBias*d+(1-n._minBias)*f,l.sleepThreshold>0&&l.motion<s?(l.sleepCounter+=1,l.sleepCounter>=l.sleepThreshold/i&&n.set(l,!0)):l.sleepCounter>0&&(l.sleepCounter-=1)}else n.set(l,!1)}},n.afterCollisions=function(e){for(var t=n._motionSleepThreshold,i=0;i<e.length;i++){var r=e[i];if(r.isActive){var s=r.collision,a=s.bodyA.parent,o=s.bodyB.parent;if(!(a.isSleeping&&o.isSleeping||a.isStatic||o.isStatic)&&(a.isSleeping||o.isSleeping)){var l=a.isSleeping&&!a.isStatic?a:o,h=l===a?o:a;!l.isStatic&&h.motion>t&&n.set(l,!1)}}}},n.set=function(e,t){var i=e.isSleeping;t?(e.isSleeping=!0,e.sleepCounter=e.sleepThreshold,e.positionImpulse.x=0,e.positionImpulse.y=0,e.positionPrev.x=e.position.x,e.positionPrev.y=e.position.y,e.anglePrev=e.angle,e.speed=0,e.angularSpeed=0,e.motion=0,i||s.trigger(e,"sleepStart")):(e.isSleeping=!1,e.sleepCounter=0,i&&s.trigger(e,"sleepEnd"))}},66280(e,t,i){var n={};e.exports=n;var r=i(41598),s=i(53402),a=i(22562),o=i(15647),l=i(31725);n.rectangle=function(e,t,i,n,o){o=o||{};var l={label:"Rectangle Body",position:{x:e,y:t},vertices:r.fromPath("L 0 0 L "+i+" 0 L "+i+" "+n+" L 0 "+n)};if(o.chamfer){var h=o.chamfer;l.vertices=r.chamfer(l.vertices,h.radius,h.quality,h.qualityMin,h.qualityMax),delete o.chamfer}return a.create(s.extend({},l,o))},n.trapezoid=function(e,t,i,n,o,l){l=l||{},o>=1&&s.warn("Bodies.trapezoid: slope parameter must be < 1.");var h,u=i*(o*=.5),c=u+(1-2*o)*i,d=c+u;h=o<.5?"L 0 0 L "+u+" "+-n+" L "+c+" "+-n+" L "+d+" 0":"L 0 0 L "+c+" "+-n+" L "+d+" 0";var f={label:"Trapezoid Body",position:{x:e,y:t},vertices:r.fromPath(h)};if(l.chamfer){var p=l.chamfer;f.vertices=r.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete l.chamfer}return a.create(s.extend({},f,l))},n.circle=function(e,t,i,r,a){r=r||{};var o={label:"Circle Body",circleRadius:i};a=a||25;var l=Math.ceil(Math.max(10,Math.min(a,i)));return l%2===1&&(l+=1),n.polygon(e,t,l,i,s.extend({},o,r))},n.polygon=function(e,t,i,o,l){if(l=l||{},i<3)return n.circle(e,t,o,l);for(var h=2*Math.PI/i,u="",c=.5*h,d=0;d<i;d+=1){var f=c+d*h,p=Math.cos(f)*o,m=Math.sin(f)*o;u+="L "+p.toFixed(3)+" "+m.toFixed(3)+" "}var g={label:"Polygon Body",position:{x:e,y:t},vertices:r.fromPath(u)};if(l.chamfer){var v=l.chamfer;g.vertices=r.chamfer(g.vertices,v.radius,v.quality,v.qualityMin,v.qualityMax),delete l.chamfer}return a.create(s.extend({},g,l))},n.fromVertices=function(e,t,i,n,h,u,c,d){var f,p,m,g,v,y,x,b,w,T,_=s.getDecomp();for(f=Boolean(_&&_.quickDecomp),n=n||{},m=[],h="undefined"!==typeof h&&h,u="undefined"!==typeof u?u:.01,c="undefined"!==typeof c?c:10,d="undefined"!==typeof d?d:.01,s.isArray(i[0])||(i=[i]),w=0;w<i.length;w+=1)if(v=i[w],!(g=r.isConvex(v))&&!f&&s.warnOnce("Bodies.fromVertices: Install the 'poly-decomp' library and use Common.setDecomp or provide 'decomp' as a global to decompose concave vertices."),g||!f)v=g?r.clockwiseSort(v):r.hull(v),m.push({position:{x:e,y:t},vertices:v});else{var S=v.map(function(e){return[e.x,e.y]});_.makeCCW(S),!1!==u&&_.removeCollinearPoints(S,u),!1!==d&&_.removeDuplicatePoints&&_.removeDuplicatePoints(S,d);var E=_.quickDecomp(S);for(y=0;y<E.length;y++){var C=E[y].map(function(e){return{x:e[0],y:e[1]}});c>0&&r.area(C)<c||m.push({position:r.centre(C),vertices:C})}}for(y=0;y<m.length;y++)m[y]=a.create(s.extend(m[y],n));if(h)for(y=0;y<m.length;y++){var A=m[y];for(x=y+1;x<m.length;x++){var k=m[x];if(o.overlaps(A.bounds,k.bounds)){var R=A.vertices,O=k.vertices;for(b=0;b<A.vertices.length;b++)for(T=0;T<k.vertices.length;T++){var P=l.magnitudeSquared(l.sub(R[(b+1)%R.length],O[T])),M=l.magnitudeSquared(l.sub(R[b],O[(T+1)%O.length]));P<5&&M<5&&(R[b].isInternal=!0,O[T].isInternal=!0)}}}}return m.length>1?(p=a.create(s.extend({parts:m.slice(0)},n)),a.setPosition(p,{x:e,y:t}),p):m[0]},n.flagCoincidentParts=function(e,t){void 0===t&&(t=5);for(var i=0;i<e.length;i++)for(var n=e[i],r=i+1;r<e.length;r++){var s=e[r];if(o.overlaps(n.bounds,s.bounds))for(var a=n.vertices,h=s.vertices,u=0;u<n.vertices.length;u++)for(var c=0;c<s.vertices.length;c++){var d=l.magnitudeSquared(l.sub(a[(u+1)%a.length],h[c])),f=l.magnitudeSquared(l.sub(a[u],h[(c+1)%h.length]));d<t&&f<t&&(a[u].isInternal=!0,h[c].isInternal=!0)}}return e}},74116(e,t,i){var n={};e.exports=n;var r=i(69351),s=i(48140),a=i(53402),o=i(22562),l=i(66280);n.stack=function(e,t,i,n,s,a,l){for(var h,u=r.create({label:"Stack"}),c=e,d=t,f=0,p=0;p<n;p++){for(var m=0,g=0;g<i;g++){var v=l(c,d,g,p,h,f);if(v){var y=v.bounds.max.y-v.bounds.min.y,x=v.bounds.max.x-v.bounds.min.x;y>m&&(m=y),o.translate(v,{x:.5*x,y:.5*y}),c=v.bounds.max.x+s,r.addBody(u,v),h=v,f+=1}else c+=s}d+=m+a,c=e}return u},n.chain=function(e,t,i,n,o,l){for(var h=e.bodies,u=1;u<h.length;u++){var c=h[u-1],d=h[u],f=c.bounds.max.y-c.bounds.min.y,p=c.bounds.max.x-c.bounds.min.x,m=d.bounds.max.y-d.bounds.min.y,g={bodyA:c,pointA:{x:p*t,y:f*i},bodyB:d,pointB:{x:(d.bounds.max.x-d.bounds.min.x)*n,y:m*o}},v=a.extend(g,l);r.addConstraint(e,s.create(v))}return e.label+=" Chain",e},n.mesh=function(e,t,i,n,o){var l,h,u,c,d,f=e.bodies;for(l=0;l<i;l++){for(h=1;h<t;h++)u=f[h-1+l*t],c=f[h+l*t],r.addConstraint(e,s.create(a.extend({bodyA:u,bodyB:c},o)));if(l>0)for(h=0;h<t;h++)u=f[h+(l-1)*t],c=f[h+l*t],r.addConstraint(e,s.create(a.extend({bodyA:u,bodyB:c},o))),n&&h>0&&(d=f[h-1+(l-1)*t],r.addConstraint(e,s.create(a.extend({bodyA:d,bodyB:c},o)))),n&&h<t-1&&(d=f[h+1+(l-1)*t],r.addConstraint(e,s.create(a.extend({bodyA:d,bodyB:c},o))))}return e.label+=" Mesh",e},n.pyramid=function(e,t,i,r,s,a,l){return n.stack(e,t,i,r,s,a,function(t,n,a,h,u,c){var d=Math.min(r,Math.ceil(i/2)),f=u?u.bounds.max.x-u.bounds.min.x:0;if(!(h>d)&&!(a<(h=d-h)||a>i-1-h))return 1===c&&o.translate(u,{x:(a+(i%2===1?1:-1))*f,y:0}),l(e+(u?a*f:0)+a*s,n,a,h,u,c)})},n.newtonsCradle=function(e,t,i,n,a){for(var o=r.create({label:"Newtons Cradle"}),h=0;h<i;h++){var u=l.circle(e+h*(1.9*n),t+a,n,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),c=s.create({pointA:{x:e+h*(1.9*n),y:t},bodyB:u});r.addBody(o,u),r.addConstraint(o,c)}return o},n.car=function(e,t,i,n,a){var h=o.nextGroup(!0),u=.5*-i+20,c=.5*i-20,d=r.create({label:"Car"}),f=l.rectangle(e,t,i,n,{collisionFilter:{group:h},chamfer:{radius:.5*n},density:2e-4}),p=l.circle(e+u,t+0,a,{collisionFilter:{group:h},friction:.8}),m=l.circle(e+c,t+0,a,{collisionFilter:{group:h},friction:.8}),g=s.create({bodyB:f,pointB:{x:u,y:0},bodyA:p,stiffness:1,length:0}),v=s.create({bodyB:f,pointB:{x:c,y:0},bodyA:m,stiffness:1,length:0});return r.addBody(d,f),r.addBody(d,p),r.addBody(d,m),r.addConstraint(d,g),r.addConstraint(d,v),d},n.softBody=function(e,t,i,r,s,o,h,u,c,d){c=a.extend({inertia:1/0},c),d=a.extend({stiffness:.2,render:{type:"line",anchors:!1}},d);var f=n.stack(e,t,i,r,s,o,function(e,t){return l.circle(e,t,u,c)});return n.mesh(f,i,r,h,d),f.label="Soft Body",f}},66615(e,t,i){var n={};e.exports=n;var r=i(31725),s=i(53402);n.fromVertices=function(e){for(var t={},i=0;i<e.length;i++){var n=(i+1)%e.length,a=r.normalise({x:e[n].y-e[i].y,y:e[i].x-e[n].x}),o=0===a.y?1/0:a.x/a.y;t[o=o.toFixed(3).toString()]=a}return s.values(t)},n.rotate=function(e,t){if(0!==t)for(var i=Math.cos(t),n=Math.sin(t),r=0;r<e.length;r++){var s,a=e[r];s=a.x*i-a.y*n,a.y=a.x*n+a.y*i,a.x=s}}},15647(e){var t={};e.exports=t,t.create=function(e){var i={min:{x:0,y:0},max:{x:0,y:0}};return e&&t.update(i,e),i},t.update=function(e,t,i){e.min.x=1/0,e.max.x=-1/0,e.min.y=1/0,e.max.y=-1/0;for(var n=0;n<t.length;n++){var r=t[n];r.x>e.max.x&&(e.max.x=r.x),r.x<e.min.x&&(e.min.x=r.x),r.y>e.max.y&&(e.max.y=r.y),r.y<e.min.y&&(e.min.y=r.y)}i&&(i.x>0?e.max.x+=i.x:e.min.x+=i.x,i.y>0?e.max.y+=i.y:e.min.y+=i.y)},t.contains=function(e,t){return t.x>=e.min.x&&t.x<=e.max.x&&t.y>=e.min.y&&t.y<=e.max.y},t.overlaps=function(e,t){return e.min.x<=t.max.x&&e.max.x>=t.min.x&&e.max.y>=t.min.y&&e.min.y<=t.max.y},t.translate=function(e,t){e.min.x+=t.x,e.max.x+=t.x,e.min.y+=t.y,e.max.y+=t.y},t.shift=function(e,t){var i=e.max.x-e.min.x,n=e.max.y-e.min.y;e.min.x=t.x,e.max.x=t.x+i,e.min.y=t.y,e.max.y=t.y+n},t.wrap=function(e,t,i){var n=null,r=null;if("undefined"!==typeof t.min.x&&"undefined"!==typeof t.max.x&&(e.min.x>t.max.x?n=t.min.x-e.max.x:e.max.x<t.min.x&&(n=t.max.x-e.min.x)),"undefined"!==typeof t.min.y&&"undefined"!==typeof t.max.y&&(e.min.y>t.max.y?r=t.min.y-e.max.y:e.max.y<t.min.y&&(r=t.max.y-e.min.y)),null!==n||null!==r)return{x:n||0,y:r||0}}},74058(e,t,i){var n={};e.exports=n;i(15647);var r=i(53402);n.pathToVertices=function(e,t){"undefined"===typeof window||"SVGPathSeg"in window||r.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var i,s,a,o,l,h,u,c,d,f,p,m=[],g=0,v=0,y=0;t=t||15;var x=function(e,t,i){var n=i%2===1&&i>1;if(!d||e!=d.x||t!=d.y){d&&n?(f=d.x,p=d.y):(f=0,p=0);var r={x:f+e,y:p+t};!n&&d||(d=r),m.push(r),v=f+e,y=p+t}},b=function(e){var t=e.pathSegTypeAsLetter.toUpperCase();if("Z"!==t){switch(t){case"M":case"L":case"T":case"C":case"S":case"Q":v=e.x,y=e.y;break;case"H":v=e.x;break;case"V":y=e.y}x(v,y,e.pathSegType)}};for(n._svgPathToAbsolute(e),a=e.getTotalLength(),h=[],i=0;i<e.pathSegList.numberOfItems;i+=1)h.push(e.pathSegList.getItem(i));for(u=h.concat();g<a;){if((l=h[e.getPathSegAtLength(g)])!=c){for(;u.length&&u[0]!=l;)b(u.shift());c=l}switch(l.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":o=e.getPointAtLength(g),x(o.x,o.y,0)}g+=t}for(i=0,s=u.length;i<s;++i)b(u[i]);return m},n._svgPathToAbsolute=function(e){for(var t,i,n,r,s,a,o=e.pathSegList,l=0,h=0,u=o.numberOfItems,c=0;c<u;++c){var d=o.getItem(c),f=d.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(f))"x"in d&&(l=d.x),"y"in d&&(h=d.y);else switch("x1"in d&&(n=l+d.x1),"x2"in d&&(s=l+d.x2),"y1"in d&&(r=h+d.y1),"y2"in d&&(a=h+d.y2),"x"in d&&(l+=d.x),"y"in d&&(h+=d.y),f){case"m":o.replaceItem(e.createSVGPathSegMovetoAbs(l,h),c);break;case"l":o.replaceItem(e.createSVGPathSegLinetoAbs(l,h),c);break;case"h":o.replaceItem(e.createSVGPathSegLinetoHorizontalAbs(l),c);break;case"v":o.replaceItem(e.createSVGPathSegLinetoVerticalAbs(h),c);break;case"c":o.replaceItem(e.createSVGPathSegCurvetoCubicAbs(l,h,n,r,s,a),c);break;case"s":o.replaceItem(e.createSVGPathSegCurvetoCubicSmoothAbs(l,h,s,a),c);break;case"q":o.replaceItem(e.createSVGPathSegCurvetoQuadraticAbs(l,h,n,r),c);break;case"t":o.replaceItem(e.createSVGPathSegCurvetoQuadraticSmoothAbs(l,h),c);break;case"a":o.replaceItem(e.createSVGPathSegArcAbs(l,h,d.r1,d.r2,d.angle,d.largeArcFlag,d.sweepFlag),c);break;case"z":case"Z":l=t,h=i}"M"!=f&&"m"!=f||(t=l,i=h)}}},31725(e){var t={};e.exports=t,t.create=function(e,t){return{x:e||0,y:t||0}},t.clone=function(e){return{x:e.x,y:e.y}},t.magnitude=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},t.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},t.rotate=function(e,t,i){var n=Math.cos(t),r=Math.sin(t);i||(i={});var s=e.x*n-e.y*r;return i.y=e.x*r+e.y*n,i.x=s,i},t.rotateAbout=function(e,t,i,n){var r=Math.cos(t),s=Math.sin(t);n||(n={});var a=i.x+((e.x-i.x)*r-(e.y-i.y)*s);return n.y=i.y+((e.x-i.x)*s+(e.y-i.y)*r),n.x=a,n},t.normalise=function(e){var i=t.magnitude(e);return 0===i?{x:0,y:0}:{x:e.x/i,y:e.y/i}},t.dot=function(e,t){return e.x*t.x+e.y*t.y},t.cross=function(e,t){return e.x*t.y-e.y*t.x},t.cross3=function(e,t,i){return(t.x-e.x)*(i.y-e.y)-(t.y-e.y)*(i.x-e.x)},t.add=function(e,t,i){return i||(i={}),i.x=e.x+t.x,i.y=e.y+t.y,i},t.sub=function(e,t,i){return i||(i={}),i.x=e.x-t.x,i.y=e.y-t.y,i},t.mult=function(e,t){return{x:e.x*t,y:e.y*t}},t.div=function(e,t){return{x:e.x/t,y:e.y/t}},t.perp=function(e,t){return{x:(t=!0===t?-1:1)*-e.y,y:t*e.x}},t.neg=function(e){return{x:-e.x,y:-e.y}},t.angle=function(e,t){return Math.atan2(t.y-e.y,t.x-e.x)},t._temp=[t.create(),t.create(),t.create(),t.create(),t.create(),t.create()]},41598(e,t,i){var n={};e.exports=n;var r=i(31725),s=i(53402);n.create=function(e,t){for(var i=[],n=0;n<e.length;n++){var r=e[n],s={x:r.x,y:r.y,index:n,body:t,isInternal:!1};i.push(s)}return i},n.fromPath=function(e,t){var i=[];return e.replace(/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/gi,function(e,t,n){i.push({x:parseFloat(t),y:parseFloat(n)})}),n.create(i,t)},n.centre=function(e){for(var t,i,s,a=n.area(e,!0),o={x:0,y:0},l=0;l<e.length;l++)s=(l+1)%e.length,t=r.cross(e[l],e[s]),i=r.mult(r.add(e[l],e[s]),t),o=r.add(o,i);return r.div(o,6*a)},n.mean=function(e){for(var t={x:0,y:0},i=0;i<e.length;i++)t.x+=e[i].x,t.y+=e[i].y;return r.div(t,e.length)},n.area=function(e,t){for(var i=0,n=e.length-1,r=0;r<e.length;r++)i+=(e[n].x-e[r].x)*(e[n].y+e[r].y),n=r;return t?i/2:Math.abs(i)/2},n.inertia=function(e,t){for(var i,n,s=0,a=0,o=e,l=0;l<o.length;l++)n=(l+1)%o.length,s+=(i=Math.abs(r.cross(o[n],o[l])))*(r.dot(o[n],o[n])+r.dot(o[n],o[l])+r.dot(o[l],o[l])),a+=i;return t/6*(s/a)},n.translate=function(e,t,i){i="undefined"!==typeof i?i:1;var n,r=e.length,s=t.x*i,a=t.y*i;for(n=0;n<r;n++)e[n].x+=s,e[n].y+=a;return e},n.rotate=function(e,t,i){if(0!==t){var n,r,s,a,o=Math.cos(t),l=Math.sin(t),h=i.x,u=i.y,c=e.length;for(a=0;a<c;a++)r=(n=e[a]).x-h,s=n.y-u,n.x=h+(r*o-s*l),n.y=u+(r*l+s*o);return e}},n.contains=function(e,t){for(var i,n=t.x,r=t.y,s=e.length,a=e[s-1],o=0;o<s;o++){if(i=e[o],(n-a.x)*(i.y-a.y)+(r-a.y)*(a.x-i.x)>0)return!1;a=i}return!0},n.scale=function(e,t,i,s){if(1===t&&1===i)return e;var a,o;s=s||n.centre(e);for(var l=0;l<e.length;l++)a=e[l],o=r.sub(a,s),e[l].x=s.x+o.x*t,e[l].y=s.y+o.y*i;return e},n.chamfer=function(e,t,i,n,a){t="number"===typeof t?[t]:t||[8],i="undefined"!==typeof i?i:-1,n=n||2,a=a||14;for(var o=[],l=0;l<e.length;l++){var h=e[l-1>=0?l-1:e.length-1],u=e[l],c=e[(l+1)%e.length],d=t[l<t.length?l:t.length-1];if(0!==d){var f=r.normalise({x:u.y-h.y,y:h.x-u.x}),p=r.normalise({x:c.y-u.y,y:u.x-c.x}),m=Math.sqrt(2*Math.pow(d,2)),g=r.mult(s.clone(f),d),v=r.normalise(r.mult(r.add(f,p),.5)),y=r.sub(u,r.mult(v,m)),x=i;-1===i&&(x=1.75*Math.pow(d,.32)),(x=s.clamp(x,n,a))%2===1&&(x+=1);for(var b=Math.acos(r.dot(f,p))/x,w=0;w<x;w++)o.push(r.add(r.rotate(g,b*w),y))}else o.push(u)}return o},n.clockwiseSort=function(e){var t=n.mean(e);return e.sort(function(e,i){return r.angle(t,e)-r.angle(t,i)}),e},n.isConvex=function(e){var t,i,n,r,s=0,a=e.length;if(a<3)return null;for(t=0;t<a;t++)if(n=(t+2)%a,r=(e[i=(t+1)%a].x-e[t].x)*(e[n].y-e[i].y),(r-=(e[i].y-e[t].y)*(e[n].x-e[i].x))<0?s|=1:r>0&&(s|=2),3===s)return!1;return 0!==s||null},n.hull=function(e){var t,i,n=[],s=[];for((e=e.slice(0)).sort(function(e,t){var i=e.x-t.x;return 0!==i?i:e.y-t.y}),i=0;i<e.length;i+=1){for(t=e[i];s.length>=2&&r.cross3(s[s.length-2],s[s.length-1],t)<=0;)s.pop();s.push(t)}for(i=e.length-1;i>=0;i-=1){for(t=e[i];n.length>=2&&r.cross3(n[n.length-2],n[n.length-1],t)<=0;)n.pop();n.push(t)}return n.pop(),s.pop(),n.concat(s)}},55973(e){function t(e,t,i){i=i||0;var n,r,s,a,o,l,h,u=[0,0];return n=e[1][1]-e[0][1],r=e[0][0]-e[1][0],s=n*e[0][0]+r*e[0][1],a=t[1][1]-t[0][1],o=t[0][0]-t[1][0],l=a*t[0][0]+o*t[0][1],_(h=n*o-a*r,0,i)||(u[0]=(o*s-r*l)/h,u[1]=(n*l-a*s)/h),u}function i(e,t,i,n){var r=t[0]-e[0],s=t[1]-e[1],a=n[0]-i[0],o=n[1]-i[1];if(a*s-o*r===0)return!1;var l=(r*(i[1]-e[1])+s*(e[0]-i[0]))/(a*s-o*r),h=(a*(e[1]-i[1])+o*(i[0]-e[0]))/(o*r-a*s);return l>=0&&l<=1&&h>=0&&h<=1}function n(e,t,i){return(t[0]-e[0])*(i[1]-e[1])-(i[0]-e[0])*(t[1]-e[1])}function r(e,t,i){return n(e,t,i)>0}function s(e,t,i){return n(e,t,i)>=0}function a(e,t,i){return n(e,t,i)<0}function o(e,t,i){return n(e,t,i)<=0}e.exports={decomp:function(e){var t=b(e);return t.length>0?w(e,t):[e]},quickDecomp:function e(t,i,n,l,h,u,m){u=u||100,m=m||0,h=h||25,i="undefined"!==typeof i?i:[],n=n||[],l=l||[];var g=[0,0],v=[0,0],x=[0,0],b=0,w=0,_=0,S=0,E=0,C=0,A=0,k=[],R=[],O=t,P=t;if(P.length<3)return i;if(++m>u)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var M=0;M<t.length;++M)if(p(O,M)){n.push(O[M]),b=w=Number.MAX_VALUE;for(var N=0;N<t.length;++N)r(d(O,M-1),d(O,M),d(O,N))&&o(d(O,M-1),d(O,M),d(O,N-1))&&(x=T(d(O,M-1),d(O,M),d(O,N),d(O,N-1)),a(d(O,M+1),d(O,M),x)&&(_=c(O[M],x))<w&&(w=_,v=x,C=N)),r(d(O,M+1),d(O,M),d(O,N+1))&&o(d(O,M+1),d(O,M),d(O,N))&&(x=T(d(O,M+1),d(O,M),d(O,N),d(O,N+1)),r(d(O,M-1),d(O,M),x)&&(_=c(O[M],x))<b&&(b=_,g=x,E=N));if(C===(E+1)%t.length)x[0]=(v[0]+g[0])/2,x[1]=(v[1]+g[1])/2,l.push(x),M<E?(f(k,O,M,E+1),k.push(x),R.push(x),0!==C&&f(R,O,C,O.length),f(R,O,0,M+1)):(0!==M&&f(k,O,M,O.length),f(k,O,0,E+1),k.push(x),R.push(x),f(R,O,C,M+1));else{if(C>E&&(E+=t.length),S=Number.MAX_VALUE,E<C)return i;for(N=C;N<=E;++N)s(d(O,M-1),d(O,M),d(O,N))&&o(d(O,M+1),d(O,M),d(O,N))&&(_=c(d(O,M),d(O,N)))<S&&y(O,M,N)&&(S=_,A=N%t.length);M<A?(f(k,O,M,A+1),0!==A&&f(R,O,A,P.length),f(R,O,0,M+1)):(0!==M&&f(k,O,M,P.length),f(k,O,0,A+1),f(R,O,A,M+1))}return k.length<R.length?(e(k,i,n,l,h,u,m),e(R,i,n,l,h,u,m)):(e(R,i,n,l,h,u,m),e(k,i,n,l,h,u,m)),i}return i.push(t),i},isSimple:function(e){var t,n=e;for(t=0;t<n.length-1;t++)for(var r=0;r<t-1;r++)if(i(n[t],n[t+1],n[r],n[r+1]))return!1;for(t=1;t<n.length-2;t++)if(i(n[0],n[n.length-1],n[t],n[t+1]))return!1;return!0},removeCollinearPoints:function(e,t){for(var i=0,n=e.length-1;e.length>3&&n>=0;--n)u(d(e,n-1),d(e,n),d(e,n+1),t)&&(e.splice(n%e.length,1),i++);return i},removeDuplicatePoints:function(e,t){for(var i=e.length-1;i>=1;--i)for(var n=e[i],r=i-1;r>=0;--r)S(n,e[r],t)&&e.splice(i,1)},makeCCW:function(e){for(var t=0,i=e,n=1;n<e.length;++n)(i[n][1]<i[t][1]||i[n][1]===i[t][1]&&i[n][0]>i[t][0])&&(t=n);return!r(d(e,t-1),d(e,t),d(e,t+1))&&(function(e){for(var t=[],i=e.length,n=0;n!==i;n++)t.push(e.pop());for(n=0;n!==i;n++)e[n]=t[n]}(e),!0)}};var l=[],h=[];function u(e,t,i,r){if(r){var s=l,a=h;s[0]=t[0]-e[0],s[1]=t[1]-e[1],a[0]=i[0]-t[0],a[1]=i[1]-t[1];var o=s[0]*a[0]+s[1]*a[1],u=Math.sqrt(s[0]*s[0]+s[1]*s[1]),c=Math.sqrt(a[0]*a[0]+a[1]*a[1]);return Math.acos(o/(u*c))<r}return 0===n(e,t,i)}function c(e,t){var i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n}function d(e,t){var i=e.length;return e[t<0?t%i+i:t%i]}function f(e,t,i,n){for(var r=i;r<n;r++)e.push(t[r])}function p(e,t){return a(d(e,t-1),d(e,t),d(e,t+1))}var m=[],g=[];function v(e,i,n){var r,a,l=m,h=g;if(s(d(e,i+1),d(e,i),d(e,n))&&o(d(e,i-1),d(e,i),d(e,n)))return!1;a=c(d(e,i),d(e,n));for(var u=0;u!==e.length;++u)if((u+1)%e.length!==i&&u!==i&&s(d(e,i),d(e,n),d(e,u+1))&&o(d(e,i),d(e,n),d(e,u))&&(l[0]=d(e,i),l[1]=d(e,n),h[0]=d(e,u),h[1]=d(e,u+1),r=t(l,h),c(d(e,i),r)<a))return!1;return!0}function y(e,t,n){for(var r=0;r!==e.length;++r)if(r!==t&&r!==n&&(r+1)%e.length!==t&&(r+1)%e.length!==n&&i(d(e,t),d(e,n),d(e,r),d(e,r+1)))return!1;return!0}function x(e,t,i,n){var r=n||[];if(function(e){e.length=0}(r),t<i)for(var s=t;s<=i;s++)r.push(e[s]);else{for(s=0;s<=i;s++)r.push(e[s]);for(s=t;s<e.length;s++)r.push(e[s])}return r}function b(e){for(var t=[],i=[],n=[],r=[],s=Number.MAX_VALUE,a=0;a<e.length;++a)if(p(e,a))for(var o=0;o<e.length;++o)if(v(e,a,o)){i=b(x(e,a,o,r)),n=b(x(e,o,a,r));for(var l=0;l<n.length;l++)i.push(n[l]);i.length<s&&(t=i,s=i.length,t.push([d(e,a),d(e,o)]))}return t}function w(e,t){if(0===t.length)return[e];if(t instanceof Array&&t.length&&t[0]instanceof Array&&2===t[0].length&&t[0][0]instanceof Array){for(var i=[e],n=0;n<t.length;n++)for(var r=t[n],s=0;s<i.length;s++){var a=w(i[s],r);if(a){i.splice(s,1),i.push(a[0],a[1]);break}}return i}r=t,n=e.indexOf(r[0]),s=e.indexOf(r[1]);return-1!==n&&-1!==s&&[x(e,n,s),x(e,s,n)]}function T(e,t,i,n,r){r=r||0;var s=t[1]-e[1],a=e[0]-t[0],o=s*e[0]+a*e[1],l=n[1]-i[1],h=i[0]-n[0],u=l*i[0]+h*i[1],c=s*h-l*a;return _(c,0,r)?[0,0]:[(h*o-a*u)/c,(s*u-l*o)/c]}function _(e,t,i){return i=i||0,Math.abs(e-t)<=i}function S(e,t,i){return _(e[0],t[0],i)&&_(e[1],t[1],i)}},52018(e,t,i){var n=new(i(83419))({initialize:function(e){this.pluginManager=e,this.game=e.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});e.exports=n},42363(e){var t={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loa
2der","TweenManager","LightsPlugin"]};t.DefaultScene.push("CameraManager3D"),t.Global.push("facebook"),e.exports=t},37277(e){var t={},i={},n={register:function(e,i,n,r){void 0===r&&(r=!1),t[e]={plugin:i,mapping:n,custom:r}},registerCustom:function(e,t,n,r){i[e]={plugin:t,mapping:n,data:r}},hasCore:function(e){return t.hasOwnProperty(e)},hasCustom:function(e){return i.hasOwnProperty(e)},getCore:function(e){return t[e]},getCustom:function(e){return i[e]},getCustomClass:function(e){return i.hasOwnProperty(e)?i[e].plugin:null},remove:function(e){t.hasOwnProperty(e)&&delete t[e]},removeCustom:function(e){i.hasOwnProperty(e)&&delete i[e]},destroyCorePlugins:function(){for(var e in t)t.hasOwnProperty(e)&&delete t[e]},destroyCustomPlugins:function(){for(var e in i)i.hasOwnProperty(e)&&delete i[e]}};e.exports=n},77332(e,t,i){var n=i(83419),r=i(8443),s=i(50792),a=i(74099),o=i(44603),l=i(39429),h=i(95540),u=i(37277),c=i(72905),d=i(8054),f=new n({Extends:s,initialize:function(e){s.call(this),this.game=e,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],e.isBooted||e.config.renderType===d.HEADLESS?this.boot():e.events.once(r.BOOT,this.boot,this)},boot:function(){var e,t,i,n,s,a,o,l=this.game.config,u=l.installGlobalPlugins;for(u=u.concat(this._pendingGlobal),e=0;e<u.length;e++)t=u[e],i=h(t,"key",null),n=h(t,"plugin",null),s=h(t,"start",!1),a=h(t,"mapping",null),o=h(t,"data",null),i&&(n?this.install(i,n,s,a,o):console.warn("Missing `plugin` for key: "+i));for(u=(u=l.installScenePlugins).concat(this._pendingScene),e=0;e<u.length;e++)t=u[e],i=h(t,"key",null),n=h(t,"plugin",null),a=h(t,"mapping",null),i&&(n?this.installScenePlugin(i,n,a):console.warn("Missing `plugin` for key: "+i));this._pendingGlobal=[],this._pendingScene=[],this.game.events.once(r.DESTROY,this.destroy,this)},addToScene:function(e,t,i){var n,r,s,a=this.game,o=e.scene,l=e.settings.map,h=e.settings.isBooted;for(n=0;n<t.length;n++)a[r=t[n]]?(e[r]=a[r],l.hasOwnProperty(r)&&(o[l[r]]=e[r])):"game"===r&&l.hasOwnProperty(r)&&(o[l[r]]=a);for(var c=0;c<i.length;c++)for(s=i[c],n=0;n<s.length;n++)if(r=s[n],u.hasCore(r)){var d=u.getCore(r),f=d.mapping,p=new d.plugin(o,this,f);e[f]=p,d.custom?o[f]=p:l.hasOwnProperty(f)&&(o[l[f]]=p),h&&p.boot()}for(s=this.plugins,n=0;n<s.length;n++){var m=s[n];m.mapping&&(o[m.mapping]=m.plugin)}},getDefaultScenePlugins:function(){var e=this.game.config.defaultPlugins;return e=e.concat(this.scenePlugins)},installScenePlugin:function(e,t,i,n,r){if(void 0===r&&(r=!1),"function"===typeof t){if(u.hasCore(e)||u.register(e,t,i,!0),-1===this.scenePlugins.indexOf(e))this.scenePlugins.push(e);else if(!r&&u.hasCore(e))return void console.warn("Scene Plugin key in use: "+e);if(n){var s=new t(n,this,e);n.sys[e]=s,i&&""!==i&&(n[i]=s),s.boot()}}else console.warn("Invalid Scene Plugin: "+e)},install:function(e,t,i,n,r){if(void 0===i&&(i=!1),void 0===n&&(n=null),void 0===r&&(r=null),"function"!==typeof t)return console.warn("Invalid Plugin: "+e),null;if(u.hasCustom(e))return console.warn("Plugin key in use: "+e),null;if(null!==n&&(i=!0),this.game.isBooted){if(u.registerCustom(e,t,n,r),i)return this.start(e)}else this._pendingGlobal.push({key:e,plugin:t,start:i,mapping:n,data:r});return null},getIndex:function(e){for(var t=this.plugins,i=0;i<t.length;i++){if(t[i].key===e)return i}return-1},getEntry:function(e){var t=this.getIndex(e);if(-1!==t)return this.plugins[t]},isActive:function(e){var t=this.getEntry(e);return t&&t.active},start:function(e,t){void 0===t&&(t=e);var i=this.getEntry(t);return i&&!i.active?(i.active=!0,i.plugin.start()):i||(i=this.createEntry(e,t)),i?i.plugin:null},createEntry:function(e,t){var i=u.getCustom(e);if(i){var n=new i.plugin(this);i={key:t,plugin:n,active:!0,mapping:i.mapping,data:i.data},this.plugins.push(i),n.init(i.data),n.start()}return i},stop:function(e){var t=this.getEntry(e);return t&&t.active&&(t.active=!1,t.plugin.stop()),this},get:function(e,t){void 0===t&&(t=!0);var i=this.getEntry(e);if(i)return i.plugin;var n=this.getClass(e);return n&&t?(i=this.createEntry(e,e))?i.plugin:null:n||null},getClass:function(e){return u.getCustomClass(e)},removeGlobalPlugin:function(e){var t=this.getEntry(e);t&&c(this.plugins,t),u.removeCustom(e)},removeScenePlugin:function(e){c(this.scenePlugins,e),u.remove(e)},registerGameObject:function(e,t,i){return t&&l.register(e,t),i&&o.register(e,i),this},removeGameObject:function(e,t,i){return void 0===t&&(t=!0),void 0===i&&(i=!0),t&&l.remove(e),i&&o.remove(e),this},registerFileType:function(e,t,i){a.register(e,t),i&&i.sys.load&&(i.sys.load[e]=t)},destroy:function(){for(var e=0;e<this.plugins.length;e++)this.plugins[e].plugin.destroy();
vendor: 92,289 bytes, line 2
2u.destroyCustomPlugins(),this.game.noReturn&&u.destroyCorePlugins(),this.game=null,this.plugins=[],this.scenePlugins=[]}});e.exports=f},45145(e,t,i){var n=i(52018),r=i(83419),s=i(44594),a=new r({Extends:n,initialize:function(e,t,i){n.call(this,t),this.scene=e,this.systems=e.sys,this.pluginKey=i,e.sys.events.once(s.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});e.exports=a},18922(e,t,i){e.exports={BasePlugin:i(52018),DefaultPlugins:i(42363),PluginCache:i(37277),PluginManager:i(77332),ScenePlugin:i(45145)}},63595(){"undefined"!==typeof HTMLVideoElement&&!("requestVideoFrameCallback"in HTMLVideoElement.prototype)&&"getVideoPlaybackQuality"in HTMLVideoElement.prototype&&(HTMLVideoElement.prototype._rvfcpolyfillmap={},HTMLVideoElement.prototype.requestVideoFrameCallback=function(e){const t=performance.now(),i=this.getVideoPlaybackQuality(),n=this.mozPresentedFrames||this.mozPaintedFrames||i.totalVideoFrames-i.droppedVideoFrames,r=(s,a)=>{const o=this.getVideoPlaybackQuality(),l=this.mozPresentedFrames||this.mozPaintedFrames||o.totalVideoFrames-o.droppedVideoFrames;if(l>n){const n=this.mozFrameDelay||o.totalFrameDelay-i.totalFrameDelay||0,r=a-s;e(a,{presentationTime:a+1e3*n,expectedDisplayTime:a+r,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+r/1e3,presentedFrames:l,processingDuration:n}),delete this._rvfcpolyfillmap[t]}else this._rvfcpolyfillmap[t]=requestAnimationFrame(e=>r(a,e))};return this._rvfcpolyfillmap[t]=requestAnimationFrame(e=>r(t,e)),t},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(e){cancelAnimationFrame(this._rvfcpolyfillmap[e]),delete this._rvfcpolyfillmap[e]})},10312(e){e.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(e){e.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},84322(e){e.exports={MULTIPLY:0,FILL:1,ADD:2,SCREEN:4,OVERLAY:5,HARD_LIGHT:6,MULTIPLY_TWO:7}},68627(e,t,i){var n=i(19715),r=i(32880),s=i(83419),a=i(8054),o=i(50792),l=i(92503),h=i(56373),u=i(97480),c=i(69442),d=i(8443),f=i(61340),p=new s({Extends:o,initialize:function(e){o.call(this);var t=e.config;this.config={clearBeforeRender:t.clearBeforeRender,backgroundColor:t.backgroundColor,antialias:t.antialias,roundPixels:t.roundPixels,transparent:t.transparent},this.game=e,this.type=a.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=e.canvas;var i={alpha:t.transparent,desynchronized:t.desynchronized,willReadFrequently:!1};this.gameContext=t.context?t.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=t.antialias,this.blendModes=h(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this.isBooted=!1,this.init()},init:function(){var e=this.game;e.events.once(d.BOOT,function(){var e=this.config;if(!e.transparent){var t=this.gameContext,i=this.gameCanvas;t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i.width,i.height)}},this),e.textures.once(c.READY,this.boot,this)},boot:function(){var e=this.game,t=e.scale.baseSize;this.width=t.width,this.height=t.height,this.isBooted=!0,e.scale.on(u.RESIZE,this.onResize,this),this.resize(t.width,t.height)},onResize:function(e,t){t.width===this.width&&t.height===this.height||this.resize(t.width,t.height)},resize:function(e,t){this.width=e,this.height=t,this.emit(l.RESIZE,e,t)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(e){return this.currentContext.globalCompositeOperation=e,this},setContext:function(e){return this.currentContext=e||this.gameContext,this},setAlpha:function(e){return this.currentContext.globalAlpha=e,this},preRender:function(){var e=this.gameContext,t=this.config,i=this.width,n=this.height;e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),this.emit(l.PRE_RENDER_CLEAR),t.clearBeforeRender&&(e.clearRect(0,0,i,n),t.transparent||(e.fillStyle=t.backgroundColor.rgba,e.fillRect(0,0,i,n))),e.save(),this.drawCount=0,this.emit(l.PRE_RENDER)},render:function(e,t,i){var r=t.length;this.emit(l.RENDER,e,i);var s=i.x,a=i.y,o=i.width,h=i.height,u=i.renderToTexture?i.context:e.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(s,a,o,h),u.clip()),i.emit(n.PRE_RENDER,i),this.currentContext=u;var c=i.mask;c&&c.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(s,a,o,h)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=r,i.renderToTexture&&i.emit(n.PRE_RENDER,i),i.matrix.copyToContext(u);for(var d=0;d<r;d++){var f=t[d];f.mask&&f.mask.preRenderCanvas(this,f,i),f.renderCanvas(this,f,i),f.mask&&f.mask.postRenderCanvas(this,f,i)}u.setTransform(1,0,0,1,0,0),u.globalCompositeOperation="source-over",u.globalAlpha=1,i.flashEffect.postRenderCanvas(u),i.fadeEffect.postRenderCanvas(u),i.dirty=!1,c&&c.postRenderCanvas(this),u.restore(),i.renderToTexture&&(i.emit(n.POST_RENDER,i),i.renderToGame&&e.sys.context.drawImage(i.canvas,s,a)),i.emit(n.POST_RENDER,i)},postRender:function(){this.gameContext.restore(),this.emit(l.POST_RENDER);var e=this.snapshotState;e.callback&&(r(this.gameCanvas,e),e.callback=null)},snapshotCanvas:function(e,t,i,n,s,a,o,l,h){void 0===i&&(i=!1),this.snapshotArea(n,s,a,o,t,l,h);var u=this.snapshotState;return u.getPixel=i,r(e,u),u.callback=null,this},snapshot:function(e,t,i){return this.snapshotArea(0,0,this.gameCanvas.width,this.gameCanvas.height,e,t,i)},snapshotArea:function(e,t,i,n,r,s,a){var o=this.snapshotState;return o.callback=r,o.type=s,o.encoder=a,o.getPixel=!1,o.x=e,o.y=t,o.width=Math.min(i,this.gameCanvas.width),o.height=Math.min(n,this.gameCanvas.height),this},snapshotPixel:function(e,t,i){return this.snapshotArea(e,t,1,1,i),this.snapshotState.getPixel=!0,this},batchSprite:function(e,t,i,n){var r=i.alpha*e.alpha;if(0!==r){var s=this.currentContext,a=this._tempMatrix1,o=this._tempMatrix2,l=t.canvasData,h=l.x,u=l.y,c=t.cutWidth,d=t.cutHeight,f=t.customPivot,p=t.source.resolution,m=e.displayOriginX,g=e.displayOriginY,v=-m+t.x,y=-g+t.y;if(e.isCropped){var x=e._crop;x.flipX===e.flipX&&x.flipY===e.flipY||t.updateCropUVs(x,e.flipX,e.flipY),c=x.cw,d=x.ch,h=x.cx,u=x.cy,v=-m+x.x,y=-g+x.y,e.flipX&&(v>=0?v=-(v+c):v<0&&(v=Math.abs(v)-c)),e.flipY&&(y>=0?y=-(y+d):y<0&&(y=Math.abs(y)-d))}var b=1,w=1;e.flipX&&(f||(v+=-t.realWidth+2*m),b=-1),e.flipY&&(f||(y+=-t.realHeight+2*g),w=-1);var T=e.x,_=e.y;if(i.roundPixels&&(T=Math.floor(T),_=Math.floor(_)),o.applyITRS(T,_,e.rotation,e.scaleX*b,e.scaleY*w),a.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,e.scrollFactorX,e.scrollFactorY),n&&a.multiply(n),a.multiply(o),i.renderRoundPixels&&(a.e=Math.floor(a.e+.5),a.f=Math.floor(a.f+.5)),s.save(),a.setToContext(s),s.globalCompositeOperation=this.blendModes[e.blendMode],s.globalAlpha=r,s.imageSmoothingEnabled=!t.source.scaleMode,e.mask&&e.mask.preRenderCanvas(this,e,i),c>0&&d>0){var S=c/p,E=d/p;i.roundPixels&&(v=Math.floor(v+.5),y=Math.floor(y+.5),S+=.5,E+=.5),s.drawImage(t.source.image,h,u,c,d,v,y,S,E)}e.mask&&e.mask.postRenderCanvas(this,e,i),s.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});e.exports=p},55830(e,t,i){e.exports={CanvasRenderer:i(68627),GetBlendModes:i(56373),SetTransform:i(20926)}},56373(e,t,i){var n=i(10312),r=i(89289);e.exports=function(){var e=[],t=r.supportNewBlendModes,i="source-over";return e[n.NORMAL]=i,e[n.ADD]="lighter",e[n.MULTIPLY]=t?"multiply":i,e[n.SCREEN]=t?"screen":i,e[n.OVERLAY]=t?"overlay":i,e[n.DARKEN]=t?"darken":i,e[n.LIGHTEN]=t?"lighten":i,e[n.COLOR_DODGE]=t?"color-dodge":i,e[n.COLOR_BURN]=t?"color-burn":i,e[n.HARD_LIGHT]=t?"hard-light":i,e[n.SOFT_LIGHT]=t?"soft-light":i,e[n.DIFFERENCE]=t?"difference":i,e[n.EXCLUSION]=t?"exclusion":i,e[n.HUE]=t?"hue":i,e[n.SATURATION]=t?"saturation":i,e[n.COLOR]=t?"color":i,e[n.LUMINOSITY]=t?"luminosity":i,e[n.ERASE]="destination-out",e[n.SOURCE_IN]="source-in",e[n.SOURCE_OUT]="source-out",e[n.SOURCE_ATOP]="source-atop",e[n.DESTINATION_OVER]="destination-over",e[n.DESTINATION_IN]="destination-in",e[n.DESTINATION_OUT]="destination-out",e[n.DESTINATION_ATOP]="destination-atop",e[n.LIGHTER]="lighter",e[n.COPY]="copy",e[n.XOR]="xor",e}},20926(e,t,i){var n=i(91296);e.exports=function(e,t,i,r,s){var a=r.alpha*i.alpha;if(a<=0)return!1;var o=n(i,r,s).calc;return t.globalCompositeOperation=e.blendModes[i.blendMode],t.globalAlpha=a,t.save(),o.setToContext(t),t.imageSmoothingEnabled=i.frame?!i.frame.source.scaleMode:e.antialias,!0}},63899(e){e.exports="losewebgl"},6119(e){e.exports="postrender"},31124(e){e.exports="prerenderclear"},48070(e){e.exports="prerender"},15640(e){e.exports="render"},8912(e){e.exports="resize"},87124(e){e.exports="restorewebgl"},53998(e){e.exports="setparalleltextureunits"},92503(e,t,i){e.exports={LOSE_WEBGL:i(63899),POST_RENDER:i(6119),PRE_RENDER:i(48070),PRE_RENDER_CLEAR:i(31124),RENDER:i(15640),RESIZE:i(8912),RESTORE_WEBGL:i(87124),SET_PARALLEL_TEXTURE_UNITS:i(53998)}},36909(e,t,i){e.exports={Events:i(92503),Snapshot:i(89966)},e.exports.Canvas=i(55830),e.exports.WebGL=i(4159)},32880(e,t,i){var n=i(27919),r=i(40987),s=i(95540);e.exports=function(e,t){var i=s(t,"callback"),a=s(t,"type","image/png"),o=s(t,"encoder",.92),l=Math.abs(Math.round(s(t,"x",0))),h=Math.abs(Math.round(s(t,"y",0))),u=Math.floor(s(t,"width",e.width)),c=Math.floor(s(t,"height",e.height));if(s(t,"getPixel",!1)){var d=e.getContext("2d",{willReadFrequently:!1}).getImageData(l,h,1,1).data;i.call(null,new r(d[0],d[1],d[2],d[3]))}else if(0!==l||0!==h||u!==e.width||c!==e.height){var f=n.createWebGL(this,u,c),p=f.getContext("2d",{willReadFrequently:!0});u>0&&c>0&&p.drawImage(e,l,h,u,c,0,0,u,c);var m=new Image;m.onerror=function(){i.call(null),n.remove(f)},m.onload=function(){i.call(null,m),n.remove(f)},m.src=f.toDataURL(a,o)}else{var g=new Image;g.onerror=function(){i.call(null)},g.onload=function(){i.call(null,g)},g.src=e.toDataURL(a,o)}}},88815(e,t,i){var n=i(27919),r=i(40987),s=i(95540);e.exports=function(e,t){var i=e,a=s(t,"callback"),o=s(t,"type","image/png"),l=s(t,"encoder",.92),h=Math.abs(Math.round(s(t,"x",0))),u=Math.abs(Math.round(s(t,"y",0))),c=s(t,"getPixel",!1),d=s(t,"isFramebuffer",!1),f=d?s(t,"bufferWidth",1):i.drawingBufferWidth,p=d?s(t,"bufferHeight",1):i.drawingBufferHeight;if(c){var m=new Uint8Array(4),g=p-u-1;i.readPixels(h,g,1,1,i.RGBA,i.UNSIGNED_BYTE,m),a.call(null,new r(m[0],m[1],m[2],m[3]))}else{var v=Math.floor(s(t,"width",f)),y=Math.floor(s(t,"height",p)),x=new Uint8Array(v*y*4);i.readPixels(h,p-u-y,v,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var b=n.createWebGL(this,v,y),w=b.getContext("2d",{willReadFrequently:!0}),T=w.getImageData(0,0,v,y),_=T.data,S=0;S<y;S++)for(var E=0;E<v;E++){var C=4*((y-S-1)*v+E),A=4*(S*v+E),k=x[C+0],R=x[C+1],O=x[C+2],P=x[C+3];if(t.unpremultiplyAlpha&&0!==P){var M=255/P;k=Math.floor(k*M),R=Math.floor(R*M),O=Math.floor(O*M)}_[A+0]=k,_[A+1]=R,_[A+2]=O,_[A+3]=P}w.putImageData(T,0,0);var N=new Image;N.onerror=function(){a.call(null),n.remove(b)},N.onload=function(){a.call(null,N),n.remove(b)},N.src=b.toDataURL(o,l)}}},89966(e,t,i){e.exports={Canvas:i(32880),WebGL:i(88815)}},87774(e,t,i){var n=i(50030),r=i(83419),s=i(71623),a=new r({initialize:function(e,t){void 0===t&&(t={}),this.renderer=e,this.camera=null,this.setCamera(t.camera||null),this.state={bindings:{framebuffer:null},blend:{},colorClearValue:t.clearColor||[0,0,0,0],colorWritemask:t.colorWritemask||[!0,!0,!0,!0],scissor:{box:[0,0,0,0],enable:!0},stencil:t.stencilParameters||s.create(e),viewport:[0,0,0,0]},this.blendMode=-1,this.setBlendMode(t.blendMode||0),this.alphaStrategy=t.alphaStrategy||e.config.alphaStrategy,this.autoClear=0,void 0===t.autoClear||!0===t.autoClear?this.setAutoClear(!0,!0,!0):Array.isArray(t.autoClear)&&this.setAutoClear.apply(this,t.autoClear),this.useCanvas=!!t.useCanvas,this.framebuffer=null,this.texture=null,this.enableMipmap=!!t.enableMipmap,this.pool=t.pool||null,this.lastUsed=0,this.width=0,this.height=0,this._locks=[],t.copyFrom?this.copy(t.copyFrom):this.resize(t.width||e.width,t.height||e.height)},resize:function(e,t){if((e=Math.round(e))<=0&&(e=1),(t=Math.round(t))<=0&&(t=1),this.useCanvas)this.framebuffer||(this.framebuffer=this.renderer.createFramebuffer(null));else if(this.framebuffer)this.framebuffer.resize(e,t);else{var i=this.renderer,r=i.gl,s=n(e,t),a=r.NEAREST;i.config.antialias&&(a=r.LINEAR);var o=a;s&&this.enableMipmap&&i.config.mipmapRegeneration&&i.mipmapFilter&&(o=i.mipmapFilter);var l=r.CLAMP_TO_EDGE;s&&(l=r.REPEAT),this.texture=i.createTexture2D(0,o,a,l,l,r.RGBA,null,e,t),this.framebuffer=i.createFramebuffer(this.texture,i.config.stencil,!1)}this.state.bindings.framebuffer=this.framebuffer,this.width=e,this.height=t,this.state.scissor.box=[0,0,e,t],this.state.viewport=[0,0,e,t]},copy:function(e){var t=e.state,i=t.blend,n=t.scissor,r=t.stencil;this.autoClear=e.autoClear,this.useCanvas=e.useCanvas,this.framebuffer=e.framebuffer,this.texture=e.texture,this.camera=e.camera,this.blendMode=e.blendMode,this.alphaStrategy=e.alphaStrategy,this.width=e.width,this.height=e.height,this.state={bindings:{framebuffer:t.bindings.framebuffer},blend:{color:i.color&&i.color.slice(),enable:i.enable,equation:i.equation,func:i.func},colorClearValue:t.colorClearValue.slice(),colorWritemask:t.colorWritemask.slice(),scissor:{box:n.box.slice(),enable:n.enable},stencil:{enabled:r.enabled,func:{func:r.func.func,ref:r.func.ref,mask:r.func.mask},op:{fail:r.op.fail,zfail:r.op.zfail,zpass:r.op.zpass},clear:r.clear,writeMask:r.writeMask},viewport:t.viewport.slice()}},getClone:function(e){var t=new a(this.renderer,{copyFrom:this});return e||t.setAutoClear(!1,!1,!1),t},setAlphaStrategy:function(e){this.alphaStrategy=e},setAutoClear:function(e,t,i){var n=0,r=this.renderer.gl;e&&(n|=r.COLOR_BUFFER_BIT),t&&(n|=r.DEPTH_BUFFER_BIT),i&&(n|=r.STENCIL_BUFFER_BIT),this.autoClear=n},setBlendMode:function(e,t){if(e!==this.blendMode){var i=this.state.blend,n=this.renderer.blendModes[e];i.enable=n.enable,i.equation=n.equation,i.func=n.func,i.color=t||void 0,this.blendMode=e}},setCamera:function(e){this.camera=e},setClearColor:function(e,t,i,n){var r=this.state.colorClearValue;e===r[0]&&t===r[1]&&i===r[2]&&n===r[3]||(this.state.colorClearValue=[e,t,i,n])},setColorWritemask:function(e,t,i,n){this.state.colorWritemask=[e,t,i,n]},setScissorBox:function(e,t,i,n){t=this.height-t-n,this.state.scissor.box=[e,t,i,n]},setScissorEnable:function(e){this.state.scissor.enable=e},setStencil:function(e,t,i,n,r,s,a,o,l){void 0===e&&(e=!0),void 0===t&&(t=this.renderer.gl.EQUAL),void 0===i&&(i=0),void 0===n&&(n=255),void 0===r&&(r=this.renderer.gl.KEEP),void 0===s&&(s=this.renderer.gl.KEEP),void 0===a&&(a=this.renderer.gl.KEEP),void 0===o&&(o=0),void 0===l&&(l=0),this.state.stencil={enabled:e,func:{func:t,ref:i,mask:n},op:{fail:r,zfail:s,zpass:a},clear:o,writeMask:l}},use:function(){this.renderer.renderNodes.finishBatch(),this.autoClear&&this.clear()},release:function(){this.pool&&0===this._locks.length&&(this.lastUsed=Date.now(),this.pool.add(this)),this.renderer.renderNodes.finishBatch()},lock:function(e){-1===this._locks.indexOf(e)&&this._locks.push(e)},unlock:function(e,t){var i=this._locks.indexOf(e);-1!==i&&this._locks.splice(i,1),t&&this.release()},isLocked:function(){return this._locks.length>0},beginDraw:function(){this.texture&&this.renderer.glTextureUnits.unbindTexture(this.texture),this.renderer.glWrapper.update(this.state)},clear:function(e){this.beginDraw(),void 0===e&&(e=this.autoClear),this.renderer.renderNodes.finishBatch(),this.renderer.gl.clear(e)},destroy:function(){this.renderer.deleteTexture(this.texture),this.renderer.deleteFramebuffer(this.state.bindings.framebuffer),this.renderer=null,this.camera=null,this.state=null,this.framebuffer=null,this.texture=null}});e.exports=a},65656(e,t,i){var n=i(83419),r=i(87774),s=new n({initialize:function(e,t,i){this.renderer=e,this.maxAge=t,this.maxPoolSize=i,this.agePool=[],this.sizePool={}},add:function(e){if(-1===this.agePool.indexOf(e)){var t=e.width+"x"+e.height;this.sizePool[t]?this.sizePool[t].push(e):this.sizePool[t]=[e],this.agePool.push(e)}},get:function(e,t){var i,n,s=this.renderer;void 0===e&&(e=s.width),void 0===t&&(t=s.height);var a=s.getMaxTextureSize();e>a&&(e=a),t>a&&(t=a);var o=e+"x"+t,l=this.sizePool[o];if(l&&l.length>0)return i=l.pop(),n=this.agePool.indexOf(i),this.agePool.splice(n,1),i;if(this.agePool.length>0){var h=Date.now(),u=this.maxAge;if(h-(i=this.agePool[0]).lastUsed>u){this.agePool.shift();var c=i.width+"x"+i.height;return n=(l=this.sizePool[c]).indexOf(i),l.splice(n,1),i.resize(e,t),i}}return this.agePool.length<this.maxPoolSize?i=new r(s,{autoClear:!0,pool:this,width:e,height:t}):(i=this.agePool.shift())?(n=(l=this.sizePool[o]).indexOf(i),l.splice(n,1),i.resize(e,t),i):i=new r(s,{autoClear:!0,pool:this,width:e,height:t})},setMaxAge:function(e){this.maxAge=e},setMaxPoolSize:function(e){this.maxPoolSize=e},clear:function(){for(var e=0;e<this.agePool.length;e++)this.agePool[e].destroy();this.sizePool={},this.agePool.length=0},prune:function(){var e=this.sizePool,t=this.agePool,i=t.length-this.maxPoolSize;if(i>0)for(var n=t.splice(0,i),r=0;r<i;r++){var s=n[r],a=e[s.width+"x"+s.height],o=a.indexOf(s);a.splice(o,1),s.destroy()}}});e.exports=s},56436(e,t,i){var n=i(83419),r=i(62644),s=new n({initialize:function(e,t,i){this.renderer=e,this.indexBuffer=i,this.attributeBufferLayouts=t,this.currentProgramKey=null,this.currentConfig={base:{vertexShader:"",fragmentShader:""},additions:[],features:[]},this.programs={},this.uniforms={}},getCurrentProgramSuite:function(){var e=this.currentConfig,t=this.renderer,i=t.shaderProgramFactory,n=i.getKey(e.base,e.additions,e.features);if(!this.programs[n]){var s=i.getShaderProgram(e.base,e.additions,e.features);s.compiling&&s.checkParallelCompile(),s.compiling||(this.programs[n]={program:s,vao:t.createVAO(s,this.indexBuffer,this.attributeBufferLayouts),config:r(e)})}return this.programs[n]||null},resetCurrentConfig:function(){this.currentConfig.base.vertexShader="",this.currentConfig.base.fragmentShader="",this.currentConfig.additions.length=0,this.currentConfig.features.length=0},setUniform:function(e,t){this.uniforms[e]=t},removeUniform:function(e){delete this.uniforms[e]},clearUniforms:function(){this.uniforms={}},applyUniforms:function(e){var t=this.uniforms;for(var i in t)e.setUniform(i,t[i])},setBaseShader:function(e,t,i){var n=this.currentConfig.base;n.name=e,n.vertexShader=t,n.fragmentShader=i},addAddition:function(e,t){void 0===t?this.currentConfig.additions.push(e):this.currentConfig.additions.splice(t,0,e)},getAddition:function(e){for(var t=this.currentConfig.additions,i=0;i<t.length;i++){var n=t[i];if(n.name===e)return n}return null},getAdditionsByTag:function(e){return this.currentConfig.additions.filter(function(t){return!!t.tags&&t.tags.includes(e)})},getAdditionIndex:function(e){return this.currentConfig.additions.findIndex(function(t){return t.name===e})},removeAddition:function(e){this.currentConfig.additions=this.currentConfig.additions.filter(function(t){return t.name!==e})},replaceAddition:function(e,t){var i=this.currentConfig.additions.findIndex(function(t){return t.name===e});-1!==i&&(this.currentConfig.additions[i]=t)},addFeature:function(e){-1===this.currentConfig.features.indexOf(e)&&this.currentConfig.features.push(e)},removeFeature:function(e){this.currentConfig.features=this.currentConfig.features.filter(function(t){return t!==e})},clearFeatures:function(){this.currentConfig.features.length=0}});e.exports=s},18804(e,t,i){var n=new(i(83419))({initialize:function(e){this.renderer=e,this.programs={}},has:function(e){return void 0!==this.programs[e]},getShaderProgram:function(e,t,i){var n=this.getKey(e,t,i),r=this.programs[n];return r||(r=this.createShaderProgram(n,e,t,i)),r},getKey:function(e,t,i){var n=e.name;if(t&&t.length>0){n+="_";for(var r=0;r<t.length;r++){var s=t[r];s.disable||(n+="_"+s.name)}}return i&&i.length>0&&(n+="__",n+=i.sort().join("_")),n},createShaderProgram:function(e,t,i,n){var r=t.vertexShader,s=t.fragmentShader;if(r=r.replace(/\r/g,""),s=s.replace(/\r/g,""),i){for(var a,o,l={},h=0;h<i.length;h++){var u=i[h];if(!u.disable)for(a in u.additions)o=(o=u.additions[a]).replace(/\r/g,""),l[a]||(l[a]=""),l[a]+=o+"\n"}for(a in l){var c="#pragma phaserTemplate("+a+")\n";o=l[a],r=r.replace(c,o),s=s.replace(c,o)}}if(n){var d="",f=/[^a-zA-Z0-9]/g;for(h=0;h<n.length;h++){d+="#define FEATURE_"+n[h].toUpperCase().replace(f,"_")+"\n"}r=r.replace("#pragma phaserTemplate(features)",d),s=s.replace("#pragma phaserTemplate(features)",d)}r=r.replace("#pragma phaserTemplate(shaderName)","#define SHADER_NAME "+e+"__VERTEX"),s=s.replace("#pragma phaserTemplate(shaderName)","#define SHADER_NAME "+e+"__FRAGMENT");var p=/\s*#pragma phaserTemplate\(.*/g;r=r.replace(p,""),s=s.replace(p,"");var m=this.renderer.createProgram(r,s);return this.programs[e]=m,m}});e.exports=n},70554(e,t,i){var n=i(61340);e.exports={getTintFromFloats:function(e,t,i,n){return((255*n&255)<<24|(255*e&255)<<16|(255*t&255)<<8|255*i&255)>>>0},getTintAppendFloatAlpha:function(e,t){return((255*t&255)<<24|e)>>>0},getTintAppendFloatAlphaAndSwap:function(e,t){return((255*t&255)<<24|(255&e)<<16|(e>>8&255)<<8|e>>16&255)>>>0},getFloatsFromUintRGB:function(e){return[(e>>16&255)/255,(e>>8&255)/255,(255&e)/255]},checkShaderMax:function(e,t){var i=Math.min(16,e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS));return t&&-1!==t?Math.min(i,t):i},updateLightingUniforms:function(e,t,i,r,s,a,o,l){var h=t.camera,u=h.scene.sys.lights;if(u&&u.active){var c=u.getLights(h),d=c.length,f=u.ambientColor,p=t.height;if(e){i.setUniform("uNormSampler",r),i.setUniform("uCamera",[h.x,h.y,h.rotation,h.zoom]),i.setUniform("uAmbientLightColor",[f.r,f.g,f.b]),i.setUniform("uLightCount",d);for(var m=new n,g=0;g<d;g++){var v=c[g].light,y=v.color,x="uLights["+g+"].";m.copyWithScrollFactorFrom(h.matrixCombined,h.scrollX,h.scrollY,v.scrollFactorX,v.scrollFactorY),m.transformPoint(v.x,v.y,s);var b=s.x,w=p-s.y;if(i.setUniform(x+"position",[b,w,v.z*h.zoom]),i.setUniform(x+"color",[y.r,y.g,y.b]),i.setUniform(x+"intensity",v.intensity),i.setUniform(x+"radius",v.radius),v.coneEnabled){m.transformPoint(v.x+Math.cos(v.coneRotation),v.y+Math.sin(v.coneRotation),s);var T=s.x-b,_=p-s.y-w,S=Math.sqrt(T*T+_*_);0===S?(T=1,_=0):(T/=S,_/=S),i.setUniform(x+"direction",[T,_]),i.setUniform(x+"cone",[Math.cos(.5*v.coneOuterAngle),Math.cos(.5*v.coneInnerAngle),1])}else i.setUniform(x+"direction",[1,0]),i.setUniform(x+"cone",[-1,1,0])}a&&(i.setUniform("uDiffuseFlatThreshold",3*l),i.setUniform("uPenumbra",o))}else for(i.removeUniform("uNormSampler"),i.removeUniform("uCamera"),i.removeUniform("uAmbientLightColor"),i.removeUniform("uLightCount"),i.removeUniform("uPenumbra"),i.removeUniform("uDiffuseFlatThreshold"),g=0;g<d;g++)x="uLights["+g+"].",i.removeUniform(x+"position"),i.removeUniform(x+"color"),i.removeUniform(x+"intensity"),i.removeUniform(x+"radius"),i.removeUniform(x+"direction"),i.removeUniform(x+"cone")}}}},74797(e,t,i){var n=i(95428),r=i(72905),s=i(83419),a=i(8054),o=i(50792),l=i(92503),h=i(50030),u=i(37867),c=i(29747),d=i(87774),f=i(97480),p=i(69442),m=i(70554),g=i(88815),v=i(26128),y=i(37959),x=i(1482),b=i(86272),w=i(82751),T=i(13760),_=i(84387),S=i(85788),E=i(47774),C=i(53314),A=i(30130),k=i(65656),R=i(18804),O=!1,P=new s({Extends:o,initialize:function(e){o.call(this);var t=e.config,i={alpha:t.transparent,desynchronized:t.desynchronized,depth:!0,antialias:t.antialiasGL,premultipliedAlpha:t.premultipliedAlpha,stencil:t.stencil,failIfMajorPerformanceCaveat:t.failIfMajorPerformanceCaveat,powerPreference:t.powerPreference,preserveDrawingBuffer:t.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:t.clearBeforeRender,antialias:t.antialias,alphaStrategy:t.alphaStrategy,stencil:t.stencil,stencilAlphaStrategy:t.stencilAlphaStrategy,backgroundColor:t.backgroundColor,contextCreation:i,roundPixels:t.roundPixels,pathDetailThreshold:t.pathDetailThreshold,maxTextures:t.maxTextures,maxTextureSize:t.maxTextureSize,batchSize:t.batchSize,maxLights:t.maxLights,mipmapFilter:t.mipmapFilter,mipmapRegeneration:t.mipmapRegeneration},this.game=e,this.type=a.WEBGL,this.renderNodes=null,this.cameraRenderNode=null,this.shaderProgramFactory=new R(this),this.width=0,this.height=0,this.canvas=e.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,unpremultiplyAlpha:!0},this.maxTextures=0,this.textureUnitIndices=[],this.glBufferWrappers=[],this.glProgramWrappers=[],this.glTextureWrappers=[],this.glFramebufferWrappers=[],this.glVAOWrappers=[],this.genericQuadIndexBuffer=null,this.baseDrawingContext=null,this.currentViewCamera=null,this.drawingContextPool=new k(this,1e3,1024),this.contextLostHandler=c,this.contextRestoredHandler=c,this.previousContextLostHandler=c,this.previousContextRestoredHandler=c,this.gl=null,this.glWrapper=null,this.glTextureUnits=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.parallelShaderCompileExtension=null,this.standardDerivativesExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats,this.compression,this.drawingBufferHeight=0,this.blankTexture=null,this.normalTexture=null,this.whiteTexture=null,this.shaderSetters=null,this.mipmapFilter=null,this.isBooted=!1,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.projectionFlipY=!1,this.spector=null,this._debugCapture=!1,this.init(this.config)},init:function(e){var t,i=this.game,n=this.canvas,r=e.backgroundColor;if(!(t=i.config.context?i.config.context:n.getContext("webgl",e.contextCreation)||n.getContext("experimental-webgl",e.contextCreation))||t.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=t,this.setExtensions(),this.setContextHandlers(),i.context=t;for(var s=0;s<=27;s++)this.blendModes.push(E.createCombined(this));this.blendModes[1].func=[t.ONE,t.DST_ALPHA,t.ONE,t.DST_ALPHA],this.blendModes[2].func=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_COLOR],this.blendModes[17].equation=[t.FUNC_REVERSE_SUBTRACT,t.FUNC_REVERSE_SUBTRACT],this.blendModes[17].func=[t.ZERO,t.ONE_MINUS_SRC_ALPHA,t.ZERO,t.ONE_MINUS_SRC_ALPHA],this.glFormats=[t.BYTE,t.SHORT,t.UNSIGNED_BYTE,t.UNSIGNED_SHORT,t.FLOAT],this.shaderSetters=new b(this),e.maxTextures&&-1!==e.maxTextures||(e.maxTextures=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)),e.maxTextureSize||(e.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),this.glWrapper=new y(this),this.glWrapper.update(void 0,!0),t.clearColor(r.redGL,r.greenGL,r.blueGL,r.alphaGL),t.clear(t.COLOR_BUFFER_BIT);for(-1!==["NEAREST","LINEAR","NEAREST_MIPMAP_NEAREST","LINEAR_MIPMAP_NEAREST","NEAREST_MIPMAP_LINEAR","LINEAR_MIPMAP_LINEAR"].indexOf(e.mipmapFilter)&&(this.mipmapFilter=t[e.mipmapFilter]),this.maxTextures=m.checkShaderMax(t,e.maxTextures),s=0;s<this.maxTextures;s++)this.textureUnitIndices.push(s);return this.glTextureUnits=new T(this),this.projectionMatrix=(new u).identity(),i.textures.once(p.READY,this.boot,this),this},boot:function(){var e=this.game,t=this.gl,i=e.scale.baseSize,n=i.width,r=i.height;this.width=n,this.height=r,this.isBooted=!0,this.glWrapper.updateVAO({vao:null}),this.genericQuadIndexBuffer=this.createIndexBuffer(new Uint16Array([0,1,2,3]),t.STATIC_DRAW),this.renderNodes=new A(this),this.cameraRenderNode=this.renderNodes.getNode("Camera"),this.blankTexture=e.textures.getFrame("__DEFAULT").glTexture,this.normalTexture=e.textures.getFrame("__NORMAL").glTexture,this.whiteTexture=e.textures.getFrame("__WHITE").glTexture,this.baseDrawingContext=new d(this,{autoClear:!0,useCanvas:!0,clearColor:[this.config.backgroundColor.redGL,this.config.backgroundColor.greenGL,this.config.backgroundColor.blueGL,this.config.backgroundColor.alphaGL]}),this.on(l.RESIZE,this.baseDrawingContext.resize,this.baseDrawingContext),e.scale.on(f.RESIZE,this.onResize,this),this.resize(n,r)},setExtensions:function(){var e=this.gl,t=this.game,i=e.getSupportedExtensions();this.supportedExtensions=i;var n="ANGLE_instanced_arrays";if(this.instancedArraysExtension=i.indexOf(n)>-1?e.getExtension(n):null,t.config.skipUnreadyShaders){var r="KHR_parallel_shader_compile";this.parallelShaderCompileExtension=i.indexOf(r)>-1?e.getExtension(r):null,this.parallelShaderCompileExtension||(t.config.skipUnreadyShaders=!1)}var s="OES_vertex_array_object";this.vaoExtension=i.indexOf(s)>-1?e.getExtension(s):null;var a="OES_standard_derivatives";if(this.standardDerivativesExtension=i.indexOf(a)>-1?e.getExtension(a):null,e instanceof WebGLRenderingContext){if(!this.instancedArraysExtension)throw new Error("ANGLE_instanced_arrays extension not supported. Required for rendering.");if(e.vertexAttribDivisor=this.instancedArraysExtension.vertexAttribDivisorANGLE.bind(this.instancedArraysExtension),e.drawArraysInstanced=this.instancedArraysExtension.drawArraysInstancedANGLE.bind(this.instancedArraysExtension),e.drawElementsInstanced=this.instancedArraysExtension.drawElementsInstancedANGLE.bind(this.instancedArraysExtension),!this.vaoExtension)throw new Error("OES_vertex_array_object extension not supported. Required for rendering.");if(e.createVertexArray=this.vaoExtension.createVertexArrayOES.bind(this.vaoExtension),e.bindVertexArray=this.vaoExtension.bindVertexArrayOES.bind(this.vaoExtension),e.deleteVertexArray=this.vaoExtension.deleteVertexArrayOES.bind(this.vaoExtension),e.isVertexArray=this.vaoExtension.isVertexArrayOES.bind(this.vaoExtension),this.standardDerivativesExtension)e.FRAGMENT_SHADER_DERIVATIVE_HINT=this.standardDerivativesExtension.FRAGMENT_SHADER_DERIVATIVE_HINT_OES;else if(t.config.smoothPixelArt)throw new Error("OES_standard_derivatives extension not supported. Cannot use smoothPixelArt.")}},setContextHandlers:function(e,t){this.previousContextLostHandler&&this.canvas.removeEventListener("webglcontextlost",this.previousContextLostHandler,!1),this.previousContextRestoredHandler&&this.canvas.removeEventListener("webglcontextrestored",this.previousContextRestoredHandler,!1),this.contextLostHandler="function"===typeof e?e.bind(this):this.dispatchContextLost.bind(this),this.contextRestoredHandler="function"===typeof t?t.bind(this):this.dispatchContextRestored.bind(this),this.canvas.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),this.previousContextLostHandler=this.contextLostHandler,this.previousContextRestoredHandler=this.contextRestoredHandler},dispatchContextLost:function(e){this.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),this.emit(l.LOSE_WEBGL,this),e.preventDefault()},dispatchContextRestored:function(e){if(this.gl.isContextLost())console&&console.log("WebGL Context restored, but context is still lost");else{this.setExtensions(),this.glWrapper.update(C.getDefault(this),!0),this.glTextureUnits.init(),this.compression=this.getCompressedTextures();var t=function(e){e.createResource()};n(this.glTextureWrappers,t),n(this.glBufferWrappers,t),n(this.glFramebufferWrappers,t),n(this.glProgramWrappers,t),n(this.glVAOWrappers,t),this.glTextureUnits.bindUnits(this.glTextureUnits.units,!0),this.resize(this.game.scale.baseSize.width,this.game.scale.baseSize.height),this.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),this.emit(l.RESTORE_WEBGL,this),e.preventDefault()}},captureFrame:function(e,t){void 0===e&&(e=!1),void 0===t&&(t=!1)},captureNextFrame:function(){O},getFps:function(){O},log:function(){},startCapture:function(e,t,i){void 0===e&&(e=0),void 0===t&&(t=!1),void 0===i&&(i=!1)},stopCapture:function(){O},onCapture:function(e){},onResize:function(e,t){t.width===this.width&&t.height===this.height||this.resize(t.width,t.height)},resize:function(e,t){var i=this.gl;return this.width=e,this.height=t,this.setProjectionMatrix(e,t),this.drawingBufferHeight=i.drawingBufferHeight,this.glWrapper.update({scissor:{box:[0,i.drawingBufferHeight-t,e,t]},viewport:[0,0,e,t]}),this.emit(l.RESIZE,e,t),this},getCompressedTextures:function(){var e="WEBGL_compressed_texture_",t="WEBKIT_"+e,i=function(i,n){var r=i.getExtension(e+n)||i.getExtension(t+n)||i.getExtension("EXT_texture_compression_"+n);if(r){var s={};for(var a in r)s[r[a]]=a;return s}},n=this.gl;return{ETC:i(n,"etc"),ETC1:i(n,"etc1"),ATC:i(n,"atc"),ASTC:i(n,"astc"),BPTC:i(n,"bptc"),RGTC:i(n,"rgtc"),PVRTC:i(n,"pvrtc"),S3TC:i(n,"s3tc"),S3TCSRGB:i(n,"s3tc_srgb"),IMG:!0}},getCompressedTextureName:function(e,t){var i=this.compression[e.toUpperCase()];if(t in i)return i[t]},supportsCompressedTexture:function(e,t){var i=this.compression[e.toUpperCase()];return!!i&&(!t||t in i)},getAspectRatio:function(){return this.width/this.height},setProjectionMatrix:function(e,t,i){return e===this.projectionWidth&&t===this.projectionHeight&&i===this.projectionFlipY||(this.projectionWidth=e,this.projectionHeight=t,this.projectionFlipY=!!i,i?this.projectionMatrix.ortho(0,e,0,t,-1e3,1e3):this.projectionMatrix.ortho(0,e,t,0,-1e3,1e3)),this},setProjectionMatrixFromDrawingContext:function(e){return this.setProjectionMatrix(e.width,e.height,!1)},resetProjectionMatrix:function(){return this.setProjectionMatrix(this.width,this.height)},hasExtension:function(e){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(e)},getExtension:function(e){return this.hasExtension(e)?(e in this.extensions||(this.extensions[e]=this.gl.getExtension(e)),this.extensions[e]):null},addBlendMode:function(e,t){return this.blendModes.push(E.createCombined(this,!0,void 0,t,e[0],e[1]))-1-1},updateBlendMode:function(e,t,i){if(e>17&&this.blendModes[e]){var n=this.blendModes[e];2===t.length?n.func=[t[0],t[1],t[0],t[1]]:n.func=[t[0],t[1],t[2],t[3]],n.equation="number"===typeof i?[i,i]:[i[0],i[1]]}return this},removeBlendMode:function(e){return e>17&&this.blendModes[e]&&this.blendModes.splice(e,1),this},clearFramebuffer:function(e,t,i){var n=this.gl,r=0;e&&(this.glWrapper.updateColorClearValue({colorClearValue:e}),r|=n.COLOR_BUFFER_BIT),void 0!==t&&(this.glWrapper.updateStencilClear({stencil:{clear:t}}),r|=n.STENCIL_BUFFER_BIT),void 0!==i&&(r|=n.DEPTH_BUFFER_BIT),n.clear(r)},createTextureFromSource:function(e,t,i,n,r,s){void 0===r&&(r=!1);var o=this.gl,l=o.NEAREST,u=o.NEAREST,c=o.CLAMP_TO_EDGE;t=e?e.width:t,i=e?e.height:i;var d=h(t,i);if(d&&!r&&(c=o.REPEAT),n===a.ScaleModes.LINEAR&&this.config.antialias){var f=e&&e.compressed,p=!f&&d||f&&e.mipmaps.length>1;l=this.mipmapFilter&&p?this.mipmapFilter:o.LINEAR,u=o.LINEAR}return e||"number"!==typeof t||"number"!==typeof i?this.createTexture2D(0,l,u,c,c,o.RGBA,e,void 0,void 0,void 0,void 0,s):this.createTexture2D(0,l,u,c,c,o.RGBA,null,t,i,void 0,void 0,s)},createTexture2D:function(e,t,i,n,r,s,a,o,l,h,u,c){"number"!==typeof o&&(o=a?a.width:1),"number"!==typeof l&&(l=a?a.height:1);var d=new w(this,e,t,i,n,r,s,a,o,l,h,u,c);return this.glTextureWrappers.push(d),d},createFramebuffer:function(e,t,i){Array.isArray(e)||null===e||(e=[e]);var n=new _(this,e,t,i);return this.glFramebufferWrappers.push(n),n},createProgram:function(e,t){var i=new x(this,e,t);return this.glProgramWrappers.push(i),i},createVertexBuffer:function(e,t){var i=this.gl,n=new v(this,e,i.ARRAY_BUFFER,t);return this.glBufferWrappers.push(n),n},createIndexBuffer:function(e,t){var i=this.gl,n=new v(this,e,i.ELEMENT_ARRAY_BUFFER,t);return this.glBufferWrappers.push(n),n},createVAO:function(e,t,i){var n=new S(this,e,t,i);return this.glVAOWrappers.push(n),n},deleteTexture:function(e){if(e)return r(this.glTextureWrappers,e),e.destroy(),this},deleteFramebuffer:function(e){return e?(r(this.glFramebufferWrappers,e),e.destroy(),this):this},deleteProgram:function(e){return e&&(r(this.glProgramWrappers,e),e.destroy()),this},deleteBuffer:function(e){return e?(r(this.glBufferWrappers,e),e.destroy(),this):this},preRender:function(){if(!this.contextLost){this.emit(l.PRE_RENDER_CLEAR);var e=this.baseDrawingContext;if(this.config.clearBeforeRender){var t=this.config.backgroundColor;e.setClearColor(t.redGL,t.greenGL,t.blueGL,t.alphaGL),e.setAutoClear(!0,!0,!0)}else e.setAutoClear(!1,!1,!1);e.use(),this.emit(l.PRE_RENDER)}},render:function(e,t,i){this.contextLost||(this.emit(l.RENDER,e,i),this.currentViewCamera=i,this.cameraRenderNode.run(this.baseDrawingContext,t,i),this.currentViewCamera=null)},postRender:function(){if(this.baseDrawingContext.release(),!this.contextLost){this.emit(l.POST_RENDER);var e=this.snapshotState;e.callback&&(g(this.gl,e),e.callback=null)}},drawElements:function(e,t,i,n,r,s,a){var o=this.gl;e.beginDraw(),i.bind(),n.bind(),this.glTextureUnits.bindUnits(t),o.drawElements(a||o.TRIANGLE_STRIP,r,o.UNSIGNED_SHORT,s)},drawInstancedArrays:function(e,t,i,n,r,s,a,o){var l=this.gl;e.beginDraw(),i.bind(),n.bind(),this.glTextureUnits.bindUnits(t),l.drawArraysInstanced(o||l.TRIANGLE_STRIP,r,s,a)},snapshot:function(e,t,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,e,t,i)},snapshotArea:function(e,t,i,n,r,s,a){var o=this.snapshotState;return o.callback=r,o.type=s,o.encoder=a,o.getPixel=!1,o.x=e,o.y=t,o.width=i,o.height=n,o.unpremultiplyAlpha=this.game.config.premultipliedAlpha,this},snapshotPixel:function(e,t,i){return this.snapshotArea(e,t,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(e,t,i,n,r,s,a,o,l,h,u){void 0===r&&(r=!1),void 0===s&&(s=0),void 0===a&&(a=0),void 0===o&&(o=t),void 0===l&&(l=i),"pixel"===h&&(r=!0,h="image/png"),this.snapshotArea(s,a,o,l,n,h,u);var c=this.snapshotState;return c.getPixel=r,c.isFramebuffer=!0,c.bufferWidth=t,c.bufferHeight=i,c.width=Math.min(c.width,t),c.height=Math.min(c.height,i),this.glWrapper.updateBindingsFramebuffer({bindings:{framebuffer:e}}),g(this.gl,c),c.callback=null,c.isFramebuffer=!1,this},canvasToTexture:function(e,t,i,n){void 0===i&&(i=!1),void 0===n&&(n=!0);var r=this.gl,s=r.NEAREST,a=r.NEAREST,o=e.width,l=e.height,u=r.CLAMP_TO_EDGE,c=h(o,l);return!i&&c&&(u=r.REPEAT),this.config.antialias&&(s=c&&this.mipmapFilter?this.mipmapFilter:r.LINEAR,a=r.LINEAR),t?(t.update(e,o,l,n,u,u,s,a,t.format),t):this.createTexture2D(0,s,a,u,u,r.RGBA,e,o,l,!0,!1,n)},createCanvasTexture:function(e,t,i){return void 0===t&&(t=!1),void 0===i&&(i=!0),this.canvasToTexture(e,null,t,i)},updateCanvasTexture:function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=!1),this.canvasToTexture(e,t,n,i)},videoToTexture:function(e,t,i,n){void 0===i&&(i=!1),void 0===n&&(n=!0);var r=this.gl,s=r.NEAREST,a=r.NEAREST,o=e.videoWidth,l=e.videoHeight,u=r.CLAMP_TO_EDGE,c=h(o,l);return!i&&c&&(u=r.REPEAT),this.config.antialias&&(s=c&&this.mipmapFilter?this.mipmapFilter:r.LINEAR,a=r.LINEAR),t?(t.update(e,o,l,n,u,u,s,a,t.format),t):this.createTexture2D(0,s,a,u,u,r.RGBA,e,o,l,!0,!0,n)},createVideoTexture:function(e,t,i){return void 0===t&&(t=!1),void 0===i&&(i=!0),this.videoToTexture(e,null,t,i)},updateVideoTexture:function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=!1),this.videoToTexture(e,t,n,i)},createUint8ArrayTexture:function(e,t,i,n,r){var s=this.gl,a=s.NEAREST,o=s.NEAREST,l=s.CLAMP_TO_EDGE;return h(t,i)&&(l=s.REPEAT),void 0===n&&(n=!0),void 0===r&&(r=!0),this.createTexture2D(0,a,o,l,l,s.RGBA,e,t,i,n,!1,r)},setTextureFilter:function(e,t){var i=this.gl,n=0===t?i.LINEAR:i.NEAREST,r=this.glTextureUnits,s=r.units[0];return r.bind(e,0),e.update(e.pixels,e.width,e.height,e.flipY,e.wrapS,e.wrapT,n,n,e.format),s&&r.bind(s,0),this},setTextureWrap:function(e,t,i){var n=this.gl;if(!h(e.width,e.height)&&(t!==n.CLAMP_TO_EDGE||i!==n.CLAMP_TO_EDGE))return this;var r=this.glTextureUnits,s=r.units[0];return r.bind(e,0),e.update(e.pixels,e.width,e.height,e.flipY,t,i,e.minFilter,e.magFilter,e.format),s&&r.bind(s,0),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.off(l.RESIZE,this.baseDrawingContext.resize,this.baseDrawingContext),this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);var e=function(e){e.destroy()};n(this.glBufferWrappers,e),n(this.glFramebufferWrappers,e),n(this.glProgramWrappers,e),n(this.glTextureWrappers,e),this.removeAllListeners(),this.extensions={},this.gl=null,this.game=null,this.canvas=null,this.contextLost=!0}});e.exports=P},14500(e){e.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},4159(e,t,i){var n=i(14500),r=i(79291),s={Shaders:i(89350),ShaderAdditionMakers:i(83786),DrawingContext:i(87774),DrawingContextPool:i(65656),ProgramManager:i(56436),RenderNodes:i(54521),ShaderProgramFactory:i(18804),Utils:i(70554),WebGLRenderer:i(74797),Wrappers:i(31884)};s=r(!1,s,n),e.exports=s},47774(e){var t={createCombined:function(e,t,i,n,r,s){var a=e.gl;return void 0===t&&(t=!0),void 0===i&&(i=[0,0,0,0]),void 0===n&&(n=a.FUNC_ADD),void 0===r&&(r=a.ONE),void 0===s&&(s=a.ONE_MINUS_SRC_ALPHA),{enabled:t,color:i,equation:[n,n],func:[r,s,r,s]}},createSeparate:function(e,t,i,n,r,s,a,o,l){var h=e.gl;return void 0===t&&(t=!0),void 0===i&&(i=[0,0,0,0]),void 0===n&&(n=h.FUNC_ADD),void 0===r&&(r=h.FUNC_ADD),void 0===s&&(s=h.ONE),void 0===a&&(a=h.ONE_MINUS_SRC_ALPHA),void 0===o&&(o=h.ONE),void 0===l&&(l=h.ONE_MINUS_SRC_ALPHA),{enabled:t,color:i,equation:[n,r],func:[s,a,o,l]}}};e.exports=t},53314(e,t,i){var n=i(8054),r=i(62644),s=i(71623),a={getDefault:function(e){return{bindings:{activeTexture:0,arrayBuffer:null,elementArrayBuffer:null,framebuffer:null,program:null,renderbuffer:null},blend:r(e.blendModes[n.BlendModes.NORMAL]),colorClearValue:[0,0,0,1],colorWritemask:[!0,!0,!0,!0],cullFace:!1,depthTest:!1,scissor:{enable:!0,box:[0,0,0,0]},stencil:s.create(e),texturing:{flipY:!1,premultiplyAlpha:!1},vao:null,viewport:[0,0,0,0]}}};e.exports=a},71623(e){var t={create:function(e,t,i,n,r,s,a,o,l,h){var u=e.gl;return void 0===t&&(t=!0),void 0===i&&(i=u.EQUAL),void 0===n&&(n=0),void 0===r&&(r=255),void 0===s&&(s=u.KEEP),void 0===a&&(a=u.KEEP),void 0===o&&(o=u.KEEP),void 0===l&&(l=0),void 0===h&&(h=255),{enabled:t,func:{func:i,ref:n,mask:r},op:{fail:s,zfail:a,zpass:o},clear:l,writeMask:h}}};e.exports=t},13961(e,t,i){var n=i(83419),r=i(56436),s=i(40952),a=i(6141),o=i(36909),l=new n({Extends:a,initialize:function(e,t,i){var n=e.renderer,l=n.gl,h=(i=this._copyAndCompleteConfig(e,i||{},t)).name;if(!h)throw new Error("BatchHandler must have a name");a.call(this,h,e),this.instancesPerBatch=-1,this.verticesPerInstance=i.verticesPerInstance;var u=Math.floor(65536/this.verticesPerInstance),c=i.instancesPerBatch||n.config.batchSize||u;this.instancesPerBatch=Math.min(c,u),this.indicesPerInstance=i.indicesPerInstance,this.bytesPerIndexPerInstance=this.indicesPerInstance*Uint16Array.BYTES_PER_ELEMENT,this.maxTexturesPerBatch=1,this.topology=i.topology||l.TRIANGLE_STRIP,this.manager.on(o.Events.SET_PARALLEL_TEXTURE_UNITS,this.updateTextureCount,this),n.glWrapper.updateVAO({vao:null}),this.indexBuffer=n.createIndexBuffer(this._generateElementIndices(this.instancesPerBatch),i.indexBufferDynamic?l.DYNAMIC_DRAW:l.STATIC_DRAW);var d=i.vertexBufferLayout;if(d.count=this.instancesPerBatch*this.verticesPerInstance,this.vertexBufferLayout=new s(n,d,null),this.programManager=new r(n,[this.vertexBufferLayout],this.indexBuffer),this.programManager.setBaseShader(i.shaderName,i.vertexSource,i.fragmentSource),i.shaderAdditions)for(var f=0;f<i.shaderAdditions.length;f++){var p=i.shaderAdditions[f];this.programManager.addAddition(p)}if(i.shaderFeatures)for(f=0;f<i.shaderFeatures.length;f++)this.programManager.addFeature(i.shaderFeatures[f]);this.bytesPerInstance=this.vertexBufferLayout.layout.stride*this.verticesPerInstance,this.floatsPerInstance=this.bytesPerInstance/Float32Array.BYTES_PER_ELEMENT,this.currentBatchEntry={start:0,count:0,unit:0,texture:[]},this.batchEntries=[],this.instanceCount=0,this.updateTextureCount(e.maxParallelTextureUnits),this.resize(n.width,n.height),n.on(o.Events.RESIZE,this.resize,this)},_copyAndCompleteConfig:function(e,t,i){var n={};n.name=t.name||i.name,n.verticesPerInstance=t.verticesPerInstance||i.verticesPerInstance,n.indicesPerInstance=t.indicesPerInstance||i.indicesPerInstance,n.topology=t.topology||i.topology,n.shaderName=t.shaderName||i.shaderName,n.vertexSource=t.vertexSource||i.vertexSource,n.fragmentSource=t.fragmentSource||i.fragmentSource,n.shaderAdditions=t.shaderAdditions||i.shaderAdditions,Array.isArray(n.shaderAdditions)&&(n.shaderAdditions=n.shaderAdditions.map(function(e){return Object.assign({},e)})),n.shaderFeatures=t.shaderFeatures||i.shaderFeatures,n.indexBufferDynamic=t.indexBufferDynamic||i.indexBufferDynamic,n.instancesPerBatch=t.instancesPerBatch,n.maxTexturesPerBatch=t.maxTexturesPerBatch;var r=t.vertexBufferLayout||i.vertexBufferLayout;n.vertexBufferLayout={},n.vertexBufferLayout.usage=r.usage,n.vertexBufferLayout.layout=[];for(var s=t.vertexBufferLayoutRemove||[],a=0;a<r.layout.length;a++){var o=r.layout[a];-1===s.indexOf(o.name)&&(n.vertexBufferLayout.layout[a]={name:o.name,size:o.size||1,type:o.type||"FLOAT",normalized:o.normalized||!1})}if(t.vertexBufferLayoutAdd){var l=t.vertexBufferLayoutAdd||[];for(a=0;a<l.length;a++){var h=l[a];n.vertexBufferLayout.layout.push({name:h.name,size:h.size||1,type:h.type||"FLOAT",normalized:h.normalized||!1})}}return n},_generateElementIndices:function(e){return new ArrayBuffer(e*this.bytesPerInstance)},resize:function(e,t){},updateTextureCount:function(e){},run:function(e){},batch:function(){}});e.exports=l},16971(e,t,i){var n=i(83419),r=i(4127),s=i(89924),a=i(13961),o=new n({Extends:a,initialize:function(e,t){a.call(this,e,this.defaultConfig,t),this._emptyTextures=[]},defaultConfig:{name:"BatchHandlerPointLight",verticesPerInstance:4,indicesPerInstance:6,shaderName:"POINTLIGHT",vertexSource:s,fragmentSource:r,vertexBufferLayout:{usage:"DYNAMIC_DRAW",layout:[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius",size:1},{name:"inLightAttenuation",size:1},{name:"inLightColor",size:4}]}},_generateElementIndices:function(e){for(var t=new ArrayBuffer(6*e*2),i=new Uint16Array(t),n=0,r=0;r<e;r++){var s=4*r;i[n++]=s,i[n++]=s,i[n++]=s+1,i[n++]=s+2,i[n++]=s+3,i[n++]=s+3}return t},setupUniforms:function(e){var t=this.programManager,i=e.width,n=e.height;t.setUniform("uCameraZoom",e.camera.zoom),t.setUniform("uResolution",[i,n]),e.renderer.setProjectionMatrixFromDrawingContext(e),t.setUniform("uProjectionMatrix",e.renderer.projectionMatrix.val)},run:function(e){var t=this.instanceCount;if(0!==t){this.onRunBegin(e);var i=this.programManager,n=i.getCurrentProgramSuite();if(n){var r=n.program,s=n.vao;this.setupUniforms(e),i.applyUniforms(r),this.vertexBufferLayout.buffer.update(this.instanceCount*this.bytesPerInstance),this.manager.renderer.drawElements(e,this._emptyTextures,r,s,t*this.indicesPerInstance,0)}this.instanceCount=0,this.onRunEnd(e)}},batch:function(e,t,i,n,r,s,a,o,l,h,u,c){0===this.instanceCount&&this.manager.setCurrentBatchNode(this,e);var d=t.color,f=t.intensity,p=t.radius,m=t.attenuation,g=d.r*f,v=d.g*f,y=d.b*f,x=t.alpha,b=this.instanceCount*this.floatsPerInstance,w=this.vertexBufferLayout.buffer.viewF32;w[b++]=r,w[b++]=s,w[b++]=u,w[b++]=c,w[b++]=p,w[b++]=m,w[b++]=g,w[b++]=v,w[b++]=y,w[b++]=x,w[b++]=i,w[b++]=n,w[b++]=u,w[b++]=c,w[b++]=p,w[b++]=m,w[b++]=g,w[b++]=v,w[b++]=y,w[b++]=x,w[b++]=l,w[b++]=h,w[b++]=u,w[b++]=c,w[b++]=p,w[b++]=m,w[b++]=g,w[b++]=v,w[b++]=y,w[b++]=x,w[b++]=a,w[b++]=o,w[b++]=u,w[b++]=c,w[b++]=p,w[b++]=m,w[b++]=g,w[b++]=v,w[b++]=y,w[b++]=x,this.instanceCount++,this.instanceCount===this.instancesPerBatch&&this.run(e)}});e.exports=o},15214(e,t,i){var n=i(26099),r=i(83419),s=i(62644),a=i(70554),o=i(98840),l=i(44667),h=i(94158),u=i(81084),c=i(44349),d=i(6184),f=i(11653),p=i(40829),m=i(42792),g=i(96049),v=i(33997),y=i(79532),x=i(65217),b=i(74505),w=(a=i(70554),i(13961)),T=a.getTintAppendFloatAlpha,_=new r({Extends:w,initialize:function(e,t){this.renderOptions={alphaStrategy:"keep",multiTexturing:!1,texRes:!1,lighting:!1,selfShadow:!1,selfShadowPenumbra:0,selfShadowThreshold:0,smoothPixelArt:!1},w.call(this,e,this.defaultConfig,t),this.programManager.setUniform("uMainSampler[0]",this.manager.renderer.textureUnitIndices),this.nextRenderOptions=s(this.renderOptions),this._renderOptionsChanged=!1,this._lightVector=new n},defaultConfig:{name:"BatchHandlerQuad",verticesPerInstance:4,indicesPerInstance:6,shaderName:"STANDARD",vertexSource:l,fragmentSource:o,shaderAdditions:[m(),g(!0),b(!0),f(1),v(),c(),d(!0),x(!0),y(!0),p(!0),u(!0),h(!0)],vertexBufferLayout:{usage:"DYNAMIC_DRAW",layout:[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexDatum"},{name:"inTintEffect",size:4,type:"UNSIGNED_BYTE",normalized:!0},{name:"inTint",size:4,type:"UNSIGNED_BYTE",normalized:!0}]}},_generateElementIndices:function(e){for(var t=new ArrayBuffer(6*e*2),i=new Uint16Array(t),n=0,r=0;r<e;r++){var s=4*r;i[n++]=s,i[n++]=s,i[n++]=s+1,i[n++]=s+2,i[n++]=s+3,i[n++]=s+3}return t},updateTextureCount:function(e){var t=this.manager.renderer;void 0===e&&(e=t.maxTextures);var i=Math.max(1,Math.min(e,t.maxTextures));if(i!==this.maxTexturesPerBatch){if(i<this.currentBatchEntry.unit&&this.manager.currentBatchNode===this&&this.manager.finishBatch(),this.maxTexturesPerBatch=i,this.renderOptions.multiTexturing){var n=this.programManager,r=n.getAdditionsByTag("TEXTURE")[0];r&&n.replaceAddition(r.name,v(this.maxTexturesPerBatch))}this.resize(t.width,t.height)}},setupUniforms:function(e){var t=this.programManager,i=this.renderOptions;t.setUniform("uResolution",[e.width,e.height]),e.renderer.setProjectionMatrixFromDrawingContext(e),t.setUniform("uProjectionMatrix",e.renderer.projectionMatrix.val),this.renderOptions.lighting&&a.updateLightingUniforms(i.lighting,e,t,1,this._lightVector,i.selfShadow,i.selfShadowThreshold,i.selfShadowPenumbra)},setupTextureUniforms:function(e){var t=this.programManager;if(this.renderOptions.multiTexturing){for(var i=[],n=0;n<e.length;n++)i.push(e[n].width,e[n].height);t.setUniform("uMainResolution[0]",i)}else t.setUniform("uMainResolution[0]",[e[0].width,e[0].height])},finalizeTextureCount:function(e){var t=this.programManager;this.renderOptions.lighting&&(e=1);var i=t.getAdditionsByTag("TEXTURE")[0];i&&t.replaceAddition(i.name,v(e));var n=t.getAdditionsByTag("TexCount")[0];n&&t.replaceAddition(n.name,f(e))},updateRenderOptions:function(e){var t=this.nextRenderOptions,i=this.renderOptions,n=!1;e.alphaStrategy!==i.alphaStrategy&&(t.alphaStrategy=e.alphaStrategy,n=!0);var r=!!e.multiTexturing&&!e.lighting;r!==i.multiTexturing&&(t.multiTexturing=r,n=!0);var s=!!e.lighting;s!==i.lighting&&(t.lighting=s,n=!0);var a=s&&e.lighting.selfShadow&&e.lighting.selfShadow.enabled;a!==i.selfShadow&&(t.selfShadow=a,n=!0);var o=a?e.lighting.selfShadow.penumbra:0;o!==i.selfShadowPenumbra&&(t.selfShadowPenumbra=o,n=!0);var l=a?e.lighting.selfShadow.diffuseFlatThreshold:0;l!==i.selfShadowThreshold&&(t.selfShadowThreshold=l,n=!0);var h=!!e.smoothPixelArt;h!==i.smoothPixelArt&&(t.smoothPixelArt=h,t.texRes=h,n=!0),this._renderOptionsChanged=n},updateShaderConfig:function(){var e,t=this.programManager,i=this.renderOptions,n=this.nextRenderOptions;if(i.alphaStrategy!==n.alphaStrategy){var r=n.alphaStrategy;i.alphaStrategy=r;var s=t.getAdditionsByTag("ALPHA_DISCARD")[0];if(s){var a="keep"===r,o="dither"===r,l="number"===typeof r?r:void 0;t.replaceAddition(s.name,h(a,o,l))}}if(i.multiTexturing!==n.multiTexturing){var u=n.multiTexturing;i.multiTexturing=u;var c=t.getAdditionsByTag("TexCount")[0];c&&t.replaceAddition(c.name,f(u?this.maxTexturesPerBatch:1));var d=t.getAdditionsByTag("TEXTURE")[0];d&&t.replaceAddition(d.name,v(u?this.maxTexturesPerBatch:1))}if(i.lighting!==n.lighting){var p=n.lighting;i.lighting=p;var m=t.getAdditionsByTag("LIGHTING");for(e=0;e<m.length;e++){m[e].disable=!p}if(p){var g=t.getAddition("DefineLights");g&&(g.additions.fragmentDefine="#define LIGHT_COUNT "+this.manager.renderer.config.maxLights)}}if(i.selfShadow!==n.selfShadow){var y=n.selfShadow;i.selfShadow=y,y?t.addFeature("SELFSHADOW"):t.removeFeature("SELFSHADOW")}if(i.selfShadowPenumbra=n.selfShadowPenumbra,i.selfShadowThreshold=n.selfShadowThreshold,i.smoothPixelArt!==n.smoothPixelArt){var x=n.smoothPixelArt;i.smoothPixelArt=x;var b=t.getAddition("SmoothPixelArt");b&&(b.disable=!x)}if(i.texRes!==n.texRes){var w=n.texRes;i.texRes=w;var T=t.getAddition("GetTexRes");T&&(T.disable=!w)}},run:function(e){if(0!==this.instanceCount){this.onRunBegin(e),this.pushCurrentBatchEntry();var t=this.programManager,i=this.bytesPerIndexPerInstance,n=this.indicesPerInstance,r=this.manager.renderer;this.vertexBufferLayout.buffer.update(this.instanceCount*this.bytesPerInstance);for(var s=this.batchEntries.length,a=0;a<s;a++){var o=this.batchEntries[a];this.finalizeTextureCount(o.unit);var l=t.getCurrentProgramSuite();if(l){var h=l.program,u=l.vao;this.setupUniforms(e),t.applyUniforms(h),this.renderOptions.texRes&&(this.setupTextureUniforms(o.texture),t.applyUniforms(h)),r.drawElements(e,o.texture,h,u,o.count*n,o.start*i,this.topology)}}this.instanceCount=0,this.currentBatchEntry.start=0,this.batchEntries.length=0,this.onRunEnd(e)}},batch:function(e,t,i,n,r,s,a,o,l,h,u,c,d,f,p,m,g,v,y,x,b,w,_,S){0===this.instanceCount&&this.manager.setCurrentBatchNode(this,e),x.alphaStrategy=e.alphaStrategy,this.updateRenderOptions(x),this._renderOptionsChanged&&(this.run(e),this.updateShaderConfig());var E=this.batchTextures(t,x);void 0===b?(w=b=p<<24,_=b,S=b):(b=T(b,p/255),w=T(w,p/255),_=T(_,p/255),S=T(S,p/255));var C=this.instanceCount*this.floatsPerInstance,A=this.vertexBufferLayout.buffer,k=A.viewF32,R=A.viewU32;k[C++]=r,k[C++]=s,k[C++]=u,k[C++]=c+f,k[C++]=E,R[C++]=w,R[C++]=g,k[C++]=i,k[C++]=n,k[C++]=u,k[C++]=c,k[C++]=E,R[C++]=b,R[C++]=m,k[C++]=l,k[C++]=h,k[C++]=u+d,k[C++]=c+f,k[C++]=E,R[C++]=S,R[C++]=y,k[C++]=a,k[C++]=o,k[C++]=u+d,k[C++]=c,k[C++]=E,R[C++]=_,R[C++]=v,this.instanceCount++,this.currentBatchEntry.count++,this.instanceCount===this.instancesPerBatch&&this.run(e)},batchWithUV:function(e,t,i,n,r,s,a,o,l,h,u,c,d,f,p,m,g,v,y,x,b,w,_,S,E,C,A,k){0===this.instanceCount&&this.manager.setCurrentBatchNode(this,e),S.alphaStrategy=e.alphaStrategy,this.updateRenderOptions(S),this._renderOptionsChanged&&(this.run(e),this.updateShaderConfig());var R=this.batchTextures(t,S);void 0===E?(C=E=y<<24,A=E,k=E):(E=T(E,y/255),C=T(C,y/255),A=T(A,y/255),k=T(k,y/255));var O=this.instanceCount*this.floatsPerInstance,P=this.vertexBufferLayout.buffer,M=P.viewF32,N=P.viewU32;M[O++]=r,M[O++]=s,M[O++]=d,M[O++]=f,M[O++]=R,N[O++]=C,N[O++]=b,M[O++]=i,M[O++]=n,M[O++]=u,M[O++]=c,M[O++]=R,N[O++]=E,N[O++]=x,M[O++]=l,M[O++]=h,M[O++]=g,M[O++]=v,M[O++]=R,N[O++]=k,N[O++]=_,M[O++]=a,M[O++]=o,M[O++]=p,M[O++]=m,M[O++]=R,N[O++]=A,N[O++]=w,this.instanceCount++,this.currentBatchEntry.count++,this.instanceCount===this.instancesPerBatch&&this.run(e)},batchTextures:function(e,t){var i=this.renderOptions,n=0,r=this.currentBatchEntry;if(i.multiTexturing)-1===(n=e.batchUnit)&&(r.texture.length===this.maxTexturesPerBatch&&(this.pushCurrentBatchEntry(),r=this.currentBatchEntry),n=r.unit,e.batchUnit=n,r.texture[n]=e,r.unit++);else if(i.lighting){n=t.lighting.normalMapRotation;var s=t.lighting.normalGLTexture;r.texture[0]===e&&r.texture[1]===s||(this.pushCurrentBatchEntry(),r=this.currentBatchEntry,e.batchUnit=0,s.batchUnit=1,r.texture[0]=e,r.texture[1]=s,r.unit=2)}else r.texture[0]!==e&&(this.pushCurrentBatchEntry(),r=this.currentBatchEntry,e.batchUnit=0,r.texture[0]=e,r.unit=1);return n},pushCurrentBatchEntry:function(){if(!(this.currentBatchEntry.count<1)){this.batchEntries.push(this.currentBatchEntry);for(var e=this.currentBatchEntry.texture,t=0;t<e.length;t++)e[t].batchUnit=-1;this.currentBatchEntry={start:this.instanceCount,count:0,unit:0,texture:[]}}}});e.exports=_},72266(e,t,i){var n=i(83419),r=i(15214),s=new n({Extends:r,initialize:function(e,t){void 0===t&&(t={}),t.name||(t.name="BatchHandlerQuadSingle"),t.shaderName||(t.shaderName="STANDARD_SINGLE"),t.instancesPerBatch||(t.instancesPerBatch=1),r.call(this,e,t)}});e.exports=s},62791(e,t,i){var n=i(83419),r=i(98840),s=i(44667),a=i(94158),o=i(44349),l=i(11653),h=i(42792),u=i(96049),c=i(74505),d=i(33997),f=i(70554),p=i(15214),m=f.getTintAppendFloatAlpha,g=new n({Extends:p,initialize:function(e,t){p.call(this,e,t),this.renderOptions.multiTexturing=!0},defaultConfig:{name:"BatchHandlerStrip",verticesPerInstance:2,indicesPerInstance:2,shaderName:"STRIP",vertexSource:s,fragmentSource:r,shaderAdditions:[h(),u(!0),c(!0),l(1),d(),o(),a(!0)],vertexBufferLayout:{usage:"DYNAMIC_DRAW",layout:[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexDatum"},{name:"inTintEffect",size:4,type:"UNSIGNED_BYTE",normalized:!0},{name:"inTint",size:4,type:"UNSIGNED_BYTE",normalized:!0}]}},_generateElementIndices:function(e){for(var t=new ArrayBuffer(2*e*2),i=new Uint16Array(t),n=i.length,r=0;r<n;r++)i[r]=r;return t},batchStrip:function(e,t,i,n,r,s,a,o,l,h,u,c){0===this.instanceCount&&this.manager.setCurrentBatchNode(this,e);var d=r.length/(2*this.verticesPerInstance);if(d>this.instancesPerBatch)throw new Error("BatchHandlerStrip: Vertex count exceeds maximum per batch ("+this.maxVerticesPerBatch+")");this.instanceCount+d>this.instancesPerBatch&&this.run(e),u.alphaStrategy=e.alphaStrategy,this.updateRenderOptions(u),this._renderOptionsChanged&&(this.run(e),this.updateShaderConfig());var f,p=this.batchTextures(n),g=this.instanceCount*this.floatsPerInstance,v=this.vertexBufferLayout.buffer,y=v.viewF32,x=v.viewU32,b=!1;if(this.instanceCount>0){var w=1+this.floatsPerInstance/this.verticesPerInstance;y[g++]=y[g-w],y[g++]=y[g-w],y[g++]=y[g-w],y[g++]=y[g-w],y[g++]=y[g-w],y[g++]=y[g-w],x[g++]=x[g-w],b=!0}c&&(f=[]);for(var T=i.a,_=i.b,S=i.c,E=i.d,C=i.e,A=i.f,k=h<<24,R=r.length,O=0;O<R;O+=2){var P=r[O],M=r[O+1],N=P*T+M*S+C,I=P*_+M*E+A;y[g++]=N,y[g++]=I,y[g++]=s[O],y[g++]=s[O+1],y[g++]=p,x[g++]=k,x[g++]=m(a[O/2],o[O/2]*l),b?(O-=2,this.instanceCount++,this.currentBatchEntry.count++,b=!1):f&&f.push(N,I),O%4===2&&(this.instanceCount++,this.currentBatchEntry.count++)}c&&c.call(t,t,R,f)}});e.exports=g},21832(e,t,i){var n=i(83419),r=i(98840),s=i(44667),a=i(94158),o=i(81084),l=i(44349),h=i(6184),u=i(11653),c=i(40829),d=i(42792),f=i(96049),p=i(33997),m=i(10455),g=i(79532),v=i(65217),y=i(74505),x=i(44832),b=i(23295),w=i(70554),T=i(15214),_=w.getTintAppendFloatAlpha,S=new n({Extends:T,initialize:function(e,t){T.call(this,e,t)},defaultConfig:{name:"BatchHandlerTileSprite",verticesPerInstance:4,indicesPerInstance:6,shaderName:"TILESPRITE",vertexSource:s,fragmentSource:r,shaderAdditions:[m(),d(),f(!0),b(!0),x(!0),y(!0),u(1),p(),l(),h(!0),v(!0),g(!0),c(!0),o(!0),a(!0)],vertexBufferLayout:{usage:"DYNAMIC_DRAW",layout:[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inFrame",size:4},{name:"inTexDatum"},{name:"inTintEffect",size:4,type:"UNSIGNED_BYTE",normalized:!0},{name:"inTint",size:4,type:"UNSIGNED_BYTE",normalized:!0}]}},updateRenderOptions:function(e){T.prototype.updateRenderOptions.call(this,e);var t=this.renderOptions,i=this.nextRenderOptions,n=this._renderOptionsChanged;i.clampFrame=!!e.clampFrame,i.clampFrame!==t.clampFrame&&(n=!0),i.wrapFrame=!!e.wrapFrame,i.wrapFrame!==t.wrapFrame&&(n=!0),i.texRes=i.clampFrame||i.texRes,i.texRes!==t.texRes&&(n=!0),n&&(this._renderOptionsChanged=!0)},updateShaderConfig:function(){T.prototype.updateShaderConfig.call(this);var e=this.programManager,t=this.renderOptions,i=this.nextRenderOptions;if(i.clampFrame!==t.clampFrame){var n=i.clampFrame;t.clampFrame=n,e.getAddition("TexCoordFrameClamp").disable=!i.clampFrame}if(i.wrapFrame!==t.wrapFrame){var r=i.wrapFrame;t.wrapFrame=r,e.getAddition("TexCoordFrameWrap").disable=!r}},batch:function(e,t,i,n,r,s,a,o,l,h,u,c,d,f,p,m,g,v,y,x,b,w,T,S,E,C,A,k,R,O,P,M){0===this.instanceCount&&this.manager.setCurrentBatchNode(this,e),x.alphaStrategy=e.alphaStrategy,this.updateRenderOptions(x),this._renderOptionsChanged&&(this.run(e),this.updateShaderConfig());var N=this.batchTextures(t,x);void 0===R?(O=R=p<<24,P=R,M=R):(R=_(R,p/255),O=_(O,p/255),P=_(P,p/255),M=_(M,p/255));var I=this.instanceCount*this.floatsPerInstance,L=this.vertexBufferLayout.buffer,D=L.viewF32,F=L.viewU32;D[I++]=r,D[I++]=s,D[I++]=T,D[I++]=S,D[I++]=u,D[I++]=c,D[I++]=d,D[I++]=f,D[I++]=N,F[I++]=O,F[I++]=g,D[I++]=i,D[I++]=n,D[I++]=b,D[I++]=w,D[I++]=u,D[I++]=c,D[I++]=d,D[I++]=f,D[I++]=N,F[I++]=R,F[I++]=m,D[I++]=l,D[I++]=h,D[I++]=A,D[I++]=k,D[I++]=u,D[I++]=c,D[I++]=d,D[I++]=f,D[I++]=N,F[I++]=M,F[I++]=y,D[I++]=a,D[I++]=o,D[I++]=E,D[I++]=C,D[I++]=u,D[I++]=c,D[I++]=d,D[I++]=f,D[I++]=N,F[I++]=P,F[I++]=v,this.instanceCount++,this.currentBatchEntry.count++,this.instanceCount===this.instancesPerBatch&&this.run(e)}});e.exports=S},59444(e,t,i){var n=i(26099),r=i(83419),s=i(70554),a=i(15214),o=s.getTintAppendFloatAlpha,l=new r({Extends:a,initialize:function(e,t){a.call(this,e,t),this._tempPoint=new n},defaultConfig:Object.assign({},a.prototype.defaultConfig,{name:"BatchHandlerTri",verticesPerInstance:3,indicesPerInstance:3,topology:4}),_generateElementIndices:function(e){for(var t=new ArrayBuffer(3*e*2),i=new Uint16Array(t),n=i.length,r=0;r<n;r++)i[r]=r;return t},batchTriangles:function(e,t,i,n,r,s,a){0===this.instanceCount&&this.manager.setCurrentBatchNode(this,e),a.alphaStrategy=e.alphaStrategy,this.updateRenderOptions(a),this._renderOptionsChanged&&(this.run(e),this.updateShaderConfig()),n.setupMatrix(e,t,i);for(var l=this._tempPoint,h=t.flipV,u=t.tintMode,c=o(t.tint,t.alpha),d=u<<24,f=t.texture.source,p=this.floatsPerInstance,m=this.instancesPerBatch,g=this.vertexBufferLayout.buffer,v=g.viewF32,y=g.viewU32,x=s.length/4|0,b=0;b<x;b++){var w=4*b,T=s[w],_=s[w+1],S=s[w+2],E=f[s[w+3]].glTexture,C=this.batchTextures(E,a),A=this.instanceCount*p,k=4*T;l.set(r[k],r[k+1]),n.transformVertex(l);var R=r[k+3];v[A++]=l.x,v[A++]=l.y,v[A++]=r[k+2],v[A++]=h?1-R:R,v[A++]=C,y[A++]=d,y[A++]=c;var O=4*_;l.set(r[O],r[O+1]),n.transformVertex(l);var P=r[O+3];v[A++]=l.x,v[A++]=l.y,v[A++]=r[O+2],v[A++]=h?1-P:P,v[A++]=C,y[A++]=d,y[A++]=c;var M=4*S;l.set(r[M],r[M+1]),n.transformVertex(l);var N=r[M+3];v[A++]=l.x,v[A++]=l.y,v[A++]=r[M+2],v[A++]=h?1-N:N,v[A++]=C,y[A++]=d,y[A++]=c,this.instanceCount++,this.currentBatchEntry.count++,this.instanceCount===m&&this.run(e)}}});e.exports=l},62087(e,t,i){var n=i(26099),r=i(83419),s=i(94158),a=i(81084),o=i(6184),l=i(13198),h=i(73416),u=i(91627),c=i(70554),d=i(13961),f=new r({Extends:d,initialize:function(e,t){d.call(this,e,this.defaultConfig,t),this._emptyTextures=[],this.vertexCount=0,this._lightVector=new n,this.renderOptions={alphaStrategy:"keep",lighting:!1},this.nextRenderOptions={alphaStrategy:"keep",lighting:!1},this._renderOptionsChanged=!1},defaultConfig:{name:"BatchHandlerTriFlat",verticesPerInstance:3,indicesPerInstance:3,topology:4,shaderName:"FLAT",vertexSource:u,fragmentSource:h,shaderAdditions:[o(!0),l(!0),a(!0),s(!0)],indexBufferDynamic:!0,vertexBufferLayout:{usage:"DYNAMIC_DRAW",layout:[{name:"inPosition",size:2},{name:"inTint",size:4,type:"UNSIGNED_BYTE",normalized:!0}]}},_generateElementIndices:function(e){return new ArrayBuffer(3*e*2)},setupUniforms:function(e){var t=this.programManager;e.renderer.setProjectionMatrixFromDrawingContext(e),t.setUniform("uProjectionMatrix",e.renderer.projectionMatrix.val),this.renderOptions.lighting&&(c.updateLightingUniforms(this.renderOptions.lighting,e,t,1,this._lightVector),t.setUniform("uResolution",[e.width,e.height]))},updateRenderOptions:function(e,t){var i=this.nextRenderOptions,n=this.renderOptions,r=!1;t!==n.alphaStrategy&&(i.alphaStrategy=t,r=!0),e!==n.lighting&&(i.lighting=e,r=!0),this._renderOptionsChanged=r},updateShaderConfig:function(){var e=this.programManager,t=this.renderOptions,i=this.nextRenderOptions;if(t.alphaStrategy!==i.alphaStrategy){var n=i.alphaStrategy;t.alphaStrategy=n;var r=e.getAdditionsByTag("ALPHA_DISCARD")[0];if(r){var a="keep"===n,o="dither"===n,l="number"===typeof n?n:void 0;e.replaceAddition(r.name,s(a,o,l))}}if(t.lighting!==i.lighting){var h=i.lighting;t.lighting=h;for(var u=e.getAdditionsByTag("LIGHTING"),c=0;c<u.length;c++){u[c].disable=!h}if(h){var d=e.getAddition("DefineLights");d&&(d.additions.fragmentDefine="#define LIGHT_COUNT "+this.manager.renderer.config.maxLights)}}},run:function(e){if(0!==this.instanceCount){this.onRunBegin(e);var t=this.programManager,i=t.getCurrentProgramSuite();if(i){var n=i.program,r=i.vao;this.setupUniforms(e),t.applyUniforms(n);var s=this.indicesPerInstance,a=this.instanceCount,o=this.manager.renderer,l=this.vertexBufferLayout.buffer,h=this.vertexBufferLayout.layout.stride;l.update(this.vertexCount*h),r.bind(),r.indexBuffer.update(a*s*2),o.drawElements(e,this._emptyTextures,n,r,a*s,0,this.topology)}this.instanceCount=0,this.vertexCount=0,this.onRunEnd(e)}},batch:function(e,t,i,n,r){0===this.instanceCount&&this.manager.setCurrentBatchNode(this,e),this.updateRenderOptions(r,e.alphaStrategy),this._renderOptionsChanged&&(this.run(e),this.updateShaderConfig());for(var s=0,a=0,o=this.instancesPerBatch,l=this.vertexBufferLayout.layout.stride,h=this.verticesPerInstance,u=this.indexBuffer.viewU16,c=this.instanceCount*this.indicesPerInstance,d=this.vertexBufferLayout.buffer,f=d.viewF32,p=d.viewU32,m=this.vertexCount*l/f.BYTES_PER_ELEMENT,g=[],v=0,y=[],x=0,b=0;b<t.length;b++){var w=t[b],T=2*w;g[b]!==s&&(f[m++]=i[T],f[m++]=i[T+1],p[m++]=n[w],g[v++]=s,y[x++]=this.vertexCount,this.vertexCount++);var _=y[x-1];u[c++]=_,++a===h&&(this.instanceCount++,a=0),(this.instanceCount===o||0===a&&c+h>=u.length)&&(s++,this.run(e),c=this.instanceCount*this.indicesPerInstance,m=this.vertexCount*l/f.BYTES_PER_ELEMENT,v=0,x=0)}}});e.exports=f},61842(e,t,i){var n=i(19715),r=i(1e3),s=i(61340),a=i(87841),o=i(43855),l=i(83419),h=i(70554),u=i(6141);function c(e){return h.getTintAppendFloatAlpha(16777215,e)}var d=new l({Extends:u,initialize:function(e){u.call(this,"Camera",e),this.batchHandlerQuadSingleNode=e.getNode("BatchHandlerQuadSingle"),this.fillCameraNode=e.getNode("FillCamera"),this.listCompositorNode=e.getNode("ListCompositor"),this._parentTransformMatrix=new s},run:function(e,t,i,s,l,h){var u;this.onRunBegin(e);var d=e.renderer.drawingContextPool,f=this.manager,p=i.alpha,m=i.filters.internal.getActive(),g=i.filters.external.getActive(),v=l||i.forceComposite||m.length||g.length||p<1;s?i.matrixExternal.multiply(s,s):s=this._parentTransformMatrix.copyFrom(i.matrixExternal);var y=s.decomposeMatrix(),x=o(y.translateX,0)&&o(y.translateY,0)&&o(y.rotation,0)&&o(y.scaleX,1)&&o(y.scaleY,1),b=i.x,w=i.y,T=i.width,_=i.height,S=e.getClone();S.setCamera(i),v?((u=d.get(T,_)).setCamera(i),u.setScissorBox(0,0,T,_)):(u=S).setScissorBox(b,w,T,_),u.use();var E=this.fillCameraNode;if(i.backgroundColor.alphaGL>0){var C=i.backgroundColor,A=r(C.red,C.green,C.blue,C.alpha);E.run(u,A,v)}this.listCompositorNode.run(u,t,null,h);var k=i.flashEffect;k.postRenderWebGL()&&(A=r(k.red,k.green,k.blue,255*k.alpha),E.run(u,A,v));var R=i.fadeEffect;if(R.postRenderWebGL()&&(A=r(R.red,R.green,R.blue,255*R.alpha),E.run(u,A,v)),f.finishBatch(),v){var O,P,M,N,I={alphaStrategy:S.alphaStrategy,smoothPixelArt:f.renderer.game.config.smoothPixelArt},L=new a(0,0,u.width,u.height);for(O=0;O<m.length;O++)P=m[O],u=f.getNode(P.renderNode).run(P,u),M=P.getPaddingCeil(),L.setTo(L.x+M.x,L.y+M.y,L.width+M.width,L.height+M.height);var D=u,F=g.length>0,B=!F,U=new a(0,0,S.width,S.height);if(F){for(O=g.length-1;O>=0;O--)(P=g[O]).active&&(M=P.getPaddingCeil(),U.setTo(U.x+M.x,U.y+M.y,U.width+M.width,U.height+M.height));(B=U.width!==u.width||U.height!==u.height||!x)&&((u=d.get(U.width,U.height)).setScissorBox(0,0,U.width,U.height),u.setCamera(S.camera),u.use())}else u=S;if(B){var z,V=U.x,H=U.y;s.setQuad(L.x,L.y,L.x+L.width,L.y+L.height),z=s.quad,N=F?4294967295:c(p),i.roundPixels&&(z[0]=Math.round(z[0]),z[1]=Math.round(z[1]),z[2]=Math.round(z[2]),z[3]=Math.round(z[3]),z[4]=Math.round(z[4]),z[5]=Math.round(z[5]),z[6]=Math.round(z[6]),z[7]=Math.round(z[7])),this.batchHandlerQuadSingleNode.batch(u,D.texture,z[0]-V,z[1]-H,z[2]-V,z[3]-H,z[6]-V,z[7]-H,z[4]-V,z[5]-H,0,1,1,-1,!1,N,N,N,N,I)}if(D!==u&&D.release(),F){var j=!1;for(D=null,M=new a,O=0;O<g.length;O++)(P=g[O]).allowBaseDraw&&u.width===S.width&&u.height===S.height&&O===g.length-1&&1===p&&(j=!0,D=S),u=f.getNode(P.renderNode).run(P,u,D,M),(M=P.currentPadding).x=-M.x,M.y=-M.y,M.width=-M.width,M.height=-M.height;if(!j){N=c(p);var Y=-M.x,W=-M.y,G=u.width+M.right,X=u.height+M.bottom;this.batchHandlerQuadSingleNode.batch(S,u.texture,Y,X,Y,W,G,X,G,W,0,0,1,1,!1,N,N,N,N,I),u.release()}}}i.dirty=!1,i.emit(n.POST_RENDER,i),this.onRunEnd(e)}});e.exports=d},76409(e,t,i){var n=i(83419),r=i(6141),s=new n({Extends:r,initialize:function(e){r.call(this,"DrawLine",e)},run:function(e,t,i,n,r,s,a,o,l){this.onRunBegin(e);var h=r-i,u=s-n,c=Math.sqrt(h*h+u*u),d=a*(s-n)/c,f=a*(i-r)/c,p=o*(s-n)/c,m=o*(i-r)/c,g=r-p,v=s-m,y=i-d,x=n-f,b=r+p,w=s+m,T=i+d,_=n+f,S=l.length;t?(l[S+0]=t.getX(T,_),l[S+1]=t.getY(T,_),l[S+2]=t.getX(y,x),l[S+3]=t.getY(y,x),l[S+4]=t.getX(g,v),l[S+5]=t.getY(g,v),l[S+6]=t.getX(b,w),l[S+7]=t.getY(b,w)):(l[S+0]=T,l[S+1]=_,l[S+2]=y,l[S+3]=x,l[S+4]=g,l[S+5]=v,l[S+6]=b,l[S+7]=w),this.onRunEnd(e)}});e.exports=s},95449(e,t,i){var n=i(19715),r=i(42538),s=i(83419),a=i(10312),o=i(6141),l=new s({Extends:o,initialize:function(e){o.call(this,"DynamicTextureHandler",e),this.fillRectNode=this.manager.getNode("FillRect")},run:function(e){var t=e.drawingContext,i=t.camera,s=t.renderer,o=e.manager;this.onRunBegin(t);var l,h,u,c,d,f,p,m,g,v,y,x,b,w,T=t.framebuffer.renderTexture;if(T)for(var _=s.glTextureUnits,S=_.units,E=0;E<S.length;E++)S[E]===T&&_.bind(null,E);t.setScissorBox(0,0,i.width,i.height),t.use();for(var C=e.commandBuffer,A=C.length,k=null,R=!1,O=t,P=s.gl,M=0;M<A;M++){switch(C[M]){case r.CLEAR:b=C[++M],w=C[++M],x=C[++M],c=C[++M];var N=O.getClone();N.setScissorEnable(!0),N.setScissorBox(b,w,x,c),N.use(),N.clear(P.COLOR_BUFFER_BIT|P.DEPTH_BUFFER_BIT|P.STENCIL_BUFFER_BIT),N.release();break;case r.FILL:var I=C[++M];b=C[++M],w=C[++M],x=C[++M],c=C[++M],this.fillRectNode.run(O,null,null,b,w,x,c,I,I,I,I,!1);break;case r.STAMP:d=C[++M],u=C[++M],b=C[++M],w=C[++M],l=C[++M],y=C[++M],m=C[++M],g=C[++M],v=C[++M],f=C[++M],p=C[++M],h=C[++M];var L=o.resetStamp(l,y);L.setPosition(b,w).setRotation(m).setTexture(d,u).setOrigin(f,p).setScale(g,v).setBlendMode(h),O=this._draw(s,L,O,t,k);break;case r.REPEAT:d=C[++M],u=C[++M],b=C[++M],w=C[++M],l=C[++M],y=C[++M],m=C[++M],g=C[++M],v=C[++M],f=C[++M],p=C[++M],h=C[++M],x=C[++M],c=C[++M];var D=C[++M],F=C[++M],B=C[++M],U=C[++M],z=C[++M],V=o.resetTileSprite(l,y);V.setPosition(b,w).setRotation(m).setTexture(d,u).setSize(x,c).setOrigin(f,p).setScale(g,v).setBlendMode(h).setTilePosition(D,F).setTileRotation(B).setTileScale(U,z),O=this._draw(s,V,O,t,k);break;case r.DRAW:var H=C[++M];if(b=C[++M],w=C[++M],void 0!==b){var j=H.x;H.x+=b}if(void 0!==w){var Y=H.y;H.y+=w}O=this._draw(s,H,O,t,k),void 0!==b&&(H.x=j),void 0!==w&&(H.y=Y);break;case r.SET_ERASE:C[++M]?(k||(k=t.getClone()).setBlendMode(a.ERASE),O!==k&&(O.release(),O=k,k.use())):O===k&&(k.release(),O=t,t.use());break;case r.PRESERVE:R=C[++M];break;case r.CALLBACK:(0,C[++M])();break;case r.CAPTURE:H=C[++M];var W=C[++M],G=e.startCapture(H,W),X=O;W.camera&&((X=X.getClone()).setCamera(W.camera),X.use()),this._draw(s,H,X,t,k,G.transform),e.finishCapture(H,G),W.camera&&X.release()}}R||(C.length=0),O.release(),T.needsMipmapRegeneration=!0,i.emit(n.POST_RENDER,i),this.onRunEnd(t)},_draw:function(e,t,i,n,r,s){if(i!==r&&t.blendMode!==i.blendMode&&t.blendMode!==a.SKIP_CHECK){i.release();var o=t.blendMode;o===n.blendMode?i=n:(i=n.getClone()).setBlendMode(o),i.use()}return t.renderWebGLStep(e,t,i,s),i}});e.exports=l},61199(e,t,i){var n=i(83419),r=i(6141),s=new n({Extends:r,initialize:function(e){r.call(this,"FillCamera",e),this.fillRectNode=this.manager.getNode("FillRect")},run:function(e,t,i){this.onRunBegin(e);var n=e.camera,r=i?0:n.x,s=i?0:n.y,a=n.width,o=n.height;this.fillRectNode.run(e,null,null,r,s,a,o,t,t,t,t),this.onRunEnd(e)}});e.exports=s},14255(e,t,i){var n=i(94811),r=i(83419),s=i(6141),a=new r({Extends:s,initialize:function(e){s.call(this,"FillPath",e)},run:function(e,t,i,r,s,a,o,l,h){this.onRunBegin(e),void 0===l&&(l=0);var u,c,d,f,p,m,g=r.length,v=0,y=0,x=[],b=[],w=0;for(c=0;c<g;c++)d=r[c],p=t.getX(d.x,d.y),m=t.getY(d.x,d.y),c>0&&c<g-1&&Math.abs(p-x[v-2])<=l&&Math.abs(m-x[v-1])<=l||(x[v++]=p,x[v++]=m);if(f=n(x),s===a&&s===o){var T=x.length;for(u=0;u<T;u+=2)b[w++]=s;i.batch(e,f,x,b,h)}else{var _=f.length,S=Array(_),E=Array(2*_),C=0;for(u=0;u<_;u+=3){var A=2*f[u];p=x[A+0],m=x[A+1],E[C++]=p,E[C++]=m,p=x[(A=2*f[u+1])+0],m=x[A+1],E[C++]=p,E[C++]=m,p=x[(A=2*f[u+2])+0],m=x[A+1],E[C++]=p,E[C++]=m,b[w++]=s,b[w++]=a,b[w++]=o,S[y++]=u+0,S[y++]=u+1,S[y++]=u+2}i.batch(e,S,E,b,h)}this.onRunEnd(e)}});e.exports=a},12682(e,t,i){var n=i(61340),r=i(83419),s=i(6141),a=new r({Extends:s,initialize:function(e){s.call(this,"FillRect",e),this._batchHandlerDefault=e.getNode("BatchHandlerTriFlat"),this._identityMatrix=new n,this._indexedTriangles=[0,1,2,2,3,0]},run:function(e,t,i,n,r,s,a,o,l,h,u,c){this.onRunBegin(e),t||(t=this._identityMatrix),i||(i=this._batchHandlerDefault);var d=t.setQuad(n,r,n+s,r+a);i.batch(e,this._indexedTriangles,d,[o,h,u,l],c),this.onRunEnd(e)}});e.exports=a},13119(e,t,i){var n=i(83419),r=i(6141),s=new n({Extends:r,initialize:function(e){r.call(this,"FillTri",e),this._indexedTriangles=[0,1,2]},run:function(e,t,i,n,r,s,a,o,l,h,u,c,d){this.onRunBegin(e),t?i.batch(e,this._indexedTriangles,[t.getX(n,r),t.getY(n,r),t.getX(s,a),t.getY(s,a),t.getX(o,l),t.getY(o,l)],[h,u,c],d):i.batch(e,this._indexedTriangles,[n,r,s,a,o,l],[h,u,c],d),this.onRunEnd(e)}});e.exports=s},27996(e,t,i){var n=i(83419),r=i(8054),s=i(6141),a=new n({Extends:s,initialize:function(e){s.call(this,"ListCompositor",e)},run:function(e,t,i,n){this.onRunBegin(e);for(var s=e,a=e.blendMode,o=a,l=this.manager.renderer,h=0;h<t.length;h++){var u=t[h];u.blendMode!==o&&u.blendMode!==r.BlendModes.SKIP_CHECK&&(s!==e&&s.release(),(o=u.blendMode)===a?s=e:((s=e.getClone()).setBlendMode(o),s.use())),u.renderWebGLStep(l,u,s,i,n,t,h)}s!==e&&s.release(),this.onRunEnd(e)}});e.exports=a},56432(e,t,i){var n=i(83419),r=i(46975),s=i(6141),a=new n({Extends:s,initialize:function(e){s.call(this,"RebindContext",e),this._state={bindings:{activeTexture:0,arrayBuffer:null,elementArrayBuffer:null,framebuffer:null,program:null,renderbuffer:null},vao:null}},run:function(e){this.onRunBegin(e);var t=this.manager.renderer,i=t.glWrapper;t.clearFramebuffer(void 0,void 0,0),i.update(r(this._state,i.state),!0),t.glTextureUnits.unbindAllUnits(),this.onRunEnd(e)}});e.exports=a},6141(e,t,i){var n=new(i(83419))({initialize:function(e,t){this.name=e,this.manager=t,this._run=null},run:function(){},onRunBegin:function(e){},onRunEnd:function(e){},setDebug:function(e){e?(this._run=this.run,this.run=function(){var e=this.manager;e.pushDebug(this.name);var t=this._run.apply(this,arguments);return e.popDebug(),t}):(this.run=this._run,this._run=null)}});e.exports=n},30130(e,t,i){var n=i(50792),r=i(83419),s=i(92503),a=i(47406),o=i(53663),l=i(16971),h=i(15214),u=i(72266),c=i(62791),d=i(21832),f=i(59444),p=i(62087),m=i(61842),g=i(76409),v=i(95449),y=i(61199),x=i(14255),b=i(12682),w=i(13119),T=i(22731),_=i(57032),S=i(52903),E=i(13922),C=i(33466),A=i(75798),k=i(90830),R=i(52302),O=i(34989),P=i(91614),M=i(15600),N=i(99786),I=i(26825),L=i(54900),D=i(34652),F=i(26703),B=i(56165),U=i(40305),z=i(55905),V=i(58167),H=i(40752),j=i(13279),Y=i(27459),W=i(88856),G=i(10845),X=i(99184),q=i(27996),K=i(56432),Q=i(17486),J=i(68517),Z=i(31029),$=i(94494),ee=i(87469),te=i(89723),ie=i(12913),ne=i(22995),re=i(86081),se=i(88383),ae=i(34454),oe=i(46211),le=i(64552),he=i(95433),ue=new r({Extends:n,initialize:function(e){n.call(this),this.renderer=e;var t=e.game;this.maxParallelTextureUnits=t.config.autoMobileTextures&&!t.device.os.desktop?1:e.maxTextures,this._nodes={},this._nodeConstructors={BaseFilter:a,BaseFilterShader:o,BatchHandlerPointLight:l,BatchHandlerQuad:h,BatchHandlerQuadSingle:u,BatchHandlerStrip:c,BatchHandlerTileSprite:d,BatchHandlerTri:f,BatchHandlerTriFlat:p,Camera:m,DrawLine:g,DynamicTextureHandler:v,FillCamera:y,FillPath:x,FillRect:b,FillTri:w,FilterBarrel:T,FilterBlend:_,FilterBlocky:S,FilterBlur:E,FilterBlurHigh:C,FilterBlurLow:A,FilterBlurMed:k,FilterBokeh:R,FilterColorMatrix:O,FilterCombineColorMatrix:P,FilterDisplacement:M,FilterGlow:N,FilterGradientMap:I,FilterImageLight:L,FilterKey:D,FilterMask:F,FilterNormalTools:B,FilterPanoramaBlur:U,FilterParallelFilters:z,FilterPixelate:V,FilterQuantize:H,FilterSampler:j,FilterShadow:Y,FilterThreshold:W,FilterVignette:G,FilterWipe:X,ListCompositor:q,RebindContext:K,StrokePath:Q,SubmitterMeshToQuad:J,SubmitterQuad:Z,SubmitterTile:$,SubmitterTilemapGPULayer:ee,SubmitterTileSprite:te,TexturerImage:ie,TexturerTileSprite:ne,TransformerImage:re,TransformerStamp:se,TransformerTile:ae,TransformerTileSprite:oe,TransformerVertex:le,YieldContext:he},Object.entries(t.config.renderNodes).forEach(function(e){var t=e[0],i=e[1];this.addNodeConstructor(t,i)},this),this.currentBatchNode=null,this.currentBatchDrawingContext=null,this.debug=!1,this.debugGraph=null,this.currentDebugNode=null},addNode:function(e,t){if(this._nodes[e])throw new Error("node "+e+" already exists.");this._nodes[e]=t,this.debug&&t.setDebug(!0)},addNodeConstructor:function(e,t){if(this._nodeConstructors[e])throw new Error("node constructor "+e+" already exists.");this._nodeConstructors[e]=t},getNode:function(e){if(this._nodes[e])return this._nodes[e];if(this._nodeConstructors[e]){var t=new this._nodeConstructors[e](this);return this.addNode(e,t),t}return null},hasNode:function(e,t){return!!this._nodes[e]||!t&&!!this._nodeConstructors[e]},setCurrentBatchNode:function(e,t){this.currentBatchNode!==e&&(null!==this.currentBatchNode&&this.currentBatchNode.run(this.currentBatchDrawingContext),this.currentBatchNode=e,this.currentBatchDrawingContext=e?t:null)},setMaxParallelTextureUnits:function(e){this.maxParallelTextureUnits=Math.max(1,Math.min(e,this.renderer.maxTextures)),this.emit(s.SET_PARALLEL_TEXTURE_UNITS,this.maxParallelTextureUnits)},finishBatch:function(){null!==this.currentBatchNode&&this.setCurrentBatchNode(null)},startStandAloneRender:function(){this.finishBatch()},setDebug:function(e){for(var t in this.debug=e,this._nodes)this._nodes[t].setDebug(e);e&&(this.debugGraph=null,this.currentDebugNode=null,this.pushDebug("[Render Tree Root]"),this.renderer.once(s.POST_RENDER,function(){this.setDebug(!1)},this))},pushDebug:function(e){if(this.debug){var t={name:e,children:[],parent:this.currentDebugNode};this.debugGraph?this.currentDebugNode.children.push(t):this.debugGraph=t,this.currentDebugNode=t}},popDebug:function(){this.debug&&(this.currentDebugNode.parent?this.currentDebugNode=this.currentDebugNode.parent:this.currentDebugNode=null)},debugToString:function(){var e;return e=function e(t,i){for(var n=function(e){return"  ".repeat(e)}(i)+t.name+"\n",r=0;r<t.children.length;r++)n+=e(t.children[r],i+1);return n}(this.debugGraph,0),e}});e.exports=ue},55403(e,t,i){var n=i(83419),r=i(40952),s=i(56436),a=i(6141),o=i(65884),l=i(72823),h=new n({Extends:a,initialize:function(e,t){a.call(this,"ShaderQuad",e);var i=e.renderer;this.renderer=i,(t=this._completeConfig(t)).updateShaderConfig&&(this.updateShaderConfig=t.updateShaderConfig),this.indexBuffer=i.genericQuadIndexBuffer,this.vertexBufferLayout=new r(i,t.vertexBufferLayout,null),this.programManager=new s(i,[this.vertexBufferLayout],this.indexBuffer),this.programManager.setBaseShader(t.shaderName,t.vertexSource,t.fragmentSource);for(var n=0;n<t.shaderAdditions.length;n++){var o=t.shaderAdditions[n];this.programManager.addAddition(o)}this.setUniform=this.programManager.setUniform.bind(this.programManager),this.transformerNode=e.getNode("TransformerImage"),this._texturerProxy={frameWidth:1,frameHeight:1,frame:{realWidth:1,realHeight:1},uvSource:{x:0,y:0}}},_completeConfig:function(e){var t=this.renderer.gl,i=e.vertexSource;if(!i){var n=e.vertexKey;if(n){var r=this.manager.renderer.game.cache.shader.get(n);r&&r.glsl&&(i=r.glsl)}}i||(i=o);var s=e.fragmentSource;if(!s){var a=e.fragmentKey;a&&(r=this.manager.renderer.game.cache.shader.get(a))&&r.glsl&&(s=r.glsl)}return s||(s=l),{name:e.name||"ShaderQuad",shaderName:e.shaderName||e.name||"ShaderQuad",vertexSource:i,fragmentSource:s,shaderAdditions:e.shaderAdditions||[],vertexBufferLayout:{usage:"DYNAMIC_DRAW",count:4,layout:[{name:"inPosition",size:2,type:t.FLOAT,normalized:!1},{name:"inTexCoord",size:2,type:t.FLOAT,normalized:!1}]}}},run:function(e,t,i){var n=this.manager,r=this.renderer;n.startStandAloneRender(),this.onRunBegin(e);var s,a,o,l,h,u,c,d,f=t.width,p=t.height;if(this._texturerProxy.frame.realWidth=f,this._texturerProxy.frame.realHeight=p,this._texturerProxy.frameWidth=f,this._texturerProxy.frameHeight=p,t.renderToTexture)s=0,a=0,o=0,l=p,h=f,u=p,c=f,d=0;else{var m=this.transformerNode;m.run(e,t,this._texturerProxy,i);var g=m.quad;s=g[0],a=g[1],o=g[2],l=g[3],h=g[4],u=g[5],c=g[6],d=g[7]}var v=this.vertexBufferLayout.layout.stride,y=this.vertexBufferLayout.buffer,x=y.viewF32,b=0;x[b++]=o,x[b++]=l,x[b++]=t.textureCoordinateBottomLeft.x,x[b++]=t.textureCoordinateBottomLeft.y,x[b++]=s,x[b++]=a,x[b++]=t.textureCoordinateTopLeft.x,x[b++]=t.textureCoordinateTopLeft.y,x[b++]=h,x[b++]=u,x[b++]=t.textureCoordinateBottomRight.x,x[b++]=t.textureCoordinateBottomRight.y,x[b++]=c,x[b++]=d,x[b++]=t.textureCoordinateTopRight.x,x[b++]=t.textureCoordinateTopRight.y,y.update(4*v);var w=this.programManager;this.updateShaderConfig(e,t,this);var T=w.getCurrentProgramSuite();if(T){var _=T.program,S=T.vao,E=this.setUniform;r.setProjectionMatrixFromDrawingContext(e),E("uProjectionMatrix",e.renderer.projectionMatrix.val),t.setupUniforms(E,e),w.applyUniforms(_),r.drawElements(e,this.setupTextures(t),_,S,4,0)}this.onRunEnd(e)},setupTextures:function(e){for(var t=e.textures,i=[],n=0;n<t.length;n++){var r=t[n].get().source.glTexture;i.push(r)}return i},updateShaderConfig:function(e,t,i){}});e.exports=h},17486(e,t,i){var n=i(83419),r=i(6141),s=new n({Extends:r,initialize:function(e){r.call(this,"StrokePath",e),this.drawLineNode=this.manager.getNode("DrawLine")},run:function(e,t,i,n,r,s,a,o,l,h,u,c){this.onRunBegin(e);var d,f,p=this.drawLineNode,m=i.length-1,g=!1,v=!1;n>2&&m>1&&(g=!0,r||(v=!0));for(var y,x,b,w,T,_,S,E,C=[],A=0,k=[],R=0,O=[],P=0,M=u*u,N=0;N<m;N+=E){if(_=0===N,S=N===m-1,E=1,d=i[N],f=i[N+E],M&&!S)for(x=f.x-d.x,b=f.y-d.y,w=s.getX(x,b)-s.tx,T=s.getY(x,b)-s.ty;N+E<m-1&&w*w+T*T<=M;)x=(f=i[N+ ++E]).x-d.x,b=f.y-d.y,w=s.getX(x,b)-s.tx,T=s.getY(x,b)-s.ty;p.run(e,s,d.x,d.y,f.x,f.y,d.width/2,f.width/2,k),y=(R+=8)/2,O[P++]=a,O[P++]=l,O[P++]=h,O[P++]=o,C[A++]=y-4,C[A++]=y-3,C[A++]=y-2,C[A++]=y-2,C[A++]=y-1,C[A++]=y-4,g&&!_&&(C[A++]=y-4,C[A++]=y-3,C[A++]=y-6,C[A++]=y-6,C[A++]=y-5,C[A++]=y-4,v&&S&&(C[A++]=y-2,C[A++]=y-1,C[A++]=0,C[A++]=0,C[A++]=1,C[A++]=y-2))}t.batch(e,C,k,O,c),this.onRunEnd(e)}});e.exports=s},95433(e,t,i){var n=i(83419),r=i(6141),s=new n({Extends:r,initialize:function(e){r.call(this,"YieldContext",e),this._state={blend:this.manager.renderer.blendModes[0],vao:null}},run:function(e){this.onRunBegin(e);var t=this.manager,i=t.renderer;t.startStandAloneRender(),i.glWrapper.update(this._state),i.glTextureUnits.unbindAllUnits(),this.onRunEnd(e)}});e.exports=s},70972(e,t,i){var n=new(i(90330))([["Submitter","SubmitterQuad"],["BatchHandler","BatchHandlerQuad"]]);e.exports=n},98682(e,t,i){var n=new(i(90330))([["Submitter","SubmitterQuad"],["BatchHandler","BatchHandlerQuad"]]);e.exports=n},87891(e,t,i){var n=new(i(90330))([["Submitter","BatchHandlerTriFlat"],["FillPath","FillPath"],["FillRect","FillRect"],["FillTri","FillTri"],["StrokePath","StrokePath"]]);e.exports=n},40939(e,t,i){var n=new(i(90330))([["Submitter","SubmitterQuad"],["BatchHandler","BatchHandlerQuad"],["Transformer","TransformerImage"],["Texturer","TexturerImage"]]);e.exports=n},2389(e,t,i){var n=new(i(90330))([["Submitter","SubmitterMeshToQuad"],["BatchHandler","BatchHandlerQuad"],["BatchHandlerTriangles","BatchHandlerTri"],["Transformer","TransformerVertex"]]);e.exports=n},68668(e,t,i){var n=new(i(90330))([["Submitter","SubmitterQuad"],["BatchHandler","BatchHandlerQuad"]]);e.exports=n},43246(e,t,i){var n=new(i(90330))([["BatchHandler","BatchHandlerPointLight"]]);e.exports=n},30529(e,t,i){var n=new(i(90330))([["BatchHandler","BatchHandlerQuad"]]);e.exports=n},85760(e,t,i){var n=new(i(90330))([["BatchHandler","BatchHandlerStrip"]]);e.exports=n},78705(e,t,i){var n=new(i(90330))([["Submitter","SubmitterQuad"],["BatchHandler","BatchHandlerQuad"],["Transformer","TransformerStamp"],["Texturer","TexturerImage"]]);e.exports=n},41571(e,t,i){var n=new(i(90330))([["Submitter","SubmitterTileSprite"],["BatchHandler","BatchHandlerTileSprite"],["Transformer","TransformerTileSprite"],["Texturer","TexturerTileSprite"]]);e.exports=n},67743(e,t,i){var n=new(i(90330))([["Submitter","SubmitterTilemapGPULayer"]]);e.exports=n},79317(e,t,i){var n=new(i(90330))([["Submitter","SubmitterTile"],["BatchHandler","BatchHandlerTileSprite"],["Transformer","TransformerTile"]]);e.exports=n},59212(e,t,i){var n={DefaultBitmapTextNodes:i(70972),DefaultBlitterNodes:i(98682),DefaultGraphicsNodes:i(87891),DefaultImageNodes:i(40939),DefaultParticleEmitterNodes:i(68668),DefaultPointLightNodes:i(43246),DefaultQuadNodes:i(30529),DefaultRopeNodes:i(85760),DefaultStampNodes:i(78705),DefaultTilemapGPULayerNodes:i(67743),DefaultTilemapLayerNodes:i(79317),DefaultTileSpriteNodes:i(41571)};e.exports=n},47406(e,t,i){var n=i(83419),r=i(6141),s=new n({Extends:r,initialize:function(e,t){r.call(this,e,t)},run:function(e,t,i,n){}});e.exports=s},53663(e,t,i){var n=i(83419),r=i(2807),s=i(99501),a=i(56436),o=i(40952),l=i(47406),h=new n({Extends:l,initialize:function(e,t,i,n,h){if(!n){var u=t.renderer.game.cache.shader.get(i);if(!u||!u.glsl)throw new Error("BaseFilterShader: No fragment shader source provided and no shader found with key "+i);n=u.glsl}l.call(this,e,t);var c=t.renderer,d=c.gl,f={name:e,shaderName:e,vertexSource:r,fragmentSource:n,shaderAdditions:h||[],vertexBufferLayout:{usage:"DYNAMIC_DRAW",count:4,layout:[{name:"inPosition",size:2,type:d.FLOAT,normalized:!1},{name:"inTexCoord",size:2,type:d.FLOAT,normalized:!1}]}};f.shaderAdditions.push(s()),this.indexBuffer=c.genericQuadIndexBuffer,this.vertexBufferLayout=new o(c,f.vertexBufferLayout,null),this.programManager=new a(c,[this.vertexBufferLayout],this.indexBuffer),this.programManager.setBaseShader(f.shaderName,f.vertexSource,f.fragmentSource);for(var p=0;p<f.shaderAdditions.length;p++){var m=f.shaderAdditions[p];this.programManager.addAddition(m)}this.programManager.setUniform("uMainSampler",0)},run:function(e,t,i,n){var r=this.manager,s=r.renderer;r.startStandAloneRender(),n||(n=e.getPaddingCeil()),i||(i=s.drawingContextPool.get(t.width+n.width,t.height+n.height)),i.use(),this.onRunBegin(i);var a=[t.texture];this.setupTextures(e,a,i);var o=-1,l=-1,h=-1,c=1,d=1,f=1,p=1,m=-1;if(n.left){var g=2*n.left/i.width;o-=g,h-=g}if(n.right){var v=2*n.right/i.width;p-=v,d-=v}if(n.top){var y=2*n.top/i.height;c+=y,f+=y}if(n.bottom){var x=2*n.bottom/i.height;l+=x,m+=x}var b=this.vertexBufferLayout.layout.stride,w=this.vertexBufferLayout.buffer,T=w.viewF32,_=0;T[_++]=-1,T[_++]=-1,T[_++]=u(0,o,p),T[_++]=u(0,l,m),T[_++]=-1,T[_++]=1,T[_++]=u(0,h,d),T[_++]=u(1,c,f),T[_++]=1,T[_++]=-1,T[_++]=u(1,o,p),T[_++]=u(0,l,m),T[_++]=1,T[_++]=1,T[_++]=u(1,h,d),T[_++]=u(1,c,f),w.update(4*b);var S=this.programManager;this.updateShaderConfig(e,i);var E=S.getCurrentProgramSuite();if(E){var C=E.program,A=E.vao;this.setupUniforms(e,i),S.applyUniforms(C),s.drawElements(i,a,C,A,4,0)}return t.release(),this.onRunEnd(i),i},updateShaderConfig:function(e,t){},setupTextures:function(e,t,i){},setupUniforms:function(e,t){}});function u(e,t,i){return(t=.5*(1/t+1))+e*((i=.5*(1/i+1))-t)}e.exports=h},22731(e,t,i){var n=i(83419),r=i(53663),s=i(10235),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterBarrel",e,null,s)},setupUniforms:function(e,t){this.programManager.setUniform("amount",e.amount)}});e.exports=a},57032(e,t,i){var n=i(90330),r=i(83419),s=i(10312),a=i(53663),o=i(65980),l=new r({Extends:a,initialize:function(e){this._blendModeMap=new n;var t=this._blendModeMap;Object.entries(s).forEach(function(e){t.set(e[1],e[0])});var i=t.get(s.NORMAL),r=[{name:i,additions:{fragmentHeader:"#define BLEND "+i},tags:["blendmode"]}];a.call(this,"FilterBlend",e,null,o,r)},updateShaderConfig:function(e,t){var i=e.blendMode;i===s.SKIP_CHECK&&(i=s.NORMAL);var n=this._blendModeMap.get(i)||this._blendModeMap.get(s.NORMAL),r=this.programManager.getAdditionsByTag("blendmode")[0];r.name=n,r.additions.fragmentHeader="#define BLEND "+n},setupTextures:function(e,t,i){t[1]=e.glTexture},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("uMainSampler2",1),i.setUniform("amount",e.amount),i.setUniform("color",e.color)}});e.exports=l},52903(e,t,i){var n=i(83419),r=i(53663),s=i(5899),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterBlocky",e,null,s)},setupUniforms:function(e,t){var i=this.programManager,n=Math.max(1,e.size.x),r=Math.max(1,e.size.y);i.setUniform("resolution",[t.width,t.height]),i.setUniform("uSizeAndOffset",[n,r,e.offset.x,e.offset.y])}});e.exports=a},13922(e,t,i){var n=i(87841),r=i(83419),s=i(47406),a=new r({Extends:s,initialize:function(e){s.call(this,"FilterBlur",e)},run:function(e,t,i,r){this.onRunBegin(i);var s=e.quality,a=e.steps,o=null;switch(s){case 2:o=this.manager.getNode("FilterBlurHigh");break;case 1:o=this.manager.getNode("FilterBlurMed");break;default:o=this.manager.getNode("FilterBlurLow")}var l={strength:e.strength,color:e.glcolor,x:e.x,y:e.y};r||(r=e.getPaddingCeil());for(var h=t,u=0;u<a;u++){l.x=e.x,l.y=0,h=o.run(l,h,null,r),0===u&&(r=new n);var c=u===a-1?i:null;l.x=0,l.y=e.y,h=o.run(l,h,c,r)}return i=h,this.onRunEnd(i),i}});e.exports=a},33466(e,t,i){var n=i(83419),r=i(53663),s=i(20784),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterBlurHigh",e,null,s)},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("resolution",[t.width,t.height]),i.setUniform("strength",e.strength),i.setUniform("color",e.color),i.setUniform("offset",[e.x,e.y])}});e.exports=a},75798(e,t,i){var n=i(83419),r=i(53663),s=i(65122),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterBlurLow",e,null,s)},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("resolution",[t.width,t.height]),i.setUniform("strength",e.strength),i.setUniform("color",e.color),i.setUniform("offset",[e.x,e.y])}});e.exports=a},90830(e,t,i){var n=i(83419),r=i(53663),s=i(60942),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterBlurMed",e,null,s)},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("resolution",[t.width,t.height]),i.setUniform("strength",e.strength),i.setUniform("color",e.color),i.setUniform("offset",[e.x,e.y])}});e.exports=a},52302(e,t,i){var n=i(83419),r=i(53663),s=i(43722),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterBokeh",e,null,s)},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("radius",e.radius),i.setUniform("amount",e.amount),i.setUniform("contrast",e.contrast),i.setUniform("strength",e.strength),i.setUniform("blur",[e.blurX,e.blurY]),i.setUniform("isTiltShift",e.isTiltShift),i.setUniform("resolution",[t.width,t.height])}});e.exports=a},34989(e,t,i){var n=i(83419),r=i(53663),s=i(19883),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterColorMatrix",e,null,s)},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("uColorMatrix[0]",e.colorMatrix.getData()),i.setUniform("uAlp
2ha",e.colorMatrix.alpha)}});e.exports=a},91614(e,t,i){var n=i(83419),r=i(53663),s=i(32624),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterCombineColorMatrix",e,null,s)},setupTextures:function(e,t,i){t[1]=e.glTexture},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("uTransferSampler",1),i.setUniform("uColorMatrixSelf[0]",e.colorMatrixSelf.getData()),i.setUniform("uColorMatrixTransfer[0]",e.colorMatrixTransfer.getData()),i.setUniform("uAlphaSelf",e.colorMatrixSelf.alpha),i.setUniform("uAlphaTransfer",e.colorMatrixTransfer.alpha),i.setUniform("uAdditions",e.additions),i.setUniform("uMultiplications",e.multiplications)}});e.exports=a},15600(e,t,i){var n=i(83419),r=i(53663),s=i(12886),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterDisplacement",e,null,s)},setupTextures:function(e,t){t[1]=e.glTexture},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("uDisplacementSampler",1),i.setUniform("amount",[e.x,e.y])}});e.exports=a},99786(e,t,i){var n=i(83419),r=i(53663),s=i(33016),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterGlow",e,null,s,[{name:"distance_10.0",additions:{fragmentDefine:"#define DISTANCE 10.0"},tags:["distance"]},{name:"quality_0.1",additions:{fragmentDefine:"#define QUALITY 0.1"},tags:["quality"]}])},updateShaderConfig:function(e,t){var i=this.programManager,n=e.distance.toFixed(0)+".0",r=i.getAdditionsByTag("distance")[0];r.name="distance_"+n,r.additions.fragmentDefine="#undef DISTANCE\n#define DISTANCE "+n;var s=e.quality.toFixed(0)+".0",a=i.getAdditionsByTag("quality")[0];a.name="quality_"+s,a.additions.fragmentDefine="#undef QUALITY\n#define QUALITY "+s},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("resolution",[t.width,t.height]),i.setUniform("glowColor",e.glcolor),i.setUniform("outerStrength",e.outerStrength),i.setUniform("innerStrength",e.innerStrength),i.setUniform("scale",e.scale),i.setUniform("knockout",e.knockout)}});e.exports=a},26825(e,t,i){var n=i(83419),r=i(53663),s=i(33179),a=i(68589),o=new n({Extends:r,initialize:function(e){var t=[{name:"RAMP_0",tags:"RAMP",additions:{fragmentHeader:a}}];r.call(this,"FilterGradientMap",e,null,s,t)},setupTextures:function(e,t,i){t[1]=e.ramp.glTexture},setupUniforms:function(e,t){var i=this.programManager,n=e.ramp;i.setUniform("uRampTexture",1),i.setUniform("uRampResolution",n.dataTextureResolution),i.setUniform("uRampBandStart",n.dataTextureFirstBand),i.setUniform("uDither",e.dither),i.setUniform("uUnpremultiply",e.unpremultiply),i.setUniform("uColor",e.color),i.setUniform("uColorFactor",e.colorFactor),i.setUniform("uAlpha",e.alpha)},updateShaderConfig:function(e,t){var i=e.ramp.bandTreeDepth,n=this.programManager.getAdditionsByTag("RAMP")[0];n.name="RAMP_"+i,n.additions.fragmentHeader=a.replace("#define BAND_TREE_DEPTH 0.0","#define BAND_TREE_DEPTH "+i+".0")}});e.exports=o},54900(e,t,i){var n=i(83419),r=i(53663),s=i(94526),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterImageLight",e,null,s)},setupTextures:function(e,t,i){t[1]=e.environmentGlTexture,t[2]=e.normalGlTexture},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("uEnvSampler",1),i.setUniform("uNormSampler",2),i.setUniform("uViewMatrix",e.viewMatrix.val),i.setUniform("uModelRotation",e.getModelRotation()),i.setUniform("uBulge",e.bulge),i.setUniform("uColorFactor",e.colorFactor)}});e.exports=a},34652(e,t,i){var n=i(83419),r=i(53663),s=i(4488),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterKey",e,null,s)},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("uColor",e.color),i.setUniform("uIsolateThresholdFeather",[e.isolate,e.threshold,e.feather])}});e.exports=a},26703(e,t,i){var n=i(83419),r=i(53663),s=i(39603),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterMask",e,null,s)},setupTextures:function(e,t,i){e.maskGameObject&&(e.needsUpdate||e.autoUpdate)&&e.updateDynamicTexture(i.width,i.height),t[1]=e.glTexture},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("uMaskSampler",1),i.setUniform("invert",e.invert)}});e.exports=a},56165(e,t,i){var n=i(83419),r=i(53663),s=i(60047),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterNormalTools",e,null,s,[{name:"view",additions:{fragmentHeader:"#define VIEW_MATRIX"},tags:["header"]}])},updateShaderConfig:function(e,t){var i=this.programManager.getAdditionsByTag("header")[0];i.name="view",i.additions.fragmentHeader="#define VIEW_MATRIX",1!==e.facingPower&&(i.name+="_facingPower",i.additions.fragmentHeader+="\
2n#define FACING_POWER"),e.outputRatio&&(i.name+="_ratio",i.additions.fragmentHeader+="\n#define OUTPUT_RATIO")},setupUniforms:function(e,t){var i=this.programManager;if(i.setUniform("uViewMatrix",e.viewMatrix.val),1!==e.facingPower&&i.setUniform("uFacingPower",e.facingPower),e.outputRatio){var n=e.ratioVector;i.setUniform("uRatioVector",[n.x,n.y,n.z]),i.setUniform("uRatioRadius",e.ratioRadius)}}});e.exports=a},40305(e,t,i){var n=i(83419),r=i(53663),s=i(7529),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterPanoramaBlur",e,null,s,[{name:"samples_32_16",additions:{fragmentHeader:"#define SAMPLES_X 32.0\n#define SAMPLES_Y 16.0"},tags:["samples"]}])},updateShaderConfig:function(e,t){var i=e.samplesX.toFixed(0),n=e.samplesY.toFixed(0),r=this.programManager.getAdditionsByTag("samples")[0];r.name="samples_"+i+"_"+n,r.additions.fragmentHeader="#define SAMPLES_X "+i+".0\n#define SAMPLES_Y "+n+".0"},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("uRadius",e.radius),i.setUniform("uPower",e.power)}});e.exports=a},55905(e,t,i){var n=i(87841),r=i(83419),s=i(10312),a=i(47406),o=new r({Extends:a,initialize:function(e){a.call(this,"FilterParallelFilters",e)},run:function(e,t,i,r){this.onRunBegin(i),t.lock(this);var a=e.bottom.getActive(),o=e.top.getActive(),l=r||e.getPaddingCeil();if(a.length+o.length>0){var h=t,u=t;if(a.length>0){r=l;for(var c=0;c<a.length;c++){var d=a[c],f=this.manager.getNode(d.renderNode);h=f.run(d,h,null,r),0===c&&c<a.length-1&&(r=new n)}}if(o.length>0)for(r=l,c=0;c<o.length;c++)d=o[c],u=(f=this.manager.getNode(d.renderNode)).run(d,u,null,r),0===c&&c<o.length-1&&(r=new n);t.unlock(this),t!==h&&t!==u&&t.release(),e.blend.glTexture=u.texture,f=this.manager.getNode("FilterBlend"),i=this.manager.getNode("FilterBlend").run(e.blend,h,i,r),u.release()}else{f=this.manager.getNode("FilterBlend");var p={blendMode:s.COPY,glTexture:t.texture,amount:1,color:[1,1,1,1]};t.unlock(this),i=f.run(p,t,i,l)}return this.onRunEnd(i),i}});e.exports=o},58167(e,t,i){var n=i(83419),r=i(53663),s=i(99191),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterPixelate",e,null,s)},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("amount",e.amount),i.setUniform("resolution",[t.width,t.height])}});e.exports=a},40752(e,t,i){var n=i(83419),r=i(53663),s=i(88430),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterQuantize",e,null,s)},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("uSteps",e.steps),i.setUniform("uGamma",e.gamma),i.setUniform("uOffset",e.offset),i.setUniform("uMode",e.mode),i.setUniform("uDither",e.dither)}});e.exports=a},13279(e,t,i){var n=i(83419),r=i(47406),s=new n({Extends:r,initialize:function(e){r.call(this,"FilterSampler",e)},run:function(e,t,i,n){this.onRunBegin(t);var r=this.manager.renderer,s=0,a=0,o=1,l=1,h=t.width,u=t.height,c=!1;return e.region?(s=e.region.x,a=e.region.y,void 0!==e.region.width?(o=e.region.width,l=e.region.height):c=!0):(o=h,l=u),r.snapshotFramebuffer(t.framebuffer,h,u,e.callback,c,s,a,o,l),this.onRunEnd(t),t}});e.exports=s},27459(e,t,i){var n=i(83419),r=i(53663),s=i(69355),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterShadow",e,null,s)},setupUniforms:function(e,t){var i=this.programManager,n=e.samples;i.setUniform("lightPosition",[e.x,1-e.y]),i.setUniform("decay",e.decay),i.setUniform("power",e.power/n),i.setUniform("color",e.glcolor),i.setUniform("samples",n),i.setUniform("intensity",e.intensity)}});e.exports=a},88856(e,t,i){var n=i(83419),r=i(53663),s=i(92636),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterThreshold",e,null,s)},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("edge1",e.edge1),i.setUniform("edge2",e.edge2),i.setUniform("invert",e.invert)}});e.exports=a},10845(e,t,i){var n=i(83419),r=i(53663),s=i(18185),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterVignette",e,null,s)},setupUniforms:function(e,t){var i=this.programManager,n=e.color;i.setUniform("uRadius",e.radius),i.setUniform("uStrength",e.strength),i.setUniform("uPosition",[e.x,e.y]),i.setUniform("uColor",[n.redGL,n.greenGL,n.blueGL,n.alphaGL]),i.setUniform("uBlendMode",e.blendMode)}});e.exports=a},99184(e,t,i){var n=i(83419),r=i(53663),s=i(99174),a=new n({Extends:r,initialize:function(e){r.call(this,"FilterWipe",e,null,s)},setupTextures:function(e,t,i){t[1]=e.wipeTexture.get().glTexture},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("uMainSampler2",1),i.setUniform("uProgress_WipeWidth_Direction_Axis",[e.progress,e.wipeWidth,e.direction,e.axis]),i.setUniform("uReveal",e.reveal)}});e.exports=a},54521(e,t,i){var n={BaseFilter:i(47406),BaseFilterShader:i(53663),BatchHandler:i(13961),BatchHandlerPointLight:i(16971),BatchHandlerQuad:i(15214),BatchHandlerQuadSingle:i(72266),BatchHandlerStrip:i(62791),BatchHandlerTileSprite:i(21832),BatchHandlerTri:i(59444),BatchHandlerTriFlat:i(62087),Camera:i(61842),Defaults:i(59212),DrawLine
vendor: 15,357 bytes, line 2
2:i(76409),DynamicTextureHandler:i(95449),FillCamera:i(61199),FillPath:i(14255),FillRect:i(12682),FillTri:i(13119),FilterBarrel:i(22731),FilterBlend:i(57032),FilterBlur:i(13922),FilterBlurHigh:i(33466),FilterBlurLow:i(75798),FilterBlurMed:i(90830),FilterBokeh:i(52302),FilterColorMatrix:i(34989),FilterCombineColorMatrix:i(91614),FilterDisplacement:i(15600),FilterGlow:i(99786),FilterGradientMap:i(26825),FilterImageLight:i(54900),FilterKey:i(34652),FilterMask:i(26703),FilterNormalTools:i(56165),FilterPanoramaBlur:i(40305),FilterParallelFilters:i(55905),FilterPixelate:i(58167),FilterQuantize:i(40752),FilterSampler:i(13279),FilterShadow:i(27459),FilterThreshold:i(88856),FilterVignette:i(10845),FilterWipe:i(99184),ListCompositor:i(27996),RebindContext:i(56432),RenderNode:i(6141),StrokePath:i(17486),SubmitterMeshToQuad:i(68517),SubmitterQuad:i(31029),SubmitterSpriteGPULayer:i(53384),SubmitterTile:i(94494),SubmitterTilemapGPULayer:i(87469),SubmitterTileSprite:i(89723),TexturerImage:i(12913),TexturerTileSprite:i(22995),TransformerImage:i(86081),TransformerStamp:i(88383),TransformerTile:i(34454),TransformerTileSprite:i(46211),TransformerVertex:i(64552),YieldContext:i(95433)};e.exports=n},68517(e,t,i){var n=i(26099),r=i(83419),s=i(46975),a=i(70554),o=i(31029),l=a.getTintAppendFloatAlpha,h=new r({Extends:o,initialize:function(e,t){t=s(t||{},this.defaultConfig),o.call(this,e,t),this._tempPoint=new n},defaultConfig:{name:"SubmitterMeshToQuad",role:"Submitter",batchHandler:"BatchHandler"},run:function(e,t,i,n,r,s){this.onRunBegin(e),n.setupMatrix(e,t,i);if(t.useOrderedIndices&&t.indicesOrdered){for(var a=t.indicesOrdered,o=0;o<a.length;o+=8)this._submitQuad(a[o],a[o+1],a[o+2],a[o+6],a[o+3],e,t,i,n,r,s);this.onRunEnd(e)}else{for(var l=t.indices,h=0;h<l.length;h+=4)this._submitQuad(l[h],l[h+1],l[h+2],l[h+2],l[h+3],e,t,i,n,r,s);this.onRunEnd(e)}},_submitQuad:function(e,t,i,n,r,s,a,o,h,u,c){var d=a.vertices[4*e],f=a.vertices[4*e+1],p=a.vertices[4*e+2],m=a.vertices[4*e+3],g=a.vertices[4*t],v=a.vertices[4*t+1],y=a.vertices[4*t+2],x=a.vertices[4*t+3],b=a.vertices[4*i],w=a.vertices[4*i+1],T=a.vertices[4*i+2],_=a.vertices[4*i+3],S=a.vertices[4*n],E=a.vertices[4*n+1],C=a.vertices[4*n+2],A=a.vertices[4*n+3];a.flipV&&(m=1-m,x=1-x,_=1-_,A=1-A);var k=a.tintMode,R=l(a.tint,a.alpha),O=a.tint2,P=this._tempPoint;P.set(d,f),h.transformVertex(P),d=P.x,f=P.y,P.set(g,v),h.transformVertex(P),g=P.x,v=P.y,P.set(b,w),h.transformVertex(P),b=P.x,w=P.y,P.set(S,E),h.transformVertex(P),S=P.x,E=P.y,this.setRenderOptions(a,u,c),(a.customRenderNodes[this.batchHandler]||a.defaultRenderNodes[this.batchHandler]).batchWithUV(s,a.texture.source[r].glTexture,d,f,g,v,b,w,S,E,p,m,y,x,T,_,C,A,k,R,R,R,R,this._renderOptions,O,O,O,O)}});e.exports=h},31029(e,t,i){var n=i(83419),r=i(46975),s=i(70554),a=i(6141),o=s.getTintAppendFloatAlpha,l=new n({Extends:a,initialize:function(e,t){t=r(t||{},this.defaultConfig),a.call(this,t.name,e),this.batchHandler=t.batchHandler,this._renderOptions={multiTexturing:!0,lighting:null,smoothPixelArt:null},this._lightingOptions={normalGLTexture:null,normalMapRotation:0,selfShadow:{enabled:!1,penumbra:0,diffuseFlatThreshold:0}}},defaultConfig:{name:"SubmitterQuad",role:"Submitter",batchHandler:"BatchHandler"},run:function(e,t,i,n,r,s,a,l,h){var u,c,d,f,p,m,g,v,y;this.onRunBegin(e),r.run&&r.run(e,t,n),s.run&&s.run(e,t,r,i,n),a?(a.run&&a.run(e,t,n),u=a.tintEffect,c=a.tintTopLeft,d=a.tintBottomLeft,f=a.tintTopRight,p=a.tintBottomRight,m=a.tint2TopLeft,g=a.tint2BottomLeft,v=a.tint2TopRight,y=a.tint2BottomRight):(u=t.tintMode,c=o(t.tintTopLeft,t._alphaTL),d=o(t.tintBottomLeft,t._alphaBL),f=o(t.tintTopRight,t._alphaTR),p=o(t.tintBottomRight,t._alphaBR),m=t.tint2TopLeft,g=t.tint2BottomLeft,v=t.tint2TopRight,y=t.tint2BottomRight);var x=s.quad,b=r.uvSource,w=b.u0,T=b.v0,_=b.u1,S=b.v1;this.setRenderOptions(t,l,h),(t.customRenderNodes[this.batchHandler]||t.defaultRenderNodes[this.batchHandler]).batch(e,r.frame.source.glTexture,x[0],x[1],x[2],x[3],x[6],x[7],x[4],x[5],w,T,_-w,S-T,u,c,d,f,p,this._renderOptions,m,g,v,y),this.onRunEnd(e)},setRenderOptions:function(e,t,i){var n,r,s,a=this._renderOptions;if(e.displayTexture?(n=e.displayTexture,r=e.displayFrame.sourceIndex):e.texture?(n=e.texture,r=e.frame.sourceIndex):e.tileset&&(n=Array.isArray(e.tileset)?e.tileset[0].image:e.tileset.image,r=0),e.lighting){if(t||n&&(t=n.dataSource[r]),t=t?t.glTexture:this.manager.renderer.normalTexture,isNaN(i))if(i=e.rotation,e.parentContainer)i=e.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2).rotationNormalized;var o=e.selfShadow,l=o.enabled;null===l&&(l=e.scene.sys.game.config.selfShadow),this._lightingOptions.normalGLTexture=t,this._lightingOptions.normalMapRotation=i,this._lightingOptions.selfShadow.enabled=l,this._lightingOptions.selfShadow.penumbra=o.penumbra,this._lightingOptions.selfShadow.diffuseFlatThreshold=o.diffuseFlatThreshold,a.lighting=this._lightingOptions}else a.lighting=null;s=n&&null!==n.smoothPixelArt?n.smoothPixelArt:e.scene.sys.game.config.smoothPixelArt,a.smoothPixelArt=s}});e.exports=l},53384(e,t,i){var n=i(61340),r=i(26099),s=i(83419),a=i(46975),o=i(56436),l=i(94158),h=i(81084),u=i(44349),c=i(6184),d=i(11653),f=i(40829),p=i(42792),m=i(96049),g=i(33997),v=i(79532),y=i(74505),x=i(70554),b=i(40952),w=i(6141),T=i(49119),_=i(3524),S=new s({Extends:w,initialize:function(e,t,i){var s=e.renderer,l=a(t||{},this.defaultConfig),h=l.name;this._completeLayout(l),w.call(this,h,e),this.config=l,this.gameObject=i,this.instanceBufferLayout=new b(s,l.instanceBufferLayout,null),this.vertexBufferLayout=new b(s,l.vertexBufferLayout,null);var u=this.vertexBufferLayout.buffer,c=u.viewU8;if(c[0]=0,c[1]=1,c[2]=2,c[3]=3,u.update(),this.programManager=new o(s,[this.vertexBufferLayout,this.instanceBufferLayout],this.indexBuffer),this.programManager.setBaseShader(l.shaderName,l.vertexSource,l.fragmentSource),l.shaderAdditions)for(var d=0;d<l.shaderAdditions.length;d++){var f=l.shaderAdditions[d];this.programManager.addAddition(f)}if(l.shaderFeatures)for(d=0;d<l.shaderFeatures.length;d++)this.programManager.addFeature(l.shaderFeatures[d]);this._calcMatrix=new n,this._lightVector=new r},defaultConfig:{name:"SubmitterSpriteGPULayer",count:0,shaderName:"SpriteGPULayer",vertexSource:_,fragmentSource:T,shaderAdditions:[p(),m(),y(!0),d(1),g(),u(),c(!0),v(!0),f(!0),h(!0),l(!0)],instanceBufferLayout:{usage:"STATIC_DRAW",instanceDivisor:1,layout:[{name:"inPositionX",size:4},{name:"inPositionY",size:4},{name:"inRotation",size:4},{name:"inScaleX",size:4},{name:"inScaleY",size:4},{name:"inAlpha",size:4},{name:"inFrame",size:4},{name:"inTintBlend",size:4},{name:"inTintBL",size:4,type:"UNSIGNED_BYTE",normalized:!0},{name:"inTintTL",size:4,type:"UNSIGNED_BYTE",normalized:!0},{name:"inTintBR",size:4,type:"UNSIGNED_BYTE",normalized:!0},{name:"inTintTR",size:4,type:"UNSIGNED_BYTE",normalized:!0},{name:"inOriginAndTintModeAndCreationTime",size:4},{name:"inScrollFactor",size:2}]},vertexBufferLayout:{usage:"STATIC_DRAW",count:4,layout:[{name:"inVertex",type:"UNSIGNED_BYTE"}]}},_completeLayout:function(e){var t=e.vertexBufferLayout;e.vertexBufferLayout={},e.vertexBufferLayout.usage=t.usage,e.vertexBufferLayout.count=t.count,e.vertexBufferLayout.layout=[];for(var i=e.vertexBufferLayoutRemove||[],n=0;n<t.layout.length;n++){var r=t.layout[n];-1===i.indexOf(r.name)&&(e.vertexBufferLayout.layout[n]={name:r.name,size:r.size||1,type:r.type||"FLOAT",normalized:r.normalized||!1})}if(e.vertexBufferLayoutAdd){var s=e.vertexBufferLayoutAdd||[];for(n=0;n<s.length;n++){var a=s[n];e.vertexBufferLayout.layout.push({name:a.name,size:a.size||1,type:a.type||"FLOAT",normalized:a.normalized||!1})}}for(t=e.instanceBufferLayout,e.instanceBufferLayout={},e.instanceBufferLayout.usage=t.usage,e.instanceBufferLayout.instanceDivisor=t.instanceDivisor,e.instanceBufferLayout.layout=[],i=e.instanceBufferLayoutRemove||[],n=0;n<t.layout.length;n++)r=t.layout[n],-1===i.indexOf(r.name)&&(e.instanceBufferLayout.layout[n]={name:r.name,size:r.size||1,type:r.type||"FLOAT",normalized:r.normalized||!1});if(e.instanceBufferLayoutAdd)for(s=e.instanceBufferLayoutAdd||[],n=0;n<s.length;n++)a=s[n],e.instanceBufferLayout.layout.push({name:a.name,size:a.size||1,type:a.type||"FLOAT",normalized:a.normalized||!1})},setupUniforms:function(e){var t=e.camera,i=this.programManager,n=this.gameObject;i.setUniform("uRoundPixels",t.roundPixels),i.setUniform("uResolution",[e.width,e.height]),e.renderer.setProjectionMatrixFromDrawingContext(e),i.setUniform("uProjectionMatrix",e.renderer.projectionMatrix.val);var r=t.matrixCombined;i.setUniform("uViewMatrix",[r.a,r.b,0,r.c,r.d,0,r.tx,r.ty,1]),i.setUniform("uCameraScrollAndAlpha",[t.scrollX,t.scrollY,n.alpha]),i.setUniform("uTime",n.timeElapsed),i.setUniform("uDiffuseResolution",[n.frame.source.width,n.frame.source.height]),i.setUniform("uFrameDataResolution",[n.frameDataTexture.width,n.frameDataTexture.height]),i.setUniform("uGravity",n.gravity),i.setUniform("uMainSampler[0]",0),i.setUniform("uFrameDataTexture",1);var s=n.texture.source[0].glTexture;i.setUniform("uMainResolution[0]",[s.width,s.height]),x.updateLightingUniforms(n.lighting,e,i,2,this._lightVector,n.selfShadow.enabled,n.selfShadow.diffuseFlatThreshold,n.selfShadow.penumbra)},updateRenderOptions:function(e){var t=this.programManager,i=e.alphaStrategy,n=t.getAdditionsByTag("ALPHA_DISCARD")[0];if(n){var r="keep"===i,s="dither"===i,a="number"===typeof i?i:void 0;t.replaceAddition(n.name,l(r,s,a))}for(var o=this.gameObject.lighting,h=t.getAdditionsByTag("LIGHTING"),u=0;u<h.length;u++)h[u].disable=!o;if(o){var c=t.getAddition("DefineLights");c&&(c.additions.fragmentDefine="#define LIGHT_COUNT "+this.manager.renderer.config.maxLights)}var d=t.getAddition("SmoothPixelArt");if(d){var f=this.gameObject.texture.smoothPixelArt;null===f&&(f=this.gameObject.scene.game.config.smoothPixelArt),d.disable=!f}t.clearFeatures();var p=this.gameObject.getShaderFeatures();for(u=0;u<p.length;u++)t.addFeature(p[u]);this.gameObject.selfShadow.enabled&&t.addFeature("SELFSHADOW")},run:function(e){var t,i=this.gameObject;if(0!==i.memberCount){this.manager.startStandAloneRender(),this.onRunBegin(e);var n=i.bufferUpdateSegments;if(n>0){var r=this.instanceBufferLayout.buffer,s=i.memberCount,a=Math.floor(s/i.bufferUpdateSegmentSize),o=!0;for(t=0;t<=a;t++)if(!(1<<t&n)){o=!1;break}if(n===i.MAX_BUFFER_UPDATE_SEGMENTS_FULL||s<=i.bufferUpdateSegmentSize||o)r.update();else{var l=i.bufferUpdateSegmentSize,h=l*this.instanceBufferLayout.layout.stride;for(t=0;t<32&&t*l<s;t++)n&1<<t&&r.update(h,t*h)}i.clearAllSegmentsNeedUpdate()}var u=[i.frame.source.glTexture,i.frameDataTexture];if(i.lighting){var c=i.texture.dataSource[i.frame.sourceIndex];c=c?c.glTexture:this.manager.renderer.normalTexture,u[2]=c}this.updateRenderOptions(e);var d=this.programManager,f=d.getCurrentProgramSuite();if(f){var p=f.program,m=f.vao;this.setupUniforms(e),d.applyUniforms(p),this.manager.renderer.drawInstancedArrays(e,u,p,m,0,4,i.memberCount)}this.onRunEnd(e)}}});e.exports=S},94494(e,t,i){var n=i(83419),r=i(31029),s=new n({Extends:r,initialize:function(e,t){r.call(this,e,t),this._renderOptions.clampFrame=!0},defaultConfig:{name:"SubmitterTile",role:"Submitter",batchHandler:"BatchHandler"},run:function(e,t,i,n,r,s,a,o,l){var h,u,c,d,f,p,m,g,v;if(this.onRunBegin(e),r.run&&r.run(e,t,n),s.run&&s.run(e,t,r,i,n),a)a.run&&a.run(e,t,n),h=a.tintEffect,u=a.tintTopLeft,c=a.tintBottomLeft,d=a.tintTopRight,f=a.tintBottomRight,p=a.tint2TopLeft,m=a.tint2BottomLeft,g=a.tint2TopRight,v=a.tint2BottomRight;else{h=t.tintMode;var y=4294967295;u=y,c=y,d=y,f=y;p=0,m=0,g=0,v=0}var x=r.frame,b=s.quad,w=r.uvSource,T=w.u0,_=w.v0,S=w.u1,E=w.v1;this.setRenderOptions(t,o,l),(t.customRenderNodes[this.batchHandler]||t.defaultRenderNodes[this.batchHandler]).batch(e,x.source.glTexture,b[0],b[1],b[2],b[3],b[6],b[7],b[4],b[5],T,_,S-T,E-_,h,u,c,d,f,this._renderOptions,T,E,T,_,S,E,S,_,p,m,g,v),this.onRunEnd(e)}});e.exports=s},89723(e,t,i){var n=i(83419),r=i(70554),s=i(31029),a=r.getTintAppendFloatAlpha,o=new n({Extends:s,initialize:function(e,t){s.call(this,e,t),this._renderOptions.wrapFrame=!0},defaultConfig:{name:"SubmitterTileSprite",role:"Submitter",batchHandler:"BatchHandler"},run:function(e,t,i,n,r,s,o,l,h){var u,c,d,f,p,m,g,v,y;this.onRunBegin(e),r.run&&r.run(e,t,n),s.run&&s.run(e,t,r,i,n),o?(o.run&&o.run(e,t,n),u=o.tintEffect,c=o.tintTopLeft,d=o.tintBottomLeft,f=o.tintTopRight,p=o.tintBottomRight,m=o.tint2TopLeft,g=o.tint2BottomLeft,v=o.tint2TopRight,y=o.tint2BottomRight):(u=t.tintMode,c=a(t.tintTopLeft,t._alphaTL),d=a(t.tintBottomLeft,t._alphaBL),f=a(t.tintTopRight,t._alphaTR),p=a(t.tintBottomRight,t._alphaBR),m=t.tint2TopLeft,g=t.tint2BottomLeft,v=t.tint2TopRight,y=t.tint2BottomRight);var x=r.frame,b=s.quad,w=x,T=w.u0,_=w.v0,S=w.u1,E=w.v1,C=r.uvMatrix.quad;this.setRenderOptions(t,l,h),this._lightingOptions.normalMapRotation+=t.tileRotation,(t.customRenderNodes[this.batchHandler]||t.defaultRenderNodes[this.batchHandler]).batch(e,x.source.glTexture,b[0],b[1],b[2],b[3],b[6],b[7],b[4],b[5],T,_,S-T,E-_,u,c,d,f,p,this._renderOptions,C[0],C[1],C[2],C[3],C[6],C[7],C[4],C[5],m,g,v,y),this.onRunEnd(e)}});e.exports=o},87469(e,t,i){var n=i(61340),r=i(26099),s=i(83419),a=i(46975),o=i(56436),l=i(84639),h=i(94158),u=i(81084),c=i(6184),d=i(747),f=i(74505),p=i(57532),m=i(23879),g=i(40952),v=i(6141),y=i(70554),x=new s({Extends:v,initialize:function(e,t){var i=e.renderer,s=a(t||{},this.defaultConfig),l=s.name;if(this._completeLayout(s),v.call(this,l,e),this.config=s,this.indexBuffer=i.genericQuadIndexBuffer,this.vertexBufferLayout=new g(i,s.vertexBufferLayout,null),this.programManager=new o(i,[this.vertexBufferLayout],this.indexBuffer),this.programManager.setBaseShader(s.shaderName,s.vertexSource,s.fragmentSource),s.shaderAdditions)for(var h=0;h<s.shaderAdditions.length;h++){var u=s.shaderAdditions[h];this.programManager.addAddition(u)}if(s.shaderFeatures)for(h=0;h<s.shaderFeatures.length;h++)this.programManager.addFeature(s.shaderFeatures[h]);this._spriteMatrix=new n,this._calcMatrix=new n,this._lightVector=new r,this._quad=new Float32Array(8)},defaultConfig:{name:"SubmitterTilemapGPULayer",shaderName:"TilemapGPULayer",vertexSource:m,fragmentSource:p,shaderAdditions:[f(!0),d(!0),c(!0),u(!0),h(!0)],vertexBufferLayout:{usage:"DYNAMIC_DRAW",count:4,layout:[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]}},_completeLayout:function(e){var t=e.vertexBufferLayout;e.vertexBufferLayout={},e.vertexBufferLayout.usage=t.usage,e.vertexBufferLayout.count=t.count||4,e.vertexBufferLayout.layout=[];for(var i=e.vertexBufferLayoutRemove||[],n=0;n<t.layout.length;n++){var r=t.layout[n];-1===i.indexOf(r.name)&&(e.vertexBufferLayout.layout[n]={name:r.name,size:r.size||1,type:r.type||"FLOAT",normalized:r.normalized||!1})}if(e.vertexBufferLayoutAdd){var s=e.vertexBufferLayoutAdd||[];for(n=0;n<s.length;n++){var a=s[n];e.vertexBufferLayout.layout.push({name:a.name,size:a.size||1,type:a.type||"FLOAT",normalized:a.normalized||!1})}}},setupUniforms:function(e,t){var i=this.programManager;i.setUniform("uResolution",[e.width,e.height]),e.renderer.setProjectionMatrixFromDrawingContext(e),i.setUniform("uProjectionMatrix",e.renderer.projectionMatrix.val);var n=t.tileset,r=n.glTexture,s=t.layerDataTexture,a=n.getAnimationDataTexture(e.renderer);i.setUniform("uMainSampler",0),i.setUniform("uLayerSampler",1),i.setUniform("uAnimS
2ampler",2),i.setUniform("uMainResolution",[r.width,r.height]),i.setUniform("uLayerResolution",[s.width,s.height]),i.setUniform("uAnimResolution",[a.width,a.height]),i.setUniform("uTileColumns",n.columns),i.setUniform("uTileWidthHeightMarginSpacing",[n.tileWidth,n.tileHeight,n.tileMargin,n.tileSpacing]),i.setUniform("uAlpha",t.alpha),i.setUniform("uTime",t.timeElapsed),y.updateLightingUniforms(t.lighting,e,i,3,this._lightVector,t.selfShadow.enabled,t.selfShadow.diffuseFlatThreshold,t.selfShadow.penumbra)},updateRenderOptions:function(e,t){var i=this.programManager,n=e.tileset.image,r=t.alphaStrategy,s=i.getAdditionsByTag("ALPHA_DISCARD")[0];if(s){var a="keep"===r,o="dither"===r,u="number"===typeof r?r:void 0;i.replaceAddition(s.name,h(a,o,u))}var c=i.getAdditionsByTag("MAXANIMS")[0];c&&i.removeAddition(c.name),e.tileset.maxAnimationLength>0&&i.addAddition(l(e.tileset.maxAnimationLength));for(var d=e.lighting,f=i.getAdditionsByTag("LIGHTING"),p=0;p<f.length;p++){f[p].disable=!d}if(d){var m=i.getAddition("DefineLights");m&&(m.additions.fragmentDefine="#define LIGHT_COUNT "+this.manager.renderer.config.maxLights)}var g=e.selfShadow.enabled;null===g&&(g=e.scene.sys.game.config.selfShadow),g?i.addFeature("SELFSHADOW"):i.removeFeature("SELFSHADOW");var v=n.smoothPixelArt;null===v&&(v=e.scene.sys.game.config.smoothPixelArt);var y=i.getAddition("SmoothPixelArt");y&&(y.disable=!v),n.source[0].glTexture.magFilter===this.manager.renderer.gl.LINEAR?i.addFeature("BORDERFILTER"):i.removeFeature("BORDERFILTER")},run:function(e,t,i){var n=this.manager,r=n.renderer;n.startStandAloneRender(),this.onRunBegin(e);var s=e.camera,a=this._spriteMatrix,o=this._calcMatrix,l=this._quad,h=t.x,u=t.y,c=t.width,d=t.height;o.copyWithScrollFactorFrom(s.getViewMatrix(!e.useCanvas),s.scrollX,s.scrollY,t.scrollFactorX,t.scrollFactorY),i&&o.multiply(i),a.applyITRS(h,u,0,t.scaleX,t.scaleY),o.multiply(a),o.setQuad(h,u,h+c,u+d,l);var f=this.vertexBufferLayout.layout.stride,p=this.vertexBufferLayout.buffer,m=p.viewF32,g=0;m[g++]=l[2],m[g++]=l[3],m[g++]=0,m[g++]=0,m[g++]=l[0],m[g++]=l[1],m[g++]=0,m[g++]=1,m[g++]=l[4],m[g++]=l[5],m[g++]=1,m[g++]=0,m[g++]=l[6],m[g++]=l[7],m[g++]=1,m[g++]=1,p.update(4*f);var v=t.tileset,y=v.glTexture,x=v.getAnimationDataIndexMap(r).size>0,b=[y,t.layerDataTexture];if(x&&(b[2]=v.getAnimationDataTexture(r)),t.lighting){var w=v.image.dataSource[0];w=w?w.glTexture:this.manager.renderer.normalTexture,b[3]=w}this.updateRenderOptions(t,e);var T=this.programManager,_=T.getCurrentProgramSuite();if(_){var S=_.program,E=_.vao;this.setupUniforms(e,t),T.applyUniforms(S),r.drawElements(e,b,S,E,4,0)}this.onRunEnd(e)}});e.exports=x},12913(e,t,i){var n=i(83419),r=i(6141),s=new n({Extends:r,initialize:function(e){r.call(this,"TexturerImage",e),this.frame=null,this.frameWidth=0,this.frameHeight=0,this.uvSource=null},run:function(e,t,i){this.onRunBegin(e);var n=t.frame;if(this.frame=n,this.frameWidth=n.cutWidth,this.frameHeight=n.cutHeight,this.uvSource=n,t.isCropped){var r=t._crop;this.uvSource=r,r.flipX===t.flipX&&r.flipY===t.flipY||t.frame.updateCropUVs(r,t.flipX,t.flipY),this.frameWidth=r.width,this.frameHeight=r.height}var s=n.source.resolution;this.frameWidth/=s,this.frameHeight/=s,this.onRunEnd(e)}});e.exports=s},22995(e,t,i){var n=i(61340),r=i(83419),s=i(6141),a=new r({Extends:s,initialize:function(e){s.call(this,"TexturerTileSprite",e),this.frame=null,this.uvMatrix=new n},run:function(e,t,i){this.onRunBegin(e);var n=t.frame;if(this.frame=n,t.isCropped){var r=t._crop;r.flipX===t.flipX&&r.flipY===t.flipY||t.frame.updateCropUVs(r,t.flipX,t.flipY)}this.uvMatrix.loadIdentity(),this.uvMatrix.scale(1/n.width,1/n.height),this.uvMatrix.translate(t.tilePositionX,t.tilePositionY),this.uvMatrix.scale(1/t.tileScaleX,1/t.tileScaleY),this.uvMatrix.rotate(-t.tileRotation),this.uvMatrix.setQuad(0,0,t.width,t.height),this.onRunEnd(e)}});e.exports=a},86081(e,t,i){var n=i(61340),r=i(83419),s=i(46975),a=i(6141),o=new r({Extends:a,initialize:function(e,t){t=s(t||{},this.defaultConfig),a.call(this,t.name,e),this.quad=new Float32Array(8),this._spriteMatrix=new n,this._calcMatrix=new n},defaultConfig:{name:"TransformerImage",role:"Transformer"},run:function(e,t,i,n,r){this.onRunBegin(e);var s=i.frame,a=i.uvSource,o=a.x,l=a.y,h=t.displayOriginX,u=t.displayOriginY,c=-h+o,d=-u+l,f=s.customPivot,p=1,m=1;t.flipX&&(f||(c+=-s.realWidth+2*h),p=-1),t.flipY&&(f||(d+=-s.realHeight+2*u),m=-1);var g=e.camera,v=this._spriteMatrix,y=this._calcMatrix.copyWithScrollFactorFrom(g.getViewMatrix(!e.useCanvas),g.scrollX,g.scrollY,t.scrollFactorX,t.scrollFactorY);n&&y.multiply(n),v.applyITRS(t.x,t.y,t.rotation,t.scaleX*p,t.scaleY*m),y.multiply(v),y.setQuad(c,d,c+i.frameWidth,d+i.frameHeight,this.quad);var x=y.matrix,b=1===x[0]&&0===x[1]&&0===x[2]&&1===x[3];if(t.willRoundVertices(g,b)){var w=this.quad;w[0]=Math.round(w[0]),w[1]=Math.round(w[1]),w[2]=Math.round(w[2]),w[3]=Math.round(w[3]),w[4]=Math.round(w[4]),w[5]=Math.round(w[5]),w[6]=Math.round(w[6]),w[7]=Math.round(w[7])}this.onRunEnd(e)}});e.exports=o},88383(e,t,i){var n=i(61340),r=i(83419),s=i(46975),a=i(6141),o=new r({Extends:a,initialize:function(e,t){t=s(t||{},this.defaultConfig),a.call(this,t.name,e),this._spriteMatrix=new n,this.quad=this._spriteMatrix.quad},defaultConfig:{name:"TransformerStamp",role:"Transformer"},run:function(e,t,i,n,r){this.onRunBegin(e);var s=i.frame,a=i.uvSource,o=a.x,l=a.y,h=t.displayOriginX,u=t.displayOriginY,c=-h+o,d=-u+l,f=s.customPivot,p=1,m=1;t.flipX&&(f||(c+=-s.realWidth+2*h),p=-1),t.flipY&&(f||(d+=-s.realHeight+2*u),m=-1);var g=t.x,v=t.y,y=this._spriteMatrix;y.applyITRS(g,v,t.rotation,t.scaleX*p,t.scaleY*m);var x=y.matrix;this.onlyTranslate=1===x[0]&&0===x[1]&&0===x[2]&&1===x[3],y.setQuad(c,d,c+i.frameWidth,d+i.frameHeight);var b=y.matrix,w=1===b[0]&&0===b[1]&&0===b[2]&&1===b[3];if(t.willRoundVertices(e.camera,w)){var T=this.quad;T[0]=Math.round(T[0]),T[1]=Math.round(T[1]),T[2]=Math.round(T[2]),T[3]=Math.round(T[3]),T[4]=Math.round(T[4]),T[5]=Math.round(T[5]),T[6]=Math.round(T[6]),T[7]=Math.round(T[7])}this.onRunEnd(e)}});e.exports=o},34454(e,t,i){var n=i(83419),r=i(86081),s=new n({Extends:r,initialize:function(e,t){r.call(this,e,t)},defaultConfig:{name:"TransformerTile",role:"Transformer"},run:function(e,t,i,n,r){this.onRunBegin(e);var s=e.camera,a=this._calcMatrix,o=this._spriteMatrix;a.copyWithScrollFactorFrom(s.getViewMatrix(!e.useCanvas),s.scrollX,s.scrollY,t.scrollFactorX,t.scrollFactorY),n&&a.multiply(n);var l=i.frameWidth,h=i.frameHeight,u=l,c=h,d=l/2,f=h/2,p=t.scaleX,m=t.scaleY,g=t.gi
vendor: 4,748 bytes, line 2
2dMap[r.index],v=g.tileOffset.x,y=g.tileOffset.y,x=t.x+r.pixelX*p+(d*p-v),b=t.y+r.pixelY*m+(f*m-y),w=-d,T=-f;r.flipX&&(u*=-1,w+=l),r.flipY&&(c*=-1,w+=h),o.applyITRS(x,b,r.rotation,p,m),a.multiply(o),a.setQuad(w,T,w+u,T+c,this.quad);var _=a.matrix,S=1===_[0]&&0===_[1]&&0===_[2]&&1===_[3];if(t.willRoundVertices(s,S)){var E=this.quad;E[0]=Math.round(E[0]),E[1]=Math.round(E[1]),E[2]=Math.round(E[2]),E[3]=Math.round(E[3]),E[4]=Math.round(E[4]),E[5]=Math.round(E[5]),E[6]=Math.round(E[6]),E[7]=Math.round(E[7])}this.onRunEnd(e)}});e.exports=s},46211(e,t,i){var n=i(83419),r=i(86081),s=new n({Extends:r,initialize:function(e,t){r.call(this,e,t)},defaultConfig:{name:"TransformerTileSprite",role:"Transformer"},run:function(e,t,i,n,r){this.onRunBegin(e);var s=t.width,a=t.height,o=t.displayOriginX,l=t.displayOriginY,h=-o,u=-l,c=1,d=1;t.flipX&&(h+=2*o-s,c=-1),t.flipY&&(u+=2*l-a,d=-1);var f=t.x,p=t.y,m=e.camera,g=this._calcMatrix,v=this._spriteMatrix;g.copyWithScrollFactorFrom(m.getViewMatrix(!e.useCanvas),m.scrollX,m.scrollY,t.scrollFactorX,t.scrollFactorY),n&&g.multiply(n),v.applyITRS(f,p,t.rotation,t.scaleX*c,t.scaleY*d),g.multiply(v),g.setQuad(h,u,h+s,u+a,this.quad);var y=g.matrix,x=1===y[0]&&0===y[1]&&0===y[2]&&1===y[3];if(t.willRoundVertices(m,x)){var b=this.quad;b[0]=Math.round(b[0]),b[1]=Math.round(b[1]),b[2]=Math.round(b[2]),b[3]=Math.round(b[3]),b[4]=Math.round(b[4]),b[5]=Math.round(b[5]),b[6]=Math.round(b[6]),b[7]=Math.round(b[7])}this.onRunEnd(e)}});e.exports=s},64552(e,t,i){var n=i(61340),r=i(83419),s=i(46975),a=i(6141),o=new r({Extends:a,initialize:function(e,t){t=s(t||{},this.defaultConfig),a.call(this,t.name,e),this._spriteMatrix=new n,this._calcMatrix=new n,this._roundVertices=!1},defaultConfig:{name:"TransformerVertex",role:"Transformer"},run:function(e,t,i,n){this.onRunBegin(e),this.setupMatrix(e,t,i),this.transformVertex(n),this.onRunEnd(e)},setupMatrix:function(e,t,i){var n=e.camera,r=this._spriteMatrix,s=this._calcMatrix.copyWithScrollFactorFrom(n.getViewMatrix(!e.useCanvas),n.scrollX,n.scrollY,t.scrollFactorX,t.scrollFactorY);i&&s.multiply(i),r.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.multiply(r);var a=s.matrix,o=1===a[0]&&0===a[1]&&0===a[2]&&1===a[3];return this._roundVertices=t.willRoundVertices(n,o),s},transformVertex:function(e){return this._calcMatrix.transformPoint(e.x,e.y,e),this._roundVertices&&(e.x=Math.round(e.x),e.y=Math.round(e.y)),e}});e.exports=o},56113(e){e.exports=["vec4 applyAlphaDiscard(vec4 fragColor)","{","    #ifdef ALPHA_DISCARD_STRATEGY_THRESHOLD","    if (fragColor.a < ALPHA_DISCARD_STRATEGY_THRESHOLD)","    {","        discard;","    }","    #endif","    #ifdef ALPHA_DISCARD_STRATEGY_DITHER","    float noise = fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y));","    if (noise >= fragColor.a)","    {","        discard;","    }","    #endif","    return fragColor / fragColor.a;","}"].join("\n")},84547(e){e.exports=["vec4 applyLighting (vec4 fragColor, vec3 normal)","{","    vec4 lighting = getLighting(fragColor, normal);","    return fragColor * vec4(lighting.rgb * lighting.a, lighting.a);","}"].join("\n")},11104(e){e.exports=["vec4 applyTint(vec4 texture)","{","    float tintMode = outTintEffect.a;","    vec3 unpremultTexture = texture.rgb / texture.a;","    float alpha = texture.a * outTint.a;","    vec3 color = vec3(unpremultTexture);","    if (tintMode == 0.0) {","        color *= outTint.bgr;","    }","    else if (tintMode == 1.0) {","        color = outTint.bgr;","    }","    else if (tintMode == 2.0) {","        color += outTint.bgr;","    }","    else if (tintMode == 4.0) {","        color = 1.0 - (1.0 - unpremultTexture) * (1.0 - outTint.bgr);","    }","    else if (tintMode == 5.0) {","        color = vec3(","            unpremultTexture.r < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),","            unpremultTexture.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),","            unpremultTexture.b < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)","        );","    }","    else if (tintMode == 6.0) {","        color = vec3(","            outTint.b < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),","            outTint.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),","            outTint.r < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)","        );","    }","    else if (tintMode == 7.0) {","        color = (1.0 - color) * outTintEffe
2ct.bgr + outTint.bgr * color;","    }","    return vec4(color * alpha, alpha);","}"].join("\n")},81556(e){e.exports=["vec4 boundedSampler(sampler2D sampler, vec2 uv)","{","    if (clamp(uv, 0.0, 1.0) != uv)","    {","        return vec4(0.0, 0.0, 0.0, 0.0);","    }","    return texture2D(sampler, uv);","}"].join("\n")},96293(e){e.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];","    c.rgb *= c.a;","    result.rgb *= result.a;","    gl_FragColor = mix(c, result, uAlpha);","}"].join("\n")},78390(e){e.exports=["vec2 v2len (vec2 a, vec2 b)","{","    return sqrt(a*a+b*b);","}","vec2 getBlockyTexCoord (vec2 texCoord, vec2 texRes) {","    texCoord *= texRes;","    vec2 seam = floor(texCoord + 0.5);","    texCoord = (texCoord - seam) / v2len(dFdx(texCoord), dFdy(texCoord)) + seam;","    texCoord = clamp(texCoord, seam-.5, seam+.5);","    return texCoord / texRes;","}"].join("\n")},11719(e){e.exports=["struct Light","{","    vec3 position;","    vec3 color;","    float intensity;","    float radius;","    vec2 direction;","    vec3 cone; // outer cosine, inner cosine, enabled flag","};","const int kMaxLights = LIGHT_COUNT;","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform int uLightCount;","#ifdef FEATURE_SELFSHADOW","uniform float uDiffuseFlatThreshold;","uniform float uPenumbra;","#endif","vec4 getLighting (vec4 fragColor, vec3 normal)","{","    vec3 finalColor = vec3(0.0);","    vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;","    #ifdef FEATURE_SELFSHADOW","    vec3 unpremultipliedColor = fragColor.rgb / fragColor.a;","    float occlusionThreshold = 1.0 - ((unpremultipliedColor.r + unpremultipliedColor.g + unpremultipliedColor.b) / uDiffuseFlatThreshold);","    #endif","    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), light.position.z / res.x);","            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);","            if (light.cone.z > 0.5)","            {","                vec2 coneVector = gl_FragCoord.xy - light.position.xy;","                float coneLength = length(coneVector);","                vec2 lightToFrag = coneLength > 0.0 ? coneVector / coneLength : light.direction;","                float coneDot = dot(lightToFrag, light.direction);","                float coneRange = abs(light.cone.y - light.cone.x);","                float coneAttenuation = coneRange < 0.0001 ? step(light.cone.y, coneDot) : smoothstep(light.cone.x, light.cone.y, coneDot);","                attenuation *= coneAttenuation;","            }","            #ifdef FEATURE_SELFSHADOW","            float occluded = smoothstep(0.0, 1.0, (diffuseFactor - occlusionThreshold) / uPenumbra);","            vec3 diffuse = light.color * diffuseFactor * occluded;","            #else","            vec3 diffuse = light.color * diffuseFactor;","            #endif","            finalColor += (attenuation * diffuse) * light.intensity;","        }","    }","    vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);","    return colorOutput;","}"].join("\n")},14030(e){e.exports=["vec2 clampTexCoordWithinFrame (vec2 texCoord)","{","    vec2 texRes = getTexRes();","    vec4 frameTexel = outFrame * texRes.xyxy;","    vec2 frameMin = frameTexel.xy + vec2(0.5, 0.5);","    vec2 frameMax = frameTexel.xy + frameTexel.zw - vec2(0.5, 0.5);","    return clamp(texCoord, frameMin / texRes, frameMax / texRes);","}"].join("\n")},10235(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","vec2 Distort(vec2 p)","{","    float theta  = atan(p.y, p.x);","    float radius = length(p);","    radius = pow(radius, amount);
2","    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 = boundedSampler(uMainSampler, texCoord);","}"].join("\n")},65980(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform float amount;","uniform vec4 color;","varying vec2 outTexCoord;","vec4 NORMAL (vec4 base, vec4 blend)","{","    return blend + base * (1.0 - blend.a);","}","vec4 ADD (vec4 base, vec4 blend)","{","    return base + blend;","}","vec4 MULTIPLY (vec4 base, vec4 blend)","{","    return base * blend;","}","vec4 SCREEN (vec4 base, vec4 blend)","{","    return 1.0 - (1.0 - base) * (1.0 - blend);","}","float overlayChannel (float base, float blend)","{","    return base < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 OVERLAY (vec4 base, vec4 blend)","{","    return vec4(","        overlayChannel(base.r, blend.r),","        overlayChannel(base.g, blend.g),","        overlayChannel(base.b, blend.b),","        overlayChannel(base.a, blend.a)","    );","}","vec4 DARKEN (vec4 base, vec4 blend)","{","    return min(base, blend);","}","vec4 LIGHTEN (vec4 base, vec4 blend)","{","    return max(base, blend);","}","float dodgeChannel (float base, float blend)","{","    return blend == 1.0 ? blend : min(1.0, base / (1.0 - blend));","}","vec4 COLOR_DODGE (vec4 base, vec4 blend)","{","    return vec4(","        dodgeChannel(base.r, blend.r),","        dodgeChannel(base.g, blend.g),","        dodgeChannel(base.b, blend.b),","        dodgeChannel(base.a, blend.a)","    );","}","float burnChannel (float base, float blend)","{","    return blend == 0.0 ? blend : 1.0 - min(1.0, (1.0 - base) / blend);","}","vec4 COLOR_BURN (vec4 base, vec4 blend)","{","    return vec4(","        burnChannel(base.r, blend.r),","        burnChannel(base.g, blend.g),","        burnChannel(base.b, blend.b),","        burnChannel(base.a, blend.a)","    );","}","float hardLightChannel (float base, float blend)","{","    return blend < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 HARD_LIGHT (vec4 base, vec4 blend)","{","    return vec4(","        hardLightChannel(base.r, blend.r),","        hardLightChannel(base.g, blend.g),","        hardLightChannel(base.b, blend.b),","        hardLightChannel(base.a, blend.a)","    );","}","float softLightChannel (float base, float blend)","{","    return blend < 0.5 ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));","}","vec4 SOFT_LIGHT (vec4 base, vec4 blend)","{","    return vec4(","        softLightChannel(base.r, blend.r),","        softLightChannel(base.g, blend.g),","        softLightChannel(base.b, blend.b),","        softLightChannel(base.a, blend.a)","    );","}","vec4 DIFFERENCE (vec4 base, vec4 blend)","{","    return abs(base - blend);","}","vec4 EXCLUSION (vec4 base, vec4 blend)","{","    return base + blend - 2.0 * base * blend;","}","vec3 rgbToHsl (vec3 color)","{","    vec3 hsl = vec3(0.0);","    float fmin = min(min(color.r, color.g), color.b);","    float fmax = max(max(color.r, color.g), color.b);","    float delta = fmax - fmin;","    hsl.z = (fmax + fmin) / 2.0;","    if (delta == 0.0)","    {","        hsl.x = 0.0;","        hsl.y = 0.0;","    }","    else","    {","        if (hsl.z < 0.5)","        {","            hsl.y = delta / (fmax + fmin);","        }","        else","        {","            hsl.y = delta / (2.0 - fmax - fmin);","        }","        float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;","        float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;","        float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;","        if (color.r == fmax)","        {","            hsl.x = deltaB - deltaG;","        }","        else if (color.g == fmax)","        {","            hsl.x = (1.0 / 3.0) + deltaR - deltaB;","        }","        else if (color.b == fmax)","        {","            hsl.x = (2.0 / 3.0) + deltaG - deltaR;","        }","        if (hsl.x < 0.0)","        {","            hsl.x += 1.0;","        }","        else if (hsl.x > 1.0)","        {","            hsl.x -= 1.0;","        }","    }","    return hsl;","}","vec3 hslToRgb (vec3 hsl)","{","    float p = hsl.z * (1.0 - hsl.
2y);","    float q = hsl.z * (1.0 - hsl.y * hsl.x);","    float t = hsl.z * (1.0 - hsl.y * (1.0 - hsl.x));","    if (hsl.x < 1.0 / 6.0)","    {","        return vec3(hsl.z, t, p);","    }","    else if (hsl.x < 0.5)","    {","        return vec3(q, hsl.z, p);","    }","    else if (hsl.x < 2.0 / 3.0)","    {","        return vec3(p, hsl.z, t);","    }","    return vec3(p, q, hsl.z);","}","vec4 HUE (vec4 base, vec4 blend)","{","    vec3 baseHSL = rgbToHsl(base.rgb);","    vec3 blendHSL = rgbToHsl(blend.rgb);","    return vec4(hslToRgb(vec3(blendHSL.x, baseHSL.y, baseHSL.z)), base.a);","}","vec4 SATURATION (vec4 base, vec4 blend)","{","    vec3 baseHSL = rgbToHsl(base.rgb);","    vec3 blendHSL = rgbToHsl(blend.rgb);","    return vec4(hslToRgb(vec3(baseHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 COLOR (vec4 base, vec4 blend)","{","    vec3 baseHSL = rgbToHsl(base.rgb);","    vec3 blendHSL = rgbToHsl(blend.rgb);","    return vec4(hslToRgb(vec3(blendHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 LUMINOSITY (vec4 base, vec4 blend)","{","    vec3 baseHSL = rgbToHsl(base.rgb);","    vec3 blendHSL = rgbToHsl(blend.rgb);","    return vec4(hslToRgb(vec3(baseHSL.x, baseHSL.y, blendHSL.z)), base.a);","}","vec4 ERASE (vec4 base, vec4 blend)","{","    return base * (1.0 - blend.a);","}","vec4 SOURCE_IN (vec4 base, vec4 blend)","{","    return blend * base.a;","}","vec4 SOURCE_OUT (vec4 base, vec4 blend)","{","    return blend * (1.0 - base.a);","}","vec4 SOURCE_ATOP (vec4 base, vec4 blend)","{","    return base * (1.0 - blend.a) + blend * base.a;","}","vec4 DESTINATION_OVER (vec4 base, vec4 blend)","{","    return base + blend * (1.0 - base.a);","}","vec4 DESTINATION_IN (vec4 base, vec4 blend)","{","    return base * blend.a;","}","vec4 DESTINATION_OUT (vec4 base, vec4 blend)","{","    return base * (1.0 - blend.a);","}","vec4 DESTINATION_ATOP (vec4 base, vec4 blend)","{","    return base * blend.a + blend * (1.0 - base.a);","}","vec4 LIGHTER (vec4 base, vec4 blend)","{","    return ADD(base, blend);","}","vec4 COPY (vec4 base, vec4 blend)","{","    return blend;","}","vec4 XOR (vec4 base, vec4 blend)","{","    return base * (1.0 - blend.a) + blend * (1.0 - base.a);","}","#pragma phaserTemplate(fragmentHeader)","void main ()","{","    vec4 base = boundedSampler(uMainSampler, outTexCoord);","    vec4 blend = boundedSampler(uMainSampler2, outTexCoord) * color;","    vec4 blended = BLEND(base, blend);","    gl_FragColor = mix(base, blended, amount);","}"].join("\n")},5899(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec4 uSizeAndOffset;","varying vec2 outTexCoord;","void main()","{","    vec2 gridCell = floor((outTexCoord * resolution + uSizeAndOffset.zw) / uSizeAndOffset.xy) * uSizeAndOffset.xy - uSizeAndOffset.zw;","    vec2 texCoord = gridCell / resolution;","    gl_FragColor = texture2D(uMainSampler, texCoord);","}"].join("\n")},20784(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","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 += boundedSampler(uMainSampler, uv) * 0.1964825501511404;","    col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.2969069646728344;","    col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.2969069646728344;","    col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.09447039785044732;","    col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.09447039785044732;","    col += boundedSampler(uMainSampler, uv + (off3 / resolution)) * 0.010381362401148057;","    col += boundedSampler(uMainSampler, uv - (off3 / resolution)) * 0.010381362401148057;","    gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},65122(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{","    vec2 uv = outTexCoord;","    vec4 col = vec4(0.0);","    vec2 offset = vec2(1.333) * offset * strength;
2","    col += boundedSampler(uMainSampler, uv) * 0.29411764705882354;","    col += boundedSampler(uMainSampler, uv + (offset / resolution)) * 0.35294117647058826;","    col += boundedSampler(uMainSampler, uv - (offset / resolution)) * 0.35294117647058826;","    gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},60942(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","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 += boundedSampler(uMainSampler, uv) * 0.2270270270;","    col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.3162162162;","    col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.3162162162;","    col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.0702702703;","    col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.0702702703;","    gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},43722(e){e.exports=["#pragma phaserTemplate(shaderName)","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;","}","#pragma phaserTemplate(fragmentHeader)","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 = boundedSampler(tex, uv + pixel * Sample(j, r)).xyz;","        col = contrast > 0.0 ? col * col * (1.0 + contrast) : col;","        vec3 bokeh = vec3(0.5) + pow(col, vec3(10.0)) * amount;","        acc += col * bokeh;","        div += bokeh;","    }","    return acc / div;","}","void main ()","{","    float shift = 1.0;","    if (isTiltShift)","    {","        vec2 uv = vec2(gl_FragCoord.xy / resolution + vec2(-0.5, -0.5)) * 2.0;","        float centerStrength = 1.0;","        shift = length(uv * blur * strength) * centerStrength;","    }","    gl_FragColor = vec4(Bokeh(uMainSampler, outTexCoord * vec2(1.0, 1.0), radius * shift), 0.0);","}"].join("\n")},19883(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{","    vec4 c = texture2D(uMainSampler, outTexCoord);","    if (uAlpha == 0.0)","    {","        gl_FragColor = c;","        return;","    }","    if (c.a > 0.0)","    {","        c.rgb /= c.a;","    }","    vec4 result;","    result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];","    result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];","    result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];","    result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];","    vec3 rgb = mix(c.rgb, result.rgb, uAlpha);","    rgb *= result.a;","    gl_FragColor = vec4(rgb, result.a);","}"].join("\n")},32624(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uTransferSampler;","uniform float uColorMatrixSelf[20];","uniform float uColorMatrixTransfer[20];","uniform float uAlphaSelf;","uniform float uAlphaTransfer;","uniform vec4 uAdditions;","uniform vec4 uMultiplications;","varying vec2 outTexCoord;","#define S uColorMatrixSelf","#define T uColorMatrixTransfer","void main ()","{","    vec4 self = texture2D(uMainSampler, outTexCoord);","    if (uAlphaSelf == 0.0)","    {","        gl_FragColor = self;","        return;","    }","    if (self.a > 0.0)","    {","        self.rgb /= self.a;","    }","    vec4 resultSelf;","    resultSelf.r = (S[0] * self.r) + (S[1] * self.g) + (S[2] * self.b) + (S[3] * self.a) + S[4];","    resultSelf.g = (S[5] * self.r) + (S[6] * self.g) + (S[7] * self.b) + (S[8] * self.a) + S[9];","    resultSelf.b = (S[10] * self.r) + (S[11] * self.g) + (S[12] * self.b) + (S[13] * self.a) + S[14];","    resultSelf.a = (S[15] * self.r) + (S[16] * self.g) + (S[17] * self.b) + (S[18] * self.a) + S[19];","    if (uAlphaTransfer == 0.0)","    {","        self.rgb *= self.a;","        resultSelf.rgb *= resultSelf.a;","        gl_FragColor = mix(self, resultSelf, uAlphaSelf);","        return;","    }","    vec4 tex = texture2D(uTransferSampler, outTexCoord);","    if (tex.a > 0.0)","    {","        tex.rgb /= tex.a;","    }","    vec4 resultTransfer;","    resultTransfer.r = (T[0] * tex.r) + (T[1] * tex.g) + (T[2] * tex.b) + (T[3] * tex.a) + T[4];","    resultTransfer.g = (T[5] * tex.r) + (T[6] * tex.g) + (T[7] * tex.b) + (T[8] * tex.a) + T[9];","    resultTransfer.b = (T[10] * tex.r) + (T[11] * tex.g) + (T[12] * tex.b) + (T[13] * tex.a) + T[14];
2","    resultTransfer.a = (T[15] * tex.r) + (T[16] * tex.g) + (T[17] * tex.b) + (T[18] * tex.a) + T[19];","    vec4 combo = (resultSelf + resultTransfer) * uAdditions + (resultSelf * resultTransfer) * uMultiplications;","    self.rgb *= self.a;","    resultSelf.rgb *= resultSelf.a;","    combo.rgb *= combo.a;","    gl_FragColor = mix(self, mix(resultSelf, combo, uAlphaTransfer), uAlphaSelf);","}"].join("\n")},12886(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uDisplacementSampler;","uniform vec2 amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{","    vec2 disp = (-vec2(0.5, 0.5) + texture2D(uDisplacementSampler, outTexCoord).rg) * amount;","    gl_FragColor = boundedSampler(uMainSampler, outTexCoord + disp).rgba;","}"].join("\n")},33016(e){e.exports=["#pragma phaserTemplate(shaderName)","#define DISTANCE 10.0","#define QUALITY 10.0","#pragma phaserTemplate(fragmentDefine)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform float outerStrength;","uniform float innerStrength;","uniform float scale;","uniform vec2 resolution;","uniform vec4 glowColor;","uniform bool knockout;","const float PI = 3.14159265358979323846264;","const float MAX_ALPHA = DISTANCE * (DISTANCE + 1.0) * QUALITY / 2.0;","#pragma phaserTemplate(fragmentHeader)","void main ()","{","    vec2 px = vec2(1.0 / resolution.x, 1.0 / resolution.y) * scale;","    float totalAlpha = 0.0;","    float curAngle = 0.0;","    vec2 direction;","    vec2 displaced;","    vec4 color;","    for (float curDistance = 0.0; curDistance < DISTANCE; curDistance++)","    {","        curAngle += fract(sin(dot(vec2(curDistance, outTexCoord.x + outTexCoord.y), vec2(12.9898, 78.233))) * 43758.5453);","        for (float i = 0.0; i < QUALITY; i++)","        {","            curAngle += PI * 2.0 / (QUALITY);","            direction = vec2(cos(curAngle), sin(curAngle)) * px;","            displaced = outTexCoord + direction * (curDistance + 1.0);","            color = boundedSampler(uMainSampler, displaced);","            totalAlpha += (DISTANCE - curDistance) * color.a;","        }","    }","    color = boundedSampler(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);","    if (knockout)","    {","        float resultAlpha = outerGlowStrength + innerGlowStrength;","        gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);","    }","    else","    {","        vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;","        gl_FragColor = innerColor + outerGlowColor;","    }","}"].join("\n")},33179(e){e.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uColorFactor;","uniform bool uUnpremultiply;","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{","    vec4 sample = texture2D(uMainSampler, outTexCoord);","    if (uUnpremultiply)","    {","        sample.rgb /= sample.a;","    }","    vec4 modulatedSample = sample * uColorFactor + uColor;","    float progress = modulatedSample.r + modulatedSample.g + modulatedSample.b + modulatedSample.a;","    vec4 rampColor = getRampAt(progress);","    rampColor.rgb *= rampColor.a;","    gl_FragColor = mix(sample, rampColor * sample.a, uAlpha);","}"].join("\n")},94526(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uEnvSampler;","uniform sampler2D uNormSampler;","uniform mat4 uViewMatrix;","uniform float uModelRotation;","uniform float uBulge;","uniform vec3 uColorFactor;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","void main()","{","    vec4 color = texture2D(uMainSampler, outTexCoord);","    vec3 normal = texture2D(uNormSampler, outTexCoord).rgb;","    vec3 normalN = normal * 2.0 - 1.0;","    float normalXYLength = length(normalN.xy);","    float angle = atan(","        normalN.y,","        normalN.x","    ) - uModelRotation;","    normalN = vec3(","        normalXYLength * cos(angle),","        normalXYLength * sin(angle),","        normalN.z","    );","    normalN = reflect(vec3(0.0, 0.0, -1.0), normalN);","    normalN = (uViewMatrix * vec4(normalN, 1.0)).xyz;","    float envX = atan(normalN.x, normalN.z) / PI;","    float envY = sin(normalN.y * PI / 2.0);","    vec2 uv = vec2(envX, envY) * 0.5 + 0.5;","    vec2 rotatedTexCoord = vec2(","        cos(-uModelRotation) * outTexCoord.x - sin(-uModelRotation) * outTexCoord.y,","        sin(-uModelRotation) * outTexCoord.x + cos(-    uModelRotation) * outTexCoord.y","    );","    uv += uBulge * (rotatedTexCoord - 0.5);","    if (uv.y < 0.0)","    {","        uv.y = abs(uv.y);","        uv.x += 0.5;","    }","    else if (uv.y > 1.0)","    {","        uv.y = 2.0 - uv.y;","        uv.x += 0.5;","    }","    vec3 environment = texture2D(uEnvSampler, uv).rgb;","    gl_FragColor = vec4(environment * color.rgb * uColorFactor, color.a);","}"].join("\n")},4488(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uIsolateThresholdFeather;","varying vec2 outTexCoord;","void main()","{","    vec4 color = texture2D(uMainSampler, outTexCoord);","    vec3 unpremultipliedColor = color.rgb / color.a;","    float isolate = uIsolateThresholdFeather.x;","    float threshold = uIsolateThresholdFeather.y;","    float feather = uIsolateThresholdFeather.z;","    float match = distance(unpremultipliedColor, uColor.rgb);","    match = clamp(match - threshold, 0.0, 1.0);","    match = clamp(match / feather, 0.0, 1.0);","    if (isolate == 1.0)","    {","        match = 1.0 - match;","    }","    match = mix(1.0, match, uColor.a);","    gl_FragColor = color * match;","}"].join("\n")},39603(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool invert;","varying vec2 outTexCoord;","void main ()","{","    vec4 color = texture2D(uMainSampler, outTexCoord);","    vec4 mask = texture2D(uMaskSampler, outTexCoord);","    float a = mask.a;","    color *= invert ? (1.0 - a) : a;","    gl_FragColor = color;","}"].join("\n")},60047(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform mat4 uViewMatrix;","#ifdef FACING_POWER","uniform float uFacingPower;","#endif","#ifdef OUTPUT_RATIO","uniform vec3 uRatioVector;","uniform float uRatioRadius;","#endif","varying vec2 outTexCoord;","void main()","{","    vec3 normal = texture2D(uMainSampler, outTexCoord).rgb * 2.0 - 1.0;","    normal = (uViewMatrix * vec4(normal, 1.0)).xyz;","    #ifdef FACING_POWER","    normal = normalize(normal * vec3(1.0, 1.0, uFacingPower));","    #endif","    #ifdef OUTPUT_RATIO","    float ratio = dot(normal, normalize(uRatioVector));","    ratio = (ratio - 1.0 + uRatioRadius) / uRatioRadius;","    if (ratio <= 0.0)","    {","        ratio = 0.0;","    }","    normal = vec3(ratio * 2.0 - 1.0);","    #endif","    gl_FragColor = vec4((normal + 1.0) * 0.5, 1.0);","}"].join("\n")},7529(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uPower;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","#pragma phaserTemplate(fragmentHeader)","#define STEP_X 1.0 / SAMPLES_X","#define STEP_Y 1.0 / SAMPLES_Y","vec3 uvPanoramaNormal(vec2 uv)","{","    float y = uv.y * 2.0 - 1.0;","    float angle = (uv.x * 2.0 - 1.0) * PI;","    float x = sin(angle);","    float z = cos(angle);","    vec2 xz = vec2(x, z);","    xz *= sqrt(1.0 - y * y);","    return normalize(vec3(xz.x, y, xz.y));","}","void main()","{","    vec3 acc = vec3(0.0);","    float div = 0.0;","    vec3 texelNormal = uvPanoramaNormal(outTexCoord);","    for (float y = STEP_Y / 2.0; y < 1.0; y += STEP_Y)","    {","        float yWeight = cos((y * 2.0 - 1.0) * PI / 2.0);","        for (float x = STEP_X / 2.0; x < 1.0; x += STEP_X)","        {","            vec2 uv = vec2(x, y);","            vec3 sampleNormal = uvPanoramaNormal(uv);","            float dotProduct = dot(sampleNormal, texelNormal);","            dotProduct = (dotProduct - 1.0 + uRadius) / uRadius;","            if (dotProduct <= 0.0)","            {","                continue;","            }","            vec3 color = texture2D(uMainSampler, uv).rgb;","            color *= pow(length(color), uPower);","            acc += color * dotProduct * yWeight;","            div += dotProduct * yWeight;","        }","    }","    gl_FragColor = vec4(acc / div, 1.0);","}"].join("\n")},99191(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float amount;","varying vec2 outTexCoord;","void main ()","{","    float pixelSize = floor(2.0 + amount);","    vec2 center = pixelSize * floor(outTexCoord * resolution / pixelSize) + pixelSize * vec2(0.5, 0.5);","    vec2 corner1 = center + pixelSize * vec2(-0.5, -0.5);","    vec2 corner2 = center + pixelSize * vec2(+0.5, -0.5);","    vec2 corner3 = center + pixelSize * vec2(+0.5, +0.5);","    vec2 corner4 = center + pixelSize * vec2(-0.5, +0.5);","    vec4 pixel = 0.4 * texture2D(uMainSampler, center / resolution);","    pixel += 0.15 * texture2D(uMainSampler, corner1 / resolution);","    pixel += 0.15 * texture2D(uMainSampler, corner2 / resolution);","    pixel += 0.15 * texture2D(uMainSampler, corner3 / resolution);","    pixel += 0.15 * texture2D(uMainSampler, corner4 / resolution);","    gl_FragColor = pixel;","}"].join("\n")},88430(e){e.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","uniform sampler2D uMainSampler;","uniform vec4 uSteps;","uniform vec4 uGamma;","uniform vec4 uOffset;","uniform int uMode;","uniform bool uDither;","varying vec2 outTexCoord;","vec4 rgbaToHsva(vec4 rgba)","{","    float r = rgba.r;","    float g = rgba.g;","    float b = rgba.b;","    float a = rgba.a;","    float min = min(min(r, g), b);","    float max = max(max(r, g), b);","    float d = max - min;","    float h = 0.0;","    float s = (max == 0.0) ? 0.0 : d / max;","    float v = max;","    if (max != min)","    {","        if (max == r)","        {","            h = (g - b) / d + ((g < b) ? 6.0 : 0.0);","        }","        else if (max == g)","        {","            h = (b - r) / d + 2.0;","        }","        else","        {","            h = (r - g) / d + 4.0;","        }","        h /= 6.0;","    }","    return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{","    float k = mod(n + hsva.x * 6.0, 6.0);","    float min = min(min(k, 4.0 - k), 1.0);","    return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{","    return vec4(","        hsvaToRgbaConvert(5.0, hsva),","        hsvaToRgbaConvert(3.0, hsva),","        hsvaToRgbaConvert(1.0, hsva),","        hsva.a","    );","}","vec4 ditherIGN(vec4 value)","{","    value += fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5;","    return value;","}","void main ()","{","    vec4 sample = texture2D(uMainSampler, outTexCoord);","    if (uMode == 1)","    {","        sample = rgbaToHsva(sample);","    }","    sample = pow(sample, uGamma);","    sample -= uOffset;","    vec4 steps = max(uSteps - 1.0, 1.0);","    sample *= steps;","    if (uDither)","    {","        sample = ditherIGN(sample);","    }","    sample = ceil(sample - 0.5);","    sample /= steps;","    sample += uOffset;","    sample = pow(sample, 1.0 / uGamma);","    if (uMode == 1)","    {","        sample.x = mod(sample.x, 1.0);","        sample = hsvaToRgba(clamp(sample, 0.0, 1.0));","    }","    gl_FragColor = sample;","}"].join("\n")},69355(e){e.exports=["#pragma phaserTemplate(shaderName)","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;","#pragma phaserTemplate(fragmentHeader)","void main ()","{","    vec4 texture = boundedSampler(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 += boundedSampler(uMainSampler, outTexCoord + float(i) * decay / limit * pc).a * power;","    }","    float mask = 1.0 - texture.a;","    gl_FragColor = mix(texture, color, clamp(shadow * mask, 0.0, 1.0));","}"].join("\n")},92636(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 edge1;","uniform vec4 edge2;","uniform vec4 invert;","varying vec2 outTexCoord;","void main ()","{","    vec4 color = texture2D(uMainSampler, outTexCoord);","    color = clamp((color - edge1) / (edge2 - edge1), 0.0, 1.0);","    color = mix(color, 1.0 - color, invert);","    gl_FragColor = color;","}"].join("\n")},18185(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uStrength;","uniform vec2 uPosition;","uniform vec4 uColor;","uniform int uBlendMode;","varying vec2 outTexCoord;","void main ()","{","    float vignette = 1.0;","    vec2 position = vec2(uPosition.x, 1.0 - uPosition.y);","    float d = length(outTexCoord - position);","    if (d <= uRadius)","    {","        float g = d / uRadius;","        vignette = sin(g * 3.14 * uStrength);","    }","    vec4 color = uColor;","    vec4 texture = texture2D(uMainSampler, outTexCoord);
2","    if (uBlendMode == 1)","    {","        color.rgb = texture.rgb + color.rgb;","    }","    else if (uBlendMode == 2)","    {","        color.rgb = texture.rgb * color.rgb;","    }","    else if (uBlendMode == 3)","    {","        color.rgb = 1.0 - ((1.0 - texture.rgb) * (1.0 - color.rgb));","    }","    gl_FragColor = mix(texture, color, vignette);","}"].join("\n")},99174(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform vec4 uProgress_WipeWidth_Direction_Axis;","uniform float uReveal;","varying vec2 outTexCoord;","void main ()","{","    vec4 color0;","    vec4 color1;","    if (uReveal == 0.0)","    {","        color0 = texture2D(uMainSampler, outTexCoord);","        color1 = texture2D(uMainSampler2, outTexCoord);","    }","    else","    {","        color0 = texture2D(uMainSampler2, outTexCoord);","        color1 = texture2D(uMainSampler, outTexCoord);","    }","    float distance = uProgress_WipeWidth_Direction_Axis.x;","    float width = uProgress_WipeWidth_Direction_Axis.y;","    float direction = uProgress_WipeWidth_Direction_Axis.z;","    float axis = outTexCoord.x;","    if (uProgress_WipeWidth_Direction_Axis.w == 1.0)","    {","        axis = outTexCoord.y;","    }","    float adjust = mix(width, -width, distance);","    float value = smoothstep(distance - width, distance + width, abs(direction - axis) + adjust);","    gl_FragColor = mix(color1, color0, value);","}"].join("\n")},73416(e){e.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{","    vec4 fragColor = outTint;","    #pragma phaserTemplate(fragmentProcess)","    gl_FragColor = fragColor;","}"].join("\n")},91627(e){e.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec4 inTint;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{","    gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","    outTint = vec4(inTint.bgr * inTint.a, inTint.a);","    #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84220(e){e.exports=["vec3 getNormalFromMap (vec2 texCoord)","{","    vec3 normalMap = texture2D(uNormSampler, texCoord).rgb;","    return normalize(outInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));","}"].join("\n")},2860(e){e.exports=["uniform vec2 uMainResolution[TEXTURE_COUNT];","vec2 getTexRes ()","{","    #if TEXTURE_COUNT == 1","    float texId = 0.0;","    #else","    float texId = outTexDatum;","    #endif","    #pragma phaserTemplate(texIdProcess)","    vec2 texRes = vec2(0.0);","    for (int i = 0; i < TEXTURE_COUNT; i++)","    {","        if (texId == float(i))","        {","            texRes = uMainResolution[i];","            break;","        }","    }","    return texRes;","}"].join("\n")},46432(e){e.exports=["uniform sampler2D uMainSampler[TEXTURE_COUNT];","vec4 getTexture (vec2 texCoord)","{","    #if TEXTURE_COUNT == 1","    return texture2D(uMainSampler[0], texCoord);","    #else","    if (outTexDatum == 0.0) return texture2D(uMainSampler[0], texCoord);","    #define ELSE_TEX_CASE(INDEX) else if (outTexDatum == float(INDEX)) return texture2D(uMainSampler[INDEX], texCoord);","    #pragma phaserTemplate(texIdProcess)","    else return vec4(0.0, 0.0, 0.0, 0.0);","    #endif","}"].join("\n")},41509(e){e.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","#define PI 3.14159265358979323846","uniform int uRepeatMode;","uniform float uOffset;","uniform int uShapeMode;","uniform vec2 uShape;","uniform vec2 uStart;","varying vec2 outTexCoord;","float linear()","{","    float len = length(uShape);","    return dot(uShape, outTexCoord - uStart) / len / len;","}","float bilinear()","{","    return abs(linear());","}","float radial()","{","    return distance(uStart, outTexCoord) / length(uShape);","}","float conicSymmetric()","{","    return dot(normalize(uShape), normalize(outTexCoord - uStart)) * 0.5 + 0.5;","}","float conicAsymmetric()","{","    vec2 fromStart = outTexCoord - uStart;","    float angleFromStart = atan(fromStart.y, fromStart.x);","    float shapeAngle = atan(uShape.y, uShape.x);","    float angle = (angleFromStart - shapeAngle) / PI / 2.0;","    if (angle < 0.0) angle += 1.0;","    return angle;","}","float repeat(float value)","{","    if (uRepeatMode == 1)","    {","        if (value < 0.0 || value > 1.0)","        {","            discard;","        }","        return value;","    }","    else if (uRepeatMode == 2)","    {","        return mod(value, 1.0);","    }","    else if (uRepeatMode == 3)","    {","        return 1.0 - abs(1.0 - mod(value, 2.0));","    }","    return clamp(value, 0.0, 1.0);","}","void main()","{","    float progress = 0.0;","    if (uShapeMode == 0)","    {","        progress = linear();","    }","    else if (uShapeMode == 1)","    {","        progress = bilinear();","    }","    else if (uShapeMode == 2)","    {","        progress = radial();","    }","    else if (uShapeMode == 3)","    {","        progress = conicSymmetric();","    }","    else if (uShapeMode == 4)","    {","        progress = conicAsymmetric();","    }","    progress -= uOffset;","    progress = repeat(progress);","    vec4 bandCol = getRampAt(progress);","    bandCol.rgb *= bandCol.a;","    gl_FragColor = bandCol;","}"].join("\n")},98840(e){e.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTexDatum;
2","varying vec4 outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{","    #pragma phaserTemplate(fragmentProcess)","    gl_FragColor = fragColor;","}"].join("\n")},44667(e){e.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexDatum;","attribute vec4 inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTexDatum;","varying vec4 outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{","    gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","    outTexCoord = inTexCoord;","    outTexDatum = inTexDatum;","    outTint = inTint;","    outTintEffect = inTintEffect * vec4(1.0, 1.0, 1.0, 255.0); // Denormalize tint mode to an integer.","    #pragma phaserTemplate(vertexProcess)","}"].join("\n")},16421(e){e.exports=["#version 100","#pragma phaserTemplate(shaderName)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uOffset;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uPower;","uniform int uMode;","varying vec2 outTexCoord;","float trig(vec2 p)","{","    return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","void main ()","{","    float value = pow(trig(outTexCoord + uOffset), uPower);","    if (uMode == 0)","    {","        vec4 color = mix(uColorStart, uColorEnd, value);","        color.rgb *= color.a;","        gl_FragColor = color;","    }","    else if (uMode == 1)","    {","        float valueR = pow(trig(outTexCoord + uOffset + 32.1), uPower);","        float valueG = pow(trig(outTexCoord + uOffset + 11.1), uPower);","        float valueB = pow(trig(outTexCoord + uOffset + 23.4), uPower);","        vec4 color = vec4(valueR, valueG, valueB, 1.);","        color *= mix(uColorStart, uColorEnd, value);","        color.rgb *= color.a;","        gl_FragColor = color;","    }","    else if (uMode == 2)","    {","        float valueAngle = pow(trig(outTexCoord + uOffset), uPower) * 3.141592;","        float x = value * cos(valueAngle);","        float y = value * sin(valueAngle);","        vec4 color = vec4(","            x,","            y,","            sqrt(1. - x * x - y * y),","            1.0","        );","        gl_FragColor = color * 0.5 + 0.5;","    }","}"].join("\n")},83587(e){e.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uCells;","uniform vec2 uPeriod;","uniform vec2 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec2 uSeed;","varying vec2 outTexCoord;","float psrdnoise(vec2 x, vec2 period, float alpha)","{","    vec2 uv = vec2(x.x+x.y*0.5, x.y);","    vec2 i0 = floor(uv), f0 = fract(uv);","    float cmp = step(f0.y, f0.x);","    vec2 o1 = vec2(cmp, 1.0-cmp);","    vec2 i1 = i0 + o1, i2 = i0 + 1.0;","    vec2 v0 = vec2(i0.x - i0.y*0.5, i0.y);","    vec2 v1 = vec2(v0.x + o1.x - o1.y*0.5, v0.y + o1.y);","    vec2 v2 = vec2(v0.x + 0.5, v0.y + 1.0);","    vec2 x0 = x - v0, x1 = x - v1, x2 = x - v2;","    vec3 iu, iv, xw, yw;","    if(any(greaterThan(period, vec2(0.0)))) {","        xw = vec3(v0.x, v1.x, v2.x); yw = vec3(v0.y, v1.y, v2.y);","        if(period.x > 0.0)","            xw = mod(vec3(v0.x, v1.x, v2.x), period.x);","        if(period.y > 0.0)","            yw = mod(vec3(v0.y, v1.y, v2.y), period.y);","        iu = floor(xw + 0.5*yw + 0.5); iv = floor(yw + 0.5);","    } else {","        iu = vec3(i0.x, i1.x, i2.x); iv = vec3(i0.y, i1.y, i2.y);","    }","    iu += uSeed.xxx; iv += uSeed.yyy;","    vec3 hash = mod(iu, 289.0);","    hash = mod((hash*51.0 + 2.0)*hash + iv, 289.0);","    hash = mod((hash*34.0 + 10.0)*hash, 289.0);","    vec3 psi = hash*0.07482 + alpha;","    vec3 gx = cos(psi); vec3 gy = sin(psi);","    vec2 g0 = vec2(gx.x, gy.x);
2","    vec2 g1 = vec2(gx.y, gy.y);","    vec2 g2 = vec2(gx.z, gy.z);","    vec3 w = 0.8 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2));","    w = max(w, 0.0); vec3 w2 = w*w; vec3 w4 = w2*w2;","    vec3 gdotx = vec3(dot(g0, x0), dot(g1, x1), dot(g2, x2));","    float n = dot(w4, gdotx);","    return 10.9*n;","}","float iterate (vec2 coord, float detailPower, float flowPower, float contributionPower)","{","    float value = 0.;","    float itValue = 0.;","    for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)","    {","        float detailScale = pow(detailPower, iteration);","        float flowScale = pow(flowPower, iteration);","        itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);","        value += itValue / pow(contributionPower, iteration);","    }","    return value;","}","float iterateWarp (vec2 coord, float detailPower, float flowPower, float contributionPower)","{","    float value = 0.;","    float itValue = 0.;","    for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)","    {","        float detailScale = pow(detailPower, iteration);","        float flowScale = pow(flowPower, iteration);","        itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);","        value += itValue / pow(contributionPower, iteration);","    }","    return value;","}","vec2 warp (vec2 coord)","{","    vec2 o2 = vec2(11.3, 23.7);","    float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);","    float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);","    return vec2(coord1, coord2);","}","void main ()","{","    vec2 coord = outTexCoord * uCells + uOffset;","    if (uWarpAmount > 0.)","    {","        coord += warp(coord) * uWarpAmount;","    }","    float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;","    value = pow(clamp(value, 0., 1.), uValuePower);","    #ifndef NORMAL_MAP","    vec4 color = mix(uColorStart, uColorEnd, value);","    color.rgb *= color.a;","    gl_FragColor = color;","    #else","    float dx = dFdx(value) * uNormalScale;","    float dy = dFdy(value) * uNormalScale;","    vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;","    gl_FragColor = vec4(normal, 1.0);","    #endif","}"].join("\n")},13460(e){e.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uCells;","uniform vec3 uPeriod;","uniform vec3 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec3 uSeed;","varying vec2 outTexCoord;","vec4 permute(vec4 i) {","    vec4 im = mod(i, 289.0);","    return mod(((im * 34.0) + 10.0) * im, 289.0);","}","float psrdnoise(vec3 x, vec3 period, float alpha) {","    const mat3 M = mat3(0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.0);","    const mat3 Mi = mat3(-0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, -0.5);","    vec3 uvw = M * x;","    vec3 i0 = floor(uvw);","    vec3 f0 = fract(uvw);","    vec3 g_ = step(f0.xyx, f0.yzz);","    vec3 l_ = 1.0 - g_;","    vec3 g = vec3(l_.z, g_.xy);","    vec3 l = vec3(l_.xy, g_.z);","    vec3 o1 = min(g, l);","    vec3 o2 = max(g, l);","    vec3 i1 = i0 + o1, i2 = i0 + o2, i3 = i0 + 1.0;","    vec3 v0 = Mi * i0, v1 = Mi * i1, v2 = Mi * i2, v3 = Mi * i3;","    vec3 x0 = x - v0, x1 = x - v1, x2 = x - v2, x3 = x - v3;","    if(any(greaterThan(period, vec3(0.0)))) {","        vec4 vx = vec4(v0.x, v1.x, v2.x, v3.x);","        vec4 vy = vec4(v0.y, v1.y, v2.y, v3.y);","        vec4 vz = vec4(v0.z, v1.z, v2.z, v3.z);","        if(period.x > 0.0)","            vx = mod(vx, period.x);","        if(period.y > 0.0)","            vy = mod(vy, period.y);","        if(period.z > 0.0)","            vz = mod(vz, period.z);","        i0 = floor(M * vec3(vx.x, vy.x, vz.x) + 0.5);","        i1 = floor(M * vec3(vx.y, vy.y, vz.y) + 0.5);","        i2 = floor(M * vec3(vx.z, vy.z, vz.z) + 0.5);","        i3 = floor(M * vec3(vx.w, vy.w, vz.w) + 0.5);","    }","    i0 += uSeed; i1 += uSeed; i2 += uSeed; i3 += uSeed;","    vec4 hash = permute(permute(permute(vec4(i0.z, i1.z, i2.z, i3.z)) + vec4(i0.y, i1.y, i2.y, i3.y)) + vec4(i0.x, i1.x, i2.x, i3.x));","    vec4 theta = hash * 3.883222077;","    vec4 sz = 0.996539792 - 0.006920415 * hash;","    vec4 psi = hash * 0.108705628;","    vec4 Ct = cos(theta);","    vec4 St = sin(theta);","    vec4 sz_prime = sqrt(1.0 - sz * sz);","    vec4 gx, gy, gz;","    if(alpha != 0.0) {","        vec4 px = Ct * sz_prime;","        vec4 py = St * sz_prime;","        vec4 pz = sz;","        vec4 Sp = sin(psi);","        vec4 Cp = cos(psi);","        vec4 Ctp = St * Sp - Ct * Cp;","        vec4 qx = mix(Ctp * St, Sp, sz);","        vec4 qy = mix(-Ctp * Ct, Cp, sz);","        vec4 qz = -(py * Cp + px * Sp);","        vec4 Sa = vec4(sin(alpha));","        vec4 Ca = vec4(cos(alpha));","        gx = Ca * px + Sa * qx;","        gy = Ca * py + Sa * qy;","        gz = Ca * pz + Sa * qz;","    } else {","        gx = Ct * sz_prime;","        gy = St * sz_prime;","        gz = sz;","    }
2","    vec3 g0 = vec3(gx.x, gy.x, gz.x), g1 = vec3(gx.y, gy.y, gz.y);","    vec3 g2 = vec3(gx.z, gy.z, gz.z), g3 = vec3(gx.w, gy.w, gz.w);","    vec4 w = 0.5 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3));","    w = max(w, 0.0);","    vec4 w2 = w * w;","    vec4 w3 = w2 * w;","    vec4 gdotx = vec4(dot(g0, x0), dot(g1, x1), dot(g2, x2), dot(g3, x3));","    float n = dot(w3, gdotx);","    return 39.5 * n;","}","float iterate (vec3 coord, float detailPower, float flowPower, float contributionPower)","{","    float value = 0.;","    float itValue = 0.;","    for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)","    {","        float detailScale = pow(detailPower, iteration);","        float flowScale = pow(flowPower, iteration);","        itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);","        value += itValue / pow(contributionPower, iteration);","    }","    return value;","}","float iterateWarp (vec3 coord, float detailPower, float flowPower, float contributionPower)","{","    float value = 0.;","    float itValue = 0.;","    for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)","    {","        float detailScale = pow(detailPower, iteration);","        float flowScale = pow(flowPower, iteration);","        itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);","        value += itValue / pow(contributionPower, iteration);","    }","    return value;","}","vec3 warp (vec3 coord)","{","    vec3 o2 = vec3(11.3, 23.7, 13.1);","    vec3 o3 = vec3(29.9, 2.3, 31.7);","    float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);","    float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);","    float coord3 = iterateWarp(coord + o3, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);","    return vec3(coord1, coord2, coord3);","}","void main ()","{","    vec3 coord = (vec3(outTexCoord, 0.0) * uCells) + uOffset;","    if (uWarpAmount > 0.)","    {","        coord += warp(coord) * uWarpAmount;","    }","    float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;","    value = pow(clamp(value, 0., 1.), uValuePower);","    #ifndef NORMAL_MAP","    vec4 color = mix(uColorStart, uColorEnd, value);","    color.rgb *= color.a;","    gl_FragColor = color;","    #else","    float dx = dFdx(value) * uNormalScale;","    float dy = dFdy(value) * uNormalScale;","    vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;","    gl_FragColor = vec4(normal, 1.0);","    #endif","}"].join("\n")},17205(e){e.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uSeedX;","uniform vec2 uSeedY;","uniform vec2 uCells;","uniform vec2 uCellOffset;","uniform vec2 uVariation;","uniform vec2 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec2 p)","{","    return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","vec2 bigCoord (vec2 coord, float scale)","{","    return (coord + uCellOffset) * scale * uCells;","}","vec2 hash2D (vec2 coord)","{","    return vec2(","        trig(coord + uSeedX),","        trig(coord + uSeedY)","    ) * uVariation;","}","float worley2D (vec2 uv, float scale)","{","    vec2 coord = bigCoord(uv, scale);","    vec2 point = floor(coord);","    vec2 frac = fract(coord);","    float dist = 12.0;","    for (float j = -1.0; j <= 1.0; j++)","    for (float i = -1.0; i <= 1.0; i++)","    {","        vec2 cellNeighbor = vec2(i, j);","        vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));","        vec2 diff = cellNeighbor - frac + jitter;","        float d = dot(diff, diff); // Squared length of diff.","        if (d < dist)","        {","            dist = d;","        }","    }","    return sqrt(dist);","}","float worley2DIndex (vec2 uv, float scale)","{","    vec2 coord = bigCoord(uv, scale);","    vec2 point = floor(coord);","    vec2 frac = fract(coord);","    float dist = 12.0;","    float random = 0.0;","    for (float j = -1.0; j <= 1.0;
2 j++)","    for (float i = -1.0; i <= 1.0; i++)","    {","        vec2 cellNeighbor = vec2(i, j);","        vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));","        vec2 diff = cellNeighbor - frac + jitter;","        float d = dot(diff, diff); // Squared length of diff.","        if (d < dist)","        {","            dist = d;","            random = jitter.x;","        }","    }","    return random;","}","float worley2DSmooth (vec2 uv, float scale)","{","    vec2 coord = bigCoord(uv, scale);","    vec2 point = floor(coord);","    vec2 frac = fract(coord);","    float value = 0.0;","    for (float j = -1.0; j <= 1.0; j++)","    for (float i = -1.0; i <= 1.0; i++)","    {","        vec2 cellNeighbor = vec2(i, j);","        vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));","        vec2 diff = cellNeighbor - frac + jitter;","        float d = length(diff);","        value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length.","    }","    return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley2D (vec2 uv)","{","    float value = 0.0;","    float itValue = 0.0;","    for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)","    {","        float scale = exp2(iteration);","        #ifdef MODE_DISTANCE","            itValue = worley2D(uv + iteration, scale);","        #endif","        #ifdef MODE_INDEX","            itValue = worley2DIndex(uv + iteration, scale);","        #endif","        #ifdef MODE_DISTANCE_SMOOTH","            itValue = worley2DSmooth(uv + iteration, scale);","        #endif","        value += (itValue - 0.5) / scale;","    }","    return value + 0.5;","}","void main ()","{","    float value = iterateWorley2D(outTexCoord);","    #ifndef NORMAL_MAP","        vec4 color = mix(uColorStart, uColorEnd, value);","        color.rgb *= color.a;","        gl_FragColor = color;","    #else","        float dx = dFdx(value) * uNormalScale;","        float dy = dFdy(value) * uNormalScale;","        vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;","        gl_FragColor = vec4(normal, 1.0);","    #endif","}"].join("\n")},79814(e){e.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uSeedX;","uniform vec3 uSeedY;","uniform vec3 uSeedZ;","uniform vec3 uCells;","uniform vec3 uCellOffset;","uniform vec3 uVariation;","uniform vec3 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec3 p)","{","    return fract(43757.5453*sin(dot(p, vec3(12.9898,78.233, 9441.8953))));","}","vec3 bigCoord (vec3 coord, float scale)","{","    return (coord + uCellOffset) * scale * uCells;","}","vec3 hash3D (vec3 coord)","{","    return vec3(","        trig(coord + uSeedX),","        trig(coord + uSeedY),","        trig(coord + uSeedZ)","    ) * uVariation;","}","float worley3D (vec3 uv, float scale)","{","    vec3 coord = bigCoord(uv, scale);","    vec3 point = floor(coord);","    vec3 frac = fract(coord);","    float dist = 12.0;","    for (float k = -1.0; k <= 1.0; k++)","    for (float j = -1.0; j <= 1.0; j++)","    for (float i = -1.0; i <= 1.0; i++)","    {","        vec3 cellNeighbor = vec3(i, j, k);","        vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));","        vec3 diff = cellNeighbor - frac + jitter;","        float d = dot(diff, diff); // Squared length of diff.","        if (d < dist)","        {","            dist = d;","        }","    }","    return sqrt(dist);","}","float worley3DIndex (vec3 uv, float scale)","{","    vec3 coord = bigCoord(uv, scale);","    vec3 point = floor(coord);","    vec3 frac = fract(coord);","    float dist = 12.0;","    float random = 0.0;","    for (float k = -1.0; k <= 1.0; k++)","    for (float j = -1.0; j <= 1.0;
2 j++)","    for (float i = -1.0; i <= 1.0; i++)","    {","        vec3 cellNeighbor = vec3(i, j, k);","        vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));","        vec3 diff = cellNeighbor - frac + jitter;","        float d = dot(diff, diff); // Squared length of diff.","        if (d < dist)","        {","            dist = d;","            random = jitter.x;","        }","    }","    return random;","}","float worley3DSmooth (vec3 uv, float scale)","{","    vec3 coord = bigCoord(uv, scale);","    vec3 point = floor(coord);","    vec3 frac = fract(coord);","    float value = 0.0;","    for (float k = -1.0; k <= 1.0; k++)","    for (float j = -1.0; j <= 1.0; j++)","    for (float i = -1.0; i <= 1.0; i++)","    {","        vec3 cellNeighbor = vec3(i, j, k);","        vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));","        vec3 diff = cellNeighbor - frac + jitter;","        float d = length(diff);","        value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length.","    }","    return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley3D (vec3 uv)","{","    float value = 0.0;","    float itValue = 0.0;","    for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)","    {","        float scale = exp2(iteration);","        #ifdef MODE_DISTANCE","            itValue = worley3D(uv + iteration, scale);","        #endif","        #ifdef MODE_INDEX","            itValue = worley3DIndex(uv + iteration, scale);","        #endif","        #ifdef MODE_DISTANCE_SMOOTH","            itValue = worley3DSmooth(uv + iteration, scale);","        #endif","        value += (itValue - 0.5) / scale;","    }","    return value + 0.5;","}","void main ()","{","    vec3 uv = vec3(outTexCoord, 0.0);","    float value = iterateWorley3D(uv);","    #ifndef NORMAL_MAP","        vec4 color = mix(uColorStart, uColorEnd, value);","        color.rgb *= color.a;","        gl_FragColor = color;","    #else","        float dx = dFdx(value) * uNormalScale;","        float dy = dFdy(value) * uNormalScale;","        vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;","        gl_FragColor = vec4(normal, 1.0);","    #endif","}"].join("\n")},99595(e){e.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec4 uSeedX;","uniform vec4 uSeedY;","uniform vec4 uSeedZ;","uniform vec4 uSeedW;","uniform vec4 uCells;","uniform vec4 uCellOffset;","uniform vec4 uVariation;","uniform vec4 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec4 p)","{","    return fract(43757.5453*sin(dot(p, vec4(12.9898,78.233,9441.8953,61.99))));","}","vec4 bigCoord (vec4 coord, float scale)","{","    return (coord + uCellOffset) * scale * uCells;","}","vec4 hash4D (vec4 coord)","{","    return vec4(","        trig(coord + uSeedX),","        trig(coord + uSeedY),","        trig(coord + uSeedZ),","        trig(coord + uSeedW)","    ) * uVariation;","}","float worley4D (vec4 uv, float scale)","{","    vec4 coord = bigCoord(uv, scale);","    vec4 point = floor(coord);","    vec4 frac = fract(coord);","    float dist = 16.0;","    for (float l = -1.0; l <= 1.0; l++)","    for (float k = -1.0; k <= 1.0; k++)","    for (float j = -1.0; j <= 1.0; j++)","    for (float i = -1.0; i <= 1.0; i++)","    {","        vec4 cellNeighbor = vec4(i, j, k, l);","        vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));","        vec4 diff = cellNeighbor - frac + jitter;","        float d = dot(diff, diff); // Squared length of diff.","        if (d < dist)","        {","            dist = d;","        }","    }","    return sqrt(dist);","}","float worley4DIndex (vec4 uv, float scale)","{","    vec4 coord = bigCoord(uv, scale);","    vec4 point = floor(coord);","    vec4 frac = fract(coord);","    float dist = 16.0;","    float random = 0.0;","    for (float l = -1.0; l <= 1.0; l++)","    for (float k = -1.0; k <= 1.0; k++)","    for (float j = -1.0; j <= 1.0;
2 j++)","    for (float i = -1.0; i <= 1.0; i++)","    {","        vec4 cellNeighbor = vec4(i, j, k, l);","        vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));","        vec4 diff = cellNeighbor - frac + jitter;","        float d = dot(diff, diff); // Squared length of diff.","        if (d < dist)","        {","            dist = d;","            random = jitter.x;","        }","    }","    return random;","}","float worley4DSmooth (vec4 uv, float scale)","{","    vec4 coord = bigCoord(uv, scale);","    vec4 point = floor(coord);","    vec4 frac = fract(coord);","    float value = 0.0;","    for (float l = -1.0; l <= 1.0; l++)","    for (float k = -1.0; k <= 1.0; k++)","    for (float j = -1.0; j <= 1.0; j++)","    for (float i = -1.0; i <= 1.0; i++)","    {","        vec4 cellNeighbor = vec4(i, j, k, l);","        vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));","        vec4 diff = cellNeighbor - frac + jitter;","        float d = length(diff);","        value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length.","    }","    return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley4D (vec4 uv)","{","    float value = 0.0;","    float itValue = 0.0;","    for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)","    {","        float scale = exp2(iteration);","        #ifdef MODE_DISTANCE","            itValue = worley4D(uv + iteration, scale);","        #endif","        #ifdef MODE_INDEX","            itValue = worley4DIndex(uv + iteration, scale);","        #endif","        #ifdef MODE_DISTANCE_SMOOTH","            itValue = worley4DSmooth(uv + iteration, scale);","        #endif","        value += (itValue - 0.5) / scale;","    }","    return value + 0.5;","}","void main ()","{","    vec4 uv = vec4(outTexCoord, 0.0, 0.0);","    float value = iterateWorley4D(uv);","    #ifndef NORMAL_MAP","        vec4 color = mix(uColorStart, uColorEnd, value);","        color.rgb *= color.a;","        gl_FragColor = color;","    #else","        float dx = dFdx(value) * uNormalScale;","        float dy = dFdy(value) * uNormalScale;","        vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;","        gl_FragColor = vec4(normal, 1.0);","    #endif","}"].join("\n")},62807(e){e.exports=["float inverseRotation = -rotation - uCamera.z;","float irSine = sin(inverseRotation);","float irCosine = cos(inverseRotation);","outInverseRotationMatrix = mat3(","    irCosine, irSine, 0.0,","    -irSine, irCosine, 0.0,","    0.0, 0.0, 1.0",");"].join("\n")},4127(e){e.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform float uCameraZoom;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","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;","    #pragma phaserTemplate(fragmentProcess)","    gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}"].join("\n")},89924(e){e.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(vertexDefine)","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;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","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);","    #pragma phaserTemplate(vertexProcess)","}"].join("\n")},68589(e){e.exports=["#extension GL_OES_standard_derivatives : enable","#define BAND_TREE_DEPTH 0.0","uniform sampler2D uRampTexture;","uniform vec2 uRampResolution;","uniform float uRampBandStart;","uniform bool uDither;","float decodeNumberSample(vec4 sample)","{","    return (","        sample.r * 255.0 +","        sample.g * 255.0 * 256.0 +","        sample.b * 255.0 * 256.0 * 256.0 +","        sample.a * 255.0 * 256.0 * 256.0 * 256.0","    ) / 256.0 / 256.0;","}","struct Band","{","    vec4 colorStart;","    vec4 colorEnd;","    float start;","    float end;","    int colorSpace;","    int interpolation;","    float middle;","};","Band getBand(float progress)","{","    vec2 rampStep = 1.0 / uRampResolution;","    vec2 c = rampStep / 2.0;","    float start = decodeNumberSample(texture2D(uRampTexture, c));","    float end = decodeNumberSample(texture2D(uRampTexture, vec2(1.0, 0.0) * rampStep + c));","    float TREE_OFFSET = 2.0; // Beginning of tree block.","    float index = 0.0;","    float x, y;","    for (float i = 0.0; i < BAND_TREE_DEPTH; i++)","    {","        x = mod(index + TREE_OFFSET, uRampResolution.x);","        y = floor(x / uRampResolution.x);","        float pivot = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));","        if (progress > pivot)","        {","            start = pivot;","            index = index * 2.0 + 2.0;","        }","        else","        {","            end = pivot;","            index = index * 2.0 + 1.0;","        }","    }","    float bandNumber = index - uRampBandStart + TREE_OFFSET;","    float bandIndex = bandNumber * 3.0 + uRampBandStart;","    x =  mod(bandIndex, uRampResolution.x);","    y = floor(bandIndex / uRampResolution.x);","    vec4 colorStart = texture2D(uRampTexture, vec2(x, y) * rampStep + c);","    x =  mod(bandIndex + 1.0, uRampResolution.x);","    y = floor(bandIndex / uRampResolution.x);","    vec4 colorEnd = texture2D(uRampTexture, vec2(x, y) * rampStep + c);","    x =  mod(bandIndex + 2.0, uRampResolution.x);","    y = floor(bandIndex / uRampResolution.x);","    float bandData = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));","    int colorSpace = int(floor(bandData / 255.0));","    int interpolation = int(floor(bandData)) - colorSpace * 255;","    return Band(colorStart, colorEnd, start, end, colorSpace, interpolation, fract(bandData) * 2.0);","}","float interpolate(float progress, int mode)","{","    if (mode == 1)","    {","        if ((progress *= 2.0) < 1.0)","        {","            return 0.5 * sqrt(1.0 - (--progress * progress));","        }","        progress = 1.0 - progress;","        return 1.0 - 0.5 * sqrt(1.0 - progress * progress);","    }","    if (mode == 2)","    {","        return sin((progress - 0.5) * 3.14159265358979323846) * 0.5 + 0.5;","    }","    if (mode == 3)","    {","        return sqrt(1.0 - (--progress * progress));","    }","    if (mode == 4)","    {","        return 1.0 - sqrt(1.0 - progress * progress);","    }","    return progress;","}","float ditherIGN(float value)","{","    float dx = dFdx(value);","    float dy = dFdy(value);","    float rateOfChange = sqrt(dx * dx + dy * dy);","    value += (fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5) * rateOfChange;","    return value;","}","vec4 rgbaToHsva(vec4 rgba)","{","    float r = rgba.r;","    float g = rgba.g;","    float b = rgba.b;","    float a = rgba.a;","    float min = min(min(r, g), b);","    float max = max(max(r, g), b);","    float d = max - min;","    float h = 0.0;","    float s = (max == 0.0) ? 0.0 : d / max;","    float v = max;","    if (max != min)","    {","        if (max == r)","        {","            h = (g - b) / d + ((g < b) ? 6.0 : 0.0);","        }","        else if (max == g)","        {","            h = (b - r) / d + 2.0;","        }","        else","        {","            h = (r - g) / d + 4.0;","        }","        h /= 6.0;","    }","    return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{","    float k = mod(n + hsva.x * 6.0, 6.0);","    float min = min(min(k, 4.0 - k), 1.0);","    return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{","    return vec4(","        hsvaToRgbaConvert(5.0, hsva),","        hsvaToRgbaConvert(3.0, hsva),","        hsvaToRgbaConvert(1.0, hsva),","        hsva.a","    );","}
2","vec4 mixBandColor(float progress, Band band)","{","    if (band.colorSpace == 0)","    {","        return mix(band.colorStart, band.colorEnd, progress);","    }","    vec4 hsvaStart = rgbaToHsva(band.colorStart);","    vec4 hsvaEnd = rgbaToHsva(band.colorEnd);","    if (band.colorSpace == 1)","    {","        float dH = hsvaStart.x - hsvaEnd.x;","        if (dH > 0.5)","        {","            hsvaStart.x -= 1.0;","        }","        else if (dH < -0.5)","        {","            hsvaStart.x += 1.0;","        }","    }","    else if (band.colorSpace == 2)","    {","        if (hsvaStart.x > hsvaEnd.x)","        {","            hsvaStart.x -= 1.0;","        }","    }","    else if (band.colorSpace == 3)","    {","        if (hsvaStart.x < hsvaEnd.x)","        {","            hsvaStart.x += 1.0;","        }","    }","    vec4 hsvaMix = mix(hsvaStart, hsvaEnd, progress);","    hsvaMix.x = mod(hsvaMix.x, 1.0);","    return hsvaToRgba(hsvaMix);","}","vec4 getRampAt(float progress)","{","    Band band = getBand(progress);","    float bandProgress = (progress - band.start) / (band.end - band.start);","    float gamma = log(0.5) / log(band.middle);","    bandProgress = pow(bandProgress, gamma);","    bandProgress = interpolate(bandProgress, band.interpolation);","    if (uDither)","    {","        bandProgress = ditherIGN(bandProgress);","    }","    return mixBandColor(bandProgress, band);","}"].join("\n")},72823(e){e.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{","    vec4 fragColor = vec4(outTexCoord.xyx, 1.0);","    #pragma phaserTemplate(fragmentProcess)","    gl_FragColor = fragColor;","}"].join("\n")},65884(e){e.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{","    gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","    outTexCoord = inTexCoord;","    #pragma phaserTemplate(vertexProcess)","}"].join("\n")},2807(e){e.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outFragCoord;","varying vec2 outTexCoord;","void main ()","{","    outFragCoord = inPosition.xy * 0.5 + 0.5;","    outTexCoord = inTexCoord;","    gl_Position = vec4(inPosition, 0, 1);","}"].join("\n")},49119(e){e.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying vec4 outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{","    #pragma phaserTemplate(fragmentProcess)","    gl_FragColor = fragColor;","}"].join("\n")},3524(e){e
vendor: 15,882 bytes, line 2
2.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#define ROUND_BIAS 0.5001","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform mat3 uViewMatrix;","uniform vec3 uCameraScrollAndAlpha;","uniform int uRoundPixels;","uniform vec2 uResolution;","uniform float uTime;","uniform vec2 uDiffuseResolution;","uniform vec2 uFrameDataResolution;","uniform sampler2D uFrameDataTexture;","uniform float uGravity;","attribute float inVertex;","attribute vec4 inPositionX;","attribute vec4 inPositionY;","attribute vec4 inRotation;","attribute vec4 inScaleX;","attribute vec4 inScaleY;","attribute vec4 inAlpha;","attribute vec4 inFrame;","attribute vec4 inTintBlend;","attribute vec4 inTintTL;","attribute vec4 inTintTR;","attribute vec4 inTintBL;","attribute vec4 inTintBR;","attribute vec4 inOriginAndTintModeAndCreationTime;","attribute vec2 inScrollFactor;","varying vec2 outTexCoord;","varying vec4 outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","const float PI = 3.14159265359;","const float HALF_PI = PI / 2.0;","const float BOUNCE_OVERSHOOT = 1.70158;","const float BOUNCE_OVERSHOOT_PLUS = BOUNCE_OVERSHOOT + 1.0;","const float BOUNCE_OVERSHOOT_IN_OUT = BOUNCE_OVERSHOOT * 1.525;","const float BOUNCE_OVERSHOOT_IN_OUT_PLUS = BOUNCE_OVERSHOOT_IN_OUT + 1.0;","float animate (vec4 anim)","{","    float value = anim.x;","    float a = anim.y;","    float b = abs(anim.z);","    float c = abs(anim.w);","    bool yoyo = anim.z < 0.0;","    bool loop = anim.w > 0.0;","    int type = int(floor(c));","    if (type == 0|| b == 0.0)","    {","        return value;","    }","    float duration = b;","    float delay = mod(c, 1.0) * 2.0;","    float rawTime = ((uTime - inOriginAndTintModeAndCreationTime.w) / duration) - delay;","    float time = mod(rawTime, 1.0);","    if (yoyo && (mod(rawTime, 2.0) >= 1.0))","    {","        time = 1.0 - time;","    }","    float repeats = loop ? 0.0 : floor(a);","    float timeContinuous = loop ? time : rawTime;","    #ifdef FEATURE_LINEAR","    if (type == 1)","    {","        return value + a * timeContinuous;","    }","    #endif","    #ifdef FEATURE_GRAVITY","    if (type == 2)","    {","        float v = floor(a);","        float gravityFactor = (a - v) * 2.0 - 1.0;","        if (gravityFactor == 0.0)","        {","            gravityFactor = 1.0;","        }","        float seconds = timeContinuous * duration / 1000.0;","        float accel = uGravity * gravityFactor;","        return value + (v * seconds) + (0.5 * accel * seconds * seconds);","    }","    #endif","    #ifdef FEATURE_QUAD_EASEOUT","    if (type == 10)","    {","        return value + a * time * (2.0 - time)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_QUAD_EASEIN","    if (type == 11)","    {","        return value + a * time * time","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_QUAD_EASEINOUT","    if (type == 12)","    {","        time *= 2.0;","        if (time < 1.0)","        {","            return value + a * time * time * 0.5","                + repeats * a;","        }","        time -= 1.0;","        return value + a * -0.5 * (time * (time - 2.0) - 1.0)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_CUBIC_EASEOUT","    if (type == 20)","    {","        time -= 1.0;","        return value + a * (time * time * time + 1.0)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_CUBIC_EASEIN","    if (type == 21)","    {","        return value + a * time * time * time","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_CUBIC_EASEINOUT","    if (type == 22)","    {","        time *= 2.0;","        if (time < 1.0)","        {","            return value + a * time * time * time * 0.5","                + repeats * a;","        }","        time -= 2.0;","        return value + a * 0.5 * (time * time * time + 2.0)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_QUART_EASEOUT","    if (type == 30)","    {","        time -= 1.0;","        return value + a * (1.0 - time * time * time * time)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_QUART_EASEIN","    if (type == 31)","    {","        return value + a * time * time * time * time","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_QUART_EASEINOUT","    if (type == 32)","    {","        time *= 2.0;","        if (time < 1.0)","        {","            return value + a * time * time * time * time * 0.5","                + repeats * a;","        }","        time -= 2.0;","        return value + a * -0.5 * (time * time * time * time - 2.0)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_QUINT_EASEOUT","    if (type == 40)","    {","        time -= 1.0;","        return value + a * (time * time * time * time * time + 1.0)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_QUINT_EASEIN","    if (type == 41)","    {","        return value + a * time * time * time * time * time","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_QUINT_EASEINOUT","    if (type == 42)","    {","        time *= 2.0;","        if (time < 1.0)","        {","            return value + a * time * time * time * time * time * 0.5","                + repeats * a;","        }","        time -= 2.0;","        return value + a * 0.5 * (time * time * time * time * time + 2.0)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_SINE_EASEOUT","    if (type == 50)","    {","        return value + a * sin(time * HALF_PI)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_SINE_EASEIN","    if (type == 51)","    {","        return value + a * (1.0 - cos(time * HALF_PI))","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_SINE_EASEINOUT","    if (type == 52)","    {","        return value + a * 0.5 * (1.0 - cos(PI * time))","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_EXPO_EASEOUT","    if (type == 60)","    {","        return value + a * (1.0 - pow(2.0, -10.0 * time))","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_EXPO_EASEIN","    if (type == 61)","    {","        return value + a * pow(2.0, 10.0 * (time - 1.0) - 0.001)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_EXPO_EASEINOUT","    if (type == 62)","    {","        time *= 2.0;","        if (time < 1.0)","        {","            return value + a * 0.5 * pow(2.0, 10.0 * (time - 1.0))","                + repeats * a;","        }","        time -= 1.0;","        return value + a * 0.5 * (2.0 - pow(2.0, -10.0 * (time - 1.0)))","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_CIRC_EASEOUT","    if (type == 70)","    {","        time -= 1.0;","        return value + a * sqrt(1.0 - time * time)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_CIRC_EASEIN","    if (type == 71)","    {","        return value + a * (1.0 - sqrt(1.0 - time * time))","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_CIRC_EASEINOUT","    if (type == 72)","    {","        time *= 2.0;","        if (time < 1.0)","        {","            return value + a * -0.5 * (sqrt(1.0 - time * time) - 1.0)","                + repeats * a;","        }","        time -= 2.0;","        return value + a * 0.5 * (sqrt(1.0 - time * time) + 1.0)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_BACK_EASEOUT","    if (type == 90)","    {","        time -= 1.0;","        return value + a * (time * time * (BOUNCE_OVERSHOOT_PLUS * time + BOUNCE_OVERSHOOT) + 1.0)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_BACK_EASEIN","    if (type == 91)","    {","        return value + a * time * time * (BOUNCE_OVERSHOOT_PLUS * time - BOUNCE_OVERSHOOT)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_BACK_EASEINOUT","    if (type == 92)","    {","        time *= 2.0;","        if (time < 1.0)","        {","            return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time - BOUNCE_OVERSHOOT_IN_OUT))","                + repeats * a;","        }","        time -= 2.0;","        return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time + BOUNCE_OVERSHOOT_IN_OUT) + 2.0)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_BOUNCE_EASEOUT","    if (type == 100)","    {","        if (time < 1.0 / 2.75)","        {","            return value + a * (7.5625 * time * time)","                + repeats * a;","        }","        else if (time < 2.0 / 2.75)","        {","            time -= 1.5 / 2.75;","            return value + a * (7.5625 * time * time + 0.75)","                + repeats * a;","        }","        else if (time < 2.5 / 2.75)","        {","            time -= 2.25 / 2.75;","            return value + a * (7.5625 * time * time + 0.9375)","                + repeats * a;","        }","        else","        {","            time -= 2.625 / 2.75;","            return value + a * (7.5625 * time * time + 0.984375)","                + repeats * a;","        }","    }","    #endif","    #ifdef FEATURE_BOUNCE_EASEIN","    if (type == 101)","    {","        time = 1.0 - time;","        if (time < 1.0 / 2.75)","        {","            return value + a * (1.0 - 7.5625 * time * time)","                + repeats * a;","        }","        else if (time < 2.0 / 2.75)","        {","            time -= 1.5 / 2.75;","            return value + a * (1.0 - (7.5625 * time * time + 0.75))","                + repeats * a;","        }","        else if (time < 2.5 / 2.75)","        {","            time -= 2.25 / 2.75;","            return value + a * (1.0 - (7.5625 * time * time + 0.9375))","                + repeats * a;","        }","        else","        {","            time -= 2.625 / 2.75;","            return value + a * (1.0 - (7.5625 * time * time + 0.984375))","                + repeats * a;","        }","    }","    #endif","    #ifdef FEATURE_BOUNCE_EASEINOUT","    if (type == 102)","    {","        bool reverse = false;","        if (time < 0.5)","        {","            time = 1.0 - time * 2.0;","            reverse = true;","        }","        if (time < 1.0 / 2.75)","        {","            time = 7.5625 * time * time;","        }","        else if (time < 2.0 / 2.75)","        {","            time -= 1.5 / 2.75;","            time = 7.5625 * time * time + 0.75;","        }","        else if (time < 2.5 / 2.75)","        {","            time -= 2.25 / 2.75;","            time = 7.5625 * time * time + 0.9375;","        }","        else","        {","            time -= 2.625 / 2.75;","            time = 7.5625 * time * time + 0.984375;","        }","        if (reverse)","        {","            return value + a * (1.0 - time) * 0.5","                + repeats * a;","        }","        return value + a * time * 0.5 + 0.5","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_STEPPED","    if (type == 110)","    {","        return value + a * floor(time + 0.5)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_SMOOTHSTEP_EASEOUT","    if (type == 120)","    {","        return value + a * (smoothstep(0.0, 1.0, time / 2.0 + 0.5) * 2.0 - 1.0)","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_SMOOTHSTEP_EASEIN","    if (type == 121)","    {","        return value + a * smoothstep(0.0, 1.0, time / 2.0) * 2.0","            + repeats * a;","    }","    #endif","    #ifdef FEATURE_SMOOTHSTEP_EASEINOUT","    if (type == 122)","    {","        return value + a * smoothstep(0.0, 1.0, time)","            + repeats * a;","    }","    #endif","    return value;","}","struct Frame {","    vec2 position;","    vec2 size;","    vec2 offset;","};","Frame getFrame (float frame)","{","    float index1 = floor(frame) * 3.0;","    float index2 = index1 + 1.0;","    float index3 = index1 + 2.0;","    float width = uFrameDataResolution.x;","    float x = mod(index1, width);","    float y = floor(index1 / width);","    vec4 texelUV = texture2D(","        uFrameDataTexture,","        vec2(x + 0.5, y + 0.5) / uFrameDataResolution","    );","    x = mod(index2, width);","    y = floor(index2 / width);","    vec4 texelWH = texture2D(","        uFrameDataTexture,","        vec2(x + 0.5, y + 0.5) / uFrameDataResolution","    );","    x = mod(index3, width);","    y = floor(index3 / width);","    vec4 texelOrigin = texture2D(","        uFrameDataTexture,","        vec2(x + 0.5, y + 0.5) / uFrameDataResolution","    );","    return Frame(","        vec2(","            texelUV.r + texelUV.g * 256.0,","            texelUV.b + texelUV.a * 256.0","        ) * 255.0,","        vec2(","            texelWH.r + texelWH.g * 256.0,","            texelWH.b + texelWH.a * 256.0","        ) * 255.0,","        vec2(","            texelOrigin.r + texelOrigin.g * 256.0,","            texelOrigin.b + texelOrigin.a * 256.0","        ) * 255.0 - 32768.0","    );","}","void main ()","{","    float positionX = animate(inPositionX);","    float positionY = animate(inPositionY);","    float rotation = animate(inRotation);","    float scaleX = animate(inScaleX);","    float scaleY = animate(inScaleY);","    float frame = animate(inFrame);","    float tintBlend = animate(inTintBlend);","    float alpha = animate(inAlpha);","    vec2 origin = inOriginAndTintModeAndCreationTime.xy;","    float tintMode = inOriginAndTintModeAndCreationTime.z;","    float scrollFactorX = inScrollFactor.x;","    float scrollFactorY = inScrollFactor.y;","    Frame frameData = getFrame(frame);","    vec2 uv = frameData.position / uDiffuseResolution;","    vec2 wh = frameData.size / uDiffuseResolution;","    float u = uv.s;","    float v = uv.t;","    float w = wh.s;","    float h = wh.t;","    float width = frameData.size.s;","    float height = frameData.size.t;","    vec4 tint = inTintTL;","    float x = -origin.x;","    float y = -origin.y;","    if (inVertex == 0.0)","    {","        y = 1.0 - origin.y;","        v += h;","        tint = inTintBL;","    }","    else if (inVertex == 2.0)","    {","        x = 1.0 - origin.x;","        y = 1.0 - origin.y;","        u += w;","        v += h;","        tint = inTintBR;","    }","    else if (inVertex == 3.0)","    {","        x = 1.0 - origin.x;","        u += w;","        tint = inTintTR;","    }","    vec3 position = vec3(","        (x * width - frameData.offset.x) * scaleX,","        (y * height - frameData.offset.y) * scaleY,","        1.0","    );","    mat3 viewMatrix = uViewMatrix * mat3(","        1.0, 0.0, 0.0,","        0.0, 1.0, 0.0,","        uCameraScrollAndAlpha.x * (1.0 - scrollFactorX), uCameraScrollAndAlpha.y * (1.0 - scrollFactorY), 1.0","    );","    float sine = sin(rotation);","    float cosine = cos(rotation);","    mat3 transformMatrix = mat3(","        cosine, sine, 0.0,","        -sine, cosine, 0.0,","        positionX, positionY, 1.0","    );","    position = viewMatrix * transformMatrix * position;","    alpha *= uCameraScrollAndAlpha.z;","    tint.a *= alpha;","    if (uRoundPixels == 1 && rotation == 0.0 && scaleX == 1.0 && scaleY == 1.0)","    {","        position.xy = floor(position.xy + ROUND_BIAS);","    }","    gl_Position = uProjectionMatrix * vec4(position.xy, 1.0, 1.0);","    outTexCoord = vec2(u, 1.0 - v);","    outTint = mix(vec4(1.0, 1.0, 1.0, tint.a), tint, tintBlend);","    outTintEffect = vec4(0.0, 0.0, 0.0, tintMode * 255.0); // Denormalize tint mode to an integer.","    #pragma phaserTemplate(vertexProcess)","}"].join("\n")},57532(
2e){e.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","/* Redefine MAX_ANIM_FRAMES to support animations with different frame numbers. */","#define MAX_ANIM_FRAMES 0","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uLayerSampler;","uniform vec2 uMainResolution;","uniform vec2 uLayerResolution;","uniform float uTileColumns;","uniform vec4 uTileWidthHeightMarginSpacing;","uniform float uAlpha;","uniform float uTime;","#if MAX_ANIM_FRAMES > 0","uniform sampler2D uAnimSampler;","uniform vec2 uAnimResolution;","#endif","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","vec2 getTexRes ()","{","    return uMainResolution;","}","float floatTexel (vec4 texel)","{","    return texel.r * 255.0 + (texel.g * 255.0 * 256.0) + (texel.b * 255.0 * 256.0 * 256.0) + (texel.a * 255.0 * 256.0 * 256.0 * 256.0);","}","struct Tile","{","    float index;","    vec2 uv; // In texels.","    #if MAX_ANIM_FRAMES > 0","    bool animated;","    #endif","    bool empty;","};","Tile getLayerData (vec2 coord)","{","    vec2 texelCoord = coord * uLayerResolution;","    vec2 tile = floor(texelCoord);","    vec2 uv = fract(texelCoord);","    uv.y = 1.0 - uv.y;","    vec4 texel = texture2D(uLayerSampler, (tile + 0.5) / uLayerResolution) * 255.0;","    float flags = texel.a;","    /* Check for empty tile flag in bit 28. */","    if (flags == 16.0)","    {","        return Tile(","            0.0,","            vec2(0.0),","            #if MAX_ANIM_FRAMES > 0","            false,","            #endif","            true","        );","    }","    /* Bit 31 is flipX. */","    bool flipX = flags > 127.0;","    /* Bit 30 is flipY. */","    bool flipY = mod(flags, 128.0) > 63.0;","    #if MAX_ANIM_FRAMES > 0","    /* Bit 29 is animation. */","    bool animated = mod(flags, 64.0) > 31.0;","    #endif","    if (flipX)","    {","        uv.x = 1.0 - uv.x;","    }","    if (flipY)","    {","        uv.y = 1.0 - uv.y;","    }","    float index = texel.r + (texel.g * 256.0) + (texel.b * 256.0 * 256.0);","    return Tile(","        index,","        uv * uTileWidthHeightMarginSpacing.xy,","        #if MAX_ANIM_FRAMES > 0","        animated,","        #endif","        false","    );","}","vec2 getFrameCorner (float index)","{","    float x = mod(index, uTileColumns);","    float y = floor(index / uTileColumns);","    vec2 xy = vec2(x, y);","    return xy * outTileStride + uTileWidthHeightMarginSpacing.zz;","}","#if MAX_ANIM_FRAMES > 0","float animationIndex (float index)","{","    float animTextureWidth = uAnimResolution.x;","    vec2 index2D = vec2(mod(index, animTextureWidth), floor(index / animTextureWidth));","    vec4 animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);","    index2D = vec2(mod(index + 1.0, animTextureWidth), floor((index + 1.0) / animTextureWidth));","    vec4 animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);","    float animDuration = floatTexel(animDurationTexel);","    float animIndex = floatTexel(animIndexTexel);","    float animTime = mod(uTime, animDuration);","    float animTimeAccum = 0.0;","    for (int i = 0; i < MAX_ANIM_FRAMES; i++)","    {","        index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));","        animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);","        float frameDuration = floatTexel(animDurationTexel);","        animTimeAccum += frameDuration;","        if (animTime <= animTimeAccum)","        {","            break;","        }","        animIndex += 2.0;","    }","    animIndex += 1.0;","    index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));","    animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);","    float animFrameIndex = floatTexel(animIndexTexel);","    return animFrameIndex;","}
2","#endif","vec2 getTileTexelCoord (Tile tile)","{","    if (tile.empty)","    {","        return vec2(0.0);","    }","    float index = tile.index;","    #if MAX_ANIM_FRAMES > 0","    if (tile.animated)","    {","        index = animationIndex(index);","    }","    #endif","    vec2 frameCorner = getFrameCorner(index);","    return frameCorner + tile.uv;","}","#pragma phaserTemplate(fragmentHeader)","struct Samples {","    vec4 color;","    #pragma phaserTemplate(defineSamples)","};","Samples getColorSamples (vec2 texCoord)","{","    Samples samples;","    samples.color = texture2D(","        uMainSampler,","        vec2(texCoord.x, 1.0 - texCoord.y)","    );","    #pragma phaserTemplate(getSamples)","    return samples;","}","Samples mixSamples (Samples samples1, Samples samples2, float alpha)","{","    Samples samples;","    samples.color = mix(samples1.color, samples2.color, alpha);","    #pragma phaserTemplate(mixSamples)","    return samples;","}","Samples getFinalSamples (Tile tile, vec2 layerTexCoord)","{","    vec2 texelCoord = getTileTexelCoord(tile);","    vec2 texCoord = texelCoord / uMainResolution;","    #pragma phaserTemplate(texCoord)","    #ifndef FEATURE_BORDERFILTER","    return getColorSamples(texCoord);","    #else","    #pragma phaserTemplate(finalSamples)","    vec2 wh = uTileWidthHeightMarginSpacing.xy;","    vec2 frameCorner = getFrameCorner(tile.index);","    vec2 frameCornerOpposite = frameCorner + wh;","    vec2 texCoordClamped = clamp(texCoord, (frameCorner + 0.5) / uMainResolution, (frameCornerOpposite - 0.5) / uMainResolution);","    vec2 dTexelCoord = (texCoord - texCoordClamped) * uMainResolution;","    dTexelCoord.y = -dTexelCoord.y;","    vec2 offsets = sign(dTexelCoord);","    Samples samples0 = getColorSamples(texCoordClamped);","    if (offsets.x == 0.0)","    {","        if (offsets.y == 0.0)","        {","            return samples0;","        }","        Tile tileY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);","        vec2 texelCoordY = getTileTexelCoord(tileY);","        vec2 texCoordY = texelCoordY / uMainResolution;","        Samples samplesY = getColorSamples(texCoordY);","        return mixSamples(samples0, samplesY, abs(dTexelCoord.y));","    }","    else","    {","        if (offsets.y == 0.0)","        {","            Tile tileX = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);","            vec2 texelCoordX = getTileTexelCoord(tileX);","            vec2 texCoordX = texelCoordX / uMainResolution;","            Samples samplesX = getColorSamples(texCoordX);","            return mixSamples(samples0, samplesX, abs(dTexelCoord.x));","        }","        Tile tileX = getLayerData(layerTexCoord + (offsets * vec2(1.0, 0.0) - dTexelCoord) / wh / uLayerResolution);","        vec2 texelCoordX = getTileTexelCoord(tileX);","        vec2 texCoordX = texelCoordX / uMainResolution;","        Samples samplesX = getColorSamples(texCoordX);","        Tile tileY = getLayerData(layerTexCoord + (offsets * vec2(0.0, 1.0) - dTexelCoord) / wh / uLayerResolution);","        vec2 texelCoordY = getTileTexelCoord(tileY);","        vec2 texCoordY = texelCoordY / uMainResolution;","        Samples samplesY = getColorSamples(texCoordY);","        Tile tileXY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);","        vec2 texelCoordXY = getTileTexelCoord(tileXY);","        vec2 texCoordXY = texelCoordXY / uMainResolution;","        Samples samplesXY = getColorSamples(texCoordXY);","        Samples samples1 = mixSamples(samples0, samplesX, abs(dTexelCoord.x));","        Samples samples2 = mixSamples(samplesY, samplesXY, abs(dTexelCoord.x));","        return mixSamples(samples1, samples2, abs(dTexelCoord.y));","    }","    #endif","}","void main ()","{","    vec2 layerTexCoord = outTexCoord;","    Tile tile = getLayerData(layerTexCoord);","    Samples samples = getFinalSamples(tile, layerTexCoord);","    vec4 fragColor = samples.color;","    #pragma phaserTemplate(declareSamples)","    #pragma phaserTemplate(fragmentProcess)","    fragColor *= uAlpha;","    gl_FragColor = fragColor;","}"].join("\n")},23879(e){e.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","uniform vec4 uTileWidthHeightMarginSpacing;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{","    gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","    outTexCoord = inTexCoord;","    outTileStride = uTileWidthHeightMarginSpacing.xy + uTileWidthHeightMarginSpacing.zz;","    #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84639(e){e.exports=function(e,t){return{name:e+"Anims",additions:{fragmentDefine:"#undef MAX_ANIM_FRAMES\n#define MAX_ANIM_FRAMES "+e},tags:["MAXANIMS"],disable:!!t}}},94158(e,t,i){var n=i(56113);e.exports=function(e,t,i){var r="AlphaDiscard",s={fragmentHeader:n,fragmentProcess:"fragColor = applyAlphaDiscard(fragColor);"};if(t)r+="Dither",s.fragmentDefine="#define ALPHA_DISCARD_STRATEGY_DITHER";else if(i){r+="Threshold_"+i;var a=i.toString();Math.round(i)===i&&(a+="."),s.fragmentDefine="#define ALPHA_DISCARD_STRATEGY_THRESHOLD "+a}else e=!0;return{name:r,additions:s,tags:["ALPHA_DISCARD"],disable:!!e}}},81084(e,t,i){var n=i(84547);e.exports=function(e){return{name:"ApplyLighting",additions:{fragmentHeader:n,fragmentProcess:"fragColor = applyLighting(fragColor, normal);"},tags:["LIGHTING"],disable:!!e}}},44349(e,t,i){var n=i(11104);e.exports=function(e){return{name:"Tint",additions:{fragmentHeader:n,fragmentProcess:"fragColor = applyTint(fragColor);"},tags:["TINT"],disable:!!e}}},99501(e,t,i){var n=i(81556);e.exports=function(e){return{name:"BoundedSampler",additions:{fragmentHeader:n},disable:!!e}}},6184(e,t,i){var n=i(11719);e.exports=function(e){return{name:"DefineLights",additions:{fragmentDefine:"#define LIGHT_COUNT 1",fragmentHeader:n},tags:["LIGHTING"],disable:!!e}}},11653(e){e.exports=function(e,t){return{name:e+"TexCount",additions:{fragmentDefine:"#define TEXTURE_COUNT "+e},tags:["TexCount"],disable:!!t}}},13198(e){e.exports=function(e){return{name:"FlatNormal",additions:{fragmentProcess:"vec3 normal = vec3(0.0, 0.0, 1.0);"},tags:["LIGHTING"],disable:!!e}}},40829(e,t,i){var n=i(84220);e.exports=function(e){return{name:"NormalMap",additions:{fragmentHeader:n,fragmentProcess:"vec3 normal = getNormalFromMap(texCoord);"},tags:["LIGHTING"],disable:!!e}}},42792(e){e.exports=function(e){return{name:"TexCoordOut",additions:{fragmentProcess:"vec2 texCoord = outTexCoord;\n#pragma phaserTemplate(texCoord)"},tags:["TEXCOORD"],disable:!!e}}},96049(e,t,i){var n=i(2860);e.exports=function(e){return{name:"GetTexRes",additions:{fragmentHeader:n},tags:["TEXRES"],disable:!!e}}},33997(e,t,i){var n=i(46432);e.exports=function(e,t){void 0===e&&(e=1);for(var i="",r=1;r<e;r++)i+="ELSE_TEX_CASE("+r+")\n";return{name:"GetTexture"+e,additions:{fragmentHeader:n.replace("#pragma phaserTemplate(texIdProcess)",i),fragmentProcess:"vec4 fragColor = getTexture(texCoord);"},tags:["TEXTURE"],disable:!!t}}},10455(e){e.exports=function(e){return{name:"OutFrame",additions:{vertexHeader:"attribute vec4 inFrame;",vertexProcess:"outFrame = inFrame;",outVariables:"varying vec4 outFrame;"},disable:!!e}}},79532(e,t,i){var n=i(62807);e.exports=function(e){return{name:"OutInverseRotation",additions:{vertexHeader:"uniform vec4 uCamera;",vertexProcess:n,outVariables:"varying mat3 outInverseRotationMatrix;"},tags:["LIGHTING"],disable:!!e}}},65217(e){e.exports=function(e){return{name:"RotDatum",additions:{vertexProcess:"float rotation = inTexDatum;"},tags:["LIGHTING"],disable:!!e}}},747(e){e.exports=function(e){return{name:"SampleNormal",additions:{defineSamples:"vec4 normal;",getSamples:"samples.normal = texture2D(uNormSampler, texCoord);",mixSamples:"samples.normal = mix(samples1.normal, samples2.normal, alpha);",declareSamples:"vec3 normal = normalize(samples.normal.rgb * 2.0 - 1.0);"},tags:["LIGHTING"],disable:!!e}}},74505(e,t,i){var n=i(78390);e.exports=function(e){return{name:"SmoothPixelArt",additions:{extensions:"#extension GL_OES_standard_derivatives : enable",fragmentHeader:n,texCoord:"texCoord = getBlockyTexCoord(texCoord, getTexRes());"},disable:!!e}}},44832(e,t,i){var n=i(14030);e.exports=function(e){return{name:"TexCoordFrameClamp",additions:{fragmentHeader:n,texCoord:"texCoord = clampTexCoordWithinFrame(texCoord);"},disable:!!e}}},23295(e){e.exports=function(e){return{name:"TexCoordFrameWrap",additions:{texCoord:"// Wrap texture coordinate into the UV space of the texture frame.\ntexCoord = mod(texCoord, 1.0) * outFrame.zw + outFrame.xy;"},disable:!!e}}},83786(e,t,i){e.exports={MakeAnimLength:i(84639),MakeApplyLighting:i(81084),MakeApplyTint:i(44349),MakeBoundedSampler:i(99501),MakeDefineLights:i(6184),MakeDefineTexCount:i(11653),MakeFlatNormal:i(13198),MakeGetNormalFromMap:i(40829),MakeGetTexCoordOut:i(42792),MakeGetTexRes:i(96049),MakeGetTexture:i(33997),MakeOutFrame:i(10455),MakeOutInverseRotation:i(79532),MakeRotationDatum:i(65217),MakeSampleNormal:i(747),MakeSmoothPixelArt:i(74505),MakeTexCoordFrameClamp:i(44832),MakeTexCoordFrameWrap:i(23295)}},89350(e,t,i){e.exports={ApplyAlphaDiscard:i(56113),ApplyLighting:i(84547),ApplyTint:i(11104),BoundedSampler:i(81556),ColorMatrixFrag:i(96293),DefineBlockyTexCoord:i(78390),DefineLights:i(11719),DefineTexCoordFrameClamp:i(14030),FilterBarrelFrag:i(10235),FilterBlendFrag:i(65980),FilterBlockyFrag:i(5899),FilterBlurHighFrag:i(20784),FilterBlurLowFrag:i(65122),FilterBlurMedFrag:i(60942),FilterBokehFrag:i(43722),FilterColorMatrixFrag:i(19883),FilterComb
vendor: 190,972 bytes, line 2
2ineColorMatrixFrag:i(32624),FilterDisplacementFrag:i(12886),FilterGlowFrag:i(33016),FilterGradientMapFrag:i(33179),FilterImageLightFrag:i(94526),FilterKeyFrag:i(4488),FilterMaskFrag:i(39603),FilterNormalToolsFrag:i(60047),FilterPanoramaBlurFrag:i(7529),FilterPixelateFrag:i(99191),FilterQuantizeFrag:i(88430),FilterShadowFrag:i(69355),FilterThresholdFrag:i(92636),FilterVignetteFrag:i(18185),FilterWipeFrag:i(99174),FlatFrag:i(73416),FlatVert:i(91627),GetNormalFromMap:i(84220),GetTexRes:i(2860),GetTexture:i(46432),GradientFrag:i(41509),MultiFrag:i(98840),MultiVert:i(44667),NoiseFrag:i(16421),NoiseSimplex2DFrag:i(83587),NoiseSimplex3DFrag:i(13460),NoiseWorley2DFrag:i(17205),NoiseWorley3DFrag:i(79814),NoiseWorley4DFrag:i(99595),OutInverseRotation:i(62807),PointLightFrag:i(4127),PointLightVert:i(89924),Ramp:i(68589),ShaderQuadFrag:i(72823),ShaderQuadVert:i(65884),SimpleTextureVert:i(2807),SpriteGPULayerFrag:i(49119),SpriteGPULayerVert:i(3524),TilemapGPULayerFrag:i(57532),TilemapGPULayerVert:i(23879)}},26128(e,t,i){var n=new(i(83419))({initialize:function(e,t,i,n){this.renderer=e,this.webGLBuffer=null,this.dataBuffer=t,this.viewF32=null,this.viewU8=new Uint8Array(t),this.viewU16=null,this.viewU32=null,this.bufferType=i,this.bufferUsage=n,this.createViews(),this.createResource()},createResource:function(){var e=this.renderer.gl,t=this.bufferType,i=e.createBuffer();this.webGLBuffer=i,this.bind(),e.bufferData(t,this.dataBuffer,this.bufferUsage),this.bind(!0)},bind:function(e){var t=this.renderer.gl,i=this.bufferType,n=e?null:this;i===t.ARRAY_BUFFER?this.renderer.glWrapper.updateBindingsArrayBuffer({bindings:{arrayBuffer:n}}):i===t.ELEMENT_ARRAY_BUFFER&&this.renderer.glWrapper.updateBindingsElementArrayBuffer({bindings:{elementArrayBuffer:n}})},update:function(e,t){var i=this.renderer.gl;this.bind(),void 0===t&&(t=0),void 0===e?i.bufferSubData(this.bufferType,t,this.dataBuffer):i.bufferSubData(this.bufferType,t,this.viewU8.subarray(t,t+e))},resize:function(e){var t=this.renderer.gl;this.dataBuffer=new ArrayBuffer(e),this.createViews(),this.bind(),t.bufferData(this.bufferType,this.dataBuffer,this.bufferUsage)},createViews:function(){var e=this.dataBuffer;this.viewF32=null,e.byteLength%Float32Array.BYTES_PER_ELEMENT===0&&(this.viewF32=new Float32Array(e)),this.viewU8=new Uint8Array(e),this.viewU16=null,e.byteLength%Uint16Array.BYTES_PER_ELEMENT===0&&(this.viewU16=new Uint16Array(e)),this.viewU32=null,e.byteLength%Uint32Array.BYTES_PER_ELEMENT===0&&(this.viewU32=new Uint32Array(e))},destroy:function(){this.renderer.gl.deleteBuffer(this.webGLBuffer),this.webGLBuffer=null,this.dataBuffer=null,this.viewF32=null,this.viewU8=null,this.viewU16=null,this.viewU32=null,this.renderer=null}});e.exports=n},84387(e,t,i){var n=i(83419),r={36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"},s=new n({initialize:function(e,t,i,n){var r=e.gl;if(this.webGLFramebuffer=null,this.renderer=e,this.useCanvas=!t||0===t.length,this.width=0,this.height=0,this.attachments=[],!this.useCanvas){for(var s=0;s<t.length;s++)if(this.attachments.push({texture:t[s],attachmentPoint:r.COLOR_ATTACHMENT0+s}),0===s)this.width=t[s].width,this.height=t[s].height;else if(t[s].width!==this.width||t[s].height!==this.height)throw new Error("Color attachments must have the same dimensions");n&&i?this.attachments.push({attachmentPoint:r.DEPTH_STENCIL_ATTACHMENT,internalFormat:r.DEPTH_STENCIL}):n?this.attachments.push({attachmentPoint:r.DEPTH_ATTACHMENT,internalFormat:r.DEPTH_COMPONENT16}):i&&this.attachments.push({attachmentPoint:r.STENCIL_ATTACHMENT,internalFormat:r.STENCIL_INDEX8})}this.renderTexture=null,this.attachments[0]&&(this.renderTexture=this.attachments[0].texture),this.createResource()},createResource:function(){if(!this.useCanvas){var e=this.renderer,t=e.glWrapper,i=e.gl;if(this.webGLFramebuffer){i.deleteFramebuffer(this.webGLFramebuffer);for(var n=0;n<this.attachments.length;n++){var s=this.attachments[n];s.texture||i.deleteRenderbuffer(s.renderbuffer)}}var a=i.createFramebuffer();for(this.webGLFramebuffer=a,t.updateBindingsFramebuffer({bindings:{framebuffer:this}},!0),n=0;n<this.attachments.length;n++){var o=(s=this.attachments[n]).attachmentPoint,l=s.texture;if(l)l.isRenderTexture=!0,i.framebufferTexture2D(i.FRAMEBUFFER,o,i.TEXTURE_2D,l.webGLTexture,0);else{var h=i.checkFramebufferStatus(i.FRAMEBUFFER);if(h!==i.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer status: "+(r[h]||h));var u=i.createRenderbuffer();t.updateBindingsRenderbuffer({bindings:{renderbuffer:u}}),i.renderbufferStorage(i.RENDERBUFFER,s.internalFormat,this.width,this.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,o,i.RENDERBUFFER,u),s.renderbuffer=u}}}},resize:function(e,t){this.useCanvas||(this.width=e,this.height=t,this.renderTexture.resize(e,t),this.createResource())},destroy:function(){if(null!==this.renderer){for(var e=this.renderer,t=e.gl,i=0;i<this.attachments.length;i++){var n=this.attachments[i];n.texture?(e.glWrapper.updateBindingsFramebuffer({bindings:{framebuffer:this}}),t.framebufferTexture2D(t.FRAMEBUFFER,n.attachmentPoint,t.TEXTURE_2D,null,0),e.deleteTexture(n.texture)):t.deleteRenderbuffer(n.renderbuffer)}t.deleteFramebuffer(this.webGLFramebuffer),e.glWrapper.updateBindingsFramebuffer({bindings:{framebuffer:null,renderbuffer:null}}),this.attachments.length=0,this.renderTexture=null,this.webGLFramebuffer=null,this.renderer=null}}});e.exports=s},37959(e,t,i){var n=i(83419),r=i(53314),s=new n({initialize:function(e){this.renderer=e,this.state=r.getDefault(e)},update:function(e,t,i){if(void 0===e){if(!t)return;e=this.state}void 0===t&&(t=!1),void 0===i&&(i=!1),void 0===e.vao||i||this.updateVAO(e,t),void 0!==e.bindings&&this.updateBindings(e,t),void 0!==e.blend&&this.updateBlend(e,t),void 0!==e.colorClearValue&&this.updateColorClearValue(e,t),void 0!==e.colorWritemask&&this.updateColorWritemask(e,t),void 0!==e.cullFace&&this.updateCullFace(e,t),void 0!==e.depthTest&&this.updateDepthTest(e,t),void 0!==e.scissor&&this.updateScissor(e,t),void 0!==e.stencil&&this.updateStencil(e,t),void 0!==e.texturing&&this.updateTexturing(e,t),void 0!==e.viewport&&this.updateViewport(e,t),void 0!==e.vao&&i&&this.updateVAO(e,t)},updateBindings:function(e,t){var i=e.bindings;void 0!==i.activeTexture&&this.updateBindingsActiveTexture(e,t),void 0!==i.arrayBuffer&&this.updateBindingsArrayBuffer(e,t),void 0!==i.elementArrayBuffer&&this.updateBindingsElementArrayBuffer(e,t),void 0!==i.framebuffer&&this.updateBindingsFramebuffer(e,t),void 0!==i.program&&this.updateBindingsProgram(e,t),void 0!==i.renderbuffer&&this.updateBindingsRenderbuffer(e,t)},updateBindingsActiveTexture:function(e,t){var i=e.bindings.activeTexture,n=i!==this.state.bindings.activeTexture;if(n&&(this.state.bindings.activeTexture=i),n||t){var r=this.renderer.gl;r.activeTexture(r.TEXTURE0+i)}},updateBindingsArrayBuffer:function(e,t){var i=e.bindings.arrayBuffer,n=this.renderer.gl;if(null!==i&&i.bufferType!==n.ARRAY_BUFFER)throw new Error("Invalid buffer type for ARRAY_BUFFER");var r=i!==this.state.bindings.arrayBuffer;if(r&&(this.state.bindings.arrayBuffer=i),r||t){var s=i?i.webGLBuffer:null;n.bindBuffer(n.ARRAY_BUFFER,s)}},updateBindingsElementArrayBuffer:function(e,t){var i=e.bindings.elementArrayBuffer,n=this.renderer.gl;if(null!==i&&i.bufferType!==n.ELEMENT_ARRAY_BUFFER)throw new Error("Invalid buffer type for ELEMENT_ARRAY_BUFFER");var r=i!==this.state.bindings.elementArrayBuffer;if(r&&(this.state.bindings.elementArrayBuffer=i),r||t){var s=i?i.webGLBuffer:null;n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,s)}},updateBindingsFramebuffer:function(e,t){var i=e.bindings.framebuffer,n=i!==this.state.bindings.framebuffer;if(n&&(this.state.bindings.framebuffer=i),n||t){var r=this.renderer.gl,s=i?i.webGLFramebuffer:null;r.bindFramebuffer(r.FRAMEBUFFER,s)}},updateBindingsProgram:function(e,t){var i=e.bindings.program,n=i!==this.state.bindings.program;if(n&&(this.state.bindings.program=i),n||t){var r=i?i.webGLProgram:null;this.renderer.gl.useProgram(r)}},updateBindingsRenderbuffer:function(e,t){var i=e.bindings.renderbuffer,n=i!==this.state.bindings.renderbuffer;if(n&&(this.state.bindings.renderbuffer=i),n||t){var r=this.renderer.gl,s=i||null;r.bindRenderbuffer(r.RENDERBUFFER,s)}},updateBlend:function(e,t){var i=e.blend;void 0!==i.enabled&&this.updateBlendEnabled(e,t),void 0!==i.color&&this.updateBlendColor(e,t),void 0!==i.equation&&this.updateBlendEquation(e,t),void 0!==i.func&&this.updateBlendFunc(e,t)},updateBlendColor:function(e,t){var i=e.blend.color,n=i[0],r=i[1],s=i[2],a=i[3],o=n!==this.state.blend.color[0]||r!==this.state.blend.color[1]||s!==this.state.blend.color[2]||a!==this.state.blend.color[3];o&&(this.state.blend.color=[n,r,s,a]),(o||t)&&this.renderer.gl.blendColor(n,r,s,a)},updateBlendEnabled:function(e,t){var i=e.blend.enabled,n=i!==this.state.blend.enabled;if(n&&(this.state.blend.enabled=i),n||t){var r=this.renderer.gl;i?r.enable(r.BLEND):r.disable(r.BLEND)}},updateBlendEquation:function(e,t){var i=e.blend.equation,n=i[0]!==this.state.blend.equation[0]||i[1]!==this.state.blend.equation[1];n&&(this.state.blend.equation=[i[0],i[1]]),(n||t)&&this.renderer.gl.blendEquationSeparate(i[0],i[1])},updateBlendFunc:function(e,t){var i=e.blend.func,n=i[0]!==this.state.blend.func[0]||i[1]!==this.state.blend.func[1]||i[2]!==this.state.blend.func[2]||i[3]!==this.state.blend.func[3];n&&(this.state.blend.func=[i[0],i[1],i[2],i[3]]),(n||t)&&this.renderer.gl.blendFuncSeparate(i[0],i[1],i[2],i[3])},updateColorClearValue:function(e,t){var i=e.colorClearValue,n=i[0],r=i[1],s=i[2],a=i[3],o=n!==this.state.colorClearValue[0]||r!==this.state.colorClearValue[1]||s!==this.state.colorClearValue[2]||a!==this.state.colorClearValue[3];o&&(this.state.colorClearValue=[n,r,s,a]),(o||t)&&this.renderer.gl.clearColor(n,r,s,a)},updateColorWritemask:function(e,t){var i=e.colorWritemask,n=i[0],r=i[1],s=i[2],a=i[3],o=n!==this.state.colorWritemask[0]||r!==this.state.colorWritemask[1]||s!==this.state.colorWritemask[2]||a!==this.state.colorWritemask[3];o&&(this.state.colorWritemask=[n,r,s,a]),(o||t)&&this.renderer.gl.colorMask(n,r,s,a)},updateCullFace:function(e,t){var i=!!e.cullFace,n=i!==this.state.cullFace;if(n&&(this.state.cullFace=i),n||t){var r=this.renderer.gl;i?r.enable(r.CULL_FACE):r.disable(r.CULL_FACE)}},updateDepthTest:function(e,t){var i=!!e.depthTest,n=i!==this.state.depthTest;if(n&&(this.state.depthTest=i),n||t){var r=this.renderer.gl;i?r.enable(r.DEPTH_TEST):r.disable(r.DEPTH_TEST)}},updateScissor:function(e,t){var i=e.scissor;void 0!==i.enable&&this.updateScissorEnabled(e,t),void 0!==i.box&&this.updateScissorBox(e,t)},updateScissorEnabled:function(e,t){var i=e.scissor.enable,n=i!==this.state.scissor.enable;if(n&&(this.state.scissor.enable=i),n||t){var r=this.renderer.gl;i?r.enable(r.SCISSOR_TEST):r.disable(r.SCISSOR_TEST)}},updateScissorBox:function(e,t){var i=e.scissor.box,n=i[0],r=i[1],s=i[2],a=i[3],o=n!==this.state.scissor.box[0]||r!==this.state.scissor.box[1]||s!==this.state.scissor.box[2]||a!==this.state.scissor.box[3];o&&(this.state.scissor.box=[n,r,s,a]),(o||t)&&this.renderer.gl.scissor(n,r,s,a)},updateStencil:function(e,t){var i=e.stencil;void 0!==i.clear&&this.updateStencilClear(e,t),void 0!==i.enabled&&this.updateStencilEnabled(e,t),void 0!==i.func&&this.updateStencilFunc(e,t),void 0!==i.op&&this.updateStencilOp(e,t),void 0!==i.writeMask&&this.updateStencilWriteMask(e,t)},updateStencilClear:function(e,t){var i=e.stencil.clear,n=i!==this.state.stencil.clear;n&&(this.state.stencil.clear=i),(n||t)&&this.renderer.gl.clearStencil(i)},updateStencilEnabled:function(e,t){var i=e.stencil.enabled,n=i!==this.state.stencil.enabled;if(n&&(this.state.stencil.enabled=i),n||t){var r=this.renderer.gl;i?r.enable(r.STENCIL_TEST):r.disable(r.STENCIL_TEST)}},updateStencilFunc:function(e,t){var i=e.stencil.func,n=i.func!==this.state.stencil.func.func||i.ref!==this.state.stencil.func.ref||i.mask!==this.state.stencil.func.mask;(n&&(this.state.stencil.func={func:i.func,ref:i.ref,mask:i.mask}),n||t)&&this.renderer.gl.stencilFunc(i.func,i.ref,i.mask)},updateStencilOp:function(e,t){var i=e.stencil.op,n=i.fail!==this.state.stencil.op.fail||i.zfail!==this.state.stencil.op.zfail||i.zpass!==this.state.stencil.op.zpass;(n&&(this.state.stencil.op={fail:i.fail,zfail:i.zfail,zpass:i.zpass}),n||t)&&this.renderer.gl.stencilOp(i.fail,i.zfail,i.zpass)},updateStencilWriteMask:function(e,t){var i=e.stencil.writeMask,n=i!==this.state.stencil.writeMask;(n&&(this.state.stencil.writeMask=i),n||t)&&this.renderer.gl.stencilMask(i)},updateTexturing:function(e,t){var i=e.texturing;void 0!==i.flipY&&this.updateTexturingFlipY(e,t),void 0!==i.premultiplyAlpha&&this.updateTexturingPremultiplyAlpha(e,t)},updateTexturingFlipY:function(e,t){var i=e.texturing.flipY,n=i!==this.state.texturing.flipY;if(n&&(this.state.texturing.flipY=i),n||t){var r=this.renderer.gl;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,i)}},updateTexturingPremultiplyAlpha:function(e,t){var i=e.texturing.premultiplyAlpha,n=i!==this.state.texturing.premultiplyAlpha;if(n&&(this.state.texturing.premultiplyAlpha=i),n||t){var r=this.renderer.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i)}},updateVAO:function(e,t){var i=e.vao,n=i!==this.state.vao;if(n&&(this.state.vao=i),n||t){var r=this.renderer.gl;i?r.bindVertexArray(i.vertexArrayObject):r.bindVertexArray(null)}},updateViewport:function(e,t){var i=e.viewport,n=i[0],r=i[1],s=i[2],a=i[3],o=n!==this.state.viewport[0]||r!==this.state.viewport[1]||s!==this.state.viewport[2]||a!==this.state.viewport[3];o&&(this.state.viewport=[n,r,s,a]),(o||t)&&this.renderer.gl.viewport(n,r,s,a)}});e.exports=s},1482(e,t,i){var n=i(90330);function r(e,t){return e!==t&&(!Number.isNaN(e)&&void 0!==e||!Number.isNaN(t)&&void 0!==t)}var s=new(i(83419))({initialize:function(e,t,i){this.renderer=e,this.webGLProgram=null,this.compiling=!1,this._compileStartTime=0,this.compileTimeMs=0,this.glState={bindings:{program:this}},this.vertexSource=t,this.fragmentSource=i,this._vertexShader=null,this._fragmentShader=null,this.glAttributes=[],this.glAttributeNames=new n,this.glAttributeBuffer=null,this.glUniforms=new n,this.uniformRequests=new n,this.createResource()},createResource:function(){var e=this.renderer,t=e.gl;if(this.glAttributeBuffer=null,!t.isContextLost()){this.compiling=!0,this._compileStartTime=performance.now(),e.glWrapper.state.bindings.program===this&&e.glWrapper.updateBindingsProgram({bindings:{program:null}});var i=t.createProgram();this.webGLProgram=i;var n=t.createShader(t.VERTEX_SHADER),r=t.createShader(t.FRAGMENT_SHADER);this._vertexShader=n,this._fragmentShader=r,t.shaderSource(n,this.vertexSource),t.shaderSource(r,this.fragmentSource),t.compileShader(n),t.compileShader(r),t.attachShader(i,n),t.attachShader(i,r),t.linkProgram(i),e.game.config.skipUnreadyShaders||this._completeProgram()}},checkParallelCompile:function(){var e=this.renderer,t=e.gl,i=e.parallelShaderCompileExtension;i&&t.getProgramParameter(this.webGLProgram,i.COMPLETION_STATUS_KHR)&&this._completeProgram()},_completeProgram:function(){var e=this.webGLProgram,t=this.renderer.gl,i=this._vertexShader,n=this._fragmentShader,r="Shader failed:\n";if(!t.getProgramParameter(e,t.LINK_STATUS)){if(!t.getShaderParameter(i,t.COMPILE_STATUS))throw console.log(this.vertexSource),new Error("Vertex "+r+t.getShaderInfoLog(i));if(!t.getShaderParameter(n,t.COMPILE_STATUS))throw console.log(this.fragmentSource),new Error("Fragment "+r+t.getShaderInfoLog(n));throw console.log(this.vertexSource,this.fragmentSource),new Error("Link Shader failed:"+t.getProgramInfoLog(e))}this._setupAttributesAndUniforms(),this.compileTimeMs=performance.now()-this._compileStartTime,this.compiling=!1},_setupAttributesAndUniforms:function(){var e=this.webGLProgram,t=this.renderer,i=t.gl,n=this;this.glAttributeNames.clear(),this.glAttributes.length=0;for(var r=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES),s=0;s<r;s++){var a=i.getActiveAttrib(e,s),o=i.getAttribLocation(e,a.name);this.glAttributeNames.set(a.name,s),this.glAttributes[s]={location:o,name:a.name,size:a.size,type:a.type}}this.glUniforms.each(function(e,t){n.uniformRequests.has(e)||n.uniformRequests.set(e,t.value)}),this.glUniforms.clear();var l=i.getProgramParameter(e,i.ACTIVE_UNIFORMS);for(s=0;s<l;s++){var h=i.getActiveUniform(e,s),u=t.shaderSetters.constants[h.type],c=0,d=h.size*u.size;d>1&&(c=u.baseType===i.FLOAT?new Float32Array(d):new Int32Array(d)),this.glUniforms.set(h.name,{location:i.getUniformLocation(e,h.name),size:h.size,type:h.type,value:c})}},setUniform:function(e,t){this.uniformRequests.set(e,t)},bind:function(){this.renderer.glWrapper.updateBindingsProgram(this.glState),this.uniformRequests.each(this._processUniformRequest.bind(this)),this.uniformRequests.clear()},_processUniformRequest:function(e,t){var i=this.renderer,n=i.gl,s=this.glUniforms.get(e);if(s){var a=s.value;if(a.length){for(var o=!1,l=0;l<a.length;l++)r(a[l],t[l])&&(o=!0,a[l]=t[l]);if(!o)return}else{if(!r(a,t))return;a=t,s.value=t}var h=s.location,u=s.type,c=s.size,d=i.shaderSetters.constants[u];if(d.isMatrix)d.set.call(n,h,!1,a);else if(c>1)d.setV.call(n,h,a);else switch(d.size){case 1:d.set.call(n,h,t);break;case 2:d.set.call(n,h,t[0],t[1]);break;case 3:d.set.call(n,h,t[0],t[1],t[2]);break;case 4:d.set.call(n,h,t[0],t[1],t[2],t[3])}}},destroy:function(){if(this.webGLProgram){var e=this.renderer.gl;if(!e.isContextLost()){this._vertexShader&&e.deleteShader(this._vertexShader),this._fragmentShader&&e.deleteShader(this._fragmentShader),e.deleteProgram(this.webGLProgram);for(var t=0;t<this.glAttributes.length;t++)e.disableVertexAttribArray(this.glAttributes[t].location);this.glAttributes.length=0,this.glUniforms.clear()}this.glAttributeBuffer=null,this.glAttributeNames.clear(),this.uniformRequests.clear(),this._vertexShader=null,this._fragmentShader=null,this.webGLProgram=null,this.renderer=null}}});e.exports=s},86272(e,t,i){var n=new(i(83419))({initialize:function(e){var t=e.gl;this.constants={5124:{constant:t.INT,baseType:t.INT,size:1,bytes:4,set:t.uniform1i,setV:t.uniform1iv,isMatrix:!1},35667:{constant:t.INT_VEC2,baseType:t.INT,size:2,bytes:4,set:t.uniform2i,setV:t.uniform2iv,isMatrix:!1},35668:{constant:t.INT_VEC3,baseType:t.INT,size:3,bytes:4,set:t.uniform3i,setV:t.uniform3iv,isMatrix:!1},35669:{constant:t.INT_VEC4,baseType:t.INT,size:4,bytes:4,set:t.uniform4i,setV:t.uniform4iv,isMatrix:!1},5126:{constant:t.FLOAT,baseType:t.FLOAT,size:1,bytes:4,set:t.uniform1f,setV:t.uniform1fv,isMatrix:!1},35664:{constant:t.FLOAT_VEC2,baseType:t.FLOAT,size:2,bytes:4,set:t.uniform2f,setV:t.uniform2fv,isMatrix:!1},35665:{constant:t.FLOAT_VEC3,baseType:t.FLOAT,size:3,bytes:4,set:t.uniform3f,setV:t.uniform3fv,isMatrix:!1},35666:{constant:t.FLOAT_VEC4,baseType:t.FLOAT,size:4,bytes:4,set:t.uniform4f,setV:t.uniform4fv,isMatrix:!1},5125:{constant:t.UNSIGNED_INT,baseType:t.UNSIGNED_INT,size:1,bytes:4,set:t.uniform1i,setV:t.uniform1iv,isMatrix:!1},5120:{constant:t.BYTE,baseType:t.BYTE,size:1,bytes:1,set:t.uniform1i,setV:t.uniform1iv,isMatrix:!1},5121:{constant:t.UNSIGNED_BYTE,baseType:t.UNSIGNED_BYTE,size:1,bytes:1,set:t.uniform1i,setV:t.uniform1iv,isMatrix:!1},5122:{constant:t.SHORT,baseType:t.SHORT,size:1,bytes:2,set:t.uniform1i,setV:t.uniform1iv,isMatrix:!1},5123:{constant:t.UNSIGNED_SHORT,baseType:t.UNSIGNED_SHORT,size:1,bytes:2,set:t.uniform1i,setV:t.uniform1iv,isMatrix:!1},35670:{constant:t.BOOL,baseType:t.BOOL,size:1,bytes:4,set:t.uniform1i,setV:t.uniform1iv,isMatrix:!1},35671:{constant:t.BOOL_VEC2,baseType:t.BOOL,size:2,bytes:4,set:t.uniform2i,setV:t.uniform2iv,isMatrix:!1},35672:{constant:t.BOOL_VEC3,baseType:t.BOOL,size:3,bytes:4,set:t.uniform3i,setV:t.uniform3iv,isMatrix:!1},35673:{constant:t.BOOL_VEC4,baseType:t.BOOL,size:4,bytes:4,set:t.uniform4i,setV:t.uniform4iv,isMatrix:!1},35674:{constant:t.FLOAT_MAT2,baseType:t.FLOAT,size:4,bytes:4,set:t.uniformMatrix2fv,setV:t.uniformMatrix2fv,isMatrix:!0},35675:{constant:t.FLOAT_MAT3,baseType:t.FLOAT,size:9,bytes:4,set:t.uniformMatrix3fv,setV:t.uniformMatrix3fv,isMatrix:!0},35676:{constant:t.FLOAT_MAT4,baseType:t.FLOAT,size:16,bytes:4,set:t.uniformMatrix4fv,setV:t.uniformMatrix4fv,isMatrix:!0},35678:{constant:t.SAMPLER_2D,baseType:t.INT,size:1,bytes:4,set:t.uniform1i,setV:t.uniform1iv,isMatrix:!1},35680:{constant:t.SAMPLER_CUBE,baseType:t.INT,size:1,bytes:4,set:t.uniform1i,setV:t.uniform1iv,isMatrix:!1}}}});e.exports=n},13760(e,t,i){var n=new(i(83419))({initialize:function(e){this.renderer=e,this.units=[],this.unitIndices=[],this.init()},init:function(){var e=this.renderer.gl;this.units.length=0,this.unitIndices.length=0;for(var t=e.createTexture(),i=this.renderer.maxTextures-1;i>=0;i--)this.units[i]=void 0,this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:i}}),e.bindTexture(e.TEXTURE_2D,t),this.unitIndices[i]=i;e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([0,0,255,255]))},bind:function(e,t,i,n){var r=this.units[t]!==e;if((i||!1!==n||r)&&this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:t}},i),r||i){this.units[t]=e;var s=e?e.webGLTexture:null,a=this.renderer.gl;a.bindTexture(a.TEXTURE_2D,s),e&&e.needsMipmapRegeneration&&e.generateMipmap()}},bindUnits:function(e,t){for(var i=Math.min(e.length,this.renderer.maxTextures)-1;i>=0;i--)void 0!==e[i]&&this.bind(e[i],i,t,!1)},unbindTexture:function(e){for(var t=this.units.length-1;t>=0;t--)this.units[t]===e&&this.bind(null,t,!0,!1)},unbindAllUnits:function(){for(var e=this.units.length-1;e>=0;e--)this.bind(null,e,!0,!1)}});e.exports=n},82751(e,t,i){var n=i(83419),r=i(50030),s=new n({initialize:function(e,t,i,n,r,s,a,o,l,h,u,c,d){void 0===d&&(d=!0),this.renderer=e,this.webGLTexture=null,this.isRenderTexture=!1,this.mipLevel=t,this.minFilter=i,this.magFilter=n,this.wrapT=r,this.wrapS=s,this.format=a,this.pixels=o,this.width=l,this.height=h,this.pma=void 0===u||null===u||u,this.forceSize=!!c,this.flipY=!!d,this.__SPECTOR_Metadata={},this.batchUnit=-1,this.needsMipmapRegeneration=!1,this.createResource()},createResource:function(){var e=this.renderer.gl;if(!e.isContextLost())if(this.pixels instanceof s)this.webGLTexture=this.pixels.webGLTexture;else{var t=e.createTexture();t.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=t,this._processTexture()}},resize:function(e,t){if(this.width!==e||this.height!==t){this.width=e,this.height=t;var i=this.renderer,n=i.gl,s=r(e,t);s?(this.wrapS=n.REPEAT,this.wrapT=n.REPEAT):(this.wrapS=n.CLAMP_TO_EDGE,this.wrapT=n.CLAMP_TO_EDGE),s&&i.mipmapFilter&&(!this.isRenderTexture||i.config.mipmapRegeneration)?this.minFilter=i.mipmapFilter:i.config.antialias?this.minFilter=n.LINEAR:this.minFilter=n.NEAREST,this._processTexture()}},update:function(e,t,i,n,r,s,a,o,l){0!==t&&0!==i&&(this.pixels=e,this.width=t,this.height=i,this.flipY=n,this.wrapS=r,this.wrapT=s,this.minFilter=a,this.magFilter=o,this.format=l,this._processTexture())},_processTexture:function(){var e=this.renderer.gl;this.renderer.glTextureUnits.bind(this,0),this.renderer.glWrapper.updateTexturing({texturing:{flipY:this.flipY,premultiplyAlpha:this.pma}}),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,this.minFilter),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,this.magFilter),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,this.wrapS),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,this.wrapT);var t=this.pixels,i=this.mipLevel,n=this.width,r=this.height,s=this.format;if(null===t||void 0===t)e.texImage2D(e.TEXTURE_2D,i,s,n,r,0,s,e.UNSIGNED_BYTE,null),this.generateMipmap();else if(t.compressed){n=t.width,r=t.height;for(var a=0;a<t.mipmaps.length;a++)e.compressedTexImage2D(e.TEXTURE_2D,a,t.internalFormat,t.mipmaps[a].width,t.mipmaps[a].height,0,t.mipmaps[a].data)}else t instanceof Uint8Array?(e.texImage2D(e.TEXTURE_2D,i,s,n,r,0,s,e.UNSIGNED_BYTE,t),this.generateMipmap()):(this.forceSize||(n=t.width,r=t.height),e.texImage2D(e.TEXTURE_2D,i,s,s,e.UNSIGNED_BYTE,t),this.generateMipmap())},isMipmap:function(){var e=this.minFilter,t=this.renderer.gl;return e===t.NEAREST_MIPMAP_NEAREST||e===t.LINEAR_MIPMAP_NEAREST||e===t.LINEAR_MIPMAP_LINEAR||e===t.NEAREST_MIPMAP_LINEAR},generateMipmap:function(){this.needsMipmapRegeneration=!1;var e=this.renderer.gl;this.isMipmap()&&r(this.width,this.height)&&e.generateMipmap(e.TEXTURE_2D)},spectorMetadata:{get:function(){return this.__SPECTOR_Metadata},set:function(e){this.__SPECTOR_Metadata=e,this.webGLTexture.__SPECTOR_Metadata=e}},destroy:function(){null!==this.webGLTexture&&(this.pixels instanceof s||this.renderer.gl.deleteTexture(this.webGLTexture),this.pixels=null,this.webGLTexture=null,this.renderer=null)}});e.exports=s},85788(e,t,i){var n=new(i(83419))({initialize:function(e,t,i,n){this.renderer=e,this.program=t,this.vertexArrayObject=null,this.indexBuffer=i,this.attributeBufferLayouts=n,this.glState={vao:this},this.createResource()},createResource:function(){var e=this.renderer.gl;this.vertexArrayObject=e.createVertexArray(),this.bind(),this.indexBuffer&&this.indexBuffer.bind();for(var t=this.program,i=t.glAttributes,n=t.glAttributeNames,r=0;r<this.attributeBufferLayouts.length;r++){var s=this.attributeBufferLayouts[r];s.buffer.bind();for(var a=s.layout.stride,o=s.layout.instanceDivisor,l=0;l<s.layout.layout.length;l++){var h=s.layout.layout[l],u=n.get(h.name);if(void 0!==u){var c=i[u];h.location=c.location;for(var d=h.location,f=h.bytes||4,p=h.columns||1,m=h.normalized,g=h.offset,v=h.size,y=h.type,x=0;x<p;x++)e.enableVertexAttribArray(d+x),e.vertexAttribPointer(d+x,v,y,m,a,g+f*x*v),isNaN(o)||e.vertexAttribDivisor(d+x,o)}}}this.renderer.glWrapper.updateVAO({vao:null}),this.renderer.glWrapper.updateBindings({bindings:{arrayBuffer:null,elementArrayBuffer:null}})},bind:function(){this.renderer.glWrapper.updateVAO(this.glState)},destroy:function(){var e=this.renderer.gl;this.vertexArrayObject&&(e.deleteVertexArray(this.vertexArrayObject),this.vertexArrayObject=null),this.indexBuffer=null,this.attributeBufferLayouts=null,this.glState=null,this.renderer=null}});e.exports=n},40952(e,t,i){var n=new(i(83419))({initialize:function(e,t,i){this.renderer=e,this.layout=t,this.completeLayout(t);var n=t.stride*t.count;if(i&&i.byteLength<n)throw new Error("Buffer too small for layout");this.buffer=i||e.createVertexBuffer(new ArrayBuffer(n),t.usage)},completeLayout:function(e){var t=this.renderer.gl,i=e.layout,n=this.renderer.shaderSetters.constants;"string"===typeof e.usage&&(e.usage=t[e.usage]);for(var r=0,s=0;s<i.length;s++){var a=i[s],o=a.size,l=a.columns||1;a.offset=r,"string"===typeof a.type&&(a.type=t[a.type]);var h=n[a.type],u=h.size,c=h.bytes;a.bytes=c,r+=o*l*c*u}e.stride=r}});e.exports=n},31884(e,t,i){var n={WebGLGlobalWrapper:i(37959),WebGLBufferWrapper:i(26128),WebGLProgramWrapper:i(1482),WebGLShaderSetterWrapper:i(86272),WebGLTextureWrapper:i(82751),WebGLTextureUnitsWrapper:i(13760),WebGLFramebufferWrapper:i(84387),WebGLVAOWrapper:i(85788),WebGLVertexBufferLayoutWrapper:i(40952)};e.exports=n},76531(e,t,i){var n=i(13560),r=i(83419),s=i(45319),a=i(50792),o=i(97480),l=i(8443),h=i(57811),u=i(74403),c=i(45818),d=i(29747),f=i(87841),p=i(86555),m=i(56583),g=i(26099),v=i(38058),y=new r({Extends:a,initialize:function(e){a.call(this),this.game=e,this.canvas,this.canvasBounds=new f,this.parent=null,this.parentIsWindow=!1,this.parentSize=new p,this.gameSize=new p,this.baseSize=new p,this.displaySize=new p,this.scaleMode=n.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new g(1,1),this.autoRound=!1,this.autoCenter=n.CENTER.NO_CENTER,this.orientation=n.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:d,windowResize:d,fullScreenChange:d,fullScreenError:d}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(l.BOOT,this.boot,this)},boot:function(){var e=this.game;this.canvas=e.canvas,this.fullscreen=e.device.fullscreen;var t=this.scaleMode;t!==n.SCALE_MODE.RESIZE&&t!==n.SCALE_MODE.EXPAND&&this.displaySize.setAspectMode(t),t===n.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()),e.events.on(l.PRE_STEP,this.step,this),e.events.once(l.READY,this.refresh,this),e.events.once(l.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(e){this.getParent(e),this.getParentBounds();var t=e.width,i=e.height,r=e.scaleMode,s=e.zoom,a=e.autoRound;if("string"===typeof t)if("%"!==t.substr(-1))t=parseInt(t,10);else{var o=this.parentSize.width;0===o&&(o=window.innerWidth);var l=parseInt(t,10)/100;t=Math.floor(o*l)}if("string"===typeof i)if("%"!==i.substr(-1))i=parseInt(i,10);else{var h=this.parentSize.height;0===h&&(h=window.innerHeight);var u=parseInt(i,10)/100;i=Math.floor(h*u)}this.scaleMode=r,this.autoRound=a,this.autoCenter=e.autoCenter,this.resizeInterval=e.resizeInterval,a&&(t=Math.floor(t),i=Math.floor(i)),this.gameSize.setSize(t,i),s===n.ZOOM.MAX_ZOOM&&(s=this.getMaxZoom()),this.zoom=s,1!==s&&(this._resetZoom=!0),this.baseSize.setSize(t,i),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),e.minWidth>0&&this.displaySize.setMin(e.minWidth*s,e.minHeight*s),e.maxWidth>0&&this.displaySize.setMax(e.maxWidth*s,e.maxHeight*s),this.displaySize.setSize(t,i),(e.snapWidth>0||e.snapHeight>0)&&this.displaySize.setSnap(e.snapWidth,e.snapHeight),this.orientation=c(t,i)},getParent:function(e){var t=e.parent;if(null!==t){if(this.parent=u(t),this.parentIsWindow=this.parent===document.body,e.expandParent&&e.scaleMode!==n.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}e.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=u(e.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var e=this.parentSize,t=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(t.height=h(!0));var i=t.width,n=t.height;if(e.width!==i||e.height!==n)return e.setSize(i,n),!0;if(this.canvas){var r=this.canvasBounds,s=this.canvas.getBoundingClientRect();if(s.x!==r.x||s.y!==r.y)return!0}return!1},lockOrientation:function(e){var t=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!t&&t.call(screen,e)},setParentSize:function(e,t){return this.parentSize.setSize(e,t),this.refresh()},setGameSize:function(e,t){var i=this.autoRound;i&&(e=Math.floor(e),t=Math.floor(t));var n=this.width,r=this.height;return this.gameSize.resize(e,t),this.baseSize.resize(e,t),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(e/t),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(n,r)},resize:function(e,t){var i=this.zoom,n=this.autoRound;n&&(e=Math.floor(e),t=Math.floor(t));var r=this.width,s=this.height;this.gameSize.resize(e,t),this.baseSize.resize(e,t),n&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(e*i,t*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,o=e*i,l=t*i;return n&&(o=Math.floor(o),l=Math.floor(l)),o===e&&l===t||(a.width=o+"px",a.height=l+"px"),this.refresh(r,s)},setZoom:function(e){return this.zoom=e,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this.displaySize.setSnap(e,t),this.refresh()},refresh:function(e,t){void 0===e&&(e=this.width),void 0===t&&(t=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var n=this.canvas.style,r=i.style;r.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",r.marginLeft=n.marginLeft,r.marginTop=n.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,e,t),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var e=c(this.width,this.height);e!==this.orientation&&(this.orientation=e,this.emit(o.ORIENTATION_CHANGE,e))}},updateScale:function(){var e,t,i=this.canvas.style,r=this.gameSize.width,a=this.gameSize.height,o=this.zoom,l=this.autoRound;if(this.scaleMode===n.SCALE_MODE.NONE)this.displaySize.setSize(r*o,a*o),e=this.displaySize.width,t=this.displaySize.height,l&&(e=Math.floor(e),t=Math.floor(t)),this._resetZoom&&(i.width=e+"px",i.height=t+"px",this._resetZoom=!1);else if(this.scaleMode===n.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),e=this.displaySize.width,t=this.displaySize.height,l&&(e=Math.floor(e),t=Math.floor(t)),this.canvas.width=e,this.canvas.height=t;else if(this.scaleMode===n.SCALE_MODE.EXPAND){var h,u,c=this.game.config.width,d=this.game.config.height,f=this.parentSize.width,p=this.parentSize.height,m=f/c,g=p/d;m<g?(h=c,u=0!==m?p/m:d):(h=0!==g?f/g:c,u=d);var v=s(h,this.displaySize.minWidth,this.displaySize.maxWidth),y=s(u,this.displaySize.minHeight,this.displaySize.maxHeight);this.baseSize.setSize(v,y),this.gameSize.setSize(v,y),l&&(v=Math.floor(v),y=Math.floor(y)),this.canvas.width=v,this.canvas.height=y;var x=f*(v/h),b=p*(y/u);this.displaySize.setSize(x,b),e=this.displaySize.width,t=this.displaySize.height,l&&(e=Math.floor(e),t=Math.floor(t)),i.width=e+"px",i.height=t+"px"}else this.displaySize.setSize(this.parentSize.width,this.parentSize.height),e=this.displaySize.width,t=this.displaySize.height,l&&(e=Math.floor(e),t=Math.floor(t)),i.width=e+"px",i.height=t+"px";this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var e=m(this.parentSize.width,this.gameSize.width,0,!0),t=m(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(e,t),1)},updateCenter:function(){var e=this.autoCenter;if(e!==n.CENTER.NO_CENTER){var t=this.canvas,i=t.style,r=t.getBoundingClientRect(),s=r.width,a=r.height,o=Math.floor((this.parentSize.width-s)/2),l=Math.floor((this.parentSize.height-a)/2);e===n.CENTER.CENTER_HORIZONTALLY?l=0:e===n.CENTER.CENTER_VERTICALLY&&(o=0),i.marginLeft=o+"px",i.marginTop=l+"px"}},updateBounds:function(){var e=this.canvasBounds,t=this.canvas.getBoundingClientRect();e.x=t.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),e.y=t.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),e.width=t.width,e.height=t.height},transformX:function(e){return(e-this.canvasBounds.left)*this.displayScale.x},transformY:function(e){return(e-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(e){void 0===e&&(e={navigationUI:"hide"});var t=this.fullscreen;if(t.available){if(!t.active){var i=this.getFullscreenTarget();t.keyboard?i[t.request](Element.ALLOW_KEYBOARD_INPUT):i[t.request](e)}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(e){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,e)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var e=document.createElement("div");e.style.margin="0",e.style.padding="0",e.style.width="100%",e.style.height="100%",this.fullscreenTarget=e,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var e=this.fullscreenTarget;if(e&&e.parentNode){var t=e.parentNode;t.insertBefore(this.canvas,e),t.removeChild(e)}}},stopFullscreen:function(){var e=this.fullscreen;if(!e.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;e.active&&document[e.cancel](),this.removeFullscreenTarget()},leaveFullScreenSuccessHandler:function(){this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(e){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(e)},startListeners:function(){var e=this,t=this.domlisteners;if(t.orientationChange=function(){e.updateBounds(),e._checkOrientation=!0,e.dirty=!0,e.refresh()},t.windowResize=function(){e.updateBounds(),e.getParentBounds(),e.refresh(),e.dirty=!0},screen.orientation&&screen.orientation.addEventListener?screen.orientation.addEventListener("change",t.orientationChange,!1):window.addEventListener("orientationchange",t.orientationChange,!1),window.addEventListener("resize",t.windowResize,!1),this.fullscreen.available){t.fullScreenChange=function(t){return e.onFullScreenChange(t)},t.fullScreenError=function(t){return e.onFullScreenError(t)};["webkit","moz",""].forEach(function(e){document.addEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.addEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.addEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.addEventListener("MSFullscreenError",t.fullScreenError,!1)}},onFullScreenChange:function(){document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?this.fullscreenSuccessHandler():(this.stopFullscreen(),this.leaveFullScreenSuccessHandler())},onFullScreenError:function(){this.removeFullscreenTarget()},getViewPort:function(e,t){e instanceof v||(t=e,e=void 0),void 0===t&&(t=new f);var i,n,r=this.baseSize,s=this.parentSize,a=this.canvasBounds,o=this.displayScale,l=a.x>=0?0:-a.x*o.x,h=a.y>=0?0:-a.y*o.y;return i=s.width>=a.width?r.width:r.width-(a.width-s.width)*o.x,n=s.height>=a.height?r.height:r.height-(a.height-s.height)*o.y,t.setTo(l,h,i,n),e&&(t.width/=e.zoomX,t.height/=e.zoomY,t.centerX=e.centerX+e.scrollX,t.centerY=e.centerY+e.scrollY),t},step:function(e,t){this.parent&&(this._lastCheck+=t,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var e=this.domlisteners;screen.orientation&&screen.orientation.addEventListener?screen.orientation.removeEventListener("change",e.orientationChange,!1):window.removeEventListener("orientationchange",e.orientationChange,!1),window.removeEventListener("resize",e.windowResize,!1);["webkit","moz",""].forEach(function(t){document.removeEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.removeEventListener(t+"fullscreenerror",e.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",e.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===n.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===n.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});e.exports=y},64743(e){e.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218(e){e.exports={LANDSCAPE:"landscape-primary",LANDSCAPE_SECONDARY:"landscape-secondary",PORTRAIT:"portrait-primary",PORTRAIT_SECONDARY:"portrait-secondary"}},81050(e){e.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805(e){e.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560(e,t,i){var n={CENTER:i(64743),ORIENTATION:i(39218),SCALE_MODE:i(81050),ZOOM:i(80805)};e.exports=n},56139(e){e.exports="enterfullscreen"},2336(e){e.exports="fullscreenfailed"},47412(e){e.exports="fullscreenunsupported"},51452(e){e.exports="leavefullscreen"},20666(e){e.exports="orientationchange"},47945(e){e.exports="resize"},97480(e,t,i){e.exports={ENTER_FULLSCREEN:i(56139),FULLSCREEN_FAILED:i(2336),FULLSCREEN_UNSUPPORTED:i(47412),LEAVE_FULLSCREEN:i(51452),ORIENTATION_CHANGE:i(20666),RESIZE:i(47945)}},93364(e,t,i){var n=i(79291),r=i(13560),s={Center:i(64743),Events:i(97480),Orientation:i(39218),ScaleManager:i(76531),ScaleModes:i(81050),Zoom:i(80805)};s=n(!1,s,r.CENTER),s=n(!1,s,r.ORIENTATION),s=n(!1,s,r.SCALE_MODE),s=n(!1,s,r.ZOOM),e.exports=s},27397(e,t,i){var n=i(95540),r=i(35355);e.exports=function(e){var t=e.game.config.defaultPhysicsSystem,i=n(e.settings,"physics",!1);if(t||i){var s=[];if(t&&s.push(r(t+"Physics")),i)for(var a in i)a=r(a.concat("Physics")),-1===s.indexOf(a)&&s.push(a);return s}}},52106(e,t,i){var n=i(95540);e.exports=function(e){var t=e.plugins.getDefaultScenePlugins(),i=n(e.settings,"plugins",!1);return Array.isArray(i)?i:t||[]}},87033(e){e.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",matterPhysics:"matter"}},97482(e,t,i){var n=i(83419),r=i(2368),s=new n({initialize:function(e){this.sys=new r(this,e),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(){}});e.exports=s},60903(e,t,i){var n=i(83419),r=i(89993),s=i(44594),a=i(8443),o=i(35154),l=i(54899),h=i(29747),u=i(97482),c=i(2368),d=new n({initialize:function(e,t){if(this.game=e,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,t){Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++)this._pending.push({key:"default",scene:t[i],autoStart:0===i,data:{}})}e.events.once(a.READY,this.bootQueue,this)},bootQueue:function(){if(!this.isBooted){var e,t,i,n;for(this.systemScene=this.createSceneFromInstance("__SYSTEM",new u),this.game.events.emit(a.SYSTEM_READY,this.systemScene,this),e=0;e<this._pending.length;e++){var r;i=(t=this._pending[e]).key,(n=t.scene)instanceof u?r=this.createSceneFromInstance(i,n):"object"===typeof n?r=this.createSceneFromObject(i,n):"function"===typeof n&&(r=this.createSceneFromFunction(i,n)),i=r.sys.settings.key,this.keys[i]=r,this.scenes.push(r),this._data[i]&&(r.sys.settings.data=this._data[i].data,this._data[i].autoStart&&(t.autoStart=!0)),(t.autoStart||r.sys.settings.active)&&this._start.push(i)}for(this._pending.length=0,this._data={},this.isBooted=!0,e=0;e<this._start.length;e++)t=this._start[e],this.start(t);this._start.length=0}},processQueue:function(){var e=this._pending.length,t=this._queue.length;if(0!==e||0!==t){var i,n;if(e){for(i=0;i<e;i++)n=this._pending[i],this.add(n.key,n.scene,n.autoStart,n.data);for(i=0;i<this._start.length;i++)n=this._start[i],this.start(n);this._start.length=0,this._pending.length=0}for(i=0;i<this._queue.length;i++)this[(n=this._queue[i]).op](n.keyA,n.keyB,n.data);this._queue.length=0}},add:function(e,t,i,n){return void 0===i&&(i=!1),void 0===n&&(n={}),this.isProcessing||!this.isBooted?(this._pending.push({key:e,scene:t,autoStart:i,data:n}),this.isBooted||(this._data[e]={data:n}),null):(e=this.getKey(e,t),t instanceof u?r=this.createSceneFromInstance(e,t):"object"===typeof t?(t.key=e,r=this.createSceneFromObject(e,t)):"function"===typeof t&&(r=this.createSceneFromFunction(e,t)),r.sys.settings.data=n,e=r.sys.settings.key,this.keys[e]=r,this.scenes.push(r),(i||r.sys.settings.active)&&(this._pending.length?this._start.push(e):this.start(e)),r);var r},remove:function(e){if(this.isProcessing)return this.queueOp("remove",e);var t=this.getScene(e);if(!t||t.sys.isTransitioning())return this;var i=this.scenes.indexOf(t),n=t.sys.settings.key;return i>-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),t.sys.destroy()),this},bootScene:function(e){var t,i=e.sys,n=i.settings;i.sceneUpdate=h,e.init&&(e.init.call(e,n.data),n.status=r.INIT,n.isTransition&&i.events.emit(s.TRANSITION_INIT,n.transitionFrom,n.transitionDuration)),i.load&&(t=i.load).reset(),t&&e.preload?(e.preload.call(e),n.status=r.LOADING,t.once(l.COMPLETE,this.loadComplete,this),t.start()):this.create(e)},loadComplete:function(e){this.create(e.scene)},payloadComplete:function(e){this.bootScene(e.scene)},update:function(e,t){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>r.START&&n.settings.status<=r.RUNNING&&n.step(e,t),n.scenePlugin&&n.scenePlugin._target&&n.scenePlugin.step(e,t)}},render:function(e){for(var t=0;t<this.scenes.length;t++){var i=this.scenes[t].sys;i.settings.visible&&i.settings.status>=r.LOADING&&i.settings.status<r.SLEEPING&&i.render(e)}this.isProcessing=!1},create:function(e){var t=e.sys,i=t.settings;e.create&&(i.status=r.CREATING,e.create.call(e,i.data),i.status===r.DESTROYED)||(i.isTransition&&t.events.emit(s.TRANSITION_START,i.transitionFrom,i.transitionDuration),e.update&&(t.sceneUpdate=e.update),i.status=r.RUNNING,t.events.emit(s.CREATE,e))},createSceneFromFunction:function(e,t){var i=new t;if(i instanceof u){var n=i.sys.settings.key;if(""!==n&&(e=n),this.keys.hasOwnProperty(e))throw new Error("Cannot add Scene with duplicate key: "+e);return this.createSceneFromInstance(e,i)}return i.sys=new c(i),i.sys.settings.key=e,i.sys.init(this.game),i},createSceneFromInstance:function(e,t){return""===t.sys.settings.key&&(t.sys.settings.key=e),t.sys.init(this.game),t},createSceneFromObject:function(e,t){var i=new u(t),n=i.sys.settings.key;""!==n?e=n:i.sys.settings.key=e,i.sys.init(this.game);for(var r=["init","preload","create","update","render"],s=0;s<r.length;s++){var a=o(t,r[s],null);a&&(i[r[s]]=a)}if(t.hasOwnProperty("extend"))for(var l in t.extend)if(t.extend.hasOwnProperty(l)){var h=t.extend[l];"data"===l&&i.hasOwnProperty("data")&&"object"===typeof h?i.data.merge(h):"sys"!==l&&(i[l]=h)}return i},getKey:function(e,t){if(e||(e="default"),"function"===typeof t)return e;if(t instanceof u?e=t.sys.settings.key:"object"===typeof t&&t.hasOwnProperty("key")&&(e=t.key),this.keys.hasOwnProperty(e))throw new Error("Cannot add Scene with duplicate key: "+e);return e},getScenes:function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!1);for(var i=[],n=this.scenes,r=0;r<n.length;r++){var s=n[r];s&&(!e||e&&s.sys.isActive())&&i.push(s)}return t?i.reverse():i},getScene:function(e){if("string"===typeof e){if(this.keys[e])return this.keys[e]}else for(var t=0;t<this.scenes.length;t++)if(e===this.scenes[t])return e;return null},isActive:function(e){var t=this.getScene(e);return t?t.sys.isActive():null},isPaused:function(e){var t=this.getScene(e);return t?t.sys.isPaused():null},isVisible:function(e){var t=this.getScene(e);return t?t.sys.isVisible():null},isSleeping:function(e){var t=this.getScene(e);return t?t.sys.isSleeping():null},pause:function(e,t){var i=this.getScene(e);return i&&i.sys.pause(t),this},resume:function(e,t){var i=this.getScene(e);return i&&i.sys.resume(t),this},sleep:function(e,t){var i=this.getScene(e);return i&&!i.sys.isTransitioning()&&i.sys.sleep(t),this},wake:function(e,t){var i=this.getScene(e);return i&&i.sys.wake(t),this},run:function(e,t){var i=this.getScene(e);if(!i){for(var n=0;n<this._pending.length;n++)if(this._pending[n].key===e){this.queueOp("start",e,t);break}return this}i.sys.isSleeping()?i.sys.wake(t):i.sys.isPaused()?i.sys.resume(t):this.start(e,t)},start:function(e,t){if(!this.isBooted)return this._data[e]={autoStart:!0,data:t},this;var i=this.getScene(e);if(!i)return console.warn("Scene key not found: "+e),this;var n,s=i.sys,a=s.settings.status;if(a>=r.START&&a<=r.CREATING)return this;if(a>=r.RUNNING&&a<=r.SLEEPING)s.shutdown(),s.sceneUpdate=h,s.start(t);else if(s.sceneUpdate=h,s.start(t),s.load&&(n=s.load),n&&s.settings.hasOwnProperty("pack")&&(n.reset(),n.addPack({payload:s.settings.pack})))return s.settings.status=r.LOADING,n.once(l.COMPLETE,this.payloadComplete,this),n.start(),this;return this.bootScene(i),this},stop:function(e,t){var i=this.getScene(e);if(i&&!i.sys.isTransitioning()&&i.sys.settings.status!==r.SHUTDOWN){var n=i.sys.load;n&&(n.off(l.COMPLETE,this.loadComplete,this),n.off(l.COMPLETE,this.payloadComplete,this)),i.sys.shutdown(t)}return this},switch:function(e,t,i){var n=this.getScene(e),r=this.getScene(t);return n&&r&&n!==r&&(this.sleep(e),this.isSleeping(t)?this.wake(t,i):this.start(t,i)),this},getAt:function(e){return this.scenes[e]},getIndex:function(e){var t=this.getScene(e);return this.scenes.indexOf(t)},bringToTop:function(e){if(this.isProcessing)return this.queueOp("bringToTop",e);var t=this.getIndex(e),i=this.scenes;if(-1!==t&&t<i.length){var n=this.getScene(e);i.splice(t,1),i.push(n)}return this},sendToBack:function(e){if(this.isProcessing)return this.queueOp("sendToBack",e);var t=this.getIndex(e);if(-1!==t&&t>0){var i=this.getScene(e);this.scenes.splice(t,1),this.scenes.unshift(i)}return this},moveDown:function(e){if(this.isProcessing)return this.queueOp("moveDown",e);var t=this.getIndex(e);if(t>0){var i=t-1,n=this.getScene(e),r=this.getAt(i);this.scenes[t]=r,this.scenes[i]=n}return this},moveUp:function(e){if(this.isProcessing)return this.queueOp("moveUp",e);var t=this.getIndex(e);if(t<this.scenes.length-1){var i=t+1,n=this.getScene(e),r=this.getAt(i);this.scenes[t]=r,this.scenes[i]=n}return this},moveAbove:function(e,t){if(e===t)return this;if(this.isProcessing)return this.queueOp("moveAbove",e,t);var i=this.getIndex(e),n=this.getIndex(t);if(-1!==i&&-1!==n&&n<i){var r=this.getAt(n);this.scenes.splice(n,1),this.scenes.splice(i+(n>i),0,r)}return this},moveBelow:function(e,t){if(e===t)return this;if(this.isProcessing)return this.queueOp("moveBelow",e,t);var i=this.getIndex(e),n=this.getIndex(t);if(-1!==i&&-1!==n&&n>i){var r=this.getAt(n);this.scenes.splice(n,1),0===i?this.scenes.unshift(r):this.scenes.splice(i-(n<i),0,r)}return this},queueOp:function(e,t,i,n){return this._queue.push({op:e,keyA:t,keyB:i,data:n}),this},swapPosition:function(e,t){if(e===t)return this;if(this.isProcessing)return this.queueOp("swapPosition",e,t);var i=this.getIndex(e),n=this.getIndex(t);if(i!==n&&-1!==i&&-1!==n){var r=this.getAt(i);this.scenes[i]=this.scenes[n],this.scenes[n]=r}return this},dump:function(){for(var e=[],t=["pending","init","start","loading","creating","running","paused","sleeping","shutdown","destroyed"],i=0;i<this.scenes.length;i++){var n=this.scenes[i].sys,s=!n.settings.visible||n.settings.status!==r.RUNNING&&n.settings.status!==r.PAUSED?"[-] ":"[*] ";s+=n.settings.key+" ("+t[n.settings.status]+")",e.push(s)}console.log(e.join("\n"))},destroy:function(){for(var e=0;e<this.scenes.length;e++){this.scenes[e].sys.destroy()}this.systemScene.sys.destroy(),this.update=h,this.scenes=[],this._pending=[],this._start=[],this._queue=[],this.game=null,this.systemScene=null}});e.exports=d},52209(e,t,i){var n=i(45319),r=i(83419),s=i(44594),a=i(95540),o=i(37277),l=new r({initialize:function(e){this.scene=e,this.systems=e.sys,this.settings=e.sys.settings,this.key=e.sys.settings.key,this.manager=e.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,e.sys.events.once(s.BOOT,this.boot,this),e.sys.events.on(s.START,this.pluginStart,this)},boot:function(){this.systems.events.once(s.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(s.SHUTDOWN,this.shutdown,this)},start:function(e,t){return void 0===e&&(e=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",e,t),this},restart:function(e){var t=this.key;return this.manager.queueOp("stop",t),this.manager.queueOp("start",t,e),this},transition:function(e){void 0===e&&(e={});var t=a(e,"target",!1),i=this.manager.getScene(t);if(!t||!this.checkValidTransition(i))return!1;var n=a(e,"duration",1e3);this._elapsed=0,this._target=i,this._duration=n,this._willSleep=a(e,"sleep",!1),this._willRemove=a(e,"remove",!1);var r=a(e,"onUpdate",null);r&&(this._onUpdate=r,this._onUpdateScope=a(e,"onUpdateScope",this.scene));var o=a(e,"allowInput",!1);this.settings.transitionAllowInput=o;var l=i.sys.settings;l.isTransition=!0,l.transitionFrom=this.scene,l.transitionDuration=n,l.transitionAllowInput=o,a(e,"moveAbove",!1)?this.manager.moveAbove(this.key,t):a(e,"moveBelow",!1)&&this.manager.moveBelow(this.key,t),i.sys.isSleeping()?i.sys.wake(a(e,"data")):this.manager.start(t,a(e,"data"));var h=a(e,"onStart",null),u=a(e,"onStartScope",this.scene);return h&&h.call(u,this.scene,i,n),this.systems.events.emit(s.TRANSITION_OUT,i,n),!0},checkValidTransition:function(e){return!(!e||e.sys.isActive()||e.sys.isTransitioning()||e===this.scene||this.systems.isTransitioning())},step:function(e,t){this._elapsed+=t,this.transitionProgress=n(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var e=this._target.sys,t=this._target.sys.settings;e.events.emit(s.TRANSITION_COMPLETE,this.scene),t.isTransition=!1,t.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(e,t,i,n){return this.manager.add(e,t,i,n)},launch:function(e,t){return e&&e!==this.key&&this.manager.queueOp("start",e,t),this},run:function(e,t){return e&&e!==this.key&&this.manager.queueOp("run",e,t),this},pause:function(e,t){return void 0===e&&(e=this.key),this.manager.queueOp("pause",e,t),this},resume:function(e,t){return void 0===e&&(e=this.key),this.manager.queueOp("resume",e,t),this},sleep:function(e,t){return void 0===e&&(e=this.key),this.manager.queueOp("sleep",e,t),this},wake:function(e,t){return void 0===e&&(e=this.key),this.manager.queueOp("wake",e,t),this},switch:function(e,t){return e!==this.key&&this.manager.queueOp("switch",this.key,e,t),this},stop:function(e,t){return void 0===e&&(e=this.key),this.manager.queueOp("stop",e,t),this},setActive:function(e,t,i){void 0===t&&(t=this.key);var n=this.manager.getScene(t);return n&&n.sys.setActive(e,i),this},setVisible:function(e,t){void 0===t&&(t=this.key);var i=this.manager.getScene(t);return i&&i.sys.setVisible(e),this},isSleeping:function(e){return void 0===e&&(e=this.key),this.manager.isSleeping(e)},isActive:function(e){return void 0===e&&(e=this.key),this.manager.isActive(e)},isPaused:function(e){return void 0===e&&(e=this.key),this.manager.isPaused(e)},isVisible:function(e){return void 0===e&&(e=this.key),this.manager.isVisible(e)},swapPosition:function(e,t){return void 0===t&&(t=this.key),e!==t&&this.manager.swapPosition(e,t),this},moveAbove:function(e,t){return void 0===t&&(t=this.key),e!==t&&this.manager.moveAbove(e,t),this},moveBelow:function(e,t){return void 0===t&&(t=this.key),e!==t&&this.manager.moveBelow(e,t),this},remove:function(e){return void 0===e&&(e=this.key),this.manager.remove(e),this},moveUp:function(e){return void 0===e&&(e=this.key),this.manager.moveUp(e),this},moveDown:function(e){return void 0===e&&(e=this.key),this.manager.moveDown(e),this},bringToTop:function(e){return void 0===e&&(e=this.key),this.manager.bringToTop(e),this},sendToBack:function(e){return void 0===e&&(e=this.key),this.manager.sendToBack(e),this},get:function(e){return this.manager.getScene(e)},getStatus:function(e){var t=this.manager.getScene(e);if(t)return t.sys.getStatus()},getIndex:function(e){return void 0===e&&(e=this.key),this.manager.getIndex(e)},shutdown:function(){var e=this.systems.events;e.off(s.SHUTDOWN,this.shutdown,this),e.off(s.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",l,"scenePlugin"),e.exports=l},55681(e,t,i){var n=i(89993),r=i(35154),s=i(46975),a=i(87033),o={create:function(e){return"string"===typeof e?e={key:e}:void 0===e&&(e={}),{status:n.PENDING,key:r(e,"key",""),active:r(e,"active",!1),visible:r(e,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:r(e,"pack",!1),cameras:r(e,"cameras",null),map:r(e,"map",s(a,r(e,"mapAdd",{}))),physics:r(e,"physics",{}),loader:r(e,"loader",{}),plugins:r(e,"plugins",!1),input:r(e,"input",{})}}};e.exports=o},2368(e,t,i){var n=i(83419),r=i(89993),s=i(42363),a=i(44594),o=i(27397),l=i(52106),h=i(29747),u=i(55681),c=new n({initialize:function(e,t){this.scene=e,this.game,this.renderer,this.config=t,this.settings=u.create(t),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=h},init:function(e){this.settings.status=r.INIT,this.sceneUpdate=h,this.game=e,this.renderer=e.renderer,this.canvas=e.canvas,this.context=e.context;var t=e.plugins;this.plugins=t,t.addToScene(this,s.Global,[s.CoreScene,l(this),o(this)]),this.events.emit(a.BOOT,this),this.settings.isBooted=!0},step:function(e,t){var i=this.events;i.emit(a.PRE_UPDATE,e,t),i.emit(a.UPDATE,e,t),this.sceneUpdate.call(this.scene,e,t),i.emit(a.POST_UPDATE,e,t)},render:function(e){var t=this.displayList;t.depthSort(),this.events.emit(a.PRE_RENDER,e),this.cameras.render(e,t),this.events.emit(a.RENDER,e)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(e){var t=this.settings,i=this.getStatus();return i!==r.CREATING&&i!==r.RUNNING?console.warn("Cannot pause non-running Scene",t.key):this.settings.active&&(t.status=r.PAUSED,t.active=!1,this.events.emit(a.PAUSE,this,e)),this},resume:function(e){var t=this.events,i=this.settings;return this.settings.active||(i.status=r.RUNNING,i.active=!0,t.emit(a.RESUME,this,e)),this},sleep:function(e){var t=this.settings,i=this.getStatus();return i!==r.CREATING&&i!==r.RUNNING?console.warn("Cannot sleep non-running Scene",t.key):(t.status=r.SLEEPING,t.active=!1,t.visible=!1,this.events.emit(a.SLEEP,this,e)),this},wake:function(e){var t=this.events,i=this.settings;return i.status=r.RUNNING,i.active=!0,i.visible=!0,t.emit(a.WAKE,this,e),i.isTransition&&t.emit(a.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var e=this.settings.status;return e>r.PENDING&&e<=r.RUNNING},isSleeping:function(){return this.settings.status===r.SLEEPING},isActive:function(){return this.settings.status===r.RUNNING},isPaused:function(){return this.settings.status===r.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(e){return this.settings.visible=e,this},setActive:function(e,t){return e?this.resume(t):this.pause(t)},start:function(e){var t=this.events,i=this.settings;e&&(i.data=e),i.status=r.START,i.active=!0,i.visible=!0,t.emit(a.START,this),t.emit(a.READY,this,e)},shutdown:function(e){var t=this.events,i=this.settings;t.off(a.TRANSITION_INIT),t.off(a.TRANSITION_START),t.off(a.TRANSITION_COMPLETE),t.off(a.TRANSITION_OUT),i.status=r.SHUTDOWN,i.active=!1,i.visible=!1,t.emit(a.SHUTDOWN,this,e)},destroy:function(){var e=this.events,t=this.settings;t.status=r.DESTROYED,t.active=!1,t.visible=!1,e.emit(a.DESTROY,this),e.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","cameras","displayList","events","make","scenePlugin","updateList"],n=0;n<i.length;n++)this[i[n]]=null}});e.exports=c},89993(e){e.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},69830(e){e.exports="addedtoscene"},7919(e){e.exports="boot"},46763(e){e.exports="create"},11763(e){e.exports="destroy"},71555(e){e.exports="pause"},36735(e){e.exports="postupdate"},3809(e){e.exports="prerender"},90716(e){e.exports="preupdate"},58262(e){e.exports="ready"},91633(e){e.exports="removedfromscene"},10319(e){e.exports="render"},87132(e){e.exports="resume"},81961(e){e.exports="shutdown"},90194(e){e.exports="sleep"},6265(e){e.exports="start"},33178(e){e.exports="transitioncomplete"},43063(e){e.exports="transitioninit"},11259(e){e.exports="transitionout"},61611(e){e.exports="transitionstart"},45209(e){e.exports="transitionwake"},22966(e){e.exports="update"},21747(e){e.exports="wake"},44594(e,t,i){e.exports={ADDED_TO_SCENE:i(69830),BOOT:i(7919),CREATE:i(46763),DESTROY:i(11763),PAUSE:i(71555),POST_UPDATE:i(36735),PRE_RENDER:i(3809),PRE_UPDATE:i(90716),READY:i(58262),REMOVED_FROM_SCENE:i(91633),RENDER:i(10319),RESUME:i(87132),SHUTDOWN:i(81961),SLEEP:i(90194),START:i(6265),TRANSITION_COMPLETE:i(33178),TRANSITION_INIT:i(43063),TRANSITION_OUT:i(11259),TRANSITION_START:i(61611),TRANSITION_WAKE:i(45209),UPDATE:i(22966),WAKE:i(21747)}},62194(e,t,i){var n=i(89993),r=i(79291),s={Events:i(44594),GetPhysicsPlugins:i(27397),GetScenePlugins:i(52106),SceneManager:i(60903),ScenePlugin:i(52209),Settings:i(55681),Systems:i(2368)};s=r(!1,s,n),e.exports=s},30341(e,t,i){var n=i(83419),r=i(50792),s=i(14463),a=i(79291),o=i(29747),l=new n({Extends:r,initialize:function(e,t,i){r.call(this),this.manager=e,this.key=t,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,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(e){return!(!e||!e.name||"string"!==typeof e.name)&&(this.markers[e.name]?(console.error("addMarker "+e.name+" already exists in Sound"),!1):(e=a(!0,{name:"",start:0,duration:this.totalDuration-(e.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},e),this.markers[e.name]=e,!0))},updateMarker:function(e){return!(!e||!e.name||"string"!==typeof e.name)&&(this.markers[e.name]?(this.markers[e.name]=a(!0,this.markers[e.name],e),!0):(console.warn("Audio Marker: "+e.name+" missing in Sound: "+this.key),!1))},removeMarker:function(e){var t=this.markers[e];return t?(this.markers[e]=null,t):null},play:function(e,t){if(void 0===e&&(e=""),"object"===typeof e&&(t=e,e=""),"string"!==typeof e)return!1;if(e){if(!this.markers[e])return console.warn("Marker: "+e+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[e],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=a(this.currentConfig,t),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:o,calculateRate:function(){var e=this.currentConfig.detune+this.manager.detune,t=Math.pow(1.0005777895065548,e);this.totalRate=this.currentConfig.rate*this.manager.rate*t},destroy:function(){this.pendingRemove||(this.stop(),this.emit(s.DESTROY,this),this.removeAllListeners(),this.pendingRemove=!0,this.manager=null,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});e.exports=l},85034(e,t,i){var n=i(83419),r=i(41786),s=i(50792),a=i(14463),o=i(8443),l=i(46710),h=i(58731),u=i(29747),c=i(26099),d=new n({Extends:s,initialize:function(e){s.call(this),this.game=e,this.jsonCache=e.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,this.gameLostFocus=!1,this.listenerPosition=new c;var t=e.events;t.on(o.BLUR,this.onGameBlur,this),t.on(o.FOCUS,this.onGameFocus,this),t.on(o.PRE_STEP,this.update,this),t.once(o.DESTROY,this.destroy,this)},add:u,addAudioSprite:function(e,t){void 0===t&&(t={});var i=this.add(e,t);for(var n in i.spritemap=this.jsonCache.get(e).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var s=r(t),a=i.spritemap[n];s.loop=!!a.hasOwnProperty("loop")&&a.loop,i.addMarker({name:n,start:a.start,duration:a.end-a.start,config:s})}return i},get:function(e){return h(this.sounds,"key",e)},getAll:function(e){return e?l(this.sounds,"key",e):l(this.sounds)},getAllPlaying:function(){return l(this.sounds,"isPlaying",!0)},play:function(e,t){var i=this.add(e);return i.once(a.COMPLETE,i.destroy,i),t?t.name?(i.addMarker(t),i.play(t.name)):i.play(t):i.play()},playAudioSprite:function(e,t,i){var n=this.addAudioSprite(e);return n.once(a.COMPLETE,n.destroy,n),n.play(t,i)},remove:function(e){var t=this.sounds.indexOf(e);return-1!==t&&(e.destroy(),this.sounds.splice(t,1),!0)},removeAll:function(){this.sounds.forEach(function(e){e.destroy()}),this.sounds.length=0},removeByKey:function(e){for(var t=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===e&&(n.destroy(),this.sounds.splice(i,1),t++)}return t},pauseAll:function(){this.forEachActiveSound(function(e){e.pause()}),this.emit(a.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(e){e.resume()}),this.emit(a.RESUME_ALL,this)},setListenerPosition:u,stopAll:function(){this.forEachActiveSound(function(e){e.stop()}),this.emit(a.STOP_ALL,this)},stopByKey:function(e){var t=0;return this.getAll(e).forEach(function(e){e.stop()&&t++}),t},isPlaying:function(e){var t,i=this.sounds.length-1;if(void 0===e){for(;i>=0;i--)if((t=this.sounds[i]).isPlaying)return!0}else for(;i>=0;i--)if((t=this.sounds[i]).key===e&&t.isPlaying)return!0;return!1},unlock:u,onBlur:u,onFocus:u,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(e,t){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(a.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(e,t)})},destroy:function(){this.game.events.off(o.BLUR,this.onGameBlur,this),this.game.events.off(o.FOCUS,this.onGameFocus,this),this.game.events.off(o.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(e,t){var i=this;this.sounds.forEach(function(n,r){n&&!n.pendingRemove&&e.call(t||i,n,r,i.sounds)})},setRate:function(e){return this.rate=e,this},rate:{get:function(){return this._rate},set:function(e){this._rate=e,this.forEachActiveSound(function(e){e.calculateRate()}),this.emit(a.GLOBAL_RATE,this,e)}},setDetune:function(e){return this.detune=e,this},detune:{get:function(){return this._detune},set:function(e){this._detune=e,this.forEachActiveSound(function(e){e.calculateRate()}),this.emit(a.GLOBAL_DETUNE,this,e)}}});e.exports=d},14747(e,t,i){var n=i(33684),r=i(25960),s=i(57490),a={create:function(e){var t=e.config.audio,i=e.device.audio;return t.noAudio||!i.webAudio&&!i.audioData?new r(e):i.webAudio&&!t.disableWebAudio?new s(e):new n(e)}};e.exports=a},19723(e){e.exports="complete"},98882(e){e.exports="decodedall"},57506(e){e.exports="decoded"},73146(e){e.exports="destroy"},11305(e){e.exports="detune"},40577(e){e.exports="detune"},30333(e){e.exports="mute"},20394(e){e.exports="rate"},21802(e){e.exports="volume"},1299(e){e.exports="looped"},99190(e){e.exports="loop"},97125(e){e.exports="mute"},89259(e){e.exports="pan"},79986(e){e.exports="pauseall"},17586(e){e.exports="pause"},19618(e){e.exports="play"},42306(e){e.exports="rate"},10387(e){e.exports="resumeall"},48959(e){e.exports="resume"},9960(e){e.exports="seek"},19180(e){e.exports="stopall"},98328(e){e.exports="stop"},50401(e){e.exports="unlocked"},52498(e){e.exports="volume"},14463(e,t,i){e.exports={COMPLETE:i(19723),DECODED:i(57506),DECODED_ALL:i(98882),DESTROY:i(73146),DETUNE:i(11305),GLOBAL_DETUNE:i(40577),GLOBAL_MUTE:i(30333),GLOBAL_RATE:i(20394),GLOBAL_VOLUME:i(21802),LOOP:i(99190),LOOPED:i(1299),MUTE:i(97125),PAN:i(89259),PAUSE_ALL:i(79986),PAUSE:i(17586),PLAY:i(19618),RATE:i(42306),RESUME_ALL:i(10387),RESUME:i(48959),SEEK:i(9960),STOP_ALL:i(19180),STOP:i(98328),UNLOCKED:i(50401),VOLUME:i(52498)}},64895(e,t,i){var n=i(30341),r=i(83419),s=i(14463),a=i(45319),o=new r({Extends:n,initialize:function(e,t,i){if(void 0===i&&(i={}),this.tags=e.game.cache.audio.get(t),!this.tags)throw new Error('No cached audio asset with key "'+t);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,n.call(this,e,t,i)},play:function(e,t){return!this.manager.isLocked(this,"play",[e,t])&&(!!n.prototype.play.call(this,e,t)&&(!!this.pickAndPlayAudioTag()&&(this.emit(s.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(s.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(s.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(s.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var e=this.currentConfig.seek,t=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+e;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===t?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*t,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var e=0;e<this.tags.length;e++){var t=this.tags[e];if("false"===t.dataset.used)return t.dataset.used="true",this.audio=t,!0}if(!this.manager.override)return!1;var i=[];this.manager.forEachActiveSound(function(e){e.key===this.key&&e.audio&&i.push(e)},this),i.sort(function(e,t){return e.loop===t.loop?t.seek/t.duration-e.seek/e.duration:e.loop?1:-1});var n=i[0];return this.audio=n.audio,n.reset(),n.audio=null,n.startTime=0,n.previousTime=0,!0},playCatchPromise:function(){var e=this.audio.play();e&&e.catch(function(e){console.warn(e)})},stopAndReleaseAudioTag:function(){this.startTime=0,this.previousTime=0,this.audio&&(this.audio.pause(),this.audio.dataset.used="false",this.audio=null)},reset:function(){n.prototype.stop.call(this)},onBlur:function(){this.isPlaying=!1,this.isPaused=!0,this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.currentConfig.delay=Math.max(0,(this.startTime-window.performance.now())/1e3),this.stopAndReleaseAudioTag()},onFocus:function(){this.isPlaying=!0,this.isPaused=!1,this.pickAndPlayAudioTag()},update:function(e){if(this.isPlaying)if(this.startTime>0)this.startTime<e-this.manager.audioPlayDelay&&(this.audio.currentTime+=Math.max(0,e-this.startTime)/1e3,this.startTime=0,this.previousTime=this.audio.currentTime,this.playCatchPromise());else{var t=this.currentMarker?this.currentMarker.start:0,i=t+this.duration,n=this.audio.currentTime;if(this.currentConfig.loop)n>=i-this.manager.loopEndOffset?(this.audio.currentTime=t+Math.max(0,n-i),n=this.audio.currentTime):n<t&&(this.audio.currentTime+=t,n=this.audio.currentTime),n<this.previousTime&&this.emit(s.LOOPED,this);else if(n>=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(s.COMPLETE,this);this.previousTime=n}},destroy:function(){n.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(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(e){this.currentConfig.mute=e,this.manager.isLocked(this,"mute",e)||(this.updateMute(),this.emit(s.MUTE,this,e))}},setMute:function(e){return this.mute=e,this},volume:{get:function(){return this.currentConfig.volume},set:function(e){this.currentConfig.volume=e,this.manager.isLocked(this,"volume",e)||(this.updateVolume(),this.emit(s.VOLUME,this,e))}},setVolume:function(e){return this.volume=e,this},rate:{get:function(){return this.currentConfig.rate},set:function(e){this.currentConfig.rate=e,this.manager.isLocked(this,s.RATE,e)||(this.calculateRate(),this.emit(s.RATE,this,e))}},setRate:function(e){return this.rate=e,this},detune:{get:function(){return this.currentConfig.detune},set:function(e){this.currentConfig.detune=e,this.manager.isLocked(this,s.DETUNE,e)||(this.calculateRate(),this.emit(s.DETUNE,this,e))}},setDetune:function(e){return this.detune=e,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(e){this.manager.isLocked(this,"seek",e)||this.startTime>0||(this.isPlaying||this.isPaused)&&(e=Math.min(Math.max(0,e),this.duration),this.isPlaying?(this.previousTime=e,this.audio.currentTime=e):this.isPaused&&(this.currentConfig.seek=e),this.emit(s.SEEK,this,e))}},setSeek:function(e){return this.seek=e,this},loop:{get:function(){return this.currentConfig.loop},set:function(e){this.currentConfig.loop=e,this.manager.isLocked(this,"loop",e)||(this.audio&&(this.audio.loop=e),this.emit(s.LOOP,this,e))}},setLoop:function(e){return this.loop=e,this},pan:{get:function(){return this.currentConfig.pan},set:function(e){this.currentConfig.pan=e,this.emit(s.PAN,this,e)}},setPan:function(e){return this.pan=e,this}});e.exports=o},33684(e,t,i){var n=i(85034),r=i(83419),s=i(14463),a=i(64895),o=new r({Extends:n,initialize:function(e){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,n.call(this,e)},add:function(e,t){var i=new a(this,e,t);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var e=this;if(this.game.cache.audio.entries.each(function(t,i){for(var n=0;n<i.length;n++)if("true"===i[n].dataset.locked)return e.locked=!0,!1;return!0}),this.locked){var t=!1,i=function(){t=!0},n=function(){if(t)t=!1;else{document.body.removeEventListener("touchmove",i),document.body.removeEventListener("touchend",n);var r=[];if(e.game.cache.audio.entries.each(function(e,t){for(var i=0;i<t.length;i++){var n=t[i];"true"===n.dataset.locked&&r.push(n)}return!0}),0!==r.length){var s=r[r.length-1];s.oncanplaythrough=function(){s.oncanplaythrough=null,r.forEach(function(e){e.dataset.locked="false"}),e.unlocked=!0},r.forEach(function(e){e.load()})}}};this.once(s.UNLOCKED,function(){for(this.forEachActiveSound(function(e){null===e.currentMarker&&0===e.duration&&(e.duration=e.tags[0].duration),e.totalDuration=e.tags[0].duration});this.lockedActionsQueue.length;){var e=this.lockedActionsQueue.shift();e.sound[e.prop].apply?e.sound[e.prop].apply(e.sound,e.value||[]):e.sound[e.prop]=e.value}},this),document.body.addEventListener("touchmove",i,!1),document.body.addEventListener("touchend",n,!1)}},onBlur:function(){this.forEachActiveSound(function(e){e.isPlaying&&(this.onBlurPausedSounds.push(e),e.onBlur())})},onFocus:function(){this.onBlurPausedSounds.forEach(function(e){e.onFocus()}),this.onBlurPausedSounds.length=0},destroy:function(){n.prototype.destroy.call(this),this.onBlurPausedSounds.length=0,this.onBlurPausedSounds=null},isLocked:function(e,t,i){return"true"===e.tags[0].dataset.locked&&(this.lockedActionsQueue.push({sound:e,prop:t,value:i}),!0)},setMute:function(e){return this.mute=e,this},mute:{get:function(){return this._mute},set:function(e){this._mute=e,this.forEachActiveSound(function(e){e.updateMute()}),this.emit(s.GLOBAL_MUTE,this,e)}},setVolume:function(e){return this.volume=e,this},volume:{get:function(){return this._volume},set:function(e){this._volume=e,this.forEachActiveSound(function(e){e.updateVolume()}),this.emit(s.GLOBAL_VOLUME,this,e)}}});e.exports=o},23717(e,t,i){e.exports={SoundManagerCreator:i(14747),Events:i(14463),BaseSound:i(30341),BaseSoundManager:i(85034),WebAudioSound:i(71741),WebAudioSoundManager:i(57490),HTML5AudioSound:i(64895),HTML5AudioSoundManager:i(33684),NoAudioSound:i(4603),NoAudioSoundManager:i(25960)}},4603(e,t,i){var n=i(30341),r=i(83419),s=i(50792),a=i(79291),o=i(29747),l=function(){return!1},h=function(){return null},u=function(){return this},c=new r({Extends:s,initialize:function(e,t,i){void 0===i&&(i={}),s.call(this),this.manager=e,this.key=t,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},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:l,updateMarker:l,removeMarker:h,play:l,pause:l,resume:l,stop:l,setMute:u,setVolume:u,setRate:u,setDetune:u,setSeek:u,setLoop:u,setPan:u,applyConfig:h,resetConfig:h,update:o,calculateRate:h,destroy:function(){n.prototype.destroy.call(this)}});e.exports=c},25960(e,t,i){var n=i(85034),r=i(83419),s=i(50792),a=i(4603),o=i(29747),l=new r({Extends:s,initialize:function(e){s.call(this),this.game=e,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(e,t){var i=new a(this,e,t);return this.sounds.push(i),i},addAudioSprite:function(e,t){var i=this.add(e,t);return i.spritemap={},i},get:function(e){return n.prototype.get.call(this,e)},getAll:function(e){return n.prototype.getAll.call(this,e)},play:function(e,t){return!1},playAudioSprite:function(e,t,i){return!1},remove:function(e){return n.prototype.remove.call(this,e)},removeAll:function(){return n.prototype.removeAll.call(this)},removeByKey:function(e){return n.prototype.removeByKey.call(this,e)},stopByKey:function(e){return n.prototype.stopByKey.call(this,e)},onBlur:o,onFocus:o,onGameBlur:o,onGameFocus:o,pauseAll:o,resumeAll:o,stopAll:o,update:o,setRate:o,setDetune:o,setMute:o,setVolume:o,unlock:o,forEachActiveSound:function(e,t){n.prototype.forEachActiveSound.call(this,e,t)},destroy:function(){n.prototype.destroy.call(this)}});e.exports=l},71741(e,t,i){var n=i(30341),r=i(83419),s=i(14463),a=i(95540),o=new r({Extends:n,initialize:function(e,t,i){if(void 0===i&&(i={}),this.audioBuffer=e.game.cache.audio.get(t),!this.audioBuffer)throw new Error('Audio key "'+t+'" not found in cache');this.source=null,this.loopSource=null,this.muteNode=e.context.createGain(),this.volumeNode=e.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),e.context.createPanner&&(this.spatialNode=e.context.createPanner(),this.volumeNode.connect(this.spatialNode)),e.context.createStereoPanner?(this.pannerNode=e.context.createStereoPanner(),e.context.createPanner?this.spatialNode.connect(this.pannerNode):this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(e.destination)):e.context.createPanner?this.spatialNode.connect(e.destination):this.volumeNode.connect(e.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,e,t,i)},play:function(e,t){return!!n.prototype.play.call(this,e,t)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(s.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime<this.startTime)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.getCurrentTime(),this.stopAndRemoveBufferSource(),this.emit(s.PAUSE,this),!0))},resume:function(){return!(this.manager.context.currentTime<this.startTime)&&(!!n.prototype.resume.call(this)&&(this.createAndStartBufferSource(),this.emit(s.RESUME,this),!0))},stop:function(){return!!n.prototype.stop.call(this)&&(this.stopAndRemoveBufferSource(),this.emit(s.STOP,this),!0)},createAndStartBufferSource:function(){var e=this.currentConfig.seek,t=this.currentConfig.delay,i=this.manager.context.currentTime+t,n=(this.currentMarker?this.currentMarker.start:0)+e,r=this.duration-e;this.playTime=i-e,this.startTime=i,this.source=this.createBufferSource(),this.applyConfig(),this.source.start(Math.max(0,i),Math.max(0,n),Math.max(0,r)),this.resetConfig()},createAndStartLoopBufferSource:function(){var e=this.getLoopTime(),t=this.currentMarker?this.currentMarker.start:0,i=this.duration;this.loopTime=e,this.loopSource=this.createBufferSource(),this.loopSource.playbackRate.setValueAtTime(this.totalRate,0),this.loopSource.start(Math.max(0,e),Math.max(0,t),Math.max(0,i))},createBufferSource:function(){var e=this,t=this.manager.context.createBufferSource();return t.buffer=this.audioBuffer,t.connect(this.muteNode),t.onended=function(t){var i=t.target;i!==e.source&&i!==e.loopSource||(e.currentConfig.loop?e.hasLooped=!0:e.hasEnded=!0)},t},stopAndRemoveBufferSource:function(){if(this.source){var e=this.source;this.source=null,e.stop(),e.disconnect()}this.playTime=0,this.startTime=0,this.hasEnded=!1,this.stopAndRemoveLoopBufferSource()},stopAndRemoveLoopBufferSource:function(){this.loopSource&&(this.loopSource.stop(),this.loopSource.disconnect(),this.loopSource=null),this.loopTime=0},applyConfig:function(){this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:1});var e=this.currentConfig.source;if(e&&this.manager.context.createPanner){var t=this.spatialNode;t.panningModel=a(e,"panningModel","equalpower"),t.distanceModel=a(e,"distanceModel","inverse"),t.orientationX.value=a(e,"orientationX",0),t.orientationY.value=a(e,"orientationY",0),t.orientationZ.value=a(e,"orientationZ",-1),t.refDistance=a(e,"refDistance",1),t.maxDistance=a(e,"maxDistance",1e4),t.rolloffFactor=a(e,"rolloffFactor",1),t.coneInnerAngle=a(e,"coneInnerAngle",360),t.coneOuterAngle=a(e,"coneOuterAngle",0),t.coneOuterGain=a(e,"coneOuterGain",0),this.spatialSource=a(e,"follow",null),this.spatialSource||(t.positionX.value=a(e,"x",0),t.positionY.value=a(e,"y",0),t.positionZ.value=a(e,"z",0))}n.prototype.applyConfig.call(this)},x:{get:function(){return this.spatialNode?this.spatialNode.positionX:0},set:function(e){this.spatialNode&&(this.spatialNode.positionX.value=e)}},y:{get:function(){return this.spatialNode?this.spatialNode.positionY:0},set:function(e){this.spatialNode&&(this.spatialNode.positionY.value=e)}},update:function(){if(this.isPlaying&&this.spatialSource){var e=a(this.spatialSource,"x",null),t=a(this.spatialSource,"y",null);e&&e!==this._spatialx&&(this._spatialx=this.spatialNode.positionX.value=e),t&&t!==this._spatialy&&(this._spatialy=this.spatialNode.positionY.value=t)}this.hasEnded?(n.prototype.stop.call(this),this.stopAndRemoveBufferSource(),this.emit(s.COMPLETE,this)):this.hasLooped&&(this.hasLooped=!1,this.source=this.loopSource,this.loopSource=null,this.playTime=this.startTime=this.loopTime,this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:this.totalRate}),this.createAndStartLoopBufferSource(),this.emit(s.LOOPED,this))},destroy:function(){this.pendingRemove||(n.prototype.destroy.call(this),this.audioBuffer=null,this.stopAndRemoveBufferSource(),this.muteNode.disconnect(),this.muteNode=null,this.volumeNode.disconnect(),this.volumeNode=null,this.pannerNode&&(this.pannerNode.disconnect(),this.pannerNode=null),this.spatialNode&&(this.spatialNode.disconnect(),this.spatialNode=null,this.spatialSource=null),this.rateUpdates.length=0,this.rateUpdates=null)},calculateRate:function(){n.prototype.calculateRate.call(this);var e=this.manager.context.currentTime;this.source&&"number"===typeof this.totalRate&&this.source.playbackRate.setValueAtTime(this.totalRate,e),this.isPlaying&&(this.rateUpdates.push({time:Math.max(this.startTime,e)-this.playTime,rate:this.totalRate}),this.loopSource&&(this.stopAndRemoveLoopBufferSource(),this.createAndStartLoopBufferSource()))},getCurrentTime:function(){for(var e=0,t=0;t<this.rateUpdates.length;t++){e+=((t<this.rateUpdates.length-1?this.rateUpdates[t+1].time:this.manager.context.currentTime-this.playTime)-this.rateUpdates[t].time)*this.rateUpdates[t].rate}return e},getLoopTime:function(){for(var e=0,t=0;t<this.rateUpdates.length-1;t++)e+=(this.rateUpdates[t+1].time-this.rateUpdates[t].time)*this.rateUpdates[t].rate;var i=this.rateUpdates[this.rateUpdates.length-1];return this.playTime+i.time+(this.duration-e)/i.rate},rate:{get:function(){return this.currentConfig.rate},set:function(e){this.currentConfig.rate=e,this.calculateRate(),this.emit(s.RATE,this,e)}},setRate:function(e){return this.rate=e,this},detune:{get:function(){return this.currentConfig.detune},set:function(e){this.currentConfig.detune=e,this.calculateRate(),this.emit(s.DETUNE,this,e)}},setDetune:function(e){return this.detune=e,this},mute:{get:function(){return 0===this.muteNode.gain.value},set:function(e){this.currentConfig.mute=e,this.muteNode.gain.setValueAtTime(e?0:1,0),this.emit(s.MUTE,this,e)}},setMute:function(e){return this.mute=e,this},volume:{get:function(){return this.volumeNode.gain.value},set:function(e){this.currentConfig.volume=e,this.volumeNode.gain.setValueAtTime(e,0),this.emit(s.VOLUME,this,e)}},setVolume:function(e){return this.volume=e,this},seek:{get:function(){return this.isPlaying?this.manager.context.currentTime<this.startTime?this.startTime-this.playTime:this.getCurrentTime():this.isPaused?this.currentConfig.seek:0},set:function(e){this.manager.context.currentTime<this.startTime||(this.isPlaying||this.isPaused)&&(e=Math.min(Math.max(0,e),this.duration),this.currentConfig.seek=e,this.isPlaying&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource()),this.emit(s.SEEK,this,e))}},setSeek:function(e){return this.seek=e,this},loop:{get:function(){return this.currentConfig.loop},set:function(e){this.currentConfig.loop=e,this.isPlaying&&(this.stopAndRemoveLoopBufferSource(),e&&this.createAndStartLoopBufferSource()),this.emit(s.LOOP,this,e)}},setLoop:function(e){return this.loop=e,this},pan:{get:function(){return this.pannerNode?this.pannerNode.pan.value:0},set:function(e){this.currentConfig.pan=e,this.pannerNode&&this.pannerNode.pan.setValueAtTime(e,this.manager.context.currentTime),this.emit(s.PAN,this,e)}},setPan:function(e){return this.pan=e,this}});e.exports=o},57490(e,t,i){var n=i(53134),r=i(85034),s=i(83419),a=i(14463),o=i(8443),l=i(71741),h=i(95540),u=new s({Extends:r,initialize:function(e){this.context=this.createAudioContext(e),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state,r.call(this,e),this.locked&&(e.isBooted?this.unlock():e.events.once(o.BOOT,this.unlock,this)),e.events.on(o.VISIBLE,this.onGameVisible,this)},onGameVisible:function(){var e=this.context;window.setTimeout(function(){e&&(e.suspend(),e.resume())},100)},createAudioContext:function(e){var t=e.config.audio;return t.context?(t.context.resume(),t.context):window.hasOwnProperty("AudioContext")?new AudioContext:window.hasOwnProperty("webkitAudioContext")?new window.webkitAudioContext:void 0},setAudioContext:function(e){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=e,this.masterMuteNode=e.createGain(),this.masterVolumeNode=e.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(e.destination),this.destination=this.masterMuteNode,this},add:function(e,t){var i=new l(this,e,t);return this.sounds.push(i),i},decodeAudio:function(e,t){var i;i=Array.isArray(e)?e:[{key:e,data:t}];for(var r=this.game.cache.audio,s=i.length,o=0;o<i.length;o++){var l=i[o],h=l.key,u=l.data;"string"===typeof u&&(u=n(u));var c=function(e,t){r.add(e,t),this.emit(a.DECODED,e),0===--s&&this.emit(a.DECODED_ALL)}.bind(this,h),d=function(e,t){console.error("Error decoding audio: "+e+" - ",t?t.message:""),0===--s&&this.emit(a.DECODED_ALL)}.bind(this,h);this.context.decodeAudioData(u,c,d)}},setListenerPosition:function(e,t){return void 0===e&&(e=this.game.scale.width/2),void 0===t&&(t=this.game.scale.height/2),this.listenerPosition.set(e,t),this},unlock:function(){var e=this,t=document.body,i=function i(){if(e.context&&t){var n=t.removeEventListener.bind(t);e.context.resume().then(function(){n("touchstart",i),n("touchend",i),n("mousedown",i),n("mouseup",i),n("keydown",i),e.unlocked=!0},function(){n("touchstart",i),n("touchend",i),n("mousedown",i),n("mouseup",i),n("keydown",i)})}};t&&(t.addEventListener("touchstart",i,!1),t.addEventListener("touchend",i,!1),t.addEventListener("mousedown",i,!1),t.addEventListener("mouseup",i,!1),t.addEventListener("keydown",i,!1))},onBlur:function(){this.locked||this.context.suspend()},onFocus:function(){var e=this.context;!e||this.locked||"suspended"!==e.state&&"interrupted"!==e.state||e.resume()},update:function(e,t){var i=this.context.listener,n=h(this.listenerPosition,"x",null),s=h(this.listenerPosition,"y",null);if(i&&void 0!==i.positionX)n&&n!==this._spatialx&&(this._spatialx=i.positionX.value=n),s&&s!==this._spatialy&&(this._spatialy=i.positionY.value=s);else if(i){n&&n!==this._spatialx&&(this._spatialx=n),s&&s!==this._spatialy&&(this._spatialy=s);var a=h(i,"z",0);i.setPosition(this._spatialx||0,this._spatialy||0,a)}r.prototype.update.call(this,e,t),this.gameLostFocus||this.onFocus()},destroy:function(){if(this.destination=null,this.masterVolumeNode.disconnect(),this.masterVolumeNode=null,this.masterMuteNode.disconnect(),this.masterMuteNode=null,this.game.config.audio.context)this.context.suspend();else{var e=this;this.context.close().then(function(){e.context=null})}this.game.events.off(o.VISIBLE,this.onGameVisible,this),r.prototype.destroy.call(this)},setMute:function(e){return this.mute=e,this},mute:{get:function(){return 0===this.masterMuteNode.gain.value},set:function(e){this.masterMuteNode.gain.setValueAtTime(e?0:1,0),this.emit(a.GLOBAL_MUTE,this,e)}},setVolume:function(e){return this.volume=e,this},volume:{get:function(){return this.masterVolumeNode.gain.value},set:function(e){this.masterVolumeNode.gain.setValueAtTime(e,0),this.emit(a.GLOBAL_VOLUME,this,e)}}});e.exports=u},73162(e,t,i){var n=i(37105),r=i(83419),s=i(29747),a=i(19186),o=new r({initialize:function(e){this.parent=e,this.list=[],this.position=0,this.addCallback=s,this.removeCallback=s,this._sortKey=""},add:function(e,t){return t?n.Add(this.list,e):n.Add(this.list,e,0,this.addCallback,this)},addAt:function(e,t,i){return i?n.AddAt(this.list,e,t):n.AddAt(this.list,e,t,0,this.addCallback,this)},getAt:function(e){return this.list[e]},getIndex:function(e){return this.list.indexOf(e)},sort:function(e,t){return e?(void 0===t&&(t=function(t,i){return t[e]-i[e]}),a(this.list,t),this):this},getByName:function(e){return n.GetFirst(this.list,"name",e)},getRandom:function(e,t){return n.GetRandom(this.list,e,t)},getFirst:function(e,t,i,r){return n.GetFirst(this.list,e,t,i,r)},getAll:function(e,t,i,r){return n.GetAll(this.list,e,t,i,r)},count:function(e,t){return n.CountAllMatching(this.list,e,t)},swap:function(e,t){n.Swap(this.list,e,t)},moveTo:function(e,t){return n.MoveTo(this.list,e,t)},moveAbove:function(e,t){return n.MoveAbove(this.list,e,t)},moveBelow:function(e,t){return n.MoveBelow(this.list,e,t)},remove:function(e,t){return t?n.Remove(this.list,e):n.Remove(this.list,e,this.removeCallback,this)},removeAt:function(e,t){return t?n.RemoveAt(this.list,e):n.RemoveAt(this.list,e,this.removeCallback,this)},removeBetween:function(e,t,i){return i?n.RemoveBetween(this.list,e,t):n.RemoveBetween(this.list,e,t,this.removeCallback,this)},removeAll:function(e){for(var t=this.list.length;t--;)this.remove(this.list[t],e);return this},bringToTop:function(e){return n.BringToTop(this.list,e)},sendToBack:function(e){return n.SendToBack(this.list,e)},moveUp:function(e){return n.MoveUp(this.list,e),e},moveDown:function(e){return n.MoveDown(this.list,e),e},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(e,t){return n.Replace(this.list,e,t)},exists:function(e){return this.list.indexOf(e)>-1},setAll:function(e,t,i,r){return n.SetAll(this.list,e,t,i,r),this},each:function(e,t){for(var i=[null],n=2;n<arguments.length;n++)i.push(arguments[n]);for(n=0;n<this.list.length;n++)i[0]=this.list[n],e.apply(t,i)},shutdown:function(){this.removeAll(),this.list=[]},destroy:function(){this.removeAll(),this.parent=null,this.addCallback=null,this.removeCallback=null},length:{get:function(){return this.list.length}},first:{get:function(){return this.position=0,this.list.length>0?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.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return this.position>0?(this.position--,this.list[this.position]):null}}});e.exports=o},90330(e,t,i){var n=new(i(83419))({initialize:function(e){this.entries={},this.size=0,this.setAll(e)},setAll:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.set(e[t][0],e[t][1]);return this},set:function(e,t){return this.has(e)||this.size++,this.entries[e]=t,this},get:function(e){if(this.has(e))return this.entries[e]},getArray:function(){var e=[],t=this.entries;for(var i in t)e.push(t[i]);return e},has:function(e){return this.entries.hasOwnProperty(e)},delete:function(e){return this.has(e)&&(delete this.entries[e],this.size--),this},clear:function(){return Object.keys(this.entries).forEach(function(e){delete this.entries[e]},this),this.size=0,this},keys:function(){return Object.keys(this.entries)},values:function(){var e=[],t=this.entries;for(var i in t)e.push(t[i]);return e},dump:function(){var e=this.entries;for(var t in console.group("Map"),e)console.log(t,e[t]);console.groupEnd()},each:function(e){var t=this.entries;for(var i in t)if(!1===e(i,t[i]))break;return this},contains:function(e){var t=this.entries;for(var i in t)if(t[i]===e)return!0;return!1},merge:function(e,t){void 0===t&&(t=!1);var i=this.entries,n=e.entries;for(var r in n)i.hasOwnProperty(r)&&t?i[r]=n[r]:this.set(r,n[r]);return this}});e.exports=n},25774(e,t,i){var n=i(83419),r=i(50792),s=i(82348),a=new n({Extends:r,initialize:function(){r.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(e){return this._active.indexOf(e)>-1},isPending:function(e){return this._toProcess>0&&this._pending.indexOf(e)>-1},isDestroying:function(e){return this._destroy.indexOf(e)>-1},add:function(e){return this.checkQueue&&this.isActive(e)&&!this.isDestroying(e)||this.isPending(e)||(this._pending.push(e),this._toProcess++),e},remove:function(e){if(this.isPending(e)){var t=this._pending,i=t.indexOf(e);-1!==i&&t.splice(i,1)}else this.isActive(e)&&(this._destroy.push(e),this._toProcess++);return e},removeAll:function(){for(var e=this._active,t=this._destroy,i=e.length;i--;)t.push(e[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var e,t,i=this._destroy,n=this._active;for(e=0;e<i.length;e++){t=i[e];var r=n.indexOf(t);-1!==r&&(n.splice(r,1),this.emit(s.PROCESS_QUEUE_REMOVE,t))}for(i.length=0,i=this._pending,e=0;e<i.length;e++)t=i[e],(!this.checkQueue||this.checkQueue&&-1===n.indexOf(t))&&(n.push(t),this.emit(s.PROCESS_QUEUE_ADD,t));return i.length=0,this._toProcess=0,n},getActive:function(){return this._active},length:{get:function(){return this._active.length}},destroy:function(){this._toProcess=0,this._pending=[],this._active=[],this._destroy=[]}});e.exports=a},59542(e,t,i){var n=i(43886);function r(e){if(!(this instanceof r))return new r(e,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function s(e,t,i){if(!i)return t.indexOf(e);for(var n=0;n<t.length;n++)if(i(e,t[n]))return n;return-1}function a(e,t){o(e,0,e.children.length,t,e)}function o(e,t,i,n,r){r||(r=v(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var s,a=t;a<i;a++)s=e.children[a],l(r,e.leaf?n(s):s);return r}function l(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function h(e,t){return e.minX-t.minX}function u(e,t){return e.minY-t.minY}function c(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function d(e){return e.maxX-e.minX+(e.maxY-e.minY)}function f(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function p(e,t){var i=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),s=Math.min(e.maxY,t.maxY);return Math.max(0,r-i)*Math.max(0,s-n)}function m(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function g(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function v(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,t,i,r,s){for(var a,o=[t,i];o.length;)(i=o.pop())-(t=o.pop())<=r||(a=t+Math.ceil((i-t)/r/2)*r,n(e,a,t,i,s),o.push(t,a,a,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],n=this.toBBox;if(!g(e,t))return i;for(var r,s,a,o,l=[];t;){for(r=0,s=t.children.length;r<s;r++)a=t.children[r],g(e,o=t.leaf?n(a):a)&&(t.leaf?i.push(a):m(e,o)?this._all(a,i):l.push(a));t=l.pop()}return i},collides:function(e){var t=this.data,i=this.toBBox;if(!g(e,t))return!1;for(var n,r,s,a,o=[];t;){for(n=0,r=t.children.length;n<r;n++)if(s=t.children[n],g(e,a=t.leaf?i(s):s)){if(t.leaf||m(e,a))return!0;o.push(s)}t=o.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}var n=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=v([]),this},remove:function(e,t){if(!e)return this;for(var i,n,r,a,o=this.data,l=this.toBBox(e),h=[],u=[];o||h.length;){if(o||(o=h.pop(),n=h[h.length-1],i=u.pop(),a=!0),o.leaf&&-1!==(r=s(e,o.children,t)))return o.children.splice(r,1),h.push(o),this._condense(h),this;a||o.leaf||!m(o,l)?n?(i++,o=n.children[i],a=!1):o=null:(h.push(o),u.push(i),i=0,n=o,o=o.children[0])}return this},toBBox:function(e){return e},compareMinX:h,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},_build:function(e,t,i,n){var r,s=i-t+1,o=this._maxEntries;if(s<=o)return a(r=v(e.slice(t,i+1)),this.toBBox),r;n||(n=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,n-1))),(r=v([])).leaf=!1,r.height=n;var l,h,u,c,d=Math.ceil(s/o),f=d*Math.ceil(Math.sqrt(o));for(y(e,t,i,f,this.compareMinX),l=t;l<=i;l+=f)for(y(e,l,u=Math.min(l+f-1,i),d,this.compareMinY),h=l;h<=u;h+=d)c=Math.min(h+d-1,u),r.children.push(this._build(e,h,c,n-1));return a(r,this.toBBox),r},_chooseSubtree:function(e,t,i,n){for(var r,s,a,o,l,h,u,d;n.push(t),!t.leaf&&n.length-1!==i;){for(u=d=1/0,r=0,s=t.children.length;r<s;r++)l=c(a=t.children[r]),(h=f(e,a)-l)<d?(d=h,u=l<u?l:u,o=a):h===d&&l<u&&(u=l,o=a);t=o||t.children[0]}return t},_insert:function(e,t,i){var n=this.toBBox,r=i?e:n(e),s=[],a=this._chooseSubtree(r,this.data,t,s);for(a.children.push(e),l(a,r);t>=0&&s[t].children.length>this._maxEntries;)this._split(s,t),t--;this._adjustParentBBoxes(r,s,t)},_split:function(e,t){var i=e[t],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);var s=this._chooseSplitIndex(i,r,n),o=v(i.children.splice(s,i.children.length-s));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(e,t){this.data=v([e,t]),this.data.height=e.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var n,r,s,a,l,h,u,d;for(h=u=1/0,n=t;n<=i-t;n++)a=p(r=o(e,0,n,this.toBBox),s=o(e,n,i,this.toBBox)),l=c(r)+c(s),a<h?(h=a,d=n,u=l<u?l:u):a===h&&l<u&&(u=l,d=n);return d},_chooseSplitAxis:function(e,t,i){var n=e.leaf?this.compareMinX:h,r=e.leaf?this.compareMinY:u;this._allDistMargin(e,t,i,n)<this._allDistMargin(e,t,i,r)&&e.children.sort(n)},_allDistMargin:function(e,t,i,n){e.children.sort(n);var r,s,a=this.toBBox,h=o(e,0,t,a),u=o(e,i-t,i,a),c=d(h)+d(u);for(r=t;r<i-t;r++)s=e.children[r],l(h,e.leaf?a(s):s),c+=d(h);for(r=i-t-1;r>=t;r--)s=e.children[r],l(u,e.leaf?a(s):s),c+=d(u);return c},_adjustParentBBoxes:function(e,t,i){for(var n=i;n>=0;n--)l(t[n],e)},_condense:function(e){for(var t,i=e.length-1;i>=0;i--)0===e[i].children.length?i>0?(t=e[i-1].children).splice(t.indexOf(e[i]),1):this.clear():a(e[i],this.toBBox)},compareMinX:function(e,t){return e.left-t.left},compareMinY:function(e,t){return e.top-t.top},toBBox:function(e){return{minX:e.left,minY:e.top,maxX:e.right,maxY:e.bottom}}},e.exports=r},86555(e,t,i){var n=i(45319),r=i(83419),s=i(56583),a=i(26099),o=new r({initialize:function(e,t,i,n){void 0===e&&(e=0),void 0===t&&(t=e),void 0===i&&(i=0),void 0===n&&(n=null),this._width=e,this._height=t,this._parent=n,this.aspectMode=i,this.aspectRatio=0===t?1:e/t,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new a},setAspectMode:function(e){return void 0===e&&(e=0),this.aspectMode=e,this.setSize(this._width,this._height)},setSnap:function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this.snapTo.set(e,t),this.setSize(this._width,this._height)},setParent:function(e){return this._parent=e,this.setSize(this._width,this._height)},setMin:function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this.minWidth=n(e,0,this.maxWidth),this.minHeight=n(t,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(e,t){return void 0===e&&(e=Number.MAX_VALUE),void 0===t&&(t=e),this.maxWidth=n(e,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(t,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(e,t){switch(void 0===e&&(e=0),void 0===t&&(t=e),this.aspectMode){case o.NONE:this._width=this.getNewWidth(s(e,this.snapTo.x)),this._height=this.getNewHeight(s(t,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case o.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(s(e,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case o.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(s(t,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case o.FIT:this.constrain(e,t,!0);break;case o.ENVELOP:this.constrain(e,t,!1)}return this},setAspectRatio:function(e){return this.aspectRatio=e,this.setSize(this._width,this._height)},resize:function(e,t){return this._width=this.getNewWidth(s(e,this.snapTo.x)),this._height=this.getNewHeight(s(t,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(e,t){return void 0===t&&(t=!0),e=n(e,this.minWidth,this.maxWidth),t&&this._parent&&e>this._parent.width&&(e=Math.max(this.minWidth,this._parent.width)),e},getNewHeight:function(e,t){return void 0===t&&(t=!0),e=n(e,this.minHeight,this.maxHeight),t&&this._parent&&e>this._parent.height&&(e=Math.max(this.minHeight,this._parent.height)),e},constrain:function(e,t,i){void 0===e&&(e=0),void 0===t&&(t=e),void 0===i&&(i=!0),e=this.getNewWidth(e),t=this.getNewHeight(t);var n=this.snapTo,r=0===t?1:e/t;return i&&this.aspectRatio>r||!i&&this.aspectRatio<r?(t=(e=s(e,n.x))/this.aspectRatio,n.y>0&&(e=(t=s(t,n.y))*this.aspectRatio)):(i&&this.aspectRatio<r||!i&&this.aspectRatio>r)&&(e=(t=s(t,n.y))*this.aspectRatio,n.x>0&&(t=(e=s(e,n.x))*(1/this.aspectRatio))),this._width=e,this._height=t,this},fitTo:function(e,t){return this.constrain(e,t,!0)},envelop:function(e,t){return this.constrain(e,t,!1)},setWidth:function(e){return this.setSize(e,this._height)},setHeight:function(e){return this.setSize(this._width,e)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(e){e&&e.style&&(e.style.width=this._width+"px",e.style.height=this._height+"px")},copy:function(e){return e.setAspectMode(this.aspectMode),e.aspectRatio=this.aspectRatio,e.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(e){this.setSize(e,this._height)}},height:{get:function(){return this._height},set:function(e){this.setSize(this._width,e)}}});o.NONE=0,o.WIDTH_CONTROLS_HEIGHT=1,o.HEIGHT_CONTROLS_WIDTH=2,o.FIT=3,o.ENVELOP=4,e.exports=o},15238(e){e.exports="add"},56187(e){e.exports="remove"},82348(e,t,i){e.exports={PROCESS_QUEUE_ADD:i(15238),PROCESS_QUEUE_REMOVE:i(56187)}},41392(e,t,i){e.exports={Events:i(82348),List:i(73162),Map:i(90330),ProcessQueue:i(25774),RTree:i(59542),Size:i(86555)}},57382(e,t,i){var n=i(83419),r=i(45319),s=i(40987),a=i(8054),o=i(50030),l=i(79237),h=new n({Extends:l,initialize:function(e,t,i,n,r){l.call(this,e,t,i,n,r),this.add("__BASE",0,0,0,n,r),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=n,this.height=r,this.imageData=this.context.getImageData(0,0,n,r),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(e,t,i,n){return void 0===n&&(n=!0),this.context.drawImage(i,e,t),n&&this.update(),this},drawFrame:function(e,t,i,n,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=!0);var s=this.manager.getFrame(e,t);if(s){var a=s.canvasData,o=s.cutWidth,l=s.cutHeight,h=s.source.resolution;this.context.drawImage(s.source.image,a.x,a.y,o,l,i,n,o/h,l/h),r&&this.update()}return this},setPixel:function(e,t,i,n,r,s){if(void 0===s&&(s=255),e=Math.abs(Math.floor(e)),t=Math.abs(Math.floor(t)),this.getIndex(e,t)>-1){var a=this.context.getImageData(e,t,1,1);a.data[0]=i,a.data[1]=n,a.data[2]=r,a.data[3]=s,this.context.putImageData(a,e,t)}return this},putData:function(e,t,i,n,r,s,a){return void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=e.width),void 0===a&&(a=e.height),this.context.putImageData(e,t,i,n,r,s,a),this},getData:function(e,t,i,n){return e=r(Math.floor(e),0,this.width-1),t=r(Math.floor(t),0,this.height-1),i=r(i,1,this.width-e),n=r(n,1,this.height-t),this.context.getImageData(e,t,i,n)},getPixel:function(e,t,i){i||(i=new s);var n=this.getIndex(e,t);if(n>-1){var r=this.data,a=r[n+0],o=r[n+1],l=r[n+2],h=r[n+3];i.setTo(a,o,l,h)}return i},getPixels:function(e,t,i,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=this.width),void 0===n&&(n=i),e=Math.abs(Math.round(e)),t=Math.abs(Math.round(t));for(var a=r(e,0,this.width),o=r(e+i,0,this.width),l=r(t,0,this.height),h=r(t+n,0,this.height),u=new s,c=[],d=l;d<h;d++){for(var f=[],p=a;p<o;p++)u=this.getPixel(p,d,u),f.push({x:p,y:d,color:u.color,alpha:u.alphaGL});c.push(f)}return c},getIndex:function(e,t){return e=Math.abs(Math.round(e)),t=Math.abs(Math.round(t)),e<this.width&&t<this.height?4*(e+t*this.width):-1},refresh:function(){return this._source.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(e,t,i,n,r){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=this.width),void 0===n&&(n=this.height),void 0===r&&(r=!0),this.context.clearRect(e,t,i,n),r&&this.update(),this},setSize:function(e,t){return void 0===t&&(t=e),e===this.width&&t===this.height||(this.canvas.width=e,this.canvas.height=t,this._source.width=e,this._source.height=t,this._source.isPowerOf2=o(e,t),this.frames.__BASE.setSize(e,t,0,0),this.width=e,this.height=t,this.refresh()),this},destroy:function(){l.prototype.destroy.call(this),this._source=null,this.canvas=null,this.context=null,this.imageData=null,this.data=null,this.pixels=null,this.buffer=null}});e.exports=h},81320(e,t,i){var n=i(10312),r=i(38058),s=i(27919),a=i(83419),o=i(8054),l=i(87774),h=i(4327),u=i(95540),c=i(79237),d=i(70554),f=i(42538),p=i(61340),m=new a({Extends:c,initialize:function(e,t,i,n,a){void 0===i&&(i=256),void 0===n&&(n=256),void 0===a&&(a=!0),this.type="DynamicTexture";var h=e.game.renderer,u=h&&h.type===o.CANVAS,d=u?s.create2D(this,i,n):[this];(c.call(this,e,t,d,i,n),this.add("__BASE",0,0,0,i,n),this.renderer=h,this.width=-1,this.height=-1,this.commandBuffer=[],this.canvas=u?d:null,this.context=u?d.getContext("2d",{willReadFrequently:!0}):null,this.camera=new r(0,0,i,n).setScene(e.game.scene.systemScene,!1),this.drawingContext=u?null:new l(h,{width:i,height:n,camera:this.camera,autoClear:!1,enableMipmap:!0}),u)||(this.get().source.glTexture=this.drawingContext.texture);this.setSize(i,n,a)},setSize:function(e,t,i){void 0===t&&(t=e),void 0===i&&(i=!0),i&&((e=Math.floor(e))%2!==0&&e++,(t=Math.floor(t))%2!==0&&t++);var n=this.get(),r=n.source;if(e!==this.width||t!==this.height){this.canvas&&(this.canvas.width=e,this.canvas.height=t);var s=this.drawingContext;!s||s.width===e&&s.height===t||s.resize(e,t),this.camera.setSize(e,t),r.updateSize(e,t),n.setSize(e,t),this.width=e,this.height=t}else{var a=this.getSourceImage();n.cutX+e>a.width&&(e=a.width-n.cutX),n.cutY+t>a.height&&(t=a.height-n.cutY),n.setSize(e,t,n.cutX,n.cutY)}return this},render:function(){if(0!==this.commandBuffer.length)return this.camera.preRender(),this.renderer.type===o.WEBGL&&this._renderWebGL(),this.renderer.type===o.CANVAS&&this._renderCanvas(),this},_renderWebGL:function(){this.renderer.renderNodes.getNode("DynamicTextureHandler").run(this)},_renderCanvas:function(){var e,t,i,r,s,a,o,l,h,u,c,d,p,m,g,v=this.camera,y=this.context,x=this.renderer,b=this.manager;x.setContext(y);for(var w=this.commandBuffer,T=w.length,_=!1,S=!1,E=0;E<T;E++){switch(w[E]){case f.CLEAR:m=w[++E],g=w[++E],p=w[++E],s=w[++E],void 0!==m&&void 0!==g&&void 0!==p&&void 0!==s?y.clearRect(m,g,p,s):(y.save(),y.setTransform(1,0,0,1,0,0),y.clearRect(0,0,this.width,this.height),y.restore());break;case f.FILL:var C=w[++E];m=w[++E],g=w[++E],p=w[++E],s=w[++E],e=(C>>24&255)/255;var A=C>>16&255,k=C>>8&255,R=255&C;y.save(),y.globalCompositeOperation="source-over",y.fillStyle="rgba("+A+","+k+","+R+","+e+")",y.fillRect(m,g,p,s),y.restore();break;case f.STAMP:a=w[++E],r=w[++E],m=w[++E],g=w[++E],e=w[++E],d=w[++E],h=w[++E],u=w[++E],c=w[++E],o=w[++E],l=w[++E],t=w[++E],S&&(t=n.ERASE);var O=b.resetStamp(e,d);O.setPosition(m,g).setRotation(h).setScale(u,c).setTexture(a,r).setOrigin(o,l).setBlendMode(t),O.renderCanvas(x,O,v,null);break;case f.REPEAT:a=w[++E],r=w[++E],m=w[++E],g=w[++E],e=w[++E],d=w[++E],h=w[++E],u=w[++E],c=w[++E],o=w[++E],l=w[++E],t=w[++E],p=w[++E],s=w[++E];var P=w[++E],M=w[++E],N=w[++E],I=w[++E],L=w[++E];S&&(t=n.ERASE);var D=b.resetTileSprite(e,d);D.setPosition(m,g).setRotation(h).setScale(u,c).setTexture(a,r).setSize(p,s).setOrigin(o,l).setBlendMode(t).setTilePosition(P,M).setTileRotation(N).setTileScale(I,L),D.renderCanvas(x,D,v,null);break;case f.DRAW:var F=w[++E];if(m=w[++E],g=w[++E],void 0!==m){var B=F.x;F.x=m}if(void 0!==g){var U=F.y;F.y=g}S&&(i=F.blendMode,F.blendMode=n.ERASE),F.renderCanvas(x,F,v,null),void 0!==m&&(F.x=B),void 0!==g&&(F.y=U),S&&(F.blendMode=i);break;case f.SET_ERASE:S=!!w[++E];break;case f.PRESERVE:_=w[++E];break;case f.CALLBACK:(0,w[++E])();break;case f.CAPTURE:F=w[++E];var z=w[++E],V=this.startCapture(F,z);F.renderCanvas(x,F,z.camera||v,V.transform),this.finishCapture(F,V)}}_||(w.length=0),x.setContext()},fill:function(e,t,i,n,r,s){void 0===t&&(t=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=this.width),void 0===s&&(s=this.height);var a=e>>16&255,o=e>>8&255,l=255&e,h=d.getTintFromFloats(a/255,o/255,l/255,t);return this.commandBuffer.push(f.FILL,h,i,n,r,s),this},clear:function(e,t,i,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=this.width),void 0===n&&(n=this.height),this.commandBuffer.push(f.CLEAR,e,t,i,n),this},stamp:function(e,t,i,n,r){void 0===i&&(i=0),void 0===n&&(n=0);var s=u(r,"alpha",1),a=u(r,"tint",16777215),o=u(r,"angle",0),l=u(r,"rotation",0),h=u(r,"scale",1),c=u(r,"scaleX",h),d=u(r,"scaleY",h),p=u(r,"originX",.5),m=u(r,"originY",.5),g=u(r,"blendMode",0);return 0!==o&&(l=o*Math.PI/180),this.commandBuffer.push(f.STAMP,e,t,i,n,s,a,l,c,d,p,m,g),this},erase:function(e,t,i,n,r){var s=this.commandBuffer,a=s.length;return s[a-2]!==f.SET_ERASE||s[a-1]?s.push(f.SET_ERASE,!0):s.length-=2,this.draw(e,t,i,n,r),s.push(f.SET_ERASE,!1),this},draw:function(e,t,i,n,r){Array.isArray(e)||(e=[e]);for(var s=e.length,a=0;a<s;a++){var o=e[a];if(o&&o!==this)if(o.renderWebGL||o.renderCanvas)this.commandBuffer.push(f.DRAW,o,t,i);else if(o.isParent||o.list)for(var l=o.getChildren(),u=0;u<l.length;u++){var c=l[u];c.willRender(this.camera)&&this.draw(c,t,i)}else"string"===typeof o?this.stamp(o,null,t,i,{alpha:n,tint:r}):o instanceof h?this.stamp(o.texture.key,o,t,i,{alpha:n,tint:r}):Array.isArray(o)&&this.draw(o,t,i,n,r)}return this},capture:function(e,t){return t||(t={}),this.commandBuffer.push(f.CAPTURE,e,t),this},startCapture:function(e,t){var i={},n=void 0;return t.transform instanceof p?n=t.transform:"world"===t.transform&&e.parentContainer&&(n=e.parentContainer.getWorldTransformMatrix()),n&&(i.transform=n),t.camera&&(n||(n=new p),t.camera.matrixExternal.multiply(n,n)),void 0!==t.x&&(i.x=e.x,e.x=t.x),void 0!==t.y&&(i.y=e.y,e.y=t.y),void 0!==t.rotation?(i.rotation=e.rotation,e.rotation=t.rotation):void 0!==t.angle&&(i.rotation=e.rotation,e.angle=t.angle),void 0!==t.scaleX&&(i.scaleX=e.scaleX,e.scaleX=t.scaleX),void 0!==t.scaleY&&(i.scaleY=e.scaleY,e.scaleY=t.scaleY),void 0!==t.originX&&(i.originX=e.originX,e.originX=t.originX),void 0!==t.originY&&(i.originY=e.originY,e.originY=t.originY),void 0!==t.alpha&&(i.alpha=e.alpha,e.alpha=t.alpha),void 0!==t.tint&&(i.tint=e.tint,e.tint=t.tint),void 0!==t.blendMode&&(i.blendMode=e.blendMode,e.blendMode=t.blendMode),i},finishCapture:function(e,t){void 0!==t.x&&(e.x=t.x),void 0!==t.y&&(e.y=t.y),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scaleX&&(e.scaleX=t.scaleX),void 0!==t.scaleY&&(e.scaleY=t.scaleY),void 0!==t.originX&&(e.originX=t.originX),void 0!==t.originY&&(e.originY=t.originY),void 0!==t.alpha&&(e.alpha=t.alpha),void 0!==t.tint&&(e.tint=t.tint),void 0!==t.blendMode&&(e.blendMode=t.blendMode)},repeat:function(e,t,i,n,r,s,a){void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=this.width),void 0===s&&(s=this.height);var o=u(a,"alpha",1),l=u(a,"tint",16777215),h=u(a,"angle",0),c=u(a,"rotation",0),d=u(a,"scale",1),p=u(a,"scaleX",d),m=u(a,"scaleY",d),g=u(a,"originX",0),v=u(a,"originY",0),y=u(a,"blendMode",0);0!==h&&(c=h*Math.PI/180);var x=u(a,"tilePositionX",0),b=u(a,"tilePositionY",0),w=u(a,"tileRotation",0),T=u(a,"tileScaleX",1),_=u(a,"tileScaleY",1);return this.commandBuffer.push(f.REPEAT,e,t,i,n,o,l,c,p,m,g,v,y,r,s,x,b,w,T,_),this},preserve:function(e){return this.commandBuffer.push(f.PRESERVE,e),this},callback:function(e){return this.commandBuffer.push(f.CALLBACK,e),this},snapshotArea:function(e,t,i,n,r,s,a){return this.drawingContext?this.renderer.snapshotFramebuffer(this.drawingContext.framebuffer,this.width,this.height,r,!1,e,t,i,n,s,a):this.renderer.snapshotCanvas(this.canvas,r,!1,e,t,i,n,s,a),this},snapshot:function(e,t,i){return this.snapshotArea(0,0,this.width,this.height,e,t,i)},snapshotPixel:function(e,t,i){return this.snapshotArea(e,t,1,1,i,"pixel")},getWebGLTexture:function(){if(this.drawingContext)return this.drawingContext.texture},renderWebGL:function(e,t,i,n){var r=this.manager.resetStamp();r.setTexture(this),r.setOrigin(0),r.renderWebGLStep(e,r,i,n)},renderCanvas:function(){},destroy:function(){var e=this.manager.stamp;e&&e.texture===this&&this.manager.resetStamp(),c.prototype.destroy.call(this),s.remove(this.canvas),this.drawingContext&&this.drawingContext.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.renderer=null}});e.exports=m},42538(e){e.exports={CLEAR:0,FILL:1,STAMP:2,REPEAT:3,DRAW:4,SET_ERASE:5,PRESERVE:6,CALLBACK:7,CAPTURE:8}},4327(e,t,i){var n=i(83419),r=i(45319),s=i(79291),a=new n({initialize:function(e,t,i,n,r,s,a){this.texture=e,this.name=t,this.source=e.source[i],this.sourceIndex=i,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0},is3Slice:!1,scale9:!1,scale9Borders:{x:0,y:0,w:0,h:0}},this.setSize(s,a,n,r)},setCutPosition:function(e,t){return void 0===e&&(e=0),void 0===t&&(t=0),this.cutX=e,this.cutY=t,this.updateUVs()},setCutSize:function(e,t){return this.cutWidth=e,this.cutHeight=t,this.updateUVs()},setSize:function(e,t,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.setCutPosition(i,n),this.setCutSize(e,t),this.width=e,this.height=t,this.halfWidth=Math.floor(.5*e),this.halfHeight=Math.floor(.5*t),this.centerX=Math.floor(e/2),this.centerY=Math.floor(t/2);var r=this.data,s=r.cut;s.x=i,s.y=n,s.w=e,s.h=t,s.r=i+e,s.b=n+t,r.sourceSize.w=e,r.sourceSize.h=t,r.spriteSourceSize.w=e,r.spriteSourceSize.h=t,r.radius=.5*Math.sqrt(e*e+t*t);var a=r.drawImage;return a.x=i,a.y=n,a.width=e,a.height=t,this.updateUVs()},setTrim:function(e,t,i,n,r,s){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=e,a.sourceSize.h=t,o.x=i,o.y=n,o.w=r,o.h=s,o.r=i+r,o.b=n+s,this.x=i,this.y=n,this.width=r,this.height=s,this.halfWidth=.5*r,this.halfHeight=.5*s,this.centerX=Math.floor(r/2),this.centerY=Math.floor(s/2),this.updateUVs()},setScale9:function(e,t,i,n){var r=this.data;return r.scale9=!0,r.is3Slice=0===t&&n===this.height,r.scale9Borders.x=e,r.scale9Borders.y=t,r.scale9Borders.w=i,r.scale9Borders.h=n,this},setCropUVs:function(e,t,i,n,s,a,o){var l=this.cutX,h=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=l+(t=r(t,0,d)),m=h+(i=r(i,0,f)),g=n=r(n,0,d-t),v=s=r(s,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,b=t+(n=r(n,0,x.x+u-t)),w=i+(s=r(s,0,x.y+c-i));if(!(x.r<t||x.b<i||x.x>b||x.y>w)){var T=Math.max(x.x,t),_=Math.max(x.y,i),S=Math.min(x.r,b)-T,E=Math.min(x.b,w)-_;g=S,v=E,p=a?l+(u-(T-x.x)-S):l+(T-x.x),m=o?h+(c-(_-x.y)-E):h+(_-x.y),t=T,i=_,n=S,s=E}else p=0,m=0,g=0,v=0}else a&&(p=l+(u-t-n)),o&&(m=h+(c-i-s));var C=this.source.width,A=this.source.height;return e.u0=Math.max(0,p/C),e.v0=1-Math.max(0,m/A),e.u1=Math.min(1,(p+g)/C),e.v1=1-Math.min(1,(m+v)/A),e.x=t,e.y=i,e.cx=p,e.cy=m,e.cw=g,e.ch=v,e.width=n,e.height=s,e.flipX=a,e.flipY=o,e},updateCropUVs:function(e,t,i){return this.setCropUVs(e,e.x,e.y,e.width,e.height,t,i)},setUVs:function(e,t,i,n,r,s){var a=this.data.drawImage;return a.width=e,a.height=t,this.u0=i,this.v0=n,this.u1=r,this.v1=s,this},updateUVs:function(){var e=this.cutX,t=this.cutY,i=this.cutWidth,n=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=n;var s=this.source.width,a=this.source.height;return this.u0=e/s,this.v0=1-t/a,this.u1=(e+i)/s,this.v1=1-(t+n)/a,this},updateUVsInverted:function(){var e=this.source.width,t=this.source.height;return this.u0=(this.cutX+this.cutHeight)/e,this.v0=1-this.cutY/t,this.u1=this.cutX/e,this.v1=1-(this.cutY+this.cutWidth)/t,this},clone:function(){var e=new a(this.texture,this.name,this.sourceIndex);return e.cutX=this.cutX,e.cutY=this.cutY,e.cutWidth=this.cutWidth,e.cutHeight=this.cutHeight,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e.halfWidth=this.halfWidth,e.halfHeight=this.halfHeight,e.centerX=this.centerX,e.centerY=this.centerY,e.rotated=this.rotated,e.data=s(!0,e.data,this.data),e.updateUVs(),e},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}}});e.exports=a},79237(e,t,i){var n=i(83419),r=i(19673),s=i(4327),a=i(11876),o='Texture "%s" has no frame "%s"',l=new n({initialize:function(e,t,i,n,r){Array.isArray(i)||(i=[i]),this.manager=e,this.key=t,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0,this.smoothPixelArt=null;for(var s=0;s<i.length;s++)this.source.push(new a(this,i[s],n,r))},add:function(e,t,i,n,r,a){if(this.has(e))return null;var o=new s(this,e,t,i,n,r,a);return this.frames[e]=o,"__BASE"===this.firstFrame&&(this.firstFrame=e),this.frameTotal++,o},remove:function(e){return!!this.has(e)&&(this.get(e).destroy(),delete this.frames[e],!0)},has:function(e){return this.frames.hasOwnProperty(e)},get:function(e){e||(e=this.firstFrame);var t=this.frames[e];return t||(console.warn(o,this.key,e),t=this.frames[this.firstFrame]),t},getTextureSourceIndex:function(e){for(var t=0;t<this.source.length;t++)if(this.source[t]===e)return t;return-1},getFramesFromTextureSource:function(e,t){void 0===t&&(t=!1);var i=[];for(var n in this.frames)if("__BASE"!==n||t){var r=this.frames[n];r.sourceIndex===e&&i.push(r)}return i},getFrameBounds:function(e){void 0===e&&(e=0);for(var t=this.getFramesFromTextureSource(e,!0),i=t[0],n=i.cutX,r=i.cutY,s=i.cutX+i.cutWidth,a=i.cutY+i.cutHeight,o=1;o<t.length-1;o++){var l=t[o];l.cutX<n&&(n=l.cutX),l.cutY<r&&(r=l.cutY),l.cutX+l.cutWidth>s&&(s=l.cutX+l.cutWidth),l.cutY+l.cutHeight>a&&(a=l.cutY+l.cutHeight)}return{x:n,y:r,width:s-n,height:a-r}},getFrameNames:function(e){void 0===e&&(e=!1);var t=Object.keys(this.frames);if(!e){var i=t.indexOf("__BASE");-1!==i&&t.splice(i,1)}return t},getSourceImage:function(e){void 0!==e&&null!==e&&1!==this.frameTotal||(e="__BASE");var t=this.frames[e];return t?t.source.image:(console.warn(o,this.key,e),this.frames.__BASE.source.image)},getDataSourceImage:function(e){void 0!==e&&null!==e&&1!==this.frameTotal||(e="__BASE");var t,i=this.frames[e];return i?t=i.sourceIndex:(console.warn(o,this.key,e),t=this.frames.__BASE.sourceIndex),this.dataSource[t].image},setSource:function(e,t,i,n,r){void 0===t&&(t=0),void 0===i&&(i=!1),Array.isArray(e)||(e=[e]);for(var s=0;s<e.length;s++){var o=s+t,l=e[s];l instanceof a&&(l=l.source);var h=this.source[o],u=l.naturalWidth||l.videoWidth||l.width||h.width||n||0,c=l.naturalHeight||l.videoHeight||l.height||h.height||r||0;if(h){if(!i){h.updateSource(l);continue}h.destroy()}this.source[o]=new a(this,l,u,c)}},setDataSource:function(e,t,i,n,r){void 0===t&&(t=0),void 0===i&&(i=!1),Array.isArray(e)||(e=[e]);for(var s=0;s<e.length;s++){var o=s+t,l=e[s],h=this.dataSource[o],u=l.naturalWidth||l.videoWidth||l.width||h.width||n||0,c=l.naturalHeight||l.videoHeight||l.height||h.height||r||0;if(h){if(!i){h.updateSource(l);continue}h.destroy()}this.dataSource[o]=new a(this,l,u,c)}},setFilter:function(e){var t;for(t=0;t<this.source.length;t++)this.source[t].setFilter(e);for(t=0;t<this.dataSource.length;t++)this.dataSource[t].setFilter(e)},setSmoothPixelArt:function(e){this.smoothPixelArt=e,e&&this.setFilter(r.LINEAR)},setWrap:function(e,t){void 0===t&&(t=e);for(var i=0;i<this.source.length;i++)this.source[i].setWrap(e,t);for(i=0;i<this.dataSource.length;i++)this.dataSource[i].setWrap(e,t)},destroy:function(){var e,t=this.source,i=this.dataSource;for(e=0;e<t.length;e++)t[e]&&t[e].destroy();for(e=0;e<i.length;e++)i[e]&&i[e].destroy();for(var n in this.frames){var r=this.frames[n];r&&r.destroy()}this.source=[],this.dataSource=[],this.frames={},this.manager.removeKey(this.key),this.manager=null}});e.exports=l},17130(e,t,i){var n=i(27919),r=i(57382),s=i(83419),a=i(40987),o=i(8054),l=i(81320),h=i(50792),u=i(69442),c=i(4327),d=i(8443),f=i(35154),p=i(88571),m=i(30100),g=i(41212),v=i(61309),y=i(87841),x=i(79237),b=i(20839),w=new s({Extends:h,initialize:function(e){h.call(this),this.game=e,this.name="TextureManager",this.list={},this._tempCanvas=n.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,this.stamp,this.stampCrop=new y,this.tileSprite,this.silentWarnings=!1,e.events.once(d.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(u.LOAD,this.updatePending,this),this.on(u.ERROR,this.updatePending,this);var e=this.game.config;null!==e.defaultImage&&this.addBase64("__DEFAULT",e.defaultImage),null!==e.missingImage&&this.addBase64("__MISSING",e.missingImage),null!==e.whiteImage&&this.addBase64("__WHITE",e.whiteImage),this.game.renderer&&this.game.renderer.gl&&this.addUint8Array("__NORMAL",new Uint8Array([127,127,255,255]),1,1),this.game.events.once(d.DESTROY,this.destroy,this),this.game.events.once(d.SYSTEM_READY,function(e){this.stamp=new p(e).setOrigin(0),this.tileSprite=new b(e,0,0,256,256,"__WHITE").setOrigin(0)},this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(u.LOAD),this.off(u.ERROR),this.emit(u.READY))},checkKey:function(e){return!(!e||"string"!==typeof e||this.exists(e))||(this.silentWarnings||console.error("Texture key already in use: "+e),!1)},remove:function(e){if("string"===typeof e){if(!this.exists(e))return this.silentWarnings||console.warn("No texture found matching key: "+e),this;e=this.get(e)}var t=e.key;return this.list.hasOwnProperty(t)&&(e.destroy(),this.emit(u.REMOVE,t),this.emit(u.REMOVE_KEY+t)),this},removeKey:function(e){return this.list.hasOwnProperty(e)&&delete this.list[e],this},addBase64:function(e,t){if(this.checkKey(e)){var i=this,n=new Image;n.onerror=function(){i.emit(u.ERROR,e)},n.onload=function(){var t=i.create(e,n);t&&(v.Image(t,0),i.emit(u.ADD,e,t),i.emit(u.ADD_KEY+e,t),i.emit(u.LOAD,e,t))},n.src=t}return this},getBase64:function(e,t,i,r){void 0===i&&(i="image/png"),void 0===r&&(r=.92);var s="",a=this.getFrame(e,t);if(a&&(a.source.isRenderTexture||a.source.isGLTexture))this.silentWarnings||console.warn("Cannot getBase64 from WebGL Texture");else if(a){var o=a.canvasData,l=n.create2D(this,o.width,o.height),h=l.getContext("2d",{willReadFrequently:!0});o.width>0&&o.height>0&&h.drawImage(a.source.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),s=l.toDataURL(i,r),n.remove(l)}return s},addImage:function(e,t,i){var n=null;return this.checkKey(e)&&(n=this.create(e,t),v.Image(n,0),i&&n.setDataSource(i),this.emit(u.ADD,e,n),this.emit(u.ADD_KEY+e,n)),n},addGLTexture:function(e,t){var i=null;if(this.checkKey(e)){var n=t.width,r=t.height;(i=this.create(e,t,n,r)).add("__BASE",0,0,0,n,r),this.emit(u.ADD,e,i),this.emit(u.ADD_KEY+e,i)}return i},addCompressedTexture:function(e,t,i){var n=null;if(this.checkKey(e)){if((n=this.create(e,t)).add("__BASE",0,0,0,t.width,t.height),i){var r=function(e,t,i){Array.isArray(i.textures)||Array.isArray(i.frames)?v.JSONArray(e,t,i):v.JSONHash(e,t,i)};if(Array.isArray(i))for(var s=0;s<i.length;s++)r(n,s,i[s]);else r(n,0,i)}this.emit(u.ADD,e,n),this.emit(u.ADD_KEY+e,n)}return n},addRenderTexture:function(e,t){var i=null;return this.checkKey(e)&&((i=this.create(e,t)).add("__BASE",0,0,0,t.width,t.height),this.emit(u.ADD,e,i),this.emit(u.ADD_KEY+e,i)),i},createCanvas:function(e,t,i){if(void 0===t&&(t=256),void 0===i&&(i=256),this.checkKey(e)){var r=n.create(this,t,i,o.CANVAS,!0);return this.addCanvas(e,r)}return null},addCanvas:function(e,t,i){void 0===i&&(i=!1);var n=null;return i?n=new r(this,e,t,t.width,t.height):this.checkKey(e)&&(n=new r(this,e,t,t.width,t.height),this.list[e]=n,this.emit(u.ADD,e,n),this.emit(u.ADD_KEY+e,n)),n},addDynamicTexture:function(e,t,i,n){var r=null;return"string"!==typeof e||this.exists(e)?e=(r=e).key:(void 0===n&&(n=!0),r=new l(this,e,t,i,n)),this.checkKey(e)?(this.list[e]=r,this.emit(u.ADD,e,r),this.emit(u.ADD_KEY+e,r)):r=null,r},addAtlas:function(e,t,i,n){return i&&!Array.isArray(i)&&Array.isArray(i.pages)&&i.frames&&!Array.isArray(i.frames)?this.addAtlasPCT(e,t,i,n):Array.isArray(i.textures)||Array.isArray(i.frames)?this.addAtlasJSONArray(e,t,i,n):this.addAtlasJSONHash(e,t,i,n)},addAtlasJSONArray:function(e,t,i,n){var r=null;if(t instanceof x?(e=t.key,r=t):this.checkKey(e)&&(r=this.create(e,t)),r){if(Array.isArray(i))for(var s=1===i.length,a=0;a<r.source.length;a++){var o=s?i[0]:i[a];v.JSONArray(r,a,o)}else v.JSONArray(r,0,i);n&&r.setDataSource(n),this.emit(u.ADD,e,r),this.emit(u.ADD_KEY+e,r)}return r},addAtlasJSONHash:function(e,t,i,n){var r=null;if(t instanceof x?(e=t.key,r=t):this.checkKey(e)&&(r=this.create(e,t)),r){if(Array.isArray(i))for(var s=0;s<i.length;s++)v.JSONHash(r,s,i[s]);else v.JSONHash(r,0,i);n&&r.setDataSource(n),this.emit(u.ADD,e,r),this.emit(u.ADD_KEY+e,r)}return r},addAtlasPCT:function(e,t,i,n){var r=null;return t instanceof x?(e=t.key,r=t):this.checkKey(e)&&(r=this.create(e,t)),r&&(v.PCT(r,i),n&&r.setDataSource(n),this.emit(u.ADD,e,r),this.emit(u.ADD_KEY+e,r)),r},addAtlasXML:function(e,t,i,n){var r=null;return t instanceof x?(e=t.key,r=t):this.checkKey(e)&&(r=this.create(e,t)),r&&(v.AtlasXML(r,0,i),n&&r.setDataSource(n),this.emit(u.ADD,e,r),this.emit(u.ADD_KEY+e,r)),r},addUnityAtlas:function(e,t,i,n){var r=null;return t instanceof x?(e=t.key,r=t):this.checkKey(e)&&(r=this.create(e,t)),r&&(v.UnityYAML(r,0,i),n&&r.setDataSource(n),this.emit(u.ADD,e,r),this.emit(u.ADD_KEY+e,r)),r},addSpriteSheet:function(e,t,i,n){var r=null;if(t instanceof x?(e=t.key,r=t):this.checkKey(e)&&(r=this.create(e,t)),r){var s=r.source[0].width,a=r.source[0].height;v.SpriteSheet(r,0,0,0,s,a,i),n&&r.setDataSource(n),this.emit(u.ADD,e,r),this.emit(u.ADD_KEY+e,r)}return r},addSpriteSheetFromAtlas:function(e,t){if(!this.checkKey(e))return null;var i=f(t,"atlas",null),n=f(t,"frame",null);if(i&&n){var r=this.get(i).get(n);if(r){var s=r.source.image;s||(s=r.source.glTexture);var a=this.create(e,s);return r.trimmed?v.SpriteSheetFromAtlas(a,r,t):v.SpriteSheet(a,0,r.cutX,r.cutY,r.cutWidth,r.cutHeight,t),this.emit(u.ADD,e,a),this.emit(u.ADD_KEY+e,a),a}}},addUint8Array:function(e,t,i,n){if(!this.checkKey(e)||t.length/4!==i*n)return null;var r=this.create(e,t,i,n);return r.add("__BASE",0,0,0,i,n),this.emit(u.ADD,e,r),this.emit(u.ADD_KEY+e,r),r},addFlatColor:function(e,t,i,n,r){if(!this.checkKey(e)||t<=0||i<=0)return null;void 0===n&&(n=0),void 0===r&&(r=0);for(var s=m(n),a=s.red,o=s.green,l=s.blue,h=new Uint8Array(t*i*4),u=0;u<t*i;u++)h[4*u]=a,h[4*u+1]=o,h[4*u+2]=l,h[4*u+3]=255*r;return this.addUint8Array(e,h,t,i)},create:function(e,t,i,n){var r=null;return this.checkKey(e)&&(r=new x(this,e,t,i,n),this.list[e]=r),r},exists:function(e){return this.list.hasOwnProperty(e)},get:function(e){return void 0===e&&(e="__DEFAULT"),this.list[e]?this.list[e]:e instanceof x?e:e instanceof c?e.texture:this.list.__MISSING},cloneFrame:function(e,t){if(this.list[e])return this.list[e].get(t).clone()},getFrame:function(e,t){if(this.list[e])return this.list[e].get(t)},parseFrame:function(e){if(e)return"string"===typeof e?this.getFrame(e):Array.isArray(e)&&2===e.length?this.getFrame(e[0],e[1]):g(e)?this.getFrame(e.key,e.frame):e instanceof x?e.get():e instanceof c?e:void 0},getTextureKeys:function(){var e=[];for(var t in this.list)"__DEFAULT"!==t&&"__MISSING"!==t&&"__WHITE"!==t&&"__NORMAL"!==t&&e.push(t);return e},getPixel:function(e,t,i,n){var r=this.getFrame(i,n);if(r){var s=r.source,o=s.image;if(!(s.isCanvas||s.isVideo||o instanceof HTMLImageElement))return console.warn("TextureManager.getPixelAlpha: The texture source must be Image, Canvas, or Video"),null;e-=r.x,t-=r.y;var l=r.data.cut;if(e+=l.x,t+=l.y,e>=l.x&&e<l.r&&t>=l.y&&t<l.b){var h=this._tempContext;h.clearRect(0,0,1,1),h.drawImage(o,e,t,1,1,0,0,1,1);var u=h.getImageData(0,0,1,1);return new a(u.data[0],u.data[1],u.data[2],u.data[3])}}return null},getPixelAlpha:function(e,t,i,n){var r=this.getFrame(i,n);if(r){var s=r.source,a=s.image;if(!(s.isCanvas||s.isVideo||a instanceof HTMLImageElement))return console.warn("TextureManager.getPixelAlpha: The texture source must be Image, Canvas, or Video"),null;e-=r.x,t-=r.y;var o=r.data.cut;if(e+=o.x,t+=o.y,e>=o.x&&e<o.r&&t>=o.y&&t<o.b){var l=this._tempContext;return l.clearRect(0,0,1,1),l.drawImage(a,e,t,1,1,0,0,1,1),l.getImageData(0,0,1,1).data[3]}}return null},setTexture:function(e,t,i){return this.list[t]&&(e.texture=this.list[t],e.frame=e.texture.get(i)),e},renameTexture:function(e,t){var i=this.get(e);return!(!i||e===t)&&(i.key=t,this.list[t]=i,delete this.list[e],!0)},each:function(e,t){for(var i=[null],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var r in this.list)i[0]=this.list[r],e.apply(t,i)},resetStamp:function(e,t){void 0===e&&(e=1),void 0===t&&(t=16777215);var i=this.stamp;return i.setCrop(),i.setPosition(0),i.setAngle(0),i.setScale(1),i.setAlpha(e),i.setTint(t),i.setTexture("__WHITE"),i},resetTileSprite:function(e,t){void 0===e&&(e=1),void 0===t&&(t=16777215);var i=this.tileSprite;return i.setPosition(0),i.setAngle(0),i.setScale(1),i.setAlpha(e),i.setTint(t),i.setTexture("__WHITE"),i},destroy:function(){for(var e in this.list)this.list[e].destroy();this.list={},this.stamp.destroy(),this.game=null,this.stamp=null,n.remove(this._tempCanvas)}});e.exports=w},11876(e,t,i){var n=i(27919),r=i(83419),s=i(50030),a=i(29795),o=i(82751),l=new r({initialize:function(e,t,i,n,r){void 0===r&&(r=!0);var l=e.manager.game;this.renderer=l.renderer,this.texture=e,this.source=t,this.image=t.compressed?null:t,this.compressionAlgorithm=t.compressed?t.format:null,this.resolution=1,this.width=i||t.naturalWidth||t.videoWidth||t.width||0,this.height=n||t.naturalHeight||t.videoHeight||t.height||0,this.scaleMode=a.DEFAULT,this.isCanvas=t instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&t instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===t.type||"DynamicTexture"===t.type,this.isGLTexture=t instanceof o,this.isPowerOf2=s(this.width,this.height),this.glTexture=null,this.flipY=r,this.init(l)},init:function(e){var t=this.renderer;if(t){var i=this.source;if(t.gl){var n=this.image,r=this.flipY,s=this.width,a=this.height,o=this.scaleMode;this.isCanvas?this.glTexture=t.createCanvasTexture(n,!1,r):this.isVideo?this.glTexture=t.createVideoTexture(n,!1,r):this.isRenderTexture?this.glTexture=t.createTextureFromSource(null,s,a,o,void 0,r):this.isGLTexture?this.glTexture=i:this.compressionAlgorithm?this.glTexture=t.createTextureFromSource(i,void 0,void 0,o,void 0,r):i instanceof Uint8Array?this.glTexture=t.createUint8ArrayTexture(i,s,a,void 0,r):this.glTexture=t.createTextureFromSource(n,s,a,o,void 0,r)}else this.isRenderTexture&&(this.image=i.canvas)}e.config.antialias||this.setFilter(1)},setFilter:function(e){this.renderer&&this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,e),this.scaleMode=e},setFlipY:function(e){return void 0===e&&(e=!0),e===this.flipY||(this.flipY=e,this.update()),this},setWrap:function(e,t){return this.renderer&&this.renderer.gl&&this.renderer.setTextureWrap(this.glTexture,e,t),this},update:function(){var e=this.renderer,t=this.image,i=this.flipY;if(e.gl){var n=this.glTexture;this.isCanvas?e.updateCanvasTexture(t,n,i):this.isVideo?e.updateVideoTexture(t,n,i):n.update(this.source,this.width,this.height,i,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format)}},updateSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.isPowerOf2=s(e,t))},updateSource:function(e){!this.isCanvas||e===this.image||e instanceof HTMLCanvasElement||n.remove(this.image),this.source=e,this.image=e.compressed?null:e,this.compressionAlgorithm=e.compressed?e.format:null,this.width=e.naturalWidth||e.videoWidth||e.width||0,this.height=e.naturalHeight||e.videoHeight||e.height||0,this.isPowerOf2=s(this.width,this.height),this.isCanvas=e instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&e instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===e.type||"DynamicTexture"===e.type,this.isGLTexture=e instanceof o,this.update()},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&n.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});e.exports=l},43378(e){e.exports={CLAMP_TO_EDGE:33071,REPEAT:10497,MIRRORED_REPEAT:33648}},19673(e){e.exports={LINEAR:0,NEAREST:1}},44538(e){e.exports="addtexture"},63486(e){e.exports="addtexture-"},94851(e){e.exports="onerror"},29099(e){e.exports="onload"},8678(e){e.exports="ready"},86415(e){e.exports="removetexture"},30879(e){e.exports="removetexture-"},69442(e,t,i){e.exports={ADD:i(44538),ADD_KEY:i(63486),ERROR:i(94851),LOAD:i(29099),READY:i(8678),REMOVE:i(86415),REMOVE_KEY:i(30879)}},27458(e,t,i){var n=i(79291),r=i(19673),s=i(43378),a={CanvasTexture:i(57382),DynamicTexture:i(81320),Events:i(69442),FilterMode:r,Frame:i(4327),Parsers:i(61309),Texture:i(79237),TextureManager:i(17130),TextureSource:i(11876),WrapMode:s};a=n(!1,a,r),a=n(!1,a,s),e.exports=a},89905(e){e.exports=function(e,t,i){if(i.getElementsByTagName("TextureAtlas")){var n=e.source[t];e.add("__BASE",t,0,0,n.width,n.height);for(var r,s=i.getElementsByTagName("SubTexture"),a=0;a<s.length;a++){var o=s[a].attributes,l=o.name.value,h=parseInt(o.x.value,10),u=parseInt(o.y.value,10),c=parseInt(o.width.value,10),d=parseInt(o.height.value,10);if(r=e.add(l,t,h,u,c,d),o.frameX){var f=Math.abs(parseInt(o.frameX.value,10)),p=Math.abs(parseInt(o.frameY.value,10)),m=parseInt(o.frameWidth.value,10),g=parseInt(o.frameHeight.value,10);r.setTrim(m,g,f,p,c,d)}}return e}console.warn("Invalid Texture Atlas XML given")}},72893(e){e.exports=function(e,t){var i=e.source[t];return e.add("__BASE",t,0,0,i.width,i.height),e}},4832(e){e.exports=function(e,t){var i=e.source[t];return e.add("__BASE",t,0,0,i.width,i.height),e}},78566(e,t,i){var n=i(41786);e.exports=function(e,t,i){if(i.frames||i.textures){var r=e.source[t];e.add("__BASE",t,0,0,r.width,r.height);for(var s,a=Array.isArray(i.textures)?i.textures[t].frames:i.frames,o=0;o<a.length;o++){var l=a[o];if(s=e.add(l.filename,t,l.frame.x,l.frame.y,l.frame.w,l.frame.h)){l.trimmed&&s.setTrim(l.sourceSize.w,l.sourceSize.h,l.spriteSourceSize.x,l.spriteSourceSize.y,l.spriteSourceSize.w,l.spriteSourceSize.h),l.rotated&&(s.rotated=!0,s.updateUVsInverted());var h=l.anchor||l.pivot;h&&(s.customPivot=!0,s.pivotX=h.x,s.pivotY=h.y),l.scale9Borders&&s.setScale9(l.scale9Borders.x,l.scale9Borders.y,l.scale9Borders.w,l.scale9Borders.h),s.customData=n(l)}else console.warn("Invalid atlas json, frame already exists: "+l.filename)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?e.customData[u]=i[u].slice(0):e.customData[u]=i[u]);return e}console.warn("Invalid Texture Atlas JSON Array")}},39711(e,t,i){var n=i(41786);e.exports=function(e,t,i){if(i.frames){var r=e.source[t];e.add("__BASE",t,0,0,r.width,r.height);var s,a=i.frames;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];if(s=e.add(o,t,l.frame.x,l.frame.y,l.frame.w,l.frame.h)){l.trimmed&&s.setTrim(l.sourceSize.w,l.sourceSize.h,l.spriteSourceSize.x,l.spriteSourceSize.y,l.spriteSourceSize.w,l.spriteSourceSize.h),l.rotated&&(s.rotated=!0,s.updateUVsInverted());var h=l.anchor||l.pivot;h&&(s.customPivot=!0,s.pivotX=h.x,s.pivotY=h.y),l.scale9Borders&&s.setScale9(l.scale9Borders.x,l.scale9Borders.y,l.scale9Borders.w,l.scale9Borders.h),s.customData=n(l)}else console.warn("Invalid atlas json, frame already exists: "+o)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?e.customData[u]=i[u].slice(0):e.customData[u]=i[u]);return e}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},31403(e){e.exports=function(e){var t,i=[171,75,84,88,32,49,49,187,13,10,26,10],n=new Uint8Array(e,0,12);for(t=0;t<n.length;t++)if(n[t]!==i[t])return void console.warn("KTXParser - Invalid file format");var r=Uint32Array.BYTES_PER_ELEMENT,s=new DataView(e,12,13*r),a=67305985===s.getUint32(0,!0);if(0===s.getUint32(1*r,a)){var o=s.getUint32(4*r,a),l=s.getUint32(6*r,a),h=s.getUint32(7*r,a),u=Math.max(1,s.getUint32(11*r,a)),c=s.getUint32(12*r,a),d=new Array(u),f=64+c,p=l,m=h;for(t=0;t<u;t++){var g=new Int32Array(e,f,1)[0];f+=4,d[t]={data:new Uint8Array(e,f,g),width:p,height:m},p=Math.max(1,p>>1),m=Math.max(1,m>>1),f+=g}return{mipmaps:d,width:l,height:h,internalFormat:o,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},41942(e){e.exports=function(e,t){if(t&&t.frames&&t.pages){var i=e.source[0];e.add("__BASE",0,0,0,i.width,i.height);var n=t.frames;for(var r in n)if(n.hasOwnProperty(r)){var s=n[r],a=0|s.page;if(a>=e.source.length)console.warn('PCT atlas frame "'+r+'" references missing page '+a);else{var o=e.add(s.key||r,a,s.x,s.y,s.w,s.h);o?(s.trimmed&&o.setTrim(s.sourceW,s.sourceH,s.trimX,s.trimY,s.w,s.h),s.rotated&&(o.rotated=!0,o.updateUVsInverted())):console.warn("Invalid PCT atlas, frame already exists: "+r)}}return e.customData.pct={pages:t.pages,folders:t.folders},e}console.warn("Invalid PCT atlas data given")}},39620(e){var t={1:".png",2:".webp",3:".jpg",4:".jpeg",5:".gif"},i=function(e,t){for(var i=String(e);i.length<t;)i="0"+i;return i},n=function(e,i,n){var r=e,s="",a=r.indexOf("/");a>0&&function(e){if(0===e.length)return!1;for(var t=0;t<e.length;t++){var i=e.charCodeAt(t);if(i<48||i>57)return!1}return!0}(r.substring(0,a))&&(s=i[parseInt(r.substring(0,a),10)],r=r.substring(a+1));var o=/~([1-5])$/.exec(r);if(o){var l=t[parseInt(o[1],10)];r=r.substring(0,r.length-2)+l}else n&&(r+=n);return s?s+"/"+r:r},r=function(e,r){var s="",a=/~([1-5])$/.exec(e);a&&(s=t[parseInt(a[1],10)],e=e.substring(0,e.length-2));for(var o=[],l=e.split(","),h=0;h<l.length;h++){var u=l[h],c=u.indexOf("#");if(c>=0)for(var d=u.substring(0,c),f=u.substring(c+1),p=f.indexOf("-"),m=f.substring(0,p),g=f.substring(p+1),v=parseInt(m,10),y=parseInt(g,10),x=m.length>1&&"0"===m.charAt(0)?m.length:0,b=v;b<=y;b++){var w=x>0?i(b,x):String(b);o.push(n(d+w,r,s))}else o.push(n(u,r,s))}return o};e.exports=function(e){if("string"!==typeof e||0===e.length)return console.warn("Invalid PCT file: empty or not a string"),null;var t=e.split("\n"),i=t[0];if(13===i.charCodeAt(i.length-1)&&(i=i.substring(0,i.length-1)),!i||0!==i.indexOf("PCT:"))return console.warn("Not a PCT file: missing PCT: header"),null;var s=i.substring(4),a=s.split("."),o=parseInt(a[0],10);if(isNaN(o)||o>1)return console.warn("Unsupported PCT version: "+s),null;for(var l=[],h=[],u={},c=0,d=null,f=1;f<t.length;f++){var p=t[f];if(p&&(13!==p.charCodeAt(p.length-1)||(p=p.substring(0,p.length-1))))if(null===d){var m=p.substring(0,2);if("P:"===m){var g=p.substring(2).split(",");l.push({filename:g[0],format:g[1],width:parseInt(g[2],10),height:parseInt(g[3],10),padding:parseInt(g[4],10)})}else if("F:"===m)h.push(p.substring(2));else if("#"===p.charAt(0))c=parseInt(p.substring(1),10);else if("B:"===m){var v=p.substring(2).split("|"),y=v[0].split(","),x={page:c,x:parseInt(y[0],10),y:parseInt(y[1],10),cols:parseInt(y[2],10),frameW:parseInt(y[3],10),frameH:parseInt(y[4],10),trimmed:v.length>1};if(x.trimmed){var b=v[1].split(",");x.sourceW=parseInt(b[0],10),x.sourceH=parseInt(b[1],10),x.trimX=parseInt(b[2],10),x.trimY=parseInt(b[3],10)}d=x}else if("A:"===m){var w=p.indexOf("=",2);if(-1===w)continue;var T=n(p.substring(2,w),h,""),_=r(p.substring(w+1),h),S=u[T];if(S)for(var E=0;E<_.length;E++){var C=_[E],A={};for(var k in S)A[k]=S[k];A.key=C,u[C]=A}}else{var R=p.split("|");if(R.length<3)continue;var O=n(R[0],h,""),P=parseInt(R[1],10),M=0!==(2&P),N=R[2].split(","),I={key:O,page:c,x:parseInt(N[0],10),y:parseInt(N[1],10),w:parseInt(N[2],10),h:parseInt(N[3],10),trimmed:M,rotated:0!==(1&P)};if(M){var L=R[3].split(",");I.sourceW=parseInt(L[0],10),I.sourceH=parseInt(L[1],10),I.trimX=parseInt(L[2],10),I.trimY=parseInt(L[3],10)}else I.sourceW=I.w,I.sourceH=I.h,I.trimX=0,I.trimY=0;u[O]=I}}else{var D=d;d=null;for(var F=l[D.page].padding,B=D.frameW+2*F,U=D.frameH+2*F,z=r(p,h),V=0;V<z.length;V++){var H=V%D.cols,j=Math.floor(V/D.cols),Y=z[V],W={key:Y,page:D.page,x:D.x+H*B+F,y:D.y+j*U+F,w:D.frameW,h:D.frameH,trimmed:D.trimmed,rotated:!1};D.trimmed?(W.sourceW=D.sourceW,W.sourceH=D.sourceH,W.trimX=D.trimX,W.trimY=D.trimY):(W.sourceW=D.frameW,W.sourceH=D.frameH,W.trimX=0,W.trimY=0),u[Y]=W}}}return{pages:l,folders:h,frames:u}}},82038(e){function t(e,t,i,n,r,s,a){return void 0===a&&(a=16),Math.floor((e+i)/r)*Math.floor((t+n)/s)*a}function i(e,t){return(e=Math.max(e,16))*(t=Math.max(t,8))/4}function n(e,t){return(e=Math.max(e,8))*(t=Math.max(t,8))/2}function r(e,t){return Math.ceil(e/4)*Math.ceil(t/4)*16}function s(e,i){return t(e,i,3,3,4,4,8)}function a(e,i){return t(e,i,3,3,4,4)}var o={0:{sizeFunc:i,glFormat:[35841]},1:{sizeFunc:i,glFormat:[35843]},2:{sizeFunc:n,glFormat:[35840]},3:{sizeFunc:n,glFormat:[35842]},6:{sizeFunc:s,glFormat:[36196]},7:{sizeFunc:s,glFormat:[33776,35916]},8:{sizeFunc:a,glFormat:[33777,35917]},9:{sizeFunc:a,glFormat:[33778,35918]},11:{sizeFunc:a,glFormat:[33779,35919]},14:{sizeFunc:r,glFormat:[36494,36495]},15:{sizeFunc:r,glFormat:[36492,36493]},22:{sizeFunc:s,glFormat:[37492,37493]},23:{sizeFunc:a,glFormat:[37496,37497]},24:{sizeFunc:s,glFormat:[37494,37495]},25:{sizeFunc:s,glFormat:[37488]},26:{sizeFunc:a,glFormat:[37490]},27:{sizeFunc:a,glFormat:[37808,37840]},28:{sizeFunc:function(e,i){return t(e,i,4,3,5,4)},glFormat:[37809,37841]},29:{sizeFunc:function(e,i){return t(e,i,4,4,5,5)},glFormat:[37810,37842]},30:{sizeFunc:function(e,i){return t(e,i,5,4,6,5)},glFormat:[37811,37843]},31:{sizeFunc:function(e,i){return t(e,i,5,5,6,6)},glFormat:[37812,37844]},32:{sizeFunc:function(e,i){return t(e,i,7,4,8,5)},glFormat:[37813,37845]},33:{sizeFunc:function(e,i){return t(e,i,7,5,8,6)},glFormat:[37814,37846]},34:{sizeFunc:function(e,i){return t(e,i,7,7,8,8)},glFormat:[37815,37847]},35:{sizeFunc:function(e,i){return t(e,i,9,4,10,5)},glFormat:[37816,37848]},36:{sizeFunc:function(e,i){return t(e,i,9,5,10,6)},glFormat:[37817,37849]},37:{sizeFunc:function(e,i){return t(e,i,9,7,10,8)},glFormat:[37818,37850]},38:{sizeFunc:function(e,i){return t(e,i,9,9,10,10)},glFormat:[37819,37851]},39:{sizeFunc:function(e,i){return t(e,i,11,9,12,10)},glFormat:[37820,37852]},40:{sizeFunc:function(e,i){return t(e,i,11,11,12,12)},glFormat:[37821,37853]}};e.exports=function(e){for(var t=new Uint32Array(e,0,13),i=55727696===t[0]?t[2]:t[3],n=t[4],r=o[i].glFormat[n],s=o[i].sizeFunc,a=t[11],l=t[7],h=t[6],u=52+t[12],c=new Uint8Array(e,u),d=new Array(a),f=0,p=l,m=h,g=0;g<a;g++){var v=s(p,m);d[g]={data:new Uint8Array(c.buffer,c.byteOffset+f,v),width:p,height:m},p=Math.max(1,p>>1),m=Math.max(1,m>>1),f+=v}return{mipmaps:d,width:l,height:h,internalFormat:r,compressed:!0,generateMipmap:!1}}},75549(e,t,i){var n=i(95540);e.exports=function(e,t,i,r,s,a,o){var l=n(o,"frameWidth",null),h=n(o,"frameHeight",l);if(null===l)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=e.source[t];e.add("__BASE",t,0,0,u.width,u.height);var c=n(o,"startFrame",0),d=n(o,"endFrame",-1),f=n(o,"margin",0),p=n(o,"spacing",0),m=Math.floor((s-f+p)/(l+p))*Math.floor((a-f+p)/(h+p));0===m&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",e.key),(c>m||c<-m)&&(c=0),c<0&&(c=m+c),(-1===d||d>m||d<c)&&(d=m);for(var g=f,v=f,y=0,x=0,b=0,w=0;w<m;w++){y=0,x=0;var T=g+l,_=v+h;T>s&&(y=T-s),_>a&&(x=_-a),w>=c&&w<=d&&(e.add(b,t,i+g,r+v,l-y,h-x),b++),(g+=l+p)+l>s&&(g=f,v+=h+p)}return e}},47534(e,t,i){var n=i(95540);e.exports=function(e,t,i){var r=n(i,"frameWidth",null),s=n(i,"frameHeight",r);if(!r)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var a=e.source[0];e.add("__BASE",0,0,0,a.width,a.height);var o,l=n(i,"startFrame",0),h=n(i,"endFrame",-1),u=n(i,"margin",0),c=n(i,"spacing",0),d=t.cutX,f=t.cutY,p=t.cutWidth,m=t.cutHeight,g=t.realWidth,v=t.realHeight,y=Math.floor((g-u+c)/(r+c)),x=Math.floor((v-u+c)/(s+c)),b=y*x,w=t.x,T=r-w,_=r-(g-p-w),S=t.y,E=s-S,C=s-(v-m-S);(l>b||l<-b)&&(l=0),l<0&&(l=b+l),-1!==h&&(b=l+(h+1));for(var A=u,k=u,R=0,O=0;O<x;O++){for(var P=0===O,M=O===x-1,N=0;N<y;N++){var I=0===N,L=N===y-1;if(o=e.add(R,0,d+A,f+k,r,s),I||P||L||M){var D=I?w:0,F=P?S:0,B=0,U=0;I&&(B+=r-T),L&&(B+=r-_),P&&(U+=s-E),M&&(U+=s-C);var z=r-B,V=s-U;o.cutWidth=z,o.cutHeight=V,o.setTrim(r,s,D,F,z,V)}A+=c,A+=I?T:L?_:r,R++}A=u,k+=c,k+=P?E:M?C:s}return e}},86147(e){var t=0,i=function(e,i,n,r){var s=t-r.y-r.height;e.add(n,i,r.x,s,r.width,r.height)};e.exports=function(e,n,r){var s=e.source[n];e.add("__BASE",n,0,0,s.width,s.height),t=s.height;for(var a=r.split("\n"),o=/^[ ]*(- )*(\w+)+[: ]+(.*)/,l="",h="",u={x:0,y:0,width:0,height:0},c=0;c<a.length;c++){var d=a[c].match(o);if(d){var f="- "===d[1],p=d[2],m=d[3];if(f&&(h!==l&&(i(e,n,h,u),l=h),u={x:0,y:0,width:0,height:0}),"name"!==p)switch(p){case"x":case"y":case"width":case"height":u[p]=parseInt(m,10)}else h=m}}return h!==l&&i(e,n,h,u),e}},55222(e,t,i){var n=i(50030);function r(e){for(var t=e.mipmaps,i=0;i<t.length;i++){var n=t[i].width,r=t[i].height;if((n<<i)%4!==0||(r<<i)%4!==0)return console.warn("BPTC, RGTC, and S3TC dimensions must be a multiple of 4 pixels, and each successive mip level must be half the size of the previous level, rounded down. Mip level "+i+" is "+n+"x"+r),!1}return!0}function s(){return!0}function a(e){var t=e.mipmaps[0];return!!n(t.width,t.height)||(console.warn("PVRTC base dimensions must be power of two. Base level is "+t.width+"x"+t.height),!1)}function o(e){var t=e.mipmaps[0];return t.width%4===0&&t.height%4===0||(console.warn("S3TC SRGB base dimensions must be a multiple of 4 pixels. Base level is "+t.width+"x"+t.height+" pixels"),!1)}var l={37488:s,37489:s,37490:s,37491:s,37492:s,37493:s,37494:s,37495:s,37496:s,37497:s,36196:s,37808:s,37809:s,37810:s,37811:s,37812:s,37813:s,37814:s,37815:s,37816:s,37817:s,37818:s,37819:s,37820:s,37821:s,37840:s,37841:s,37842:s,37843:s,37844:s,37845:s,37846:s,37847:s,37848:s,37849:s,37850:s,37851:s,37852:s,37853:s,36492:r,36493:r,36494:r,36495:r,36283:r,36284:r,36285:r,36286:r,35840:a,35841:a,35842:a,35843:a,33776:r,33777:r,33778:r,33779:r,35916:o,35917:o,35918:o,35919:o};e.exports=function(e){for(var t=e.mipmaps,i=1;i<t.length;i++){var r=t[i].width,s=t[i].height;if(!n(r,s))return console.warn("Mip level "+i+" is not a power-of-two size: "+r+"x"+s),!1}var a=l[e.internalFormat];return a?a(e):(console.warn("No format checker found for internal format "+e.internalFormat+". Assuming valid."),!0)}},61309(e,t,i){e.exports={AtlasXML:i(89905),Canvas:i(72893),Image:i(4832),JSONArray:i(78566),JSONHash:i(39711),KTXParser:i(31403),PCT:i(41942),PCTDecode:i(39620),PVRParser:i(82038),SpriteSheet:i(75549),SpriteSheetFromAtlas:i(47534),UnityYAML:i(86147)}},80341(e){e.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},16536(e,t,i){var n=new(i(83419))({initialize:function(e,t,i,n,r,s,a){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===r&&(r=0),void 0===s&&(s=0),this.name=e,this.firstgid=0|t,this.imageWidth=0|i,this.imageHeight=0|n,this.imageMargin=0|r,this.imageSpacing=0|s,this.properties=a||{},this.images=[],this.total=0},containsImageIndex:function(e){return e>=this.firstgid&&e<this.firstgid+this.total},addImage:function(e,t,i,n){return this.images.push({gid:e,image:t,width:i,height:n}),this.total++,this}});e.exports=n},27462(e,t,i){var n=new(i(83419))({initialize:function(e){if(this.gids=[],void 0!==e)for(var t=0;t<e.length;++t)for(var i=e[t],n=0;n<i.total;++n)this.gids[i.firstgid+n]=i;this._gids=this.gids},enabled:{get:function(){return!!this.gids},set:function(e){this.gids=e?this._gids:void 0}},getTypeIncludingTile:function(e){if(void 0!==e.type&&""!==e.type)return e.type;if(this.gids&&void 0!==e.gid){var t=this.gids[e.gid];if(t){var i=t.getTileData(e.gid);if(i)return i.type}}},setTextureAndFrame:function(e,t,i,n){if(null===t&&this.gids&&void 0!==n.gid){var r=this.gids[n.gid];r&&(null===t&&void 0!==r.image&&(t=r.image.key),null===i&&(i=n.gid-r.firstgid),e.scene.textures.getFrame(t,i)||(t=null,i=null))}e.setTexture(t,i)},setPropertiesFromTiledObject:function(e,t){if(void 0!==this.gids&&void 0!==t.gid){var i=this.gids[t.gid];void 0!==i&&this.setFromJSON(e,i.getTileProperties(t.gid))}this.setFromJSON(e,t.properties)},setFromJSON:function(e,t){if(t)if(Array.isArray(t))for(var i=0;i<t.length;i++){var n=t[i];void 0!==e[n.name]?e[n.name]=n.value:e.setData(n.name,n.value)}else for(var r in t)void 0!==e[r]?e[r]=t[r]:e.setData(r,t[r])}});e.exports=n},31989(e,t,i){var n=i(80341),r=i(87010),s=i(46177),a=i(49075);e.exports=function(e,t,i,o,l,h,u,c){void 0===i&&(i=32),void 0===o&&(o=32),void 0===l&&(l=10),void 0===h&&(h=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=s(void 0!==t?t:"map",n.ARRAY_2D,u,i,o,c);else if(void 0!==t){var f=e.cache.tilemap.get(t);f?d=s(t,f.format,f.data,i,o,c):console.warn("No map data found for key "+t)}return null===d&&(d=new r({tileWidth:i,tileHeight:o,width:l,height:h})),new a(e,d)}},23029(e,t,i){var n=i(83419),r=i(31401),s=i(91907),a=i(62644),o=i(93232),l=i(84322),h=new n({Mixins:[r.AlphaSingle,r.Flip,r.Visible],initialize:function(e,t,i,n,r,s,a,o){this.layer=e,this.index=t,this.x=i,this.y=n,this.width=r,this.height=s,this.right,this.bottom,this.baseWidth=void 0!==a?a:r,this.baseHeight=void 0!==o?o:s,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.tint2=0,this.tintMode=l.MULTIPLY,this.physics={}},containsPoint:function(e,t){return!(e<this.pixelX||t<this.pixelY||e>this.right||t>this.bottom)},copy:function(e){return this.index=e.index,this.alpha=e.alpha,this.properties=a(e.properties),this.visible=e.visible,this.setFlip(e.flipX,e.flipY),this.tint=e.tint,this.tint2=e.tint2,this.rotation=e.rotation,this.collideUp=e.collideUp,this.collideDown=e.collideDown,this.collideLeft=e.collideLeft,this.collideRight=e.collideRight,this.collisionCallback=e.collisionCallback,this.collisionCallbackContext=e.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(e){var t=this.tilemapLayer;return t?t.tileToWorldXY(this.x,this.y,void 0,e).x:this.x*this.baseWidth},getRight:function(e){var t=this.tilemapLayer;return t?this.getLeft(e)+this.width*t.scaleX:this.getLeft(e)+this.width},getTop:function(e){var t=this.tilemapLayer;return t?t.tileToWorldXY(this.x,this.y,void 0,e).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(e){var t=this.tilemapLayer;return t?this.getTop(e)+this.height*t.scaleY:this.getTop(e)+this.height},getBounds:function(e,t){return void 0===t&&(t=new o),t.x=this.getLeft(e),t.y=this.getTop(e),t.width=this.getRight(e)-t.x,t.height=this.getBottom(e)-t.y,t},getCenterX:function(e){return(this.getLeft(e)+this.getRight(e))/2},getCenterY:function(e){return(this.getTop(e)+this.getBottom(e))/2},intersects:function(e,t,i,n){return!(i<=this.pixelX||n<=this.pixelY||e>=this.right||t>=this.bottom)},isInteresting:function(e,t){return e&&t?this.canCollide||this.hasInterestingFace:e?this.collides:!!t&&this.hasInterestingFace},resetCollision:function(e){(void 0===e&&(e=!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,e)&&(this.tilemapLayer&&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(e,t,i,n,r){(void 0===t&&(t=e),void 0===i&&(i=e),void 0===n&&(n=e),void 0===r&&(r=!0),this.collideLeft=e,this.collideRight=t,this.collideUp=i,this.collideDown=n,this.faceLeft=e,this.faceRight=t,this.faceTop=i,this.faceBottom=n,r)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(e,t){return null===e?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=e,this.collisionCallbackContext=t),this},setSize:function(e,t,i,n){return void 0!==e&&(this.width=e),void 0!==t&&(this.height=t),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){var e=this.layer.orientation;if(e===s.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(e===s.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(e===s.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(e===s.HEXAGONAL){var t,i,n=this.layer.staggerAxis,r=this.layer.staggerIndex,a=this.layer.hexSideLength;"y"===n?(i=(this.baseHeight-a)/2+a,this.pixelX="odd"===r?this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*i):"x"===n&&(t=(this.baseWidth-a)/2+a,this.pixelX=this.x*t,this.pixelY="odd"===r?this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.y*this.baseHeight-this.x%2*(this.baseHeight/2))}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var e=this.layer.tilemapLayer;if(e){var t=e.gidMap[this.index];if(t)return t}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var e=this.tilemapLayer;return e?e.tilemap:null}}});e.exports=h},49075(e,t,i){var n=i(84101),r=i(83419),s=i(39506),a=i(80341),o=i(95540),l=i(14977),h=i(27462),u=i(91907),c=i(36305),d=i(19133),f=i(68287),p=i(23029),m=i(81086),g=i(44731),v=i(53180),y=i(20442),x=i(33629),b=new r({initialize:function(e,t){this.scene=e,this.tileWidth=t.tileWidth,this.tileHeight=t.tileHeight,this.width=t.width,this.height=t.height,this.orientation=t.orientation,this.renderOrder=t.renderOrder,this.format=t.format,this.version=t.version,this.properties=t.properties,this.widthInPixels=t.widthInPixels,this.heightInPixels=t.heightInPixels,this.imageCollections=t.imageCollections,this.images=t.images,this.layers=t.layers,this.tiles=t.tiles,this.tilesets=t.tilesets,this.objects=t.objects,this.currentLayerIndex=0,this.hexSideLength=t.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:m.GetWorldToTileXYFunction(i),WorldToTileX:m.GetWorldToTileXFunction(i),WorldToTileY:m.GetWorldToTileYFunction(i),TileToWorldXY:m.GetTileToWorldXYFunction(i),TileToWorldX:m.GetTileToWorldXFunction(i),TileToWorldY:m.GetTileToWorldYFunction(i),GetTileCorners:m.GetTileCornersFunction(i)}},setRenderOrder:function(e){var t=["right-down","left-down","right-up","left-up"];return"number"===typeof e&&(e=t[e]),t.indexOf(e)>-1&&(this.renderOrder=e),this},addTilesetImage:function(e,t,i,r,s,o,l,h){if(void 0===e)return null;void 0!==t&&null!==t||(t=e);var u=this.scene.sys.textures;if(!u.exists(t))return console.warn('Texture key "%s" not found',t),null;var c=u.get(t),d=this.getTilesetIndex(e);if(null===d&&this.format===a.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',e,this.tilesets),null;var f=this.tilesets[d];return f?((i||r)&&f.setTileSize(i,r),(s||o)&&f.setSpacing(s,o),f.setImage(c),f):(void 0===i&&(i=this.tileWidth),void 0===r&&(r=this.tileHeight),void 0===s&&(s=0),void 0===o&&(o=0),void 0===l&&(l=0),void 0===h&&(h={x:0,y:0}),(f=new x(e,l,i,r,s,o,void 0,void 0,h)).setImage(c),this.tilesets.push(f),this.tiles=n(this),f)},copy:function(e,t,i,n,r,s,a,o){return null!==(o=this.getLayer(o))?(m.Copy(e,t,i,n,r,s,a,o),this):null},createBlankLayer:function(e,t,i,n,r,s,a,o){if(void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=this.width),void 0===s&&(s=this.height),void 0===a&&(a=this.tileWidth),void 0===o&&(o=this.tileHeight),null!==this.getLayerIndex(e))return console.warn("Invalid Tilemap Layer ID: "+e),null;for(var h,u=new l({name:e,tileWidth:a,tileHeight:o,width:r,height:s,orientation:this.orientation,hexSideLength:this.hexSideLength}),c=0;c<s;c++){h=[];for(var d=0;d<r;d++)h.push(new p(u,-1,d,c,a,o,this.tileWidth,this.tileHeight));u.data.push(h)}this.layers.push(u),this.currentLayerIndex=this.layers.length-1;var f=new y(this.scene,this,this.currentLayerIndex,t,i,n);return f.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(f),f},createLayer:function(e,t,i,n,r){var s=this.getLayerIndex(e);if(null===s)return console.warn("Invalid Tilemap Layer ID: "+e),"string"===typeof e&&console.warn("Valid tilelayer names: %o",this.getTileLayerNames()),null;var a,o=this.layers[s];return o.tilemapLayer?(console.warn("Tilemap Layer ID already exists:"+e),null):(this.currentLayerIndex=s,void 0===i&&(i=o.x),void 0===n&&(n=o.y),r?(Array.isArray(t)&&(t.length>1&&console.warn("TilemapGPULayer can only use one tileset. Using the first item given."),t=t[0]),a=new v(this.scene,this,s,t,i,n)):(a=new y(this.scene,this,s,t,i,n)).setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(a),a)},createFromObjects:function(e,t,i){void 0===i&&(i=!0);var n=[],r=this.getObjectLayer(e);if(!r)return console.warn("createFromObjects: Invalid objectLayerName given: "+e),n;var a=new h(i?this.tilesets:void 0);Array.isArray(t)||(t=[t]);var l=r.objects;t.sortByY&&l.sort(function(e,t){return e.y>t.y?1:-1});for(var d=0;d<t.length;d++){var p,m=t[d],g=o(m,"id",null),v=o(m,"gid",null),y=o(m,"name",null),x=o(m,"type",null);a.enabled=!o(m,"ignoreTileset",null);for(var b=[],w=0;w<l.length;w++)p=l[w],(null===g&&null===v&&null===y&&null===x||null!==g&&p.id===g||null!==v&&p.gid===v||null!==y&&p.name===y||null!==x&&a.getTypeIncludingTile(p)===x)&&b.push(p);for(var T=o(m,"classType",f),_=o(m,"scene",this.scene),S=o(m,"container",null),E=o(m,"key",null),C=o(m,"frame",null),A=0;A<b.length;A++){p=b[A];var k=new T(_);if(k.setName(p.name),k.setPosition(p.x,p.y),a.setTextureAndFrame(k,E,C,p),p.width&&(k.displayWidth=p.width),p.height&&(k.displayHeight=p.height),this.orientation===u.ISOMETRIC){var R=this.tileWidth/this.tileHeight,O={x:k.x-k.y,y:(k.x+k.y)/R};k.x=O.x,k.y=O.y}var P={x:k.originX*p.width,y:(k.originY-(p.gid?1:0))*p.height};if(p.rotation){var M=s(p.rotation);c(P,M),k.rotation=M}k.x+=P.x,k.y+=P.y,void 0===p.flippedHorizontal&&void 0===p.flippedVertical||k.setFlip(p.flippedHorizontal,p.flippedVertical),p.visible||(k.visible=!1),a.setPropertiesFromTiledObject(k,p),S?S.add(k):_.add.existing(k),n.push(k)}}return n},createFromTiles:function(e,t,i,n,r,s){return null===(s=this.getLayer(s))?null:m.CreateFromTiles(e,t,i,n,r,s)},fill:function(e,t,i,n,r,s,a){return void 0===s&&(s=!0),null===(a=this.getLayer(a))?null:(m.Fill(e,t,i,n,r,s,a),this)},filterObjects:function(e,t,i){if("string"===typeof e){var n=e;if(!(e=this.getObjectLayer(e)))return console.warn("No object layer found with the name: "+n),null}return e.objects.filter(t,i)},filterTiles:function(e,t,i,n,r,s,a,o){return null===(o=this.getLayer(o))?null:m.FilterTiles(e,t,i,n,r,s,a,o)},findByIndex:function(e,t,i,n){return null===(n=this.getLayer(n))?null:m.FindByIndex(e,t,i,n)},findObject:function(e,t,i){if("string"===typeof e){var n=e;if(!(e=this.getObjectLayer(e)))return console.warn("No object layer found with the name: "+n),null}return e.objects.find(t,i)||null},findTile:function(e,t,i,n,r,s,a,o){return null===(o=this.getLayer(o))?null:m.FindTile(e,t,i,n,r,s,a,o)},forEachTile:function(e,t,i,n,r,s,a,o){return null===(o=this.getLayer(o))?null:(m.ForEachTile(e,t,i,n,r,s,a,o),this)},getImageIndex:function(e){return this.getIndex(this.images,e)},getImageLayerNames:function(){return this.images&&Array.isArray(this.images)?this.images.map(function(e){return e.name}):[]},getIndex:function(e,t){for(var i=0;i<e.length;i++)if(e[i].name===t)return i;return null},getLayer:function(e){var t=this.getLayerIndex(e);return null!==t?this.layers[t]:null},getObjectLayer:function(e){var t=this.getIndex(this.objects,e);return null!==t?this.objects[t]:null},getObjectLayerNames:function(){return this.objects&&Array.isArray(this.objects)?this.objects.map(function(e){return e.name}):[]},getLayerIndex:function(e){return void 0===e?this.currentLayerIndex:"string"===typeof e?this.getLayerIndexByName(e):"number"===typeof e&&e<this.layers.length?e:e instanceof g&&e.tilemap===this?e.layerIndex:null},getLayerIndexByName:function(e){return this.getIndex(this.layers,e)},getTileAt:function(e,t,i,n){return null===(n=this.getLayer(n))?null:m.GetTileAt(e,t,i,n)},getTileAtWorldXY:function(e,t,i,n,r){return null===(r=this.getLayer(r))?null:m.GetTileAtWorldXY(e,t,i,n,r)},getTileLayerNames:function(){return this.layers&&Array.isArray(this.layers)?this.layers.map(function(e){return e.name}):[]},getTilesWithin:function(e,t,i,n,r,s){return null===(s=this.getLayer(s))?null:m.GetTilesWithin(e,t,i,n,r,s)},getTilesWithinShape:function(e,t,i,n){return null===(n=this.getLayer(n))?null:m.GetTilesWithinShape(e,t,i,n)},getTilesWithinWorldXY:function(e,t,i,n,r,s,a){return null===(a=this.getLayer(a))?null:m.GetTilesWithinWorldXY(e,t,i,n,r,s,a)},getTileset:function(e){var t=this.getIndex(this.tilesets,e);return null!==t?this.tilesets[t]:null},getTilesetIndex:function(e){return this.getIndex(this.tilesets,e)},hasTileAt:function(e,t,i){return null===(i=this.getLayer(i))?null:m.HasTileAt(e,t,i)},hasTileAtWorldXY:function(e,t,i,n){return null===(n=this.getLayer(n))?null:m.HasTileAtWorldXY(e,t,i,n)},layer:{get:function(){return this.layers[this.currentLayerIndex]},set:function(e){this.setLayer(e)}},putTileAt:function(e,t,i,n,r){return void 0===n&&(n=!0),null===(r=this.getLayer(r))?null:m.PutTileAt(e,t,i,n,r)},putTileAtWorldXY:function(e,t,i,n,r,s){return void 0===n&&(n=!0),null===(s=this.getLayer(s))?null:m.PutTileAtWorldXY(e,t,i,n,r,s)},putTilesAt:function(e,t,i,n,r){return void 0===n&&(n=!0),null===(r=this.getLayer(r))?null:(m.PutTilesAt(e,t,i,n,r),this)},randomize:function(e,t,i,n,r,s){return null===(s=this.getLayer(s))?null:(m.Randomize(e,t,i,n,r,s),this)},calculateFacesAt:function(e,t,i){return null===(i=this.getLayer(i))?null:(m.CalculateFacesAt(e,t,i),this)},calculateFacesWithin:function(e,t,i,n,r){return null===(r=this.getLayer(r))?null:(m.CalculateFacesWithin(e,t,i,n,r),this)},removeLayer:function(e){var t=this.getLayerIndex(e);if(null!==t){d(this.layers,t);for(var i=t;i<this.layers.length;i++)this.layers[i].tilemapLayer&&this.layers[i].tilemapLayer.layerIndex--;return this.currentLayerIndex===t&&(this.currentLayerIndex=0),this}return null},destroyLayer:function(e){var t=this.getLayerIndex(e);return null!==t?((e=this.layers[t]).tilemapLayer.destroy(),d(this.layers,t),this.currentLayerIndex===t&&(this.currentLayerIndex=0),this):null},removeAllLayers:function(){for(var e=this.layers,t=0;t<e.length;t++)e[t].tilemapLayer&&e[t].tilemapLayer.destroy(!1);return e.length=0,this.currentLayerIndex=0,this},removeTile:function(e,t,i){void 0===t&&(t=-1),void 0===i&&(i=!0);var n=[];Array.isArray(e)||(e=[e]);for(var r=0;r<e.length;r++){var s=e[r];n.push(this.removeTileAt(s.x,s.y,!0,i,s.tilemapLayer)),t>-1&&this.putTileAt(t,s.x,s.y,i,s.tilemapLayer)}return n},removeTileAt:function(e,t,i,n,r){return void 0===i&&(i=!0),void 0===n&&(n=!0),null===(r=this.getLayer(r))?null:m.RemoveTileAt(e,t,i,n,r)},removeTileAtWorldXY:function(e,t,i,n,r,s){return void 0===i&&(i=!0),void 0===n&&(n=!0),null===(s=this.getLayer(s))?null:m.RemoveTileAtWorldXY(e,t,i,n,r,s)},renderDebug:function(e,t,i){return null===(i=this.getLayer(i))?null:(this.orientation===u.ORTHOGONAL&&m.RenderDebug(e,t,i),this)},renderDebugFull:function(e,t){for(var i=this.layers,n=0;n<i.length;n++)m.RenderDebug(e,t,i[n]);return this},replaceByIndex:function(e,t,i,n,r,s,a){return null===(a=this.getLayer(a))?null:(m.ReplaceByIndex(e,t,i,n,r,s,a),this)},setCollision:function(e,t,i,n,r){return void 0===t&&(t=!0),void 0===i&&(i=!0),void 0===r&&(r=!0),null===(n=this.getLayer(n))?null:(m.SetCollision(e,t,i,n,r),this)},setCollisionBetween:function(e,t,i,n,r){return void 0===i&&(i=!0),void 0===n&&(n=!0),null===(r=this.getLayer(r))?null:(m.SetCollisionBetween(e,t,i,n,r),this)},setCollisionByProperty:function(e,t,i,n){return void 0===t&&(t=!0),void 0===i&&(i=!0),null===(n=this.getLayer(n))?null:(m.SetCollisionByProperty(e,t,i,n),this)},setCollisionByExclusion:function(e,t,i,n){return void 0===t&&(t=!0),void 0===i&&(i=!0),null===(n=this.getLayer(n))?null:(m.SetCollisionByExclusion(e,t,i,n),this)},setCollisionFromCollisionGroup:function(e,t,i){return void 0===e&&(e=!0),void 0===t&&(t=!0),null===(i=this.getLayer(i))?null:(m.SetCollisionFromCollisionGroup(e,t,i),this)},setTileIndexCallback:function(e,t,i,n){return null===(n=this.getLayer(n))?null:(m.SetTileIndexCallback(e,t,i,n),this)},setTileLocationCallback:function(e,t,i,n,r,s,a){return null===(a=this.getLayer(a))?null:(m.SetTileLocationCallback(e,t,i,n,r,s,a),this)},setLayer:function(e){var t=this.getLayerIndex(e);return null!==t&&(this.currentLayerIndex=t),this},setBaseTileSize:function(e,t){this.tileWidth=e,this.tileHeight=t,this.widthInPixels=this.width*e,this.heightInPixels=this.height*t;for(var i=0;i<this.layers.length;i++){this.layers[i].baseTileWidth=e,this.layers[i].baseTileHeight=t;for(var n=this.layers[i].data,r=this.layers[i].width,s=this.layers[i].height,a=0;a<s;a++)for(var o=0;o<r;o++){var l=n[a][o];null!==l&&l.setSize(void 0,void 0,e,t)}}return this},setLayerTileSize:function(e,t,i){if(null===(i=this.getLayer(i)))return this;i.tileWidth=e,i.tileHeight=t;for(var n=i.data,r=i.width,s=i.height,a=0;a<s;a++)for(var o=0;o<r;o++){var l=n[a][o];null!==l&&l.setSize(e,t)}return this},shuffle:function(e,t,i,n,r){return null===(r=this.getLayer(r))?null:(m.Shuffle(e,t,i,n,r),this)},swapByIndex:function(e,t,i,n,r,s,a){return null===(a=this.getLayer(a))?null:(m.SwapByIndex(e,t,i,n,r,s,a),this)},tileToWorldX:function(e,t,i){return null===(i=this.getLayer(i))?null:this._convert.TileToWorldX(e,t,i)},tileToWorldY:function(e,t,i){return null===(i=this.getLayer(i))?null:this._convert.TileToWorldY(e,t,i)},tileToWorldXY:function(e,t,i,n,r){return null===(r=this.getLayer(r))?null:this._convert.TileToWorldXY(e,t,i,n,r)},getTileCorners:function(e,t,i,n){return null===(n=this.getLayer(n))?null:this._convert.GetTileCorners(e,t,i,n)},weightedRandomize:function(e,t,i,n,r,s){return null===(s=this.getLayer(s))?null:(m.WeightedRandomize(t,i,n,r,e,s),this)},worldToTileX:function(e,t,i,n){return null===(n=this.getLayer(n))?null:this._convert.WorldToTileX(e,t,i,n)},worldToTileY:function(e,t,i,n){return null===(n=this.getLayer(n))?null:this._convert.WorldToTileY(e,t,i,n)},worldToTileXY:function(e,t,i,n,r,s){return null===(s=this.getLayer(s))?null:this._convert.WorldToTileXY(e,t,i,n,r,s)},destroy:function(){this.removeAllLayers(),this.tiles.length=0,this.tilesets.length=0,this.objects.length=0,this.scene=null}});e.exports=b},45939(e,t,i){var n=i(44603),r=i(31989);n.register("tilemap",function(e){var t=void 0!==e?e:{};return r(this.scene,t.key,t.tileWidth,t.tileHeight,t.width,t.height,t.data,t.insertNull)})},46029(e,t,i){var n=i(39429),r=i(31989);n.register("tilemap",function(e,t,i,n,s,a,o){return null===e&&(e=void 0),null===t&&(t=void 0),null===i&&(i=void 0),null===n&&(n=void 0),null===s&&(s=void 0),r(this.scene,e,t,i,n,s,a,o)})},53180(e,t,i){var n=i(67743),r=i(83419),s=i(44731),a=i(57912),o=new r({Extends:s,Mixins:[a],initialize:function(e,t,i,n,r,a){s.call(this,"TilemapGPULayer",e,t,i,r,a),this.tileset=null,this.layerDataTexture=null,this.setTileset(n),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return n}},setTileset:function(e){"string"===typeof e&&(e=this.tilemap.getTileset(e)),this.tileset=e,this.generateLayerDataTexture()},generateLayerDataTexture:function(){for(var e=this.layer,t=this.tileset,i=t.firstgid,n=this.scene.renderer,r=t.getAnimationDataIndexMap(n),s=new Uint32Array(e.width*e.height),a=0;a<e.height;a++)for(var o=0;o<e.width;o++){var l=e.data[a][o],h=l.index-i,u=l.flipX,c=l.flipY,d=!1;r.has(h)&&(h=r.get(h),d=!0),u&&(h|=2147483648),c&&(h|=1073741824),d&&(h|=536870912),-1===l.index&&(h=268435456),s[a*e.width+o]=h}this.layerDataTexture&&this.layerDataTexture.destroy();var f=new Uint8Array(s.buffer);this.layerDataTexture=n.createUint8ArrayTexture(f,e.width,e.height,!1,!0)}});e.exports=o},57912(e,t,i){var n=i(29747),r=n,s=n;r=i(6736),e.exports={renderWebGL:r,renderCanvas:s}},6736(e){e.exports=function(e,t,i,n){(t.customRenderNodes.Submitter||t.defaultRenderNodes.Submitter).run(i,t,n)}},20442(e,t,i){var n=i(79317),r=i(83419),s=i(81086),a=i(19218),o=i(44731),l=i(84322),h=new r({Extends:o,Mixins:[a],initialize:function(e,t,i,n,r,a){o.call(this,"TilemapLayer",e,t,i,r,a),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=s.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.setTilesets(n),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return n}},setTilesets:function(e){var t=[],i=[],n=this.tilemap;Array.isArray(e)||(e=[e]);for(var r=0;r<e.length;r++){var s=e[r];if("string"===typeof s&&(s=n.getTileset(s)),s){i.push(s);for(var a=s.firstgid,o=0;o<s.total;o++)t[a+o]=s}}this.gidMap=t,this.tileset=i},setRenderOrder:function(e){return"string"===typeof e&&(e=["right-down","left-down","right-up","left-up"].indexOf(e)),e>=0&&e<4&&(this._renderOrder=e),this},cull:function(e){return this.cullCallback(this.layer,e,this.culledTiles,this._renderOrder)},setSkipCull:function(e){return void 0===e&&(e=!0),this.skipCull=e,this},setCullPadding:function(e,t){return void 0===e&&(e=1),void 0===t&&(t=1),this.cullPaddingX=e,this.cullPaddingY=t,this},setTint:function(e,t,i,n,r,s){void 0===e&&(e=16777215);return this.forEachTile(function(t){t.tint=e},this,t,i,n,r,s)},setTint2:function(e,t,i,n,r,s){void 0===e&&(e=0);return this.forEachTile(function(t){t.tint2=e},this,t,i,n,r,s)},setTintMode:function(e,t,i,n,r,s){void 0===e&&(e=l.MULTIPLY);return this.forEachTile(function(t){t.tintMode=e},this,t,i,n,r,s)},destroy:function(e){this.culledTiles.length=0,this.cullCallback=null,o.prototype.destroy.call(this,e)}});e.exports=h},44731(e,t,i){var n=i(83419),r=i(78389),s=i(31401),a=i(95643),o=i(81086),l=i(26099),h=new n({Extends:a,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.ElapseTimer,s.Flip,s.GetBounds,s.Lighting,s.Mask,s.Origin,s.RenderNodes,s.Transform,s.Visible,s.ScrollFactor,r],initialize:function(e,t,i,n,r,s){a.call(this,t,e),this.isTilemap=!0,this.tilemap=i,this.layerIndex=n,this.layer=i.layers[n],this.layer.tilemapLayer=this,this.gidMap=[],this.tempVec=new l,this.collisionCategory=1,this.collisionMask=1,this.setAlpha(this.layer.alpha),this.setPosition(r,s),this.setOrigin(0,0),this.setSize(i.tileWidth*this.layer.width,i.tileHeight*this.layer.height)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(e,t){this.updateTimer(e,t)},calculateFacesAt:function(e,t){return o.CalculateFacesAt(e,t,this.layer),this},calculateFacesWithin:function(e,t,i,n){return o.CalculateFacesWithin(e,t,i,n,this.layer),this},createFromTiles:function(e,t,i,n,r){return o.CreateFromTiles(e,t,i,n,r,this.layer)},copy:function(e,t,i,n,r,s,a){return o.Copy(e,t,i,n,r,s,a,this.layer),this},fill:function(e,t,i,n,r,s){return o.Fill(e,t,i,n,r,s,this.layer),this},filterTiles:function(e,t,i,n,r,s,a){return o.FilterTiles(e,t,i,n,r,s,a,this.layer)},findByIndex:function(e,t,i){return o.FindByIndex(e,t,i,this.layer)},findTile:function(e,t,i,n,r,s,a){return o.FindTile(e,t,i,n,r,s,a,this.layer)},forEachTile:function(e,t,i,n,r,s,a){return o.ForEachTile(e,t,i,n,r,s,a,this.layer),this},getTileAt:function(e,t,i){return o.GetTileAt(e,t,i,this.layer)},getTileAtWorldXY:function(e,t,i,n){return o.GetTileAtWorldXY(e,t,i,n,this.layer)},getIsoTileAtWorldXY:function(e,t,i,n,r){void 0===i&&(i=!0);var s=this.tempVec;return o.IsometricWorldToTileXY(e,t,!0,s,r,this.layer,i),this.getTileAt(s.x,s.y,n)},getTilesWithin:function(e,t,i,n,r){return o.GetTilesWithin(e,t,i,n,r,this.layer)},getTilesWithinShape:function(e,t,i){return o.GetTilesWithinShape(e,t,i,this.layer)},getTilesWithinWorldXY:function(e,t,i,n,r,s){return o.GetTilesWithinWorldXY(e,t,i,n,r,s,this.layer)},hasTileAt:function(e,t){return o.HasTileAt(e,t,this.layer)},hasTileAtWorldXY:function(e,t,i){return o.HasTileAtWorldXY(e,t,i,this.layer)},putTileAt:function(e,t,i,n){return o.PutTileAt(e,t,i,n,this.layer)},putTileAtWorldXY:function(e,t,i,n,r){return o.PutTileAtWorldXY(e,t,i,n,r,this.layer)},putTilesAt:function(e,t,i,n){return o.PutTilesAt(e,t,i,n,this.layer),this},randomize:function(e,t,i,n,r){return o.Randomize(e,t,i,n,r,this.layer),this},removeTileAt:function(e,t,i,n){return o.RemoveTileAt(e,t,i,n,this.layer)},removeTileAtWorldXY:function(e,t,i,n,r){return o.RemoveTileAtWorldXY(e,t,i,n,r,this.layer)},renderDebug:function(e,t){return o.RenderDebug(e,t,this.layer),this},replaceByIndex:function(e,t,i,n,r,s){return o.ReplaceByIndex(e,t,i,n,r,s,this.layer),this},setCollision:function(e,t,i,n){return o.SetCollision(e,t,i,this.layer,n),this},setCollisionBetween:function(e,t,i,n){return o.SetCollisionBetween(e,t,i,n,this.layer),this},setCollisionByProperty:function(e,t,i){return o.SetCollisionByProperty(e,t,i,this.layer),this},setCollisionByExclusion:function(e,t,i){return o.SetCollisionByExclusion(e,t,i,this.layer),this},setCollisionFromCollisionGroup:function(e,t){return o.SetCollisionFromCollisionGroup(e,t,this.layer),this},setTileIndexCallback:function(e,t,i){return o.SetTileIndexCallback(e,t,i,this.layer),this},setTileLocationCallback:function(e,t,i,n,r,s){return o.SetTileLocationCallback(e,t,i,n,r,s,this.layer),this},shuffle:function(e,t,i,n){return o.Shuffle(e,t,i,n,this.layer),this},swapByIndex:function(e,t,i,n,r,s){return o.SwapByIndex(e,t,i,n,r,s,this.layer),this},tileToWorldX:function(e,t){return this.tilemap.tileToWorldX(e,t,this)},tileToWorldY:function(e,t){return this.tilemap.tileToWorldY(e,t,this)},tileToWorldXY:function(e,t,i,n){return this.tilemap.tileToWorldXY(e,t,i,n,this)},getTileCorners:function(e,t,i){return this.tilemap.getTileCorners(e,t,i,this)},weightedRandomize:function(e,t,i,n,r){return o.WeightedRandomize(t,i,n,r,e,this.layer),this},worldToTileX:function(e,t,i){return this.tilemap.worldToTileX(e,t,i,this)},worldToTileY:function(e,t,i){return this.tilemap.worldToTileY(e,t,i,this)},worldToTileXY:function(e,t,i,n,r){return this.tilemap.worldToTileXY(e,t,i,n,r,this)},destroy:function(e){void 0===e&&(e=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),e&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.gidMap=[],this.tileset=[],a.prototype.destroy.call(this))}});e.exports=h},16153(e,t,i){var n=i(61340),r=new n,s=new n,a=new n;e.exports=function(e,t,i,n){var o=t.cull(i),l=o.length,h=i.alpha*t.alpha;if(!(0===l||h<=0)){s.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY);var u=e.currentContext,c=t.gidMap;u.save(),r.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,t.scrollFactorX,t.scrollFactorY),n&&r.multiply(n),r.multiply(s,a),a.setToContext(u),(!e.antialias||t.scaleX>1||t.scaleY>1)&&(u.imageSmoothingEnabled=!1);for(var d=0;d<l;d++){var f=o[d],p=c[f.index];if(p){var m=p.image.getSourceImage(),g=p.getTileTextureCoordinates(f.index),v=p.tileWidth,y=p.tileHeight;if(null!==g&&0!==v&&0!==y){var x=.5*v,b=.5*y;g.x+=p.tileOffset.x,g.y+=p.tileOffset.y,u.save(),u.translate(f.pixelX+x,f.pixelY+b),0!==f.rotation&&u.rotate(f.rotation),(f.flipX||f.flipY)&&u.scale(f.flipX?-1:1,f.flipY?-1:1),u.globalAlpha=h*f.alpha,u.drawImage(m,g.x,g.y,v,y,-x,-b,v,y),u.restore()}}}u.restore()}}},19218(e,t,i){var n=i(29747),r=n,s=n;r=i(99558),s=i(16153),e.exports={renderWebGL:r,renderCanvas:s}},99558(e,t,i){var n=i(84322),r=i(70554).getTintAppendFloatAlpha,s={frame:{source:{glTexture:null}},uvSource:{u0:0,v0:0,u1:1,v1:1},frameWidth:0,frameHeight:0},a={tintEffect:n.MULTIPLY,tintTopLeft:0,tintTopRight:0,tintBottomLeft:0,tintBottomRight:0};e.exports=function(e,t,i,n){var o=i.camera,l=t.cull(o),h=l.length,u=t.alpha;if(!(0===h||u<=0))for(var c=t.gidMap,d=t.customRenderNodes.Submitter||t.defaultRenderNodes.Submitter,f=t.customRenderNodes.Transformer||t.defaultRenderNodes.Transformer,p=t.timeElapsed,m=0;m<h;m++){var g=l[m],v=c[g.index];if(v){var y=v.getAnimatedTileId(g.index,p);if(null!==y){var x=v.getTileTextureCoordinates(y),b=v.tileWidth,w=v.tileHeight;if(x&&0!==b&&0!==w){var T=v.glTexture,_=b,S=w,E=x.x,C=x.y,A=r(g.tint,u*g.alpha),k=g.tint2;s.frame.source.glTexture=v.glTexture,s.frameWidth=_,s.frameHeight=S,s.uvSource.u0=E/T.width,s.uvSource.v0=1-(C+S)/T.height,s.uvSource.u1=(E+_)/T.width,s.uvSource.v1=1-C/T.height,a.tintEffect=g.tintMode,a.tintTopLeft=A,a.tintTopRight=A,a.tintBottomLeft=A,a.tintBottomRight=A,a.tint2TopLeft=k,a.tint2TopRight=k,a.tint2BottomLeft=k,a.tint2BottomRight=k,d.run(i,t,n,g,s,f,a)}}}}}},33629(e,t,i){var n=i(83419),r=i(26099),s=new n({initialize:function(e,t,i,n,s,a,o,l,h){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===a&&(a=0),void 0===o&&(o={}),void 0===l&&(l={}),this.name=e,this.firstgid=t,this.tileWidth=i,this.tileHeight=n,this.tileMargin=s,this.tileSpacing=a,this.tileProperties=o,this.tileData=l,this.tileOffset=new r,void 0!==h&&this.tileOffset.set(h.x,h.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[],this.animationSearchThreshold=64,this.maxAnimationLength=0,this._animationDataTexture=null,this._animationDataIndexMap=null},getTileProperties:function(e){return this.containsTileIndex(e)?this.tileProperties[e-this.firstgid]:null},getTileData:function(e){return this.containsTileIndex(e)?this.tileData[e-this.firstgid]:null},getTileCollisionGroup:function(e){var t=this.getTileData(e);return t&&t.objectgroup?t.objectgroup:null},containsTileIndex:function(e){return e>=this.firstgid&&e<this.firstgid+this.total},getAnimatedTileId:function(e,t){if(!this.containsTileIndex(e))return null;var i=this.getTileData(e);if(!i||!i.animation)return e;t%=i.animationDuration;for(var n=i.animation,r=null,s=0,a=n.length-1,o=0,l=0;s<=a;){if((l=(r=n[o=s+a>>>1]).startTime)<=t&&l+r.duration>t)return r.tileid+this.firstgid;l<t?s=o+1:a=o-1}return null},getTileTextureCoordinates:function(e){return this.containsTileIndex(e)?this.texCoordinates[e-this.firstgid]:null},setImage:function(e){this.image=e;var t=e.get(),i=e.getFrameBounds();return this.glTexture=t.source.glTexture,t.width>i.width||t.height>i.height?this.updateTileData(t.width,t.height):this.updateTileData(i.width,i.height,i.x,i.y),this},setTileSize:function(e,t){return void 0!==e&&(this.tileWidth=e),void 0!==t&&(this.tileHeight=t),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(e,t){return void 0!==e&&(this.tileMargin=e),void 0!==t&&(this.tileSpacing=t),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(e,t,i,n){void 0===i&&(i=0),void 0===n&&(n=0);var r=(t-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),s=(e-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);r%1===0&&s%1===0||console.warn("Image tile area not tile size multiple in: "+this.name),r=Math.floor(r),s=Math.floor(s),this.rows=r,this.columns=s,this.total=r*s,this.texCoordinates.length=0;for(var a=this.tileMargin+i,o=this.tileMargin+n,l=0;l<this.rows;l++){for(var h=0;h<this.columns;h++)this.texCoordinates.push({x:a,y:o}),a+=this.tileWidth+this.tileSpacing;a=this.tileMargin+i,o+=this.tileHeight+this.tileSpacing}return this._animationDataTexture&&this.createAnimationDataTexture(),this},getAnimationDataTexture:function(e){return this._animationDataTexture||this.createAnimationDataTexture(e),this._animationDataTexture},getAnimationDataIndexMap:function(e){return this._animationDataIndexMap||this.createAnimationDataTexture(e),this._animationDataIndexMap},createAnimationDataTexture:function(e){for(var t=this.tileData,i=this.total,n=[],r=[],s=new Map,a=0,o=0;o<i;o++){var l=t[o];if(l&&l.animation){var h=l.animation,u=l.animationDuration;s.set(o,n.length),n.push([u,r.length]);for(var c=0;c<h.length;c++){var d=h[c];r.push([d.duration,d.tileid])}a=Math.max(a,h.length)}}var f=n.length+r.length;if(f>8388608)throw new Error("Tileset._animationDataTexture: too many animations - total number of animations plus animation frames is max 8388608, got "+f);var p=2*f,m=Math.min(p,4096),g=Math.ceil(p/4096),v=new Uint32Array(m*g),y=0,x=n.length;for(o=0;o<x;o++){var b=(h=n[o])[0],w=h[1];v[y++]=b,v[y++]=2*(w+x)}for(o=0;o<r.length;o++){var T=(d=r[o])[0],_=d[1];v[y++]=T,v[y++]=_}this._animationDataTexture&&this._animationDataTexture.destroy();var S=new Uint8Array(v.buffer);this._animationDataTexture=e.createUint8ArrayTexture(S,m,g,!1,!0),this._animationDataIndexMap=s,this.maxAnimationLength=a}});e.exports=s},72023(e,t,i){var n=i(7423);e.exports=function(e,t,i){var r=n(e,t,!0,i),s=n(e,t-1,!0,i),a=n(e,t+1,!0,i),o=n(e-1,t,!0,i),l=n(e+1,t,!0,i),h=r&&r.collides;return h&&(r.faceTop=!0,r.faceBottom=!0,r.faceLeft=!0,r.faceRight=!0),s&&s.collides&&(h&&(r.faceTop=!1),s.faceBottom=!h),a&&a.collides&&(h&&(r.faceBottom=!1),a.faceTop=!h),o&&o.collides&&(h&&(r.faceLeft=!1),o.faceRight=!h),l&&l.collides&&(h&&(r.faceRight=!1),l.faceLeft=!h),r&&!r.collides&&r.resetFaces(),r}},42573(e,t,i){var n=i(7423),r=i(7386);e.exports=function(e,t,i,s,a){for(var o=null,l=null,h=null,u=null,c=r(e,t,i,s,null,a),d=0;d<c.length;d++){var f=c[d];f&&(f.collides?(o=n(f.x,f.y-1,!0,a),l=n(f.x,f.y+1,!0,a),h=n(f.x-1,f.y,!0,a),u=n(f.x+1,f.y,!0,a),f.faceTop=!o||!o.collides,f.faceBottom=!l||!l.collides,f.faceLeft=!h||!h.collides,f.faceRight=!u||!u.collides):f.resetFaces())}}},33528(e,t,i){var n=new(i(26099));e.exports=function(e,t,i,r){var s=i.tilemapLayer,a=s.cullPaddingX,o=s.cullPaddingY,l=s.tilemap.tileToWorldXY(e,t,n,r,s);return l.x>r.worldView.x+s.scaleX*i.tileWidth*(-a-.5)&&l.x<r.worldView.right+s.scaleX*i.tileWidth*(a-.5)&&l.y>r.worldView.y+s.scaleY*i.tileHeight*(-o-1)&&l.y<r.worldView.bottom+s.scaleY*i.tileHeight*(o-.5)}},1785(e,t,i){var n=i(42573),r=i(7386),s=i(62991),a=i(23029);e.exports=function(e,t,i,o,l,h,u,c){void 0===u&&(u=!0);var d=r(e,t,i,o,null,c),f=[];d.forEach(function(e){var t=new a(e.layer,e.index,e.x,e.y,e.width,e.height,e.baseWidth,e.baseHeight);t.copy(e),f.push(t)});for(var p=l-e,m=h-t,g=0;g<f.length;g++){var v=f[g],y=v.x+p,x=v.y+m;s(y,x,c)&&c.data[x][y]&&(v.x=y,v.y=x,v.updatePixelXY(),c.data[x][y]=v)}u&&n(l-1,h-1,i+2,o+2,c),d.length=0,f.length=0}},78419(e,t,i){var n=i(62644),r=i(7386),s=i(27987);e.exports=function(e,t,i,a,o,l){i||(i={}),Array.isArray(e)||(e=[e]);var h=l.tilemapLayer;a||(a=h.scene),o||(o=a.cameras.main);var u,c=l.width,d=l.height,f=r(0,0,c,d,null,l),p=[],m=function(e,t,i){for(var n=0;n<i.length;n++){var r=i[n];e.hasOwnProperty(r)||(e[r]=t[r])}};for(u=0;u<f.length;u++){var g=f[u],v=n(i);if(-1!==e.indexOf(g.index)){var y=h.tileToWorldXY(g.x,g.y,void 0,o,l);v.x=y.x,v.y=y.y,m(v,g,["rotation","flipX","flipY","alpha","visible","t
2int"]),v.hasOwnProperty("origin")||(v.x+=.5*g.width,v.y+=.5*g.height),v.hasOwnProperty("useSpriteSheet")&&(v.key=g.tileset.image,v.frame=g.index-g.tileset.firstgid),p.push(a.make.sprite(v))}}if(Array.isArray(t))for(u=0;u<e.length;u++)s(e[u],t[u],0,0,c,d,l);else if(null!==t)for(u=0;u<e.length;u++)s(e[u],t,0,0,c,d,l);return p}},19545(e,t,i){var n=i(87841),r=i(63448),s=i(56583),a=new n;e.exports=function(e,t){var i=e.tilemapLayer.tilemap,n=e.tilemapLayer,o=Math.floor(i.tileWidth*n.scaleX),l=Math.floor(i.tileHeight*n.scaleY),h=s(t.worldView.x-n.x,o,0,!0)-n.cullPaddingX,u=r(t.worldView.right-n.x,o,0,!0)+n.cullPaddingX,c=s(t.worldView.y-n.y,l,0,!0)-n.cullPaddingY,d=r(t.worldView.bottom-n.y,l,0,!0)+n.cullPaddingY;return a.setTo(h,c,u-h,d-c)}},30003(e,t,i){var n=i(19545),r=i(32483);e.exports=function(e,t,i,s){void 0===i&&(i=[]),void 0===s&&(s=0),i.length=0;var a=e.tilemapLayer,o=n(e,t);return(a.skipCull||1!==a.scrollFactorX||1!==a.scrollFactorY)&&(o.left=0,o.right=e.width,o.top=0,o.bottom=e.height),r(e,o,s,i),i}},35137(e,t,i){var n=i(7386),r=i(42573),s=i(20576);e.exports=function(e,t,i,a,o,l,h){for(var u=-1!==h.collideIndexes.indexOf(e),c=n(t,i,a,o,null,h),d=0;d<c.length;d++)c[d].index=e,s(c[d],u);l&&r(t-1,i-1,a+2,o+2,h)}},40253(e,t,i){var n=i(7386);e.exports=function(e,t,i,r,s,a,o,l){return n(i,r,s,a,o,l).filter(e,t)}},52692(e){e.exports=function(e,t,i,n){void 0===t&&(t=0),void 0===i&&(i=!1);var r,s,a,o=0;if(i){for(s=n.height-1;s>=0;s--)for(r=n.width-1;r>=0;r--)if((a=n.data[s][r])&&a.index===e){if(o===t)return a;o+=1}}else for(s=0;s<n.height;s++)for(r=0;r<n.width;r++)if((a=n.data[s][r])&&a.index===e){if(o===t)return a;o+=1}return null}},66151(e,t,i){var n=i(7386);e.exports=function(e,t,i,r,s,a,o,l){return n(i,r,s,a,o,l).find(e,t)||null}},97560(e,t,i){var n=i(7386);e.exports=function(e,t,i,r,s,a,o,l){n(i,r,s,a,o,l).forEach(e,t)}},43305(e,t,i){var n=i(91907),r=i(30003),s=i(9474),a=i(14018),o=i(29747),l=i(54503);e.exports=function(e){return e===n.ORTHOGONAL?r:e===n.HEXAGONAL?s:e===n.STAGGERED?l:e===n.ISOMETRIC?a:o}},7423(e,t,i){var n=i(62991);e.exports=function(e,t,i,r){if(n(e,t,r)){var s=r.data[t][e]||null;return s?-1===s.index?i?s:null:s:null}return null}},60540(e,t,i){var n=i(7423),r=new(i(26099));e.exports=function(e,t,i,s,a){return a.tilemapLayer.worldToTileXY(e,t,!0,r,s),n(r.x,r.y,i,a)}},55826(e,t,i){var n=i(26099);e.exports=function(e,t,i,r){var s=r.baseTileWidth,a=r.baseTileHeight,o=r.tilemapLayer,l=0,h=0;o&&(i||(i=o.scene.cameras.main),l=o.x+i.scrollX*(1-o.scrollFactorX),h=o.y+i.scrollY*(1-o.scrollFactorY),s*=o.scaleX,a*=o.scaleY);var u=l+e*s,c=h+t*a;return[new n(u,c),new n(u+s,c),new n(u+s,c+a),new n(u,c+a)]}},11758(e,t,i){var n=i(91907),r=i(27229),s=i(29747),a=i(55826);e.exports=function(e){return e===n.ORTHOGONAL?a:e===n.ISOMETRIC?s:e===n.HEXAGONAL?r:(n.STAGGERED,s)}},39167(e,t,i){var n=i(91907),r=i(29747),s=i(97281);e.exports=function(e){return e===n.ORTHOGONAL?s:r}},62e3(e,t,i){var n=i(91907),r=i(19951),s=i(14127),a=i(29747),o=i(97202),l=i(70326);e.exports=function(e){return e===n.ORTHOGONAL?l:e===n.ISOMETRIC?s:e===n.HEXAGONAL?r:e===n.STAGGERED?o:a}},5984(e,t,i){var n=i(91907),r=i(29747),s=i(28054),a=i(29650);e.exports=function(e){return e===n.ORTHOGONAL?a:e===n.STAGGERED?s:r}},7386(e,t,i){var n=i(95540);e.exports=function(e,t,i,r,s,a){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=a.width),void 0===r&&(r=a.height),s||(s={});var o=n(s,"isNotEmpty",!1),l=n(s,"isColliding",!1),h=n(s,"hasInterestingFace",!1);e<0&&(i+=e,e=0),t<0&&(r+=t,t=0),e+i>a.width&&(i=Math.max(a.width-e,0)),t+r>a.height&&(r=Math.max(a.height-t,0));for(var u=[],c=t;c<t+r;c++)for(var d=e;d<e+i;d++){var f=a.data[c][d];if(null!==f){if(o&&-1===f.index)continue;if(l&&!f.collides)continue;if(h&&!f.hasInterestingFace)continue;u.push(f)}}return u}},91141(e,t,i){var n=i(55738),r=i(7386),s=i(91865),a=i(29747),o=i(26099),l=i(91907),h=function(e,t){return s.RectangleToTriangle(t,e)},u=new o,c=new o,d=new o;e.exports=function(e,t,i,o){if(o.orientation!==l.ORTHOGONAL)return console.warn("GetTilesWithinShape only works with orthogonal tilemaps"),[];if(void 0===e)return[];var f=a;e instanceof n.Circle?f=s.CircleToRectangle:e instanceof n.Rectangle?f=s.RectangleToRectangle:e instanceof n.Triangle?f=h:e instanceof n.Line&&(f=s.LineToRectangle),o.tilemapLayer.worldToTileXY(e.left,e.top,!0,c,i);var p=c.x,m=c.y;o.tilemapLayer.worldToTileXY(e.right,e.bottom,!1,d,i);var g=Math.ceil(d.x),v=Math.ceil(d.y),y=Math.max(g-p,1),x=Math.max(v-m,1),b=r(p,m,y,x,t,o),w=o.tileWidth,T=o.tileHeight;o.tilemapLayer&&(w*=o.tilemapLayer.scaleX,T*=o.tilemapLayer.scaleY);for(var _=[],S=new n.Rectangle(0,0,w,T),E=0;E<b.length;E++){var C=b[E];o.tilemapLayer.tileToWorldXY(C.x,C.y,u,i),S.x=u.x,S.y=u.y,f(e,S)&&_.push(C)}return _}},96523(e,t,i){var n=i(7386),r=i(26099),s=new r,a=new r;e.exports=function(e,t,i,r,o,l,h){var u=h.tilemapLayer.tilemap._convert.WorldToTileXY;u(e,t,!0,s,l,h);var c=s.x,d=s.y;u(e+i,t+r,!1,a,l,h);var f=Math.ceil(a.x),p=Math.ceil(a.y);return n(c,d,f-c,p-d,o,h)}},96113(e,t,i){var n=i(91907),r=i(20242),s=i(10095);e.exports=function(e){return e===n.ORTHOGONAL?s:r}},16926(e,t,i){var n=i(91907),r=i(86625),s=i(96897),a=i(29747),o=i(15108),l=i(85896);e.exports=function(e){return e===n.ORTHOGONAL?l:e===n.ISOMETRIC?s:e===n.HEXAGONAL?r:e===n.STAGGERED?o:a}},55762(e,t,i){var n=i(91907),r=i(20242),s=i(51900),a=i(63288);e.exports=function(e){return e===n.ORTHOGONAL?a:e===n.STAGGERED?s:r}},45091(e,t,i){var n=i(62991);e.exports=function(e,t,i){if(n(e,t,i)){var r=i.data[t][e];return null!==r&&r.index>
vendor: 85,871 bytes, line 2
2-1}return!1}},24152(e,t,i){var n=i(45091),r=new(i(26099));e.exports=function(e,t,i,s){s.tilemapLayer.worldToTileXY(e,t,!0,r,i);var a=r.x,o=r.y;return n(a,o,s)}},90454(e,t,i){var n=i(63448),r=i(56583);e.exports=function(e,t){var i,s,a,o,l=e.tilemapLayer.tilemap,h=e.tilemapLayer,u=Math.floor(l.tileWidth*h.scaleX),c=Math.floor(l.tileHeight*h.scaleY),d=e.hexSideLength;if("y"===e.staggerAxis){var f=(c-d)/2+d;i=r(t.worldView.x-h.x,u,0,!0)-h.cullPaddingX,s=n(t.worldView.right-h.x,u,0,!0)+h.cullPaddingX,a=r(t.worldView.y-h.y,f,0,!0)-h.cullPaddingY,o=n(t.worldView.bottom-h.y,f,0,!0)+h.cullPaddingY}else{var p=(u-d)/2+d;i=r(t.worldView.x-h.x,p,0,!0)-h.cullPaddingX,s=n(t.worldView.right-h.x,p,0,!0)+h.cullPaddingX,a=r(t.worldView.y-h.y,c,0,!0)-h.cullPaddingY,o=n(t.worldView.bottom-h.y,c,0,!0)+h.cullPaddingY}return{left:i,right:s,top:a,bottom:o}}},9474(e,t,i){var n=i(90454),r=i(32483);e.exports=function(e,t,i,s){void 0===i&&(i=[]),void 0===s&&(s=0),i.length=0;var a=e.tilemapLayer,o=n(e,t);return a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY&&(o.left=0,o.right=e.width,o.top=0,o.bottom=e.height),r(e,o,s,i),i}},27229(e,t,i){var n=i(19951),r=i(26099),s=new r;e.exports=function(e,t,i,a){var o=a.baseTileWidth,l=a.baseTileHeight,h=a.tilemapLayer;h&&(o*=h.scaleX,l*=h.scaleY);var u,c,d=n(e,t,s,i,a),f=[],p=.5773502691896257;"y"===a.staggerAxis?(u=p*o,c=l/2):(u=o/2,c=p*l);for(var m=0;m<6;m++){var g=2*Math.PI*(.5-m)/6;f.push(new r(d.x+u*Math.cos(g),d.y+c*Math.sin(g)))}return f}},19951(e,t,i){var n=i(26099);e.exports=function(e,t,i,r,s){i||(i=new n);var a=s.baseTileWidth,o=s.baseTileHeight,l=s.tilemapLayer,h=0,u=0;l&&(r||(r=l.scene.cameras.main),h=l.x+r.scrollX*(1-l.scrollFactorX),u=l.y+r.scrollY*(1-l.scrollFactorY),a*=l.scaleX,o*=l.scaleY);var c,d,f=a/2,p=o/2,m=s.staggerAxis,g=s.staggerIndex;return"y"===m?(c=h+a*e+a,d=u+1.5*t*p+p,t%2===0&&("odd"===g?c-=f:c+=f)):"x"===m&&"odd"===g&&(c=h+1.5*e*f+f,d=u+o*e+o,e%2===0&&("odd"===g?d-=p:d+=p)),i.set(c,d)}},86625(e,t,i){var n=i(26099);e.exports=function(e,t,i,r,s,a){r||(r=new n);var o=a.baseTileWidth,l=a.baseTileHeight,h=a.tilemapLayer;h&&(s||(s=h.scene.cameras.main),e-=h.x+s.scrollX*(1-h.scrollFactorX),t-=h.y+s.scrollY*(1-h.scrollFactorY),o*=h.scaleX,l*=h.scaleY);var u,c,d,f,p,m=.5773502691896257,g=-.3333333333333333,v=.6666666666666666,y=o/2,x=l/2;"y"===a.staggerAxis?(d=m*(u=(e-y)/(m*o))+g*(c=(t-x)/x),f=0*u+v*c):(d=g*(u=(e-y)/y)+m*(c=(t-x)/(m*l)),f=v*u+0*c),p=-d-f;var b,w=Math.round(d),T=Math.round(f),_=Math.round(p),S=Math.abs(w-d),E=Math.abs(T-f),C=Math.abs(_-p);S>E&&S>C?w=-T-_:E>C&&(T=-w-_);var A=T;return b="odd"===a.staggerIndex?A%2===0?T/2+w:T/2+w-.5:A%2===0?T/2+w:T/2+w+.5,r.set(b,A)}},62991(e){e.exports=function(e,t,i){return e>=0&&e<i.width&&t>=0&&t<i.height}},14018(e,t,i){var n=i(33528);e.exports=function(e,t,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var s,a,o,l=e.tilemapLayer,h=e.data,u=e.width,c=e.height,d=l.skipCull,f=u,p=c;if(0===r)for(a=0;a<p;a++)for(s=0;s<f;s++)(o=h[a][s])&&-1!==o.index&&o.visible&&0!==o.alpha&&(d||n(s,a,e,t))&&i.push(o);else if(1===r)for(a=0;a<p;a++)for(s=f;s>=0;s--)(o=h[a][s])&&-1!==o.index&&o.visible&&0!==o.alpha&&(d||n(s,a,e,t))&&i.push(o);else if(2===r)for(a=p;a>=0;a--)for(s=0;s<f;s++)(o=h[a][s])&&-1!==o.index&&o.visible&&0!==o.alpha&&(d||n(s,a,e,t))&&i.push(o);else if(3===r)for(a=p;a>=0;a--)for(s=f;s>=0;s--)(o=h[a][s])&&-1!==o.index&&o.visible&&0!==o.alpha&&(d||n(s,a,e,t))&&i.push(o);return l.tilesDrawn=i.length,l.tilesTotal=u*c,i}},14127(e,t,i){var n=i(26099);e.exports=function(e,t,i,r,s){i||(i=new n);var a=s.baseTileWidth,o=s.baseTileHeight,l=s.tilemapLayer,h=0,u=0;l&&(r||(r=l.scene.cameras.main),h=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX,u=l.y+r.scrollY*(1-l.scrollFactorY),o*=l.scaleY);var c=h+a/2*(e-t),d=u+(e+t)*(o/2);return i.set(c,d)}},96897(e,t,i){var n=i(26099);e.exports=function(e,t,i,r,s,a,o){r||(r=new n);var l=a.baseTileWidth,h=a.baseTileHeight,u=a.tilemapLayer;u&&(s||(s=u.scene.cameras.main),t-=u.y+s.scrollY*(1-u.scrollFactorY),h*=u.scaleY,e-=u.x+s.scrollX*(1-u.scrollFactorX),l*=u.scaleX);var c=l/2,d=h/2;o||(t-=h);var f=.5*((e-=c)/c+t/d),p=.5*(-e/c+t/d);return i&&(f=Math.floor(f),p=Math.floor(p)),r.set(f,p)}},71558(e,t,i){var n=i(23029),r=i(62991),s=i(72023),a=i(20576);e.exports=function(e,t,i,o,l){if(void 0===o&&(o=!0),!r(t,i,l))return null;var h,u=l.data[i][t],c=u&&u.collides;e instanceof n?(null===l.data[i][t]&&(l.data[i][t]=new n(l,e.index,t,i,l.tileWidth,l.tileHeight)),l.data[i][t].copy(e)):(h=e,null===l.data[i][t]?l.data[i][t]=new n(l,h,t,i,l.tileWidth,l.tileHeight):l.data[i][t].index=h);var d=l.data[i][t],f=-1!==l.collideIndexes.indexOf(d.index);if(-1===(h=e instanceof n?e.index:e))d.width=l.tileWidth,d.height=l.tileHeight;else{var p=l.tilemapLayer.tilemap,m=p.tiles[h][2],g=p.tilesets[m];d.width=g.tileWidth,d.height=g.tileHeight}return a(d,f),o&&c!==d.collides&&s(t,i,l),d}},26303(e,t,i){var n=i(71558),r=new(i(26099));e.exports=function(e,t,i,s,a,o){return o.tilemapLayer.worldToTileXY(t,i,!0,r,a,o),n(e,r.x,r.y,s,o)}},14051(e,t,i){var n=i(42573),r=i(71558);e.exports=function(e,t,i,s,a){if(void 0===s&&(s=!0),!Array.isArray(e))return null;Array.isArray(e[0])||(e=[e]);for(var o=e.length,l=e[0].length,h=0;h<o;h++)for(var u=0;u<l;u++){var c=e[h][u];r(c,t+u,i+h,!1,a)}s&&n(t-1,i-1,l+2,o+2,a)}},77389(e,t,i){var n=i(7386),r=i(26546);e.exports=function(e,t,i,s,a,o){var l,h=n(e,t,i,s,{},o);if(!a)for(a=[],l=0;l<h.length;l++)-1===a.indexOf(h[l].index)&&a.push(h[l].index);for(l=0;l<h.length;l++)h[l].index=r(a)}},63557(e,t,i){var n=i(23029),r=i(62991),s=i(72023);e.exports=function(e,t,i,a,o){if(void 0===i&&(i=!0),void 0===a&&(a=!0),!r(e,t,o))return null;var l=o.data[t][e];return l?(o.data[t][e]=i?null:new n(o,-1,e,t,o.tileWidth,o.tileHeight),a&&l&&l.collides&&s(e,t,o),l):null}},94178(e,t,i){var n=i(63557),r=new(i(26099));e.exports=function(e,t,i,s,a,o){return o.tilemapLayer.worldToTileXY(e,t,!0,r,a,o),n(r.x,r.y,i,s,o)}},15533(e,t,i){var n=i(7386),r=i(3956),s=new r(105,210,231,150),a=new r(243,134,48,200),o=new r(40,39,37,150);e.exports=function(e,t,i){void 0===t&&(t={});var r=void 0!==t.tileColor?t.tileColor:s,l=void 0!==t.collidingTileColor?t.collidingTileColor:a,h=void 0!==t.faceColor?t.faceColor:o,u=n(0,0,i.width,i.height,null,i);e.translateCanvas(i.tilemapLayer.x,i.tilemapLayer.y),e.scaleCanvas(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var c=0;c<u.length;c++){var d=u[c],f=d.tileset?d.tileset.tileOffset:{x:0,y:0},p=d.width,m=d.height,g=d.pixelX-f.x,v=d.pixelY-f.y,y=d.collides?l:r;null!==y&&(e.fillStyle(y.color,y.alpha/255),e.fillRect(g,v,p,m)),g+=1,v+=1,p-=2,m-=2,null!==h&&(e.lineStyle(1,h.color,h.alpha/255),d.faceTop&&e.lineBetween(g,v,g+p,v),d.faceRight&&e.lineBetween(g+p,v,g+p,v+m),d.faceBottom&&e.lineBetween(g,v+m,g+p,v+m),d.faceLeft&&e.lineBetween(g,v,g,v+m))}}},27987(e,t,i){var n=i(7386);e.exports=function(e,t,i,r,s,a,o){for(var l=n(i,r,s,a,null,o),h=0;h<l.length;h++)l[h]&&l[h].index===e&&(l[h].index=t)}},32483(e){e.exports=function(e,t,i,n){var r,s,a,o=e.data,l=e.width,h=e.height,u=e.tilemapLayer,c=Math.max(0,t.left),d=Math.min(l,t.right),f=Math.max(0,t.top),p=Math.min(h,t.bottom);if(0===i)for(s=f;s<p;s++)for(r=c;o[s]&&r<d;r++)(a=o[s][r])&&-1!==a.index&&a.visible&&0!==a.alpha&&n.push(a);else if(1===i)for(s=f;s<p;s++)for(r=d;o[s]&&r>=c;r--)(a=o[s][r])&&-1!==a.index&&a.visible&&0!==a.alpha&&n.push(a);else if(2===i)for(s=p;s>=f;s--)for(r=c;o[s]&&r<d;r++)(a=o[s][r])&&-1!==a.index&&a.visible&&0!==a.alpha&&n.push(a);else if(3===i)for(s=p;s>=f;s--)for(r=d;o[s]&&r>=c;r--)(a=o[s][r])&&-1!==a.index&&a.visible&&0!==a.alpha&&n.push(a);return u.tilesDrawn=n.length,u.tilesTotal=l*h,n}},57068(e,t,i){var n=i(20576),r=i(42573),s=i(9589);e.exports=function(e,t,i,a,o){void 0===t&&(t=!0),void 0===i&&(i=!0),void 0===o&&(o=!0),Array.isArray(e)||(e=[e]);for(var l=0;l<e.length;l++)s(e[l],t,a);if(o)for(var h=0;h<a.height;h++)for(var u=0;u<a.width;u++){var c=a.data[h][u];c&&-1!==e.indexOf(c.index)&&n(c,t)}i&&r(0,0,a.width,a.height,a)}},37266(e,t,i){var n=i(20576),r=i(42573),s=i(9589);e.exports=function(e,t,i,a,o,l){if(void 0===i&&(i=!0),void 0===a&&(a=!0),void 0===l&&(l=!0),!(e>t)){for(var h=e;h<=t;h++)s(h,i,o);if(l)for(var u=0;u<o.height;u++)for(var c=0;c<o.width;c++){var d=o.data[u][c];d&&d.index>=e&&d.index<=t&&n(d,i)}a&&r(0,0,o.width,o.height,o)}}},75661(e,t,i){var n=i(20576),r=i(42573),s=i(9589);e.exports=function(e,t,i,a){void 0===t&&(t=!0),void 0===i&&(i=!0),Array.isArray(e)||(e=[e]);for(var o=0;o<a.height;o++)for(var l=0;l<a.width;l++){var h=a.data[o][l];h&&-1===e.indexOf(h.index)&&(n(h,t),s(h.index,t,a))}i&&r(0,0,a.width,a.height,a)}},64740(e,t,i){var n=i(20576),r=i(42573),s=i(97022);e.exports=function(e,t,i,a){void 0===t&&(t=!0),void 0===i&&(i=!0);for(var o=0;o<a.height;o++)for(var l=0;l<a.width;l++){var h=a.data[o][l];if(h)for(var u in e)if(s(h.properties,u)){var c=e[u];Array.isArray(c)||(c=[c]);for(var d=0;d<c.length;d++)h.properties[u]===c[d]&&n(h,t)}}i&&r(0,0,a.width,a.height,a)}},63307(e,t,i){var n=i(20576),r=i(42573);e.exports=function(e,t,i){void 0===e&&(e=!0),void 0===t&&(t=!0);for(var s=0;s<i.height;s++)for(var a=0;a<i.width;a++){var o=i.data[s][a];if(o){var l=o.getCollisionGroup();l&&l.objects&&l.objects.length>0&&n(o,e)}}t&&r(0,0,i.width,i.height,i)}},9589(e){e.exports=function(e,t,i){var n=i.collideIndexes.indexOf(e);t&&-1===n?i.collideIndexes.push(e):t||-1===n||i.collideIndexes.splice(n,1)}},20576(e){e.exports=function(e,t){t?e.setCollision(!0,!0,!0,!0,!1):e.resetCollision(!1)}},79583(e){e.exports=function(e,t,i,n){if("number"===typeof e)n.callbacks[e]=null!==t?{callback:t,callbackContext:i}:void 0;else for(var r=0,s=e.length;r<s;r++)n.callbacks[e[r]]=null!==t?{callback:t,callbackContext:i}:void 0}},93254(e,t,i){var n=i(7386);e.exports=function(e,t,i,r,s,a,o){for(var l=n(e,t,i,r,null,o),h=0;h<l.length;h++)l[h].setCollisionCallback(s,a)}},32903(e,t,i){var n=i(7386),r=i(33680);e.exports=function(e,t,i,s,a){var o=n(e,t,i,s,null,a),l=o.map(function(e){return e.index});r(l);for(var h=0;h<o.length;h++)o[h].index=l[h]}},61325(e,t,i){var n=i(63448),r=i(56583);e.exports=function(e,t){var i=e.tilemapLayer.tilemap,s=e.tilemapLayer,a=Math.floor(i.tileWidth*s.scaleX),o=Math.floor(i.tileHeight*s.scaleY);return{left:r(t.worldView.x-s.x,a,0,!0)-s.cullPaddingX,right:n(t.worldView.right-s.x,a,0,!0)+s.cullPaddingX,top:r(t.worldView.y-s.y,o/2,0,!0)-s.cullPaddingY,bottom:n(t.worldView.bottom-s.y,o/2,0,!0)+s.cullPaddingY}}},54503(e,t,i){var n=i(61325),r=i(32483);e.exports=function(e,t,i,s){void 0===i&&(i=[]),void 0===s&&(s=0),i.length=0;var a=e.tilemapLayer,o=n(e,t);return a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY&&(o.left=0,o.right=e.width,o.top=0,o.bottom=e.height),r(e,o,s,i),i}},97202(e,t,i){var n=i(26099);e.exports=function(e,t,i,r,s){i||(i=new n);var a=s.baseTileWidth,o=s.baseTileHeight,l=s.tilemapLayer,h=0,u=0;l&&(r||(r=l.scene.cameras.main),h=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX,u=l.y+r.scrollY*(1-l.scrollFactorY),o*=l.scaleY);var c=h+e*a+t%2*(a/2),d=u+t*(o/2);return i.set(c,d)}},28054(e){e.exports=function(e,t,i){var n=i.baseTileHeight,r=i.tilemapLayer,s=0;return r&&(void 0===t&&(t=r.scene.cameras.main),s=r.y+t.scrollY*(1-r.scrollFactorY),n*=r.scaleY),s+e*(n/2)+n}},15108(e,t,i){var n=i(26099);e.exports=function(e,t,i,r,s,a){r||(r=new n);var o=a.baseTileWidth,l=a.baseTileHeight,h=a.tilemapLayer;h&&(s||(s=h.scene.cameras.main),t-=h.y+s.scrollY*(1-h.scrollFactorY),l*=h.scaleY,e-=h.x+s.scrollX*(1-h.scrollFactorX),o*=h.scaleX);var u=i?Math.floor(t/(l/2)):t/(l/2),c=i?Math.floor((e+u%2*.5*o)/o):(e+u%2*.5*o)/o;return r.set(c,u)}},51900(e){e.exports=function(e,t,i,n){var r=n.baseTileHeight,s=n.tilemapLayer;return s&&(i||(i=s.scene.cameras.main),e-=s.y+i.scrollY*(1-s.scrollFactorY),r*=s.scaleY),t?Math.floor(e/(r/2)):e/(r/2)}},86560(e,t,i){var n=i(7386);e.exports=function(e,t,i,r,s,a,o){for(var l=n(i,r,s,a,null,o),h=0;h<l.length;h++)l[h]&&(l[h].index===e?l[h].index=t:l[h].index===t&&(l[h].index=e))}},97281(e){e.exports=function(e,t,i){var n=i.baseTileWidth,r=i.tilemapLayer,s=0;return r&&(t||(t=r.scene.cameras.main),s=r.x+t.scrollX*(1-r.scrollFactorX),n*=r.scaleX),s+e*n}},70326(e,t,i){var n=i(97281),r=i(29650),s=i(26099);e.exports=function(e,t,i,a,o){return i||(i=new s(0,0)),i.x=n(e,a,o),i.y=r(t,a,o),i}},29650(e){e.exports=function(e,t,i){var n=i.baseTileHeight,r=i.tilemapLayer,s=0;return r&&(t||(t=r.scene.cameras.main),s=r.y+t.scrollY*(1-r.scrollFactorY),n*=r.scaleY),s+e*n}},77366(e,t,i){var n=i(7386),r=i(75508);e.exports=function(e,t,i,s,a,o){if(a){var l,h=n(e,t,i,s,null,o),u=0;for(l=0;l<a.length;l++)u+=a[l].weight;if(!(u<=0))for(l=0;l<h.length;l++){for(var c=r.RND.frac()*u,d=0,f=-1,p=0;p<a.length;p++)if(c<=(d+=a[p].weight)){var m=a[p].index;f=Array.isArray(m)?m[Math.floor(r.RND.frac()*m.length)]:m;break}h[l].index=f}}}},10095(e,t,i){var n=i(85896),r=new(i(26099));e.exports=function(e,t,i,s){return n(e,0,t,r,i,s),r.x}},85896(e,t,i){var n=i(26099);e.exports=function(e,t,i,r,s,a){void 0===i&&(i=!0),r||(r=new n);var o=a.baseTileWidth,l=a.baseTileHeight,h=a.tilemapLayer;h&&(s||(s=h.scene.cameras.main),e-=h.x+s.scrollX*(1-h.scrollFactorX),t-=h.y+s.scrollY*(1-h.scrollFactorY),o*=h.scaleX,l*=h.scaleY);var u=e/o,c=t/l;return i&&(u=Math.floor(u),c=Math.floor(c)),r.set(u,c)}},63288(e,t,i){var n=i(85896),r=new(i(26099));e.exports=function(e,t,i,s){return n(0,e,t,r,i,s),r.y}},81086(e,t,i){e.exports={CalculateFacesAt:i(72023),CalculateFacesWithin:i(42573),CheckIsoBounds:i(33528),Copy:i(1785),CreateFromTiles:i(78419),CullBounds:i(19545),CullTiles:i(30003),Fill:i(35137),FilterTiles:i(40253),FindByIndex:i(52692),FindTile:i(66151),ForEachTile:i(97560),GetCullTilesFunction:i(43305),GetTileAt:i(7423),GetTileAtWorldXY:i(60540),GetTileCorners:i(55826),GetTileCornersFunction:i(11758),GetTilesWithin:i(7386),GetTilesWithinShape:i(91141),GetTilesWithinWorldXY:i(96523),GetTileToWorldXFunction:i(39167),GetTileToWorldXYFunction:i(62e3),GetTileToWorldYFunction:i(5984),GetWorldToTileXFunction:i(96113),GetWorldToTileXYFunction:i(16926),GetWorldToTileYFunction:i(55762),HasTileAt:i(45091),HasTileAtWorldXY:i(24152),HexagonalCullBounds:i(90454),HexagonalCullTiles:i(9474),HexagonalGetTileCorners:i(27229),HexagonalTileToWorldXY:i(19951),HexagonalWorldToTileXY:i(86625),IsInLayerBounds:i(62991),IsometricCullTiles:i(14018),IsometricTileToWorldXY:i(14127),IsometricWorldToTileXY:i(96897),PutTileAt:i(71558),PutTileAtWorldXY:i(26303),PutTilesAt:i(14051),Randomize:i(77389),RemoveTileAt:i(63557),RemoveTileAtWorldXY:i(94178),RenderDebug:i(15533),ReplaceByIndex:i(27987),RunCull:i(32483),SetCollision:i(57068),SetCollisionBetween:i(37266),SetCollisionByExclusion:i(75661),SetCollisionByProperty:i(64740),SetCollisionFromCollisionGroup:i(63307),SetLayerCollisionIndex:i(9589),SetTileCollision:i(20576),SetTileIndexCallback:i(79583),SetTileLocationCallback:i(93254),Shuffle:i(32903),StaggeredCullBounds:i(61325),StaggeredCullTiles:i(54503),StaggeredTileToWorldXY:i(97202),StaggeredTileToWorldY:i(28054),StaggeredWorldToTileXY:i(15108),StaggeredWorldToTileY:i(51900),SwapByIndex:i(86560),TileToWorldX:i(97281),TileToWorldXY:i(70326),TileToWorldY:i(29650),WeightedRandomize:i(77366),WorldToTileX:i(10095),WorldToTileXY:i(85896),WorldToTileY:i(63288)}},91907(e){e.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},21829(e,t,i){var n={ORIENTATION:i(91907)};e.exports=n},62501(e,t,i){var n=i(79291),r=i(21829),s={Components:i(81086),Parsers:i(57442),Formats:i(80341),ImageCollection:i(16536),ParseToTilemap:i(31989),Tile:i(23029),Tilemap:i(49075),TilemapCreator:i(45939),TilemapFactory:i(46029),Tileset:i(33629),TilemapLayerBase:i(44731),TilemapLayer:i(20442),TilemapGPULayer:i(53180),Orientation:i(91907),LayerData:i(14977),MapData:i(87010),ObjectLayer:i(48700)};s=n(!1,s,r.ORIENTATION),e.exports=s},14977(e,t,i){var n=i(83419),r=i(91907),s=i(95540),a=new n({initialize:function(e){void 0===e&&(e={}),this.name=s(e,"name","layer"),this.id=s(e,"id",0),this.x=s(e,"x",0),this.y=s(e,"y",0),this.width=s(e,"width",0),this.height=s(e,"height",0),this.tileWidth=s(e,"tileWidth",0),this.tileHeight=s(e,"tileHeight",0),this.baseTileWidth=s(e,"baseTileWidth",this.tileWidth),this.baseTileHeight=s(e,"baseTileHeight",this.tileHeight),this.orientation=s(e,"orientation",r.ORTHOGONAL),this.widthInPixels=s(e,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=s(e,"heightInPixels",this.height*this.baseTileHeight),this.alpha=s(e,"alpha",1),this.visible=s(e,"visible",!0),this.properties=s(e,"properties",[]),this.indexes=s(e,"indexes",[]),this.collideIndexes=s(e,"collideIndexes",[]),this.callbacks=s(e,"callbacks",[]),this.bodies=s(e,"bodies",[]),this.data=s(e,"data",[]),this.tilemapLayer=s(e,"tilemapLayer",null),this.hexSideLength=s(e,"hexSideLength",0),this.staggerAxis=s(e,"staggerAxis","y"),this.staggerIndex=s(e,"staggerIndex","odd")}});e.exports=a},87010(e,t,i){var n=i(83419),r=i(91907),s=i(95540),a=new n({initialize:function(e){void 0===e&&(e={}),this.name=s(e,"name","map"),this.width=s(e,"width",0),this.height=s(e,"height",0),this.infinite=s(e,"infinite",!1),this.tileWidth=s(e,"tileWidth",0),this.tileHeight=s(e,"tileHeight",0),this.widthInPixels=s(e,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=s(e,"heightInPixels",this.height*this.tileHeight),this.format=s(e,"format",null),this.orientation=s(e,"orientation",r.ORTHOGONAL),this.renderOrder=s(e,"renderOrder","right-down"),this.version=s(e,"version","1"),this.properties=s(e,"properties",{}),this.layers=s(e,"layers",[]),this.images=s(e,"images",[]),this.objects=s(e,"objects",[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=s(e,"collision",{}),this.tilesets=s(e,"tilesets",[]),this.imageCollections=s(e,"imageCollections",[]),this.tiles=s(e,"tiles",[]),this.hexSideLength=s(e,"hexSideLength",0),this.staggerAxis=s(e,"staggerAxis","y"),this.staggerIndex=s(e,"staggerIndex","odd")}});e.exports=a},48700(e,t,i){var n=i(83419),r=i(95540),s=new n({initialize:function(e){void 0===e&&(e={}),this.name=r(e,"name","object layer"),this.id=r(e,"id",0),this.opacity=r(e,"opacity",1),this.properties=r(e,"properties",{}),this.propertyTypes=r(e,"propertytypes",{}),this.type=r(e,"type","objectgroup"),this.visible=r(e,"visible",!0),this.objects=r(e,"objects",[]),Array.isArray(this.objects)||(this.objects=[])}});e.exports=s},6641(e,t,i){var n=i(91907);e.exports=function(e){return"isometric"===(e=e.toLowerCase())?n.ISOMETRIC:"staggered"===e?n.STAGGERED:"hexagonal"===e?n.HEXAGONAL:n.ORTHOGONAL}},46177(e,t,i){var n=i(80341),r=i(2342),s=i(82593),a=i(46594),o=i(87021);e.exports=function(e,t,i,l,h,u){var c;switch(t){case n.ARRAY_2D:c=r(e,i,l,h,u);break;case n.CSV:c=s(e,i,l,h,u);break;case n.TILED_JSON:c=a(e,i,u);break;case n.WELTMEISTER:c=o(e,i,u);break;default:console.warn("Unrecognized tilemap data format: "+t),c=null}return c}},2342(e,t,i){var n=i(80341),r=i(14977),s=i(87010),a=i(23029);e.exports=function(e,t,i,o,l){for(var h=new r({tileWidth:i,tileHeight:o}),u=new s({name:e,tileWidth:i,tileHeight:o,format:n.ARRAY_2D,layers:[h]}),c=[],d=t.length,f=0,p=0;p<t.length;p++){c[p]=[];for(var m=t[p],g=0;g<m.length;g++){var v=parseInt(m[g],10);isNaN(v)||-1===v?c[p][g]=l?null:new a(h,-1,g,p,i,o):c[p][g]=new a(h,v,g,p,i,o)}0===f&&(f=m.length)}return u.width=h.width=f,u.height=h.height=d,u.widthInPixels=h.widthInPixels=f*i,u.heightInPixels=h.heightInPixels=d*o,h.data=c,u}},82593(e,t,i){var n=i(80341),r=i(2342);e.exports=function(e,t,i,s,a){var o=t.trim().split("\n").map(function(e){return e.split(",")}),l=r(e,o,i,s,a);return l.format=n.CSV,l}},6656(e,t,i){var n=i(14977),r=i(23029);e.exports=function(e,t){for(var i=[],s=0;s<e.layer.length;s++){for(var a=e.layer[s],o=new n({name:a.name,width:a.width,height:a.height,tileWidth:a.tilesize,tileHeight:a.tilesize,visible:1===a.visible}),l=[],h=[],u=0;u<a.data.length;u++){for(var c=0;c<a.data[u].length;c++){var d,f=a.data[u][c]-1;d=f>-1?new r(o,f,c,u,a.tilesize,a.tilesize):t?null:new r(o,-1,c,u,a.tilesize,a.tilesize),l.push(d)}h.push(l),l=[]}o.data=h,i.push(o)}return i}},96483(e,t,i){var n=i(33629);e.exports=function(e){for(var t=[],i=[],r=0;r<e.layer.length;r++){var s=e.layer[r],a=s.tilesetName;""!==a&&-1===i.indexOf(a)&&(i.push(a),t.push(new n(a,0,s.tilesize,s.tilesize,0,0)))}return t}},87021(e,t,i){var n=i(80341),r=i(87010),s=i(6656),a=i(96483);e.exports=function(e,t,i){if(0===t.layer.length)return console.warn("No layers found in the Weltmeister map: "+e),null;for(var o=0,l=0,h=0;h<t.layer.length;h++)t.layer[h].width>o&&(o=t.layer[h].width),t.layer[h].height>l&&(l=t.layer[h].height);var u=new r({width:o,height:l,name:e,tileWidth:t.layer[0].tilesize,tileHeight:t.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=s(t,i),u.tilesets=a(t),u}},52833(e,t,i){e.exports={ParseTileLayers:i(6656),ParseTilesets:i(96483),ParseWeltmeister:i(87021)}},57442(e,t,i){e.exports={FromOrientationString:i(6641),Parse:i(46177),Parse2DArray:i(2342),ParseCSV:i(82593),Impact:i(52833),Tiled:i(96761)}},51233(e,t,i){var n=i(79291);e.exports=function(e){for(var t,i,r,s,a,o=0;o<e.layers.length;o++){t=e.layers[o],s=null;for(var l=0;l<t.data.length;l++){a=t.data[l];for(var h=0;h<a.length;h++)null===(i=a[h])||i.index<0||(r=e.tiles[i.index][2],s=e.tilesets[r],i.width=s.tileWidth,i.height=s.tileHeight,s.tileProperties&&s.tileProperties[i.index-s.firstgid]&&(i.properties=n(i.properties,s.tileProperties[i.index-s.firstgid])))}}}},41868(e){e.exports=function(e){for(var t=window.atob(e),i=t.length,n=new Array(i/4),r=0;r<i;r+=4)n[r/4]=(t.charCodeAt(r)|t.charCodeAt(r+1)<<8|t.charCodeAt(r+2)<<16|t.charCodeAt(r+3)<<24)>>>0;return n}},84101(e,t,i){var n=i(33629);e.exports=function(e){var t,i,r=[];for(t=0;t<e.imageCollections.length;t++)for(var s=e.imageCollections[t].images,a=0;a<s.length;a++){var o=s[a],l={x:0,y:o.height-e.tileHeight};(i=new n(o.image,o.gid,o.width,o.height,0,0,void 0,void 0,l)).updateTileData(o.width,o.height),e.tilesets.push(i)}for(t=0;t<e.tilesets.length;t++)for(var h=(i=e.tilesets[t]).tileMargin,u=i.tileMargin,c=0,d=0,f=0,p=i.firstgid;p<i.firstgid+i.total&&(r[p]=[h,u,t],h+=i.tileWidth+i.tileSpacing,++c!==i.total)&&(++d!==i.columns||(h=i.tileMargin,u+=i.tileHeight+i.tileSpacing,d=0,++f!==i.rows));p++);return r}},79677(e,t,i){var n=i(95540);e.exports=function(e,t,i){if(!t)return{i:0,layers:e.layers,name:"",opacity:1,visible:!0,x:0,y:0};var r=t.x+n(t,"startx",0)*e.tilewidth+n(t,"offsetx",0),s=t.y+n(t,"starty",0)*e.tileheight+n(t,"offsety",0);return{i:0,layers:t.layers,name:i.name+t.name+"/",opacity:i.opacity*t.opacity,visible:i.visible&&t.visible,x:i.x+r,y:i.y+s}}},29920(e){var t=2147483648,i=1073741824,n=536870912;e.exports=function(e){var r=Boolean(e&t),s=Boolean(e&i),a=Boolean(e&n);e&=536870911;var o=0,l=!1;return r&&s&&a?(o=Math.PI/2,l=!0):r&&s&&!a?(o=Math.PI,l=!1):r&&!s&&a?(o=Math.PI/2,l=!1):!r||s||a?!r&&s&&a?(o=3*Math.PI/2,l=!1):r||!s||a?r||s||!a?r||s||a||(o=0,l=!1):(o=3*Math.PI/2,l=!0):(o=Math.PI,l=!0):(o=0,l=!0),{gid:e,flippedHorizontal:r,flippedVertical:s,flippedAntiDiagonal:a,rotation:o,flipped:l}}},12635(e,t,i){var n=i(95540),r=i(79677);e.exports=function(e){for(var t=[],i=[],s=r(e);s.i<s.layers.length||i.length>0;)if(s.i>=s.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}s=i.pop()}else{var a=s.layers[s.i];if(s.i++,"imagelayer"===a.type){var o=n(a,"offsetx",0)+n(a,"startx",0),l=n(a,"offsety",0)+n(a,"starty",0);t.push({name:s.name+a.name,image:a.image,x:s.x+o+a.x,y:s.y+l+a.y,alpha:s.opacity*a.opacity,visible:s.visible&&a.visible,properties:n(a,"properties",{})})}else if("group"===a.type){var h=r(e,a,s);i.push(s),s=h}}return t}},46594(e,t,i){var n=i(51233),r=i(84101),s=i(91907),a=i(62644),o=i(80341),l=i(6641),h=i(87010),u=i(12635),c=i(22611),d=i(28200),f=i(24619);e.exports=function(e,t,i){var p=a(t),m=new h({width:p.width,height:p.height,name:e,tileWidth:p.tilewidth,tileHeight:p.tileheight,orientation:l(p.orientation),format:o.TILED_JSON,version:p.version,properties:p.properties,renderOrder:p.renderorder,infinite:p.infinite});if(m.orientation===s.HEXAGONAL)if(m.hexSideLength=p.hexsidelength,m.staggerAxis=p.staggeraxis,m.staggerIndex=p.staggerindex,"y"===m.staggerAxis){var g=(m.tileHeight-m.hexSideLength)/2;m.widthInPixels=m.tileWidth*(m.width+.5),m.heightInPixels=m.height*(m.hexSideLength+g)+g}else{var v=(m.tileWidth-m.hexSideLength)/2;m.widthInPixels=m.width*(m.hexSideLength+v)+v,m.heightInPixels=m.tileHeight*(m.height+.5)}m.layers=d(p,i),m.images=u(p);var y=f(p);return m.tilesets=y.tilesets,m.imageCollections=y.imageCollections,m.objects=c(p),m.tiles=r(m),n(m),m}},52205(e,t,i){var n=i(18254),r=i(29920),s=function(e){return{x:e.x,y:e.y}},a=["id","name","type","rotation","properties","visible","x","y","width","height"];e.exports=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=0);var o=n(e,a);if(o.x+=t,o.y+=i,e.gid){var l=r(e.gid);o.gid=l.gid,o.flippedHorizontal=l.flippedHorizontal,o.flippedVertical=l.flippedVertical,o.flippedAntiDiagonal=l.flippedAntiDiagonal}else e.polyline?o.polyline=e.polyline.map(s):e.polygon?o.polygon=e.polygon.map(s):e.ellipse?o.ellipse=e.ellipse:e.text?o.text=e.text:e.point?o.point=!0:o.rectangle=!0;return o}},22611(e,t,i){var n=i(95540),r=i(52205),s=i(48700),a=i(79677);e.exports=function(e){for(var t=[],i=[],o=a(e);o.i<o.layers.length||i.length>0;)if(o.i>=o.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}o=i.pop()}else{var l=o.layers[o.i];if(o.i++,l.opacity*=o.opacity,l.visible=o.visible&&l.visible,"objectgroup"===l.type){l.name=o.name+l.name;for(var h=o.x+n(l,"startx",0)+n(l,"offsetx",0),u=o.y+n(l,"starty",0)+n(l,"offsety",0),c=[],d=0;d<l.objects.length;d++){var f=r(l.objects[d],h,u);c.push(f)}var p=new s(l);p.objects=c,t.push(p)}else if("group"===l.type){var m=a(e,l,o);i.push(o),o=m}}return t}},28200(e,t,i){var n=i(41868),r=i(91907),s=i(79677),a=i(6641),o=i(95540),l=i(14977),h=i(29920),u=i(23029);e.exports=function(e,t){for(var i=o(e,"infinite",!1),c=[],d=[],f=s(e);f.i<f.layers.length||d.length>0;)if(f.i>=f.layers.length){if(d.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}f=d.pop()}else{var p=f.layers[f.i];if(f.i++,"tilelayer"===p.type)if(p.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+p.name+"'");else{if(p.encoding&&"base64"===p.encoding){if(p.chunks)for(var m=0;m<p.chunks.length;m++)p.chunks[m].data=n(p.chunks[m].data);p.data&&(p.data=n(p.data)),delete p.encoding}var g,v,y,x,b,w,T=[],_=0;if(i){var S=o(p,"startx",0)+p.x,E=o(p,"starty",0)+p.y;(g=new l({name:f.name+p.name,id:p.id,x:f.x+o(p,"offsetx",0)+S*e.tilewidth,y:f.y+o(p,"offsety",0)+E*e.tileheight,width:p.width,height:p.height,tileWidth:e.tilewidth,tileHeight:e.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:o(p,"properties",[]),orientation:a(e.orientation)})).orientation===r.HEXAGONAL&&(g.hexSideLength=e.hexsidelength,g.staggerAxis=e.staggeraxis,g.staggerIndex=e.staggerindex,"y"===g.staggerAxis?(b=(g.tileHeight-g.hexSideLength)/2,g.widthInPixels=g.tileWidth*(g.width+.5),g.heightInPixels=g.height*(g.hexSideLength+b)+b):(w=(g.tileWidth-g.hexSideLength)/2,g.widthInPixels=g.width*(g.hexSideLength+w)+w,g.heightInPixels=g.tileHeight*(g.height+.5)));for(var C=0;C<p.height;C++){T[C]=[null];for(var A=0;A<p.width;A++)T[C][A]=null}for(C=0,B=p.chunks.length;C<B;C++)for(var k=p.chunks[C],R=k.x-S,O=k.y-E,P=0,M=0,N=k.data.length;M<N;M++){var I=_+R,L=P+O;(v=h(k.data[M])).gid>0?((y=new u(g,v.gid,I,L,e.tilewidth,e.tileheight)).rotation=v.rotation,y.flipX=v.flipped,T[L][I]=y):(x=t?null:new u(g,-1,I,L,e.tilewidth,e.tileheight),T[L][I]=x),++_===k.width&&(P++,_=0)}}else{(g=new l({name:f.name+p.name,id:p.id,x:f.x+o(p,"offsetx",0)+p.x,y:f.y+o(p,"offsety",0)+p.y,width:p.width,height:p.height,tileWidth:e.tilewidth,tileHeight:e.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:o(p,"properties",[]),orientation:a(e.orientation)})).orientation===r.HEXAGONAL&&(g.hexSideLength=e.hexsidelength,g.staggerAxis=e.staggeraxis,g.staggerIndex=e.staggerindex,"y"===g.staggerAxis?(b=(g.tileHeight-g.hexSideLength)/2,g.widthInPixels=g.tileWidth*(g.width+.5),g.heightInPixels=g.height*(g.hexSideLength+b)+b):(w=(g.tileWidth-g.hexSideLength)/2,g.widthInPixels=g.width*(g.hexSideLength+w)+w,g.heightInPixels=g.tileHeight*(g.height+.5)));for(var D=[],F=0,B=p.data.length;F<B;F++)(v=h(p.data[F])).gid>0?((y=new u(g,v.gid,_,T.length,e.tilewidth,e.tileheight)).rotation=v.rotation,y.flipX=v.flipped,D.push(y)):(x=t?null:new u(g,-1,_,T.length,e.tilewidth,e.tileheight),D.push(x)),++_===p.width&&(T.push(D),_=0,D=[])}g.data=T,c.push(g)}else if("group"===p.type){var U=s(e,p,f);d.push(f),f=U}}return c}},24619(e,t,i){var n=i(33629),r=i(16536),s=i(52205),a=i(57880);e.exports=function(e){for(var t,i=[],o=[],l=null,h=0;h<e.tilesets.length;h++){var u=e.tilesets[h];if(u.source)console.warn("External tilesets unsupported. Use Embed Tileset and re-export");else if(u.image){var c=new n(u.name,u.firstgid,u.tilewidth,u.tileheight,u.margin,u.spacing,void 0,void 0,u.tileoffset);if(e.version>1){var d=void 0,f=void 0;if(Array.isArray(u.tiles)){d=d||{},f=f||{};for(var p=0;p<u.tiles.length;p++){var m=u.tiles[p];if(m.properties){var g={};m.properties.forEach(function(e){g[e.name]=e.value}),f[m.id]=g}if(m.objectgroup&&((d[m.id]||(d[m.id]={})).objectgroup=m.objectgroup,m.objectgroup.objects)){var v=m.objectgroup.objects.map(function(e){return s(e)});d[m.id].objectgroup.objects=v}m.animation&&((d[m.id]||(d[m.id]={})).animation=m.animation),m.type&&((d[m.id]||(d[m.id]={})).type=m.type)}for(var y in d){var x=d[y].animation;if(x){for(var b=0,w=0;w<x.length;w++)x[w].startTime=b,b+=x[w].duration;d[y].animationDuration=b}}}Array.isArray(u.wangsets)&&(d=d||{},f=f||{},a(u.wangsets,d)),d&&(c.tileData=d,c.tileProperties=f)}else if(u.tileproperties&&(c.tileProperties=u.tileproperties),u.tiles)for(t in c.tileData=u.tiles,c.tileData){var T=c.tileData[t].objectgroup;if(T&&T.objects){var _=T.objects.map(function(e){return s(e)});c.tileData[t].objectgroup.objects=_}}c.updateTileData(u.imagewidth,u.imageheight),i.push(c)}else{var S=new r(u.name,u.firstgid,u.tilewidth,u.tileheight,u.margin,u.spacing,u.properties),E=0;for(p=0;p<u.tiles.length;p++){var C=(m=u.tiles[p]).image,A=parseInt(m.id,10),k=u.firstgid+A,R=m.imagewidth,O=m.imageheight;S.addImage(k,C,R,O),E=Math.max(A,E)}S.maxId=E,o.push(S)}l&&(l.lastgid=u.firstgid-1),l=u}return{tilesets:i,imageCollections:o}}},57880(e){e.exports=function(e,t){for(var i=0;i<e.length;i++){var n=e[i],r=i;if(n.name&&""!==n.name&&(r=n.name),Array.isArray(n.wangtiles)&&n.wangtiles.length>0){var s,a,o,l={},h={};if(Array.isArray(n.edgecolors))for(s=0;s<n.edgecolors.length;s++)o=1+s,""!==(a=n.edgecolors[s]).name&&(l[o]=a.name);if(Array.isArray(n.cornercolors))for(s=0;s<n.cornercolors.length;s++)o=1+s,""!==(a=n.cornercolors[s]).name&&(h[o]=a.name);if(Array.isArray(n.colors))for(s=0;s<n.colors.length;s++)o=1+s,""!==(a=n.colors[s]).name&&(l[o]=h[o]=a.name);for(var u=[l,h,l,h,l,h,l,h],c=0;c<n.wangtiles.length;c++){var d=n.wangtiles[c],f=t[d.tileid]||(t[d.tileid]={});f=f.wangid||(f.wangid={});for(var p=[],m=0;m<Math.min(u.length,d.wangid.length);m++)if(0!==(a=d.wangid[m])){var g=u[m][a];void 0===g?p.push(a):p.push(g)}else p.push(void 0);f[r]=p}}}}},96761(e,t,i){e.exports={AssignTileProperties:i(51233),Base64Decode:i(41868),BuildTilesetIndex:i(84101),CreateGroupLayer:i(79677),ParseGID:i(29920),ParseImageLayers:i(12635),ParseJSONTiled:i(46594),ParseObject:i(52205),ParseObjectLayers:i(22611),ParseTileLayers:i(28200),ParseTilesets:i(24619)}},33385(e,t,i){var n=i(83419),r=i(37277),s=i(44594),a=i(94880),o=i(72905),l=new n({initialize:function(e){this.scene=e,this.systems=e.sys,this.now=0,this.startTime=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],e.sys.events.once(s.BOOT,this.boot,this),e.sys.events.on(s.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(s.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var e=this.systems.events;e.on(s.PRE_UPDATE,this.preUpdate,this),e.on(s.UPDATE,this.update,this),e.once(s.SHUTDOWN,this.shutdown,this)},addEvent:function(e){var t;if(e instanceof a){if(t=e,this.removeEvent(t),t.elapsed=t.startAt,t.hasDispatched=!1,t.repeatCount=-1===t.repeat||t.loop?999999999999:t.repeat,t.delay<=0&&t.repeatCount>0)throw new Error("TimerEvent infinite loop created via zero delay")}else t=new a(e);return this._pendingInsertion.push(t),t},delayedCall:function(e,t,i,n){return this.addEvent({delay:e,callback:t,args:i,callbackScope:n})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(e){Array.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++){var i=e[t];o(this._pendingRemoval,i),o(this._pendingInsertion,i),o(this._active,i)}return this},removeAllEvents:function(){return this._pendingRemoval=this._pendingRemoval.concat(this._active),this},preUpdate:function(){var e=this._pendingRemoval.length,t=this._pendingInsertion.length;if(0!==e||0!==t){var i,n;for(i=0;i<e;i++){n=this._pendingRemoval[i];var r=this._active.indexOf(n);r>-1&&this._active.splice(r,1),n.destroy()}for(i=0;i<t;i++)n=this._pendingInsertion[i],this._active.push(n);this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(e,t){if(this.now=e,!this.paused){t*=this.timeScale;for(var i=0;i<this._active.length;i++){var n=this._active[i];if(!n.paused&&(n.elapsed+=t*n.timeScale,n.elapsed>=n.delay)){var r=n.elapsed-n.delay;if(n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0){if(n.repeatCount--,r>=n.delay)for(;r>=n.delay&&n.repeatCount>0;)n.callback&&n.callback.apply(n.callbackScope,n.args),r-=n.delay,n.repeatCount--;n.elapsed=r,n.hasDispatched=!1}else n.hasDispatched&&this._pendingRemoval.push(n)}}}},shutdown:function(){var e;for(e=0;e<this._pendingInsertion.length;e++)this._pendingInsertion[e].destroy();for(e=0;e<this._active.length;e++)this._active[e].destroy();for(e=0;e<this._pendingRemoval.length;e++)this._pendingRemoval[e].destroy();this._active.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;var t=this.systems.events;t.off(s.PRE_UPDATE,this.preUpdate,this),t.off(s.UPDATE,this.update,this),t.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(s.START,this.start,this),this.scene=null,this.systems=null}});r.register("Clock",l,"time"),e.exports=l},96120(e,t,i){var n=i(83419),r=i(50792),s=i(39429),a=i(95540),o=i(44594),l=i(89809),h=new n({Extends:r,initialize:function(e,t){r.call(this),this.scene=e,this.systems=e.sys,this.elapsed=0,this.timeScale=1,this.paused=!0,this.complete=!1,this.totalComplete=0,this.loop=0,this.iteration=0,this.events=[];var i=this.systems.events;i.on(o.PRE_UPDATE,this.preUpdate,this),i.on(o.UPDATE,this.update,this),i.once(o.SHUTDOWN,this.destroy,this),t&&this.add(t)},preUpdate:function(e,t){this.paused||(this.elapsed+=t*this.timeScale)},update:function(){if(!this.paused&&!this.complete){var e,t,i=this.events,n=!1,r=this.systems;for(e=0;e<i.length;e++){var s=i[e];if(!s.complete&&s.time<=this.elapsed){if(s.complete=!0,this.totalComplete++,t=s.target?s.target:this,s.if&&!s.if.call(t,s))continue;if(s.once&&(n=!0),s.set&&s.target)for(var a in s.set)s.target[a]=s.set[a];this.iteration&&s.repeat++,s.loop&&s.repeat&&s.loop.call(t),s.tween&&(s.tweenInstance=r.tweens.add(s.tween)),s.sound&&("string"===typeof s.sound?r.sound.play(s.sound):r.sound.play(s.sound.key,s.sound.config)),s.event&&this.emit(s.event,t),s.run&&s.run.call(t),s.stop&&this.stop()}}if(n)for(e=0;e<i.length;e++)i[e].complete&&i[e].once&&(i.splice(e,1),e--);var o=0;for(e=0;e<i.length;e++)i[e].complete||o++;0===o&&(i.length>0||this.totalComplete>0)&&(0!==this.loop&&(-1===this.loop||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(l.COMPLETE,this)}},play:function(e){return void 0===e&&(e=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,e&&this.reset(),this},pause:function(){this.paused=!0;for(var e=this.events,t=0;t<e.length;t++){var i=e[t];i.tweenInstance&&(i.tweenInstance.paused=!0)}return this},repeat:function(e){return void 0!==e&&!0!==e||(e=-1),!1===e&&(e=0),this.loop=e,this},resume:function(){this.paused=!1;for(var e=this.events,t=0;t<e.length;t++){var i=e[t];i.tweenInstance&&(i.tweenInstance.paused=!1)}return this},stop:function(){return this.paused=!0,this.complete=!0,this},reset:function(e){void 0===e&&(e=!1),this.elapsed=0,e||(this.iteration=0);for(var t=this.events,i=0;i<t.length;i++){var n=t[i];n.complete=!1,e||(n.repeat=0),n.tweenInstance&&n.tweenInstance.stop()}return this.play(!1)},add:function(e){Array.isArray(e)||(e=[e]);var t=this.events,i=0;t.length>0&&(i=t[t.length-1].time);for(var n=0;n<e.length;n++){var r=e[n],s=a(r,"at",0),o=a(r,"in",null);null!==o&&(s=this.elapsed+o);var l=a(r,"from",null);null!==l&&(s=i+l),t.push({complete:!1,time:s,repeat:0,if:a(r,"if",null),run:a(r,"run",null),loop:a(r,"loop",null),event:a(r,"event",null),target:a(r,"target",null),set:a(r,"set",null),tween:a(r,"tween",null),sound:a(r,"sound",null),once:a(r,"once",!1),stop:a(r,"stop",!1)}),i=s}return this.complete=!1,this},clear:function(){for(var e=this.events,t=0;t<e.length;t++){var i=e[t];i.tweenInstance&&i.tweenInstance.stop()}return e.length=0,this.elapsed=0,this.paused=!0,this},isPlaying:function(){return!this.paused&&!this.complete},getProgress:function(){return Math.min(this.totalComplete,this.events.length)/this.events.length},destroy:function(){var e=this.systems.events;e.off(o.PRE_UPDATE,this.preUpdate,this),e.off(o.UPDATE,this.update,this),e.off(o.SHUTDOWN,this.destroy,this),this.clear(),this.scene=null,this.systems=null}});s.register("timeline",function(e){return new h(this.scene,e)}),e.exports=h},94880(e,t,i){var n=i(83419),r=i(95540),s=new n({initialize:function(e){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(e)},reset:function(e){if(this.delay=r(e,"delay",0),this.repeat=r(e,"repeat",0),this.loop=r(e,"loop",!1),this.callback=r(e,"callback",void 0),this.callbackScope=r(e,"callbackScope",this),this.args=r(e,"args",[]),this.timeScale=r(e,"timeScale",1),this.startAt=r(e,"startAt",0),this.paused=r(e,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this.delay<=0&&this.repeatCount>0)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 e=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/e}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(e){void 0===e&&(e=!1),this.elapsed=this.delay,this.hasDispatched=!e,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});e.exports=s},35945(e){e.exports="complete"},89809(e,t,i){e.exports={COMPLETE:i(35945)}},90291(e,t,i){e.exports={Clock:i(33385),Events:i(89809),Timeline:i(96120),TimerEvent:i(94880)}},40382(e,t,i){var n=i(72905),r=i(83419),s=i(43491),a=i(88032),o=i(37277),l=i(44594),h=i(93109),u=i(8462),c=i(8357),d=i(43960),f=i(26012),p=new r({initialize:function(e){this.scene=e,this.events=e.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(l.BOOT,this.boot,this),this.events.on(l.START,this.start,this)},boot:function(){this.events.once(l.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(l.UPDATE,this.update,this),this.events.once(l.SHUTDOWN,this.shutdown,this)},create:function(e){Array.isArray(e)||(e=[e]);for(var t=[],i=0;i<e.length;i++){var n=e[i];n instanceof u||n instanceof d?t.push(n):Array.isArray(n.tweens)?t.push(f(this,n)):t.push(c(this,n))}return 1===t.length?t[0]:t},add:function(e){var t=e,i=this.tweens;return t instanceof u||t instanceof d||(t=Array.isArray(t.tweens)?f(this,t):c(this,t)),i.push(t.reset()),t},addMultiple:function(e){for(var t,i=[],n=this.tweens,r=0;r<e.length;r++)(t=e[r])instanceof u||t instanceof d||(t=Array.isArray(t.tweens)?f(this,t):c(this,t)),n.push(t.reset()),i.push(t);return i},chain:function(e){var t=f(this,e);return this.tweens.push(t.init()),t},getChainedTweens:function(e){return e.getChainedTweens()},has:function(e){return this.tweens.indexOf(e)>-1},existing:function(e){return this.has(e)||this.tweens.push(e.reset()),this},addCounter:function(e){var t=a(this,e);return this.tweens.push(t.reset()),t},stagger:function(e,t){return h(e,t)},setLagSmooth:function(e,t){return void 0===e&&(e=1/1e-8),void 0===t&&(t=0),this.maxLag=e,this.lagSkip=Math.min(t,this.maxLag),this},setFps:function(e){return void 0===e&&(e=240),this.gap=1e3/e,this.nextTime=1e3*this.time+this.gap,this},getDelta:function(e){var t=Date.now()-this.prevTime;t>this.maxLag&&(this.startTime+=t-this.lagSkip),this.prevTime+=t;var i=this.prevTime-this.startTime,n=i-this.nextTime,r=i-1e3*this.time;return n>0||e?(i/=1e3,this.time=i,this.nextTime+=n+(n>=this.gap?4:this.gap-n)):r=0,r},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(e){void 0===e&&(e=!1);var t=this.getDelta(e);if(!(t<=0)){var i,n;this.processing=!0;var r=[],s=this.tweens;for(i=0;i<s.length;i++)(n=s[i]).update(t)&&r.push(n);var a=r.length;if(a&&s.length>0){for(i=0;i<a;i++){n=r[i];var o=s.indexOf(n);o>-1&&(n.isPendingRemove()||n.isDestroyed())&&(s.splice(o,1),n.destroy())}r.length=0}this.processing=!1}},remove:function(e){return this.processing?e.setPendingRemoveState():(n(this.tweens,e),e.setRemovedState()),this},reset:function(e){return this.existing(e),e.seek(),e.setActiveState(),this},makeActive:function(e){return this.existing(e),e.setActiveState(),this},each:function(e,t){var i,n=[null];for(i=1;i<arguments.length;i++)n.push(arguments[i]);return this.tweens.forEach(function(i){n[0]=i,e.apply(t,n)}),this},getTweens:function(){return this.tweens.slice()},getTweensOf:function(e){for(var t=[],i=this.tweens,n=(e=Array.isArray(e)?s(e):[e]).length,r=0;r<i.length;r++)for(var a=i[r],o=0;o<n;o++)!a.isDestroyed()&&a.hasTarget(e[o])&&t.push(a);return t},getGlobalTimeScale:function(){return this.timeScale},setGlobalTimeScale:function(e){return this.timeScale=e,this},isTweening:function(e){for(var t,i=this.tweens,n=0;n<i.length;n++)if((t=i[n]).isPlaying()&&t.hasTarget(e))return!0;return!1},killAll:function(){for(var e=this.processing?this.getTweens():this.tweens,t=0;t<e.length;t++)e[t].destroy();return this.processing||(e.length=0),this},killTweensOf:function(e){for(var t=this.getTweensOf(e),i=0;i<t.length;i++)t[i].destroy();return this},pauseAll:function(){return this.paused=!0,this},resumeAll:function(){return this.paused=!1,this},shutdown:function(){this.killAll(),this.tweens=[],this.events.off(l.UPDATE,this.update,this),this.events.off(l.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(l.START,this.start,this),this.scene=null,this.events=null}});o.register("TweenManager",p,"tweens"),e.exports=p},57355(e){e.exports=function(e,t,i){return e&&e.hasOwnProperty(t)?e[t]:i}},6113(e,t,i){var n=i(62640),r=i(35355);e.exports=function(e,t){var i=n.Power0;if("string"===typeof e)if(n.hasOwnProperty(e))i=n[e];else{var s="";if(e.indexOf(".")){var a=(s=e.substring(e.indexOf(".")+1)).toLowerCase();"in"===a?s="easeIn":"out"===a?s="easeOut":"inout"===a&&(s="easeInOut")}e=r(e.substring(0,e.indexOf(".")+1)+s),n.hasOwnProperty(e)&&(i=n[e])}else"function"===typeof e&&(i=e);if(!t)return i;var o=t.slice(0);return o.unshift(0),function(e){return o[0]=e,i.apply(this,o)}}},91389(e,t,i){var n=i(89318),r=i(77259),s={bezier:n,catmull:r,catmullrom:r,linear:i(28392)};e.exports=function(e){if(null===e)return null;var t=s.linear;return"string"===typeof e?s.hasOwnProperty(e)&&(t=s[e]):"function"===typeof e&&(t=e),t}},55292(e){e.exports=function(e,t,i){var n;e.hasOwnProperty(t)?n="function"===typeof e[t]?function(i,n,r,s,a,o){return e[t](i,n,r,s,a,o)}:function(){return e[t]}:n="function"===typeof i?i:function(){return i};return n}},82985(e,t,i){var n=i(81076);e.exports=function(e){var t,i=[];if(e.hasOwnProperty("props"))for(t in e.props)"_"!==t.substring(0,1)&&i.push({key:t,value:e.props[t]});else for(t in e)-1===n.indexOf(t)&&"_"!==t.substring(0,1)&&i.push({key:t,value:e[t]});return i}},62329(e,t,i){var n=i(35154);e.exports=function(e){var t=n(e,"targets",null);return null===t||("function"===typeof t&&(t=t.call()),Array.isArray(t)||(t=[t])),t}},17777(e,t,i){var n=i(30976),r=i(99472);function s(e){return!!e.getActive&&"function"===typeof e.getActive}function a(e){return!!e.getStart&&"function"===typeof e.getStart}function o(e){return!!e.getEnd&&"function"===typeof e.getEnd}var l=function(e,t){var i,h,u=function(e,t,i){return i},c=function(e,t,i){return i},d=null,f=typeof t;if("number"===f)u=function(){return t};else if(Array.isArray(t))c=function(){return t[0]},u=function(){return t[t.length-1]};else if("string"===f){var p=t.toLowerCase(),m="random"===p.substring(0,6),g="int"===p.substring(0,3);if(m||g){var v=p.indexOf("("),y=p.indexOf(")"),x=p.indexOf(",");if(!(v&&y&&x))throw new Error("invalid random() format");var b=parseFloat(p.substring(v+1,x)),w=parseFloat(p.substring(x+1,y));u=m?function(){return r(b,w)}:function(){return n(b,w)}}else{p=p[0];var T=parseFloat(t.substr(2));switch(p){case"+":u=function(e,t,i){return i+T};break;case"-":u=function(e,t,i){return i-T};break;case"*":u=function(e,t,i){return i*T};break;case"/":u=function(e,t,i){return i/T};break;default:u=function(){return parseFloat(t)}}}}else if("function"===f)u=t;else if("object"===f)if(a(h=t)||o(h)||s(h))s(t)&&(d=t.getActive),o(t)&&(u=t.getEnd),a(t)&&(c=t.getStart);else if(t.hasOwnProperty("value"))i=l(e,t.value);else{var _=t.hasOwnProperty("to"),S=t.hasOwnProperty("from"),E=t.hasOwnProperty("start");if(_&&(S||E)){if(i=l(e,t.to),E){var C=l(e,t.start);i.getActive=C.getEnd}if(S){var A=l(e,t.from);i.getStart=A.getEnd}}}return i||(i={getActive:d,getEnd:u,getStart:c}),i};e.exports=l},88032(e,t,i){var n=i(70402),r=i(69902),s=i(23568),a=i(57355),o=i(6113),l=i(95540),h=i(55292),u=i(35154),c=i(17777),d=i(269),f=i(8462);e.exports=function(e,t,i){if(t instanceof f)return t.parent=e,t;i=void 0===i?r:d(r,i);var p=l(t,"from",0),m=l(t,"to",1),g=[{value:p}],v=l(t,"delay",i.delay),y=l(t,"easeParams",i.easeParams),x=l(t,"ease",i.ease),b=c("value",m),w=new f(e,g),T=w.add(0,"value",b.getEnd,b.getStart,b.getActive,o(l(t,"ease",x),l(t,"easeParams",y)),h(t,"delay",v),l(t,"duration",i.duration),a(t,"yoyo",i.yoyo),l(t,"hold",i.hold),l(t,"repeat",i.repeat),l(t,"repeatDelay",i.repeatDelay),!1,!1);T.start=p,T.current=p,w.completeDelay=s(t,"completeDelay",0),w.loop=Math.round(s(t,"loop",0)),w.loopDelay=Math.round(s(t,"loopDelay",0)),w.paused=a(t,"paused",!1),w.persist=a(t,"persist",!1),w.isNumberTween=!0,w.callbackScope=u(t,"callbackScope",w);for(var _=n.TYPES,S=0;S<_.length;S++){var E=_[S],C=u(t,E,!1);if(C){var A=u(t,E+"Params",[]);w.setCallback(E,C,A)}}return w}},93109(e,t,i){var n=i(6113),r=i(35154),s=i(36383);e.exports=function(e,t){var i;void 0===t&&(t={});var a=r(t,"start",0),o=r(t,"ease",null),l=r(t,"grid",null),h=r(t,"from",0),u="first"===h,c="center"===h,d="last"===h,f="number"===typeof h,p=Array.isArray(e),m=p?parseFloat(e[0]):parseFloat(e),g=p?parseFloat(e[1]):0,v=Math.max(m,g);if(p&&(a+=m),l){var y=l[0],x=l[1],b=0,w=0,T=0,_=0,S=[];d?(b=y-1,w=x-1):f?(b=h%y,w=Math.floor(h/y)):c&&(b=(y-1)/2,w=(x-1)/2);for(var E=s.MIN_SAFE_INTEGER,C=0;C<x;C++){S[C]=[];for(var A=0;A<y;A++){T=b-A,_=w-C;var k=Math.sqrt(T*T+_*_);k>E&&(E=k),S[C][A]=k}}}var R=o?n(o):null;return i=l?function(e,t,i,n){var r,s=0,o=n%y,l=Math.floor(n/y);if(o>=0&&o<y&&l>=0&&l<x&&(s=S[l][o]),p){var h=g-m;r=R?s/E*h*R(s/E):s/E*h}else r=R?s*m*R(s/E):s*m;return r+a}:function(e,t,i,n,r){var s,o,l;(r--,u?s=n:c?s=Math.abs(r/2-n):d?s=r-n:f&&(s=Math.abs(h-n)),p)?(l=c?(g-m)/r*(2*s):(g-m)/r*s,o=R?l*R(s/r):l):o=R?r*v*R(s/r):s*m;return o+a},i}},8357(e,t,i){var n=i(70402),r=i(69902),s=i(23568),a=i(57355),o=i(6113),l=i(95540),h=i(91389),u=i(55292),c=i(82985),d=i(62329),f=i(35154),p=i(17777),m=i(269),g=i(8462);e.exports=function(e,t,i){if(t instanceof g)return t.parent=e,t;i=void 0===i?r:m(r,i);var v=d(t);!v&&i.targets&&(v=i.targets);for(var y=c(t),x=l(t,"delay",i.delay),b=l(t,"duration",i.duration),w=l(t,"easeParams",i.easeParams),T=l(t,"ease",i.ease),_=l(t,"hold",i.hold),S=l(t,"repeat",i.repeat),E=l(t,"repeatDelay",i.repeatDelay),C=a(t,"yoyo",i.yoyo),A=a(t,"flipX",i.flipX),k=a(t,"flipY",i.flipY),R=l(t,"interpolation",i.interpolation),O=function(e,t,i,n){if("texture"===i){var r=n,s=void 0;Array.isArray(n)?(r=n[0],s=n[1]):n.hasOwnProperty("value")?(r=n.value,Array.isArray(n.value)?(r=n.value[0],s=n.value[1]):"string"===typeof n.value&&(r=n.value)):"string"===typeof n&&(r=n),e.addFrame(t,r,s,u(n,"delay",x),l(n,"duration",b),l(n,"hold",_),l(n,"repeat",S),l(n,"repeatDelay",E),a(n,"flipX",A),a(n,"flipY",k))}else{var c=p(i,n),d=h(l(n,"interpolation",R));e.add(t,i,c.getEnd,c.getStart,c.getActive,o(l(n,"ease",T),l(n,"easeParams",w)),u(n,"delay",x),l(n,"duration",b),a(n,"yoyo",C),l(n,"hold",_),l(n,"repeat",S),l(n,"repeatDelay",E),a(n,"flipX",A),a(n,"flipY",k),d,d?n:null)}},P=new g(e,v),M=0;M<y.length;M++)for(var N=y[M].key,I=y[M].value,L=0;L<v.length;L++){v[L]&&("scale"!==N||v[L].hasOwnProperty("scale")?O(P,L,N,I):(O(P,L,"scaleX",I),O(P,L,"scaleY",I)))}P.completeDelay=s(t,"completeDelay",0),P.loop=Math.round(s(t,"loop",0)),P.loopDelay=Math.round(s(t,"loopDelay",0)),P.paused=a(t,"paused",!1),P.persist=a(t,"persist",!1),P.callbackScope=l(t,"callbackScope",P);for(var D=n.TYPES,F=0;F<D.length;F++){var B=D[F],U=f(t,B,!1);if(U){var z=f(t,B+"Params",[]);P.setCallback(B,U,z)}}return P}},26012(e,t,i){var n=i(70402),r=i(23568),s=i(57355),a=i(62329),o=i(35154),l=i(8357),h=i(43960);e.exports=function(e,t){if(t instanceof h)return t.parent=e,t;var i,u=new h(e);u.startDelay=o(t,"delay",0),u.completeDelay=r(t,"completeDelay",0),u.loop=Math.round(r(t,"loop",o(t,"repeat",0))),u.loopDelay=Math.round(r(t,"loopDelay",o(t,"repeatDelay",0))),u.paused=s(t,"paused",!1),u.persist=s(t,"persist",!1),u.callbackScope=o(t,"callbackScope",u);var c=n.TYPES;for(i=0;i<c.length;i++){var d=c[i],f=o(t,d,!1);if(f){var p=o(t,d+"Params",[]);u.setCallback(d,f,p)}}var m=o(t,"tweens",null);if(Array.isArray(m)){var g=[],v=a(t),y=void 0;for(v&&(y={targets:v}),i=0;i<m.length;i++)g.push(l(u,m[i],y));u.add(g)}return u}},30231(e,t,i){e.exports={GetBoolean:i(57355),GetEaseFunction:i(6113),GetInterpolationFunction:i(91389),GetNewValue:i(55292),GetProps:i(82985),GetTargets:i(62329),GetValueOp:i(17777),NumberTweenBuilder:i(88032),StaggerBuilder:i(93109),TweenBuilder:i(8357)}},73685(e){e.exports="active"},98540(e){e.exports="complete"},67233(e){e.exports="loop"},2859(e){e.exports="pause"},98336(e){e.exports="repeat"},25764(e){e.exports="resume"},32193(e){e.exports="start"},84371(e){e.exports="stop"},70766(e){e.exports="update"},55659(e){e.exports="yoyo"},842(e,t,i){e.exports={TWEEN_ACTIVE:i(73685),TWEEN_COMPLETE:i(98540),TWEEN_LOOP:i(67233),TWEEN_PAUSE:i(2859),TWEEN_RESUME:i(25764),TWEEN_REPEAT:i(98336),TWEEN_START:i(32193),TWEEN_STOP:i(84371),TWEEN_UPDATE:i(70766),TWEEN_YOYO:i(55659)}},43066(e,t,i){var n={States:i(86353),Builders:i(30231),Events:i(842),TweenManager:i(40382),Tween:i(8462),TweenData:i(48177),TweenFrameData:i(42220),BaseTween:i(70402),TweenChain:i(43960)};e.exports=n},70402(e,t,i){var n=i(83419),r=i(50792),s=i(842),a=i(86353),o=new n({Extends:r,initialize:function(e){r.call(this),this.parent=e,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(e){return this.timeScale=e,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(s.TWEEN_PAUSE,"onPause")),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(s.TWEEN_RESUME,"onResume")),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(s.TWEEN_ACTIVE,"onActive")},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(s.TWEEN_COMPLETE,"onComplete")},complete:function(e){return void 0===e&&(e=0),e?(this.setCompleteDelayState(),this.countdown=e):this.onCompleteHandler(),this},completeAfterLoop:function(e){return void 0===e&&(e=0),this.loopCounter>e&&(this.loopCounter=e),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return!this.parent||this.isRemoved()||this.isPendingRemove()||this.isDestroyed()||(this.dispatchEvent(s.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(e){this.countdown-=e,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(s.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(e){return this.startDelay-=e,this.startDelay<=0&&(this.setActiveState(),this.hasStarted=!0,this.dispatchEvent(s.TWEEN_START,"onStart"),e=0),e},updateCompleteDelay:function(e){this.countdown-=e,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(e,t,i){return void 0===i&&(i=[]),this.callbacks.hasOwnProperty(e)&&(this.callbacks[e]={func:t,params:i}),this},setPendingState:function(){this.state=a.PENDING},setActiveState:function(){this.state=a.ACTIVE,this.hasStarted=!1},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(e){e.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});o.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],e.exports=o},95042(e,t,i){var n=i(83419),r=i(842),s=i(86353),a=new n({initialize:function(e,t,i,n,r,s,a,o,l,h){this.tween=e,this.targetIndex=t,this.duration=n<=0?.01:n,this.totalDuration=0,this.delay=0,this.getDelay=i,this.yoyo=r,this.hold=s,this.repeat=a,this.repeatDelay=o,this.repeatCounter=0,this.flipX=l,this.flipY=h,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},getTarget:function(){return this.tween.targets[this.targetIndex]},setTargetValue:function(e){void 0===e&&(e=this.current),this.tween.targets[this.targetIndex][this.key]=e},setCreatedState:function(){this.state=s.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=s.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=s.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=s.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=s.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=s.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=s.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=s.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===s.CREATED},isDelayed:function(){return this.state===s.DELAY},isPendingRender:function(){return this.state===s.PENDING_RENDER},isPlayingForward:function(){return this.state===s.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===s.PLAYING_BACKWARD},isHolding:function(){return this.state===s.HOLD_DELAY},isRepeating:function(){return this.state===s.REPEAT_DELAY},isComplete:function(){return this.state===s.COMPLETE},setStateFromEnd:function(e){this.yoyo?this.onRepeat(e,!0,!0):this.repeatCounter>0?this.onRepeat(e,!0,!1):this.setCompleteState()},setStateFromStart:function(e){this.repeatCounter>0?this.onRepeat(e,!1):this.setCompleteState()},reset:function(){var e=this.tween,t=e.totalTargets,i=this.targetIndex,n=e.targets[i],r=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(n,r,0,i,t,e),this.repeatCounter=-1===this.repeat?s.MAX:this.repeat,this.setPendingRenderState();var a=this.duration+this.hold;this.yoyo&&(a+=this.duration);var o=a+this.repeatDelay;this.totalDuration=this.delay+a,-1===this.repeat?(this.totalDuration+=o*s.MAX,e.isInfinite=!0):this.repeat>0&&(this.totalDuration+=o*this.repeat),this.totalDuration>e.duration&&(e.duration=this.totalDuration),this.delay<e.startDelay&&(e.startDelay=this.delay),this.delay>0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(e,t,i){var n=this.tween,s=n.totalTargets,a=this.targetIndex,o=n.targets[a],l=this.key,h="texture"!==l;if(this.elapsed=e,this.progress=e/this.duration,this.flipX&&o.toggleFlipX(),this.flipY&&o.toggleFlipY(),h&&(t||i)&&(this.start=this.getStartValue(o,l,this.start,a,s,n)),i)return this.setPlayingBackwardState(),void this.dispatchEvent(r.TWEEN_YOYO,"onYoyo");this.repeatCounter--,h&&(this.end=this.getEndValue(o,l,this.start,a,s,n)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-e,h&&(this.current=this.start,o[l]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});e.exports=a},69902(e){e.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null}},81076(e){e.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"]},8462(e,t,i){var n=i(70402),r=i(83419),s=i(842),a=i(44603),o=i(39429),l=i(36383),h=i(86353),u=i(48177),c=i(42220),d=new r({Extends:n,initialize:function(e,t){n.call(this,e),this.targets=t,this.totalTargets=t.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,this.isNumberTween=!1},add:function(e,t,i,n,r,s,a,o,l,h,c,d,f,p,m,g){var v=new u(this,e,t,i,n,r,s,a,o,l,h,c,d,f,p,m,g);return this.totalData=this.data.push(v),v},addFrame:function(e,t,i,n,r,s,a,o,l,h){var u=new c(this,e,t,i,n,r,s,a,o,l,h);return this.totalData=this.data.push(u),u},getValue:function(e){void 0===e&&(e=0);var t=null;return this.data&&(t=this.data[e].current),t},hasTarget:function(e){return this.targets&&-1!==this.targets.indexOf(e)},updateTo:function(e,t,i){if(void 0===i&&(i=!1),"texture"!==e)for(var n=0;n<this.totalData;n++){var r=this.data[n];r.key===e&&(r.isPlayingForward()||r.isPlayingBackward())&&(r.end=t,i&&(r.start=r.current))}return this},restart:function(){switch(this.state){case h.REMOVED:case h.FINISHED:this.seek(),this.parent.makeActive(this);break;case h.PENDING:case h.PENDING_REMOVE:this.parent.reset(this);break;case h.DESTROYED:console.warn("Cannot restart destroyed Tween",this);break;default:this.seek()}return this.paused=!1,this.hasStarted=!1,this},nextState:function(){if(this.loopCounter>0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(s.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,n.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(e,t,i){if(void 0===e&&(e=0),void 0===t&&(t=16.6),void 0===i&&(i=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;i||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(s.TWEEN_ACTIVE,"onActive");var n=this.paused;if(this.paused=!1,e>0){for(var r=Math.floor(e/t),a=e-r*t,o=0;o<r;o++)this.update(t);a>0&&this.update(a)}return this.paused=n,this.isSeeking=!1,this},initTweenData:function(e){void 0===e&&(e=!1),this.duration=0,this.startDelay=l.MAX_SAFE_INTEGER;for(var t=this.data,i=0;i<this.totalData;i++)t[i].reset(e);this.duration=Math.max(this.duration,.01);var n=this.duration,r=this.completeDelay,s=this.loopCounter,a=this.loopDelay;this.totalDuration=s>0?n+r+(n+a)*s:n+r},reset:function(e){return void 0===e&&(e=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,-1===this.loop&&(this.isInfinite=!0,this.loopCounter=h.MAX),e||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(s.TWEEN_ACTIVE,"onActive")),this},update:function(e){if(this.isPendingRemove()||this.isDestroyed())return!this.persist||(this.setFinishedState(),!1);if(this.paused||this.isFinished())return!1;if(e*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(e),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(e),!1;this.hasStarted||(e=this.updateStartCountdown(e));var t=!1;if(this.isActive())for(var i=this.data,n=0;n<this.totalData;n++)i[n].update(e)&&(t=!0);this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),t||this.nextState();var r=this.isPendingRemove();return r&&this.persist&&(this.setFinishedState(),r=!1),r},forward:function(e){return this.update(e),this},rewind:function(e){return this.update(-e),this},dispatchEvent:function(e,t){if(!this.isSeeking){if(this.emit(e,this,this.targets),!this.callbacks)return;var i=this.callbacks[t];i&&i.func.apply(this.callbackScope,[this,this.targets].concat(i.params))}},destroy:function(){n.prototype.destroy.call(this),this.targets=null}});o.register("tween",function(e){return this.scene.sys.tweens.add(e)}),a.register("tween",function(e){return this.scene.sys.tweens.create(e)}),e.exports=d},43960(e,t,i){var n=i(72905),r=i(70402),s=i(83419),a=i(842),o=i(44603),l=i(39429),h=i(86353),u=new s({Extends:r,initialize:function(e){r.call(this,e),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=-1===this.loop?h.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this},add:function(e){var t=this.parent.create(e);Array.isArray(t)||(t=[t]);for(var i=this.data,n=0;n<t.length;n++){var r=t[n];r.parent=this,i.push(r.reset())}return this.totalData=i.length,this},remove:function(e){return n(this.data,e),e.setRemovedState(),e===this.currentTween&&this.nextTween(),this.totalData=this.data.length,this},hasTarget:function(e){for(var t=this.data,i=0;i<this.totalData;i++)if(t[i].hasTarget(e))return!0;return!1},restart:function(){return this.isDestroyed()?(console.warn("Cannot restart destroyed TweenChain",this),this):(this.isRemoved()&&this.parent.makeActive(this),this.resetTweens(),this.paused=!1,this.init())},reset:function(e){return e.seek(),e.setActiveState(),this},makeActive:function(e){return e.reset(),e.setActiveState(),this},nextState:function(){if(this.loopCounter>0)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))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var e=this.data,t=this.totalData,i=0;i<t;i++)e[i].reset(!1);this.setCurrentTween(0)},update:function(e){if(this.isPendingRemove()||this.isDestroyed())return!this.persist||(this.setFinishedState(),!1);if(this.isFinished()||this.paused)return!1;if(e*=this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(e),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(e),!1;this.hasStarted||(e=this.updateStartCountdown(e));var t=!1;return this.isActive()&&this.currentTween&&(this.currentTween.update(e)&&this.nextTween()&&this.nextState(),(t=this.isPendingRemove())&&this.persist&&(this.setFinishedState(),t=!1)),t},nextTween:function(){return this.currentIndex++,this.currentIndex===this.totalData||(this.setCurrentTween(this.currentIndex),!1)},setCurrentTween:function(e){this.currentIndex=e,this.currentTween=this.data[e],this.currentTween.setActiveState()},dispatchEvent:function(e,t){this.emit(e,this);var i=this.callbacks[t];i&&i.func.apply(this.callbackScope,[this].concat(i.params))},destroy:function(){r.prototype.destroy.call(this),this.currentTween=null}});l.register("tweenchain",function(e){return this.scene.sys.tweens.chain(e)}),o.register("tweenchain",function(e){return this.scene.sys.tweens.create(e)}),e.exports=u},48177(e,t,i){var n=i(95042),r=i(45319),s=i(83419),a=i(842),o=new s({Extends:n,initialize:function(e,t,i,r,s,a,o,l,h,u,c,d,f,p,m,g,v){n.call(this,e,t,l,h,u,c,d,f,p,m),this.key=i,this.getActiveValue=a,this.getEndValue=r,this.getStartValue=s,this.ease=o,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=g,this.interpolationData=v},reset:function(e){n.prototype.reset.call(this);var t=this.tween.targets[this.targetIndex],i=this.key;e&&(t[i]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(t[i]=this.getActiveValue(t,i,0))},update:function(e){var t=this.tween,i=t.totalTargets,n=this.targetIndex,s=t.targets[n],o=this.key;if(!s||s.isDestroyed)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(s,o,s[o],n,i,t),this.end=this.getEndValue(s,o,this.start,n,i,t),this.current=this.start,s[o]=this.start,this.setPlayingForwardState(),!0;var l=this.isPlayingForward(),h=this.isPlayingBackward();if(l||h){var u=this.elapsed,c=this.duration,d=0,f=!1;(u+=e)>=c?(d=u-c,u=c,f=!0):u<0&&(u=0);var p=r(u/c,0,1);this.elapsed=u,this.progress=p,this.previous=this.current,l||(p=1-p);var m=this.ease(p);this.interpolation?this.current=this.interpolation(this.interpolationData,m):this.current=this.start+(this.end-this.start)*m,s[o]=this.current,f&&(l?(t.isNumberTween&&(this.current=this.end,s[o]=this.current),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(d)):(t.isNumberTween&&(this.current=this.start,s[o]=this.current),this.setStateFromStart(d))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(e,t){var i=this.tween;if(!i.isSeeking){var n=i.targets[this.targetIndex],r=this.key,s=this.current,a=this.previous;i.emit(e,i,r,n,s,a);var o=i.callbacks[t];o&&o.func.apply(i.callbackScope,[i,n,r,s,a].concat(o.params))}},destroy:function(){n.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});e.exports=o},42220(e,t,i){var n=i(95042),r=i(45319),s=i(83419),a=i(842),o=new s({Extends:n,initialize:function(e,t,i,r,s,a,o,l,h,u,c){n.call(this,e,t,s,a,!1,o,l,h,u,c),this.key="texture",this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=r,this.yoyo=0!==l},reset:function(e){n.prototype.reset.call(this);var t=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=t.texture.key,this.startFrame=t.frame.name),e&&t.setTexture(this.startTexture,this.startFrame)},update:function(e){var t=this.tween,i=this.targetIndex,n=t.targets[i];if(!n)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&n.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var s=this.isPlayingForward(),o=this.isPlayingBackward();if(s||o){var l=this.elapsed,h=this.duration,u=0,c=!1;(l+=e)>=h?(u=l-h,l=h,c=!0):l<0&&(l=0);var d=r(l/h,0,1);this.elapsed=l,this.progress=d,c&&(s?(n.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(n.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(e,t){var i=this.tween;if(!i.isSeeking){var n=i.targets[this.targetIndex],r=this.key;i.emit(e,i,r,n);var s=i.callbacks[t];s&&s.func.apply(i.callbackScope,[i,n,r].concat(s.params))}},destroy:function(){n.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});e.exports=o},86353(e){e.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},83419(e){function t(e,t,i){var n=i?e[t]:Object.getOwnPropertyDescriptor(e,t);return!i&&n.value&&"object"===typeof n.value&&(n=n.value),!(!n||!function(e){return!!e.get&&"function"===typeof e.get||!!e.set&&"function"===typeof e.set}(n))&&("undefined"===typeof n.enumerable&&(n.enumerable=!0),"undefined"===typeof n.configurable&&(n.configurable=!0),n)}function i(e,t){var i=Object.getOwnPropertyDescriptor(e,t);return!!i&&(i.value&&"object"===typeof i.value&&(i=i.value),!1===i.configurable)}function n(e,n,r,a){for(var o in n)if(n.hasOwnProperty(o)){var l=t(n,o,r);if(!1!==l){if(i((a||e).prototype,o)){if(s.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(e.prototype,o,l)}else e.prototype[o]=n[o]}}function r(e,t){if(t){Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++)n(e,t[i].prototype||t[i])}}function s(e){var t,i;if(e||(e={}),e.initialize){if("function"!==typeof e.initialize)throw new Error("initialize must be a function");t=e.initialize,delete e.initialize}else if(e.Extends){var s=e.Extends;t=function(){s.apply(this,arguments)}}else t=function(){};e.Extends?(t.prototype=Object.create(e.Extends.prototype),t.prototype.constructor=t,i=e.Extends,delete e.Extends):t.prototype.constructor=t;var a=null;return e.Mixins&&(a=e.Mixins,delete e.Mixins),r(t,a),n(t,e,!0,i),t}s.extend=n,s.mixin=r,s.ignoreFinals=!1,e.exports=s},29747(e){e.exports=function(){}},20242(e){e.exports=function(){return null}},71146(e){e.exports=function(e,t,i,n,r){if(void 0===r&&(r=e),i>0){var s=i-e.length;if(s<=0)return null}if(!Array.isArray(t))return-1===e.indexOf(t)?(e.push(t),n&&n.call(r,t),t):null;for(var a=t.length-1;a>=0;)-1!==e.indexOf(t[a])&&t.splice(a,1),a--;if(0===(a=t.length))return null;i>0&&a>s&&(t.splice(s),a=s);for(var o=0;o<a;o++){var l=t[o];e.push(l),n&&n.call(r,l)}return t}},51067(e){e.exports=function(e,t,i,n,r,s){if(void 0===i&&(i=0),void 0===s&&(s=e),n>0){var a=n-e.length;if(a<=0)return null}if(!Array.isArray(t))return-1===e.indexOf(t)?(e.splice(i,0,t),r&&r.call(s,t),t):null;for(var o=t.length-1;o>=0;)-1!==e.indexOf(t[o])&&t.pop(),o--;if(0===(o=t.length))return null;n>0&&o>a&&(t.splice(a),o=a);for(var l=o-1;l>=0;l--){var h=t[l];e.splice(i,0,h),r&&r.call(s,h)}return t}},66905(e){e.exports=function(e,t){var i=e.indexOf(t);return-1!==i&&i<e.length&&(e.splice(i,1),e.push(t)),t}},21612(e,t,i){var n=i(82011);e.exports=function(e,t,i,r,s){void 0===r&&(r=0),void 0===s&&(s=e.length);var a=0;if(n(e,r,s))for(var o=r;o<s;o++){e[o][t]===i&&a++}return a}},95428(e){e.exports=function(e,t,i){var n,r=[null];for(n=3;n<arguments.length;n++)r.push(arguments[n]);for(n=0;n<e.length;n++)r[0]=e[n],t.apply(i,r);return e}},36914(e,t,i){var n=i(82011);e.exports=function(e,t,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=e.length),n(e,r,s)){var a,o=[null];for(a=5;a<arguments.length;a++)o.push(arguments[a]);for(a=r;a<s;a++)o[0]=e[a],t.apply(i,o)}return e}},81957(e){e.exports=function(e,t,i){if(!t.length)return NaN;if(1===t.length)return t[0];var n,r,s=1;if(i){if(e<t[0][i])return t[0];for(;t[s][i]<e;)s++}else for(;t[s]<e;)s++;return s>t.length&&(s=t.length),i?(n=t[s-1][i],(r=t[s][i])-e<=e-n?t[s]:t[s-1]):(n=t[s-1],(r=t[s])-e<=e-n?r:n)}},43491(e){var t=function(e,i){void 0===i&&(i=[]);for(var n=0;n<e.length;n++)Array.isArray(e[n])?t(e[n],i):i.push(e[n]);return i};e.exports=t},46710(e,t,i){var n=i(82011);e.exports=function(e,t,i,r,s){void 0===r&&(r=0),void 0===s&&(s=e.length);var a=[];if(n(e,r,s))for(var o=r;o<s;o++){var l=e[o];(!t||t&&void 0===i&&l.hasOwnProperty(t)||t&&void 0!==i&&l[t]===i)&&a.push(l)}return a}},58731(e,t,i){var n=i(82011);e.exports=function(e,t,i,r,s){var a,o;if(void 0===r&&(r=0),void 0===s&&(s=e.length),-1!==r){if(n(e,r,s))for(a=r;a<s;a++)if(o=e[a],!t||t&&void 0===i&&o.hasOwnProperty(t)||t&&void 0!==i&&o[t]===i)return o}else if(n(e,0,s))for(a=s;a>=0;a--)if(o=e[a],!t||t&&void 0===i&&o.hasOwnProperty(t)||t&&void 0!==i&&o[t]===i)return o;return null}},26546(e){e.exports=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=e.length);var n=t+Math.floor(Math.random()*(i-t));return void 0===e[n]?null:e[n]}},85835(e){e.exports=function(e,t,i){if(t===i)return e;var n=e.indexOf(t),r=e.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n>r||(e.splice(n,1),r=e.indexOf(i),e.splice(r+1,0,t)),e}},83371(e){e.exports=function(e,t,i){if(t===i)return e;var n=e.indexOf(t),r=e.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n<r||(e.splice(n,1),0===r?e.unshift(t):e.splice(r,0,t)),e}},70864(e){e.exports=function(e,t){var i=e.indexOf(t);if(i>0){var n=e[i-1],r=e.indexOf(n);e[i]=n,e[r]=t}return e}},69693(e){e.exports=function(e,t,i){var n=e.indexOf(t);if(-1===n||i<0||i>=e.length)throw new Error("Supplied index out of bounds");return n!==i&&(e.splice(n,1),e.splice(i,0,t)),t}},40853(e){e.exports=function(e,t){var i=e.indexOf(t);if(-1!==i&&i<e.length-1){var n=e[i+1],r=e.indexOf(n);e[i]=n,e[r]=t}return e}},20283(e){e.exports=function(e,t,i,n){var r,s=[],a=!1;if((i||n)&&(a=!0,i||(i=""),n||(n="")),t<e)for(r=e;r>=t;r--)a?s.push(i+r.toString()+n):s.push(r);else for(r=e;r<=t;r++)a?s.push(i+r.toString()+n):s.push(r);return s}},593(e,t,i){var n=i(2284);e.exports=function(e,t,i){void 0===e&&(e=0),void 0===t&&(t=null),void 0===i&&(i=1),null===t&&(t=e,e=0);for(var r=[],s=Math.max(n((t-e)/(i||1)),0),a=0;a<s;a++)r.push(e),e+=i;return r}},43886(e){function t(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function i(e,t){return e<t?-1:e>t?1:0}var n=function(e,r,s,a,o){for(void 0===s&&(s=0),void 0===a&&(a=e.length-1),void 0===o&&(o=i);a>s;){if(a-s>600){var l=a-s+1,h=r-s+1,u=Math.log(l),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(l-c)/l)*(h-l/2<0?-1:1),f=Math.max(s,Math.floor(r-h*c/l+d)),p=Math.min(a,Math.floor(r+(l-h)*c/l+d));n(e,r,f,p,o)}var m=e[r],g=s,v=a;for(t(e,s,r),o(e[a],m)>0&&t(e,s,a);g<v;){for(t(e,g,v),g++,v--;o(e[g],m)<0;)g++;for(;o(e[v],m)>0;)v--}0===o(e[s],m)?t(e,s,v):t(e,++v,a),v<=r&&(s=v+1),r<=v&&(a=v-1)}};e.exports=n},88492(e,t,i){var n=i(35154),r=i(33680),s=function(e,t,i){for(var n=[],r=0;r<e.length;r++)for(var s=0;s<t.length;s++)for(var a=0;a<i;a++)n.push({a:e[r],b:t[s]});return n};e.exports=function(e,t,i){var a=n(i,"max",0),o=n(i,"qty",1),l=n(i,"random",!1),h=n(i,"randomB",!1),u=n(i,"repeat",0),c=n(i,"yoyo",!1),d=[];if(h&&r(t),-1===u)if(0===a)u=0;else{var f=e.length*t.length*o;c&&(f*=2),u=Math.ceil(a/f)}for(var p=0;p<=u;p++){var m=s(e,t,o);l&&r(m),d=d.concat(m),c&&(m.reverse(),d=d.concat(m))}return a&&d.splice(a),d}},72905(e,t,i){var n=i(19133);e.exports=function(e,t,i,r){var s;if(void 0===r&&(r=e),!Array.isArray(t))return-1!==(s=e.indexOf(t))?(n(e,s),i&&i.call(r,t),t):null;for(var a=t.length-1,o=[];a>=0;){var l=t[a];-1!==(s=e.indexOf(l))&&(n(e,s),o.push(l),i&&i.call(r,l)),a--}return o}},60248(e,t,i){var n=i(19133);e.exports=function(e,t,i,r){if(void 0===r&&(r=e),t<0||t>e.length-1)throw new Error("Index out of bounds");var s=n(e,t);return i&&i.call(r,s),s}},81409(e,t,i){var n=i(82011);e.exports=function(e,t,i,r,s){if(void 0===t&&(t=0),void 0===i&&(i=e.length),void 0===s&&(s=e),n(e,t,i)){var a=i-t,o=e.splice(t,a);if(r)for(var l=0;l<o.length;l++){var h=o[l];r.call(s,h)}return o}return[]}},31856(e,t,i){var n=i(19133);e.exports=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=e.length);var r=t+Math.floor(Math.random()*i);return n(e,r)}},42169(e){e.exports=function(e,t,i){var n=e.indexOf(t),r=e.indexOf(i);return-1!==n&&-1===r&&(e[n]=i,!0)}},86003(e){e.exports=function(e,t){void 0===t&&(t=1);for(var i=null,n=0;n<t;n++)i=e.shift(),e.push(i);return i}},49498(e){e.exports=function(e,t){void 0===t&&(t=1);for(var i=null,n=0;n<t;n++)i=e.pop(),e.unshift(i);return i}},82011(e){e.exports=function(e,t,i,n){var r=e.length;if(t<0||t>=r||t>=i||i>r){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},89545(e){e.exports=function(e,t){var i=e.indexOf(t);return-1!==i&&i>0&&(e.splice(i,1),e.unshift(t)),t}},17810(e,t,i){var n=i(82011);e.exports=function(e,t,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=e.length),n(e,r,s))for(var a=r;a<s;a++){var o=e[a];o.hasOwnProperty(t)&&(o[t]=i)}return e}},33680(e){e.exports=function(e){for(var t=e.length-1;t>0;t--){var i=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[i],e[i]=n}return e}},90126(e){e.exports=function(e){var t=/\D/g;return e.sort(function(e,i){return parseInt(e.replace(t,""),10)-parseInt(i.replace(t,""),10)}),e}},19133(e){e.exports=function(e,t){if(!(t>=e.length)){for(var i=e.length-1,n=e[t],r=t;r<i;r++)e[r]=e[r+1];return e.length=i,n}}},19186(e,t,i){var n=i(82264);function r(e,t){return String(e).localeCompare(t)}function s(e,t,i,n){var r,s,a,o,l,h=e.length,u=0,c=2*i;for(r=0;r<h;r+=c)for(a=(s=r+i)+i,s>h&&(s=h),a>h&&(a=h),o=r,l=s;;)if(o<s&&l<a)t(e[o],e[l])<=0?n[u++]=e[o++]:n[u++]=e[l++];else if(o<s)n[u++]=e[o++];else{if(!(l<a))break;n[u++]=e[l++]}}e.exports=function(e,t){if(void 0===t&&(t=r),!e||e.length<2)return e;if(n.features.stableSort)return e.sort(t);var i=function(e,t){var i=e.length;if(i<=1)return e;for(var n=new Array(i),r=1;r<i;r*=2){s(e,t,r,n);var a=e;e=n,n=a}return e}(e,t);return i!==e&&s(i,null,e.length,e),e}},25630(e){e.exports=function(e,t,i){if(t===i)return e;var n=e.indexOf(t),r=e.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return e[n]=i,e[r]=t,e}},37105(e,t,i){e.exports={Matrix:i(54915),Add:i(71146),AddAt:i(51067),BringToTop:i(66905),CountAllMatching:i(21612),Each:i(95428),EachInRange:i(36914),FindClosestInSorted:i(81957),Flatten:i(43491),GetAll:i(46710),GetFirst:i(58731),GetRandom:i(26546),MoveDown:i(70864),MoveTo:i(69693),MoveUp:i(40853),MoveAbove:i(85835),MoveBelow:i(83371),NumberArray:i(20283),NumberArrayStep:i(593),QuickSelect:i(43886),Range:i(88492),Remove:i(72905),RemoveAt:i(60248),RemoveBetween:i(81409),RemoveRandomElement:i(31856),Replace:i(42169),RotateLeft:i(86003),RotateRight:i(49498),SafeRange:i(82011),SendToBack:i(89545),SetAll:i(17810),Shuffle:i(33680),SortByDigits:i(90126),SpliceOne:i(19133),StableSort:i(19186),Swap:i(25630)}},86922(e){e.exports=function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))return!1;for(var t=e[0].length,i=1;i<e.length;i++)if(e[i].length!==t)return!1;return!0}},63362(e,t,i){var n=i(41836),r=i(86922);e.exports=function(e){var t="";if(!r(e))return t;for(var i=0;i<e.length;i++){for(var s=0;s<e[i].length;s++){var a=e[i][s].toString();t+="undefined"!==a?n(a,2):"?",s<e[i].length-1&&(t+=" |")}if(i<e.length-1){t+="\n";for(var o=0;o<e[i].length;o++)t+="---",o<e[i].length-1&&(t+="+");t+="\n"}}return t}},92598(e){e.exports=function(e){return e.reverse()}},21224(e){e.exports=function(e){for(var t=0;t<e.length;t++)e[t].reverse();return e}},98717(e,t,i){var n=i(37829);e.exports=function(e){return n(e,180)}},44657(e,t,i){var n=i(37829);e.exports=function(e,t){void 0===t&&(t=1);for(var i=0;i<t;i++)e=n(e,90);return e}},37829(e,t,i){var n=i(86922),r=i(2429);e.exports=function(e,t){if(void 0===t&&(t=90),!n(e))return null;if("string"!==typeof t&&(t=(t%360+360)%360),90===t||-270===t||"rotateLeft"===t)(e=r(e)).reverse();else if(-90===t||270===t||"rotateRight"===t)e.reverse(),e=r(e);else if(180===Math.abs(t)||"rotate180"===t){for(var i=0;i<e.length;i++)e[i].reverse();e.reverse()}return e}},92632(e,t,i){var n=i(37829);e.exports=function(e,t){void 0===t&&(t=1);for(var i=0;i<t;i++)e=n(e,-90);return e}},69512(e,t,i){var n=i(86003),r=i(49498);e.exports=function(e,t,i){if(void 0===t&&(t=0),void 0===i&&(i=0),0!==i&&(i<0?n(e,Math.abs(i)):r(e,i)),0!==t)for(var s=0;s<e.length;s++){var a=e[s];t<0?n(a,Math.abs(t)):r(a,t)}return e}},2429(e){e.exports=function(e){for(var t=e.length,i=e[0].length,n=new Array(i),r=0;r<i;r++){n[r]=new Array(t);for(var s=t-1;s>-1;s--)n[r][s]=e[s][r]}return n}},54915(e,t,i){e.exports={CheckMatrix:i(86922),MatrixToString:i(63362),ReverseColumns:i(92598),ReverseRows:i(21224),Rotate180:i(98717),RotateLeft:i(44657),RotateMatrix:i(37829),RotateRight:i(92632),Translate:i(69512),TransposeMatrix:i(2429)}},71334(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";e.exports=function(e,i){for(var n=new Uint8Array(e),r=n.length,s=i?"data:"+i+";base64,":"",a=0;a<r;a+=3)s+=t[n[a]>>2],s+=t[(3&n[a])<<4|n[a+1]>>4],s+=t[(15&n[a+1])<<2|n[a+2]>>6],s+=t[63&n[a+2]];return r%3===2?s=s.substring(0,s.length-1)+"=":r%3===1&&(s=s.substring(0,s.length-2)+"=="),s}},53134(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),n=0;n<64;n++)i[t.charCodeAt(n)]=n;e.exports=function(e){var t,n,r,s,a=(e=e.substr(e.indexOf(",")+1)).length,o=.75*a,l=0;"="===e[a-1]&&(o--,"="===e[a-2]&&o--);for(var h=new ArrayBuffer(o),u=new Uint8Array(h),c=0;c<a;c+=4)t=i[e.charCodeAt(c)],n=i[e.charCodeAt(c+1)],r=i[e.charCodeAt(c+2)],s=i[e.charCodeAt(c+3)],u[l++]=t<<2|n>>4,u[l++]=(15&n)<<4|r>>2,u[l++]=(3&r)<<6|63&s;return h}},65839(e,t,i){e.exports={ArrayBufferToBase64:i(71334),Base64ToArrayBuffer:i(53134)}},91799(e,t,i){e.exports={Array:i(37105),Base64:i(65839),Objects:i(1183),String:i(31749),NOOP:i(29747),NULL:i(20242)}},41786(e){e.exports=function(e){var t={};for(var i in e)Array.isArray(e[i])?t[i]=e[i].slice(0):t[i]=e[i];return t}},62644(e){var t=function(e){var i,n,r;if("object"!==typeof e||null===e)return e;for(r in i=Array.isArray(e)?[]:{},e)n=e[r],i[r]=t(n);return i};e.exports=t},79291(e,t,i){var n=i(41212),r=function(){var e,t,i,s,a,o,l=arguments[0]||{},h=1,u=arguments.length,c=!1;for("boolean"===typeof l&&(c=l,l=arguments[1]||{},h=2),u===h&&(l=this,--h);h<u;h++)if(null!=(e=arguments[h]))for(t in e)i=l[t],l!==(s=e[t])&&(c&&s&&(n(s)||(a=Array.isArray(s)))?(a?(a=!1,o=i&&Array.isArray(i)?i:[]):o=i&&n(i)?i:{},l[t]=r(c,o,s)):void 0!==s&&(l[t]=s));return l};e.exports=r},23568(e,t,i){var n=i(75508),r=i(35154);e.exports=function(e,t,i){var s=r(e,t,null);if(null===s)return i;if(Array.isArray(s))return n.RND.pick(s);if("object"===typeof s){if(s.hasOwnProperty("randInt"))return n.RND.integerInRange(s.randInt[0],s.randInt[1]);if(s.hasOwnProperty("randFloat"))return n.RND.realInRange(s.randFloat[0],s.randFloat[1])}else if("function"===typeof s)return s(t);return s}},95540(e){e.exports=function(e,t,i){var n=typeof e;return e&&"number"!==n&&"string"!==n&&e.hasOwnProperty(t)&&void 0!==e[t]?e[t]:i}},82840(e,t,i){var n=i(35154),r=i(45319);e.exports=function(e,t,i,s,a){void 0===a&&(a=i);var o=n(e,t,a);return r(o,i,s)}}
vendor: 4,271 bytes, line 2
2,35154(e){e.exports=function(e,t,i,n){if(!e&&!n||"number"===typeof e)return i;if(e&&e.hasOwnProperty(t))return e[t];if(n&&n.hasOwnProperty(t))return n[t];if(-1!==t.indexOf(".")){for(var r=t.split("."),s=e,a=n,o=i,l=i,h=!0,u=!0,c=0;c<r.length;c++)s&&s.hasOwnProperty(r[c])?(o=s[r[c]],s=s[r[c]]):h=!1,a&&a.hasOwnProperty(r[c])?(l=a[r[c]],a=a[r[c]]):u=!1;return h?o:u?l:i}return i}},69036(e){e.exports=function(e,t){for(var i=0;i<t.length;i++)if(!e.hasOwnProperty(t[i]))return!1;return!0}},1985(e){e.exports=function(e,t){for(var i=0;i<t.length;i++)if(e.hasOwnProperty(t[i]))return!0;return!1}},97022(e){e.exports=function(e,t){return e.hasOwnProperty(t)}},41212(e){e.exports=function(e){if(!e||"object"!==typeof e||e.nodeType||e===e.window)return!1;try{if(e.constructor&&!{}.hasOwnProperty.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(oT){return!1}return!0}},46975(e,t,i){var n=i(41786);e.exports=function(e,t){var i=n(e);for(var r in t)i.hasOwnProperty(r)||(i[r]=t[r]);return i}},269(e,t,i){var n=i(41786);e.exports=function(e,t){var i=n(e);for(var r in t)i.hasOwnProperty(r)&&(i[r]=t[r]);return i}},18254(e,t,i){var n=i(97022);e.exports=function(e,t){for(var i={},r=0;r<t.length;r++){var s=t[r];n(e,s)&&(i[s]=e[s])}return i}},61622(e){e.exports=function(e,t,i){if(!e||"number"===typeof e)return!1;if(e.hasOwnProperty(t))return e[t]=i,!0;if(-1!==t.indexOf(".")){for(var n=t.split("."),r=e,s=e,a=0;a<n.length;a++){if(!r.hasOwnProperty(n[a]))return!1;s=r,r=r[n[a]]}return s[n[n.length-1]]=i,!0}return!1}},1183(e,t,i){e.exports={Clone:i(41786),DeepCopy:i(62644),Extend:i(79291),GetAdvancedValue:i(23568),GetFastValue:i(95540),GetMinMaxValue:i(82840),GetValue:i(35154),HasAll:i(69036),HasAny:i(1985),HasValue:i(97022),IsPlainObject:i(41212),Merge:i(46975),MergeRight:i(269),Pick:i(18254),SetValue:i(61622)}},27902(e){e.exports=function(e,t){return e.replace(/%([0-9]+)/g,function(e,i){return t[Number(i)-1]})}},41836(e){e.exports=function(e,t,i,n){void 0===t&&(t=0),void 0===i&&(i=" "),void 0===n&&(n=3);var r=0;if(t+1>=(e=e.toString()).length)switch(n){case 1:e=new Array(t+1-e.length).join(i)+e;break;case 3:var s=Math.ceil((r=t-e.length)/2);e=new Array(r-s+1).join(i)+e+new Array(s+1).join(i);break;default:e+=new Array(t+1-e.length).join(i)}return e}},33628(e){e.exports=function(e,t){return 0===t?e.slice(1):e.slice(0,t)+e.slice(t+1)}},27671(e){e.exports=function(e){return e.split("").reverse().join("")}},45650(e){e.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}},35355(e){e.exports=function(e){return e&&e[0].toUpperCase()+e.slice(1)}},31749(e,t,i){e.exports={Format:i(27902),Pad:i(41836),RemoveAt:i(33628),Reverse:i(27671),UppercaseFirst:i(35355),UUID:i(45650)}}},vP={};function yP(e){var t=vP[e];if(void 0!==t)return t.exports;var i=vP[e]={exports:{}};return gP[e](i,i.exports,yP),i.exports}yP.d=(e,t)=>{for(var i in t)yP.o(t,i)&&!yP.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},yP.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(oT){if("object"===typeof window)return window}}(),yP.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var xP={};yP.d(xP,{A4:()=>HP,AB:()=>qP,AQ:()=>zP,Ae:()=>iM,Aq:()=>eM,Ay:()=>fM,B_:()=>RP,CB:()=>sM,Cu:()=>NP,D7:()=>KP,Dh:()=>DP,En:()=>wP,FE:()=>jP,Fu:()=>$P,M3:()=>hM,NS:()=>uM,O1:()=>QP,PX:()=>dM,Q8:()=>nM,Qw:()=>TP,SY:()=>oM,Tm:()=>EP,UP:()=>cM,XT:()=>kP,Xs:()=>AP,Z5:()=>WP,Zt:()=>IP,_k:()=>GP,aH:()=>BP,dv:()=>PP,gX:()=>JP,gd:()=>_P,ho:()=>XP,iJ:()=>CP,j$:()=>rM,l2:()=>SP,nl:()=>OP,pd:()=>FP,qt:()=>aM,ry:()=>VP,sV:()=>MP,sx:()=>ZP,x3:()=>lM,xS:()=>LP,xv:()=>tM,zA:()=>YP,zU:()=>UP}),yP(63595);var bP=yP(8054);const wP=yP(61061),TP=yP(60421),_P=yP(10312),SP=yP(83388),EP=yP(26638),CP=yP(42857),AP=yP(83419),kP=yP(25410),RP=yP(44965),OP=yP(27460),PP=yP(84902),MP=yP(93055),NP=yP(11889),IP=yP(50127),LP=yP(77856),DP=yP(55738),FP=yP(14350),BP=yP(57777),UP=yP(75508),zP=yP(44563),VP=yP(18922),HP=yP(36909),jP=yP(93364),YP=yP(29795),WP=yP(97482),GP=yP(62194),XP=yP(41392),qP=yP(23717),KP=yP(27458),QP=yP(62501),JP=yP(90291),ZP=yP(84322),$P=yP(43066),eM=yP(91799),tM=bP.VERSION,iM=bP.LOG_VERSION,nM=bP.AUTO,rM=bP.CANVAS,s
2M=bP.WEBGL,aM=bP.HEADLESS,oM=bP.FOREVER,lM=bP.NONE,hM=bP.LEFT,uM=bP.RIGHT,cM=bP.UP,dM=bP.DOWN,fM={Actions:wP,Animations:TP,BlendModes:_P,Cache:SP,Cameras:EP,Core:CP,Class:AP,Curves:kP,Data:RP,Display:OP,DOM:PP,Events:MP,Filters:NP,Game:IP,GameObjects:LP,Geom:DP,Input:FP,Loader:BP,Math:UP,Physics:zP,Plugins:VP,Renderer:HP,Scale:jP,ScaleModes:YP,Scene:WP,Scenes:GP,Structs:XP,Sound:qP,Textures:KP,Tilemaps:QP,Time:JP,TintModes:ZP,Tweens:$P,Utils:eM,VERSION:tM,LOG_VERSION:iM,AUTO:nM,CANVAS:rM,WEBGL:sM,HEADLESS:aM,FOREVER:oM,NONE:lM,LEFT:hM,RIGHT:uM,UP:cM,DOWN:dM},pM=xP.Ay;function mM(t){let i=t.rows,n=void 0===i?9:i,r=t.cols,s=void 0===r?9:r,a=t.cellSize,o=void 0===a?64:a,l=t.minCellSize,h=void 0===l?28:l,u=t.board,c=void 0===u?[]:u,d=t.lastMove,f=void 0===d?null:d,p=t.pieceLabels,m=void 0===p?{}:p,g=t.promotedLabels,v=void 0===g?{}:g,y=t.selected,x=void 0===y?null:y,b=t.legalTargets,w=void 0===b?[]:b,T=t.onSquareClick,_=void 0===T?()=>{}:T,S=t.flipBoard,E=void 0!==S&&S,C=t.flatBoard,A=void 0===C||C,k=t.lightColor,R=void 0===k?15784373:k,O=t.darkColor,P=void 0===O?11896931:O,M=t.boardColor,N=void 0===M?14463836:M,I=t.lineColor,L=void 0===I?3877402:I,D=t.komaFillColor,F=void 0===D?16244645:D,B=t.komaStrokeColor,U=void 0===B?7029795:B,z=t.komaStrokeWidth,V=void 0===z?2:z,H=t.komaScale,j=void 0===H?.86:H,Y=t.inkColor,W=void 0===Y?"#1a1008":Y,G=t.promotedInkColor,X=void 0===G?"#b5121b":G,q=t.goteInkColor,K=void 0===q?null:q,Q=t.goteInkColorPromoted,J=void 0===Q?null:Q,Z=t.highlightColor,$=void 0===Z?3066993:Z,ee=t.selectColor,te=void 0===ee?15844367:ee;const ie=(0,e.useRef)(null),ne=(0,e.useRef)(null),re=(0,e.useRef)(null),se=(0,e.useRef)({});return se.current={selected:x,legalTargets:w,onSquareClick:_,flipBoard:E},(0,e.useEffect)(()=>{let e=!0,t=null;const i=s*o,r=n*o;class a extends pM.Scene{constructor(){super("BoardScene")}create(){this.gridGraphics=this.add.graphics(),this.highlightGraphics=this.add.graphics(),this.pieceGrid=Array.from({length:n},()=>Array(s).fill(null));const e=o*j*.82,t=o*j;this.komaPoints=[0,-t/2,.3*e,.3*-t,.4*e,t/2,.4*-e,t/2,.3*-e,.3*-t],this.komaTextYOffset=this._polygonCentroidY(this.komaPoints);for(let i=0;i<n;i++)for(let e=0;e<s;e++){this.add.zone(e*o,i*o,o,o).setOrigin(0,0).setInteractive({useHandCursor:!0}).on("pointerdown",()=>{const t=se.current.flipBoard,r=t?n-1-i:i,a=t?s-1-e:e;se.current.onSquareClick(r,a)})}this.drawBoard(),this.fullRenderPieces(c),this.drawHighlights(),this.sys.game.canvas&&(this.sys.game.canvas.style.touchAction="manipulation")}drawBoard(){const e=this.gridGraphics;if(e.clear(),A)e.fillStyle(N,1),e.fillRect(0,0,s*o,n*o);else for(let t=0;t<n;t++)for(let i=0;i<s;i++){const n=(t+i)%2===0;e.fillStyle(n?R:P,1),e.fillRect(i*o,t*o,o,o)}e.lineStyle(2,L,1);for(let t=0;t<=s;t++)e.lineBetween(t*o,0,t*o,n*o);for(let t=0;t<=n;t++)e.lineBetween(0,t*o,s*o,t*o)}_polygonCentroidY(e){let t=0,i=0;const n=e.length/2;for(let r=0;r<n;r++){const s=e[2*r],a=e[2*r+1],o=(r+1)%n,l=e[2*o],h=e[2*o+1],u=s*h-l*a;t+=u,i+=(a+h)*u}return t*=.5,Math.abs(t)<1e-6?0:i/(6*t)}_labelFor(e){const t=e.promoted&&v[e.type]?v[e.type]:m[e.type]||e.type;let i=t,n=.36*o;return 2===t.length&&(n=.27*o),t.length>=3&&(i=t[0]+"\n"+t.slice(1),n=.24*o),{displayLabel:i,fontSize:n}}_inkFor(e){const t="gote"===e.color;return e.promoted?t&&J?J:X:t&&K?K:W}createPieceContainer(e,t,i){const n=this.add.container(e,t),r=this.add.graphics();r.fillStyle(F,1),r.lineStyle(V,U,1),r.beginPath(),r.moveTo(this.komaPoints[0],this.komaPoints[1]);for(let u=2;u<this.komaPoints.length;u+=2)r.lineTo(this.komaPoints[u],this.komaPoints[u+1]);r.closePath(),r.fillPath(),r.strokePath();const s=this._labelFor(i),a=s.displayLabel,o=s.fontSize,l=this.add.text(0,this.komaTextYOffset,a,{fontSize:"".concat(Math.floor(o),"px"),color:this._inkFor(i),fontStyle:"bold",align:"center",fontFamily:'"Hiragino Sans", "Yu Gothic", "Noto Sans JP", Roboto, sans-serif'}).setOrigin(.5);n.add([r,l]);const h=se.current.flipBoard?"gote"===i.color:"sente"===i.color;return n.setAngle(h?0:180),n}fullRenderPieces(e){for(let r=0;r<n;r++)for(let e=0;e<s;e++)this.pieceGrid[r][e]&&(this.pieceGrid[r][e].destroy(),this.pieceGrid[r][e]=null);const t=se.current.flipBoard;for(let r=0;r<n;r++)for(let a=0;a<s;a++){var i;const l=null===e||void 0===e||null===(i=e[r])||void 0===i?void 0:i[a];if(!l)continue;const h=(t?s-1-a:a)*o+o/2,u=(t?n-1-r:r)*o+o/2;this.pieceGrid[r][a]=this.createPieceContainer(h,u,l)}}drawHighlights(){const e=this.highlightGraphics;e.clear();const t=se.current,i=t.selected,r=t.legalTargets,a=t.flipBoard;if(i){const t=a?n-1-i.row:i.row,r=a?s-1-i.col:i.col;e.fillStyle(te,.45),e.fillRect(r*o,t*o,o,o)}
2(r||[]).forEach(t=>{let i=t.row,r=t.col;const l=a?n-1-i:i,h=a?s-1-r:r;e.fillStyle($,.45),e.fillCircle(h*o+o/2,l*o+o/2,.15*o)})}}const l=()=>{if(!e)return;if(!ie.current||0===ie.current.clientWidth)return void(t=requestAnimationFrame(l));const o={type:pM.AUTO,width:i,height:r,parent:ie.current,transparent:!0,scene:a,scale:{mode:pM.Scale.FIT,autoCenter:pM.Scale.CENTER_HORIZONTALLY,width:i,height:r,min:{width:s*h,height:n*h},max:{width:i,height:r}},input:{activePointers:1,touch:{capture:!0}}},u=new pM.Game(o);ne.current=u,u.events.once(pM.Core.Events.READY,()=>{e&&(re.current=u.scene.getScene("BoardScene"),re.current&&(re.current.fullRenderPieces(c),re.current.drawHighlights()))})};return l(),()=>{e=!1,t&&cancelAnimationFrame(t),ne.current&&(ne.current.destroy(!0),ne.current=null,re.current=null)}},[n,s,o,h]),(0,e.useEffect)(()=>{re.current&&(re.current.fullRenderPieces(c),re.current.drawHighlights())},[c,E,f]),(0,e.useEffect)(()=>{var e;null===(e=re.current)||void 0===e||e.drawHighlights()},[x,w]),(0,QO.jsx)("div",{ref:ie,style:{width:"100%",maxWidth:s*o,margin:"0 auto",aspectRatio:"".concat(s," / ").concat(n),touchAction:"manipulation"}})}const gM={P:"\u6b69",L:"\u9999",N:"\u6842",S:"\u9280",G:"\u91d1",B:"\u89d2",R:"\u98db",K:"\u7389"},vM={P:"\u3068",L:"\u674f",N:"\u572d",S:"\u5168",B:"\u99ac",R:"\u9f8d"};class yM{constructor(){this.reset()}reset(){this._board=Array.from({length:9},()=>Array(9).fill(null)),this._hands={sente:{P:0,L:0,N:0,S:0,G:0,B:0,R:0},gote:{P:0,L:0,N:0,S:0,G:0,B:0,R:0}},this._turn="sente",this._moveHistory=[],this._setupInitialBoard()}_setupInitialBoard(){const e=["L","N","S","G","K","G","S","N","L"];for(let i=0;i<9;i++)this._board[0][i]={type:e[i],color:"gote",promoted:!1};this._board[1][1]={type:"R",color:"gote",promoted:!1},this._board[1][7]={type:"B",color:"gote",promoted:!1};for(let i=0;i<9;i++)this._board[2][i]={type:"P",color:"gote",promoted:!1};for(let i=0;i<9;i++)this._board[6][i]={type:"P",color:"sente",promoted:!1};this._board[7][1]={type:"B",color:"sente",promoted:!1},this._board[7][7]={type:"R",color:"sente",promoted:!1};const t=["L","N","S","G","K","G","S","N","L"];for(let i=0;i<9;i++)this._board[8][i]={color:"sente",type:t[i],promoted:!1}}board(){return this._board.map(e=>e.map(e=>e?m({},e):null))}hands(){return{sente:m({},this._hands.sente),gote:m({},this._hands.gote)}}turn(){return this._turn}history(){return[...this._moveHistory]}isCheck(e){const t=e||this._turn;let i=null;for(let r=0;r<9;r++){for(let e=0;e<9;e++){const n=this._board[r][e];if(n&&"K"===n.type&&n.color===t){i={row:r,col:e};break}}if(i)break}if(!i)return!1;const n="sente"===t?"gote":"sente";for(let r=0;r<9;r++)for(let e=0;e<9;e++){const t=this._board[r][e];if(t&&t.color===n){if(this.moves({row:r,col:e}).some(e=>e.to.row===i.row&&e.to.col===i.col))return!0}}return!1}hasAnyLegalMoves(e){const t=e||this._turn;for(let r=0;r<9;r++)for(let e=0;e<9;e++){const i=this._board[r][e];if(i&&i.color===t){if(this.moves({row:r,col:e}).length>0)return!0}}const i=this._hands[t]||{};for(const r of Object.entries(i)){var n=u(r,2);const e=n[0];if(n[1]>0){if(this.getLegalDrops(e,t).length>0)return!0}}return!1}move(e){let t=e.from,i=e.to,n=e.promote,r=void 0!==n&&n;const s=this._board[t.row][t.col];if(!s)throw new Error("Se\xe7ilen karede ta\u015f bulunamad\u0131");const a=this._board[i.row][i.col];if(a){const e=this.unpromotedType(a.type);this._hands[s.color][e]=(this._hands[s.color][e]||0)+1}const o=r||s.promoted;this._board[i.row][i.col]=m(m({},s),{},{promoted:o}),this._board[t.row][t.col]=null;const l={type:"move",color:s.color,from:t,to:i,piece:s.type,pieceType:s.type,symbol:gM[s.type]||s.type,promoted:o,captured:a?a.type:null};return this._moveHistory.push(l),this._turn="sente"===this._turn?"gote":"sente",l}drop(e){let t=e.type,i=e.row,n=e.col;const r=e.color||this._turn;if((this._hands[r][t]||0)<=0)throw new Error("Elinizde bu ta\u015ftan kalmad\u0131");if(this._board[i][n])throw new Error("Hedef kare bo\u015f de\u011fil");this._hands[r][t]--,this._board[i][n]={type:t,color:r,promoted:!1};const s={type:"drop",color:r,piece:t,pieceType:t,symbol:gM[t]||t,to:{row:i,col:n}};return this._moveHistory.push(s),this._turn="sente"===this._turn?"gote":"sente",s}getLegalDrops(e,t){const i=t||this._turn,n=[],r=new Set;if("P"===e)for(let s=0;s<9;s++)for(let e=0;e<9;e++){const t=this._board[e][s];if(t&&t.color===i&&"P"===t.type&&!t.promoted){r.add(s);break}}for(let s=0;s<9;s++)for(let t=0;t<9;t++)if(null===this._board[s][t]&&("P"!==e||!r.has(t))){if("sente"===i){if(("P"===e||"L"===e)&&0===s)continue;if("N"===e&&s<=1)continue}else{if(("P"===e||"L"===e)&&8===s)continue;if("N"===e&&s>=7)continue}n.push({row:s,col:t})}return n}dropTargets(e,t){return this.getLegalDrops(e,t)}moves(e){let t=e.row,i=e.col;const n=this._board[t][i];if(!n)return[];const r=[],s=n.color,a="sente"===s?-1:1,o=(e,t)=>{if(e<0||e>8||t<0||t>8)return!1;const i=this._board[e][t];return i?(i.color!==s&&r.push({to:{row:e,col:t},capture:!0}),!1):(r.push({to:{row:e,col:t},capture:!1}),!0)},l=(e,n)=>{let r=t+e,s=i+n;for(;r>=0&&r<=8&&s>=0&&s<=8&&o(r,s);)r+=e,s+=n}
2,h=n.type,u=n.promoted,c=()=>{o(t+a,i-1),o(t+a,i),o(t+a,i+1),o(t,i-1),o(t,i+1),o(t-a,i)};if(u&&["P","L","N","S"].includes(h))c();else switch(h){case"P":o(t+a,i);break;case"L":l(a,0);break;case"N":o(t+2*a,i-1),o(t+2*a,i+1);break;case"S":o(t+a,i-1),o(t+a,i),o(t+a,i+1),o(t-a,i-1),o(t-a,i+1);break;case"G":c();break;case"B":l(1,1),l(1,-1),l(-1,1),l(-1,-1),u&&(o(t+1,i),o(t-1,i),o(t,i+1),o(t,i-1));break;case"R":l(1,0),l(-1,0),l(0,1),l(0,-1),u&&(o(t+1,i+1),o(t+1,i-1),o(t-1,i+1),o(t-1,i-1));break;case"K":for(let e=-1;e<=1;e++)for(let n=-1;n<=1;n++)0===e&&0===n||o(t+e,i+n)}return r}unpromotedType(e){return{"+P":"P","+L":"L","+N":"N","+S":"S","+B":"B","+R":"R"}[e]||e}}const xM={P:1,L:3,N:4,S:5,G:6,B:8,R:10,K:1e3};function bM(e,t){const i=function(e){let t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).randomness,i=void 0===t?3:t;const n=e.turn(),r=e.board(),s=[];for(let o=0;o<9;o++)for(let t=0;t<9;t++){const a=r[o][t];a&&a.color===n&&e.moves({row:o,col:t}).forEach(e=>{const n=r[e.to.row][e.to.col],a=n&&xM[n.type]||0;(e.mustPromote?[!0]:e.canPromote?[!0,!1]:[!1]).forEach(n=>{let r=2*a;n&&(r+=2.5),r+=Math.random()*i,s.push({kind:"move",from:{row:o,col:t},to:e.to,promote:n,score:r})})})}const a=e.hands()[n]||{};return Object.entries(a).forEach(t=>{let n=u(t,2),r=n[0];n[1]&&e.dropTargets(r).forEach(e=>{let t=.15*(xM[r]||0);t+=Math.random()*i,s.push({kind:"drop",pieceType:r,to:e,score:t})})}),0===s.length?null:(s.sort((e,t)=>t.score-e.score),s[0])}(e,t);return i?"move"===i.kind?e.move({from:i.from,to:i.to,promote:i.promote}):e.drop({type:i.pieceType,row:i.to.row,col:i.to.col}):null}function wM(t){let i=t.onHistoryChange,n=void 0===i?()=>{}:i,r=t.aiColor,s=void 0===r?"gote":r,a=t.aiDelay,o=void 0===a?900:a;const l=$O().user,h=(0,e.useRef)(null);h.current||(h.current=new yM);const c=h.current,d=u((0,e.useState)({board:c.board(),lastMove:null}),2),f=d[0],p=d[1],m=u((0,e.useState)(c.turn()),2),g=m[0],v=m[1],y=u((0,e.useState)(c.hands()),2),x=y[0],b=y[1],w=u((0,e.useState)(null),2),T=w[0],_=w[1],S=u((0,e.useState)(null),2),E=S[0],C=S[1],A=u((0,e.useState)([]),2),k=A[0],R=A[1],O=u((0,e.useState)(!0),2),P=O[0],M=O[1],N=u((0,e.useState)(!1),2),I=N[0],L=N[1],D=u((0,e.useState)(null),2),F=D[0],B=D[1],U=(0,e.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(p({board:c.board(),lastMove:e}),v(c.turn()),b(c.hands()),n(c.history()),null!==e&&void 0!==e&&e.captured){const t=gM[e.captured]||e.captured,i="sente"===e.color?"Sente":"Gote";hn.warning("".concat(i,", rakibin ").concat(t," ta\u015f\u0131n\u0131 ald\u0131!"))}let t=null;if("K"===(null===e||void 0===e?void 0:e.captured)?t={winner:e.color,reason:"king-captured"}:e&&!c.hasAnyLegalMoves()&&(t={winner:"sente"===c.turn()?"gote":"sente",reason:"no-moves"}),t){B(t);const e="sente"===t.winner?"Sente (Siyah)":"Gote (Beyaz)",i="king-captured"===t.reason?"\u015eah al\u0131nd\u0131.":"Rakibin oynayacak hamlesi kalmad\u0131.";if(hn.success("Oyun bitti \u2014 ".concat(e," kazand\u0131! ").concat(i)),XO("game_complete",{winner:t.winner,reason:t.reason,move_count:c.history().length,vs_ai:P}),l&&P){const e="sente"===t.winner?"win":"loss";KO(l.uid,{result:e,reason:t.reason,history:c.history()}).then(()=>hn.success("Oyun profiline kaydedildi.")).catch(e=>{console.error("Oyun kaydedilemedi:",e),hn.error("Oyun kaydedilemedi: ".concat(e.code||e.message||"bilinmeyen hata"))})}else l&&!P&&hn.message('"Gote\'yi bilgisayar oynats\u0131n" kapal\u0131 oldu\u011fu i\xe7in bu oyun kaydedilmedi.')}else if(e&&c.isCheck(c.turn())){const e="sente"===c.turn()?"Sente":"Gote";hn.warning("\u015eah! ".concat(e," tehdit alt\u0131nda."))}},[c,n,l,P]);(0,e.useEffect)(()=>{n(c.history())},[]),(0,e.useEffect)(()=>{if(F)return;if(!P||g!==s)return;L(!0);const e=setTimeout(()=>{const e=bM(c);L(!1),U(e)},o);return()=>clearTimeout(e)},[g,P,s,o,c,U,F]);const z=()=>{_(null),C(null),R([])},V=(0,e.useCallback)(async(e,t)=>{if(F||I||P&&g===s)return;const i=f.board,n=i[e][t];if(E){if(k.some(i=>i.row===e&&i.col===t)){const i=c.drop({type:E,row:e,col:t});z(),U(i)}else z();return}if(T){if(k.some(i=>i.row===e&&i.col===t)){const n=((e,t,i)=>{if(!e||e.promoted||["G","K"].includes(e.type))return{canPromote:!1,mustPromote:!1};const n="sente"===e.color;if(!(n?i<=2||t<=2:i>=6||t>=6))return{canPromote:!1,mustPromote:!1};let r=!1;return"P"===e.type||"L"===e.type?r=n?0===i:8===i:"N"===e.type&&(r=n?i<=1:i>=7),{canPromote:!0,mustPromote:r}}
2)(i[T.row][T.col],T.row,e),r=n.canPromote;let s=!1;n.mustPromote?s=!0:r&&(s=await new Promise(e=>{hn.confirm("Terfi / Y\xfckseltme","Bu ta\u015f\u0131 terfi ettirmek (y\xfckseltmek) ister misiniz?",()=>e(!0),()=>e(!1))}));const a=c.move({from:T,to:{row:e,col:t},promote:s});return z(),void U(a)}return void(n&&n.color===g?(_({row:e,col:t}),R(c.moves({row:e,col:t}).map(e=>e.to))):z())}n&&n.color===g&&(_({row:e,col:t}),R(c.moves({row:e,col:t}).map(e=>e.to)))},[f,T,k,E,c,g,U,I,P,s,F]),H=e=>{const t=Object.entries(x[e]||{}).filter(e=>u(e,2)[1]>0);return 0===t.length?(0,QO.jsx)("span",{className:"text-muted small",children:"(elde ta\u015f yok)"}):t.map(t=>{let i=u(t,2),n=i[0],r=i[1];return(0,QO.jsxs)("button",{type:"button",onClick:()=>((e,t)=>{e===g&&(F||I||P&&g===s||(_(null),E!==t?(C(t),R(c.dropTargets(t))):z()))})(e,n),className:"btn me-1 mb-1 px-3 py-2 "+(E===n&&g===e?"btn-success":"btn-outline-secondary"),disabled:e!==g,children:[gM[n]," ",(0,QO.jsx)("span",{className:"badge bg-light text-dark ms-1",children:r})]},n)})};return(0,QO.jsxs)("div",{className:"card shadow-sm",children:[(0,QO.jsxs)("div",{className:"card-header d-flex flex-wrap justify-content-between align-items-center gap-2",children:[(0,QO.jsx)("span",{className:"fw-bold",children:"\u015eogi Tahtas\u0131"}),(0,QO.jsxs)("div",{className:"form-check form-switch mb-0",children:[(0,QO.jsx)("input",{className:"form-check-input",type:"checkbox",role:"switch",id:"aiToggle",checked:P,onChange:e=>M(e.target.checked)}),(0,QO.jsx)("label",{className:"form-check-label small",htmlFor:"aiToggle",children:"Gote'yi bilgisayar oynats\u0131n"})]})]}),!l&&(0,QO.jsx)("div",{className:"alert alert-light border small text-center mb-0 py-1 rounded-0",children:"Giri\u015f yapmad\u0131n \u2014 bu oyun profiline ve liderlik tablosuna kaydedilmeyecek."}),(0,QO.jsxs)("div",{className:"card-body d-flex flex-column align-items-center gap-3",children:[F&&(0,QO.jsxs)("div",{className:"alert alert-success text-center w-100 mb-0 py-2",children:[(0,QO.jsxs)("div",{className:"fw-bold",children:["sente"===F.winner?"Sente (Siyah)":"Gote (Beyaz)"," kazand\u0131!"]}),(0,QO.jsx)("div",{className:"small mb-2",children:"king-captured"===F.reason?"\u015eah al\u0131nd\u0131.":"Rakibin oynayacak hamlesi kalmad\u0131."}),(0,QO.jsx)("button",{type:"button",className:"btn btn-sm btn-primary",onClick:()=>{c.reset(),B(null),_(null),C(null),R([]),U(null)},children:"Yeniden Ba\u015fla"})]}),(0,QO.jsxs)("div",{className:"w-100 text-center",children:[(0,QO.jsx)("div",{className:"fw-semibold text-danger",children:"Gote (\xfcst) \u2014 elindekiler"}),(0,QO.jsx)("div",{children:H("gote")})]}),(0,QO.jsx)(mM,{rows:9,cols:9,cellSize:64,board:f.board,lastMove:f.lastMove,pieceLabels:gM,promotedLabels:vM,selected:T,legalTargets:k,onSquareClick:V}),(0,QO.jsxs)("div",{className:"w-100 text-center",children:[(0,QO.jsx)("div",{className:"fw-semibold",children:"Sente (alt) \u2014 elindekiler"}),(0,QO.jsx)("div",{children:H("sente")})]}),(0,QO.jsxs)("div",{className:"fs-5",children:["S\u0131ra:"," ",(0,QO.jsx)("span",{className:"badge ".concat("sente"===g?"bg-dark":"bg-danger"),children:"sente"===g?"Sente (Siyah)":"Gote (Beyaz)"}),!F&&c.isCheck(g)&&(0,QO.jsx)("span",{className:"badge bg-warning text-dark ms-2",children:"\u015eah!"}),!F&&I&&(0,QO.jsxs)("span",{className:"badge bg-info text-dark ms-2",children:[(0,QO.jsx)("span",{className:"spinner-border spinner-border-sm me-1",role:"status","aria-hidden":"true"}),"Gote d\xfc\u015f\xfcn\xfcyor\u2026"]})]})]})]})}function TM(e){let t=e.row,i=e.col;const n=t+1;return"".concat(9-i).concat(n)}function _M(e){const t=gM[e.piece]||e.piece;if("drop"===e.type)return"".concat(t," elden ").concat(TM(e.to)," karesine kondu");const i=["".concat(t," ").concat(TM(e.from)," \u2192 ").concat(TM(e.to))];return e.promote&&i.push("(terfi etti)"),e.captured&&i.push("\u2014 ".concat(gM[e.captured]||e.captured," al\u0131nd\u0131")),i.join(" ")}function SM(e){let t=e.history;const i=(void 0===t?[]:t).map((e,t)=>({move:e,num:t+1})).reverse();return(0,QO.jsxs)("div",{className:"card shadow-sm h-100",children:[(0,QO.jsx)("div",{className:"card-header fw-bold",children:"Hamle Ge\xe7mi\u015fi"}),(0,QO.jsx)("div",{className:"card-body p-0",style:{maxHeight:620,overflowY:"auto"},children:0===i.length?(0,QO.jsx)("div",{className:"p-3 text-muted small",children:"Hen\xfcz hamle oynanmad\u0131."}):(0,QO.jsx)("ul",{className:"list-group list-group-flush mb-0",children:i.map(e=>{let t=e.move,i=e.num;return(0,QO.jsxs)("li",{className:"list-group-item d-flex align-items-start gap-2 small",children:[(0,QO.jsx)("span",{className:"badge bg-secondary",children:i}),(0,QO.jsx)("span",{className:"badge ".concat("sente"===t.color?"bg-dark":"bg-danger"),children:"sente"===t.color?"Sente":"Gote"}),(0,QO.jsx)("span",{children:_M(t)})]},i)})})})]})}function EM(){const t=u((0,e.useState)([]),2),i=t[0],n=t[1];return(0,QO.jsxs)("div",{className:"container-fluid py-3 py-md-4",children:[(0,QO.jsxs)(an,{children:[(0,QO.jsx)("title",{children:"Online \u015eogi Oyna \u2014 Bilgisayara Kar\u015f\u
20131 Pratik Yap | \u015eogi T\xfcrkiye"}),(0,QO.jsx)("meta",{name:"description",content:"\xdccretsiz yapay zekaya kar\u015f\u0131 \u015eogi (Japon Satranc\u0131) oynay\u0131n. Hamle ge\xe7mi\u015finizi inceleyin ve kendinizi geli\u015ftirin."})]}),(0,QO.jsx)("h1",{className:"text-center mb-3 mb-md-4 fs-3 fs-md-1",children:"\u015eogi Oyna"}),(0,QO.jsxs)("div",{className:"row g-3 g-md-4 justify-content-center",children:[(0,QO.jsx)("div",{className:"col-12 col-lg-8",children:(0,QO.jsx)(wM,{onHistoryChange:n})}),(0,QO.jsx)("div",{className:"col-12 col-lg-4",children:(0,QO.jsx)(SM,{history:i})})]})]})}function CM(e){if(!e)return"?";const t=9-e.col,i=e.row+1;return"".concat(t).concat(i)}function AM(e){const t=gM[e.piece]||e.piece;if("drop"===e.type)return"".concat(t," elden ").concat(CM(e.to)," karesine kondu");const i=["".concat(t," ").concat(CM(e.from)," \u2192 ").concat(CM(e.to))];return e.promote&&i.push("(terfi etti)"),e.captured&&i.push("\u2014 ".concat(gM[e.captured]||e.captured," al\u0131nd\u0131")),i.join(" ")}const kM=[{id:"streak_1",title:"\u0130lk Ad\u0131m",icon:"\ud83c\udf31",desc:"\u0130lk kez giri\u015f yap\u0131ld\u0131."},{id:"streak_3",title:"Kararl\u0131 Oyuncu",icon:"\u26a1",desc:"3 g\xfcn aral\u0131ks\u0131z giri\u015f yap."},{id:"streak_7",title:"Haftal\u0131k Seri",icon:"\ud83d\udd25",desc:"7 g\xfcn aral\u0131ks\u0131z giri\u015f yap."},{id:"streak_10",title:"10 G\xfcnl\xfck Seri",icon:"\ud83d\udca5",desc:"10 g\xfcn aral\u0131ks\u0131z giri\u015f yap."},{id:"streak_25",title:"Ate\u015fli Usta",icon:"\ud83c\udf0b",desc:"25 g\xfcn aral\u0131ks\u0131z giri\u015f yap."},{id:"streak_50",title:"Efsanevi Devaml\u0131l\u0131k",icon:"\ud83d\udc51",desc:"50 g\xfcn aral\u0131ks\u0131z giri\u015f yap."},{id:"games_1",title:"\u0130lk Hamle",icon:"\ud83c\udfaf",desc:"1 ma\xe7 tamamla."},{id:"games_3",title:"\xc7aylak Oyuncu",icon:"\u265f\ufe0f",desc:"3 ma\xe7 tamamla."},{id:"games_10",title:"Tecr\xfcbeli Sava\u015f\xe7\u0131",icon:"\ud83d\udee1\ufe0f",desc:"10 ma\xe7 tamamla."},{id:"games_25",title:"Masa Hakimi",icon:"\u2694\ufe0f",desc:"25 ma\xe7 tamamla."},{id:"games_50",title:"\u015eogi M\xfcptelas\u0131",icon:"\ud83c\udf1f",desc:"50 ma\xe7 tamamla."},{id:"games_100",title:"Y\xfczler Kul\xfcb\xfc",icon:"\ud83d\udc8e",desc:"100 ma\xe7 tamamla."},{id:"wins_1",title:"\u0130lk Zafer",icon:"\ud83c\udf89",desc:"1 ma\xe7 kazan."},{id:"wins_3",title:"Galibiyet Serisi",icon:"\ud83c\udfc5",desc:"3 ma\xe7 kazan."},{id:"wins_5",title:"Usta Aday\u0131",icon:"\ud83c\udfc6",desc:"5 ma\xe7 kazan."},{id:"wins_10",title:"Strateji Dehas\u0131",icon:"\ud83e\udd47",desc:"10 ma\xe7 kazan."},{id:"wins_25",title:"Yenilmez General",icon:"\u26e9\ufe0f",desc:"25 ma\xe7 kazan."},{id:"mp_1",title:"Online Arena",icon:"\ud83c\udf10",desc:"1 multiplayer ma\xe7 yap."},{id:"mp_3",title:"Rakiplerin Korkulu R\xfcyas\u0131",icon:"\u2694\ufe0f",desc:"3 multiplayer ma\xe7 yap."},{id:"mp_10",title:"Arena \u015eampiyonu",icon:"\ud83d\udc51",desc:"10 multiplayer ma\xe7 yap."}];function RM(){const t=$O(),i=t.user,n=t.profile,r=t.loading,s=t.login,a=u((0,e.useState)([]),2),o=a[0],l=a[1],h=u((0,e.useState)(!0),2),c=h[0],d=h[1],f=u((0,e.useState)(!1),2),p=f[0],g=f[1],v=u((0,e.useState)(""),2),y=v[0],x=v[1],b=u((0,e.useState)(!1),2),w=b[0],T=b[1],_=u((0,e.useState)(null),2),S=_[0],E=_[1];if((0,e.useEffect)(()=>{i&&(d(!0),async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;const i=m_(ov(YO,"users",e,"games"),x_("playedAt","desc"),w_(t));return(await M_(i)).docs.map(e=>m({id:e.id},e.data()))}(i.uid).then(l).catch(e=>console.error(e)).finally(()=>d(!1)))},[i,null===n||void 0===n?void 0:n.gamesPlayed]),r)return(0,QO.jsx)("div",{className:"container py-5 text-center text-muted",children:"Y\xfckleniyor\u2026"});if(!i)return(0,QO.jsxs)("div",{className:"container py-5 text-center",children:[(0,QO.jsx)("h1",{className:"mb-3",children:"Profilim"}),(0,QO.jsx)("p",{className:"text-muted mb-4",children:"Profilini, rozetlerini, oyun ge\xe7mi\u015fini ve istatistiklerini g\xf6rmek i\xe7in Gmail hesab\u0131nla giri\u015f yapmal\u0131s\u0131n."}),(0,QO.jsx)("button",{type:"button",className:"btn btn-primary",onClick:s,children:"Gmail ile Giri\u015f Yap"})]});const C=new Set(((null===n||void 0===n?void 0:n.ribbons)||[]).map(e=>e.id)),A=kM.filter(e=>C.has(e.id)).length;return(0,QO.jsxs)("div",{className:"container py-4 py-md-5",children:[(0,QO.jsx)("div",{className:"card shadow-sm mb-4",children:(0,QO.jsxs)("div",{className:"card-body d-flex flex-wrap align-items-center gap-3",children:[(null===n||void 0===n?void 0:n.photoURL)&&(0,QO.jsx)("img",{src:n.photoURL,alt:"",width:64,height:64,className:"rounded-circle",referrerPolicy:"no-referrer"}),(0,QO.jsx)("div",{className:"flex-grow-1",children:p?(0,QO.jsxs)("div",{className:"d-flex gap-2 flex-wrap align-items-center",children:[(0,QO.jsx)("input",{className:"form-control",style:{maxWidth:260},value:y,onChange:e=>x(e.target.value),maxLength:30,placeholder:"Yeni takma ad",autoF
2ocus:!0}),(0,QO.jsx)("button",{type:"button",className:"btn btn-primary",onClick:async()=>{T(!0);try{await async function(e,t){const i=(t||"").trim();if(!i)throw new Error("Takma ad bo\u015f olamaz.");if(i.length>30)throw new Error("Takma ad en fazla 30 karakter olabilir.");const n=lv(YO,"users",e),r=await P_(n);if(!r.exists())throw new Error("Profil bulunamad\u0131.");if(r.data().nicknameChanged)throw new Error("Takma ad\u0131n\u0131 sadece bir kez de\u011fi\u015ftirebilirsin.");await N_(n,{nickname:i,nicknameChanged:!0,updatedAt:Iv()})}(i.uid,y),hn.success("Takma ad\u0131n g\xfcncellendi."),g(!1)}catch(oT){hn.error(oT.message||"Bir hata olu\u015ftu.")}finally{T(!1)}},disabled:w||!y.trim(),children:"Kaydet"}),(0,QO.jsx)("button",{type:"button",className:"btn btn-outline-secondary",onClick:()=>g(!1),disabled:w,children:"Vazge\xe7"})]}):(0,QO.jsxs)(QO.Fragment,{children:[(0,QO.jsxs)("div",{className:"d-flex align-items-center gap-2 flex-wrap",children:[(0,QO.jsx)("h2",{className:"mb-0",children:(null===n||void 0===n?void 0:n.nickname)||i.displayName}),(0,QO.jsxs)("span",{className:"badge bg-warning text-dark fs-6",children:["\ud83d\udd25 ",(null===n||void 0===n?void 0:n.streak)||1," G\xfcn Seri"]})]}),(0,QO.jsx)("div",{className:"text-muted small mb-2",children:i.email}),null!==n&&void 0!==n&&n.nicknameChanged?(0,QO.jsx)("span",{className:"badge bg-secondary",children:"Takma ad de\u011fi\u015ftirildi"}):(0,QO.jsx)("button",{type:"button",className:"btn btn-sm btn-outline-secondary",onClick:()=>{x((null===n||void 0===n?void 0:n.nickname)||""),g(!0)},children:"Takma Ad\u0131 De\u011fi\u015ftir (1 hakk\u0131n var)"})]})})]})}),(0,QO.jsxs)("div",{className:"row g-3 mb-4",children:[(0,QO.jsx)("div",{className:"col-6 col-md-3",children:(0,QO.jsx)("div",{className:"card text-center shadow-sm h-100 border-primary",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("div",{className:"fs-3 fw-bold text-primary",children:(null===n||void 0===n?void 0:n.score)||0}),(0,QO.jsx)("div",{className:"text-muted small",children:"Toplam Puan"})]})})}),(0,QO.jsx)("div",{className:"col-6 col-md-3",children:(0,QO.jsx)("div",{className:"card text-center shadow-sm h-100",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("div",{className:"fs-3 fw-bold",children:(null===n||void 0===n?void 0:n.gamesPlayed)||0}),(0,QO.jsx)("div",{className:"text-muted small",children:"Oynanan Ma\xe7"})]})})}),(0,QO.jsx)("div",{className:"col-6 col-md-3",children:(0,QO.jsx)("div",{className:"card text-center shadow-sm h-100",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("div",{className:"fs-3 fw-bold text-success",children:(null===n||void 0===n?void 0:n.wins)||0}),(0,QO.jsx)("div",{className:"text-muted small",children:"Kazan\u0131lan"})]})})}),(0,QO.jsx)("div",{className:"col-6 col-md-3",children:(0,QO.jsx)("div",{className:"card text-center shadow-sm h-100",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("div",{className:"fs-3 fw-bold text-danger",children:(null===n||void 0===n?void 0:n.losses)||0}),(0,QO.jsx)("div",{className:"text-muted small",children:"Kaybedilen"})]})})})]}),(0,QO.jsxs)("div",{className:"card shadow-sm mb-4",children:[(0,QO.jsxs)("div",{className:"card-header fw-bold d-flex justify-content-between align-items-center",children:[(0,QO.jsxs)("span",{children:["\ud83c\udfc5 G\xf6rev Rozetleri (",A," / ",kM.length,")"]}),(0,QO.jsxs)("span",{className:"badge bg-primary",children:[Math.round(A/kM.length*100),"% Tamamland\u0131"]})]}),(0,QO.jsx)("div",{className:"card-body",children:(0,QO.jsx)("div",{className:"row g-3",children:kM.map(e=>{const t=C.has(e.id);return(0,QO.jsx)("div",{className:"col-12 col-sm-6 col-md-4 col-lg-3",children:(0,QO.jsxs)("div",{className:"border rounded p-3 h-100 d-flex align-items-center gap-3 transition-all ".concat(t?"bg-light border-success shadow-sm":"bg-body-tertiary opacity-50 border-dashed"),style:{position:"relative",filter:t?"none":"grayscale(90%)"},children:[(0,QO.jsx)("div",{className:"fs-1",children:e.icon}),(0,QO.jsxs)("div",{children:[(0,QO.jsxs)("div",{className:"fw-bold small d-flex align-items-center gap-1",children:[e.title,!t&&(0,QO.jsx)("span",{className:"badge bg-secondary",style:{fontSize:"0.65rem"},children:"\ud83d\udd12 Kilitli"})]}),(0,QO.jsx)("div",{className:"text-muted",style:{fontSize:"0.75rem"},children:e.desc})]})]})},e.id)})})})]}),(0,QO.jsxs)("div",{className:"card shadow-sm",children:[(0,QO.jsx)("div",{className:"card-header fw-bold",children:"Oyun Ge\xe7mi\u015fi"}),(0,QO.jsx)("div",{className:"card-body p-0",children:c?(0,QO.jsx)("div",{className:"p-3 text-muted small",children:"Y\xfckleniyor\u2026"}):0===o.length?(0,QO.jsx)("div",{className:"p-3 text-muted small",children:"Hen\xfcz kaydedilmi\u015f oyun yok."}):(0,QO.jsx)("ul",{className:"list-group list-group-flush",children:o.map(e=>{var t,i;return(0,QO.jsxs)("li",{className:"list-group-item",children:[(0,QO.jsxs)("div",{className:"d-flex justify-content-between align-items-center flex-wrap gap-2",children:[(0,QO.jsxs)("div",{children:[(0,QO.jsx)("span",{className:"badge me-2 ".concat("win"===e.result?"bg-success":"bg-danger"),children:"win"===e.result?"Kazand\u0131n":"Kaybettin"}),(0,QO.jsxs)("span",{className:"fw-bold me-2 text-dark",children:["vs. ",e.opponentNickname||"Bilgisayar"]}),(0,QO.jsxs)("span",{className:"small text-muted",children:[null!==(t=e.playedAt)&&void 0!==t&&t.toDate?e.playedAt.toDate().toLocaleStr
2ing("tr-TR"):"\u2014"," \xb7 ",e.moveCount," hamle"]})]}),(0,QO.jsx)("button",{type:"button",className:"btn btn-sm btn-outline-secondary",onClick:()=>E(S===e.id?null:e.id),children:S===e.id?"Gizle":"Hamleleri G\xf6r"})]}),S===e.id&&(0,QO.jsx)("ol",{className:"small mt-2 mb-0 ps-3",style:{maxHeight:240,overflowY:"auto"},children:null===(i=e.history)||void 0===i?void 0:i.map((e,t)=>(0,QO.jsxs)("li",{children:[(0,QO.jsx)("span",{className:"sente"===e.color?"text-dark fw-semibold":"text-danger fw-semibold",children:"sente"===e.color?"Sente":"Gote"})," \u2014 ",AM(e)]},t))})]},e.id)})})})]})]})}function OM(){const t=u((0,e.useState)([]),2),i=t[0],n=t[1],r=u((0,e.useState)(!0),2),s=r[0],a=r[1],o=u((0,e.useState)(null),2),l=o[0],h=o[1];return(0,e.useEffect)(()=>{(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;const t=m_(ov(YO,"users"),x_("score","desc"),w_(e));return(await M_(t)).docs.map(e=>m({id:e.id},e.data()))})().then(n).catch(e=>{console.error(e),h("Liderlik tablosu y\xfcklenirken bir hata olu\u015ftu.")}).finally(()=>a(!1))},[]),(0,QO.jsxs)("div",{className:"container py-4 py-md-5",children:[(0,QO.jsx)("h1",{className:"mb-2",children:"Liderlik Tablosu"}),(0,QO.jsx)("p",{className:"text-muted mb-4",children:"S\u0131ralama, oyuncular\u0131n kazand\u0131\u011f\u0131 toplam puana g\xf6re anl\u0131k g\xfcncellenir."}),(0,QO.jsx)("div",{className:"card shadow-sm mb-4 border-info",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("h5",{className:"fw-bold text-info mb-3",children:"\ud83d\udcca Puantaj Sistemi Kurallar\u0131"}),(0,QO.jsxs)("div",{className:"row g-3 small",children:[(0,QO.jsx)("div",{className:"col-12 col-md-6",children:(0,QO.jsxs)("div",{className:"p-3 bg-light rounded border",children:[(0,QO.jsx)("div",{className:"fw-bold text-dark mb-1",children:"Yapay Zekaya Kar\u015f\u0131 :"}),(0,QO.jsxs)("ul",{className:"mb-0 ps-3 text-secondary",children:[(0,QO.jsxs)("li",{children:["Galibiyet: ",(0,QO.jsx)("strong",{className:"text-success",children:"+2 Puan"})]}),(0,QO.jsxs)("li",{children:["Beraberlik: ",(0,QO.jsx)("strong",{className:"text-primary",children:"+1 Puan"})]}),(0,QO.jsxs)("li",{children:["Ma\u011flubiyet: ",(0,QO.jsx)("strong",{className:"text-muted",children:"0 Puan"})]})]})]})}),(0,QO.jsx)("div",{className:"col-12 col-md-6",children:(0,QO.jsxs)("div",{className:"p-3 bg-light rounded border",children:[(0,QO.jsx)("div",{className:"fw-bold text-dark mb-1",children:"\u015eogi Arena :"}),(0,QO.jsxs)("ul",{className:"mb-0 ps-3 text-secondary",children:[(0,QO.jsxs)("li",{children:["Galibiyet: ",(0,QO.jsx)("strong",{className:"text-success",children:"+5 Puan"})]}),(0,QO.jsxs)("li",{children:["Beraberlik: ",(0,QO.jsx)("strong",{className:"text-primary",children:"+1 Puan"})]}),(0,QO.jsxs)("li",{children:["Ma\u011flubiyet: ",(0,QO.jsx)("strong",{className:"text-danger",children:"-2 Puan"})]})]})]})})]})]})}),(0,QO.jsx)("div",{className:"card shadow-sm",children:(0,QO.jsx)("div",{className:"card-body p-0",children:s?(0,QO.jsx)("div",{className:"p-3 text-muted small",children:"Y\xfckleniyor\u2026"}):l?(0,QO.jsx)("div",{className:"p-3 text-danger small",children:l}):0===i.length?(0,QO.jsx)("div",{className:"p-3 text-muted small",children:"Hen\xfcz kimse oyun tamamlamam\u0131\u015f \u2014 ilk sen ol!"}):(0,QO.jsx)("div",{className:"table-responsive",children:(0,QO.jsxs)("table",{className:"table table-hover align-middle mb-0",children:[(0,QO.jsx)("thead",{children:(0,QO.jsxs)("tr",{className:"table-light",children:[(0,QO.jsx)("th",{style:{width:48},children:"#"}),(0,QO.jsx)("th",{children:"Oyuncu"}),(0,QO.jsx)("th",{className:"text-center",children:"Puan"}),(0,QO.jsx)("th",{className:"text-center",children:"Seri (\ud83d\udd25)"}),(0,QO.jsx)("th",{className:"text-center",children:"Oynanan Ma\xe7"}),(0,QO.jsx)("th",{className:"text-center",children:"G / B / M"})]})}),(0,QO.jsx)("tbody",{children:i.map((e,t)=>(0,QO.jsxs)("tr",{children:[(0,QO.jsx)("td",{className:"fw-bold",children:t+1}),(0,QO.jsx)("td",{children:(0,QO.jsxs)("div",{className:"d-flex align-items-center gap-2",children:[e.photoURL&&(0,QO.jsx)("img",{src:e.photoURL,alt:"",width:28,height:28,className:"rounded-circle",referrerPolicy:"no-referrer"}),(0,QO.jsx)("span",{className:"fw-semibold",children:e.nickname})]})}),(0,QO.jsx)("td",{className:"text-center fw-bold text-primary fs-5",children:e.score||0}),(0,QO.jsxs)("td",{className:"text-center text-warning fw-semibold",children:["\ud83d\udd25 ",e.streak||1," G\xfcn"]}),(0,QO.jsx)("td",{className:"text-center",children:e.gamesPlayed||0}),(0,QO.jsxs)("td",{className:"text-center",children:[(0,QO.jsxs)("span",{className:"text-success fw-semibold",children:[e.wins||0,"G"]})," / "," ",(0,QO.jsxs)("span",{className:"text-secondary",children:[e.draws||0,"B"]})," / "," ",(0,QO.jsxs)("span",{className:"text-danger",children:[e.losses||0,"M"]})]})]},e.id))})]})})})})]})}const PM=Array.from({length:9},()=>Array(9).fill(null));PM[0][8]={type:"K",color:"gote",promoted:!1},PM[2][7]={type:"P",color:"gote",promoted:!1};const MM=[{q:"Tsume Shogi (\u8a70\u5c06\u68cb) nedir?",a:"Tsume Shogi, rakip \u015fah\u0131 \xfcst \xfcste \u015fah \xe7ekerek ka\xe7\u0131\u015f b\u0131rakmayacak \u015fekilde mat etmeyi hedefleyen geleneksel \u015eogi mat bulmacalar\u0131d\u0131r. Taktiksel hesaplama yetene\u011fini geli\u015ftirmek i\xe7in en etkili e\u011fitim y\xf6ntemidir."},{q:"Elden ta\u015f s\xfcrme (Drop) kural\u0131 nas\u0131l \xe7al\u0131\u015f\u0131r?",a:"Ele ge\xe7irdi\u011finiz bir rakip ta\u015f oyundan tamamen \xe7\u0131kmaz; sizin elinize ge\xe7er ve rengi de\u011fi\u015fip sizin ta\u015f\u0131n\u0131z olur. S\u0131ran\u0131z geldi\u011finde elinizdeki ta\u015f\u0131 bo\u015f bir kareye b\u0131rakabilirsiniz."},{q:"Nifu yasa\u011f\u0131 nedir?",a:"Ayn\u0131 dik s\xfctunda ayn\u0131 oyuncunun terfi etmemi\u015f iki adet piyadesinin bulunmas\u0131 yasa\u011f\u0131d\u0131r."},{q:"\u015eogide ta\u015f terfi ettirmek zorunlu mu?",a:"\xc7o\u011fu durumda terfi iste\u011fe ba\u011fl\u0131d\u0131r. Ancak ta\u015f\u0131n gitti\u011fi karede terfi etmeden hareket etme imkan\u0131 kalm\u0131yorsa terfi ZORUNLUDUR."}];function NM(){const t=u((0,e.useState)(PM),2),i=t[0],n=t[1],r=u((0,e.useState)(null),2),s=r[0],a=r[1],o=u((0,e.useState)([]),2),l=o[0],h=o[1],c=u((0,e.useState)(!1),2),d=c[0],f=c[1],p=u((0,e.useState)(!1),2),m=p[0],g=p[1],v=u((0,e.useState)(0),2),y=v[0],x=v[1];return(0,QO.jsxs)("div",{className:"container py-4 py-md-5",children:[(0,QO.jsxs)("div",{className:"text-center mb-5",children:[(0,QO.jsx)("h1",{className:"fw-bold display-5 text-primary",children:"\u015eogi Akademi"}),(0,QO.jsx)("p",{className:"lead text-muted",children:"\u015eogi stratejilerini \xf6\u011frenin, rehberleri inceleyin, interaktif bulmacalar \xe7\xf6z\xfcn ve merak ettiklerinizi ke\u015ffedin."})]}),(0,QO.jsxs)("div",{className:"row g-4 mb-5",children:[(0,QO.jsx)("div",{className:"col-12 col-md-4",children:(0,QO.jsxs)("div",{className:"card h-100 shadow-sm border-0 bg-light text-center p-3",children:[(0,QO.jsx)("h5",{className:"fw-bold",children:"Nas\u0131l Oynan\u0131r?"}),(0,QO.jsx)("p",{className:"small text-muted",children:"Temel \u015fogi kurallar\u0131 ve oyunun amac\u0131."}),(0,QO.jsx)(Ht,{to:"/nasil-oynanir",className:"btn btn-outline-primary btn-sm mt-auto",children:"Rehbere Git"})]})}),(0,QO.jsx)("div",{className:"col-12 col-md-4",children:(0,QO.jsxs)("div",{className:"card h-100 shadow-sm border-0 bg-light text-center p-3",children:[(0,QO.jsx)("h5",{className:"fw-bold",children:"Ta\u015flar & Hareketler"}),(0,QO.jsx)("p",{className:"small text-muted",children:"8 ta\u015f \xe7e\u015fidi ve terfi bi\xe7imleri."}),(0,QO.jsx)(Ht,{to:"/taslar",className:"btn btn-outline-primary btn-sm mt-auto",children:"Ta\u015flar\u0131 \u0130ncele"})]})}),(0,QO.jsx)("div",{className:"col-12 col-md-4",children:(0,QO.jsxs)("div",{className:"card h-100 shadow-sm border-0 bg-light text-center p-3",children:[(0,QO.jsx)("h5",{className:"fw-bold",children:"\xd6zel Kurallar"}),(0,QO.jsx)("p",{className:"small text-muted",children:"Drop (Elden ta\u015f atma), Nifu yasa\u011f\u0131 ve terfi esaslar\u
20131."}),(0,QO.jsx)(Ht,{to:"/kurallar",className:"btn btn-outline-primary btn-sm mt-auto",children:"Kurallar\u0131 Oku"})]})})]}),(0,QO.jsx)("hr",{className:"my-5"}),(0,QO.jsxs)("div",{className:"card shadow border-warning mb-5",children:[(0,QO.jsxs)("div",{className:"card-header bg-warning text-dark fw-bold d-flex justify-content-between align-items-center",children:[(0,QO.jsx)("span",{children:"\ud83e\udde9 G\xfcnl\xfck Tsume Shogi (\u8a70\u5c06\u68cb) \u2014 \u0130nteraktif Tahta"}),(0,QO.jsx)("span",{className:"badge bg-dark text-light",children:"1 Hamlede Mat"})]}),(0,QO.jsxs)("div",{className:"card-body text-center p-3 p-md-4",children:[(0,QO.jsx)("h4",{className:"fw-bold mb-2",children:"1 Hamlede Mat Bulmacas\u0131 (1-Handume)"}),(0,QO.jsxs)("p",{className:"text-muted mb-3",children:["S\u0131ra Sente'de! Elinizdeki ",(0,QO.jsx)("strong",{children:"Alt\u0131n General (\u91d1)"})," ta\u015f\u0131n\u0131 se\xe7ip tahta \xfczerinde do\u011fru kareye b\u0131rakarak rakip \u015eah'\u0131 mat edin."]}),(0,QO.jsxs)("div",{className:"mb-3",children:[(0,QO.jsx)("span",{className:"fw-semibold me-2",children:"Elinizdeki Ta\u015f:"}),d?(0,QO.jsx)("span",{className:"text-muted small",children:"(Elde ta\u015f kalmad\u0131)"}):(0,QO.jsxs)("button",{type:"button",className:"btn ".concat("G"===s?"btn-success":"btn-outline-primary"," fw-bold px-3 py-2"),onClick:()=>(e=>{d||(s===e?(a(null),h([])):(a(e),h([{row:1,col:7},{row:0,col:7},{row:1,col:8}])))})("G"),children:[gM.G," (Alt\u0131n General) ",(0,QO.jsx)("span",{className:"badge bg-light text-dark ms-1",children:"1"})]})]}),(0,QO.jsx)("div",{className:"d-flex justify-content-center mb-3",children:(0,QO.jsx)("div",{style:{maxWidth:420,width:"100%"},children:(0,QO.jsx)(mM,{rows:9,cols:9,cellSize:46,board:i,pieceLabels:gM,promotedLabels:vM,legalTargets:l,onSquareClick:(e,t)=>{if(!d&&s)if(1===e&&7===t&&"G"===s){const e=i.map(e=>[...e]);e[1][7]={type:"G",color:"sente",promoted:!1},n(e),a(null),h([]),f(!0),hn.success("\ud83c\udf89 Tebrikler! 1 Hamlede Mat (Tsume Shogi) \xe7\xf6z\xfcld\xfc!")}else hn.error("Yanl\u0131\u015f hamle! \u015eah ka\xe7abilir veya tehdit alt\u0131nda kalmaz. Tekrar deneyin."),a(null),h([])}})})}),d&&(0,QO.jsx)("div",{className:"alert alert-success fw-bold max-w-md mx-auto mb-3",children:"\ud83c\udf89 Harika! Alt\u0131n General'i 2-2 karesine atarak \u015eah'\u0131n t\xfcm ka\xe7\u0131\u015f a\xe7\u0131lar\u0131n\u0131 kapatt\u0131n\u0131z ve mat ettiniz!"}),(0,QO.jsxs)("div",{className:"d-flex justify-content-center gap-2",children:[(0,QO.jsx)("button",{className:"btn btn-sm btn-outline-secondary",onClick:()=>g(!m),children:m?"\u0130pucunu Gizle":"\ud83d\udca1 \u0130pucu Al"}),d&&(0,QO.jsx)("button",{className:"btn btn-sm btn-warning",onClick:()=>{n(PM),a(null),h([]),f(!1)},children:"\ud83d\udd04 Yeniden Dene"})]}),m&&(0,QO.jsxs)("div",{className:"alert alert-info mt-3 small max-w-md mx-auto mb-0",children:["\ud83d\udca1 ",(0,QO.jsx)("strong",{children:"\u0130pucu:"})," Alt\u0131n General \xf6ne ve \xe7aprazlara kontrol sa\u011flar. \u015eah'\u0131n tam \xf6n\xfcndeki ",(0,QO.jsx)("strong",{children:"2-2"})," karesine atarak ka\xe7\u0131\u015f yollar\u0131n\u0131 tamamen kilitleyebilirsiniz."]})]})]}),(0,QO.jsx)("hr",{className:"my-5"}),(0,QO.jsxs)("div",{className:"mt-5",children:[(0,QO.jsxs)("div",{className:"text-center mb-4",children:[(0,QO.jsx)("h3",{className:"fw-bold",children:"\u2753 Akademi S\u0131k\xe7a Sorulan Sorular"}),(0,QO.jsx)("p",{className:"text-muted small",children:"\u015eogi \xf6\u011frenirken en \xe7ok merak edilen konular."})]}),(0,QO.jsx)("div",{className:"accordion shadow-sm max-w-3xl mx-auto",children:MM.map((e,t)=>(0,QO.jsxs)("div",{className:"accordion-item",children:[(0,QO.jsx)("h2",{className:"accordion-header",children:(0,QO.jsx)("button",{className:"accordion-button ".concat(y!==t?"collapsed":""," fw-semibold"),type:"button",onClick:()=>x(y===t?null:t),children:e.q})}),y===t&&(0,QO.jsx)("div",{className:"accordion-collapse collapse show",children:(0,QO.jsx)("div",{className:"accordion-body text-secondary small",style:{lineHeight:"1.7"},children:e.a})})]},t))}),(0,QO.jsx)("div",{className:"text-center mt-4",children:(0,QO.jsx)(Ht,{to:"/sss",className:"btn btn-link text-decoration-none fw-semibold",children:"T\xfcm S\u0131k\xe7a Sorulan Sorular\u0131 G\xf6r (25+ Soru & Cevap) \u2192"})})]})]})}function IM(){var t;const i=$O().user,n=(0,e.useRef)(null);
2n.current||(n.current=new yM);const r=n.current,s=u((0,e.useState)(!1),2),a=s[0],o=s[1],l=u((0,e.useState)(null),2),h=l[0],c=l[1],d=u((0,e.useState)(null),2),f=d[0],p=d[1],m=u((0,e.useState)(null),2),g=m[0],v=m[1],y=u((0,e.useState)({board:r.board(),lastMove:null}),2),x=y[0],b=y[1],w=u((0,e.useState)(null),2),T=w[0],_=w[1],S=u((0,e.useState)(null),2),E=S[0],C=S[1],A=u((0,e.useState)([]),2),k=A[0],R=A[1],O={uid:(null===i||void 0===i?void 0:i.uid)||"guest_".concat(Math.random().toString(36).substring(2,7)),nickname:(null===i||void 0===i?void 0:i.displayName)||(null===i||void 0===i||null===(t=i.email)||void 0===t?void 0:t.split("@")[0])||"Oyuncu",photoURL:(null===i||void 0===i?void 0:i.photoURL)||""};(0,e.useEffect)(()=>{if(!h)return;const e=function(e,t){const i=CO(oP,"rooms/".concat(e));return LO(i,e=>{t(e.val())}),()=>DO(i)}(h,e=>{if(e&&(v(e),e.lastMove)){var t,i,n,s,a,o,l,h;const u=r.history(),c=u[u.length-1];c&&(null===(t=c.from)||void 0===t?void 0:t.row)===(null===(i=e.lastMove.from)||void 0===i?void 0:i.row)&&(null===(n=c.from)||void 0===n?void 0:n.col)===(null===(s=e.lastMove.from)||void 0===s?void 0:s.col)&&(null===(a=c.to)||void 0===a?void 0:a.row)===(null===(o=e.lastMove.to)||void 0===o?void 0:o.row)&&(null===(l=c.to)||void 0===l?void 0:l.col)===(null===(h=e.lastMove.to)||void 0===h?void 0:h.col)||("drop"===e.lastMove.type?r.drop({type:e.lastMove.pieceType||e.lastMove.piece,row:e.lastMove.to.row,col:e.lastMove.to.col,color:e.lastMove.color}):"move"===e.lastMove.type&&r.move({from:e.lastMove.from,to:e.lastMove.to,promote:e.lastMove.promoted}),b({board:r.board(),lastMove:e.lastMove}))}});return()=>e()},[h,r]);const P=()=>{_(null),C(null),R([])},M=(0,e.useCallback)(async(e,t)=>{if(!g||"playing"!==g.status||g.turn!==f)return;const i=r.board(),n=i[e][t];if(E){if(k.some(i=>i.row===e&&i.col===t)){const i=r.drop({type:E,row:e,col:t,color:f});P(),b({board:r.board(),lastMove:i});const n="sente"===f?"gote":"sente";await uP(h,i,n)}else P();return}if(T){if(k.some(i=>i.row===e&&i.col===t)){const n=((e,t,i)=>{if(!e||e.promoted||["G","K"].includes(e.type))return{canPromote:!1,mustPromote:!1};const n="sente"===e.color;if(!(n?i<=2||t<=2:i>=6||t>=6))return{canPromote:!1,mustPromote:!1};let r=!1;return"P"===e.type||"L"===e.type?r=n?0===i:8===i:"N"===e.type&&(r=n?i<=1:i>=7),{canPromote:!0,mustPromote:r}})(i[T.row][T.col],T.row,e),s=n.canPromote;let a=!1;n.mustPromote?a=!0:s&&(a=await new Promise(e=>{hn.confirm("Terfi / Y\xfckseltme","Bu ta\u015f\u0131 terfi ettirmek (y\xfckseltmek) ister misiniz?",()=>e(!0),()=>e(!1))}));const o=r.move({from:T,to:{row:e,col:t},promote:a});P(),b({board:r.board(),lastMove:o});const l="sente"===f?"gote":"sente";return await uP(h,o,l),void("K"===o.captured&&(await async function(e,t,i){const n=CO(oP,"rooms/".concat(e));await OO(n,{status:"finished",winner:t,reason:i,finishedAt:Date.now()})}(h,f,"king-captured"),hn.success("Tebrikler! Rakip \u015eah\u0131 alarak ma\xe7\u0131 kazand\u0131n\u0131z.")))}return void(n&&n.color===f?(_({row:e,col:t}),R(r.moves({row:e,col:t}).map(e=>e.to))):P())}n&&n.color===f&&(_({row:e,col:t}),R(r.moves({row:e,col:t}).map(e=>e.to)))},[g,f,E,k,T,r,h]),N=e=>{const t=r.hands(),i=Object.entries(t[e]||{}).filter(e=>u(e,2)[1]>0);return 0===i.length?(0,QO.jsx)("span",{className:"text-muted small",children:"(elde ta\u015f yok)"}):i.map(t=>{let i=u(t,2),n=i[0],s=i[1];return(0,QO.jsxs)("button",{type:"button",onClick:()=>((e,t)=>{e===f&&(null===g||void 0===g?void 0:g.turn)===f&&(_(null),E!==t?(C(t),R(r.dropTargets(t,f))):P())})(e,n),className:"btn me-1 mb-1 px-3 py-2 "+(E===n&&(null===g||void 0===g?void 0:g.turn)===e?"btn-success":"btn-outline-secondary"),disabled:e!==f||(null===g||void 0===g?void 0:g.turn)!==f,children:[gM[n]," ",(0,QO.jsx)("span",{className:"badge bg-light text-dark ms-1",children:s})]},n)})};return(0,QO.jsxs)("div",{className:"container py-4",children:[(0,QO.jsx)("h2",{className:"fw-bold text-center mb-4",children:"\u015eogi Arena (Online)"}),h?(0,QO.jsxs)("div",{className:"card shadow-sm",children:[(0,QO.jsx)("div",{className:"card-header d-flex justify-content-between align-items-center",children:(0,QO.jsxs)("span",{className:"badge bg-primary",children:["Taraf\u0131n\u0131z: ","sente"===f?"Sente (Siyah)":"Gote (Beyaz)"]})}),(0,QO.jsxs)("div",{className:"card-body d-flex flex-column align-items-center gap-3",children:["finished"===(null===g||void 0===g?void 0:g.status)&&(0,QO.jsxs)("div",{className:"alert alert-success text-center w-100 mb-0",children:["Oyun Bitti! Kazanan:"," ",(0,QO.jsx)("strong",{children:"sente"===g.winner?"Sente":"Gote"})]}),(0,QO.jsxs)("div",{className:"w-100 text-center",children:[(0,QO.jsxs)("div",{className:"fw-semibold text-danger",children:["Rakip (","sente"===f?"Gote":"Sente",") \u2014 Elindekiler"]}),(0,QO.jsx)("div",{children:N("sente"===f?"gote":"sente")})]}),(0,QO.jsx)(mM,{rows:9,cols:9,cellSize:64,board:x.board,lastMove:x.lastMove,pieceLabels:gM,promotedLabels:vM,selected:T,legalTargets:k,onSquareClick:M,flipBoard:"gote"===f}),(0,QO.jsxs)("div",{className:"w-100 text-center",children:[(0,QO.jsxs)("div",{className:"fw-semibold text-primary",children:["Siz (",f,") \u2014 Elindekiler"]}),(0,QO.jsx)("div",{children:N(f)})]}),(0,QO.jsxs)("div",{className:"fs-5 mt-2",children:["S\u0131ra:"," ",(0,QO.jsx)("span",{className:"badge ".concat((null===g||void 0===g?void 0:g.turn)===f?"bg-success":"bg-secondary"),children:(null===g||void 0===g?void 0:g.turn)===f?"Sizde!":"Rakipte..."})]})]})]}):(0,QO.jsxs)("div",{className:"card shadow-sm max-w-md mx-auto text-center p-4",children:[(0,QO.jsx)("h4",{children:"\xc7evrimi\xe7i Oyuncu Arama"}),(0,QO.jsx)("p",{className:"text-muted small",children:"Ger\xe7ek bir rakiple e\u015fle\u015fmek i\xe7in arama ba\u015flat\u0131n."}),(0,QO.jsx)("button",{type:"button",className:"btn btn-danger btn-lg fw-bold mt-3",onClick:()=>{o(!0),r.reset(),b({board:r.board(),lastMove:null}),lP(O,e=>{let t=e.roomId,i=e.role;c(t),p(i),o(!1),hn.success("Ma\xe7 bulundu! Rol\xfcn\xfcz: ".concat("sente"===i?"Sente (Siyah)":"Gote (Beyaz)"))})},disabled:a,children:a?(0,QO.jsxs)(QO.Fragment,{children:[(0,QO.jsx)("span",{className:"spinner-border spinner-border-sm me-2"}),"Rakip Arat\u0131l\u0131yor..."]}):"H\u0131zl\u0131 Ma\xe7 Bul"})]})]})}function LM(){const t=u((0,e.useState)({name:"",email:"",subject:"",message:""}),2),i=t[0],n=t[1];return(0,QO.jsxs)("div",{className:"container py-4 py-md-5",children:[(0,QO.jsx)("h1",{className:"fw-bold mb-4",children:"\u0130leti\u015fim"}),(0,QO.jsxs)("div",{className:"row g-4",children:[(0,QO.jsx)("div",{className:"col-12 col-md-5",children:(0,QO.jsx)("div",{className:"card shadow-sm h-100",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("h5",{className:"card-title fw-bold text-primary mb-3",children:"Bizimle \u0130leti\u015fime Ge\xe7in"}),(0,QO.jsx)("p",{className:"card-text text-muted mb-4",children:"\u015eogi T\xfcrkiye toplulu\u011fu ile ilgili g\xf6r\xfc\u015f, \xf6neri, i\u015f birli\u011fi veya turnuva organizasyonlar\u0131 i\xe7in a\u015fa\u011f\u0131daki formdan veya sosyal medya hesaplar\u0131m\u0131zdan bize ula\u015fabilirsiniz."}),(0,QO.jsxs)("div",{className:"mb-3",children:[(0,QO.jsx)("strong",{className:"d-block text-dark",children:"E-posta:"}),(0,QO.jsx)("span",{className:"text-muted",children:"[email protected]"})]}),(0,QO.jsxs)("div",{className:"mb-4",children:[(0,QO.jsx)("strong",{className:"d-block text-dark mb-2",children:"Sosyal Medya:"}),(0,QO.jsxs)("div",{className:"d-flex gap-2",children:[(0,QO.jsx)("a",{href:"https://www.youtube.com/@\u015eogiT\xfcrkiye",target:"_blank",rel:"noopener noreferrer",className:"btn btn-outline-danger btn-sm",children:"YouTube"}),(0,QO.jsx)("a",{href:"https://instagram.com/sogiturkiye",target:"_blank",rel:"noopener noreferrer",className:"btn btn-outline-primary btn-sm",children:"Instagram"})]})]})]})})}),(0,QO.jsx)("div",{className:"col-12 col-md-7",children:(0,QO.jsx)("div",{className:"card shadow-sm",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("h5",{className:"card-title fw-bold mb-3",children:"\u0130leti\u015fim Formu"}),(0,QO.jsxs)("form",{onSubmit:e=>{e.preventDefault(),hn.success("Mesaj\u0131n\u0131z ba\u015far\u0131yla al\u0131nd\u0131. En k\u0131sa s\xfcrede d\xf6n\xfc\u015f yapaca\u011f\u0131z!"),n({name:"",email:"",subject:"",message:""})},children:[(0,QO.jsxs)("div",{className:"mb-3",children:[(0,QO.jsx)("label",{className:"form-label small fw-semibold",children:"Ad\u0131n\u0131z Soyad\u0131n\u0131z"}),(0,QO.jsx)("input",{type:"text",className:"form-control",required:!0,value:i.name,onChange:e=>n(m(m({},i),{},{name:e.target.value}))})]}),(0,QO.jsxs)("div",{className:"mb-3",children:[(0,QO.jsx)("label",{className:"form-label small fw-semibold",children:"E-posta Adresiniz"}),(0,QO.jsx)("input",{type:"email",className:"form-control",required:!0,value:i.email,onChange:e=>n(m(m({},i),{},{email:e.target.value}))})]}),(0,QO.jsxs)("div",{className:"mb-3",children:[(0,QO.jsx)("label",{className:"form-label small fw-semibold",children:"Konu"}),(0,QO.jsx)("input",{type:"text",className:"form-control",required:!0,value:i.subject,onChange:e=>n(m(m({},i),{},{subject:e.target.value}))})]}),(0,QO.jsxs)("div",{className:"mb-3",children:[(0,QO.jsx)("label",{className:"form-label small fw-semibold",children:"Mesaj\u0131n\u0131z"}),(0,QO.jsx)("textarea",{className:"form-control",rows:"4",required:!0,value:i.message,onChange:e=>n(m(m({},i),{},{message:e.target.value}))})]}),(0,QO.jsx)("button",{type:"submit",className:"btn btn-primary px-4",children:"G\xf6nder"})]})]})})})]})]})}const DM=[{q:"Nifu nedir ve neden yasakt\u0131r?",a:'Nifu (\u4e8c\u6b69, \u0130ki Piyade), ayn\u0131 dik s\xfctunda (dosyada) ayn\u0131 oyuncunun terfi etmemi\u015f iki adet piyadesinin bulunmas\u0131 yasa\u011f\u0131d\u0131r. \u015eoginin en temel k\u0131s\u0131tlama kurallar\u0131ndan biridir. E\u011fer bir s\xfctunda zaten a\xe7\u0131k bir piyadeniz varsa, elinizdeki bir di\u011fer piyadeyi o s\xfctuna b\u0131rakamazs\u0131n\u0131z (drop yapamazs\u0131n\u0131z). Ancak terfi etmi\u015f bir piyade (Tokin) art\u0131k "Piyade" say\u0131lmad\u0131\u011f\u0131 i\xe7in ayn\u0131 s\xfctuna ikinci bir a\xe7\u0131k piyade atabilirsiniz.'},{q:"\u015eogide ta\u015f terfi ettirmek zorunlu mu?",a:"\xc7o\u011fu durumda terfi iste\u011fe ba\u011fl\u0131d\u0131r (opsiyoneldir). Ta\u015f\u0131n\u0131z terfi b\xf6lgesine (rakip taraf\u0131ndaki ilk 3 s\u0131ra) girdi\u011finde, b\xf6lge i\xe7inde hareket etti\u011finde veya b\xf6lgeden \xe7\u0131kt\u0131\u011f\u0131nda terfi edip etmeyece\u011finize karar verebilirsiniz. Ancak ta\u015f\u0131n gitti\u011fi karede terfi etmeden hareket etme imkan\u0131 kalm\u0131yorta terfi ZORUNLUDUR. \xd6rne\u011fin: Piyade ve M\u0131zrak son s\u0131raya, At (\u015e\xf6valye) ise son iki s\u0131raya g
2iderse zorunlu olarak terfi eder."},{q:"Elden ta\u015f s\xfcrme (Drop) kural\u0131 nas\u0131l \xe7al\u0131\u015f\u0131r?",a:'\u015eogiyi klasik satran\xe7tan ay\u0131ran en \xf6zg\xfcn kurald\u0131r. Ele ge\xe7irdi\u011finiz bir rakip ta\u015f oyundan tamamen \xe7\u0131kmaz; sizin "elinize" (koma-dai) ge\xe7er ve rengi de\u011fi\u015fip sizin ta\u015f\u0131n\u0131z olur. S\u0131ran\u0131z geldi\u011finde tahtadaki bir ta\u015f\u0131 oynamak yerine, elinizdeki bu ta\u015flardan birini bo\u015f bir kareye "b\u0131rakabilirsiniz". Elden at\u0131lan ta\u015flar her zaman terfi etmemi\u015f y\xfcz\xfcyle konur.'},{q:"Terfi b\xf6lgesi neresidir?",a:"Tahtan\u0131n rakip oyuncuya ait olan ilk 3 s\u0131ras\u0131 (Sente i\xe7in 1, 2 ve 3. s\u0131ralar; Gote i\xe7in 7, 8 ve 9. s\u0131ralar) terfi b\xf6lgesidir."},{q:"Hangi ta\u015flar terfi edemez?",a:"\u015eah (\u014c/Gyoku) ve Alt\u0131n General (Kin) ta\u015flar\u0131 terfi etmez. Zaten do\u011fu\u015ftan en \xfcst formlar\u0131ndad\u0131rlar."},{q:"G\xfcm\xfc\u015f General terfi edince nas\u0131l hareket eder?",a:'G\xfcm\xfc\u015f General terfi etti\u011finde "Narigin" ad\u0131n\u0131 al\u0131r ve tam olarak bir Alt\u0131n General gibi hareket etmeye ba\u015flar (\xd6ne, yanlara, arkaya d\xfcz ve \xf6ne \xe7apraz \u2014 6 y\xf6ne 1 kare).'},{q:"Piyade terfi edince ne olur?",a:'Piyade terfi etti\u011finde "Tokin" (\u3068) ad\u0131n\u0131 al\u0131r. Hareketi t\u0131pk\u0131 bir Alt\u0131n General gibi olur ve \xe7ok g\xfc\xe7l\xfc bir h\xfccum ta\u015f\u0131na d\xf6n\xfc\u015f\xfcr.'},{q:"Kale ve Fil terfi edince eski hareket kabiliyetlerini kaybeder mi?",a:'Hay\u0131r, kaybetmezler! Aksi takdirde daha da g\xfc\xe7lenirler. Kale terfi edince "Ejderha" (Ryu) olur; dikey/yatay s\u0131n\u0131rs\u0131z hareketinin yan\u0131 s\u0131ra \xe7apraz tek kare gitme yetene\u011fi kazan\u0131r. Fil terfi edince "At" (Uma) olur; \xe7apraz s\u0131n\u0131rs\u0131z hareketinin yan\u0131 s\u0131ra dikey/yatay tek kare gitme yetene\u011fi kazan\u0131r.'},{q:"Elden b\u0131rak\u0131lan (Drop edilen) bir ta\u015f hemen o hamlede terfi edebilir mi?",a:"Hay\u0131r. Elden b\u0131rak\u0131lan bir ta\u015f, do\u011frudan terfi b\xf6lgesine at\u0131lsa dahi BIKILDI\u011eI AN TERF\u0130 EDEMEZ. Terfi edebilmek i\xe7in tahtada en az bir hamle hareket etmesi gerekir."},{q:"Uchifuzume nedir?",a:"Uchifuzume, elden piyade atarak rakip \u015eah'\u0131 DO\u011eRUDAN MAT ETME YASA\u011eIDIR. Elden piyade atarak \u015fah \xe7ekebilirsiniz, ancak o at\u0131\u015f rakibi an\u0131nda mat ediyorsa bu hamle kural d\u0131\u015f\u0131d\u0131r. (Not: Tahtadaki mevcut bir piyadeyi ilerleterek mat etmek ise tamamen serbesttir)."},{q:"Sennichite (Pozisyon Tekrar\u0131) durumunda ne olur?",a:"Ayn\u0131 tahta pozisyonunun ve elde tutulan ta\u015f durumunun bir ma\xe7ta 4 kez birebir tekrarlanmas\u0131na Sennichite denir. Bu durumda ma\xe7 berabere (ge\xe7ersiz) say\u0131l\u0131r ve oyuncular renkleri de\u011fi\u015ftirip ma\xe7\u0131 yeniden oynarlar."},{q:"\u015eogide berabere (Pat) var m\u0131d\u0131r?",a:'Klasik satran\xe7taki gibi bir "Pat" kural\u0131 yoktur. S\u0131ras\u0131 gelen oyuncunun kurala uygun yapabilece\u011fi hi\xe7bir hamlesi kalmam\u0131\u015fsa (\u015fah alt\u0131nda olmasa bile) oyunu KAYBEDER.'},{q:"\u015eogi tahtas\u0131 ka\xe7 kareden olu\u015fur?",a:"\u015eogi tahtas\u0131 9\xd79 olmak \xfczere toplam 81 kareden olu\u015fur. Satran\xe7tan farkl\u0131 olarak t\xfcm kareler tek renktir."},{q:"Sente ve Gote ne anlama gelir?",a:"Sente (\u5148\u624b), oyuna ilk ba\u015flayan (Siyah) oyuncudur. Gote (\u5f8c\u624b), ikinci ba\u015flayan (Beyaz) oyuncudur."},{q:"Oyuna kim ba\u015flar, kura nas\u0131l \xe7ekilir?",a:'Geleneksel \u015fogide oyuna ba\u015flayacak taraf\u0131 belirlemek i\xe7in "Furi-koma" (ta\u015f savurma) yap\u0131l\u0131r. 5 adet piyade ta\u015f sallan\u0131p tahtaya at\u0131l\u0131r; a\xe7\u0131k piyade say\u0131s\u0131 fazla \xe7\u0131karsa ta\u015f\u0131 atan oyuncu Sente olur.'},{q:"M\u0131zrak (Kyo) ta\u015f\u0131 nas\u0131l hareket eder?",a:"M\u0131zrak sadece ileri do\u011fru, \xf6n\xfcnde ta\u015f olmad\u0131\u011f\u0131 s\xfcrece istedi\u011fi kadar kare gidebilir. Yanlara, geriye veya \xe7aprazlara hareket edemez."},{q:"At (Kei) ta\u015f\u0131 di\u011fer ta\u015flar\u0131n \xfczerinden atlayabilir mi?",a:'Evet! \u015eogide aradaki ta\u015flar\u0131n \xfczerinden atlayabilen TEK TA\u015e At (\u015e\xf6valye)\'d\u0131r. Tam iki kare ileri ve bir kare yana "L" \u015feklinde z\u0131plar.'},{q:"Ele ge\xe7irilen bir ta\u015f elden at\u0131l\u0131rken terfi etmi\u015f haliyle at\u0131labilir mi?",a:"Hay\u0131r. Ele ge\xe7irdi\u011finiz ta\u015f rakipte terfi etmi\u015f bir ta\u015f dahi olsa (\xf6rne\u011fin Tokin veya Ejderha), sizin elinize ge\xe7ti\u011finde orijinal terfi etmemi\u015f haline (Piyade veya Kale) d\xf6n\xfc\u015f\xfcr."},{q:"Tsume Shogi (\u8a70\u5c06\u68cb) nedir?",a:"Tsume Shogi, rakip \u015fah\u0131 \xfcst \xfcste \u015fah \xe7ekerek ka\xe7\u0131\u015f b\u0131rakmayacak \u015fekilde mat etmeyi hedefleyen geleneksel \u015eogi mat bulmacalar\u0131d\u0131r. Tsume bulmacalar\u0131nda kural gere\u011fi h\xfccum eden taraf\u0131n HER HAMLES\u0130NDE \u015fah \xe7ekmesi zorunludur ve rakip her defas\u0131nda mat\u0131 olabildi\u011fince geciktirecek en do\u011fru savunma hamlelerini y
2apar. Taktiksel hesaplama yetene\u011fini geli\u015ftirmek i\xe7in en etkili e\u011fitim y\xf6ntemidir."},{q:"\u015eogide Rok yapma var m\u0131d\u0131r?",a:'Klasik satran\xe7taki gibi tek hamlede \u015eah ve Kale\'nin yerini de\u011fi\u015ftiren \xf6zel bir "Rok" hamlesi yoktur. Bunun yerine \u015eah\'\u0131 korumak i\xe7in ta\u015flarla ad\u0131m ad\u0131m "Kale" (Yagura, Mino, Anaguma vb.) ad\u0131 verilen savunma yap\u0131lar\u0131 in\u015fa edilir.'},{q:"Bir oyunda en fazla ka\xe7 ta\u015f elinizde bulunabilir?",a:"Herhangi bir s\u0131n\u0131r yoktur. Ele ge\xe7irdi\u011finiz t\xfcm ta\u015flar\u0131 elinizde tutabilir ve istedi\u011finiz s\u0131rayla tahtaya s\xfcrebilirsiniz."},{q:"Gyoku ve \u014c aras\u0131ndaki fark nedir?",a:'\u0130kisi de \u015eah ta\u015f\u0131d\u0131r. \xd6nemli/k\u0131demli oyuncu "\u014c" (\u738b - Kral), di\u011fer oyuncu ise "Gyoku" (\u7389 - M\xfccevher \u015eah) ta\u015f\u0131n\u0131 kullan\u0131r. Hareket kabiliyetleri ve kurallar\u0131 birebir ayn\u0131d\u0131r.'},{q:"Japonya \u015eogi Birli\u011fi (Nihon Shogi Renmei) nedir?",a:"1924 y\u0131l\u0131nda kurulan, profesyonel \u015fogi oyuncular\u0131n\u0131 (Kishi) derecelendiren, resmi turnuvalar\u0131 d\xfczenleyen ve oyunun kurallar\u0131n\u0131 koruyan resmi Japon kurumudur."},{q:"\u015eogide hamle notasyonu nas\u0131l yaz\u0131l\u0131r?",a:"USI (Universal Shogi Interface) standartlar\u0131nda tahtan\u0131n sa\u011f \xfcst k\xf6\u015fesi 11 (1-1), sol alt k\xf6\u015fesi 99 (9-9) kabul edilir. Dikey s\xfctunlar rakamla (1-9), yatay s\u0131ralar rakam veya harfle g\xf6sterilir."},{q:"Yapay zeka \u015fogi oyuncular\u0131n\u0131 yenebilir mi?",a:"Evet. 2010'lu y\u0131llar\u0131n ba\u015f\u0131ndan itibaren YaneuraOu ve Elmo gibi geli\u015fmi\u015f \u015fogi motorlar\u0131 d\xfcnyan\u0131n en iyi profesyonel \u015fogi insan \u015fampiyonlar\u0131n\u0131 ma\u011flup etmeyi ba\u015farm\u0131\u015ft\u0131r."},{q:"\u015eogi \xf6\u011frenmek \xe7ocuklarda zeka geli\u015fimine faydal\u0131 m\u0131d\u0131r?",a:"Kesinlikle. \u015eogi, ele ge\xe7irilen ta\u015flar\u0131n tekrar kullan\u0131lmas\u0131 kural\u0131 nedeniyle \xe7ok katmanl\u0131 bir \xf6ng\xf6r\xfc, stratejik planlama, odaklanma ve karar verme becerisi kazand\u0131r\u0131r."}];function FM(){const t=u((0,e.useState)(""),2),i=t[0],n=t[1],r=u((0,e.useState)(0),2),s=r[0],a=r[1],o=DM.filter(e=>e.q.toLowerCase().includes(i.toLowerCase())||e.a.toLowerCase().includes(i.toLowerCase())),l={"@context":"https://schema.org","@type":"FAQPage",mainEntity:DM.map(e=>({"@type":"Question",name:e.q,acceptedAnswer:{"@type":"Answer",text:e.a}}))};return(0,QO.jsxs)("div",{className:"container py-4 py-md-5",children:[(0,QO.jsxs)(an,{children:[(0,QO.jsx)("title",{children:"S\u0131k\xe7a Sorulan Sorular (SSS) \u2014 \u015eogi T\xfcrkiye"}),(0,QO.jsx)("meta",{name:"description",content:"\u015eogi kurallar\u0131, Nifu yasa\u011f\u0131, ta\u015f terfi esaslar\u0131, elden ta\u015f s\xfcrme kural\u0131 ve merak edilen t\xfcm sorular\u0131n T\xfcrk\xe7e cevaplar\u0131."}),(0,QO.jsx)("link",{rel:"canonical",href:"https://sogiturkiye.com/sss"}),(0,QO.jsx)("script",{type:"application/ld+json",children:JSON.stringify(l)})]}),(0,QO.jsxs)("div",{className:"text-center mb-5",children:[(0,QO.jsx)("h1",{className:"fw-bold display-6 mb-2",children:"S\u0131k\xe7a Sorulan Sorular"}),(0,QO.jsx)("p",{className:"lead text-muted",children:"\u015eogi (Japon Satran\xe7\u0131) hakk\u0131nda merak etti\u011finiz t\xfcm kurallar, terimler ve stratejik detaylar."})]}),(0,QO.jsx)("div",{className:"row justify-content-center mb-4",children:(0,QO.jsx)("div",{className:"col-12 col-md-8",children:(0,QO.jsx)("input",{type:"text",className:"form-control form-control-lg shadow-sm",placeholder:"Soru veya kural ara (\xf6r: Nifu, Terfi, Drop...)",value:i,onChange:e=>n(e.target.value)})})}),(0,QO.jsx)("div",{className:"row justify-content-center",children:(0,QO.jsx)("div",{className:"col-12 col-md-10",children:0===o.length?(0,QO.jsx)("div",{className:"text-center text-muted py-5 card shadow-sm",children:"Arad\u0131\u011f\u0131n\u0131z kritere uygun bir soru bulunamad\u0131."}):(0,QO.jsx)("div",{className:"accordion shadow-sm",children:o.map((e,t)=>{const i=s===t;return(0,QO.jsxs)("div",{className:"accordion-item",children:[(0,QO.jsx)("h2",{className:"accordion-header",children:(0,QO.jsx)("button",{className:"accordion-button ".concat(i?"":"collapsed"," fw-semibold"),type:"button",onClick:()=>(e=>{a(s===e?null:e)})(t),children:e.q})}),i&&(0,QO.jsx)("div",{className:"accordion-collapse collapse show",children:(0,QO.jsx)("div",{className:"accordion-body text-secondary",style:{lineHeight:"1.7"},children:e.a})})]},t)})})})}),(0,QO.jsx)("div",{className:"card shadow-sm mt-5 bg-light text-center border-0 p-4",children:(0,QO.jsxs)("div",{className:"card-body",children:[(0,QO.jsx)("h5",{className:"fw-bold mb-2",children:"Arad\u0131\u011f\u0131n\u0131z cevab\u0131 bulamad\u0131n\u0131z m\u0131?"}),(0,QO.jsx)("p",{className:"text-muted mb-3",children:"Akl\u0131n\u0131za tak\u0131lan di\u011fer sorular veya turnuva detaylar\u0131 i\xe7in ileti\u015fim sayfam\u0131zdan bize ula\u015fabilirsiniz."}),(0,QO.jsx)(Ht,{to:"/iletisim",className:"btn btn-primary px-4 fw-semibold",children:"Bize Ula\u015f\u0131n"})]})})]})}const BM="sogi.oyna",UM="https://play.google.com/store/apps/details?id=".concat(BM)+"&referrer=utm_source%3Dsogioyna_web%26utm_medium%3Dinstall_banner",zM="sogi_app_banner_hidden_until",VM=["/oyna","/arena"];function HM(e){try{localStorage.setItem(zM,String(Date.now()+864e5*e))}catch(t){}}function jM(){const t=Le().pathname,i=u((0,e.useState)(!1),2),n=i[0],r=i[1],s=u((0,e.useState)(!1),2),a=s[0],o=s[1];(0,e.useEffect)(()=>
2{if(!function(){var e,t;const i=navigator.userAgent||"";return!!/Android/i.test(i)&&!/; wv\)/.test(i)&&!document.referrer.startsWith("android-app://")&&(null===(e=(t=window).matchMedia)||void 0===e||!e.call(t,"(display-mode: standalone)").matches)}()||function(){try{return Number(localStorage.getItem(zM))||0}catch(e){return 0}}()>Date.now())return;let e=!1;const t=setTimeout(async()=>{try{var t,i;const e=await Promise.race([null===(t=(i=navigator).getInstalledRelatedApps)||void 0===t?void 0:t.call(i),new Promise(e=>setTimeout(e,1e3))]);if(null!==e&&void 0!==e&&e.some(e=>e.id===BM))return}catch(n){}e||r(!0)},1500);return()=>{e=!0,clearTimeout(t)}},[]);const l=n&&!a&&!VM.includes(t);if((0,e.useEffect)(()=>{l&&XO("app_banner_view",{page_path:t})},[l]),!l)return null;const h=()=>{XO("app_banner_dismiss",{page_path:t}),HM(7),o(!0)};return(0,QO.jsxs)("div",{className:"app-install-banner",role:"dialog","aria-labelledby":"app-install-title",children:[(0,QO.jsx)("button",{type:"button",className:"app-install-close","aria-label":"Kapat",onClick:h,children:"\xd7"}),(0,QO.jsxs)("div",{className:"app-install-body",children:[(0,QO.jsx)("img",{src:"/android-icon-192x192.png",alt:"",className:"app-install-icon",width:"56",height:"56"}),(0,QO.jsxs)("div",{className:"app-install-text",children:[(0,QO.jsx)("strong",{id:"app-install-title",children:"\u015eogi uygulamam\u0131z\u0131 indirin"}),(0,QO.jsx)("span",{children:"Japon Satranc\u0131 : \u015eogi \u2014 Google Play'de \xfccretsiz. Daha h\u0131zl\u0131 ve tam ekran oynay\u0131n."})]})]}),(0,QO.jsxs)("div",{className:"app-install-actions",children:[(0,QO.jsx)("button",{type:"button",className:"btn btn-link app-install-later",onClick:h,children:"\u015eimdi de\u011fil"}),(0,QO.jsx)("a",{href:UM,target:"_blank",rel:"noopener noreferrer",className:"btn app-install-cta",onClick:()=>{XO("app_banner_click",{page_path:t}),HM(30),o(!0)},children:"Uygulamay\u0131 Y\xfckle"})]})]})}function YM(){const t=Le();return(0,e.useEffect)(()=>{XO("page_view",{page_path:t.pathname,page_title:document.title})},[t]),null}function WM(){return(0,QO.jsx)(Gi,{children:(0,QO.jsx)(ZO,{children:(0,QO.jsxs)(Vt,{children:[(0,QO.jsx)(YM,{}),(0,QO.jsxs)("div",{className:"d-flex flex-column min-vh-100",children:[(0,QO.jsx)(iP,{}),(0,QO.jsx)("div",{className:"flex-grow-1",children:(0,QO.jsxs)(ot,{children:[(0,QO.jsx)(st,{path:"/",element:(0,QO.jsx)(cP,{})}),(0,QO.jsx)(st,{path:"/akademi",element:(0,QO.jsx)(NM,{})}),(0,QO.jsx)(st,{path:"/arena",element:(0,QO.jsx)(IM,{})}),(0,QO.jsx)(st,{path:"/iletisim",element:(0,QO.jsx)(LM,{})}),(0,QO.jsx)(st,{path:"/sss",element:(0,QO.jsx)(FM,{})})," ",(0,QO.jsx)(st,{path:"/faq",element:(0,QO.jsx)(FM,{})})," ",(0,QO.jsx)(st,{path:"/nasil-oynanir",element:(0,QO.jsx)(dP,{})}),(0,QO.jsx)(st,{path:"/taslar",element:(0,QO.jsx)(pP,{})}),(0,QO.jsx)(st,{path:"/kurallar",element:(0,QO.jsx)(mP,{})}),(0,QO.jsx)(st,{path:"/oyna",element:(0,QO.jsx)(EM,{})}),(0,QO.jsx)(st,{path:"/profil",element:(0,QO.jsx)(RM,{})}),(0,QO.jsx)(st,{path:"/liderlik-tablosu",element:(0,QO.jsx)(OM,{})}),(0,QO.jsx)(st,{path:"*",element:(0,QO.jsx)(rt,{to:"/",replace:!0})})]})}),(0,QO.jsx)(nP,{}),(0,QO.jsx)(jM,{})]})]})})})}const GM=function(){return(0,QO.jsx)(WM,{})};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));const XM=e=>{e&&e instanceof Function&&i.e(488).then(i.bind(i,488)).then(t=>{let i=t.getCLS,n=t.getFID,r=t.getFCP,s=t.getLCP,a=t.getTTFB;i(e),n(e),r(e),s(e),a(e)})};n.createRoot(document.getElementById("root")).render((0,QO.jsx)(e.StrictMode,{children:(0,QO.jsx)(GM,{})})),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(e=>{e.unregister()}).catch(e=>{console.error(e.message)}),XM()})()})();
3//# sourceMappingURL=main.05826989.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.