From b3b859f52d8be196d9d526abff387af4ab482ccb Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 1 May 2023 13:21:29 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20thepaper?= =?UTF-8?q?pilot/Planar-Pioneers@186fb4468bd653d0b84542b33d2f057b92cc0a30?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...meLoop.09343c26.js => gameLoop.dc03ce30.js} | 2 +- .../{index.8696f909.js => index.3f729fa9.js} | 18 +++++++++--------- .../{index.83961fb5.css => index.43bdca03.css} | 2 +- index.html | 4 ++-- sw.js | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) rename assets/{gameLoop.09343c26.js => gameLoop.dc03ce30.js} (89%) rename assets/{index.8696f909.js => index.3f729fa9.js} (73%) rename assets/{index.83961fb5.css => index.43bdca03.css} (99%) diff --git a/assets/gameLoop.09343c26.js b/assets/gameLoop.dc03ce30.js similarity index 89% rename from assets/gameLoop.09343c26.js rename to assets/gameLoop.dc03ce30.js index a1c5226..c963dc2 100644 --- a/assets/gameLoop.09343c26.js +++ b/assets/gameLoop.dc03ce30.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.8696f909.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";import"./unique-names-generator.5494b30b.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 M(){f=(await d(()=>import("./index.8696f909.js").then(function(t){return t.c}),["assets/index.8696f909.js","assets/index.83961fb5.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","assets/unique-names-generator.5494b30b.js"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{M 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.3f729fa9.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";import"./unique-names-generator.5494b30b.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 M(){f=(await d(()=>import("./index.3f729fa9.js").then(function(t){return t.c}),["assets/index.3f729fa9.js","assets/index.43bdca03.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","assets/unique-names-generator.5494b30b.js"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{M as startGameLoop}; diff --git a/assets/index.8696f909.js b/assets/index.3f729fa9.js similarity index 73% rename from assets/index.8696f909.js rename to assets/index.3f729fa9.js index a39df19..6f40e5f 100644 --- a/assets/index.8696f909.js +++ b/assets/index.3f729fa9.js @@ -1,18 +1,18 @@ -/* empty css */import"./vue.c16a309b.js";import{_ as I,C as s,l as Me,q as Yt,t as z,b2 as st,ab as Q,aF as S,a1 as D,a2 as C,aL as _t,G as pe,aD as xi,w as Ye,b3 as nt,a9 as p,O as se,ap as ar,az as Rn,as as Nt,aH as xn,A as Ce,$ as te,b7 as H,b9 as ei,ar as Ct,bv as an,a8 as q,bt as sr,bc as sn,T as or,u as ti,j as lr,bw as ht,aM as bt,a0 as U,aO as Oe,J as ie,I as qe,aI as Jt,aG as Kt,z as At,bo as ur,bs as cr,aK as on,bd as fi,am as Dn,H as dr,bx as fr,bf as gr}from"./@vue.6b211d3c.js";import{c as Ei}from"./nanoevents.1080beb7.js";import{L as Dt}from"./lz-string.dccec454.js";import{Y as pr}from"./vue-next-select.ded54c4a.js";import{D as mr}from"./vuedraggable.1879de79.js";import{p as vr}from"./vue-textarea-autosize.35804eaf.js";import{P as hr}from"./vue-panzoom.8ce6f9b1.js";import{s as br,u as Ln}from"./vue-toastification.9c2dad53.js";import{n as yr,t as wr,l as _r}from"./unique-names-generator.5494b30b.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 Nr=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)}};Nr();const Cr="modulepreload",gi={},kr="./",yn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${kr}${i}`,i in gi)return;gi[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":Cr,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())},Mr="./projInfo-schema.json",Sr="Planar Pioneers",Ir="A game about controlling and exploiting planes!",$r="planar-pioneers",xr="thepaperpilot",Er="",Tr="",Dr="0.0",Pr="Initial Commit",Fr=!1,Or=!1,Ar=2,qr=!0,Vr=null,Rr="",Lr=["main"],Br=3600,jr=0,zr=!0,Ur="base64";var de={$schema:Mr,title:Sr,description:Ir,id:$r,author:xr,discordName:Er,discordLink:Tr,versionNumber:Dr,versionTitle:Pr,allowGoBack:Fr,defaultShowSmall:Or,defaultDecimalsShown:Ar,useHeader:qr,banner:Vr,logo:Rr,initialTabs:Lr,maxTickLength:Br,offlineLimit:jr,enablePausing:zr,exportEncoding:Ur};class Gr{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 Wr(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 Wr{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Zn=17,Hr=9e15,Zr=Math.log10(9e15),Yr=1/9e15,Jr=308,Kr=-324,pi=5,Xr=(1<<10)-1,Qr=function(){const e=[];for(let n=Kr+1;n<=Jr;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),Lt=[2,Math.E,3,4,5,6,7,8,9,10],ea=[[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]],ta=[[-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 M=function(t){return o.fromValue_noAlloc(t)},Y=function(e,t,n){return o.fromComponents(e,t,n)},ee=function(t,n,i){return o.fromComponents_noNormalize(t,n,i)};const xt=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)))},Yn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},na=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},Ti=.5671432904097838,mi=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return Ti;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 ee(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 b.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(b.sub(1,n.pow(e))).div(b.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=Hr)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=b.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const w=parseFloat(i[0]),_=parseFloat(i[1]),E=i[1].split(";");let R=1;if(E.length===2&&(R=parseFloat(E[1]),isFinite(R)||(R=1)),isFinite(w)&&isFinite(_)){const x=b.pentate(w,_,R);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const w=parseFloat(r[0]),_=parseFloat(r[1]),E=r[1].split(";");let R=1;if(E.length===2&&(R=parseFloat(E[1]),isFinite(R)||(R=1)),isFinite(w)&&isFinite(_)){const x=b.tetrate(w,_,R);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const a=e.split("^");if(a.length===2){const w=parseFloat(a[0]),_=parseFloat(a[1]);if(isFinite(w)&&isFinite(_)){const E=b.pow(w,_);return this.sign=E.sign,this.layer=E.layer,this.mag=E.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.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 w=parseFloat(c[1]);if(isFinite(w)||(w=1),isFinite(u)&&isFinite(l)){const _=b.tetrate(u,l,w);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.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 w=parseFloat(c[1]);if(isFinite(w)||(w=1),isFinite(u)&&isFinite(l)){const _=b.tetrate(u,l,w);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const f=e.split("e"),v=f.length-1;if(v===0){const w=parseFloat(e);if(isFinite(w))return this.fromNumber(w),b.fromStringCache.size>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}else if(v===1){const w=parseFloat(e);if(isFinite(w)&&w!==0)return this.fromNumber(w),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}const g=e.split("e^");if(g.length===2){this.sign=1,g[0].charAt(0)=="-"&&(this.sign=-1);let w="";for(let _=0;_=43&&E<=57||E===101)w+=g[1].charAt(_);else return this.layer=parseFloat(w),this.mag=parseFloat(g[1].substr(_+1)),this.normalize(),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}if(v<1)return this.sign=0,this.layer=0,this.mag=0,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this;const y=parseFloat(f[0]);if(y===0)return this.sign=0,this.layer=0,this.mag=0,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this;let N=parseFloat(f[f.length-1]);if(v>=2){const w=parseFloat(f[f.length-2]);isFinite(w)&&(N*=Math.sign(w),N+=Yn(w))}if(!isFinite(y))this.sign=f[0]==="-"?-1:1,this.layer=v,this.mag=N;else if(v===1)this.sign=Math.sign(y),this.layer=1,this.mag=N+Math.log10(Math.abs(y));else if(this.sign=Math.sign(y),this.layer=v,v===2){const w=b.mul(Y(1,2,N),M(y));return this.sign=w.sign,this.layer=w.layer,this.mag=w.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}else this.mag=N;return this.normalize(),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}fromValue(e){return e instanceof b?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:xt(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:xt(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<=pi?(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):xt(this.m,e)+"e"+xt(this.e,e):this.layer===1?xt(this.m,e)+"e"+xt(this.e,e):this.layer<=pi?(this.sign===-1?"-":"")+"e".repeat(this.layer)+xt(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+xt(this.mag,e)}abs(){return ee(this.sign===0?0:1,this.layer,this.mag)}neg(){return ee(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?b.dZero:this.layer===0?Y(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?b.dZero:this.layer===0?Y(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?b.dZero:this.layer===0?Y(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?b.dZero:this.layer===0?Y(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=M(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 ee(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(b.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return b.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))>Zn)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))>Zn)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)>Zn)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(M(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=M(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return ee(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return ee(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 b.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=M(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?b.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=M(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=M(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=M(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=Yn(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?b.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=M(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?b.dNaN:this.layer===0&&e.layer===0?Y(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):b.div(this.log10(),e.log10())}log2(){return this.sign<=0?b.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?b.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=M(e),n=this,i=t;if(n.sign===0)return i.eq(0)?ee(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return ee(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:b.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return b.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 b.dOne;e=ee(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):b.dOne}pow_base(e){return M(e).pow(this)}root(e){const t=M(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?b.exp(b.mul(this,b.ln(this).sub(1))):b.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(ee(1,0,24)))return b.fromNumber(na(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 b.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,b.exp(t)}else return this.layer===1?b.exp(b.mul(this,b.ln(this).sub(1))):b.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?b.dOne:this.layer===0&&this.mag<=709.7?b.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 b.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return Y(1,2,Math.log10(this.mag)-.3010299956639812);{const e=b.div(ee(this.sign,this.layer-1,this.mag),ee(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=ee(1,0,1)){if(e===1)return b.pow(this,t);if(e===0)return new b(t);if(this.eq(b.dOne))return b.dOne;if(this.eq(-1))return b.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return b.fromNumber(Math.E);const a=b.ln(this).neg();return a.lambertw().div(a)}else return r>1.444667861009766?b.fromNumber(Number.POSITIVE_INFINITY):b.dNaN}if(this.eq(b.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),b.fromNumber(r)}if(e<0)return b.iteratedlog(t,this,-e);t=M(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(b.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r3)return ee(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=ee(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return b.tetrate(e,-t,this);e=M(e);let n=b.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 b.fromNumber(a)}slog_internal(e=10){if(e=M(e),e.lte(b.dZero)||e.eq(b.dOne))return b.dNaN;if(e.lt(b.dOne))return this.eq(b.dOne)?b.dZero:this.eq(b.dZero)?b.dNegOne:b.dNaN;if(this.mag<0||this.eq(b.dZero))return b.dNegOne;let t=0,n=b.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(b.dZero))n=b.pow(e,n),t-=1;else{if(n.lte(b.dOne))return b.fromNumber(t+b.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=b.log(n,e)}return b.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:b.critical_section(e,t,ta)}static tetrate_critical(e,t){return b.critical_section(e,t,ea)}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-Lt[u])/(Lt[u+1]-Lt[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=b.fromValue_noAlloc(e).toNumber();const t=b.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?b.tetrate(t,i):Number.isFinite(i)?i>=-1?b.log(b.tetrate(t,i+1),t):b.log(b.log(b.tetrate(t,i+2),t),t):b.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return b.fromNumber(mi(this.toNumber()));if(this.layer===0)return b.fromNumber(mi(this.sign*this.mag));if(this.layer===1)return vi(this);if(this.layer===2)return vi(this);if(this.layer>=3)return ee(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return ee(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=ee(1,0,1)){t=M(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(b.dOne)?(++e,t=b.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?b.fromNumber(Math.sin(this.sign*this.mag)):ee(0,0,0)}cos(){return this.mag<0?b.dOne:this.layer===0?b.fromNumber(Math.cos(this.sign*this.mag)):ee(0,0,0)}tan(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.tan(this.sign*this.mag)):ee(0,0,0)}asin(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.asin(this.sign*this.mag)):ee(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?b.fromNumber(Math.acos(this.toNumber())):this.layer===0?b.fromNumber(Math.acos(this.sign*this.mag)):ee(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.atan(this.sign*this.mag)):b.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 b.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return b.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?ee(Number.NaN,Number.NaN,Number.NaN):b.ln(this.add(1).div(b.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(b.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=b;o.fromStringCache=new Gr(Xr);o.dZero=ee(0,0,0);o.dOne=ee(1,0,1);o.dNegOne=ee(-1,0,1);o.dTwo=ee(1,0,2);o.dTen=ee(1,0,10);o.dNaN=ee(Number.NaN,Number.NaN,Number.NaN);o.dInf=ee(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);o.dNegInf=ee(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);o.dNumberMax=Y(1,0,Number.MAX_VALUE);o.dNumberMin=Y(1,0,Number.MIN_VALUE);M=o.fromValue_noAlloc;Y=o.fromComponents;ee=o.fromComponents_noNormalize;o.fromMantissaExponent;o.fromMantissaExponent_noNormalize;const ia=new o(1);function pn(e,t,n=!0){let i=o.log10(e).floor(),r=o.div(e,o.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=ia,i=i.add(1));const a=i.gte(1e9)?ve(i,Math.max(Math.max(t,3),de.defaultDecimalsShown)):i.gte(1e4)?Pn(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+a:"e"+a}function Pn(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 Di(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()),de.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const ra=new o("eeee1000"),aa=new o("e100000"),hi=new o("e1000"),Pi=new o(1e9),sa=new o(1e6),oa=new o(1e3),la=new o(.98),ua=new o(.001),Fi=new o(0);function ve(e,t,n){if(t==null&&(t=de.defaultDecimalsShown),n=n!=null?n:de.defaultShowSmall,e=new o(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+ve(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(ra)){const i=e.slog();return i.gte(sa)?"F"+ve(i.floor()):o.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+Pn(i.floor(),0)}else{if(e.gte(aa))return pn(e,0,!1);if(e.gte(hi))return pn(e,0);if(e.gte(Pi))return pn(e,t);if(e.gte(oa))return Pn(e,0);if(e.gte(ua)||!n)return Di(e,t);if(e.eq(Fi))return 0 .toFixed(t)}return e=Ai(e),e.lt(hi)?pn(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):ve(e,t)+"\u207B\xB9"}function et(e){return e=new o(e),e.sign<0?"-"+et(e.neg()):e.gte(Pi)||e.lte(la)&&!e.eq(Fi)?ve(e):ve(e,0)}function Oi(e){return o.lt(e,0)?"-"+Oi(o.neg(e)):o.gt(e,2**51)?ve(o.div(e,31536e3))+"y":(e=new o(e).toNumber(),e<60?ve(e)+"s":e<3600?et(Math.floor(e/60))+"m "+ve(e%60)+"s":e<86400?et(Math.floor(e/3600))+"h "+et(Math.floor(e/60)%60)+"m "+et(e%60)+"s":e<31536e3?et(Math.floor(e/84600)%365)+"d "+et(Math.floor(e/3600)%24)+"h "+et(Math.floor(e/60)%60)+"m":et(Math.floor(e/31536e3))+"y "+et(Math.floor(e/84600)%365)+"d "+et(Math.floor(e/3600)%24)+"h")}function ca(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 da(e,t){return ve(e,t,!0)}function Ai(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 fa=Object.freeze(Object.defineProperty({__proto__:null,default:o,exponentialFormat:pn,commaFormat:Pn,regularFormat:Di,format:ve,formatWhole:et,formatTime:Oi,toPlaces:ca,formatSmall:da,invertOOM:Ai},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:ga,commaFormat:pa,regularFormat:ma,format:Ht,formatWhole:Ge,formatTime:Bn,toPlaces:va,formatSmall:Pt,invertOOM:ha}=fa;window.Decimal=o;window.exponentialFormat=ga;window.commaFormat=pa;window.regularFormat=ma;window.format=Ht;window.formatWhole=Ge;window.formatTime=Bn;window.toPlaces=va;window.formatSmall=Pt;window.invertOOM=ha;function tt(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Fn(e){return typeof e=="function"}var J=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(J||{});const wn=Symbol("DoNotCache");function F(e,t){const n=e[t];Fn(n)&&n.length===0&&!n[wn]?e[t]=I(n.bind(e)):Fn(n)&&(e[t]=n.bind(e),e[t][wn]=!0)}function he(e){return Fn(e)&&!e[wn]&&(e=I(e)),e}const ft=Symbol("Component"),it=Symbol("GatherProps");let ba=0;function Nn(e="feature-"){return e+ba++}var _e=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(_e||{});function ot(e){const t=s(e);return t!==2&&t!==!1}function un(e){return s(e)===1}function ne(e){return e[wn]=!0,e}function oe(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function ya(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)&&!Me(u)&&i(u))})};return i(e),n}const Bt={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 ni=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(ni||{}),dt={classic:Bt,paper:{...Bt,variables:{...Bt.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:{...Bt,variables:{...Bt.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:{...Bt,variables:{...Bt.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const Ve=Ei();"fonts"in document&&(document.fonts.onloadingdone=()=>Ve.emit("fontsLoaded"));var wa=Object.freeze(Object.defineProperty({__proto__:null,globalBus:Ve},Symbol.toStringTag,{value:"Module"}));const _a=Yt({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var X=window.player=_a;function qi(e){return JSON.stringify(e,(t,n)=>s(n))}function Vi(e={}){return Object.assign({id:`${de.id}-0`,name:"Default Save",tabs:de.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:de.id,modVersion:de.versionNumber,layers:{}},e)}function We(e){const t=Dt.compressToUTF16(qi(e!=null?e:X));return localStorage.setItem((e!=null?e:X).id,t),t}async function Na(){Ma();try{let e=localStorage.getItem(re.active);if(e==null){await zt(rn());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Dt.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==de.id){await zt(rn());return}t.id=re.active,await zt(t)}catch(e){console.error(`Failed to load save. Falling back to new save. -`,e),await zt(rn())}}function rn(){const e=En(),t=Vi({id:e});return We(t),re.saves.push(e),t}function En(){let e,t=0;do e=`${de.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const Ca=z(!1);async function zt(e){console.info("Loading save",e),Ca.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await yn(()=>Promise.resolve().then(function(){return Ha}),void 0),{fixOldSave:r,getInitialLayers:a}=await yn(()=>Promise.resolve().then(function(){return Uc}),void 0);for(const u in t){const l=t[u];l&&n(l)}a(e).forEach(u=>i(u,e)),e=Vi(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,de.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==de.versionNumber&&(r(e.modVersion,e),e.modVersion=de.versionNumber),Object.assign(X,e),re.active=X.id,Ve.emit("onLoad")}setInterval(()=>{X.autosave&&We()},1e3);window.onbeforeunload=()=>{X.autosave&&We()};window.save=We;const ka=window.hardReset=async()=>{await zt(rn())};window.deleteLowerSaves=()=>{const e=Object.values(re.saves).indexOf(X.id)+1;Object.values(re.saves).slice(e).forEach(t=>localStorage.removeItem(t)),re.saves=re.saves.slice(0,e)};const _n=Yt({active:"",saves:[],showTPS:!0,theme:ni.Nordic,unthrottled:!1,alignUnits:!1});st(_n,e=>{const t=Dt.compressToUTF16(JSON.stringify(e));localStorage.setItem(de.id,t)},{deep:!0});var re=window.settings=_n;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:ni.Nordic,alignUnits:!1};Ve.emit("loadSettings",e),Object.assign(_n,e),ka()};function Ma(){try{let e=localStorage.getItem(de.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Dt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(_n,t)}Ve.emit("loadSettings",_n)}catch{}}const Ri=Yt([]);function Sa(e){Ri.push(e)}const Ia=Yt([]),$a=Yt([]),xa={class:"table"},Ea=Q({__name:"Row",setup(e){const t=I(()=>dt[re.theme].mergeAdjacent);return(n,i)=>(S(),D("div",xa,[C("div",{class:pe(["row",{mergeAdjacent:s(t)}])},[_t(n.$slots,"default")],2)]))}});function Ta(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!ar(e)}function ae(e,t="span"){return typeof e=="function"?Q({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),Q({template:e})):Q({render:()=>({})}):e}function Ze(e){if(gt(e))return typeof e=="function"?e():ae(e);const t=e[ft];return p(t,e[it](),null)}function Da(...e){let t;return p(Ea,null,Ta(t=e.map(Ze))?t:{default:()=>[t]})}function rt(e){if(gt(e))return typeof e=="function"?e():typeof e=="string"?p(se,null,[e]):p(e,null,null);const t=e[ft];return p(t,e[it](),null)}function bi(e,t){return e.reduce((n,i)=>p(se,null,[n,t,i]))}function gt(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 Li(e,t){const n=z(null),i=z(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 xi(a),{start:r,stop:a,handleHolding:u}}function Bi(e,t="div"){const n=Ye();return nt(()=>{n.value=ae(xe(e),t)}),n}function Cn(e,t="div"){const n=Ye(null);return nt(()=>{const i=xe(e);n.value=i==""||i==null?null:ae(i,t)}),n}function xe(e){return s(s(e))}function j(...e){return e.includes(Object)||e.push(Object),e}function Pa(e){const t=z(!1),n=e[it].bind(e);return e[it]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}var fe=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const Fa=Q({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var v;const n=z({}),i=new ResizeObserver(l),r=z(null);Rn(()=>{const g=r.value;g!=null&&i.observe(g)});let a=!0,u=z((v=r.value)==null?void 0:v.getBoundingClientRect());function l(){a&&(a=!1,Nt(()=>{var g;u.value=(g=r.value)==null?void 0:g.getBoundingClientRect(),Object.values(n.value).filter(y=>y).forEach(y=>y.rect=y.element.getBoundingClientRect()),t("updateNodes",n.value),a=!0}))}Ve.on("fontsLoaded",l);const c={attributes:!1,childList:!0,subtree:!1};xn(ii,(g,y)=>{const N=new MutationObserver(()=>f(g));N.observe(y,c),n.value[g]={element:y,observer:N,rect:y.getBoundingClientRect()},l()}),xn(ri,g=>{var y;(y=n.value[g])==null||y.observer.disconnect(),n.value[g]=void 0,l()}),xn(ai,n),xn(si,u);function f(g){const y=n.value[g];y!=null&&(y.rect=y.element.getBoundingClientRect(),t("updateNodes",n.value))}return(g,y)=>(S(),D(se,null,[_t(g.$slots,"default",{},void 0,!0),C("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var ji=fe(Fa,[["__scopeId","data-v-2b1dc1bc"]]);const Oa=["onPointerdown"],Aa={class:"modal-wrapper"},qa={class:"modal-container"},Va={class:"modal-header"},Ra={class:"modal-body"},La={class:"modal-footer"},Ba=C("div",{class:"modal-default-flex-grow"},null,-1),kt=Q({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=Ce(e),a=I(()=>s(r.modelValue)||l.value);function u(){n("update:modelValue",!1)}const l=z(!1),c=z(null),f=I(()=>{var v,g;return(g=(v=c.value)==null?void 0:v.nodes)!=null?g:null});return t({isOpen:a,nodes:f}),(v,g)=>(S(),te(or,{to:"#modal-root"},[p(sn,{name:"modal",onBeforeEnter:g[0]||(g[0]=y=>l.value=!0),onAfterLeave:g[1]||(g[1]=y=>l.value=!1)},{default:H(()=>[ei(C("div",Ct({class:"modal-mask",onPointerdown:an(u,["self"])},v.$attrs),[C("div",Aa,[C("div",qa,[C("div",Va,[_t(v.$slots,"header",{shown:s(a)},()=>[q(" default header ")])]),C("div",Ra,[p(ji,{ref_key:"contextRef",ref:c},{default:H(()=>[_t(v.$slots,"body",{shown:s(a)},()=>[q(" default body ")])]),_:3},512)]),C("div",La,[_t(v.$slots,"footer",{shown:s(a)},()=>[C("div",{class:"modal-default-footer"},[Ba,C("button",{class:"button modal-default-button",onClick:u}," Close ")])])])])])],16,Oa),[[sr,e.modelValue]])]),_:3})]))}}),Tt=Symbol("ProxyState");function Je(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===Tt)return r();const l=r()[u];return l!=null&&typeof l=="object"&&vt in l?l[vt]:l},set(a,u,l){return r()[u]=l,!0},has(a,u){return u===Tt?!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 $e=window.state=ti({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Ft=Symbol("PersistentState"),ln=Symbol("DefaultValue"),On=Symbol("StackTrace"),An=Symbol("Deleted"),vt=Symbol("NonPersistent"),Ut=Symbol("SaveDataPath"),Qn=Symbol("SkipPersistence");function ja(){var e,t;return(t=(e=new Error().stack)==null?void 0:e.split(` +/* empty css */import"./vue.c16a309b.js";import{_ as I,C as s,l as Me,q as Yt,t as z,b2 as st,ab as Q,aF as S,a1 as D,a2 as C,aL as _t,G as pe,aD as $i,w as Ye,b3 as nt,a9 as p,O as se,ap as ar,az as Rn,as as Nt,aH as $n,A as ke,$ as te,b7 as Z,b9 as ei,ar as Ct,bv as an,a8 as q,bt as sr,bc as sn,T as or,u as ti,j as lr,bw as ht,aM as bt,a0 as U,aO as Oe,J as ie,I as qe,aI as Jt,aG as Kt,z as qt,bo as ur,bs as cr,aK as on,bd as fi,am as Dn,H as dr,bx as fr,bf as gr}from"./@vue.6b211d3c.js";import{c as Ei}from"./nanoevents.1080beb7.js";import{L as Pt}from"./lz-string.dccec454.js";import{Y as pr}from"./vue-next-select.ded54c4a.js";import{D as mr}from"./vuedraggable.1879de79.js";import{p as vr}from"./vue-textarea-autosize.35804eaf.js";import{P as hr}from"./vue-panzoom.8ce6f9b1.js";import{s as br,u as Ln}from"./vue-toastification.9c2dad53.js";import{n as yr,t as wr,l as _r}from"./unique-names-generator.5494b30b.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 Nr=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)}};Nr();const Cr="modulepreload",gi={},kr="./",yn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${kr}${i}`,i in gi)return;gi[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":Cr,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())},Mr="./projInfo-schema.json",Sr="Planar Pioneers",Ir="A game about controlling and exploiting planes!",xr="planar-pioneers",$r="thepaperpilot",Er="",Tr="",Dr="0.0",Pr="Initial Commit",Fr=!1,Or=!1,Ar=2,qr=!0,Vr=null,Rr="",Lr=["main"],Br=3600,jr=0,zr=!0,Ur="base64";var de={$schema:Mr,title:Sr,description:Ir,id:xr,author:$r,discordName:Er,discordLink:Tr,versionNumber:Dr,versionTitle:Pr,allowGoBack:Fr,defaultShowSmall:Or,defaultDecimalsShown:Ar,useHeader:qr,banner:Vr,logo:Rr,initialTabs:Lr,maxTickLength:Br,offlineLimit:jr,enablePausing:zr,exportEncoding:Ur};class Gr{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 Wr(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 Wr{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Zn=17,Hr=9e15,Zr=Math.log10(9e15),Yr=1/9e15,Jr=308,Kr=-324,pi=5,Xr=(1<<10)-1,Qr=function(){const e=[];for(let n=Kr+1;n<=Jr;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),Bt=[2,Math.E,3,4,5,6,7,8,9,10],ea=[[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]],ta=[[-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 M=function(t){return o.fromValue_noAlloc(t)},Y=function(e,t,n){return o.fromComponents(e,t,n)},ee=function(t,n,i){return o.fromComponents_noNormalize(t,n,i)};const $t=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)))},Yn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},na=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},Ti=.5671432904097838,mi=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return Ti;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 ee(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 b.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(b.sub(1,n.pow(e))).div(b.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=Hr)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=b.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const w=parseFloat(i[0]),_=parseFloat(i[1]),E=i[1].split(";");let R=1;if(E.length===2&&(R=parseFloat(E[1]),isFinite(R)||(R=1)),isFinite(w)&&isFinite(_)){const $=b.pentate(w,_,R);return this.sign=$.sign,this.layer=$.layer,this.mag=$.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const w=parseFloat(r[0]),_=parseFloat(r[1]),E=r[1].split(";");let R=1;if(E.length===2&&(R=parseFloat(E[1]),isFinite(R)||(R=1)),isFinite(w)&&isFinite(_)){const $=b.tetrate(w,_,R);return this.sign=$.sign,this.layer=$.layer,this.mag=$.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const a=e.split("^");if(a.length===2){const w=parseFloat(a[0]),_=parseFloat(a[1]);if(isFinite(w)&&isFinite(_)){const E=b.pow(w,_);return this.sign=E.sign,this.layer=E.layer,this.mag=E.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.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 w=parseFloat(c[1]);if(isFinite(w)||(w=1),isFinite(u)&&isFinite(l)){const _=b.tetrate(u,l,w);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.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 w=parseFloat(c[1]);if(isFinite(w)||(w=1),isFinite(u)&&isFinite(l)){const _=b.tetrate(u,l,w);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const f=e.split("e"),v=f.length-1;if(v===0){const w=parseFloat(e);if(isFinite(w))return this.fromNumber(w),b.fromStringCache.size>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}else if(v===1){const w=parseFloat(e);if(isFinite(w)&&w!==0)return this.fromNumber(w),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}const g=e.split("e^");if(g.length===2){this.sign=1,g[0].charAt(0)=="-"&&(this.sign=-1);let w="";for(let _=0;_=43&&E<=57||E===101)w+=g[1].charAt(_);else return this.layer=parseFloat(w),this.mag=parseFloat(g[1].substr(_+1)),this.normalize(),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}if(v<1)return this.sign=0,this.layer=0,this.mag=0,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this;const y=parseFloat(f[0]);if(y===0)return this.sign=0,this.layer=0,this.mag=0,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this;let N=parseFloat(f[f.length-1]);if(v>=2){const w=parseFloat(f[f.length-2]);isFinite(w)&&(N*=Math.sign(w),N+=Yn(w))}if(!isFinite(y))this.sign=f[0]==="-"?-1:1,this.layer=v,this.mag=N;else if(v===1)this.sign=Math.sign(y),this.layer=1,this.mag=N+Math.log10(Math.abs(y));else if(this.sign=Math.sign(y),this.layer=v,v===2){const w=b.mul(Y(1,2,N),M(y));return this.sign=w.sign,this.layer=w.layer,this.mag=w.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}else this.mag=N;return this.normalize(),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}fromValue(e){return e instanceof b?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:$t(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:$t(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<=pi?(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):$t(this.m,e)+"e"+$t(this.e,e):this.layer===1?$t(this.m,e)+"e"+$t(this.e,e):this.layer<=pi?(this.sign===-1?"-":"")+"e".repeat(this.layer)+$t(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+$t(this.mag,e)}abs(){return ee(this.sign===0?0:1,this.layer,this.mag)}neg(){return ee(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?b.dZero:this.layer===0?Y(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?b.dZero:this.layer===0?Y(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?b.dZero:this.layer===0?Y(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?b.dZero:this.layer===0?Y(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=M(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 ee(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(b.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return b.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))>Zn)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))>Zn)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)>Zn)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(M(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=M(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return ee(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return ee(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 b.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=M(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?b.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=M(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=M(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=M(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=Yn(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?b.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=M(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?b.dNaN:this.layer===0&&e.layer===0?Y(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):b.div(this.log10(),e.log10())}log2(){return this.sign<=0?b.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?b.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=M(e),n=this,i=t;if(n.sign===0)return i.eq(0)?ee(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return ee(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:b.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return b.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 b.dOne;e=ee(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):b.dOne}pow_base(e){return M(e).pow(this)}root(e){const t=M(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?b.exp(b.mul(this,b.ln(this).sub(1))):b.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(ee(1,0,24)))return b.fromNumber(na(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 b.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,b.exp(t)}else return this.layer===1?b.exp(b.mul(this,b.ln(this).sub(1))):b.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?b.dOne:this.layer===0&&this.mag<=709.7?b.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 b.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return Y(1,2,Math.log10(this.mag)-.3010299956639812);{const e=b.div(ee(this.sign,this.layer-1,this.mag),ee(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=ee(1,0,1)){if(e===1)return b.pow(this,t);if(e===0)return new b(t);if(this.eq(b.dOne))return b.dOne;if(this.eq(-1))return b.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return b.fromNumber(Math.E);const a=b.ln(this).neg();return a.lambertw().div(a)}else return r>1.444667861009766?b.fromNumber(Number.POSITIVE_INFINITY):b.dNaN}if(this.eq(b.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),b.fromNumber(r)}if(e<0)return b.iteratedlog(t,this,-e);t=M(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(b.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r3)return ee(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=ee(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return b.tetrate(e,-t,this);e=M(e);let n=b.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 b.fromNumber(a)}slog_internal(e=10){if(e=M(e),e.lte(b.dZero)||e.eq(b.dOne))return b.dNaN;if(e.lt(b.dOne))return this.eq(b.dOne)?b.dZero:this.eq(b.dZero)?b.dNegOne:b.dNaN;if(this.mag<0||this.eq(b.dZero))return b.dNegOne;let t=0,n=b.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(b.dZero))n=b.pow(e,n),t-=1;else{if(n.lte(b.dOne))return b.fromNumber(t+b.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=b.log(n,e)}return b.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:b.critical_section(e,t,ta)}static tetrate_critical(e,t){return b.critical_section(e,t,ea)}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-Bt[u])/(Bt[u+1]-Bt[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=b.fromValue_noAlloc(e).toNumber();const t=b.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?b.tetrate(t,i):Number.isFinite(i)?i>=-1?b.log(b.tetrate(t,i+1),t):b.log(b.log(b.tetrate(t,i+2),t),t):b.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return b.fromNumber(mi(this.toNumber()));if(this.layer===0)return b.fromNumber(mi(this.sign*this.mag));if(this.layer===1)return vi(this);if(this.layer===2)return vi(this);if(this.layer>=3)return ee(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return ee(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=ee(1,0,1)){t=M(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(b.dOne)?(++e,t=b.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?b.fromNumber(Math.sin(this.sign*this.mag)):ee(0,0,0)}cos(){return this.mag<0?b.dOne:this.layer===0?b.fromNumber(Math.cos(this.sign*this.mag)):ee(0,0,0)}tan(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.tan(this.sign*this.mag)):ee(0,0,0)}asin(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.asin(this.sign*this.mag)):ee(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?b.fromNumber(Math.acos(this.toNumber())):this.layer===0?b.fromNumber(Math.acos(this.sign*this.mag)):ee(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.atan(this.sign*this.mag)):b.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 b.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return b.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?ee(Number.NaN,Number.NaN,Number.NaN):b.ln(this.add(1).div(b.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(b.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=b;o.fromStringCache=new Gr(Xr);o.dZero=ee(0,0,0);o.dOne=ee(1,0,1);o.dNegOne=ee(-1,0,1);o.dTwo=ee(1,0,2);o.dTen=ee(1,0,10);o.dNaN=ee(Number.NaN,Number.NaN,Number.NaN);o.dInf=ee(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);o.dNegInf=ee(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);o.dNumberMax=Y(1,0,Number.MAX_VALUE);o.dNumberMin=Y(1,0,Number.MIN_VALUE);M=o.fromValue_noAlloc;Y=o.fromComponents;ee=o.fromComponents_noNormalize;o.fromMantissaExponent;o.fromMantissaExponent_noNormalize;const ia=new o(1);function pn(e,t,n=!0){let i=o.log10(e).floor(),r=o.div(e,o.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=ia,i=i.add(1));const a=i.gte(1e9)?ve(i,Math.max(Math.max(t,3),de.defaultDecimalsShown)):i.gte(1e4)?Pn(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+a:"e"+a}function Pn(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 Di(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()),de.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const ra=new o("eeee1000"),aa=new o("e100000"),hi=new o("e1000"),Pi=new o(1e9),sa=new o(1e6),oa=new o(1e3),la=new o(.98),ua=new o(.001),Fi=new o(0);function ve(e,t,n){if(t==null&&(t=de.defaultDecimalsShown),n=n!=null?n:de.defaultShowSmall,e=new o(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+ve(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(ra)){const i=e.slog();return i.gte(sa)?"F"+ve(i.floor()):o.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+Pn(i.floor(),0)}else{if(e.gte(aa))return pn(e,0,!1);if(e.gte(hi))return pn(e,0);if(e.gte(Pi))return pn(e,t);if(e.gte(oa))return Pn(e,0);if(e.gte(ua)||!n)return Di(e,t);if(e.eq(Fi))return 0 .toFixed(t)}return e=Ai(e),e.lt(hi)?pn(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):ve(e,t)+"\u207B\xB9"}function et(e){return e=new o(e),e.sign<0?"-"+et(e.neg()):e.gte(Pi)||e.lte(la)&&!e.eq(Fi)?ve(e):ve(e,0)}function Oi(e){return o.lt(e,0)?"-"+Oi(o.neg(e)):o.gt(e,2**51)?ve(o.div(e,31536e3))+"y":(e=new o(e).toNumber(),e<60?ve(e)+"s":e<3600?et(Math.floor(e/60))+"m "+ve(e%60)+"s":e<86400?et(Math.floor(e/3600))+"h "+et(Math.floor(e/60)%60)+"m "+et(e%60)+"s":e<31536e3?et(Math.floor(e/84600)%365)+"d "+et(Math.floor(e/3600)%24)+"h "+et(Math.floor(e/60)%60)+"m":et(Math.floor(e/31536e3))+"y "+et(Math.floor(e/84600)%365)+"d "+et(Math.floor(e/3600)%24)+"h")}function ca(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 da(e,t){return ve(e,t,!0)}function Ai(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 fa=Object.freeze(Object.defineProperty({__proto__:null,default:o,exponentialFormat:pn,commaFormat:Pn,regularFormat:Di,format:ve,formatWhole:et,formatTime:Oi,toPlaces:ca,formatSmall:da,invertOOM:Ai},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:ga,commaFormat:pa,regularFormat:ma,format:Ht,formatWhole:Ge,formatTime:Bn,toPlaces:va,formatSmall:Ft,invertOOM:ha}=fa;window.Decimal=o;window.exponentialFormat=ga;window.commaFormat=pa;window.regularFormat=ma;window.format=Ht;window.formatWhole=Ge;window.formatTime=Bn;window.toPlaces=va;window.formatSmall=Ft;window.invertOOM=ha;function tt(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Fn(e){return typeof e=="function"}var J=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(J||{});const wn=Symbol("DoNotCache");function F(e,t){const n=e[t];Fn(n)&&n.length===0&&!n[wn]?e[t]=I(n.bind(e)):Fn(n)&&(e[t]=n.bind(e),e[t][wn]=!0)}function he(e){return Fn(e)&&!e[wn]&&(e=I(e)),e}const ft=Symbol("Component"),it=Symbol("GatherProps");let ba=0;function Nn(e="feature-"){return e+ba++}var _e=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(_e||{});function ot(e){const t=s(e);return t!==2&&t!==!1}function un(e){return s(e)===1}function ne(e){return e[wn]=!0,e}function oe(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function ya(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)&&!Me(u)&&i(u))})};return i(e),n}const jt={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 ni=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(ni||{}),dt={classic:jt,paper:{...jt,variables:{...jt.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:{...jt,variables:{...jt.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:{...jt,variables:{...jt.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const Ve=Ei();"fonts"in document&&(document.fonts.onloadingdone=()=>Ve.emit("fontsLoaded"));var wa=Object.freeze(Object.defineProperty({__proto__:null,globalBus:Ve},Symbol.toStringTag,{value:"Module"}));const _a=Yt({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var X=window.player=_a;function qi(e){return JSON.stringify(e,(t,n)=>s(n))}function Vi(e={}){return Object.assign({id:`${de.id}-0`,name:"Default Save",tabs:de.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:de.id,modVersion:de.versionNumber,layers:{}},e)}function We(e){const t=Pt.compressToUTF16(qi(e!=null?e:X));return localStorage.setItem((e!=null?e:X).id,t),t}async function Na(){Ma();try{let e=localStorage.getItem(re.active);if(e==null){await Ut(rn());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Pt.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==de.id){await Ut(rn());return}t.id=re.active,await Ut(t)}catch(e){console.error(`Failed to load save. Falling back to new save. +`,e),await Ut(rn())}}function rn(){const e=En(),t=Vi({id:e});return We(t),re.saves.push(e),t}function En(){let e,t=0;do e=`${de.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const Ca=z(!1);async function Ut(e){console.info("Loading save",e),Ca.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await yn(()=>Promise.resolve().then(function(){return Ha}),void 0),{fixOldSave:r,getInitialLayers:a}=await yn(()=>Promise.resolve().then(function(){return Uc}),void 0);for(const u in t){const l=t[u];l&&n(l)}a(e).forEach(u=>i(u,e)),e=Vi(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,de.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==de.versionNumber&&(r(e.modVersion,e),e.modVersion=de.versionNumber),Object.assign(X,e),re.active=X.id,Ve.emit("onLoad")}setInterval(()=>{X.autosave&&We()},1e3);window.onbeforeunload=()=>{X.autosave&&We()};window.save=We;const ka=window.hardReset=async()=>{await Ut(rn())};window.deleteLowerSaves=()=>{const e=Object.values(re.saves).indexOf(X.id)+1;Object.values(re.saves).slice(e).forEach(t=>localStorage.removeItem(t)),re.saves=re.saves.slice(0,e)};const _n=Yt({active:"",saves:[],showTPS:!0,theme:ni.Nordic,unthrottled:!1,alignUnits:!1});st(_n,e=>{const t=Pt.compressToUTF16(JSON.stringify(e));localStorage.setItem(de.id,t)},{deep:!0});var re=window.settings=_n;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:ni.Nordic,alignUnits:!1};Ve.emit("loadSettings",e),Object.assign(_n,e),ka()};function Ma(){try{let e=localStorage.getItem(de.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Pt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(_n,t)}Ve.emit("loadSettings",_n)}catch{}}const Ri=Yt([]);function Sa(e){Ri.push(e)}const Ia=Yt([]),xa=Yt([]),$a={class:"table"},Ea=Q({__name:"Row",setup(e){const t=I(()=>dt[re.theme].mergeAdjacent);return(n,i)=>(S(),D("div",$a,[C("div",{class:pe(["row",{mergeAdjacent:s(t)}])},[_t(n.$slots,"default")],2)]))}});function Ta(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!ar(e)}function ae(e,t="span"){return typeof e=="function"?Q({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),Q({template:e})):Q({render:()=>({})}):e}function Ze(e){if(gt(e))return typeof e=="function"?e():ae(e);const t=e[ft];return p(t,e[it](),null)}function Da(...e){let t;return p(Ea,null,Ta(t=e.map(Ze))?t:{default:()=>[t]})}function rt(e){if(gt(e))return typeof e=="function"?e():typeof e=="string"?p(se,null,[e]):p(e,null,null);const t=e[ft];return p(t,e[it](),null)}function bi(e,t){return e.reduce((n,i)=>p(se,null,[n,t,i]))}function gt(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 Li(e,t){const n=z(null),i=z(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 $i(a),{start:r,stop:a,handleHolding:u}}function Bi(e,t="div"){const n=Ye();return nt(()=>{n.value=ae($e(e),t)}),n}function Cn(e,t="div"){const n=Ye(null);return nt(()=>{const i=$e(e);n.value=i==""||i==null?null:ae(i,t)}),n}function $e(e){return s(s(e))}function j(...e){return e.includes(Object)||e.push(Object),e}function Pa(e){const t=z(!1),n=e[it].bind(e);return e[it]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}var fe=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const Fa=Q({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var v;const n=z({}),i=new ResizeObserver(l),r=z(null);Rn(()=>{const g=r.value;g!=null&&i.observe(g)});let a=!0,u=z((v=r.value)==null?void 0:v.getBoundingClientRect());function l(){a&&(a=!1,Nt(()=>{var g;u.value=(g=r.value)==null?void 0:g.getBoundingClientRect(),Object.values(n.value).filter(y=>y).forEach(y=>y.rect=y.element.getBoundingClientRect()),t("updateNodes",n.value),a=!0}))}Ve.on("fontsLoaded",l);const c={attributes:!1,childList:!0,subtree:!1};$n(ii,(g,y)=>{const N=new MutationObserver(()=>f(g));N.observe(y,c),n.value[g]={element:y,observer:N,rect:y.getBoundingClientRect()},l()}),$n(ri,g=>{var y;(y=n.value[g])==null||y.observer.disconnect(),n.value[g]=void 0,l()}),$n(ai,n),$n(si,u);function f(g){const y=n.value[g];y!=null&&(y.rect=y.element.getBoundingClientRect(),t("updateNodes",n.value))}return(g,y)=>(S(),D(se,null,[_t(g.$slots,"default",{},void 0,!0),C("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var ji=fe(Fa,[["__scopeId","data-v-2b1dc1bc"]]);const Oa=["onPointerdown"],Aa={class:"modal-wrapper"},qa={class:"modal-container"},Va={class:"modal-header"},Ra={class:"modal-body"},La={class:"modal-footer"},Ba=C("div",{class:"modal-default-flex-grow"},null,-1),kt=Q({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=ke(e),a=I(()=>s(r.modelValue)||l.value);function u(){n("update:modelValue",!1)}const l=z(!1),c=z(null),f=I(()=>{var v,g;return(g=(v=c.value)==null?void 0:v.nodes)!=null?g:null});return t({isOpen:a,nodes:f}),(v,g)=>(S(),te(or,{to:"#modal-root"},[p(sn,{name:"modal",onBeforeEnter:g[0]||(g[0]=y=>l.value=!0),onAfterLeave:g[1]||(g[1]=y=>l.value=!1)},{default:Z(()=>[ei(C("div",Ct({class:"modal-mask",onPointerdown:an(u,["self"])},v.$attrs),[C("div",Aa,[C("div",qa,[C("div",Va,[_t(v.$slots,"header",{shown:s(a)},()=>[q(" default header ")])]),C("div",Ra,[p(ji,{ref_key:"contextRef",ref:c},{default:Z(()=>[_t(v.$slots,"body",{shown:s(a)},()=>[q(" default body ")])]),_:3},512)]),C("div",La,[_t(v.$slots,"footer",{shown:s(a)},()=>[C("div",{class:"modal-default-footer"},[Ba,C("button",{class:"button modal-default-button",onClick:u}," Close ")])])])])])],16,Oa),[[sr,e.modelValue]])]),_:3})]))}}),Tt=Symbol("ProxyState");function Je(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===Tt)return r();const l=r()[u];return l!=null&&typeof l=="object"&&vt in l?l[vt]:l},set(a,u,l){return r()[u]=l,!0},has(a,u){return u===Tt?!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 xe=window.state=ti({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Ot=Symbol("PersistentState"),ln=Symbol("DefaultValue"),On=Symbol("StackTrace"),An=Symbol("Deleted"),vt=Symbol("NonPersistent"),Gt=Symbol("SaveDataPath"),Qn=Symbol("SkipPersistence");function ja(){var e,t;return(t=(e=new Error().stack)==null?void 0:e.split(` `).slice(3,5).map(n=>n.trim()).join(` -`))!=null?t:""}function yi(e,t){var n;if(o.isNaN(t))throw $e.hasNaN||(X.autosave=!1,$e.hasNaN=!0,$e.NaNPath=e[Ut],$e.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[Ut])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[Ft].value=t}function at(e,t=!0){const n=Me(e)?e:z(e);Me(e)&&(e=e.value);const i=I({get(){return n.value},set(a){t?yi(r,a):r[Ft].value=a}});i[ln]=e;const r={get value(){return n.value},set value(a){t?yi(r,a):r[Ft].value=a},__v_isRef:!0,[Ft]:n,[ln]:e,[On]:ja(),[An]:!1,[vt]:i,[Ut]:void 0};return Le.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,` +`))!=null?t:""}function yi(e,t){var n;if(o.isNaN(t))throw xe.hasNaN||(X.autosave=!1,xe.hasNaN=!0,xe.NaNPath=e[Gt],xe.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[Gt])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[Ot].value=t}function at(e,t=!0){const n=Me(e)?e:z(e);Me(e)&&(e=e.value);const i=I({get(){return n.value},set(a){t?yi(r,a):r[Ot].value=a}});i[ln]=e;const r={get value(){return n.value},set value(a){t?yi(r,a):r[Ot].value=a},__v_isRef:!0,[Ot]:n,[ln]:e,[On]:ja(),[An]:!1,[vt]:i,[Gt]:void 0};return Le.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,` Created at: -`+r[On]):Zt[Le[Le.length-1]].add(r),r}function za(e){return e!=null&&typeof e=="object"&&Ft in e}function Jn(e){return!(Tt in e)&&vt in e?e[vt]:new Proxy(e,{get(t,n){if(n!==Ft)return n===Qn?!0:t[n]},set(t,n,i){return t[n]=i,!0},has(t,n){return n===Ft?!1:n==Qn?!0:Reflect.has(t,n)}})}function zi(e){Le.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):Zt[Le[Le.length-1]].delete(e),e[An]=!0}Ve.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[Qn]===!0)return;if(Tt in c&&(c=c[Tt]),za(c)){if(u=!0,c[An]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` +`+r[On]):Zt[Le[Le.length-1]].add(r),r}function za(e){return e!=null&&typeof e=="object"&&Ot in e}function Jn(e){return!(Tt in e)&&vt in e?e[vt]:new Proxy(e,{get(t,n){if(n!==Ot)return n===Qn?!0:t[n]},set(t,n,i){return t[n]=i,!0},has(t,n){return n===Ot?!1:n==Qn?!0:Reflect.has(t,n)}})}function zi(e){Le.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):Zt[Le[Le.length-1]].delete(e),e[An]=!0}Ve.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[Qn]===!0)return;if(Tt in c&&(c=c[Tt]),za(c)){if(u=!0,c[An]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` Created at: -`+c[On]);return}Zt[e.id].delete(c);const f=[e.id,...a,l];c[Ut]!=null&&JSON.stringify(f)!==JSON.stringify(c[Ut])&&console.error(`Persistent ref is being saved to \`${f.join(".")}\` when it's already present at \`${c[Ut].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[Ut]=f;const v=a.reduce((y,N)=>(N in y||(y[N]={}),y[N]),t),g=v[l];v[l]=c[Ft],lr(v)?g!=null?v[l]=g:v[l]=c[ln]:g!=null?v[l].value=g:v[l].value=c[ln]}else!(c instanceof o)&&!Me(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...a,l])&&(ht(c)&&!ht(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.",Tt in r?r[Tt]:r,l):u=!0))}}),u};i(e[Tt]),Zt[e.id].forEach(r=>{r[An]||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[On]);return}Zt[e.id].delete(c);const f=[e.id,...a,l];c[Gt]!=null&&JSON.stringify(f)!==JSON.stringify(c[Gt])&&console.error(`Persistent ref is being saved to \`${f.join(".")}\` when it's already present at \`${c[Gt].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[Gt]=f;const v=a.reduce((y,N)=>(N in y||(y[N]={}),y[N]),t),g=v[l];v[l]=c[Ot],lr(v)?g!=null?v[l]=g:v[l]=c[ln]:g!=null?v[l].value=g:v[l].value=c[ln]}else!(c instanceof o)&&!Me(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...a,l])&&(ht(c)&&!ht(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.",Tt in r?r[Tt]:r,l):u=!0))}}),u};i(e[Tt]),Zt[e.id].forEach(r=>{r[An]||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[On])}),Zt[e.id].clear()});const ii=Symbol("RegisterNode"),ri=Symbol("UnregisterNode"),ai=Symbol("Nodes"),si=Symbol("Bounds"),we=ti({});window.layers=we;const Zt={},Le=[];function oi(e,t){return Je(()=>{const n={},i=n.emitter=Ei();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=z({}),n.id=e,Le.push(e),Zt[e]=new Set,n.minimized=at(!1,!1),Object.assign(n,t.call(n,n)),Le[Le.length-1]==null||Le[Le.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen Stack: ${Le} -Trying to pop ${n.id}`;Le.pop(),F(n,"color"),F(n,"display"),F(n,"classes"),F(n,"style"),F(n,"name"),oe(n,"name",n.id),F(n,"minWidth"),oe(n,"minWidth",600),F(n,"minimizable"),oe(n,"minimizable",!0),F(n,"minimizedDisplay");const r=n.style;return n.style=I(()=>{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 li(e,t){if(console.info("Adding layer",e.id),we[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,we[e.id]);return}oe(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),we[e.id]=e,Ve.emit("addLayer",e,t.layers[e.id])}function Ua(e){return we[e]}function Ui(e){console.info("Removing layer",e.id),Ve.emit("removeLayer",e),we[e.id]=void 0}function Ga(e){Ui(e),li(e,X)}function Wa(e){const t=z(!1);return{openModal:()=>t.value=!0,modal:ne(()=>p(kt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>p("h2",null,[s(e.name)]),body:s(e.display)}))}}Ve.on("update",function(t){Object.values(we).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(we).forEach(n=>{n==null||n.emit("update",t)}),Object.values(we).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Ha=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:ii,UnregisterNodeInjectionKey:ri,NodesInjectionKey:ai,BoundsInjectionKey:si,layers:we,persistentRefs:Zt,addingLayers:Le,createLayer:oi,addLayer:li,getLayer:Ua,removeLayer:Ui,reloadLayer:Ga,setupLayerModal:Wa},Symbol.toStringTag,{value:"Module"}));const Za=Q({components:{Context:ji},props:{index:{type:Number,required:!0},display:{type:j(Object,String,Function),required:!0},minimizedDisplay:j(Object,String,Function),minimized:{type:Object,required:!0},name:{type:j(String),required:!0},color:j(String),minimizable:j(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=Ce(e),a=Bi(t),u=Cn(r),l=I(()=>de.allowGoBack&&n.value>0&&!xe(i));function c(){X.tabs.splice(s(e.index),1/0)}function f(v){e.nodes.value=v}return{component:a,minimizedComponent:u,showGoBack:l,updateNodes:f,unref:s,goBack:c}}}),Ya={key:1};function Ja(e,t,n,i,r,a){const u=bt("Context");return S(),D("div",{class:"layer-container",style:qe({"--layer-color":e.unref(e.color)})},[e.showGoBack?(S(),D("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...l)=>e.goBack&&e.goBack(...l))},"\u274C")):U("",!0),e.unref(e.minimized)?(S(),D("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=l=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(S(),te(Oe(e.minimizedComponent),{key:0})):(S(),D("div",Ya,ie(e.unref(e.name)),1))])):(S(),D("div",{key:2,class:pe(["layer-tab",{showGoBack:e.showGoBack}])},[p(u,{onUpdateNodes:e.updateNodes},{default:H(()=>[(S(),te(Oe(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(S(),D("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=l=>e.$emit("setMinimized",!0))}," \u25BC ")):U("",!0)],4)}var Ka=fe(Za,[["render",Ja],["__scopeId","data-v-72dd78b1"]]);const Gi=e=>(Jt("data-v-4b4bda40"),e=e(),Kt(),e),Xa=Gi(()=>C("h2",null,"Changelog",-1)),Qa=Gi(()=>C("details",{open:""},[C("summary",null,[q("v0.0 Initial Commit - "),C("time",null,"2021-09-04")]),q(" This is the first release :D "),C("ul",null,[C("li",{class:"feature"},"Did everything"),C("li",{class:"fix"},"Had some fun"),C("li",{class:"breaking"},"Removed everything"),C("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),es=Q({__name:"Changelog",setup(e,{expose:t}){const n=z(!1);return t({open(){n.value=!0}}),(i,r)=>(S(),te(kt,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=a=>n.value=a)},{header:H(()=>[Xa]),body:H(()=>[Qa]),_:1},8,["modelValue"]))}});var ts=fe(es,[["__scopeId","data-v-4b4bda40"]]),ns=Q({props:{element:Object,display:{type:j(Object,String,Function),required:!0},style:j(Object,String,Array),classes:j(Object),direction:j(String),xoffset:j(String),yoffset:j(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=Ce(e),r=z(!1),a=I(()=>(xe(i)||r.value)&&u.value),u=Cn(n),l=Ye(ae(ne(()=>{const v=xe(t);return v==null?"":rt(v)})));function c(v){const g=i;v.shiftKey&&g&&(g.value=!g.value,v.stopPropagation(),v.preventDefault())}const f=I(()=>xe(i)&&dt[re.theme].showPin);return{Direction:J,isHovered:r,isShown:a,comp:u,elementComp:l,unref:s,togglePinned:c,showPin:f}}});const is={key:0,class:"material-icons pinned"};function rs(e,t,n,i,r,a){return S(),D("div",{class:pe(["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))},[_t(e.$slots,"default",{},void 0,!0),e.elementComp?(S(),te(Oe(e.elementComp),{key:0})):U("",!0),p(sn,{name:"fade"},{default:H(()=>{var u;return[e.isShown?(S(),D("div",{key:0,class:pe(["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:qe([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(u=e.unref(e.style))!=null?u:{}])},[e.showPin?(S(),D("span",is,"push_pin")):U("",!0),e.comp?(S(),te(Oe(e.comp),{key:1})):U("",!0)],6)):U("",!0)]}),_:1})],34)}var ke=fe(ns,[["render",rs],["__scopeId","data-v-6102fa3a"]]);const Xt=e=>(Jt("data-v-4f97aa40"),e=e(),Kt(),e),as={class:"info-modal-header"},ss=["src","alt"],os={class:"info-modal-title"},ls={key:0},us={key:0},cs={key:0},ds=Xt(()=>C("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),fs=Xt(()=>C("br",null,null,-1)),gs=Xt(()=>C("br",null,null,-1)),ps=["href"],ms=Xt(()=>C("span",{class:"material-icons info-modal-discord"},"discord",-1)),vs=Xt(()=>C("div",null,[C("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[C("span",{class:"material-icons info-modal-discord"},"discord"),q(" The Paper Pilot Community ")])],-1)),hs=Xt(()=>C("div",null,[C("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[C("span",{class:"material-icons info-modal-discord"},"discord"),q(" The Modding Tree ")])],-1)),bs=Xt(()=>C("br",null,null,-1));var ys=Q({__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:f}=de,v=Ce(n),g=z(!1),y=I(()=>Bn(X.timePlayed)),N=I(()=>ae(ne(()=>p(se,null,[Ia.map(Ze)]))));t({open(){g.value=!0}});function w(){var _;(_=s(v.changelog))==null||_.open()}return(_,E)=>(S(),te(kt,{modelValue:g.value,"onUpdate:modelValue":E[0]||(E[0]=R=>g.value=R)},{header:H(()=>[C("div",as,[s(r)?(S(),D("img",{key:0,class:"info-modal-logo",src:s(r),alt:s(i)},null,8,ss)):U("",!0),C("div",os,[C("h2",null,ie(s(i)),1),C("h4",null,[q(" v"+ie(s(c)),1),s(f)?(S(),D("span",ls,": "+ie(s(f)),1)):U("",!0)])])])]),body:H(({shown:R})=>[R?(S(),D("div",us,[s(a)?(S(),D("div",cs,"By "+ie(s(a)),1)):U("",!0),ds,fs,C("div",{class:"link",onClick:w},"Changelog"),gs,C("div",null,[s(l)?(S(),D("a",{key:0,href:s(l),class:"info-modal-discord-link",target:"_blank"},[ms,q(" "+ie(s(u)),1)],8,ps)):U("",!0)]),vs,hs,bs,C("div",null,"Time Played: "+ie(s(y)),1),(S(),te(Oe(s(N))))])):U("",!0)]),_:1},8,["modelValue"]))}});var ws=fe(ys,[["__scopeId","data-v-4f97aa40"]]);const _s={class:"field"},Ns={key:0,class:"field-title"},ui=Q({__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=Cn(At(n,"title"),"span"),r=z((u=n.options.find(l=>l.value===n.modelValue))!=null?u:null);st(At(n,"modelValue"),l=>{var c;xe(r)!==l&&(r.value=(c=n.options.find(f=>f.value===l))!=null?c:null)});function a(l){t("update:modelValue",l.value)}return(l,c)=>(S(),D("div",_s,[s(i)?(S(),D("span",Ns,[(S(),te(Oe(s(i))))])):U("",!0),p(s(pr),{options:e.options,modelValue:r.value,"onUpdate:modelValue":[c[0]||(c[0]=f=>r.value=f),a],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const Cs={class:"field"},ks=Q({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=I(()=>{var a;return ae((a=s(n.title))!=null?a:"","span")}),r=I({get(){return!!n.modelValue},set(a){t("update:modelValue",a)}});return(a,u)=>(S(),D("label",Cs,[ei(C("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":u[0]||(u[0]=l=>Me(r)?r.value=l:null)},null,512),[[ur,s(r)]]),(S(),te(Oe(s(i))))]))}});var wt=fe(ks,[["__scopeId","data-v-11046116"]]);const Ms=["onClick"],Ss=Q({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=z(!1),i=z(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,Nt(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(a,u)=>(S(),D("button",{onClick:an(r,["stop"]),class:pe(["feedback",{activated:n.value,left:e.left}])},[_t(a.$slots,"default",{},void 0,!0)],10,Ms))}});var Wi=fe(Ss,[["__scopeId","data-v-01a1b95c"]]);const Is={class:"header"},$s=C("h2",null,"Settings",-1),xs={class:"option-tabs"},Es={key:0},Ts={key:1};var Ds=Q({__name:"Options",setup(e,{expose:t}){const n=z(!1),i=z("behaviour");function r(B){return B==i.value}function a(B){i.value=B}t({isTab:r,setTab:a,save:We,open(){n.value=!0}});const u=Object.keys(dt).map(B=>({label:tt(B),value:B})),l=I(()=>ae(ne(()=>p(se,null,[Ri.map(Ze)])))),{showTPS:c,theme:f,unthrottled:v,alignUnits:g}=Ce(re),{autosave:y,offlineProd:N}=Ce(X),w=I({get(){return X.devSpeed===0},set(B){X.devSpeed=B?0:null}}),_=ne(()=>p("span",{class:"option-title"},[q("Unthrottled"),p("desc",null,[q("Allow the game to run as fast as possible. Not battery friendly.")])])),E=ne(()=>p("span",{class:"option-title"},[q("Offline Production"),p(ke,{display:"Save-specific",direction:J.Right},{default:()=>[q("*")]}),p("desc",null,[q("Simulate production that occurs while the game is closed.")])])),R=ne(()=>p("span",{class:"option-title"},[q("Autosave"),p(ke,{display:"Save-specific",direction:J.Right},{default:()=>[q("*")]}),p("desc",null,[q("Automatically save the game every second or when the game is closed.")])])),x=ne(()=>p("span",{class:"option-title"},[q("Pause game"),p(ke,{display:"Save-specific",direction:J.Right},{default:()=>[q("*")]}),p("desc",null,[q("Stop everything from moving.")])])),T=ne(()=>p("span",{class:"option-title"},[q("Theme"),p("desc",null,[q("How the game looks.")])])),L=ne(()=>p("span",{class:"option-title"},[q("Show TPS"),p("desc",null,[q("Show TPS meter at the bottom-left corner of the page.")])])),A=ne(()=>p("span",{class:"option-title"},[q("Align modifier units"),p("desc",null,[q("Align numbers to the beginning of the unit in modifier view.")])]));return(B,K)=>(S(),te(kt,{modelValue:n.value,"onUpdate:modelValue":K[10]||(K[10]=le=>n.value=le)},{header:H(()=>[C("div",Is,[$s,C("div",xs,[C("button",{class:pe({selected:r("behaviour")}),onClick:K[0]||(K[0]=le=>a("behaviour"))},"Behaviour",2),C("button",{class:pe({selected:r("appearance")}),onClick:K[1]||(K[1]=le=>a("appearance"))},"Appearance",2)])])]),body:H(()=>[r("behaviour")?(S(),D("div",Es,[p(wt,{title:s(_),modelValue:s(v),"onUpdate:modelValue":K[2]||(K[2]=le=>Me(v)?v.value=le:null)},null,8,["title","modelValue"]),s(de).enablePausing?(S(),te(wt,{key:0,title:s(x),modelValue:s(w),"onUpdate:modelValue":K[3]||(K[3]=le=>Me(w)?w.value=le:null)},null,8,["title","modelValue"])):U("",!0),p(wt,{title:s(E),modelValue:s(N),"onUpdate:modelValue":K[4]||(K[4]=le=>Me(N)?N.value=le:null)},null,8,["title","modelValue"]),p(wt,{title:s(R),modelValue:s(y),"onUpdate:modelValue":K[5]||(K[5]=le=>Me(y)?y.value=le:null)},null,8,["title","modelValue"]),s(y)?U("",!0):(S(),te(Wi,{key:1,class:"button save-button",onClick:K[6]||(K[6]=le=>s(We)())},{default:H(()=>[q("Manually save")]),_:1}))])):U("",!0),r("appearance")?(S(),D("div",Ts,[p(ui,{title:s(T),options:s(u),modelValue:s(f),"onUpdate:modelValue":K[7]||(K[7]=le=>Me(f)?f.value=le:null)},null,8,["title","options","modelValue"]),(S(),te(Oe(s(l)))),p(wt,{title:s(L),modelValue:s(c),"onUpdate:modelValue":K[8]||(K[8]=le=>Me(c)?c.value=le:null)},null,8,["title","modelValue"]),p(wt,{title:s(A),modelValue:s(g),"onUpdate:modelValue":K[9]||(K[9]=le=>Me(g)?g.value=le:null)},null,8,["title","modelValue"])])):U("",!0)]),_:1},8,["modelValue"]))}});const Ps=["onSubmit"],Fs={class:"field"},Os={key:0,class:"field-title"},As=["placeholder"],qs=Q({__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=Cn(At(n,"title"),"span"),r=Ye(null);Rn(()=>{var c;(c=r.value)==null||c.focus()});const a=I({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,f)=>(S(),D("form",{onSubmit:an(u,["prevent"])},[C("div",Fs,[s(i)?(S(),D("span",Os,[(S(),te(Oe(s(i))))])):U("",!0),e.textArea?(S(),te(s(vr),{key:1,modelValue:s(a),"onUpdate:modelValue":f[0]||(f[0]=v=>Me(a)?a.value=v:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:l,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):ei((S(),D("input",{key:2,type:"text","onUpdate:modelValue":f[1]||(f[1]=v=>Me(a)?a.value=v:null),placeholder:e.placeholder,class:pe({fullWidth:!e.title}),onBlur:l,ref_key:"field",ref:r},null,42,As)),[[cr,s(a)]])])],40,Ps))}});var Hi=fe(qs,[["__scopeId","data-v-90bd4994"]]);const Vs={key:0},Rs=["onClick","disabled"],Ls={key:0},Bs=["onClick"],js=Q({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=Ce(e),r=z(!1);st(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)=>(S(),D("span",{class:pe(["container",{confirming:r.value}])},[r.value?(S(),D("span",Vs,"Are you sure?")):U("",!0),C("button",{onClick:an(a,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(S(),D("span",Ls,"Yes")):_t(l.$slots,"default",{key:1},void 0,!0)],8,Rs),r.value?(S(),D("button",{key:1,class:"button",onClick:an(u,["stop"])},"No",8,Bs)):U("",!0)],2))}});var zs=fe(js,[["__scopeId","data-v-2f8ef34c"]]);const Mt=e=>(Jt("data-v-32313015"),e=e(),Kt(),e),Us=Mt(()=>C("div",{class:"handle material-icons"},"drag_handle",-1)),Gs={key:0,class:"actions"},Ws=Mt(()=>C("span",{class:"material-icons"},"content_paste",-1)),Hs=Mt(()=>C("span",{class:"material-icons"},"content_copy",-1)),Zs=Mt(()=>C("span",{class:"material-icons"},"edit",-1)),Ys=Mt(()=>C("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Js={key:1,class:"actions"},Ks=Mt(()=>C("span",{class:"material-icons"},"check",-1)),Xs=Mt(()=>C("span",{class:"material-icons"},"close",-1)),Qs={key:2,class:"details"},eo={class:"save-version"},to=Mt(()=>C("br",null,null,-1)),no={key:0},io={key:3,class:"details"},ro={key:4,class:"details error"},ao=Mt(()=>C("br",null,null,-1)),so=Q({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=Ce(n),r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),a=z(!1),u=z(!1),l=z("");st(a,()=>{var g;return l.value=(g=i.value.name)!=null?g:""});const c=I(()=>i.value!=null&&i.value.id===X.id),f=I(()=>{var g;return c.value?X.time:(g=i.value!=null&&i.value.time)!=null?g:0});function v(){t("editName",l.value),a.value=!1}return(g,y)=>(S(),D("div",{class:pe(["save",{active:s(c)}])},[Us,a.value?(S(),D("div",Js,[C("button",{onClick:v,class:"button"},[p(ke,{display:"Save",direction:s(J).Left,class:"info"},{default:H(()=>[Ks]),_:1},8,["direction"])]),C("button",{onClick:y[5]||(y[5]=N=>a.value=!a.value),class:"button"},[p(ke,{display:"Cancel",direction:s(J).Left,class:"info"},{default:H(()=>[Xs]),_:1},8,["direction"])])])):(S(),D("div",Gs,[s(i).error==null&&!u.value?(S(),te(Wi,{key:0,onClick:y[0]||(y[0]=N=>t("export")),class:"button",left:""},{default:H(()=>[p(ke,{display:"Export",direction:s(J).Left,class:"info"},{default:H(()=>[Ws]),_:1},8,["direction"])]),_:1})):U("",!0),s(i).error==null&&!u.value?(S(),D("button",{key:1,onClick:y[1]||(y[1]=N=>t("duplicate")),class:"button"},[p(ke,{display:"Duplicate",direction:s(J).Left,class:"info"},{default:H(()=>[Hs]),_:1},8,["direction"])])):U("",!0),s(i).error==null&&!u.value?(S(),D("button",{key:2,onClick:y[2]||(y[2]=N=>a.value=!a.value),class:"button"},[p(ke,{display:"Edit Name",direction:s(J).Left,class:"info"},{default:H(()=>[Zs]),_:1},8,["direction"])])):U("",!0),p(zs,{disabled:s(c),onClick:y[3]||(y[3]=N=>t("delete")),onConfirmingChanged:y[4]||(y[4]=N=>u.value=N)},{default:H(()=>[p(ke,{display:"Delete",direction:s(J).Left,class:"info"},{default:H(()=>[Ys]),_:1},8,["direction"])]),_:1},8,["disabled"])])),s(i).error==null&&!a.value?(S(),D("div",Qs,[C("button",{class:"button open",onClick:y[6]||(y[6]=N=>t("open"))},[C("h3",null,ie(s(i).name),1)]),C("span",eo,"v"+ie(s(i).modVersion),1),to,s(f)?(S(),D("div",no,"Last played "+ie(s(r).format(s(f))),1)):U("",!0)])):s(i).error==null&&a.value?(S(),D("div",io,[p(Hi,{modelValue:l.value,"onUpdate:modelValue":y[7]||(y[7]=N=>l.value=N),class:"editname",onSubmit:v},null,8,["modelValue"])])):(S(),D("div",ro,[q(" Error: Failed to load save with id "+ie(s(i).id),1),ao,q(ie(s(i).error),1)]))],2))}});var oo=fe(so,[["__scopeId","data-v-32313015"]]);const ci=e=>(Jt("data-v-2a4275be"),e=e(),Kt(),e),lo=ci(()=>C("h2",null,"Saves Manager",-1)),uo={class:"modal-footer"},co={class:"field"},fo=ci(()=>C("span",{class:"field-title"},"Create Save",-1)),go={class:"field-buttons"},po={class:"footer"},mo=ci(()=>C("div",{style:{"flex-grow":"1"}},null,-1)),vo=Q({__name:"SavesManager",setup(e,{expose:t}){const n=z(!1),i=z(null);t({open(){n.value=!0}});const r=z(!1),a=z(""),u=z(null);st(a,x=>{x?Nt(()=>{try{if(x[0]!=="{")if(x[0]==="e")x=decodeURIComponent(escape(atob(x)));else if(x[0]==="\u1BE1")x=Dt.decompressFromUTF16(x);else{console.warn("Unable to determine preset encoding",x),r.value=!0;return}const T=JSON.parse(x);if(typeof T!="object"){r.value=!0;return}const L=En();T.id=L,We(T),a.value="",r.value=!1,re.saves.push(L)}catch{r.value=!0}}):r.value=!1});let l={},c=z(Object.keys(l).reduce((x,T)=>(x.push({label:T.split("/").slice(-1)[0].slice(0,-4),value:l[T]}),x),[]));const f=ti({});function v(x){if(f[x]==null){let T=localStorage.getItem(x);if(T==null)f[x]={error:"Save doesn't exist in localStorage",id:x};else if(T==="dW5kZWZpbmVk")f[x]={error:"Save is undefined",id:x};else try{if(T[0]!=="{")if(T[0]==="e")T=decodeURIComponent(escape(atob(T)));else if(T[0]==="\u1BE1")T=Dt.decompressFromUTF16(T);else return console.warn("Unable to determine preset encoding",T),r.value=!0,f[x]={error:"Unable to determine preset encoding",id:x},f[x];f[x]={...JSON.parse(T),id:x}}catch(L){f[x]={error:L,id:x},console.warn(`SavesManager: Failed to load info about save with id ${x}: +Trying to pop ${n.id}`;Le.pop(),F(n,"color"),F(n,"display"),F(n,"classes"),F(n,"style"),F(n,"name"),oe(n,"name",n.id),F(n,"minWidth"),oe(n,"minWidth",600),F(n,"minimizable"),oe(n,"minimizable",!0),F(n,"minimizedDisplay");const r=n.style;return n.style=I(()=>{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 li(e,t){if(console.info("Adding layer",e.id),we[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,we[e.id]);return}oe(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),we[e.id]=e,Ve.emit("addLayer",e,t.layers[e.id])}function Ua(e){return we[e]}function Ui(e){console.info("Removing layer",e.id),Ve.emit("removeLayer",e),we[e.id]=void 0}function Ga(e){Ui(e),li(e,X)}function Wa(e){const t=z(!1);return{openModal:()=>t.value=!0,modal:ne(()=>p(kt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>p("h2",null,[s(e.name)]),body:s(e.display)}))}}Ve.on("update",function(t){Object.values(we).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(we).forEach(n=>{n==null||n.emit("update",t)}),Object.values(we).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Ha=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:ii,UnregisterNodeInjectionKey:ri,NodesInjectionKey:ai,BoundsInjectionKey:si,layers:we,persistentRefs:Zt,addingLayers:Le,createLayer:oi,addLayer:li,getLayer:Ua,removeLayer:Ui,reloadLayer:Ga,setupLayerModal:Wa},Symbol.toStringTag,{value:"Module"}));const Za=Q({components:{Context:ji},props:{index:{type:Number,required:!0},display:{type:j(Object,String,Function),required:!0},minimizedDisplay:j(Object,String,Function),minimized:{type:Object,required:!0},name:{type:j(String),required:!0},color:j(String),minimizable:j(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=ke(e),a=Bi(t),u=Cn(r),l=I(()=>de.allowGoBack&&n.value>0&&!$e(i));function c(){X.tabs.splice(s(e.index),1/0)}function f(v){e.nodes.value=v}return{component:a,minimizedComponent:u,showGoBack:l,updateNodes:f,unref:s,goBack:c}}}),Ya={key:1};function Ja(e,t,n,i,r,a){const u=bt("Context");return S(),D("div",{class:"layer-container",style:qe({"--layer-color":e.unref(e.color)})},[e.showGoBack?(S(),D("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...l)=>e.goBack&&e.goBack(...l))},"\u274C")):U("",!0),e.unref(e.minimized)?(S(),D("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=l=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(S(),te(Oe(e.minimizedComponent),{key:0})):(S(),D("div",Ya,ie(e.unref(e.name)),1))])):(S(),D("div",{key:2,class:pe(["layer-tab",{showGoBack:e.showGoBack}])},[p(u,{onUpdateNodes:e.updateNodes},{default:Z(()=>[(S(),te(Oe(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(S(),D("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=l=>e.$emit("setMinimized",!0))}," \u25BC ")):U("",!0)],4)}var Ka=fe(Za,[["render",Ja],["__scopeId","data-v-72dd78b1"]]);const Gi=e=>(Jt("data-v-4b4bda40"),e=e(),Kt(),e),Xa=Gi(()=>C("h2",null,"Changelog",-1)),Qa=Gi(()=>C("details",{open:""},[C("summary",null,[q("v0.0 Initial Commit - "),C("time",null,"2021-09-04")]),q(" This is the first release :D "),C("ul",null,[C("li",{class:"feature"},"Did everything"),C("li",{class:"fix"},"Had some fun"),C("li",{class:"breaking"},"Removed everything"),C("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),es=Q({__name:"Changelog",setup(e,{expose:t}){const n=z(!1);return t({open(){n.value=!0}}),(i,r)=>(S(),te(kt,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=a=>n.value=a)},{header:Z(()=>[Xa]),body:Z(()=>[Qa]),_:1},8,["modelValue"]))}});var ts=fe(es,[["__scopeId","data-v-4b4bda40"]]),ns=Q({props:{element:Object,display:{type:j(Object,String,Function),required:!0},style:j(Object,String,Array),classes:j(Object),direction:j(String),xoffset:j(String),yoffset:j(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=ke(e),r=z(!1),a=I(()=>($e(i)||r.value)&&u.value),u=Cn(n),l=Ye(ae(ne(()=>{const v=$e(t);return v==null?"":rt(v)})));function c(v){const g=i;v.shiftKey&&g&&(g.value=!g.value,v.stopPropagation(),v.preventDefault())}const f=I(()=>$e(i)&&dt[re.theme].showPin);return{Direction:J,isHovered:r,isShown:a,comp:u,elementComp:l,unref:s,togglePinned:c,showPin:f}}});const is={key:0,class:"material-icons pinned"};function rs(e,t,n,i,r,a){return S(),D("div",{class:pe(["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))},[_t(e.$slots,"default",{},void 0,!0),e.elementComp?(S(),te(Oe(e.elementComp),{key:0})):U("",!0),p(sn,{name:"fade"},{default:Z(()=>{var u;return[e.isShown?(S(),D("div",{key:0,class:pe(["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:qe([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(u=e.unref(e.style))!=null?u:{}])},[e.showPin?(S(),D("span",is,"push_pin")):U("",!0),e.comp?(S(),te(Oe(e.comp),{key:1})):U("",!0)],6)):U("",!0)]}),_:1})],34)}var Ne=fe(ns,[["render",rs],["__scopeId","data-v-6102fa3a"]]);const Xt=e=>(Jt("data-v-4f97aa40"),e=e(),Kt(),e),as={class:"info-modal-header"},ss=["src","alt"],os={class:"info-modal-title"},ls={key:0},us={key:0},cs={key:0},ds=Xt(()=>C("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),fs=Xt(()=>C("br",null,null,-1)),gs=Xt(()=>C("br",null,null,-1)),ps=["href"],ms=Xt(()=>C("span",{class:"material-icons info-modal-discord"},"discord",-1)),vs=Xt(()=>C("div",null,[C("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[C("span",{class:"material-icons info-modal-discord"},"discord"),q(" The Paper Pilot Community ")])],-1)),hs=Xt(()=>C("div",null,[C("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[C("span",{class:"material-icons info-modal-discord"},"discord"),q(" The Modding Tree ")])],-1)),bs=Xt(()=>C("br",null,null,-1));var ys=Q({__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:f}=de,v=ke(n),g=z(!1),y=I(()=>Bn(X.timePlayed)),N=I(()=>ae(ne(()=>p(se,null,[Ia.map(Ze)]))));t({open(){g.value=!0}});function w(){var _;(_=s(v.changelog))==null||_.open()}return(_,E)=>(S(),te(kt,{modelValue:g.value,"onUpdate:modelValue":E[0]||(E[0]=R=>g.value=R)},{header:Z(()=>[C("div",as,[s(r)?(S(),D("img",{key:0,class:"info-modal-logo",src:s(r),alt:s(i)},null,8,ss)):U("",!0),C("div",os,[C("h2",null,ie(s(i)),1),C("h4",null,[q(" v"+ie(s(c)),1),s(f)?(S(),D("span",ls,": "+ie(s(f)),1)):U("",!0)])])])]),body:Z(({shown:R})=>[R?(S(),D("div",us,[s(a)?(S(),D("div",cs,"By "+ie(s(a)),1)):U("",!0),ds,fs,C("div",{class:"link",onClick:w},"Changelog"),gs,C("div",null,[s(l)?(S(),D("a",{key:0,href:s(l),class:"info-modal-discord-link",target:"_blank"},[ms,q(" "+ie(s(u)),1)],8,ps)):U("",!0)]),vs,hs,bs,C("div",null,"Time Played: "+ie(s(y)),1),(S(),te(Oe(s(N))))])):U("",!0)]),_:1},8,["modelValue"]))}});var ws=fe(ys,[["__scopeId","data-v-4f97aa40"]]);const _s={class:"field"},Ns={key:0,class:"field-title"},ui=Q({__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=Cn(qt(n,"title"),"span"),r=z((u=n.options.find(l=>l.value===n.modelValue))!=null?u:null);st(qt(n,"modelValue"),l=>{var c;$e(r)!==l&&(r.value=(c=n.options.find(f=>f.value===l))!=null?c:null)});function a(l){t("update:modelValue",l.value)}return(l,c)=>(S(),D("div",_s,[s(i)?(S(),D("span",Ns,[(S(),te(Oe(s(i))))])):U("",!0),p(s(pr),{options:e.options,modelValue:r.value,"onUpdate:modelValue":[c[0]||(c[0]=f=>r.value=f),a],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const Cs={class:"field"},ks=Q({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=I(()=>{var a;return ae((a=s(n.title))!=null?a:"","span")}),r=I({get(){return!!n.modelValue},set(a){t("update:modelValue",a)}});return(a,u)=>(S(),D("label",Cs,[ei(C("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":u[0]||(u[0]=l=>Me(r)?r.value=l:null)},null,512),[[ur,s(r)]]),(S(),te(Oe(s(i))))]))}});var wt=fe(ks,[["__scopeId","data-v-11046116"]]);const Ms=["onClick"],Ss=Q({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=z(!1),i=z(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,Nt(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(a,u)=>(S(),D("button",{onClick:an(r,["stop"]),class:pe(["feedback",{activated:n.value,left:e.left}])},[_t(a.$slots,"default",{},void 0,!0)],10,Ms))}});var Wi=fe(Ss,[["__scopeId","data-v-01a1b95c"]]);const Is={class:"header"},xs=C("h2",null,"Settings",-1),$s={class:"option-tabs"},Es={key:0},Ts={key:1};var Ds=Q({__name:"Options",setup(e,{expose:t}){const n=z(!1),i=z("behaviour");function r(B){return B==i.value}function a(B){i.value=B}t({isTab:r,setTab:a,save:We,open(){n.value=!0}});const u=Object.keys(dt).map(B=>({label:tt(B),value:B})),l=I(()=>ae(ne(()=>p(se,null,[Ri.map(Ze)])))),{showTPS:c,theme:f,unthrottled:v,alignUnits:g}=ke(re),{autosave:y,offlineProd:N}=ke(X),w=I({get(){return X.devSpeed===0},set(B){X.devSpeed=B?0:null}}),_=ne(()=>p("span",{class:"option-title"},[q("Unthrottled"),p("desc",null,[q("Allow the game to run as fast as possible. Not battery friendly.")])])),E=ne(()=>p("span",{class:"option-title"},[q("Offline Production"),p(Ne,{display:"Save-specific",direction:J.Right},{default:()=>[q("*")]}),p("desc",null,[q("Simulate production that occurs while the game is closed.")])])),R=ne(()=>p("span",{class:"option-title"},[q("Autosave"),p(Ne,{display:"Save-specific",direction:J.Right},{default:()=>[q("*")]}),p("desc",null,[q("Automatically save the game every second or when the game is closed.")])])),$=ne(()=>p("span",{class:"option-title"},[q("Pause game"),p(Ne,{display:"Save-specific",direction:J.Right},{default:()=>[q("*")]}),p("desc",null,[q("Stop everything from moving.")])])),T=ne(()=>p("span",{class:"option-title"},[q("Theme"),p("desc",null,[q("How the game looks.")])])),L=ne(()=>p("span",{class:"option-title"},[q("Show TPS"),p("desc",null,[q("Show TPS meter at the bottom-left corner of the page.")])])),A=ne(()=>p("span",{class:"option-title"},[q("Align modifier units"),p("desc",null,[q("Align numbers to the beginning of the unit in modifier view.")])]));return(B,K)=>(S(),te(kt,{modelValue:n.value,"onUpdate:modelValue":K[10]||(K[10]=le=>n.value=le)},{header:Z(()=>[C("div",Is,[xs,C("div",$s,[C("button",{class:pe({selected:r("behaviour")}),onClick:K[0]||(K[0]=le=>a("behaviour"))},"Behaviour",2),C("button",{class:pe({selected:r("appearance")}),onClick:K[1]||(K[1]=le=>a("appearance"))},"Appearance",2)])])]),body:Z(()=>[r("behaviour")?(S(),D("div",Es,[p(wt,{title:s(_),modelValue:s(v),"onUpdate:modelValue":K[2]||(K[2]=le=>Me(v)?v.value=le:null)},null,8,["title","modelValue"]),s(de).enablePausing?(S(),te(wt,{key:0,title:s($),modelValue:s(w),"onUpdate:modelValue":K[3]||(K[3]=le=>Me(w)?w.value=le:null)},null,8,["title","modelValue"])):U("",!0),p(wt,{title:s(E),modelValue:s(N),"onUpdate:modelValue":K[4]||(K[4]=le=>Me(N)?N.value=le:null)},null,8,["title","modelValue"]),p(wt,{title:s(R),modelValue:s(y),"onUpdate:modelValue":K[5]||(K[5]=le=>Me(y)?y.value=le:null)},null,8,["title","modelValue"]),s(y)?U("",!0):(S(),te(Wi,{key:1,class:"button save-button",onClick:K[6]||(K[6]=le=>s(We)())},{default:Z(()=>[q("Manually save")]),_:1}))])):U("",!0),r("appearance")?(S(),D("div",Ts,[p(ui,{title:s(T),options:s(u),modelValue:s(f),"onUpdate:modelValue":K[7]||(K[7]=le=>Me(f)?f.value=le:null)},null,8,["title","options","modelValue"]),(S(),te(Oe(s(l)))),p(wt,{title:s(L),modelValue:s(c),"onUpdate:modelValue":K[8]||(K[8]=le=>Me(c)?c.value=le:null)},null,8,["title","modelValue"]),p(wt,{title:s(A),modelValue:s(g),"onUpdate:modelValue":K[9]||(K[9]=le=>Me(g)?g.value=le:null)},null,8,["title","modelValue"])])):U("",!0)]),_:1},8,["modelValue"]))}});const Ps=["onSubmit"],Fs={class:"field"},Os={key:0,class:"field-title"},As=["placeholder"],qs=Q({__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=Cn(qt(n,"title"),"span"),r=Ye(null);Rn(()=>{var c;(c=r.value)==null||c.focus()});const a=I({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,f)=>(S(),D("form",{onSubmit:an(u,["prevent"])},[C("div",Fs,[s(i)?(S(),D("span",Os,[(S(),te(Oe(s(i))))])):U("",!0),e.textArea?(S(),te(s(vr),{key:1,modelValue:s(a),"onUpdate:modelValue":f[0]||(f[0]=v=>Me(a)?a.value=v:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:l,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):ei((S(),D("input",{key:2,type:"text","onUpdate:modelValue":f[1]||(f[1]=v=>Me(a)?a.value=v:null),placeholder:e.placeholder,class:pe({fullWidth:!e.title}),onBlur:l,ref_key:"field",ref:r},null,42,As)),[[cr,s(a)]])])],40,Ps))}});var Hi=fe(qs,[["__scopeId","data-v-90bd4994"]]);const Vs={key:0},Rs=["onClick","disabled"],Ls={key:0},Bs=["onClick"],js=Q({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=ke(e),r=z(!1);st(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)=>(S(),D("span",{class:pe(["container",{confirming:r.value}])},[r.value?(S(),D("span",Vs,"Are you sure?")):U("",!0),C("button",{onClick:an(a,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(S(),D("span",Ls,"Yes")):_t(l.$slots,"default",{key:1},void 0,!0)],8,Rs),r.value?(S(),D("button",{key:1,class:"button",onClick:an(u,["stop"])},"No",8,Bs)):U("",!0)],2))}});var zs=fe(js,[["__scopeId","data-v-2f8ef34c"]]);const Mt=e=>(Jt("data-v-32313015"),e=e(),Kt(),e),Us=Mt(()=>C("div",{class:"handle material-icons"},"drag_handle",-1)),Gs={key:0,class:"actions"},Ws=Mt(()=>C("span",{class:"material-icons"},"content_paste",-1)),Hs=Mt(()=>C("span",{class:"material-icons"},"content_copy",-1)),Zs=Mt(()=>C("span",{class:"material-icons"},"edit",-1)),Ys=Mt(()=>C("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Js={key:1,class:"actions"},Ks=Mt(()=>C("span",{class:"material-icons"},"check",-1)),Xs=Mt(()=>C("span",{class:"material-icons"},"close",-1)),Qs={key:2,class:"details"},eo={class:"save-version"},to=Mt(()=>C("br",null,null,-1)),no={key:0},io={key:3,class:"details"},ro={key:4,class:"details error"},ao=Mt(()=>C("br",null,null,-1)),so=Q({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=ke(n),r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),a=z(!1),u=z(!1),l=z("");st(a,()=>{var g;return l.value=(g=i.value.name)!=null?g:""});const c=I(()=>i.value!=null&&i.value.id===X.id),f=I(()=>{var g;return c.value?X.time:(g=i.value!=null&&i.value.time)!=null?g:0});function v(){t("editName",l.value),a.value=!1}return(g,y)=>(S(),D("div",{class:pe(["save",{active:s(c)}])},[Us,a.value?(S(),D("div",Js,[C("button",{onClick:v,class:"button"},[p(Ne,{display:"Save",direction:s(J).Left,class:"info"},{default:Z(()=>[Ks]),_:1},8,["direction"])]),C("button",{onClick:y[5]||(y[5]=N=>a.value=!a.value),class:"button"},[p(Ne,{display:"Cancel",direction:s(J).Left,class:"info"},{default:Z(()=>[Xs]),_:1},8,["direction"])])])):(S(),D("div",Gs,[s(i).error==null&&!u.value?(S(),te(Wi,{key:0,onClick:y[0]||(y[0]=N=>t("export")),class:"button",left:""},{default:Z(()=>[p(Ne,{display:"Export",direction:s(J).Left,class:"info"},{default:Z(()=>[Ws]),_:1},8,["direction"])]),_:1})):U("",!0),s(i).error==null&&!u.value?(S(),D("button",{key:1,onClick:y[1]||(y[1]=N=>t("duplicate")),class:"button"},[p(Ne,{display:"Duplicate",direction:s(J).Left,class:"info"},{default:Z(()=>[Hs]),_:1},8,["direction"])])):U("",!0),s(i).error==null&&!u.value?(S(),D("button",{key:2,onClick:y[2]||(y[2]=N=>a.value=!a.value),class:"button"},[p(Ne,{display:"Edit Name",direction:s(J).Left,class:"info"},{default:Z(()=>[Zs]),_:1},8,["direction"])])):U("",!0),p(zs,{disabled:s(c),onClick:y[3]||(y[3]=N=>t("delete")),onConfirmingChanged:y[4]||(y[4]=N=>u.value=N)},{default:Z(()=>[p(Ne,{display:"Delete",direction:s(J).Left,class:"info"},{default:Z(()=>[Ys]),_:1},8,["direction"])]),_:1},8,["disabled"])])),s(i).error==null&&!a.value?(S(),D("div",Qs,[C("button",{class:"button open",onClick:y[6]||(y[6]=N=>t("open"))},[C("h3",null,ie(s(i).name),1)]),C("span",eo,"v"+ie(s(i).modVersion),1),to,s(f)?(S(),D("div",no,"Last played "+ie(s(r).format(s(f))),1)):U("",!0)])):s(i).error==null&&a.value?(S(),D("div",io,[p(Hi,{modelValue:l.value,"onUpdate:modelValue":y[7]||(y[7]=N=>l.value=N),class:"editname",onSubmit:v},null,8,["modelValue"])])):(S(),D("div",ro,[q(" Error: Failed to load save with id "+ie(s(i).id),1),ao,q(ie(s(i).error),1)]))],2))}});var oo=fe(so,[["__scopeId","data-v-32313015"]]);const ci=e=>(Jt("data-v-2a4275be"),e=e(),Kt(),e),lo=ci(()=>C("h2",null,"Saves Manager",-1)),uo={class:"modal-footer"},co={class:"field"},fo=ci(()=>C("span",{class:"field-title"},"Create Save",-1)),go={class:"field-buttons"},po={class:"footer"},mo=ci(()=>C("div",{style:{"flex-grow":"1"}},null,-1)),vo=Q({__name:"SavesManager",setup(e,{expose:t}){const n=z(!1),i=z(null);t({open(){n.value=!0}});const r=z(!1),a=z(""),u=z(null);st(a,$=>{$?Nt(()=>{try{if($[0]!=="{")if($[0]==="e")$=decodeURIComponent(escape(atob($)));else if($[0]==="\u1BE1")$=Pt.decompressFromUTF16($);else{console.warn("Unable to determine preset encoding",$),r.value=!0;return}const T=JSON.parse($);if(typeof T!="object"){r.value=!0;return}const L=En();T.id=L,We(T),a.value="",r.value=!1,re.saves.push(L)}catch{r.value=!0}}):r.value=!1});let l={},c=z(Object.keys(l).reduce(($,T)=>($.push({label:T.split("/").slice(-1)[0].slice(0,-4),value:l[T]}),$),[]));const f=ti({});function v($){if(f[$]==null){let T=localStorage.getItem($);if(T==null)f[$]={error:"Save doesn't exist in localStorage",id:$};else if(T==="dW5kZWZpbmVk")f[$]={error:"Save is undefined",id:$};else try{if(T[0]!=="{")if(T[0]==="e")T=decodeURIComponent(escape(atob(T)));else if(T[0]==="\u1BE1")T=Pt.decompressFromUTF16(T);else return console.warn("Unable to determine preset encoding",T),r.value=!0,f[$]={error:"Unable to determine preset encoding",id:$},f[$];f[$]={...JSON.parse(T),id:$}}catch(L){f[$]={error:L,id:$},console.warn(`SavesManager: Failed to load info about save with id ${$}: ${L} -${T}`)}}return f[x]}st(n,x=>{x&&Object.keys(f).forEach(T=>delete f[T])});const g=I(()=>re.saves.reduce((x,T)=>(x[T]=v(T),x),{}));function y(x){let T;switch(X.id===x?T=qi(X):T=JSON.stringify(g.value[x]),de.exportEncoding){default:console.warn(`Unknown save encoding: ${de.exportEncoding}. Defaulting to lz`);case"lz":T=Dt.compressToUTF16(T);break;case"base64":T=btoa(unescape(encodeURIComponent(T)));break;case"plain":break}const L=document.createElement("textarea");L.value=T,document.body.appendChild(L),L.select(),L.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(L)}function N(x){X.id===x&&We();const T={...g.value[x],id:En()};We(T),re.saves.push(T.id)}function w(x){re.saves=re.saves.filter(T=>T!==x),localStorage.removeItem(x),f[x]=void 0}function _(x){g.value[X.id].time=X.time,We(),f[X.id]=void 0,zt(g.value[x]),f[x]=void 0}function E(x){if(u.value=x,Nt(()=>{u.value=null}),x[0]!=="{")if(x[0]==="e")x=decodeURIComponent(escape(atob(x)));else if(x[0]==="\u1BE1")x=Dt.decompressFromUTF16(x);else{console.warn("Unable to determine preset encoding",x);return}const T=JSON.parse(x);T.id=En(),We(T),re.saves.push(T.id),_(T.id)}function R(x,T){const L=g.value[x];L!=null&&(L.name=T,X.id===x?(X.name=T,We()):(We(L),f[x]=void 0))}return(x,T)=>(S(),te(kt,{modelValue:n.value,"onUpdate:modelValue":T[4]||(T[4]=L=>n.value=L),ref_key:"modal",ref:i},{header:H(()=>[lo]),body:H(({shown:L})=>[L?(S(),te(s(mr),{key:0,list:s(re).saves,handle:".handle",itemKey:A=>A},{item:H(({element:A})=>[p(oo,{save:s(g)[A],onOpen:B=>_(A),onExport:B=>y(A),onEditName:B=>R(A,B),onDuplicate:B=>N(A),onDelete:B=>w(A)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):U("",!0)]),footer:H(()=>[C("div",uo,[p(Hi,{modelValue:a.value,"onUpdate:modelValue":T[0]||(T[0]=L=>a.value=L),title:"Import Save",placeholder:"Paste your save here!",class:pe({importingFailed:r.value})},null,8,["modelValue","class"]),C("div",co,[fo,C("div",go,[C("button",{class:"button",onClick:T[1]||(T[1]=L=>_(s(rn)().id))},"New Game"),Object.keys(s(c)).length>0?(S(),te(ui,{key:0,options:s(c),modelValue:u.value,"onUpdate:modelValue":T[2]||(T[2]=L=>E(L)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):U("",!0)])]),C("div",po,[mo,C("button",{class:"button modal-default-button",onClick:T[3]||(T[3]=L=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Zi=fe(vo,[["__scopeId","data-v-2a4275be"]]);const Ke=e=>(Jt("data-v-318a1c31"),e=e(),Kt(),e),ho=["src","alt"],bo={key:1,class:"title"},yo=Ke(()=>C("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),wo={class:"discord"},_o={class:"discord-links"},No={key:0},Co=["href"],ko=Ke(()=>C("li",null,[C("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Mo=Ke(()=>C("li",null,[C("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),So={href:"https://forums.moddingtree.com/",target:"_blank"},Io=Ke(()=>C("span",{class:"material-icons"},"forum",-1)),$o=Ke(()=>C("span",{class:"material-icons"},"info",-1)),xo=Ke(()=>C("span",{class:"material-icons"},"library_books",-1)),Eo=Ke(()=>C("span",{class:"material-icons"},"settings",-1)),To=Ke(()=>C("span",{class:"material-icons"},"library_books",-1)),Do=Ke(()=>C("span",{class:"material-icons"},"settings",-1)),Po=Ke(()=>C("span",{class:"material-icons"},"info",-1)),Fo={href:"https://forums.moddingtree.com/",target:"_blank"},Oo=Ke(()=>C("span",{class:"material-icons"},"forum",-1)),Ao={class:"discord"},qo={class:"discord-links"},Vo={key:0},Ro=["href"],Lo=Ke(()=>C("li",null,[C("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Bo=Ke(()=>C("li",null,[C("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),jo=Q({__name:"Nav",setup(e){const t=z(null),n=z(null),i=z(null),r=z(null),{useHeader:a,banner:u,title:l,discordName:c,discordLink:f,versionNumber:v}=de;function g(){window.open(f,"mywindow")}return(y,N)=>(S(),D(se,null,[s(a)?(S(),D("div",Ct({key:0,class:"nav"},y.$attrs),[s(u)?(S(),D("img",{key:0,src:s(u),class:"banner",alt:s(l)},null,8,ho)):(S(),D("div",bo,ie(s(l)),1)),C("div",{onClick:N[0]||(N[0]=w=>{var _;return(_=r.value)==null?void 0:_.open()}),class:"version-container"},[p(ke,{display:"Changelog",direction:s(J).Down,class:"version"},{default:H(()=>[C("span",null,"v"+ie(s(v)),1)]),_:1},8,["direction"])]),yo,C("div",wo,[C("span",{onClick:g,class:"material-icons"},"discord"),C("ul",_o,[s(f)?(S(),D("li",No,[C("a",{href:s(f),target:"_blank"},ie(s(c)),9,Co)])):U("",!0),ko,Mo])]),C("div",null,[C("a",So,[p(ke,{display:"Forums",direction:s(J).Down,yoffset:"5px"},{default:H(()=>[Io]),_:1},8,["direction"])])]),C("div",{onClick:N[1]||(N[1]=w=>{var _;return(_=t.value)==null?void 0:_.open()})},[p(ke,{display:"Info",direction:s(J).Down,class:"info"},{default:H(()=>[$o]),_:1},8,["direction"])]),C("div",{onClick:N[2]||(N[2]=w=>{var _;return(_=n.value)==null?void 0:_.open()})},[p(ke,{display:"Saves",direction:s(J).Down,xoffset:"-20px"},{default:H(()=>[xo]),_:1},8,["direction"])]),C("div",{onClick:N[3]||(N[3]=w=>{var _;return(_=i.value)==null?void 0:_.open()})},[p(ke,{display:"Settings",direction:s(J).Down,xoffset:"-66px"},{default:H(()=>[Eo]),_:1},8,["direction"])])],16)):(S(),D("div",Ct({key:1,class:"overlay-nav"},y.$attrs),[C("div",{onClick:N[4]||(N[4]=w=>{var _;return(_=r.value)==null?void 0:_.open()}),class:"version-container"},[p(ke,{display:"Changelog",direction:s(J).Right,xoffset:"25%",class:"version"},{default:H(()=>[C("span",null,"v"+ie(s(v)),1)]),_:1},8,["direction"])]),C("div",{onClick:N[5]||(N[5]=w=>{var _;return(_=n.value)==null?void 0:_.open()})},[p(ke,{display:"Saves",direction:s(J).Right},{default:H(()=>[To]),_:1},8,["direction"])]),C("div",{onClick:N[6]||(N[6]=w=>{var _;return(_=i.value)==null?void 0:_.open()})},[p(ke,{display:"Settings",direction:s(J).Right},{default:H(()=>[Do]),_:1},8,["direction"])]),C("div",{onClick:N[7]||(N[7]=w=>{var _;return(_=t.value)==null?void 0:_.open()})},[p(ke,{display:"Info",direction:s(J).Right},{default:H(()=>[Po]),_:1},8,["direction"])]),C("div",null,[C("a",Fo,[p(ke,{display:"Forums",direction:s(J).Right,xoffset:"7px"},{default:H(()=>[Oo]),_:1},8,["direction"])])]),C("div",Ao,[C("span",{onClick:g,class:"material-icons"},"discord"),C("ul",qo,[s(f)?(S(),D("li",Vo,[C("a",{href:s(f),target:"_blank"},ie(s(c)),9,Ro)])):U("",!0),Lo,Bo])])],16)),p(ws,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),p(Zi,{ref_key:"savesManager",ref:n},null,512),p(Ds,{ref_key:"options",ref:i},null,512),p(ts,{ref_key:"changelog",ref:r},null,512)],64))}});var Yi=fe(jo,[["__scopeId","data-v-318a1c31"]]);const zo={class:"inner-tab"},Uo=Q({__name:"Game",setup(e){const t=At(X,"tabs"),n=I(()=>Object.keys(we)),i=de.useHeader;function r(a){const{display:u,minimized:l,name:c,color:f,minimizable:v,nodes:g,minimizedDisplay:y}=a;return{display:u,minimized:l,name:c,color:f,minimizable:v,nodes:g,minimizedDisplay:y}}return(a,u)=>(S(),D("div",{class:pe(["tabs-container",{useHeader:s(i)}])},[(S(!0),D(se,null,on(s(t),(l,c)=>{var f,v;return S(),D("div",{key:c,class:pe(["tab",s((f=s(we)[l])==null?void 0:f.classes)]),style:qe(s((v=s(we)[l])==null?void 0:v.style))},[c===0&&!s(i)?(S(),te(Yi,{key:0})):U("",!0),C("div",zo,[s(n).includes(l)?(S(),te(Ka,Ct({key:0},r(s(we)[l]),{index:c,onSetMinimized:g=>s(we)[l].minimized.value=g}),null,16,["index","onSetMinimized"])):(S(),te(Oe(l),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var Go=fe(Uo,[["__scopeId","data-v-dcd207b4"]]);const Wo=Q({__name:"Sticky",setup(e){const t=z("0"),n=new ResizeObserver(r),i=Ye(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 Nt(r),document.fonts.ready.then(r),Rn(()=>{var u;const a=(u=i.value)==null?void 0:u.parentElement;a&&n.observe(a)}),(a,u)=>(S(),D("div",{class:"sticky",style:qe({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[_t(a.$slots,"default",{},void 0,!0)],4))}});var qn=fe(Wo,[["__scopeId","data-v-cccac690"]]);const Ho=["x1","y1","x2","y2"],Zo=Q({__name:"BoardLink",props:{link:null},setup(e){const n=Ce(e),i=I(()=>{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=I(()=>{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)=>(S(),D("line",Ct({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,Ho))}});var Yo=fe(Zo,[["__scopeId","data-v-57c4970a"]]);const Jo={key:0},Ko=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],Xo=["fill","stroke-width","stroke"],Qo=["fill"],el=Q({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const i=Ce(e),r=I(()=>ce(i.nodeType.value.size,s(i.node))),a=I(()=>{var v;return(v=ce(i.nodeType.value.outlineColor,s(i.node)))!=null?v:dt[re.theme].variables["--outline"]}),u=I(()=>{var v;return(v=ce(i.nodeType.value.titleColor,s(i.node)))!=null?v:dt[re.theme].variables["--foreground"]}),l=I(()=>ce(i.nodeType.value.actionDistance,s(i.node)));function c(v,g){t("clickAction",g.id),v.preventDefault(),v.stopPropagation()}function f(v,g){var y;((y=s(i.selectedAction))==null?void 0:y.id)===g.id&&(v.preventDefault(),v.stopPropagation())}return(v,g)=>(S(),te(sn,{name:"actions",appear:""},{default:H(()=>[e.isSelected&&e.actions?(S(),D("g",Jo,[(S(!0),D(se,null,on(e.actions,(y,N)=>{var w,_;return S(),D("g",{key:y.id,class:pe(["action",{selected:((w=e.selectedAction)==null?void 0:w.id)===y.id}]),transform:`translate( +${T}`)}}return f[$]}st(n,$=>{$&&Object.keys(f).forEach(T=>delete f[T])});const g=I(()=>re.saves.reduce(($,T)=>($[T]=v(T),$),{}));function y($){let T;switch(X.id===$?T=qi(X):T=JSON.stringify(g.value[$]),de.exportEncoding){default:console.warn(`Unknown save encoding: ${de.exportEncoding}. Defaulting to lz`);case"lz":T=Pt.compressToUTF16(T);break;case"base64":T=btoa(unescape(encodeURIComponent(T)));break;case"plain":break}const L=document.createElement("textarea");L.value=T,document.body.appendChild(L),L.select(),L.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(L)}function N($){X.id===$&&We();const T={...g.value[$],id:En()};We(T),re.saves.push(T.id)}function w($){re.saves=re.saves.filter(T=>T!==$),localStorage.removeItem($),f[$]=void 0}function _($){g.value[X.id].time=X.time,We(),f[X.id]=void 0,Ut(g.value[$]),f[$]=void 0}function E($){if(u.value=$,Nt(()=>{u.value=null}),$[0]!=="{")if($[0]==="e")$=decodeURIComponent(escape(atob($)));else if($[0]==="\u1BE1")$=Pt.decompressFromUTF16($);else{console.warn("Unable to determine preset encoding",$);return}const T=JSON.parse($);T.id=En(),We(T),re.saves.push(T.id),_(T.id)}function R($,T){const L=g.value[$];L!=null&&(L.name=T,X.id===$?(X.name=T,We()):(We(L),f[$]=void 0))}return($,T)=>(S(),te(kt,{modelValue:n.value,"onUpdate:modelValue":T[4]||(T[4]=L=>n.value=L),ref_key:"modal",ref:i},{header:Z(()=>[lo]),body:Z(({shown:L})=>[L?(S(),te(s(mr),{key:0,list:s(re).saves,handle:".handle",itemKey:A=>A},{item:Z(({element:A})=>[p(oo,{save:s(g)[A],onOpen:B=>_(A),onExport:B=>y(A),onEditName:B=>R(A,B),onDuplicate:B=>N(A),onDelete:B=>w(A)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):U("",!0)]),footer:Z(()=>[C("div",uo,[p(Hi,{modelValue:a.value,"onUpdate:modelValue":T[0]||(T[0]=L=>a.value=L),title:"Import Save",placeholder:"Paste your save here!",class:pe({importingFailed:r.value})},null,8,["modelValue","class"]),C("div",co,[fo,C("div",go,[C("button",{class:"button",onClick:T[1]||(T[1]=L=>_(s(rn)().id))},"New Game"),Object.keys(s(c)).length>0?(S(),te(ui,{key:0,options:s(c),modelValue:u.value,"onUpdate:modelValue":T[2]||(T[2]=L=>E(L)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):U("",!0)])]),C("div",po,[mo,C("button",{class:"button modal-default-button",onClick:T[3]||(T[3]=L=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Zi=fe(vo,[["__scopeId","data-v-2a4275be"]]);const Ke=e=>(Jt("data-v-318a1c31"),e=e(),Kt(),e),ho=["src","alt"],bo={key:1,class:"title"},yo=Ke(()=>C("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),wo={class:"discord"},_o={class:"discord-links"},No={key:0},Co=["href"],ko=Ke(()=>C("li",null,[C("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Mo=Ke(()=>C("li",null,[C("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),So={href:"https://forums.moddingtree.com/",target:"_blank"},Io=Ke(()=>C("span",{class:"material-icons"},"forum",-1)),xo=Ke(()=>C("span",{class:"material-icons"},"info",-1)),$o=Ke(()=>C("span",{class:"material-icons"},"library_books",-1)),Eo=Ke(()=>C("span",{class:"material-icons"},"settings",-1)),To=Ke(()=>C("span",{class:"material-icons"},"library_books",-1)),Do=Ke(()=>C("span",{class:"material-icons"},"settings",-1)),Po=Ke(()=>C("span",{class:"material-icons"},"info",-1)),Fo={href:"https://forums.moddingtree.com/",target:"_blank"},Oo=Ke(()=>C("span",{class:"material-icons"},"forum",-1)),Ao={class:"discord"},qo={class:"discord-links"},Vo={key:0},Ro=["href"],Lo=Ke(()=>C("li",null,[C("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Bo=Ke(()=>C("li",null,[C("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),jo=Q({__name:"Nav",setup(e){const t=z(null),n=z(null),i=z(null),r=z(null),{useHeader:a,banner:u,title:l,discordName:c,discordLink:f,versionNumber:v}=de;function g(){window.open(f,"mywindow")}return(y,N)=>(S(),D(se,null,[s(a)?(S(),D("div",Ct({key:0,class:"nav"},y.$attrs),[s(u)?(S(),D("img",{key:0,src:s(u),class:"banner",alt:s(l)},null,8,ho)):(S(),D("div",bo,ie(s(l)),1)),C("div",{onClick:N[0]||(N[0]=w=>{var _;return(_=r.value)==null?void 0:_.open()}),class:"version-container"},[p(Ne,{display:"Changelog",direction:s(J).Down,class:"version"},{default:Z(()=>[C("span",null,"v"+ie(s(v)),1)]),_:1},8,["direction"])]),yo,C("div",wo,[C("span",{onClick:g,class:"material-icons"},"discord"),C("ul",_o,[s(f)?(S(),D("li",No,[C("a",{href:s(f),target:"_blank"},ie(s(c)),9,Co)])):U("",!0),ko,Mo])]),C("div",null,[C("a",So,[p(Ne,{display:"Forums",direction:s(J).Down,yoffset:"5px"},{default:Z(()=>[Io]),_:1},8,["direction"])])]),C("div",{onClick:N[1]||(N[1]=w=>{var _;return(_=t.value)==null?void 0:_.open()})},[p(Ne,{display:"Info",direction:s(J).Down,class:"info"},{default:Z(()=>[xo]),_:1},8,["direction"])]),C("div",{onClick:N[2]||(N[2]=w=>{var _;return(_=n.value)==null?void 0:_.open()})},[p(Ne,{display:"Saves",direction:s(J).Down,xoffset:"-20px"},{default:Z(()=>[$o]),_:1},8,["direction"])]),C("div",{onClick:N[3]||(N[3]=w=>{var _;return(_=i.value)==null?void 0:_.open()})},[p(Ne,{display:"Settings",direction:s(J).Down,xoffset:"-66px"},{default:Z(()=>[Eo]),_:1},8,["direction"])])],16)):(S(),D("div",Ct({key:1,class:"overlay-nav"},y.$attrs),[C("div",{onClick:N[4]||(N[4]=w=>{var _;return(_=r.value)==null?void 0:_.open()}),class:"version-container"},[p(Ne,{display:"Changelog",direction:s(J).Right,xoffset:"25%",class:"version"},{default:Z(()=>[C("span",null,"v"+ie(s(v)),1)]),_:1},8,["direction"])]),C("div",{onClick:N[5]||(N[5]=w=>{var _;return(_=n.value)==null?void 0:_.open()})},[p(Ne,{display:"Saves",direction:s(J).Right},{default:Z(()=>[To]),_:1},8,["direction"])]),C("div",{onClick:N[6]||(N[6]=w=>{var _;return(_=i.value)==null?void 0:_.open()})},[p(Ne,{display:"Settings",direction:s(J).Right},{default:Z(()=>[Do]),_:1},8,["direction"])]),C("div",{onClick:N[7]||(N[7]=w=>{var _;return(_=t.value)==null?void 0:_.open()})},[p(Ne,{display:"Info",direction:s(J).Right},{default:Z(()=>[Po]),_:1},8,["direction"])]),C("div",null,[C("a",Fo,[p(Ne,{display:"Forums",direction:s(J).Right,xoffset:"7px"},{default:Z(()=>[Oo]),_:1},8,["direction"])])]),C("div",Ao,[C("span",{onClick:g,class:"material-icons"},"discord"),C("ul",qo,[s(f)?(S(),D("li",Vo,[C("a",{href:s(f),target:"_blank"},ie(s(c)),9,Ro)])):U("",!0),Lo,Bo])])],16)),p(ws,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),p(Zi,{ref_key:"savesManager",ref:n},null,512),p(Ds,{ref_key:"options",ref:i},null,512),p(ts,{ref_key:"changelog",ref:r},null,512)],64))}});var Yi=fe(jo,[["__scopeId","data-v-318a1c31"]]);const zo={class:"inner-tab"},Uo=Q({__name:"Game",setup(e){const t=qt(X,"tabs"),n=I(()=>Object.keys(we)),i=de.useHeader;function r(a){const{display:u,minimized:l,name:c,color:f,minimizable:v,nodes:g,minimizedDisplay:y}=a;return{display:u,minimized:l,name:c,color:f,minimizable:v,nodes:g,minimizedDisplay:y}}return(a,u)=>(S(),D("div",{class:pe(["tabs-container",{useHeader:s(i)}])},[(S(!0),D(se,null,on(s(t),(l,c)=>{var f,v;return S(),D("div",{key:c,class:pe(["tab",s((f=s(we)[l])==null?void 0:f.classes)]),style:qe(s((v=s(we)[l])==null?void 0:v.style))},[c===0&&!s(i)?(S(),te(Yi,{key:0})):U("",!0),C("div",zo,[s(n).includes(l)?(S(),te(Ka,Ct({key:0},r(s(we)[l]),{index:c,onSetMinimized:g=>s(we)[l].minimized.value=g}),null,16,["index","onSetMinimized"])):(S(),te(Oe(l),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var Go=fe(Uo,[["__scopeId","data-v-dcd207b4"]]);const Wo=Q({__name:"Sticky",setup(e){const t=z("0"),n=new ResizeObserver(r),i=Ye(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 Nt(r),document.fonts.ready.then(r),Rn(()=>{var u;const a=(u=i.value)==null?void 0:u.parentElement;a&&n.observe(a)}),(a,u)=>(S(),D("div",{class:"sticky",style:qe({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[_t(a.$slots,"default",{},void 0,!0)],4))}});var qn=fe(Wo,[["__scopeId","data-v-cccac690"]]);const Ho=["x1","y1","x2","y2"],Zo=Q({__name:"BoardLink",props:{link:null},setup(e){const n=ke(e),i=I(()=>{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=I(()=>{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)=>(S(),D("line",Ct({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,Ho))}});var Yo=fe(Zo,[["__scopeId","data-v-57c4970a"]]);const Jo={key:0},Ko=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],Xo=["fill","stroke-width","stroke"],Qo=["fill"],el=Q({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const i=ke(e),r=I(()=>ce(i.nodeType.value.size,s(i.node))),a=I(()=>{var v;return(v=ce(i.nodeType.value.outlineColor,s(i.node)))!=null?v:dt[re.theme].variables["--outline"]}),u=I(()=>{var v;return(v=ce(i.nodeType.value.titleColor,s(i.node)))!=null?v:dt[re.theme].variables["--foreground"]}),l=I(()=>ce(i.nodeType.value.actionDistance,s(i.node)));function c(v,g){t("clickAction",g.id),v.preventDefault(),v.stopPropagation()}function f(v,g){var y;((y=s(i.selectedAction))==null?void 0:y.id)===g.id&&(v.preventDefault(),v.stopPropagation())}return(v,g)=>(S(),te(sn,{name:"actions",appear:""},{default:Z(()=>[e.isSelected&&e.actions?(S(),D("g",Jo,[(S(!0),D(se,null,on(e.actions,(y,N)=>{var w,_;return S(),D("g",{key:y.id,class:pe(["action",{selected:((w=e.selectedAction)==null?void 0:w.id)===y.id}]),transform:`translate( ${(-s(r)-30)*Math.sin(((e.actions.length-1)/2-N)*s(l))}, ${(s(r)+30)*Math.cos(((e.actions.length-1)/2-N)*s(l))} - )`,onMousedown:E=>c(E,y),onTouchstart:E=>c(E,y),onMouseup:E=>f(E,y),onTouchend:an(E=>f(E,y),["stop"])},[C("circle",{fill:s(ce)(y.fillColor,e.node),r:"20","stroke-width":((_=e.selectedAction)==null?void 0:_.id)===y.id?4:0,stroke:s(a)},null,8,Xo),C("text",{fill:s(u),class:"material-icons"},ie(s(ce)(y.icon,e.node)),9,Qo)],42,Ko)}),128))])):U("",!0)]),_:1}))}});var tl=fe(el,[["__scopeId","data-v-9efb2a56"]]);const nl=["transform"],il={key:0},rl=["r","fill","stroke"],al=["r","fill","stroke"],sl=["r","fill"],ol=["r","stroke-dasharray","stroke-dashoffset","stroke"],ll={key:1,transform:"rotate(45, 0, 0)"},ul=["width","height","transform","fill","stroke"],cl=["width","height","transform","fill","stroke"],dl=["width","height","transform","fill"],fl=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],gl=["fill","y"],pl=["fill"],ml={key:0},vl=["fill","y"],hl=["fill","y"],bl=Q({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},selectedNode:null,selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,i=Math.sqrt(2),r=Ce(n),a=I(()=>s(r.selectedNode)===s(r.node)),u=I(()=>ce(r.nodeType.value.draggable,s(r.node)));st(u,V=>{const ge=s(r.node);s(r.dragging)===ge&&!V&&t("endDragging",ge)});const l=I(()=>{var ge;const V=s(r.node);return(ge=ce(r.nodeType.value.actions,V))==null?void 0:ge.filter(Pe=>ot(ce(Pe.visibility,V)))}),c=I(()=>{var ge;const V=s(r.node);if(ce(r.nodeType.value.draggable,V)&&((ge=s(r.dragging))==null?void 0:ge.id)===V.id&&s(r.dragged)!=null){const{x:Pe,y:Be}=s(r.dragged);return{x:V.position.x+Math.round(Pe/25)*25,y:V.position.y+Math.round(Be/25)*25}}return V.position}),f=I(()=>ce(r.nodeType.value.shape,s(r.node))),v=I(()=>ce(r.nodeType.value.title,s(r.node))),g=I(()=>ce(r.nodeType.value.subtitle,s(r.node))),y=I(()=>{var V;return(V=a.value?s(r.selectedAction)&&ce(s(r.selectedAction).tooltip,s(r.node)):null)!=null?V:ce(r.nodeType.value.label,s(r.node))}),N=I(()=>{var V,ge;return ce((ge=(V=s(r.selectedAction))==null?void 0:V.confirmationLabel)!=null?ge:{text:"Tap again to confirm"},s(r.node))}),w=I(()=>ce(r.nodeType.value.size,s(r.node))),_=I(()=>{var V;return(V=ce(r.nodeType.value.progress,s(r.node)))!=null?V:0}),E=I(()=>dt[re.theme].variables["--background"]),R=I(()=>{var V;return(V=ce(r.nodeType.value.outlineColor,s(r.node)))!=null?V:dt[re.theme].variables["--outline"]}),x=I(()=>{var V;return(V=ce(r.nodeType.value.fillColor,s(r.node)))!=null?V:dt[re.theme].variables["--raised-background"]}),T=I(()=>ce(r.nodeType.value.progressColor,s(r.node))),L=I(()=>{var V;return(V=ce(r.nodeType.value.titleColor,s(r.node)))!=null?V:dt[re.theme].variables["--foreground"]}),A=I(()=>ce(r.nodeType.value.progressDisplay,s(r.node))),B=I(()=>r.dragging.value!=null&&s(r.hasDragged)&&ce(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),K=I(()=>ce(r.nodeType.value.style,s(r.node))),le=I(()=>ce(r.nodeType.value.classes,s(r.node)));function Se(V){t("mouseDown",V,r.node.value,u.value)}function Te(V){var ge,Pe,Be;(ge=r.hasDragged)!=null&&ge.value||(t("endDragging",r.node.value),(Be=(Pe=r.nodeType.value).onClick)==null||Be.call(Pe,r.node.value),V.stopPropagation())}return(V,ge)=>{var Pe,Be,lt;return S(),D("g",{class:pe(["boardnode",{[e.node.type]:!0,isSelected:s(a),isDraggable:s(u),...s(le)}]),style:qe([{opacity:((Pe=e.dragging)==null?void 0:Pe.id)===e.node.id&&e.hasDragged?.5:1},(Be=s(K))!=null?Be:[]]),transform:`translate(${s(c).x},${s(c).y})${s(a)?" scale(1.2)":""}`},[p(tl,{actions:(lt=s(l))!=null?lt:[],"is-selected":s(a),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:ge[0]||(ge[0]=Xe=>t("clickAction",Xe))},null,8,["actions","is-selected","node","node-type","selected-action"]),C("g",{class:"node-container",onMousedown:Se,onTouchstartPassive:Se,onMouseup:Te,onTouchendPassive:Te},[s(f)===s(Ae).Circle?(S(),D("g",il,[s(B)?(S(),D("circle",{key:0,class:"receiver",r:s(w)+8,fill:s(E),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,rl)):U("",!0),C("circle",{class:"body",r:s(w),fill:s(x),stroke:s(R),"stroke-width":4},null,8,al),s(A)===s(Gt).Fill?(S(),D("circle",{key:1,class:"progress progressFill",r:Math.max(s(w)*s(_)-2,0),fill:s(T)},null,8,sl)):(S(),D("circle",{key:2,r:s(w)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(s(w)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(s(w)+4.5)*2*Math.PI-s(_)*(s(w)+4.5)*2*Math.PI,stroke:s(T)},null,8,ol))])):s(f)===s(Ae).Diamond?(S(),D("g",ll,[s(B)?(S(),D("rect",{key:0,class:"receiver",width:s(w)*s(i)+16,height:s(w)*s(i)+16,transform:`translate(${-(s(w)*s(i)+16)/2}, ${-(s(w)*s(i)+16)/2})`,fill:s(E),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,ul)):U("",!0),C("rect",{class:"body",width:s(w)*s(i),height:s(w)*s(i),transform:`translate(${-s(w)*s(i)/2}, ${-s(w)*s(i)/2})`,fill:s(x),stroke:s(R),"stroke-width":4},null,8,cl),s(A)===s(Gt).Fill?(S(),D("rect",{key:1,class:"progress progressFill",width:Math.max(s(w)*s(i)*s(_)-2,0),height:Math.max(s(w)*s(i)*s(_)-2,0),transform:`translate(${-Math.max(s(w)*s(i)*s(_)-2,0)/2}, ${-Math.max(s(w)*s(i)*s(_)-2,0)/2})`,fill:s(T)},null,8,dl)):(S(),D("rect",{key:2,class:"progress progressDiamond",width:s(w)*s(i)+9,height:s(w)*s(i)+9,transform:`translate(${-(s(w)*s(i)+9)/2}, ${-(s(w)*s(i)+9)/2})`,fill:"transparent","stroke-dasharray":(s(w)*s(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(s(w)*s(i)+9)*4-s(_)*(s(w)*s(i)+9)*4,stroke:s(T)},null,8,fl))])):U("",!0),C("text",{fill:s(L),class:"node-title",y:s(g)?10:0},ie(s(v)),9,gl),s(g)?(S(),D("text",{key:2,fill:s(L),class:"node-subtitle",y:"-15"},ie(s(g)),9,pl)):U("",!0)],32),p(sn,{name:"fade",appear:""},{default:H(()=>{var Xe;return[s(y)?(S(),D("g",ml,[C("text",{fill:(Xe=s(y).color)!=null?Xe:s(L),class:pe(["node-title",{pulsing:s(y).pulsing}]),y:-s(w)-20},ie(s(y).text),11,vl)])):U("",!0)]}),_:1}),p(sn,{name:"fade",appear:""},{default:H(()=>{var Xe;return[s(a)&&e.selectedAction?(S(),D("text",{key:0,fill:(Xe=s(N).color)!=null?Xe:s(L),class:pe(["node-title",{pulsing:s(N).pulsing}]),y:s(w)+75},ie(s(N).text),11,hl)):U("",!0)]}),_:1})],14,nl)}}});var yl=fe(bl,[["__scopeId","data-v-4654be02"]]);const wl={class:"stage",width:"100%",height:"100%"},_l={class:"g1"},Nl=Q({__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=Ce(e),i=z({x:0,y:0}),r=z({x:0,y:0}),a=z(!1),u=z(null),l=I(()=>{const N=n.nodes.value.slice();if(n.draggingNode.value){const w=N.splice(N.indexOf(n.draggingNode.value),1)[0];N.push(w)}return N});nt(()=>{const N=n.draggingNode.value;if(N==null)return null;const w={x:N.position.x+r.value.x,y:N.position.y+r.value.y};let _=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((E,R)=>{if(R.id===N.id)return E;const x=n.types.value[R.type];if(!ce(x.canAccept,R,N))return E;const L=Math.pow(w.x-R.position.x,2)+Math.pow(w.y-R.position.y,2);let A=ce(x.size,R);return L>_||L>A*A?E:(_=L,R)},null))});function c(N){N.setTransformOrigin(null),N.moveTo(u.value.$el.clientWidth/2,u.value.$el.clientHeight/2)}function f(N,w=null,_=!1){if(n.draggingNode.value==null){N.preventDefault(),N.stopPropagation();let E,R;if("touches"in N)if(N.touches.length===1)E=N.touches[0].clientX,R=N.touches[0].clientY;else return;else E=N.clientX,R=N.clientY;i.value={x:E,y:R},r.value={x:0,y:0},a.value=!1,_&&n.setDraggingNode.value(w)}w!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function v(N){const{x:w,y:_,scale:E}=u.value.panZoomInstance.getTransform();let R,x;if("touches"in N)if(N.touches.length===1)R=N.touches[0].clientX,x=N.touches[0].clientY;else{g(n.draggingNode.value),n.mousePosition.value=null;return}else R=N.clientX,x=N.clientY;n.mousePosition.value={x:(R-w)/E,y:(x-_)/E},r.value={x:r.value.x+(R-i.value.x)/E,y:r.value.y+(x-i.value.y)/E},i.value={x:R,y:x},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(a.value=!0),n.draggingNode.value!=null&&(N.preventDefault(),N.stopPropagation())}function g(N,w=!1){var _,E;if(n.draggingNode.value!=null&&n.draggingNode.value===N){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 R=n.nodes.value;R.push(R.splice(R.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((E=(_=n.types.value[n.receivingNode.value.type]).onDrop)==null||E.call(_,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!a.value&&!w&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function y(N,w){n.state.value.selectedAction===w?s(n.selectedAction).onClick(s(n.selectedNode)):n.state.value={...n.state.value,selectedAction:w}}return(N,w)=>{const _=bt("panZoom");return s(ot)(e.visibility)?(S(),te(_,{key:0,style:qe([{width:e.width,height:e.height},e.style]),class:pe(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:w[0]||(w[0]=E=>f(E)),onTouchstart:w[1]||(w[1]=E=>f(E)),onMouseup:w[2]||(w[2]=()=>g(s(e.draggingNode))),onTouchendPassive:w[3]||(w[3]=()=>g(s(e.draggingNode))),onMouseleave:w[4]||(w[4]=()=>g(s(e.draggingNode),!0))},{default:H(()=>[(S(),D("svg",wl,[C("g",_l,[p(fi,{name:"link",appear:""},{default:H(()=>[(S(!0),D(se,null,on(s(e.links)||[],E=>(S(),D("g",{key:`${E.startNode.id}-${E.endNode.id}`},[p(Yo,{link:E},null,8,["link"])]))),128))]),_:1}),p(fi,{name:"grow",duration:500,appear:""},{default:H(()=>[(S(!0),D(se,null,on(s(l),E=>{var R;return S(),D("g",{key:E.id,style:{"transition-duration":"0s"}},[p(yl,{node:E,nodeType:e.types[E.type],dragging:s(e.draggingNode),dragged:s(e.draggingNode)===E?r.value:void 0,hasDragged:a.value,receivingNode:((R=s(e.receivingNode))==null?void 0:R.id)===E.id,selectedNode:s(e.selectedNode),selectedAction:s(e.selectedAction),onMouseDown:f,onEndDragging:g,onClickAction:x=>y(E,x)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","selectedNode","selectedAction","onClickAction"])])}),128))]),_:1})])]))]),_:1},8,["style","class","options"])):U("",!0)}}});Ve.on("setupVue",e=>hr.install(e));const Ji=Symbol("Board");var Gt=(e=>(e.Outline="Outline",e.Fill="Fill",e))(Gt||{}),Ae=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(Ae||{});function Cl(e){const t=at({nodes:[],selectedNode:null,selectedAction:null},!1);return Je(n=>{const i=e.call(n,n);i.id=Nn("board-"),i.type=Ji,i[ft]=Nl,i.state?(zi(t),F(i,"state")):(t[ln]={nodes:i.startNodes().map((l,c)=>(l.id=c,l)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=I(()=>s(u.state).nodes),i.selectedNode=I({get(){return u.nodes.value.find(l=>l.id===s(u.state).selectedNode)||null},set(l){var c,f;Me(u.state)?u.state.value={...u.state.value,selectedNode:(c=l==null?void 0:l.id)!=null?c:null}:u.state.selectedNode=(f=l==null?void 0:l.id)!=null?f:null}}),i.selectedAction=I({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(f=>f.id===s(u.state).selectedAction)||null},set(l){var c,f;Me(u.state)?u.state.value={...u.state.value,selectedAction:(c=l==null?void 0:l.id)!=null?c:null}:u.state.selectedAction=(f=l==null?void 0:l.id)!=null?f:null}}),i.mousePosition=z(null),i.links?F(i,"links"):i.links=I(()=>u.selectedAction.value==null?null:u.selectedAction.value.links&&u.selectedNode.value?ce(u.selectedAction.value.links,u.selectedNode.value):null),i.draggingNode=z(null),i.receivingNode=z(null),F(i,"visibility"),oe(i,"visibility",_e.Visible),F(i,"width"),oe(i,"width","100%"),F(i,"height"),oe(i,"height","100%"),F(i,"classes"),F(i,"style");for(const l in i.types){const c=i.types[l];if(F(c,"title"),F(c,"subtitle"),F(c,"label"),F(c,"size"),oe(c,"size",50),F(c,"style"),F(c,"classes"),F(c,"draggable"),oe(c,"draggable",!1),F(c,"shape"),oe(c,"shape","Circle"),F(c,"canAccept"),oe(c,"canAccept",!1),F(c,"progress"),F(c,"progressDisplay"),oe(c,"progressDisplay","Fill"),F(c,"progressColor"),oe(c,"progressColor","none"),F(c,"fillColor"),F(c,"outlineColor"),F(c,"titleColor"),F(c,"actionDistance"),oe(c,"actionDistance",Math.PI/6),c.nodes=I(()=>s(u.state).nodes.filter(f=>f.type===l)),oe(c,"onClick",function(f){s(u.state).selectedNode=f.id}),c.actions)for(const f of c.actions)F(f,"visibility"),oe(f,"visibility",_e.Visible),F(f,"icon"),F(f,"fillColor"),F(f,"tooltip"),F(f,"confirmationLabel"),oe(f,"confirmationLabel",{text:"Tap again to confirm"}),F(f,"links")}function r(l){i.draggingNode.value=l}function a(l){i.receivingNode.value=l}i.placeInAvailableSpace=function(l,c=100,f=J.Right){const v=u.nodes.value.slice().filter(g=>g===l||(f===J.Down||f===J.Up)&&Math.abs(g.position.x-l.position.x)>c||(f===J.Left||f===J.Right)&&Math.abs(g.position.y-l.position.y)>c?!1:!(f===J.Right&&g.position.xl.position.x+c||f===J.Up&&g.position.y>l.position.y+c||f===J.Down&&g.position.yg.position.x-y.position.x:f===J.Left?(g,y)=>y.position.x-g.position.x:f===J.Up?(g,y)=>y.position.y-g.position.y:(g,y)=>g.position.y-y.position.y);for(let g=0;g0&&N>c)break}},i[it]=function(){const{nodes:l,types:c,state:f,visibility:v,width:g,height:y,style:N,classes:w,links:_,selectedAction:E,selectedNode:R,mousePosition:x,draggingNode:T,receivingNode:L}=this;return{nodes:l,types:c,state:f,visibility:v,width:g,height:y,style:s(N),classes:w,links:_,selectedAction:E,selectedNode:R,mousePosition:x,draggingNode:T,receivingNode:L,setDraggingNode:r,setReceivingNode:a}};const u=i;return u})}function ce(e,t,...n){return Fn(e)?e(t,...n):s(e)}function Tn(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const mn={};Ve.on("addLayer",e=>{const t=ya(e,Ji);mn[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)}))})})});Ve.on("removeLayer",e=>{var t;(t=mn[e.id])==null||t.call(mn),mn[e.id]=void 0});function Ki(e,t="points",n=0,i=void 0){const r=Me(e)?e:at(e);if(r.displayName=t,r.precision=n,r.small=i,!Me(e)){const a=r[vt];a.displayName=t,a.precision=n,a.small=i}return r}new o("10^^8");new o("1e100");function wi(e,t){const n=t!=null?t:e.value;return o.eq(e.precision,0)?Ge(e.small?n:o.floor(n)):Ht(n,e.precision,e.small)}Ve.on("setupVue",e=>e.use(br));function kl(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 Ml=Q({props:{visibility:{type:j(Number,Boolean),required:!0},display:{type:j(Object,String,Function),required:!0},style:j(String,Object,Array),classes:j(Object),glowColor:j(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=Ce(e),a=Bi(n),u=I(()=>{const c=xe(i);return c==null||c===""?{}:s(r)?kl(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function l(){t("selectTab")}return{selectTab:l,component:a,glowColorStyle:u,unref:s,Visibility:_e,isVisible:ot,isHidden:un}}});function Sl(e,t,n,i,r,a){var u;return e.isVisible(e.visibility)?(S(),D("button",{key:0,onClick:t[0]||(t[0]=(...l)=>e.selectTab&&e.selectTab(...l)),class:pe(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:qe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(u=e.unref(e.style))!=null?u:{}])},[(S(),te(Oe(e.component)))],6)):U("",!0)}var Xi=fe(Ml,[["render",Sl],["__scopeId","data-v-21427abb"]]);const Il=Q({props:{visibility:{type:j(Number,Boolean),required:!0},activeTab:{type:j(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:j(Object),required:!0},style:j(String,Object,Array),classes:j(Object),buttonContainerStyle:j(String,Object,Array),buttonContainerClasses:j(Object)},components:{Sticky:qn,TabButton:Xi},setup(e){const{activeTab:t}=Ce(e),n=I(()=>dt[re.theme].floatingTabs),i=Ye("");nt(()=>{const l=xe(t);if(l==null){i.value="";return}if(gt(l)){i.value=ae(l);return}i.value=ae(s(l.display))});const r=I(()=>{const l=xe(t);return gt(l)||!l?void 0:s(l.classes)}),a=I(()=>{const l=xe(t);return gt(l)||!l?void 0:s(l.style)});function u(l){const{display:c,style:f,classes:v,glowColor:g,visibility:y}=l;return{display:c,style:s(f),classes:v,glowColor:g,visibility:y}}return{floating:n,tabClasses:r,tabStyle:a,Visibility:_e,component:i,gatherButtonProps:u,unref:s,isVisible:ot,isHidden:un}}});function $l(e,t,n,i,r,a){var c,f;const u=bt("TabButton"),l=bt("Sticky");return e.isVisible(e.visibility)?(S(),D("div",{key:0,class:pe(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:qe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(f=e.tabStyle)!=null?f:[]])},[p(l,{class:pe(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:qe(e.unref(e.buttonContainerStyle))},{default:H(()=>[C("div",{class:pe(["tab-buttons",{floating:e.floating}])},[(S(!0),D(se,null,on(e.unref(e.tabs),(v,g)=>(S(),te(u,Ct({onSelectTab:y=>e.selected.value=g,floating:e.floating,key:g,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)?(S(),te(Oe(e.unref(e.component)),{key:0})):U("",!0)],6)):U("",!0)}var xl=fe(Il,[["render",$l],["__scopeId","data-v-58dbf83a"]]);const El=Symbol("TabButton"),Tl=Symbol("TabFamily");function Dl(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=at(Object.keys(e)[0],!1);return Je(i=>{var u;const r=(u=t==null?void 0:t.call(i,i))!=null?u:{};r.id=Nn("tabFamily-"),r.type=Tl,r[ft]=xl,r.tabs=Object.keys(e).reduce((l,c)=>{const f=e[c]();return f.type=El,f[ft]=Xi,F(f,"visibility"),oe(f,"visibility",_e.Visible),F(f,"tab"),F(f,"display"),F(f,"classes"),F(f,"style"),F(f,"glowColor"),l[c]=f,l},{}),r.selected=n,r.activeTab=I(()=>{const l=s(a.tabs);if(n.value in l&&ot(l[n.value].visibility))return s(l[n.value].tab);const c=Object.values(l).find(f=>ot(f.visibility));return c?s(c.tab):null}),F(r,"visibility"),oe(r,"visibility",_e.Visible),F(r,"classes"),F(r,"style"),F(r,"buttonContainerClasses"),F(r,"buttonContainerStyle"),r[it]=function(){const{visibility:l,activeTab:c,selected:f,tabs:v,style:g,classes:y,buttonContainerClasses:N,buttonContainerStyle:w}=this;return{visibility:l,activeTab:c,selected:f,tabs:v,style:s(g),classes:y,buttonContainerClasses:N,buttonContainerStyle:w}};const a=r;return a})}const Qi=o.ln(10);function vn(e){return e}function Pl(e,t){if(P(t))return t.invert(o.neg(e));throw new Error("Could not invert due to no input being a variable")}function Fl(e,t){if(P(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 Ol(e){return m.neg(e)}function Al(e,t,n){if(P(t))return t.invert(o.sub(e,be(n)));if(P(n))return n.invert(o.sub(e,be(t)));throw new Error("Could not invert due to no input being a variable")}function ql(e,t,n){var i,r;if(P(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(P(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 Vl(e,t,n){if(P(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(P(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 Rl(e,t,n){if(P(t))return t.invert(o.add(e,be(n)));if(P(n))return n.invert(o.sub(be(t),e));throw new Error("Could not invert due to no input being a variable")}function Ll(e,t,n){var i,r;if(P(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(P(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 Bl(e,t,n){if(P(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(P(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 jl(e,t,n){if(P(t))return t.invert(o.div(e,be(n)));if(P(n))return n.invert(o.div(e,be(t)));throw new Error("Could not invert due to no input being a variable")}function zl(e,t,n){if(P(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(P(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 Ul(e,t,n){if(P(t))return m.div(e,n);if(P(n))return m.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Gl(e,t,n){if(P(t))return t.invert(o.mul(e,be(n)));if(P(n))return n.invert(o.div(be(t),e));throw new Error("Could not invert due to no input being a variable")}function Wl(e,t,n){if(P(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(P(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 Hl(e,t,n){if(P(t))return m.mul(e,n);if(P(n))return m.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Zl(e,t){if(P(t))return t.invert(o.recip(e));throw new Error("Could not invert due to no input being a variable")}function Yl(e,t){if(P(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 Jl(e,t){if(P(t))return t.invert(o.pow10(e));throw new Error("Could not invert due to no input being a variable")}function Kl(e){return o.ln(e).sub(1).times(e).div(Qi)}function Xl(e,t){if(P(t)){const n=Qi.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 Ql(e,t){if(P(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:Kl,invert:Xl})}throw new Error("Could not integrate due to no input being a variable")}function eu(e,t,n){if(P(t))return t.invert(o.pow(be(n),e));if(P(n))return n.invert(o.root(be(t),e));throw new Error("Could not invert due to no input being a variable")}function tu(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function nu(e,t,n){if(P(t)){const i=o.ln(be(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 iu(e,t,n){if(P(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:tu,invert:nu})}throw new Error("Could not integrate due to no input being a variable")}function ru(e,t){if(P(t))return t.invert(o.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function au(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function su(e,t){if(P(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 ou(e,t){if(P(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:au,invert:su})}throw new Error("Could not integrate due to no input being a variable")}function lu(e,t){if(P(t))return t.invert(o.exp(e));throw new Error("Could not invert due to no input being a variable")}function uu(e){return o.ln(e).sub(1).times(e)}function cu(e,t){if(P(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 du(e,t){if(P(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:uu,invert:cu})}throw new Error("Could not integrate due to no input being a variable")}function fu(e,t,n){if(P(t))return t.invert(o.root(e,be(n)));if(P(n))return n.invert(o.ln(e).div(o.ln(be(t))));throw new Error("Could not invert due to no input being a variable")}function gu(e,t,n){if(P(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(P(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 pu(e,t){if(P(t))return t.invert(o.root(e,10));throw new Error("Could not invert due to no input being a variable")}function mu(e,t){if(P(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 vu(e,t,n){if(P(t))return t.invert(o.ln(e).div(be(n)));if(P(n))return n.invert(o.root(be(t),e));throw new Error("Could not invert due to no input being a variable")}function hu(e,t,n){if(P(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(P(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 bu(e,t,n){if(P(t))return t.invert(o.root(e,o.recip(be(n))));if(P(n))return n.invert(o.ln(be(t)).div(o.ln(e)));throw new Error("Could not invert due to no input being a variable")}function yu(e,t,n){if(P(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 wu(e,t){if(P(t))return t.invert(o.ln(e));throw new Error("Could not invert due to no input being a variable")}function _u(e,t){if(P(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 Nu(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.tetrate(e,i,n)}function Cu(e,t,n,i){if(P(t))return t.invert(o.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function ku(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 Mu(e,t,n,i){if(P(t))return t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,be(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Su(e,t=10,n=2){const i=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,i)}function Iu(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function $u(e,t,n){if(P(t))return t.invert(o.tetrate(e,o.minabs(1e308,be(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function xu(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.layeradd(e,i,n)}function Eu(e,t,n,i){if(P(t))return t.invert(o.layeradd(e,o.minabs(1e308,be(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function Tu(e,t){if(P(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 Du(e,t){if(P(t))return t.invert(o.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function Pu(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.pentate(e,i,n)}function Fu(e,t){if(P(t))return t.invert(o.asin(e));throw new Error("Could not invert due to no input being a variable")}function Ou(e,t){if(P(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 Au(e,t){if(P(t))return t.invert(o.acos(e));throw new Error("Could not invert due to no input being a variable")}function qu(e,t){if(P(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 Vu(e,t){if(P(t))return t.invert(o.atan(e));throw new Error("Could not invert due to no input being a variable")}function Ru(e,t){if(P(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 Lu(e,t){if(P(t))return t.invert(o.sin(e));throw new Error("Could not invert due to no input being a variable")}function Bu(e,t){if(P(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 ju(e,t){if(P(t))return t.invert(o.cos(e));throw new Error("Could not invert due to no input being a variable")}function zu(e,t){if(P(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 Uu(e,t){if(P(t))return t.invert(o.tan(e));throw new Error("Could not invert due to no input being a variable")}function Gu(e,t){if(P(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 Wu(e,t){if(P(t))return t.invert(o.asinh(e));throw new Error("Could not invert due to no input being a variable")}function Hu(e,t){if(P(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 Zu(e,t){if(P(t))return t.invert(o.acosh(e));throw new Error("Could not invert due to no input being a variable")}function Yu(e,t){if(P(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 Ju(e,t){if(P(t))return t.invert(o.atanh(e));throw new Error("Could not invert due to no input being a variable")}function Ku(e,t){if(P(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 Xu(e,t){if(P(t))return t.invert(o.sinh(e));throw new Error("Could not invert due to no input being a variable")}function Qu(e,t){if(P(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 ec(e,t){if(P(t))return t.invert(o.cosh(e));throw new Error("Could not invert due to no input being a variable")}function tc(e,t){if(P(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 nc(e,t){if(P(t))return t.invert(o.tanh(e));throw new Error("Could not invert due to no input being a variable")}function ic(e,t){if(P(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 cn(e){return(t,n)=>new m({inputs:[t,n],evaluate:e,invert:vn})}function P(e){return e instanceof ye&&e.hasVariable()}function be(e,t){return e instanceof ye?e.evaluate(t):s(e)}function rc(){return m.pow(this,2).div(2)}function ac(){return this}const Ne=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"&&vt in n?n[vt]:n)),"variable"in e?(typeof e.variable=="object"&&vt in e.variable&&(e.variable=e.variable[vt]),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:rc,internalIntegrateInner:ac,applySubstitution:vn}}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 y,N;const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:a,applySubstitution:u}=e,l=t.reduce((w,_)=>w+(_ instanceof Ne?_.internalVariables:0),0),c=t.find(w=>w instanceof Ne&&w.hasVariable()),f=l===1?c==null?void 0:c.innermostVariable:void 0,v=(y=c==null?void 0:c.isInvertible())!=null?y:!1,g=(N=c==null?void 0:c.isIntegrable())!=null?N:!1;return{inputs:t,internalEvaluate:n,internalInvert:v?i:void 0,internalIntegrate:g?r:void 0,internalIntegrateInner:a,applySubstitution:u,innermostVariable:f,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=>be(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:be(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof Ne&&e.inputs[n]instanceof Ne?t.equals(e.inputs[n]):!(t instanceof Ne)&&!(e.inputs[n]instanceof Ne)&&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=z(0),r=n(m.variable(i)),a=he(t);function u(c){return o.lt(c,s(a))?c:(i.value=o.sub(c,s(a)),o.add(r.evaluate(),s(a)))}function l(c,f){if(P(f)&&r.isInvertible())return o.gt(c,s(a))&&(c=o.add(r.invert(o.sub(c,s(a))),s(a))),f.invert(c);throw new Error("Could not invert due to no input being a variable")}return new m({inputs:[e],evaluate:u,invert:r.isInvertible()&&r.hasVariable()?l:void 0})}static if(e,t,n,i){const r=z(0),a=m.variable(r),u=n(a),l=i==null?void 0:i(a),c=he(t);function f(g){return s(c)?(r.value=g,u.evaluate()):l?(r.value=g,l.evaluate()):g}function v(g,y){if(!P(y)||!u.isInvertible()||l!=null&&!l.isInvertible())throw new Error("Could not invert due to no input being a variable");return s(c)?y.invert(u.invert(g)):l?y.invert(l.invert(g)):y.invert(g)}return new m({inputs:[e],evaluate:f,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:Pl,applySubstitution:Ol,integrate:Fl})}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:Al,integrate:ql,integrateInner:Vl,applySubstitution:vn})}static sub(e,t){return new m({inputs:[e,t],evaluate:o.sub,invert:Rl,integrate:Ll,integrateInner:Bl,applySubstitution:vn})}static mul(e,t){return new m({inputs:[e,t],evaluate:o.mul,invert:jl,integrate:zl,applySubstitution:Ul})}static div(e,t){return new m({inputs:[e,t],evaluate:o.div,invert:Gl,integrate:Wl,applySubstitution:Hl})}static recip(e){return new m({inputs:[e],evaluate:o.recip,invert:Zl,integrate:Yl})}static clamp(e,t,n){return new m({inputs:[e,t,n],evaluate:o.clamp,invert:vn})}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:Jl,integrate:Ql})}static log(e,t){return new m({inputs:[e,t],evaluate:o.log,invert:eu,integrate:iu})}static log2(e){return new m({inputs:[e],evaluate:o.log2,invert:ru,integrate:ou})}static ln(e){return new m({inputs:[e],evaluate:o.ln,invert:lu,integrate:du})}static pow(e,t){return new m({inputs:[e,t],evaluate:o.pow,invert:fu,integrate:gu})}static pow10(e){return new m({inputs:[e],evaluate:o.pow10,invert:pu,integrate:mu})}static pow_base(e,t){return new m({inputs:[e,t],evaluate:o.pow_base,invert:vu,integrate:hu})}static root(e,t){return new m({inputs:[e,t],evaluate:o.root,invert:bu,integrate:yu})}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:wu,integrate:_u})}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:Nu,invert:Cu})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:ku,invert:Mu})}static iteratedlog(e,t=10,n=1){return new m({inputs:[e,t,n],evaluate:Su})}static slog(e,t=10){return new m({inputs:[e,t],evaluate:Iu,invert:$u})}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:xu,invert:Eu})}static lambertw(e){return new m({inputs:[e],evaluate:o.lambertw,invert:Tu})}static ssqrt(e){return new m({inputs:[e],evaluate:o.ssqrt,invert:Du})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:Pu})}static sin(e){return new m({inputs:[e],evaluate:o.sin,invert:Lu,integrate:Ou})}static cos(e){return new m({inputs:[e],evaluate:o.cos,invert:ju,integrate:qu})}static tan(e){return new m({inputs:[e],evaluate:o.tan,invert:Uu,integrate:Ru})}static asin(e){return new m({inputs:[e],evaluate:o.asin,invert:Fu,integrate:Bu})}static acos(e){return new m({inputs:[e],evaluate:o.acos,invert:Au,integrate:zu})}static atan(e){return new m({inputs:[e],evaluate:o.atan,invert:Vu,integrate:Gu})}static sinh(e){return new m({inputs:[e],evaluate:o.sinh,invert:Xu,integrate:Hu})}static cosh(e){return new m({inputs:[e],evaluate:o.cosh,invert:ec,integrate:Yu})}static tanh(e){return new m({inputs:[e],evaluate:o.tanh,invert:nc,integrate:Ku})}static asinh(e){return new m({inputs:[e],evaluate:o.asinh,invert:Wu,integrate:Qu})}static acosh(e){return new m({inputs:[e],evaluate:o.acosh,invert:Zu,integrate:tc})}static atanh(e){return new m({inputs:[e],evaluate:o.atanh,invert:Ju,integrate:ic})}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 ye=Ne;ye.negate=Ne.neg;ye.negated=Ne.neg;ye.sgn=Ne.sign;ye.plus=Ne.add;ye.subtract=Ne.sub;ye.minus=Ne.sub;ye.multiply=Ne.mul;ye.times=Ne.mul;ye.divide=Ne.div;ye.divideBy=Ne.div;ye.dividedBy=Ne.div;ye.reciprocal=Ne.recip;ye.reciprocate=Ne.recip;ye.max=cn(o.max);ye.min=cn(o.min);ye.minabs=cn(o.minabs);ye.maxabs=cn(o.maxabs);ye.clampMin=cn(o.clampMin);ye.clampMax=cn(o.clampMax);ye.logarithm=Ne.log;class m extends ye{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 sc(e,t,n=!0,i){const r=he(n);return I(()=>{var u,l;let a;if(s(r)){if(!e.isIntegrable()||!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");a=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((u=s(e.innermostVariable))!=null?u:0),i==null&&(i=10)}else{if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula");a=o.floor(e.invert(t.value)),i==null&&(i=0)}if(i>0&&o.lt(Ot(e,a,!0,0),1e308)){a=a.sub(i).clampMin(0);let c=Ot(e,a,!0,0);for(;;){const f=e.evaluate(a.add((l=s(e.innermostVariable))!=null?l:0));if(o.add(c,f).lte(t.value))a=a.add(1),c=o.add(c,f);else break}}return a})}function Ot(e,t,n=!0,i){var a,u,l;let r=o.add(t,(a=s(e.innermostVariable))!=null?a:0);if(n){if(!e.isIntegrable())throw new Error("Cannot calculate cost with spending resources of non-integrable formula");const c=r;r=r.sub(i!=null?i:10).clampMin((u=s(e.innermostVariable))!=null?u:0);let f=o.sub(e.evaluateIntegral(r),e.evaluateIntegral());if(c.gt(1e308))return f.add(o.sub(c,r).times(e.evaluate(r)));for(let v=r.toNumber();v{const{addend:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),u=he(n),l=he(i),c=r==null?void 0:he(r);return{apply:f=>o.add(f,s(u)),invert:f=>o.sub(f,s(u)),getFormula:f=>m.add(f,u),enabled:c,description:i==null?void 0:ne(()=>p("div",{class:"modifier-container"},[s(l)!=null?p("span",{class:"modifier-description"},[rt(s(l))]):null,p("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)?"+":"",Pt(s(u))])]))}})}function mt(e){return Je(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),u=he(n),l=he(i),c=r==null?void 0:he(r);return{apply:f=>o.times(f,s(u)),invert:f=>o.div(f,s(u)),getFormula:f=>m.times(f,u),enabled:c,description:i==null?void 0:ne(()=>p("div",{class:"modifier-container"},[s(l)!=null?p("span",{class:"modifier-description"},[rt(s(l))]):null,p("span",{class:"modifier-amount",style:(a===!0?o.gt(s(u),1):o.lt(s(u),1))?"color: var(--danger)":""},[q("\xD7"),Pt(s(u))])]))}})}function oc(e){return Je(t=>{const{exponent:n,description:i,enabled:r,supportLowNumbers:a,smallerIsBetter:u}=e.call(t,t),l=he(n),c=he(i),f=r==null?void 0:he(r);return{apply:v=>{let g=v;return a&&(g=o.add(g,1)),g=o.pow(g,s(l)),a&&(g=o.sub(g,1)),g},invert:v=>{let g=v;return a&&(g=o.add(g,1)),g=o.root(g,s(l)),a&&(g=o.sub(g,1)),g},getFormula:v=>a?m.add(v,1).pow(l).sub(1):m.pow(v,l),enabled:f,description:i==null?void 0:ne(()=>p("div",{class:"modifier-container"},[s(c)!=null?p("span",{class:"modifier-description"},[rt(s(c)),a?" (+1 effective)":null]):null,p("span",{class:"modifier-amount",style:(u===!0?o.gt(s(l),1):o.lt(s(l),1))?"color: var(--danger)":""},[q("^"),Pt(s(l))])]))}})}function jt(e){return Je(()=>{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)?I(()=>t.filter(n=>s(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?ne(()=>p(se,null,[t.filter(n=>s(n.enabled)!==!1).map(n=>s(n.description)).filter(n=>n).map(rt)])):void 0}})}const lc={key:0},uc={key:0,class:"mark star"},cc=["src"],dc=Q({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(S(),D("div",lc,[e.mark===!0?(S(),D("div",uc)):(S(),D("img",{key:1,class:"mark",src:e.mark},null,8,cc))])):U("",!0)}});var jn=fe(dc,[["__scopeId","data-v-2207999f"]]);const fc=Q({__name:"Node",props:{id:null},setup(e){const n=Ce(e),i=Dn(ii,()=>{}),r=Dn(ri,()=>{}),a=Ye(null),u=I(()=>a.value&&a.value.parentElement);return st([u,n.id],([l,c],[f,v])=>{f&&r(s(v)),l&&i(c,l)}),xi(()=>r(s(n.id))),(l,c)=>(S(),D("div",{class:"node",ref_key:"node",ref:a},null,512))}});var zn=fe(fc,[["__scopeId","data-v-a48cb382"]]),gc=Q({props:{display:{type:j(Object,String,Function),required:!0},visibility:{type:j(Number,Boolean),required:!0},style:j(Object,String,Array),classes:j(Object),onClick:Function,onHold:Function,canClick:{type:j(Boolean),required:!0},small:Boolean,mark:j(Boolean,String),id:{type:String,required:!0}},components:{Node:zn,MarkNode:jn},setup(e){const{display:t,onClick:n,onHold:i}=Ce(e),r=Ye("");nt(()=>{var v;const l=xe(t);if(l==null){r.value="";return}if(gt(l)){r.value=ae(l);return}const c=ae((v=l.title)!=null?v:"","h3"),f=ae(l.description,"div");r.value=ae(ne(()=>p("span",null,[l.title!=null?p("div",null,[p(c,null,null)]):null,p(f,null,null)])))});const{start:a,stop:u}=Li(n,i);return{start:a,stop:u,comp:r,Visibility:_e,isVisible:ot,isHidden:un,unref:s}}});function pc(e,t,n,i,r,a){var c;const u=bt("MarkNode"),l=bt("Node");return e.isVisible(e.visibility)?(S(),D("button",{key:0,style:qe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...f)=>e.onClick&&e.onClick(...f)),onMousedown:t[1]||(t[1]=(...f)=>e.start&&e.start(...f)),onMouseleave:t[2]||(t[2]=(...f)=>e.stop&&e.stop(...f)),onMouseup:t[3]||(t[3]=(...f)=>e.stop&&e.stop(...f)),onTouchstartPassive:t[4]||(t[4]=(...f)=>e.start&&e.start(...f)),onTouchendPassive:t[5]||(t[5]=(...f)=>e.stop&&e.stop(...f)),onTouchcancelPassive:t[6]||(t[6]=(...f)=>e.stop&&e.stop(...f)),class:pe({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)?(S(),te(Oe(e.unref(e.comp)),{key:0})):U("",!0),p(u,{mark:e.unref(e.mark)},null,8,["mark"]),p(l,{id:e.id},null,8,["id"])],38)):U("",!0)}var mc=fe(gc,[["render",pc],["__scopeId","data-v-211328c0"]]);const vc=["x1","y1","x2","y2"],hc=Q({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=Ce(e),i=I(()=>{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=I(()=>{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)=>(S(),D("line",Ct({"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,vc))}});const bc=Q({__name:"Links",props:{links:null},setup(e){var c;const n=At(e,"links"),i=z(null),r=Dn(ai,z({})),a=Dn(si,z(void 0)),u=z((c=i.value)==null?void 0:c.getBoundingClientRect());st(a,()=>{var f;return u.value=(f=i.value)==null?void 0:f.getBoundingClientRect()}),Rn(()=>{var f;return u.value=(f=i.value)==null?void 0:f.getBoundingClientRect()});const l=I(()=>{var v,g;const f=r.value;return(g=(v=n.value)==null?void 0:v.filter(y=>{var N,w;return((N=f[y.startNode.id])==null?void 0:N.rect)&&((w=f[y.startNode.id])==null?void 0:w.rect)}))!=null?g:[]});return(f,v)=>(S(),D(se,null,[s(l)?(S(),D("svg",dr(Ct({key:0},f.$attrs)),[(S(!0),D(se,null,on(s(l),(g,y)=>(S(),te(hc,{key:y,link:g,boundingRect:u.value,startNode:s(r)[g.startNode.id],endNode:s(r)[g.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):U("",!0),C("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var yc=fe(bc,[["__scopeId","data-v-063f6d6b"]]);Q({props:{nodes:{type:j(Array),required:!0},leftSideNodes:j(Array),rightSideNodes:j(Array),branches:j(Array)},components:{Links:yc},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=Ce(e),r=Ye();nt(()=>{const l=xe(t);r.value=ae(ne(()=>p(se,null,[l.map(c=>p("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(rt)]))])))});const a=Ye();nt(()=>{const l=xe(n);a.value=l?ae(ne(()=>p("span",{class:"left-side-nodes small"},[l.map(rt)]))):""});const u=Ye();return nt(()=>{const l=xe(i);u.value=l?ae(ne(()=>p("span",{class:"side-nodes small"},[l.map(rt)]))):""}),{unref:s,nodesComp:r,leftNodesComp:a,rightNodesComp:u}}});Q({props:{display:j(Object,String,Function),visibility:{type:j(Number,Boolean),required:!0},style:j(String,Object,Array),classes:j(Object),onClick:Function,onHold:Function,color:j(String),glowColor:j(String),canClick:{type:j(Boolean),required:!0},mark:j(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:jn,Node:zn},setup(e){const{onClick:t,onHold:n,display:i}=Ce(e),r=Cn(i),{start:a,stop:u}=Li(t,n);return{start:a,stop:u,comp:r,unref:s,Visibility:_e,isCoercableComponent:gt,isVisible:ot,isHidden:un}}});function hn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(l=>he(l.base)),n.baseText=t.map(l=>he(l.baseText)),n.visible=t.map(l=>he(l.visible)),n.title=t.map(l=>he(l.title)),n.subtitle=t.map(l=>he(l.subtitle)),i=!0),t}const a=at({},!1);return[ne(()=>{const l=r();let c=!0;const f=l.map((v,g)=>{var R,x,T;if(s(n.visible[g])===!1)return null;const y=p("h3",{onClick:()=>a.value[g]=!a.value[g],style:"cursor: pointer"},[p("span",{class:"modifier-toggle"+(s(a.value[g])?" collapsed":"")},[q("\u25BC")]),s(n.title[g]),s(n.subtitle[g])!=null?p("span",{class:"subtitle"},[q(" ("),s(n.subtitle[g]),q(")")]):null]),N=s(a.value[g])?null:p(se,null,[p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[rt((R=s(n.baseText[g]))!=null?R:"Base")]),p("span",{class:"modifier-amount"},[Ht((x=s(n.base[g]))!=null?x:1),v.unit])]),v.modifier.description==null?null:rt(s(v.modifier.description))]),w=!c;c=!1;const _=(T=s(n.base[g]))!=null?T:1,E=v.modifier.apply(_);return p(se,null,[w?p("br",null,null):null,p("div",{style:{"--unit":re.alignUnits&&v.unit!=null?"'"+v.unit+"'":""}},[y,p("br",null,null),N,p("hr",null,null),p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[q("Total")]),p("span",{class:"modifier-amount",style:(v.smallerIsBetter===!0?o.gt(E,_!=null?_:1):o.lt(E,_!=null?_:1))?"color: var(--danger)":""},[Pt(E),v.unit])])])])});return p(se,null,[f])}),a]}function _i(e,t,n){const i=he(t),r=he(n);return I(()=>{const a=s(i),u=s(r);return o.gte(e.value,u)?"Now":o.lte(a,0)?"Never":Bn(o.sub(u,e.value).div(a))})}function Vn(e,t,n=1){const i=he(t),r=he(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return ne(()=>{var a;if(s(i)){const u=Pt(e.evaluate()),l=Pt(e.evaluate(o.add(s((a=e.innermostVariable)!=null?a:0),s(r))));return p(se,null,[p("b",null,[p("i",null,[u,q(" \u2192 "),l])])])}return p(se,null,[Pt(e.evaluate())])})}const wc=Q({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(S(),D("div",{style:qe({width:e.width,height:e.height})},null,4))}});function Kn(e){return Je(t=>{const n=e.call(t,t);if(n.partialDisplay=i=>p("span",{style:s(n.requirementMet)?"":"color: var(--danger)"},[wi(n.resource,n.cost instanceof m?Ot(n.cost,i!=null?i:1,s(n.spendResources)):s(n.cost))," ",n.resource.displayName]),n.display=i=>p("div",null,[s(n.requiresPay)?"Costs: ":"Requires: ",wi(n.resource,n.cost instanceof m?Ot(n.cost,i!=null?i:1,s(n.spendResources)):s(n.cost))," ",n.resource.displayName]),F(n,"visibility"),oe(n,"visibility",_e.Visible),F(n,"cost"),F(n,"requiresPay"),oe(n,"requiresPay",!0),F(n,"spendResources"),oe(n,"spendResources",!0),oe(n,"pay",function(i){const r=n.cost instanceof m?Ot(n.cost,i!=null?i:1,s(n.spendResources)):s(n.cost);n.resource.value=o.sub(n.resource.value,r).max(0)}),n.canMaximize=I(()=>n.cost instanceof m&&n.cost.isInvertible()&&(s(n.spendResources)===!1||n.cost.isIntegrable())),n.cost instanceof m&&n.cost.isInvertible()){const i=sc(n.cost,n.resource,s(n.spendResources));n.requirementMet=I(()=>s(n.canMaximize)?i.value:n.cost instanceof m?o.gte(n.resource.value,n.cost.evaluate()):o.gte(n.resource.value,s(n.cost)))}else n.requirementMet=I(()=>n.cost instanceof m?o.gte(n.resource.value,n.cost.evaluate()):o.gte(n.resource.value,s(n.cost)));return n})}function di(e){return Je(()=>({requirementMet:I(()=>ot(e.visibility)),visibility:_e.None,requiresPay:!1}))}function _c(e,t){return Je(()=>({requirementMet:he(e),partialDisplay:t==null?void 0:ne(()=>rt(t)),display:t==null?void 0:ne(()=>p(se,null,[q("Req: "),rt(t)])),visibility:t==null?_e.None:_e.Visible,requiresPay:!1}))}function Un(e){if(ht(e))return e.every(Un);const t=s(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function er(e){if(ht(e))return e.map(er).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 Gn(e,t=1){var n,i;if(ht(e)&&(e=e.filter(r=>ot(r.visibility)),e.length===1&&(e=e[0])),ht(e)){e=e.filter(u=>"partialDisplay"in u);const r=e.filter(u=>s(u.requiresPay)),a=e.filter(u=>!s(u.requiresPay));return p(se,null,[r.length>0?p("div",null,[q("Costs:")," ",bi(r.map(u=>u.partialDisplay(t)),p(se,null,[q(", ")]))]):null,a.length>0?p("div",null,[q("Requires:")," ",bi(a.map(u=>u.partialDisplay(t)),p(se,null,[q(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:p(se,null,null)}function tr(e,t=1){var n;ht(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 Nc=Q({props:{visibility:{type:j(Number,Boolean),required:!0},display:j(Object,String,Function),earned:{type:j(Boolean),required:!0},requirements:j(Object,Array),image:j(String),style:j(String,Object,Array),classes:j(Object),mark:j(Boolean,String),small:j(Boolean),id:{type:String,required:!0}},components:{Node:zn,MarkNode:jn},setup(e){const{display:t,requirements:n,earned:i}=Ce(e),r=Ye("");return nt(()=>{const a=xe(t);if(a==null){r.value="";return}if(gt(a)){r.value=ae(a);return}const u=ae(a.requirement?a.requirement:ne(()=>{var f;return Gn((f=xe(n))!=null?f:[])}),"h3"),l=ae(a.effectDisplay||"","b"),c=xe(i)?ae(a.optionsDisplay||"","span"):"";r.value=ae(ne(()=>p("span",null,[p(u,null,null),a.effectDisplay!=null?p("div",null,[p(l,null,null)]):null,a.optionsDisplay!=null?p("div",{class:"equal-spaced"},[p(c,null,null)]):null])))}),{comp:r,unref:s,Visibility:_e,isVisible:ot,isHidden:un}}});function Cc(e,t,n,i,r,a){var c;const u=bt("MarkNode"),l=bt("Node");return e.isVisible(e.visibility)?(S(),D("div",{key:0,style:qe([{visibility:e.isHidden(e.visibility)?"hidden":void 0,backgroundImage:e.earned&&e.image&&`url(${e.image})`||""},(c=e.unref(e.style))!=null?c:[]]),class:pe({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?(S(),te(Oe(e.comp),{key:0})):U("",!0),p(u,{mark:e.unref(e.mark)},null,8,["mark"]),p(l,{id:e.id},null,8,["id"])],6)):U("",!0)}var kc=fe(Nc,[["render",Cc],["__scopeId","data-v-5673325a"]]);const Mc=Ln(),Sc=Symbol("Achievement");let nn=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function Ic(e,...t){const n=at(!1,!1),i=t.reduce((r,a)=>{var u;return Object.assign(r,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return Je(r=>{var c,f,v;const a=(c=e==null?void 0:e.call(r,r))!=null?c:{};a.id=Nn("achievement-"),a.type=Sc,a[ft]=kc;for(const g of t)(f=g.preConstruct)==null||f.call(g,a);a.earned=n,a.complete=function(){var y,N;n.value=!0;const g=a;if((y=g.onComplete)==null||y.call(g),g.display!=null&&s(g.showPopups)===!0){const w=s(g.display);let _;gt(w)?_=ae(w):w.requirement!=null?_=ae(w.requirement):_=Gn((N=g.requirements)!=null?N:[]),Mc.info(p("div",null,[p("h3",null,[q("Achievement earned!")]),p("div",null,[p(_,null,null)])]))}},Object.assign(a,i),F(a,"visibility"),oe(a,"visibility",_e.Visible);const u=a.visibility;a.visibility=fr(()=>{const g=s(a.display);switch(re.msDisplay){default:case nn.All:return s(u);case nn.Configurable:return s(a.earned)&&!(g!=null&&typeof g=="object"&&"optionsDisplay"in g)?_e.None:s(u);case nn.Incomplete:return s(a.earned)?_e.None:s(u);case nn.None:return _e.None}}),F(a,"display"),F(a,"mark"),F(a,"small"),F(a,"image"),F(a,"style"),F(a,"classes"),F(a,"showPopups"),oe(a,"showPopups",!0);for(const g of t)(v=g.postConstruct)==null||v.call(g,a);const l=t.reduce((g,y)=>{var N;return Object.assign(g,(N=y.getGatheredProps)==null?void 0:N.call(y,a))},{});if(a[it]=function(){const{visibility:g,display:y,requirements:N,earned:w,image:_,style:E,classes:R,mark:x,small:T,id:L}=this;return{visibility:g,display:y,requirements:N,earned:w,image:_,style:s(E),classes:R,mark:x,small:T,id:L,...l}},a.requirements){const g=a,y=[di(g),_c(()=>!g.earned.value),...ht(a.requirements)?a.requirements:[a.requirements]];nt(()=>{re.active===X.id&&Un(y)&&g.complete()})}return a})}Ve.on("loadSettings",e=>{oe(e,"msDisplay",nn.All)});const $c=Object.values(nn).map(e=>({label:tt(e),value:e}));Sa(ne(()=>p(ui,{title:ne(()=>p("span",{class:"option-title"},[q("Show achievements"),p("desc",null,[q("Select which achievements to display based on criterias.")])])),options:$c,"onUpdate:modelValue":e=>re.msDisplay=e,modelValue:re.msDisplay},null)));const xc=Symbol("Repeatable");function Ec(e,...t){const n=at(0),i=t.reduce((r,a)=>{var u;return Object.assign(r,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return Je(r=>{var y,N,w;const a=e.call(r,r);a.id=Nn("repeatable-"),a.type=xc,a[ft]=mc;for(const _ of t)(y=_.preConstruct)==null||y.call(_,a);a.amount=n,a.amount[ln]=(N=a.initialAmount)!=null?N:0,Object.assign(a,i);const u={requirementMet:I(()=>o.sub(s(a.limit),a.amount.value)),requiresPay:!1,visibility:_e.None},l=di(a);ht(a.requirements)?(a.requirements.unshift(l),a.requirements.push(u)):a.requirements=[l,a.requirements,u],a.maxed=I(()=>o.gte(a.amount.value,s(a.limit))),F(a,"classes");const c=a.classes;a.classes=I(()=>{const _=s(c)||{};return a.maxed.value&&(_.bought=!0),_}),a.amountToIncrease=I(()=>s(a.maximize)?er(a.requirements):1),a.canClick=I(()=>Un(a.requirements));const f=a.onClick;a.onClick=function(_){const E=a;!s(E.canClick)||(tr(a.requirements,s(a.amountToIncrease)),E.amount.value=o.add(E.amount.value,1),f==null||f(_))},F(a,"display");const v=a.display;a.display=ne(()=>{var E,R,x;const _=s(v);if(gt(_)){const T=ae(_);return p(T,null,null)}if(_!=null){const T=a,L=ae((E=_.title)!=null?E:"","h3"),A=ae((R=_.description)!=null?R:""),B=ae((x=_.effectDisplay)!=null?x:"");return p("span",null,[_.title==null?null:p("div",null,[p(L,null,null)]),_.description==null?null:p(A,null,null),_.showAmount===!1?null:p("div",null,[p("br",null,null),p(se,null,[q("Amount: "),Ge(T.amount.value)]),o.isFinite(s(T.limit))?p(se,null,[q(" / "),Ge(s(T.limit))]):void 0]),_.effectDisplay==null?null:p("div",null,[p("br",null,null),q("Currently: "),p(B,null,null)]),T.maxed.value?null:p("div",null,[p("br",null,null),Gn(T.requirements,s(a.amountToIncrease))])])}return""}),F(a,"visibility"),oe(a,"visibility",_e.Visible),F(a,"limit"),oe(a,"limit",o.dInf),F(a,"style"),F(a,"mark"),F(a,"small"),F(a,"maximize");for(const _ of t)(w=_.postConstruct)==null||w.call(_,a);const g=t.reduce((_,E)=>{var R;return Object.assign(_,(R=E.getGatheredProps)==null?void 0:R.call(E,a))},{});return a[it]=function(){const{display:_,visibility:E,style:R,classes:x,onClick:T,canClick:L,small:A,mark:B,id:K}=this;return{display:_,visibility:E,style:s(R),classes:x,onClick:T,canClick:L,small:A,mark:B,id:K,...g}},a})}function Ni(e,t){return F(t,"display"),F(t,"classes"),F(t,"style"),F(t,"direction"),oe(t,"direction",J.Up),F(t,"xoffset"),F(t,"yoffset"),t.pinnable&&(t.pinned=at(!1,!1)),Nt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,zi(t.pinned)):e.pinned=t.pinned);const n=e[ft];e[ft]=ke;const i=e[it].bind(e);e[it]=function(){const{display:a,classes:u,style:l,direction:c,xoffset:f,yoffset:v,pinned:g}=this;return{element:{[ft]:n,[it]:i},display:a,classes:u,style:s(l),direction:c,xoffset:f,yoffset:v,pinned:g}}.bind(t)}),t}var Tc=Q({props:{display:{type:j(String,Object,Function),required:!0},visibility:{type:j(Number,Boolean),required:!0},style:j(String,Object,Array),classes:j(Object),requirements:{type:Object,required:!0},canPurchase:{type:j(Boolean),required:!0},bought:{type:j(Boolean),required:!0},mark:j(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:zn,MarkNode:jn},setup(e){const{display:t,requirements:n,bought:i}=Ce(e),r=Ye("");return nt(()=>{const a=xe(t);if(a==null){r.value="";return}if(gt(a)){r.value=ae(a);return}const u=ae(a.title||"","h3"),l=ae(a.description,"div"),c=ae(a.effectDisplay||"");r.value=ae(ne(()=>p("span",null,[a.title!=null?p("div",null,[p(u,null,null)]):null,p(l,null,null),a.effectDisplay!=null?p("div",null,[q("Currently: "),p(c,null,null)]):null,i.value?null:p(se,null,[p("br",null,null),Gn(n.value)])])))}),{component:r,unref:s,Visibility:_e,isVisible:ot,isHidden:un}}});const Dc=["disabled"];function Pc(e,t,n,i,r,a){var c;const u=bt("MarkNode"),l=bt("Node");return e.isVisible(e.visibility)?(S(),D("button",{key:0,style:qe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...f)=>e.purchase&&e.purchase(...f)),class:pe({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)?(S(),te(Oe(e.unref(e.component)),{key:0})):U("",!0),p(u,{mark:e.unref(e.mark)},null,8,["mark"]),p(l,{id:e.id},null,8,["id"])],14,Dc)):U("",!0)}var Fc=fe(Tc,[["render",Pc],["__scopeId","data-v-9be6bac0"]]);const Oc=Symbol("Upgrade");function Ac(e,...t){const n=at(!1,!1),i=t.reduce((r,a)=>{var u;return Object.assign(r,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return Je(r=>{var c,f;const a=e.call(r,r);a.id=Nn("upgrade-"),a.type=Oc,a[ft]=Fc;for(const v of t)(c=v.preConstruct)==null||c.call(v,a);a.bought=n,Object.assign(a,i),a.canPurchase=I(()=>!n.value&&Un(a.requirements)),a.purchase=function(){var g;const v=a;!s(v.canPurchase)||(tr(a.requirements),n.value=!0,(g=v.onPurchase)==null||g.call(v))};const u=di(a);ht(a.requirements)?a.requirements.unshift(u):a.requirements=[u,a.requirements],F(a,"visibility"),oe(a,"visibility",_e.Visible),F(a,"classes"),F(a,"style"),F(a,"display"),F(a,"mark");for(const v of t)(f=v.postConstruct)==null||f.call(v,a);const l=t.reduce((v,g)=>{var y;return Object.assign(v,(y=g.getGatheredProps)==null?void 0:y.call(g,a))},{});return a[it]=function(){const{display:v,visibility:g,style:y,classes:N,requirements:w,canPurchase:_,bought:E,mark:R,id:x,purchase:T}=this;return{display:v,visibility:g,style:s(y),classes:N,requirements:w,canPurchase:_,bought:E,mark:R,id:x,purchase:T,...l}},a})}function qc(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 Vc={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"]},Ci=[[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 ki(e){const t=Ci[Math.floor(e()*Ci.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 Bc=Ln();function nr(e,t,n,i){return oi(e,function(){const r=qc(0,n>>0,n>>32,1);for(let G=0;G<12;G++)r();const a=ki(r),u=Mi([.64,.75,.55],r),l=Mi([.18,.2,.25],r),c=Ki(0,ki(r)),f=Et.indexOf(t);let v=r();i.some(G=>G.type==="increaseDiff")&&(v=v/2+.5),i.some(G=>G.type==="decreaseDiff")&&(v=v/2);const g=v+f+1,y=i.some(G=>G.type==="increaseRewards")?g+1:g;let N=Math.ceil(r()*(f+2));i.some(G=>G.type==="increaseLength")&&N++;const w=[],_=jt(()=>w),E=I(()=>_.apply(0)),R=[];function x({feature:G,canClick:Z,modifier:Fe,cost:St,previewModifier:qt,showETA:je}){Z=he(Z),je=he(je);const Qt=Pa(G);R.push({shouldShowPreview:I(()=>s(Z)&&Qt.value),modifier:qt!=null?qt:Fe,cost:St}),w.push(Fe);const It=_i(c,E,()=>be(St));Ni(G,{display:je==null?It:()=>s(je)?It.value:"",direction:J.Down})}const T=[],L=z(0);let A=m.variable(L).times(0);const B={};let K=!0;const le=I(()=>o.add(g,r()-.5).pow_base(2).times(10).times(A.evaluate())),Se=[];for(let G=0;G({addend:me,description:k,enabled:ue.bought}));break}case"mult":{const me=r()*5+1;$=`Multiply previous ${c.displayName} gain by x${ve(me)}.`,A=A.add(o.sub(me,1).times(B[L.value-1])),O=mt(()=>({multiplier:me,description:k,enabled:ue.bought}));break}case"pow":{const me=r()/5+1.1;$=`Raise previous ${c.displayName} gain to the ^${ve(me)}`,A=A.add(o.pow(B[L.value-1],me)).sub(B[L.value-1]),O=oc(()=>({exponent:me,description:k,enabled:ue.bought}))}}B[L.value]=A.evaluate(),L.value++;const W=K,ue=Ac(()=>({requirements:Kn(()=>({resource:Jn(c),cost:d})),display:{title:k,description:$},visibility:W}));x({feature:ue,canClick:()=>ue.canPurchase.value,modifier:O,cost:d,showETA:()=>!ue.bought.value}),De.push(ue)}T.push(De);break;case"repeatables":const ut=[];for(let Ie=0;Ie<3;Ie++){const h=gn({add:1.5,mult:3},r),d=L.value,k=le.value,$=Si(r);let O="",W,ue,me,ct;const tn=m.variable(I(()=>pt.amount.value)).times(2);switch(h){case"add":{const Qe=o.add(k,10).times(r()+.5);O=`Gain ${ve(Qe)} ${c.displayName}/s`,ct=tn.add(1).times(k),A=A.add(I(()=>o.sub(L.value,d).add(1).times(5).times(Qe))),W=I(()=>ve(o.times(Qe,pt.amount.value))+"/s"),ue=bn(()=>({addend:()=>o.times(Qe,pt.amount.value),description:$,enabled:()=>o.gt(pt.amount.value,0)})),me=bn(()=>({addend:Qe}));break}case"mult":{const Qe=r()+1;O=`Multiply previous ${c.displayName} gain by x${ve(Qe)}.`,ct=tn.pow_base(Qe).times(k),A=A.add(I(()=>o.sub(L.value,d).add(1).times(5).pow_base(Qe).sub(1).times(B[d]))),W=I(()=>"x"+ve(o.pow(Qe,pt.amount.value))),ue=mt(()=>({multiplier:()=>o.pow(Qe,pt.amount.value),description:$,enabled:()=>o.gt(pt.amount.value,0)})),me=mt(()=>({multiplier:Qe}));break}}B[L.value]=A.evaluate(),L.value++;const rr=K,pt=Ec(()=>({requirements:Kn(()=>({resource:Jn(c),cost:ct})),display:()=>({title:$,description:O,effectDisplay:s(W)}),visibility:rr}));x({feature:pt,canClick:()=>s(pt.canClick),modifier:ue,cost:ct,previewModifier:me}),ut.push(pt)}T.push(ut);break}const St={cache:i.some(De=>De.type==="increaseCaches")?10:1,generation:i.some(De=>De.type==="increaseGens")?10:1,resourceMulti:i.some(De=>De.type==="increaseResourceMults")?10:1,energyMulti:i.some(De=>De.type==="increaseEnergyMults")?2.5:.25,influences:Object.keys(Re.influenceNodes.value).length+Se.length===Object.keys(Wt).length?0:i.some(De=>De.type==="increaseInfluences")?20:2},qt=gn(St,r);let je="",Qt,It,In,ze,fn,Vt;switch(qt){case"cache":ze=Xn(r,i),je=`Gain ${ve(y)}x your current ${ze}.`,It=()=>{var Ie,Ue,h;return Re.grantResource(ze,o.times((h=(Ue=(Ie=Re.resourceNodes.value[ze])==null?void 0:Ie.state)==null?void 0:Ue.amount)!=null?h:0,y))};break;case"generation":ze=Xn(r,i);const De=o.div(y,120).times(He[ze]);je=`Gain ${ve(De)} ${ze}/s while plane is active.`,Qt=Ie=>Re.grantResource(ze,o.times(Ie,De)),In=I(()=>Re.resourceNodes.value[ze]);break;case"resourceMulti":fn=ze=Xn(r,i),Vt=o.div(y,17).pow_base(2),je=`Gain ${ve(Vt)}x ${ze} while plane is active.`;break;case"energyMulti":fn="energy",Vt=o.div(y,17),je=`Gain ${ve(Vt)}x energy while plane is active.`;break;case"influences":const ut=gn(Object.keys(Wt).reduce((Ie,Ue)=>(Ie[Ue]=Ue in Re.influenceNodes.value||Se.includes(Ue)?0:1,Ie),{}),r);Se.push(ut),je="Gain a new portal influence",It=()=>{if(ut in Re.influenceNodes.value){Bc.warning("Error: ignoring duplicate portal influence ("+Wt[ut].display+")");return}const Ie={id:Tn(Re.board),position:{...Re.board.types.portal.nodes.value.find(Ue=>Ue.state.id===e).position},type:"influence",state:{type:ut,data:Wt[ut].initialData}};Re.board.placeInAvailableSpace(Ie),Re.board.nodes.value.push(Ie)};break}const $t=K,Rt=le.value,en=Ic(()=>({requirements:Kn(()=>({resource:Jn(c),cost:Rt})),visibility:$t,display:{requirement:`${ve(Rt)} ${c.displayName}`,effectDisplay:je},style:"width: 100%",classes:{final:G===N-1},update:Qt,onComplete:It,link:In,effectedResource:fn,resourceMulti:Vt})),$n=_i(c,E,Rt);Ni(en,{display:()=>en.earned.value?"":$n.value,direction:J.Down}),T.push([en]),K=en.earned}const[Te,V]=hn(()=>[{title:`${tt(c.displayName)} Gain`,modifier:_,base:0,unit:"/s"}]),ge=z(!1),Pe=ne(()=>p(kt,{modelValue:ge.value,"onUpdate:modelValue":G=>ge.value=G},{header:()=>p("h2",null,[q("Modifiers")]),body:()=>Ze(Te)}));this.on("preUpdate",G=>{!Re.activePortals.value.some(Z=>Z.state.id===e)||(c.value=o.times(E.value,G).add(c.value),yt.value.forEach(Z=>{var Fe;(Fe=Z.update)==null||Fe.call(Z,G)}))});const Be=I(()=>{const G=R.find(Z=>Z.shouldShowPreview.value);return G?o.neg(be(G.cost)):0}),lt=I(()=>{const G=R.find(Z=>Z.shouldShowPreview.value);return G?o.sub(G.modifier.apply(E.value),E.value):0}),Xe=Vn(m.variable(0).add(c),()=>o.neq(Be.value,0),Be),dn=Vn(m.variable(0).add(E),()=>o.neq(lt.value,0),lt),Mn=I(()=>{const G=[];return yt.value.forEach(Z=>{Z.link&&G.push(Z.link)}),G}),Hn=I(()=>{const G={};return yt.value.forEach(Z=>{Z.effectedResource!=null&&Z.resourceMulti!=null&&(G[Z.effectedResource]!=null?G[Z.effectedResource]=o.times(G[Z.effectedResource],Z.resourceMulti):G[Z.effectedResource]=Z.resourceMulti)}),G}),yt=I(()=>{const G=[];for(let Z=1;Zo.lt(yt.value.length,N)&&T.some(G=>G.some(Z=>"earned"in Z&&s(Z.earned)||"bought"in Z&&s(Z.bought)?!1:("canClick"in Z&&s(Z.canClick)||"canPurchase"in Z&&s(Z.canPurchase),!0))));return{tier:at(t),seed:at(n),influences:at(i),name:a,color:u,resource:c,background:l,style:{background:l,"--background":l},features:T,resourceTabCollapsed:V,links:Mn,resourceMultis:Hn,earnedTreasures:yt,showNotif:Sn,display:ne(()=>p(se,null,[p(qn,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",null,[a])]),p("span",{class:"nav-segment"},[p("h3",null,[t,q("-tier")])]),p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>ge.value=!0},[q("modifiers")])])]}),p(qn,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h3",{style:`color: ${u}; text-shadow: 0px 0px 10px ${u};`},[Ze(Xe)])," ",c.displayName]),p("span",{class:"nav-segment"},[q("("),p("h3",{style:`color: ${u}; text-shadow: 0px 0px 10px ${u};`},[o.gt(E.value,0)?"+":"",Ze(dn)]),q("/s)")])]}),p(wc,{height:"60px"},null),T.map(G=>Da(...G)),Ze(Pe)])),minimizedDisplay:ne(()=>p("div",null,[p("span",null,[a]),p("span",{style:"font-size: large; vertical-align: sub;"},[" ",yt.value.length,q("/"),N,q(" treasures")])]))}})}function Xn(e,t){t=t.filter(l=>l.type==="increaseResources"||l.type==="decreaseResources");const n=Object.keys(He).reduce((l,c)=>{let f=He[c];return t.filter(v=>v.data===c).forEach(v=>{v.type==="increaseResources"?f*=1e3:f/=1e3}),l+f},0),i=Object.keys(He),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?"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 20% stronger":"Material level is 10% stronger"}},Wt={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}},Re=oi("main",function(){const e=Ki(0,"energy"),t=m.variable(0).add(1),n=I(()=>A.types.resource.nodes.value.reduce((h,d)=>(h[d.state.type]=d,h),{})),i=I(()=>({...A.types.passive.nodes.value.reduce((h,d)=>(h[d.state]=d,h),{}),sand:A.types.dowsing.nodes.value[0],wood:A.types.quarry.nodes.value[0],coal:A.types.empowerer.nodes.value[0],iron:A.types.portalGenerator.nodes.value[0]})),r=I(()=>({...A.types.influence.nodes.value.reduce((h,d)=>(h[d.state.type]=d,h),{})})),a=I(()=>Et.reduce((h,d)=>{var W,ue,me;const k=(me=(ue=(W=n.value[d])==null?void 0:W.state)==null?void 0:ue.amount)!=null?me:0;let $=o.floor(t.invertIntegral(k)).sub(10).clampMin(0),O=Ot(t,$,!0,0);for(;;){const ct=t.evaluate($);if(o.add(O,ct).lte(k))$=$.add(1),O=o.add(O,ct);else break}return h[d]=$,h},{}));function u(h){var W,ue,me;const d=(me=(ue=(W=n.value[h])==null?void 0:W.state)==null?void 0:ue.amount)!=null?me:0,k=a.value[h],$=Ot(t,k,!0),O=Ot(t,o.add(k,1),!0);return o.sub(d,$).max(0).div(o.sub(O,$)).toNumber()}const l=Yt({}),c=Yt({});Nt(()=>{Et.forEach(h=>{st(()=>a.value[h],(d,k)=>{o.gt(d,k)&&re.active===X.id&&Ii.info(p("div",null,[p("h3",null,[o.eq(d,1)?`${tt(h)} discovered`:`${tt(h)} is now Level ${Ge(d)}`,q("!")]),p("div",null,[q("Energy gain is now 1.01x higher.")])]))})})});const f=I(()=>[K,Se,Te,V].filter(h=>{var d,k;return(k=(d=h.value)==null?void 0:d.state)==null?void 0:k.powered}).length+A.types.portal.nodes.value.filter(h=>h.state.powered).length),v=I(()=>o.eq(f.value,0)?10:o.add(f.value,1).pow_base(100).div(10).times(.99)),g=I(()=>Te.value==null?0:Te.value.state.resources.reduce((d,k)=>o.div(100,Fe[k].computedModifier.value).add(d),o.dZero)),y={id:"deselect",icon:"close",tooltip:h=>({text:"tools"in h.state?"Disconnect tools":"Disconnect resources"}),onClick(h){Array.isArray(h.state)?h.state=[]:"resources"in h.state?h.state={...h.state,resources:[]}:"tools"in h.state&&(h.state={...h.state,tools:[]}),A.selectedAction.value=null,A.selectedNode.value=null},visibility:h=>Array.isArray(h.state)?h.state.length>0:"resources"in h.state?h.state.resources.length>0:"tools"in h.state?h.state.tools.length>0:!1},N={id:"toggle",icon:"bolt",tooltip:h=>({text:h.state.powered?"Turn Off":`Turn On - Always runs for ${Ge(v.value)} energy/s`}),onClick(h){h.state={...h.state,powered:!h.state.powered},A.selectedAction.value=null},fillColor:h=>h.state.powered?"var(--accent1)":"var(--locked)"};function w(h,d=1/0){const k=h(m.variable(0));return{id:"moreConnections",icon:"hub",formula:k,tooltip($){return{text:`Increase Connections - ${Ge(k.evaluate($.state.maxConnections))} energy`}},confirmationLabel:$=>o.gte(e.value,k.evaluate($.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick($){const O=k.evaluate($.state.maxConnections);o.gte(e.value,O)&&(e.value=o.sub(e.value,O)),$.state={...$.state,maxConnections:$.state.maxConnections+1},A.selectedAction.value=null},visibility:$=>$.state.maxConnectionsO!==k)}:h.state={...h.state,resources:[...$,k]},A.selectedNode.value=h}function T(h,d){if(d.type!=="passive")return!1;const k=d.state,{maxConnections:$,tools:O}=h.state;return O.includes(k)?!0:O.length!==$}function L(h,d){if(d.type!=="passive")return;const k=d.state,$=h.state.tools;$.includes(k)?h.state={...h.state,tools:$.filter(O=>O!==k)}:h.state={...h.state,tools:[...$,k]},A.selectedNode.value=h}const A=Cl(h=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:{mine:{shape:Ae.Diamond,size:50,title:"\u{1FAA8}",label:d=>d===h.selectedNode.value?{text:"Mining"}:Object.keys(n.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[N],progress:d=>B(d)?new o(d.state.progress).toNumber():0,progressDisplay:Gt.Outline,progressColor:"var(--accent2)",classes:d=>({running:B(d)}),draggable:!0},brokenFactory:{shape:Ae.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:d=>d===h.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(d){o.gte(e.value,100)&&(d.type="factory",e.value=o.sub(e.value,100))},confirmationLabel:()=>o.gte(e.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},factory:{shape:Ae.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:d=>{var k,$;if(d===h.selectedNode.value)return{text:d.state==null?"Forge - Drag a resource to me!":`Forging ${Ee[d.state].name}`};if(((k=h.draggingNode.value)==null?void 0:k.type)==="resource"){const O=(($=h.draggingNode.value)==null?void 0:$.state).type,W=d.state===O?"Disconnect":Ee[O].name,ue=d.state===O||o.gte(e.value,Ee[O].cost)&&i.value[O]==null?"var(--accent2)":"var(--danger)";return{text:W,color:ue}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(d){d.state=void 0,h.selectedAction.value=null,h.selectedNode.value=null},visibility:d=>d.state!=null},{id:"craft",icon:"done",tooltip:d=>({text:`Forge ${Ee[d.state].name} - ${Ge(Ee[d.state].cost)} energy`}),onClick(d){const k=Ee[d.state];if(o.gte(e.value,k.cost)&&i.value[d.state]==null){e.value=o.sub(e.value,k.cost);const $={id:Tn(h),position:{...d.position},type:k.type,state:k.state};h.placeInAvailableSpace($),h.nodes.value.push($),h.selectedAction.value=null,h.selectedNode.value=null,d.state=void 0}},fillColor:d=>o.gte(e.value,Ee[d.state].cost)&&i.value[d.state]==null?"var(--accent2)":"var(--danger)",visibility:d=>d.state!=null,confirmationLabel:d=>o.gte(e.value,Ee[d.state].cost)?i.value[d.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:d=>d.state==null||i.value[d.state]!=null?0:o.div(e.value,Ee[d.state].cost).clampMax(1).toNumber(),progressDisplay:Gt.Fill,progressColor:d=>d.state!=null&&o.gte(e.value,Ee[d.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(d,k){return k.type==="resource"},onDrop(d,k){const $=k.state.type;d.state===$?d.state=void 0:d.state=$,h.selectedNode.value=d},draggable:!0},resource:{shape:Ae.Circle,size:50,title:d=>tt(d.state.type),subtitle:d=>Ge(d.state.amount),progress:d=>u(d.state.type),onClick(){},progressDisplay:Gt.Outline,progressColor:"var(--accent3)",classes:d=>{var k;return{"affected-node":Se.value!=null&&B(Se.value)&&Se.value.state.resources.includes(d.state.type)||o.neq((k=lt.value[d.state.type])!=null?k:1,1)}},draggable:!0},passive:{shape:Ae.Circle,size:50,title:d=>Ee[d.state].name,label:d=>d===h.selectedNode.value?{text:$i[d.state].description(V.value!=null&&B(V.value)&&V.value.state.tools.includes(d.state))}:null,outlineColor:"var(--bought)",classes:d=>({"affected-node":V.value!=null&&B(V.value)&&V.value.state.tools.includes(d.state)}),draggable:!0},dowsing:{shape:Ae.Diamond,size:50,title:"\u{1F962}",label:d=>d===h.selectedNode.value?{text:d.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${d.state.resources.length}/${d.state.maxConnections})`}:_(d,k=>`Double ${k} odds`),actionDistance:Math.PI/4,actions:[y,w(d=>d.add(2).pow_base(100),16),N],classes:d=>({running:B(d)}),canAccept:R,onDrop:x,draggable:!0},quarry:{shape:Ae.Diamond,size:50,title:"\u26CF\uFE0F",label:d=>d===h.selectedNode.value?{text:d.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${d.state.resources.length}/${d.state.maxConnections})`}:_(d,k=>`Gather ${Ht(o.div(Fe[k].computedModifier.value,100))} ${k}/s`),actionDistance:Math.PI/4,actions:[y,w(d=>d.add(2).pow_base(1e4),16),N],progress:d=>B(d)?o.eq(g.value,0)?0:new o(d.state.progress).div(g.value).toNumber():0,progressDisplay:Gt.Outline,progressColor:"var(--accent2)",canAccept:R,onDrop:x,classes:d=>({running:B(d)}),draggable:!0},empowerer:{shape:Ae.Diamond,size:50,title:"\u{1F50C}",label:d=>d===h.selectedNode.value?{text:d.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${d.state.tools.length}/${d.state.maxConnections})`}:E(d,k=>`Double ${Ee[k].name}'s effect`),actionDistance:Math.PI/4,actions:[y,w(d=>d.add(3).pow_base(1e3),16),N],canAccept:T,onDrop:L,classes:d=>({running:B(d)}),draggable:!0},portalGenerator:{shape:Ae.Diamond,size:50,title:"\u26E9\uFE0F",label:d=>{if(d===h.selectedNode.value)return{text:d.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${d.state.tier}-tier portal`};const k=h.draggingNode.value;if((k==null?void 0:k.type)==="resource"){const $=k.state.type;return{text:d.state.tier===$?"Disconnect":`${tt($)}-tier Portal`,color:"var(--accent2)"}}else if((k==null?void 0:k.type)==="influence"){const $=k.state.type,{influences:O}=d.state;return O.includes($)?{text:"Disconnect",color:"var(--accent2)"}:{text:"Add influence",color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(d){d.state={...d.state,tier:void 0,influences:[]},h.selectedAction.value=null,h.selectedNode.value=null},visibility:d=>{const{tier:k,influences:$}=d.state;return k!=null||$.length>0}},{id:"makePortal",icon:"done",tooltip:d=>({text:`Spawn ${d.state.tier}-tier portal`}),onClick(d){let k=0;for(;`portal-${k}`in we;)k++;const{tier:$,influences:O}=d.state;li(nr(`portal-${k}`,$,Math.floor(Math.random()*4294967296),O.map(ue=>r.value[ue].state)),X);const W={id:Tn(h),position:{...d.position},type:"portal",state:{id:`portal-${k}`,powered:!1}};h.placeInAvailableSpace(W),h.nodes.value.push(W),h.selectedAction.value=null,h.selectedNode.value=null,d.state={tier:void 0,influences:[]}},visibility:d=>d.state.tier!=null}],canAccept(d,k){return k.type==="resource"||k.type==="influence"},onDrop(d,k){if(k.type==="resource"){const $=k.state.type,O=d.state.tier;d.state={...d.state,tier:$===O?void 0:$}}else if(k.type==="influence"){const $=k.state.type,O=d.state.influences;O.includes($)?d.state={...d.state,influences:O.filter(W=>W!==$)}:d.state={...d.state,influences:[...O,$]}}h.selectedNode.value=d},draggable:!0},portal:{shape:Ae.Diamond,size:50,title:"\u{1F300}",label:d=>d===h.selectedNode.value?{text:`Portal to ${we[d.state.id].name}`,color:we[d.state.id].color}:null,actionDistance:Math.PI/4,actions:[N],classes:d=>({running:B(d),showNotif:we[d.state.id].showNotif.value}),outlineColor:d=>we[d.state.id].background,draggable:!0},influence:{shape:d=>d.state.type==="increaseResources"||d.state.type==="decreaseResources"?Ae.Diamond:Ae.Circle,size:50,title:d=>Wt[d.state.type].display,label:d=>{if(d===h.selectedNode.value){const k=d.state,$=Wt[k.type].description;return{text:typeof $=="function"?$(k):$}}return null},actionDistance:Math.PI/4,actions:[y],canAccept:(d,k)=>k.type!=="resource"?!1:Array.isArray(d.state),onDrop:(d,k)=>{if(k.type!=="resource")return;const $=k.state.type,O=d.state;O.includes($)?d.state=O.filter(W=>W!==$):d.state=[...O,$],h.selectedNode.value=d},outlineColor:"var(--danger)",draggable:!0}},style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const d=[];if(d.push(...Object.keys(l).map(k=>({startNode:K.value,endNode:n.value[k],stroke:"var(--accent3)",strokeWidth:5}))),le.value!=null&&le.value.state!=null&&d.push({startNode:le.value,endNode:n.value[le.value.state],stroke:"var(--foreground)",strokeWidth:4}),Se.value!=null&&Se.value.state.resources.forEach(k=>{d.push({startNode:Se.value,endNode:n.value[k],stroke:B(Se.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),Te.value!=null&&Te.value.state.resources.forEach(k=>{d.push({startNode:Te.value,endNode:n.value[k],stroke:"var(--foreground)",strokeWidth:4})}),d.push(...Object.keys(c).map(k=>({startNode:Te.value,endNode:n.value[k],stroke:"var(--accent3)",strokeWidth:5}))),V.value!=null&&V.value.state.tools.forEach(k=>{d.push({startNode:V.value,endNode:i.value[k],stroke:B(V.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),ge.value!=null){const k=ge.value.state;k.tier!=null&&d.push({startNode:ge.value,endNode:n.value[k.tier],stroke:"var(--foreground)",strokeWidth:4}),k.influences.forEach($=>{console.log($),d.push({startNode:ge.value,endNode:r.value[$],stroke:"var(--foreground)",strokeWidth:4})}),h.types.portal.nodes.value.forEach($=>{const O=we[$.state.id];return O.links.value.forEach(W=>{W.value!=null&&d.push({startNode:$,endNode:W.value,stroke:B($)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(O.resourceMultis.value).forEach(W=>{W!=="energy"&&W in n.value&&d.push({startNode:$,endNode:n.value[W],stroke:B($)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),d})}return Object.values(r.value).forEach(k=>{const $=k.state;($.type==="increaseResources"||$.type==="decreaseResources")&&$.data.forEach(O=>{d.push({startNode:k,endNode:n.value[O],stroke:"var(--foreground)",strokeWidth:4})})}),d}}));function B(h){return h===A.selectedNode.value||h.state.powered}const K=I(()=>A.types.mine.nodes.value[0]),le=I(()=>A.types.factory.nodes.value[0]),Se=I(()=>i.value.sand),Te=I(()=>i.value.wood),V=I(()=>i.value.coal),ge=I(()=>i.value.iron);function Pe(h,d){let k=n.value[h];if(d=o.times(d,St[h].computedModifier.value),k==null)k={id:Tn(A),position:{...K.value.position},type:"resource",state:{type:h,amount:d}},A.placeInAvailableSpace(k),A.nodes.value.push(k);else{const $=k.state;k.state={...$,amount:o.add($.amount,d)}}}const Be=I(()=>Object.keys(He).reduce((h,d)=>h+new o(Fe[d].computedModifier.value).toNumber(),0)),lt=I(()=>{const h={};return A.types.portal.nodes.value.forEach(d=>{if(!B(d))return;const $=we[d.state.id].resourceMultis.value;Object.keys($).forEach(O=>{h[O]!=null?h[O]=o.times(h[O],$[O]):h[O]=$[O]})}),h}),Xe=jt(()=>[...Et.map(h=>mt(()=>({description:()=>`${tt(h)} (Lv. ${Ge(a.value[h])}) (${Ht(Z.value)}x per level)`,multiplier:()=>o.pow(Z.value,a.value[h]),enabled:()=>{var d,k;return h in n.value&&o.gt((k=(d=n.value[h].state)==null?void 0:d.amount)!=null?k:0,0)}}))),mt(()=>({multiplier:()=>V.value!=null&&B(V.value)&&V.value.state.tools.includes("stone")?4:2,description:()=>(V.value!=null&&B(V.value)&&V.value.state.tools.includes("stone")?"Empowered ":"")+Ee.stone.name,enabled:()=>i.value.stone!=null})),mt(()=>({multiplier:()=>{var h;return(h=lt.value.energy)!=null?h:1},description:"Planar Treasures",enabled:()=>{var h;return o.neq((h=lt.value.energy)!=null?h:1,1)}})),bn(()=>({addend:()=>o.pow(100,f.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(f.value,0)}))]),dn=I(()=>Xe.apply(1)),Mn=jt(()=>[mt(()=>({multiplier:()=>V.value!=null&&B(V.value)&&V.value.state.tools.includes("dirt")?4:2,description:()=>(V.value!=null&&B(V.value)&&V.value.state.tools.includes("dirt")?"Empowered ":"")+Ee.dirt.name,enabled:()=>i.value.dirt!=null}))]),Hn=I(()=>Mn.apply(1)),yt=jt(()=>[mt(()=>({multiplier:()=>V.value!=null&&B(V.value)&&V.value.state.tools.includes("gravel")?4:2,description:()=>(V.value!=null&&B(V.value)&&V.value.state.tools.includes("gravel")?"Empowered ":"")+Ee.gravel.name,enabled:()=>i.value.gravel!=null}))]),Sn=I(()=>yt.apply(1)),G=jt(()=>[bn(()=>({addend:()=>V.value!=null&&B(V.value)&&V.value.state.tools.includes("copper")?.002:.001,description:()=>(V.value!=null&&B(V.value)&&V.value.state.tools.includes("copper")?"Empowered ":"")+Ee.copper.name,enabled:()=>i.value.copper!=null}))]),Z=I(()=>G.apply(1.01)),Fe=Object.keys(He).reduce((h,d)=>{const k=jt(()=>[mt(()=>({multiplier:2,description:"Dowsing",enabled:()=>Se.value!=null&&B(Se.value)&&Se.value.state.resources.includes(d)}))]),$=I(()=>k.apply(He[d])),O={title:`${tt(d)} Drop Rate`,modifier:k,base:He[d]};return h[d]={modifier:k,computedModifier:$,section:O},h},{}),St=Object.keys(He).reduce((h,d)=>{const k=jt(()=>[mt(()=>({multiplier:()=>{var W;return(W=lt.value[d])!=null?W:1},description:"Planar Treasures",enabled:()=>{var W;return o.neq((W=lt.value[d])!=null?W:1,1)}}))]),$=I(()=>k.apply(1)),O={title:`${tt(d)} Gain`,modifier:k};return h[d]={modifier:k,computedModifier:$,section:O},h},{}),[qt,je]=hn(()=>[{title:"Energy Gain",modifier:Xe,base:1,unit:"/s"}]),[Qt,It]=hn(()=>[{title:"Mining Speed",modifier:Mn,base:1,unit:"/s",visible:()=>i.value.dirt!=null},{title:"Ore Dropped",modifier:yt,base:1,visible:()=>i.value.gravel!=null},{title:"Material Level Effect",modifier:G,base:1.01,visible:()=>i.value.copper!=null}]),[In,ze]=hn(()=>Object.values(Fe).map(h=>h.section)),[fn,Vt]=hn(()=>Object.values(St).map(h=>h.section)),$t=Dl({general:()=>({display:"Energy",glowColor(){return $t.activeTab.value===this.tab?"white":""},tab:qt,energyTabCollapsed:je}),mining:()=>({display:"Mine",glowColor(){return $t.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(i.value).length>0,tab:Qt,miningTabCollapsed:It}),resources:()=>({display:"Mine Rates",glowColor(){return $t.activeTab.value===this.tab?"white":""},visibility:()=>Se.value!=null,tab:In,resourcesCollapsed:ze}),resourcesGain:()=>({display:"Resource Gain",glowColor(){return $t.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(St).some(h=>o.neq(h.computedModifier.value,1)),tab:fn,resourceGainCollapsed:Vt})}),Rt=z(!1),en=ne(()=>p(kt,{modelValue:Rt.value,"onUpdate:modelValue":h=>Rt.value=h},{header:()=>p("h2",null,[q("Modifiers")]),body:()=>Ze($t)}));this.on("preUpdate",h=>{if(Object.keys(l).forEach(d=>{l[d]-=h,l[d]<=0&&delete l[d]}),Object.keys(c).forEach(d=>{c[d]-=h,c[d]<=0&&delete c[d]}),B(K.value)){const d=o.add(K.value.state.progress,o.times(Hn.value,h)),k=d.floor();K.value.state={...K.value.state,progress:o.sub(d,k)};const $=k.div(Be.value).floor();$.gt(0)&&Et.forEach(W=>{Pe(W,o.times(new o(Fe[W].computedModifier.value).toNumber(),$).times(Sn.value)),l[W]=.3});const O=o.sub(k,$).toNumber();for(let W=0;W0){let $=o.add(d,h);const O=o.div(d,g.value).floor();$=o.sub($,o.times(O,g.value)),Te.value.state={...Te.value.state,progress:$},o.gt(O,0)&&k.forEach(W=>{Pe(W,O),c[W]=.3})}}e.value=o.add(e.value,o.times(dn.value,h)),o.lt(e.value,0)&&(e.value=0,K.value.state={...K.value.state,powered:!1},Ii.warning(p("div",null,[p("h3",null,[q("Ran out of energy!")]),p("div",null,[q("All machines have been turned off.")])])))});const $n=I(()=>{var h,d;return A.selectedAction.value===A.types.brokenFactory.actions[0]?-100:A.selectedAction.value===A.types.factory.actions[1]?o.neg(Ee[A.selectedNode.value.state].cost):((h=A.selectedAction.value)==null?void 0:h.id)==="moreConnections"?o.neg(A.selectedAction.value.formula.evaluate(((d=A.selectedNode.value)==null?void 0:d.state).maxConnections)):0}),De=Vn(m.variable(0).add(e),()=>o.neq($n.value,0),$n),ut=I(()=>{var h;return A.selectedAction.value===N?((h=A.selectedNode.value)==null?void 0:h.state).powered?o.eq(f.value,1)?10:o.pow(100,f.value).div(10).times(.99):o.neg(v.value):0}),Ie=Vn(m.variable(0).add(dn),()=>o.neq(ut.value,0),ut),Ue=I(()=>A.types.portal.nodes.value.filter(h=>B(h)));return st(Ue,h=>{Nt(()=>{X.tabs=["main",...h.map(d=>d.state.id)]})}),{name:"World",board:A,energy:e,modifierTabs:$t,mineLootTable:He,tools:Ee,passives:$i,resourceNodes:n,toolNodes:i,influenceNodes:r,grantResource:Pe,activePortals:Ue,display:ne(()=>p(se,null,[p(qn,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[Ze(De)])," ",q("energy")]),p("span",{class:"nav-segment"},[q("("),p("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt(dn.value,0)?"+":"",Ze(Ie)]),q("/s)")]),o.gt(f.value,0)?p("span",{class:"nav-segment"},[p("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[Ge(f.value)])," ",q("machines powered")]):null,p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>Rt.value=!0},[q("modifiers")])]),X.devSpeed===0?p("span",{class:"nav-segment"},[q("Game Paused")]):X.devSpeed!=null&&X.devSpeed!==1?p("span",{class:"nav-segment"},[q("Dev Speed: "),Ht(X.devSpeed),q("x")]):null]}),Ze(A),Ze(en)]))}}),jc=e=>{var i,r,a,u,l;const t=[Re];let n=0;for(;`portal-${n}`in((i=e.layers)!=null?i:{});){const c=(r=e.layers)==null?void 0:r[`portal-${n}`];t.push(nr(`portal-${n}`,(a=c.tier)!=null?a:"dirt",(u=c.seed)!=null?u:Math.floor(Math.random()*4294967296),(l=c.influences)!=null?l:[])),n++}return t},ir=I(()=>!1);function zc(e,t){}var Uc=Object.freeze(Object.defineProperty({__proto__:null,mineLootTable:He,resourceNames:Et,influences:Wt,main:Re,getInitialLayers:jc,hasWon:ir,fixOldSave:zc},Symbol.toStringTag,{value:"Module"}));const kn=e=>(Jt("data-v-4a50ce42"),e=e(),Kt(),e),Gc={class:"game-over-modal-header"},Wc=["src","alt"],Hc={class:"game-over-modal-title"},Zc=kn(()=>C("h2",null,"Congratulations!",-1)),Yc={key:0},Jc=kn(()=>C("br",null,null,-1)),Kc=kn(()=>C("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Xc=kn(()=>C("br",null,null,-1)),Qc=["href"],ed=kn(()=>C("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),td=Q({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:a,versionTitle:u}=de,l=I(()=>Bn(X.timePlayed)),c=I(()=>ir.value&&!X.keepGoing),f=At(X,"autosave");function v(){X.keepGoing=!0}function g(){zt(rn())}return(y,N)=>(S(),te(kt,{"model-value":s(c)},{header:H(()=>[C("div",Gc,[s(n)?(S(),D("img",{key:0,class:"game-over-modal-logo",src:s(n),alt:s(t)},null,8,Wc)):U("",!0),C("div",Hc,[Zc,C("h4",null,"You've beaten "+ie(s(t))+" v"+ie(s(a))+": "+ie(s(u)),1)])])]),body:H(({shown:w})=>[w?(S(),D("div",Yc,[C("div",null,"It took you "+ie(s(l))+" to beat the game.",1),Jc,Kc,Xc,C("div",null,[C("a",{href:s(r),class:"game-over-modal-discord-link"},[ed,q(" "+ie(s(i)),1)],8,Qc)]),p(wt,{title:"Autosave",modelValue:s(f),"onUpdate:modelValue":N[0]||(N[0]=_=>Me(f)?f.value=_:null)},null,8,["modelValue"])])):U("",!0)]),footer:H(()=>[C("div",{class:"game-over-footer"},[C("button",{onClick:v,class:"button"},"Keep Going"),C("button",{onClick:g,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var nd=fe(td,[["__scopeId","data-v-4a50ce42"]]);const Wn=e=>(Jt("data-v-2776d67d"),e=e(),Kt(),e),id=Wn(()=>C("div",{class:"nan-modal-header"},[C("h2",null,"NaN value detected!")],-1)),rd={key:0},ad=Wn(()=>C("br",null,null,-1)),sd=["href"],od=Wn(()=>C("span",{class:"material-icons nan-modal-discord"},"discord",-1)),ld=Wn(()=>C("br",null,null,-1)),ud={class:"nan-footer"},cd=Q({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=de,i=z(!0),r=z(!0),a=At($e,"hasNaN"),u=z(null);st(a,y=>{y?(i.value=X.autosave,r.value=X.devSpeed===0):(X.autosave=i.value,X.devSpeed=r.value?0:null)});const l=I(()=>{var y;return(y=$e.NaNPath)==null?void 0:y.join(".")}),c=I(()=>$e.NaNPersistent!=null?$e.NaNPersistent.value:null);function f(){$e.NaNPersistent!=null&&($e.NaNPersistent.value=new o(0),$e.hasNaN=!1)}function v(){$e.NaNPersistent&&($e.NaNPersistent.value=new o(1),$e.hasNaN=!1)}function g(){$e.NaNPersistent&&($e.NaNPersistent.value=new o(NaN),$e.hasNaN=!1)}return(y,N)=>(S(),D(se,null,[p(kt,Ct({modelValue:s(a),"onUpdate:modelValue":N[4]||(N[4]=w=>Me(a)?a.value=w:null)},y.$attrs),{header:H(()=>[id]),body:H(()=>[C("div",null,[q(' Attempted to assign "'+ie(s(l))+'" to NaN',1),s(c)?(S(),D("span",rd,ie(" ")+"(previously "+ie(s(Ht)(s(c)))+")",1)):U("",!0),q(". Auto-saving has been "+ie(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),ad,C("div",null,[C("a",{href:s(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[od,q(" "+ie(s(t)||"The Paper Pilot Community"),1)],8,sd)]),ld,p(wt,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=w=>i.value=w)},null,8,["modelValue"]),s(de).enablePausing?(S(),te(wt,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":N[1]||(N[1]=w=>r.value=w)},null,8,["modelValue"])):U("",!0)]),footer:H(()=>[C("div",ud,[C("button",{onClick:N[2]||(N[2]=w=>{var _;return(_=u.value)==null?void 0:_.open()}),class:"button"},"Open Saves Manager"),C("button",{onClick:f,class:"button"},"Set to 0"),C("button",{onClick:v,class:"button"},"Set to 1"),s(c)&&s(o).neq(s(c),0)&&s(o).neq(s(c),1)?(S(),D("button",{key:0,onClick:N[3]||(N[3]=w=>a.value=!1),class:"button"}," Set to previous ")):U("",!0),C("button",{onClick:g,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),p(Zi,{ref_key:"savesManager",ref:u},null,512)],64))}});var dd=fe(cd,[["__scopeId","data-v-2776d67d"]]);const fd={key:0,class:"tpsDisplay"},gd={key:0,class:"low"},pd=Q({__name:"TPS",setup(e){const t=I(()=>o.div($e.lastTenTicks.length,$e.lastTenTicks.reduce((a,u)=>a+u,0))),n=z([]);nt(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=I(()=>n.value.reduce((a,u)=>o.max(a,u),0)),r=I(()=>o.sub(t.value,i.value).gt(1));return(a,u)=>s(t).isNan()?U("",!0):(S(),D("div",fd,[q(" TPS: "+ie(s(Ge)(s(t)))+" ",1),p(sn,{name:"fade"},{default:H(()=>[s(r)?(S(),D("span",gd,ie(s(Ge)(s(i))),1)):U("",!0)]),_:1})]))}});var md=fe(pd,[["__scopeId","data-v-46a3ed5b"]]);var vd=Q({__name:"App",setup(e){const t=de.useHeader,n=I(()=>dt[re.theme].variables),i=At(re,"showTPS"),r=I(()=>ae(ne(()=>p(se,null,[$a.map(Ze)]))));return(a,u)=>(S(),D(se,null,[C("div",{id:"modal-root",style:qe(s(n))},null,4),C("div",{class:pe(["app",{useHeader:s(t)}]),style:qe(s(n))},[s(t)?(S(),te(Yi,{key:0})):U("",!0),p(Go),s(s(i))?(S(),te(md,{key:1})):U("",!0),p(nd),p(dd),(S(),te(Oe(s(r))))],6)],64))}});var hd=fe(vd,[["__scopeId","data-v-41d15e5e"]]);function bd(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:u}=e;let l,c,f,v;const g=async(N=!0)=>{await f,N&&(l==null||l.addEventListener("controlling",w=>{w.isUpdate&&window.location.reload()})),await(v==null?void 0:v())};async function y(){if("serviceWorker"in navigator){const{Workbox:N,messageSW:w}=await yn(()=>import("./workbox-window.4a8794bb.js"),[]);v=async()=>{c&&c.waiting&&await w(c.waiting,{type:"SKIP_WAITING"})},l=new N("./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 f=y(),g}function yd(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:u}=e,l=z(!1),c=z(!1);return{updateServiceWorker:bd({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=de.title;window.projInfo=de;if(de.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 Na();const{globalBus:e}=await yn(()=>Promise.resolve().then(function(){return wa}),void 0),{startGameLoop:t}=await yn(()=>import("./gameLoop.09343c26.js"),["assets/gameLoop.09343c26.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","assets/unique-names-generator.5494b30b.js"]),n=window.vue=gr(hd);e.emit("setupVue",n),n.mount("#app"),Nt(()=>{const i=Ln(),{updateServiceWorker:r}=yd({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,yn as _,$e as a,de as b,Uc as c,Ve as g,Ca as l,X as p,re as s}; + )`,onMousedown:E=>c(E,y),onTouchstart:E=>c(E,y),onMouseup:E=>f(E,y),onTouchend:an(E=>f(E,y),["stop"])},[C("circle",{fill:s(ce)(y.fillColor,e.node),r:"20","stroke-width":((_=e.selectedAction)==null?void 0:_.id)===y.id?4:0,stroke:s(a)},null,8,Xo),C("text",{fill:s(u),class:"material-icons"},ie(s(ce)(y.icon,e.node)),9,Qo)],42,Ko)}),128))])):U("",!0)]),_:1}))}});var tl=fe(el,[["__scopeId","data-v-9efb2a56"]]);const nl=["transform"],il={key:0},rl=["r","fill","stroke"],al=["r","fill","stroke"],sl=["r","fill"],ol=["r","stroke-dasharray","stroke-dashoffset","stroke"],ll={key:1,transform:"rotate(45, 0, 0)"},ul=["width","height","transform","fill","stroke"],cl=["width","height","transform","fill","stroke"],dl=["width","height","transform","fill"],fl=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],gl=["fill","y"],pl=["fill"],ml={key:0},vl=["fill","y"],hl=["fill","y"],bl=Q({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},selectedNode:null,selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,i=Math.sqrt(2),r=ke(n),a=I(()=>s(r.selectedNode)===s(r.node)),u=I(()=>ce(r.nodeType.value.draggable,s(r.node)));st(u,V=>{const ge=s(r.node);s(r.dragging)===ge&&!V&&t("endDragging",ge)});const l=I(()=>{var ge;const V=s(r.node);return(ge=ce(r.nodeType.value.actions,V))==null?void 0:ge.filter(Pe=>ot(ce(Pe.visibility,V)))}),c=I(()=>{var ge;const V=s(r.node);if(ce(r.nodeType.value.draggable,V)&&((ge=s(r.dragging))==null?void 0:ge.id)===V.id&&s(r.dragged)!=null){const{x:Pe,y:Be}=s(r.dragged);return{x:V.position.x+Math.round(Pe/25)*25,y:V.position.y+Math.round(Be/25)*25}}return V.position}),f=I(()=>ce(r.nodeType.value.shape,s(r.node))),v=I(()=>ce(r.nodeType.value.title,s(r.node))),g=I(()=>ce(r.nodeType.value.subtitle,s(r.node))),y=I(()=>{var V;return(V=a.value?s(r.selectedAction)&&ce(s(r.selectedAction).tooltip,s(r.node)):null)!=null?V:ce(r.nodeType.value.label,s(r.node))}),N=I(()=>{var V,ge;return ce((ge=(V=s(r.selectedAction))==null?void 0:V.confirmationLabel)!=null?ge:{text:"Tap again to confirm"},s(r.node))}),w=I(()=>ce(r.nodeType.value.size,s(r.node))),_=I(()=>{var V;return(V=ce(r.nodeType.value.progress,s(r.node)))!=null?V:0}),E=I(()=>dt[re.theme].variables["--background"]),R=I(()=>{var V;return(V=ce(r.nodeType.value.outlineColor,s(r.node)))!=null?V:dt[re.theme].variables["--outline"]}),$=I(()=>{var V;return(V=ce(r.nodeType.value.fillColor,s(r.node)))!=null?V:dt[re.theme].variables["--raised-background"]}),T=I(()=>ce(r.nodeType.value.progressColor,s(r.node))),L=I(()=>{var V;return(V=ce(r.nodeType.value.titleColor,s(r.node)))!=null?V:dt[re.theme].variables["--foreground"]}),A=I(()=>ce(r.nodeType.value.progressDisplay,s(r.node))),B=I(()=>r.dragging.value!=null&&s(r.hasDragged)&&ce(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),K=I(()=>ce(r.nodeType.value.style,s(r.node))),le=I(()=>ce(r.nodeType.value.classes,s(r.node)));function Se(V){t("mouseDown",V,r.node.value,u.value)}function Te(V){var ge,Pe,Be;(ge=r.hasDragged)!=null&&ge.value||(t("endDragging",r.node.value),(Be=(Pe=r.nodeType.value).onClick)==null||Be.call(Pe,r.node.value),V.stopPropagation())}return(V,ge)=>{var Pe,Be,lt;return S(),D("g",{class:pe(["boardnode",{[e.node.type]:!0,isSelected:s(a),isDraggable:s(u),...s(le)}]),style:qe([{opacity:((Pe=e.dragging)==null?void 0:Pe.id)===e.node.id&&e.hasDragged?.5:1},(Be=s(K))!=null?Be:[]]),transform:`translate(${s(c).x},${s(c).y})${s(a)?" scale(1.2)":""}`},[p(tl,{actions:(lt=s(l))!=null?lt:[],"is-selected":s(a),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:ge[0]||(ge[0]=Xe=>t("clickAction",Xe))},null,8,["actions","is-selected","node","node-type","selected-action"]),C("g",{class:"node-container",onMousedown:Se,onTouchstartPassive:Se,onMouseup:Te,onTouchendPassive:Te},[s(f)===s(Ae).Circle?(S(),D("g",il,[s(B)?(S(),D("circle",{key:0,class:"receiver",r:s(w)+8,fill:s(E),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,rl)):U("",!0),C("circle",{class:"body",r:s(w),fill:s($),stroke:s(R),"stroke-width":4},null,8,al),s(A)===s(Wt).Fill?(S(),D("circle",{key:1,class:"progress progressFill",r:Math.max(s(w)*s(_)-2,0),fill:s(T)},null,8,sl)):(S(),D("circle",{key:2,r:s(w)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(s(w)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(s(w)+4.5)*2*Math.PI-s(_)*(s(w)+4.5)*2*Math.PI,stroke:s(T)},null,8,ol))])):s(f)===s(Ae).Diamond?(S(),D("g",ll,[s(B)?(S(),D("rect",{key:0,class:"receiver",width:s(w)*s(i)+16,height:s(w)*s(i)+16,transform:`translate(${-(s(w)*s(i)+16)/2}, ${-(s(w)*s(i)+16)/2})`,fill:s(E),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,ul)):U("",!0),C("rect",{class:"body",width:s(w)*s(i),height:s(w)*s(i),transform:`translate(${-s(w)*s(i)/2}, ${-s(w)*s(i)/2})`,fill:s($),stroke:s(R),"stroke-width":4},null,8,cl),s(A)===s(Wt).Fill?(S(),D("rect",{key:1,class:"progress progressFill",width:Math.max(s(w)*s(i)*s(_)-2,0),height:Math.max(s(w)*s(i)*s(_)-2,0),transform:`translate(${-Math.max(s(w)*s(i)*s(_)-2,0)/2}, ${-Math.max(s(w)*s(i)*s(_)-2,0)/2})`,fill:s(T)},null,8,dl)):(S(),D("rect",{key:2,class:"progress progressDiamond",width:s(w)*s(i)+9,height:s(w)*s(i)+9,transform:`translate(${-(s(w)*s(i)+9)/2}, ${-(s(w)*s(i)+9)/2})`,fill:"transparent","stroke-dasharray":(s(w)*s(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(s(w)*s(i)+9)*4-s(_)*(s(w)*s(i)+9)*4,stroke:s(T)},null,8,fl))])):U("",!0),C("text",{fill:s(L),class:"node-title",y:s(g)?10:0},ie(s(v)),9,gl),s(g)?(S(),D("text",{key:2,fill:s(L),class:"node-subtitle",y:"-15"},ie(s(g)),9,pl)):U("",!0)],32),p(sn,{name:"fade",appear:""},{default:Z(()=>{var Xe;return[s(y)?(S(),D("g",ml,[C("text",{fill:(Xe=s(y).color)!=null?Xe:s(L),class:pe(["node-title",{pulsing:s(y).pulsing}]),y:-s(w)-20},ie(s(y).text),11,vl)])):U("",!0)]}),_:1}),p(sn,{name:"fade",appear:""},{default:Z(()=>{var Xe;return[s(a)&&e.selectedAction?(S(),D("text",{key:0,fill:(Xe=s(N).color)!=null?Xe:s(L),class:pe(["node-title",{pulsing:s(N).pulsing}]),y:s(w)+75},ie(s(N).text),11,hl)):U("",!0)]}),_:1})],14,nl)}}});var yl=fe(bl,[["__scopeId","data-v-4654be02"]]);const wl={class:"stage",width:"100%",height:"100%"},_l={class:"g1"},Nl=Q({__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=ke(e),i=z({x:0,y:0}),r=z({x:0,y:0}),a=z(!1),u=z(null),l=I(()=>{const N=n.nodes.value.slice();if(n.draggingNode.value){const w=N.splice(N.indexOf(n.draggingNode.value),1)[0];N.push(w)}return N});nt(()=>{const N=n.draggingNode.value;if(N==null)return null;const w={x:N.position.x+r.value.x,y:N.position.y+r.value.y};let _=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((E,R)=>{if(R.id===N.id)return E;const $=n.types.value[R.type];if(!ce($.canAccept,R,N))return E;const L=Math.pow(w.x-R.position.x,2)+Math.pow(w.y-R.position.y,2);let A=ce($.size,R);return L>_||L>A*A?E:(_=L,R)},null))});function c(N){N.setTransformOrigin(null),N.moveTo(u.value.$el.clientWidth/2,u.value.$el.clientHeight/2)}function f(N,w=null,_=!1){if(n.draggingNode.value==null){N.preventDefault(),N.stopPropagation();let E,R;if("touches"in N)if(N.touches.length===1)E=N.touches[0].clientX,R=N.touches[0].clientY;else return;else E=N.clientX,R=N.clientY;i.value={x:E,y:R},r.value={x:0,y:0},a.value=!1,_&&n.setDraggingNode.value(w)}w!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function v(N){const{x:w,y:_,scale:E}=u.value.panZoomInstance.getTransform();let R,$;if("touches"in N)if(N.touches.length===1)R=N.touches[0].clientX,$=N.touches[0].clientY;else{g(n.draggingNode.value),n.mousePosition.value=null;return}else R=N.clientX,$=N.clientY;n.mousePosition.value={x:(R-w)/E,y:($-_)/E},r.value={x:r.value.x+(R-i.value.x)/E,y:r.value.y+($-i.value.y)/E},i.value={x:R,y:$},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(a.value=!0),n.draggingNode.value!=null&&(N.preventDefault(),N.stopPropagation())}function g(N,w=!1){var _,E;if(n.draggingNode.value!=null&&n.draggingNode.value===N){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 R=n.nodes.value;R.push(R.splice(R.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((E=(_=n.types.value[n.receivingNode.value.type]).onDrop)==null||E.call(_,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!a.value&&!w&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function y(N,w){n.state.value.selectedAction===w?s(n.selectedAction).onClick(s(n.selectedNode)):n.state.value={...n.state.value,selectedAction:w}}return(N,w)=>{const _=bt("panZoom");return s(ot)(e.visibility)?(S(),te(_,{key:0,style:qe([{width:e.width,height:e.height},e.style]),class:pe(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:w[0]||(w[0]=E=>f(E)),onTouchstart:w[1]||(w[1]=E=>f(E)),onMouseup:w[2]||(w[2]=()=>g(s(e.draggingNode))),onTouchendPassive:w[3]||(w[3]=()=>g(s(e.draggingNode))),onMouseleave:w[4]||(w[4]=()=>g(s(e.draggingNode),!0))},{default:Z(()=>[(S(),D("svg",wl,[C("g",_l,[p(fi,{name:"link",appear:""},{default:Z(()=>[(S(!0),D(se,null,on(s(e.links)||[],E=>(S(),D("g",{key:`${E.startNode.id}-${E.endNode.id}`},[p(Yo,{link:E},null,8,["link"])]))),128))]),_:1}),p(fi,{name:"grow",duration:500,appear:""},{default:Z(()=>[(S(!0),D(se,null,on(s(l),E=>{var R;return S(),D("g",{key:E.id,style:{"transition-duration":"0s"}},[p(yl,{node:E,nodeType:e.types[E.type],dragging:s(e.draggingNode),dragged:s(e.draggingNode)===E?r.value:void 0,hasDragged:a.value,receivingNode:((R=s(e.receivingNode))==null?void 0:R.id)===E.id,selectedNode:s(e.selectedNode),selectedAction:s(e.selectedAction),onMouseDown:f,onEndDragging:g,onClickAction:$=>y(E,$)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","selectedNode","selectedAction","onClickAction"])])}),128))]),_:1})])]))]),_:1},8,["style","class","options"])):U("",!0)}}});Ve.on("setupVue",e=>hr.install(e));const Ji=Symbol("Board");var Wt=(e=>(e.Outline="Outline",e.Fill="Fill",e))(Wt||{}),Ae=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(Ae||{});function Cl(e){const t=at({nodes:[],selectedNode:null,selectedAction:null},!1);return Je(n=>{const i=e.call(n,n);i.id=Nn("board-"),i.type=Ji,i[ft]=Nl,i.state?(zi(t),F(i,"state")):(t[ln]={nodes:i.startNodes().map((l,c)=>(l.id=c,l)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=I(()=>s(u.state).nodes),i.selectedNode=I({get(){return u.nodes.value.find(l=>l.id===s(u.state).selectedNode)||null},set(l){var c,f;Me(u.state)?u.state.value={...u.state.value,selectedNode:(c=l==null?void 0:l.id)!=null?c:null}:u.state.selectedNode=(f=l==null?void 0:l.id)!=null?f:null}}),i.selectedAction=I({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(f=>f.id===s(u.state).selectedAction)||null},set(l){var c,f;Me(u.state)?u.state.value={...u.state.value,selectedAction:(c=l==null?void 0:l.id)!=null?c:null}:u.state.selectedAction=(f=l==null?void 0:l.id)!=null?f:null}}),i.mousePosition=z(null),i.links?F(i,"links"):i.links=I(()=>u.selectedAction.value==null?null:u.selectedAction.value.links&&u.selectedNode.value?ce(u.selectedAction.value.links,u.selectedNode.value):null),i.draggingNode=z(null),i.receivingNode=z(null),F(i,"visibility"),oe(i,"visibility",_e.Visible),F(i,"width"),oe(i,"width","100%"),F(i,"height"),oe(i,"height","100%"),F(i,"classes"),F(i,"style");for(const l in i.types){const c=i.types[l];if(F(c,"title"),F(c,"subtitle"),F(c,"label"),F(c,"size"),oe(c,"size",50),F(c,"style"),F(c,"classes"),F(c,"draggable"),oe(c,"draggable",!1),F(c,"shape"),oe(c,"shape","Circle"),F(c,"canAccept"),oe(c,"canAccept",!1),F(c,"progress"),F(c,"progressDisplay"),oe(c,"progressDisplay","Fill"),F(c,"progressColor"),oe(c,"progressColor","none"),F(c,"fillColor"),F(c,"outlineColor"),F(c,"titleColor"),F(c,"actionDistance"),oe(c,"actionDistance",Math.PI/6),c.nodes=I(()=>s(u.state).nodes.filter(f=>f.type===l)),oe(c,"onClick",function(f){s(u.state).selectedNode=f.id}),c.actions)for(const f of c.actions)F(f,"visibility"),oe(f,"visibility",_e.Visible),F(f,"icon"),F(f,"fillColor"),F(f,"tooltip"),F(f,"confirmationLabel"),oe(f,"confirmationLabel",{text:"Tap again to confirm"}),F(f,"links")}function r(l){i.draggingNode.value=l}function a(l){i.receivingNode.value=l}i.placeInAvailableSpace=function(l,c=100,f=J.Right){const v=u.nodes.value.slice().filter(g=>g===l||(f===J.Down||f===J.Up)&&Math.abs(g.position.x-l.position.x)>c||(f===J.Left||f===J.Right)&&Math.abs(g.position.y-l.position.y)>c?!1:!(f===J.Right&&g.position.xl.position.x+c||f===J.Up&&g.position.y>l.position.y+c||f===J.Down&&g.position.yg.position.x-y.position.x:f===J.Left?(g,y)=>y.position.x-g.position.x:f===J.Up?(g,y)=>y.position.y-g.position.y:(g,y)=>g.position.y-y.position.y);for(let g=0;g0&&N>c)break}},i[it]=function(){const{nodes:l,types:c,state:f,visibility:v,width:g,height:y,style:N,classes:w,links:_,selectedAction:E,selectedNode:R,mousePosition:$,draggingNode:T,receivingNode:L}=this;return{nodes:l,types:c,state:f,visibility:v,width:g,height:y,style:s(N),classes:w,links:_,selectedAction:E,selectedNode:R,mousePosition:$,draggingNode:T,receivingNode:L,setDraggingNode:r,setReceivingNode:a}};const u=i;return u})}function ce(e,t,...n){return Fn(e)?e(t,...n):s(e)}function Tn(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const mn={};Ve.on("addLayer",e=>{const t=ya(e,Ji);mn[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)}))})})});Ve.on("removeLayer",e=>{var t;(t=mn[e.id])==null||t.call(mn),mn[e.id]=void 0});function Ki(e,t="points",n=0,i=void 0){const r=Me(e)?e:at(e);if(r.displayName=t,r.precision=n,r.small=i,!Me(e)){const a=r[vt];a.displayName=t,a.precision=n,a.small=i}return r}new o("10^^8");new o("1e100");function wi(e,t){const n=t!=null?t:e.value;return o.eq(e.precision,0)?Ge(e.small?n:o.floor(n)):Ht(n,e.precision,e.small)}Ve.on("setupVue",e=>e.use(br));function kl(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 Ml=Q({props:{visibility:{type:j(Number,Boolean),required:!0},display:{type:j(Object,String,Function),required:!0},style:j(String,Object,Array),classes:j(Object),glowColor:j(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=ke(e),a=Bi(n),u=I(()=>{const c=$e(i);return c==null||c===""?{}:s(r)?kl(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function l(){t("selectTab")}return{selectTab:l,component:a,glowColorStyle:u,unref:s,Visibility:_e,isVisible:ot,isHidden:un}}});function Sl(e,t,n,i,r,a){var u;return e.isVisible(e.visibility)?(S(),D("button",{key:0,onClick:t[0]||(t[0]=(...l)=>e.selectTab&&e.selectTab(...l)),class:pe(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:qe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(u=e.unref(e.style))!=null?u:{}])},[(S(),te(Oe(e.component)))],6)):U("",!0)}var Xi=fe(Ml,[["render",Sl],["__scopeId","data-v-21427abb"]]);const Il=Q({props:{visibility:{type:j(Number,Boolean),required:!0},activeTab:{type:j(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:j(Object),required:!0},style:j(String,Object,Array),classes:j(Object),buttonContainerStyle:j(String,Object,Array),buttonContainerClasses:j(Object)},components:{Sticky:qn,TabButton:Xi},setup(e){const{activeTab:t}=ke(e),n=I(()=>dt[re.theme].floatingTabs),i=Ye("");nt(()=>{const l=$e(t);if(l==null){i.value="";return}if(gt(l)){i.value=ae(l);return}i.value=ae(s(l.display))});const r=I(()=>{const l=$e(t);return gt(l)||!l?void 0:s(l.classes)}),a=I(()=>{const l=$e(t);return gt(l)||!l?void 0:s(l.style)});function u(l){const{display:c,style:f,classes:v,glowColor:g,visibility:y}=l;return{display:c,style:s(f),classes:v,glowColor:g,visibility:y}}return{floating:n,tabClasses:r,tabStyle:a,Visibility:_e,component:i,gatherButtonProps:u,unref:s,isVisible:ot,isHidden:un}}});function xl(e,t,n,i,r,a){var c,f;const u=bt("TabButton"),l=bt("Sticky");return e.isVisible(e.visibility)?(S(),D("div",{key:0,class:pe(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:qe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(f=e.tabStyle)!=null?f:[]])},[p(l,{class:pe(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:qe(e.unref(e.buttonContainerStyle))},{default:Z(()=>[C("div",{class:pe(["tab-buttons",{floating:e.floating}])},[(S(!0),D(se,null,on(e.unref(e.tabs),(v,g)=>(S(),te(u,Ct({onSelectTab:y=>e.selected.value=g,floating:e.floating,key:g,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)?(S(),te(Oe(e.unref(e.component)),{key:0})):U("",!0)],6)):U("",!0)}var $l=fe(Il,[["render",xl],["__scopeId","data-v-58dbf83a"]]);const El=Symbol("TabButton"),Tl=Symbol("TabFamily");function Dl(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=at(Object.keys(e)[0],!1);return Je(i=>{var u;const r=(u=t==null?void 0:t.call(i,i))!=null?u:{};r.id=Nn("tabFamily-"),r.type=Tl,r[ft]=$l,r.tabs=Object.keys(e).reduce((l,c)=>{const f=e[c]();return f.type=El,f[ft]=Xi,F(f,"visibility"),oe(f,"visibility",_e.Visible),F(f,"tab"),F(f,"display"),F(f,"classes"),F(f,"style"),F(f,"glowColor"),l[c]=f,l},{}),r.selected=n,r.activeTab=I(()=>{const l=s(a.tabs);if(n.value in l&&ot(l[n.value].visibility))return s(l[n.value].tab);const c=Object.values(l).find(f=>ot(f.visibility));return c?s(c.tab):null}),F(r,"visibility"),oe(r,"visibility",_e.Visible),F(r,"classes"),F(r,"style"),F(r,"buttonContainerClasses"),F(r,"buttonContainerStyle"),r[it]=function(){const{visibility:l,activeTab:c,selected:f,tabs:v,style:g,classes:y,buttonContainerClasses:N,buttonContainerStyle:w}=this;return{visibility:l,activeTab:c,selected:f,tabs:v,style:s(g),classes:y,buttonContainerClasses:N,buttonContainerStyle:w}};const a=r;return a})}const Qi=o.ln(10);function vn(e){return e}function Pl(e,t){if(P(t))return t.invert(o.neg(e));throw new Error("Could not invert due to no input being a variable")}function Fl(e,t){if(P(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 Ol(e){return m.neg(e)}function Al(e,t,n){if(P(t))return t.invert(o.sub(e,be(n)));if(P(n))return n.invert(o.sub(e,be(t)));throw new Error("Could not invert due to no input being a variable")}function ql(e,t,n){var i,r;if(P(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(P(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 Vl(e,t,n){if(P(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(P(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 Rl(e,t,n){if(P(t))return t.invert(o.add(e,be(n)));if(P(n))return n.invert(o.sub(be(t),e));throw new Error("Could not invert due to no input being a variable")}function Ll(e,t,n){var i,r;if(P(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(P(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 Bl(e,t,n){if(P(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(P(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 jl(e,t,n){if(P(t))return t.invert(o.div(e,be(n)));if(P(n))return n.invert(o.div(e,be(t)));throw new Error("Could not invert due to no input being a variable")}function zl(e,t,n){if(P(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(P(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 Ul(e,t,n){if(P(t))return m.div(e,n);if(P(n))return m.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Gl(e,t,n){if(P(t))return t.invert(o.mul(e,be(n)));if(P(n))return n.invert(o.div(be(t),e));throw new Error("Could not invert due to no input being a variable")}function Wl(e,t,n){if(P(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(P(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 Hl(e,t,n){if(P(t))return m.mul(e,n);if(P(n))return m.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Zl(e,t){if(P(t))return t.invert(o.recip(e));throw new Error("Could not invert due to no input being a variable")}function Yl(e,t){if(P(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 Jl(e,t){if(P(t))return t.invert(o.pow10(e));throw new Error("Could not invert due to no input being a variable")}function Kl(e){return o.ln(e).sub(1).times(e).div(Qi)}function Xl(e,t){if(P(t)){const n=Qi.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 Ql(e,t){if(P(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:Kl,invert:Xl})}throw new Error("Could not integrate due to no input being a variable")}function eu(e,t,n){if(P(t))return t.invert(o.pow(be(n),e));if(P(n))return n.invert(o.root(be(t),e));throw new Error("Could not invert due to no input being a variable")}function tu(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function nu(e,t,n){if(P(t)){const i=o.ln(be(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 iu(e,t,n){if(P(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:tu,invert:nu})}throw new Error("Could not integrate due to no input being a variable")}function ru(e,t){if(P(t))return t.invert(o.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function au(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function su(e,t){if(P(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 ou(e,t){if(P(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:au,invert:su})}throw new Error("Could not integrate due to no input being a variable")}function lu(e,t){if(P(t))return t.invert(o.exp(e));throw new Error("Could not invert due to no input being a variable")}function uu(e){return o.ln(e).sub(1).times(e)}function cu(e,t){if(P(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 du(e,t){if(P(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:uu,invert:cu})}throw new Error("Could not integrate due to no input being a variable")}function fu(e,t,n){if(P(t))return t.invert(o.root(e,be(n)));if(P(n))return n.invert(o.ln(e).div(o.ln(be(t))));throw new Error("Could not invert due to no input being a variable")}function gu(e,t,n){if(P(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(P(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 pu(e,t){if(P(t))return t.invert(o.root(e,10));throw new Error("Could not invert due to no input being a variable")}function mu(e,t){if(P(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 vu(e,t,n){if(P(t))return t.invert(o.ln(e).div(be(n)));if(P(n))return n.invert(o.root(be(t),e));throw new Error("Could not invert due to no input being a variable")}function hu(e,t,n){if(P(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(P(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 bu(e,t,n){if(P(t))return t.invert(o.root(e,o.recip(be(n))));if(P(n))return n.invert(o.ln(be(t)).div(o.ln(e)));throw new Error("Could not invert due to no input being a variable")}function yu(e,t,n){if(P(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 wu(e,t){if(P(t))return t.invert(o.ln(e));throw new Error("Could not invert due to no input being a variable")}function _u(e,t){if(P(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 Nu(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.tetrate(e,i,n)}function Cu(e,t,n,i){if(P(t))return t.invert(o.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function ku(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 Mu(e,t,n,i){if(P(t))return t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,be(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Su(e,t=10,n=2){const i=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,i)}function Iu(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function xu(e,t,n){if(P(t))return t.invert(o.tetrate(e,o.minabs(1e308,be(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function $u(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.layeradd(e,i,n)}function Eu(e,t,n,i){if(P(t))return t.invert(o.layeradd(e,o.minabs(1e308,be(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function Tu(e,t){if(P(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 Du(e,t){if(P(t))return t.invert(o.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function Pu(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.pentate(e,i,n)}function Fu(e,t){if(P(t))return t.invert(o.asin(e));throw new Error("Could not invert due to no input being a variable")}function Ou(e,t){if(P(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 Au(e,t){if(P(t))return t.invert(o.acos(e));throw new Error("Could not invert due to no input being a variable")}function qu(e,t){if(P(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 Vu(e,t){if(P(t))return t.invert(o.atan(e));throw new Error("Could not invert due to no input being a variable")}function Ru(e,t){if(P(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 Lu(e,t){if(P(t))return t.invert(o.sin(e));throw new Error("Could not invert due to no input being a variable")}function Bu(e,t){if(P(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 ju(e,t){if(P(t))return t.invert(o.cos(e));throw new Error("Could not invert due to no input being a variable")}function zu(e,t){if(P(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 Uu(e,t){if(P(t))return t.invert(o.tan(e));throw new Error("Could not invert due to no input being a variable")}function Gu(e,t){if(P(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 Wu(e,t){if(P(t))return t.invert(o.asinh(e));throw new Error("Could not invert due to no input being a variable")}function Hu(e,t){if(P(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 Zu(e,t){if(P(t))return t.invert(o.acosh(e));throw new Error("Could not invert due to no input being a variable")}function Yu(e,t){if(P(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 Ju(e,t){if(P(t))return t.invert(o.atanh(e));throw new Error("Could not invert due to no input being a variable")}function Ku(e,t){if(P(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 Xu(e,t){if(P(t))return t.invert(o.sinh(e));throw new Error("Could not invert due to no input being a variable")}function Qu(e,t){if(P(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 ec(e,t){if(P(t))return t.invert(o.cosh(e));throw new Error("Could not invert due to no input being a variable")}function tc(e,t){if(P(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 nc(e,t){if(P(t))return t.invert(o.tanh(e));throw new Error("Could not invert due to no input being a variable")}function ic(e,t){if(P(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 cn(e){return(t,n)=>new m({inputs:[t,n],evaluate:e,invert:vn})}function P(e){return e instanceof ye&&e.hasVariable()}function be(e,t){return e instanceof ye?e.evaluate(t):s(e)}function rc(){return m.pow(this,2).div(2)}function ac(){return this}const Ce=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"&&vt in n?n[vt]:n)),"variable"in e?(typeof e.variable=="object"&&vt in e.variable&&(e.variable=e.variable[vt]),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:rc,internalIntegrateInner:ac,applySubstitution:vn}}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 y,N;const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:a,applySubstitution:u}=e,l=t.reduce((w,_)=>w+(_ instanceof Ce?_.internalVariables:0),0),c=t.find(w=>w instanceof Ce&&w.hasVariable()),f=l===1?c==null?void 0:c.innermostVariable:void 0,v=(y=c==null?void 0:c.isInvertible())!=null?y:!1,g=(N=c==null?void 0:c.isIntegrable())!=null?N:!1;return{inputs:t,internalEvaluate:n,internalInvert:v?i:void 0,internalIntegrate:g?r:void 0,internalIntegrateInner:a,applySubstitution:u,innermostVariable:f,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=>be(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:be(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof Ce&&e.inputs[n]instanceof Ce?t.equals(e.inputs[n]):!(t instanceof Ce)&&!(e.inputs[n]instanceof Ce)&&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=z(0),r=n(m.variable(i)),a=he(t);function u(c){return o.lt(c,s(a))?c:(i.value=o.sub(c,s(a)),o.add(r.evaluate(),s(a)))}function l(c,f){if(P(f)&&r.isInvertible())return o.gt(c,s(a))&&(c=o.add(r.invert(o.sub(c,s(a))),s(a))),f.invert(c);throw new Error("Could not invert due to no input being a variable")}return new m({inputs:[e],evaluate:u,invert:r.isInvertible()&&r.hasVariable()?l:void 0})}static if(e,t,n,i){const r=z(0),a=m.variable(r),u=n(a),l=i==null?void 0:i(a),c=he(t);function f(g){return s(c)?(r.value=g,u.evaluate()):l?(r.value=g,l.evaluate()):g}function v(g,y){if(!P(y)||!u.isInvertible()||l!=null&&!l.isInvertible())throw new Error("Could not invert due to no input being a variable");return s(c)?y.invert(u.invert(g)):l?y.invert(l.invert(g)):y.invert(g)}return new m({inputs:[e],evaluate:f,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:Pl,applySubstitution:Ol,integrate:Fl})}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:Al,integrate:ql,integrateInner:Vl,applySubstitution:vn})}static sub(e,t){return new m({inputs:[e,t],evaluate:o.sub,invert:Rl,integrate:Ll,integrateInner:Bl,applySubstitution:vn})}static mul(e,t){return new m({inputs:[e,t],evaluate:o.mul,invert:jl,integrate:zl,applySubstitution:Ul})}static div(e,t){return new m({inputs:[e,t],evaluate:o.div,invert:Gl,integrate:Wl,applySubstitution:Hl})}static recip(e){return new m({inputs:[e],evaluate:o.recip,invert:Zl,integrate:Yl})}static clamp(e,t,n){return new m({inputs:[e,t,n],evaluate:o.clamp,invert:vn})}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:Jl,integrate:Ql})}static log(e,t){return new m({inputs:[e,t],evaluate:o.log,invert:eu,integrate:iu})}static log2(e){return new m({inputs:[e],evaluate:o.log2,invert:ru,integrate:ou})}static ln(e){return new m({inputs:[e],evaluate:o.ln,invert:lu,integrate:du})}static pow(e,t){return new m({inputs:[e,t],evaluate:o.pow,invert:fu,integrate:gu})}static pow10(e){return new m({inputs:[e],evaluate:o.pow10,invert:pu,integrate:mu})}static pow_base(e,t){return new m({inputs:[e,t],evaluate:o.pow_base,invert:vu,integrate:hu})}static root(e,t){return new m({inputs:[e,t],evaluate:o.root,invert:bu,integrate:yu})}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:wu,integrate:_u})}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:Nu,invert:Cu})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:ku,invert:Mu})}static iteratedlog(e,t=10,n=1){return new m({inputs:[e,t,n],evaluate:Su})}static slog(e,t=10){return new m({inputs:[e,t],evaluate:Iu,invert:xu})}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:$u,invert:Eu})}static lambertw(e){return new m({inputs:[e],evaluate:o.lambertw,invert:Tu})}static ssqrt(e){return new m({inputs:[e],evaluate:o.ssqrt,invert:Du})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:Pu})}static sin(e){return new m({inputs:[e],evaluate:o.sin,invert:Lu,integrate:Ou})}static cos(e){return new m({inputs:[e],evaluate:o.cos,invert:ju,integrate:qu})}static tan(e){return new m({inputs:[e],evaluate:o.tan,invert:Uu,integrate:Ru})}static asin(e){return new m({inputs:[e],evaluate:o.asin,invert:Fu,integrate:Bu})}static acos(e){return new m({inputs:[e],evaluate:o.acos,invert:Au,integrate:zu})}static atan(e){return new m({inputs:[e],evaluate:o.atan,invert:Vu,integrate:Gu})}static sinh(e){return new m({inputs:[e],evaluate:o.sinh,invert:Xu,integrate:Hu})}static cosh(e){return new m({inputs:[e],evaluate:o.cosh,invert:ec,integrate:Yu})}static tanh(e){return new m({inputs:[e],evaluate:o.tanh,invert:nc,integrate:Ku})}static asinh(e){return new m({inputs:[e],evaluate:o.asinh,invert:Wu,integrate:Qu})}static acosh(e){return new m({inputs:[e],evaluate:o.acosh,invert:Zu,integrate:tc})}static atanh(e){return new m({inputs:[e],evaluate:o.atanh,invert:Ju,integrate:ic})}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 ye=Ce;ye.negate=Ce.neg;ye.negated=Ce.neg;ye.sgn=Ce.sign;ye.plus=Ce.add;ye.subtract=Ce.sub;ye.minus=Ce.sub;ye.multiply=Ce.mul;ye.times=Ce.mul;ye.divide=Ce.div;ye.divideBy=Ce.div;ye.dividedBy=Ce.div;ye.reciprocal=Ce.recip;ye.reciprocate=Ce.recip;ye.max=cn(o.max);ye.min=cn(o.min);ye.minabs=cn(o.minabs);ye.maxabs=cn(o.maxabs);ye.clampMin=cn(o.clampMin);ye.clampMax=cn(o.clampMax);ye.logarithm=Ce.log;class m extends ye{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 sc(e,t,n=!0,i){const r=he(n);return I(()=>{var u,l;let a;if(s(r)){if(!e.isIntegrable()||!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");a=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((u=s(e.innermostVariable))!=null?u:0),i==null&&(i=10)}else{if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula");a=o.floor(e.invert(t.value)),i==null&&(i=0)}if(i>0&&o.lt(At(e,a,!0,0),1e308)){a=a.sub(i).clampMin(0);let c=At(e,a,!0,0);for(;;){const f=e.evaluate(a.add((l=s(e.innermostVariable))!=null?l:0));if(o.add(c,f).lte(t.value))a=a.add(1),c=o.add(c,f);else break}}return a})}function At(e,t,n=!0,i){var a,u,l;let r=o.add(t,(a=s(e.innermostVariable))!=null?a:0);if(n){if(!e.isIntegrable())throw new Error("Cannot calculate cost with spending resources of non-integrable formula");const c=r;r=r.sub(i!=null?i:10).clampMin((u=s(e.innermostVariable))!=null?u:0);let f=o.sub(e.evaluateIntegral(r),e.evaluateIntegral());if(c.gt(1e308))return f.add(o.sub(c,r).times(e.evaluate(r)));for(let v=r.toNumber();v{const{addend:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),u=he(n),l=he(i),c=r==null?void 0:he(r);return{apply:f=>o.add(f,s(u)),invert:f=>o.sub(f,s(u)),getFormula:f=>m.add(f,u),enabled:c,description:i==null?void 0:ne(()=>p("div",{class:"modifier-container"},[s(l)!=null?p("span",{class:"modifier-description"},[rt(s(l))]):null,p("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)?"+":"",Ft(s(u))])]))}})}function mt(e){return Je(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),u=he(n),l=he(i),c=r==null?void 0:he(r);return{apply:f=>o.times(f,s(u)),invert:f=>o.div(f,s(u)),getFormula:f=>m.times(f,u),enabled:c,description:i==null?void 0:ne(()=>p("div",{class:"modifier-container"},[s(l)!=null?p("span",{class:"modifier-description"},[rt(s(l))]):null,p("span",{class:"modifier-amount",style:(a===!0?o.gt(s(u),1):o.lt(s(u),1))?"color: var(--danger)":""},[q("\xD7"),Ft(s(u))])]))}})}function oc(e){return Je(t=>{const{exponent:n,description:i,enabled:r,supportLowNumbers:a,smallerIsBetter:u}=e.call(t,t),l=he(n),c=he(i),f=r==null?void 0:he(r);return{apply:v=>{let g=v;return a&&(g=o.add(g,1)),g=o.pow(g,s(l)),a&&(g=o.sub(g,1)),g},invert:v=>{let g=v;return a&&(g=o.add(g,1)),g=o.root(g,s(l)),a&&(g=o.sub(g,1)),g},getFormula:v=>a?m.add(v,1).pow(l).sub(1):m.pow(v,l),enabled:f,description:i==null?void 0:ne(()=>p("div",{class:"modifier-container"},[s(c)!=null?p("span",{class:"modifier-description"},[rt(s(c)),a?" (+1 effective)":null]):null,p("span",{class:"modifier-amount",style:(u===!0?o.gt(s(l),1):o.lt(s(l),1))?"color: var(--danger)":""},[q("^"),Ft(s(l))])]))}})}function zt(e){return Je(()=>{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)?I(()=>t.filter(n=>s(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?ne(()=>p(se,null,[t.filter(n=>s(n.enabled)!==!1).map(n=>s(n.description)).filter(n=>n).map(rt)])):void 0}})}const lc={key:0},uc={key:0,class:"mark star"},cc=["src"],dc=Q({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(S(),D("div",lc,[e.mark===!0?(S(),D("div",uc)):(S(),D("img",{key:1,class:"mark",src:e.mark},null,8,cc))])):U("",!0)}});var jn=fe(dc,[["__scopeId","data-v-2207999f"]]);const fc=Q({__name:"Node",props:{id:null},setup(e){const n=ke(e),i=Dn(ii,()=>{}),r=Dn(ri,()=>{}),a=Ye(null),u=I(()=>a.value&&a.value.parentElement);return st([u,n.id],([l,c],[f,v])=>{f&&r(s(v)),l&&i(c,l)}),$i(()=>r(s(n.id))),(l,c)=>(S(),D("div",{class:"node",ref_key:"node",ref:a},null,512))}});var zn=fe(fc,[["__scopeId","data-v-a48cb382"]]),gc=Q({props:{display:{type:j(Object,String,Function),required:!0},visibility:{type:j(Number,Boolean),required:!0},style:j(Object,String,Array),classes:j(Object),onClick:Function,onHold:Function,canClick:{type:j(Boolean),required:!0},small:Boolean,mark:j(Boolean,String),id:{type:String,required:!0}},components:{Node:zn,MarkNode:jn},setup(e){const{display:t,onClick:n,onHold:i}=ke(e),r=Ye("");nt(()=>{var v;const l=$e(t);if(l==null){r.value="";return}if(gt(l)){r.value=ae(l);return}const c=ae((v=l.title)!=null?v:"","h3"),f=ae(l.description,"div");r.value=ae(ne(()=>p("span",null,[l.title!=null?p("div",null,[p(c,null,null)]):null,p(f,null,null)])))});const{start:a,stop:u}=Li(n,i);return{start:a,stop:u,comp:r,Visibility:_e,isVisible:ot,isHidden:un,unref:s}}});function pc(e,t,n,i,r,a){var c;const u=bt("MarkNode"),l=bt("Node");return e.isVisible(e.visibility)?(S(),D("button",{key:0,style:qe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...f)=>e.onClick&&e.onClick(...f)),onMousedown:t[1]||(t[1]=(...f)=>e.start&&e.start(...f)),onMouseleave:t[2]||(t[2]=(...f)=>e.stop&&e.stop(...f)),onMouseup:t[3]||(t[3]=(...f)=>e.stop&&e.stop(...f)),onTouchstartPassive:t[4]||(t[4]=(...f)=>e.start&&e.start(...f)),onTouchendPassive:t[5]||(t[5]=(...f)=>e.stop&&e.stop(...f)),onTouchcancelPassive:t[6]||(t[6]=(...f)=>e.stop&&e.stop(...f)),class:pe({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)?(S(),te(Oe(e.unref(e.comp)),{key:0})):U("",!0),p(u,{mark:e.unref(e.mark)},null,8,["mark"]),p(l,{id:e.id},null,8,["id"])],38)):U("",!0)}var mc=fe(gc,[["render",pc],["__scopeId","data-v-211328c0"]]);const vc=["x1","y1","x2","y2"],hc=Q({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=ke(e),i=I(()=>{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=I(()=>{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)=>(S(),D("line",Ct({"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,vc))}});const bc=Q({__name:"Links",props:{links:null},setup(e){var c;const n=qt(e,"links"),i=z(null),r=Dn(ai,z({})),a=Dn(si,z(void 0)),u=z((c=i.value)==null?void 0:c.getBoundingClientRect());st(a,()=>{var f;return u.value=(f=i.value)==null?void 0:f.getBoundingClientRect()}),Rn(()=>{var f;return u.value=(f=i.value)==null?void 0:f.getBoundingClientRect()});const l=I(()=>{var v,g;const f=r.value;return(g=(v=n.value)==null?void 0:v.filter(y=>{var N,w;return((N=f[y.startNode.id])==null?void 0:N.rect)&&((w=f[y.startNode.id])==null?void 0:w.rect)}))!=null?g:[]});return(f,v)=>(S(),D(se,null,[s(l)?(S(),D("svg",dr(Ct({key:0},f.$attrs)),[(S(!0),D(se,null,on(s(l),(g,y)=>(S(),te(hc,{key:y,link:g,boundingRect:u.value,startNode:s(r)[g.startNode.id],endNode:s(r)[g.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):U("",!0),C("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var yc=fe(bc,[["__scopeId","data-v-063f6d6b"]]);Q({props:{nodes:{type:j(Array),required:!0},leftSideNodes:j(Array),rightSideNodes:j(Array),branches:j(Array)},components:{Links:yc},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=ke(e),r=Ye();nt(()=>{const l=$e(t);r.value=ae(ne(()=>p(se,null,[l.map(c=>p("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(rt)]))])))});const a=Ye();nt(()=>{const l=$e(n);a.value=l?ae(ne(()=>p("span",{class:"left-side-nodes small"},[l.map(rt)]))):""});const u=Ye();return nt(()=>{const l=$e(i);u.value=l?ae(ne(()=>p("span",{class:"side-nodes small"},[l.map(rt)]))):""}),{unref:s,nodesComp:r,leftNodesComp:a,rightNodesComp:u}}});Q({props:{display:j(Object,String,Function),visibility:{type:j(Number,Boolean),required:!0},style:j(String,Object,Array),classes:j(Object),onClick:Function,onHold:Function,color:j(String),glowColor:j(String),canClick:{type:j(Boolean),required:!0},mark:j(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:jn,Node:zn},setup(e){const{onClick:t,onHold:n,display:i}=ke(e),r=Cn(i),{start:a,stop:u}=Li(t,n);return{start:a,stop:u,comp:r,unref:s,Visibility:_e,isCoercableComponent:gt,isVisible:ot,isHidden:un}}});function hn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(l=>he(l.base)),n.baseText=t.map(l=>he(l.baseText)),n.visible=t.map(l=>he(l.visible)),n.title=t.map(l=>he(l.title)),n.subtitle=t.map(l=>he(l.subtitle)),i=!0),t}const a=at({},!1);return[ne(()=>{const l=r();let c=!0;const f=l.map((v,g)=>{var R,$,T;if(s(n.visible[g])===!1)return null;const y=p("h3",{onClick:()=>a.value[g]=!a.value[g],style:"cursor: pointer"},[p("span",{class:"modifier-toggle"+(s(a.value[g])?" collapsed":"")},[q("\u25BC")]),s(n.title[g]),s(n.subtitle[g])!=null?p("span",{class:"subtitle"},[q(" ("),s(n.subtitle[g]),q(")")]):null]),N=s(a.value[g])?null:p(se,null,[p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[rt((R=s(n.baseText[g]))!=null?R:"Base")]),p("span",{class:"modifier-amount"},[Ht(($=s(n.base[g]))!=null?$:1),v.unit])]),v.modifier.description==null?null:rt(s(v.modifier.description))]),w=!c;c=!1;const _=(T=s(n.base[g]))!=null?T:1,E=v.modifier.apply(_);return p(se,null,[w?p("br",null,null):null,p("div",{style:{"--unit":re.alignUnits&&v.unit!=null?"'"+v.unit+"'":""}},[y,p("br",null,null),N,p("hr",null,null),p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[q("Total")]),p("span",{class:"modifier-amount",style:(v.smallerIsBetter===!0?o.gt(E,_!=null?_:1):o.lt(E,_!=null?_:1))?"color: var(--danger)":""},[Ft(E),v.unit])])])])});return p(se,null,[f])}),a]}function _i(e,t,n){const i=he(t),r=he(n);return I(()=>{const a=s(i),u=s(r);return o.gte(e.value,u)?"Now":o.lte(a,0)?"Never":Bn(o.sub(u,e.value).div(a))})}function Vn(e,t,n=1){const i=he(t),r=he(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return ne(()=>{var a;if(s(i)){const u=Ft(e.evaluate()),l=Ft(e.evaluate(o.add(s((a=e.innermostVariable)!=null?a:0),s(r))));return p(se,null,[p("b",null,[p("i",null,[u,q(" \u2192 "),l])])])}return p(se,null,[Ft(e.evaluate())])})}const wc=Q({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(S(),D("div",{style:qe({width:e.width,height:e.height})},null,4))}});function Kn(e){return Je(t=>{const n=e.call(t,t);if(n.partialDisplay=i=>p("span",{style:s(n.requirementMet)?"":"color: var(--danger)"},[wi(n.resource,n.cost instanceof m?At(n.cost,i!=null?i:1,s(n.spendResources)):s(n.cost))," ",n.resource.displayName]),n.display=i=>p("div",null,[s(n.requiresPay)?"Costs: ":"Requires: ",wi(n.resource,n.cost instanceof m?At(n.cost,i!=null?i:1,s(n.spendResources)):s(n.cost))," ",n.resource.displayName]),F(n,"visibility"),oe(n,"visibility",_e.Visible),F(n,"cost"),F(n,"requiresPay"),oe(n,"requiresPay",!0),F(n,"spendResources"),oe(n,"spendResources",!0),oe(n,"pay",function(i){const r=n.cost instanceof m?At(n.cost,i!=null?i:1,s(n.spendResources)):s(n.cost);n.resource.value=o.sub(n.resource.value,r).max(0)}),n.canMaximize=I(()=>n.cost instanceof m&&n.cost.isInvertible()&&(s(n.spendResources)===!1||n.cost.isIntegrable())),n.cost instanceof m&&n.cost.isInvertible()){const i=sc(n.cost,n.resource,s(n.spendResources));n.requirementMet=I(()=>s(n.canMaximize)?i.value:n.cost instanceof m?o.gte(n.resource.value,n.cost.evaluate()):o.gte(n.resource.value,s(n.cost)))}else n.requirementMet=I(()=>n.cost instanceof m?o.gte(n.resource.value,n.cost.evaluate()):o.gte(n.resource.value,s(n.cost)));return n})}function di(e){return Je(()=>({requirementMet:I(()=>ot(e.visibility)),visibility:_e.None,requiresPay:!1}))}function _c(e,t){return Je(()=>({requirementMet:he(e),partialDisplay:t==null?void 0:ne(()=>rt(t)),display:t==null?void 0:ne(()=>p(se,null,[q("Req: "),rt(t)])),visibility:t==null?_e.None:_e.Visible,requiresPay:!1}))}function Un(e){if(ht(e))return e.every(Un);const t=s(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function er(e){if(ht(e))return e.map(er).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 Gn(e,t=1){var n,i;if(ht(e)&&(e=e.filter(r=>ot(r.visibility)),e.length===1&&(e=e[0])),ht(e)){e=e.filter(u=>"partialDisplay"in u);const r=e.filter(u=>s(u.requiresPay)),a=e.filter(u=>!s(u.requiresPay));return p(se,null,[r.length>0?p("div",null,[q("Costs:")," ",bi(r.map(u=>u.partialDisplay(t)),p(se,null,[q(", ")]))]):null,a.length>0?p("div",null,[q("Requires:")," ",bi(a.map(u=>u.partialDisplay(t)),p(se,null,[q(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:p(se,null,null)}function tr(e,t=1){var n;ht(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 Nc=Q({props:{visibility:{type:j(Number,Boolean),required:!0},display:j(Object,String,Function),earned:{type:j(Boolean),required:!0},requirements:j(Object,Array),image:j(String),style:j(String,Object,Array),classes:j(Object),mark:j(Boolean,String),small:j(Boolean),id:{type:String,required:!0}},components:{Node:zn,MarkNode:jn},setup(e){const{display:t,requirements:n,earned:i}=ke(e),r=Ye("");return nt(()=>{const a=$e(t);if(a==null){r.value="";return}if(gt(a)){r.value=ae(a);return}const u=ae(a.requirement?a.requirement:ne(()=>{var f;return Gn((f=$e(n))!=null?f:[])}),"h3"),l=ae(a.effectDisplay||"","b"),c=$e(i)?ae(a.optionsDisplay||"","span"):"";r.value=ae(ne(()=>p("span",null,[p(u,null,null),a.effectDisplay!=null?p("div",null,[p(l,null,null)]):null,a.optionsDisplay!=null?p("div",{class:"equal-spaced"},[p(c,null,null)]):null])))}),{comp:r,unref:s,Visibility:_e,isVisible:ot,isHidden:un}}});function Cc(e,t,n,i,r,a){var c;const u=bt("MarkNode"),l=bt("Node");return e.isVisible(e.visibility)?(S(),D("div",{key:0,style:qe([{visibility:e.isHidden(e.visibility)?"hidden":void 0,backgroundImage:e.earned&&e.image&&`url(${e.image})`||""},(c=e.unref(e.style))!=null?c:[]]),class:pe({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?(S(),te(Oe(e.comp),{key:0})):U("",!0),p(u,{mark:e.unref(e.mark)},null,8,["mark"]),p(l,{id:e.id},null,8,["id"])],6)):U("",!0)}var kc=fe(Nc,[["render",Cc],["__scopeId","data-v-5673325a"]]);const Mc=Ln(),Sc=Symbol("Achievement");let nn=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function Ic(e,...t){const n=at(!1,!1),i=t.reduce((r,a)=>{var u;return Object.assign(r,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return Je(r=>{var c,f,v;const a=(c=e==null?void 0:e.call(r,r))!=null?c:{};a.id=Nn("achievement-"),a.type=Sc,a[ft]=kc;for(const g of t)(f=g.preConstruct)==null||f.call(g,a);a.earned=n,a.complete=function(){var y,N;n.value=!0;const g=a;if((y=g.onComplete)==null||y.call(g),g.display!=null&&s(g.showPopups)===!0){const w=s(g.display);let _;gt(w)?_=ae(w):w.requirement!=null?_=ae(w.requirement):_=Gn((N=g.requirements)!=null?N:[]),Mc.info(p("div",null,[p("h3",null,[q("Achievement earned!")]),p("div",null,[p(_,null,null)])]))}},Object.assign(a,i),F(a,"visibility"),oe(a,"visibility",_e.Visible);const u=a.visibility;a.visibility=fr(()=>{const g=s(a.display);switch(re.msDisplay){default:case nn.All:return s(u);case nn.Configurable:return s(a.earned)&&!(g!=null&&typeof g=="object"&&"optionsDisplay"in g)?_e.None:s(u);case nn.Incomplete:return s(a.earned)?_e.None:s(u);case nn.None:return _e.None}}),F(a,"display"),F(a,"mark"),F(a,"small"),F(a,"image"),F(a,"style"),F(a,"classes"),F(a,"showPopups"),oe(a,"showPopups",!0);for(const g of t)(v=g.postConstruct)==null||v.call(g,a);const l=t.reduce((g,y)=>{var N;return Object.assign(g,(N=y.getGatheredProps)==null?void 0:N.call(y,a))},{});if(a[it]=function(){const{visibility:g,display:y,requirements:N,earned:w,image:_,style:E,classes:R,mark:$,small:T,id:L}=this;return{visibility:g,display:y,requirements:N,earned:w,image:_,style:s(E),classes:R,mark:$,small:T,id:L,...l}},a.requirements){const g=a,y=[di(g),_c(()=>!g.earned.value),...ht(a.requirements)?a.requirements:[a.requirements]];nt(()=>{re.active===X.id&&Un(y)&&g.complete()})}return a})}Ve.on("loadSettings",e=>{oe(e,"msDisplay",nn.All)});const xc=Object.values(nn).map(e=>({label:tt(e),value:e}));Sa(ne(()=>p(ui,{title:ne(()=>p("span",{class:"option-title"},[q("Show achievements"),p("desc",null,[q("Select which achievements to display based on criterias.")])])),options:xc,"onUpdate:modelValue":e=>re.msDisplay=e,modelValue:re.msDisplay},null)));const $c=Symbol("Repeatable");function Ec(e,...t){const n=at(0),i=t.reduce((r,a)=>{var u;return Object.assign(r,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return Je(r=>{var y,N,w;const a=e.call(r,r);a.id=Nn("repeatable-"),a.type=$c,a[ft]=mc;for(const _ of t)(y=_.preConstruct)==null||y.call(_,a);a.amount=n,a.amount[ln]=(N=a.initialAmount)!=null?N:0,Object.assign(a,i);const u={requirementMet:I(()=>o.sub(s(a.limit),a.amount.value)),requiresPay:!1,visibility:_e.None},l=di(a);ht(a.requirements)?(a.requirements.unshift(l),a.requirements.push(u)):a.requirements=[l,a.requirements,u],a.maxed=I(()=>o.gte(a.amount.value,s(a.limit))),F(a,"classes");const c=a.classes;a.classes=I(()=>{const _=s(c)||{};return a.maxed.value&&(_.bought=!0),_}),a.amountToIncrease=I(()=>s(a.maximize)?er(a.requirements):1),a.canClick=I(()=>Un(a.requirements));const f=a.onClick;a.onClick=function(_){const E=a;!s(E.canClick)||(tr(a.requirements,s(a.amountToIncrease)),E.amount.value=o.add(E.amount.value,1),f==null||f(_))},F(a,"display");const v=a.display;a.display=ne(()=>{var E,R,$;const _=s(v);if(gt(_)){const T=ae(_);return p(T,null,null)}if(_!=null){const T=a,L=ae((E=_.title)!=null?E:"","h3"),A=ae((R=_.description)!=null?R:""),B=ae(($=_.effectDisplay)!=null?$:"");return p("span",null,[_.title==null?null:p("div",null,[p(L,null,null)]),_.description==null?null:p(A,null,null),_.showAmount===!1?null:p("div",null,[p("br",null,null),p(se,null,[q("Amount: "),Ge(T.amount.value)]),o.isFinite(s(T.limit))?p(se,null,[q(" / "),Ge(s(T.limit))]):void 0]),_.effectDisplay==null?null:p("div",null,[p("br",null,null),q("Currently: "),p(B,null,null)]),T.maxed.value?null:p("div",null,[p("br",null,null),Gn(T.requirements,s(a.amountToIncrease))])])}return""}),F(a,"visibility"),oe(a,"visibility",_e.Visible),F(a,"limit"),oe(a,"limit",o.dInf),F(a,"style"),F(a,"mark"),F(a,"small"),F(a,"maximize");for(const _ of t)(w=_.postConstruct)==null||w.call(_,a);const g=t.reduce((_,E)=>{var R;return Object.assign(_,(R=E.getGatheredProps)==null?void 0:R.call(E,a))},{});return a[it]=function(){const{display:_,visibility:E,style:R,classes:$,onClick:T,canClick:L,small:A,mark:B,id:K}=this;return{display:_,visibility:E,style:s(R),classes:$,onClick:T,canClick:L,small:A,mark:B,id:K,...g}},a})}function Ni(e,t){return F(t,"display"),F(t,"classes"),F(t,"style"),F(t,"direction"),oe(t,"direction",J.Up),F(t,"xoffset"),F(t,"yoffset"),t.pinnable&&(t.pinned=at(!1,!1)),Nt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,zi(t.pinned)):e.pinned=t.pinned);const n=e[ft];e[ft]=Ne;const i=e[it].bind(e);e[it]=function(){const{display:a,classes:u,style:l,direction:c,xoffset:f,yoffset:v,pinned:g}=this;return{element:{[ft]:n,[it]:i},display:a,classes:u,style:s(l),direction:c,xoffset:f,yoffset:v,pinned:g}}.bind(t)}),t}var Tc=Q({props:{display:{type:j(String,Object,Function),required:!0},visibility:{type:j(Number,Boolean),required:!0},style:j(String,Object,Array),classes:j(Object),requirements:{type:Object,required:!0},canPurchase:{type:j(Boolean),required:!0},bought:{type:j(Boolean),required:!0},mark:j(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:zn,MarkNode:jn},setup(e){const{display:t,requirements:n,bought:i}=ke(e),r=Ye("");return nt(()=>{const a=$e(t);if(a==null){r.value="";return}if(gt(a)){r.value=ae(a);return}const u=ae(a.title||"","h3"),l=ae(a.description,"div"),c=ae(a.effectDisplay||"");r.value=ae(ne(()=>p("span",null,[a.title!=null?p("div",null,[p(u,null,null)]):null,p(l,null,null),a.effectDisplay!=null?p("div",null,[q("Currently: "),p(c,null,null)]):null,i.value?null:p(se,null,[p("br",null,null),Gn(n.value)])])))}),{component:r,unref:s,Visibility:_e,isVisible:ot,isHidden:un}}});const Dc=["disabled"];function Pc(e,t,n,i,r,a){var c;const u=bt("MarkNode"),l=bt("Node");return e.isVisible(e.visibility)?(S(),D("button",{key:0,style:qe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...f)=>e.purchase&&e.purchase(...f)),class:pe({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)?(S(),te(Oe(e.unref(e.component)),{key:0})):U("",!0),p(u,{mark:e.unref(e.mark)},null,8,["mark"]),p(l,{id:e.id},null,8,["id"])],14,Dc)):U("",!0)}var Fc=fe(Tc,[["render",Pc],["__scopeId","data-v-9be6bac0"]]);const Oc=Symbol("Upgrade");function Ac(e,...t){const n=at(!1,!1),i=t.reduce((r,a)=>{var u;return Object.assign(r,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return Je(r=>{var c,f;const a=e.call(r,r);a.id=Nn("upgrade-"),a.type=Oc,a[ft]=Fc;for(const v of t)(c=v.preConstruct)==null||c.call(v,a);a.bought=n,Object.assign(a,i),a.canPurchase=I(()=>!n.value&&Un(a.requirements)),a.purchase=function(){var g;const v=a;!s(v.canPurchase)||(tr(a.requirements),n.value=!0,(g=v.onPurchase)==null||g.call(v))};const u=di(a);ht(a.requirements)?a.requirements.unshift(u):a.requirements=[u,a.requirements],F(a,"visibility"),oe(a,"visibility",_e.Visible),F(a,"classes"),F(a,"style"),F(a,"display"),F(a,"mark");for(const v of t)(f=v.postConstruct)==null||f.call(v,a);const l=t.reduce((v,g)=>{var y;return Object.assign(v,(y=g.getGatheredProps)==null?void 0:y.call(g,a))},{});return a[it]=function(){const{display:v,visibility:g,style:y,classes:N,requirements:w,canPurchase:_,bought:E,mark:R,id:$,purchase:T}=this;return{display:v,visibility:g,style:s(y),classes:N,requirements:w,canPurchase:_,bought:E,mark:R,id:$,purchase:T,...l}},a})}function qc(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 Vc={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"]},Ci=[[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 ki(e){const t=Ci[Math.floor(e()*Ci.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 Bc=Ln();function nr(e,t,n,i){return oi(e,function(){const r=qc(0,n>>0,n>>32,1);for(let G=0;G<12;G++)r();const a=ki(r),u=Mi([.64,.75,.55],r),l=Mi([.18,.2,.25],r),c=Ki(0,ki(r)),f=Et.indexOf(t);let v=r();i.some(G=>G.type==="increaseDiff")&&(v=v/2+.5),i.some(G=>G.type==="decreaseDiff")&&(v=v/2);const g=v+f+1,y=i.some(G=>G.type==="increaseRewards")?g+1:g;let N=Math.ceil(r()*(f+2));i.some(G=>G.type==="increaseLength")&&N++;const w=[],_=zt(()=>w),E=I(()=>_.apply(0)),R=[];function $({feature:G,canClick:W,modifier:Fe,cost:St,previewModifier:Vt,showETA:je}){W=he(W),je=he(je);const Qt=Pa(G);R.push({shouldShowPreview:I(()=>s(W)&&Qt.value),modifier:Vt!=null?Vt:Fe,cost:St}),w.push(Fe);const It=_i(c,E,()=>be(St));Ni(G,{display:je==null?It:()=>s(je)?It.value:"",direction:J.Down})}const T=[],L=z(0);let A=m.variable(L).times(0);const B={};let K=!0;const le=I(()=>o.add(g,r()-.5).pow_base(2).times(10).times(A.evaluate())),Se=[];for(let G=0;G({addend:me,description:k,enabled:ue.bought}));break}case"mult":{const me=r()*5+1;x=`Multiply previous ${c.displayName} gain by x${ve(me)}.`,A=A.add(o.sub(me,1).times(B[L.value-1])),O=mt(()=>({multiplier:me,description:k,enabled:ue.bought}));break}case"pow":{const me=r()/5+1.1;x=`Raise previous ${c.displayName} gain to the ^${ve(me)}`,A=A.add(o.pow(B[L.value-1],me)).sub(B[L.value-1]),O=oc(()=>({exponent:me,description:k,enabled:ue.bought}))}}B[L.value]=A.evaluate(),L.value++;const H=K,ue=Ac(()=>({requirements:Kn(()=>({resource:Jn(c),cost:d})),display:{title:k,description:x},visibility:H}));$({feature:ue,canClick:()=>ue.canPurchase.value,modifier:O,cost:d,showETA:()=>!ue.bought.value}),De.push(ue)}T.push(De);break;case"repeatables":const ut=[];for(let Ie=0;Ie<3;Ie++){const h=gn({add:1.5,mult:3},r),d=L.value,k=le.value,x=Si(r);let O="",H,ue,me,ct;const tn=m.variable(I(()=>pt.amount.value)).times(2);switch(h){case"add":{const Qe=o.add(k,10).times(r()+.5);O=`Gain ${ve(Qe)} ${c.displayName}/s`,ct=tn.add(1).times(k),A=A.add(I(()=>o.sub(L.value,d).add(1).times(5).times(Qe))),H=I(()=>ve(o.times(Qe,pt.amount.value))+"/s"),ue=bn(()=>({addend:()=>o.times(Qe,pt.amount.value),description:x,enabled:()=>o.gt(pt.amount.value,0)})),me=bn(()=>({addend:Qe}));break}case"mult":{const Qe=r()+1;O=`Multiply previous ${c.displayName} gain by x${ve(Qe)}.`,ct=tn.pow_base(Qe).times(k),A=A.add(I(()=>o.sub(L.value,d).add(1).times(5).pow_base(Qe).sub(1).times(B[d]))),H=I(()=>"x"+ve(o.pow(Qe,pt.amount.value))),ue=mt(()=>({multiplier:()=>o.pow(Qe,pt.amount.value),description:x,enabled:()=>o.gt(pt.amount.value,0)})),me=mt(()=>({multiplier:Qe}));break}}B[L.value]=A.evaluate(),L.value++;const rr=K,pt=Ec(()=>({requirements:Kn(()=>({resource:Jn(c),cost:ct})),display:()=>({title:x,description:O,effectDisplay:s(H)}),visibility:rr}));$({feature:pt,canClick:()=>s(pt.canClick),modifier:ue,cost:ct,previewModifier:me}),ut.push(pt)}T.push(ut);break}const St={cache:i.some(De=>De.type==="increaseCaches")?10:1,generation:i.some(De=>De.type==="increaseGens")?10:1,resourceMulti:i.some(De=>De.type==="increaseResourceMults")?10:1,energyMulti:i.some(De=>De.type==="increaseEnergyMults")?2.5:.25,influences:Object.keys(Re.influenceNodes.value).length+Se.length===Object.keys(Dt).length?0:i.some(De=>De.type==="increaseInfluences")?20:2},Vt=gn(St,r);let je="",Qt,It,In,ze,fn,Rt;switch(Vt){case"cache":ze=Xn(r,i),je=`Gain ${ve(y)}x your current ${ze}.`,It=()=>{var Ie,Ue,h;return Re.grantResource(ze,o.times((h=(Ue=(Ie=Re.resourceNodes.value[ze])==null?void 0:Ie.state)==null?void 0:Ue.amount)!=null?h:0,y))};break;case"generation":ze=Xn(r,i);const De=o.div(y,120).times(He[ze]);je=`Gain ${ve(De)} ${ze}/s while plane is active.`,Qt=Ie=>Re.grantResource(ze,o.times(Ie,De)),In=I(()=>Re.resourceNodes.value[ze]);break;case"resourceMulti":fn=ze=Xn(r,i),Rt=o.div(y,17).pow_base(2),je=`Gain ${ve(Rt)}x ${ze} while plane is active.`;break;case"energyMulti":fn="energy",Rt=o.div(y,17),je=`Gain ${ve(Rt)}x energy while plane is active.`;break;case"influences":const ut=gn(Object.keys(Dt).reduce((Ie,Ue)=>(Ie[Ue]=Ue in Re.influenceNodes.value||Se.includes(Ue)?0:1,Ie),{}),r);Se.push(ut),je="Gain a new portal influence",It=()=>{if(ut in Re.influenceNodes.value){Bc.warning("Error: ignoring duplicate portal influence ("+Dt[ut].display+")");return}const Ie={id:Tn(Re.board),position:{...Re.board.types.portal.nodes.value.find(Ue=>Ue.state.id===e).position},type:"influence",state:{type:ut,data:Dt[ut].initialData}};Re.board.placeInAvailableSpace(Ie),Re.board.nodes.value.push(Ie)};break}const xt=K,Lt=le.value,en=Ic(()=>({requirements:Kn(()=>({resource:Jn(c),cost:Lt})),visibility:xt,display:{requirement:`${ve(Lt)} ${c.displayName}`,effectDisplay:je},style:"width: 100%",classes:{final:G===N-1},update:Qt,onComplete:It,link:In,effectedResource:fn,resourceMulti:Rt})),xn=_i(c,E,Lt);Ni(en,{display:()=>en.earned.value?"":xn.value,direction:J.Down}),T.push([en]),K=en.earned}const[Te,V]=hn(()=>[{title:`${tt(c.displayName)} Gain`,modifier:_,base:0,unit:"/s"}]),ge=z(!1),Pe=ne(()=>p(kt,{modelValue:ge.value,"onUpdate:modelValue":G=>ge.value=G},{header:()=>p("h2",null,[q("Modifiers")]),body:()=>Ze(Te)}));this.on("preUpdate",G=>{!Re.activePortals.value.some(W=>W.state.id===e)||(c.value=o.times(E.value,G).add(c.value),yt.value.forEach(W=>{var Fe;(Fe=W.update)==null||Fe.call(W,G)}))});const Be=I(()=>{const G=R.find(W=>W.shouldShowPreview.value);return G?o.neg(be(G.cost)):0}),lt=I(()=>{const G=R.find(W=>W.shouldShowPreview.value);return G?o.sub(G.modifier.apply(E.value),E.value):0}),Xe=Vn(m.variable(0).add(c),()=>o.neq(Be.value,0),Be),dn=Vn(m.variable(0).add(E),()=>o.neq(lt.value,0),lt),Mn=I(()=>{const G=[];return yt.value.forEach(W=>{W.link&&G.push(W.link)}),G}),Hn=I(()=>{const G={};return yt.value.forEach(W=>{W.effectedResource!=null&&W.resourceMulti!=null&&(G[W.effectedResource]!=null?G[W.effectedResource]=o.times(G[W.effectedResource],W.resourceMulti):G[W.effectedResource]=W.resourceMulti)}),G}),yt=I(()=>{const G=[];for(let W=1;Wo.lt(yt.value.length,N)&&T.some(G=>G.some(W=>"earned"in W&&s(W.earned)||"bought"in W&&s(W.bought)?!1:("canClick"in W&&s(W.canClick)||"canPurchase"in W&&s(W.canPurchase),!0))));return{tier:at(t),seed:at(n),influences:at(i),name:a,color:u,resource:c,background:l,style:{background:l,"--background":l},features:T,resourceTabCollapsed:V,links:Mn,resourceMultis:Hn,earnedTreasures:yt,showNotif:Sn,display:ne(()=>p(se,null,[p(qn,{class:"nav-container",style:"z-index: 5"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",null,[a])]),p("span",{class:"nav-segment"},[p("h3",null,[t,q("-tier")])]),i.length===0?null:p("span",{class:"nav-segment"},[p(Ne,{display:i.map(G=>{const W=Dt[G.type].description;return typeof W=="function"?W(G):W}).join("
"),direction:J.Down,style:"width: 300px"},{default:()=>[p("h3",null,[i.length,q(" influences")])]})]),p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>ge.value=!0},[q("modifiers")])])]}),p(qn,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h3",{style:`color: ${u}; text-shadow: 0px 0px 10px ${u};`},[Ze(Xe)])," ",c.displayName]),p("span",{class:"nav-segment"},[q("("),p("h3",{style:`color: ${u}; text-shadow: 0px 0px 10px ${u};`},[o.gt(E.value,0)?"+":"",Ze(dn)]),q("/s)")])]}),p(wc,{height:"60px"},null),T.map(G=>Da(...G)),Ze(Pe)])),minimizedDisplay:ne(()=>p("div",null,[p("span",null,[a]),p("span",{style:"font-size: large; vertical-align: sub;"},[" ",yt.value.length,q("/"),N,q(" treasures")])]))}})}function Xn(e,t){t=t.filter(l=>l.type==="increaseResources"||l.type==="decreaseResources");const n=Object.keys(He).reduce((l,c)=>{let f=He[c];return t.filter(v=>v.data===c).forEach(v=>{v.type==="increaseResources"?f*=1e3:f/=1e3}),l+f},0),i=Object.keys(He),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?"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 20% stronger":"Material level is 10% stronger"}},Dt={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}},Re=oi("main",function(){const e=Ki(0,"energy"),t=m.variable(0).add(1),n=I(()=>A.types.resource.nodes.value.reduce((h,d)=>(h[d.state.type]=d,h),{})),i=I(()=>({...A.types.passive.nodes.value.reduce((h,d)=>(h[d.state]=d,h),{}),sand:A.types.dowsing.nodes.value[0],wood:A.types.quarry.nodes.value[0],coal:A.types.empowerer.nodes.value[0],iron:A.types.portalGenerator.nodes.value[0]})),r=I(()=>({...A.types.influence.nodes.value.reduce((h,d)=>(h[d.state.type]=d,h),{})})),a=I(()=>Et.reduce((h,d)=>{var H,ue,me;const k=(me=(ue=(H=n.value[d])==null?void 0:H.state)==null?void 0:ue.amount)!=null?me:0;let x=o.floor(t.invertIntegral(k)).sub(10).clampMin(0),O=At(t,x,!0,0);for(;;){const ct=t.evaluate(x);if(o.add(O,ct).lte(k))x=x.add(1),O=o.add(O,ct);else break}return h[d]=x,h},{}));function u(h){var H,ue,me;const d=(me=(ue=(H=n.value[h])==null?void 0:H.state)==null?void 0:ue.amount)!=null?me:0,k=a.value[h],x=At(t,k,!0),O=At(t,o.add(k,1),!0);return o.sub(d,x).max(0).div(o.sub(O,x)).toNumber()}const l=Yt({}),c=Yt({});Nt(()=>{Et.forEach(h=>{st(()=>a.value[h],(d,k)=>{o.gt(d,k)&&re.active===X.id&&Ii.info(p("div",null,[p("h3",null,[o.eq(d,1)?`${tt(h)} discovered`:`${tt(h)} is now Level ${Ge(d)}`,q("!")]),p("div",null,[q("Energy gain is now 1.01x higher.")])]))})})});const f=I(()=>[K,Se,Te,V].filter(h=>{var d,k;return(k=(d=h.value)==null?void 0:d.state)==null?void 0:k.powered}).length+A.types.portal.nodes.value.filter(h=>h.state.powered).length),v=I(()=>o.eq(f.value,0)?10:o.add(f.value,1).pow_base(100).div(10).times(.99)),g=I(()=>Te.value==null?0:Te.value.state.resources.reduce((d,k)=>o.div(100,Fe[k].computedModifier.value).add(d),o.dZero)),y={id:"deselect",icon:"close",tooltip:h=>({text:"tools"in h.state?"Disconnect tools":"Disconnect resources"}),onClick(h){Array.isArray(h.state)?h.state=[]:"resources"in h.state?h.state={...h.state,resources:[]}:"tools"in h.state&&(h.state={...h.state,tools:[]}),A.selectedAction.value=null,A.selectedNode.value=null},visibility:h=>Array.isArray(h.state)?h.state.length>0:"resources"in h.state?h.state.resources.length>0:"tools"in h.state?h.state.tools.length>0:!1},N={id:"toggle",icon:"bolt",tooltip:h=>({text:h.state.powered?"Turn Off":`Turn On - Always runs for ${Ge(v.value)} energy/s`}),onClick(h){h.state={...h.state,powered:!h.state.powered},A.selectedAction.value=null},fillColor:h=>h.state.powered?"var(--accent1)":"var(--locked)"};function w(h,d=1/0){const k=h(m.variable(0));return{id:"moreConnections",icon:"hub",formula:k,tooltip(x){return{text:`Increase Connections - ${Ge(k.evaluate(x.state.maxConnections))} energy`}},confirmationLabel:x=>o.gte(e.value,k.evaluate(x.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(x){const O=k.evaluate(x.state.maxConnections);o.gte(e.value,O)&&(e.value=o.sub(e.value,O)),x.state={...x.state,maxConnections:x.state.maxConnections+1},A.selectedAction.value=null},visibility:x=>x.state.maxConnectionsO!==k)}:h.state={...h.state,resources:[...x,k]},A.selectedNode.value=h}function T(h,d){if(d.type!=="passive")return!1;const k=d.state,{maxConnections:x,tools:O}=h.state;return O.includes(k)?!0:O.length!==x}function L(h,d){if(d.type!=="passive")return;const k=d.state,x=h.state.tools;x.includes(k)?h.state={...h.state,tools:x.filter(O=>O!==k)}:h.state={...h.state,tools:[...x,k]},A.selectedNode.value=h}const A=Cl(h=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:{mine:{shape:Ae.Diamond,size:50,title:"\u{1FAA8}",label:d=>d===h.selectedNode.value?{text:"Mining"}:Object.keys(n.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[N],progress:d=>B(d)?new o(d.state.progress).toNumber():0,progressDisplay:Wt.Outline,progressColor:"var(--accent2)",classes:d=>({running:B(d)}),draggable:!0},brokenFactory:{shape:Ae.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:d=>d===h.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(d){o.gte(e.value,100)&&(d.type="factory",e.value=o.sub(e.value,100))},confirmationLabel:()=>o.gte(e.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},factory:{shape:Ae.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:d=>{var k,x;if(d===h.selectedNode.value)return{text:d.state==null?"Forge - Drag a resource to me!":`Forging ${Ee[d.state].name}`};if(((k=h.draggingNode.value)==null?void 0:k.type)==="resource"){const O=((x=h.draggingNode.value)==null?void 0:x.state).type,H=d.state===O?"Disconnect":Ee[O].name,ue=d.state===O||o.gte(e.value,Ee[O].cost)&&i.value[O]==null?"var(--accent2)":"var(--danger)";return{text:H,color:ue}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(d){d.state=void 0,h.selectedAction.value=null,h.selectedNode.value=null},visibility:d=>d.state!=null},{id:"craft",icon:"done",tooltip:d=>({text:`Forge ${Ee[d.state].name} - ${Ge(Ee[d.state].cost)} energy`}),onClick(d){const k=Ee[d.state];if(o.gte(e.value,k.cost)&&i.value[d.state]==null){e.value=o.sub(e.value,k.cost);const x={id:Tn(h),position:{...d.position},type:k.type,state:k.state};h.placeInAvailableSpace(x),h.nodes.value.push(x),h.selectedAction.value=null,h.selectedNode.value=null,d.state=void 0}},fillColor:d=>o.gte(e.value,Ee[d.state].cost)&&i.value[d.state]==null?"var(--accent2)":"var(--danger)",visibility:d=>d.state!=null,confirmationLabel:d=>o.gte(e.value,Ee[d.state].cost)?i.value[d.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:d=>d.state==null||i.value[d.state]!=null?0:o.div(e.value,Ee[d.state].cost).clampMax(1).toNumber(),progressDisplay:Wt.Fill,progressColor:d=>d.state!=null&&o.gte(e.value,Ee[d.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(d,k){return k.type==="resource"},onDrop(d,k){const x=k.state.type;d.state===x?d.state=void 0:d.state=x,h.selectedNode.value=d},draggable:!0},resource:{shape:Ae.Circle,size:50,title:d=>tt(d.state.type),subtitle:d=>Ge(d.state.amount),progress:d=>u(d.state.type),onClick(){},progressDisplay:Wt.Outline,progressColor:"var(--accent3)",classes:d=>{var k;return{"affected-node":Se.value!=null&&B(Se.value)&&Se.value.state.resources.includes(d.state.type)||o.neq((k=lt.value[d.state.type])!=null?k:1,1)}},draggable:!0},passive:{shape:Ae.Circle,size:50,title:d=>Ee[d.state].name,label:d=>d===h.selectedNode.value?{text:xi[d.state].description(V.value!=null&&B(V.value)&&V.value.state.tools.includes(d.state))}:null,outlineColor:"var(--bought)",classes:d=>({"affected-node":V.value!=null&&B(V.value)&&V.value.state.tools.includes(d.state)}),draggable:!0},dowsing:{shape:Ae.Diamond,size:50,title:"\u{1F962}",label:d=>d===h.selectedNode.value?{text:d.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${d.state.resources.length}/${d.state.maxConnections})`}:_(d,k=>`Double ${k} odds`),actionDistance:Math.PI/4,actions:[y,w(d=>d.add(2).pow_base(100),16),N],classes:d=>({running:B(d)}),canAccept:R,onDrop:$,draggable:!0},quarry:{shape:Ae.Diamond,size:50,title:"\u26CF\uFE0F",label:d=>d===h.selectedNode.value?{text:d.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${d.state.resources.length}/${d.state.maxConnections})`}:_(d,k=>`Gather ${Ht(o.div(Fe[k].computedModifier.value,100))} ${k}/s`),actionDistance:Math.PI/4,actions:[y,w(d=>d.add(2).pow_base(1e4),16),N],progress:d=>B(d)?o.eq(g.value,0)?0:new o(d.state.progress).div(g.value).toNumber():0,progressDisplay:Wt.Outline,progressColor:"var(--accent2)",canAccept:R,onDrop:$,classes:d=>({running:B(d)}),draggable:!0},empowerer:{shape:Ae.Diamond,size:50,title:"\u{1F50C}",label:d=>d===h.selectedNode.value?{text:d.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${d.state.tools.length}/${d.state.maxConnections})`}:E(d,k=>`Double ${Ee[k].name}'s effect`),actionDistance:Math.PI/4,actions:[y,w(d=>d.add(3).pow_base(1e3),16),N],canAccept:T,onDrop:L,classes:d=>({running:B(d)}),draggable:!0},portalGenerator:{shape:Ae.Diamond,size:50,title:"\u26E9\uFE0F",label:d=>{if(d===h.selectedNode.value)return{text:d.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${d.state.tier}-tier portal`};const k=h.draggingNode.value;if((k==null?void 0:k.type)==="resource"){const x=k.state.type;return{text:d.state.tier===x?"Disconnect":`${tt(x)}-tier Portal`,color:"var(--accent2)"}}else if((k==null?void 0:k.type)==="influence"){const x=k.state.type,{influences:O}=d.state;return O.includes(x)?{text:"Disconnect",color:"var(--accent2)"}:{text:"Add influence",color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(d){d.state={...d.state,tier:void 0,influences:[]},h.selectedAction.value=null,h.selectedNode.value=null},visibility:d=>{const{tier:k,influences:x}=d.state;return k!=null||x.length>0}},{id:"makePortal",icon:"done",tooltip:d=>({text:`Spawn ${d.state.tier}-tier portal`}),onClick(d){let k=0;for(;`portal-${k}`in we;)k++;const{tier:x,influences:O}=d.state;li(nr(`portal-${k}`,x,Math.floor(Math.random()*4294967296),O.map(ue=>r.value[ue].state)),X);const H={id:Tn(h),position:{...d.position},type:"portal",state:{id:`portal-${k}`,powered:!1}};h.placeInAvailableSpace(H),h.nodes.value.push(H),h.selectedAction.value=null,h.selectedNode.value=null,d.state={tier:void 0,influences:[]}},visibility:d=>d.state.tier!=null}],canAccept(d,k){return k.type==="resource"||k.type==="influence"},onDrop(d,k){if(k.type==="resource"){const x=k.state.type,O=d.state.tier;d.state={...d.state,tier:x===O?void 0:x}}else if(k.type==="influence"){const x=k.state.type,O=d.state.influences;O.includes(x)?d.state={...d.state,influences:O.filter(H=>H!==x)}:d.state={...d.state,influences:[...O,x]}}h.selectedNode.value=d},draggable:!0},portal:{shape:Ae.Diamond,size:50,title:"\u{1F300}",label:d=>d===h.selectedNode.value?{text:`Portal to ${we[d.state.id].name}`,color:we[d.state.id].color}:null,actionDistance:Math.PI/4,actions:[N],classes:d=>({running:B(d),showNotif:we[d.state.id].showNotif.value}),outlineColor:d=>we[d.state.id].background,draggable:!0},influence:{shape:d=>d.state.type==="increaseResources"||d.state.type==="decreaseResources"?Ae.Diamond:Ae.Circle,size:50,title:d=>Dt[d.state.type].display,label:d=>{if(d===h.selectedNode.value){const k=d.state,x=Dt[k.type].description;return{text:typeof x=="function"?x(k):x}}return null},actionDistance:Math.PI/4,actions:[y],canAccept:(d,k)=>k.type!=="resource"?!1:Array.isArray(d.state),onDrop:(d,k)=>{if(k.type!=="resource")return;const x=k.state.type,O=d.state;O.includes(x)?d.state=O.filter(H=>H!==x):d.state=[...O,x],h.selectedNode.value=d},outlineColor:"var(--danger)",draggable:!0}},style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const d=[];if(d.push(...Object.keys(l).map(k=>({startNode:K.value,endNode:n.value[k],stroke:"var(--accent3)",strokeWidth:5}))),le.value!=null&&le.value.state!=null&&d.push({startNode:le.value,endNode:n.value[le.value.state],stroke:"var(--foreground)",strokeWidth:4}),Se.value!=null&&Se.value.state.resources.forEach(k=>{d.push({startNode:Se.value,endNode:n.value[k],stroke:B(Se.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),Te.value!=null&&Te.value.state.resources.forEach(k=>{d.push({startNode:Te.value,endNode:n.value[k],stroke:"var(--foreground)",strokeWidth:4})}),d.push(...Object.keys(c).map(k=>({startNode:Te.value,endNode:n.value[k],stroke:"var(--accent3)",strokeWidth:5}))),V.value!=null&&V.value.state.tools.forEach(k=>{d.push({startNode:V.value,endNode:i.value[k],stroke:B(V.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),ge.value!=null){const k=ge.value.state;k.tier!=null&&d.push({startNode:ge.value,endNode:n.value[k.tier],stroke:"var(--foreground)",strokeWidth:4}),k.influences.forEach(x=>{console.log(x),d.push({startNode:ge.value,endNode:r.value[x],stroke:"var(--foreground)",strokeWidth:4})}),h.types.portal.nodes.value.forEach(x=>{const O=we[x.state.id];return O.links.value.forEach(H=>{H.value!=null&&d.push({startNode:x,endNode:H.value,stroke:B(x)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(O.resourceMultis.value).forEach(H=>{H!=="energy"&&H in n.value&&d.push({startNode:x,endNode:n.value[H],stroke:B(x)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),d})}return Object.values(r.value).forEach(k=>{const x=k.state;(x.type==="increaseResources"||x.type==="decreaseResources")&&x.data.forEach(O=>{d.push({startNode:k,endNode:n.value[O],stroke:"var(--foreground)",strokeWidth:4})})}),d}}));function B(h){return h===A.selectedNode.value||h.state.powered}const K=I(()=>A.types.mine.nodes.value[0]),le=I(()=>A.types.factory.nodes.value[0]),Se=I(()=>i.value.sand),Te=I(()=>i.value.wood),V=I(()=>i.value.coal),ge=I(()=>i.value.iron);function Pe(h,d){let k=n.value[h];if(d=o.times(d,St[h].computedModifier.value),k==null)k={id:Tn(A),position:{...K.value.position},type:"resource",state:{type:h,amount:d}},A.placeInAvailableSpace(k),A.nodes.value.push(k);else{const x=k.state;k.state={...x,amount:o.add(x.amount,d)}}}const Be=I(()=>Object.keys(He).reduce((h,d)=>h+new o(Fe[d].computedModifier.value).toNumber(),0)),lt=I(()=>{const h={};return A.types.portal.nodes.value.forEach(d=>{if(!B(d))return;const x=we[d.state.id].resourceMultis.value;Object.keys(x).forEach(O=>{h[O]!=null?h[O]=o.times(h[O],x[O]):h[O]=x[O]})}),h}),Xe=zt(()=>[...Et.map(h=>mt(()=>({description:()=>`${tt(h)} (Lv. ${Ge(a.value[h])}) (${Ht(W.value)}x per level)`,multiplier:()=>o.pow(W.value,a.value[h]),enabled:()=>{var d,k;return h in n.value&&o.gt((k=(d=n.value[h].state)==null?void 0:d.amount)!=null?k:0,0)}}))),mt(()=>({multiplier:()=>V.value!=null&&B(V.value)&&V.value.state.tools.includes("stone")?4:2,description:()=>(V.value!=null&&B(V.value)&&V.value.state.tools.includes("stone")?"Empowered ":"")+Ee.stone.name,enabled:()=>i.value.stone!=null})),mt(()=>({multiplier:()=>{var h;return(h=lt.value.energy)!=null?h:1},description:"Planar Treasures",enabled:()=>{var h;return o.neq((h=lt.value.energy)!=null?h:1,1)}})),bn(()=>({addend:()=>o.pow(100,f.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(f.value,0)}))]),dn=I(()=>Xe.apply(1)),Mn=zt(()=>[mt(()=>({multiplier:()=>V.value!=null&&B(V.value)&&V.value.state.tools.includes("dirt")?4:2,description:()=>(V.value!=null&&B(V.value)&&V.value.state.tools.includes("dirt")?"Empowered ":"")+Ee.dirt.name,enabled:()=>i.value.dirt!=null}))]),Hn=I(()=>Mn.apply(1)),yt=zt(()=>[mt(()=>({multiplier:()=>V.value!=null&&B(V.value)&&V.value.state.tools.includes("gravel")?4:2,description:()=>(V.value!=null&&B(V.value)&&V.value.state.tools.includes("gravel")?"Empowered ":"")+Ee.gravel.name,enabled:()=>i.value.gravel!=null}))]),Sn=I(()=>yt.apply(1)),G=zt(()=>[bn(()=>({addend:()=>V.value!=null&&B(V.value)&&V.value.state.tools.includes("copper")?.002:.001,description:()=>(V.value!=null&&B(V.value)&&V.value.state.tools.includes("copper")?"Empowered ":"")+Ee.copper.name,enabled:()=>i.value.copper!=null}))]),W=I(()=>G.apply(1.01)),Fe=Object.keys(He).reduce((h,d)=>{const k=zt(()=>[mt(()=>({multiplier:2,description:"Dowsing",enabled:()=>Se.value!=null&&B(Se.value)&&Se.value.state.resources.includes(d)}))]),x=I(()=>k.apply(He[d])),O={title:`${tt(d)} Drop Rate`,modifier:k,base:He[d]};return h[d]={modifier:k,computedModifier:x,section:O},h},{}),St=Object.keys(He).reduce((h,d)=>{const k=zt(()=>[mt(()=>({multiplier:()=>{var H;return(H=lt.value[d])!=null?H:1},description:"Planar Treasures",enabled:()=>{var H;return o.neq((H=lt.value[d])!=null?H:1,1)}}))]),x=I(()=>k.apply(1)),O={title:`${tt(d)} Gain`,modifier:k};return h[d]={modifier:k,computedModifier:x,section:O},h},{}),[Vt,je]=hn(()=>[{title:"Energy Gain",modifier:Xe,base:1,unit:"/s"}]),[Qt,It]=hn(()=>[{title:"Mining Speed",modifier:Mn,base:1,unit:"/s",visible:()=>i.value.dirt!=null},{title:"Ore Dropped",modifier:yt,base:1,visible:()=>i.value.gravel!=null},{title:"Material Level Effect",modifier:G,base:1.01,visible:()=>i.value.copper!=null}]),[In,ze]=hn(()=>Object.values(Fe).map(h=>h.section)),[fn,Rt]=hn(()=>Object.values(St).map(h=>h.section)),xt=Dl({general:()=>({display:"Energy",glowColor(){return xt.activeTab.value===this.tab?"white":""},tab:Vt,energyTabCollapsed:je}),mining:()=>({display:"Mine",glowColor(){return xt.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(i.value).length>0,tab:Qt,miningTabCollapsed:It}),resources:()=>({display:"Mine Rates",glowColor(){return xt.activeTab.value===this.tab?"white":""},visibility:()=>Se.value!=null,tab:In,resourcesCollapsed:ze}),resourcesGain:()=>({display:"Resource Gain",glowColor(){return xt.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(St).some(h=>o.neq(h.computedModifier.value,1)),tab:fn,resourceGainCollapsed:Rt})}),Lt=z(!1),en=ne(()=>p(kt,{modelValue:Lt.value,"onUpdate:modelValue":h=>Lt.value=h},{header:()=>p("h2",null,[q("Modifiers")]),body:()=>Ze(xt)}));this.on("preUpdate",h=>{if(Object.keys(l).forEach(d=>{l[d]-=h,l[d]<=0&&delete l[d]}),Object.keys(c).forEach(d=>{c[d]-=h,c[d]<=0&&delete c[d]}),B(K.value)){const d=o.add(K.value.state.progress,o.times(Hn.value,h)),k=d.floor();K.value.state={...K.value.state,progress:o.sub(d,k)};const x=k.div(Be.value).floor();x.gt(0)&&Et.forEach(H=>{Pe(H,o.times(new o(Fe[H].computedModifier.value).toNumber(),x).times(Sn.value)),l[H]=.3});const O=o.sub(k,x).toNumber();for(let H=0;H0){let x=o.add(d,h);const O=o.div(d,g.value).floor();x=o.sub(x,o.times(O,g.value)),Te.value.state={...Te.value.state,progress:x},o.gt(O,0)&&k.forEach(H=>{Pe(H,O),c[H]=.3})}}e.value=o.add(e.value,o.times(dn.value,h)),o.lt(e.value,0)&&(e.value=0,K.value.state={...K.value.state,powered:!1},Ii.warning(p("div",null,[p("h3",null,[q("Ran out of energy!")]),p("div",null,[q("All machines have been turned off.")])])))});const xn=I(()=>{var h,d;return A.selectedAction.value===A.types.brokenFactory.actions[0]?-100:A.selectedAction.value===A.types.factory.actions[1]?o.neg(Ee[A.selectedNode.value.state].cost):((h=A.selectedAction.value)==null?void 0:h.id)==="moreConnections"?o.neg(A.selectedAction.value.formula.evaluate(((d=A.selectedNode.value)==null?void 0:d.state).maxConnections)):0}),De=Vn(m.variable(0).add(e),()=>o.neq(xn.value,0),xn),ut=I(()=>{var h;return A.selectedAction.value===N?((h=A.selectedNode.value)==null?void 0:h.state).powered?o.eq(f.value,1)?10:o.pow(100,f.value).div(10).times(.99):o.neg(v.value):0}),Ie=Vn(m.variable(0).add(dn),()=>o.neq(ut.value,0),ut),Ue=I(()=>A.types.portal.nodes.value.filter(h=>B(h)));return st(Ue,h=>{Nt(()=>{X.tabs=["main",...h.map(d=>d.state.id)]})}),{name:"World",board:A,energy:e,modifierTabs:xt,mineLootTable:He,tools:Ee,passives:xi,resourceNodes:n,toolNodes:i,influenceNodes:r,grantResource:Pe,activePortals:Ue,display:ne(()=>p(se,null,[p(qn,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[Ze(De)])," ",q("energy")]),p("span",{class:"nav-segment"},[q("("),p("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt(dn.value,0)?"+":"",Ze(Ie)]),q("/s)")]),o.gt(f.value,0)?p("span",{class:"nav-segment"},[p("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[Ge(f.value)])," ",q("machines powered")]):null,p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>Lt.value=!0},[q("modifiers")])]),X.devSpeed===0?p("span",{class:"nav-segment"},[q("Game Paused")]):X.devSpeed!=null&&X.devSpeed!==1?p("span",{class:"nav-segment"},[q("Dev Speed: "),Ht(X.devSpeed),q("x")]):null]}),Ze(A),Ze(en)]))}}),jc=e=>{var i,r,a,u,l;const t=[Re];let n=0;for(;`portal-${n}`in((i=e.layers)!=null?i:{});){const c=(r=e.layers)==null?void 0:r[`portal-${n}`];t.push(nr(`portal-${n}`,(a=c.tier)!=null?a:"dirt",(u=c.seed)!=null?u:Math.floor(Math.random()*4294967296),(l=c.influences)!=null?l:[])),n++}return t},ir=I(()=>!1);function zc(e,t){}var Uc=Object.freeze(Object.defineProperty({__proto__:null,mineLootTable:He,resourceNames:Et,influences:Dt,main:Re,getInitialLayers:jc,hasWon:ir,fixOldSave:zc},Symbol.toStringTag,{value:"Module"}));const kn=e=>(Jt("data-v-4a50ce42"),e=e(),Kt(),e),Gc={class:"game-over-modal-header"},Wc=["src","alt"],Hc={class:"game-over-modal-title"},Zc=kn(()=>C("h2",null,"Congratulations!",-1)),Yc={key:0},Jc=kn(()=>C("br",null,null,-1)),Kc=kn(()=>C("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Xc=kn(()=>C("br",null,null,-1)),Qc=["href"],ed=kn(()=>C("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),td=Q({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:a,versionTitle:u}=de,l=I(()=>Bn(X.timePlayed)),c=I(()=>ir.value&&!X.keepGoing),f=qt(X,"autosave");function v(){X.keepGoing=!0}function g(){Ut(rn())}return(y,N)=>(S(),te(kt,{"model-value":s(c)},{header:Z(()=>[C("div",Gc,[s(n)?(S(),D("img",{key:0,class:"game-over-modal-logo",src:s(n),alt:s(t)},null,8,Wc)):U("",!0),C("div",Hc,[Zc,C("h4",null,"You've beaten "+ie(s(t))+" v"+ie(s(a))+": "+ie(s(u)),1)])])]),body:Z(({shown:w})=>[w?(S(),D("div",Yc,[C("div",null,"It took you "+ie(s(l))+" to beat the game.",1),Jc,Kc,Xc,C("div",null,[C("a",{href:s(r),class:"game-over-modal-discord-link"},[ed,q(" "+ie(s(i)),1)],8,Qc)]),p(wt,{title:"Autosave",modelValue:s(f),"onUpdate:modelValue":N[0]||(N[0]=_=>Me(f)?f.value=_:null)},null,8,["modelValue"])])):U("",!0)]),footer:Z(()=>[C("div",{class:"game-over-footer"},[C("button",{onClick:v,class:"button"},"Keep Going"),C("button",{onClick:g,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var nd=fe(td,[["__scopeId","data-v-4a50ce42"]]);const Wn=e=>(Jt("data-v-2776d67d"),e=e(),Kt(),e),id=Wn(()=>C("div",{class:"nan-modal-header"},[C("h2",null,"NaN value detected!")],-1)),rd={key:0},ad=Wn(()=>C("br",null,null,-1)),sd=["href"],od=Wn(()=>C("span",{class:"material-icons nan-modal-discord"},"discord",-1)),ld=Wn(()=>C("br",null,null,-1)),ud={class:"nan-footer"},cd=Q({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=de,i=z(!0),r=z(!0),a=qt(xe,"hasNaN"),u=z(null);st(a,y=>{y?(i.value=X.autosave,r.value=X.devSpeed===0):(X.autosave=i.value,X.devSpeed=r.value?0:null)});const l=I(()=>{var y;return(y=xe.NaNPath)==null?void 0:y.join(".")}),c=I(()=>xe.NaNPersistent!=null?xe.NaNPersistent.value:null);function f(){xe.NaNPersistent!=null&&(xe.NaNPersistent.value=new o(0),xe.hasNaN=!1)}function v(){xe.NaNPersistent&&(xe.NaNPersistent.value=new o(1),xe.hasNaN=!1)}function g(){xe.NaNPersistent&&(xe.NaNPersistent.value=new o(NaN),xe.hasNaN=!1)}return(y,N)=>(S(),D(se,null,[p(kt,Ct({modelValue:s(a),"onUpdate:modelValue":N[4]||(N[4]=w=>Me(a)?a.value=w:null)},y.$attrs),{header:Z(()=>[id]),body:Z(()=>[C("div",null,[q(' Attempted to assign "'+ie(s(l))+'" to NaN',1),s(c)?(S(),D("span",rd,ie(" ")+"(previously "+ie(s(Ht)(s(c)))+")",1)):U("",!0),q(". Auto-saving has been "+ie(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),ad,C("div",null,[C("a",{href:s(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[od,q(" "+ie(s(t)||"The Paper Pilot Community"),1)],8,sd)]),ld,p(wt,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=w=>i.value=w)},null,8,["modelValue"]),s(de).enablePausing?(S(),te(wt,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":N[1]||(N[1]=w=>r.value=w)},null,8,["modelValue"])):U("",!0)]),footer:Z(()=>[C("div",ud,[C("button",{onClick:N[2]||(N[2]=w=>{var _;return(_=u.value)==null?void 0:_.open()}),class:"button"},"Open Saves Manager"),C("button",{onClick:f,class:"button"},"Set to 0"),C("button",{onClick:v,class:"button"},"Set to 1"),s(c)&&s(o).neq(s(c),0)&&s(o).neq(s(c),1)?(S(),D("button",{key:0,onClick:N[3]||(N[3]=w=>a.value=!1),class:"button"}," Set to previous ")):U("",!0),C("button",{onClick:g,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),p(Zi,{ref_key:"savesManager",ref:u},null,512)],64))}});var dd=fe(cd,[["__scopeId","data-v-2776d67d"]]);const fd={key:0,class:"tpsDisplay"},gd={key:0,class:"low"},pd=Q({__name:"TPS",setup(e){const t=I(()=>o.div(xe.lastTenTicks.length,xe.lastTenTicks.reduce((a,u)=>a+u,0))),n=z([]);nt(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=I(()=>n.value.reduce((a,u)=>o.max(a,u),0)),r=I(()=>o.sub(t.value,i.value).gt(1));return(a,u)=>s(t).isNan()?U("",!0):(S(),D("div",fd,[q(" TPS: "+ie(s(Ge)(s(t)))+" ",1),p(sn,{name:"fade"},{default:Z(()=>[s(r)?(S(),D("span",gd,ie(s(Ge)(s(i))),1)):U("",!0)]),_:1})]))}});var md=fe(pd,[["__scopeId","data-v-46a3ed5b"]]);var vd=Q({__name:"App",setup(e){const t=de.useHeader,n=I(()=>dt[re.theme].variables),i=qt(re,"showTPS"),r=I(()=>ae(ne(()=>p(se,null,[xa.map(Ze)]))));return(a,u)=>(S(),D(se,null,[C("div",{id:"modal-root",style:qe(s(n))},null,4),C("div",{class:pe(["app",{useHeader:s(t)}]),style:qe(s(n))},[s(t)?(S(),te(Yi,{key:0})):U("",!0),p(Go),s(s(i))?(S(),te(md,{key:1})):U("",!0),p(nd),p(dd),(S(),te(Oe(s(r))))],6)],64))}});var hd=fe(vd,[["__scopeId","data-v-41d15e5e"]]);function bd(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:u}=e;let l,c,f,v;const g=async(N=!0)=>{await f,N&&(l==null||l.addEventListener("controlling",w=>{w.isUpdate&&window.location.reload()})),await(v==null?void 0:v())};async function y(){if("serviceWorker"in navigator){const{Workbox:N,messageSW:w}=await yn(()=>import("./workbox-window.4a8794bb.js"),[]);v=async()=>{c&&c.waiting&&await w(c.waiting,{type:"SKIP_WAITING"})},l=new N("./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 f=y(),g}function yd(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:u}=e,l=z(!1),c=z(!1);return{updateServiceWorker:bd({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=de.title;window.projInfo=de;if(de.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 Na();const{globalBus:e}=await yn(()=>Promise.resolve().then(function(){return wa}),void 0),{startGameLoop:t}=await yn(()=>import("./gameLoop.dc03ce30.js"),["assets/gameLoop.dc03ce30.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","assets/unique-names-generator.5494b30b.js"]),n=window.vue=gr(hd);e.emit("setupVue",n),n.mount("#app"),Nt(()=>{const i=Ln(),{updateServiceWorker:r}=yd({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,yn as _,xe as a,de as b,Uc as c,Ve as g,Ca as l,X as p,re as s}; diff --git a/assets/index.83961fb5.css b/assets/index.43bdca03.css similarity index 99% rename from assets/index.83961fb5.css rename to assets/index.43bdca03.css index e9d28bb..fd91e14 100644 --- a/assets/index.83961fb5.css +++ b/assets/index.43bdca03.css @@ -1 +1 @@ -.table{display:flex;flex-flow:column wrap;justify-content:center;align-items:center;max-width:100%;margin:0 auto}.table+.table{margin-top:10px}.row{display:flex;flex-flow:row wrap;justify-content:center;align-items:stretch;max-width:100%;margin:0 10px}.row>:not(.feature){margin:0;display:flex}.col{display:flex;flex-flow:column wrap;justify-content:center;align-items:center;height:100%;margin:10px 0}.row.mergeAdjacent>.feature:not(.dontMerge),.row.mergeAdjacent>.tooltip-container>.feature:not(.dontMerge){margin-left:0;margin-right:0;border-radius:0}.row.mergeAdjacent>.feature:not(.dontMerge):first-child,.row.mergeAdjacent>.tooltip-container:first-child>.feature:not(.dontMerge){border-radius:var(--border-radius) 0 0 var(--border-radius)}.row.mergeAdjacent>.feature:not(.dontMerge):last-child,.row.mergeAdjacent>.tooltip-container:last-child>.feature:not(.dontMerge){border-radius:0 var(--border-radius) var(--border-radius) 0}.row.mergeAdjacent>.feature:not(.dontMerge):first-child:last-child,.row.mergeAdjacent>.tooltip-container:first-child:last-child>.feature:not(.dontMerge){border-radius:var(--border-radius)}.row-grid.mergeAdjacent>.feature:not(.dontMerge),.row-grid.mergeAdjacent>.tooltip-container>.feature:not(.dontMerge){margin:0;border-radius:0}.row-grid.mergeAdjacent>.feature:not(.dontMerge):last-child,.row-grid.mergeAdjacent>.tooltip-container:last-child>.feature:not(.dontMerge){border-radius:0}.row-grid.mergeAdjacent>.feature:not(.dontMerge):first-child,.row-grid.mergeAdjacent>.tooltip-container:first-child>.feature:not(.dontMerge){border-radius:0}.table-grid>.row-grid.mergeAdjacent:last-child>.feature:not(.dontMerge):first-child{border-radius:0 0 0 var(--border-radius)}.table-grid>.row-grid.mergeAdjacent:first-child>.feature:not(.dontMerge):last-child{border-radius:0 var(--border-radius) 0 0}.table-grid>.row-grid.mergeAdjacent:first-child>.feature:not(.dontMerge):first-child{border-radius:var(--border-radius) 0 0 0}.table-grid>.row-grid.mergeAdjacent:last-child>.feature:not(.dontMerge):last-child{border-radius:0 0 var(--border-radius) 0}.col.mergeAdjacent .feature:not(.dontMerge){margin-top:0;margin-bottom:0;border-radius:0}.col.mergeAdjacent .feature:not(.dontMerge):first-child{border-radius:var(--border-radius) var(--border-radius) 0 0}.col.mergeAdjacent .feature:not(.dontMerge):last-child{border-radius:0 0 var(--border-radius) var(--border-radius)}.col.mergeAdjacent .feature:not(.dontMerge):first-child:last-child{border-radius:var(--border-radius)}.resize-listener[data-v-2b1dc1bc]{position:absolute;top:0px;left:0;right:-4px;bottom:5px;z-index:-10;pointer-events:none}.modal-mask{position:fixed;z-index:9998;top:0;left:0;bottom:0;right:0;background-color:#00000080;transition:opacity .3s ease}.modal-wrapper{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.modal-container{width:640px;max-width:95vw;max-height:95vh;background-color:var(--background);padding:20px;border-radius:5px;transition:all .3s ease;text-align:left;border:var(--modal-border);box-sizing:border-box;display:flex;flex-direction:column}.modal-header{width:100%}.modal-body{margin:20px 0;width:100%;overflow-y:auto;overflow-x:hidden}.modal-footer{width:100%}.modal-default-footer{display:flex}.modal-default-flex-grow{flex-grow:1}.modal-enter-from,.modal-leave-active{opacity:0}.modal-enter-from .modal-container,.modal-leave-active .modal-container{-webkit-transform:scale(1.1);transform:scale(1.1)}.layer-container[data-v-72dd78b1]{min-width:100%;min-height:100%;margin:0;flex-grow:1;display:flex;isolation:isolate}.layer-tab[data-v-72dd78b1]:not(.minimized){padding-top:20px;padding-bottom:20px;min-height:100%;flex-grow:1;text-align:center;position:relative}.inner-tab>.layer-container>.layer-tab[data-v-72dd78b1]:not(.minimized){padding-top:50px}.layer-tab.minimized[data-v-72dd78b1]{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;padding:55px 0 0;margin:0;cursor:pointer;font-size:40px;color:var(--foreground);border:none;background-color:transparent}.layer-tab.minimized>*[data-v-72dd78b1]{margin:0;writing-mode:vertical-rl;text-align:left;padding-left:10px;width:50px}.inner-tab>.layer-container>.layer-tab[data-v-72dd78b1]:not(.minimized){margin:-50px -10px;padding:50px 10px}.modal-body .layer-tab[data-v-72dd78b1]{padding-bottom:0}.modal-body .layer-tab[data-v-72dd78b1]:not(.hasSubtabs){padding-top:0}.minimize[data-v-72dd78b1]{position:sticky;top:6px;right:9px;z-index:7;line-height:30px;border:none;background:var(--background);box-shadow:var(--background) 0 2px 3px 5px;border-radius:50%;color:var(--foreground);font-size:40px;cursor:pointer;margin-top:-44px;margin-right:-30px}.minimized+.minimize[data-v-72dd78b1]{transform:rotate(-90deg);top:10px;right:18px;pointer-events:none}.goBack[data-v-72dd78b1]{position:sticky;top:10px;left:10px;line-height:30px;margin-top:-50px;margin-left:-35px;border:none;background:var(--background);box-shadow:var(--background) 0 2px 3px 5px;border-radius:50%;color:var(--foreground);font-size:30px;cursor:pointer;z-index:7}.goBack[data-v-72dd78b1]:hover{transform:scale(1.1);text-shadow:0 0 7px var(--foreground)}.layer-tab.minimized>*>.desc{color:var(--accent1);font-size:30px}details[data-v-4b4bda40]{margin:10px 0;padding-left:18px}summary[data-v-4b4bda40]{cursor:pointer;margin-bottom:10px;margin-left:-18px}ul[data-v-4b4bda40]{margin:var(--feature-margin) 0;background:var(--raised-background);border:2px solid rgba(0,0,0,.125);padding:5px 5px 5px 15px;list-style:inside}li[data-v-4b4bda40]{margin:8px 0}li[data-v-4b4bda40]:before{padding:2px 8px;margin-right:8px;border-radius:var(--border-radius)}.feature[data-v-4b4bda40]:before{content:"Feature";background:var(--accent1)}.fix[data-v-4b4bda40]:before{content:"Fix";background:var(--accent2)}.balancing[data-v-4b4bda40]:before{content:"Balancing";background:var(--accent3)}.breaking[data-v-4b4bda40]:before{content:"Breaking";background:var(--danger)}.tooltip-container[data-v-6102fa3a]{position:relative;--xoffset: 0px;--yoffset: 0px;text-shadow:none!important}.tooltip[data-v-6102fa3a],.tooltip[data-v-6102fa3a]:after{pointer-events:none;position:absolute}.tooltip[data-v-6102fa3a]{text-align:center;width:150px;font-size:14px;line-height:1.2;bottom:calc(100% + var(--yoffset));left:calc(50% + var(--xoffset));margin-bottom:5px;transform:translate(-50%);padding:7px;border-radius:3px;background-color:var(--tooltip-background);color:var(--points);z-index:100!important;word-break:break-word}.tooltip[data-v-6102fa3a] hr{margin:var(--feature-margin) 0}.shown[data-v-6102fa3a]{z-index:10}.fade-enter-from[data-v-6102fa3a],.fade-leave-to[data-v-6102fa3a]{opacity:0}.tooltip[data-v-6102fa3a]:after{content:" ";position:absolute;top:100%;bottom:100%;left:calc(50% - var(--xoffset));width:0;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--tooltip-background) transparent transparent transparent}.tooltip.left[data-v-6102fa3a],.side-nodes .tooltip[data-v-6102fa3a]:not(.right):not(.bottom):not(.top){bottom:calc(50% + var(--yoffset));left:unset;right:calc(100% + var(--xoffset));margin-bottom:unset;margin-right:5px;transform:translateY(50%)}.tooltip.left[data-v-6102fa3a]:after,.side-nodes .tooltip[data-v-6102fa3a]:not(.right):not(.bottom):not(.top):after{top:calc(50% + var(--yoffset));bottom:unset;left:100%;right:100%;margin-left:unset;margin-top:-5px;border-color:transparent transparent transparent var(--tooltip-background)}.tooltip.right[data-v-6102fa3a]{bottom:calc(50% + var(--yoffset));left:calc(100% + var(--xoffset));margin-bottom:unset;margin-left:5px;transform:translateY(50%)}.tooltip.right[data-v-6102fa3a]:after{top:calc(50% + var(--yoffset));left:0;right:100%;margin-left:-10px;margin-top:-5px;border-color:transparent var(--tooltip-background) transparent transparent}.tooltip.bottom[data-v-6102fa3a]{top:calc(100% + var(--yoffset));bottom:unset;left:calc(50% + var(--xoffset));margin-bottom:unset;margin-top:5px;transform:translate(-50%)}.tooltip.bottom[data-v-6102fa3a]:after{top:0;margin-top:-10px;border-color:transparent transparent var(--tooltip-background) transparent}.pinned[data-v-6102fa3a]{position:absolute;right:-5px;top:-5px;transform:rotate(45deg)}.info-modal-header[data-v-4f97aa40]{display:flex;margin:-20px -20px 0;background:var(--raised-background);align-items:center}.info-modal-header *[data-v-4f97aa40]{margin:0}.info-modal-logo[data-v-4f97aa40]{height:4em;width:4em}.info-modal-title[data-v-4f97aa40]{display:flex;flex-direction:column;padding:10px 0;margin-left:10px}.info-modal-discord-link[data-v-4f97aa40]{display:flex;align-items:center}.info-modal-discord[data-v-4f97aa40]{margin:0 4px 0 0}.field{display:flex;position:relative;min-height:2em;margin:10px 0;user-select:none;justify-content:space-between;align-items:center}.field>*{margin:0}.vue-select{width:50%;border-radius:var(--border-radius)}.field-buttons .vue-select{width:unset}.vue-select,.vue-dropdown{border-color:var(--outline)}.vue-dropdown{background:var(--raised-background)}.vue-dropdown-item{color:var(--foreground)}.vue-dropdown-item,.vue-dropdown-item *{transition-duration:0s}.vue-dropdown-item.highlighted{background-color:var(--highlighted)}.vue-dropdown-item.selected,.vue-dropdown-item.highlighted.selected{background-color:var(--bought)}.vue-input input{font-size:inherit}.vue-input input::placeholder{color:var(--link)}.field[data-v-11046116]{cursor:pointer}input[data-v-11046116]{appearance:none;pointer-events:none}span[data-v-11046116]{width:100%;padding-right:41px;position:relative}input+span[data-v-11046116]:before{content:"";position:absolute;top:calc(50% - 7px);right:0px;border-radius:7px;width:36px;height:14px;background-color:var(--outline);opacity:.38;vertical-align:top;transition:background-color .2s,opacity .2s}input+span[data-v-11046116]:after{content:"";position:absolute;top:calc(50% - 10px);right:16px;border-radius:50%;width:20px;height:20px;background-color:var(--locked);box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;transition:background-color .2s,transform .2s}input:checked+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}input:checked+span[data-v-11046116]:after{background-color:var(--link);transform:translate(16px)}input:active+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}input:checked:active+span[data-v-11046116]:before{background-color:var(--outline);opacity:.38}input:disabled+span[data-v-11046116]{color:#000;opacity:.38;cursor:default}input:disabled+span[data-v-11046116]:before{background-color:var(--outline);opacity:.38}input:checked:disabled+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}.feedback[data-v-01a1b95c]{position:relative}.feedback[data-v-01a1b95c]:after{position:absolute;left:calc(100% + 5px);top:50%;transform:translateY(-50%);content:"\2714";opacity:0;pointer-events:none;box-shadow:inset 0 0 0 35px #6f94b600;text-shadow:none}.feedback.left[data-v-01a1b95c]:after{left:unset;right:calc(100% + 5px)}.feedback.activated[data-v-01a1b95c]:after{animation:feedback-01a1b95c .5s ease-out forwards}@keyframes feedback-01a1b95c{0%{opacity:1;transform:scale3d(.4,.4,1),translateY(-50%)}80%{opacity:.1}to{opacity:0;transform:scale3d(1.2,1.2,1),translateY(-50%)}}.option-tabs{border-bottom:2px solid var(--outline);margin-top:10px;margin-bottom:-10px}.option-tabs button{background-color:transparent;color:var(--foreground);margin-bottom:-2px;font-size:14px;cursor:pointer;padding:5px 20px;border:none;border-bottom:2px solid var(--foreground)}.option-tabs button:not(.selected){border-bottom-color:transparent}.option-title .tooltip-container{display:inline;margin-left:5px}.option-title desc{display:block;opacity:.6;font-size:small;width:300px;margin-left:0}.save-button{text-align:right}form[data-v-90bd4994]{margin:0;width:100%}.field>*[data-v-90bd4994]{margin:0}input[data-v-90bd4994]{width:50%;outline:none;border:solid 1px var(--outline);background-color:unset;border-radius:var(--border-radius)}.fullWidth[data-v-90bd4994]{width:100%}.container[data-v-2f8ef34c]{display:flex;align-items:center;background:var(--raised-background);box-shadow:var(--raised-background) 0 2px 3px 5px}.container.confirming button[data-v-2f8ef34c]{font-size:1em}.container>*[data-v-2f8ef34c]{margin:0 4px}.danger,.button.danger{position:relative;border:solid 2px var(--danger);border-right-width:16px}.danger:after{position:absolute;content:"!";color:#fff;right:-13px}.save[data-v-32313015]{position:relative;border:solid 4px var(--outline);padding:4px;background:var(--raised-background);margin:var(--feature-margin);display:flex;align-items:center;min-height:30px}.save.active[data-v-32313015]{border-color:var(--bought)}.open[data-v-32313015]{display:inline;margin:0;padding-left:0}.handle[data-v-32313015]{flex-grow:0;margin-right:8px;margin-left:0;cursor:pointer}.details[data-v-32313015]{margin:0 80px 0 0;flex-grow:1}.error[data-v-32313015]{font-size:.8em;color:var(--danger)}.save-version[data-v-32313015]{margin-left:4px;font-size:.7em;opacity:.7}.actions[data-v-32313015]{position:absolute;top:0;bottom:0;right:4px;display:flex;padding:4px;z-index:1}.editname[data-v-32313015]{margin:0}.save button{transition-duration:0s}.save .actions button{display:flex;font-size:1.2em}.save .actions button .material-icons{font-size:unset}.save .button.danger{display:flex;align-items:center;padding:4px}.save .field,.field form[data-v-2a4275be],.field .field-title[data-v-2a4275be],.field .field-buttons[data-v-2a4275be]{margin:0}.field-buttons[data-v-2a4275be]{display:flex}.field-buttons .field[data-v-2a4275be]{margin:0 0 0 8px}.modal-footer[data-v-2a4275be]{margin-top:-20px}.footer[data-v-2a4275be]{display:flex;margin-top:20px}.importingFailed input{color:red}.field-buttons .v-select{width:220px}.presets .vue-select[aria-expanded=true] vue-dropdown{visibility:hidden}.nav[data-v-318a1c31]{background-color:var(--raised-background);display:flex;left:0;right:0;top:0;height:46px;width:100%;border-bottom:4px solid var(--outline)}.nav>*[data-v-318a1c31]{height:46px;width:46px;display:flex;cursor:pointer;flex-shrink:0}.nav>.banner[data-v-318a1c31]{height:100%;width:unset}.overlay-nav[data-v-318a1c31]{position:fixed;top:10px;left:10px;display:flex;flex-direction:column;z-index:2}.overlay-nav>*[data-v-318a1c31]{height:50px;width:50px;display:flex;cursor:pointer;margin:0;align-items:center;justify-content:center}.title[data-v-318a1c31]{font-size:36px;text-align:left;margin-left:12px;cursor:unset}.nav>.title[data-v-318a1c31]{width:unset;flex-shrink:1;overflow:hidden;white-space:nowrap}.nav .saves[data-v-318a1c31],.nav .info[data-v-318a1c31]{display:flex}.tooltip-container[data-v-318a1c31]{width:100%;height:100%;display:flex}.overlay-nav .discord[data-v-318a1c31]{position:relative}.discord img[data-v-318a1c31]{width:100%;height:100%}.discord-links[data-v-318a1c31]{position:fixed;top:45px;padding:20px;right:-280px;width:200px;transition:right .25s ease;background:var(--raised-background);z-index:10}.overlay-nav .discord-links[data-v-318a1c31]{position:absolute;left:-280px;right:unset;transition:left .25s ease}.overlay-nav .discord:hover .discord-links[data-v-318a1c31]{left:-10px}.discord-links li[data-v-318a1c31]{margin-bottom:4px}.discord-links li[data-v-318a1c31]:first-child{font-size:1.2em}*:not(.overlay-nav) .discord:hover .discord-links[data-v-318a1c31]{right:0}.material-icons[data-v-318a1c31]{font-size:36px}.material-icons[data-v-318a1c31]:hover{text-shadow:5px 0 10px var(--link),-3px 0 12px var(--foreground)}.nav .version-container[data-v-318a1c31]{display:flex;height:25px;margin-bottom:0;margin-left:10px}.overlay-nav .version-container[data-v-318a1c31]{width:unset;height:25px}.version[data-v-318a1c31]{color:var(--points)}.version:hover span[data-v-318a1c31]{text-shadow:5px 0 10px var(--points),-3px 0 12px var(--points)}.nav>div>a[data-v-318a1c31],.overlay-nav>div>a[data-v-318a1c31]{color:var(--foreground);text-shadow:none}.tabs-container[data-v-dcd207b4]{width:100vw;flex-grow:1;overflow-x:auto;overflow-y:hidden;display:flex}.tabs-container[data-v-dcd207b4]:not(.useHeader){width:calc(100vw - 50px);margin-left:50px}.tab[data-v-dcd207b4]{position:relative;height:100%;flex-grow:1;transition-duration:0s;overflow-y:auto;overflow-x:hidden}.inner-tab[data-v-dcd207b4]{padding:50px 10px;min-height:calc(100% - 100px);display:flex;flex-direction:column;margin:0;flex-grow:1}.tab+.tab>.inner-tab[data-v-dcd207b4]{border-left:solid 4px var(--outline)}.tab hr{height:4px;border:none;background:var(--outline);margin:var(--feature-margin) 0}.tab .modal-body hr{margin:7px 0}.sticky[data-v-cccac690]{position:sticky;background:var(--background);width:calc(100% - 2px);z-index:3}.link[data-v-57c4970a]{transition-duration:0s}.link.pulsing[data-v-57c4970a]{animation:pulsing-57c4970a 2s ease-in infinite}@keyframes pulsing-57c4970a{0%{opacity:.25}50%{opacity:1}to{opacity:.25}}.action:not(.boardnode):hover circle[data-v-9efb2a56],.action:not(.boardnode).selected circle[data-v-9efb2a56]{r:25}.action:not(.boardnode):hover text[data-v-9efb2a56],.action:not(.boardnode).selected text[data-v-9efb2a56]{font-size:187.5%}.action:not(.boardnode) text[data-v-9efb2a56]{text-anchor:middle;dominant-baseline:central}.actions-enter-from .action,.actions-leave-to .action{transform:translate(0)}.boardnode[data-v-4654be02]{cursor:pointer;transition-duration:0s}.boardnode:hover .body[data-v-4654be02]{fill:var(--highlighted)}.boardnode.running .body[data-v-4654be02]{fill:var(--accent1)!important}.boardnode:not(.isDraggable) .body[data-v-4654be02]{fill:var(--locked)}.node-title[data-v-4654be02]{text-anchor:middle;dominant-baseline:middle;font-family:monospace;font-size:200%;pointer-events:none;filter:drop-shadow(3px 3px 2px var(--tooltip-background))}.node-subtitle[data-v-4654be02]{text-anchor:middle;dominant-baseline:middle;font-family:monospace;font-size:150%;pointer-events:none;filter:drop-shadow(3px 3px 2px var(--tooltip-background))}.progress[data-v-4654be02]{transition-duration:.05s}.progressRing[data-v-4654be02]{transform:rotate(-90deg)}.fade-enter-from[data-v-4654be02],.fade-leave-to[data-v-4654be02]{opacity:0}.pulsing[data-v-4654be02]{animation:pulsing-4654be02 2s ease-in infinite}@keyframes pulsing-4654be02{0%{opacity:.25}50%{opacity:1}to{opacity:.25}}.grow-enter-from .node-container,.grow-leave-to .node-container{transform:scale(0)}.vue-pan-zoom-scene{width:100%;height:100%;cursor:grab}.vue-pan-zoom-scene:active{cursor:grabbing}.g1{transition-duration:0s}.link-enter-from,.link-leave-to{opacity:0}.tabButton[data-v-21427abb]{background-color:transparent;color:var(--foreground);font-size:20px;cursor:pointer;padding:5px 20px;margin:5px;border-radius:5px;border:2px solid;flex-shrink:0;border-color:var(--layer-color)}.tabButton[data-v-21427abb]:hover{transform:scale(1.1);text-shadow:0 0 7px var(--foreground)}:not(.floating)>.tabButton[data-v-21427abb]{height:50px;margin:0;border-left:none;border-right:none;border-top:none;border-bottom-width:4px;border-radius:0;transform:unset}:not(.floating) .tabButton[data-v-21427abb]:not(.active){border-bottom-color:transparent}.tabButton>*[data-v-21427abb]{pointer-events:none}.tab-family-container[data-v-58dbf83a]{margin:calc(50px + var(--feature-margin)) 20px var(--feature-margin) 20px;position:relative;border:solid 4px;border-color:var(--outline)}.layer-tab>.tab-family-container[data-v-58dbf83a]:first-child{margin:-4px -11px var(--feature-margin) -11px}.layer-tab>.tab-family-container[data-v-58dbf83a]:first-child:nth-last-child(3){border-bottom-style:none;border-left-style:none;border-right-style:none;height:calc(100% + 50px)}.modal-body>.tab-family-container[data-v-58dbf83a]:first-child{margin:calc(10px + var(--feature-margin)) 10px 0 10px;border:none}.tab-family-container[data-v-58dbf83a]>:nth-child(2){margin-top:20px}.modal-body>.tab-family-container[data-v-58dbf83a]>:nth-child(2){margin-top:50px}.tab-family-container[data-v-f18896fc][data-v-58dbf83a]>:last-child{margin-bottom:20px}.tab-buttons-container[data-v-58dbf83a]{z-index:4}.tab-buttons-container[data-v-58dbf83a]:not(.floating){border-bottom:solid 4px;border-color:inherit}:not(.layer-tab):not(.modal-body)>.tab-family-container>.tab-buttons-container[data-v-58dbf83a]:not(.floating){width:calc(100% + 6px);margin-left:-3px}.tab-buttons-container:not(.floating) .tab-buttons[data-v-58dbf83a]{text-align:left;margin-bottom:-4px}.tab-buttons-container.floating .tab-buttons[data-v-58dbf83a]{justify-content:center;margin-top:-25px}.tab-buttons[data-v-58dbf83a]{margin-bottom:24px;display:flex;flex-flow:wrap;z-index:4}.layer-tab>.tab-family-container:first-child:nth-last-child(3)>.tab-buttons-container>.tab-buttons[data-v-58dbf83a]{padding-right:60px}.tab-buttons[data-v-58dbf83a]:not(.floating){text-align:left;border-bottom:inherit;border-width:4px;box-sizing:border-box;height:50px}.modal-body .tab-buttons[data-v-58dbf83a]{width:100%;margin-left:0;margin-right:0;padding-left:0}.showGoBack>.tab-family-container:first-child>.tab-buttons-container:not(.floating) .tab-buttons[data-v-58dbf83a]{padding-left:70px}:not(.showGoBack)>.tab-family-container>.tab-buttons-container:not(.floating):first-child .tab-buttons[data-v-58dbf83a]{padding-left:0}.minimizable>.tab-buttons-container[data-v-58dbf83a]:not(.floating):first-child{padding-right:50px}.tab-buttons-container:not(.floating):first-child .tab-buttons[data-v-58dbf83a]{margin-top:-50px}.tab-buttons-container+*[data-v-58dbf83a]{margin-top:20px}.modifier-container{display:flex;padding:1px 8px}.modifier-container:nth-child(2n){background:var(--raised-background)}.modifier-amount{flex-shrink:0;text-align:right}:not(:first-of-type,:last-of-type)>.modifier-amount:after{content:var(--unit);opacity:0}.modifier-description{flex-grow:1}.collapsible-container[data-v-a72c16aa]{width:calc(100% - 10px)}.collapsible-toggle[data-v-a72c16aa]{max-width:unset;width:calc(100% + 0px);margin:0 0 0 -5px;background:var(--raised-background);padding:var(--feature-margin);color:var(--foreground);cursor:pointer;transition-duration:0s}.collapsible-toggle[data-v-a72c16aa]:last-child{margin-left:unset}[data-v-a72c16aa] .collapsible-toggle+.table{max-width:unset;width:calc(100% + 10px);margin-left:-5px}[data-v-a72c16aa] .col{margin-top:0;margin-bottom:0;width:100%}.mergeAdjacent .collapsible-toggle[data-v-a72c16aa]{border:0;border-top-left-radius:0!important;border-top-right-radius:0!important}[data-v-a72c16aa] .mergeAdjacent .feature:not(.dontMerge):first-child{border-top-left-radius:0!important;border-top-right-radius:0!important}.feature:not(li),.feature:not(li) button{position:relative;padding:5px;border-radius:var(--border-radius);border:2px solid rgba(0,0,0,.125);margin:var(--feature-margin);box-sizing:border-box;color:var(--feature-foreground);z-index:0;transition:all .5s,z-index 0s .5s}.can,.can button{background-color:var(--layer-color);cursor:pointer}.can:hover,.can:hover button{transform:scale(1.15);box-shadow:0 0 20px var(--points);z-index:1;transition:all .5s,z-index 0s}.locked,.locked button{background-color:var(--locked);cursor:not-allowed}.bought,.bought button{background-color:var(--bought);cursor:default}.mark[data-v-2207999f]{position:absolute;left:-25px;top:-10px;width:30px;height:30px;z-index:1;pointer-events:none;margin-left:.9em;margin-right:.9em;margin-bottom:1.2em;border-right:.3em solid transparent;border-bottom:.7em solid transparent;border-left:.3em solid transparent;font-size:10px}.star[data-v-2207999f]{left:-10px;width:0;height:0;margin-left:.9em;margin-right:.9em;margin-bottom:1.2em;border-right:.3em solid transparent;border-bottom:.7em solid #ffcc00;border-left:.3em solid transparent;font-size:10px;pointer-events:none}.star[data-v-2207999f]:before,.star[data-v-2207999f]:after{content:"";width:0;height:0;position:absolute;top:.6em;left:-1em;border-right:1em solid transparent;border-bottom:.7em solid #ffcc00;border-left:1em solid transparent;transform:rotate(-35deg)}.star[data-v-2207999f]:after{transform:rotate(35deg)}.node[data-v-a48cb382]{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.clickable[data-v-211328c0]{min-height:120px;width:120px;font-size:10px}.clickable.small[data-v-211328c0]{min-height:unset}.clickable>*[data-v-211328c0]{pointer-events:none}.resize-listener[data-v-063f6d6b]{position:absolute;top:0px;left:0;right:-4px;bottom:5px;z-index:-10;pointer-events:none}svg[data-v-063f6d6b]{position:absolute;top:0;left:0;width:100%;height:100%;z-index:-10;pointer-events:none}.left-side-nodes[data-v-39ca96d0]{position:absolute;left:15px;top:65px}.side-nodes[data-v-39ca96d0]{position:absolute;right:15px;top:65px}.left-side-nodes[data-v-39ca96d0] .treeNode,.side-nodes[data-v-39ca96d0] .treeNode{margin:20px auto}.small[data-v-39ca96d0] .treeNode{height:60px;width:60px}.small[data-v-39ca96d0] .treeNode>*:first-child{font-size:30px}.treeNode[data-v-727230a6]{height:100px;width:100px;border-radius:50%;padding:0;margin:0 10px}.treeNode>*[data-v-727230a6]:first-child{width:100%;height:100%;border:2px solid rgba(0,0,0,.125);border-radius:inherit;font-size:40px;color:#00000080;text-shadow:2px 2px 4px rgba(0,0,0,.25);box-shadow:-4px -4px 4px #00000040 inset,0 0 20px var(--background);display:flex}.treeNode>*:first-child>*[data-v-727230a6]{pointer-events:none}.modifier-toggle{padding-right:10px;transform:translateY(-1px);display:inline-block}.modifier-toggle.collapsed{transform:translate(-5px,-5px) rotate(-90deg)}.nav-container{margin-top:-50px;text-align:left;border-bottom:solid 1px var(--outline);margin-left:-10px;margin-right:-10px;padding:10px;width:100%}.nav-segment{border-right:solid 1px var(--outline);padding-right:10px;margin-right:10px}.affected-node{filter:drop-shadow(0px 0px 20px var(--accent1))}.achievement.final{border-color:var(--accent3)}.showNotif .body{filter:drop-shadow(0px 0px 20px var(--foreground))}.achievement[data-v-5673325a]{height:90px;width:90px;font-size:10px;color:#fff;text-shadow:0 0 2px #000000}.achievement[data-v-5673325a]:not(.small){height:unset;width:calc(100% - 10px);min-width:120px;padding-left:5px;padding-right:5px;background-color:var(--locked);border-width:4px;border-radius:5px;color:#00000080;font-size:unset;text-shadow:unset}.achievement.done[data-v-5673325a]{background-color:var(--bought);cursor:default}.achievement[data-v-5673325a] .equal-spaced{display:flex;justify-content:center}.achievement[data-v-5673325a] .equal-spaced>*{margin:auto}.upgrade[data-v-9be6bac0]{min-height:120px;width:120px;font-size:10px}.upgrade>*[data-v-9be6bac0]{pointer-events:none}.game-over-modal-header[data-v-4a50ce42]{display:flex;margin:-20px -20px 0;background:var(--raised-background);align-items:center}.game-over-modal-header *[data-v-4a50ce42]{margin:0}.game-over-modal-logo[data-v-4a50ce42]{height:4em;width:4em}.game-over-modal-title[data-v-4a50ce42]{display:flex;flex-direction:column;padding:10px 0;margin-left:10px}.game-over-footer[data-v-4a50ce42]{display:flex;justify-content:flex-end}.game-over-footer button[data-v-4a50ce42]{margin:0 10px}.game-over-modal-discord-link[data-v-4a50ce42]{display:flex;align-items:center}.game-over-modal-discord[data-v-4a50ce42]{margin:0 4px 0 0}.nan-modal-header[data-v-2776d67d]{padding:10px 0;margin-left:10px}.nan-footer[data-v-2776d67d]{display:flex;justify-content:flex-end}.nan-footer button[data-v-2776d67d]{margin:0 10px}.nan-modal-discord-link[data-v-2776d67d]{display:flex;align-items:center}.nan-modal-discord[data-v-2776d67d]{margin:0 4px 0 0}.tpsDisplay[data-v-46a3ed5b]{position:absolute;left:10px;bottom:10px;z-index:100}.low[data-v-46a3ed5b]{color:var(--danger)}.fade-leave-to[data-v-46a3ed5b]{opacity:0}:root{color-scheme:dark}*{transition-duration:.5s;font-family:Roboto Mono,monospace;font-weight:700;margin:auto;text-size-adjust:none}*:focus{outline:none}body{overflow:hidden;transition:none;text-align:center}html,body,#app{min-height:100%;height:100%}h1,h2,h3,b,input{display:inline}button{color:#000}a,.button,.link{display:block;color:var(--link);background:none;border:none;cursor:pointer;text-decoration:none}a:hover,.button:hover,.link:hover{text-shadow:5px 0 10px var(--link),-3px 0 12px var(--link)}.button:disabled{opacity:.5;cursor:not-allowed}.button:disabled:hover{text-shadow:none}ul{list-style-type:none}.Vue-Toastification__toast{margin:unset}.app[data-v-41d15e5e]{background-color:var(--background);color:var(--foreground);display:flex;flex-flow:column;min-height:100%;height:100%}#modal-root[data-v-41d15e5e]{position:absolute;min-height:100%;height:100%;color:var(--foreground)} +.table{display:flex;flex-flow:column wrap;justify-content:center;align-items:center;max-width:100%;margin:0 auto}.table+.table{margin-top:10px}.row{display:flex;flex-flow:row wrap;justify-content:center;align-items:stretch;max-width:100%;margin:0 10px}.row>:not(.feature){margin:0;display:flex}.col{display:flex;flex-flow:column wrap;justify-content:center;align-items:center;height:100%;margin:10px 0}.row.mergeAdjacent>.feature:not(.dontMerge),.row.mergeAdjacent>.tooltip-container>.feature:not(.dontMerge){margin-left:0;margin-right:0;border-radius:0}.row.mergeAdjacent>.feature:not(.dontMerge):first-child,.row.mergeAdjacent>.tooltip-container:first-child>.feature:not(.dontMerge){border-radius:var(--border-radius) 0 0 var(--border-radius)}.row.mergeAdjacent>.feature:not(.dontMerge):last-child,.row.mergeAdjacent>.tooltip-container:last-child>.feature:not(.dontMerge){border-radius:0 var(--border-radius) var(--border-radius) 0}.row.mergeAdjacent>.feature:not(.dontMerge):first-child:last-child,.row.mergeAdjacent>.tooltip-container:first-child:last-child>.feature:not(.dontMerge){border-radius:var(--border-radius)}.row-grid.mergeAdjacent>.feature:not(.dontMerge),.row-grid.mergeAdjacent>.tooltip-container>.feature:not(.dontMerge){margin:0;border-radius:0}.row-grid.mergeAdjacent>.feature:not(.dontMerge):last-child,.row-grid.mergeAdjacent>.tooltip-container:last-child>.feature:not(.dontMerge){border-radius:0}.row-grid.mergeAdjacent>.feature:not(.dontMerge):first-child,.row-grid.mergeAdjacent>.tooltip-container:first-child>.feature:not(.dontMerge){border-radius:0}.table-grid>.row-grid.mergeAdjacent:last-child>.feature:not(.dontMerge):first-child{border-radius:0 0 0 var(--border-radius)}.table-grid>.row-grid.mergeAdjacent:first-child>.feature:not(.dontMerge):last-child{border-radius:0 var(--border-radius) 0 0}.table-grid>.row-grid.mergeAdjacent:first-child>.feature:not(.dontMerge):first-child{border-radius:var(--border-radius) 0 0 0}.table-grid>.row-grid.mergeAdjacent:last-child>.feature:not(.dontMerge):last-child{border-radius:0 0 var(--border-radius) 0}.col.mergeAdjacent .feature:not(.dontMerge){margin-top:0;margin-bottom:0;border-radius:0}.col.mergeAdjacent .feature:not(.dontMerge):first-child{border-radius:var(--border-radius) var(--border-radius) 0 0}.col.mergeAdjacent .feature:not(.dontMerge):last-child{border-radius:0 0 var(--border-radius) var(--border-radius)}.col.mergeAdjacent .feature:not(.dontMerge):first-child:last-child{border-radius:var(--border-radius)}.resize-listener[data-v-2b1dc1bc]{position:absolute;top:0px;left:0;right:-4px;bottom:5px;z-index:-10;pointer-events:none}.modal-mask{position:fixed;z-index:9998;top:0;left:0;bottom:0;right:0;background-color:#00000080;transition:opacity .3s ease}.modal-wrapper{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.modal-container{width:640px;max-width:95vw;max-height:95vh;background-color:var(--background);padding:20px;border-radius:5px;transition:all .3s ease;text-align:left;border:var(--modal-border);box-sizing:border-box;display:flex;flex-direction:column}.modal-header{width:100%}.modal-body{margin:20px 0;width:100%;overflow-y:auto;overflow-x:hidden}.modal-footer{width:100%}.modal-default-footer{display:flex}.modal-default-flex-grow{flex-grow:1}.modal-enter-from,.modal-leave-active{opacity:0}.modal-enter-from .modal-container,.modal-leave-active .modal-container{-webkit-transform:scale(1.1);transform:scale(1.1)}.layer-container[data-v-72dd78b1]{min-width:100%;min-height:100%;margin:0;flex-grow:1;display:flex;isolation:isolate}.layer-tab[data-v-72dd78b1]:not(.minimized){padding-top:20px;padding-bottom:20px;min-height:100%;flex-grow:1;text-align:center;position:relative}.inner-tab>.layer-container>.layer-tab[data-v-72dd78b1]:not(.minimized){padding-top:50px}.layer-tab.minimized[data-v-72dd78b1]{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;padding:55px 0 0;margin:0;cursor:pointer;font-size:40px;color:var(--foreground);border:none;background-color:transparent}.layer-tab.minimized>*[data-v-72dd78b1]{margin:0;writing-mode:vertical-rl;text-align:left;padding-left:10px;width:50px}.inner-tab>.layer-container>.layer-tab[data-v-72dd78b1]:not(.minimized){margin:-50px -10px;padding:50px 10px}.modal-body .layer-tab[data-v-72dd78b1]{padding-bottom:0}.modal-body .layer-tab[data-v-72dd78b1]:not(.hasSubtabs){padding-top:0}.minimize[data-v-72dd78b1]{position:sticky;top:6px;right:9px;z-index:7;line-height:30px;border:none;background:var(--background);box-shadow:var(--background) 0 2px 3px 5px;border-radius:50%;color:var(--foreground);font-size:40px;cursor:pointer;margin-top:-44px;margin-right:-30px}.minimized+.minimize[data-v-72dd78b1]{transform:rotate(-90deg);top:10px;right:18px;pointer-events:none}.goBack[data-v-72dd78b1]{position:sticky;top:10px;left:10px;line-height:30px;margin-top:-50px;margin-left:-35px;border:none;background:var(--background);box-shadow:var(--background) 0 2px 3px 5px;border-radius:50%;color:var(--foreground);font-size:30px;cursor:pointer;z-index:7}.goBack[data-v-72dd78b1]:hover{transform:scale(1.1);text-shadow:0 0 7px var(--foreground)}.layer-tab.minimized>*>.desc{color:var(--accent1);font-size:30px}details[data-v-4b4bda40]{margin:10px 0;padding-left:18px}summary[data-v-4b4bda40]{cursor:pointer;margin-bottom:10px;margin-left:-18px}ul[data-v-4b4bda40]{margin:var(--feature-margin) 0;background:var(--raised-background);border:2px solid rgba(0,0,0,.125);padding:5px 5px 5px 15px;list-style:inside}li[data-v-4b4bda40]{margin:8px 0}li[data-v-4b4bda40]:before{padding:2px 8px;margin-right:8px;border-radius:var(--border-radius)}.feature[data-v-4b4bda40]:before{content:"Feature";background:var(--accent1)}.fix[data-v-4b4bda40]:before{content:"Fix";background:var(--accent2)}.balancing[data-v-4b4bda40]:before{content:"Balancing";background:var(--accent3)}.breaking[data-v-4b4bda40]:before{content:"Breaking";background:var(--danger)}.tooltip-container[data-v-6102fa3a]{position:relative;--xoffset: 0px;--yoffset: 0px;text-shadow:none!important}.tooltip[data-v-6102fa3a],.tooltip[data-v-6102fa3a]:after{pointer-events:none;position:absolute}.tooltip[data-v-6102fa3a]{text-align:center;width:150px;font-size:14px;line-height:1.2;bottom:calc(100% + var(--yoffset));left:calc(50% + var(--xoffset));margin-bottom:5px;transform:translate(-50%);padding:7px;border-radius:3px;background-color:var(--tooltip-background);color:var(--points);z-index:100!important;word-break:break-word}.tooltip[data-v-6102fa3a] hr{margin:var(--feature-margin) 0}.shown[data-v-6102fa3a]{z-index:10}.fade-enter-from[data-v-6102fa3a],.fade-leave-to[data-v-6102fa3a]{opacity:0}.tooltip[data-v-6102fa3a]:after{content:" ";position:absolute;top:100%;bottom:100%;left:calc(50% - var(--xoffset));width:0;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--tooltip-background) transparent transparent transparent}.tooltip.left[data-v-6102fa3a],.side-nodes .tooltip[data-v-6102fa3a]:not(.right):not(.bottom):not(.top){bottom:calc(50% + var(--yoffset));left:unset;right:calc(100% + var(--xoffset));margin-bottom:unset;margin-right:5px;transform:translateY(50%)}.tooltip.left[data-v-6102fa3a]:after,.side-nodes .tooltip[data-v-6102fa3a]:not(.right):not(.bottom):not(.top):after{top:calc(50% + var(--yoffset));bottom:unset;left:100%;right:100%;margin-left:unset;margin-top:-5px;border-color:transparent transparent transparent var(--tooltip-background)}.tooltip.right[data-v-6102fa3a]{bottom:calc(50% + var(--yoffset));left:calc(100% + var(--xoffset));margin-bottom:unset;margin-left:5px;transform:translateY(50%)}.tooltip.right[data-v-6102fa3a]:after{top:calc(50% + var(--yoffset));left:0;right:100%;margin-left:-10px;margin-top:-5px;border-color:transparent var(--tooltip-background) transparent transparent}.tooltip.bottom[data-v-6102fa3a]{top:calc(100% + var(--yoffset));bottom:unset;left:calc(50% + var(--xoffset));margin-bottom:unset;margin-top:5px;transform:translate(-50%)}.tooltip.bottom[data-v-6102fa3a]:after{top:0;margin-top:-10px;border-color:transparent transparent var(--tooltip-background) transparent}.pinned[data-v-6102fa3a]{position:absolute;right:-5px;top:-5px;transform:rotate(45deg)}.info-modal-header[data-v-4f97aa40]{display:flex;margin:-20px -20px 0;background:var(--raised-background);align-items:center}.info-modal-header *[data-v-4f97aa40]{margin:0}.info-modal-logo[data-v-4f97aa40]{height:4em;width:4em}.info-modal-title[data-v-4f97aa40]{display:flex;flex-direction:column;padding:10px 0;margin-left:10px}.info-modal-discord-link[data-v-4f97aa40]{display:flex;align-items:center}.info-modal-discord[data-v-4f97aa40]{margin:0 4px 0 0}.field{display:flex;position:relative;min-height:2em;margin:10px 0;user-select:none;justify-content:space-between;align-items:center}.field>*{margin:0}.vue-select{width:50%;border-radius:var(--border-radius)}.field-buttons .vue-select{width:unset}.vue-select,.vue-dropdown{border-color:var(--outline)}.vue-dropdown{background:var(--raised-background)}.vue-dropdown-item{color:var(--foreground)}.vue-dropdown-item,.vue-dropdown-item *{transition-duration:0s}.vue-dropdown-item.highlighted{background-color:var(--highlighted)}.vue-dropdown-item.selected,.vue-dropdown-item.highlighted.selected{background-color:var(--bought)}.vue-input input{font-size:inherit}.vue-input input::placeholder{color:var(--link)}.field[data-v-11046116]{cursor:pointer}input[data-v-11046116]{appearance:none;pointer-events:none}span[data-v-11046116]{width:100%;padding-right:41px;position:relative}input+span[data-v-11046116]:before{content:"";position:absolute;top:calc(50% - 7px);right:0px;border-radius:7px;width:36px;height:14px;background-color:var(--outline);opacity:.38;vertical-align:top;transition:background-color .2s,opacity .2s}input+span[data-v-11046116]:after{content:"";position:absolute;top:calc(50% - 10px);right:16px;border-radius:50%;width:20px;height:20px;background-color:var(--locked);box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;transition:background-color .2s,transform .2s}input:checked+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}input:checked+span[data-v-11046116]:after{background-color:var(--link);transform:translate(16px)}input:active+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}input:checked:active+span[data-v-11046116]:before{background-color:var(--outline);opacity:.38}input:disabled+span[data-v-11046116]{color:#000;opacity:.38;cursor:default}input:disabled+span[data-v-11046116]:before{background-color:var(--outline);opacity:.38}input:checked:disabled+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}.feedback[data-v-01a1b95c]{position:relative}.feedback[data-v-01a1b95c]:after{position:absolute;left:calc(100% + 5px);top:50%;transform:translateY(-50%);content:"\2714";opacity:0;pointer-events:none;box-shadow:inset 0 0 0 35px #6f94b600;text-shadow:none}.feedback.left[data-v-01a1b95c]:after{left:unset;right:calc(100% + 5px)}.feedback.activated[data-v-01a1b95c]:after{animation:feedback-01a1b95c .5s ease-out forwards}@keyframes feedback-01a1b95c{0%{opacity:1;transform:scale3d(.4,.4,1),translateY(-50%)}80%{opacity:.1}to{opacity:0;transform:scale3d(1.2,1.2,1),translateY(-50%)}}.option-tabs{border-bottom:2px solid var(--outline);margin-top:10px;margin-bottom:-10px}.option-tabs button{background-color:transparent;color:var(--foreground);margin-bottom:-2px;font-size:14px;cursor:pointer;padding:5px 20px;border:none;border-bottom:2px solid var(--foreground)}.option-tabs button:not(.selected){border-bottom-color:transparent}.option-title .tooltip-container{display:inline;margin-left:5px}.option-title desc{display:block;opacity:.6;font-size:small;width:300px;margin-left:0}.save-button{text-align:right}form[data-v-90bd4994]{margin:0;width:100%}.field>*[data-v-90bd4994]{margin:0}input[data-v-90bd4994]{width:50%;outline:none;border:solid 1px var(--outline);background-color:unset;border-radius:var(--border-radius)}.fullWidth[data-v-90bd4994]{width:100%}.container[data-v-2f8ef34c]{display:flex;align-items:center;background:var(--raised-background);box-shadow:var(--raised-background) 0 2px 3px 5px}.container.confirming button[data-v-2f8ef34c]{font-size:1em}.container>*[data-v-2f8ef34c]{margin:0 4px}.danger,.button.danger{position:relative;border:solid 2px var(--danger);border-right-width:16px}.danger:after{position:absolute;content:"!";color:#fff;right:-13px}.save[data-v-32313015]{position:relative;border:solid 4px var(--outline);padding:4px;background:var(--raised-background);margin:var(--feature-margin);display:flex;align-items:center;min-height:30px}.save.active[data-v-32313015]{border-color:var(--bought)}.open[data-v-32313015]{display:inline;margin:0;padding-left:0}.handle[data-v-32313015]{flex-grow:0;margin-right:8px;margin-left:0;cursor:pointer}.details[data-v-32313015]{margin:0 80px 0 0;flex-grow:1}.error[data-v-32313015]{font-size:.8em;color:var(--danger)}.save-version[data-v-32313015]{margin-left:4px;font-size:.7em;opacity:.7}.actions[data-v-32313015]{position:absolute;top:0;bottom:0;right:4px;display:flex;padding:4px;z-index:1}.editname[data-v-32313015]{margin:0}.save button{transition-duration:0s}.save .actions button{display:flex;font-size:1.2em}.save .actions button .material-icons{font-size:unset}.save .button.danger{display:flex;align-items:center;padding:4px}.save .field,.field form[data-v-2a4275be],.field .field-title[data-v-2a4275be],.field .field-buttons[data-v-2a4275be]{margin:0}.field-buttons[data-v-2a4275be]{display:flex}.field-buttons .field[data-v-2a4275be]{margin:0 0 0 8px}.modal-footer[data-v-2a4275be]{margin-top:-20px}.footer[data-v-2a4275be]{display:flex;margin-top:20px}.importingFailed input{color:red}.field-buttons .v-select{width:220px}.presets .vue-select[aria-expanded=true] vue-dropdown{visibility:hidden}.nav[data-v-318a1c31]{background-color:var(--raised-background);display:flex;left:0;right:0;top:0;height:46px;width:100%;border-bottom:4px solid var(--outline)}.nav>*[data-v-318a1c31]{height:46px;width:46px;display:flex;cursor:pointer;flex-shrink:0}.nav>.banner[data-v-318a1c31]{height:100%;width:unset}.overlay-nav[data-v-318a1c31]{position:fixed;top:10px;left:10px;display:flex;flex-direction:column;z-index:2}.overlay-nav>*[data-v-318a1c31]{height:50px;width:50px;display:flex;cursor:pointer;margin:0;align-items:center;justify-content:center}.title[data-v-318a1c31]{font-size:36px;text-align:left;margin-left:12px;cursor:unset}.nav>.title[data-v-318a1c31]{width:unset;flex-shrink:1;overflow:hidden;white-space:nowrap}.nav .saves[data-v-318a1c31],.nav .info[data-v-318a1c31]{display:flex}.tooltip-container[data-v-318a1c31]{width:100%;height:100%;display:flex}.overlay-nav .discord[data-v-318a1c31]{position:relative}.discord img[data-v-318a1c31]{width:100%;height:100%}.discord-links[data-v-318a1c31]{position:fixed;top:45px;padding:20px;right:-280px;width:200px;transition:right .25s ease;background:var(--raised-background);z-index:10}.overlay-nav .discord-links[data-v-318a1c31]{position:absolute;left:-280px;right:unset;transition:left .25s ease}.overlay-nav .discord:hover .discord-links[data-v-318a1c31]{left:-10px}.discord-links li[data-v-318a1c31]{margin-bottom:4px}.discord-links li[data-v-318a1c31]:first-child{font-size:1.2em}*:not(.overlay-nav) .discord:hover .discord-links[data-v-318a1c31]{right:0}.material-icons[data-v-318a1c31]{font-size:36px}.material-icons[data-v-318a1c31]:hover{text-shadow:5px 0 10px var(--link),-3px 0 12px var(--foreground)}.nav .version-container[data-v-318a1c31]{display:flex;height:25px;margin-bottom:0;margin-left:10px}.overlay-nav .version-container[data-v-318a1c31]{width:unset;height:25px}.version[data-v-318a1c31]{color:var(--points)}.version:hover span[data-v-318a1c31]{text-shadow:5px 0 10px var(--points),-3px 0 12px var(--points)}.nav>div>a[data-v-318a1c31],.overlay-nav>div>a[data-v-318a1c31]{color:var(--foreground);text-shadow:none}.tabs-container[data-v-dcd207b4]{width:100vw;flex-grow:1;overflow-x:auto;overflow-y:hidden;display:flex}.tabs-container[data-v-dcd207b4]:not(.useHeader){width:calc(100vw - 50px);margin-left:50px}.tab[data-v-dcd207b4]{position:relative;height:100%;flex-grow:1;transition-duration:0s;overflow-y:auto;overflow-x:hidden}.inner-tab[data-v-dcd207b4]{padding:50px 10px;min-height:calc(100% - 100px);display:flex;flex-direction:column;margin:0;flex-grow:1}.tab+.tab>.inner-tab[data-v-dcd207b4]{border-left:solid 4px var(--outline)}.tab hr{height:4px;border:none;background:var(--outline);margin:var(--feature-margin) 0}.tab .modal-body hr{margin:7px 0}.sticky[data-v-cccac690]{position:sticky;background:var(--background);width:calc(100% - 2px);z-index:3}.link[data-v-57c4970a]{transition-duration:0s}.link.pulsing[data-v-57c4970a]{animation:pulsing-57c4970a 2s ease-in infinite}@keyframes pulsing-57c4970a{0%{opacity:.25}50%{opacity:1}to{opacity:.25}}.action:not(.boardnode):hover circle[data-v-9efb2a56],.action:not(.boardnode).selected circle[data-v-9efb2a56]{r:25}.action:not(.boardnode):hover text[data-v-9efb2a56],.action:not(.boardnode).selected text[data-v-9efb2a56]{font-size:187.5%}.action:not(.boardnode) text[data-v-9efb2a56]{text-anchor:middle;dominant-baseline:central}.actions-enter-from .action,.actions-leave-to .action{transform:translate(0)}.boardnode[data-v-4654be02]{cursor:pointer;transition-duration:0s}.boardnode:hover .body[data-v-4654be02]{fill:var(--highlighted)}.boardnode.running .body[data-v-4654be02]{fill:var(--accent1)!important}.boardnode:not(.isDraggable) .body[data-v-4654be02]{fill:var(--locked)}.node-title[data-v-4654be02]{text-anchor:middle;dominant-baseline:middle;font-family:monospace;font-size:200%;pointer-events:none;filter:drop-shadow(3px 3px 2px var(--tooltip-background))}.node-subtitle[data-v-4654be02]{text-anchor:middle;dominant-baseline:middle;font-family:monospace;font-size:150%;pointer-events:none;filter:drop-shadow(3px 3px 2px var(--tooltip-background))}.progress[data-v-4654be02]{transition-duration:.05s}.progressRing[data-v-4654be02]{transform:rotate(-90deg)}.fade-enter-from[data-v-4654be02],.fade-leave-to[data-v-4654be02]{opacity:0}.pulsing[data-v-4654be02]{animation:pulsing-4654be02 2s ease-in infinite}@keyframes pulsing-4654be02{0%{opacity:.25}50%{opacity:1}to{opacity:.25}}.grow-enter-from .node-container,.grow-leave-to .node-container{transform:scale(0)}.vue-pan-zoom-scene{width:100%;height:100%;cursor:grab}.vue-pan-zoom-scene:active{cursor:grabbing}.g1{transition-duration:0s}.link-enter-from,.link-leave-to{opacity:0}.tabButton[data-v-21427abb]{background-color:transparent;color:var(--foreground);font-size:20px;cursor:pointer;padding:5px 20px;margin:5px;border-radius:5px;border:2px solid;flex-shrink:0;border-color:var(--layer-color)}.tabButton[data-v-21427abb]:hover{transform:scale(1.1);text-shadow:0 0 7px var(--foreground)}:not(.floating)>.tabButton[data-v-21427abb]{height:50px;margin:0;border-left:none;border-right:none;border-top:none;border-bottom-width:4px;border-radius:0;transform:unset}:not(.floating) .tabButton[data-v-21427abb]:not(.active){border-bottom-color:transparent}.tabButton>*[data-v-21427abb]{pointer-events:none}.tab-family-container[data-v-58dbf83a]{margin:calc(50px + var(--feature-margin)) 20px var(--feature-margin) 20px;position:relative;border:solid 4px;border-color:var(--outline)}.layer-tab>.tab-family-container[data-v-58dbf83a]:first-child{margin:-4px -11px var(--feature-margin) -11px}.layer-tab>.tab-family-container[data-v-58dbf83a]:first-child:nth-last-child(3){border-bottom-style:none;border-left-style:none;border-right-style:none;height:calc(100% + 50px)}.modal-body>.tab-family-container[data-v-58dbf83a]:first-child{margin:calc(10px + var(--feature-margin)) 10px 0 10px;border:none}.tab-family-container[data-v-58dbf83a]>:nth-child(2){margin-top:20px}.modal-body>.tab-family-container[data-v-58dbf83a]>:nth-child(2){margin-top:50px}.tab-family-container[data-v-f18896fc][data-v-58dbf83a]>:last-child{margin-bottom:20px}.tab-buttons-container[data-v-58dbf83a]{z-index:4}.tab-buttons-container[data-v-58dbf83a]:not(.floating){border-bottom:solid 4px;border-color:inherit}:not(.layer-tab):not(.modal-body)>.tab-family-container>.tab-buttons-container[data-v-58dbf83a]:not(.floating){width:calc(100% + 6px);margin-left:-3px}.tab-buttons-container:not(.floating) .tab-buttons[data-v-58dbf83a]{text-align:left;margin-bottom:-4px}.tab-buttons-container.floating .tab-buttons[data-v-58dbf83a]{justify-content:center;margin-top:-25px}.tab-buttons[data-v-58dbf83a]{margin-bottom:24px;display:flex;flex-flow:wrap;z-index:4}.layer-tab>.tab-family-container:first-child:nth-last-child(3)>.tab-buttons-container>.tab-buttons[data-v-58dbf83a]{padding-right:60px}.tab-buttons[data-v-58dbf83a]:not(.floating){text-align:left;border-bottom:inherit;border-width:4px;box-sizing:border-box;height:50px}.modal-body .tab-buttons[data-v-58dbf83a]{width:100%;margin-left:0;margin-right:0;padding-left:0}.showGoBack>.tab-family-container:first-child>.tab-buttons-container:not(.floating) .tab-buttons[data-v-58dbf83a]{padding-left:70px}:not(.showGoBack)>.tab-family-container>.tab-buttons-container:not(.floating):first-child .tab-buttons[data-v-58dbf83a]{padding-left:0}.minimizable>.tab-buttons-container[data-v-58dbf83a]:not(.floating):first-child{padding-right:50px}.tab-buttons-container:not(.floating):first-child .tab-buttons[data-v-58dbf83a]{margin-top:-50px}.tab-buttons-container+*[data-v-58dbf83a]{margin-top:20px}.modifier-container{display:flex;padding:1px 8px}.modifier-container:nth-child(2n){background:var(--raised-background)}.modifier-amount{flex-shrink:0;text-align:right}:not(:first-of-type,:last-of-type)>.modifier-amount:after{content:var(--unit);opacity:0}.modifier-description{flex-grow:1}.collapsible-container[data-v-a72c16aa]{width:calc(100% - 10px)}.collapsible-toggle[data-v-a72c16aa]{max-width:unset;width:calc(100% + 0px);margin:0 0 0 -5px;background:var(--raised-background);padding:var(--feature-margin);color:var(--foreground);cursor:pointer;transition-duration:0s}.collapsible-toggle[data-v-a72c16aa]:last-child{margin-left:unset}[data-v-a72c16aa] .collapsible-toggle+.table{max-width:unset;width:calc(100% + 10px);margin-left:-5px}[data-v-a72c16aa] .col{margin-top:0;margin-bottom:0;width:100%}.mergeAdjacent .collapsible-toggle[data-v-a72c16aa]{border:0;border-top-left-radius:0!important;border-top-right-radius:0!important}[data-v-a72c16aa] .mergeAdjacent .feature:not(.dontMerge):first-child{border-top-left-radius:0!important;border-top-right-radius:0!important}.feature:not(li),.feature:not(li) button{position:relative;padding:5px;border-radius:var(--border-radius);border:2px solid rgba(0,0,0,.125);margin:var(--feature-margin);box-sizing:border-box;color:var(--feature-foreground);z-index:0;transition:all .5s,z-index 0s .5s}.can,.can button{background-color:var(--layer-color);cursor:pointer}.can:hover,.can:hover button{transform:scale(1.15);box-shadow:0 0 20px var(--points);z-index:1;transition:all .5s,z-index 0s}.locked,.locked button{background-color:var(--locked);cursor:not-allowed}.bought,.bought button{background-color:var(--bought);cursor:default}.mark[data-v-2207999f]{position:absolute;left:-25px;top:-10px;width:30px;height:30px;z-index:1;pointer-events:none;margin-left:.9em;margin-right:.9em;margin-bottom:1.2em;border-right:.3em solid transparent;border-bottom:.7em solid transparent;border-left:.3em solid transparent;font-size:10px}.star[data-v-2207999f]{left:-10px;width:0;height:0;margin-left:.9em;margin-right:.9em;margin-bottom:1.2em;border-right:.3em solid transparent;border-bottom:.7em solid #ffcc00;border-left:.3em solid transparent;font-size:10px;pointer-events:none}.star[data-v-2207999f]:before,.star[data-v-2207999f]:after{content:"";width:0;height:0;position:absolute;top:.6em;left:-1em;border-right:1em solid transparent;border-bottom:.7em solid #ffcc00;border-left:1em solid transparent;transform:rotate(-35deg)}.star[data-v-2207999f]:after{transform:rotate(35deg)}.node[data-v-a48cb382]{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.clickable[data-v-211328c0]{min-height:120px;width:120px;font-size:10px}.clickable.small[data-v-211328c0]{min-height:unset}.clickable>*[data-v-211328c0]{pointer-events:none}.resize-listener[data-v-063f6d6b]{position:absolute;top:0px;left:0;right:-4px;bottom:5px;z-index:-10;pointer-events:none}svg[data-v-063f6d6b]{position:absolute;top:0;left:0;width:100%;height:100%;z-index:-10;pointer-events:none}.left-side-nodes[data-v-39ca96d0]{position:absolute;left:15px;top:65px}.side-nodes[data-v-39ca96d0]{position:absolute;right:15px;top:65px}.left-side-nodes[data-v-39ca96d0] .treeNode,.side-nodes[data-v-39ca96d0] .treeNode{margin:20px auto}.small[data-v-39ca96d0] .treeNode{height:60px;width:60px}.small[data-v-39ca96d0] .treeNode>*:first-child{font-size:30px}.treeNode[data-v-727230a6]{height:100px;width:100px;border-radius:50%;padding:0;margin:0 10px}.treeNode>*[data-v-727230a6]:first-child{width:100%;height:100%;border:2px solid rgba(0,0,0,.125);border-radius:inherit;font-size:40px;color:#00000080;text-shadow:2px 2px 4px rgba(0,0,0,.25);box-shadow:-4px -4px 4px #00000040 inset,0 0 20px var(--background);display:flex}.treeNode>*:first-child>*[data-v-727230a6]{pointer-events:none}.modifier-toggle{padding-right:10px;transform:translateY(-1px);display:inline-block}.modifier-toggle.collapsed{transform:translate(-5px,-5px) rotate(-90deg)}.nav-container{margin-top:-50px;text-align:left;border-bottom:solid 1px var(--outline);margin-left:-10px;margin-right:-10px;padding:10px;width:100%}.nav-segment:not(:last-child){border-right:solid 1px var(--outline);padding-right:10px;margin-right:10px}.nav-segment .tooltip-container{display:inline}.affected-node{filter:drop-shadow(0px 0px 20px var(--accent1))}.achievement.final{border-color:var(--accent3)}.showNotif .body{filter:drop-shadow(0px 0px 20px var(--foreground))}.achievement[data-v-5673325a]{height:90px;width:90px;font-size:10px;color:#fff;text-shadow:0 0 2px #000000}.achievement[data-v-5673325a]:not(.small){height:unset;width:calc(100% - 10px);min-width:120px;padding-left:5px;padding-right:5px;background-color:var(--locked);border-width:4px;border-radius:5px;color:#00000080;font-size:unset;text-shadow:unset}.achievement.done[data-v-5673325a]{background-color:var(--bought);cursor:default}.achievement[data-v-5673325a] .equal-spaced{display:flex;justify-content:center}.achievement[data-v-5673325a] .equal-spaced>*{margin:auto}.upgrade[data-v-9be6bac0]{min-height:120px;width:120px;font-size:10px}.upgrade>*[data-v-9be6bac0]{pointer-events:none}.game-over-modal-header[data-v-4a50ce42]{display:flex;margin:-20px -20px 0;background:var(--raised-background);align-items:center}.game-over-modal-header *[data-v-4a50ce42]{margin:0}.game-over-modal-logo[data-v-4a50ce42]{height:4em;width:4em}.game-over-modal-title[data-v-4a50ce42]{display:flex;flex-direction:column;padding:10px 0;margin-left:10px}.game-over-footer[data-v-4a50ce42]{display:flex;justify-content:flex-end}.game-over-footer button[data-v-4a50ce42]{margin:0 10px}.game-over-modal-discord-link[data-v-4a50ce42]{display:flex;align-items:center}.game-over-modal-discord[data-v-4a50ce42]{margin:0 4px 0 0}.nan-modal-header[data-v-2776d67d]{padding:10px 0;margin-left:10px}.nan-footer[data-v-2776d67d]{display:flex;justify-content:flex-end}.nan-footer button[data-v-2776d67d]{margin:0 10px}.nan-modal-discord-link[data-v-2776d67d]{display:flex;align-items:center}.nan-modal-discord[data-v-2776d67d]{margin:0 4px 0 0}.tpsDisplay[data-v-46a3ed5b]{position:absolute;left:10px;bottom:10px;z-index:100}.low[data-v-46a3ed5b]{color:var(--danger)}.fade-leave-to[data-v-46a3ed5b]{opacity:0}:root{color-scheme:dark}*{transition-duration:.5s;font-family:Roboto Mono,monospace;font-weight:700;margin:auto;text-size-adjust:none}*:focus{outline:none}body{overflow:hidden;transition:none;text-align:center}html,body,#app{min-height:100%;height:100%}h1,h2,h3,b,input{display:inline}button{color:#000}a,.button,.link{display:block;color:var(--link);background:none;border:none;cursor:pointer;text-decoration:none}a:hover,.button:hover,.link:hover{text-shadow:5px 0 10px var(--link),-3px 0 12px var(--link)}.button:disabled{opacity:.5;cursor:not-allowed}.button:disabled:hover{text-shadow:none}ul{list-style-type:none}.Vue-Toastification__toast{margin:unset}.app[data-v-41d15e5e]{background-color:var(--background);color:var(--foreground);display:flex;flex-flow:column;min-height:100%;height:100%}#modal-root[data-v-41d15e5e]{position:absolute;min-height:100%;height:100%;color:var(--foreground)} diff --git a/index.html b/index.html index d282ba2..133a798 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ Profectus - + @@ -32,7 +32,7 @@ - + diff --git a/sw.js b/sw.js index 775ad5e..2743f0c 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.09343c26.js",revision:null},{url:"assets/index.83961fb5.css",revision:null},{url:"assets/index.8696f909.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/unique-names-generator.5494b30b.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:"21bc747a27650da8531bdcc8a7e57a0d"},{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.dc03ce30.js",revision:null},{url:"assets/index.3f729fa9.js",revision:null},{url:"assets/index.43bdca03.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/unique-names-generator.5494b30b.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:"e1addd8610a426184ce11afdc6c3c024"},{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")))}));