diff --git a/assets/gameLoop.f1000c82.js b/assets/gameLoop.ccb7744b.js similarity index 92% rename from assets/gameLoop.f1000c82.js rename to assets/gameLoop.ccb7744b.js index 8e52491..02d1ce0 100644 --- a/assets/gameLoop.f1000c82.js +++ b/assets/gameLoop.ccb7744b.js @@ -1 +1 @@ -import{_ as d,s as p,p as e,a as o,l as T,D as l,b as m,g as u}from"./index.79f46657.js";import"./vue.c16a309b.js";import{b2 as c}from"./@vue.6b211d3c.js";/* empty css */import"./nanoevents.1080beb7.js";import"./lz-string.dccec454.js";import"./vue-next-select.ded54c4a.js";import"./vuedraggable.1879de79.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-panzoom.8ce6f9b1.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";import"./vue-toastification.9c2dad53.js";let n=null,f=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(o.lastTenTicks.push(r),o.lastTenTicks.length>10&&(o.lastTenTicks=o.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!o.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(l.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),l.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||l.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!l.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),u.emit("update",i,r),p.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function A(){f=(await d(()=>import("./index.79f46657.js").then(function(t){return t.c}),["assets/index.79f46657.js","assets/index.8dafe82c.css","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{A as startGameLoop}; +import{_ as d,s as p,p as e,a as o,l as T,D as l,b as m,g as u}from"./index.acf4cfde.js";import"./vue.c16a309b.js";import{b2 as c}from"./@vue.6b211d3c.js";/* empty css */import"./nanoevents.1080beb7.js";import"./lz-string.dccec454.js";import"./vue-next-select.ded54c4a.js";import"./vuedraggable.1879de79.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-panzoom.8ce6f9b1.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";import"./vue-toastification.9c2dad53.js";let n=null,f=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(o.lastTenTicks.push(r),o.lastTenTicks.length>10&&(o.lastTenTicks=o.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!o.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(l.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),l.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||l.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!l.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),u.emit("update",i,r),p.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function A(){f=(await d(()=>import("./index.acf4cfde.js").then(function(t){return t.c}),["assets/index.acf4cfde.js","assets/index.8dafe82c.css","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{A as startGameLoop}; diff --git a/assets/index.79f46657.js b/assets/index.acf4cfde.js similarity index 55% rename from assets/index.79f46657.js rename to assets/index.acf4cfde.js index a819fff..b060829 100644 --- a/assets/index.79f46657.js +++ b/assets/index.acf4cfde.js @@ -1,18 +1,18 @@ -/* empty css */import"./vue.c16a309b.js";import{_ as w,C as s,l as Fe,q as pn,t as U,b2 as mt,ab as J,aF as M,a1 as A,a2 as N,aL as Dt,G as _e,aD as mr,w as vt,b3 as St,a9 as f,O as re,ap as Kr,az as gi,as as zt,aH as ri,A as Te,$ as ne,b7 as Z,b9 as Oi,ar as Gt,bv as In,a8 as T,bt as Qr,bc as zn,T as ea,u as qi,j as ta,bw as At,aM as kt,a0 as G,aO as Qe,J as pe,I as Le,aI as gn,aG as mn,z as Qt,bo as na,bs as ia,aK as xn,bd as er,am as li,H as ra,bx as aa,bf as sa}from"./@vue.6b211d3c.js";import{c as vr}from"./nanoevents.1080beb7.js";import{L as Yt}from"./lz-string.dccec454.js";import{Y as oa}from"./vue-next-select.ded54c4a.js";import{D as la}from"./vuedraggable.1879de79.js";import{p as ua}from"./vue-textarea-autosize.35804eaf.js";import{P as ca}from"./vue-panzoom.8ce6f9b1.js";import{s as da,u as mi}from"./vue-toastification.9c2dad53.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";const pa=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerpolicy&&(a.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?a.credentials="include":r.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}};pa();const fa="modulepreload",tr={},ga="./",Gn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${ga}${i}`,i in tr)return;tr[i]=!0;const r=i.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${a}`))return;const u=document.createElement("link");if(u.rel=r?"stylesheet":fa,r||(u.as="script",u.crossOrigin=""),u.href=i,document.head.appendChild(u),r)return new Promise((l,c)=>{u.addEventListener("load",l),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},ma="./projInfo-schema.json",va="Planar Pioneers",ha="A game about controlling and exploiting planes!",ba="planar-pioneers",ya="thepaperpilot",wa="",_a="",Na="0.0",Ca="Initial Commit",ka=!1,Ma=!1,Sa=2,Ia=!0,xa=null,$a="",Ea=["main"],Pa=3600,Ta=0,Da=!0,Aa="base64";var ye={$schema:ma,title:va,description:ha,id:ba,author:ya,discordName:wa,discordLink:_a,versionNumber:Na,versionTitle:Ca,allowGoBack:ka,defaultShowSmall:Ma,defaultDecimalsShown:Sa,useHeader:Ia,banner:xa,logo:$a,initialTabs:Ea,maxTickLength:Pa,offlineLimit:Ta,enablePausing:Da,exportEncoding:Aa};class Ra{constructor(t){this.map=new Map,this.first=void 0,this.last=void 0,this.maxSize=t}get size(){return this.map.size}get(t){const n=this.map.get(t);if(n!==void 0)return n!==this.first&&(n===this.last?(this.last=n.prev,this.last.next=void 0):(n.prev.next=n.next,n.next.prev=n.prev),n.next=this.first,this.first.prev=n,this.first=n),n.value}set(t,n){if(this.maxSize<1)return;if(this.map.has(t))throw new Error("Cannot update existing keys in the cache");const i=new Fa(t,n);for(this.first===void 0?(this.first=i,this.last=i):(i.next=this.first,this.first.prev=i,this.first=i),this.map.set(t,i);this.map.size>this.maxSize;){const r=this.last;this.map.delete(r.key),this.last=r.prev,this.last.next=void 0}}}class Fa{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const xi=17,Oa=9e15,qa=Math.log10(9e15),Va=1/9e15,Ba=308,La=-324,nr=5,ja=(1<<10)-1,za=function(){const e=[];for(let n=La+1;n<=Ba;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),an=[2,Math.E,3,4,5,6,7,8,9,10],Ga=[[1,1.0891180521811203,1.1789767925673957,1.2701455431742086,1.3632090180450092,1.4587818160364217,1.5575237916251419,1.6601571006859253,1.767485818836978,1.8804192098842727,2],[1,1.1121114330934079,1.231038924931609,1.3583836963111375,1.4960519303993531,1.6463542337511945,1.8121385357018724,1.996971324618307,2.2053895545527546,2.4432574483385254,Math.E],[1,1.1187738849693603,1.2464963939368214,1.38527004705667,1.5376664685821402,1.7068895236551784,1.897001227148399,2.1132403089001035,2.362480153784171,2.6539010333870774,3],[1,1.1367350847096405,1.2889510672956703,1.4606478703324786,1.6570295196661111,1.8850062585672889,2.1539465047453485,2.476829779693097,2.872061932789197,3.3664204535587183,4],[1,1.1494592900767588,1.319708228183931,1.5166291280087583,1.748171114438024,2.0253263297298045,2.3636668498288547,2.7858359149579424,3.3257226212448145,4.035730287722532,5],[1,1.159225940787673,1.343712473580932,1.5611293155111927,1.8221199554561318,2.14183924486326,2.542468319282638,3.0574682501653316,3.7390572020926873,4.6719550537360774,6],[1,1.1670905356972596,1.3632807444991446,1.5979222279405536,1.8842640123816674,2.2416069644878687,2.69893426559423,3.3012632110403577,4.121250340630164,5.281493033448316,7],[1,1.1736630594087796,1.379783782386201,1.6292821855668218,1.9378971836180754,2.3289975651071977,2.8384347394720835,3.5232708454565906,4.478242031114584,5.868592169644505,8],[1,1.1793017514670474,1.394054150657457,1.65664127441059,1.985170999970283,2.4069682290577457,2.9647310119960752,3.7278665320924946,4.814462547283592,6.436522247411611,9],[1,1.1840100246247336,1.4061375836156955,1.6802272208863964,2.026757028388619,2.4770056063449646,3.080525271755482,3.9191964192627284,5.135152840833187,6.989961179534715,10]],Ua=[[-1,-.9194161097107025,-.8335625019330468,-.7425599821143978,-.6466611521029437,-.5462617907227869,-.4419033816638769,-.3342645487554494,-.224140440909962,-.11241087890006762,0],[-1,-.90603157029014,-.80786507256596,-.7064666939634,-.60294836853664,-.49849837513117,-.39430303318768,-.29147201034755,-.19097820800866,-.09361896280296,0],[-1,-.9021579584316141,-.8005762598234203,-.6964780623319391,-.5911906810998454,-.486050182576545,-.3823089430815083,-.28106046722897615,-.1831906535795894,-.08935809204418144,0],[-1,-.8917227442365535,-.781258746326964,-.6705130326902455,-.5612813129406509,-.4551067709033134,-.35319256652135966,-.2563741554088552,-.1651412821106526,-.0796919581982668,0],[-1,-.8843387974366064,-.7678744063886243,-.6529563724510552,-.5415870994657841,-.4352842206588936,-.33504449124791424,-.24138853420685147,-.15445285440944467,-.07409659641336663,0],[-1,-.8786709358426346,-.7577735191184886,-.6399546189952064,-.527284921869926,-.4211627631006314,-.3223479611761232,-.23107655627789858,-.1472057700818259,-.07035171210706326,0],[-1,-.8740862815291583,-.7497032990976209,-.6297119746181752,-.5161838335958787,-.41036238255751956,-.31277212146489963,-.2233976621705518,-.1418697367979619,-.06762117662323441,0],[-1,-.8702632331800649,-.7430366914122081,-.6213373075161548,-.5072025698095242,-.40171437727184167,-.30517930701410456,-.21736343968190863,-.137710238299109,-.06550774483471955,0],[-1,-.8670016295947213,-.7373984232432306,-.6143173985094293,-.49973884395492807,-.394584953527678,-.2989649949848695,-.21245647317021688,-.13434688362382652,-.0638072667348083,0],[-1,-.8641642839543857,-.732534623168535,-.6083127477059322,-.4934049257184696,-.3885773075899922,-.29376029055315767,-.2083678561173622,-.13155653399373268,-.062401588652553186,0]];let k=function(t){return o.fromValue_noAlloc(t)},Y=function(e,t,n){return o.fromComponents(e,t,n)},ie=function(t,n,i){return o.fromComponents_noNormalize(t,n,i)};const Zt=function(t,n){const i=n+1,r=Math.ceil(Math.log10(Math.abs(t))),a=Math.round(t*Math.pow(10,i-r))*Math.pow(10,r-i);return parseFloat(a.toFixed(Math.max(i-r,0)))},$i=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Wa=function(e){if(!isFinite(e))return e;if(e<-50)return e===Math.trunc(e)?Number.NEGATIVE_INFINITY:0;let t=1;for(;e<10;)t=t*e,++e;e-=1;let n=.9189385332046727;n=n+(e+.5)*Math.log(e),n=n-e;const i=e*e;let r=e;return n=n+1/(12*r),r=r*i,n=n+1/(360*r),r=r*i,n=n+1/(1260*r),r=r*i,n=n+1/(1680*r),r=r*i,n=n+1/(1188*r),r=r*i,n=n+691/(360360*r),r=r*i,n=n+7/(1092*r),r=r*i,n=n+3617/(122400*r),Math.exp(n)/t},hr=.5671432904097838,ir=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return hr;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let r=0;r<100;++r){if(i=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(i-n).5?1:-1;if(Math.random()*20<1)return ie(t,0,1);const n=Math.floor(Math.random()*(e+1));let i=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(i=Math.trunc(i));let r=Math.pow(10,i);return Math.random()>.9&&(r=Math.trunc(r)),Y(t,n,r)}static affordGeometricSeries_core(e,t,n,i){const r=t.mul(n.pow(i));return y.floor(e.div(r).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,i){return t.mul(n.pow(i)).mul(y.sub(1,n.pow(e))).div(y.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const a=t.add(i.mul(n)).sub(n.div(2)),u=a.pow(2);return a.neg().add(u.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,i){const r=t.add(i.mul(n));return e.div(2).mul(r.mul(2).plus(e.sub(1).mul(n)))}static efficiencyOfPurchase_core(e,t,n){return e.div(t).add(e.div(n))}normalize(){if(this.sign===0||this.mag===0&&this.layer===0)return this.sign=0,this.mag=0,this.layer=0,this;if(this.layer===0&&this.mag<0&&(this.mag=-this.mag,this.sign=-this.sign),this.layer===0&&this.mag=Oa)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e0;)this.layer-=1,this.layer===0?this.mag=Math.pow(10,this.mag):(this.mag=t*Math.pow(10,e),e=Math.abs(this.mag),t=Math.sign(this.mag));return this.layer===0&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):this.mag===0&&(this.sign=0)),this}fromComponents(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this.normalize(),this}fromComponents_noNormalize(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this}fromMantissaExponent(e,t){return this.layer=1,this.sign=Math.sign(e),e=Math.abs(e),this.mag=t+Math.log10(e),this.normalize(),this}fromMantissaExponent_noNormalize(e,t){return this.fromMantissaExponent(e,t),this}fromDecimal(e){return this.sign=e.sign,this.layer=e.layer,this.mag=e.mag,this}fromNumber(e){return this.mag=Math.abs(e),this.sign=Math.sign(e),this.layer=0,this.normalize(),this}fromString(e){const t=e,n=y.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const C=parseFloat(i[0]),_=parseFloat(i[1]),x=i[1].split(";");let E=1;if(x.length===2&&(E=parseFloat(x[1]),isFinite(E)||(E=1)),isFinite(C)&&isFinite(_)){const S=y.pentate(C,_,E);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const C=parseFloat(r[0]),_=parseFloat(r[1]),x=r[1].split(";");let E=1;if(x.length===2&&(E=parseFloat(x[1]),isFinite(E)||(E=1)),isFinite(C)&&isFinite(_)){const S=y.tetrate(C,_,E);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}const a=e.split("^");if(a.length===2){const C=parseFloat(a[0]),_=parseFloat(a[1]);if(isFinite(C)&&isFinite(_)){const x=y.pow(C,_);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}e=e.trim().toLowerCase();let u,l,c=e.split("pt");if(c.length===2){u=10,l=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let C=parseFloat(c[1]);if(isFinite(C)||(C=1),isFinite(u)&&isFinite(l)){const _=y.tetrate(u,l,C);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){u=10,l=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let C=parseFloat(c[1]);if(isFinite(C)||(C=1),isFinite(u)&&isFinite(l)){const _=y.tetrate(u,l,C);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}const d=e.split("e"),v=d.length-1;if(v===0){const C=parseFloat(e);if(isFinite(C))return this.fromNumber(C),y.fromStringCache.size>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}else if(v===1){const C=parseFloat(e);if(isFinite(C)&&C!==0)return this.fromNumber(C),y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}const p=e.split("e^");if(p.length===2){this.sign=1,p[0].charAt(0)=="-"&&(this.sign=-1);let C="";for(let _=0;_=43&&x<=57||x===101)C+=p[1].charAt(_);else return this.layer=parseFloat(C),this.mag=parseFloat(p[1].substr(_+1)),this.normalize(),y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}if(v<1)return this.sign=0,this.layer=0,this.mag=0,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this;const b=parseFloat(d[0]);if(b===0)return this.sign=0,this.layer=0,this.mag=0,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this;let g=parseFloat(d[d.length-1]);if(v>=2){const C=parseFloat(d[d.length-2]);isFinite(C)&&(g*=Math.sign(C),g+=$i(C))}if(!isFinite(b))this.sign=d[0]==="-"?-1:1,this.layer=v,this.mag=g;else if(v===1)this.sign=Math.sign(b),this.layer=1,this.mag=g+Math.log10(Math.abs(b));else if(this.sign=Math.sign(b),this.layer=v,v===2){const C=y.mul(Y(1,2,g),k(b));return this.sign=C.sign,this.layer=C.layer,this.mag=C.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}else this.mag=g;return this.normalize(),y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}fromValue(e){return e instanceof y?this.fromDecimal(e):typeof e=="number"?this.fromNumber(e):typeof e=="string"?this.fromString(e):(this.sign=0,this.layer=0,this.mag=0,this)}toNumber(){return Number.isFinite(this.layer)?this.layer===0?this.sign*this.mag:this.layer===1?this.sign*Math.pow(10,this.mag):this.mag>0?this.sign>0?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:0:Number.NaN}mantissaWithDecimalPlaces(e){return isNaN(this.m)?Number.NaN:this.m===0?0:Zt(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Zt(this.mag,e)}toString(){return isNaN(this.layer)||isNaN(this.sign)||isNaN(this.mag)?"NaN":this.mag===Number.POSITIVE_INFINITY||this.layer===Number.POSITIVE_INFINITY?this.sign===1?"Infinity":"-Infinity":this.layer===0?this.mag<1e21&&this.mag>1e-7||this.mag===0?(this.sign*this.mag).toString():this.m+"e"+this.e:this.layer===1?this.m+"e"+this.e:this.layer<=nr?(this.sign===-1?"-":"")+"e".repeat(this.layer)+this.mag:(this.sign===-1?"-":"")+"(e^"+this.layer+")"+this.mag}toExponential(e){return this.layer===0?(this.sign*this.mag).toExponential(e):this.toStringWithDecimalPlaces(e)}toFixed(e){return this.layer===0?(this.sign*this.mag).toFixed(e):this.toStringWithDecimalPlaces(e)}toPrecision(e){return this.e<=-7?this.toExponential(e-1):e>this.e?this.toFixed(e-this.exponent-1):this.toExponential(e-1)}valueOf(){return this.toString()}toJSON(){return this.toString()}toStringWithDecimalPlaces(e){return this.layer===0?this.mag<1e21&&this.mag>1e-7||this.mag===0?(this.sign*this.mag).toFixed(e):Zt(this.m,e)+"e"+Zt(this.e,e):this.layer===1?Zt(this.m,e)+"e"+Zt(this.e,e):this.layer<=nr?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Zt(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Zt(this.mag,e)}abs(){return ie(this.sign===0?0:1,this.layer,this.mag)}neg(){return ie(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?y.dZero:this.layer===0?Y(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?y.dZero:this.layer===0?Y(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?y.dZero:this.layer===0?Y(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?y.dZero:this.layer===0?Y(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=k(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer)||this.sign===0)return t;if(t.sign===0)return this;if(this.sign===-t.sign&&this.layer===t.layer&&this.mag===t.mag)return ie(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(y.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return y.fromNumber(n.sign*n.mag+i.sign*i.mag);const r=n.layer*Math.sign(n.mag),a=i.layer*Math.sign(i.mag);if(r-a>=2)return n;if(r===0&&a===-1){if(Math.abs(i.mag-Math.log10(n.mag))>xi)return n;{const u=Math.pow(10,Math.log10(n.mag)-i.mag),l=i.sign+n.sign*u;return Y(Math.sign(l),1,i.mag+Math.log10(Math.abs(l)))}}if(r===1&&a===0){if(Math.abs(n.mag-Math.log10(i.mag))>xi)return n;{const u=Math.pow(10,n.mag-Math.log10(i.mag)),l=i.sign+n.sign*u;return Y(Math.sign(l),1,Math.log10(i.mag)+Math.log10(Math.abs(l)))}}if(Math.abs(n.mag-i.mag)>xi)return n;{const u=Math.pow(10,n.mag-i.mag),l=i.sign+n.sign*u;return Y(Math.sign(l),1,i.mag+Math.log10(Math.abs(l)))}}plus(e){return this.add(e)}sub(e){return this.add(k(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=k(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return ie(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return ie(this.sign*t.sign,0,1);let n,i;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return y.fromNumber(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return Y(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return Y(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return Y(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const r=Y(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(Y(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return Y(n.sign*i.sign,r.layer+1,r.sign*r.mag)}if(n.layer===2&&i.layer===2){const r=Y(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(Y(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return Y(n.sign*i.sign,r.layer+1,r.sign*r.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=k(e);return this.mul(t.recip())}divide(e){return this.div(e)}divideBy(e){return this.div(e)}dividedBy(e){return this.div(e)}recip(){return this.mag===0?y.dNaN:this.layer===0?Y(this.sign,0,1/this.mag):Y(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=k(e);return this.sign>t.sign?1:this.sign0?this.layer:-this.layer,i=t.mag>0?t.layer:-t.layer;return n>i?1:nt.mag?1:this.mag0?t:this}clamp(e,t){return this.max(e).min(t)}clampMin(e){return this.max(e)}clampMax(e){return this.min(e)}cmp_tolerance(e,t){const n=k(e);return this.eq_tolerance(n,t)?0:this.cmp(n)}compare_tolerance(e,t){return this.cmp_tolerance(e,t)}eq_tolerance(e,t){const n=k(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let i=this.mag,r=n.mag;return this.layer>n.layer&&(r=$i(r)),this.layer0?Y(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Y(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?y.dNaN:this.layer>0?Y(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Y(this.sign,0,Math.log10(this.mag))}log(e){return e=k(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?y.dNaN:this.layer===0&&e.layer===0?Y(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):y.div(this.log10(),e.log10())}log2(){return this.sign<=0?y.dNaN:this.layer===0?Y(this.sign,0,Math.log2(this.mag)):this.layer===1?Y(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?Y(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):Y(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?y.dNaN:this.layer===0?Y(this.sign,0,Math.log(this.mag)):this.layer===1?Y(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?Y(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):Y(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=k(e),n=this,i=t;if(n.sign===0)return i.eq(0)?ie(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return ie(1,0,1);if(i.sign===1&&i.layer===0&&i.mag===1)return n;const r=n.absLog10().mul(i).pow10();return this.sign===-1?Math.abs(i.toNumber()%2)%2===1?r.neg():Math.abs(i.toNumber()%2)%2===0?r:y.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return y.dNaN;let e=this;if(e.layer===0){const t=Math.pow(10,e.sign*e.mag);if(Number.isFinite(t)&&Math.abs(t)>=.1)return Y(1,0,t);if(e.sign===0)return y.dOne;e=ie(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?Y(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?Y(-e.sign,e.layer+1,-e.mag):y.dOne}pow_base(e){return k(e).pow(this)}root(e){const t=k(e);return this.pow(t.recip())}factorial(){return this.mag<0?this.add(1).gamma():this.layer===0?this.add(1).gamma():this.layer===1?y.exp(y.mul(this,y.ln(this).sub(1))):y.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(ie(1,0,24)))return y.fromNumber(Wa(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const n=e*e;let i=e,r=12*i,a=1/r,u=t+a;if(u===t||(t=u,i=i*n,r=360*i,a=1/r,u=t-a,u===t))return y.exp(t);t=u,i=i*n,r=1260*i;let l=1/r;return t=t+l,i=i*n,r=1680*i,l=1/r,t=t-l,y.exp(t)}else return this.layer===1?y.exp(y.mul(this,y.ln(this).sub(1))):y.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?y.dOne:this.layer===0&&this.mag<=709.7?y.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?Y(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?Y(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):Y(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return y.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return Y(1,2,Math.log10(this.mag)-.3010299956639812);{const e=y.div(ie(this.sign,this.layer-1,this.mag),ie(1,0,2));return e.layer+=1,e.normalize(),e}}cube(){return this.pow(3)}cbrt(){return this.pow(1/3)}tetrate(e=2,t=ie(1,0,1)){if(e===1)return y.pow(this,t);if(e===0)return new y(t);if(this.eq(y.dOne))return y.dOne;if(this.eq(-1))return y.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return y.fromNumber(Math.E);const a=y.ln(this).neg();return a.lambertw().div(a)}else return r>1.444667861009766?y.fromNumber(Number.POSITIVE_INFINITY):y.dNaN}if(this.eq(y.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),y.fromNumber(r)}if(e<0)return y.iteratedlog(t,this,-e);t=k(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(y.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r3)return ie(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=ie(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return y.tetrate(e,-t,this);e=k(e);let n=y.fromDecimal(this);const i=t;t=Math.trunc(t);const r=i-t;if(n.layer-e.layer>3){const a=Math.min(t,n.layer-e.layer-3);t-=a,n.layer-=a}for(let a=0;a1e4)return n}return r>0&&r<1&&(e.eq(10)?n=n.layeradd10(-r):n=n.layeradd(-r,e)),n}slog(e=10,t=100){let n=.001,i=!1,r=!1,a=this.slog_internal(e).toNumber();for(let u=1;u1&&r!=c&&(i=!0),r=c,i?n/=2:n*=2,n=Math.abs(n)*(c?-1:1),a+=n,n===0)break}return y.fromNumber(a)}slog_internal(e=10){if(e=k(e),e.lte(y.dZero)||e.eq(y.dOne))return y.dNaN;if(e.lt(y.dOne))return this.eq(y.dOne)?y.dZero:this.eq(y.dZero)?y.dNegOne:y.dNaN;if(this.mag<0||this.eq(y.dZero))return y.dNegOne;let t=0,n=y.fromDecimal(this);if(n.layer-e.layer>3){const i=n.layer-e.layer-3;t+=i,n.layer-=i}for(let i=0;i<100;++i)if(n.lt(y.dZero))n=y.pow(e,n),t-=1;else{if(n.lte(y.dOne))return y.fromNumber(t+y.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=y.log(n,e)}return y.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:y.critical_section(e,t,Ua)}static tetrate_critical(e,t){return y.critical_section(e,t,Ga)}static critical_section(e,t,n){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let i=0,r=0;for(let u=0;ue){const l=(e-an[u])/(an[u+1]-an[u]);i=n[u][Math.floor(t)]*(1-l)+n[u+1][Math.floor(t)]*l,r=n[u][Math.ceil(t)]*(1-l)+n[u+1][Math.ceil(t)]*l;break}const a=t-Math.floor(t);return i<=0||r<=0?i*(1-a)+r*a:Math.pow(e,Math.log(i)/Math.log(e)*(1-a)+Math.log(r)/Math.log(e)*a)}layeradd10(e){e=y.fromValue_noAlloc(e).toNumber();const t=y.fromDecimal(this);if(e>=1){t.mag<0&&t.layer>0?(t.sign=0,t.mag=0,t.layer=0):t.sign===-1&&t.layer==0&&(t.sign=1,t.mag=-t.mag);const n=Math.trunc(e);e-=n,t.layer+=n}if(e<=-1){const n=Math.trunc(e);if(e-=n,t.layer+=n,t.layer<0)for(let i=0;i<100;++i){if(t.layer++,t.mag=Math.log10(t.mag),!isFinite(t.mag))return t.sign===0&&(t.sign=1),t.layer<0&&(t.layer=0),t.normalize();if(t.layer>=0)break}}for(;t.layer<0;)t.layer++,t.mag=Math.log10(t.mag);return t.sign===0&&(t.sign=1,t.mag===0&&t.layer>=1&&(t.layer-=1,t.mag=1)),t.normalize(),e!==0?t.layeradd(e,10):t}layeradd(e,t){const i=this.slog(t).toNumber()+e;return i>=0?y.tetrate(t,i):Number.isFinite(i)?i>=-1?y.log(y.tetrate(t,i+1),t):y.log(y.log(y.tetrate(t,i+2),t),t):y.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return y.fromNumber(ir(this.toNumber()));if(this.layer===0)return y.fromNumber(ir(this.sign*this.mag));if(this.layer===1)return rr(this);if(this.layer===2)return rr(this);if(this.layer>=3)return ie(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return ie(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=ie(1,0,1)){t=k(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(y.dOne)?(++e,t=y.fromNumber(i)):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let r=0;r10)return t}return t}sin(){return this.mag<0?this:this.layer===0?y.fromNumber(Math.sin(this.sign*this.mag)):ie(0,0,0)}cos(){return this.mag<0?y.dOne:this.layer===0?y.fromNumber(Math.cos(this.sign*this.mag)):ie(0,0,0)}tan(){return this.mag<0?this:this.layer===0?y.fromNumber(Math.tan(this.sign*this.mag)):ie(0,0,0)}asin(){return this.mag<0?this:this.layer===0?y.fromNumber(Math.asin(this.sign*this.mag)):ie(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?y.fromNumber(Math.acos(this.toNumber())):this.layer===0?y.fromNumber(Math.acos(this.sign*this.mag)):ie(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?y.fromNumber(Math.atan(this.sign*this.mag)):y.fromNumber(Math.atan(this.sign*(1/0)))}sinh(){return this.exp().sub(this.negate().exp()).div(2)}cosh(){return this.exp().add(this.negate().exp()).div(2)}tanh(){return this.sinh().div(this.cosh())}asinh(){return y.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return y.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?ie(Number.NaN,Number.NaN,Number.NaN):y.ln(this.add(1).div(y.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(y.pow(10,e))}egg(){return this.add(9)}lessThanOrEqualTo(e){return this.cmp(e)<1}lessThan(e){return this.cmp(e)<0}greaterThanOrEqualTo(e){return this.cmp(e)>-1}greaterThan(e){return this.cmp(e)>0}};let o=y;o.fromStringCache=new Ra(ja);o.dZero=ie(0,0,0);o.dOne=ie(1,0,1);o.dNegOne=ie(-1,0,1);o.dTwo=ie(1,0,2);o.dTen=ie(1,0,10);o.dNaN=ie(Number.NaN,Number.NaN,Number.NaN);o.dInf=ie(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);o.dNegInf=ie(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);o.dNumberMax=Y(1,0,Number.MAX_VALUE);o.dNumberMin=Y(1,0,Number.MIN_VALUE);k=o.fromValue_noAlloc;Y=o.fromComponents;ie=o.fromComponents_noNormalize;o.fromMantissaExponent;o.fromMantissaExponent_noNormalize;const Ha=new o(1);function Vn(e,t,n=!0){let i=o.log10(e).floor(),r=o.div(e,o.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=Ha,i=i.add(1));const a=i.gte(1e9)?ht(i,Math.max(Math.max(t,3),ye.defaultDecimalsShown)):i.gte(1e4)?ui(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+a:"e"+a}function ui(e,t){if(e==null)return"NaN";if(e=new o(e),e.mag<.001)return 0 .toFixed(t);const i=e.toStringWithDecimalPlaces(t).split(".");return i[0]=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),i.length==1?i[0]:i[0]+"."+i[1]}function br(e,t){return e==null?"NaN":(e=new o(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),ye.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Za=new o("eeee1000"),Xa=new o("e100000"),ar=new o("e1000"),yr=new o(1e9),Ya=new o(1e6),Ja=new o(1e3),Ka=new o(.98),Qa=new o(.001),wr=new o(0);function ht(e,t,n){if(t==null&&(t=ye.defaultDecimalsShown),n=n!=null?n:ye.defaultShowSmall,e=new o(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+ht(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Za)){const i=e.slog();return i.gte(Ya)?"F"+ht(i.floor()):o.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+ui(i.floor(),0)}else{if(e.gte(Xa))return Vn(e,0,!1);if(e.gte(ar))return Vn(e,0);if(e.gte(yr))return Vn(e,t);if(e.gte(Ja))return ui(e,0);if(e.gte(Qa)||!n)return br(e,t);if(e.eq(wr))return 0 .toFixed(t)}return e=Nr(e),e.lt(ar)?Vn(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):ht(e,t)+"\u207B\xB9"}function Ke(e){return e=new o(e),e.sign<0?"-"+Ke(e.neg()):e.gte(yr)||e.lte(Ka)&&!e.eq(wr)?ht(e):ht(e,0)}function _r(e){return o.lt(e,0)?"-"+_r(o.neg(e)):o.gt(e,2**51)?ht(o.div(e,31536e3))+"y":(e=new o(e).toNumber(),e<60?ht(e)+"s":e<3600?Ke(Math.floor(e/60))+"m "+ht(e%60)+"s":e<86400?Ke(Math.floor(e/3600))+"h "+Ke(Math.floor(e/60)%60)+"m "+Ke(e%60)+"s":e<31536e3?Ke(Math.floor(e/84600)%365)+"d "+Ke(Math.floor(e/3600)%24)+"h "+Ke(Math.floor(e/60)%60)+"m":Ke(Math.floor(e/31536e3))+"y "+Ke(Math.floor(e/84600)%365)+"d "+Ke(Math.floor(e/3600)%24)+"h")}function es(e,t,n){e=new o(e);let i=e.toStringWithDecimalPlaces(t);return new o(i).gte(n)&&(i=o.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function ts(e,t){return ht(e,t,!0)}function Nr(e){let t=o.log10(e).ceil();const n=o.div(e,o.pow(10,t));return t=t.neg(),e=new o(10).pow(t).times(n),e}var ns=Object.freeze(Object.defineProperty({__proto__:null,default:o,exponentialFormat:Vn,commaFormat:ui,regularFormat:br,format:ht,formatWhole:Ke,formatTime:_r,toPlaces:es,formatSmall:ts,invertOOM:Nr},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:is,commaFormat:rs,regularFormat:as,format:Ie,formatWhole:pt,formatTime:vi,toPlaces:ss,formatSmall:jt,invertOOM:os}=ns;window.Decimal=o;window.exponentialFormat=is;window.commaFormat=rs;window.regularFormat=as;window.format=Ie;window.formatWhole=pt;window.formatTime=vi;window.toPlaces=ss;window.formatSmall=jt;window.invertOOM=os;function at(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Un(e){return typeof e=="function"}var H=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(H||{});const Wn=Symbol("DoNotCache");function $(e,t){const n=e[t];Un(n)&&n.length===0&&!n[Wn]?e[t]=w(n.bind(e)):Un(n)&&(e[t]=n.bind(e),e[t][Wn]=!0)}function we(e){return Un(e)&&!e[Wn]&&(e=w(e)),e}const bt=Symbol("Component"),ft=Symbol("GatherProps");let ls=0;function tn(e="feature-"){return e+ls++}var ke=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(ke||{});function We(e){const t=s(e);return t!==2&&t!==!1}function vn(e){return s(e)===1}function K(e){return e[Wn]=!0,e}function oe(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function Hn(e,...t){const n=[],i=r=>{Object.keys(r).forEach(a=>{const u=r[a];u!=null&&typeof u=="object"&&(t.includes(u.type)?n.push(u):!(u instanceof o)&&!Fe(u)&&i(u))})};return i(e),n}const sn={variables:{"--foreground":"#dfdfdf","--background":"#0f0f0f","--feature-foreground":"#0f0f0f","--tooltip-background":"rgba(0, 0, 0, 0.75)","--raised-background":"#0f0f0f","--points":"#ffffff","--locked":"#bf8f8f","--highlighted":"#333","--bought":"#77bf5f","--danger":"rgb(220, 53, 69)","--link":"#02f2f2","--outline":"#dfdfdf","--accent1":"#627a82","--accent2":"#658262","--accent3":"#7c6282","--border-radius":"15px","--modal-border":"solid 2px var(--color)","--feature-margin":"0px"},floatingTabs:!0,mergeAdjacent:!0,showPin:!0};var Vi=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Vi||{}),Nt={classic:sn,paper:{...sn,variables:{...sn.variables,"--background":"#2a323d","--feature-foreground":"#000","--raised-background":"#333c4a","--locked":"#3a3e45","--bought":"#5C8A58","--outline":"#333c4a","--border-radius":"4px","--modal-border":"","--feature-margin":"5px"},floatingTabs:!1},nordic:{...sn,variables:{...sn.variables,"--foreground":"#D8DEE9","--background":"#2E3440","--feature-foreground":"#000","--raised-background":"#3B4252","--points":"#E5E9F0","--locked":"#4c566a","--highlighted":"#434c5e","--bought":"#8FBCBB","--danger":"#D08770","--link":"#88C0D0","--outline":"#3B4252","--accent1":"#B48EAD","--accent2":"#A3BE8C","--accent3":"#EBCB8B","--border-radius":"4px","--modal-border":"solid 2px #3B4252","--feature-margin":"5px"},floatingTabs:!1},aqua:{...sn,variables:{...sn.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const et=vr();"fonts"in document&&(document.fonts.onloadingdone=()=>et.emit("fontsLoaded"));var us=Object.freeze(Object.defineProperty({__proto__:null,globalBus:et},Symbol.toStringTag,{value:"Module"}));const cs=pn({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var Q=window.player=cs;function Cr(e){return JSON.stringify(e,(t,n)=>s(n))}function kr(e={}){return Object.assign({id:`${ye.id}-0`,name:"Default Save",tabs:ye.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:ye.id,modVersion:ye.versionNumber,layers:{}},e)}function gt(e){const t=Yt.compressToUTF16(Cr(e!=null?e:Q));return localStorage.setItem((e!=null?e:Q).id,t),t}async function ds(){gs();try{let e=localStorage.getItem(de.active);if(e==null){await un(Sn());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Yt.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==ye.id){await un(Sn());return}t.id=de.active,await un(t)}catch(e){console.error(`Failed to load save. Falling back to new save. -`,e),await un(Sn())}}function Sn(){const e=oi(),t=kr({id:e});return gt(t),de.saves.push(e),t}function oi(){let e,t=0;do e=`${ye.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const ps=U(!1);async function un(e){console.info("Loading save",e),ps.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await Gn(()=>Promise.resolve().then(function(){return cl}),void 0),{fixOldSave:r,getInitialLayers:a}=await Gn(()=>Promise.resolve().then(function(){return cp}),void 0);for(const u in t){const l=t[u];l&&n(l)}a(e).forEach(u=>i(u,e)),e=kr(e),e.offlineProd&&e.time!=null&&e.time&&e.devSpeed!==0&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=Math.min(e.offlineTime+(Date.now()-e.time)/1e3,ye.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ye.versionNumber&&(r(e.modVersion,e),e.modVersion=ye.versionNumber),Object.assign(Q,e),de.active=Q.id,et.emit("onLoad")}setInterval(()=>{Q.autosave&>()},1e3);window.onbeforeunload=()=>{Q.autosave&>()};window.save=gt;const fs=window.hardReset=async()=>{await un(Sn())};window.deleteLowerSaves=()=>{const e=Object.values(de.saves).indexOf(Q.id)+1;Object.values(de.saves).slice(e).forEach(t=>localStorage.removeItem(t)),de.saves=de.saves.slice(0,e)};const Zn=pn({active:"",saves:[],showTPS:!0,theme:Vi.Nordic,unthrottled:!1,alignUnits:!1});mt(Zn,e=>{const t=Yt.compressToUTF16(JSON.stringify(e));localStorage.setItem(ye.id,t)},{deep:!0});var de=window.settings=Zn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Vi.Nordic,alignUnits:!1};et.emit("loadSettings",e),Object.assign(Zn,e),fs()};function gs(){try{let e=localStorage.getItem(ye.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Yt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Zn,t)}et.emit("loadSettings",Zn)}catch{}}const Mr=pn([]);function ms(e){Mr.push(e)}const vs=pn([]),hs=pn([]),bs={class:"table"},ys=J({__name:"Column",setup(e){const t=w(()=>Nt[de.theme].mergeAdjacent);return(n,i)=>(M(),A("div",bs,[N("div",{class:_e(["col",{mergeAdjacent:s(t)}])},[Dt(n.$slots,"default")],2)]))}}),ws={class:"table"},_s=J({__name:"Row",setup(e){const t=w(()=>Nt[de.theme].mergeAdjacent);return(n,i)=>(M(),A("div",ws,[N("div",{class:_e(["row",{mergeAdjacent:s(t)}])},[Dt(n.$slots,"default")],2)]))}});function Sr(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Kr(e)}function fe(e,t="span"){return typeof e=="function"?J({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),J({template:e})):J({render:()=>({})}):e}function lt(e){if(It(e))return typeof e=="function"?e():fe(e);const t=e[bt];return f(t,e[ft](),null)}function Ei(...e){let t;return f(_s,null,Sr(t=e.map(lt))?t:{default:()=>[t]})}function Ns(...e){let t;return f(ys,null,Sr(t=e.map(lt))?t:{default:()=>[t]})}function Ct(e){if(It(e))return typeof e=="function"?e():typeof e=="string"?f(re,null,[e]):f(e,null,null);const t=e[bt];return f(t,e[ft](),null)}function sr(e,t){return e.reduce((n,i)=>f(re,null,[n,t,i]))}function It(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Wn]===!0}function Ir(e,t){const n=U(null),i=U(void 0);function r(l){n.value||(n.value=setInterval(u,250)),i.value=l}function a(){n.value&&(clearInterval(n.value),n.value=null)}function u(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return mr(a),{start:r,stop:a,handleHolding:u}}function xr(e,t="div"){const n=vt();return St(()=>{n.value=fe($e(e),t)}),n}function En(e,t="div"){const n=vt(null);return St(()=>{const i=$e(e);n.value=i==""||i==null?null:fe(i,t)}),n}function $e(e){return s(s(e))}function q(...e){return e.includes(Object)||e.push(Object),e}function or(e){const t=U(!1),n=e[ft].bind(e);return e[ft]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}var ve=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const Cs=J({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var v;const n=U({}),i=new ResizeObserver(l),r=U(null);gi(()=>{const p=r.value;p!=null&&i.observe(p)});let a=!0,u=U((v=r.value)==null?void 0:v.getBoundingClientRect());function l(){a&&(a=!1,zt(()=>{var p;u.value=(p=r.value)==null?void 0:p.getBoundingClientRect(),Object.values(n.value).filter(b=>b).forEach(b=>b.rect=b.element.getBoundingClientRect()),t("updateNodes",n.value),a=!0}))}et.on("fontsLoaded",l);const c={attributes:!1,childList:!0,subtree:!1};ri(Bi,(p,b)=>{const g=new MutationObserver(()=>d(p));g.observe(b,c),n.value[p]={element:b,observer:g,rect:b.getBoundingClientRect()},l()}),ri(Li,p=>{var b;(b=n.value[p])==null||b.observer.disconnect(),n.value[p]=void 0,l()}),ri(ji,n),ri(zi,u);function d(p){const b=n.value[p];b!=null&&(b.rect=b.element.getBoundingClientRect(),t("updateNodes",n.value))}return(p,b)=>(M(),A(re,null,[Dt(p.$slots,"default",{},void 0,!0),N("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var $r=ve(Cs,[["__scopeId","data-v-2b1dc1bc"]]);const ks=["onPointerdown"],Ms={class:"modal-wrapper"},Ss={class:"modal-container"},Is={class:"modal-header"},xs={class:"modal-body"},$s={class:"modal-footer"},Es=N("div",{class:"modal-default-flex-grow"},null,-1),Ut=J({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=Te(e),a=w(()=>s(r.modelValue)||l.value);function u(){n("update:modelValue",!1)}const l=U(!1),c=U(null),d=w(()=>{var v,p;return(p=(v=c.value)==null?void 0:v.nodes)!=null?p:null});return t({isOpen:a,nodes:d}),(v,p)=>(M(),ne(ea,{to:"#modal-root"},[f(zn,{name:"modal",onBeforeEnter:p[0]||(p[0]=b=>l.value=!0),onAfterLeave:p[1]||(p[1]=b=>l.value=!1)},{default:Z(()=>[Oi(N("div",Gt({class:"modal-mask",onPointerdown:In(u,["self"])},v.$attrs),[N("div",Ms,[N("div",Ss,[N("div",Is,[Dt(v.$slots,"header",{shown:s(a)},()=>[T(" default header ")])]),N("div",xs,[f($r,{ref_key:"contextRef",ref:c},{default:Z(()=>[Dt(v.$slots,"body",{shown:s(a)},()=>[T(" default body ")])]),_:3},512)]),N("div",$s,[Dt(v.$slots,"footer",{shown:s(a)},()=>[N("div",{class:"modal-default-footer"},[Es,N("button",{class:"button modal-default-button",onClick:u}," Close ")])])])])])],16,ks),[[Qr,e.modelValue]])]),_:3})]))}}),Xt=Symbol("ProxyState");function tt(e,t={}){const n=t;let i=!1;function r(){return i||(Object.assign(n,e.call(n,n)),i=!0),n}return new Proxy(n,{get(a,u){if(u===Xt)return r();const l=r()[u];return l!=null&&typeof l=="object"&&Tt in l?l[Tt]:l},set(a,u,l){return r()[u]=l,!0},has(a,u){return u===Xt?!0:Reflect.has(r(),u)},ownKeys(){return Reflect.ownKeys(r())},getOwnPropertyDescriptor(a,u){return i||(Object.assign(n,e.call(n,n)),i=!0),Object.getOwnPropertyDescriptor(a,u)}})}var Ue=window.state=qi({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Er=o.ln(10);function Bn(e){return e}function Ps(e,t){if(R(t))return t.invert(o.neg(e));throw new Error("Could not invert due to no input being a variable")}function Ts(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return m.neg(t.getIntegralFormula(e))}throw new Error("Could not integrate due to no input being a variable")}function Ds(e){return m.neg(e)}function As(e,t,n){if(R(t))return t.invert(o.sub(e,Me(n)));if(R(n))return n.invert(o.sub(e,Me(t)));throw new Error("Could not invert due to no input being a variable")}function Rs(e,t,n){var i,r;if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.times(n,(i=t.innermostVariable)!=null?i:0).add(a)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).add(a)}throw new Error("Could not integrate due to no input being a variable")}function Fs(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.add(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.add(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Os(e,t,n){if(R(t))return t.invert(o.add(e,Me(n)));if(R(n))return n.invert(o.sub(Me(t),e));throw new Error("Could not invert due to no input being a variable")}function qs(e,t,n){var i,r;if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.sub(a,m.times(n,(i=t.innermostVariable)!=null?i:0))}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).sub(a)}throw new Error("Could not integrate due to no input being a variable")}function Vs(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.sub(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.sub(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Bs(e,t,n){if(R(t))return t.invert(o.div(e,Me(n)));if(R(n))return n.invert(o.div(e,Me(t)));throw new Error("Could not invert due to no input being a variable")}function Ls(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.times(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function js(e,t,n){if(R(t))return m.div(e,n);if(R(n))return m.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function zs(e,t,n){if(R(t))return t.invert(o.mul(e,Me(n)));if(R(n))return n.invert(o.div(Me(t),e));throw new Error("Could not invert due to no input being a variable")}function Gs(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.div(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function Us(e,t,n){if(R(t))return m.mul(e,n);if(R(n))return m.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Ws(e,t){if(R(t))return t.invert(o.recip(e));throw new Error("Could not invert due to no input being a variable")}function Hs(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function Zs(e,t){if(R(t))return t.invert(o.pow10(e));throw new Error("Could not invert due to no input being a variable")}function Xs(e){return o.ln(e).sub(1).times(e).div(Er)}function Ys(e,t){if(R(t)){const n=Er.times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function Js(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:Xs,invert:Ys})}throw new Error("Could not integrate due to no input being a variable")}function Ks(e,t,n){if(R(t))return t.invert(o.pow(Me(n),e));if(R(n))return n.invert(o.root(Me(t),e));throw new Error("Could not invert due to no input being a variable")}function Qs(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function eo(e,t,n){if(R(t)){const i=o.ln(Me(n)).times(e);return t.invert(i.div(i.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function to(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e),n],evaluate:Qs,invert:eo})}throw new Error("Could not integrate due to no input being a variable")}function no(e,t){if(R(t))return t.invert(o.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function io(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function ro(e,t){if(R(t)){const n=o.ln(2).times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function ao(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:io,invert:ro})}throw new Error("Could not integrate due to no input being a variable")}function so(e,t){if(R(t))return t.invert(o.exp(e));throw new Error("Could not invert due to no input being a variable")}function oo(e){return o.ln(e).sub(1).times(e)}function lo(e,t){if(R(t))return t.invert(o.div(e,o.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function uo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:oo,invert:lo})}throw new Error("Could not integrate due to no input being a variable")}function co(e,t,n){if(R(t))return t.invert(o.root(e,Me(n)));if(R(n))return n.invert(o.ln(e).div(o.ln(Me(t))));throw new Error("Could not invert due to no input being a variable")}function po(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e),r=m.add(n,1);return m.pow(i,r).div(r)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.pow(t,i).div(m.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function fo(e,t){if(R(t))return t.invert(o.root(e,10));throw new Error("Could not invert due to no input being a variable")}function go(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.pow10(n).div(m.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function mo(e,t,n){if(R(t))return t.invert(o.ln(e).div(o.ln(Me(n))));if(R(n))return n.invert(o.root(Me(t),e));throw new Error("Could not invert due to no input being a variable")}function vo(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(n,i).div(m.ln(n))}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e),r=m.add(t,1);return m.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function ho(e,t,n){if(R(t))return t.invert(o.root(e,o.recip(Me(n))));if(R(n))return n.invert(o.ln(Me(t)).div(o.ln(e)));throw new Error("Could not invert due to no input being a variable")}function bo(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(i,m.recip(n).add(1)).times(n).div(m.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function yo(e,t){if(R(t))return t.invert(o.ln(e));throw new Error("Could not invert due to no input being a variable")}function wo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function _o(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.tetrate(e,i,n)}function No(e,t,n,i){if(R(t))return t.invert(o.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function Co(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.iteratedexp(e,i,new o(n))}function ko(e,t,n,i){if(R(t))return t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,Me(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Mo(e,t=10,n=2){const i=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,i)}function So(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function Io(e,t,n){if(R(t))return t.invert(o.tetrate(e,o.minabs(1e308,Me(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function xo(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.layeradd(e,i,n)}function $o(e,t,n,i){if(R(t))return t.invert(o.layeradd(e,o.minabs(1e308,Me(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function Eo(e,t){if(R(t))return t.invert(o.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function Po(e,t){if(R(t))return t.invert(o.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function To(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.pentate(e,i,n)}function Do(e,t){if(R(t))return t.invert(o.asin(e));throw new Error("Could not invert due to no input being a variable")}function Ao(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function Ro(e,t){if(R(t))return t.invert(o.acos(e));throw new Error("Could not invert due to no input being a variable")}function Fo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function Oo(e,t){if(R(t))return t.invert(o.atan(e));throw new Error("Could not invert due to no input being a variable")}function qo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function Vo(e,t){if(R(t))return t.invert(o.sin(e));throw new Error("Could not invert due to no input being a variable")}function Bo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asin(n).times(n).add(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Lo(e,t){if(R(t))return t.invert(o.cos(e));throw new Error("Could not invert due to no input being a variable")}function jo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acos(n).times(n).sub(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function zo(e,t){if(R(t))return t.invert(o.tan(e));throw new Error("Could not invert due to no input being a variable")}function Go(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atan(n).times(n).sub(m.ln(m.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function Uo(e,t){if(R(t))return t.invert(o.asinh(e));throw new Error("Could not invert due to no input being a variable")}function Wo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function Ho(e,t){if(R(t))return t.invert(o.acosh(e));throw new Error("Could not invert due to no input being a variable")}function Zo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function Xo(e,t){if(R(t))return t.invert(o.atanh(e));throw new Error("Could not invert due to no input being a variable")}function Yo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function Jo(e,t){if(R(t))return t.invert(o.sinh(e));throw new Error("Could not invert due to no input being a variable")}function Ko(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asinh(n).times(n).sub(m.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function Qo(e,t){if(R(t))return t.invert(o.cosh(e));throw new Error("Could not invert due to no input being a variable")}function el(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acosh(n).times(n).sub(m.add(n,1).sqrt().times(m.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function tl(e,t){if(R(t))return t.invert(o.tanh(e));throw new Error("Could not invert due to no input being a variable")}function nl(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atanh(n).times(n).add(m.sub(1,m.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function Pn(e){return(t,n)=>new m({inputs:[t,n],evaluate:e,invert:Bn})}function R(e){return e instanceof Ee&&e.hasVariable()}function Me(e,t){return e instanceof Ee?e.evaluate(t):s(e)}function il(){return m.pow(this,2).div(2)}function rl(){return this}const Oe=class{constructor(e){this.negate=this.neg,this.negated=this.neg,this.sgn=this.sign,this.plus=this.add,this.subtract=this.sub,this.minus=this.sub,this.multiply=this.mul,this.times=this.mul,this.divide=this.div,this.divideBy=this.div,this.dividedBy=this.div,this.reciprocal=this.recip,this.reciprocate=this.recip,this.logarithm=this.log;let t;"inputs"in e&&(e.inputs=e.inputs.map(n=>typeof n=="object"&&Tt in n?n[Tt]:n)),"variable"in e?(typeof e.variable=="object"&&Tt in e.variable&&(e.variable=e.variable[Tt]),t=this.setupVariable(e)):"evaluate"in e?t=this.setupFormula(e):t=this.setupConstant(e),this.inputs=t.inputs,this.internalVariables=t.internalVariables,this.innermostVariable=t.innermostVariable,this.internalEvaluate=t.internalEvaluate,this.internalInvert=t.internalInvert,this.internalIntegrate=t.internalIntegrate,this.internalIntegrateInner=t.internalIntegrateInner,this.applySubstitution=t.applySubstitution}setupVariable({variable:e}){return{inputs:[e],internalVariables:1,innermostVariable:e,internalIntegrate:il,internalIntegrateInner:rl,applySubstitution:Bn}}setupConstant({inputs:e}){if(e.length!==1)throw new Error("Evaluate function is required if inputs is not length 1");return{inputs:e,internalVariables:0}}setupFormula(e){var b,g;const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:a,applySubstitution:u}=e,l=t.reduce((C,_)=>C+(_ instanceof Oe?_.internalVariables:0),0),c=t.find(C=>C instanceof Oe&&C.hasVariable()),d=l===1?c==null?void 0:c.innermostVariable:void 0,v=(b=c==null?void 0:c.isInvertible())!=null?b:!1,p=(g=c==null?void 0:c.isIntegrable())!=null?g:!1;return{inputs:t,internalEvaluate:n,internalInvert:v?i:void 0,internalIntegrate:p?r:void 0,internalIntegrateInner:a,applySubstitution:u,innermostVariable:d,internalVariables:l}}isInvertible(){return this.hasVariable()&&(this.internalInvert!=null||this.internalEvaluate==null)}isIntegrable(){return this.hasVariable()&&this.internalIntegrate!=null}isIntegralInvertible(){return this.isIntegrable()?this.getIntegralFormula().isInvertible():!1}hasVariable(){return this.internalVariables===1}evaluate(e){var t,n,i;return(i=(n=(t=this.internalEvaluate)==null?void 0:t.call(this,...this.inputs.map(r=>Me(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:Me(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof Oe&&e.inputs[n]instanceof Oe?t.equals(e.inputs[n]):!(t instanceof Oe)&&!(e.inputs[n]instanceof Oe)&&o.eq(s(t),s(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new m({inputs:[e]})}static variable(e){return new m({variable:e})}static step(e,t,n){const i=n(m.variable(0)),r=we(t);function a(l){return o.lt(l,s(r))?l:o.add(i.evaluate(o.sub(l,s(r))),s(r))}function u(l,c){if(R(c)&&i.isInvertible())return o.gt(l,s(r))&&(l=o.add(i.invert(o.sub(l,s(r))),s(r))),c.invert(l);throw new Error("Could not invert due to no input being a variable")}return new m({inputs:[e],evaluate:a,invert:i.isInvertible()&&i.hasVariable()?u:void 0})}static if(e,t,n,i){const r=U(0),a=m.variable(r),u=n(a),l=i==null?void 0:i(a),c=we(t);function d(p){return s(c)?(r.value=p,u.evaluate()):l?(r.value=p,l.evaluate()):p}function v(p,b){if(!R(b)||!u.isInvertible()||l!=null&&!l.isInvertible())throw new Error("Could not invert due to no input being a variable");return s(c)?b.invert(u.invert(p)):l?b.invert(l.invert(p)):b.invert(p)}return new m({inputs:[e],evaluate:d,invert:u.isInvertible()&&u.hasVariable()?v:void 0})}static conditional(e,t,n,i){return m.if(e,t,n,i)}static abs(e){return new m({inputs:[e],evaluate:o.abs})}static neg(e){return new m({inputs:[e],evaluate:o.neg,invert:Ps,applySubstitution:Ds,integrate:Ts})}static sign(e){return new m({inputs:[e],evaluate:o.sign})}static round(e){return new m({inputs:[e],evaluate:o.round})}static floor(e){return new m({inputs:[e],evaluate:o.floor})}static ceil(e){return new m({inputs:[e],evaluate:o.ceil})}static trunc(e){return new m({inputs:[e],evaluate:o.trunc})}static add(e,t){return new m({inputs:[e,t],evaluate:o.add,invert:As,integrate:Rs,integrateInner:Fs,applySubstitution:Bn})}static sub(e,t){return new m({inputs:[e,t],evaluate:o.sub,invert:Os,integrate:qs,integrateInner:Vs,applySubstitution:Bn})}static mul(e,t){return new m({inputs:[e,t],evaluate:o.mul,invert:Bs,integrate:Ls,applySubstitution:js})}static div(e,t){return new m({inputs:[e,t],evaluate:o.div,invert:zs,integrate:Gs,applySubstitution:Us})}static recip(e){return new m({inputs:[e],evaluate:o.recip,invert:Ws,integrate:Hs})}static clamp(e,t,n){return new m({inputs:[e,t,n],evaluate:o.clamp,invert:Bn})}static pLog10(e){return new m({inputs:[e],evaluate:o.pLog10})}static absLog10(e){return new m({inputs:[e],evaluate:o.absLog10})}static log10(e){return new m({inputs:[e],evaluate:o.log10,invert:Zs,integrate:Js})}static log(e,t){return new m({inputs:[e,t],evaluate:o.log,invert:Ks,integrate:to})}static log2(e){return new m({inputs:[e],evaluate:o.log2,invert:no,integrate:ao})}static ln(e){return new m({inputs:[e],evaluate:o.ln,invert:so,integrate:uo})}static pow(e,t){return new m({inputs:[e,t],evaluate:o.pow,invert:co,integrate:po})}static pow10(e){return new m({inputs:[e],evaluate:o.pow10,invert:fo,integrate:go})}static pow_base(e,t){return new m({inputs:[e,t],evaluate:o.pow_base,invert:mo,integrate:vo})}static root(e,t){return new m({inputs:[e,t],evaluate:o.root,invert:ho,integrate:bo})}static factorial(e){return new m({inputs:[e],evaluate:o.factorial})}static gamma(e){return new m({inputs:[e],evaluate:o.gamma})}static lngamma(e){return new m({inputs:[e],evaluate:o.lngamma})}static exp(e){return new m({inputs:[e],evaluate:o.exp,invert:yo,integrate:wo})}static sqr(e){return m.pow(e,2)}static sqrt(e){return m.root(e,2)}static cube(e){return m.pow(e,3)}static cbrt(e){return m.root(e,3)}static tetrate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:_o,invert:No})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:Co,invert:ko})}static iteratedlog(e,t=10,n=1){return new m({inputs:[e,t,n],evaluate:Mo})}static slog(e,t=10){return new m({inputs:[e,t],evaluate:So,invert:Io})}static layeradd10(e,t){return new m({inputs:[e,t],evaluate:o.layeradd10})}static layeradd(e,t,n=10){return new m({inputs:[e,t,n],evaluate:xo,invert:$o})}static lambertw(e){return new m({inputs:[e],evaluate:o.lambertw,invert:Eo})}static ssqrt(e){return new m({inputs:[e],evaluate:o.ssqrt,invert:Po})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:To})}static sin(e){return new m({inputs:[e],evaluate:o.sin,invert:Vo,integrate:Ao})}static cos(e){return new m({inputs:[e],evaluate:o.cos,invert:Lo,integrate:Fo})}static tan(e){return new m({inputs:[e],evaluate:o.tan,invert:zo,integrate:qo})}static asin(e){return new m({inputs:[e],evaluate:o.asin,invert:Do,integrate:Bo})}static acos(e){return new m({inputs:[e],evaluate:o.acos,invert:Ro,integrate:jo})}static atan(e){return new m({inputs:[e],evaluate:o.atan,invert:Oo,integrate:Go})}static sinh(e){return new m({inputs:[e],evaluate:o.sinh,invert:Jo,integrate:Wo})}static cosh(e){return new m({inputs:[e],evaluate:o.cosh,invert:Qo,integrate:Zo})}static tanh(e){return new m({inputs:[e],evaluate:o.tanh,invert:tl,integrate:Yo})}static asinh(e){return new m({inputs:[e],evaluate:o.asinh,invert:Uo,integrate:Ko})}static acosh(e){return new m({inputs:[e],evaluate:o.acosh,invert:Ho,integrate:el})}static atanh(e){return new m({inputs:[e],evaluate:o.atanh,invert:Xo,integrate:nl})}step(e,t){return m.step(this,e,t)}if(e,t){return m.if(this,e,t)}conditional(e,t){return m.if(this,e,t)}abs(){return m.abs(this)}neg(){return m.neg(this)}sign(){return m.sign(this)}round(){return m.round(this)}floor(){return m.floor(this)}ceil(){return m.ceil(this)}trunc(){return m.trunc(this)}add(e){return m.add(this,e)}sub(e){return m.sub(this,e)}mul(e){return m.mul(this,e)}div(e){return m.div(this,e)}recip(){return m.recip(this)}max(e){return m.max(this,e)}min(e){return m.min(this,e)}maxabs(e){return m.maxabs(this,e)}minabs(e){return m.minabs(this,e)}clamp(e,t){return m.clamp(this,e,t)}clampMin(e){return m.clampMin(this,e)}clampMax(e){return m.clampMax(this,e)}pLog10(){return m.pLog10(this)}absLog10(){return m.absLog10(this)}log10(){return m.log10(this)}log(e){return m.log(this,e)}log2(){return m.log2(this)}ln(){return m.ln(this)}pow(e){return m.pow(this,e)}pow10(){return m.pow10(this)}pow_base(e){return m.pow_base(this,e)}root(e){return m.root(this,e)}factorial(){return m.factorial(this)}gamma(){return m.gamma(this)}lngamma(){return m.lngamma(this)}exp(){return m.exp(this)}sqr(){return m.pow(this,2)}sqrt(){return m.root(this,2)}cube(){return m.pow(this,3)}cbrt(){return m.root(this,3)}tetrate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.tetrate(this,e,t)}iteratedexp(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return m.iteratedlog(this,e,t)}slog(e=10){return m.slog(this,e)}layeradd10(e){return m.layeradd10(this,e)}layeradd(e,t){return m.layeradd(this,e,t)}lambertw(){return m.lambertw(this)}ssqrt(){return m.ssqrt(this)}pentate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.pentate(this,e,t)}sin(){return m.sin(this)}cos(){return m.cos(this)}tan(){return m.tan(this)}asin(){return m.asin(this)}acos(){return m.acos(this)}atan(){return m.atan(this)}sinh(){return m.sinh(this)}cosh(){return m.cosh(this)}tanh(){return m.tanh(this)}asinh(){return m.asinh(this)}acosh(){return m.acosh(this)}atanh(){return m.atanh(this)}};let Ee=Oe;Ee.negate=Oe.neg;Ee.negated=Oe.neg;Ee.sgn=Oe.sign;Ee.plus=Oe.add;Ee.subtract=Oe.sub;Ee.minus=Oe.sub;Ee.multiply=Oe.mul;Ee.times=Oe.mul;Ee.divide=Oe.div;Ee.divideBy=Oe.div;Ee.dividedBy=Oe.div;Ee.reciprocal=Oe.recip;Ee.reciprocate=Oe.recip;Ee.max=Pn(o.max);Ee.min=Pn(o.min);Ee.minabs=Pn(o.minabs);Ee.maxabs=Pn(o.maxabs);Ee.clampMin=Pn(o.clampMin);Ee.clampMax=Pn(o.clampMax);Ee.logarithm=Oe.log;class m extends Ee{invert(t){if(this.internalInvert&&this.hasVariable())return this.internalInvert.call(this,t,...this.inputs);if(this.inputs.length===1&&this.hasVariable())return t;throw new Error("Cannot invert non-invertible formula")}evaluateIntegral(t){if(!this.isIntegrable())throw new Error("Cannot evaluate integral of formula without integral");return this.getIntegralFormula().evaluate(t)}invertIntegral(t){if(!this.isIntegrable()||!this.getIntegralFormula().isInvertible())throw new Error("Cannot invert integral of formula without invertible integral");return this.getIntegralFormula().invert(t)}calculateConstantOfIntegration(){const t=this.getIntegralFormula().evaluate(1),n=o.add(this.evaluate(0),this.evaluate(1)).div(2);return o.sub(n,t)}getIntegralFormula(t){if(this.integralFormula!=null&&t==null)return this.integralFormula;if(t==null){if(this.applySubstitution==null){if(t=[],this.internalIntegrate==null)throw new Error("Cannot integrate formula with non-integrable operation");let n=this.internalIntegrate.call(this,t,...this.inputs);t.forEach(i=>n=i(n)),this.integralFormula=n}else if(this.internalIntegrate)this.integralFormula=this.internalIntegrate.call(this,void 0,...this.inputs);else if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())this.integralFormula=this;else throw new Error("Cannot integrate formula without variable");return this.integralFormula}else{if(this.applySubstitution==null)throw new Error("Cannot have two complex operations in an integrable formula");if(t.push(n=>this.applySubstitution.call(this,n,...this.inputs)),this.internalIntegrateInner)return this.internalIntegrateInner.call(this,t,...this.inputs);if(this.internalIntegrate)return this.internalIntegrate.call(this,t,...this.inputs);if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())return this;throw new Error("Cannot integrate formula without variable")}}}function Pr(e,t,n=!0,i,r=o.dInf){const a=we(n),u=we(i),l=we(r);return w(()=>{var b,g,C,_;const c=s(l);if(o.eq(c,1))return o.gte(t.value,e.evaluate())?o.dOne:o.dZero;const d=s(a),v=(b=s(u))!=null?b:d?10:0;let p=0;if(o.gt(c,v)){if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula with more maxBulkAmount than directSum");if(d){if(!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");p=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((g=s(e.innermostVariable))!=null?g:0)}else p=o.floor(e.invert(t.value))}if(p=o.clampMax(p,c),v>0){const x=p;p=o.sub(p,v).clampMin(0);let E;for(d?E=Jt(e,p,!0,0):E=e.evaluate(o.add((C=s(e.innermostVariable))!=null?C:0,p));o.lt(p,c)&&o.lt(p,Number.MAX_SAFE_INTEGER)&&o.add(x,1).gte(p);){const S=e.evaluate(p.add((_=s(e.innermostVariable))!=null?_:0));if(o.add(E,S).lte(t.value))p=p.add(1),E=o.add(E,S);else break}}return p})}function Jt(e,t,n=!0,i){var c;if(o.eq(t,1))return e.evaluate();const r=(c=s(e.innermostVariable))!=null?c:0;let a=o.add(t,r);const u=a;i!=null||(i=n?10:0),a=a.sub(i).clampMin(r);let l=0;if(o.gt(t,i)){if(!e.isInvertible())throw new Error("Cannot calculate cost with indirect sum of non-invertible formula");if(n){if(!e.isIntegrable())throw new Error("Cannot calculate cost with cumulative cost of non-integrable formula");if(l=o.sub(e.evaluateIntegral(a),e.evaluateIntegral()),u.gt(1e308))return o.add(l,o.sub(u,a).times(e.evaluate(a)))}else if(l=e.evaluate(a),a=a.add(1),u.gt(1e308))return o.sub(u,a).add(1).times(l)}for(let d=a.toNumber();d{for(const a of r)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerpolicy&&(a.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?a.credentials="include":r.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}};pa();const fa="modulepreload",tr={},ga="./",Gn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${ga}${i}`,i in tr)return;tr[i]=!0;const r=i.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${a}`))return;const u=document.createElement("link");if(u.rel=r?"stylesheet":fa,r||(u.as="script",u.crossOrigin=""),u.href=i,document.head.appendChild(u),r)return new Promise((l,c)=>{u.addEventListener("load",l),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},ma="./projInfo-schema.json",va="Planar Pioneers",ha="A game about controlling and exploiting planes!",ba="planar-pioneers",ya="thepaperpilot",wa="",_a="",Na="0.0",Ca="Initial Commit",ka=!1,Ma=!1,Sa=2,Ia=!0,xa=null,$a="",Ea=["main"],Pa=3600,Da=0,Ta=!0,Aa="base64";var ye={$schema:ma,title:va,description:ha,id:ba,author:ya,discordName:wa,discordLink:_a,versionNumber:Na,versionTitle:Ca,allowGoBack:ka,defaultShowSmall:Ma,defaultDecimalsShown:Sa,useHeader:Ia,banner:xa,logo:$a,initialTabs:Ea,maxTickLength:Pa,offlineLimit:Da,enablePausing:Ta,exportEncoding:Aa};class Ra{constructor(t){this.map=new Map,this.first=void 0,this.last=void 0,this.maxSize=t}get size(){return this.map.size}get(t){const n=this.map.get(t);if(n!==void 0)return n!==this.first&&(n===this.last?(this.last=n.prev,this.last.next=void 0):(n.prev.next=n.next,n.next.prev=n.prev),n.next=this.first,this.first.prev=n,this.first=n),n.value}set(t,n){if(this.maxSize<1)return;if(this.map.has(t))throw new Error("Cannot update existing keys in the cache");const i=new Fa(t,n);for(this.first===void 0?(this.first=i,this.last=i):(i.next=this.first,this.first.prev=i,this.first=i),this.map.set(t,i);this.map.size>this.maxSize;){const r=this.last;this.map.delete(r.key),this.last=r.prev,this.last.next=void 0}}}class Fa{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const $i=17,Oa=9e15,qa=Math.log10(9e15),Va=1/9e15,Ba=308,La=-324,nr=5,ja=(1<<10)-1,za=function(){const e=[];for(let n=La+1;n<=Ba;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),sn=[2,Math.E,3,4,5,6,7,8,9,10],Ga=[[1,1.0891180521811203,1.1789767925673957,1.2701455431742086,1.3632090180450092,1.4587818160364217,1.5575237916251419,1.6601571006859253,1.767485818836978,1.8804192098842727,2],[1,1.1121114330934079,1.231038924931609,1.3583836963111375,1.4960519303993531,1.6463542337511945,1.8121385357018724,1.996971324618307,2.2053895545527546,2.4432574483385254,Math.E],[1,1.1187738849693603,1.2464963939368214,1.38527004705667,1.5376664685821402,1.7068895236551784,1.897001227148399,2.1132403089001035,2.362480153784171,2.6539010333870774,3],[1,1.1367350847096405,1.2889510672956703,1.4606478703324786,1.6570295196661111,1.8850062585672889,2.1539465047453485,2.476829779693097,2.872061932789197,3.3664204535587183,4],[1,1.1494592900767588,1.319708228183931,1.5166291280087583,1.748171114438024,2.0253263297298045,2.3636668498288547,2.7858359149579424,3.3257226212448145,4.035730287722532,5],[1,1.159225940787673,1.343712473580932,1.5611293155111927,1.8221199554561318,2.14183924486326,2.542468319282638,3.0574682501653316,3.7390572020926873,4.6719550537360774,6],[1,1.1670905356972596,1.3632807444991446,1.5979222279405536,1.8842640123816674,2.2416069644878687,2.69893426559423,3.3012632110403577,4.121250340630164,5.281493033448316,7],[1,1.1736630594087796,1.379783782386201,1.6292821855668218,1.9378971836180754,2.3289975651071977,2.8384347394720835,3.5232708454565906,4.478242031114584,5.868592169644505,8],[1,1.1793017514670474,1.394054150657457,1.65664127441059,1.985170999970283,2.4069682290577457,2.9647310119960752,3.7278665320924946,4.814462547283592,6.436522247411611,9],[1,1.1840100246247336,1.4061375836156955,1.6802272208863964,2.026757028388619,2.4770056063449646,3.080525271755482,3.9191964192627284,5.135152840833187,6.989961179534715,10]],Ua=[[-1,-.9194161097107025,-.8335625019330468,-.7425599821143978,-.6466611521029437,-.5462617907227869,-.4419033816638769,-.3342645487554494,-.224140440909962,-.11241087890006762,0],[-1,-.90603157029014,-.80786507256596,-.7064666939634,-.60294836853664,-.49849837513117,-.39430303318768,-.29147201034755,-.19097820800866,-.09361896280296,0],[-1,-.9021579584316141,-.8005762598234203,-.6964780623319391,-.5911906810998454,-.486050182576545,-.3823089430815083,-.28106046722897615,-.1831906535795894,-.08935809204418144,0],[-1,-.8917227442365535,-.781258746326964,-.6705130326902455,-.5612813129406509,-.4551067709033134,-.35319256652135966,-.2563741554088552,-.1651412821106526,-.0796919581982668,0],[-1,-.8843387974366064,-.7678744063886243,-.6529563724510552,-.5415870994657841,-.4352842206588936,-.33504449124791424,-.24138853420685147,-.15445285440944467,-.07409659641336663,0],[-1,-.8786709358426346,-.7577735191184886,-.6399546189952064,-.527284921869926,-.4211627631006314,-.3223479611761232,-.23107655627789858,-.1472057700818259,-.07035171210706326,0],[-1,-.8740862815291583,-.7497032990976209,-.6297119746181752,-.5161838335958787,-.41036238255751956,-.31277212146489963,-.2233976621705518,-.1418697367979619,-.06762117662323441,0],[-1,-.8702632331800649,-.7430366914122081,-.6213373075161548,-.5072025698095242,-.40171437727184167,-.30517930701410456,-.21736343968190863,-.137710238299109,-.06550774483471955,0],[-1,-.8670016295947213,-.7373984232432306,-.6143173985094293,-.49973884395492807,-.394584953527678,-.2989649949848695,-.21245647317021688,-.13434688362382652,-.0638072667348083,0],[-1,-.8641642839543857,-.732534623168535,-.6083127477059322,-.4934049257184696,-.3885773075899922,-.29376029055315767,-.2083678561173622,-.13155653399373268,-.062401588652553186,0]];let k=function(t){return o.fromValue_noAlloc(t)},Y=function(e,t,n){return o.fromComponents(e,t,n)},ie=function(t,n,i){return o.fromComponents_noNormalize(t,n,i)};const Zt=function(t,n){const i=n+1,r=Math.ceil(Math.log10(Math.abs(t))),a=Math.round(t*Math.pow(10,i-r))*Math.pow(10,r-i);return parseFloat(a.toFixed(Math.max(i-r,0)))},Ei=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Wa=function(e){if(!isFinite(e))return e;if(e<-50)return e===Math.trunc(e)?Number.NEGATIVE_INFINITY:0;let t=1;for(;e<10;)t=t*e,++e;e-=1;let n=.9189385332046727;n=n+(e+.5)*Math.log(e),n=n-e;const i=e*e;let r=e;return n=n+1/(12*r),r=r*i,n=n+1/(360*r),r=r*i,n=n+1/(1260*r),r=r*i,n=n+1/(1680*r),r=r*i,n=n+1/(1188*r),r=r*i,n=n+691/(360360*r),r=r*i,n=n+7/(1092*r),r=r*i,n=n+3617/(122400*r),Math.exp(n)/t},hr=.5671432904097838,ir=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return hr;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let r=0;r<100;++r){if(i=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(i-n).5?1:-1;if(Math.random()*20<1)return ie(t,0,1);const n=Math.floor(Math.random()*(e+1));let i=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(i=Math.trunc(i));let r=Math.pow(10,i);return Math.random()>.9&&(r=Math.trunc(r)),Y(t,n,r)}static affordGeometricSeries_core(e,t,n,i){const r=t.mul(n.pow(i));return y.floor(e.div(r).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,i){return t.mul(n.pow(i)).mul(y.sub(1,n.pow(e))).div(y.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const a=t.add(i.mul(n)).sub(n.div(2)),u=a.pow(2);return a.neg().add(u.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,i){const r=t.add(i.mul(n));return e.div(2).mul(r.mul(2).plus(e.sub(1).mul(n)))}static efficiencyOfPurchase_core(e,t,n){return e.div(t).add(e.div(n))}normalize(){if(this.sign===0||this.mag===0&&this.layer===0)return this.sign=0,this.mag=0,this.layer=0,this;if(this.layer===0&&this.mag<0&&(this.mag=-this.mag,this.sign=-this.sign),this.layer===0&&this.mag=Oa)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e0;)this.layer-=1,this.layer===0?this.mag=Math.pow(10,this.mag):(this.mag=t*Math.pow(10,e),e=Math.abs(this.mag),t=Math.sign(this.mag));return this.layer===0&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):this.mag===0&&(this.sign=0)),this}fromComponents(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this.normalize(),this}fromComponents_noNormalize(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this}fromMantissaExponent(e,t){return this.layer=1,this.sign=Math.sign(e),e=Math.abs(e),this.mag=t+Math.log10(e),this.normalize(),this}fromMantissaExponent_noNormalize(e,t){return this.fromMantissaExponent(e,t),this}fromDecimal(e){return this.sign=e.sign,this.layer=e.layer,this.mag=e.mag,this}fromNumber(e){return this.mag=Math.abs(e),this.sign=Math.sign(e),this.layer=0,this.normalize(),this}fromString(e){const t=e,n=y.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const C=parseFloat(i[0]),_=parseFloat(i[1]),x=i[1].split(";");let E=1;if(x.length===2&&(E=parseFloat(x[1]),isFinite(E)||(E=1)),isFinite(C)&&isFinite(_)){const S=y.pentate(C,_,E);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const C=parseFloat(r[0]),_=parseFloat(r[1]),x=r[1].split(";");let E=1;if(x.length===2&&(E=parseFloat(x[1]),isFinite(E)||(E=1)),isFinite(C)&&isFinite(_)){const S=y.tetrate(C,_,E);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}const a=e.split("^");if(a.length===2){const C=parseFloat(a[0]),_=parseFloat(a[1]);if(isFinite(C)&&isFinite(_)){const x=y.pow(C,_);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}e=e.trim().toLowerCase();let u,l,c=e.split("pt");if(c.length===2){u=10,l=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let C=parseFloat(c[1]);if(isFinite(C)||(C=1),isFinite(u)&&isFinite(l)){const _=y.tetrate(u,l,C);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){u=10,l=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let C=parseFloat(c[1]);if(isFinite(C)||(C=1),isFinite(u)&&isFinite(l)){const _=y.tetrate(u,l,C);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}const d=e.split("e"),v=d.length-1;if(v===0){const C=parseFloat(e);if(isFinite(C))return this.fromNumber(C),y.fromStringCache.size>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}else if(v===1){const C=parseFloat(e);if(isFinite(C)&&C!==0)return this.fromNumber(C),y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}const p=e.split("e^");if(p.length===2){this.sign=1,p[0].charAt(0)=="-"&&(this.sign=-1);let C="";for(let _=0;_=43&&x<=57||x===101)C+=p[1].charAt(_);else return this.layer=parseFloat(C),this.mag=parseFloat(p[1].substr(_+1)),this.normalize(),y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}}if(v<1)return this.sign=0,this.layer=0,this.mag=0,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this;const b=parseFloat(d[0]);if(b===0)return this.sign=0,this.layer=0,this.mag=0,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this;let g=parseFloat(d[d.length-1]);if(v>=2){const C=parseFloat(d[d.length-2]);isFinite(C)&&(g*=Math.sign(C),g+=Ei(C))}if(!isFinite(b))this.sign=d[0]==="-"?-1:1,this.layer=v,this.mag=g;else if(v===1)this.sign=Math.sign(b),this.layer=1,this.mag=g+Math.log10(Math.abs(b));else if(this.sign=Math.sign(b),this.layer=v,v===2){const C=y.mul(Y(1,2,g),k(b));return this.sign=C.sign,this.layer=C.layer,this.mag=C.mag,y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}else this.mag=g;return this.normalize(),y.fromStringCache.maxSize>=1&&y.fromStringCache.set(t,y.fromDecimal(this)),this}fromValue(e){return e instanceof y?this.fromDecimal(e):typeof e=="number"?this.fromNumber(e):typeof e=="string"?this.fromString(e):(this.sign=0,this.layer=0,this.mag=0,this)}toNumber(){return Number.isFinite(this.layer)?this.layer===0?this.sign*this.mag:this.layer===1?this.sign*Math.pow(10,this.mag):this.mag>0?this.sign>0?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:0:Number.NaN}mantissaWithDecimalPlaces(e){return isNaN(this.m)?Number.NaN:this.m===0?0:Zt(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Zt(this.mag,e)}toString(){return isNaN(this.layer)||isNaN(this.sign)||isNaN(this.mag)?"NaN":this.mag===Number.POSITIVE_INFINITY||this.layer===Number.POSITIVE_INFINITY?this.sign===1?"Infinity":"-Infinity":this.layer===0?this.mag<1e21&&this.mag>1e-7||this.mag===0?(this.sign*this.mag).toString():this.m+"e"+this.e:this.layer===1?this.m+"e"+this.e:this.layer<=nr?(this.sign===-1?"-":"")+"e".repeat(this.layer)+this.mag:(this.sign===-1?"-":"")+"(e^"+this.layer+")"+this.mag}toExponential(e){return this.layer===0?(this.sign*this.mag).toExponential(e):this.toStringWithDecimalPlaces(e)}toFixed(e){return this.layer===0?(this.sign*this.mag).toFixed(e):this.toStringWithDecimalPlaces(e)}toPrecision(e){return this.e<=-7?this.toExponential(e-1):e>this.e?this.toFixed(e-this.exponent-1):this.toExponential(e-1)}valueOf(){return this.toString()}toJSON(){return this.toString()}toStringWithDecimalPlaces(e){return this.layer===0?this.mag<1e21&&this.mag>1e-7||this.mag===0?(this.sign*this.mag).toFixed(e):Zt(this.m,e)+"e"+Zt(this.e,e):this.layer===1?Zt(this.m,e)+"e"+Zt(this.e,e):this.layer<=nr?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Zt(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Zt(this.mag,e)}abs(){return ie(this.sign===0?0:1,this.layer,this.mag)}neg(){return ie(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?y.dZero:this.layer===0?Y(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?y.dZero:this.layer===0?Y(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?y.dZero:this.layer===0?Y(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?y.dZero:this.layer===0?Y(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=k(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer)||this.sign===0)return t;if(t.sign===0)return this;if(this.sign===-t.sign&&this.layer===t.layer&&this.mag===t.mag)return ie(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(y.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return y.fromNumber(n.sign*n.mag+i.sign*i.mag);const r=n.layer*Math.sign(n.mag),a=i.layer*Math.sign(i.mag);if(r-a>=2)return n;if(r===0&&a===-1){if(Math.abs(i.mag-Math.log10(n.mag))>$i)return n;{const u=Math.pow(10,Math.log10(n.mag)-i.mag),l=i.sign+n.sign*u;return Y(Math.sign(l),1,i.mag+Math.log10(Math.abs(l)))}}if(r===1&&a===0){if(Math.abs(n.mag-Math.log10(i.mag))>$i)return n;{const u=Math.pow(10,n.mag-Math.log10(i.mag)),l=i.sign+n.sign*u;return Y(Math.sign(l),1,Math.log10(i.mag)+Math.log10(Math.abs(l)))}}if(Math.abs(n.mag-i.mag)>$i)return n;{const u=Math.pow(10,n.mag-i.mag),l=i.sign+n.sign*u;return Y(Math.sign(l),1,i.mag+Math.log10(Math.abs(l)))}}plus(e){return this.add(e)}sub(e){return this.add(k(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=k(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return ie(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return ie(this.sign*t.sign,0,1);let n,i;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return y.fromNumber(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return Y(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return Y(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return Y(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const r=Y(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(Y(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return Y(n.sign*i.sign,r.layer+1,r.sign*r.mag)}if(n.layer===2&&i.layer===2){const r=Y(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(Y(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return Y(n.sign*i.sign,r.layer+1,r.sign*r.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=k(e);return this.mul(t.recip())}divide(e){return this.div(e)}divideBy(e){return this.div(e)}dividedBy(e){return this.div(e)}recip(){return this.mag===0?y.dNaN:this.layer===0?Y(this.sign,0,1/this.mag):Y(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=k(e);return this.sign>t.sign?1:this.sign0?this.layer:-this.layer,i=t.mag>0?t.layer:-t.layer;return n>i?1:nt.mag?1:this.mag0?t:this}clamp(e,t){return this.max(e).min(t)}clampMin(e){return this.max(e)}clampMax(e){return this.min(e)}cmp_tolerance(e,t){const n=k(e);return this.eq_tolerance(n,t)?0:this.cmp(n)}compare_tolerance(e,t){return this.cmp_tolerance(e,t)}eq_tolerance(e,t){const n=k(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let i=this.mag,r=n.mag;return this.layer>n.layer&&(r=Ei(r)),this.layer0?Y(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Y(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?y.dNaN:this.layer>0?Y(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Y(this.sign,0,Math.log10(this.mag))}log(e){return e=k(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?y.dNaN:this.layer===0&&e.layer===0?Y(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):y.div(this.log10(),e.log10())}log2(){return this.sign<=0?y.dNaN:this.layer===0?Y(this.sign,0,Math.log2(this.mag)):this.layer===1?Y(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?Y(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):Y(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?y.dNaN:this.layer===0?Y(this.sign,0,Math.log(this.mag)):this.layer===1?Y(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?Y(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):Y(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=k(e),n=this,i=t;if(n.sign===0)return i.eq(0)?ie(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return ie(1,0,1);if(i.sign===1&&i.layer===0&&i.mag===1)return n;const r=n.absLog10().mul(i).pow10();return this.sign===-1?Math.abs(i.toNumber()%2)%2===1?r.neg():Math.abs(i.toNumber()%2)%2===0?r:y.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return y.dNaN;let e=this;if(e.layer===0){const t=Math.pow(10,e.sign*e.mag);if(Number.isFinite(t)&&Math.abs(t)>=.1)return Y(1,0,t);if(e.sign===0)return y.dOne;e=ie(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?Y(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?Y(-e.sign,e.layer+1,-e.mag):y.dOne}pow_base(e){return k(e).pow(this)}root(e){const t=k(e);return this.pow(t.recip())}factorial(){return this.mag<0?this.add(1).gamma():this.layer===0?this.add(1).gamma():this.layer===1?y.exp(y.mul(this,y.ln(this).sub(1))):y.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(ie(1,0,24)))return y.fromNumber(Wa(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const n=e*e;let i=e,r=12*i,a=1/r,u=t+a;if(u===t||(t=u,i=i*n,r=360*i,a=1/r,u=t-a,u===t))return y.exp(t);t=u,i=i*n,r=1260*i;let l=1/r;return t=t+l,i=i*n,r=1680*i,l=1/r,t=t-l,y.exp(t)}else return this.layer===1?y.exp(y.mul(this,y.ln(this).sub(1))):y.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?y.dOne:this.layer===0&&this.mag<=709.7?y.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?Y(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?Y(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):Y(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return y.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return Y(1,2,Math.log10(this.mag)-.3010299956639812);{const e=y.div(ie(this.sign,this.layer-1,this.mag),ie(1,0,2));return e.layer+=1,e.normalize(),e}}cube(){return this.pow(3)}cbrt(){return this.pow(1/3)}tetrate(e=2,t=ie(1,0,1)){if(e===1)return y.pow(this,t);if(e===0)return new y(t);if(this.eq(y.dOne))return y.dOne;if(this.eq(-1))return y.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return y.fromNumber(Math.E);const a=y.ln(this).neg();return a.lambertw().div(a)}else return r>1.444667861009766?y.fromNumber(Number.POSITIVE_INFINITY):y.dNaN}if(this.eq(y.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),y.fromNumber(r)}if(e<0)return y.iteratedlog(t,this,-e);t=k(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(y.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r3)return ie(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=ie(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return y.tetrate(e,-t,this);e=k(e);let n=y.fromDecimal(this);const i=t;t=Math.trunc(t);const r=i-t;if(n.layer-e.layer>3){const a=Math.min(t,n.layer-e.layer-3);t-=a,n.layer-=a}for(let a=0;a1e4)return n}return r>0&&r<1&&(e.eq(10)?n=n.layeradd10(-r):n=n.layeradd(-r,e)),n}slog(e=10,t=100){let n=.001,i=!1,r=!1,a=this.slog_internal(e).toNumber();for(let u=1;u1&&r!=c&&(i=!0),r=c,i?n/=2:n*=2,n=Math.abs(n)*(c?-1:1),a+=n,n===0)break}return y.fromNumber(a)}slog_internal(e=10){if(e=k(e),e.lte(y.dZero)||e.eq(y.dOne))return y.dNaN;if(e.lt(y.dOne))return this.eq(y.dOne)?y.dZero:this.eq(y.dZero)?y.dNegOne:y.dNaN;if(this.mag<0||this.eq(y.dZero))return y.dNegOne;let t=0,n=y.fromDecimal(this);if(n.layer-e.layer>3){const i=n.layer-e.layer-3;t+=i,n.layer-=i}for(let i=0;i<100;++i)if(n.lt(y.dZero))n=y.pow(e,n),t-=1;else{if(n.lte(y.dOne))return y.fromNumber(t+y.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=y.log(n,e)}return y.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:y.critical_section(e,t,Ua)}static tetrate_critical(e,t){return y.critical_section(e,t,Ga)}static critical_section(e,t,n){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let i=0,r=0;for(let u=0;ue){const l=(e-sn[u])/(sn[u+1]-sn[u]);i=n[u][Math.floor(t)]*(1-l)+n[u+1][Math.floor(t)]*l,r=n[u][Math.ceil(t)]*(1-l)+n[u+1][Math.ceil(t)]*l;break}const a=t-Math.floor(t);return i<=0||r<=0?i*(1-a)+r*a:Math.pow(e,Math.log(i)/Math.log(e)*(1-a)+Math.log(r)/Math.log(e)*a)}layeradd10(e){e=y.fromValue_noAlloc(e).toNumber();const t=y.fromDecimal(this);if(e>=1){t.mag<0&&t.layer>0?(t.sign=0,t.mag=0,t.layer=0):t.sign===-1&&t.layer==0&&(t.sign=1,t.mag=-t.mag);const n=Math.trunc(e);e-=n,t.layer+=n}if(e<=-1){const n=Math.trunc(e);if(e-=n,t.layer+=n,t.layer<0)for(let i=0;i<100;++i){if(t.layer++,t.mag=Math.log10(t.mag),!isFinite(t.mag))return t.sign===0&&(t.sign=1),t.layer<0&&(t.layer=0),t.normalize();if(t.layer>=0)break}}for(;t.layer<0;)t.layer++,t.mag=Math.log10(t.mag);return t.sign===0&&(t.sign=1,t.mag===0&&t.layer>=1&&(t.layer-=1,t.mag=1)),t.normalize(),e!==0?t.layeradd(e,10):t}layeradd(e,t){const i=this.slog(t).toNumber()+e;return i>=0?y.tetrate(t,i):Number.isFinite(i)?i>=-1?y.log(y.tetrate(t,i+1),t):y.log(y.log(y.tetrate(t,i+2),t),t):y.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return y.fromNumber(ir(this.toNumber()));if(this.layer===0)return y.fromNumber(ir(this.sign*this.mag));if(this.layer===1)return rr(this);if(this.layer===2)return rr(this);if(this.layer>=3)return ie(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return ie(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=ie(1,0,1)){t=k(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(y.dOne)?(++e,t=y.fromNumber(i)):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let r=0;r10)return t}return t}sin(){return this.mag<0?this:this.layer===0?y.fromNumber(Math.sin(this.sign*this.mag)):ie(0,0,0)}cos(){return this.mag<0?y.dOne:this.layer===0?y.fromNumber(Math.cos(this.sign*this.mag)):ie(0,0,0)}tan(){return this.mag<0?this:this.layer===0?y.fromNumber(Math.tan(this.sign*this.mag)):ie(0,0,0)}asin(){return this.mag<0?this:this.layer===0?y.fromNumber(Math.asin(this.sign*this.mag)):ie(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?y.fromNumber(Math.acos(this.toNumber())):this.layer===0?y.fromNumber(Math.acos(this.sign*this.mag)):ie(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?y.fromNumber(Math.atan(this.sign*this.mag)):y.fromNumber(Math.atan(this.sign*(1/0)))}sinh(){return this.exp().sub(this.negate().exp()).div(2)}cosh(){return this.exp().add(this.negate().exp()).div(2)}tanh(){return this.sinh().div(this.cosh())}asinh(){return y.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return y.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?ie(Number.NaN,Number.NaN,Number.NaN):y.ln(this.add(1).div(y.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(y.pow(10,e))}egg(){return this.add(9)}lessThanOrEqualTo(e){return this.cmp(e)<1}lessThan(e){return this.cmp(e)<0}greaterThanOrEqualTo(e){return this.cmp(e)>-1}greaterThan(e){return this.cmp(e)>0}};let o=y;o.fromStringCache=new Ra(ja);o.dZero=ie(0,0,0);o.dOne=ie(1,0,1);o.dNegOne=ie(-1,0,1);o.dTwo=ie(1,0,2);o.dTen=ie(1,0,10);o.dNaN=ie(Number.NaN,Number.NaN,Number.NaN);o.dInf=ie(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);o.dNegInf=ie(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);o.dNumberMax=Y(1,0,Number.MAX_VALUE);o.dNumberMin=Y(1,0,Number.MIN_VALUE);k=o.fromValue_noAlloc;Y=o.fromComponents;ie=o.fromComponents_noNormalize;o.fromMantissaExponent;o.fromMantissaExponent_noNormalize;const Ha=new o(1);function Vn(e,t,n=!0){let i=o.log10(e).floor(),r=o.div(e,o.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=Ha,i=i.add(1));const a=i.gte(1e9)?ht(i,Math.max(Math.max(t,3),ye.defaultDecimalsShown)):i.gte(1e4)?ci(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+a:"e"+a}function ci(e,t){if(e==null)return"NaN";if(e=new o(e),e.mag<.001)return 0 .toFixed(t);const i=e.toStringWithDecimalPlaces(t).split(".");return i[0]=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),i.length==1?i[0]:i[0]+"."+i[1]}function br(e,t){return e==null?"NaN":(e=new o(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),ye.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Za=new o("eeee1000"),Xa=new o("e100000"),ar=new o("e1000"),yr=new o(1e9),Ya=new o(1e6),Ja=new o(1e3),Ka=new o(.98),Qa=new o(.001),wr=new o(0);function ht(e,t,n){if(t==null&&(t=ye.defaultDecimalsShown),n=n!=null?n:ye.defaultShowSmall,e=new o(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+ht(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Za)){const i=e.slog();return i.gte(Ya)?"F"+ht(i.floor()):o.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+ci(i.floor(),0)}else{if(e.gte(Xa))return Vn(e,0,!1);if(e.gte(ar))return Vn(e,0);if(e.gte(yr))return Vn(e,t);if(e.gte(Ja))return ci(e,0);if(e.gte(Qa)||!n)return br(e,t);if(e.eq(wr))return 0 .toFixed(t)}return e=Nr(e),e.lt(ar)?Vn(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):ht(e,t)+"\u207B\xB9"}function Ke(e){return e=new o(e),e.sign<0?"-"+Ke(e.neg()):e.gte(yr)||e.lte(Ka)&&!e.eq(wr)?ht(e):ht(e,0)}function _r(e){return o.lt(e,0)?"-"+_r(o.neg(e)):o.gt(e,2**51)?ht(o.div(e,31536e3))+"y":(e=new o(e).toNumber(),e<60?ht(e)+"s":e<3600?Ke(Math.floor(e/60))+"m "+ht(e%60)+"s":e<86400?Ke(Math.floor(e/3600))+"h "+Ke(Math.floor(e/60)%60)+"m "+Ke(e%60)+"s":e<31536e3?Ke(Math.floor(e/84600)%365)+"d "+Ke(Math.floor(e/3600)%24)+"h "+Ke(Math.floor(e/60)%60)+"m":Ke(Math.floor(e/31536e3))+"y "+Ke(Math.floor(e/84600)%365)+"d "+Ke(Math.floor(e/3600)%24)+"h")}function es(e,t,n){e=new o(e);let i=e.toStringWithDecimalPlaces(t);return new o(i).gte(n)&&(i=o.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function ts(e,t){return ht(e,t,!0)}function Nr(e){let t=o.log10(e).ceil();const n=o.div(e,o.pow(10,t));return t=t.neg(),e=new o(10).pow(t).times(n),e}var ns=Object.freeze(Object.defineProperty({__proto__:null,default:o,exponentialFormat:Vn,commaFormat:ci,regularFormat:br,format:ht,formatWhole:Ke,formatTime:_r,toPlaces:es,formatSmall:ts,invertOOM:Nr},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:is,commaFormat:rs,regularFormat:as,format:Ie,formatWhole:pt,formatTime:hi,toPlaces:ss,formatSmall:jt,invertOOM:os}=ns;window.Decimal=o;window.exponentialFormat=is;window.commaFormat=rs;window.regularFormat=as;window.format=Ie;window.formatWhole=pt;window.formatTime=hi;window.toPlaces=ss;window.formatSmall=jt;window.invertOOM=os;function at(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Un(e){return typeof e=="function"}var H=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(H||{});const Wn=Symbol("DoNotCache");function $(e,t){const n=e[t];Un(n)&&n.length===0&&!n[Wn]?e[t]=w(n.bind(e)):Un(n)&&(e[t]=n.bind(e),e[t][Wn]=!0)}function we(e){return Un(e)&&!e[Wn]&&(e=w(e)),e}const bt=Symbol("Component"),ft=Symbol("GatherProps");let ls=0;function nn(e="feature-"){return e+ls++}var ke=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(ke||{});function We(e){const t=s(e);return t!==2&&t!==!1}function vn(e){return s(e)===1}function K(e){return e[Wn]=!0,e}function oe(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function Hn(e,...t){const n=[],i=r=>{Object.keys(r).forEach(a=>{const u=r[a];u!=null&&typeof u=="object"&&(t.includes(u.type)?n.push(u):!(u instanceof o)&&!Fe(u)&&i(u))})};return i(e),n}const on={variables:{"--foreground":"#dfdfdf","--background":"#0f0f0f","--feature-foreground":"#0f0f0f","--tooltip-background":"rgba(0, 0, 0, 0.75)","--raised-background":"#0f0f0f","--points":"#ffffff","--locked":"#bf8f8f","--highlighted":"#333","--bought":"#77bf5f","--danger":"rgb(220, 53, 69)","--link":"#02f2f2","--outline":"#dfdfdf","--accent1":"#627a82","--accent2":"#658262","--accent3":"#7c6282","--border-radius":"15px","--modal-border":"solid 2px var(--color)","--feature-margin":"0px"},floatingTabs:!0,mergeAdjacent:!0,showPin:!0};var Vi=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Vi||{}),Nt={classic:on,paper:{...on,variables:{...on.variables,"--background":"#2a323d","--feature-foreground":"#000","--raised-background":"#333c4a","--locked":"#3a3e45","--bought":"#5C8A58","--outline":"#333c4a","--border-radius":"4px","--modal-border":"","--feature-margin":"5px"},floatingTabs:!1},nordic:{...on,variables:{...on.variables,"--foreground":"#D8DEE9","--background":"#2E3440","--feature-foreground":"#000","--raised-background":"#3B4252","--points":"#E5E9F0","--locked":"#4c566a","--highlighted":"#434c5e","--bought":"#8FBCBB","--danger":"#D08770","--link":"#88C0D0","--outline":"#3B4252","--accent1":"#B48EAD","--accent2":"#A3BE8C","--accent3":"#EBCB8B","--border-radius":"4px","--modal-border":"solid 2px #3B4252","--feature-margin":"5px"},floatingTabs:!1},aqua:{...on,variables:{...on.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const et=vr();"fonts"in document&&(document.fonts.onloadingdone=()=>et.emit("fontsLoaded"));var us=Object.freeze(Object.defineProperty({__proto__:null,globalBus:et},Symbol.toStringTag,{value:"Module"}));const cs=fn({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var Q=window.player=cs;function Cr(e){return JSON.stringify(e,(t,n)=>s(n))}function kr(e={}){return Object.assign({id:`${ye.id}-0`,name:"Default Save",tabs:ye.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:ye.id,modVersion:ye.versionNumber,layers:{}},e)}function gt(e){const t=Yt.compressToUTF16(Cr(e!=null?e:Q));return localStorage.setItem((e!=null?e:Q).id,t),t}async function ds(){gs();try{let e=localStorage.getItem(de.active);if(e==null){await cn(Sn());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Yt.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==ye.id){await cn(Sn());return}t.id=de.active,await cn(t)}catch(e){console.error(`Failed to load save. Falling back to new save. +`,e),await cn(Sn())}}function Sn(){const e=li(),t=kr({id:e});return gt(t),de.saves.push(e),t}function li(){let e,t=0;do e=`${ye.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const ps=U(!1);async function cn(e){console.info("Loading save",e),ps.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await Gn(()=>Promise.resolve().then(function(){return cl}),void 0),{fixOldSave:r,getInitialLayers:a}=await Gn(()=>Promise.resolve().then(function(){return cp}),void 0);for(const u in t){const l=t[u];l&&n(l)}a(e).forEach(u=>i(u,e)),e=kr(e),e.offlineProd&&e.time!=null&&e.time&&e.devSpeed!==0&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=Math.min(e.offlineTime+(Date.now()-e.time)/1e3,ye.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ye.versionNumber&&(r(e.modVersion,e),e.modVersion=ye.versionNumber),Object.assign(Q,e),de.active=Q.id,et.emit("onLoad")}setInterval(()=>{Q.autosave&>()},1e3);window.onbeforeunload=()=>{Q.autosave&>()};window.save=gt;const fs=window.hardReset=async()=>{await cn(Sn())};window.deleteLowerSaves=()=>{const e=Object.values(de.saves).indexOf(Q.id)+1;Object.values(de.saves).slice(e).forEach(t=>localStorage.removeItem(t)),de.saves=de.saves.slice(0,e)};const Zn=fn({active:"",saves:[],showTPS:!0,theme:Vi.Nordic,unthrottled:!1,alignUnits:!1});mt(Zn,e=>{const t=Yt.compressToUTF16(JSON.stringify(e));localStorage.setItem(ye.id,t)},{deep:!0});var de=window.settings=Zn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Vi.Nordic,alignUnits:!1};et.emit("loadSettings",e),Object.assign(Zn,e),fs()};function gs(){try{let e=localStorage.getItem(ye.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Yt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Zn,t)}et.emit("loadSettings",Zn)}catch{}}const Mr=fn([]);function ms(e){Mr.push(e)}const vs=fn([]),hs=fn([]),bs={class:"table"},ys=J({__name:"Column",setup(e){const t=w(()=>Nt[de.theme].mergeAdjacent);return(n,i)=>(M(),A("div",bs,[N("div",{class:_e(["col",{mergeAdjacent:s(t)}])},[Tt(n.$slots,"default")],2)]))}}),ws={class:"table"},_s=J({__name:"Row",setup(e){const t=w(()=>Nt[de.theme].mergeAdjacent);return(n,i)=>(M(),A("div",ws,[N("div",{class:_e(["row",{mergeAdjacent:s(t)}])},[Tt(n.$slots,"default")],2)]))}});function Sr(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Kr(e)}function fe(e,t="span"){return typeof e=="function"?J({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),J({template:e})):J({render:()=>({})}):e}function lt(e){if(It(e))return typeof e=="function"?e():fe(e);const t=e[bt];return f(t,e[ft](),null)}function Pi(...e){let t;return f(_s,null,Sr(t=e.map(lt))?t:{default:()=>[t]})}function Ns(...e){let t;return f(ys,null,Sr(t=e.map(lt))?t:{default:()=>[t]})}function Ct(e){if(It(e))return typeof e=="function"?e():typeof e=="string"?f(re,null,[e]):f(e,null,null);const t=e[bt];return f(t,e[ft](),null)}function sr(e,t){return e.reduce((n,i)=>f(re,null,[n,t,i]))}function It(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Wn]===!0}function Ir(e,t){const n=U(null),i=U(void 0);function r(l){n.value||(n.value=setInterval(u,250)),i.value=l}function a(){n.value&&(clearInterval(n.value),n.value=null)}function u(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return mr(a),{start:r,stop:a,handleHolding:u}}function xr(e,t="div"){const n=vt();return St(()=>{n.value=fe($e(e),t)}),n}function En(e,t="div"){const n=vt(null);return St(()=>{const i=$e(e);n.value=i==""||i==null?null:fe(i,t)}),n}function $e(e){return s(s(e))}function q(...e){return e.includes(Object)||e.push(Object),e}function or(e){const t=U(!1),n=e[ft].bind(e);return e[ft]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}var ve=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const Cs=J({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var v;const n=U({}),i=new ResizeObserver(l),r=U(null);mi(()=>{const p=r.value;p!=null&&i.observe(p)});let a=!0,u=U((v=r.value)==null?void 0:v.getBoundingClientRect());function l(){a&&(a=!1,zt(()=>{var p;u.value=(p=r.value)==null?void 0:p.getBoundingClientRect(),Object.values(n.value).filter(b=>b).forEach(b=>b.rect=b.element.getBoundingClientRect()),t("updateNodes",n.value),a=!0}))}et.on("fontsLoaded",l);const c={attributes:!1,childList:!0,subtree:!1};ri(Bi,(p,b)=>{const g=new MutationObserver(()=>d(p));g.observe(b,c),n.value[p]={element:b,observer:g,rect:b.getBoundingClientRect()},l()}),ri(Li,p=>{var b;(b=n.value[p])==null||b.observer.disconnect(),n.value[p]=void 0,l()}),ri(ji,n),ri(zi,u);function d(p){const b=n.value[p];b!=null&&(b.rect=b.element.getBoundingClientRect(),t("updateNodes",n.value))}return(p,b)=>(M(),A(re,null,[Tt(p.$slots,"default",{},void 0,!0),N("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var $r=ve(Cs,[["__scopeId","data-v-2b1dc1bc"]]);const ks=["onPointerdown"],Ms={class:"modal-wrapper"},Ss={class:"modal-container"},Is={class:"modal-header"},xs={class:"modal-body"},$s={class:"modal-footer"},Es=N("div",{class:"modal-default-flex-grow"},null,-1),Ut=J({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=De(e),a=w(()=>s(r.modelValue)||l.value);function u(){n("update:modelValue",!1)}const l=U(!1),c=U(null),d=w(()=>{var v,p;return(p=(v=c.value)==null?void 0:v.nodes)!=null?p:null});return t({isOpen:a,nodes:d}),(v,p)=>(M(),ne(ea,{to:"#modal-root"},[f(zn,{name:"modal",onBeforeEnter:p[0]||(p[0]=b=>l.value=!0),onAfterLeave:p[1]||(p[1]=b=>l.value=!1)},{default:Z(()=>[Oi(N("div",Gt({class:"modal-mask",onPointerdown:In(u,["self"])},v.$attrs),[N("div",Ms,[N("div",Ss,[N("div",Is,[Tt(v.$slots,"header",{shown:s(a)},()=>[D(" default header ")])]),N("div",xs,[f($r,{ref_key:"contextRef",ref:c},{default:Z(()=>[Tt(v.$slots,"body",{shown:s(a)},()=>[D(" default body ")])]),_:3},512)]),N("div",$s,[Tt(v.$slots,"footer",{shown:s(a)},()=>[N("div",{class:"modal-default-footer"},[Es,N("button",{class:"button modal-default-button",onClick:u}," Close ")])])])])])],16,ks),[[Qr,e.modelValue]])]),_:3})]))}}),Xt=Symbol("ProxyState");function tt(e,t={}){const n=t;let i=!1;function r(){return i||(Object.assign(n,e.call(n,n)),i=!0),n}return new Proxy(n,{get(a,u){if(u===Xt)return r();const l=r()[u];return l!=null&&typeof l=="object"&&Dt in l?l[Dt]:l},set(a,u,l){return r()[u]=l,!0},has(a,u){return u===Xt?!0:Reflect.has(r(),u)},ownKeys(){return Reflect.ownKeys(r())},getOwnPropertyDescriptor(a,u){return i||(Object.assign(n,e.call(n,n)),i=!0),Object.getOwnPropertyDescriptor(a,u)}})}var Ue=window.state=qi({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Er=o.ln(10);function Bn(e){return e}function Ps(e,t){if(R(t))return t.invert(o.neg(e));throw new Error("Could not invert due to no input being a variable")}function Ds(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return m.neg(t.getIntegralFormula(e))}throw new Error("Could not integrate due to no input being a variable")}function Ts(e){return m.neg(e)}function As(e,t,n){if(R(t))return t.invert(o.sub(e,Me(n)));if(R(n))return n.invert(o.sub(e,Me(t)));throw new Error("Could not invert due to no input being a variable")}function Rs(e,t,n){var i,r;if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.times(n,(i=t.innermostVariable)!=null?i:0).add(a)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).add(a)}throw new Error("Could not integrate due to no input being a variable")}function Fs(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.add(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.add(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Os(e,t,n){if(R(t))return t.invert(o.add(e,Me(n)));if(R(n))return n.invert(o.sub(Me(t),e));throw new Error("Could not invert due to no input being a variable")}function qs(e,t,n){var i,r;if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.sub(a,m.times(n,(i=t.innermostVariable)!=null?i:0))}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).sub(a)}throw new Error("Could not integrate due to no input being a variable")}function Vs(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.sub(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.sub(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Bs(e,t,n){if(R(t))return t.invert(o.div(e,Me(n)));if(R(n))return n.invert(o.div(e,Me(t)));throw new Error("Could not invert due to no input being a variable")}function Ls(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.times(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function js(e,t,n){if(R(t))return m.div(e,n);if(R(n))return m.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function zs(e,t,n){if(R(t))return t.invert(o.mul(e,Me(n)));if(R(n))return n.invert(o.div(Me(t),e));throw new Error("Could not invert due to no input being a variable")}function Gs(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.div(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function Us(e,t,n){if(R(t))return m.mul(e,n);if(R(n))return m.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Ws(e,t){if(R(t))return t.invert(o.recip(e));throw new Error("Could not invert due to no input being a variable")}function Hs(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function Zs(e,t){if(R(t))return t.invert(o.pow10(e));throw new Error("Could not invert due to no input being a variable")}function Xs(e){return o.ln(e).sub(1).times(e).div(Er)}function Ys(e,t){if(R(t)){const n=Er.times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function Js(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:Xs,invert:Ys})}throw new Error("Could not integrate due to no input being a variable")}function Ks(e,t,n){if(R(t))return t.invert(o.pow(Me(n),e));if(R(n))return n.invert(o.root(Me(t),e));throw new Error("Could not invert due to no input being a variable")}function Qs(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function eo(e,t,n){if(R(t)){const i=o.ln(Me(n)).times(e);return t.invert(i.div(i.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function to(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e),n],evaluate:Qs,invert:eo})}throw new Error("Could not integrate due to no input being a variable")}function no(e,t){if(R(t))return t.invert(o.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function io(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function ro(e,t){if(R(t)){const n=o.ln(2).times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function ao(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:io,invert:ro})}throw new Error("Could not integrate due to no input being a variable")}function so(e,t){if(R(t))return t.invert(o.exp(e));throw new Error("Could not invert due to no input being a variable")}function oo(e){return o.ln(e).sub(1).times(e)}function lo(e,t){if(R(t))return t.invert(o.div(e,o.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function uo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:oo,invert:lo})}throw new Error("Could not integrate due to no input being a variable")}function co(e,t,n){if(R(t))return t.invert(o.root(e,Me(n)));if(R(n))return n.invert(o.ln(e).div(o.ln(Me(t))));throw new Error("Could not invert due to no input being a variable")}function po(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e),r=m.add(n,1);return m.pow(i,r).div(r)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.pow(t,i).div(m.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function fo(e,t){if(R(t))return t.invert(o.root(e,10));throw new Error("Could not invert due to no input being a variable")}function go(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.pow10(n).div(m.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function mo(e,t,n){if(R(t))return t.invert(o.ln(e).div(o.ln(Me(n))));if(R(n))return n.invert(o.root(Me(t),e));throw new Error("Could not invert due to no input being a variable")}function vo(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(n,i).div(m.ln(n))}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e),r=m.add(t,1);return m.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function ho(e,t,n){if(R(t))return t.invert(o.root(e,o.recip(Me(n))));if(R(n))return n.invert(o.ln(Me(t)).div(o.ln(e)));throw new Error("Could not invert due to no input being a variable")}function bo(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(i,m.recip(n).add(1)).times(n).div(m.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function yo(e,t){if(R(t))return t.invert(o.ln(e));throw new Error("Could not invert due to no input being a variable")}function wo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function _o(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.tetrate(e,i,n)}function No(e,t,n,i){if(R(t))return t.invert(o.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function Co(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.iteratedexp(e,i,new o(n))}function ko(e,t,n,i){if(R(t))return t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,Me(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Mo(e,t=10,n=2){const i=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,i)}function So(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function Io(e,t,n){if(R(t))return t.invert(o.tetrate(e,o.minabs(1e308,Me(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function xo(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.layeradd(e,i,n)}function $o(e,t,n,i){if(R(t))return t.invert(o.layeradd(e,o.minabs(1e308,Me(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function Eo(e,t){if(R(t))return t.invert(o.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function Po(e,t){if(R(t))return t.invert(o.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function Do(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.pentate(e,i,n)}function To(e,t){if(R(t))return t.invert(o.asin(e));throw new Error("Could not invert due to no input being a variable")}function Ao(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function Ro(e,t){if(R(t))return t.invert(o.acos(e));throw new Error("Could not invert due to no input being a variable")}function Fo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function Oo(e,t){if(R(t))return t.invert(o.atan(e));throw new Error("Could not invert due to no input being a variable")}function qo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function Vo(e,t){if(R(t))return t.invert(o.sin(e));throw new Error("Could not invert due to no input being a variable")}function Bo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asin(n).times(n).add(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Lo(e,t){if(R(t))return t.invert(o.cos(e));throw new Error("Could not invert due to no input being a variable")}function jo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acos(n).times(n).sub(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function zo(e,t){if(R(t))return t.invert(o.tan(e));throw new Error("Could not invert due to no input being a variable")}function Go(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atan(n).times(n).sub(m.ln(m.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function Uo(e,t){if(R(t))return t.invert(o.asinh(e));throw new Error("Could not invert due to no input being a variable")}function Wo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function Ho(e,t){if(R(t))return t.invert(o.acosh(e));throw new Error("Could not invert due to no input being a variable")}function Zo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function Xo(e,t){if(R(t))return t.invert(o.atanh(e));throw new Error("Could not invert due to no input being a variable")}function Yo(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function Jo(e,t){if(R(t))return t.invert(o.sinh(e));throw new Error("Could not invert due to no input being a variable")}function Ko(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asinh(n).times(n).sub(m.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function Qo(e,t){if(R(t))return t.invert(o.cosh(e));throw new Error("Could not invert due to no input being a variable")}function el(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acosh(n).times(n).sub(m.add(n,1).sqrt().times(m.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function tl(e,t){if(R(t))return t.invert(o.tanh(e));throw new Error("Could not invert due to no input being a variable")}function nl(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atanh(n).times(n).add(m.sub(1,m.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function Pn(e){return(t,n)=>new m({inputs:[t,n],evaluate:e,invert:Bn})}function R(e){return e instanceof Ee&&e.hasVariable()}function Me(e,t){return e instanceof Ee?e.evaluate(t):s(e)}function il(){return m.pow(this,2).div(2)}function rl(){return this}const Oe=class{constructor(e){this.negate=this.neg,this.negated=this.neg,this.sgn=this.sign,this.plus=this.add,this.subtract=this.sub,this.minus=this.sub,this.multiply=this.mul,this.times=this.mul,this.divide=this.div,this.divideBy=this.div,this.dividedBy=this.div,this.reciprocal=this.recip,this.reciprocate=this.recip,this.logarithm=this.log;let t;"inputs"in e&&(e.inputs=e.inputs.map(n=>typeof n=="object"&&Dt in n?n[Dt]:n)),"variable"in e?(typeof e.variable=="object"&&Dt in e.variable&&(e.variable=e.variable[Dt]),t=this.setupVariable(e)):"evaluate"in e?t=this.setupFormula(e):t=this.setupConstant(e),this.inputs=t.inputs,this.internalVariables=t.internalVariables,this.innermostVariable=t.innermostVariable,this.internalEvaluate=t.internalEvaluate,this.internalInvert=t.internalInvert,this.internalIntegrate=t.internalIntegrate,this.internalIntegrateInner=t.internalIntegrateInner,this.applySubstitution=t.applySubstitution}setupVariable({variable:e}){return{inputs:[e],internalVariables:1,innermostVariable:e,internalIntegrate:il,internalIntegrateInner:rl,applySubstitution:Bn}}setupConstant({inputs:e}){if(e.length!==1)throw new Error("Evaluate function is required if inputs is not length 1");return{inputs:e,internalVariables:0}}setupFormula(e){var b,g;const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:a,applySubstitution:u}=e,l=t.reduce((C,_)=>C+(_ instanceof Oe?_.internalVariables:0),0),c=t.find(C=>C instanceof Oe&&C.hasVariable()),d=l===1?c==null?void 0:c.innermostVariable:void 0,v=(b=c==null?void 0:c.isInvertible())!=null?b:!1,p=(g=c==null?void 0:c.isIntegrable())!=null?g:!1;return{inputs:t,internalEvaluate:n,internalInvert:v?i:void 0,internalIntegrate:p?r:void 0,internalIntegrateInner:a,applySubstitution:u,innermostVariable:d,internalVariables:l}}isInvertible(){return this.hasVariable()&&(this.internalInvert!=null||this.internalEvaluate==null)}isIntegrable(){return this.hasVariable()&&this.internalIntegrate!=null}isIntegralInvertible(){return this.isIntegrable()?this.getIntegralFormula().isInvertible():!1}hasVariable(){return this.internalVariables===1}evaluate(e){var t,n,i;return(i=(n=(t=this.internalEvaluate)==null?void 0:t.call(this,...this.inputs.map(r=>Me(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:Me(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof Oe&&e.inputs[n]instanceof Oe?t.equals(e.inputs[n]):!(t instanceof Oe)&&!(e.inputs[n]instanceof Oe)&&o.eq(s(t),s(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new m({inputs:[e]})}static variable(e){return new m({variable:e})}static step(e,t,n){const i=n(m.variable(0)),r=we(t);function a(l){return o.lt(l,s(r))?l:o.add(i.evaluate(o.sub(l,s(r))),s(r))}function u(l,c){if(R(c)&&i.isInvertible())return o.gt(l,s(r))&&(l=o.add(i.invert(o.sub(l,s(r))),s(r))),c.invert(l);throw new Error("Could not invert due to no input being a variable")}return new m({inputs:[e],evaluate:a,invert:i.isInvertible()&&i.hasVariable()?u:void 0})}static if(e,t,n,i){const r=U(0),a=m.variable(r),u=n(a),l=i==null?void 0:i(a),c=we(t);function d(p){return s(c)?(r.value=p,u.evaluate()):l?(r.value=p,l.evaluate()):p}function v(p,b){if(!R(b)||!u.isInvertible()||l!=null&&!l.isInvertible())throw new Error("Could not invert due to no input being a variable");return s(c)?b.invert(u.invert(p)):l?b.invert(l.invert(p)):b.invert(p)}return new m({inputs:[e],evaluate:d,invert:u.isInvertible()&&u.hasVariable()?v:void 0})}static conditional(e,t,n,i){return m.if(e,t,n,i)}static abs(e){return new m({inputs:[e],evaluate:o.abs})}static neg(e){return new m({inputs:[e],evaluate:o.neg,invert:Ps,applySubstitution:Ts,integrate:Ds})}static sign(e){return new m({inputs:[e],evaluate:o.sign})}static round(e){return new m({inputs:[e],evaluate:o.round})}static floor(e){return new m({inputs:[e],evaluate:o.floor})}static ceil(e){return new m({inputs:[e],evaluate:o.ceil})}static trunc(e){return new m({inputs:[e],evaluate:o.trunc})}static add(e,t){return new m({inputs:[e,t],evaluate:o.add,invert:As,integrate:Rs,integrateInner:Fs,applySubstitution:Bn})}static sub(e,t){return new m({inputs:[e,t],evaluate:o.sub,invert:Os,integrate:qs,integrateInner:Vs,applySubstitution:Bn})}static mul(e,t){return new m({inputs:[e,t],evaluate:o.mul,invert:Bs,integrate:Ls,applySubstitution:js})}static div(e,t){return new m({inputs:[e,t],evaluate:o.div,invert:zs,integrate:Gs,applySubstitution:Us})}static recip(e){return new m({inputs:[e],evaluate:o.recip,invert:Ws,integrate:Hs})}static clamp(e,t,n){return new m({inputs:[e,t,n],evaluate:o.clamp,invert:Bn})}static pLog10(e){return new m({inputs:[e],evaluate:o.pLog10})}static absLog10(e){return new m({inputs:[e],evaluate:o.absLog10})}static log10(e){return new m({inputs:[e],evaluate:o.log10,invert:Zs,integrate:Js})}static log(e,t){return new m({inputs:[e,t],evaluate:o.log,invert:Ks,integrate:to})}static log2(e){return new m({inputs:[e],evaluate:o.log2,invert:no,integrate:ao})}static ln(e){return new m({inputs:[e],evaluate:o.ln,invert:so,integrate:uo})}static pow(e,t){return new m({inputs:[e,t],evaluate:o.pow,invert:co,integrate:po})}static pow10(e){return new m({inputs:[e],evaluate:o.pow10,invert:fo,integrate:go})}static pow_base(e,t){return new m({inputs:[e,t],evaluate:o.pow_base,invert:mo,integrate:vo})}static root(e,t){return new m({inputs:[e,t],evaluate:o.root,invert:ho,integrate:bo})}static factorial(e){return new m({inputs:[e],evaluate:o.factorial})}static gamma(e){return new m({inputs:[e],evaluate:o.gamma})}static lngamma(e){return new m({inputs:[e],evaluate:o.lngamma})}static exp(e){return new m({inputs:[e],evaluate:o.exp,invert:yo,integrate:wo})}static sqr(e){return m.pow(e,2)}static sqrt(e){return m.root(e,2)}static cube(e){return m.pow(e,3)}static cbrt(e){return m.root(e,3)}static tetrate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:_o,invert:No})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:Co,invert:ko})}static iteratedlog(e,t=10,n=1){return new m({inputs:[e,t,n],evaluate:Mo})}static slog(e,t=10){return new m({inputs:[e,t],evaluate:So,invert:Io})}static layeradd10(e,t){return new m({inputs:[e,t],evaluate:o.layeradd10})}static layeradd(e,t,n=10){return new m({inputs:[e,t,n],evaluate:xo,invert:$o})}static lambertw(e){return new m({inputs:[e],evaluate:o.lambertw,invert:Eo})}static ssqrt(e){return new m({inputs:[e],evaluate:o.ssqrt,invert:Po})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:Do})}static sin(e){return new m({inputs:[e],evaluate:o.sin,invert:Vo,integrate:Ao})}static cos(e){return new m({inputs:[e],evaluate:o.cos,invert:Lo,integrate:Fo})}static tan(e){return new m({inputs:[e],evaluate:o.tan,invert:zo,integrate:qo})}static asin(e){return new m({inputs:[e],evaluate:o.asin,invert:To,integrate:Bo})}static acos(e){return new m({inputs:[e],evaluate:o.acos,invert:Ro,integrate:jo})}static atan(e){return new m({inputs:[e],evaluate:o.atan,invert:Oo,integrate:Go})}static sinh(e){return new m({inputs:[e],evaluate:o.sinh,invert:Jo,integrate:Wo})}static cosh(e){return new m({inputs:[e],evaluate:o.cosh,invert:Qo,integrate:Zo})}static tanh(e){return new m({inputs:[e],evaluate:o.tanh,invert:tl,integrate:Yo})}static asinh(e){return new m({inputs:[e],evaluate:o.asinh,invert:Uo,integrate:Ko})}static acosh(e){return new m({inputs:[e],evaluate:o.acosh,invert:Ho,integrate:el})}static atanh(e){return new m({inputs:[e],evaluate:o.atanh,invert:Xo,integrate:nl})}step(e,t){return m.step(this,e,t)}if(e,t){return m.if(this,e,t)}conditional(e,t){return m.if(this,e,t)}abs(){return m.abs(this)}neg(){return m.neg(this)}sign(){return m.sign(this)}round(){return m.round(this)}floor(){return m.floor(this)}ceil(){return m.ceil(this)}trunc(){return m.trunc(this)}add(e){return m.add(this,e)}sub(e){return m.sub(this,e)}mul(e){return m.mul(this,e)}div(e){return m.div(this,e)}recip(){return m.recip(this)}max(e){return m.max(this,e)}min(e){return m.min(this,e)}maxabs(e){return m.maxabs(this,e)}minabs(e){return m.minabs(this,e)}clamp(e,t){return m.clamp(this,e,t)}clampMin(e){return m.clampMin(this,e)}clampMax(e){return m.clampMax(this,e)}pLog10(){return m.pLog10(this)}absLog10(){return m.absLog10(this)}log10(){return m.log10(this)}log(e){return m.log(this,e)}log2(){return m.log2(this)}ln(){return m.ln(this)}pow(e){return m.pow(this,e)}pow10(){return m.pow10(this)}pow_base(e){return m.pow_base(this,e)}root(e){return m.root(this,e)}factorial(){return m.factorial(this)}gamma(){return m.gamma(this)}lngamma(){return m.lngamma(this)}exp(){return m.exp(this)}sqr(){return m.pow(this,2)}sqrt(){return m.root(this,2)}cube(){return m.pow(this,3)}cbrt(){return m.root(this,3)}tetrate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.tetrate(this,e,t)}iteratedexp(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return m.iteratedlog(this,e,t)}slog(e=10){return m.slog(this,e)}layeradd10(e){return m.layeradd10(this,e)}layeradd(e,t){return m.layeradd(this,e,t)}lambertw(){return m.lambertw(this)}ssqrt(){return m.ssqrt(this)}pentate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.pentate(this,e,t)}sin(){return m.sin(this)}cos(){return m.cos(this)}tan(){return m.tan(this)}asin(){return m.asin(this)}acos(){return m.acos(this)}atan(){return m.atan(this)}sinh(){return m.sinh(this)}cosh(){return m.cosh(this)}tanh(){return m.tanh(this)}asinh(){return m.asinh(this)}acosh(){return m.acosh(this)}atanh(){return m.atanh(this)}};let Ee=Oe;Ee.negate=Oe.neg;Ee.negated=Oe.neg;Ee.sgn=Oe.sign;Ee.plus=Oe.add;Ee.subtract=Oe.sub;Ee.minus=Oe.sub;Ee.multiply=Oe.mul;Ee.times=Oe.mul;Ee.divide=Oe.div;Ee.divideBy=Oe.div;Ee.dividedBy=Oe.div;Ee.reciprocal=Oe.recip;Ee.reciprocate=Oe.recip;Ee.max=Pn(o.max);Ee.min=Pn(o.min);Ee.minabs=Pn(o.minabs);Ee.maxabs=Pn(o.maxabs);Ee.clampMin=Pn(o.clampMin);Ee.clampMax=Pn(o.clampMax);Ee.logarithm=Oe.log;class m extends Ee{invert(t){if(this.internalInvert&&this.hasVariable())return this.internalInvert.call(this,t,...this.inputs);if(this.inputs.length===1&&this.hasVariable())return t;throw new Error("Cannot invert non-invertible formula")}evaluateIntegral(t){if(!this.isIntegrable())throw new Error("Cannot evaluate integral of formula without integral");return this.getIntegralFormula().evaluate(t)}invertIntegral(t){if(!this.isIntegrable()||!this.getIntegralFormula().isInvertible())throw new Error("Cannot invert integral of formula without invertible integral");return this.getIntegralFormula().invert(t)}calculateConstantOfIntegration(){const t=this.getIntegralFormula().evaluate(1),n=o.add(this.evaluate(0),this.evaluate(1)).div(2);return o.sub(n,t)}getIntegralFormula(t){if(this.integralFormula!=null&&t==null)return this.integralFormula;if(t==null){if(this.applySubstitution==null){if(t=[],this.internalIntegrate==null)throw new Error("Cannot integrate formula with non-integrable operation");let n=this.internalIntegrate.call(this,t,...this.inputs);t.forEach(i=>n=i(n)),this.integralFormula=n}else if(this.internalIntegrate)this.integralFormula=this.internalIntegrate.call(this,void 0,...this.inputs);else if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())this.integralFormula=this;else throw new Error("Cannot integrate formula without variable");return this.integralFormula}else{if(this.applySubstitution==null)throw new Error("Cannot have two complex operations in an integrable formula");if(t.push(n=>this.applySubstitution.call(this,n,...this.inputs)),this.internalIntegrateInner)return this.internalIntegrateInner.call(this,t,...this.inputs);if(this.internalIntegrate)return this.internalIntegrate.call(this,t,...this.inputs);if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())return this;throw new Error("Cannot integrate formula without variable")}}}function Pr(e,t,n=!0,i,r=o.dInf){const a=we(n),u=we(i),l=we(r);return w(()=>{var b,g,C,_;const c=s(l);if(o.eq(c,1))return o.gte(t.value,e.evaluate())?o.dOne:o.dZero;const d=s(a),v=(b=s(u))!=null?b:d?10:0;let p=0;if(o.gt(c,v)){if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula with more maxBulkAmount than directSum");if(d){if(!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");p=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((g=s(e.innermostVariable))!=null?g:0)}else p=o.floor(e.invert(t.value))}if(p=o.clampMax(p,c),v>0){const x=p;p=o.sub(p,v).clampMin(0);let E;for(d?E=Jt(e,p,!0,0):E=e.evaluate(o.add((C=s(e.innermostVariable))!=null?C:0,p));o.lt(p,c)&&o.lt(p,Number.MAX_SAFE_INTEGER)&&o.add(x,1).gte(p);){const S=e.evaluate(p.add((_=s(e.innermostVariable))!=null?_:0));if(o.add(E,S).lte(t.value))p=p.add(1),E=o.add(E,S);else break}}return p})}function Jt(e,t,n=!0,i){var c;if(o.eq(t,1))return e.evaluate();const r=(c=s(e.innermostVariable))!=null?c:0;let a=o.add(t,r);const u=a;i!=null||(i=n?10:0),a=a.sub(i).clampMin(r);let l=0;if(o.gt(t,i)){if(!e.isInvertible())throw new Error("Cannot calculate cost with indirect sum of non-invertible formula");if(n){if(!e.isIntegrable())throw new Error("Cannot calculate cost with cumulative cost of non-integrable formula");if(l=o.sub(e.evaluateIntegral(a),e.evaluateIntegral()),u.gt(1e308))return o.add(l,o.sub(u,a).times(e.evaluate(a)))}else if(l=e.evaluate(a),a=a.add(1),u.gt(1e308))return o.sub(u,a).add(1).times(l)}for(let d=a.toNumber();dn.trim()).join(` -`))!=null?t:""}function lr(e,t){var n;if(o.isNaN(t))throw Ue.hasNaN||(Q.autosave=!1,Ue.hasNaN=!0,Ue.NaNPath=e[cn],Ue.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[cn])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[Kt].value=t}function dt(e,t=!0){const n=Fe(e)?e:U(e);Fe(e)&&(e=e.value);const i=w({get(){return n.value},set(a){t?lr(r,a):r[Kt].value=a}});i[en]=e;const r={get value(){return n.value},set value(a){t?lr(r,a):r[Kt].value=a},__v_isRef:!0,[Kt]:n,[en]:e,[ci]:al(),[di]:!1,[Tt]:i,[cn]:void 0};return ct.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,` +`))!=null?t:""}function lr(e,t){var n;if(o.isNaN(t))throw Ue.hasNaN||(Q.autosave=!1,Ue.hasNaN=!0,Ue.NaNPath=e[dn],Ue.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[dn])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[Kt].value=t}function dt(e,t=!0){const n=Fe(e)?e:U(e);Fe(e)&&(e=e.value);const i=w({get(){return n.value},set(a){t?lr(r,a):r[Kt].value=a}});i[en]=e;const r={get value(){return n.value},set value(a){t?lr(r,a):r[Kt].value=a},__v_isRef:!0,[Kt]:n,[en]:e,[di]:al(),[pi]:!1,[Dt]:i,[dn]:void 0};return ct.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,` Created at: -`+r[ci]):dn[ct[ct.length-1]].add(r),r}function sl(e){return e!=null&&typeof e=="object"&&Kt in e}function Nn(e){return!(Xt in e)&&Tt in e?e[Tt]:new Proxy(e,{get(t,n){if(n!==Kt)return n===Xn?!0:t[n]},set(t,n,i){return t[n]=i,!0},has(t,n){return n===Kt?!1:n==Xn?!0:Reflect.has(t,n)}})}function Tr(e){ct.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):dn[ct[ct.length-1]].delete(e),e[di]=!0}et.on("addLayer",(e,t)=>{const n=[],i=(r,a=[])=>{let u=!1;return Object.keys(r).forEach(l=>{let c=r[l];if(c!=null&&typeof c=="object"){if(c[Xn]===!0)return;if(Xt in c&&(c=c[Xt]),sl(c)){if(u=!0,c[di]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` +`+r[di]):pn[ct[ct.length-1]].add(r),r}function sl(e){return e!=null&&typeof e=="object"&&Kt in e}function Nn(e){return!(Xt in e)&&Dt in e?e[Dt]:new Proxy(e,{get(t,n){if(n!==Kt)return n===Xn?!0:t[n]},set(t,n,i){return t[n]=i,!0},has(t,n){return n===Kt?!1:n==Xn?!0:Reflect.has(t,n)}})}function Dr(e){ct.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):pn[ct[ct.length-1]].delete(e),e[pi]=!0}et.on("addLayer",(e,t)=>{const n=[],i=(r,a=[])=>{let u=!1;return Object.keys(r).forEach(l=>{let c=r[l];if(c!=null&&typeof c=="object"){if(c[Xn]===!0)return;if(Xt in c&&(c=c[Xt]),sl(c)){if(u=!0,c[pi]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` Created at: -`+c[ci]);return}dn[e.id].delete(c);const d=[e.id,...a,l];c[cn]!=null&&JSON.stringify(d)!==JSON.stringify(c[cn])&&console.error(`Persistent ref is being saved to \`${d.join(".")}\` when it's already present at \`${c[cn].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[cn]=d;const v=a.reduce((b,g)=>(g in b||(b[g]={}),b[g]),t),p=v[l];v[l]=c[Kt],ta(v)?p!=null?v[l]=p:v[l]=c[en]:p!=null?v[l].value=p:v[l].value=c[en]}else!(c instanceof o)&&!(c instanceof m)&&!Fe(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...a,l])&&(At(c)&&!At(r)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",Xt in r?r[Xt]:r,l):u=!0))}}),u};i(e[Xt]),dn[e.id].forEach(r=>{r[di]||console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,r,` +`+c[di]);return}pn[e.id].delete(c);const d=[e.id,...a,l];c[dn]!=null&&JSON.stringify(d)!==JSON.stringify(c[dn])&&console.error(`Persistent ref is being saved to \`${d.join(".")}\` when it's already present at \`${c[dn].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[dn]=d;const v=a.reduce((b,g)=>(g in b||(b[g]={}),b[g]),t),p=v[l];v[l]=c[Kt],ta(v)?p!=null?v[l]=p:v[l]=c[en]:p!=null?v[l].value=p:v[l].value=c[en]}else!(c instanceof o)&&!(c instanceof m)&&!Fe(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...a,l])&&(At(c)&&!At(r)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",Xt in r?r[Xt]:r,l):u=!0))}}),u};i(e[Xt]),pn[e.id].forEach(r=>{r[pi]||console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,r,` Created at: -`+r[ci])}),dn[e.id].clear()});const Bi=Symbol("RegisterNode"),Li=Symbol("UnregisterNode"),ji=Symbol("Nodes"),zi=Symbol("Bounds"),me=qi({});window.layers=me;const dn={},ct=[];function Gi(e,t){return tt(()=>{const n={},i=n.emitter=vr();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=U({}),n.id=e,ct.push(e),dn[e]=new Set,n.minimized=dt(!1,!1),Object.assign(n,t.call(n,n)),ct[ct.length-1]==null||ct[ct.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen +`+r[di])}),pn[e.id].clear()});const Bi=Symbol("RegisterNode"),Li=Symbol("UnregisterNode"),ji=Symbol("Nodes"),zi=Symbol("Bounds"),me=qi({});window.layers=me;const pn={},ct=[];function Gi(e,t){return tt(()=>{const n={},i=n.emitter=vr();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=U({}),n.id=e,ct.push(e),pn[e]=new Set,n.minimized=dt(!1,!1),Object.assign(n,t.call(n,n)),ct[ct.length-1]==null||ct[ct.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen Stack: ${ct} -Trying to pop ${n.id}`;ct.pop(),$(n,"color"),$(n,"display"),$(n,"classes"),$(n,"style"),$(n,"name"),oe(n,"name",n.id),$(n,"minWidth"),oe(n,"minWidth",600),$(n,"minimizable"),oe(n,"minimizable",!0),$(n,"minimizedDisplay");const r=n.style;return n.style=w(()=>{var u,l;let a=s(n.minWidth);return(typeof a=="number"||!Number.isNaN(parseInt(a)))&&(a=a+"px"),[(u=s(r))!=null?u:"",(l=n.minimized)!=null&&l.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:a,flexBasis:a,margin:""}]}),n})}function Ui(e,t){if(console.info("Adding layer",e.id),me[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,me[e.id]);return}oe(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),me[e.id]=e,et.emit("addLayer",e,t.layers[e.id])}function ol(e){return me[e]}function Wi(e){console.info("Removing layer",e.id),et.emit("removeLayer",e),me[e.id]=void 0}function ll(e){Wi(e),Ui(e,Q)}function ul(e){const t=U(!1);return{openModal:()=>t.value=!0,modal:K(()=>f(Ut,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>f("h2",null,[s(e.name)]),body:s(e.display)}))}}et.on("update",function(t){Object.values(me).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(me).forEach(n=>{n==null||n.emit("update",t)}),Object.values(me).forEach(n=>{n==null||n.emit("postUpdate",t)})});var cl=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Bi,UnregisterNodeInjectionKey:Li,NodesInjectionKey:ji,BoundsInjectionKey:zi,layers:me,persistentRefs:dn,addingLayers:ct,createLayer:Gi,addLayer:Ui,getLayer:ol,removeLayer:Wi,reloadLayer:ll,setupLayerModal:ul},Symbol.toStringTag,{value:"Module"}));const dl=J({components:{Context:$r},props:{index:{type:Number,required:!0},display:{type:q(Object,String,Function),required:!0},minimizedDisplay:q(Object,String,Function),minimized:{type:Object,required:!0},name:{type:q(String),required:!0},color:q(String),minimizable:q(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=Te(e),a=xr(t),u=En(r),l=w(()=>ye.allowGoBack&&n.value>0&&!$e(i));function c(){Q.tabs.splice(s(e.index),1/0)}function d(v){e.nodes.value=v}return{component:a,minimizedComponent:u,showGoBack:l,updateNodes:d,unref:s,goBack:c}}}),pl={key:1};function fl(e,t,n,i,r,a){const u=kt("Context");return M(),A("div",{class:"layer-container",style:Le({"--layer-color":e.unref(e.color)})},[e.showGoBack?(M(),A("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...l)=>e.goBack&&e.goBack(...l))},"\u274C")):G("",!0),e.unref(e.minimized)?(M(),A("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=l=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(M(),ne(Qe(e.minimizedComponent),{key:0})):(M(),A("div",pl,pe(e.unref(e.name)),1))])):(M(),A("div",{key:2,class:_e(["layer-tab",{showGoBack:e.showGoBack}])},[f(u,{onUpdateNodes:e.updateNodes},{default:Z(()=>[(M(),ne(Qe(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(M(),A("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=l=>e.$emit("setMinimized",!0))}," \u25BC ")):G("",!0)],4)}var gl=ve(dl,[["render",fl],["__scopeId","data-v-72dd78b1"]]);const Dr=e=>(gn("data-v-4b4bda40"),e=e(),mn(),e),ml=Dr(()=>N("h2",null,"Changelog",-1)),vl=Dr(()=>N("details",{open:""},[N("summary",null,[T("v0.0 Initial Commit - "),N("time",null,"2021-09-04")]),T(" This is the first release :D "),N("ul",null,[N("li",{class:"feature"},"Did everything"),N("li",{class:"fix"},"Had some fun"),N("li",{class:"breaking"},"Removed everything"),N("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),hl=J({__name:"Changelog",setup(e,{expose:t}){const n=U(!1);return t({open(){n.value=!0}}),(i,r)=>(M(),ne(Ut,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=a=>n.value=a)},{header:Z(()=>[ml]),body:Z(()=>[vl]),_:1},8,["modelValue"]))}});var bl=ve(hl,[["__scopeId","data-v-4b4bda40"]]),yl=J({props:{element:Object,display:{type:q(Object,String,Function),required:!0},style:q(Object,String,Array),classes:q(Object),direction:q(String),xoffset:q(String),yoffset:q(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=Te(e),r=U(!1),a=w(()=>($e(i)||r.value)&&u.value),u=En(n),l=vt(fe(K(()=>{const v=$e(t);return v==null?"":Ct(v)})));function c(v){const p=i;v.shiftKey&&p&&(p.value=!p.value,v.stopPropagation(),v.preventDefault())}const d=w(()=>$e(i)&&Nt[de.theme].showPin);return{Direction:H,isHovered:r,isShown:a,comp:u,elementComp:l,unref:s,togglePinned:c,showPin:d}}});const wl={key:0,class:"material-icons pinned"};function _l(e,t,n,i,r,a){return M(),A("div",{class:_e(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=u=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=u=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...u)=>e.togglePinned&&e.togglePinned(...u))},[Dt(e.$slots,"default",{},void 0,!0),e.elementComp?(M(),ne(Qe(e.elementComp),{key:0})):G("",!0),f(zn,{name:"fade"},{default:Z(()=>{var u;return[e.isShown?(M(),A("div",{key:0,class:_e(["tooltip",{top:e.unref(e.direction)===e.Direction.Up,left:e.unref(e.direction)===e.Direction.Left,right:e.unref(e.direction)===e.Direction.Right,bottom:e.unref(e.direction)===e.Direction.Down,...e.unref(e.classes)}]),style:Le([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(u=e.unref(e.style))!=null?u:{}])},[e.showPin?(M(),A("span",wl,"push_pin")):G("",!0),e.comp?(M(),ne(Qe(e.comp),{key:1})):G("",!0)],6)):G("",!0)]}),_:1})],34)}var Re=ve(yl,[["render",_l],["__scopeId","data-v-6102fa3a"]]);const hn=e=>(gn("data-v-4f97aa40"),e=e(),mn(),e),Nl={class:"info-modal-header"},Cl=["src","alt"],kl={class:"info-modal-title"},Ml={key:0},Sl={key:0},Il={key:0},xl=hn(()=>N("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),$l=hn(()=>N("br",null,null,-1)),El=hn(()=>N("br",null,null,-1)),Pl=["href"],Tl=hn(()=>N("span",{class:"material-icons info-modal-discord"},"discord",-1)),Dl=hn(()=>N("div",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[N("span",{class:"material-icons info-modal-discord"},"discord"),T(" The Paper Pilot Community ")])],-1)),Al=hn(()=>N("div",null,[N("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[N("span",{class:"material-icons info-modal-discord"},"discord"),T(" The Modding Tree ")])],-1)),Rl=hn(()=>N("br",null,null,-1));var Fl=J({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:r,author:a,discordName:u,discordLink:l,versionNumber:c,versionTitle:d}=ye,v=Te(n),p=U(!1),b=w(()=>vi(Q.timePlayed)),g=w(()=>fe(K(()=>f(re,null,[vs.map(lt)]))));t({open(){p.value=!0}});function C(){var _;(_=s(v.changelog))==null||_.open()}return(_,x)=>(M(),ne(Ut,{modelValue:p.value,"onUpdate:modelValue":x[0]||(x[0]=E=>p.value=E)},{header:Z(()=>[N("div",Nl,[s(r)?(M(),A("img",{key:0,class:"info-modal-logo",src:s(r),alt:s(i)},null,8,Cl)):G("",!0),N("div",kl,[N("h2",null,pe(s(i)),1),N("h4",null,[T(" v"+pe(s(c)),1),s(d)?(M(),A("span",Ml,": "+pe(s(d)),1)):G("",!0)])])])]),body:Z(({shown:E})=>[E?(M(),A("div",Sl,[s(a)?(M(),A("div",Il,"By "+pe(s(a)),1)):G("",!0),xl,$l,N("div",{class:"link",onClick:C},"Changelog"),El,N("div",null,[s(l)?(M(),A("a",{key:0,href:s(l),class:"info-modal-discord-link",target:"_blank"},[Tl,T(" "+pe(s(u)),1)],8,Pl)):G("",!0)]),Dl,Al,Rl,N("div",null,"Time Played: "+pe(s(b)),1),(M(),ne(Qe(s(g))))])):G("",!0)]),_:1},8,["modelValue"]))}});var Ol=ve(Fl,[["__scopeId","data-v-4f97aa40"]]);const ql={class:"field"},Vl={key:0,class:"field-title"},Hi=J({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var u;const n=e,i=En(Qt(n,"title"),"span"),r=U((u=n.options.find(l=>l.value===n.modelValue))!=null?u:null);mt(Qt(n,"modelValue"),l=>{var c;$e(r)!==l&&(r.value=(c=n.options.find(d=>d.value===l))!=null?c:null)});function a(l){t("update:modelValue",l.value)}return(l,c)=>(M(),A("div",ql,[s(i)?(M(),A("span",Vl,[(M(),ne(Qe(s(i))))])):G("",!0),f(s(oa),{options:e.options,modelValue:r.value,"onUpdate:modelValue":[c[0]||(c[0]=d=>r.value=d),a],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const Bl={class:"field"},Ll=J({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=w(()=>{var a;return fe((a=s(n.title))!=null?a:"","span")}),r=w({get(){return!!n.modelValue},set(a){t("update:modelValue",a)}});return(a,u)=>(M(),A("label",Bl,[Oi(N("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":u[0]||(u[0]=l=>Fe(r)?r.value=l:null)},null,512),[[na,s(r)]]),(M(),ne(Qe(s(i))))]))}});var Bt=ve(Ll,[["__scopeId","data-v-11046116"]]);const jl=["onClick"],zl=J({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=U(!1),i=U(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,zt(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(a,u)=>(M(),A("button",{onClick:In(r,["stop"]),class:_e(["feedback",{activated:n.value,left:e.left}])},[Dt(a.$slots,"default",{},void 0,!0)],10,jl))}});var Ar=ve(zl,[["__scopeId","data-v-01a1b95c"]]);const Gl={class:"header"},Ul=N("h2",null,"Settings",-1),Wl={class:"option-tabs"},Hl={key:0},Zl={key:1};var Xl=J({__name:"Options",setup(e,{expose:t}){const n=U(!1),i=U("behaviour");function r(ue){return ue==i.value}function a(ue){i.value=ue}t({isTab:r,setTab:a,save:gt,open(){n.value=!0}});const u=Object.keys(Nt).map(ue=>({label:at(ue),value:ue})),l=w(()=>fe(K(()=>f(re,null,[Mr.map(lt)])))),{showTPS:c,theme:d,unthrottled:v,alignUnits:p}=Te(de),{autosave:b,offlineProd:g}=Te(Q),C=w({get(){return Q.devSpeed===0},set(ue){Q.devSpeed=ue?0:null}}),_=K(()=>f("span",{class:"option-title"},[T("Unthrottled"),f("desc",null,[T("Allow the game to run as fast as possible. Not battery friendly.")])])),x=K(()=>f("span",{class:"option-title"},[T("Offline Production"),f(Re,{display:"Save-specific",direction:H.Right},{default:()=>[T("*")]}),f("desc",null,[T("Simulate production that occurs while the game is closed.")])])),E=K(()=>f("span",{class:"option-title"},[T("Autosave"),f(Re,{display:"Save-specific",direction:H.Right},{default:()=>[T("*")]}),f("desc",null,[T("Automatically save the game every second or when the game is closed.")])])),S=K(()=>f("span",{class:"option-title"},[T("Pause game"),f(Re,{display:"Save-specific",direction:H.Right},{default:()=>[T("*")]}),f("desc",null,[T("Stop everything from moving.")])])),D=K(()=>f("span",{class:"option-title"},[T("Theme"),f("desc",null,[T("How the game looks.")])])),B=K(()=>f("span",{class:"option-title"},[T("Show TPS"),f("desc",null,[T("Show TPS meter at the bottom-left corner of the page.")])])),le=K(()=>f("span",{class:"option-title"},[T("Align modifier units"),f("desc",null,[T("Align numbers to the beginning of the unit in modifier view.")])]));return(ue,te)=>(M(),ne(Ut,{modelValue:n.value,"onUpdate:modelValue":te[10]||(te[10]=X=>n.value=X)},{header:Z(()=>[N("div",Gl,[Ul,N("div",Wl,[N("button",{class:_e({selected:r("behaviour")}),onClick:te[0]||(te[0]=X=>a("behaviour"))},"Behaviour",2),N("button",{class:_e({selected:r("appearance")}),onClick:te[1]||(te[1]=X=>a("appearance"))},"Appearance",2)])])]),body:Z(()=>[r("behaviour")?(M(),A("div",Hl,[f(Bt,{title:s(_),modelValue:s(v),"onUpdate:modelValue":te[2]||(te[2]=X=>Fe(v)?v.value=X:null)},null,8,["title","modelValue"]),s(ye).enablePausing?(M(),ne(Bt,{key:0,title:s(S),modelValue:s(C),"onUpdate:modelValue":te[3]||(te[3]=X=>Fe(C)?C.value=X:null)},null,8,["title","modelValue"])):G("",!0),f(Bt,{title:s(x),modelValue:s(g),"onUpdate:modelValue":te[4]||(te[4]=X=>Fe(g)?g.value=X:null)},null,8,["title","modelValue"]),f(Bt,{title:s(E),modelValue:s(b),"onUpdate:modelValue":te[5]||(te[5]=X=>Fe(b)?b.value=X:null)},null,8,["title","modelValue"]),s(b)?G("",!0):(M(),ne(Ar,{key:1,class:"button save-button",onClick:te[6]||(te[6]=X=>s(gt)())},{default:Z(()=>[T("Manually save")]),_:1}))])):G("",!0),r("appearance")?(M(),A("div",Zl,[f(Hi,{title:s(D),options:s(u),modelValue:s(d),"onUpdate:modelValue":te[7]||(te[7]=X=>Fe(d)?d.value=X:null)},null,8,["title","options","modelValue"]),(M(),ne(Qe(s(l)))),f(Bt,{title:s(B),modelValue:s(c),"onUpdate:modelValue":te[8]||(te[8]=X=>Fe(c)?c.value=X:null)},null,8,["title","modelValue"]),f(Bt,{title:s(le),modelValue:s(p),"onUpdate:modelValue":te[9]||(te[9]=X=>Fe(p)?p.value=X:null)},null,8,["title","modelValue"])])):G("",!0)]),_:1},8,["modelValue"]))}});const Yl=["onSubmit"],Jl={class:"field"},Kl={key:0,class:"field-title"},Ql=["placeholder"],eu=J({__name:"Text",props:{title:null,modelValue:null,textArea:{type:Boolean},placeholder:null,maxHeight:null,submitOnBlur:{type:Boolean}},emits:["update:modelValue","submit","cancel"],setup(e,{emit:t}){const n=e,i=En(Qt(n,"title"),"span"),r=vt(null);gi(()=>{var c;(c=r.value)==null||c.focus()});const a=w({get(){var c;return(c=s(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function u(){t("submit")}function l(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,d)=>(M(),A("form",{onSubmit:In(u,["prevent"])},[N("div",Jl,[s(i)?(M(),A("span",Kl,[(M(),ne(Qe(s(i))))])):G("",!0),e.textArea?(M(),ne(s(ua),{key:1,modelValue:s(a),"onUpdate:modelValue":d[0]||(d[0]=v=>Fe(a)?a.value=v:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:l,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):Oi((M(),A("input",{key:2,type:"text","onUpdate:modelValue":d[1]||(d[1]=v=>Fe(a)?a.value=v:null),placeholder:e.placeholder,class:_e({fullWidth:!e.title}),onBlur:l,ref_key:"field",ref:r},null,42,Ql)),[[ia,s(a)]])])],40,Yl))}});var Rr=ve(eu,[["__scopeId","data-v-90bd4994"]]);const tu={key:0},nu=["onClick","disabled"],iu={key:0},ru=["onClick"],au=J({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=Te(e),r=U(!1);mt(r,l=>{t("confirmingChanged",l)});function a(){if(s(i.skipConfirm)){t("click");return}r.value&&t("click"),r.value=!r.value}function u(){r.value=!1}return(l,c)=>(M(),A("span",{class:_e(["container",{confirming:r.value}])},[r.value?(M(),A("span",tu,"Are you sure?")):G("",!0),N("button",{onClick:In(a,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(M(),A("span",iu,"Yes")):Dt(l.$slots,"default",{key:1},void 0,!0)],8,nu),r.value?(M(),A("button",{key:1,class:"button",onClick:In(u,["stop"])},"No",8,ru)):G("",!0)],2))}});var su=ve(au,[["__scopeId","data-v-2f8ef34c"]]);const Wt=e=>(gn("data-v-32313015"),e=e(),mn(),e),ou=Wt(()=>N("div",{class:"handle material-icons"},"drag_handle",-1)),lu={key:0,class:"actions"},uu=Wt(()=>N("span",{class:"material-icons"},"content_paste",-1)),cu=Wt(()=>N("span",{class:"material-icons"},"content_copy",-1)),du=Wt(()=>N("span",{class:"material-icons"},"edit",-1)),pu=Wt(()=>N("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),fu={key:1,class:"actions"},gu=Wt(()=>N("span",{class:"material-icons"},"check",-1)),mu=Wt(()=>N("span",{class:"material-icons"},"close",-1)),vu={key:2,class:"details"},hu={class:"save-version"},bu=Wt(()=>N("br",null,null,-1)),yu={key:0},wu={key:3,class:"details"},_u={key:4,class:"details error"},Nu=Wt(()=>N("br",null,null,-1)),Cu=J({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=Te(n),r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),a=U(!1),u=U(!1),l=U("");mt(a,()=>{var p;return l.value=(p=i.value.name)!=null?p:""});const c=w(()=>i.value!=null&&i.value.id===Q.id),d=w(()=>{var p;return c.value?Q.time:(p=i.value!=null&&i.value.time)!=null?p:0});function v(){t("editName",l.value),a.value=!1}return(p,b)=>(M(),A("div",{class:_e(["save",{active:s(c)}])},[ou,a.value?(M(),A("div",fu,[N("button",{onClick:v,class:"button"},[f(Re,{display:"Save",direction:s(H).Left,class:"info"},{default:Z(()=>[gu]),_:1},8,["direction"])]),N("button",{onClick:b[5]||(b[5]=g=>a.value=!a.value),class:"button"},[f(Re,{display:"Cancel",direction:s(H).Left,class:"info"},{default:Z(()=>[mu]),_:1},8,["direction"])])])):(M(),A("div",lu,[s(i).error==null&&!u.value?(M(),ne(Ar,{key:0,onClick:b[0]||(b[0]=g=>t("export")),class:"button",left:""},{default:Z(()=>[f(Re,{display:"Export",direction:s(H).Left,class:"info"},{default:Z(()=>[uu]),_:1},8,["direction"])]),_:1})):G("",!0),s(i).error==null&&!u.value?(M(),A("button",{key:1,onClick:b[1]||(b[1]=g=>t("duplicate")),class:"button"},[f(Re,{display:"Duplicate",direction:s(H).Left,class:"info"},{default:Z(()=>[cu]),_:1},8,["direction"])])):G("",!0),s(i).error==null&&!u.value?(M(),A("button",{key:2,onClick:b[2]||(b[2]=g=>a.value=!a.value),class:"button"},[f(Re,{display:"Edit Name",direction:s(H).Left,class:"info"},{default:Z(()=>[du]),_:1},8,["direction"])])):G("",!0),f(su,{disabled:s(c),onClick:b[3]||(b[3]=g=>t("delete")),onConfirmingChanged:b[4]||(b[4]=g=>u.value=g)},{default:Z(()=>[f(Re,{display:"Delete",direction:s(H).Left,class:"info"},{default:Z(()=>[pu]),_:1},8,["direction"])]),_:1},8,["disabled"])])),s(i).error==null&&!a.value?(M(),A("div",vu,[N("button",{class:"button open",onClick:b[6]||(b[6]=g=>t("open"))},[N("h3",null,pe(s(i).name),1)]),N("span",hu,"v"+pe(s(i).modVersion),1),bu,s(d)?(M(),A("div",yu,"Last played "+pe(s(r).format(s(d))),1)):G("",!0)])):s(i).error==null&&a.value?(M(),A("div",wu,[f(Rr,{modelValue:l.value,"onUpdate:modelValue":b[7]||(b[7]=g=>l.value=g),class:"editname",onSubmit:v},null,8,["modelValue"])])):(M(),A("div",_u,[T(" Error: Failed to load save with id "+pe(s(i).id),1),Nu,T(pe(s(i).error),1)]))],2))}});var ku=ve(Cu,[["__scopeId","data-v-32313015"]]);const Zi=e=>(gn("data-v-2a4275be"),e=e(),mn(),e),Mu=Zi(()=>N("h2",null,"Saves Manager",-1)),Su={class:"modal-footer"},Iu={class:"field"},xu=Zi(()=>N("span",{class:"field-title"},"Create Save",-1)),$u={class:"field-buttons"},Eu={class:"footer"},Pu=Zi(()=>N("div",{style:{"flex-grow":"1"}},null,-1)),Tu=J({__name:"SavesManager",setup(e,{expose:t}){const n=U(!1),i=U(null);t({open(){n.value=!0}});const r=U(!1),a=U(""),u=U(null);mt(a,S=>{S?zt(()=>{try{if(S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Yt.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S),r.value=!0;return}const D=JSON.parse(S);if(typeof D!="object"){r.value=!0;return}const B=oi();D.id=B,gt(D),a.value="",r.value=!1,de.saves.push(B)}catch{r.value=!0}}):r.value=!1});let l={},c=U(Object.keys(l).reduce((S,D)=>(S.push({label:D.split("/").slice(-1)[0].slice(0,-4),value:l[D]}),S),[]));const d=qi({});function v(S){if(d[S]==null){let D=localStorage.getItem(S);if(D==null)d[S]={error:"Save doesn't exist in localStorage",id:S};else if(D==="dW5kZWZpbmVk")d[S]={error:"Save is undefined",id:S};else try{if(D[0]!=="{")if(D[0]==="e")D=decodeURIComponent(escape(atob(D)));else if(D[0]==="\u1BE1")D=Yt.decompressFromUTF16(D);else return console.warn("Unable to determine preset encoding",D),r.value=!0,d[S]={error:"Unable to determine preset encoding",id:S},d[S];d[S]={...JSON.parse(D),id:S}}catch(B){d[S]={error:B,id:S},console.warn(`SavesManager: Failed to load info about save with id ${S}: +Trying to pop ${n.id}`;ct.pop(),$(n,"color"),$(n,"display"),$(n,"classes"),$(n,"style"),$(n,"name"),oe(n,"name",n.id),$(n,"minWidth"),oe(n,"minWidth",600),$(n,"minimizable"),oe(n,"minimizable",!0),$(n,"minimizedDisplay");const r=n.style;return n.style=w(()=>{var u,l;let a=s(n.minWidth);return(typeof a=="number"||!Number.isNaN(parseInt(a)))&&(a=a+"px"),[(u=s(r))!=null?u:"",(l=n.minimized)!=null&&l.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:a,flexBasis:a,margin:""}]}),n})}function Ui(e,t){if(console.info("Adding layer",e.id),me[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,me[e.id]);return}oe(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),me[e.id]=e,et.emit("addLayer",e,t.layers[e.id])}function ol(e){return me[e]}function Wi(e){console.info("Removing layer",e.id),et.emit("removeLayer",e),me[e.id]=void 0}function ll(e){Wi(e),Ui(e,Q)}function ul(e){const t=U(!1);return{openModal:()=>t.value=!0,modal:K(()=>f(Ut,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>f("h2",null,[s(e.name)]),body:s(e.display)}))}}et.on("update",function(t){Object.values(me).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(me).forEach(n=>{n==null||n.emit("update",t)}),Object.values(me).forEach(n=>{n==null||n.emit("postUpdate",t)})});var cl=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Bi,UnregisterNodeInjectionKey:Li,NodesInjectionKey:ji,BoundsInjectionKey:zi,layers:me,persistentRefs:pn,addingLayers:ct,createLayer:Gi,addLayer:Ui,getLayer:ol,removeLayer:Wi,reloadLayer:ll,setupLayerModal:ul},Symbol.toStringTag,{value:"Module"}));const dl=J({components:{Context:$r},props:{index:{type:Number,required:!0},display:{type:q(Object,String,Function),required:!0},minimizedDisplay:q(Object,String,Function),minimized:{type:Object,required:!0},name:{type:q(String),required:!0},color:q(String),minimizable:q(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=De(e),a=xr(t),u=En(r),l=w(()=>ye.allowGoBack&&n.value>0&&!$e(i));function c(){Q.tabs.splice(s(e.index),1/0)}function d(v){e.nodes.value=v}return{component:a,minimizedComponent:u,showGoBack:l,updateNodes:d,unref:s,goBack:c}}}),pl={key:1};function fl(e,t,n,i,r,a){const u=kt("Context");return M(),A("div",{class:"layer-container",style:Le({"--layer-color":e.unref(e.color)})},[e.showGoBack?(M(),A("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...l)=>e.goBack&&e.goBack(...l))},"\u274C")):G("",!0),e.unref(e.minimized)?(M(),A("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=l=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(M(),ne(Qe(e.minimizedComponent),{key:0})):(M(),A("div",pl,pe(e.unref(e.name)),1))])):(M(),A("div",{key:2,class:_e(["layer-tab",{showGoBack:e.showGoBack}])},[f(u,{onUpdateNodes:e.updateNodes},{default:Z(()=>[(M(),ne(Qe(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(M(),A("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=l=>e.$emit("setMinimized",!0))}," \u25BC ")):G("",!0)],4)}var gl=ve(dl,[["render",fl],["__scopeId","data-v-72dd78b1"]]);const Tr=e=>(gn("data-v-4b4bda40"),e=e(),mn(),e),ml=Tr(()=>N("h2",null,"Changelog",-1)),vl=Tr(()=>N("details",{open:""},[N("summary",null,[D("v0.0 Initial Commit - "),N("time",null,"2021-09-04")]),D(" This is the first release :D "),N("ul",null,[N("li",{class:"feature"},"Did everything"),N("li",{class:"fix"},"Had some fun"),N("li",{class:"breaking"},"Removed everything"),N("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),hl=J({__name:"Changelog",setup(e,{expose:t}){const n=U(!1);return t({open(){n.value=!0}}),(i,r)=>(M(),ne(Ut,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=a=>n.value=a)},{header:Z(()=>[ml]),body:Z(()=>[vl]),_:1},8,["modelValue"]))}});var bl=ve(hl,[["__scopeId","data-v-4b4bda40"]]),yl=J({props:{element:Object,display:{type:q(Object,String,Function),required:!0},style:q(Object,String,Array),classes:q(Object),direction:q(String),xoffset:q(String),yoffset:q(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=De(e),r=U(!1),a=w(()=>($e(i)||r.value)&&u.value),u=En(n),l=vt(fe(K(()=>{const v=$e(t);return v==null?"":Ct(v)})));function c(v){const p=i;v.shiftKey&&p&&(p.value=!p.value,v.stopPropagation(),v.preventDefault())}const d=w(()=>$e(i)&&Nt[de.theme].showPin);return{Direction:H,isHovered:r,isShown:a,comp:u,elementComp:l,unref:s,togglePinned:c,showPin:d}}});const wl={key:0,class:"material-icons pinned"};function _l(e,t,n,i,r,a){return M(),A("div",{class:_e(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=u=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=u=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...u)=>e.togglePinned&&e.togglePinned(...u))},[Tt(e.$slots,"default",{},void 0,!0),e.elementComp?(M(),ne(Qe(e.elementComp),{key:0})):G("",!0),f(zn,{name:"fade"},{default:Z(()=>{var u;return[e.isShown?(M(),A("div",{key:0,class:_e(["tooltip",{top:e.unref(e.direction)===e.Direction.Up,left:e.unref(e.direction)===e.Direction.Left,right:e.unref(e.direction)===e.Direction.Right,bottom:e.unref(e.direction)===e.Direction.Down,...e.unref(e.classes)}]),style:Le([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(u=e.unref(e.style))!=null?u:{}])},[e.showPin?(M(),A("span",wl,"push_pin")):G("",!0),e.comp?(M(),ne(Qe(e.comp),{key:1})):G("",!0)],6)):G("",!0)]}),_:1})],34)}var Re=ve(yl,[["render",_l],["__scopeId","data-v-6102fa3a"]]);const hn=e=>(gn("data-v-4f97aa40"),e=e(),mn(),e),Nl={class:"info-modal-header"},Cl=["src","alt"],kl={class:"info-modal-title"},Ml={key:0},Sl={key:0},Il={key:0},xl=hn(()=>N("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),$l=hn(()=>N("br",null,null,-1)),El=hn(()=>N("br",null,null,-1)),Pl=["href"],Dl=hn(()=>N("span",{class:"material-icons info-modal-discord"},"discord",-1)),Tl=hn(()=>N("div",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[N("span",{class:"material-icons info-modal-discord"},"discord"),D(" The Paper Pilot Community ")])],-1)),Al=hn(()=>N("div",null,[N("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[N("span",{class:"material-icons info-modal-discord"},"discord"),D(" The Modding Tree ")])],-1)),Rl=hn(()=>N("br",null,null,-1));var Fl=J({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:r,author:a,discordName:u,discordLink:l,versionNumber:c,versionTitle:d}=ye,v=De(n),p=U(!1),b=w(()=>hi(Q.timePlayed)),g=w(()=>fe(K(()=>f(re,null,[vs.map(lt)]))));t({open(){p.value=!0}});function C(){var _;(_=s(v.changelog))==null||_.open()}return(_,x)=>(M(),ne(Ut,{modelValue:p.value,"onUpdate:modelValue":x[0]||(x[0]=E=>p.value=E)},{header:Z(()=>[N("div",Nl,[s(r)?(M(),A("img",{key:0,class:"info-modal-logo",src:s(r),alt:s(i)},null,8,Cl)):G("",!0),N("div",kl,[N("h2",null,pe(s(i)),1),N("h4",null,[D(" v"+pe(s(c)),1),s(d)?(M(),A("span",Ml,": "+pe(s(d)),1)):G("",!0)])])])]),body:Z(({shown:E})=>[E?(M(),A("div",Sl,[s(a)?(M(),A("div",Il,"By "+pe(s(a)),1)):G("",!0),xl,$l,N("div",{class:"link",onClick:C},"Changelog"),El,N("div",null,[s(l)?(M(),A("a",{key:0,href:s(l),class:"info-modal-discord-link",target:"_blank"},[Dl,D(" "+pe(s(u)),1)],8,Pl)):G("",!0)]),Tl,Al,Rl,N("div",null,"Time Played: "+pe(s(b)),1),(M(),ne(Qe(s(g))))])):G("",!0)]),_:1},8,["modelValue"]))}});var Ol=ve(Fl,[["__scopeId","data-v-4f97aa40"]]);const ql={class:"field"},Vl={key:0,class:"field-title"},Hi=J({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var u;const n=e,i=En(Qt(n,"title"),"span"),r=U((u=n.options.find(l=>l.value===n.modelValue))!=null?u:null);mt(Qt(n,"modelValue"),l=>{var c;$e(r)!==l&&(r.value=(c=n.options.find(d=>d.value===l))!=null?c:null)});function a(l){t("update:modelValue",l.value)}return(l,c)=>(M(),A("div",ql,[s(i)?(M(),A("span",Vl,[(M(),ne(Qe(s(i))))])):G("",!0),f(s(oa),{options:e.options,modelValue:r.value,"onUpdate:modelValue":[c[0]||(c[0]=d=>r.value=d),a],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const Bl={class:"field"},Ll=J({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=w(()=>{var a;return fe((a=s(n.title))!=null?a:"","span")}),r=w({get(){return!!n.modelValue},set(a){t("update:modelValue",a)}});return(a,u)=>(M(),A("label",Bl,[Oi(N("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":u[0]||(u[0]=l=>Fe(r)?r.value=l:null)},null,512),[[na,s(r)]]),(M(),ne(Qe(s(i))))]))}});var Bt=ve(Ll,[["__scopeId","data-v-11046116"]]);const jl=["onClick"],zl=J({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=U(!1),i=U(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,zt(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(a,u)=>(M(),A("button",{onClick:In(r,["stop"]),class:_e(["feedback",{activated:n.value,left:e.left}])},[Tt(a.$slots,"default",{},void 0,!0)],10,jl))}});var Ar=ve(zl,[["__scopeId","data-v-01a1b95c"]]);const Gl={class:"header"},Ul=N("h2",null,"Settings",-1),Wl={class:"option-tabs"},Hl={key:0},Zl={key:1};var Xl=J({__name:"Options",setup(e,{expose:t}){const n=U(!1),i=U("behaviour");function r(ue){return ue==i.value}function a(ue){i.value=ue}t({isTab:r,setTab:a,save:gt,open(){n.value=!0}});const u=Object.keys(Nt).map(ue=>({label:at(ue),value:ue})),l=w(()=>fe(K(()=>f(re,null,[Mr.map(lt)])))),{showTPS:c,theme:d,unthrottled:v,alignUnits:p}=De(de),{autosave:b,offlineProd:g}=De(Q),C=w({get(){return Q.devSpeed===0},set(ue){Q.devSpeed=ue?0:null}}),_=K(()=>f("span",{class:"option-title"},[D("Unthrottled"),f("desc",null,[D("Allow the game to run as fast as possible. Not battery friendly.")])])),x=K(()=>f("span",{class:"option-title"},[D("Offline Production"),f(Re,{display:"Save-specific",direction:H.Right},{default:()=>[D("*")]}),f("desc",null,[D("Simulate production that occurs while the game is closed.")])])),E=K(()=>f("span",{class:"option-title"},[D("Autosave"),f(Re,{display:"Save-specific",direction:H.Right},{default:()=>[D("*")]}),f("desc",null,[D("Automatically save the game every second or when the game is closed.")])])),S=K(()=>f("span",{class:"option-title"},[D("Pause game"),f(Re,{display:"Save-specific",direction:H.Right},{default:()=>[D("*")]}),f("desc",null,[D("Stop everything from moving.")])])),T=K(()=>f("span",{class:"option-title"},[D("Theme"),f("desc",null,[D("How the game looks.")])])),B=K(()=>f("span",{class:"option-title"},[D("Show TPS"),f("desc",null,[D("Show TPS meter at the bottom-left corner of the page.")])])),le=K(()=>f("span",{class:"option-title"},[D("Align modifier units"),f("desc",null,[D("Align numbers to the beginning of the unit in modifier view.")])]));return(ue,te)=>(M(),ne(Ut,{modelValue:n.value,"onUpdate:modelValue":te[10]||(te[10]=X=>n.value=X)},{header:Z(()=>[N("div",Gl,[Ul,N("div",Wl,[N("button",{class:_e({selected:r("behaviour")}),onClick:te[0]||(te[0]=X=>a("behaviour"))},"Behaviour",2),N("button",{class:_e({selected:r("appearance")}),onClick:te[1]||(te[1]=X=>a("appearance"))},"Appearance",2)])])]),body:Z(()=>[r("behaviour")?(M(),A("div",Hl,[f(Bt,{title:s(_),modelValue:s(v),"onUpdate:modelValue":te[2]||(te[2]=X=>Fe(v)?v.value=X:null)},null,8,["title","modelValue"]),s(ye).enablePausing?(M(),ne(Bt,{key:0,title:s(S),modelValue:s(C),"onUpdate:modelValue":te[3]||(te[3]=X=>Fe(C)?C.value=X:null)},null,8,["title","modelValue"])):G("",!0),f(Bt,{title:s(x),modelValue:s(g),"onUpdate:modelValue":te[4]||(te[4]=X=>Fe(g)?g.value=X:null)},null,8,["title","modelValue"]),f(Bt,{title:s(E),modelValue:s(b),"onUpdate:modelValue":te[5]||(te[5]=X=>Fe(b)?b.value=X:null)},null,8,["title","modelValue"]),s(b)?G("",!0):(M(),ne(Ar,{key:1,class:"button save-button",onClick:te[6]||(te[6]=X=>s(gt)())},{default:Z(()=>[D("Manually save")]),_:1}))])):G("",!0),r("appearance")?(M(),A("div",Zl,[f(Hi,{title:s(T),options:s(u),modelValue:s(d),"onUpdate:modelValue":te[7]||(te[7]=X=>Fe(d)?d.value=X:null)},null,8,["title","options","modelValue"]),(M(),ne(Qe(s(l)))),f(Bt,{title:s(B),modelValue:s(c),"onUpdate:modelValue":te[8]||(te[8]=X=>Fe(c)?c.value=X:null)},null,8,["title","modelValue"]),f(Bt,{title:s(le),modelValue:s(p),"onUpdate:modelValue":te[9]||(te[9]=X=>Fe(p)?p.value=X:null)},null,8,["title","modelValue"])])):G("",!0)]),_:1},8,["modelValue"]))}});const Yl=["onSubmit"],Jl={class:"field"},Kl={key:0,class:"field-title"},Ql=["placeholder"],eu=J({__name:"Text",props:{title:null,modelValue:null,textArea:{type:Boolean},placeholder:null,maxHeight:null,submitOnBlur:{type:Boolean}},emits:["update:modelValue","submit","cancel"],setup(e,{emit:t}){const n=e,i=En(Qt(n,"title"),"span"),r=vt(null);mi(()=>{var c;(c=r.value)==null||c.focus()});const a=w({get(){var c;return(c=s(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function u(){t("submit")}function l(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,d)=>(M(),A("form",{onSubmit:In(u,["prevent"])},[N("div",Jl,[s(i)?(M(),A("span",Kl,[(M(),ne(Qe(s(i))))])):G("",!0),e.textArea?(M(),ne(s(ua),{key:1,modelValue:s(a),"onUpdate:modelValue":d[0]||(d[0]=v=>Fe(a)?a.value=v:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:l,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):Oi((M(),A("input",{key:2,type:"text","onUpdate:modelValue":d[1]||(d[1]=v=>Fe(a)?a.value=v:null),placeholder:e.placeholder,class:_e({fullWidth:!e.title}),onBlur:l,ref_key:"field",ref:r},null,42,Ql)),[[ia,s(a)]])])],40,Yl))}});var Rr=ve(eu,[["__scopeId","data-v-90bd4994"]]);const tu={key:0},nu=["onClick","disabled"],iu={key:0},ru=["onClick"],au=J({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=De(e),r=U(!1);mt(r,l=>{t("confirmingChanged",l)});function a(){if(s(i.skipConfirm)){t("click");return}r.value&&t("click"),r.value=!r.value}function u(){r.value=!1}return(l,c)=>(M(),A("span",{class:_e(["container",{confirming:r.value}])},[r.value?(M(),A("span",tu,"Are you sure?")):G("",!0),N("button",{onClick:In(a,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(M(),A("span",iu,"Yes")):Tt(l.$slots,"default",{key:1},void 0,!0)],8,nu),r.value?(M(),A("button",{key:1,class:"button",onClick:In(u,["stop"])},"No",8,ru)):G("",!0)],2))}});var su=ve(au,[["__scopeId","data-v-2f8ef34c"]]);const Wt=e=>(gn("data-v-32313015"),e=e(),mn(),e),ou=Wt(()=>N("div",{class:"handle material-icons"},"drag_handle",-1)),lu={key:0,class:"actions"},uu=Wt(()=>N("span",{class:"material-icons"},"content_paste",-1)),cu=Wt(()=>N("span",{class:"material-icons"},"content_copy",-1)),du=Wt(()=>N("span",{class:"material-icons"},"edit",-1)),pu=Wt(()=>N("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),fu={key:1,class:"actions"},gu=Wt(()=>N("span",{class:"material-icons"},"check",-1)),mu=Wt(()=>N("span",{class:"material-icons"},"close",-1)),vu={key:2,class:"details"},hu={class:"save-version"},bu=Wt(()=>N("br",null,null,-1)),yu={key:0},wu={key:3,class:"details"},_u={key:4,class:"details error"},Nu=Wt(()=>N("br",null,null,-1)),Cu=J({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=De(n),r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),a=U(!1),u=U(!1),l=U("");mt(a,()=>{var p;return l.value=(p=i.value.name)!=null?p:""});const c=w(()=>i.value!=null&&i.value.id===Q.id),d=w(()=>{var p;return c.value?Q.time:(p=i.value!=null&&i.value.time)!=null?p:0});function v(){t("editName",l.value),a.value=!1}return(p,b)=>(M(),A("div",{class:_e(["save",{active:s(c)}])},[ou,a.value?(M(),A("div",fu,[N("button",{onClick:v,class:"button"},[f(Re,{display:"Save",direction:s(H).Left,class:"info"},{default:Z(()=>[gu]),_:1},8,["direction"])]),N("button",{onClick:b[5]||(b[5]=g=>a.value=!a.value),class:"button"},[f(Re,{display:"Cancel",direction:s(H).Left,class:"info"},{default:Z(()=>[mu]),_:1},8,["direction"])])])):(M(),A("div",lu,[s(i).error==null&&!u.value?(M(),ne(Ar,{key:0,onClick:b[0]||(b[0]=g=>t("export")),class:"button",left:""},{default:Z(()=>[f(Re,{display:"Export",direction:s(H).Left,class:"info"},{default:Z(()=>[uu]),_:1},8,["direction"])]),_:1})):G("",!0),s(i).error==null&&!u.value?(M(),A("button",{key:1,onClick:b[1]||(b[1]=g=>t("duplicate")),class:"button"},[f(Re,{display:"Duplicate",direction:s(H).Left,class:"info"},{default:Z(()=>[cu]),_:1},8,["direction"])])):G("",!0),s(i).error==null&&!u.value?(M(),A("button",{key:2,onClick:b[2]||(b[2]=g=>a.value=!a.value),class:"button"},[f(Re,{display:"Edit Name",direction:s(H).Left,class:"info"},{default:Z(()=>[du]),_:1},8,["direction"])])):G("",!0),f(su,{disabled:s(c),onClick:b[3]||(b[3]=g=>t("delete")),onConfirmingChanged:b[4]||(b[4]=g=>u.value=g)},{default:Z(()=>[f(Re,{display:"Delete",direction:s(H).Left,class:"info"},{default:Z(()=>[pu]),_:1},8,["direction"])]),_:1},8,["disabled"])])),s(i).error==null&&!a.value?(M(),A("div",vu,[N("button",{class:"button open",onClick:b[6]||(b[6]=g=>t("open"))},[N("h3",null,pe(s(i).name),1)]),N("span",hu,"v"+pe(s(i).modVersion),1),bu,s(d)?(M(),A("div",yu,"Last played "+pe(s(r).format(s(d))),1)):G("",!0)])):s(i).error==null&&a.value?(M(),A("div",wu,[f(Rr,{modelValue:l.value,"onUpdate:modelValue":b[7]||(b[7]=g=>l.value=g),class:"editname",onSubmit:v},null,8,["modelValue"])])):(M(),A("div",_u,[D(" Error: Failed to load save with id "+pe(s(i).id),1),Nu,D(pe(s(i).error),1)]))],2))}});var ku=ve(Cu,[["__scopeId","data-v-32313015"]]);const Zi=e=>(gn("data-v-2a4275be"),e=e(),mn(),e),Mu=Zi(()=>N("h2",null,"Saves Manager",-1)),Su={class:"modal-footer"},Iu={class:"field"},xu=Zi(()=>N("span",{class:"field-title"},"Create Save",-1)),$u={class:"field-buttons"},Eu={class:"footer"},Pu=Zi(()=>N("div",{style:{"flex-grow":"1"}},null,-1)),Du=J({__name:"SavesManager",setup(e,{expose:t}){const n=U(!1),i=U(null);t({open(){n.value=!0}});const r=U(!1),a=U(""),u=U(null);mt(a,S=>{S?zt(()=>{try{if(S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Yt.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S),r.value=!0;return}const T=JSON.parse(S);if(typeof T!="object"){r.value=!0;return}const B=li();T.id=B,gt(T),a.value="",r.value=!1,de.saves.push(B)}catch{r.value=!0}}):r.value=!1});let l={},c=U(Object.keys(l).reduce((S,T)=>(S.push({label:T.split("/").slice(-1)[0].slice(0,-4),value:l[T]}),S),[]));const d=qi({});function v(S){if(d[S]==null){let T=localStorage.getItem(S);if(T==null)d[S]={error:"Save doesn't exist in localStorage",id:S};else if(T==="dW5kZWZpbmVk")d[S]={error:"Save is undefined",id:S};else try{if(T[0]!=="{")if(T[0]==="e")T=decodeURIComponent(escape(atob(T)));else if(T[0]==="\u1BE1")T=Yt.decompressFromUTF16(T);else return console.warn("Unable to determine preset encoding",T),r.value=!0,d[S]={error:"Unable to determine preset encoding",id:S},d[S];d[S]={...JSON.parse(T),id:S}}catch(B){d[S]={error:B,id:S},console.warn(`SavesManager: Failed to load info about save with id ${S}: ${B} -${D}`)}}return d[S]}mt(n,S=>{S&&Object.keys(d).forEach(D=>delete d[D])});const p=w(()=>de.saves.reduce((S,D)=>(S[D]=v(D),S),{}));function b(S){let D;switch(Q.id===S?D=Cr(Q):D=JSON.stringify(p.value[S]),ye.exportEncoding){default:console.warn(`Unknown save encoding: ${ye.exportEncoding}. Defaulting to lz`);case"lz":D=Yt.compressToUTF16(D);break;case"base64":D=btoa(unescape(encodeURIComponent(D)));break;case"plain":break}const B=document.createElement("textarea");B.value=D,document.body.appendChild(B),B.select(),B.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(B)}function g(S){Q.id===S&>();const D={...p.value[S],id:oi()};gt(D),de.saves.push(D.id)}function C(S){de.saves=de.saves.filter(D=>D!==S),localStorage.removeItem(S),d[S]=void 0}function _(S){p.value[Q.id].time=Q.time,gt(),d[Q.id]=void 0,un(p.value[S]),d[S]=void 0}function x(S){if(u.value=S,zt(()=>{u.value=null}),S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Yt.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S);return}const D=JSON.parse(S);D.id=oi(),gt(D),de.saves.push(D.id),_(D.id)}function E(S,D){const B=p.value[S];B!=null&&(B.name=D,Q.id===S?(Q.name=D,gt()):(gt(B),d[S]=void 0))}return(S,D)=>(M(),ne(Ut,{modelValue:n.value,"onUpdate:modelValue":D[4]||(D[4]=B=>n.value=B),ref_key:"modal",ref:i},{header:Z(()=>[Mu]),body:Z(({shown:B})=>[B?(M(),ne(s(la),{key:0,list:s(de).saves,handle:".handle",itemKey:le=>le},{item:Z(({element:le})=>[f(ku,{save:s(p)[le],onOpen:ue=>_(le),onExport:ue=>b(le),onEditName:ue=>E(le,ue),onDuplicate:ue=>g(le),onDelete:ue=>C(le)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):G("",!0)]),footer:Z(()=>[N("div",Su,[f(Rr,{modelValue:a.value,"onUpdate:modelValue":D[0]||(D[0]=B=>a.value=B),title:"Import Save",placeholder:"Paste your save here!",class:_e({importingFailed:r.value})},null,8,["modelValue","class"]),N("div",Iu,[xu,N("div",$u,[N("button",{class:"button",onClick:D[1]||(D[1]=B=>_(s(Sn)().id))},"New Game"),Object.keys(s(c)).length>0?(M(),ne(Hi,{key:0,options:s(c),modelValue:u.value,"onUpdate:modelValue":D[2]||(D[2]=B=>x(B)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):G("",!0)])]),N("div",Eu,[Pu,N("button",{class:"button modal-default-button",onClick:D[3]||(D[3]=B=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Fr=ve(Tu,[["__scopeId","data-v-2a4275be"]]);const yt=e=>(gn("data-v-318a1c31"),e=e(),mn(),e),Du=["src","alt"],Au={key:1,class:"title"},Ru=yt(()=>N("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Fu={class:"discord"},Ou={class:"discord-links"},qu={key:0},Vu=["href"],Bu=yt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Lu=yt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),ju={href:"https://forums.moddingtree.com/",target:"_blank"},zu=yt(()=>N("span",{class:"material-icons"},"forum",-1)),Gu=yt(()=>N("span",{class:"material-icons"},"info",-1)),Uu=yt(()=>N("span",{class:"material-icons"},"library_books",-1)),Wu=yt(()=>N("span",{class:"material-icons"},"settings",-1)),Hu=yt(()=>N("span",{class:"material-icons"},"library_books",-1)),Zu=yt(()=>N("span",{class:"material-icons"},"settings",-1)),Xu=yt(()=>N("span",{class:"material-icons"},"info",-1)),Yu={href:"https://forums.moddingtree.com/",target:"_blank"},Ju=yt(()=>N("span",{class:"material-icons"},"forum",-1)),Ku={class:"discord"},Qu={class:"discord-links"},ec={key:0},tc=["href"],nc=yt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),ic=yt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),rc=J({__name:"Nav",setup(e){const t=U(null),n=U(null),i=U(null),r=U(null),{useHeader:a,banner:u,title:l,discordName:c,discordLink:d,versionNumber:v}=ye;function p(){window.open(d,"mywindow")}return(b,g)=>(M(),A(re,null,[s(a)?(M(),A("div",Gt({key:0,class:"nav"},b.$attrs),[s(u)?(M(),A("img",{key:0,src:s(u),class:"banner",alt:s(l)},null,8,Du)):(M(),A("div",Au,pe(s(l)),1)),N("div",{onClick:g[0]||(g[0]=C=>{var _;return(_=r.value)==null?void 0:_.open()}),class:"version-container"},[f(Re,{display:"Changelog",direction:s(H).Down,class:"version"},{default:Z(()=>[N("span",null,"v"+pe(s(v)),1)]),_:1},8,["direction"])]),Ru,N("div",Fu,[N("span",{onClick:p,class:"material-icons"},"discord"),N("ul",Ou,[s(d)?(M(),A("li",qu,[N("a",{href:s(d),target:"_blank"},pe(s(c)),9,Vu)])):G("",!0),Bu,Lu])]),N("div",null,[N("a",ju,[f(Re,{display:"Forums",direction:s(H).Down,yoffset:"5px"},{default:Z(()=>[zu]),_:1},8,["direction"])])]),N("div",{onClick:g[1]||(g[1]=C=>{var _;return(_=t.value)==null?void 0:_.open()})},[f(Re,{display:"Info",direction:s(H).Down,class:"info"},{default:Z(()=>[Gu]),_:1},8,["direction"])]),N("div",{onClick:g[2]||(g[2]=C=>{var _;return(_=n.value)==null?void 0:_.open()})},[f(Re,{display:"Saves",direction:s(H).Down,xoffset:"-20px"},{default:Z(()=>[Uu]),_:1},8,["direction"])]),N("div",{onClick:g[3]||(g[3]=C=>{var _;return(_=i.value)==null?void 0:_.open()})},[f(Re,{display:"Settings",direction:s(H).Down,xoffset:"-66px"},{default:Z(()=>[Wu]),_:1},8,["direction"])])],16)):(M(),A("div",Gt({key:1,class:"overlay-nav"},b.$attrs),[N("div",{onClick:g[4]||(g[4]=C=>{var _;return(_=r.value)==null?void 0:_.open()}),class:"version-container"},[f(Re,{display:"Changelog",direction:s(H).Right,xoffset:"25%",class:"version"},{default:Z(()=>[N("span",null,"v"+pe(s(v)),1)]),_:1},8,["direction"])]),N("div",{onClick:g[5]||(g[5]=C=>{var _;return(_=n.value)==null?void 0:_.open()})},[f(Re,{display:"Saves",direction:s(H).Right},{default:Z(()=>[Hu]),_:1},8,["direction"])]),N("div",{onClick:g[6]||(g[6]=C=>{var _;return(_=i.value)==null?void 0:_.open()})},[f(Re,{display:"Settings",direction:s(H).Right},{default:Z(()=>[Zu]),_:1},8,["direction"])]),N("div",{onClick:g[7]||(g[7]=C=>{var _;return(_=t.value)==null?void 0:_.open()})},[f(Re,{display:"Info",direction:s(H).Right},{default:Z(()=>[Xu]),_:1},8,["direction"])]),N("div",null,[N("a",Yu,[f(Re,{display:"Forums",direction:s(H).Right,xoffset:"7px"},{default:Z(()=>[Ju]),_:1},8,["direction"])])]),N("div",Ku,[N("span",{onClick:p,class:"material-icons"},"discord"),N("ul",Qu,[s(d)?(M(),A("li",ec,[N("a",{href:s(d),target:"_blank"},pe(s(c)),9,tc)])):G("",!0),nc,ic])])],16)),f(Ol,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),f(Fr,{ref_key:"savesManager",ref:n},null,512),f(Xl,{ref_key:"options",ref:i},null,512),f(bl,{ref_key:"changelog",ref:r},null,512)],64))}});var Or=ve(rc,[["__scopeId","data-v-318a1c31"]]);const ac={class:"inner-tab"},sc=J({__name:"Game",setup(e){const t=Qt(Q,"tabs"),n=w(()=>Object.keys(me)),i=ye.useHeader;function r(a){const{display:u,minimized:l,name:c,color:d,minimizable:v,nodes:p,minimizedDisplay:b}=a;return{display:u,minimized:l,name:c,color:d,minimizable:v,nodes:p,minimizedDisplay:b}}return(a,u)=>(M(),A("div",{class:_e(["tabs-container",{useHeader:s(i)}])},[(M(!0),A(re,null,xn(s(t),(l,c)=>{var d,v;return M(),A("div",{key:c,class:_e(["tab",s((d=s(me)[l])==null?void 0:d.classes)]),style:Le(s((v=s(me)[l])==null?void 0:v.style))},[c===0&&!s(i)?(M(),ne(Or,{key:0})):G("",!0),N("div",ac,[s(n).includes(l)?(M(),ne(gl,Gt({key:0},r(s(me)[l]),{index:c,onSetMinimized:p=>s(me)[l].minimized.value=p}),null,16,["index","onSetMinimized"])):(M(),ne(Qe(l),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var oc=ve(sc,[["__scopeId","data-v-dcd207b4"]]);const lc=J({__name:"Sticky",setup(e){const t=U("0"),n=new ResizeObserver(r),i=vt(null);function r(){let a=i.value;if(a==null)return;let u=0;for(;a.previousSibling;){const l=a.previousSibling;l.dataset&&"vSticky"in l.dataset&&(u+=l.offsetHeight),a=l}t.value=u+"px"}return zt(r),document.fonts.ready.then(r),gi(()=>{var u;const a=(u=i.value)==null?void 0:u.parentElement;a&&n.observe(a)}),(a,u)=>(M(),A("div",{class:"sticky",style:Le({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[Dt(a.$slots,"default",{},void 0,!0)],4))}});var pi=ve(lc,[["__scopeId","data-v-cccac690"]]);const uc=["x1","y1","x2","y2"],cc=J({__name:"BoardLink",props:{link:null},setup(e){const n=Te(e),i=w(()=>{const a=n.link.value.startNode.position;return n.link.value.offsetStart&&(a.x+=s(n.link.value.offsetStart).x,a.y+=s(n.link.value.offsetStart).y),a}),r=w(()=>{const a=n.link.value.endNode.position;return n.link.value.offsetEnd&&(a.x+=s(n.link.value.offsetEnd).x,a.y+=s(n.link.value.offsetEnd).y),a});return(a,u)=>(M(),A("line",Gt({class:"link"},e.link,{class:{pulsing:e.link.pulsing},x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,uc))}});var dc=ve(cc,[["__scopeId","data-v-57c4970a"]]);const pc={key:0},fc=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],gc=["fill","stroke-width","stroke"],mc=["fill"],vc=J({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const i=Te(e),r=w(()=>be(i.nodeType.value.size,s(i.node))),a=w(()=>{var v;return(v=be(i.nodeType.value.outlineColor,s(i.node)))!=null?v:Nt[de.theme].variables["--outline"]}),u=w(()=>{var v;return(v=be(i.nodeType.value.titleColor,s(i.node)))!=null?v:Nt[de.theme].variables["--foreground"]}),l=w(()=>be(i.nodeType.value.actionDistance,s(i.node)));function c(v,p){t("clickAction",p.id),v.preventDefault(),v.stopPropagation()}function d(v,p){var b;((b=s(i.selectedAction))==null?void 0:b.id)===p.id&&(v.preventDefault(),v.stopPropagation())}return(v,p)=>(M(),ne(zn,{name:"actions",appear:""},{default:Z(()=>[e.isSelected&&e.actions?(M(),A("g",pc,[(M(!0),A(re,null,xn(e.actions,(b,g)=>{var C,_;return M(),A("g",{key:b.id,class:_e(["action",{selected:((C=e.selectedAction)==null?void 0:C.id)===b.id}]),transform:`translate( +${T}`)}}return d[S]}mt(n,S=>{S&&Object.keys(d).forEach(T=>delete d[T])});const p=w(()=>de.saves.reduce((S,T)=>(S[T]=v(T),S),{}));function b(S){let T;switch(Q.id===S?T=Cr(Q):T=JSON.stringify(p.value[S]),ye.exportEncoding){default:console.warn(`Unknown save encoding: ${ye.exportEncoding}. Defaulting to lz`);case"lz":T=Yt.compressToUTF16(T);break;case"base64":T=btoa(unescape(encodeURIComponent(T)));break;case"plain":break}const B=document.createElement("textarea");B.value=T,document.body.appendChild(B),B.select(),B.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(B)}function g(S){Q.id===S&>();const T={...p.value[S],id:li()};gt(T),de.saves.push(T.id)}function C(S){de.saves=de.saves.filter(T=>T!==S),localStorage.removeItem(S),d[S]=void 0}function _(S){p.value[Q.id].time=Q.time,gt(),d[Q.id]=void 0,cn(p.value[S]),d[S]=void 0}function x(S){if(u.value=S,zt(()=>{u.value=null}),S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Yt.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S);return}const T=JSON.parse(S);T.id=li(),gt(T),de.saves.push(T.id),_(T.id)}function E(S,T){const B=p.value[S];B!=null&&(B.name=T,Q.id===S?(Q.name=T,gt()):(gt(B),d[S]=void 0))}return(S,T)=>(M(),ne(Ut,{modelValue:n.value,"onUpdate:modelValue":T[4]||(T[4]=B=>n.value=B),ref_key:"modal",ref:i},{header:Z(()=>[Mu]),body:Z(({shown:B})=>[B?(M(),ne(s(la),{key:0,list:s(de).saves,handle:".handle",itemKey:le=>le},{item:Z(({element:le})=>[f(ku,{save:s(p)[le],onOpen:ue=>_(le),onExport:ue=>b(le),onEditName:ue=>E(le,ue),onDuplicate:ue=>g(le),onDelete:ue=>C(le)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):G("",!0)]),footer:Z(()=>[N("div",Su,[f(Rr,{modelValue:a.value,"onUpdate:modelValue":T[0]||(T[0]=B=>a.value=B),title:"Import Save",placeholder:"Paste your save here!",class:_e({importingFailed:r.value})},null,8,["modelValue","class"]),N("div",Iu,[xu,N("div",$u,[N("button",{class:"button",onClick:T[1]||(T[1]=B=>_(s(Sn)().id))},"New Game"),Object.keys(s(c)).length>0?(M(),ne(Hi,{key:0,options:s(c),modelValue:u.value,"onUpdate:modelValue":T[2]||(T[2]=B=>x(B)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):G("",!0)])]),N("div",Eu,[Pu,N("button",{class:"button modal-default-button",onClick:T[3]||(T[3]=B=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Fr=ve(Du,[["__scopeId","data-v-2a4275be"]]);const yt=e=>(gn("data-v-318a1c31"),e=e(),mn(),e),Tu=["src","alt"],Au={key:1,class:"title"},Ru=yt(()=>N("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Fu={class:"discord"},Ou={class:"discord-links"},qu={key:0},Vu=["href"],Bu=yt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Lu=yt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),ju={href:"https://forums.moddingtree.com/",target:"_blank"},zu=yt(()=>N("span",{class:"material-icons"},"forum",-1)),Gu=yt(()=>N("span",{class:"material-icons"},"info",-1)),Uu=yt(()=>N("span",{class:"material-icons"},"library_books",-1)),Wu=yt(()=>N("span",{class:"material-icons"},"settings",-1)),Hu=yt(()=>N("span",{class:"material-icons"},"library_books",-1)),Zu=yt(()=>N("span",{class:"material-icons"},"settings",-1)),Xu=yt(()=>N("span",{class:"material-icons"},"info",-1)),Yu={href:"https://forums.moddingtree.com/",target:"_blank"},Ju=yt(()=>N("span",{class:"material-icons"},"forum",-1)),Ku={class:"discord"},Qu={class:"discord-links"},ec={key:0},tc=["href"],nc=yt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),ic=yt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),rc=J({__name:"Nav",setup(e){const t=U(null),n=U(null),i=U(null),r=U(null),{useHeader:a,banner:u,title:l,discordName:c,discordLink:d,versionNumber:v}=ye;function p(){window.open(d,"mywindow")}return(b,g)=>(M(),A(re,null,[s(a)?(M(),A("div",Gt({key:0,class:"nav"},b.$attrs),[s(u)?(M(),A("img",{key:0,src:s(u),class:"banner",alt:s(l)},null,8,Tu)):(M(),A("div",Au,pe(s(l)),1)),N("div",{onClick:g[0]||(g[0]=C=>{var _;return(_=r.value)==null?void 0:_.open()}),class:"version-container"},[f(Re,{display:"Changelog",direction:s(H).Down,class:"version"},{default:Z(()=>[N("span",null,"v"+pe(s(v)),1)]),_:1},8,["direction"])]),Ru,N("div",Fu,[N("span",{onClick:p,class:"material-icons"},"discord"),N("ul",Ou,[s(d)?(M(),A("li",qu,[N("a",{href:s(d),target:"_blank"},pe(s(c)),9,Vu)])):G("",!0),Bu,Lu])]),N("div",null,[N("a",ju,[f(Re,{display:"Forums",direction:s(H).Down,yoffset:"5px"},{default:Z(()=>[zu]),_:1},8,["direction"])])]),N("div",{onClick:g[1]||(g[1]=C=>{var _;return(_=t.value)==null?void 0:_.open()})},[f(Re,{display:"Info",direction:s(H).Down,class:"info"},{default:Z(()=>[Gu]),_:1},8,["direction"])]),N("div",{onClick:g[2]||(g[2]=C=>{var _;return(_=n.value)==null?void 0:_.open()})},[f(Re,{display:"Saves",direction:s(H).Down,xoffset:"-20px"},{default:Z(()=>[Uu]),_:1},8,["direction"])]),N("div",{onClick:g[3]||(g[3]=C=>{var _;return(_=i.value)==null?void 0:_.open()})},[f(Re,{display:"Settings",direction:s(H).Down,xoffset:"-66px"},{default:Z(()=>[Wu]),_:1},8,["direction"])])],16)):(M(),A("div",Gt({key:1,class:"overlay-nav"},b.$attrs),[N("div",{onClick:g[4]||(g[4]=C=>{var _;return(_=r.value)==null?void 0:_.open()}),class:"version-container"},[f(Re,{display:"Changelog",direction:s(H).Right,xoffset:"25%",class:"version"},{default:Z(()=>[N("span",null,"v"+pe(s(v)),1)]),_:1},8,["direction"])]),N("div",{onClick:g[5]||(g[5]=C=>{var _;return(_=n.value)==null?void 0:_.open()})},[f(Re,{display:"Saves",direction:s(H).Right},{default:Z(()=>[Hu]),_:1},8,["direction"])]),N("div",{onClick:g[6]||(g[6]=C=>{var _;return(_=i.value)==null?void 0:_.open()})},[f(Re,{display:"Settings",direction:s(H).Right},{default:Z(()=>[Zu]),_:1},8,["direction"])]),N("div",{onClick:g[7]||(g[7]=C=>{var _;return(_=t.value)==null?void 0:_.open()})},[f(Re,{display:"Info",direction:s(H).Right},{default:Z(()=>[Xu]),_:1},8,["direction"])]),N("div",null,[N("a",Yu,[f(Re,{display:"Forums",direction:s(H).Right,xoffset:"7px"},{default:Z(()=>[Ju]),_:1},8,["direction"])])]),N("div",Ku,[N("span",{onClick:p,class:"material-icons"},"discord"),N("ul",Qu,[s(d)?(M(),A("li",ec,[N("a",{href:s(d),target:"_blank"},pe(s(c)),9,tc)])):G("",!0),nc,ic])])],16)),f(Ol,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),f(Fr,{ref_key:"savesManager",ref:n},null,512),f(Xl,{ref_key:"options",ref:i},null,512),f(bl,{ref_key:"changelog",ref:r},null,512)],64))}});var Or=ve(rc,[["__scopeId","data-v-318a1c31"]]);const ac={class:"inner-tab"},sc=J({__name:"Game",setup(e){const t=Qt(Q,"tabs"),n=w(()=>Object.keys(me)),i=ye.useHeader;function r(a){const{display:u,minimized:l,name:c,color:d,minimizable:v,nodes:p,minimizedDisplay:b}=a;return{display:u,minimized:l,name:c,color:d,minimizable:v,nodes:p,minimizedDisplay:b}}return(a,u)=>(M(),A("div",{class:_e(["tabs-container",{useHeader:s(i)}])},[(M(!0),A(re,null,xn(s(t),(l,c)=>{var d,v;return M(),A("div",{key:c,class:_e(["tab",s((d=s(me)[l])==null?void 0:d.classes)]),style:Le(s((v=s(me)[l])==null?void 0:v.style))},[c===0&&!s(i)?(M(),ne(Or,{key:0})):G("",!0),N("div",ac,[s(n).includes(l)?(M(),ne(gl,Gt({key:0},r(s(me)[l]),{index:c,onSetMinimized:p=>s(me)[l].minimized.value=p}),null,16,["index","onSetMinimized"])):(M(),ne(Qe(l),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var oc=ve(sc,[["__scopeId","data-v-dcd207b4"]]);const lc=J({__name:"Sticky",setup(e){const t=U("0"),n=new ResizeObserver(r),i=vt(null);function r(){let a=i.value;if(a==null)return;let u=0;for(;a.previousSibling;){const l=a.previousSibling;l.dataset&&"vSticky"in l.dataset&&(u+=l.offsetHeight),a=l}t.value=u+"px"}return zt(r),document.fonts.ready.then(r),mi(()=>{var u;const a=(u=i.value)==null?void 0:u.parentElement;a&&n.observe(a)}),(a,u)=>(M(),A("div",{class:"sticky",style:Le({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[Tt(a.$slots,"default",{},void 0,!0)],4))}});var fi=ve(lc,[["__scopeId","data-v-cccac690"]]);const uc=["x1","y1","x2","y2"],cc=J({__name:"BoardLink",props:{link:null},setup(e){const n=De(e),i=w(()=>{const a=n.link.value.startNode.position;return n.link.value.offsetStart&&(a.x+=s(n.link.value.offsetStart).x,a.y+=s(n.link.value.offsetStart).y),a}),r=w(()=>{const a=n.link.value.endNode.position;return n.link.value.offsetEnd&&(a.x+=s(n.link.value.offsetEnd).x,a.y+=s(n.link.value.offsetEnd).y),a});return(a,u)=>(M(),A("line",Gt({class:"link"},e.link,{class:{pulsing:e.link.pulsing},x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,uc))}});var dc=ve(cc,[["__scopeId","data-v-57c4970a"]]);const pc={key:0},fc=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],gc=["fill","stroke-width","stroke"],mc=["fill"],vc=J({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const i=De(e),r=w(()=>be(i.nodeType.value.size,s(i.node))),a=w(()=>{var v;return(v=be(i.nodeType.value.outlineColor,s(i.node)))!=null?v:Nt[de.theme].variables["--outline"]}),u=w(()=>{var v;return(v=be(i.nodeType.value.titleColor,s(i.node)))!=null?v:Nt[de.theme].variables["--foreground"]}),l=w(()=>be(i.nodeType.value.actionDistance,s(i.node)));function c(v,p){t("clickAction",p.id),v.preventDefault(),v.stopPropagation()}function d(v,p){var b;((b=s(i.selectedAction))==null?void 0:b.id)===p.id&&(v.preventDefault(),v.stopPropagation())}return(v,p)=>(M(),ne(zn,{name:"actions",appear:""},{default:Z(()=>[e.isSelected&&e.actions?(M(),A("g",pc,[(M(!0),A(re,null,xn(e.actions,(b,g)=>{var C,_;return M(),A("g",{key:b.id,class:_e(["action",{selected:((C=e.selectedAction)==null?void 0:C.id)===b.id}]),transform:`translate( ${(-s(r)-30)*Math.sin(((e.actions.length-1)/2-g)*s(l))}, ${(s(r)+30)*Math.cos(((e.actions.length-1)/2-g)*s(l))} - )`,onMousedown:x=>c(x,b),onTouchstart:x=>c(x,b),onMouseup:x=>d(x,b),onTouchend:In(x=>d(x,b),["stop"])},[N("circle",{fill:s(be)(b.fillColor,e.node),r:"20","stroke-width":((_=e.selectedAction)==null?void 0:_.id)===b.id?4:0,stroke:s(a)},null,8,gc),N("text",{fill:s(u),class:"material-icons"},pe(s(be)(b.icon,e.node)),9,mc)],42,fc)}),128))])):G("",!0)]),_:1}))}});var hc=ve(vc,[["__scopeId","data-v-9efb2a56"]]);const bc=["transform"],yc={key:0},wc=["r","fill","stroke"],_c=["r","fill","stroke"],Nc=["r","fill"],Cc=["r","stroke-dasharray","stroke-dashoffset","stroke"],kc={key:1,transform:"rotate(45, 0, 0)"},Mc=["width","height","transform","fill","stroke"],Sc=["width","height","transform","fill","stroke"],Ic=["width","height","transform","fill"],xc=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],$c=["fill","y"],Ec=["fill"],Pc={key:0},Tc=["fill","y"],Dc=["fill","y"],Ac=J({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},isSelected:{type:Boolean},selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,i=Math.sqrt(2),r=Te(n),a=w(()=>be(r.nodeType.value.draggable,s(r.node)));mt(a,L=>{const ae=s(r.node);s(r.dragging)===ae&&!L&&t("endDragging",ae)});const u=w(()=>{var ae;const L=s(r.node);return(ae=be(r.nodeType.value.actions,L))==null?void 0:ae.filter(De=>We(be(De.visibility,L)))}),l=w(()=>{var ae;const L=s(r.node);if(be(r.nodeType.value.draggable,L)&&((ae=s(r.dragging))==null?void 0:ae.id)===L.id&&s(r.dragged)!=null){const{x:De,y:Xe}=s(r.dragged);return{x:L.position.x+Math.round(De/25)*25,y:L.position.y+Math.round(Xe/25)*25}}return L.position}),c=w(()=>be(r.nodeType.value.shape,s(r.node))),d=w(()=>be(r.nodeType.value.title,s(r.node))),v=w(()=>be(r.nodeType.value.subtitle,s(r.node))),p=w(()=>{var L;return(L=r.isSelected.value?s(r.selectedAction)&&be(s(r.selectedAction).tooltip,s(r.node)):null)!=null?L:be(r.nodeType.value.label,s(r.node))}),b=w(()=>{var L,ae;return be((ae=(L=s(r.selectedAction))==null?void 0:L.confirmationLabel)!=null?ae:{text:"Tap again to confirm"},s(r.node))}),g=w(()=>be(r.nodeType.value.size,s(r.node))),C=w(()=>{var L;return(L=be(r.nodeType.value.progress,s(r.node)))!=null?L:0}),_=w(()=>Nt[de.theme].variables["--background"]),x=w(()=>{var L;return(L=be(r.nodeType.value.outlineColor,s(r.node)))!=null?L:Nt[de.theme].variables["--outline"]}),E=w(()=>{var L;return(L=be(r.nodeType.value.fillColor,s(r.node)))!=null?L:Nt[de.theme].variables["--raised-background"]}),S=w(()=>be(r.nodeType.value.progressColor,s(r.node))),D=w(()=>{var L;return(L=be(r.nodeType.value.titleColor,s(r.node)))!=null?L:Nt[de.theme].variables["--foreground"]}),B=w(()=>be(r.nodeType.value.progressDisplay,s(r.node))),le=w(()=>r.dragging.value!=null&&s(r.hasDragged)&&be(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),ue=w(()=>be(r.nodeType.value.style,s(r.node))),te=w(()=>be(r.nodeType.value.classes,s(r.node)));function X(L){t("mouseDown",L,r.node.value,a.value)}function Se(L){var ae,De,Xe;(ae=r.hasDragged)!=null&&ae.value||(t("endDragging",r.node.value),(Xe=(De=r.nodeType.value).onClick)==null||Xe.call(De,r.node.value),L.stopPropagation())}return(L,ae)=>{var De,Xe,Ht;return M(),A("g",{class:_e(["boardnode",{[e.node.type]:!0,isSelected:e.isSelected,isDraggable:s(a),...s(te)}]),style:Le([{opacity:((De=e.dragging)==null?void 0:De.id)===e.node.id&&e.hasDragged?.5:1},(Xe=s(ue))!=null?Xe:[]]),transform:`translate(${s(l).x},${s(l).y})${e.isSelected?" scale(1.2)":""}`},[f(hc,{actions:(Ht=s(u))!=null?Ht:[],"is-selected":e.isSelected,node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:ae[0]||(ae[0]=ut=>t("clickAction",ut))},null,8,["actions","is-selected","node","node-type","selected-action"]),N("g",{class:"node-container",onMousedown:X,onTouchstartPassive:X,onMouseup:Se,onTouchendPassive:Se},[s(c)===s(je).Circle?(M(),A("g",yc,[s(le)?(M(),A("circle",{key:0,class:"receiver",r:s(g)+8,fill:s(_),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,wc)):G("",!0),N("circle",{class:"body",r:s(g),fill:s(E),stroke:s(x),"stroke-width":4},null,8,_c),s(B)===s(fn).Fill?(M(),A("circle",{key:1,class:"progress progressFill",r:Math.max(s(g)*s(C)-2,0),fill:s(S)},null,8,Nc)):(M(),A("circle",{key:2,r:s(g)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(s(g)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(s(g)+4.5)*2*Math.PI-s(C)*(s(g)+4.5)*2*Math.PI,stroke:s(S)},null,8,Cc))])):s(c)===s(je).Diamond?(M(),A("g",kc,[s(le)?(M(),A("rect",{key:0,class:"receiver",width:s(g)*s(i)+16,height:s(g)*s(i)+16,transform:`translate(${-(s(g)*s(i)+16)/2}, ${-(s(g)*s(i)+16)/2})`,fill:s(_),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,Mc)):G("",!0),N("rect",{class:"body",width:s(g)*s(i),height:s(g)*s(i),transform:`translate(${-s(g)*s(i)/2}, ${-s(g)*s(i)/2})`,fill:s(E),stroke:s(x),"stroke-width":4},null,8,Sc),s(B)===s(fn).Fill?(M(),A("rect",{key:1,class:"progress progressFill",width:Math.max(s(g)*s(i)*s(C)-2,0),height:Math.max(s(g)*s(i)*s(C)-2,0),transform:`translate(${-Math.max(s(g)*s(i)*s(C)-2,0)/2}, ${-Math.max(s(g)*s(i)*s(C)-2,0)/2})`,fill:s(S)},null,8,Ic)):(M(),A("rect",{key:2,class:"progress progressDiamond",width:s(g)*s(i)+9,height:s(g)*s(i)+9,transform:`translate(${-(s(g)*s(i)+9)/2}, ${-(s(g)*s(i)+9)/2})`,fill:"transparent","stroke-dasharray":(s(g)*s(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(s(g)*s(i)+9)*4-s(C)*(s(g)*s(i)+9)*4,stroke:s(S)},null,8,xc))])):G("",!0),N("text",{fill:s(D),class:"node-title",y:s(v)?10:0},pe(s(d)),9,$c),s(v)?(M(),A("text",{key:2,fill:s(D),class:"node-subtitle",y:"-15"},pe(s(v)),9,Ec)):G("",!0)],32),f(zn,{name:"fade",appear:""},{default:Z(()=>{var ut;return[s(p)?(M(),A("g",Pc,[N("text",{fill:(ut=s(p).color)!=null?ut:s(D),class:_e(["node-title",{pulsing:s(p).pulsing}]),y:-s(g)-20},pe(s(p).text),11,Tc)])):G("",!0)]}),_:1}),f(zn,{name:"fade",appear:""},{default:Z(()=>{var ut;return[e.isSelected&&e.selectedAction?(M(),A("text",{key:0,fill:(ut=s(b).color)!=null?ut:s(D),class:_e(["node-title",{pulsing:s(b).pulsing}]),y:s(g)+75},pe(s(b).text),11,Dc)):G("",!0)]}),_:1})],14,bc)}}});var Rc=ve(Ac,[["__scopeId","data-v-518d7a7f"]]);const Fc={class:"stage",width:"100%",height:"100%"},Oc={class:"g1"},qc=J({__name:"Board",props:{nodes:null,types:null,state:null,visibility:null,width:null,height:null,style:null,classes:null,links:null,selectedAction:null,selectedNode:null,draggingNode:null,receivingNode:null,mousePosition:null,setReceivingNode:{type:Function},setDraggingNode:{type:Function}},setup(e){const n=Te(e),i=U({x:0,y:0}),r=U({x:0,y:0}),a=U(!1),u=U(null),l=w(()=>{const g=n.nodes.value.slice();if(n.selectedNode.value){const C=g.splice(g.indexOf(n.selectedNode.value),1)[0];g.push(C)}if(n.draggingNode.value){const C=g.splice(g.indexOf(n.draggingNode.value),1)[0];g.push(C)}return g});St(()=>{const g=n.draggingNode.value;if(g==null)return null;const C={x:g.position.x+r.value.x,y:g.position.y+r.value.y};let _=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((x,E)=>{if(E.id===g.id)return x;const S=n.types.value[E.type];if(!be(S.canAccept,E,g))return x;const B=Math.pow(C.x-E.position.x,2)+Math.pow(C.y-E.position.y,2);let le=be(S.size,E);return B>_||B>le*le?x:(_=B,E)},null))});function c(g){g.setTransformOrigin(null),g.moveTo(u.value.$el.clientWidth/2,u.value.$el.clientHeight/2)}function d(g,C=null,_=!1){if(n.draggingNode.value==null){g.preventDefault(),g.stopPropagation();let x,E;if("touches"in g)if(g.touches.length===1)x=g.touches[0].clientX,E=g.touches[0].clientY;else return;else x=g.clientX,E=g.clientY;i.value={x,y:E},r.value={x:0,y:0},a.value=!1,_&&n.setDraggingNode.value(C)}C!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function v(g){const{x:C,y:_,scale:x}=u.value.panZoomInstance.getTransform();let E,S;if("touches"in g)if(g.touches.length===1)E=g.touches[0].clientX,S=g.touches[0].clientY;else{p(n.draggingNode.value),n.mousePosition.value=null;return}else E=g.clientX,S=g.clientY;n.mousePosition.value={x:(E-C)/x,y:(S-_)/x},r.value={x:r.value.x+(E-i.value.x)/x,y:r.value.y+(S-i.value.y)/x},i.value={x:E,y:S},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(a.value=!0),n.draggingNode.value!=null&&(g.preventDefault(),g.stopPropagation())}function p(g,C=!1){var _,x;if(n.draggingNode.value!=null&&n.draggingNode.value===g){n.receivingNode.value==null&&(n.draggingNode.value.position.x+=Math.round(r.value.x/25)*25,n.draggingNode.value.position.y+=Math.round(r.value.y/25)*25);const E=n.nodes.value;E.push(E.splice(E.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((x=(_=n.types.value[n.receivingNode.value.type]).onDrop)==null||x.call(_,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!a.value&&!C&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function b(g,C){n.state.value.selectedAction===C?s(n.selectedAction).onClick(s(n.selectedNode)):n.state.value={...n.state.value,selectedAction:C}}return(g,C)=>{const _=kt("panZoom");return s(We)(e.visibility)?(M(),ne(_,{key:0,style:Le([{width:e.width,height:e.height},e.style]),class:_e(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:u,onInit:c,onMousemove:v,onTouchmove:v,onMousedown:C[0]||(C[0]=x=>d(x)),onTouchstart:C[1]||(C[1]=x=>d(x)),onMouseup:C[2]||(C[2]=()=>p(s(e.draggingNode))),onTouchendPassive:C[3]||(C[3]=()=>p(s(e.draggingNode))),onMouseleave:C[4]||(C[4]=()=>p(s(e.draggingNode),!0))},{default:Z(()=>[(M(),A("svg",Fc,[N("g",Oc,[f(er,{name:"link",appear:""},{default:Z(()=>[(M(!0),A(re,null,xn(s(e.links)||[],x=>(M(),A("g",{key:`${x.startNode.id}-${x.endNode.id}`},[f(dc,{link:x},null,8,["link"])]))),128))]),_:1}),f(er,{name:"grow",duration:500,appear:""},{default:Z(()=>[(M(!0),A(re,null,xn(s(l),x=>(M(),A("g",{key:x.id,style:{"transition-duration":"0s"}},[f(Rc,{node:x,nodeType:e.types[x.type],dragging:s(e.draggingNode),dragged:s(e.draggingNode)===x?r.value:void 0,hasDragged:s(e.draggingNode)==null?!1:a.value,receivingNode:s(e.receivingNode)===x,isSelected:s(e.selectedNode)===x,selectedAction:s(e.selectedNode)===x?s(e.selectedAction):null,onMouseDown:d,onEndDragging:p,onClickAction:E=>b(x,E)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","isSelected","selectedAction","onClickAction"])]))),128))]),_:1})])]))]),_:1},8,["style","class","options"])):G("",!0)}}});et.on("setupVue",e=>ca.install(e));const qr=Symbol("Board");var fn=(e=>(e.Outline="Outline",e.Fill="Fill",e))(fn||{}),je=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(je||{});function Vc(e){const t=dt({nodes:[],selectedNode:null,selectedAction:null},!1);return tt(n=>{const i=e.call(n,n);i.id=tn("board-"),i.type=qr,i[bt]=qc,i.state?(Tr(t),$(i,"state")):(t[en]={nodes:i.startNodes().map((l,c)=>(l.id=c,l)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=w(()=>s(u.state).nodes),i.selectedNode=w({get(){return u.nodes.value.find(l=>l.id===s(u.state).selectedNode)||null},set(l){var c,d;Fe(u.state)?u.state.value={...u.state.value,selectedNode:(c=l==null?void 0:l.id)!=null?c:null}:u.state.selectedNode=(d=l==null?void 0:l.id)!=null?d:null}}),i.selectedAction=w({get(){const l=u.selectedNode.value;if(l==null)return null;const c=u.types[l.type];return c.actions==null?null:c.actions.find(d=>d.id===s(u.state).selectedAction)||null},set(l){var c,d;Fe(u.state)?u.state.value={...u.state.value,selectedAction:(c=l==null?void 0:l.id)!=null?c:null}:u.state.selectedAction=(d=l==null?void 0:l.id)!=null?d:null}}),i.mousePosition=U(null),i.links?$(i,"links"):i.links=w(()=>u.selectedAction.value==null?null:u.selectedAction.value.links&&u.selectedNode.value?be(u.selectedAction.value.links,u.selectedNode.value):null),i.draggingNode=U(null),i.receivingNode=U(null),$(i,"visibility"),oe(i,"visibility",ke.Visible),$(i,"width"),oe(i,"width","100%"),$(i,"height"),oe(i,"height","100%"),$(i,"classes"),$(i,"style");for(const l in i.types){const c=i.types[l];if($(c,"title"),$(c,"subtitle"),$(c,"label"),$(c,"size"),oe(c,"size",50),$(c,"style"),$(c,"classes"),$(c,"draggable"),oe(c,"draggable",!1),$(c,"shape"),oe(c,"shape","Circle"),$(c,"canAccept"),oe(c,"canAccept",!1),$(c,"progress"),$(c,"progressDisplay"),oe(c,"progressDisplay","Fill"),$(c,"progressColor"),oe(c,"progressColor","none"),$(c,"fillColor"),$(c,"outlineColor"),$(c,"titleColor"),$(c,"actionDistance"),oe(c,"actionDistance",Math.PI/6),c.nodes=w(()=>s(u.state).nodes.filter(d=>d.type===l)),oe(c,"onClick",function(d){s(u.state).selectedNode=d.id}),c.actions)for(const d of c.actions)$(d,"visibility"),oe(d,"visibility",ke.Visible),$(d,"icon"),$(d,"fillColor"),$(d,"tooltip"),$(d,"confirmationLabel"),oe(d,"confirmationLabel",{text:"Tap again to confirm"}),$(d,"links")}function r(l){i.draggingNode.value=l}function a(l){i.receivingNode.value=l}i.placeInAvailableSpace=function(l,c=100,d=H.Right){const v=u.nodes.value.slice().filter(p=>p===l||(d===H.Down||d===H.Up)&&Math.abs(p.position.x-l.position.x)>c||(d===H.Left||d===H.Right)&&Math.abs(p.position.y-l.position.y)>c?!1:!(d===H.Right&&p.position.xl.position.x+c||d===H.Up&&p.position.y>l.position.y+c||d===H.Down&&p.position.yp.position.x-b.position.x:d===H.Left?(p,b)=>b.position.x-p.position.x:d===H.Up?(p,b)=>b.position.y-p.position.y:(p,b)=>p.position.y-b.position.y);for(let p=0;p0&&g>c)break}},i[ft]=function(){const{nodes:l,types:c,state:d,visibility:v,width:p,height:b,style:g,classes:C,links:_,selectedAction:x,selectedNode:E,mousePosition:S,draggingNode:D,receivingNode:B}=this;return{nodes:l,types:c,state:d,visibility:v,width:p,height:b,style:s(g),classes:C,links:_,selectedAction:x,selectedNode:E,mousePosition:S,draggingNode:D,receivingNode:B,setDraggingNode:r,setReceivingNode:a}};const u=i;return u})}function be(e,t,...n){return Un(e)?e(t,...n):s(e)}function $n(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const Ln={};et.on("addLayer",e=>{const t=Hn(e,qr);Ln[e.id]=e.on("postUpdate",n=>{t.forEach(i=>{Object.values(i.types).forEach(r=>r.nodes.value.forEach(a=>{var u;return(u=r.update)==null?void 0:u.call(r,a,n)}))})})});et.on("removeLayer",e=>{var t;(t=Ln[e.id])==null||t.call(Ln),Ln[e.id]=void 0});function kn(e,t="points",n=0,i=void 0){const r=Fe(e)?e:dt(e);if(r.displayName=t,r.precision=n,r.small=i,!Fe(e)){const a=r[Tt];a.displayName=t,a.precision=n,a.small=i}return r}new o("10^^8");new o("1e100");function fi(e,t){const n=t!=null?t:e.value;return o.eq(e.precision,0)?pt(e.small?n:o.floor(n)):Ie(n,e.precision,e.small)}et.on("setupVue",e=>e.use(da));function Bc(e="white",t="8px"){return{transform:"scale(1.05, 1.05)",borderColor:"rgba(0, 0, 0, 0.125)",boxShadow:`-4px -4px 4px rgba(0, 0, 0, 0.25) inset, 0 0 ${t} ${e}`,zIndex:1}}const Lc=J({props:{visibility:{type:q(Number,Boolean),required:!0},display:{type:q(Object,String,Function),required:!0},style:q(String,Object,Array),classes:q(Object),glowColor:q(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=Te(e),a=xr(n),u=w(()=>{const c=$e(i);return c==null||c===""?{}:s(r)?Bc(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function l(){t("selectTab")}return{selectTab:l,component:a,glowColorStyle:u,unref:s,Visibility:ke,isVisible:We,isHidden:vn}}});function jc(e,t,n,i,r,a){var u;return e.isVisible(e.visibility)?(M(),A("button",{key:0,onClick:t[0]||(t[0]=(...l)=>e.selectTab&&e.selectTab(...l)),class:_e(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(u=e.unref(e.style))!=null?u:{}])},[(M(),ne(Qe(e.component)))],6)):G("",!0)}var Vr=ve(Lc,[["render",jc],["__scopeId","data-v-21427abb"]]);const zc=J({props:{visibility:{type:q(Number,Boolean),required:!0},activeTab:{type:q(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:q(Object),required:!0},style:q(String,Object,Array),classes:q(Object),buttonContainerStyle:q(String,Object,Array),buttonContainerClasses:q(Object)},components:{Sticky:pi,TabButton:Vr},setup(e){const{activeTab:t}=Te(e),n=w(()=>Nt[de.theme].floatingTabs),i=vt("");St(()=>{const l=$e(t);if(l==null){i.value="";return}if(It(l)){i.value=fe(l);return}i.value=fe(s(l.display))});const r=w(()=>{const l=$e(t);return It(l)||!l?void 0:s(l.classes)}),a=w(()=>{const l=$e(t);return It(l)||!l?void 0:s(l.style)});function u(l){const{display:c,style:d,classes:v,glowColor:p,visibility:b}=l;return{display:c,style:s(d),classes:v,glowColor:p,visibility:b}}return{floating:n,tabClasses:r,tabStyle:a,Visibility:ke,component:i,gatherButtonProps:u,unref:s,isVisible:We,isHidden:vn}}});function Gc(e,t,n,i,r,a){var c,d;const u=kt("TabButton"),l=kt("Sticky");return e.isVisible(e.visibility)?(M(),A("div",{key:0,class:_e(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(d=e.tabStyle)!=null?d:[]])},[f(l,{class:_e(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:Le(e.unref(e.buttonContainerStyle))},{default:Z(()=>[N("div",{class:_e(["tab-buttons",{floating:e.floating}])},[(M(!0),A(re,null,xn(e.unref(e.tabs),(v,p)=>(M(),ne(u,Gt({onSelectTab:b=>e.selected.value=p,floating:e.floating,key:p,active:e.unref(v.tab)===e.unref(e.activeTab)},e.gatherButtonProps(v)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(M(),ne(Qe(e.unref(e.component)),{key:0})):G("",!0)],6)):G("",!0)}var Uc=ve(zc,[["render",Gc],["__scopeId","data-v-58dbf83a"]]);const Wc=Symbol("TabButton"),Hc=Symbol("TabFamily");function Zc(e,t){if(Object.keys(e).length===0)throw console.warn("Cannot create tab family with 0 tabs"),new Error("Cannot create tab family with 0 tabs");const n=dt(Object.keys(e)[0],!1);return tt(i=>{var u;const r=(u=t==null?void 0:t.call(i,i))!=null?u:{};r.id=tn("tabFamily-"),r.type=Hc,r[bt]=Uc,r.tabs=Object.keys(e).reduce((l,c)=>{const d=e[c]();return d.type=Wc,d[bt]=Vr,$(d,"visibility"),oe(d,"visibility",ke.Visible),$(d,"tab"),$(d,"display"),$(d,"classes"),$(d,"style"),$(d,"glowColor"),l[c]=d,l},{}),r.selected=n,r.activeTab=w(()=>{const l=s(a.tabs);if(n.value in l&&We(l[n.value].visibility))return s(l[n.value].tab);const c=Object.values(l).find(d=>We(d.visibility));return c?s(c.tab):null}),$(r,"visibility"),oe(r,"visibility",ke.Visible),$(r,"classes"),$(r,"style"),$(r,"buttonContainerClasses"),$(r,"buttonContainerStyle"),r[ft]=function(){const{visibility:l,activeTab:c,selected:d,tabs:v,style:p,classes:b,buttonContainerClasses:g,buttonContainerStyle:C}=this;return{visibility:l,activeTab:c,selected:d,tabs:v,style:s(p),classes:b,buttonContainerClasses:g,buttonContainerStyle:C}};const a=r;return a})}function Lt(e){return tt(t=>{const{addend:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),u=we(n),l=we(i),c=r==null?void 0:we(r);return{apply:d=>o.add(d,s(u)),invert:d=>o.sub(d,s(u)),getFormula:d=>m.add(d,u),enabled:c,description:i==null?void 0:K(()=>f("div",{class:"modifier-container"},[s(l)!=null?f("span",{class:"modifier-description"},[Ct(s(l))]):null,f("span",{class:"modifier-amount",style:(a===!0?o.gt(s(u),0):o.lt(s(u),0))?"color: var(--danger)":""},[o.gte(s(u),0)?"+":"",jt(s(u))])]))}})}function Ce(e){return tt(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),u=we(n),l=we(i),c=r==null?void 0:we(r);return{apply:d=>o.times(d,s(u)),invert:d=>o.div(d,s(u)),getFormula:d=>m.times(d,u),enabled:c,description:i==null?void 0:K(()=>f("div",{class:"modifier-container"},[s(l)!=null?f("span",{class:"modifier-description"},[Ct(s(l))]):null,f("span",{class:"modifier-amount",style:(a===!0?o.gt(s(u),1):o.lt(s(u),1))?"color: var(--danger)":""},[T("\xD7"),jt(s(u))])]))}})}function Xc(e){return tt(t=>{const{exponent:n,description:i,enabled:r,supportLowNumbers:a,smallerIsBetter:u}=e.call(t,t),l=we(n),c=we(i),d=r==null?void 0:we(r);return{apply:v=>{let p=v;return a&&(p=o.add(p,1)),p=o.pow(p,s(l)),a&&(p=o.sub(p,1)),p},invert:v=>{let p=v;return a&&(p=o.add(p,1)),p=o.root(p,s(l)),a&&(p=o.sub(p,1)),p},getFormula:v=>a?m.add(v,1).pow(l).sub(1):m.pow(v,l),enabled:d,description:i==null?void 0:K(()=>f("div",{class:"modifier-container"},[s(c)!=null?f("span",{class:"modifier-description"},[Ct(s(c)),a?" (+1 effective)":null]):null,f("span",{class:"modifier-amount",style:(u===!0?o.gt(s(l),1):o.lt(s(l),1))?"color: var(--danger)":""},[T("^"),jt(s(l))])]))}})}function wt(e){return tt(()=>{const t=e();return{apply:n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.apply(i),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduceRight((i,r)=>r.invert(i),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.getFormula(i),n):void 0,enabled:t.some(n=>n.enabled!=null)?w(()=>t.filter(n=>s(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?K(()=>f(re,null,[t.filter(n=>s(n.enabled)!==!1).map(n=>s(n.description)).filter(n=>n).map(Ct)])):void 0}})}const Fi=m.variable(0).step(2e3,e=>e.pow_base(1.02)).step(100,e=>e.pow(1.5)).step(o.pow(900,1.5).add(100),e=>e.pow(1.5)).pow(1.5),nn={id:"deselect",icon:"close",tooltip:e=>({text:"portals"in e.state?"Disconnect portals":"tools"in e.state?"Disconnect tools":"Disconnect resources"}),onClick(e){var t;Array.isArray((t=e.state)==null?void 0:t.data)?e.state={...e.state,data:[]}:"portals"in e.state?e.state={...e.state,portals:[]}:"resources"in e.state?e.state={...e.state,resources:[]}:"tools"in e.state&&(e.state={...e.state,tools:[]}),h.board.selectedAction.value=null,h.board.selectedNode.value=null},visibility:e=>{var t;return Array.isArray((t=e.state)==null?void 0:t.data)?e.state.data.length>0:"portals"in e.state?e.state.portals.length>0:"resources"in e.state?e.state.resources.length>0:"tools"in e.state?e.state.tools.length>0:!1}},Rt={id:"toggle",icon:"bolt",tooltip:e=>({text:e.state.powered?"Turn Off":`Turn On - Always runs for ${pt(h.nextPowerCost.value)} energy/s`}),onClick(e){e.state={...e.state,powered:!e.state.powered},h.board.selectedAction.value=null},fillColor:e=>e.state.powered?"var(--accent1)":"var(--locked)"};function bn(e,t=1/0){const n=e(m.variable(0));return{id:"moreConnections",icon:"hub",formula:n,tooltip(i){return{text:`Increase Connections - ${pt(n.evaluate(i.state.maxConnections))} energy`}},confirmationLabel:i=>o.gte(h.energy.value,n.evaluate(i.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(i){const r=n.evaluate(i.state.maxConnections);o.gte(h.energy.value,r)&&(h.energy.value=o.sub(h.energy.value,r),i.state={...i.state,maxConnections:o.add(i.state.maxConnections,1)},h.board.selectedAction.value=null)},visibility:i=>o.add(i.state.maxConnections,h.computedBonusConnectionsModifier.value).lt(t)}}function Br(e,t){var n,i;if(((n=h.board.draggingNode.value)==null?void 0:n.type)==="resource"){const r=((i=h.board.draggingNode.value)==null?void 0:i.state).type,{maxConnections:a,resources:u}=e.state;return u.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,h.computedBonusConnectionsModifier.value).lte(u.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Yc(e,t){var n,i;if(((n=h.board.draggingNode.value)==null?void 0:n.type)==="passive"){const r=(i=h.board.draggingNode.value)==null?void 0:i.state,{maxConnections:a,tools:u}=e.state;return u.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,h.computedBonusConnectionsModifier.value).lte(u.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function hi(e,t){var n,i;if(((n=h.board.draggingNode.value)==null?void 0:n.type)==="portal"){const r=((i=h.board.draggingNode.value)==null?void 0:i.state).id,{maxConnections:a,portals:u}=e.state;return u.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,h.computedBonusConnectionsModifier.value).lte(u.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Lr(e,t){if(t.type!=="resource")return!1;const n=t.state.type,{maxConnections:i,resources:r}=e.state;return r.includes(n)?!0:!o.add(i,h.computedBonusConnectionsModifier.value).lte(r.length)}function jr(e,t){if(t.type!=="resource")return;const n=t.state.type,i=e.state.resources;i.includes(n)?e.state={...e.state,resources:i.filter(r=>r!==n)}:e.state={...e.state,resources:[...i,n]},h.board.selectedNode.value=e}function Jc(e,t){if(t.type!=="passive")return!1;const n=t.state,{maxConnections:i,tools:r}=e.state;return r.includes(n)?!0:!o.add(i,h.computedBonusConnectionsModifier.value).lte(r.length)}function Kc(e,t){if(t.type!=="passive")return;const n=t.state,i=e.state.tools;i.includes(n)?e.state={...e.state,tools:i.filter(r=>r!==n)}:e.state={...e.state,tools:[...i,n]},h.board.selectedNode.value=e}function bi(e,t){if(t.type!=="portal")return!1;const n=t.state.id,{maxConnections:i,portals:r}=e.state;return r.includes(n)?!0:!o.add(i,h.computedBonusConnectionsModifier.value).lte(r.length)}function yi(e,t){if(t.type!=="portal")return;const n=t.state.id,{portals:i}=e.state;i.includes(n)?e.state={...e.state,portals:i.filter(r=>r!==n)}:e.state={...e.state,portals:[...i,n]},h.board.selectedNode.value=e}function Ne(e){return e===h.board.selectedNode.value||e.state.powered}function ee(e){return h.empowerer.value!=null&&Ne(h.empowerer.value)&&h.empowerer.value.state.tools.includes(e)}function Qc(e){var a,u,l;const t=(l=(u=(a=h.resourceNodes.value[e])==null?void 0:a.state)==null?void 0:u.amount)!=null?l:0,n=h.resourceLevels.value[e],i=Fi.evaluate(n),r=Fi.evaluate(o.add(n,1));return o.sub(t,i).max(0).div(o.sub(r,i)).toNumber()}function on(e,t,n){if(t.value){const i=t.value.state,r=i[n],a=i.maxConnections;o.gt(r.length,o.add(a,e))&&(t.value.state={...t.value.state,[n]:r.slice(0,o.add(a,e).toNumber())})}}const ed={key:0},td={key:0,class:"mark star"},nd=["src"],id=J({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(M(),A("div",ed,[e.mark===!0?(M(),A("div",td)):(M(),A("img",{key:1,class:"mark",src:e.mark},null,8,nd))])):G("",!0)}});var Yn=ve(id,[["__scopeId","data-v-2207999f"]]);const rd=J({__name:"Node",props:{id:null},setup(e){const n=Te(e),i=li(Bi,()=>{}),r=li(Li,()=>{}),a=vt(null),u=w(()=>a.value&&a.value.parentElement);return mt([u,n.id],([l,c],[d,v])=>{d&&r(s(v)),l&&i(c,l)}),mr(()=>r(s(n.id))),(l,c)=>(M(),A("div",{class:"node",ref_key:"node",ref:a},null,512))}});var Jn=ve(rd,[["__scopeId","data-v-a48cb382"]]),ad=J({props:{display:{type:q(Object,String,Function),required:!0},visibility:{type:q(Number,Boolean),required:!0},style:q(Object,String,Array),classes:q(Object),onClick:Function,onHold:Function,canClick:{type:q(Boolean),required:!0},small:Boolean,mark:q(Boolean,String),id:{type:String,required:!0}},components:{Node:Jn,MarkNode:Yn},setup(e){const{display:t,onClick:n,onHold:i}=Te(e),r=vt("");St(()=>{var v;const l=$e(t);if(l==null){r.value="";return}if(It(l)){r.value=fe(l);return}const c=fe((v=l.title)!=null?v:"","h3"),d=fe(l.description,"div");r.value=fe(K(()=>f("span",null,[l.title!=null?f("div",null,[f(c,null,null)]):null,f(d,null,null)])))});const{start:a,stop:u}=Ir(n,i);return{start:a,stop:u,comp:r,Visibility:ke,isVisible:We,isHidden:vn,unref:s}}});function sd(e,t,n,i,r,a){var c;const u=kt("MarkNode"),l=kt("Node");return e.isVisible(e.visibility)?(M(),A("button",{key:0,style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:_e({feature:!0,clickable:!0,can:e.unref(e.canClick),locked:!e.unref(e.canClick),small:e.small,...e.unref(e.classes)})},[e.unref(e.comp)?(M(),ne(Qe(e.unref(e.comp)),{key:0})):G("",!0),f(u,{mark:e.unref(e.mark)},null,8,["mark"]),f(l,{id:e.id},null,8,["id"])],38)):G("",!0)}var zr=ve(ad,[["render",sd],["__scopeId","data-v-211328c0"]]);const Gr=Symbol("Clickable");function od(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return tt(i=>{var u,l,c;const r=(u=e==null?void 0:e.call(i,i))!=null?u:{};r.id=tn("clickable-"),r.type=Gr,r[bt]=zr;for(const d of t)(l=d.preConstruct)==null||l.call(d,r);if(Object.assign(r,n),$(r,"visibility"),oe(r,"visibility",ke.Visible),$(r,"canClick"),oe(r,"canClick",!0),$(r,"classes"),$(r,"style"),$(r,"mark"),$(r,"display"),r.onClick){const d=r.onClick.bind(r);r.onClick=function(v){s(r.canClick)!==!1&&d(v)}}if(r.onHold){const d=r.onHold.bind(r);r.onHold=function(){s(r.canClick)!==!1&&d()}}for(const d of t)(c=d.postConstruct)==null||c.call(d,r);const a=t.reduce((d,v)=>{var p;return Object.assign(d,(p=v.getGatheredProps)==null?void 0:p.call(v,r))},{});return r[ft]=function(){const{display:d,visibility:v,style:p,classes:b,onClick:g,onHold:C,canClick:_,small:x,mark:E,id:S}=this;return{display:d,visibility:v,style:s(p),classes:b,onClick:g,onHold:C,canClick:_,small:x,mark:E,id:S,...a}},r})}function ld(e,t,n=[]){n=n.length===0?Hn(e,Gr):n;const i=typeof t=="function"?w(t):t;return e.on("update",()=>{s(i)&&n.filter(r=>s(r.canClick)).forEach(r=>{var a;return(a=r.onClick)==null?void 0:a.call(r)})})}const ud=["x1","y1","x2","y2"],cd=J({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=Te(e),i=w(()=>{const a=n.startNode.value.rect,u=n.boundingRect.value,l=u?{x:a.x+a.width/2-u.x,y:a.y+a.height/2-u.y}:{x:0,y:0};return n.link.value.offsetStart&&(l.x+=n.link.value.offsetStart.x,l.y+=n.link.value.offsetStart.y),l}),r=w(()=>{const a=n.endNode.value.rect,u=n.boundingRect.value,l=u?{x:a.x+a.width/2-u.x,y:a.y+a.height/2-u.y}:{x:0,y:0};return n.link.value.offsetEnd&&(l.x+=n.link.value.offsetEnd.x,l.y+=n.link.value.offsetEnd.y),l});return(a,u)=>(M(),A("line",Gt({"stroke-width":"15px",stroke:"white"},e.link,{x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,ud))}});const dd=J({__name:"Links",props:{links:null},setup(e){var c;const n=Qt(e,"links"),i=U(null),r=li(ji,U({})),a=li(zi,U(void 0)),u=U((c=i.value)==null?void 0:c.getBoundingClientRect());mt(a,()=>{var d;return u.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),gi(()=>{var d;return u.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const l=w(()=>{var v,p;const d=r.value;return(p=(v=n.value)==null?void 0:v.filter(b=>{var g,C;return((g=d[b.startNode.id])==null?void 0:g.rect)&&((C=d[b.startNode.id])==null?void 0:C.rect)}))!=null?p:[]});return(d,v)=>(M(),A(re,null,[s(l)?(M(),A("svg",ra(Gt({key:0},d.$attrs)),[(M(!0),A(re,null,xn(s(l),(p,b)=>(M(),ne(cd,{key:b,link:p,boundingRect:u.value,startNode:s(r)[p.startNode.id],endNode:s(r)[p.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):G("",!0),N("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var pd=ve(dd,[["__scopeId","data-v-063f6d6b"]]);J({props:{nodes:{type:q(Array),required:!0},leftSideNodes:q(Array),rightSideNodes:q(Array),branches:q(Array)},components:{Links:pd},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=Te(e),r=vt();St(()=>{const l=$e(t);r.value=fe(K(()=>f(re,null,[l.map(c=>f("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(Ct)]))])))});const a=vt();St(()=>{const l=$e(n);a.value=l?fe(K(()=>f("span",{class:"left-side-nodes small"},[l.map(Ct)]))):""});const u=vt();return St(()=>{const l=$e(i);u.value=l?fe(K(()=>f("span",{class:"side-nodes small"},[l.map(Ct)]))):""}),{unref:s,nodesComp:r,leftNodesComp:a,rightNodesComp:u}}});J({props:{display:q(Object,String,Function),visibility:{type:q(Number,Boolean),required:!0},style:q(String,Object,Array),classes:q(Object),onClick:Function,onHold:Function,color:q(String),glowColor:q(String),canClick:{type:q(Boolean),required:!0},mark:q(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Yn,Node:Jn},setup(e){const{onClick:t,onHold:n,display:i}=Te(e),r=En(i),{start:a,stop:u}=Ir(t,n);return{start:a,stop:u,comp:r,unref:s,Visibility:ke,isCoercableComponent:It,isVisible:We,isHidden:vn}}});function jn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(l=>we(l.base)),n.baseText=t.map(l=>we(l.baseText)),n.visible=t.map(l=>we(l.visible)),n.title=t.map(l=>we(l.title)),n.subtitle=t.map(l=>we(l.subtitle)),i=!0),t}const a=dt({},!1);return[K(()=>{const l=r();let c=!0;const d=l.map((v,p)=>{var E,S,D;if(s(n.visible[p])===!1)return null;const b=f("h3",{onClick:()=>a.value[p]=!a.value[p],style:"cursor: pointer"},[f("span",{class:"modifier-toggle"+(s(a.value[p])?" collapsed":"")},[T("\u25BC")]),s(n.title[p]),s(n.subtitle[p])!=null?f("span",{class:"subtitle"},[T(" ("),s(n.subtitle[p]),T(")")]):null]),g=s(a.value[p])?null:f(re,null,[f("div",{class:"modifier-container"},[f("span",{class:"modifier-description"},[Ct((E=s(n.baseText[p]))!=null?E:"Base")]),f("span",{class:"modifier-amount"},[Ie((S=s(n.base[p]))!=null?S:1),v.unit])]),v.modifier.description==null?null:Ct(s(v.modifier.description))]),C=!c;c=!1;const _=(D=s(n.base[p]))!=null?D:1,x=v.modifier.apply(_);return f(re,null,[C?f("br",null,null):null,f("div",{style:{"--unit":de.alignUnits&&v.unit!=null?"'"+v.unit+"'":""}},[b,f("br",null,null),g,f("hr",null,null),f("div",{class:"modifier-container"},[f("span",{class:"modifier-description"},[T("Total")]),f("span",{class:"modifier-amount",style:(v.smallerIsBetter===!0?o.gt(x,_!=null?_:1):o.lt(x,_!=null?_:1))?"color: var(--danger)":""},[jt(x),v.unit])])])])});return f(re,null,[d])}),a]}function Pi(e,t,n){const i=we(t),r=we(n);return w(()=>{const a=s(i),u=s(r);return o.gte(e.value,u)?"Now":o.lte(a,0)?"Never":vi(o.sub(u,e.value).div(a))})}function ln(e,t,n=1){const i=we(t),r=we(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return K(()=>{var a;if(s(i)){const u=jt(e.evaluate()),l=jt(e.evaluate(o.add(s((a=e.innermostVariable)!=null?a:0),s(r))));return f(re,null,[f("b",null,[f("i",null,[u,T(" \u2192 "),l])])])}return f(re,null,[jt(e.evaluate())])})}const Mt={dirt:120,sand:60,gravel:40,wood:30,stone:24,coal:20,copper:15,iron:12,silver:10,gold:8,emerald:6,platinum:5,diamond:4,berylium:3,unobtainium:2,ultimatum:1},Vt=Object.keys(Mt),Be={dirt:{cost:1e3,name:"Pickaxe",type:"passive",state:"dirt"},sand:{cost:1e4,name:"Dowsing Rod",type:"dowsing",state:{resources:[],maxConnections:1,powered:!1}},gravel:{cost:1e5,name:"Ore Processor",type:"passive",state:"gravel"},wood:{cost:1e6,name:"Quarry",type:"quarry",state:{resources:[],maxConnections:1,powered:!1,progress:0}},stone:{cost:1e7,name:"Energizer",type:"passive",state:"stone"},coal:{cost:1e8,name:"Tool Empowerer",type:"empowerer",state:{tools:[],maxConnections:1,powered:!1}},copper:{cost:1e9,name:"Book",type:"passive",state:"copper"},iron:{cost:1e10,name:"Portal Generator",type:"portalGenerator",state:{tier:void 0,influences:[]}},silver:{cost:1e12,name:"Robotics",type:"passive",state:"silver"},gold:{cost:1e15,name:"Booster",type:"booster",state:{portals:[],maxConnections:1,powered:!1,level:1}},emerald:{cost:1e19,name:"Artificial Intelligence",type:"passive",state:"emerald"},platinum:{cost:1e24,name:"Upgrader",type:"upgrader",state:{portals:[],maxConnections:1,powered:!1}},diamond:{cost:1e30,name:"Machine Learning",type:"passive",state:"diamond"},berylium:{cost:1e37,name:"Automator",type:"automator",state:{portals:[],maxConnections:1,powered:!1}},unobtainium:{cost:1e45,name:"National Grid",type:"passive",state:"unobtainium"},ultimatum:{cost:1e54,name:"Investments",type:"investments",state:{portals:[],maxConnections:1,powered:!1}}},Pt={dirt:"BOGO Coupon",sand:"Metal Detector",gravel:"Neural Networks",wood:"Mining Laser",stone:"Replicator",coal:"Planar Intelligence",copper:"Efficient Code",iron:"Trade Agreements",silver:"Machine Synergizer",gold:"XP Market",emerald:"Efficient Portals",platinum:"Time Dilation",diamond:"Paypal",berylium:"Tiered Mining",unobtainium:"Overclocked Portals",ultimatum:"Rebates"},fd={dirt:{description:e=>e?"Quadruples mining speed":"Doubles mining speed"},gravel:{description:e=>e?"Quadruples mine ore drops":"Doubles mine ore drops"},stone:{description:e=>e?"Quadruples energy gain":"Doubles energy gain"},copper:{description:e=>e?"Material level is 40% stronger":"Material level is 20% stronger"},silver:{description:e=>e?"Quadruples each plane's resource gain":"Doubles each plane's resource gain"},diamond:{description:e=>e?"+20% plane's resource gain per upgrade bought":"+10% plane's resource gain per upgrade bought"},emerald:{description:e=>e?"+2% plane's resource gain per minute active":"+1% plane's resource gain per minute active"},unobtainium:{description:e=>e?"+2 max connections per machine":"+1 max connections per machine"},dirtRelic:{description:e=>e?"2 free levels for repeatables":"1 free level for repeatables"},sandRelic:{description:e=>e?"Treasure's 2 tiers stronger":"Treasure's 1 tier stronger"},gravelRelic:{description:e=>e?"+2% plane's resource gain per repeatable purchase (diminishing)":"+1% plane's resource gain per repeatable purchase (diminishing)"},woodRelic:{description:e=>e?"(Relics)^2 boost mine speed":"Relics boost mine speed"},stoneRelic:{description:e=>e?"All upgrades apply twice":"Non-multiplicative upgrades apply twice"},coalRelic:{description:e=>e?"Every treasure boosts planar speed by +20%":"Every treasure boosts planar speed by +10%"},copperRelic:{description:e=>e?"Power 2 machines free":"Power 1 machine free"},ironRelic:{description:e=>e?"Conversions give quadruple output":"Conversions give double output"},silverRelic:{description:e=>e?"(Powered machines)^2 boost quarry speed":"Powered machines boost quarry speed"},goldRelic:{description:e=>e?"Each treasure gives +50% XP gain":"Each treasure gives +25% XP gain"},emeraldRelic:{description:e=>e?"Creating portals costs 20x less energy":"Creating portals costs 10x less energy"},platinumRelic:{description:e=>e?"Quadruple dimensions' tick rate":"Double dimensions' tick rate"},diamondRelic:{description:e=>e?"Repeatables/dimensions buy max at once":"Repeatables buy max at once"},beryliumRelic:{description:e=>e?"log(energy)^0.5 boosts planes' resource gain":"log(energy)^0.25 boosts planes' resource gain"},unobtainiumRelic:{description:e=>e?"Upgrades/repeatables/dimensions/prestige no longer spend on purchase":"Upgrades/repeatables no longer spend on purchase"}},_t={increaseResources:{display:"+resource",description:e=>{const t=e.data;return t.length===0?"Increase resource odds - Drag a resource to me!":t.length===1?`Increase ${t[0]}'s odds`:`Increase ${t.length} resources' odds`},cost:2,initialData:[]},decreaseResources:{display:"-resource",description:e=>{const t=e.data;return t.length===0?"Decrease resource odds - Drag a resource to me!":t.length===1?`Decrease ${t[0]}'s odds`:`Decrease ${t.length} resources' odds`},cost:2,initialData:[]},increaseLength:{display:"+length",description:"Increase length",cost:100,initialData:void 0},increaseCaches:{display:"+caches",description:"Increase caches odds",cost:10,initialData:void 0},increaseGens:{display:"+gens",description:"Increase generators odds",cost:10,initialData:void 0},increaseInfluences:{display:"+influences",description:"Increase influences odds",cost:10,initialData:void 0},increaseEnergyMults:{display:"+energy mults",description:"Increase energy mults odds",cost:10,initialData:void 0},increaseResourceMults:{display:"+resource mults",description:"Increase resource mults odds",cost:10,initialData:void 0},increaseDiff:{display:"+diff",description:"Increase difficulty/rewards odds",cost:10,initialData:void 0},decreaseDiff:{display:"-diff",description:"Decrease difficulty/rewards odds",cost:10,initialData:void 0},increaseRewards:{display:"+rewards",description:"Increase rewards level",cost:1e4,initialData:void 0},relic:{display:"+relic",description:"Max length/difficulty, add tier-unique relic",cost:1e6,initialData:void 0}},Ti=m.variable(0).add(8).times(2).pow10();const gd=J({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(M(),A("div",{style:Le({width:e.width,height:e.height})},null,4))}});function On(e){return tt(t=>{var i;const n=e.call(t,t);return n.partialDisplay=r=>f("span",{style:s(n.requirementMet)?"":"color: var(--danger)"},[fi(n.resource,n.cost instanceof m?Jt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),n.display=r=>f("div",null,[s(n.requiresPay)?"Costs: ":"Requires: ",fi(n.resource,n.cost instanceof m?Jt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),$(n,"visibility"),oe(n,"visibility",ke.Visible),$(n,"cost"),$(n,"requiresPay"),oe(n,"requiresPay",!0),$(n,"cumulativeCost"),oe(n,"cumulativeCost",!0),$(n,"maxBulkAmount"),oe(n,"maxBulkAmount",1),$(n,"directSum"),oe(n,"pay",function(r){const a=n.cost instanceof m?Jt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost);n.resource.value=o.sub(n.resource.value,a).max(0)}),n.canMaximize=w(()=>{var l;if(!(n.cost instanceof m))return!1;const r=s(n.maxBulkAmount);if(o.lte(r,1))return!1;const a=s(n.cumulativeCost),u=(l=s(n.directSum))!=null?l:a?10:0;return o.lte(r,u)?!0:!(!n.cost.isInvertible()||a===!0&&!n.cost.isIntegrable())}),n.cost instanceof m?n.requirementMet=Pr(n.cost,n.resource,(i=n.cumulativeCost)!=null?i:!0,n.directSum,n.maxBulkAmount):n.requirementMet=w(()=>o.gte(n.resource.value,s(n.cost))),n})}function Xi(e){return tt(()=>({requirementMet:w(()=>We(e.visibility)),visibility:ke.None,requiresPay:!1}))}function md(e,t){return tt(()=>({requirementMet:we(e),partialDisplay:t==null?void 0:K(()=>Ct(t)),display:t==null?void 0:K(()=>f(re,null,[T("Req: "),Ct(t)])),visibility:t==null?ke.None:ke.Visible,requiresPay:!1}))}function wi(e){if(At(e))return e.every(wi);const t=s(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function Ur(e){if(At(e))return e.map(Ur).reduce(o.min);const t=s(e.requirementMet);return typeof t=="boolean"?t?o.dInf:0:o.gt(t,1)&&s(e.canMaximize)!==!0?1:t}function _i(e,t=1){var n,i;if(At(e)&&(e=e.filter(r=>We(r.visibility)),e.length===1&&(e=e[0])),At(e)){e=e.filter(u=>"partialDisplay"in u);const r=e.filter(u=>s(u.requiresPay)),a=e.filter(u=>!s(u.requiresPay));return f(re,null,[r.length>0?f("div",null,[T("Costs:")," ",sr(r.map(u=>u.partialDisplay(t)),f(re,null,[T(", ")]))]):null,a.length>0?f("div",null,[T("Requires:")," ",sr(a.map(u=>u.partialDisplay(t)),f(re,null,[T(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:f(re,null,null)}function Wr(e,t=1){var n;At(e)?e.filter(i=>s(i.requiresPay)).forEach(i=>{var r;return(r=i.pay)==null?void 0:r.call(i,t)}):s(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}var vd=J({props:{visibility:{type:q(Number,Boolean),required:!0},display:q(Object,String,Function),earned:{type:q(Boolean),required:!0},requirements:q(Object,Array),image:q(String),style:q(String,Object,Array),classes:q(Object),mark:q(Boolean,String),small:q(Boolean),id:{type:String,required:!0}},components:{Node:Jn,MarkNode:Yn},setup(e){const{display:t,requirements:n,earned:i}=Te(e),r=vt("");return St(()=>{const a=$e(t);if(a==null){r.value="";return}if(It(a)){r.value=fe(a);return}const u=fe(a.requirement?a.requirement:K(()=>{var d;return _i((d=$e(n))!=null?d:[])}),"h3"),l=fe(a.effectDisplay||"","b"),c=$e(i)?fe(a.optionsDisplay||"","span"):"";r.value=fe(K(()=>f("span",null,[f(u,null,null),a.effectDisplay!=null?f("div",null,[f(l,null,null)]):null,a.optionsDisplay!=null?f("div",{class:"equal-spaced"},[f(c,null,null)]):null])))}),{comp:r,unref:s,Visibility:ke,isVisible:We,isHidden:vn}}});function hd(e,t,n,i,r,a){var c;const u=kt("MarkNode"),l=kt("Node");return e.isVisible(e.visibility)?(M(),A("div",{key:0,style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0,backgroundImage:e.earned&&e.image&&`url(${e.image})`||""},(c=e.unref(e.style))!=null?c:[]]),class:_e({feature:!0,achievement:!0,locked:!e.unref(e.earned),done:e.unref(e.earned),small:e.unref(e.small),...e.unref(e.classes)})},[e.comp?(M(),ne(Qe(e.comp),{key:0})):G("",!0),f(u,{mark:e.unref(e.mark)},null,8,["mark"]),f(l,{id:e.id},null,8,["id"])],6)):G("",!0)}var bd=ve(vd,[["render",hd],["__scopeId","data-v-5673325a"]]);const yd=mi(),wd=Symbol("Achievement");let Mn=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function _d(e,...t){const n=dt(!1,!1),i=t.reduce((r,a)=>{var u;return Object.assign(r,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return tt(r=>{var c,d,v;const a=(c=e==null?void 0:e.call(r,r))!=null?c:{};a.id=tn("achievement-"),a.type=wd,a[bt]=bd;for(const p of t)(d=p.preConstruct)==null||d.call(p,a);a.earned=n,a.complete=function(){var b,g;if(n.value)return;n.value=!0;const p=a;if((b=p.onComplete)==null||b.call(p),p.display!=null&&s(p.showPopups)===!0){const C=s(p.display);let _;It(C)?_=fe(C):C.requirement!=null?_=fe(C.requirement):_=_i((g=p.requirements)!=null?g:[]),yd.info(f("div",null,[f("h3",null,[T("Treasure earned!")]),f("div",null,[f(_,null,null)])]))}},Object.assign(a,i),$(a,"visibility"),oe(a,"visibility",ke.Visible);const u=a.visibility;a.visibility=aa(()=>{const p=s(a.display);switch(de.msDisplay){default:case Mn.All:return s(u);case Mn.Configurable:return s(a.earned)&&!(p!=null&&typeof p=="object"&&"optionsDisplay"in p)?ke.None:s(u);case Mn.Incomplete:return s(a.earned)?ke.None:s(u);case Mn.None:return ke.None}}),$(a,"display"),$(a,"mark"),$(a,"small"),$(a,"image"),$(a,"style"),$(a,"classes"),$(a,"showPopups"),oe(a,"showPopups",!0);for(const p of t)(v=p.postConstruct)==null||v.call(p,a);const l=t.reduce((p,b)=>{var g;return Object.assign(p,(g=b.getGatheredProps)==null?void 0:g.call(b,a))},{});if(a[ft]=function(){const{visibility:p,display:b,requirements:g,earned:C,image:_,style:x,classes:E,mark:S,small:D,id:B}=this;return{visibility:p,display:b,requirements:g,earned:C,image:_,style:s(x),classes:E,mark:S,small:D,id:B,...l}},a.requirements){const p=a,b=[Xi(p),md(()=>!p.earned.value),...At(a.requirements)?a.requirements:[a.requirements]];St(()=>{de.active===Q.id&&wi(b)&&p.complete()})}return a})}et.on("loadSettings",e=>{oe(e,"msDisplay",Mn.All)});const Nd=Object.values(Mn).map(e=>({label:at(e),value:e}));ms(K(()=>f(Hi,{title:K(()=>f("span",{class:"option-title"},[T("Show achievements"),f("desc",null,[T("Select which achievements to display based on criterias.")])])),options:Nd,"onUpdate:modelValue":e=>de.msDisplay=e,modelValue:de.msDisplay},null)));const Cd=J({props:{progress:{type:q(String,Object,Number),required:!0},width:{type:q(Number),required:!0},height:{type:q(Number),required:!0},direction:{type:q(String),required:!0},display:q(Object,String,Function),visibility:{type:q(Number,Boolean),required:!0},style:q(Object,String,Array),classes:q(Object),borderStyle:q(Object,String,Array),textStyle:q(Object,String,Array),baseStyle:q(Object,String,Array),fillStyle:q(Object,String,Array),mark:q(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Yn,Node:Jn},setup(e){const{progress:t,width:n,height:i,direction:r,display:a}=Te(e),u=w(()=>{let d=t.value instanceof o?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),l=w(()=>{const d={width:$e(n)+.5+"px",height:$e(i)+.5+"px"};switch(s(r)){case H.Up:d.clipPath=`inset(${u.value}% 0% 0% 0%)`,d.width=$e(n)+1+"px";break;case H.Down:d.clipPath=`inset(0% 0% ${u.value}% 0%)`,d.width=$e(n)+1+"px";break;case H.Right:d.clipPath=`inset(0% ${u.value}% 0% 0%)`;break;case H.Left:d.clipPath=`inset(0% 0% 0% ${u.value} + '%)`;break;case H.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),c=En(a);return{normalizedProgress:u,barStyle:l,component:c,unref:s,Visibility:ke,isVisible:We,isHidden:vn}}});function kd(e,t,n,i,r,a){var c,d,v,p,b,g,C;const u=kt("MarkNode"),l=kt("Node");return e.isVisible(e.visibility)?(M(),A("div",{key:0,style:Le([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:_e({bar:!0,...e.unref(e.classes)})},[N("div",{class:"overlayTextContainer border",style:Le([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(M(),A("span",{key:0,class:"overlayText",style:Le(e.unref(e.textStyle))},[(M(),ne(Qe(e.component)))],4)):G("",!0)],4),N("div",{class:"border",style:Le([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(v=e.unref(e.style))!=null?v:{},(p=e.unref(e.baseStyle))!=null?p:{},(b=e.unref(e.borderStyle))!=null?b:{}])},[N("div",{class:"fill",style:Le([e.barStyle,(g=e.unref(e.style))!=null?g:{},(C=e.unref(e.fillStyle))!=null?C:{}])},null,4)],4),f(u,{mark:e.unref(e.mark)},null,8,["mark"]),f(l,{id:e.id},null,8,["id"])],6)):G("",!0)}var Md=ve(Cd,[["render",kd],["__scopeId","data-v-6bd06b56"]]);const Sd=Symbol("Bar");function Id(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return tt(i=>{var u,l;const r=e.call(i,i);r.id=tn("bar-"),r.type=Sd,r[bt]=Md;for(const c of t)(u=c.preConstruct)==null||u.call(c,r);Object.assign(r,n),$(r,"visibility"),oe(r,"visibility",ke.Visible),$(r,"width"),$(r,"height"),$(r,"direction"),$(r,"style"),$(r,"classes"),$(r,"borderStyle"),$(r,"baseStyle"),$(r,"textStyle"),$(r,"fillStyle"),$(r,"progress"),$(r,"display"),$(r,"mark");for(const c of t)(l=c.postConstruct)==null||l.call(c,r);const a=t.reduce((c,d)=>{var v;return Object.assign(c,(v=d.getGatheredProps)==null?void 0:v.call(d,r))},{});return r[ft]=function(){const{progress:c,width:d,height:v,direction:p,display:b,visibility:g,style:C,classes:_,borderStyle:x,textStyle:E,baseStyle:S,fillStyle:D,mark:B,id:le}=this;return{progress:c,width:d,height:v,direction:p,display:b,visibility:g,style:s(C),classes:_,borderStyle:x,textStyle:E,baseStyle:S,fillStyle:D,mark:B,id:le,...a}},r})}function xd(e,...t){return tt(n=>{var r,a;const i=e.call(n,n);for(const u of t)(r=u.preConstruct)==null||r.call(u,i);i.formula=i.formula(m.variable(i.baseResource)),i.currentGain==null&&(i.currentGain=w(()=>{let u=o.floor(i.formula.evaluate(i.baseResource.value)).max(0);return s(i.buyMax)===!1&&(u=u.min(1)),u})),i.actualGain==null&&(i.actualGain=i.currentGain),i.currentAt==null&&(i.currentAt=w(()=>i.formula.invert(o.floor(s(i.currentGain))))),i.nextAt==null&&(i.nextAt=w(()=>i.formula.invert(o.floor(s(i.currentGain)).add(1)))),i.convert==null&&(i.convert=function(){var l;const u=s(i.currentGain);i.gainResource.value=o.add(i.gainResource.value,u),i.spend(u),(l=i.onConvert)==null||l.call(i,u)}),i.spend==null&&(i.spend=function(){i.baseResource.value=0}),$(i,"currentGain"),$(i,"actualGain"),$(i,"currentAt"),$(i,"nextAt"),$(i,"buyMax"),oe(i,"buyMax",!0);for(const u of t)(a=u.postConstruct)==null||a.call(u,i);return i})}function $d(e){return xd(e)}function Ed(e,t,n=1,i=o.dInf){const r=we(n),a=we(i);e.on("preUpdate",u=>{const l=s(r);o.neq(l,0)&&(t.gainResource.value=o.add(t.gainResource.value,o.times(l,u).times(o.ceil(s(t.actualGain)))).min(s(a)).max(t.gainResource.value))})}const Pd={postConstruct(e){e.amount===void 0&&console.error(`Decorated feature ${e.id} does not contain the required 'amount' property"`),$(e,"bonusAmount"),e.totalAmount===void 0&&(e.totalAmount=w(()=>{var t;return o.add(s((t=e.amount)!=null?t:0),s(e.bonusAmount))}))}},Hr=Symbol("Repeatable");function ur(e,...t){const n=dt(0),i=t.reduce((r,a)=>{var u;return Object.assign(r,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return tt(r=>{var b,g,C;const a=e.call(r,r);a.id=tn("repeatable-"),a.type=Hr,a[bt]=zr;for(const _ of t)(b=_.preConstruct)==null||b.call(_,a);a.amount=n,a.amount[en]=(g=a.initialAmount)!=null?g:0,Object.assign(a,i);const u={requirementMet:w(()=>o.sub(s(a.limit),a.amount.value)),requiresPay:!1,visibility:ke.None,canMaximize:!0},l=Xi(a);At(a.requirements)?(a.requirements.unshift(l),a.requirements.push(u)):a.requirements=[l,a.requirements,u],a.maxed=w(()=>o.gte(a.amount.value,s(a.limit))),$(a,"classes");const c=a.classes;a.classes=w(()=>{const _=s(c)||{};return a.maxed.value&&(_.bought=!0),_}),a.amountToIncrease=w(()=>o.clampMin(Ur(a.requirements),1)),a.canClick=w(()=>wi(a.requirements));const d=a.onClick;a.onClick=function(_){var S;const x=a;if(!s(x.canClick))return;const E=(S=s(a.amountToIncrease))!=null?S:1;Wr(a.requirements,E),x.amount.value=o.add(x.amount.value,E),d==null||d(_)},$(a,"display");const v=a.display;a.display=K(()=>{var x,E,S;const _=s(v);if(It(_)){const D=fe(_);return f(D,null,null)}if(_!=null){const D=a,B=fe((x=_.title)!=null?x:"","h3"),le=fe((E=_.description)!=null?E:""),ue=fe((S=_.effectDisplay)!=null?S:"");return f("span",null,[_.title==null?null:f("div",null,[f(B,null,null)]),_.description==null?null:f(le,null,null),_.showAmount===!1?null:f("div",null,[f("br",null,null),f(re,null,[T("Amount: "),pt(D.amount.value)]),o.isFinite(s(D.limit))?f(re,null,[T(" / "),pt(s(D.limit))]):void 0]),_.effectDisplay==null?null:f("div",null,[f("br",null,null),T("Currently: "),f(ue,null,null)]),D.maxed.value?null:f("div",null,[f("br",null,null),_i(D.requirements,s(a.amountToIncrease))])])}return""}),$(a,"visibility"),oe(a,"visibility",ke.Visible),$(a,"limit"),oe(a,"limit",o.dInf),$(a,"style"),$(a,"mark"),$(a,"small");for(const _ of t)(C=_.postConstruct)==null||C.call(_,a);const p=t.reduce((_,x)=>{var E;return Object.assign(_,(E=x.getGatheredProps)==null?void 0:E.call(x,a))},{});return a[ft]=function(){const{display:_,visibility:x,style:E,classes:S,onClick:D,canClick:B,small:le,mark:ue,id:te}=this;return{display:_,visibility:x,style:s(E),classes:S,onClick:D,canClick:B,small:le,mark:ue,id:te,...p}},a})}const Td=Symbol("Reset");function Dd(e){return tt(t=>{const n=e.call(t,t);return n.id=tn("reset-"),n.type=Td,n.reset=function(){var r;const i=a=>{if(a!=null&&typeof a=="object"&&!(a instanceof o)&&!(a instanceof m)){if(Xn in a&&a[Xn]===!0)return;if(en in a){const u=a;u.value=u[en]}else!(a instanceof o)&&!Fe(a)&&Object.values(a).forEach(u=>i(u))}};s(n.thingsToReset).forEach(i),et.emit("reset",n),(r=n.onReset)==null||r.call(n)},$(n,"thingsToReset"),n})}const ai={};et.on("removeLayer",e=>{var t;(t=ai[e.id])==null||t.call(ai),ai[e.id]=void 0});function Di(e,t){return $(t,"display"),$(t,"classes"),$(t,"style"),$(t,"direction"),oe(t,"direction",H.Up),$(t,"xoffset"),$(t,"yoffset"),t.pinnable&&(t.pinned=dt(!1,!1)),zt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,Tr(t.pinned)):e.pinned=t.pinned);const n=e[bt];e[bt]=Re;const i=e[ft].bind(e);e[ft]=function(){const{display:a,classes:u,style:l,direction:c,xoffset:d,yoffset:v,pinned:p}=this;return{element:{[bt]:n,[ft]:i},display:a,classes:u,style:s(l),direction:c,xoffset:d,yoffset:v,pinned:p}}.bind(t)}),t}var Ad=J({props:{display:{type:q(String,Object,Function),required:!0},visibility:{type:q(Number,Boolean),required:!0},style:q(String,Object,Array),classes:q(Object),requirements:{type:Object,required:!0},canPurchase:{type:q(Boolean),required:!0},bought:{type:q(Boolean),required:!0},mark:q(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:Jn,MarkNode:Yn},setup(e){const{display:t,requirements:n,bought:i}=Te(e),r=vt("");return St(()=>{const a=$e(t);if(a==null){r.value="";return}if(It(a)){r.value=fe(a);return}const u=fe(a.title||"","h3"),l=fe(a.description,"div"),c=fe(a.effectDisplay||"");r.value=fe(K(()=>f("span",null,[a.title!=null?f("div",null,[f(u,null,null)]):null,f(l,null,null),a.effectDisplay!=null?f("div",null,[T("Currently: "),f(c,null,null)]):null,i.value?null:f(re,null,[f("br",null,null),_i(n.value)])])))}),{component:r,unref:s,Visibility:ke,isVisible:We,isHidden:vn}}});const Rd=["disabled"];function Fd(e,t,n,i,r,a){var c;const u=kt("MarkNode"),l=kt("Node");return e.isVisible(e.visibility)?(M(),A("button",{key:0,style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...d)=>e.purchase&&e.purchase(...d)),class:_e({feature:!0,upgrade:!0,can:e.unref(e.canPurchase),locked:!e.unref(e.canPurchase),bought:e.unref(e.bought),...e.unref(e.classes)}),disabled:!e.unref(e.canPurchase)},[e.unref(e.component)?(M(),ne(Qe(e.unref(e.component)),{key:0})):G("",!0),f(u,{mark:e.unref(e.mark)},null,8,["mark"]),f(l,{id:e.id},null,8,["id"])],14,Rd)):G("",!0)}var Od=ve(Ad,[["render",Fd],["__scopeId","data-v-9be6bac0"]]);const Yi=Symbol("Upgrade");function cr(e,...t){const n=dt(!1,!1),i=t.reduce((r,a)=>{var u;return Object.assign(r,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return tt(r=>{var c,d;const a=e.call(r,r);a.id=tn("upgrade-"),a.type=Yi,a[bt]=Od;for(const v of t)(c=v.preConstruct)==null||c.call(v,a);a.bought=n,Object.assign(a,i),a.canPurchase=w(()=>!n.value&&wi(a.requirements)),a.purchase=function(){var p;const v=a;!s(v.canPurchase)||(Wr(a.requirements),n.value=!0,(p=v.onPurchase)==null||p.call(v))};const u=Xi(a);At(a.requirements)?a.requirements.unshift(u):a.requirements=[u,a.requirements],$(a,"visibility"),oe(a,"visibility",ke.Visible),$(a,"classes"),$(a,"style"),$(a,"display"),$(a,"mark");for(const v of t)(d=v.postConstruct)==null||d.call(v,a);const l=t.reduce((v,p)=>{var b;return Object.assign(v,(b=p.getGatheredProps)==null?void 0:b.call(p,a))},{});return a[ft]=function(){const{display:v,visibility:p,style:b,classes:g,requirements:C,canPurchase:_,bought:x,mark:E,id:S,purchase:D}=this;return{display:v,visibility:p,style:s(b),classes:g,requirements:C,canPurchase:_,bought:x,mark:E,id:S,purchase:D,...l}},a})}function qd(e,t,n=[]){n=n.length===0?Hn(e,Yi):n;const i=Un(t)?w(t):t;e.on("update",()=>{s(i)&&n.forEach(r=>r.purchase())})}function Vd(e,t,n,i){return function(){e>>>=0,t>>>=0,n>>>=0,i>>>=0;let r=e+t|0;return e=t^t>>>9,t=n+(n<<3)|0,n=n<<21|n>>>11,i=i+1|0,r=r+i|0,n=n+r|0,(r>>>0)/4294967296}}const Bd={1:["b","c","d","f","g","h","i","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z"],2:["a","e","o","u"],3:["br","cr","dr","fr","gr","pr","str","tr","bl","cl","fl","gl","pl","sl","sc","sk","sm","sn","sp","st","sw","ch","sh","th","wh"],4:["ae","ai","ao","au","a","ay","ea","ei","eo","eu","e","ey","ua","ue","ui","uo","u","uy","ia","ie","iu","io","iy","oa","oe","ou","oi","o","oy"],5:["turn","ter","nus","rus","tania","hiri","hines","gawa","nides","carro","rilia","stea","lia","lea","ria","nov","phus","mia","nerth","wei","ruta","tov","zuno","vis","lara","nia","liv","tera","gantu","yama","tune","ter","nus","cury","bos","pra","thea","nope","tis","clite"],6:["una","ion","iea","iri","illes","ides","agua","olla","inda","eshan","oria","ilia","erth","arth","orth","oth","illon","ichi","ov","arvis","ara","ars","yke","yria","onoe","ippe","osie","one","ore","ade","adus","urn","ypso","ora","iuq","orix","apus","ion","eon","eron","ao","omia"]},dr=[[1,2,5],[2,3,6],[3,4,5],[4,3,6],[3,4,2,5],[2,1,3,6],[3,4,2,5],[4,3,1,6],[3,4,1,4,5],[4,1,4,3,6]];function Ai(e){const t=dr[Math.floor(e()*dr.length)];let n="";for(let i=0;in-n*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}const fr=mi();function Zr(e,t,n,i){return Gi(e,function(){const r=Vd(0,n>>0,n>>32,1);for(let V=0;V<12;V++)r();const a=Ai(r),u=qn([.64,.75,.55],r),l=qn([.18,.2,.25],r),c=kn(0,Ai(r)),d=dt(0),v=Vt.indexOf(t);let p=r();const b=i.reduce((V,j)=>(V[j.type]=j.data,V),{});"increaseDiff"in b&&(p=p/2+.5),"decreaseDiff"in b&&(p=p/2),"relic"in b&&(p=1);const g=p+v+1,C=h.toolNodes.value.sandRelic!=null?ee("sandRelic")?2:1:0,_=dt(C),x=w(()=>("increaseRewards"in b?g+1:g)+_.value);let E="relic"in b?v+2:Math.ceil(r()*(v+2));"increaseLength"in b&&E++;const S=[],D=wt(()=>S),B=w(()=>D.apply(0)),le=[],ue={};function te({feature:V,canClick:j,modifier:xe,cost:it,previewModifier:_n,showETA:ze,previewCost:$t}){j=we(j),ze=we(ze);const Ot=or(V);le.push({shouldShowPreview:w(()=>s(j)&&Ot.value),modifier:wt(()=>{const Et=S.slice();return Et.splice(Et.indexOf(xe),1,_n),Et}),cost:$t!=null?$t:it}),S.push(xe);const qt=Pi(c,B,()=>Me(it)),st=Di(V,{display:ze==null?qt:()=>s(ze)?qt.value:"",direction:H.Down});return{isHovering:Ot,eta:qt,tooltip:st}}const X=[],Se=U(0);let L=m.variable(Se).times(0),ae=0,De=!0;const Xe=w(()=>o.add(g,r()-.5).pow_base(2).times(10).times(L.evaluate())),Ht=[];for(let V=0;V=E-1?0:4};switch(si(j,r)){case"upgrades":const F=[];for(let O=0;O<4;O++){const Ae=si({add:1,mult:V===0&&O===0?0:1},r),qe=Xe.value,Ge=Cn(r);let Ve="",Ye,ge;switch(Ae){case"add":{const ce=o.add(qe,10).pow(r()/4+1);Ve=`Gain ${Ie(ce)} ${c.displayName}/s`,L=L.add(ce),Ye=rt=>Lt(()=>({addend:ce,description:Ge,enabled:rt==null?he.bought:()=>rt()&&he.bought.value})),ge=Lt(()=>({addend:ce}));break}case"mult":{const ce=r()*5+1;Ve=`Multiply previous ${c.displayName} gain by x${Ie(ce)}.`;const rt=ae;L=L.add(o.sub(ce,1).times(rt)),Ye=He=>Ce(()=>({multiplier:ce,description:Ge,enabled:He==null?he.bought:()=>He()&&he.bought.value})),ge=Ce(()=>({multiplier:ce}));break}}ae=L.evaluate(),Se.value++;const Pe=De,he=cr(()=>({requirements:On(()=>({resource:Nn(c),cost:qe,requiresPay:()=>h.toolNodes.value.unobtainiumRelic==null})),display:{title:Ge,description:Ve},visibility:Pe}));te({feature:he,canClick:()=>he.canPurchase.value,modifier:Ye(),cost:qe,previewCost:w(()=>h.toolNodes.value.unobtainiumRelic==null?qe:0),showETA:()=>!he.bought.value,previewModifier:ge}),S.push(Ye(()=>Ae==="add"?h.toolNodes.value.stoneRelic!=null:ee("stoneRelic"))),F.push(he)}X.push(F);break;case"repeatables":const z=[];for(let O=0;O<3;O++){const Ae=si({add:1.5,mult:3},r),qe=Se.value,Ge=Xe.value,Ve=Cn(r);let Ye="",ge,Pe,he,ce;const rt=m.variable(w(()=>se.amount.value)).times(2);switch(Ae){case"add":{const Ze=o.add(Ge,10).times(r()+.5);Ye=`Gain ${Ie(Ze)} ${c.displayName}/s`,ce=rt.add(1).times(Ge),L=L.add(w(()=>o.sub(Se.value,qe).times(2).add(1).pow(2).clampMax(100).times(Ze))),ge=w(()=>Ie(o.times(Ze,s(se.totalAmount)))+"/s"),Pe=Lt(()=>({addend:()=>o.times(Ze,s(se.totalAmount)),description:Ve,enabled:()=>o.gt(s(se.totalAmount),0)})),he=Lt(()=>({addend:()=>o.add(s(se.totalAmount),se.amountToIncrease.value).times(Ze)}));break}case"mult":{const Ze=r()*.75+1.25;Ye=`Multiply previous ${c.displayName} gain by x${Ie(Ze)}.`,ce=rt.add(1).times(Ge);const ot=ae;L=L.add(w(()=>o.sub(Se.value,qe).times(2).add(1).pow(2).clampMax(100).pow_base(Ze).sub(1).times(ot))),ge=w(()=>"x"+Ie(o.pow(Ze,s(se.totalAmount)))),Pe=Ce(()=>({multiplier:()=>o.pow(Ze,s(se.totalAmount)),description:Ve,enabled:()=>o.gt(s(se.totalAmount),0)})),he=Ce(()=>({multiplier:()=>o.add(s(se.totalAmount),se.amountToIncrease.value).pow_base(Ze)}));break}}ae=L.evaluate(),Se.value++;const He=De,se=ur(()=>({requirements:On(()=>({resource:Nn(c),cost:ce,maxBulkAmount:()=>h.toolNodes.value.diamondRelic!=null?o.dInf:1,requiresPay:()=>h.toolNodes.value.unobtainiumRelic==null})),display:()=>({title:Ve,description:`${Ye}

Amount: ${pt(se.amount.value)}${o.gt(s(se.bonusAmount),0)?` [+${pt(s(se.bonusAmount))}]`:""}`,effectDisplay:s(ge),showAmount:!1}),visibility:He,limit:100,bonusAmount:()=>o.gt(se.amount.value,0)?ee("dirtRelic")?2:h.toolNodes.value.dirtRelic!=null?1:0:0}),Pd);te({feature:se,canClick:()=>s(se.canClick),modifier:Pe,cost:ce,previewModifier:he,previewCost:w(()=>h.toolNodes.value.unobtainiumRelic==null?Jt(ce,se.amountToIncrease.value):0),showETA:()=>!se.maxed.value}),z.push(se)}X.push(z);break;case"conversion":{const O=kn(0,Ai(r)),W=qn([.64,.75,.55],r),Ae=Xe.value,qe=r()/2+.25,Ge=r()/2+.25,Ve=Se.value,Ye=ae;L=L.add(w(()=>o.sub(Se.value,Ve).add(1).times(2).pow10().times(Ye)));const ge=$d(()=>({baseResource:Nn(c),gainResource:O,formula:Ii=>Ii.div(Ae).pow(qe).times(w(()=>h.toolNodes.value.ironRelic!=null?ee("ironRelic")?4:2:1)),spend(){c.value=0}}));ae=L.evaluate(),Se.value+=2;const Pe=De,he=Cn(r),ce=m.variable(O).pow(Ge).add(1),rt=Ce(()=>({multiplier:()=>ce.evaluate(),description:he,enabled:()=>o.gt(O.value,0)})),He=Ce(()=>({multiplier:()=>ce.evaluate(o.add(O.value,ge.actualGain.value))})),se=od(()=>({display:{title:he,description:K(()=>f("span",null,[T("Reset "),c.displayName,T(" for")," ",fi(O,o.clampMin(ge.actualGain.value,1))," ",O.displayName,f("br",null,null),f("div",null,[T("Next:")," ",fi(c,o.lt(ge.actualGain.value,1)?ge.currentAt.value:ge.nextAt.value)," ",c.displayName])]))},style:{width:"200px",minHeight:"100px"},canClick:()=>o.gte(ge.actualGain.value,1),prestigeResource:O,onClick:ge.convert,visibility:Pe})),{isHovering:Ze}=te({feature:se,canClick:()=>s(se.canClick),modifier:rt,cost:Ae,previewCost:c,previewModifier:He}),ot=w(()=>Ze.value&&se.canClick.value);X.push([se]);const Fn=ln(m.variable(O),ot,ge.actualGain),Je=ln(ce,ot,ge.actualGain);ue[V*2]=K(()=>f(re,null,[We(se.visibility)?f("div",{style:"margin: 10px"},[T("You have")," ",f("h2",{style:{color:W,textShadow:`0px 0px 10px ${W}`}},[Fn()])," ",O.displayName,T(","),f("br",null,null),T("providing a "),Je(),T("x multiplier to previous")," ",c.displayName,T(" gain")]):null,Ei(se)])),Ed(this,ge,()=>nt.value.lengthJt(ge,Pe.value,!0,10)),ce=w(()=>Jt(ge,o.add(Pe.value,1),!0,10)),rt=w(()=>o.pow(Ye,Pe.value)),He=Ce(()=>({multiplier:rt,description:qe,enabled:()=>We(ot.visibility)})),se=ae;L=L.add(w(()=>o.sub(Se.value,Ae).add(1).times(3).pow(Ye).times(se))),ae=L.evaluate(),Se.value+=3;const Ze=qn([.64,.75,.55],r),ot=Id(()=>({direction:H.Right,width:300,height:20,progress:()=>o.sub(O.value,he.value).div(o.sub(ce.value,he.value)).toNumber(),visibility:W,xp:O,display:K(()=>f("span",null,[Ie(O.value),T("/"),Ie(ce.value)])),fillStyle:`background-color: ${Ze}`,textStyle:"text-shadow: 5px 0 10px black"}));this.on("preUpdate",Fn=>{if(nt.value.lengthJe.state.id===e)&&We(ot.visibility)){let Je=o.times(xt.value,Fn);h.toolNodes.value.goldRelic!=null&&(Je=o.times(ee("goldRelic")?.5:.25,nt.value.length).add(1).times(Je)),O.value=o.add(Je,O.value)}}),S.push(He),X.push([ot]),ue[V*2]=K(()=>f(re,null,[We(ot.visibility)?f("div",{style:"margin: 10px"},[T("You have "),f("h3",null,[qe]),T(" Lv. "),pt(Pe.value),T(","),f("br",null,null),T("providing a "),Ie(rt.value),T("x multiplier to previous")," ",c.displayName,T(" gain"),f("br",null,null)]):null,Ei(ot)]));break}case"dimensions":{const O=Cn(r),W=kn(0,O+" energy"),Ae=qn([.64,.75,.55],r),qe=Se.value,Ge=ae;L=L.add(w(()=>o.sub(Se.value,qe).add(1).pow_base(32).add(1).log2().add(1).times(Ge)));const Ve=w(()=>o.add(W.value,1).log2().add(1)),Ye=Ce(()=>({multiplier:Ve,description:O,enabled:()=>o.gt(W.value,0)}));S.push(Ye);const ge=De,Pe=[];for(let he=0;he<4;he++){const ce=o.add(g,r()-.5).pow_base(2).times(10).recip(),rt=Xe.value,He=m.variable(w(()=>Je.amount.value)),se=He.pow_base(o.pow10(he+1)).times(rt),Ze=["First","Second","Third","Fourth"][he]+" "+O+" Dimension",ot=kn(0,Ze),Fn=He.sub(1).pow_base(2).times(ce).times(w(()=>o.add(Je.amount.value,ot.value))),Je=ur(()=>({display:{title:Ze,description:K(()=>f("div",null,[f("div",null,[T("Amount:")," ",Ie(o.add(ot.value,Je.amount.value))," ",T("["),pt(Je.amount.value),T("]")])])),effectDisplay:K(()=>f("span",null,[Yr()," ",he===0?W.displayName:["First","Second","Third","Fourth"][he-1]+" "+O+" Dimension",T("/s")])),showAmount:!1},style:{width:"400px"},effect:Fn,dimensions:ot,limit:100,energy:he===0?W:void 0,requirements:On(()=>({resource:Nn(c),cost:se,maxBulkAmount:()=>ee("diamondRelic")!=null?o.dInf:1,requiresPay:()=>!ee("unobtainiumRelic")})),visibility:ge}));Pe.push(Je);const Ii=or(Je),Ki=w(()=>s(Je.canClick)&&Ii.value),Xr=new m({inputs:[He],evaluate(Qi){return o.sub(Qi,1).pow_base(2).times(ce).times(o.add(Qi,ot.value))}}),Yr=ln(Xr,Ki);le.push({shouldShowPreview:Ki,cost:w(()=>ee("unobtainiumRelic")?0:Jt(se,Je.amountToIncrease.value))});const Jr=Pi(c,B,()=>Me(se));Di(Je,{display:Jr,direction:H.Down}),ae=L.evaluate(),Se.value++}this.on("preUpdate",he=>{if(nt.value.lengthce.state.id===e)&&We(ge)){let ce=o.times(xt.value,he);h.toolNodes.value.platinumRelic!=null&&(ce=o.times(ee("platinumRelic")?4:2,ce));const rt=Pe[0].effect.evaluate();W.value=o.times(rt,ce).add(W.value);for(let He=1;He<4;He++){const se=Pe[He].effect.evaluate();Pe[He-1].dimensions.value=o.times(se,ce).add(Pe[He-1].dimensions.value)}}}),X.push(Pe),ue[V*2]=K(()=>f(re,null,[We(ge)?f("div",{style:"margin: 10px"},[T("You have")," ",f("h2",{style:{color:Ae,textShadow:`0px 0px 10px ${Ae}`}},[Ie(W.value)])," ",W.displayName,T(","),f("br",null,null),T("providing a "),Ie(Ve.value),T("x multiplier to previous")," ",c.displayName,T(" gain")]):null,Ns(...Pe)]));break}case"prestige":{const O=Cn(r),W=De,Ae=r()/10+1.1,qe=Xe.value;L=L.pow(Ae);const Ge=Xc(()=>({exponent:Ae,description:O,enabled:ge.bought}));ae=L.evaluate(),Se.value+=20;const Ve=X.filter((he,ce)=>ce%2===0),Ye=Dd(()=>({thingsToReset:Ve,onReset(){c.value=0}})),ge=cr(()=>({display:{title:O,description:`Reset all previous ${a} content to raise all previous ${c.displayName} gain to the ^${Ie(Ae)}`},style:{width:"200px",minHeight:"100px"},onPurchase:()=>{ee("unobtainiumRelic")||Ye.reset()},visibility:W,requirements:On(()=>({resource:Nn(c),cost:qe,requiresPay:!1}))})),Pe=Ce(()=>({multiplier:0}));te({feature:ge,canClick:()=>s(ge.canPurchase),modifier:Ge,cost:qe,previewCost:w(()=>ee("unobtainiumRelic")?0:c.value),previewModifier:Pe,showETA:()=>!s(ge.bought)}),X.push([ge]);break}}const it={cache:"increaseCaches"in b?10:1,generation:"increaseGens"in b?10:1,resourceMulti:"increaseResourceMults"in b?10:1,energyMulti:"increaseEnergyMults"in b?2.5:.25,influences:Object.keys(h.influenceNodes.value).length+Ht.length===Object.keys(_t).length?0:"increaseInfluences"in b?20:2,relic:0};let _n=si(it,r);V===E-1&&"relic"in b&&(_n="relic");let ze="",$t,Ot,qt,st,Et,rn;switch(_n){case"cache":st=Ri(r,i),ze=`Gain ${Ie(o.div(x.value,12))}x your current ${st} (no modifiers).`,Ot=()=>{var O,W,Ae;return h.grantResource(st,o.times((Ae=(W=(O=h.resourceNodes.value[st])==null?void 0:O.state)==null?void 0:W.amount)!=null?Ae:0,o.div(x.value,12)))};break;case"generation":st=Ri(r,i);const F=o.div(x.value,40).times(Mt[st]);ze=`Gain ${Ie(F)} ${st}/s while plane is active.`,$t=O=>h.grantResource(st,o.times(O,F)),qt=w(()=>h.resourceNodes.value[st]);break;case"resourceMulti":Et=st=Ri(r,i),rn=o.div(x.value,10).pow_base(2),ze=`Gain ${Ie(rn)}x ${st} while plane is active.`;break;case"energyMulti":Et="energy",rn=o.div(x.value,8).add(1),ze=`Gain ${Ie(rn)}x energy while plane is active.`;break;case"influences":const z=Object.keys(_t)[Math.floor(r()*Object.keys(_t).length)];Ht.push(z),ze=`Gain a new portal influence (${_t[z].display})`,Ot=()=>{if(z in h.influenceNodes.value){fr.warning(`Error: ignoring duplicate portal influence (${_t[z].display})`);return}const O={id:$n(h.board),position:{...h.board.types.portal.nodes.value.find(W=>W.state.id===e).position},type:"influence",state:{type:z,data:_t[z].initialData}};h.board.placeInAvailableSpace(O),h.board.nodes.value.push(O)};break;case"relic":ze=t==="ultimatum"?"Win the game!":`Gain the ${t}-tier planar relic (${Pt[t]})`,Ot=()=>{if(t==="ultimatum"){Ji.value=!0;return}if(`${t}Relic`in h.toolNodes.value)fr.warning(`Error: ignoring duplicate relic (${Pt[t]})`);else{const O={id:$n(h.board),position:{...h.board.types.portal.nodes.value.find(W=>W.state.id===e).position},type:"passive",state:`${t}Relic`};h.board.placeInAvailableSpace(O),h.board.nodes.value.push(O)}}}const ii=De,Rn=Xe.value,I=_d(()=>({requirements:On(()=>({resource:Nn(c),cost:Rn})),visibility:ii,display:{requirement:`${Ie(Rn)} ${c.displayName}`,effectDisplay:ze},style:"width: 100%",classes:{final:V===E-1},update:$t,onComplete:Ot,link:qt,effectedResource:Et,resourceMulti:rn})),P=Pi(c,B,Rn);Di(I,{display:()=>I.earned.value?"":P.value,direction:H.Down}),X.push([I]),De=w(()=>I.earned.value)}const ut=Hn(X,Yi),Tn=Hn(X,Hr);S.push(Ce(()=>({multiplier:()=>ee("silver")?4:2,description:()=>(ee("silver")?"Empowered ":"")+Be.silver.name,enabled:()=>h.toolNodes.value.silver!=null})),Ce(()=>({multiplier:()=>o.add(1,(ee("diamond")?2:1)*ut.filter(V=>V.bought.value).length/10),description:()=>(ee("diamond")?"Empowered ":"")+Be.diamond.name,enabled:()=>h.toolNodes.value.diamond!=null})),Ce(()=>({multiplier:()=>o.div(d.value,6e3).times(ee("emerald")?2:1).add(1),description:()=>(ee("emerald")?"Empowered ":"")+Be.emerald.name,enabled:()=>h.toolNodes.value.emerald!=null})),Ce(()=>({multiplier:()=>o.div(Tn.reduce((V,j)=>V.add(s(j.totalAmount)),o.dZero),100).times(ee("gravelRelic")?2:1).add(1).pow(.75),description:()=>(ee("gravelRelic")?"Empowered ":"")+Pt.gravel,enabled:()=>h.toolNodes.value.gravelRelic!=null})),Ce(()=>({multiplier:()=>o.add(h.energy.value,1).log10().add(1).pow(ee("beryliumRelic")?.5:.25),description:()=>(ee("beryliumRelic")?"Empowered ":"")+Pt.berylium,enabled:()=>h.toolNodes.value.beryliumRelic!=null})));const yn=wt(()=>[Ce(()=>({multiplier:()=>{var V,j,xe;return o.add((xe=(j=(V=h.board.types.booster.nodes.value[0])==null?void 0:V.state)==null?void 0:j.level)!=null?xe:0,1)},description:"Booster",enabled:()=>{var V,j,xe;return(xe=(j=(V=h.board.types.booster.nodes.value[0])==null?void 0:V.state)==null?void 0:j.portals.includes(e))!=null?xe:!1}})),Ce(()=>({multiplier:()=>o.times(ee("coalRelic")?.2:.1,nt.value.length).add(1),description:()=>(ee("coalRelic")?"Empowered ":"")+Pt.coal,enabled:()=>h.toolNodes.value.coalRelic!=null}))]),xt=w(()=>yn.apply(1)),[Ci,Qn]=jn(()=>[{title:`${at(c.displayName)} Gain`,modifier:D,base:0,unit:"/s"},{title:`${at(c.displayName)} Time Speed`,modifier:yn,base:1,visible:()=>o.gt(xt.value,1)}]),wn=U(!1),ei=K(()=>f(Ut,{modelValue:wn.value,"onUpdate:modelValue":V=>wn.value=V},{header:()=>f("h2",null,[T("Modifiers")]),body:()=>lt(Ci)}));this.on("preUpdate",V=>{if(!h.activePortals.value.some(xe=>xe.state.id===e))return;const j=o.times(xt.value,V);d.value=o.add(d.value,j),nt.value.length{var it;(it=xe.update)==null||it.call(xe,j)})}),qd(this,()=>nt.value.lengthnt.value.length{const V=le.find(j=>j.shouldShowPreview.value);return V?o.neg(Me(V.cost)):0}),Ft=w(()=>{const V=le.find(j=>j.shouldShowPreview.value);return V&&V.modifier?o.sub(V.modifier.apply(0),B.value):0}),An=ln(m.variable(0).add(c),()=>o.neq(Dn.value,0),Dn),ti=ln(m.variable(0).add(B),()=>o.neq(Ft.value,0),Ft),ni=w(()=>{const V=[];return nt.value.forEach(j=>{j.link&&V.push(j.link)}),V}),ki=w(()=>{const V={};return nt.value.forEach(j=>{j.effectedResource!=null&&j.resourceMulti!=null&&(V[j.effectedResource]!=null?V[j.effectedResource]=o.times(V[j.effectedResource],j.resourceMulti):V[j.effectedResource]=j.resourceMulti)}),V}),nt=w(()=>{const V=[];for(let j=1;jo.lt(nt.value.length,E)&&X.some(V=>V.some(j=>"earned"in j&&s(j.earned)||"bought"in j&&s(j.bought)?!1:("canClick"in j&&s(j.canClick)||"canPurchase"in j&&s(j.canPurchase),!0)))),Si=w(()=>{const V=X.findIndex((xe,it)=>it>0&&it%2===0&&!X[it-1][0].earned.value);let j;return V===-1?j=X:j=X.slice(0,V),j.map((xe,it)=>it in ue?lt(ue[it]):Ei(...xe))});return{tier:dt(t),seed:dt(n),influences:dt(i),name:a,color:u,resource:c,background:l,style:{background:l,"--background":l},features:X,resourceTabCollapsed:Qn,links:ni,resourceMultis:ki,earnedTreasures:nt,showNotif:Mi,timeActive:d,bonusRewardsLevel:_,display:K(()=>f(re,null,[f(pi,{class:"nav-container",style:"z-index: 5"},{default:()=>[f("span",{class:"nav-segment"},[f("h2",null,[a])]),f("span",{class:"nav-segment"},[f("h3",null,[t,T("-tier")])]),i.length===0?null:f("span",{class:"nav-segment"},[f(Re,{display:i.map(V=>{const j=_t[V.type].description;return typeof j=="function"?j(V):j}).join("
"),direction:H.Down,style:"width: 300px"},{default:()=>[f("h3",null,[i.length,T(" influences")])]})]),f("span",{class:"nav-segment"},[f("button",{class:"button",style:"display: inline",onClick:()=>wn.value=!0},[T("modifiers")])])]}),f(pi,{class:"nav-container"},{default:()=>[f("span",{class:"nav-segment"},[f("h3",{style:`color: ${u}; text-shadow: 0px 0px 10px ${u};`},[lt(An)])," ",c.displayName]),f("span",{class:"nav-segment"},[T("("),f("h3",{style:`color: ${u}; text-shadow: 0px 0px 10px ${u};`},[o.gt(B.value,0)?"+":"",lt(ti)]),T("/s)")]),o.neq(xt.value,1)?f("span",{class:"nav-segment"},[T("Speed: "),Ie(xt.value),T("x")]):null]}),f(gd,{height:"60px"},null),Si.value,lt(ei)])),minimizedDisplay:K(()=>f("div",null,[f("span",null,[a]),f("span",{style:"font-size: large; vertical-align: sub;"},[" ",nt.value.length,T("/"),E,T(" treasures")])]))}})}function Ri(e,t){t=t.filter(l=>l.type==="increaseResources"||l.type==="decreaseResources");const n=Object.keys(Mt).reduce((l,c)=>{let d=Mt[c];return t.filter(v=>v.data===c).forEach(v=>{v.type==="increaseResources"?d*=1e3:d/=1e3}),l+d},0),i=Object.keys(Mt),r=Math.floor(e()*n);let a=0,u;for(let l=0;ll+c),i=Object.keys(e);let r=0,a=null;const u=t()*n;for(let l=0;le===h.board.selectedNode.value?{text:"Mining"}:Object.keys(h.resourceNodes.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[Rt],progress:e=>Ne(e)?new o(e.state.progress).toNumber():0,progressDisplay:fn.Outline,progressColor:"var(--accent2)",classes:e=>({running:Ne(e)}),draggable:!0},Ud={shape:je.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>e===h.board.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(e){o.gte(h.energy.value,100)&&(e.type="factory",h.energy.value=o.sub(h.energy.value,100))},confirmationLabel:()=>o.gte(h.energy.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},Wd={shape:je.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>{var t,n;if(e===h.board.selectedNode.value)return{text:e.state==null?"Forge - Drag a resource to me!":`Forging ${Be[e.state].name}`};if(((t=h.board.draggingNode.value)==null?void 0:t.type)==="resource"){const i=((n=h.board.draggingNode.value)==null?void 0:n.state).type,r=e.state===i?"Disconnect":h.toolNodes.value[i]==null?Be[i].name:"Already crafted",a=e.state===i||h.toolNodes.value[i]==null?"var(--accent2)":"var(--danger)";return{text:r,color:a}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(e){e.state=void 0,h.board.selectedAction.value=null,h.board.selectedNode.value=null},visibility:e=>e.state!=null},{id:"craft",icon:"done",tooltip:e=>({text:`Forge ${Be[e.state].name} - ${Ke(Be[e.state].cost)} energy`}),onClick(e){const t=Be[e.state];if(o.gte(h.energy.value,t.cost)&&h.toolNodes.value[e.state]==null){h.energy.value=o.sub(h.energy.value,t.cost);const n={id:$n(h.board),position:{...e.position},type:t.type,state:"state"in t?t.state:void 0};if(h.board.placeInAvailableSpace(n),h.board.nodes.value.push(n),e.state==="iron"){const i={id:$n(h.board),position:{...e.position},type:"trashCan"};h.board.placeInAvailableSpace(i),h.board.nodes.value.push(i)}h.board.selectedAction.value=null,h.board.selectedNode.value=null,e.state=void 0}},fillColor:e=>o.gte(h.energy.value,Be[e.state].cost)&&h.toolNodes.value[e.state]==null?"var(--accent2)":"var(--danger)",visibility:e=>e.state!=null,confirmationLabel:e=>o.gte(h.energy.value,Be[e.state].cost)?h.toolNodes.value[e.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:e=>e.state==null||h.toolNodes.value[e.state]!=null?0:o.div(o.sqrt(h.energy.value),o.sqrt(Be[e.state].cost)).clampMax(1).toNumber(),progressDisplay:fn.Fill,progressColor:e=>e.state!=null&&o.gte(h.energy.value,Be[e.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(e,t){var i;if(t.type!=="resource")return!1;const n=((i=h.board.draggingNode.value)==null?void 0:i.state).type;return h.toolNodes.value[n]==null},onDrop(e,t){const n=t.state.type;e.state===n?e.state=void 0:e.state=n,h.board.selectedNode.value=e},draggable:!0},Hd=["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI"],Zd={shape:je.Circle,size:50,title:e=>at(e.state.type)+" ("+Hd[Vt.indexOf(e.state.type)]+")",subtitle:e=>Ke(e.state.amount),progress:e=>Qc(e.state.type),onClick(){},progressDisplay:fn.Outline,progressColor:"var(--accent3)",classes:e=>{var t;return{"affected-node":h.dowsing.value!=null&&Ne(h.dowsing.value)&&h.dowsing.value.state.resources.includes(e.state.type)||o.neq((t=h.planarMultis.value[e.state.type])!=null?t:1,1)}},draggable:!0},Xd={shape:je.Circle,size:50,title:e=>{const t=e.state;return t.includes("Relic")?Pt[t.slice(0,-5)]:Be[t].name},label:e=>e===h.board.selectedNode.value?{text:fd[e.state].description(ee(e.state))}:null,outlineColor:"var(--bought)",classes:e=>({"affected-node":ee(e.state)}),draggable:!0},Yd={shape:je.Diamond,size:50,title:"\u{1F962}",label:e=>e===h.board.selectedNode.value?{text:e.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${e.state.resources.length}/${o.add(e.state.maxConnections,h.computedBonusConnectionsModifier.value)})`}:Br(e,t=>`Double ${t} odds`),actionDistance:Math.PI/4,actions:[nn,bn(e=>e.add(2).pow_base(100),16),Rt],classes:e=>({running:Ne(e)}),canAccept:Lr,onDrop:jr,draggable:!0},Jd={shape:je.Diamond,size:50,title:"\u26CF\uFE0F",label:e=>e===h.board.selectedNode.value?{text:e.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${e.state.resources.length}/${o.add(e.state.maxConnections,h.computedBonusConnectionsModifier.value)})`}:Br(e,t=>`Gather ${ht(o.div(h.dropRates[t].computedModifier.value,100))} ${t}/s`),actionDistance:Math.PI/4,actions:[nn,bn(e=>e.add(2).pow_base(1e4),16),Rt],progress:e=>Ne(e)?o.eq(h.quarryProgressRequired.value,0)?0:new o(e.state.progress).div(h.quarryProgressRequired.value).toNumber():0,progressDisplay:fn.Outline,progressColor:"var(--accent2)",canAccept:Lr,onDrop:jr,classes:e=>({running:Ne(e)}),draggable:!0},Kd={shape:je.Diamond,size:50,title:"\u{1F50C}",label:e=>e===h.board.selectedNode.value?{text:e.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${e.state.tools.length}/${o.add(e.state.maxConnections,h.computedBonusConnectionsModifier.value)})`}:Yc(e,t=>t.includes("Relic")?`Double ${Pt[t.slice(0,-5)]}'s effect`:`Double ${Be[t].name}'s effect`),actionDistance:Math.PI/4,actions:[nn,bn(e=>e.add(3).pow_base(1e3),24),Rt],canAccept:Jc,onDrop:Kc,classes:e=>({running:Ne(e)}),draggable:!0},Qd={shape:je.Diamond,size:50,title:"\u26E9\uFE0F",label:e=>{if(e===h.board.selectedNode.value)return{text:e.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${e.state.tier}-tier portal`};const t=h.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type;return{text:e.state.tier===n?"Disconnect":`${at(n)}-tier Portal`,color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="influence"){const n=t.state.type,{influences:i}=e.state;return i.includes(n)?{text:"Disconnect",color:"var(--accent2)"}:{text:"Add influence",color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="portal")return{text:`Copy tier/influences from ${me[t.state.id].name}`};return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(e){e.state={...e.state,tier:void 0,influences:[]},h.board.selectedAction.value=null,h.board.selectedNode.value=null},visibility:e=>{const{tier:t,influences:n}=e.state;return t!=null||n.length>0}},{id:"makePortal",icon:"done",tooltip:e=>({text:`Spawn ${e.state.tier}-tier portal - ${Ke(h.computedPortalCost.value)} energy`}),fillColor:()=>o.gte(h.energy.value,h.computedPortalCost.value)?"var(--accent2)":"var(--danger)",confirmationLabel:()=>o.gte(h.energy.value,h.computedPortalCost.value)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(e){if(o.lt(h.energy.value,h.computedPortalCost.value))return;let t=0;for(;`portal-${t}`in me;)t++;h.energy.value=o.sub(h.energy.value,h.computedPortalCost.value);const{tier:n,influences:i}=e.state;Ui(Zr(`portal-${t}`,n,Math.floor(Math.random()*4294967296),i.map(a=>h.influenceNodes.value[a].state)),Q);const r={id:$n(h.board),position:{...e.position},type:"portal",state:{id:`portal-${t}`,powered:!1}};h.board.placeInAvailableSpace(r),h.board.nodes.value.push(r),h.board.selectedAction.value=null,h.board.selectedNode.value=null,e.state={tier:void 0,influences:[]}},visibility:e=>e.state.tier!=null}],canAccept(e,t){return t.type==="resource"||t.type==="influence"||t.type==="portal"},onDrop(e,t){if(t.type==="resource"){const n=t.state.type,i=e.state.tier;e.state={...e.state,tier:n===i?void 0:n}}else if(t.type==="influence"){const n=t.state.type,i=e.state.influences;i.includes(n)?e.state={...e.state,influences:i.filter(r=>r!==n)}:e.state={...e.state,influences:[...i,n]}}else if(t.type==="portal"){const n=me[t.state.id];e.state={...e.state,tier:n.tier.value,influences:n.influences.value.map(i=>i.type)}}h.board.selectedNode.value=e},draggable:!0},ep={shape:je.Diamond,size:50,title:"\u{1F300}",label:e=>e===h.board.selectedNode.value?{text:`Portal to ${me[e.state.id].name}`,color:me[e.state.id].color}:null,actionDistance:Math.PI/4,actions:[Rt],classes:e=>({running:Ne(e),showNotif:me[e.state.id].showNotif.value,"affected-node":h.booster.value!=null&&Ne(h.booster.value)&&h.booster.value.state.portals.includes(e.state.id)}),outlineColor:e=>me[e.state.id].background,draggable:!0},tp={shape:e=>e.state.type==="increaseResources"||e.state.type==="decreaseResources"?je.Diamond:je.Circle,size:50,title:e=>_t[e.state.type].display,label:e=>{if(e===h.board.selectedNode.value){const n=e.state,i=_t[n.type].description;return{text:typeof i=="function"?i(n):i}}const t=h.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type,{type:i,data:r}=e.state;let a;if(Array.isArray(r)&&r.includes(n))a="Disconnect";else if(i==="increaseResources")a=`Increase ${at(n)} odds`;else if(i==="decreaseResources")a=`Decrease ${at(n)} odds`;else return null;return{text:a,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[nn],canAccept:(e,t)=>t.type!=="resource"?!1:Array.isArray(e.state.data),onDrop:(e,t)=>{if(t.type!=="resource")return;const n=t.state.type,i=e.state.data;i!=null&&(i.includes(n)?e.state={...e.state,data:i.filter(r=>r!==n)}:e.state={...e.state,data:[...i,n]},h.board.selectedNode.value=e)},outlineColor:"var(--danger)",draggable:!0},np={shape:je.Diamond,size:50,title:"\u231B",label:e=>e===h.board.selectedNode.value?{text:e.state.portals.length===0?"Booster - Drag a portal to me!":`Boosting by ${Ke(o.add(1,e.state.level))}x (${e.state.portals.length}/${o.add(e.state.maxConnections,h.computedBonusConnectionsModifier.value)})`}:hi(e,t=>`Boost ${me[t].name}'s speed`),actionDistance:Math.PI/4,actions:[nn,bn(e=>e.add(6).pow_base(1e3)),{id:"increaseBoost",icon:"arrow_upward",tooltip(e){return{text:`Increase boost - ${Ke(Ti.evaluate(e.state.level))} energy`}},confirmationLabel(e){return o.gte(h.energy.value,Ti.evaluate(e.state.level))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}},onClick(e){const t=Ti.evaluate(e.state.level);o.gte(h.energy.value,t)&&(h.energy.value=o.sub(h.energy.value,t),e.state={...e.state,level:o.add(e.state.level,1)},h.board.selectedAction.value=null)}},Rt],canAccept:bi,onDrop:yi,classes:e=>({running:Ne(e)}),draggable:!0},ip={shape:je.Diamond,size:50,title:"\u{1F916}",label:e=>e===h.board.selectedNode.value?{text:e.state.portals.length===0?"Upgrader - Drag a portal to me!":`Auto-Upgrading (${e.state.portals.length}/${o.add(e.state.maxConnections,h.computedBonusConnectionsModifier.value)})`}:hi(e,t=>`Auto-buy ${me[t].name}'s upgrades and prestiges`),actionDistance:Math.PI/4,actions:[nn,bn(e=>e.add(4).pow_base(1e6)),Rt],canAccept:bi,onDrop:yi,classes:e=>({running:Ne(e)}),draggable:!0},rp={shape:je.Diamond,size:50,title:"\u{1F9BE}",label:e=>e===h.board.selectedNode.value?{text:e.state.portals.length===0?"Automator - Drag a portal to me!":`Automatating (${e.state.portals.length}/${o.add(e.state.maxConnections,h.computedBonusConnectionsModifier.value)})`}:hi(e,t=>`Auto-buy ${me[t].name}'s repeatables and dimensions`),actionDistance:Math.PI/4,actions:[nn,bn(e=>e.add(4).pow_base(1e6)),Rt],canAccept:bi,onDrop:yi,classes:e=>({running:Ne(e)}),draggable:!0},ap={shape:je.Diamond,size:50,title:"\u{1F4B1}",label:e=>e===h.board.selectedNode.value?{text:e.state.portals.length===0?"Investments - Drag a portal to me!":`Investing (${e.state.portals.length}/${o.add(e.state.maxConnections,h.computedBonusConnectionsModifier.value)})`}:hi(e,t=>`Auto-buy ${me[t].name}'s repeatables and dimensions`),actionDistance:Math.PI/4,actions:[nn,bn(e=>e.add(3).pow_base(1e8)),Rt],canAccept:bi,onDrop:yi,classes:e=>({running:Ne(e)}),draggable:!0},sp={shape:je.Diamond,size:50,title:"\u{1F5D1}\uFE0F",label:e=>{var t;if(e===h.board.selectedNode.value)return{text:"Trash Can - Drag a portal to me!"};if(((t=h.board.draggingNode.value)==null?void 0:t.type)==="portal"){const n=h.board.draggingNode.value.state.id;return{text:`Delete ${me[n].name}!`,color:"var(--danger)"}}return null},canAccept:(e,t)=>t.type==="portal",onDrop:(e,t)=>{const n=t.state.id;Wi(me[n]),delete Q.layers[n],h.board.state.value.nodes=h.board.state.value.nodes.filter(i=>i!==t)},draggable:!0},gr=mi(),op={mine:Gd,brokenFactory:Ud,factory:Wd,resource:Zd,passive:Xd,dowsing:Yd,quarry:Jd,empowerer:Kd,portalGenerator:Qd,portal:ep,influence:tp,booster:np,upgrader:ip,automator:rp,investments:ap,trashCan:sp},h=Gi("main",function(){const e=kn(0,"energy"),t=w(()=>g.types.resource.nodes.value.reduce((I,P)=>(I[P.state.type]=P,I),{})),n=w(()=>({...g.types.passive.nodes.value.reduce((I,P)=>(I[P.state]=P,I),{}),sand:g.types.dowsing.nodes.value[0],wood:g.types.quarry.nodes.value[0],coal:g.types.empowerer.nodes.value[0],iron:g.types.portalGenerator.nodes.value[0],gold:g.types.booster.nodes.value[0],platinum:g.types.upgrader.nodes.value[0],berylium:g.types.automator.nodes.value[0],ultimatum:g.types.investments.nodes.value[0]})),i=w(()=>Object.keys(Pt).filter(I=>`${I}Relic`in n.value).length),r=w(()=>({...g.types.influence.nodes.value.reduce((I,P)=>(I[P.state.type]=P,I),{})})),a=w(()=>({...g.types.portal.nodes.value.reduce((I,P)=>(I[P.state.id]=P,I),{})})),u=w(()=>Vt.reduce((I,P)=>{var z,O,W;const F=(W=(O=(z=t.value[P])==null?void 0:z.state)==null?void 0:O.amount)!=null?W:0;return I[P]=o.floor(Fi.invert(F)),I},{})),l=pn({}),c=pn({});zt(()=>{Vt.forEach(I=>{mt(()=>u.value[I],(P,F)=>{const z=o.sub(P,F);o.gt(z,1)&&de.active===Q.id&&gr.info(f("div",null,[f("h3",null,[o.eq(P,1)?`${at(I)} discovered`:`${at(I)} is now Level ${pt(P)}`,T("!")]),o.gt(z,1)?f("div",null,[T("Gained "),pt(z),T(" levels")]):null]))})})});const d=w(()=>X.filter(I=>{var P,F;return(F=(P=I.value)==null?void 0:P.state)==null?void 0:F.powered}).length+g.types.portal.nodes.value.filter(I=>I.state.powered).length),v=w(()=>{let I=d.value;return n.value.copperRelic!=null&&(I--,ee("copperRelic")&&I--),I}),p=w(()=>{const I=v.value;return o.lt(I,0)?0:o.eq(I,0)?10:o.add(I,1).pow_base(100).div(10).times(.99)}),b=w(()=>{if(E.value==null)return 0;let P=E.value.state.resources.reduce((F,z)=>o.div(100,Ft[z].computedModifier.value).add(F),o.dZero);return n.value.silverRelic!=null&&(P=o.div(P,o.add(d.value,1)),ee("silverRelic")&&(P=o.div(P,o.add(d.value,1)))),P}),g=Vc(I=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:op,style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const P=[];if(P.push(...Object.keys(l).map(F=>({startNode:C.value,endNode:t.value[F],stroke:"var(--accent3)",strokeWidth:5}))),_.value!=null&&_.value.state!=null&&P.push({startNode:_.value,endNode:t.value[_.value.state],stroke:"var(--foreground)",strokeWidth:4}),x.value!=null&&x.value.state.resources.forEach(F=>{P.push({startNode:x.value,endNode:t.value[F],stroke:Ne(x.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),E.value!=null&&E.value.state.resources.forEach(F=>{P.push({startNode:E.value,endNode:t.value[F],stroke:"var(--foreground)",strokeWidth:4})}),P.push(...Object.keys(c).map(F=>({startNode:E.value,endNode:t.value[F],stroke:"var(--accent3)",strokeWidth:5}))),S.value!=null&&S.value.state.tools.forEach(F=>{P.push({startNode:S.value,endNode:n.value[F],stroke:Ne(S.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),D.value!=null){const F=D.value.state;F.tier!=null&&P.push({startNode:D.value,endNode:t.value[F.tier],stroke:"var(--foreground)",strokeWidth:4}),F.influences.forEach(z=>{P.push({startNode:D.value,endNode:r.value[z],stroke:"var(--foreground)",strokeWidth:4})}),I.types.portal.nodes.value.forEach(z=>{const O=me[z.state.id];return O.links.value.forEach(W=>{W.value!=null&&P.push({startNode:z,endNode:W.value,stroke:Ne(z)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(O.resourceMultis.value).forEach(W=>{W!=="energy"&&W in t.value&&P.push({startNode:z,endNode:t.value[W],stroke:Ne(z)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),P})}return B.value!=null&&B.value.state.portals.forEach(F=>{P.push({startNode:B.value,endNode:a.value[F],stroke:Ne(B.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),le.value!=null&&le.value.state.portals.forEach(F=>{P.push({startNode:le.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),ue.value!=null&&ue.value.state.portals.forEach(F=>{P.push({startNode:ue.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),te.value!=null&&te.value.state.portals.forEach(F=>{P.push({startNode:te.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),Object.values(r.value).forEach(F=>{const z=F.state;(z.type==="increaseResources"||z.type==="decreaseResources")&&z.data.forEach(O=>{P.push({startNode:F,endNode:t.value[O],stroke:"var(--foreground)",strokeWidth:4})})}),P}})),C=w(()=>g.types.mine.nodes.value[0]),_=w(()=>g.types.factory.nodes.value[0]),x=w(()=>n.value.sand),E=w(()=>n.value.wood),S=w(()=>n.value.coal),D=w(()=>n.value.iron),B=w(()=>n.value.gold),le=w(()=>n.value.platinum),ue=w(()=>n.value.berylium),te=w(()=>n.value.ultimatum),X=[C,x,E,S,B,le,ue,te];function Se(I,P){let F=t.value[I];if(P=o.times(P,An[I].computedModifier.value),F==null)F={id:$n(g),position:{...C.value.position},type:"resource",state:{type:I,amount:P}},g.placeInAvailableSpace(F),g.nodes.value.push(F);else{const z=F.state;F.state={...z,amount:o.add(z.amount,P)}}}const L=w(()=>Object.keys(Mt).reduce((I,P)=>I+new o(Ft[P].computedModifier.value).toNumber(),0)),ae=w(()=>{const I={};return g.types.portal.nodes.value.forEach(P=>{if(!Ne(P))return;const z=me[P.state.id].resourceMultis.value;Object.keys(z).forEach(O=>{I[O]!=null?I[O]=o.times(I[O],z[O]):I[O]=z[O]})}),I}),De=wt(()=>Vt.map(I=>Lt(()=>({description:()=>at(I),addend:()=>u.value[I],enabled:()=>o.gt(u.value[I],0)})))),Xe=w(()=>De.apply(0)),Ht=wt(()=>[Lt(()=>({addend:Xe,description:"Resource Levels"})),Ce(()=>({multiplier:()=>o.pow(Dn.value,Xe.value),description:()=>`${jt(Dn.value,3)}x per Resource Level`})),Ce(()=>({multiplier:()=>ee("stone")?4:2,description:()=>(ee("stone")?"Empowered ":"")+Be.stone.name,enabled:()=>n.value.stone!=null})),Ce(()=>({multiplier:()=>{var I;return(I=ae.value.energy)!=null?I:1},description:"Planar Treasures",enabled:()=>{var I;return o.neq((I=ae.value.energy)!=null?I:1,1)}})),Lt(()=>({addend:()=>o.pow(100,v.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(v.value,0)}))]),ut=w(()=>Ht.apply(0)),Tn=wt(()=>[Lt(()=>({addend:()=>ee("unobtainium")?2:1,description:()=>(ee("unobtainium")?"Empowered ":"")+Be.unobtainium.name,enabled:()=>n.value.unobtainium!=null}))]),yn=w(()=>Tn.apply(0)),xt=wt(()=>[Ce(()=>({multiplier:()=>ee("dirt")?4:2,description:()=>(ee("dirt")?"Empowered ":"")+Be.dirt.name,enabled:()=>n.value.dirt!=null})),Ce(()=>({multiplier:()=>o.pow(i.value,ee("woodRelic")?2:1),description:()=>(ee("woodRelic")?"Empowered ":"")+Pt.wood,enabled:()=>n.value.woodRelic!=null}))]),Ci=w(()=>xt.apply(1)),Qn=wt(()=>[Ce(()=>({multiplier:()=>ee("gravel")?4:2,description:()=>(ee("gravel")?"Empowered ":"")+Be.gravel.name,enabled:()=>n.value.gravel!=null}))]),wn=w(()=>Qn.apply(1)),ei=wt(()=>[Lt(()=>({addend:()=>ee("copper")?.004:.002,description:()=>(ee("copper")?"Empowered ":"")+Be.copper.name,enabled:()=>n.value.copper!=null}))]),Dn=w(()=>ei.apply(1.01)),Ft=Object.keys(Mt).reduce((I,P)=>{const F=wt(()=>[Ce(()=>({multiplier:2,description:"Dowsing",enabled:()=>x.value!=null&&Ne(x.value)&&x.value.state.resources.includes(P)}))]),z=w(()=>F.apply(Mt[P])),O={title:`${at(P)} Drop Rate`,modifier:F,base:Mt[P]};return I[P]={modifier:F,computedModifier:z,section:O},I},{}),An=Object.keys(Mt).reduce((I,P)=>{const F=wt(()=>[Ce(()=>({multiplier:()=>{var W;return(W=ae.value[P])!=null?W:1},description:"Planar Treasures",enabled:()=>{var W;return o.neq((W=ae.value[P])!=null?W:1,1)}}))]),z=w(()=>F.apply(1)),O={title:`${at(P)} Gain`,modifier:F};return I[P]={modifier:F,computedModifier:z,section:O},I},{}),ti=w(()=>{var P,F,z;const I=Vt.indexOf((z=(F=(P=D.value)==null?void 0:P.state)==null?void 0:F.tier)!=null?z:"dirt");return o.add(I,1).times(I).div(2).add(9).pow10()}),ni=wt(()=>[...Object.keys(_t).map(I=>Ce(()=>({multiplier:_t[I].cost,description:_t[I].display,enabled:()=>{var P,F,z;return(z=(F=(P=D.value)==null?void 0:P.state)==null?void 0:F.influences.includes(I))!=null?z:!1},smallerIsBetter:!0}))),Ce(()=>({multiplier:()=>ee("emeraldRelic")?.05:.1,description:()=>(ee("emeraldRelic")?"Empowered ":"")+Pt.emerald,enabled:()=>n.value.emeraldRelic!=null,smallerIsBetter:!0}))]),ki=w(()=>ni.apply(ti.value)),[nt,Mi]=jn(()=>[{title:"Resource Levels",modifier:De,base:0},{title:"Energy Gain",modifier:Ht,base:0,unit:"/s"},{title:"Portal Cost",modifier:ni,base:ti,unit:" energy",baseText:()=>{var I,P,F;return`${at((F=(P=(I=D.value)==null?void 0:I.state)==null?void 0:P.tier)!=null?F:"dirt")}-tier Base Cost`},visible:()=>D.value!=null,smallerIsBetter:!0},{title:"Bonus Connections",modifier:Tn,base:0,visible:()=>o.gt(yn.value,0)}]),[Si,V]=jn(()=>[{title:"Mining Speed",modifier:xt,base:1,unit:"/s",visible:()=>n.value.dirt!=null},{title:"Ore Dropped",modifier:Qn,base:1,visible:()=>n.value.gravel!=null},{title:"Material Level Effect",modifier:ei,base:1.01,visible:()=>n.value.copper!=null}]),[j,xe]=jn(()=>Object.values(Ft).map(I=>I.section)),[it,_n]=jn(()=>Object.values(An).map(I=>I.section)),ze=Zc({general:()=>({display:"General",glowColor(){return ze.activeTab.value===this.tab?"white":""},tab:nt,energyTabCollapsed:Mi}),mining:()=>({display:"Mine",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(n.value).length>0,tab:Si,miningTabCollapsed:V}),resources:()=>({display:"Mine Rates",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>x.value!=null,tab:j,resourcesCollapsed:xe}),resourcesGain:()=>({display:"Resource Gain",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(An).some(I=>o.neq(I.computedModifier.value,1)),tab:it,resourceGainCollapsed:_n})}),$t=U(!1),Ot=K(()=>f(Ut,{modelValue:$t.value,"onUpdate:modelValue":I=>$t.value=I},{header:()=>f("h2",null,[T("Modifiers")]),body:()=>lt(ze)}));this.on("preUpdate",I=>{if(Object.keys(l).forEach(P=>{l[P]-=I,l[P]<=0&&delete l[P]}),Object.keys(c).forEach(P=>{c[P]-=I,c[P]<=0&&delete c[P]}),Ne(C.value)){const P=o.add(C.value.state.progress,o.times(Ci.value,I)),F=P.floor();C.value.state={...C.value.state,progress:o.sub(P,F)};const z=F.div(L.value).floor();z.gt(0)&&Vt.forEach(W=>{Se(W,o.times(new o(Ft[W].computedModifier.value).toNumber(),z).times(wn.value)),l[W]=.3});const O=o.sub(F,z).toNumber();for(let W=0;W0){let z=o.add(P,I);const O=o.div(P,b.value).floor();z=o.sub(z,o.times(O,b.value)),E.value.state={...E.value.state,progress:z},o.gt(O,0)&&F.forEach(W=>{Se(W,O),c[W]=.3})}}e.value=o.add(e.value,o.times(ut.value,I)),o.lt(e.value,0)&&(e.value=0,X.forEach(P=>{var F;((F=P.value)==null?void 0:F.state).powered=!1}),Object.values(a.value).forEach(P=>{P.state.powered=!1}),C.value.state={...C.value.state,powered:!1},gr.warning(f("div",null,[f("h3",null,[T("Ran out of energy!")]),f("div",null,[T("All machines have been turned off.")])])))});const qt=w(()=>{var I,P;return g.selectedAction.value===g.types.brokenFactory.actions[0]?-100:g.selectedAction.value===g.types.factory.actions[1]?o.neg(Be[g.selectedNode.value.state].cost):((I=g.selectedAction.value)==null?void 0:I.id)==="moreConnections"?o.neg(g.selectedAction.value.formula.evaluate(((P=g.selectedNode.value)==null?void 0:P.state).maxConnections)):0}),st=ln(m.variable(0).add(e),()=>o.neq(qt.value,0),qt),Et=w(()=>{var I;return g.selectedAction.value===Rt?((I=g.selectedNode.value)==null?void 0:I.state).powered?o.eq(d.value,1)?10:o.pow(100,d.value).div(10).times(.99):o.neg(p.value):0}),rn=ln(m.variable(0).add(ut),()=>o.neq(Et.value,0),Et),ii=w(()=>g.types.portal.nodes.value.filter(I=>Ne(I))),Rn=w(()=>ii.value.sort((I,P)=>{var O,W;const F=(O=me[I.state.id])!=null&&O.minimized.value?1:0,z=(W=me[P.state.id])!=null&&W.minimized.value?1:0;return F-z}).map(I=>I.state.id));return mt(Rn,I=>{zt(()=>{Q.tabs=["main",...I]})}),mt(yn,(I,P)=>{o.lt(I,P)&&(on(I,x,"resources"),on(I,E,"resources"),on(I,S,"tools"),on(I,B,"portals"),on(I,le,"portals"),on(I,ue,"portals"),on(I,te,"portals"))}),{name:"World",board:g,energy:e,modifierTabs:ze,resourceNodes:t,toolNodes:n,influenceNodes:r,grantResource:Se,activePortals:ii,nextPowerCost:p,computedBonusConnectionsModifier:yn,quarryProgressRequired:b,dropRates:Ft,dowsing:x,empowerer:S,booster:B,upgrader:le,automator:ue,investments:te,resourceLevels:u,planarMultis:ae,computedPortalCost:ki,display:K(()=>f(re,null,[f(pi,{class:"nav-container"},{default:()=>[f("span",{class:"nav-segment"},[f("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[lt(st)])," ",T("energy")]),f("span",{class:"nav-segment"},[T("("),f("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt(ut.value,0)?"+":"",lt(rn)]),T("/s)")]),o.gt(d.value,0)?f("span",{class:"nav-segment"},[f("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[pt(d.value)])," ",T("machines powered")]):null,f("span",{class:"nav-segment"},[f("button",{class:"button",style:"display: inline",onClick:()=>$t.value=!0},[T("modifiers")])]),Q.devSpeed===0?f("span",{class:"nav-segment"},[T("Game Paused")]):Q.devSpeed!=null&&Q.devSpeed!==1?f("span",{class:"nav-segment"},[T("Dev Speed: "),Ie(Q.devSpeed),T("x")]):null]}),lt(g),lt(Ot)]))}}),lp=e=>{var n,i,r,a,u;const t=[h];return(u=(a=(r=(i=(n=e.layers)==null?void 0:n.main)==null?void 0:i.board)==null?void 0:r.state)==null?void 0:a.nodes)==null||u.filter(l=>(l==null?void 0:l.type)==="portal").map(l=>{var c,d;return(d=(c=l==null?void 0:l.state)==null?void 0:c.id)!=null?d:""}).forEach(l=>{var d,v,p,b;const c=(d=e.layers)==null?void 0:d[l];t.push(Zr(l,(v=c.tier)!=null?v:"dirt",(p=c.seed)!=null?p:Math.floor(Math.random()*4294967296),(b=c.influences)!=null?b:[]))}),t},Ji=U(!1);function up(e,t){}var cp=Object.freeze(Object.defineProperty({__proto__:null,main:h,getInitialLayers:lp,hasWon:Ji,fixOldSave:up},Symbol.toStringTag,{value:"Module"}));const Kn=e=>(gn("data-v-4a50ce42"),e=e(),mn(),e),dp={class:"game-over-modal-header"},pp=["src","alt"],fp={class:"game-over-modal-title"},gp=Kn(()=>N("h2",null,"Congratulations!",-1)),mp={key:0},vp=Kn(()=>N("br",null,null,-1)),hp=Kn(()=>N("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),bp=Kn(()=>N("br",null,null,-1)),yp=["href"],wp=Kn(()=>N("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),_p=J({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:a,versionTitle:u}=ye,l=w(()=>vi(Q.timePlayed)),c=w(()=>Ji.value&&!Q.keepGoing),d=Qt(Q,"autosave");function v(){Q.keepGoing=!0}function p(){un(Sn())}return(b,g)=>(M(),ne(Ut,{"model-value":s(c)},{header:Z(()=>[N("div",dp,[s(n)?(M(),A("img",{key:0,class:"game-over-modal-logo",src:s(n),alt:s(t)},null,8,pp)):G("",!0),N("div",fp,[gp,N("h4",null,"You've beaten "+pe(s(t))+" v"+pe(s(a))+": "+pe(s(u)),1)])])]),body:Z(({shown:C})=>[C?(M(),A("div",mp,[N("div",null,"It took you "+pe(s(l))+" to beat the game.",1),vp,hp,bp,N("div",null,[N("a",{href:s(r),class:"game-over-modal-discord-link"},[wp,T(" "+pe(s(i)),1)],8,yp)]),f(Bt,{title:"Autosave",modelValue:s(d),"onUpdate:modelValue":g[0]||(g[0]=_=>Fe(d)?d.value=_:null)},null,8,["modelValue"])])):G("",!0)]),footer:Z(()=>[N("div",{class:"game-over-footer"},[N("button",{onClick:v,class:"button"},"Keep Going"),N("button",{onClick:p,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var Np=ve(_p,[["__scopeId","data-v-4a50ce42"]]);const Ni=e=>(gn("data-v-2776d67d"),e=e(),mn(),e),Cp=Ni(()=>N("div",{class:"nan-modal-header"},[N("h2",null,"NaN value detected!")],-1)),kp={key:0},Mp=Ni(()=>N("br",null,null,-1)),Sp=["href"],Ip=Ni(()=>N("span",{class:"material-icons nan-modal-discord"},"discord",-1)),xp=Ni(()=>N("br",null,null,-1)),$p={class:"nan-footer"},Ep=J({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=ye,i=U(!0),r=U(!0),a=Qt(Ue,"hasNaN"),u=U(null);mt(a,b=>{b?(i.value=Q.autosave,r.value=Q.devSpeed===0):(Q.autosave=i.value,Q.devSpeed=r.value?0:null)});const l=w(()=>{var b;return(b=Ue.NaNPath)==null?void 0:b.join(".")}),c=w(()=>Ue.NaNPersistent!=null?Ue.NaNPersistent.value:null);function d(){Ue.NaNPersistent!=null&&(Ue.NaNPersistent.value=new o(0),Ue.hasNaN=!1)}function v(){Ue.NaNPersistent&&(Ue.NaNPersistent.value=new o(1),Ue.hasNaN=!1)}function p(){Ue.NaNPersistent&&(Ue.NaNPersistent.value=new o(NaN),Ue.hasNaN=!1)}return(b,g)=>(M(),A(re,null,[f(Ut,Gt({modelValue:s(a),"onUpdate:modelValue":g[4]||(g[4]=C=>Fe(a)?a.value=C:null)},b.$attrs),{header:Z(()=>[Cp]),body:Z(()=>[N("div",null,[T(' Attempted to assign "'+pe(s(l))+'" to NaN',1),s(c)?(M(),A("span",kp,pe(" ")+"(previously "+pe(s(Ie)(s(c)))+")",1)):G("",!0),T(". Auto-saving has been "+pe(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Mp,N("div",null,[N("a",{href:s(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[Ip,T(" "+pe(s(t)||"The Paper Pilot Community"),1)],8,Sp)]),xp,f(Bt,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":g[0]||(g[0]=C=>i.value=C)},null,8,["modelValue"]),s(ye).enablePausing?(M(),ne(Bt,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":g[1]||(g[1]=C=>r.value=C)},null,8,["modelValue"])):G("",!0)]),footer:Z(()=>[N("div",$p,[N("button",{onClick:g[2]||(g[2]=C=>{var _;return(_=u.value)==null?void 0:_.open()}),class:"button"},"Open Saves Manager"),N("button",{onClick:d,class:"button"},"Set to 0"),N("button",{onClick:v,class:"button"},"Set to 1"),s(c)&&s(o).neq(s(c),0)&&s(o).neq(s(c),1)?(M(),A("button",{key:0,onClick:g[3]||(g[3]=C=>a.value=!1),class:"button"}," Set to previous ")):G("",!0),N("button",{onClick:p,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),f(Fr,{ref_key:"savesManager",ref:u},null,512)],64))}});var Pp=ve(Ep,[["__scopeId","data-v-2776d67d"]]);const Tp={key:0,class:"tpsDisplay"},Dp=J({__name:"TPS",setup(e){const t=w(()=>o.div(Ue.lastTenTicks.length,Ue.lastTenTicks.reduce((n,i)=>n+i,0)));return(n,i)=>s(t).isNan()?G("",!0):(M(),A("div",Tp,"TPS: "+pe(s(pt)(s(t))),1))}});var Ap=ve(Dp,[["__scopeId","data-v-89b89152"]]);var Rp=J({__name:"App",setup(e){const t=ye.useHeader,n=w(()=>Nt[de.theme].variables),i=Qt(de,"showTPS"),r=w(()=>fe(K(()=>f(re,null,[hs.map(lt)]))));return(a,u)=>(M(),A(re,null,[N("div",{id:"modal-root",style:Le(s(n))},null,4),N("div",{class:_e(["app",{useHeader:s(t)}]),style:Le(s(n))},[s(t)?(M(),ne(Or,{key:0})):G("",!0),f(oc),s(s(i))?(M(),ne(Ap,{key:1})):G("",!0),f(Np),f(Pp),(M(),ne(Qe(s(r))))],6)],64))}});var Fp=ve(Rp,[["__scopeId","data-v-41d15e5e"]]);function Op(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:u}=e;let l,c,d,v;const p=async(g=!0)=>{await d,g&&(l==null||l.addEventListener("controlling",C=>{C.isUpdate&&window.location.reload()})),await(v==null?void 0:v())};async function b(){if("serviceWorker"in navigator){const{Workbox:g,messageSW:C}=await Gn(()=>import("./workbox-window.4a8794bb.js"),[]);v=async()=>{c&&c.waiting&&await C(c.waiting,{type:"SKIP_WAITING"})},l=new g("./sw.js",{scope:"./",type:"classic"}),l.addEventListener("activated",_=>{_.isUpdate||i==null||i()});{const _=()=>{n==null||n()};l.addEventListener("waiting",_),l.addEventListener("externalwaiting",_)}l.register({immediate:t}).then(_=>{c=_,a?a("./sw.js",_):r==null||r(_)}).catch(_=>{u==null||u(_)})}}return d=b(),p}function qp(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:u}=e,l=U(!1),c=U(!1);return{updateServiceWorker:Op({immediate:t,onNeedRefresh(){l.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:r,onRegisteredSW:a,onRegisterError:u}),offlineReady:c,needRefresh:l}}document.title=ye.title;window.projInfo=ye;if(ye.id==="")throw new Error("Project ID is empty! Please select a unique ID for this project in /src/data/projInfo.json");requestAnimationFrame(async()=>{console.log(`%cMade in Profectus%c -Learn more at www.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await ds();const{globalBus:e}=await Gn(()=>Promise.resolve().then(function(){return us}),void 0),{startGameLoop:t}=await Gn(()=>import("./gameLoop.f1000c82.js"),["assets/gameLoop.f1000c82.js","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=sa(Fp);e.emit("setupVue",n),n.mount("#app"),zt(()=>{const i=mi(),{updateServiceWorker:r}=qp({onNeedRefresh(){i.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){r()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{o as D,Gn as _,Ue as a,ye as b,cp as c,et as g,ps as l,Q as p,de as s}; + )`,onMousedown:x=>c(x,b),onTouchstart:x=>c(x,b),onMouseup:x=>d(x,b),onTouchend:In(x=>d(x,b),["stop"])},[N("circle",{fill:s(be)(b.fillColor,e.node),r:"20","stroke-width":((_=e.selectedAction)==null?void 0:_.id)===b.id?4:0,stroke:s(a)},null,8,gc),N("text",{fill:s(u),class:"material-icons"},pe(s(be)(b.icon,e.node)),9,mc)],42,fc)}),128))])):G("",!0)]),_:1}))}});var hc=ve(vc,[["__scopeId","data-v-9efb2a56"]]);const bc=["transform"],yc={key:0},wc=["r","fill","stroke"],_c=["r","fill","stroke"],Nc=["r","fill"],Cc=["r","stroke-dasharray","stroke-dashoffset","stroke"],kc={key:1,transform:"rotate(45, 0, 0)"},Mc=["width","height","transform","fill","stroke"],Sc=["width","height","transform","fill","stroke"],Ic=["width","height","transform","fill"],xc=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],$c=["fill","y"],Ec=["fill"],Pc={key:0},Dc=["fill","y"],Tc=["fill","y"],Ac=J({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},isSelected:{type:Boolean},selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,i=Math.sqrt(2),r=De(n),a=w(()=>be(r.nodeType.value.draggable,s(r.node)));mt(a,L=>{const ae=s(r.node);s(r.dragging)===ae&&!L&&t("endDragging",ae)});const u=w(()=>{var ae;const L=s(r.node);return(ae=be(r.nodeType.value.actions,L))==null?void 0:ae.filter(Te=>We(be(Te.visibility,L)))}),l=w(()=>{var ae;const L=s(r.node);if(be(r.nodeType.value.draggable,L)&&((ae=s(r.dragging))==null?void 0:ae.id)===L.id&&s(r.dragged)!=null){const{x:Te,y:Xe}=s(r.dragged);return{x:L.position.x+Math.round(Te/25)*25,y:L.position.y+Math.round(Xe/25)*25}}return L.position}),c=w(()=>be(r.nodeType.value.shape,s(r.node))),d=w(()=>be(r.nodeType.value.title,s(r.node))),v=w(()=>be(r.nodeType.value.subtitle,s(r.node))),p=w(()=>{var L;return(L=r.isSelected.value?s(r.selectedAction)&&be(s(r.selectedAction).tooltip,s(r.node)):null)!=null?L:be(r.nodeType.value.label,s(r.node))}),b=w(()=>{var L,ae;return be((ae=(L=s(r.selectedAction))==null?void 0:L.confirmationLabel)!=null?ae:{text:"Tap again to confirm"},s(r.node))}),g=w(()=>be(r.nodeType.value.size,s(r.node))),C=w(()=>{var L;return(L=be(r.nodeType.value.progress,s(r.node)))!=null?L:0}),_=w(()=>Nt[de.theme].variables["--background"]),x=w(()=>{var L;return(L=be(r.nodeType.value.outlineColor,s(r.node)))!=null?L:Nt[de.theme].variables["--outline"]}),E=w(()=>{var L;return(L=be(r.nodeType.value.fillColor,s(r.node)))!=null?L:Nt[de.theme].variables["--raised-background"]}),S=w(()=>be(r.nodeType.value.progressColor,s(r.node))),T=w(()=>{var L;return(L=be(r.nodeType.value.titleColor,s(r.node)))!=null?L:Nt[de.theme].variables["--foreground"]}),B=w(()=>be(r.nodeType.value.progressDisplay,s(r.node))),le=w(()=>r.dragging.value!=null&&s(r.hasDragged)&&be(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),ue=w(()=>be(r.nodeType.value.style,s(r.node))),te=w(()=>be(r.nodeType.value.classes,s(r.node)));function X(L){t("mouseDown",L,r.node.value,a.value)}function Se(L){var ae,Te,Xe;(ae=r.hasDragged)!=null&&ae.value||(t("endDragging",r.node.value),(Xe=(Te=r.nodeType.value).onClick)==null||Xe.call(Te,r.node.value),L.stopPropagation())}return(L,ae)=>{var Te,Xe,Ht;return M(),A("g",{class:_e(["boardnode",{[e.node.type]:!0,isSelected:e.isSelected,isDraggable:s(a),...s(te)}]),style:Le([{opacity:((Te=e.dragging)==null?void 0:Te.id)===e.node.id&&e.hasDragged?.5:1},(Xe=s(ue))!=null?Xe:[]]),transform:`translate(${s(l).x},${s(l).y})${e.isSelected?" scale(1.2)":""}`},[f(hc,{actions:(Ht=s(u))!=null?Ht:[],"is-selected":e.isSelected,node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:ae[0]||(ae[0]=ut=>t("clickAction",ut))},null,8,["actions","is-selected","node","node-type","selected-action"]),N("g",{class:"node-container",onMousedown:X,onTouchstartPassive:X,onMouseup:Se,onTouchendPassive:Se},[s(c)===s(je).Circle?(M(),A("g",yc,[s(le)?(M(),A("circle",{key:0,class:"receiver",r:s(g)+8,fill:s(_),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,wc)):G("",!0),N("circle",{class:"body",r:s(g),fill:s(E),stroke:s(x),"stroke-width":4},null,8,_c),s(B)===s(tn).Fill?(M(),A("circle",{key:1,class:"progress progressFill",r:Math.max(s(g)*s(C)-2,0),fill:s(S)},null,8,Nc)):(M(),A("circle",{key:2,r:s(g)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(s(g)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(s(g)+4.5)*2*Math.PI-s(C)*(s(g)+4.5)*2*Math.PI,stroke:s(S)},null,8,Cc))])):s(c)===s(je).Diamond?(M(),A("g",kc,[s(le)?(M(),A("rect",{key:0,class:"receiver",width:s(g)*s(i)+16,height:s(g)*s(i)+16,transform:`translate(${-(s(g)*s(i)+16)/2}, ${-(s(g)*s(i)+16)/2})`,fill:s(_),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,Mc)):G("",!0),N("rect",{class:"body",width:s(g)*s(i),height:s(g)*s(i),transform:`translate(${-s(g)*s(i)/2}, ${-s(g)*s(i)/2})`,fill:s(E),stroke:s(x),"stroke-width":4},null,8,Sc),s(B)===s(tn).Fill?(M(),A("rect",{key:1,class:"progress progressFill",width:Math.max(s(g)*s(i)*s(C)-2,0),height:Math.max(s(g)*s(i)*s(C)-2,0),transform:`translate(${-Math.max(s(g)*s(i)*s(C)-2,0)/2}, ${-Math.max(s(g)*s(i)*s(C)-2,0)/2})`,fill:s(S)},null,8,Ic)):(M(),A("rect",{key:2,class:"progress progressDiamond",width:s(g)*s(i)+9,height:s(g)*s(i)+9,transform:`translate(${-(s(g)*s(i)+9)/2}, ${-(s(g)*s(i)+9)/2})`,fill:"transparent","stroke-dasharray":(s(g)*s(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(s(g)*s(i)+9)*4-s(C)*(s(g)*s(i)+9)*4,stroke:s(S)},null,8,xc))])):G("",!0),N("text",{fill:s(T),class:"node-title",y:s(v)?10:0},pe(s(d)),9,$c),s(v)?(M(),A("text",{key:2,fill:s(T),class:"node-subtitle",y:"-15"},pe(s(v)),9,Ec)):G("",!0)],32),f(zn,{name:"fade",appear:""},{default:Z(()=>{var ut;return[s(p)?(M(),A("g",Pc,[N("text",{fill:(ut=s(p).color)!=null?ut:s(T),class:_e(["node-title",{pulsing:s(p).pulsing}]),y:-s(g)-20},pe(s(p).text),11,Dc)])):G("",!0)]}),_:1}),f(zn,{name:"fade",appear:""},{default:Z(()=>{var ut;return[e.isSelected&&e.selectedAction?(M(),A("text",{key:0,fill:(ut=s(b).color)!=null?ut:s(T),class:_e(["node-title",{pulsing:s(b).pulsing}]),y:s(g)+75},pe(s(b).text),11,Tc)):G("",!0)]}),_:1})],14,bc)}}});var Rc=ve(Ac,[["__scopeId","data-v-518d7a7f"]]);const Fc={class:"stage",width:"100%",height:"100%"},Oc={class:"g1"},qc=J({__name:"Board",props:{nodes:null,types:null,state:null,visibility:null,width:null,height:null,style:null,classes:null,links:null,selectedAction:null,selectedNode:null,draggingNode:null,receivingNode:null,mousePosition:null,setReceivingNode:{type:Function},setDraggingNode:{type:Function}},setup(e){const n=De(e),i=U({x:0,y:0}),r=U({x:0,y:0}),a=U(!1),u=U(null),l=w(()=>{const g=n.nodes.value.slice();if(n.selectedNode.value){const C=g.splice(g.indexOf(n.selectedNode.value),1)[0];g.push(C)}if(n.draggingNode.value){const C=g.splice(g.indexOf(n.draggingNode.value),1)[0];g.push(C)}return g});St(()=>{const g=n.draggingNode.value;if(g==null)return null;const C={x:g.position.x+r.value.x,y:g.position.y+r.value.y};let _=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((x,E)=>{if(E.id===g.id)return x;const S=n.types.value[E.type];if(!be(S.canAccept,E,g))return x;const B=Math.pow(C.x-E.position.x,2)+Math.pow(C.y-E.position.y,2);let le=be(S.size,E);return B>_||B>le*le?x:(_=B,E)},null))});function c(g){g.setTransformOrigin(null),g.moveTo(u.value.$el.clientWidth/2,u.value.$el.clientHeight/2)}function d(g,C=null,_=!1){if(n.draggingNode.value==null){g.preventDefault(),g.stopPropagation();let x,E;if("touches"in g)if(g.touches.length===1)x=g.touches[0].clientX,E=g.touches[0].clientY;else return;else x=g.clientX,E=g.clientY;i.value={x,y:E},r.value={x:0,y:0},a.value=!1,_&&n.setDraggingNode.value(C)}C!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function v(g){const{x:C,y:_,scale:x}=u.value.panZoomInstance.getTransform();let E,S;if("touches"in g)if(g.touches.length===1)E=g.touches[0].clientX,S=g.touches[0].clientY;else{p(n.draggingNode.value),n.mousePosition.value=null;return}else E=g.clientX,S=g.clientY;n.mousePosition.value={x:(E-C)/x,y:(S-_)/x},r.value={x:r.value.x+(E-i.value.x)/x,y:r.value.y+(S-i.value.y)/x},i.value={x:E,y:S},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(a.value=!0),n.draggingNode.value!=null&&(g.preventDefault(),g.stopPropagation())}function p(g,C=!1){var _,x;if(n.draggingNode.value!=null&&n.draggingNode.value===g){n.receivingNode.value==null&&(n.draggingNode.value.position.x+=Math.round(r.value.x/25)*25,n.draggingNode.value.position.y+=Math.round(r.value.y/25)*25);const E=n.nodes.value;E.push(E.splice(E.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((x=(_=n.types.value[n.receivingNode.value.type]).onDrop)==null||x.call(_,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!a.value&&!C&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function b(g,C){n.state.value.selectedAction===C?s(n.selectedAction).onClick(s(n.selectedNode)):n.state.value={...n.state.value,selectedAction:C}}return(g,C)=>{const _=kt("panZoom");return s(We)(e.visibility)?(M(),ne(_,{key:0,style:Le([{width:e.width,height:e.height},e.style]),class:_e(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:u,onInit:c,onMousemove:v,onTouchmove:v,onMousedown:C[0]||(C[0]=x=>d(x)),onTouchstart:C[1]||(C[1]=x=>d(x)),onMouseup:C[2]||(C[2]=()=>p(s(e.draggingNode))),onTouchendPassive:C[3]||(C[3]=()=>p(s(e.draggingNode))),onMouseleave:C[4]||(C[4]=()=>p(s(e.draggingNode),!0))},{default:Z(()=>[(M(),A("svg",Fc,[N("g",Oc,[f(er,{name:"link",appear:""},{default:Z(()=>[(M(!0),A(re,null,xn(s(e.links)||[],x=>(M(),A("g",{key:`${x.startNode.id}-${x.endNode.id}`},[f(dc,{link:x},null,8,["link"])]))),128))]),_:1}),f(er,{name:"grow",duration:500,appear:""},{default:Z(()=>[(M(!0),A(re,null,xn(s(l),x=>(M(),A("g",{key:x.id,style:{"transition-duration":"0s"}},[f(Rc,{node:x,nodeType:e.types[x.type],dragging:s(e.draggingNode),dragged:s(e.draggingNode)===x?r.value:void 0,hasDragged:s(e.draggingNode)==null?!1:a.value,receivingNode:s(e.receivingNode)===x,isSelected:s(e.selectedNode)===x,selectedAction:s(e.selectedNode)===x?s(e.selectedAction):null,onMouseDown:d,onEndDragging:p,onClickAction:E=>b(x,E)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","isSelected","selectedAction","onClickAction"])]))),128))]),_:1})])]))]),_:1},8,["style","class","options"])):G("",!0)}}});et.on("setupVue",e=>ca.install(e));const qr=Symbol("Board");var tn=(e=>(e.Outline="Outline",e.Fill="Fill",e))(tn||{}),je=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(je||{});function Vc(e){const t=dt({nodes:[],selectedNode:null,selectedAction:null},!1);return tt(n=>{const i=e.call(n,n);i.id=nn("board-"),i.type=qr,i[bt]=qc,i.state?(Dr(t),$(i,"state")):(t[en]={nodes:i.startNodes().map((l,c)=>(l.id=c,l)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=w(()=>s(u.state).nodes),i.selectedNode=w({get(){return u.nodes.value.find(l=>l.id===s(u.state).selectedNode)||null},set(l){var c,d;Fe(u.state)?u.state.value={...u.state.value,selectedNode:(c=l==null?void 0:l.id)!=null?c:null}:u.state.selectedNode=(d=l==null?void 0:l.id)!=null?d:null}}),i.selectedAction=w({get(){const l=u.selectedNode.value;if(l==null)return null;const c=u.types[l.type];return c.actions==null?null:c.actions.find(d=>d.id===s(u.state).selectedAction)||null},set(l){var c,d;Fe(u.state)?u.state.value={...u.state.value,selectedAction:(c=l==null?void 0:l.id)!=null?c:null}:u.state.selectedAction=(d=l==null?void 0:l.id)!=null?d:null}}),i.mousePosition=U(null),i.links?$(i,"links"):i.links=w(()=>u.selectedAction.value==null?null:u.selectedAction.value.links&&u.selectedNode.value?be(u.selectedAction.value.links,u.selectedNode.value):null),i.draggingNode=U(null),i.receivingNode=U(null),$(i,"visibility"),oe(i,"visibility",ke.Visible),$(i,"width"),oe(i,"width","100%"),$(i,"height"),oe(i,"height","100%"),$(i,"classes"),$(i,"style");for(const l in i.types){const c=i.types[l];if($(c,"title"),$(c,"subtitle"),$(c,"label"),$(c,"size"),oe(c,"size",50),$(c,"style"),$(c,"classes"),$(c,"draggable"),oe(c,"draggable",!1),$(c,"shape"),oe(c,"shape","Circle"),$(c,"canAccept"),oe(c,"canAccept",!1),$(c,"progress"),$(c,"progressDisplay"),oe(c,"progressDisplay","Fill"),$(c,"progressColor"),oe(c,"progressColor","none"),$(c,"fillColor"),$(c,"outlineColor"),$(c,"titleColor"),$(c,"actionDistance"),oe(c,"actionDistance",Math.PI/6),c.nodes=w(()=>s(u.state).nodes.filter(d=>d.type===l)),oe(c,"onClick",function(d){s(u.state).selectedNode=d.id}),c.actions)for(const d of c.actions)$(d,"visibility"),oe(d,"visibility",ke.Visible),$(d,"icon"),$(d,"fillColor"),$(d,"tooltip"),$(d,"confirmationLabel"),oe(d,"confirmationLabel",{text:"Tap again to confirm"}),$(d,"links")}function r(l){i.draggingNode.value=l}function a(l){i.receivingNode.value=l}i.placeInAvailableSpace=function(l,c=100,d=H.Right){const v=u.nodes.value.slice().filter(p=>p===l||(d===H.Down||d===H.Up)&&Math.abs(p.position.x-l.position.x)>c||(d===H.Left||d===H.Right)&&Math.abs(p.position.y-l.position.y)>c?!1:!(d===H.Right&&p.position.xl.position.x+c||d===H.Up&&p.position.y>l.position.y+c||d===H.Down&&p.position.yp.position.x-b.position.x:d===H.Left?(p,b)=>b.position.x-p.position.x:d===H.Up?(p,b)=>b.position.y-p.position.y:(p,b)=>p.position.y-b.position.y);for(let p=0;p0&&g>c)break}},i[ft]=function(){const{nodes:l,types:c,state:d,visibility:v,width:p,height:b,style:g,classes:C,links:_,selectedAction:x,selectedNode:E,mousePosition:S,draggingNode:T,receivingNode:B}=this;return{nodes:l,types:c,state:d,visibility:v,width:p,height:b,style:s(g),classes:C,links:_,selectedAction:x,selectedNode:E,mousePosition:S,draggingNode:T,receivingNode:B,setDraggingNode:r,setReceivingNode:a}};const u=i;return u})}function be(e,t,...n){return Un(e)?e(t,...n):s(e)}function $n(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const Ln={};et.on("addLayer",e=>{const t=Hn(e,qr);Ln[e.id]=e.on("postUpdate",n=>{t.forEach(i=>{Object.values(i.types).forEach(r=>r.nodes.value.forEach(a=>{var u;return(u=r.update)==null?void 0:u.call(r,a,n)}))})})});et.on("removeLayer",e=>{var t;(t=Ln[e.id])==null||t.call(Ln),Ln[e.id]=void 0});function kn(e,t="points",n=0,i=void 0){const r=Fe(e)?e:dt(e);if(r.displayName=t,r.precision=n,r.small=i,!Fe(e)){const a=r[Dt];a.displayName=t,a.precision=n,a.small=i}return r}new o("10^^8");new o("1e100");function gi(e,t){const n=t!=null?t:e.value;return o.eq(e.precision,0)?pt(e.small?n:o.floor(n)):Ie(n,e.precision,e.small)}et.on("setupVue",e=>e.use(da));function Bc(e="white",t="8px"){return{transform:"scale(1.05, 1.05)",borderColor:"rgba(0, 0, 0, 0.125)",boxShadow:`-4px -4px 4px rgba(0, 0, 0, 0.25) inset, 0 0 ${t} ${e}`,zIndex:1}}const Lc=J({props:{visibility:{type:q(Number,Boolean),required:!0},display:{type:q(Object,String,Function),required:!0},style:q(String,Object,Array),classes:q(Object),glowColor:q(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=De(e),a=xr(n),u=w(()=>{const c=$e(i);return c==null||c===""?{}:s(r)?Bc(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function l(){t("selectTab")}return{selectTab:l,component:a,glowColorStyle:u,unref:s,Visibility:ke,isVisible:We,isHidden:vn}}});function jc(e,t,n,i,r,a){var u;return e.isVisible(e.visibility)?(M(),A("button",{key:0,onClick:t[0]||(t[0]=(...l)=>e.selectTab&&e.selectTab(...l)),class:_e(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(u=e.unref(e.style))!=null?u:{}])},[(M(),ne(Qe(e.component)))],6)):G("",!0)}var Vr=ve(Lc,[["render",jc],["__scopeId","data-v-21427abb"]]);const zc=J({props:{visibility:{type:q(Number,Boolean),required:!0},activeTab:{type:q(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:q(Object),required:!0},style:q(String,Object,Array),classes:q(Object),buttonContainerStyle:q(String,Object,Array),buttonContainerClasses:q(Object)},components:{Sticky:fi,TabButton:Vr},setup(e){const{activeTab:t}=De(e),n=w(()=>Nt[de.theme].floatingTabs),i=vt("");St(()=>{const l=$e(t);if(l==null){i.value="";return}if(It(l)){i.value=fe(l);return}i.value=fe(s(l.display))});const r=w(()=>{const l=$e(t);return It(l)||!l?void 0:s(l.classes)}),a=w(()=>{const l=$e(t);return It(l)||!l?void 0:s(l.style)});function u(l){const{display:c,style:d,classes:v,glowColor:p,visibility:b}=l;return{display:c,style:s(d),classes:v,glowColor:p,visibility:b}}return{floating:n,tabClasses:r,tabStyle:a,Visibility:ke,component:i,gatherButtonProps:u,unref:s,isVisible:We,isHidden:vn}}});function Gc(e,t,n,i,r,a){var c,d;const u=kt("TabButton"),l=kt("Sticky");return e.isVisible(e.visibility)?(M(),A("div",{key:0,class:_e(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(d=e.tabStyle)!=null?d:[]])},[f(l,{class:_e(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:Le(e.unref(e.buttonContainerStyle))},{default:Z(()=>[N("div",{class:_e(["tab-buttons",{floating:e.floating}])},[(M(!0),A(re,null,xn(e.unref(e.tabs),(v,p)=>(M(),ne(u,Gt({onSelectTab:b=>e.selected.value=p,floating:e.floating,key:p,active:e.unref(v.tab)===e.unref(e.activeTab)},e.gatherButtonProps(v)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(M(),ne(Qe(e.unref(e.component)),{key:0})):G("",!0)],6)):G("",!0)}var Uc=ve(zc,[["render",Gc],["__scopeId","data-v-58dbf83a"]]);const Wc=Symbol("TabButton"),Hc=Symbol("TabFamily");function Zc(e,t){if(Object.keys(e).length===0)throw console.warn("Cannot create tab family with 0 tabs"),new Error("Cannot create tab family with 0 tabs");const n=dt(Object.keys(e)[0],!1);return tt(i=>{var u;const r=(u=t==null?void 0:t.call(i,i))!=null?u:{};r.id=nn("tabFamily-"),r.type=Hc,r[bt]=Uc,r.tabs=Object.keys(e).reduce((l,c)=>{const d=e[c]();return d.type=Wc,d[bt]=Vr,$(d,"visibility"),oe(d,"visibility",ke.Visible),$(d,"tab"),$(d,"display"),$(d,"classes"),$(d,"style"),$(d,"glowColor"),l[c]=d,l},{}),r.selected=n,r.activeTab=w(()=>{const l=s(a.tabs);if(n.value in l&&We(l[n.value].visibility))return s(l[n.value].tab);const c=Object.values(l).find(d=>We(d.visibility));return c?s(c.tab):null}),$(r,"visibility"),oe(r,"visibility",ke.Visible),$(r,"classes"),$(r,"style"),$(r,"buttonContainerClasses"),$(r,"buttonContainerStyle"),r[ft]=function(){const{visibility:l,activeTab:c,selected:d,tabs:v,style:p,classes:b,buttonContainerClasses:g,buttonContainerStyle:C}=this;return{visibility:l,activeTab:c,selected:d,tabs:v,style:s(p),classes:b,buttonContainerClasses:g,buttonContainerStyle:C}};const a=r;return a})}function Lt(e){return tt(t=>{const{addend:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),u=we(n),l=we(i),c=r==null?void 0:we(r);return{apply:d=>o.add(d,s(u)),invert:d=>o.sub(d,s(u)),getFormula:d=>m.add(d,u),enabled:c,description:i==null?void 0:K(()=>f("div",{class:"modifier-container"},[s(l)!=null?f("span",{class:"modifier-description"},[Ct(s(l))]):null,f("span",{class:"modifier-amount",style:(a===!0?o.gt(s(u),0):o.lt(s(u),0))?"color: var(--danger)":""},[o.gte(s(u),0)?"+":"",jt(s(u))])]))}})}function Ce(e){return tt(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),u=we(n),l=we(i),c=r==null?void 0:we(r);return{apply:d=>o.times(d,s(u)),invert:d=>o.div(d,s(u)),getFormula:d=>m.times(d,u),enabled:c,description:i==null?void 0:K(()=>f("div",{class:"modifier-container"},[s(l)!=null?f("span",{class:"modifier-description"},[Ct(s(l))]):null,f("span",{class:"modifier-amount",style:(a===!0?o.gt(s(u),1):o.lt(s(u),1))?"color: var(--danger)":""},[D("\xD7"),jt(s(u))])]))}})}function Xc(e){return tt(t=>{const{exponent:n,description:i,enabled:r,supportLowNumbers:a,smallerIsBetter:u}=e.call(t,t),l=we(n),c=we(i),d=r==null?void 0:we(r);return{apply:v=>{let p=v;return a&&(p=o.add(p,1)),p=o.pow(p,s(l)),a&&(p=o.sub(p,1)),p},invert:v=>{let p=v;return a&&(p=o.add(p,1)),p=o.root(p,s(l)),a&&(p=o.sub(p,1)),p},getFormula:v=>a?m.add(v,1).pow(l).sub(1):m.pow(v,l),enabled:d,description:i==null?void 0:K(()=>f("div",{class:"modifier-container"},[s(c)!=null?f("span",{class:"modifier-description"},[Ct(s(c)),a?" (+1 effective)":null]):null,f("span",{class:"modifier-amount",style:(u===!0?o.gt(s(l),1):o.lt(s(l),1))?"color: var(--danger)":""},[D("^"),jt(s(l))])]))}})}function wt(e){return tt(()=>{const t=e();return{apply:n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.apply(i),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduceRight((i,r)=>r.invert(i),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.getFormula(i),n):void 0,enabled:t.some(n=>n.enabled!=null)?w(()=>t.filter(n=>s(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?K(()=>f(re,null,[t.filter(n=>s(n.enabled)!==!1).map(n=>s(n.description)).filter(n=>n).map(Ct)])):void 0}})}const Fi=m.variable(0).step(2e3,e=>e.pow_base(1.02)).step(100,e=>e.pow(1.5)).step(o.pow(900,1.5).add(100),e=>e.pow(1.5)).pow(1.5),rn={id:"deselect",icon:"close",tooltip:e=>({text:"portals"in e.state?"Disconnect portals":"tools"in e.state?"Disconnect tools":"Disconnect resources"}),onClick(e){var t;Array.isArray((t=e.state)==null?void 0:t.data)?e.state={...e.state,data:[]}:"portals"in e.state?e.state={...e.state,portals:[]}:"resources"in e.state?e.state={...e.state,resources:[]}:"tools"in e.state&&(e.state={...e.state,tools:[]}),h.board.selectedAction.value=null,h.board.selectedNode.value=null},visibility:e=>{var t;return Array.isArray((t=e.state)==null?void 0:t.data)?e.state.data.length>0:"portals"in e.state?e.state.portals.length>0:"resources"in e.state?e.state.resources.length>0:"tools"in e.state?e.state.tools.length>0:!1}},Rt={id:"toggle",icon:"bolt",tooltip:e=>({text:e.state.powered?"Turn Off":`Turn On - Always runs for ${pt(h.nextPowerCost.value)} energy/s`}),onClick(e){e.state={...e.state,powered:!e.state.powered},h.board.selectedAction.value=null},fillColor:e=>e.state.powered?"var(--accent1)":"var(--locked)"};function bn(e,t=1/0){const n=e(m.variable(0));return{id:"moreConnections",icon:"hub",formula:n,tooltip(i){return{text:`Increase Connections - ${pt(n.evaluate(i.state.maxConnections))} energy`}},fillColor(i){return o.gte(h.energy.value,n.evaluate(i.state.maxConnections))?"var(--bought)":"var(--locked)"},confirmationLabel:i=>o.gte(h.energy.value,n.evaluate(i.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(i){const r=n.evaluate(i.state.maxConnections);o.gte(h.energy.value,r)&&(h.energy.value=o.sub(h.energy.value,r),i.state={...i.state,maxConnections:o.add(i.state.maxConnections,1)},h.board.selectedAction.value=null)},visibility:i=>o.add(i.state.maxConnections,h.computedBonusConnectionsModifier.value).lt(t)}}function Br(e,t){var n,i;if(((n=h.board.draggingNode.value)==null?void 0:n.type)==="resource"){const r=((i=h.board.draggingNode.value)==null?void 0:i.state).type,{maxConnections:a,resources:u}=e.state;return u.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,h.computedBonusConnectionsModifier.value).lte(u.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Yc(e,t){var n,i;if(((n=h.board.draggingNode.value)==null?void 0:n.type)==="passive"){const r=(i=h.board.draggingNode.value)==null?void 0:i.state,{maxConnections:a,tools:u}=e.state;return u.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,h.computedBonusConnectionsModifier.value).lte(u.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function bi(e,t){var n,i;if(((n=h.board.draggingNode.value)==null?void 0:n.type)==="portal"){const r=((i=h.board.draggingNode.value)==null?void 0:i.state).id,{maxConnections:a,portals:u}=e.state;return u.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,h.computedBonusConnectionsModifier.value).lte(u.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Lr(e,t){if(t.type!=="resource")return!1;const n=t.state.type,{maxConnections:i,resources:r}=e.state;return r.includes(n)?!0:!o.add(i,h.computedBonusConnectionsModifier.value).lte(r.length)}function jr(e,t){if(t.type!=="resource")return;const n=t.state.type,i=e.state.resources;i.includes(n)?e.state={...e.state,resources:i.filter(r=>r!==n)}:e.state={...e.state,resources:[...i,n]},h.board.selectedNode.value=e}function Jc(e,t){if(t.type!=="passive")return!1;const n=t.state,{maxConnections:i,tools:r}=e.state;return r.includes(n)?!0:!o.add(i,h.computedBonusConnectionsModifier.value).lte(r.length)}function Kc(e,t){if(t.type!=="passive")return;const n=t.state,i=e.state.tools;i.includes(n)?e.state={...e.state,tools:i.filter(r=>r!==n)}:e.state={...e.state,tools:[...i,n]},h.board.selectedNode.value=e}function yi(e,t){if(t.type!=="portal")return!1;const n=t.state.id,{maxConnections:i,portals:r}=e.state;return r.includes(n)?!0:!o.add(i,h.computedBonusConnectionsModifier.value).lte(r.length)}function wi(e,t){if(t.type!=="portal")return;const n=t.state.id,{portals:i}=e.state;i.includes(n)?e.state={...e.state,portals:i.filter(r=>r!==n)}:e.state={...e.state,portals:[...i,n]},h.board.selectedNode.value=e}function Ne(e){return e===h.board.selectedNode.value||e.state.powered}function ee(e){return h.empowerer.value!=null&&Ne(h.empowerer.value)&&h.empowerer.value.state.tools.includes(e)}function Qc(e){var a,u,l;const t=(l=(u=(a=h.resourceNodes.value[e])==null?void 0:a.state)==null?void 0:u.amount)!=null?l:0,n=h.resourceLevels.value[e],i=Fi.evaluate(n),r=Fi.evaluate(o.add(n,1));return o.sub(t,i).max(0).div(o.sub(r,i)).toNumber()}function ln(e,t,n){if(t.value){const i=t.value.state,r=i[n],a=i.maxConnections;o.gt(r.length,o.add(a,e))&&(t.value.state={...t.value.state,[n]:r.slice(0,o.add(a,e).toNumber())})}}const ed={key:0},td={key:0,class:"mark star"},nd=["src"],id=J({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(M(),A("div",ed,[e.mark===!0?(M(),A("div",td)):(M(),A("img",{key:1,class:"mark",src:e.mark},null,8,nd))])):G("",!0)}});var Yn=ve(id,[["__scopeId","data-v-2207999f"]]);const rd=J({__name:"Node",props:{id:null},setup(e){const n=De(e),i=ui(Bi,()=>{}),r=ui(Li,()=>{}),a=vt(null),u=w(()=>a.value&&a.value.parentElement);return mt([u,n.id],([l,c],[d,v])=>{d&&r(s(v)),l&&i(c,l)}),mr(()=>r(s(n.id))),(l,c)=>(M(),A("div",{class:"node",ref_key:"node",ref:a},null,512))}});var Jn=ve(rd,[["__scopeId","data-v-a48cb382"]]),ad=J({props:{display:{type:q(Object,String,Function),required:!0},visibility:{type:q(Number,Boolean),required:!0},style:q(Object,String,Array),classes:q(Object),onClick:Function,onHold:Function,canClick:{type:q(Boolean),required:!0},small:Boolean,mark:q(Boolean,String),id:{type:String,required:!0}},components:{Node:Jn,MarkNode:Yn},setup(e){const{display:t,onClick:n,onHold:i}=De(e),r=vt("");St(()=>{var v;const l=$e(t);if(l==null){r.value="";return}if(It(l)){r.value=fe(l);return}const c=fe((v=l.title)!=null?v:"","h3"),d=fe(l.description,"div");r.value=fe(K(()=>f("span",null,[l.title!=null?f("div",null,[f(c,null,null)]):null,f(d,null,null)])))});const{start:a,stop:u}=Ir(n,i);return{start:a,stop:u,comp:r,Visibility:ke,isVisible:We,isHidden:vn,unref:s}}});function sd(e,t,n,i,r,a){var c;const u=kt("MarkNode"),l=kt("Node");return e.isVisible(e.visibility)?(M(),A("button",{key:0,style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:_e({feature:!0,clickable:!0,can:e.unref(e.canClick),locked:!e.unref(e.canClick),small:e.small,...e.unref(e.classes)})},[e.unref(e.comp)?(M(),ne(Qe(e.unref(e.comp)),{key:0})):G("",!0),f(u,{mark:e.unref(e.mark)},null,8,["mark"]),f(l,{id:e.id},null,8,["id"])],38)):G("",!0)}var zr=ve(ad,[["render",sd],["__scopeId","data-v-211328c0"]]);const Gr=Symbol("Clickable");function od(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return tt(i=>{var u,l,c;const r=(u=e==null?void 0:e.call(i,i))!=null?u:{};r.id=nn("clickable-"),r.type=Gr,r[bt]=zr;for(const d of t)(l=d.preConstruct)==null||l.call(d,r);if(Object.assign(r,n),$(r,"visibility"),oe(r,"visibility",ke.Visible),$(r,"canClick"),oe(r,"canClick",!0),$(r,"classes"),$(r,"style"),$(r,"mark"),$(r,"display"),r.onClick){const d=r.onClick.bind(r);r.onClick=function(v){s(r.canClick)!==!1&&d(v)}}if(r.onHold){const d=r.onHold.bind(r);r.onHold=function(){s(r.canClick)!==!1&&d()}}for(const d of t)(c=d.postConstruct)==null||c.call(d,r);const a=t.reduce((d,v)=>{var p;return Object.assign(d,(p=v.getGatheredProps)==null?void 0:p.call(v,r))},{});return r[ft]=function(){const{display:d,visibility:v,style:p,classes:b,onClick:g,onHold:C,canClick:_,small:x,mark:E,id:S}=this;return{display:d,visibility:v,style:s(p),classes:b,onClick:g,onHold:C,canClick:_,small:x,mark:E,id:S,...a}},r})}function ld(e,t,n=[]){n=n.length===0?Hn(e,Gr):n;const i=typeof t=="function"?w(t):t;return e.on("update",()=>{s(i)&&n.filter(r=>s(r.canClick)).forEach(r=>{var a;return(a=r.onClick)==null?void 0:a.call(r)})})}const ud=["x1","y1","x2","y2"],cd=J({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=De(e),i=w(()=>{const a=n.startNode.value.rect,u=n.boundingRect.value,l=u?{x:a.x+a.width/2-u.x,y:a.y+a.height/2-u.y}:{x:0,y:0};return n.link.value.offsetStart&&(l.x+=n.link.value.offsetStart.x,l.y+=n.link.value.offsetStart.y),l}),r=w(()=>{const a=n.endNode.value.rect,u=n.boundingRect.value,l=u?{x:a.x+a.width/2-u.x,y:a.y+a.height/2-u.y}:{x:0,y:0};return n.link.value.offsetEnd&&(l.x+=n.link.value.offsetEnd.x,l.y+=n.link.value.offsetEnd.y),l});return(a,u)=>(M(),A("line",Gt({"stroke-width":"15px",stroke:"white"},e.link,{x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,ud))}});const dd=J({__name:"Links",props:{links:null},setup(e){var c;const n=Qt(e,"links"),i=U(null),r=ui(ji,U({})),a=ui(zi,U(void 0)),u=U((c=i.value)==null?void 0:c.getBoundingClientRect());mt(a,()=>{var d;return u.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),mi(()=>{var d;return u.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const l=w(()=>{var v,p;const d=r.value;return(p=(v=n.value)==null?void 0:v.filter(b=>{var g,C;return((g=d[b.startNode.id])==null?void 0:g.rect)&&((C=d[b.startNode.id])==null?void 0:C.rect)}))!=null?p:[]});return(d,v)=>(M(),A(re,null,[s(l)?(M(),A("svg",ra(Gt({key:0},d.$attrs)),[(M(!0),A(re,null,xn(s(l),(p,b)=>(M(),ne(cd,{key:b,link:p,boundingRect:u.value,startNode:s(r)[p.startNode.id],endNode:s(r)[p.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):G("",!0),N("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var pd=ve(dd,[["__scopeId","data-v-063f6d6b"]]);J({props:{nodes:{type:q(Array),required:!0},leftSideNodes:q(Array),rightSideNodes:q(Array),branches:q(Array)},components:{Links:pd},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=De(e),r=vt();St(()=>{const l=$e(t);r.value=fe(K(()=>f(re,null,[l.map(c=>f("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(Ct)]))])))});const a=vt();St(()=>{const l=$e(n);a.value=l?fe(K(()=>f("span",{class:"left-side-nodes small"},[l.map(Ct)]))):""});const u=vt();return St(()=>{const l=$e(i);u.value=l?fe(K(()=>f("span",{class:"side-nodes small"},[l.map(Ct)]))):""}),{unref:s,nodesComp:r,leftNodesComp:a,rightNodesComp:u}}});J({props:{display:q(Object,String,Function),visibility:{type:q(Number,Boolean),required:!0},style:q(String,Object,Array),classes:q(Object),onClick:Function,onHold:Function,color:q(String),glowColor:q(String),canClick:{type:q(Boolean),required:!0},mark:q(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Yn,Node:Jn},setup(e){const{onClick:t,onHold:n,display:i}=De(e),r=En(i),{start:a,stop:u}=Ir(t,n);return{start:a,stop:u,comp:r,unref:s,Visibility:ke,isCoercableComponent:It,isVisible:We,isHidden:vn}}});function jn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(l=>we(l.base)),n.baseText=t.map(l=>we(l.baseText)),n.visible=t.map(l=>we(l.visible)),n.title=t.map(l=>we(l.title)),n.subtitle=t.map(l=>we(l.subtitle)),i=!0),t}const a=dt({},!1);return[K(()=>{const l=r();let c=!0;const d=l.map((v,p)=>{var E,S,T;if(s(n.visible[p])===!1)return null;const b=f("h3",{onClick:()=>a.value[p]=!a.value[p],style:"cursor: pointer"},[f("span",{class:"modifier-toggle"+(s(a.value[p])?" collapsed":"")},[D("\u25BC")]),s(n.title[p]),s(n.subtitle[p])!=null?f("span",{class:"subtitle"},[D(" ("),s(n.subtitle[p]),D(")")]):null]),g=s(a.value[p])?null:f(re,null,[f("div",{class:"modifier-container"},[f("span",{class:"modifier-description"},[Ct((E=s(n.baseText[p]))!=null?E:"Base")]),f("span",{class:"modifier-amount"},[Ie((S=s(n.base[p]))!=null?S:1),v.unit])]),v.modifier.description==null?null:Ct(s(v.modifier.description))]),C=!c;c=!1;const _=(T=s(n.base[p]))!=null?T:1,x=v.modifier.apply(_);return f(re,null,[C?f("br",null,null):null,f("div",{style:{"--unit":de.alignUnits&&v.unit!=null?"'"+v.unit+"'":""}},[b,f("br",null,null),g,f("hr",null,null),f("div",{class:"modifier-container"},[f("span",{class:"modifier-description"},[D("Total")]),f("span",{class:"modifier-amount",style:(v.smallerIsBetter===!0?o.gt(x,_!=null?_:1):o.lt(x,_!=null?_:1))?"color: var(--danger)":""},[jt(x),v.unit])])])])});return f(re,null,[d])}),a]}function Di(e,t,n){const i=we(t),r=we(n);return w(()=>{const a=s(i),u=s(r);return o.gte(e.value,u)?"Now":o.lte(a,0)?"Never":hi(o.sub(u,e.value).div(a))})}function un(e,t,n=1){const i=we(t),r=we(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return K(()=>{var a;if(s(i)){const u=jt(e.evaluate()),l=jt(e.evaluate(o.add(s((a=e.innermostVariable)!=null?a:0),s(r))));return f(re,null,[f("b",null,[f("i",null,[u,D(" \u2192 "),l])])])}return f(re,null,[jt(e.evaluate())])})}const Mt={dirt:120,sand:60,gravel:40,wood:30,stone:24,coal:20,copper:15,iron:12,silver:10,gold:8,emerald:6,platinum:5,diamond:4,berylium:3,unobtainium:2,ultimatum:1},Vt=Object.keys(Mt),Be={dirt:{cost:1e3,name:"Pickaxe",type:"passive",state:"dirt"},sand:{cost:1e4,name:"Dowsing Rod",type:"dowsing",state:{resources:[],maxConnections:1,powered:!1}},gravel:{cost:1e5,name:"Ore Processor",type:"passive",state:"gravel"},wood:{cost:1e6,name:"Quarry",type:"quarry",state:{resources:[],maxConnections:1,powered:!1,progress:0}},stone:{cost:1e7,name:"Energizer",type:"passive",state:"stone"},coal:{cost:1e8,name:"Tool Empowerer",type:"empowerer",state:{tools:[],maxConnections:1,powered:!1}},copper:{cost:1e9,name:"Book",type:"passive",state:"copper"},iron:{cost:1e10,name:"Portal Generator",type:"portalGenerator",state:{tier:void 0,influences:[]}},silver:{cost:1e12,name:"Robotics",type:"passive",state:"silver"},gold:{cost:1e15,name:"Booster",type:"booster",state:{portals:[],maxConnections:1,powered:!1,level:1}},emerald:{cost:1e19,name:"AI",type:"passive",state:"emerald"},platinum:{cost:1e24,name:"Upgrader",type:"upgrader",state:{portals:[],maxConnections:1,powered:!1}},diamond:{cost:1e30,name:"ML",type:"passive",state:"diamond"},berylium:{cost:1e37,name:"Automator",type:"automator",state:{portals:[],maxConnections:1,powered:!1}},unobtainium:{cost:1e45,name:"National Grid",type:"passive",state:"unobtainium"},ultimatum:{cost:1e54,name:"Investments",type:"investments",state:{portals:[],maxConnections:1,powered:!1}}},Pt={dirt:"BOGO Coupon",sand:"Metal Detector",gravel:"Neural Nets",wood:"Mining Laser",stone:"Replicator",coal:"Planar Intelligence",copper:"Efficient Code",iron:"Trade Agreements",silver:"Machine Synergizer",gold:"XP Market",emerald:"Efficient Portals",platinum:"Time Dilation",diamond:"Paypal",berylium:"Tiered Mining",unobtainium:"OC'ed Portals",ultimatum:"Rebates"},fd={dirt:{description:e=>e?"Quadruples mining speed":"Doubles mining speed"},gravel:{description:e=>e?"Quadruples mine ore drops":"Doubles mine ore drops"},stone:{description:e=>e?"Quadruples energy gain":"Doubles energy gain"},copper:{description:e=>e?"Material level is 40% stronger":"Material level is 20% stronger"},silver:{description:e=>e?"Quadruples each plane's resource gain":"Doubles each plane's resource gain"},diamond:{description:e=>e?"+20% plane's resource gain per upgrade bought":"+10% plane's resource gain per upgrade bought"},emerald:{description:e=>e?"+2% plane's resource gain per minute active":"+1% plane's resource gain per minute active"},unobtainium:{description:e=>e?"+2 max connections per machine":"+1 max connections per machine"},dirtRelic:{description:e=>e?"2 free levels for repeatables":"1 free level for repeatables"},sandRelic:{description:e=>e?"Treasure's 2 tiers stronger":"Treasure's 1 tier stronger"},gravelRelic:{description:e=>e?"+2% plane's resource gain per repeatable purchase (diminishing)":"+1% plane's resource gain per repeatable purchase (diminishing)"},woodRelic:{description:e=>e?"(Relics)^2 boost mine speed":"Relics boost mine speed"},stoneRelic:{description:e=>e?"All upgrades apply twice":"Non-multiplicative upgrades apply twice"},coalRelic:{description:e=>e?"Every treasure boosts planar speed by +20%":"Every treasure boosts planar speed by +10%"},copperRelic:{description:e=>e?"Power 2 machines free":"Power 1 machine free"},ironRelic:{description:e=>e?"Conversions give quadruple output":"Conversions give double output"},silverRelic:{description:e=>e?"(Powered machines)^2 boost quarry speed":"Powered machines boost quarry speed"},goldRelic:{description:e=>e?"Each treasure gives +50% XP gain":"Each treasure gives +25% XP gain"},emeraldRelic:{description:e=>e?"Creating portals costs 20x less energy":"Creating portals costs 10x less energy"},platinumRelic:{description:e=>e?"Quadruple dimensions' tick rate":"Double dimensions' tick rate"},diamondRelic:{description:e=>e?"Repeatables/dimensions buy max at once":"Repeatables buy max at once"},beryliumRelic:{description:e=>e?"log(energy)^0.5 boosts planes' resource gain":"log(energy)^0.25 boosts planes' resource gain"},unobtainiumRelic:{description:e=>e?"Upgrades/repeatables/dimensions/prestige no longer spend on purchase":"Upgrades/repeatables no longer spend on purchase"}},_t={increaseResources:{display:"+resource",description:e=>{const t=e.data;return t.length===0?"Increase resource odds - Drag a resource to me!":t.length===1?`Increase ${t[0]}'s odds`:`Increase ${t.length} resources' odds`},cost:2,initialData:[]},decreaseResources:{display:"-resource",description:e=>{const t=e.data;return t.length===0?"Decrease resource odds - Drag a resource to me!":t.length===1?`Decrease ${t[0]}'s odds`:`Decrease ${t.length} resources' odds`},cost:2,initialData:[]},increaseLength:{display:"+length",description:"Increase length",cost:100,initialData:void 0},increaseCaches:{display:"+caches",description:"Increase caches odds",cost:10,initialData:void 0},increaseGens:{display:"+gens",description:"Increase generators odds",cost:10,initialData:void 0},increaseInfluences:{display:"+influences",description:"Increase influences odds",cost:10,initialData:void 0},increaseEnergyMults:{display:"+energy mults",description:"Increase energy mults odds",cost:10,initialData:void 0},increaseResourceMults:{display:"+resource mults",description:"Increase resource mults odds",cost:10,initialData:void 0},increaseDiff:{display:"+diff",description:"Increase difficulty/rewards odds",cost:10,initialData:void 0},decreaseDiff:{display:"-diff",description:"Decrease difficulty/rewards odds",cost:10,initialData:void 0},increaseRewards:{display:"+rewards",description:"Increase rewards level",cost:1e4,initialData:void 0},relic:{display:"+relic",description:"Max length/difficulty, add tier-unique relic",cost:1e6,initialData:void 0}},ai=m.variable(0).add(8).times(2).pow10();const gd=J({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(M(),A("div",{style:Le({width:e.width,height:e.height})},null,4))}});function On(e){return tt(t=>{var i;const n=e.call(t,t);return n.partialDisplay=r=>f("span",{style:s(n.requirementMet)?"":"color: var(--danger)"},[gi(n.resource,n.cost instanceof m?Jt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),n.display=r=>f("div",null,[s(n.requiresPay)?"Costs: ":"Requires: ",gi(n.resource,n.cost instanceof m?Jt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),$(n,"visibility"),oe(n,"visibility",ke.Visible),$(n,"cost"),$(n,"requiresPay"),oe(n,"requiresPay",!0),$(n,"cumulativeCost"),oe(n,"cumulativeCost",!0),$(n,"maxBulkAmount"),oe(n,"maxBulkAmount",1),$(n,"directSum"),oe(n,"pay",function(r){const a=n.cost instanceof m?Jt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost);n.resource.value=o.sub(n.resource.value,a).max(0)}),n.canMaximize=w(()=>{var l;if(!(n.cost instanceof m))return!1;const r=s(n.maxBulkAmount);if(o.lte(r,1))return!1;const a=s(n.cumulativeCost),u=(l=s(n.directSum))!=null?l:a?10:0;return o.lte(r,u)?!0:!(!n.cost.isInvertible()||a===!0&&!n.cost.isIntegrable())}),n.cost instanceof m?n.requirementMet=Pr(n.cost,n.resource,(i=n.cumulativeCost)!=null?i:!0,n.directSum,n.maxBulkAmount):n.requirementMet=w(()=>o.gte(n.resource.value,s(n.cost))),n})}function Xi(e){return tt(()=>({requirementMet:w(()=>We(e.visibility)),visibility:ke.None,requiresPay:!1}))}function md(e,t){return tt(()=>({requirementMet:we(e),partialDisplay:t==null?void 0:K(()=>Ct(t)),display:t==null?void 0:K(()=>f(re,null,[D("Req: "),Ct(t)])),visibility:t==null?ke.None:ke.Visible,requiresPay:!1}))}function _i(e){if(At(e))return e.every(_i);const t=s(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function Ur(e){if(At(e))return e.map(Ur).reduce(o.min);const t=s(e.requirementMet);return typeof t=="boolean"?t?o.dInf:0:o.gt(t,1)&&s(e.canMaximize)!==!0?1:t}function Ni(e,t=1){var n,i;if(At(e)&&(e=e.filter(r=>We(r.visibility)),e.length===1&&(e=e[0])),At(e)){e=e.filter(u=>"partialDisplay"in u);const r=e.filter(u=>s(u.requiresPay)),a=e.filter(u=>!s(u.requiresPay));return f(re,null,[r.length>0?f("div",null,[D("Costs:")," ",sr(r.map(u=>u.partialDisplay(t)),f(re,null,[D(", ")]))]):null,a.length>0?f("div",null,[D("Requires:")," ",sr(a.map(u=>u.partialDisplay(t)),f(re,null,[D(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:f(re,null,null)}function Wr(e,t=1){var n;At(e)?e.filter(i=>s(i.requiresPay)).forEach(i=>{var r;return(r=i.pay)==null?void 0:r.call(i,t)}):s(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}var vd=J({props:{visibility:{type:q(Number,Boolean),required:!0},display:q(Object,String,Function),earned:{type:q(Boolean),required:!0},requirements:q(Object,Array),image:q(String),style:q(String,Object,Array),classes:q(Object),mark:q(Boolean,String),small:q(Boolean),id:{type:String,required:!0}},components:{Node:Jn,MarkNode:Yn},setup(e){const{display:t,requirements:n,earned:i}=De(e),r=vt("");return St(()=>{const a=$e(t);if(a==null){r.value="";return}if(It(a)){r.value=fe(a);return}const u=fe(a.requirement?a.requirement:K(()=>{var d;return Ni((d=$e(n))!=null?d:[])}),"h3"),l=fe(a.effectDisplay||"","b"),c=$e(i)?fe(a.optionsDisplay||"","span"):"";r.value=fe(K(()=>f("span",null,[f(u,null,null),a.effectDisplay!=null?f("div",null,[f(l,null,null)]):null,a.optionsDisplay!=null?f("div",{class:"equal-spaced"},[f(c,null,null)]):null])))}),{comp:r,unref:s,Visibility:ke,isVisible:We,isHidden:vn}}});function hd(e,t,n,i,r,a){var c;const u=kt("MarkNode"),l=kt("Node");return e.isVisible(e.visibility)?(M(),A("div",{key:0,style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0,backgroundImage:e.earned&&e.image&&`url(${e.image})`||""},(c=e.unref(e.style))!=null?c:[]]),class:_e({feature:!0,achievement:!0,locked:!e.unref(e.earned),done:e.unref(e.earned),small:e.unref(e.small),...e.unref(e.classes)})},[e.comp?(M(),ne(Qe(e.comp),{key:0})):G("",!0),f(u,{mark:e.unref(e.mark)},null,8,["mark"]),f(l,{id:e.id},null,8,["id"])],6)):G("",!0)}var bd=ve(vd,[["render",hd],["__scopeId","data-v-5673325a"]]);const yd=vi(),wd=Symbol("Achievement");let Mn=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function _d(e,...t){const n=dt(!1,!1),i=t.reduce((r,a)=>{var u;return Object.assign(r,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return tt(r=>{var c,d,v;const a=(c=e==null?void 0:e.call(r,r))!=null?c:{};a.id=nn("achievement-"),a.type=wd,a[bt]=bd;for(const p of t)(d=p.preConstruct)==null||d.call(p,a);a.earned=n,a.complete=function(){var b,g;if(n.value)return;n.value=!0;const p=a;if((b=p.onComplete)==null||b.call(p),p.display!=null&&s(p.showPopups)===!0){const C=s(p.display);let _;It(C)?_=fe(C):C.requirement!=null?_=fe(C.requirement):_=Ni((g=p.requirements)!=null?g:[]),yd.info(f("div",null,[f("h3",null,[D("Treasure earned!")]),f("div",null,[f(_,null,null)])]))}},Object.assign(a,i),$(a,"visibility"),oe(a,"visibility",ke.Visible);const u=a.visibility;a.visibility=aa(()=>{const p=s(a.display);switch(de.msDisplay){default:case Mn.All:return s(u);case Mn.Configurable:return s(a.earned)&&!(p!=null&&typeof p=="object"&&"optionsDisplay"in p)?ke.None:s(u);case Mn.Incomplete:return s(a.earned)?ke.None:s(u);case Mn.None:return ke.None}}),$(a,"display"),$(a,"mark"),$(a,"small"),$(a,"image"),$(a,"style"),$(a,"classes"),$(a,"showPopups"),oe(a,"showPopups",!0);for(const p of t)(v=p.postConstruct)==null||v.call(p,a);const l=t.reduce((p,b)=>{var g;return Object.assign(p,(g=b.getGatheredProps)==null?void 0:g.call(b,a))},{});if(a[ft]=function(){const{visibility:p,display:b,requirements:g,earned:C,image:_,style:x,classes:E,mark:S,small:T,id:B}=this;return{visibility:p,display:b,requirements:g,earned:C,image:_,style:s(x),classes:E,mark:S,small:T,id:B,...l}},a.requirements){const p=a,b=[Xi(p),md(()=>!p.earned.value),...At(a.requirements)?a.requirements:[a.requirements]];St(()=>{de.active===Q.id&&_i(b)&&p.complete()})}return a})}et.on("loadSettings",e=>{oe(e,"msDisplay",Mn.All)});const Nd=Object.values(Mn).map(e=>({label:at(e),value:e}));ms(K(()=>f(Hi,{title:K(()=>f("span",{class:"option-title"},[D("Show achievements"),f("desc",null,[D("Select which achievements to display based on criterias.")])])),options:Nd,"onUpdate:modelValue":e=>de.msDisplay=e,modelValue:de.msDisplay},null)));const Cd=J({props:{progress:{type:q(String,Object,Number),required:!0},width:{type:q(Number),required:!0},height:{type:q(Number),required:!0},direction:{type:q(String),required:!0},display:q(Object,String,Function),visibility:{type:q(Number,Boolean),required:!0},style:q(Object,String,Array),classes:q(Object),borderStyle:q(Object,String,Array),textStyle:q(Object,String,Array),baseStyle:q(Object,String,Array),fillStyle:q(Object,String,Array),mark:q(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Yn,Node:Jn},setup(e){const{progress:t,width:n,height:i,direction:r,display:a}=De(e),u=w(()=>{let d=t.value instanceof o?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),l=w(()=>{const d={width:$e(n)+.5+"px",height:$e(i)+.5+"px"};switch(s(r)){case H.Up:d.clipPath=`inset(${u.value}% 0% 0% 0%)`,d.width=$e(n)+1+"px";break;case H.Down:d.clipPath=`inset(0% 0% ${u.value}% 0%)`,d.width=$e(n)+1+"px";break;case H.Right:d.clipPath=`inset(0% ${u.value}% 0% 0%)`;break;case H.Left:d.clipPath=`inset(0% 0% 0% ${u.value} + '%)`;break;case H.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),c=En(a);return{normalizedProgress:u,barStyle:l,component:c,unref:s,Visibility:ke,isVisible:We,isHidden:vn}}});function kd(e,t,n,i,r,a){var c,d,v,p,b,g,C;const u=kt("MarkNode"),l=kt("Node");return e.isVisible(e.visibility)?(M(),A("div",{key:0,style:Le([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:_e({bar:!0,...e.unref(e.classes)})},[N("div",{class:"overlayTextContainer border",style:Le([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(M(),A("span",{key:0,class:"overlayText",style:Le(e.unref(e.textStyle))},[(M(),ne(Qe(e.component)))],4)):G("",!0)],4),N("div",{class:"border",style:Le([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(v=e.unref(e.style))!=null?v:{},(p=e.unref(e.baseStyle))!=null?p:{},(b=e.unref(e.borderStyle))!=null?b:{}])},[N("div",{class:"fill",style:Le([e.barStyle,(g=e.unref(e.style))!=null?g:{},(C=e.unref(e.fillStyle))!=null?C:{}])},null,4)],4),f(u,{mark:e.unref(e.mark)},null,8,["mark"]),f(l,{id:e.id},null,8,["id"])],6)):G("",!0)}var Md=ve(Cd,[["render",kd],["__scopeId","data-v-6bd06b56"]]);const Sd=Symbol("Bar");function Id(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return tt(i=>{var u,l;const r=e.call(i,i);r.id=nn("bar-"),r.type=Sd,r[bt]=Md;for(const c of t)(u=c.preConstruct)==null||u.call(c,r);Object.assign(r,n),$(r,"visibility"),oe(r,"visibility",ke.Visible),$(r,"width"),$(r,"height"),$(r,"direction"),$(r,"style"),$(r,"classes"),$(r,"borderStyle"),$(r,"baseStyle"),$(r,"textStyle"),$(r,"fillStyle"),$(r,"progress"),$(r,"display"),$(r,"mark");for(const c of t)(l=c.postConstruct)==null||l.call(c,r);const a=t.reduce((c,d)=>{var v;return Object.assign(c,(v=d.getGatheredProps)==null?void 0:v.call(d,r))},{});return r[ft]=function(){const{progress:c,width:d,height:v,direction:p,display:b,visibility:g,style:C,classes:_,borderStyle:x,textStyle:E,baseStyle:S,fillStyle:T,mark:B,id:le}=this;return{progress:c,width:d,height:v,direction:p,display:b,visibility:g,style:s(C),classes:_,borderStyle:x,textStyle:E,baseStyle:S,fillStyle:T,mark:B,id:le,...a}},r})}function xd(e,...t){return tt(n=>{var r,a;const i=e.call(n,n);for(const u of t)(r=u.preConstruct)==null||r.call(u,i);i.formula=i.formula(m.variable(i.baseResource)),i.currentGain==null&&(i.currentGain=w(()=>{let u=o.floor(i.formula.evaluate(i.baseResource.value)).max(0);return s(i.buyMax)===!1&&(u=u.min(1)),u})),i.actualGain==null&&(i.actualGain=i.currentGain),i.currentAt==null&&(i.currentAt=w(()=>i.formula.invert(o.floor(s(i.currentGain))))),i.nextAt==null&&(i.nextAt=w(()=>i.formula.invert(o.floor(s(i.currentGain)).add(1)))),i.convert==null&&(i.convert=function(){var l;const u=s(i.currentGain);i.gainResource.value=o.add(i.gainResource.value,u),i.spend(u),(l=i.onConvert)==null||l.call(i,u)}),i.spend==null&&(i.spend=function(){i.baseResource.value=0}),$(i,"currentGain"),$(i,"actualGain"),$(i,"currentAt"),$(i,"nextAt"),$(i,"buyMax"),oe(i,"buyMax",!0);for(const u of t)(a=u.postConstruct)==null||a.call(u,i);return i})}function $d(e){return xd(e)}function Ed(e,t,n=1,i=o.dInf){const r=we(n),a=we(i);e.on("preUpdate",u=>{const l=s(r);o.neq(l,0)&&(t.gainResource.value=o.add(t.gainResource.value,o.times(l,u).times(o.ceil(s(t.actualGain)))).min(s(a)).max(t.gainResource.value))})}const Pd={postConstruct(e){e.amount===void 0&&console.error(`Decorated feature ${e.id} does not contain the required 'amount' property"`),$(e,"bonusAmount"),e.totalAmount===void 0&&(e.totalAmount=w(()=>{var t;return o.add(s((t=e.amount)!=null?t:0),s(e.bonusAmount))}))}},Hr=Symbol("Repeatable");function ur(e,...t){const n=dt(0),i=t.reduce((r,a)=>{var u;return Object.assign(r,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return tt(r=>{var b,g,C;const a=e.call(r,r);a.id=nn("repeatable-"),a.type=Hr,a[bt]=zr;for(const _ of t)(b=_.preConstruct)==null||b.call(_,a);a.amount=n,a.amount[en]=(g=a.initialAmount)!=null?g:0,Object.assign(a,i);const u={requirementMet:w(()=>o.sub(s(a.limit),a.amount.value)),requiresPay:!1,visibility:ke.None,canMaximize:!0},l=Xi(a);At(a.requirements)?(a.requirements.unshift(l),a.requirements.push(u)):a.requirements=[l,a.requirements,u],a.maxed=w(()=>o.gte(a.amount.value,s(a.limit))),$(a,"classes");const c=a.classes;a.classes=w(()=>{const _=s(c)||{};return a.maxed.value&&(_.bought=!0),_}),a.amountToIncrease=w(()=>o.clampMin(Ur(a.requirements),1)),a.canClick=w(()=>_i(a.requirements));const d=a.onClick;a.onClick=function(_){var S;const x=a;if(!s(x.canClick))return;const E=(S=s(a.amountToIncrease))!=null?S:1;Wr(a.requirements,E),x.amount.value=o.add(x.amount.value,E),d==null||d(_)},$(a,"display");const v=a.display;a.display=K(()=>{var x,E,S;const _=s(v);if(It(_)){const T=fe(_);return f(T,null,null)}if(_!=null){const T=a,B=fe((x=_.title)!=null?x:"","h3"),le=fe((E=_.description)!=null?E:""),ue=fe((S=_.effectDisplay)!=null?S:"");return f("span",null,[_.title==null?null:f("div",null,[f(B,null,null)]),_.description==null?null:f(le,null,null),_.showAmount===!1?null:f("div",null,[f("br",null,null),f(re,null,[D("Amount: "),pt(T.amount.value)]),o.isFinite(s(T.limit))?f(re,null,[D(" / "),pt(s(T.limit))]):void 0]),_.effectDisplay==null?null:f("div",null,[f("br",null,null),D("Currently: "),f(ue,null,null)]),T.maxed.value?null:f("div",null,[f("br",null,null),Ni(T.requirements,s(a.amountToIncrease))])])}return""}),$(a,"visibility"),oe(a,"visibility",ke.Visible),$(a,"limit"),oe(a,"limit",o.dInf),$(a,"style"),$(a,"mark"),$(a,"small");for(const _ of t)(C=_.postConstruct)==null||C.call(_,a);const p=t.reduce((_,x)=>{var E;return Object.assign(_,(E=x.getGatheredProps)==null?void 0:E.call(x,a))},{});return a[ft]=function(){const{display:_,visibility:x,style:E,classes:S,onClick:T,canClick:B,small:le,mark:ue,id:te}=this;return{display:_,visibility:x,style:s(E),classes:S,onClick:T,canClick:B,small:le,mark:ue,id:te,...p}},a})}const Dd=Symbol("Reset");function Td(e){return tt(t=>{const n=e.call(t,t);return n.id=nn("reset-"),n.type=Dd,n.reset=function(){var r;const i=a=>{if(a!=null&&typeof a=="object"&&!(a instanceof o)&&!(a instanceof m)){if(Xn in a&&a[Xn]===!0)return;if(en in a){const u=a;u.value=u[en]}else!(a instanceof o)&&!Fe(a)&&Object.values(a).forEach(u=>i(u))}};s(n.thingsToReset).forEach(i),et.emit("reset",n),(r=n.onReset)==null||r.call(n)},$(n,"thingsToReset"),n})}const si={};et.on("removeLayer",e=>{var t;(t=si[e.id])==null||t.call(si),si[e.id]=void 0});function Ti(e,t){return $(t,"display"),$(t,"classes"),$(t,"style"),$(t,"direction"),oe(t,"direction",H.Up),$(t,"xoffset"),$(t,"yoffset"),t.pinnable&&(t.pinned=dt(!1,!1)),zt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,Dr(t.pinned)):e.pinned=t.pinned);const n=e[bt];e[bt]=Re;const i=e[ft].bind(e);e[ft]=function(){const{display:a,classes:u,style:l,direction:c,xoffset:d,yoffset:v,pinned:p}=this;return{element:{[bt]:n,[ft]:i},display:a,classes:u,style:s(l),direction:c,xoffset:d,yoffset:v,pinned:p}}.bind(t)}),t}var Ad=J({props:{display:{type:q(String,Object,Function),required:!0},visibility:{type:q(Number,Boolean),required:!0},style:q(String,Object,Array),classes:q(Object),requirements:{type:Object,required:!0},canPurchase:{type:q(Boolean),required:!0},bought:{type:q(Boolean),required:!0},mark:q(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:Jn,MarkNode:Yn},setup(e){const{display:t,requirements:n,bought:i}=De(e),r=vt("");return St(()=>{const a=$e(t);if(a==null){r.value="";return}if(It(a)){r.value=fe(a);return}const u=fe(a.title||"","h3"),l=fe(a.description,"div"),c=fe(a.effectDisplay||"");r.value=fe(K(()=>f("span",null,[a.title!=null?f("div",null,[f(u,null,null)]):null,f(l,null,null),a.effectDisplay!=null?f("div",null,[D("Currently: "),f(c,null,null)]):null,i.value?null:f(re,null,[f("br",null,null),Ni(n.value)])])))}),{component:r,unref:s,Visibility:ke,isVisible:We,isHidden:vn}}});const Rd=["disabled"];function Fd(e,t,n,i,r,a){var c;const u=kt("MarkNode"),l=kt("Node");return e.isVisible(e.visibility)?(M(),A("button",{key:0,style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...d)=>e.purchase&&e.purchase(...d)),class:_e({feature:!0,upgrade:!0,can:e.unref(e.canPurchase),locked:!e.unref(e.canPurchase),bought:e.unref(e.bought),...e.unref(e.classes)}),disabled:!e.unref(e.canPurchase)},[e.unref(e.component)?(M(),ne(Qe(e.unref(e.component)),{key:0})):G("",!0),f(u,{mark:e.unref(e.mark)},null,8,["mark"]),f(l,{id:e.id},null,8,["id"])],14,Rd)):G("",!0)}var Od=ve(Ad,[["render",Fd],["__scopeId","data-v-9be6bac0"]]);const Yi=Symbol("Upgrade");function cr(e,...t){const n=dt(!1,!1),i=t.reduce((r,a)=>{var u;return Object.assign(r,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return tt(r=>{var c,d;const a=e.call(r,r);a.id=nn("upgrade-"),a.type=Yi,a[bt]=Od;for(const v of t)(c=v.preConstruct)==null||c.call(v,a);a.bought=n,Object.assign(a,i),a.canPurchase=w(()=>!n.value&&_i(a.requirements)),a.purchase=function(){var p;const v=a;!s(v.canPurchase)||(Wr(a.requirements),n.value=!0,(p=v.onPurchase)==null||p.call(v))};const u=Xi(a);At(a.requirements)?a.requirements.unshift(u):a.requirements=[u,a.requirements],$(a,"visibility"),oe(a,"visibility",ke.Visible),$(a,"classes"),$(a,"style"),$(a,"display"),$(a,"mark");for(const v of t)(d=v.postConstruct)==null||d.call(v,a);const l=t.reduce((v,p)=>{var b;return Object.assign(v,(b=p.getGatheredProps)==null?void 0:b.call(p,a))},{});return a[ft]=function(){const{display:v,visibility:p,style:b,classes:g,requirements:C,canPurchase:_,bought:x,mark:E,id:S,purchase:T}=this;return{display:v,visibility:p,style:s(b),classes:g,requirements:C,canPurchase:_,bought:x,mark:E,id:S,purchase:T,...l}},a})}function qd(e,t,n=[]){n=n.length===0?Hn(e,Yi):n;const i=Un(t)?w(t):t;e.on("update",()=>{s(i)&&n.forEach(r=>r.purchase())})}function Vd(e,t,n,i){return function(){e>>>=0,t>>>=0,n>>>=0,i>>>=0;let r=e+t|0;return e=t^t>>>9,t=n+(n<<3)|0,n=n<<21|n>>>11,i=i+1|0,r=r+i|0,n=n+r|0,(r>>>0)/4294967296}}const Bd={1:["b","c","d","f","g","h","i","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z"],2:["a","e","o","u"],3:["br","cr","dr","fr","gr","pr","str","tr","bl","cl","fl","gl","pl","sl","sc","sk","sm","sn","sp","st","sw","ch","sh","th","wh"],4:["ae","ai","ao","au","a","ay","ea","ei","eo","eu","e","ey","ua","ue","ui","uo","u","uy","ia","ie","iu","io","iy","oa","oe","ou","oi","o","oy"],5:["turn","ter","nus","rus","tania","hiri","hines","gawa","nides","carro","rilia","stea","lia","lea","ria","nov","phus","mia","nerth","wei","ruta","tov","zuno","vis","lara","nia","liv","tera","gantu","yama","tune","ter","nus","cury","bos","pra","thea","nope","tis","clite"],6:["una","ion","iea","iri","illes","ides","agua","olla","inda","eshan","oria","ilia","erth","arth","orth","oth","illon","ichi","ov","arvis","ara","ars","yke","yria","onoe","ippe","osie","one","ore","ade","adus","urn","ypso","ora","iuq","orix","apus","ion","eon","eron","ao","omia"]},dr=[[1,2,5],[2,3,6],[3,4,5],[4,3,6],[3,4,2,5],[2,1,3,6],[3,4,2,5],[4,3,1,6],[3,4,1,4,5],[4,1,4,3,6]];function Ai(e){const t=dr[Math.floor(e()*dr.length)];let n="";for(let i=0;in-n*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}const fr=vi();function Zr(e,t,n,i){return Gi(e,function(){const r=Vd(0,n>>0,n>>32,1);for(let V=0;V<12;V++)r();const a=Ai(r),u=qn([.64,.75,.55],r),l=qn([.18,.2,.25],r),c=kn(0,Ai(r)),d=dt(0),v=Vt.indexOf(t);let p=r();const b=i.reduce((V,j)=>(V[j.type]=j.data,V),{});"increaseDiff"in b&&(p=p/2+.5),"decreaseDiff"in b&&(p=p/2),"relic"in b&&(p=1);const g=p+v+1,C=h.toolNodes.value.sandRelic!=null?ee("sandRelic")?2:1:0,_=dt(C),x=w(()=>("increaseRewards"in b?g+1:g)+_.value);let E="relic"in b?v+2:Math.ceil(r()*(v+2));"increaseLength"in b&&E++;const S=[],T=wt(()=>S),B=w(()=>T.apply(0)),le=[],ue={};function te({feature:V,canClick:j,modifier:xe,cost:it,previewModifier:_n,showETA:ze,previewCost:$t}){j=we(j),ze=we(ze);const Ot=or(V);le.push({shouldShowPreview:w(()=>s(j)&&Ot.value),modifier:wt(()=>{const Et=S.slice();return Et.splice(Et.indexOf(xe),1,_n),Et}),cost:$t!=null?$t:it}),S.push(xe);const qt=Di(c,B,()=>Me(it)),st=Ti(V,{display:ze==null?qt:()=>s(ze)?qt.value:"",direction:H.Down});return{isHovering:Ot,eta:qt,tooltip:st}}const X=[],Se=U(0);let L=m.variable(Se).times(0),ae=0,Te=!0;const Xe=w(()=>o.add(g,r()-.5).pow_base(2).times(10).times(L.evaluate())),Ht=[];for(let V=0;V=E-1?0:4};switch(oi(j,r)){case"upgrades":const F=[];for(let O=0;O<4;O++){const Ae=oi({add:1,mult:V===0&&O===0?0:1},r),qe=Xe.value,Ge=Cn(r);let Ve="",Ye,ge;switch(Ae){case"add":{const ce=o.add(qe,10).pow(r()/4+1);Ve=`Gain ${Ie(ce)} ${c.displayName}/s`,L=L.add(ce),Ye=rt=>Lt(()=>({addend:ce,description:Ge,enabled:rt==null?he.bought:()=>rt()&&he.bought.value})),ge=Lt(()=>({addend:ce}));break}case"mult":{const ce=r()*5+1;Ve=`Multiply previous ${c.displayName} gain by x${Ie(ce)}.`;const rt=ae;L=L.add(o.sub(ce,1).times(rt)),Ye=He=>Ce(()=>({multiplier:ce,description:Ge,enabled:He==null?he.bought:()=>He()&&he.bought.value})),ge=Ce(()=>({multiplier:ce}));break}}ae=L.evaluate(),Se.value++;const Pe=Te,he=cr(()=>({requirements:On(()=>({resource:Nn(c),cost:qe,requiresPay:()=>h.toolNodes.value.unobtainiumRelic==null})),display:{title:Ge,description:Ve},visibility:Pe}));te({feature:he,canClick:()=>he.canPurchase.value,modifier:Ye(),cost:qe,previewCost:w(()=>h.toolNodes.value.unobtainiumRelic==null?qe:0),showETA:()=>!he.bought.value,previewModifier:ge}),S.push(Ye(()=>Ae==="add"?h.toolNodes.value.stoneRelic!=null:ee("stoneRelic"))),F.push(he)}X.push(F);break;case"repeatables":const z=[];for(let O=0;O<3;O++){const Ae=oi({add:1.5,mult:3},r),qe=Se.value,Ge=Xe.value,Ve=Cn(r);let Ye="",ge,Pe,he,ce;const rt=m.variable(w(()=>se.amount.value)).times(2);switch(Ae){case"add":{const Ze=o.add(Ge,10).times(r()+.5);Ye=`Gain ${Ie(Ze)} ${c.displayName}/s`,ce=rt.add(1).times(Ge),L=L.add(w(()=>o.sub(Se.value,qe).times(2).add(1).pow(2).clampMax(100).times(Ze))),ge=w(()=>Ie(o.times(Ze,s(se.totalAmount)))+"/s"),Pe=Lt(()=>({addend:()=>o.times(Ze,s(se.totalAmount)),description:Ve,enabled:()=>o.gt(s(se.totalAmount),0)})),he=Lt(()=>({addend:()=>o.add(s(se.totalAmount),se.amountToIncrease.value).times(Ze)}));break}case"mult":{const Ze=r()*.75+1.25;Ye=`Multiply previous ${c.displayName} gain by x${Ie(Ze)}.`,ce=rt.add(1).times(Ge);const ot=ae;L=L.add(w(()=>o.sub(Se.value,qe).times(2).add(1).pow(2).clampMax(100).pow_base(Ze).sub(1).times(ot))),ge=w(()=>"x"+Ie(o.pow(Ze,s(se.totalAmount)))),Pe=Ce(()=>({multiplier:()=>o.pow(Ze,s(se.totalAmount)),description:Ve,enabled:()=>o.gt(s(se.totalAmount),0)})),he=Ce(()=>({multiplier:()=>o.add(s(se.totalAmount),se.amountToIncrease.value).pow_base(Ze)}));break}}ae=L.evaluate(),Se.value++;const He=Te,se=ur(()=>({requirements:On(()=>({resource:Nn(c),cost:ce,maxBulkAmount:()=>h.toolNodes.value.diamondRelic!=null?o.dInf:1,requiresPay:()=>h.toolNodes.value.unobtainiumRelic==null})),display:()=>({title:Ve,description:`${Ye}

Amount: ${pt(se.amount.value)}${o.gt(s(se.bonusAmount),0)?` [+${pt(s(se.bonusAmount))}]`:""}`,effectDisplay:s(ge),showAmount:!1}),visibility:He,limit:100,bonusAmount:()=>o.gt(se.amount.value,0)?ee("dirtRelic")?2:h.toolNodes.value.dirtRelic!=null?1:0:0}),Pd);te({feature:se,canClick:()=>s(se.canClick),modifier:Pe,cost:ce,previewModifier:he,previewCost:w(()=>h.toolNodes.value.unobtainiumRelic==null?Jt(ce,se.amountToIncrease.value):0),showETA:()=>!se.maxed.value}),z.push(se)}X.push(z);break;case"conversion":{const O=kn(0,Ai(r)),W=qn([.64,.75,.55],r),Ae=Xe.value,qe=r()/2+.25,Ge=r()/2+.25,Ve=Se.value,Ye=ae;L=L.add(w(()=>o.sub(Se.value,Ve).add(1).times(2).pow10().times(Ye)));const ge=$d(()=>({baseResource:Nn(c),gainResource:O,formula:xi=>xi.div(Ae).pow(qe).times(w(()=>h.toolNodes.value.ironRelic!=null?ee("ironRelic")?4:2:1)),spend(){c.value=0}}));ae=L.evaluate(),Se.value+=2;const Pe=Te,he=Cn(r),ce=m.variable(O).pow(Ge).add(1),rt=Ce(()=>({multiplier:()=>ce.evaluate(),description:he,enabled:()=>o.gt(O.value,0)})),He=Ce(()=>({multiplier:()=>ce.evaluate(o.add(O.value,ge.actualGain.value))})),se=od(()=>({display:{title:he,description:K(()=>f("span",null,[D("Reset "),c.displayName,D(" for")," ",gi(O,o.clampMin(ge.actualGain.value,1))," ",O.displayName,f("br",null,null),f("div",null,[D("Next:")," ",gi(c,o.lt(ge.actualGain.value,1)?ge.currentAt.value:ge.nextAt.value)," ",c.displayName])]))},style:{width:"200px",minHeight:"100px"},canClick:()=>o.gte(ge.actualGain.value,1),prestigeResource:O,onClick:ge.convert,visibility:Pe})),{isHovering:Ze}=te({feature:se,canClick:()=>s(se.canClick),modifier:rt,cost:Ae,previewCost:c,previewModifier:He}),ot=w(()=>Ze.value&&se.canClick.value);X.push([se]);const Fn=un(m.variable(O),ot,ge.actualGain),Je=un(ce,ot,ge.actualGain);ue[V*2]=K(()=>f(re,null,[We(se.visibility)?f("div",{style:"margin: 10px"},[D("You have")," ",f("h2",{style:{color:W,textShadow:`0px 0px 10px ${W}`}},[Fn()])," ",O.displayName,D(","),f("br",null,null),D("providing a "),Je(),D("x multiplier to previous")," ",c.displayName,D(" gain")]):null,Pi(se)])),Ed(this,ge,()=>nt.value.lengthJt(ge,Pe.value,!0,10)),ce=w(()=>Jt(ge,o.add(Pe.value,1),!0,10)),rt=w(()=>o.pow(Ye,Pe.value)),He=Ce(()=>({multiplier:rt,description:qe,enabled:()=>We(ot.visibility)})),se=ae;L=L.add(w(()=>o.sub(Se.value,Ae).add(1).times(3).pow(Ye).times(se))),ae=L.evaluate(),Se.value+=3;const Ze=qn([.64,.75,.55],r),ot=Id(()=>({direction:H.Right,width:300,height:20,progress:()=>o.sub(O.value,he.value).div(o.sub(ce.value,he.value)).toNumber(),visibility:W,xp:O,display:K(()=>f("span",null,[Ie(O.value),D("/"),Ie(ce.value)])),fillStyle:`background-color: ${Ze}`,textStyle:"text-shadow: 5px 0 10px black"}));this.on("preUpdate",Fn=>{if(nt.value.lengthJe.state.id===e)&&We(ot.visibility)){let Je=o.times(xt.value,Fn);h.toolNodes.value.goldRelic!=null&&(Je=o.times(ee("goldRelic")?.5:.25,nt.value.length).add(1).times(Je)),O.value=o.add(Je,O.value)}}),S.push(He),X.push([ot]),ue[V*2]=K(()=>f(re,null,[We(ot.visibility)?f("div",{style:"margin: 10px"},[D("You have "),f("h3",null,[qe]),D(" Lv. "),pt(Pe.value),D(","),f("br",null,null),D("providing a "),Ie(rt.value),D("x multiplier to previous")," ",c.displayName,D(" gain"),f("br",null,null)]):null,Pi(ot)]));break}case"dimensions":{const O=Cn(r),W=kn(0,O+" energy"),Ae=qn([.64,.75,.55],r),qe=Se.value,Ge=ae;L=L.add(w(()=>o.sub(Se.value,qe).add(1).pow_base(32).add(1).log2().add(1).times(Ge)));const Ve=w(()=>o.add(W.value,1).log2().add(1)),Ye=Ce(()=>({multiplier:Ve,description:O,enabled:()=>o.gt(W.value,0)}));S.push(Ye);const ge=Te,Pe=[];for(let he=0;he<4;he++){const ce=o.add(g,r()-.5).pow_base(2).times(10).recip(),rt=Xe.value,He=m.variable(w(()=>Je.amount.value)),se=He.pow_base(o.pow10(he+1)).times(rt),Ze=["First","Second","Third","Fourth"][he]+" "+O+" Dimension",ot=kn(0,Ze),Fn=He.sub(1).pow_base(2).times(ce).times(w(()=>o.add(Je.amount.value,ot.value))),Je=ur(()=>({display:{title:Ze,description:K(()=>f("div",null,[f("div",null,[D("Amount:")," ",Ie(o.add(ot.value,Je.amount.value))," ",D("["),pt(Je.amount.value),D("]")])])),effectDisplay:K(()=>f("span",null,[Yr()," ",he===0?W.displayName:["First","Second","Third","Fourth"][he-1]+" "+O+" Dimension",D("/s")])),showAmount:!1},style:{width:"400px"},effect:Fn,dimensions:ot,limit:100,energy:he===0?W:void 0,requirements:On(()=>({resource:Nn(c),cost:se,maxBulkAmount:()=>ee("diamondRelic")!=null?o.dInf:1,requiresPay:()=>!ee("unobtainiumRelic")})),visibility:ge}));Pe.push(Je);const xi=or(Je),Ki=w(()=>s(Je.canClick)&&xi.value),Xr=new m({inputs:[He],evaluate(Qi){return o.sub(Qi,1).pow_base(2).times(ce).times(o.add(Qi,ot.value))}}),Yr=un(Xr,Ki);le.push({shouldShowPreview:Ki,cost:w(()=>ee("unobtainiumRelic")?0:Jt(se,Je.amountToIncrease.value))});const Jr=Di(c,B,()=>Me(se));Ti(Je,{display:Jr,direction:H.Down}),ae=L.evaluate(),Se.value++}this.on("preUpdate",he=>{if(nt.value.lengthce.state.id===e)&&We(ge)){let ce=o.times(xt.value,he);h.toolNodes.value.platinumRelic!=null&&(ce=o.times(ee("platinumRelic")?4:2,ce));const rt=Pe[0].effect.evaluate();W.value=o.times(rt,ce).add(W.value);for(let He=1;He<4;He++){const se=Pe[He].effect.evaluate();Pe[He-1].dimensions.value=o.times(se,ce).add(Pe[He-1].dimensions.value)}}}),X.push(Pe),ue[V*2]=K(()=>f(re,null,[We(ge)?f("div",{style:"margin: 10px"},[D("You have")," ",f("h2",{style:{color:Ae,textShadow:`0px 0px 10px ${Ae}`}},[Ie(W.value)])," ",W.displayName,D(","),f("br",null,null),D("providing a "),Ie(Ve.value),D("x multiplier to previous")," ",c.displayName,D(" gain")]):null,Ns(...Pe)]));break}case"prestige":{const O=Cn(r),W=Te,Ae=r()/10+1.1,qe=Xe.value;L=L.pow(Ae);const Ge=Xc(()=>({exponent:Ae,description:O,enabled:ge.bought}));ae=L.evaluate(),Se.value+=20;const Ve=X.filter((he,ce)=>ce%2===0),Ye=Td(()=>({thingsToReset:Ve,onReset(){c.value=0}})),ge=cr(()=>({display:{title:O,description:`Reset all previous ${a} content to raise all previous ${c.displayName} gain to the ^${Ie(Ae)}`},style:{width:"200px",minHeight:"100px"},onPurchase:()=>{ee("unobtainiumRelic")||Ye.reset()},visibility:W,requirements:On(()=>({resource:Nn(c),cost:qe,requiresPay:!1}))})),Pe=Ce(()=>({multiplier:0}));te({feature:ge,canClick:()=>s(ge.canPurchase),modifier:Ge,cost:qe,previewCost:w(()=>ee("unobtainiumRelic")?0:c.value),previewModifier:Pe,showETA:()=>!s(ge.bought)}),X.push([ge]);break}}const it={cache:"increaseCaches"in b?10:1,generation:"increaseGens"in b?10:1,resourceMulti:"increaseResourceMults"in b?10:1,energyMulti:"increaseEnergyMults"in b?2.5:.25,influences:Object.keys(h.influenceNodes.value).length+Ht.length===Object.keys(_t).length?0:"increaseInfluences"in b?20:2,relic:0};let _n=oi(it,r);V===E-1&&"relic"in b&&(_n="relic");let ze="",$t,Ot,qt,st,Et,an;switch(_n){case"cache":st=Ri(r,i),ze=`Gain ${Ie(o.div(x.value,12))}x your current ${st} (no modifiers).`,Ot=()=>{var O,W,Ae;return h.grantResource(st,o.times((Ae=(W=(O=h.resourceNodes.value[st])==null?void 0:O.state)==null?void 0:W.amount)!=null?Ae:0,o.div(x.value,12)))};break;case"generation":st=Ri(r,i);const F=o.div(x.value,40).times(Mt[st]);ze=`Gain ${Ie(F)} ${st}/s while plane is active.`,$t=O=>h.grantResource(st,o.times(O,F)),qt=w(()=>h.resourceNodes.value[st]);break;case"resourceMulti":Et=st=Ri(r,i),an=o.div(x.value,10).pow_base(2),ze=`Gain ${Ie(an)}x ${st} while plane is active.`;break;case"energyMulti":Et="energy",an=o.div(x.value,8).add(1),ze=`Gain ${Ie(an)}x energy while plane is active.`;break;case"influences":const z=Object.keys(_t)[Math.floor(r()*Object.keys(_t).length)];Ht.push(z),ze=`Gain a portal influence (${_t[z].display})`,Ot=()=>{if(z in h.influenceNodes.value){fr.warning(`Error: ignoring duplicate portal influence (${_t[z].display})`);return}const O={id:$n(h.board),position:{...h.board.types.portal.nodes.value.find(W=>W.state.id===e).position},type:"influence",state:{type:z,data:_t[z].initialData}};h.board.placeInAvailableSpace(O),h.board.nodes.value.push(O)};break;case"relic":ze=t==="ultimatum"?"Win the game!":`Gain the ${t}-tier planar relic (${Pt[t]})`,Ot=()=>{if(t==="ultimatum"){Ji.value=!0;return}if(`${t}Relic`in h.toolNodes.value)fr.warning(`Error: ignoring duplicate relic (${Pt[t]})`);else{const O={id:$n(h.board),position:{...h.board.types.portal.nodes.value.find(W=>W.state.id===e).position},type:"passive",state:`${t}Relic`};h.board.placeInAvailableSpace(O),h.board.nodes.value.push(O)}}}const ii=Te,Rn=Xe.value,I=_d(()=>({requirements:On(()=>({resource:Nn(c),cost:Rn})),visibility:ii,display:{requirement:`${Ie(Rn)} ${c.displayName}`,effectDisplay:ze},style:"width: 100%",classes:{final:V===E-1},update:$t,onComplete:Ot,link:qt,effectedResource:Et,resourceMulti:an})),P=Di(c,B,Rn);Ti(I,{display:()=>I.earned.value?"":P.value,direction:H.Down}),X.push([I]),Te=w(()=>I.earned.value)}const ut=Hn(X,Yi),Dn=Hn(X,Hr);S.push(Ce(()=>({multiplier:()=>ee("silver")?4:2,description:()=>(ee("silver")?"Empowered ":"")+Be.silver.name,enabled:()=>h.toolNodes.value.silver!=null})),Ce(()=>({multiplier:()=>o.add(1,(ee("diamond")?2:1)*ut.filter(V=>V.bought.value).length/10),description:()=>(ee("diamond")?"Empowered ":"")+Be.diamond.name,enabled:()=>h.toolNodes.value.diamond!=null})),Ce(()=>({multiplier:()=>o.div(d.value,6e3).times(ee("emerald")?2:1).add(1),description:()=>(ee("emerald")?"Empowered ":"")+Be.emerald.name,enabled:()=>h.toolNodes.value.emerald!=null})),Ce(()=>({multiplier:()=>o.div(Dn.reduce((V,j)=>V.add(s(j.totalAmount)),o.dZero),100).times(ee("gravelRelic")?2:1).add(1).pow(.75),description:()=>(ee("gravelRelic")?"Empowered ":"")+Pt.gravel,enabled:()=>h.toolNodes.value.gravelRelic!=null})),Ce(()=>({multiplier:()=>o.add(h.energy.value,1).log10().add(1).pow(ee("beryliumRelic")?.5:.25),description:()=>(ee("beryliumRelic")?"Empowered ":"")+Pt.berylium,enabled:()=>h.toolNodes.value.beryliumRelic!=null})));const yn=wt(()=>[Ce(()=>({multiplier:()=>{var V,j,xe;return o.add((xe=(j=(V=h.board.types.booster.nodes.value[0])==null?void 0:V.state)==null?void 0:j.level)!=null?xe:0,1)},description:"Booster",enabled:()=>{var V,j,xe;return(xe=(j=(V=h.board.types.booster.nodes.value[0])==null?void 0:V.state)==null?void 0:j.portals.includes(e))!=null?xe:!1}})),Ce(()=>({multiplier:()=>o.times(ee("coalRelic")?.2:.1,nt.value.length).add(1),description:()=>(ee("coalRelic")?"Empowered ":"")+Pt.coal,enabled:()=>h.toolNodes.value.coalRelic!=null}))]),xt=w(()=>yn.apply(1)),[ki,Qn]=jn(()=>[{title:`${at(c.displayName)} Gain`,modifier:T,base:0,unit:"/s"},{title:`${at(c.displayName)} Time Speed`,modifier:yn,base:1,visible:()=>o.gt(xt.value,1)}]),wn=U(!1),ei=K(()=>f(Ut,{modelValue:wn.value,"onUpdate:modelValue":V=>wn.value=V},{header:()=>f("h2",null,[D("Modifiers")]),body:()=>lt(ki)}));this.on("preUpdate",V=>{if(!h.activePortals.value.some(xe=>xe.state.id===e))return;const j=o.times(xt.value,V);d.value=o.add(d.value,j),nt.value.length{var it;(it=xe.update)==null||it.call(xe,j)})}),qd(this,()=>nt.value.lengthnt.value.length{const V=le.find(j=>j.shouldShowPreview.value);return V?o.neg(Me(V.cost)):0}),Ft=w(()=>{const V=le.find(j=>j.shouldShowPreview.value);return V&&V.modifier?o.sub(V.modifier.apply(0),B.value):0}),An=un(m.variable(0).add(c),()=>o.neq(Tn.value,0),Tn),ti=un(m.variable(0).add(B),()=>o.neq(Ft.value,0),Ft),ni=w(()=>{const V=[];return nt.value.forEach(j=>{j.link&&V.push(j.link)}),V}),Mi=w(()=>{const V={};return nt.value.forEach(j=>{j.effectedResource!=null&&j.resourceMulti!=null&&(V[j.effectedResource]!=null?V[j.effectedResource]=o.times(V[j.effectedResource],j.resourceMulti):V[j.effectedResource]=j.resourceMulti)}),V}),nt=w(()=>{const V=[];for(let j=1;jo.lt(nt.value.length,E)&&X.some(V=>V.some(j=>"earned"in j&&s(j.earned)||"bought"in j&&s(j.bought)?!1:("canClick"in j&&s(j.canClick)||"canPurchase"in j&&s(j.canPurchase),!0)))),Ii=w(()=>{const V=X.findIndex((xe,it)=>it>0&&it%2===0&&!X[it-1][0].earned.value);let j;return V===-1?j=X:j=X.slice(0,V),j.map((xe,it)=>it in ue?lt(ue[it]):Pi(...xe))});return{tier:dt(t),seed:dt(n),influences:dt(i),name:a,color:u,resource:c,background:l,style:{background:l,"--background":l},features:X,resourceTabCollapsed:Qn,links:ni,resourceMultis:Mi,earnedTreasures:nt,showNotif:Si,timeActive:d,bonusRewardsLevel:_,display:K(()=>f(re,null,[f(fi,{class:"nav-container",style:"z-index: 5"},{default:()=>[f("span",{class:"nav-segment"},[f("h2",null,[a])]),f("span",{class:"nav-segment"},[f("h3",null,[t,D("-tier")])]),i.length===0?null:f("span",{class:"nav-segment"},[f(Re,{display:i.map(V=>{const j=_t[V.type].description;return typeof j=="function"?j(V):j}).join("
"),direction:H.Down,style:"width: 300px"},{default:()=>[f("h3",null,[i.length,D(" influences")])]})]),f("span",{class:"nav-segment"},[f("button",{class:"button",style:"display: inline",onClick:()=>wn.value=!0},[D("modifiers")])])]}),f(fi,{class:"nav-container"},{default:()=>[f("span",{class:"nav-segment"},[f("h3",{style:`color: ${u}; text-shadow: 0px 0px 10px ${u};`},[lt(An)])," ",c.displayName]),f("span",{class:"nav-segment"},[D("("),f("h3",{style:`color: ${u}; text-shadow: 0px 0px 10px ${u};`},[o.gt(B.value,0)?"+":"",lt(ti)]),D("/s)")]),o.neq(xt.value,1)?f("span",{class:"nav-segment"},[D("Speed: "),Ie(xt.value),D("x")]):null]}),f(gd,{height:"60px"},null),Ii.value,lt(ei)])),minimizedDisplay:K(()=>f("div",null,[f("span",null,[a]),f("span",{style:"font-size: large; vertical-align: sub;"},[" ",nt.value.length,D("/"),E,D(" treasures")])]))}})}function Ri(e,t){t=t.filter(l=>l.type==="increaseResources"||l.type==="decreaseResources");const n=Object.keys(Mt).reduce((l,c)=>{let d=Mt[c];return t.filter(v=>v.data===c).forEach(v=>{v.type==="increaseResources"?d*=1e3:d/=1e3}),l+d},0),i=Object.keys(Mt),r=Math.floor(e()*n);let a=0,u;for(let l=0;ll+c),i=Object.keys(e);let r=0,a=null;const u=t()*n;for(let l=0;le===h.board.selectedNode.value?{text:"Mining"}:Object.keys(h.resourceNodes.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[Rt],progress:e=>Ne(e)?new o(e.state.progress).toNumber():0,progressDisplay:tn.Outline,progressColor:"var(--accent2)",classes:e=>({running:Ne(e)}),draggable:!0},Ud={shape:je.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>e===h.board.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(e){o.gte(h.energy.value,100)&&(e.type="factory",h.energy.value=o.sub(h.energy.value,100))},confirmationLabel:()=>o.gte(h.energy.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},Wd={shape:je.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>{var t,n;if(e===h.board.selectedNode.value)return{text:e.state==null?"Forge - Drag a resource to me!":`Forging ${Be[e.state].name}`};if(((t=h.board.draggingNode.value)==null?void 0:t.type)==="resource"){const i=((n=h.board.draggingNode.value)==null?void 0:n.state).type,r=e.state===i?"Disconnect":h.toolNodes.value[i]==null?Be[i].name:"Already crafted",a=e.state===i||h.toolNodes.value[i]==null?"var(--accent2)":"var(--danger)";return{text:r,color:a}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(e){e.state=void 0,h.board.selectedAction.value=null,h.board.selectedNode.value=null},visibility:e=>e.state!=null},{id:"craft",icon:"done",tooltip:e=>({text:`Forge ${Be[e.state].name} - ${Ke(Be[e.state].cost)} energy`}),onClick(e){const t=Be[e.state];if(o.gte(h.energy.value,t.cost)&&h.toolNodes.value[e.state]==null){h.energy.value=o.sub(h.energy.value,t.cost);const n={id:$n(h.board),position:{...e.position},type:t.type,state:"state"in t?t.state:void 0};if(h.board.placeInAvailableSpace(n),h.board.nodes.value.push(n),e.state==="iron"){const i={id:$n(h.board),position:{...e.position},type:"trashCan"};h.board.placeInAvailableSpace(i),h.board.nodes.value.push(i)}h.board.selectedAction.value=null,h.board.selectedNode.value=null,e.state=void 0}},fillColor:e=>o.gte(h.energy.value,Be[e.state].cost)&&h.toolNodes.value[e.state]==null?"var(--accent2)":"var(--danger)",visibility:e=>e.state!=null,confirmationLabel:e=>o.gte(h.energy.value,Be[e.state].cost)?h.toolNodes.value[e.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:e=>e.state==null||h.toolNodes.value[e.state]!=null?0:o.div(o.sqrt(h.energy.value),o.sqrt(Be[e.state].cost)).clampMax(1).toNumber(),progressDisplay:tn.Fill,progressColor:e=>e.state!=null&&o.gte(h.energy.value,Be[e.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(e,t){var i;if(t.type!=="resource")return!1;const n=((i=h.board.draggingNode.value)==null?void 0:i.state).type;return h.toolNodes.value[n]==null},onDrop(e,t){const n=t.state.type;e.state===n?e.state=void 0:e.state=n,h.board.selectedNode.value=e},draggable:!0},Hd=["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI"],Zd={shape:je.Circle,size:50,title:e=>at(e.state.type)+" ("+Hd[Vt.indexOf(e.state.type)]+")",subtitle:e=>Ke(e.state.amount),progress:e=>Qc(e.state.type),onClick(){},progressDisplay:tn.Outline,progressColor:"var(--accent3)",classes:e=>{var t;return{"affected-node":h.dowsing.value!=null&&Ne(h.dowsing.value)&&h.dowsing.value.state.resources.includes(e.state.type)||o.neq((t=h.planarMultis.value[e.state.type])!=null?t:1,1)}},draggable:!0},Xd={shape:je.Circle,size:50,title:e=>{const t=e.state;return t.includes("Relic")?Pt[t.slice(0,-5)]:Be[t].name},label:e=>e===h.board.selectedNode.value?{text:fd[e.state].description(ee(e.state))}:null,outlineColor:"var(--bought)",classes:e=>({"affected-node":ee(e.state)}),draggable:!0},Yd={shape:je.Diamond,size:50,title:"\u{1F962}",label:e=>e===h.board.selectedNode.value?{text:e.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${e.state.resources.length}/${o.add(e.state.maxConnections,h.computedBonusConnectionsModifier.value)})`}:Br(e,t=>`Double ${t} odds`),actionDistance:Math.PI/4,actions:[rn,bn(e=>e.add(2).pow_base(100),16),Rt],classes:e=>({running:Ne(e)}),canAccept:Lr,onDrop:jr,draggable:!0},Jd={shape:je.Diamond,size:50,title:"\u26CF\uFE0F",label:e=>e===h.board.selectedNode.value?{text:e.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${e.state.resources.length}/${o.add(e.state.maxConnections,h.computedBonusConnectionsModifier.value)})`}:Br(e,t=>`Gather ${ht(o.div(h.dropRates[t].computedModifier.value,100))} ${t}/s`),actionDistance:Math.PI/4,actions:[rn,bn(e=>e.add(2).pow_base(1e4),16),Rt],progress:e=>Ne(e)?o.eq(h.quarryProgressRequired.value,0)?0:new o(e.state.progress).div(h.quarryProgressRequired.value).toNumber():0,progressDisplay:tn.Outline,progressColor:"var(--accent2)",canAccept:Lr,onDrop:jr,classes:e=>({running:Ne(e)}),draggable:!0},Kd={shape:je.Diamond,size:50,title:"\u{1F50C}",label:e=>e===h.board.selectedNode.value?{text:e.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${e.state.tools.length}/${o.add(e.state.maxConnections,h.computedBonusConnectionsModifier.value)})`}:Yc(e,t=>t.includes("Relic")?`Double ${Pt[t.slice(0,-5)]}'s effect`:`Double ${Be[t].name}'s effect`),actionDistance:Math.PI/4,actions:[rn,bn(e=>e.add(3).pow_base(1e3),24),Rt],canAccept:Jc,onDrop:Kc,classes:e=>({running:Ne(e)}),draggable:!0},Qd={shape:je.Diamond,size:50,title:"\u26E9\uFE0F",label:e=>{if(e===h.board.selectedNode.value)return{text:e.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${e.state.tier}-tier portal`};const t=h.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type;return{text:e.state.tier===n?"Disconnect":`${at(n)}-tier Portal`,color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="influence"){const n=t.state.type,{influences:i}=e.state;return i.includes(n)?{text:"Disconnect",color:"var(--accent2)"}:{text:"Add influence",color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="portal")return{text:`Copy tier/influences from ${me[t.state.id].name}`};return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(e){e.state={...e.state,tier:void 0,influences:[]},h.board.selectedAction.value=null,h.board.selectedNode.value=null},visibility:e=>{const{tier:t,influences:n}=e.state;return t!=null||n.length>0}},{id:"makePortal",icon:"done",tooltip:e=>({text:`Spawn ${e.state.tier}-tier portal - ${Ke(h.computedPortalCost.value)} energy`}),fillColor:()=>o.gte(h.energy.value,h.computedPortalCost.value)?"var(--accent2)":"var(--danger)",confirmationLabel:()=>o.gte(h.energy.value,h.computedPortalCost.value)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(e){if(o.lt(h.energy.value,h.computedPortalCost.value))return;let t=0;for(;`portal-${t}`in me;)t++;h.energy.value=o.sub(h.energy.value,h.computedPortalCost.value);const{tier:n,influences:i}=e.state;Ui(Zr(`portal-${t}`,n,Math.floor(Math.random()*4294967296),i.map(a=>h.influenceNodes.value[a].state)),Q);const r={id:$n(h.board),position:{...e.position},type:"portal",state:{id:`portal-${t}`,powered:!1}};h.board.placeInAvailableSpace(r),h.board.nodes.value.push(r),h.board.selectedAction.value=null,h.board.selectedNode.value=null,e.state={tier:void 0,influences:[]}},visibility:e=>e.state.tier!=null}],canAccept(e,t){return t.type==="resource"||t.type==="influence"||t.type==="portal"},onDrop(e,t){if(t.type==="resource"){const n=t.state.type,i=e.state.tier;e.state={...e.state,tier:n===i?void 0:n}}else if(t.type==="influence"){const n=t.state.type,i=e.state.influences;i.includes(n)?e.state={...e.state,influences:i.filter(r=>r!==n)}:e.state={...e.state,influences:[...i,n]}}else if(t.type==="portal"){const n=me[t.state.id];e.state={...e.state,tier:n.tier.value,influences:n.influences.value.map(i=>i.type)}}h.board.selectedNode.value=e},progress:e=>e.state.tier==null?0:o.div(o.sqrt(h.energy.value),o.sqrt(h.computedPortalCost.value)).clampMax(1).toNumber(),progressDisplay:tn.Fill,progressColor:e=>e.state.tier!=null&&o.gte(h.energy.value,h.computedPortalCost.value)?"var(--accent2)":"var(--foreground)",draggable:!0},ep={shape:je.Diamond,size:50,title:"\u{1F300}",label:e=>e===h.board.selectedNode.value?{text:`Portal to ${me[e.state.id].name}`,color:me[e.state.id].color}:null,actionDistance:Math.PI/4,actions:[Rt],classes:e=>({running:Ne(e),showNotif:me[e.state.id].showNotif.value,"affected-node":h.booster.value!=null&&Ne(h.booster.value)&&h.booster.value.state.portals.includes(e.state.id)}),outlineColor:e=>me[e.state.id].background,draggable:!0},tp={shape:e=>e.state.type==="increaseResources"||e.state.type==="decreaseResources"?je.Diamond:je.Circle,size:50,title:e=>_t[e.state.type].display,label:e=>{if(e===h.board.selectedNode.value){const n=e.state,i=_t[n.type].description;return{text:typeof i=="function"?i(n):i}}const t=h.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type,{type:i,data:r}=e.state;let a;if(Array.isArray(r)&&r.includes(n))a="Disconnect";else if(i==="increaseResources")a=`Increase ${at(n)} odds`;else if(i==="decreaseResources")a=`Decrease ${at(n)} odds`;else return null;return{text:a,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[rn],canAccept:(e,t)=>t.type!=="resource"?!1:Array.isArray(e.state.data),onDrop:(e,t)=>{if(t.type!=="resource")return;const n=t.state.type,i=e.state.data;i!=null&&(i.includes(n)?e.state={...e.state,data:i.filter(r=>r!==n)}:e.state={...e.state,data:[...i,n]},h.board.selectedNode.value=e)},outlineColor:"var(--danger)",draggable:!0},np={shape:je.Diamond,size:50,title:"\u231B",label:e=>e===h.board.selectedNode.value?{text:e.state.portals.length===0?"Booster - Drag a portal to me!":`Boosting by ${Ke(o.add(1,e.state.level))}x (${e.state.portals.length}/${o.add(e.state.maxConnections,h.computedBonusConnectionsModifier.value)})`}:bi(e,t=>`Boost ${me[t].name}'s speed`),actionDistance:Math.PI/4,actions:[rn,bn(e=>e.add(6).pow_base(1e3)),{id:"increaseBoost",icon:"arrow_upward",tooltip(e){return{text:`Increase boost - ${Ke(ai.evaluate(e.state.level))} energy`}},fillColor(e){return o.gte(h.energy.value,ai.evaluate(e.state.level))?"var(--bought)":"var(--locked)"},confirmationLabel(e){return o.gte(h.energy.value,ai.evaluate(e.state.level))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}},onClick(e){const t=ai.evaluate(e.state.level);o.gte(h.energy.value,t)&&(h.energy.value=o.sub(h.energy.value,t),e.state={...e.state,level:o.add(e.state.level,1)},h.board.selectedAction.value=null)}},Rt],canAccept:yi,onDrop:wi,classes:e=>({running:Ne(e)}),draggable:!0},ip={shape:je.Diamond,size:50,title:"\u{1F916}",label:e=>e===h.board.selectedNode.value?{text:e.state.portals.length===0?"Upgrader - Drag a portal to me!":`Auto-Upgrading (${e.state.portals.length}/${o.add(e.state.maxConnections,h.computedBonusConnectionsModifier.value)})`}:bi(e,t=>`Auto-buy ${me[t].name}'s upgrades and prestiges`),actionDistance:Math.PI/4,actions:[rn,bn(e=>e.add(4).pow_base(1e6)),Rt],canAccept:yi,onDrop:wi,classes:e=>({running:Ne(e)}),draggable:!0},rp={shape:je.Diamond,size:50,title:"\u{1F9BE}",label:e=>e===h.board.selectedNode.value?{text:e.state.portals.length===0?"Automator - Drag a portal to me!":`Automatating (${e.state.portals.length}/${o.add(e.state.maxConnections,h.computedBonusConnectionsModifier.value)})`}:bi(e,t=>`Auto-buy ${me[t].name}'s repeatables and dimensions`),actionDistance:Math.PI/4,actions:[rn,bn(e=>e.add(4).pow_base(1e6)),Rt],canAccept:yi,onDrop:wi,classes:e=>({running:Ne(e)}),draggable:!0},ap={shape:je.Diamond,size:50,title:"\u{1F4B1}",label:e=>e===h.board.selectedNode.value?{text:e.state.portals.length===0?"Investments - Drag a portal to me!":`Investing (${e.state.portals.length}/${o.add(e.state.maxConnections,h.computedBonusConnectionsModifier.value)})`}:bi(e,t=>`Auto-buy ${me[t].name}'s repeatables and dimensions`),actionDistance:Math.PI/4,actions:[rn,bn(e=>e.add(3).pow_base(1e8)),Rt],canAccept:yi,onDrop:wi,classes:e=>({running:Ne(e)}),draggable:!0},sp={shape:je.Diamond,size:50,title:"\u{1F5D1}\uFE0F",label:e=>{var t;if(e===h.board.selectedNode.value)return{text:"Trash Can - Drag a portal to me!"};if(((t=h.board.draggingNode.value)==null?void 0:t.type)==="portal"){const n=h.board.draggingNode.value.state.id;return{text:`Delete ${me[n].name}!`,color:"var(--danger)"}}return null},canAccept:(e,t)=>t.type==="portal",onDrop:(e,t)=>{const n=t.state.id;Wi(me[n]),delete Q.layers[n],h.board.state.value.nodes=h.board.state.value.nodes.filter(i=>i!==t)},draggable:!0},gr=vi(),op={mine:Gd,brokenFactory:Ud,factory:Wd,resource:Zd,passive:Xd,dowsing:Yd,quarry:Jd,empowerer:Kd,portalGenerator:Qd,portal:ep,influence:tp,booster:np,upgrader:ip,automator:rp,investments:ap,trashCan:sp},h=Gi("main",function(){const e=kn(0,"energy"),t=w(()=>g.types.resource.nodes.value.reduce((I,P)=>(I[P.state.type]=P,I),{})),n=w(()=>({...g.types.passive.nodes.value.reduce((I,P)=>(I[P.state]=P,I),{}),sand:g.types.dowsing.nodes.value[0],wood:g.types.quarry.nodes.value[0],coal:g.types.empowerer.nodes.value[0],iron:g.types.portalGenerator.nodes.value[0],gold:g.types.booster.nodes.value[0],platinum:g.types.upgrader.nodes.value[0],berylium:g.types.automator.nodes.value[0],ultimatum:g.types.investments.nodes.value[0]})),i=w(()=>Object.keys(Pt).filter(I=>`${I}Relic`in n.value).length),r=w(()=>({...g.types.influence.nodes.value.reduce((I,P)=>(I[P.state.type]=P,I),{})})),a=w(()=>({...g.types.portal.nodes.value.reduce((I,P)=>(I[P.state.id]=P,I),{})})),u=w(()=>Vt.reduce((I,P)=>{var z,O,W;const F=(W=(O=(z=t.value[P])==null?void 0:z.state)==null?void 0:O.amount)!=null?W:0;return I[P]=o.floor(Fi.invert(F)),I},{})),l=fn({}),c=fn({});zt(()=>{Vt.forEach(I=>{mt(()=>u.value[I],(P,F)=>{const z=o.sub(P,F);o.gt(z,1)&&de.active===Q.id&&gr.info(f("div",null,[f("h3",null,[o.eq(P,1)?`${at(I)} discovered`:`${at(I)} is now Level ${pt(P)}`,D("!")]),o.gt(z,1)?f("div",null,[D("Gained "),pt(z),D(" levels")]):null]))})})});const d=w(()=>X.filter(I=>{var P,F;return(F=(P=I.value)==null?void 0:P.state)==null?void 0:F.powered}).length+g.types.portal.nodes.value.filter(I=>I.state.powered).length),v=w(()=>{let I=d.value;return n.value.copperRelic!=null&&(I--,ee("copperRelic")&&I--),I}),p=w(()=>{const I=v.value;return o.lt(I,0)?0:o.eq(I,0)?10:o.add(I,1).pow_base(100).div(10).times(.99)}),b=w(()=>{if(E.value==null)return 0;let P=E.value.state.resources.reduce((F,z)=>o.div(100,Ft[z].computedModifier.value).add(F),o.dZero);return n.value.silverRelic!=null&&(P=o.div(P,o.add(d.value,1)),ee("silverRelic")&&(P=o.div(P,o.add(d.value,1)))),P}),g=Vc(I=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:op,style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const P=[];if(P.push(...Object.keys(l).map(F=>({startNode:C.value,endNode:t.value[F],stroke:"var(--accent3)",strokeWidth:5}))),_.value!=null&&_.value.state!=null&&P.push({startNode:_.value,endNode:t.value[_.value.state],stroke:"var(--foreground)",strokeWidth:4}),x.value!=null&&x.value.state.resources.forEach(F=>{P.push({startNode:x.value,endNode:t.value[F],stroke:Ne(x.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),E.value!=null&&E.value.state.resources.forEach(F=>{P.push({startNode:E.value,endNode:t.value[F],stroke:"var(--foreground)",strokeWidth:4})}),P.push(...Object.keys(c).map(F=>({startNode:E.value,endNode:t.value[F],stroke:"var(--accent3)",strokeWidth:5}))),S.value!=null&&S.value.state.tools.forEach(F=>{P.push({startNode:S.value,endNode:n.value[F],stroke:Ne(S.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),T.value!=null){const F=T.value.state;F.tier!=null&&P.push({startNode:T.value,endNode:t.value[F.tier],stroke:"var(--foreground)",strokeWidth:4}),F.influences.forEach(z=>{P.push({startNode:T.value,endNode:r.value[z],stroke:"var(--foreground)",strokeWidth:4})}),I.types.portal.nodes.value.forEach(z=>{const O=me[z.state.id];return O.links.value.forEach(W=>{W.value!=null&&P.push({startNode:z,endNode:W.value,stroke:Ne(z)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(O.resourceMultis.value).forEach(W=>{W!=="energy"&&W in t.value&&P.push({startNode:z,endNode:t.value[W],stroke:Ne(z)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),P})}return B.value!=null&&B.value.state.portals.forEach(F=>{P.push({startNode:B.value,endNode:a.value[F],stroke:Ne(B.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),le.value!=null&&le.value.state.portals.forEach(F=>{P.push({startNode:le.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),ue.value!=null&&ue.value.state.portals.forEach(F=>{P.push({startNode:ue.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),te.value!=null&&te.value.state.portals.forEach(F=>{P.push({startNode:te.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),Object.values(r.value).forEach(F=>{const z=F.state;(z.type==="increaseResources"||z.type==="decreaseResources")&&z.data.forEach(O=>{P.push({startNode:F,endNode:t.value[O],stroke:"var(--foreground)",strokeWidth:4})})}),P}})),C=w(()=>g.types.mine.nodes.value[0]),_=w(()=>g.types.factory.nodes.value[0]),x=w(()=>n.value.sand),E=w(()=>n.value.wood),S=w(()=>n.value.coal),T=w(()=>n.value.iron),B=w(()=>n.value.gold),le=w(()=>n.value.platinum),ue=w(()=>n.value.berylium),te=w(()=>n.value.ultimatum),X=[C,x,E,S,B,le,ue,te];function Se(I,P){let F=t.value[I];if(P=o.times(P,An[I].computedModifier.value),F==null)F={id:$n(g),position:{...C.value.position},type:"resource",state:{type:I,amount:P}},g.placeInAvailableSpace(F),g.nodes.value.push(F);else{const z=F.state;F.state={...z,amount:o.add(z.amount,P)}}}const L=w(()=>Object.keys(Mt).reduce((I,P)=>I+new o(Ft[P].computedModifier.value).toNumber(),0)),ae=w(()=>{const I={};return g.types.portal.nodes.value.forEach(P=>{if(!Ne(P))return;const z=me[P.state.id].resourceMultis.value;Object.keys(z).forEach(O=>{I[O]!=null?I[O]=o.times(I[O],z[O]):I[O]=z[O]})}),I}),Te=wt(()=>Vt.map(I=>Lt(()=>({description:()=>at(I),addend:()=>u.value[I],enabled:()=>o.gt(u.value[I],0)})))),Xe=w(()=>Te.apply(0)),Ht=wt(()=>[Lt(()=>({addend:Xe,description:"Resource Levels"})),Ce(()=>({multiplier:()=>o.pow(Tn.value,Xe.value),description:()=>`${jt(Tn.value,3)}x per Resource Level`})),Ce(()=>({multiplier:()=>ee("stone")?4:2,description:()=>(ee("stone")?"Empowered ":"")+Be.stone.name,enabled:()=>n.value.stone!=null})),Ce(()=>({multiplier:()=>{var I;return(I=ae.value.energy)!=null?I:1},description:"Planar Treasures",enabled:()=>{var I;return o.neq((I=ae.value.energy)!=null?I:1,1)}})),Lt(()=>({addend:()=>o.pow(100,v.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(v.value,0)}))]),ut=w(()=>Ht.apply(0)),Dn=wt(()=>[Lt(()=>({addend:()=>ee("unobtainium")?2:1,description:()=>(ee("unobtainium")?"Empowered ":"")+Be.unobtainium.name,enabled:()=>n.value.unobtainium!=null}))]),yn=w(()=>Dn.apply(0)),xt=wt(()=>[Ce(()=>({multiplier:()=>ee("dirt")?4:2,description:()=>(ee("dirt")?"Empowered ":"")+Be.dirt.name,enabled:()=>n.value.dirt!=null})),Ce(()=>({multiplier:()=>o.pow(i.value,ee("woodRelic")?2:1),description:()=>(ee("woodRelic")?"Empowered ":"")+Pt.wood,enabled:()=>n.value.woodRelic!=null}))]),ki=w(()=>xt.apply(1)),Qn=wt(()=>[Ce(()=>({multiplier:()=>ee("gravel")?4:2,description:()=>(ee("gravel")?"Empowered ":"")+Be.gravel.name,enabled:()=>n.value.gravel!=null}))]),wn=w(()=>Qn.apply(1)),ei=wt(()=>[Lt(()=>({addend:()=>ee("copper")?.004:.002,description:()=>(ee("copper")?"Empowered ":"")+Be.copper.name,enabled:()=>n.value.copper!=null}))]),Tn=w(()=>ei.apply(1.01)),Ft=Object.keys(Mt).reduce((I,P)=>{const F=wt(()=>[Ce(()=>({multiplier:2,description:"Dowsing",enabled:()=>x.value!=null&&Ne(x.value)&&x.value.state.resources.includes(P)}))]),z=w(()=>F.apply(Mt[P])),O={title:`${at(P)} Drop Rate`,modifier:F,base:Mt[P]};return I[P]={modifier:F,computedModifier:z,section:O},I},{}),An=Object.keys(Mt).reduce((I,P)=>{const F=wt(()=>[Ce(()=>({multiplier:()=>{var W;return(W=ae.value[P])!=null?W:1},description:"Planar Treasures",enabled:()=>{var W;return o.neq((W=ae.value[P])!=null?W:1,1)}}))]),z=w(()=>F.apply(1)),O={title:`${at(P)} Gain`,modifier:F};return I[P]={modifier:F,computedModifier:z,section:O},I},{}),ti=w(()=>{var P,F,z;const I=Vt.indexOf((z=(F=(P=T.value)==null?void 0:P.state)==null?void 0:F.tier)!=null?z:"dirt");return o.add(I,1).times(I).div(2).add(9).pow10()}),ni=wt(()=>[...Object.keys(_t).map(I=>Ce(()=>({multiplier:_t[I].cost,description:_t[I].display,enabled:()=>{var P,F,z;return(z=(F=(P=T.value)==null?void 0:P.state)==null?void 0:F.influences.includes(I))!=null?z:!1},smallerIsBetter:!0}))),Ce(()=>({multiplier:()=>ee("emeraldRelic")?.05:.1,description:()=>(ee("emeraldRelic")?"Empowered ":"")+Pt.emerald,enabled:()=>n.value.emeraldRelic!=null,smallerIsBetter:!0}))]),Mi=w(()=>ni.apply(ti.value)),[nt,Si]=jn(()=>[{title:"Resource Levels",modifier:Te,base:0},{title:"Energy Gain",modifier:Ht,base:0,unit:"/s"},{title:"Portal Cost",modifier:ni,base:ti,unit:" energy",baseText:()=>{var I,P,F;return`${at((F=(P=(I=T.value)==null?void 0:I.state)==null?void 0:P.tier)!=null?F:"dirt")}-tier Base Cost`},visible:()=>T.value!=null,smallerIsBetter:!0},{title:"Bonus Connections",modifier:Dn,base:0,visible:()=>o.gt(yn.value,0)}]),[Ii,V]=jn(()=>[{title:"Mining Speed",modifier:xt,base:1,unit:"/s",visible:()=>n.value.dirt!=null},{title:"Ore Dropped",modifier:Qn,base:1,visible:()=>n.value.gravel!=null},{title:"Material Level Effect",modifier:ei,base:1.01,visible:()=>n.value.copper!=null}]),[j,xe]=jn(()=>Object.values(Ft).map(I=>I.section)),[it,_n]=jn(()=>Object.values(An).map(I=>I.section)),ze=Zc({general:()=>({display:"General",glowColor(){return ze.activeTab.value===this.tab?"white":""},tab:nt,energyTabCollapsed:Si}),mining:()=>({display:"Mine",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(n.value).length>0,tab:Ii,miningTabCollapsed:V}),resources:()=>({display:"Ore Rates",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>x.value!=null,tab:j,resourcesCollapsed:xe}),resourcesGain:()=>({display:"Ore Gain",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(An).some(I=>o.neq(I.computedModifier.value,1)),tab:it,resourceGainCollapsed:_n})}),$t=U(!1),Ot=K(()=>f(Ut,{modelValue:$t.value,"onUpdate:modelValue":I=>$t.value=I},{header:()=>f("h2",null,[D("Modifiers")]),body:()=>lt(ze)}));this.on("preUpdate",I=>{if(Object.keys(l).forEach(P=>{l[P]-=I,l[P]<=0&&delete l[P]}),Object.keys(c).forEach(P=>{c[P]-=I,c[P]<=0&&delete c[P]}),Ne(C.value)){const P=o.add(C.value.state.progress,o.times(ki.value,I)),F=P.floor();C.value.state={...C.value.state,progress:o.sub(P,F)};const z=F.div(L.value).floor();z.gt(0)&&Vt.forEach(W=>{Se(W,o.times(new o(Ft[W].computedModifier.value).toNumber(),z).times(wn.value)),l[W]=.3});const O=o.sub(F,z).toNumber();for(let W=0;W0){let z=o.add(P,I);const O=o.div(P,b.value).floor();z=o.sub(z,o.times(O,b.value)),E.value.state={...E.value.state,progress:z},o.gt(O,0)&&F.forEach(W=>{Se(W,O),c[W]=.3})}}e.value=o.add(e.value,o.times(ut.value,I)),o.lt(e.value,0)&&(e.value=0,X.forEach(P=>{var F;((F=P.value)==null?void 0:F.state).powered=!1}),Object.values(a.value).forEach(P=>{P.state.powered=!1}),C.value.state={...C.value.state,powered:!1},gr.warning(f("div",null,[f("h3",null,[D("Ran out of energy!")]),f("div",null,[D("All machines have been turned off.")])])))});const qt=w(()=>{var I,P;return g.selectedAction.value===g.types.brokenFactory.actions[0]?-100:g.selectedAction.value===g.types.factory.actions[1]?o.neg(Be[g.selectedNode.value.state].cost):((I=g.selectedAction.value)==null?void 0:I.id)==="moreConnections"?o.neg(g.selectedAction.value.formula.evaluate(((P=g.selectedNode.value)==null?void 0:P.state).maxConnections)):0}),st=un(m.variable(0).add(e),()=>o.neq(qt.value,0),qt),Et=w(()=>{var I;return g.selectedAction.value===Rt?((I=g.selectedNode.value)==null?void 0:I.state).powered?o.eq(d.value,1)?10:o.pow(100,d.value).div(10).times(.99):o.neg(p.value):0}),an=un(m.variable(0).add(ut),()=>o.neq(Et.value,0),Et),ii=w(()=>g.types.portal.nodes.value.filter(I=>Ne(I))),Rn=w(()=>ii.value.sort((I,P)=>{var O,W;const F=(O=me[I.state.id])!=null&&O.minimized.value?1:0,z=(W=me[P.state.id])!=null&&W.minimized.value?1:0;return F-z}).map(I=>I.state.id));return mt(Rn,I=>{zt(()=>{Q.tabs=["main",...I]})}),mt(yn,(I,P)=>{o.lt(I,P)&&(ln(I,x,"resources"),ln(I,E,"resources"),ln(I,S,"tools"),ln(I,B,"portals"),ln(I,le,"portals"),ln(I,ue,"portals"),ln(I,te,"portals"))}),{name:"World",board:g,energy:e,modifierTabs:ze,resourceNodes:t,toolNodes:n,influenceNodes:r,grantResource:Se,activePortals:ii,nextPowerCost:p,computedBonusConnectionsModifier:yn,quarryProgressRequired:b,dropRates:Ft,dowsing:x,empowerer:S,booster:B,upgrader:le,automator:ue,investments:te,resourceLevels:u,planarMultis:ae,computedPortalCost:Mi,display:K(()=>f(re,null,[f(fi,{class:"nav-container"},{default:()=>[f("span",{class:"nav-segment"},[f("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[lt(st)])," ",D("energy")]),f("span",{class:"nav-segment"},[D("("),f("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt(ut.value,0)?"+":"",lt(an)]),D("/s)")]),o.gt(d.value,0)?f("span",{class:"nav-segment"},[f("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[pt(d.value)])," ",D("machines powered")]):null,f("span",{class:"nav-segment"},[f("button",{class:"button",style:"display: inline",onClick:()=>$t.value=!0},[D("modifiers")])]),Q.devSpeed===0?f("span",{class:"nav-segment"},[D("Game Paused")]):Q.devSpeed!=null&&Q.devSpeed!==1?f("span",{class:"nav-segment"},[D("Dev Speed: "),Ie(Q.devSpeed),D("x")]):null]}),lt(g),lt(Ot)]))}}),lp=e=>{var n,i,r,a,u;const t=[h];return(u=(a=(r=(i=(n=e.layers)==null?void 0:n.main)==null?void 0:i.board)==null?void 0:r.state)==null?void 0:a.nodes)==null||u.filter(l=>(l==null?void 0:l.type)==="portal").map(l=>{var c,d;return(d=(c=l==null?void 0:l.state)==null?void 0:c.id)!=null?d:""}).forEach(l=>{var d,v,p,b;const c=(d=e.layers)==null?void 0:d[l];t.push(Zr(l,(v=c.tier)!=null?v:"dirt",(p=c.seed)!=null?p:Math.floor(Math.random()*4294967296),(b=c.influences)!=null?b:[]))}),t},Ji=U(!1);function up(e,t){}var cp=Object.freeze(Object.defineProperty({__proto__:null,main:h,getInitialLayers:lp,hasWon:Ji,fixOldSave:up},Symbol.toStringTag,{value:"Module"}));const Kn=e=>(gn("data-v-4a50ce42"),e=e(),mn(),e),dp={class:"game-over-modal-header"},pp=["src","alt"],fp={class:"game-over-modal-title"},gp=Kn(()=>N("h2",null,"Congratulations!",-1)),mp={key:0},vp=Kn(()=>N("br",null,null,-1)),hp=Kn(()=>N("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),bp=Kn(()=>N("br",null,null,-1)),yp=["href"],wp=Kn(()=>N("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),_p=J({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:a,versionTitle:u}=ye,l=w(()=>hi(Q.timePlayed)),c=w(()=>Ji.value&&!Q.keepGoing),d=Qt(Q,"autosave");function v(){Q.keepGoing=!0}function p(){cn(Sn())}return(b,g)=>(M(),ne(Ut,{"model-value":s(c)},{header:Z(()=>[N("div",dp,[s(n)?(M(),A("img",{key:0,class:"game-over-modal-logo",src:s(n),alt:s(t)},null,8,pp)):G("",!0),N("div",fp,[gp,N("h4",null,"You've beaten "+pe(s(t))+" v"+pe(s(a))+": "+pe(s(u)),1)])])]),body:Z(({shown:C})=>[C?(M(),A("div",mp,[N("div",null,"It took you "+pe(s(l))+" to beat the game.",1),vp,hp,bp,N("div",null,[N("a",{href:s(r),class:"game-over-modal-discord-link"},[wp,D(" "+pe(s(i)),1)],8,yp)]),f(Bt,{title:"Autosave",modelValue:s(d),"onUpdate:modelValue":g[0]||(g[0]=_=>Fe(d)?d.value=_:null)},null,8,["modelValue"])])):G("",!0)]),footer:Z(()=>[N("div",{class:"game-over-footer"},[N("button",{onClick:v,class:"button"},"Keep Going"),N("button",{onClick:p,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var Np=ve(_p,[["__scopeId","data-v-4a50ce42"]]);const Ci=e=>(gn("data-v-2776d67d"),e=e(),mn(),e),Cp=Ci(()=>N("div",{class:"nan-modal-header"},[N("h2",null,"NaN value detected!")],-1)),kp={key:0},Mp=Ci(()=>N("br",null,null,-1)),Sp=["href"],Ip=Ci(()=>N("span",{class:"material-icons nan-modal-discord"},"discord",-1)),xp=Ci(()=>N("br",null,null,-1)),$p={class:"nan-footer"},Ep=J({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=ye,i=U(!0),r=U(!0),a=Qt(Ue,"hasNaN"),u=U(null);mt(a,b=>{b?(i.value=Q.autosave,r.value=Q.devSpeed===0):(Q.autosave=i.value,Q.devSpeed=r.value?0:null)});const l=w(()=>{var b;return(b=Ue.NaNPath)==null?void 0:b.join(".")}),c=w(()=>Ue.NaNPersistent!=null?Ue.NaNPersistent.value:null);function d(){Ue.NaNPersistent!=null&&(Ue.NaNPersistent.value=new o(0),Ue.hasNaN=!1)}function v(){Ue.NaNPersistent&&(Ue.NaNPersistent.value=new o(1),Ue.hasNaN=!1)}function p(){Ue.NaNPersistent&&(Ue.NaNPersistent.value=new o(NaN),Ue.hasNaN=!1)}return(b,g)=>(M(),A(re,null,[f(Ut,Gt({modelValue:s(a),"onUpdate:modelValue":g[4]||(g[4]=C=>Fe(a)?a.value=C:null)},b.$attrs),{header:Z(()=>[Cp]),body:Z(()=>[N("div",null,[D(' Attempted to assign "'+pe(s(l))+'" to NaN',1),s(c)?(M(),A("span",kp,pe(" ")+"(previously "+pe(s(Ie)(s(c)))+")",1)):G("",!0),D(". Auto-saving has been "+pe(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Mp,N("div",null,[N("a",{href:s(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[Ip,D(" "+pe(s(t)||"The Paper Pilot Community"),1)],8,Sp)]),xp,f(Bt,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":g[0]||(g[0]=C=>i.value=C)},null,8,["modelValue"]),s(ye).enablePausing?(M(),ne(Bt,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":g[1]||(g[1]=C=>r.value=C)},null,8,["modelValue"])):G("",!0)]),footer:Z(()=>[N("div",$p,[N("button",{onClick:g[2]||(g[2]=C=>{var _;return(_=u.value)==null?void 0:_.open()}),class:"button"},"Open Saves Manager"),N("button",{onClick:d,class:"button"},"Set to 0"),N("button",{onClick:v,class:"button"},"Set to 1"),s(c)&&s(o).neq(s(c),0)&&s(o).neq(s(c),1)?(M(),A("button",{key:0,onClick:g[3]||(g[3]=C=>a.value=!1),class:"button"}," Set to previous ")):G("",!0),N("button",{onClick:p,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),f(Fr,{ref_key:"savesManager",ref:u},null,512)],64))}});var Pp=ve(Ep,[["__scopeId","data-v-2776d67d"]]);const Dp={key:0,class:"tpsDisplay"},Tp=J({__name:"TPS",setup(e){const t=w(()=>o.div(Ue.lastTenTicks.length,Ue.lastTenTicks.reduce((n,i)=>n+i,0)));return(n,i)=>s(t).isNan()?G("",!0):(M(),A("div",Dp,"TPS: "+pe(s(pt)(s(t))),1))}});var Ap=ve(Tp,[["__scopeId","data-v-89b89152"]]);var Rp=J({__name:"App",setup(e){const t=ye.useHeader,n=w(()=>Nt[de.theme].variables),i=Qt(de,"showTPS"),r=w(()=>fe(K(()=>f(re,null,[hs.map(lt)]))));return(a,u)=>(M(),A(re,null,[N("div",{id:"modal-root",style:Le(s(n))},null,4),N("div",{class:_e(["app",{useHeader:s(t)}]),style:Le(s(n))},[s(t)?(M(),ne(Or,{key:0})):G("",!0),f(oc),s(s(i))?(M(),ne(Ap,{key:1})):G("",!0),f(Np),f(Pp),(M(),ne(Qe(s(r))))],6)],64))}});var Fp=ve(Rp,[["__scopeId","data-v-41d15e5e"]]);function Op(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:u}=e;let l,c,d,v;const p=async(g=!0)=>{await d,g&&(l==null||l.addEventListener("controlling",C=>{C.isUpdate&&window.location.reload()})),await(v==null?void 0:v())};async function b(){if("serviceWorker"in navigator){const{Workbox:g,messageSW:C}=await Gn(()=>import("./workbox-window.4a8794bb.js"),[]);v=async()=>{c&&c.waiting&&await C(c.waiting,{type:"SKIP_WAITING"})},l=new g("./sw.js",{scope:"./",type:"classic"}),l.addEventListener("activated",_=>{_.isUpdate||i==null||i()});{const _=()=>{n==null||n()};l.addEventListener("waiting",_),l.addEventListener("externalwaiting",_)}l.register({immediate:t}).then(_=>{c=_,a?a("./sw.js",_):r==null||r(_)}).catch(_=>{u==null||u(_)})}}return d=b(),p}function qp(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:u}=e,l=U(!1),c=U(!1);return{updateServiceWorker:Op({immediate:t,onNeedRefresh(){l.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:r,onRegisteredSW:a,onRegisterError:u}),offlineReady:c,needRefresh:l}}document.title=ye.title;window.projInfo=ye;if(ye.id==="")throw new Error("Project ID is empty! Please select a unique ID for this project in /src/data/projInfo.json");requestAnimationFrame(async()=>{console.log(`%cMade in Profectus%c +Learn more at www.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await ds();const{globalBus:e}=await Gn(()=>Promise.resolve().then(function(){return us}),void 0),{startGameLoop:t}=await Gn(()=>import("./gameLoop.ccb7744b.js"),["assets/gameLoop.ccb7744b.js","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=sa(Fp);e.emit("setupVue",n),n.mount("#app"),zt(()=>{const i=vi(),{updateServiceWorker:r}=qp({onNeedRefresh(){i.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){r()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{o as D,Gn as _,Ue as a,ye as b,cp as c,et as g,ps as l,Q as p,de as s}; diff --git a/index.html b/index.html index b0ee6f3..62ab4cb 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ Profectus - + diff --git a/sw.js b/sw.js index c89f827..03442a4 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let a={};const o=e=>i(e,r),u={module:{uri:r},exports:a,require:o};s[r]=Promise.all(n.map((e=>u[e]||o(e)))).then((e=>(l(...e),a)))}}define(["./workbox-7369c0e1"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"assets/@fontsource.f66d05e7.css",revision:null},{url:"assets/@vue.6b211d3c.js",revision:null},{url:"assets/amator.1e5a40c8.js",revision:null},{url:"assets/bezier-easing.a990b400.js",revision:null},{url:"assets/gameLoop.f1000c82.js",revision:null},{url:"assets/index.79f46657.js",revision:null},{url:"assets/index.8dafe82c.css",revision:null},{url:"assets/lz-string.dccec454.js",revision:null},{url:"assets/nanoevents.1080beb7.js",revision:null},{url:"assets/ngraph.events.083734c6.js",revision:null},{url:"assets/panzoom.30c56ba6.js",revision:null},{url:"assets/sortablejs.a0f68e5e.js",revision:null},{url:"assets/vue-next-select.9e6f4164.css",revision:null},{url:"assets/vue-next-select.ded54c4a.js",revision:null},{url:"assets/vue-panzoom.8ce6f9b1.js",revision:null},{url:"assets/vue-textarea-autosize.35804eaf.js",revision:null},{url:"assets/vue-toastification.4b5f8ac8.css",revision:null},{url:"assets/vue-toastification.9c2dad53.js",revision:null},{url:"assets/vue.c16a309b.js",revision:null},{url:"assets/vuedraggable.1879de79.js",revision:null},{url:"assets/wheel.f2ae740f.js",revision:null},{url:"assets/workbox-window.4a8794bb.js",revision:null},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"favicon.svg",revision:"c8dd2748f1fedd25449164d7dda6aecb"},{url:"index.html",revision:"1ad451c07d2b1a7660043215768a7d4b"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"robots.txt",revision:"5e0bd1c281a62a380d7a948085bfe2d1"},{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"manifest.webmanifest",revision:"e1e419fec40e2d042566c11fe4bce322"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); +if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let a={};const o=e=>i(e,r),u={module:{uri:r},exports:a,require:o};s[r]=Promise.all(n.map((e=>u[e]||o(e)))).then((e=>(l(...e),a)))}}define(["./workbox-7369c0e1"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"assets/@fontsource.f66d05e7.css",revision:null},{url:"assets/@vue.6b211d3c.js",revision:null},{url:"assets/amator.1e5a40c8.js",revision:null},{url:"assets/bezier-easing.a990b400.js",revision:null},{url:"assets/gameLoop.ccb7744b.js",revision:null},{url:"assets/index.8dafe82c.css",revision:null},{url:"assets/index.acf4cfde.js",revision:null},{url:"assets/lz-string.dccec454.js",revision:null},{url:"assets/nanoevents.1080beb7.js",revision:null},{url:"assets/ngraph.events.083734c6.js",revision:null},{url:"assets/panzoom.30c56ba6.js",revision:null},{url:"assets/sortablejs.a0f68e5e.js",revision:null},{url:"assets/vue-next-select.9e6f4164.css",revision:null},{url:"assets/vue-next-select.ded54c4a.js",revision:null},{url:"assets/vue-panzoom.8ce6f9b1.js",revision:null},{url:"assets/vue-textarea-autosize.35804eaf.js",revision:null},{url:"assets/vue-toastification.4b5f8ac8.css",revision:null},{url:"assets/vue-toastification.9c2dad53.js",revision:null},{url:"assets/vue.c16a309b.js",revision:null},{url:"assets/vuedraggable.1879de79.js",revision:null},{url:"assets/wheel.f2ae740f.js",revision:null},{url:"assets/workbox-window.4a8794bb.js",revision:null},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"favicon.svg",revision:"c8dd2748f1fedd25449164d7dda6aecb"},{url:"index.html",revision:"1d3b3da42a1afd6f97a98e507d3cf45d"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"robots.txt",revision:"5e0bd1c281a62a380d7a948085bfe2d1"},{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"manifest.webmanifest",revision:"e1e419fec40e2d042566c11fe4bce322"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));