diff --git a/assets/gameLoop.6a742dab.js b/assets/gameLoop.7364e043.js similarity index 89% rename from assets/gameLoop.6a742dab.js rename to assets/gameLoop.7364e043.js index acbbbdf..544b525 100644 --- a/assets/gameLoop.6a742dab.js +++ b/assets/gameLoop.7364e043.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.6f5e52cd.js";import"./vue.804e2479.js";import{b2 as c}from"./@vue.6f8187b0.js";/* empty css */import"./nanoevents.1080beb7.js";import"./lz-string.dccec454.js";import"./vue-next-select.f5f69b1a.js";import"./vuedraggable.ce650350.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-panzoom.89be130f.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";import"./vue-toastification.5231d1bd.js";let n=null,f=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(o.lastTenTicks.push(r),o.lastTenTicks.length>10&&(o.lastTenTicks=o.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!o.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(l.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),l.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||l.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!l.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),u.emit("update",i,r),p.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function A(){f=(await d(()=>import("./index.6f5e52cd.js").then(function(t){return t.c}),["assets/index.6f5e52cd.js","assets/index.e5429d96.css","assets/@fontsource.f66d05e7.css","assets/vue.804e2479.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6f8187b0.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.f5f69b1a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.ce650350.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.89be130f.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.5231d1bd.js","assets/vue-toastification.4b5f8ac8.css"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{A as startGameLoop}; +import{_ as d,s as p,p as e,a as o,l as T,D as l,b as m,g as u}from"./index.09a0ea01.js";import"./vue.804e2479.js";import{b2 as c}from"./@vue.6f8187b0.js";/* empty css */import"./nanoevents.1080beb7.js";import"./lz-string.dccec454.js";import"./vue-next-select.f5f69b1a.js";import"./vuedraggable.ce650350.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-panzoom.89be130f.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";import"./vue-toastification.5231d1bd.js";let n=null,f=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(o.lastTenTicks.push(r),o.lastTenTicks.length>10&&(o.lastTenTicks=o.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!o.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(l.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),l.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||l.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!l.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),u.emit("update",i,r),p.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function A(){f=(await d(()=>import("./index.09a0ea01.js").then(function(t){return t.c}),["assets/index.09a0ea01.js","assets/index.53b6dde5.css","assets/@fontsource.f66d05e7.css","assets/vue.804e2479.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6f8187b0.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.f5f69b1a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.ce650350.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.89be130f.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.5231d1bd.js","assets/vue-toastification.4b5f8ac8.css"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{A as startGameLoop}; diff --git a/assets/index.09a0ea01.js b/assets/index.09a0ea01.js new file mode 100644 index 0000000..e87649d --- /dev/null +++ b/assets/index.09a0ea01.js @@ -0,0 +1,18 @@ +/* empty css */import"./vue.804e2479.js";import{_ as M,C as a,l as me,q as pt,t as A,b2 as Oe,ab as H,aD as jn,w as Le,b3 as Ue,a9 as y,O as le,az as Qt,as as tt,aF as C,a1 as $,aL as et,a2 as v,aH as Gt,A as pe,$ as X,b7 as B,b9 as dn,ar as Ge,bv as Mt,a8 as O,bt as Fi,bc as It,T as Di,u as gn,j as Pi,bw as $n,aM as Ht,a0 as L,aO as Me,J as K,G as ue,I as Te,aI as ht,aG as bt,z as nt,bo as Ai,bs as Oi,aK as $t,bd as En,am as Zt,H as Vi,bf as Li}from"./@vue.6f8187b0.js";import{c as Gn}from"./nanoevents.1080beb7.js";import{L as Xe}from"./lz-string.dccec454.js";import{Y as qi}from"./vue-next-select.f5f69b1a.js";import{D as Bi}from"./vuedraggable.ce650350.js";import{p as Ri}from"./vue-textarea-autosize.35804eaf.js";import{P as zi}from"./vue-panzoom.89be130f.js";import{s as Ui,u as Wn}from"./vue-toastification.5231d1bd.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 ji=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 o of r)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerpolicy&&(o.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?o.credentials="include":r.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}};ji();const Gi="modulepreload",Tn={},Wi="./",qt=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${Wi}${i}`,i in Tn)return;Tn[i]=!0;const r=i.endsWith(".css"),o=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${o}`))return;const u=document.createElement("link");if(u.rel=r?"stylesheet":Gi,r||(u.as="script",u.crossOrigin=""),u.href=i,document.head.appendChild(u),r)return new Promise((s,c)=>{u.addEventListener("load",s),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},Hi="./projInfo-schema.json",Zi="Planar Pioneers",Yi="A game about controlling and exploiting planes!",Ji="planar-pioneers",Ki="thepaperpilot",Xi="",Qi="",er="0.0",tr="Initial Commit",nr=!1,ir=!1,rr=2,ar=!0,or=null,sr="",lr=["main"],ur=3600,cr=0,dr=!0,gr="base64";var ne={$schema:Hi,title:Zi,description:Yi,id:Ji,author:Ki,discordName:Xi,discordLink:Qi,versionNumber:er,versionTitle:tr,allowGoBack:nr,defaultShowSmall:ir,defaultDecimalsShown:rr,useHeader:ar,banner:or,logo:sr,initialTabs:lr,maxTickLength:ur,offlineLimit:cr,enablePausing:dr,exportEncoding:gr};class fr{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 mr(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 mr{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const on=17,pr=9e15,vr=Math.log10(9e15),hr=1/9e15,br=308,yr=-324,Fn=5,_r=(1<<10)-1,wr=function(){const e=[];for(let n=yr+1;n<=br;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),at=[2,Math.E,3,4,5,6,7,8,9,10],Nr=[[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]],Cr=[[-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 b=function(t){return l.fromValue_noAlloc(t)},z=function(e,t,n){return l.fromComponents(e,t,n)},J=function(t,n,i){return l.fromComponents_noNormalize(t,n,i)};const Ye=function(t,n){const i=n+1,r=Math.ceil(Math.log10(Math.abs(t))),o=Math.round(t*Math.pow(10,i-r))*Math.pow(10,r-i);return parseFloat(o.toFixed(Math.max(i-r,0)))},sn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},kr=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},Hn=.5671432904097838,Dn=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return Hn;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 J(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)),z(t,n,r)}static affordGeometricSeries_core(e,t,n,i){const r=t.mul(n.pow(i));return m.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(m.sub(1,n.pow(e))).div(m.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const o=t.add(i.mul(n)).sub(n.div(2)),u=o.pow(2);return o.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=pr)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=m.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const _=parseFloat(i[0]),x=parseFloat(i[1]),P=i[1].split(";");let V=1;if(P.length===2&&(V=parseFloat(P[1]),isFinite(V)||(V=1)),isFinite(_)&&isFinite(x)){const I=m.pentate(_,x,V);return this.sign=I.sign,this.layer=I.layer,this.mag=I.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const _=parseFloat(r[0]),x=parseFloat(r[1]),P=r[1].split(";");let V=1;if(P.length===2&&(V=parseFloat(P[1]),isFinite(V)||(V=1)),isFinite(_)&&isFinite(x)){const I=m.tetrate(_,x,V);return this.sign=I.sign,this.layer=I.layer,this.mag=I.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}const o=e.split("^");if(o.length===2){const _=parseFloat(o[0]),x=parseFloat(o[1]);if(isFinite(_)&&isFinite(x)){const P=m.pow(_,x);return this.sign=P.sign,this.layer=P.layer,this.mag=P.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}e=e.trim().toLowerCase();let u,s,c=e.split("pt");if(c.length===2){u=10,s=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let _=parseFloat(c[1]);if(isFinite(_)||(_=1),isFinite(u)&&isFinite(s)){const x=m.tetrate(u,s,_);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){u=10,s=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let _=parseFloat(c[1]);if(isFinite(_)||(_=1),isFinite(u)&&isFinite(s)){const x=m.tetrate(u,s,_);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}const g=e.split("e"),h=g.length-1;if(h===0){const _=parseFloat(e);if(isFinite(_))return this.fromNumber(_),m.fromStringCache.size>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}else if(h===1){const _=parseFloat(e);if(isFinite(_)&&_!==0)return this.fromNumber(_),m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}const p=e.split("e^");if(p.length===2){this.sign=1,p[0].charAt(0)=="-"&&(this.sign=-1);let _="";for(let x=0;x=43&&P<=57||P===101)_+=p[1].charAt(x);else return this.layer=parseFloat(_),this.mag=parseFloat(p[1].substr(x+1)),this.normalize(),m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}if(h<1)return this.sign=0,this.layer=0,this.mag=0,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this;const w=parseFloat(g[0]);if(w===0)return this.sign=0,this.layer=0,this.mag=0,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this;let k=parseFloat(g[g.length-1]);if(h>=2){const _=parseFloat(g[g.length-2]);isFinite(_)&&(k*=Math.sign(_),k+=sn(_))}if(!isFinite(w))this.sign=g[0]==="-"?-1:1,this.layer=h,this.mag=k;else if(h===1)this.sign=Math.sign(w),this.layer=1,this.mag=k+Math.log10(Math.abs(w));else if(this.sign=Math.sign(w),this.layer=h,h===2){const _=m.mul(z(1,2,k),b(w));return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}else this.mag=k;return this.normalize(),m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}fromValue(e){return e instanceof m?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:Ye(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Ye(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<=Fn?(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):Ye(this.m,e)+"e"+Ye(this.e,e):this.layer===1?Ye(this.m,e)+"e"+Ye(this.e,e):this.layer<=Fn?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Ye(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Ye(this.mag,e)}abs(){return J(this.sign===0?0:1,this.layer,this.mag)}neg(){return J(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?m.dZero:this.layer===0?z(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?m.dZero:this.layer===0?z(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?m.dZero:this.layer===0?z(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?m.dZero:this.layer===0?z(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=b(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 J(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(m.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return m.fromNumber(n.sign*n.mag+i.sign*i.mag);const r=n.layer*Math.sign(n.mag),o=i.layer*Math.sign(i.mag);if(r-o>=2)return n;if(r===0&&o===-1){if(Math.abs(i.mag-Math.log10(n.mag))>on)return n;{const u=Math.pow(10,Math.log10(n.mag)-i.mag),s=i.sign+n.sign*u;return z(Math.sign(s),1,i.mag+Math.log10(Math.abs(s)))}}if(r===1&&o===0){if(Math.abs(n.mag-Math.log10(i.mag))>on)return n;{const u=Math.pow(10,n.mag-Math.log10(i.mag)),s=i.sign+n.sign*u;return z(Math.sign(s),1,Math.log10(i.mag)+Math.log10(Math.abs(s)))}}if(Math.abs(n.mag-i.mag)>on)return n;{const u=Math.pow(10,n.mag-i.mag),s=i.sign+n.sign*u;return z(Math.sign(s),1,i.mag+Math.log10(Math.abs(s)))}}plus(e){return this.add(e)}sub(e){return this.add(b(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=b(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return J(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return J(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 m.fromNumber(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return z(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return z(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return z(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const r=z(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(z(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return z(n.sign*i.sign,r.layer+1,r.sign*r.mag)}if(n.layer===2&&i.layer===2){const r=z(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(z(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return z(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=b(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?m.dNaN:this.layer===0?z(this.sign,0,1/this.mag):z(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=b(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=b(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=b(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=sn(r)),this.layer0?z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):z(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?m.dNaN:this.layer>0?z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):z(this.sign,0,Math.log10(this.mag))}log(e){return e=b(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?m.dNaN:this.layer===0&&e.layer===0?z(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):m.div(this.log10(),e.log10())}log2(){return this.sign<=0?m.dNaN:this.layer===0?z(this.sign,0,Math.log2(this.mag)):this.layer===1?z(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?z(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?m.dNaN:this.layer===0?z(this.sign,0,Math.log(this.mag)):this.layer===1?z(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?z(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=b(e),n=this,i=t;if(n.sign===0)return i.eq(0)?J(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return J(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:m.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return m.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 z(1,0,t);if(e.sign===0)return m.dOne;e=J(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?z(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?z(-e.sign,e.layer+1,-e.mag):m.dOne}pow_base(e){return b(e).pow(this)}root(e){const t=b(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?m.exp(m.mul(this,m.ln(this).sub(1))):m.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(J(1,0,24)))return m.fromNumber(kr(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,o=1/r,u=t+o;if(u===t||(t=u,i=i*n,r=360*i,o=1/r,u=t-o,u===t))return m.exp(t);t=u,i=i*n,r=1260*i;let s=1/r;return t=t+s,i=i*n,r=1680*i,s=1/r,t=t-s,m.exp(t)}else return this.layer===1?m.exp(m.mul(this,m.ln(this).sub(1))):m.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?m.dOne:this.layer===0&&this.mag<=709.7?m.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?z(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?z(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):z(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return m.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return z(1,2,Math.log10(this.mag)-.3010299956639812);{const e=m.div(J(this.sign,this.layer-1,this.mag),J(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=J(1,0,1)){if(e===1)return m.pow(this,t);if(e===0)return new m(t);if(this.eq(m.dOne))return m.dOne;if(this.eq(-1))return m.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return m.fromNumber(Math.E);const o=m.ln(this).neg();return o.lambertw().div(o)}else return r>1.444667861009766?m.fromNumber(Number.POSITIVE_INFINITY):m.dNaN}if(this.eq(m.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),m.fromNumber(r)}if(e<0)return m.iteratedlog(t,this,-e);t=b(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(m.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r3)return J(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=J(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return m.tetrate(e,-t,this);e=b(e);let n=m.fromDecimal(this);const i=t;t=Math.trunc(t);const r=i-t;if(n.layer-e.layer>3){const o=Math.min(t,n.layer-e.layer-3);t-=o,n.layer-=o}for(let o=0;o1e4)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,o=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),o+=n,n===0)break}return m.fromNumber(o)}slog_internal(e=10){if(e=b(e),e.lte(m.dZero)||e.eq(m.dOne))return m.dNaN;if(e.lt(m.dOne))return this.eq(m.dOne)?m.dZero:this.eq(m.dZero)?m.dNegOne:m.dNaN;if(this.mag<0||this.eq(m.dZero))return m.dNegOne;let t=0,n=m.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(m.dZero))n=m.pow(e,n),t-=1;else{if(n.lte(m.dOne))return m.fromNumber(t+m.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=m.log(n,e)}return m.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:m.critical_section(e,t,Cr)}static tetrate_critical(e,t){return m.critical_section(e,t,Nr)}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 s=(e-at[u])/(at[u+1]-at[u]);i=n[u][Math.floor(t)]*(1-s)+n[u+1][Math.floor(t)]*s,r=n[u][Math.ceil(t)]*(1-s)+n[u+1][Math.ceil(t)]*s;break}const o=t-Math.floor(t);return i<=0||r<=0?i*(1-o)+r*o:Math.pow(e,Math.log(i)/Math.log(e)*(1-o)+Math.log(r)/Math.log(e)*o)}layeradd10(e){e=m.fromValue_noAlloc(e).toNumber();const t=m.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?m.tetrate(t,i):Number.isFinite(i)?i>=-1?m.log(m.tetrate(t,i+1),t):m.log(m.log(m.tetrate(t,i+2),t),t):m.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return m.fromNumber(Dn(this.toNumber()));if(this.layer===0)return m.fromNumber(Dn(this.sign*this.mag));if(this.layer===1)return Pn(this);if(this.layer===2)return Pn(this);if(this.layer>=3)return J(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return J(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=J(1,0,1)){t=b(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(m.dOne)?(++e,t=m.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?m.fromNumber(Math.sin(this.sign*this.mag)):J(0,0,0)}cos(){return this.mag<0?m.dOne:this.layer===0?m.fromNumber(Math.cos(this.sign*this.mag)):J(0,0,0)}tan(){return this.mag<0?this:this.layer===0?m.fromNumber(Math.tan(this.sign*this.mag)):J(0,0,0)}asin(){return this.mag<0?this:this.layer===0?m.fromNumber(Math.asin(this.sign*this.mag)):J(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?m.fromNumber(Math.acos(this.toNumber())):this.layer===0?m.fromNumber(Math.acos(this.sign*this.mag)):J(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?m.fromNumber(Math.atan(this.sign*this.mag)):m.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 m.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return m.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?J(Number.NaN,Number.NaN,Number.NaN):m.ln(this.add(1).div(m.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(m.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 l=m;l.fromStringCache=new fr(_r);l.dZero=J(0,0,0);l.dOne=J(1,0,1);l.dNegOne=J(-1,0,1);l.dTwo=J(1,0,2);l.dTen=J(1,0,10);l.dNaN=J(Number.NaN,Number.NaN,Number.NaN);l.dInf=J(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);l.dNegInf=J(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);l.dNumberMax=z(1,0,Number.MAX_VALUE);l.dNumberMin=z(1,0,Number.MIN_VALUE);b=l.fromValue_noAlloc;z=l.fromComponents;J=l.fromComponents_noNormalize;l.fromMantissaExponent;l.fromMantissaExponent_noNormalize;const xr=new l(1);function Ot(e,t,n=!0){let i=l.log10(e).floor(),r=l.div(e,l.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=xr,i=i.add(1));const o=i.gte(1e9)?Ae(i,Math.max(Math.max(t,3),ne.defaultDecimalsShown)):i.gte(1e4)?Yt(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+o:"e"+o}function Yt(e,t){if(e==null)return"NaN";if(e=new l(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 Zn(e,t){return e==null?"NaN":(e=new l(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),ne.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Sr=new l("eeee1000"),Mr=new l("e100000"),An=new l("e1000"),Yn=new l(1e9),Ir=new l(1e6),$r=new l(1e3),Er=new l(.98),Tr=new l(.001),Jn=new l(0);function Ae(e,t,n){if(t==null&&(t=ne.defaultDecimalsShown),n=n!=null?n:ne.defaultShowSmall,e=new l(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+Ae(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Sr)){const i=e.slog();return i.gte(Ir)?"F"+Ae(i.floor()):l.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+Yt(i.floor(),0)}else{if(e.gte(Mr))return Ot(e,0,!1);if(e.gte(An))return Ot(e,0);if(e.gte(Yn))return Ot(e,t);if(e.gte($r))return Yt(e,0);if(e.gte(Tr)||!n)return Zn(e,t);if(e.eq(Jn))return 0 .toFixed(t)}return e=Xn(e),e.lt(An)?Ot(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):Ae(e,t)+"\u207B\xB9"}function Pe(e){return e=new l(e),e.sign<0?"-"+Pe(e.neg()):e.gte(Yn)||e.lte(Er)&&!e.eq(Jn)?Ae(e):Ae(e,0)}function Kn(e){return l.lt(e,0)?"-"+Kn(l.neg(e)):l.gt(e,2**51)?Ae(l.div(e,31536e3))+"y":(e=new l(e).toNumber(),e<60?Ae(e)+"s":e<3600?Pe(Math.floor(e/60))+"m "+Ae(e%60)+"s":e<86400?Pe(Math.floor(e/3600))+"h "+Pe(Math.floor(e/60)%60)+"m "+Pe(e%60)+"s":e<31536e3?Pe(Math.floor(e/84600)%365)+"d "+Pe(Math.floor(e/3600)%24)+"h "+Pe(Math.floor(e/60)%60)+"m":Pe(Math.floor(e/31536e3))+"y "+Pe(Math.floor(e/84600)%365)+"d "+Pe(Math.floor(e/3600)%24)+"h")}function Fr(e,t,n){e=new l(e);let i=e.toStringWithDecimalPlaces(t);return new l(i).gte(n)&&(i=l.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function Dr(e,t){return Ae(e,t,!0)}function Xn(e){let t=l.log10(e).ceil();const n=l.div(e,l.pow(10,t));return t=t.neg(),e=new l(10).pow(t).times(n),e}var Pr=Object.freeze(Object.defineProperty({__proto__:null,default:l,exponentialFormat:Ot,commaFormat:Yt,regularFormat:Zn,format:Ae,formatWhole:Pe,formatTime:Kn,toPlaces:Fr,formatSmall:Dr,invertOOM:Xn},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:Ar,commaFormat:Or,regularFormat:Vr,format:dt,formatWhole:Ve,formatTime:fn,toPlaces:Lr,formatSmall:gt,invertOOM:qr}=Pr;window.Decimal=l;window.exponentialFormat=Ar;window.commaFormat=Or;window.regularFormat=Vr;window.format=dt;window.formatWhole=Ve;window.formatTime=fn;window.toPlaces=Lr;window.formatSmall=gt;window.invertOOM=qr;function Je(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Jt(e){return typeof e=="function"}var W=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(W||{});const Bt=Symbol("DoNotCache");function q(e,t){const n=e[t];Jt(n)&&n.length===0&&!n[Bt]?e[t]=M(n.bind(e)):Jt(n)&&(e[t]=n.bind(e),e[t][Bt]=!0)}function ke(e){return Jt(e)&&!e[Bt]&&(e=M(e)),e}const Rt=Symbol("Component"),en=Symbol("GatherProps");let Br=0;function Qn(e="feature-"){return e+Br++}var We=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(We||{});function it(e){const t=a(e);return t!==2&&t!==!1}function tn(e){return a(e)===1}function se(e){return e[Bt]=!0,e}function ve(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function Rr(e,...t){const n=[],i=r=>{Object.keys(r).forEach(o=>{const u=r[o];u!=null&&typeof u=="object"&&(t.includes(u.type)?n.push(u):!(u instanceof l)&&!me(u)&&i(u))})};return i(e),n}const ot={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 mn=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(mn||{}),Re={classic:ot,paper:{...ot,variables:{...ot.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:{...ot,variables:{...ot.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:{...ot,variables:{...ot.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const Ie=Gn();"fonts"in document&&(document.fonts.onloadingdone=()=>Ie.emit("fontsLoaded"));var zr=Object.freeze(Object.defineProperty({__proto__:null,globalBus:Ie},Symbol.toStringTag,{value:"Module"}));const Ur=pt({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var G=window.player=Ur;function ei(e){return JSON.stringify(e,(t,n)=>a(n))}function ti(e={}){return Object.assign({id:`${ne.id}-0`,name:"Default Save",tabs:ne.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:ne.id,modVersion:ne.versionNumber,layers:{}},e)}function Ee(e){const t=Xe.compressToUTF16(ei(e!=null?e:G));return localStorage.setItem((e!=null?e:G).id,t),t}async function jr(){Hr();try{let e=localStorage.getItem(re.active);if(e==null){await lt(xt());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Xe.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==ne.id){await lt(xt());return}t.id=re.active,await lt(t)}catch(e){console.error(`Failed to load save. Falling back to new save. +`,e),await lt(xt())}}function xt(){const e=Wt(),t=ti({id:e});return Ee(t),re.saves.push(e),t}function Wt(){let e,t=0;do e=`${ne.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const Gr=A(!1);async function lt(e){console.info("Loading save",e),Gr.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await qt(()=>Promise.resolve().then(function(){return ga}),void 0),{fixOldSave:r,getInitialLayers:o}=await qt(()=>Promise.resolve().then(function(){return Wu}),void 0);for(const u in t){const s=t[u];s&&n(s)}o(e).forEach(u=>i(u,e)),e=ti(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,ne.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ne.versionNumber&&(r(e.modVersion,e),e.modVersion=ne.versionNumber),Object.assign(G,e),re.active=G.id,Ie.emit("onLoad")}setInterval(()=>{G.autosave&&Ee()},1e3);window.onbeforeunload=()=>{G.autosave&&Ee()};window.save=Ee;const Wr=window.hardReset=async()=>{await lt(xt())};window.deleteLowerSaves=()=>{const e=Object.values(re.saves).indexOf(G.id)+1;Object.values(re.saves).slice(e).forEach(t=>localStorage.removeItem(t)),re.saves=re.saves.slice(0,e)};const zt=pt({active:"",saves:[],showTPS:!0,theme:mn.Nordic,unthrottled:!1,alignUnits:!1});Oe(zt,e=>{const t=Xe.compressToUTF16(JSON.stringify(e));localStorage.setItem(ne.id,t)},{deep:!0});var re=window.settings=zt;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:mn.Nordic,alignUnits:!1};Ie.emit("loadSettings",e),Object.assign(zt,e),Wr()};function Hr(){try{let e=localStorage.getItem(ne.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Xe.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(zt,t)}Ie.emit("loadSettings",zt)}catch{}}const Zr=pt([]),Yr=pt([]),Jr=pt([]);function we(e,t="span"){return typeof e=="function"?H({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),H({template:e})):H({render:()=>({})}):e}function Ke(e){if(ft(e))return typeof e=="function"?e():we(e);const t=e[Rt];return y(t,e[en](),null)}function je(e){if(ft(e))return typeof e=="function"?e():typeof e=="string"?y(le,null,[e]):y(e,null,null);const t=e[Rt];return y(t,e[en](),null)}function ft(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Bt]===!0}function ni(e,t){const n=A(null),i=A(void 0);function r(s){n.value||(n.value=setInterval(u,250)),i.value=s}function o(){n.value&&(clearInterval(n.value),n.value=null)}function u(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return jn(o),{start:r,stop:o,handleHolding:u}}function ii(e,t="div"){const n=Le();return Ue(()=>{n.value=we(xe(e),t)}),n}function Et(e,t="div"){const n=Le(null);return Ue(()=>{const i=xe(e);n.value=i==""||i==null?null:we(i,t)}),n}function xe(e){return a(a(e))}function j(...e){return e.includes(Object)||e.push(Object),e}var ae=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const Kr=H({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var h;const n=A({}),i=new ResizeObserver(s),r=A(null);Qt(()=>{const p=r.value;p!=null&&i.observe(p)});let o=!0,u=A((h=r.value)==null?void 0:h.getBoundingClientRect());function s(){o&&(o=!1,tt(()=>{var p;u.value=(p=r.value)==null?void 0:p.getBoundingClientRect(),Object.values(n.value).filter(w=>w).forEach(w=>w.rect=w.element.getBoundingClientRect()),t("updateNodes",n.value),o=!0}))}Ie.on("fontsLoaded",s);const c={attributes:!1,childList:!0,subtree:!1};Gt(pn,(p,w)=>{const k=new MutationObserver(()=>g(p));k.observe(w,c),n.value[p]={element:w,observer:k,rect:w.getBoundingClientRect()},s()}),Gt(vn,p=>{var w;(w=n.value[p])==null||w.observer.disconnect(),n.value[p]=void 0,s()}),Gt(hn,n),Gt(bn,u);function g(p){const w=n.value[p];w!=null&&(w.rect=w.element.getBoundingClientRect(),t("updateNodes",n.value))}return(p,w)=>(C(),$(le,null,[et(p.$slots,"default",{},void 0,!0),v("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var ri=ae(Kr,[["__scopeId","data-v-2b1dc1bc"]]);const Xr=["onPointerdown"],Qr={class:"modal-wrapper"},ea={class:"modal-container"},ta={class:"modal-header"},na={class:"modal-body"},ia={class:"modal-footer"},ra=v("div",{class:"modal-default-flex-grow"},null,-1),rt=H({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=pe(e),o=M(()=>a(r.modelValue)||s.value);function u(){n("update:modelValue",!1)}const s=A(!1),c=A(null),g=M(()=>{var h,p;return(p=(h=c.value)==null?void 0:h.nodes)!=null?p:null});return t({isOpen:o,nodes:g}),(h,p)=>(C(),X(Di,{to:"#modal-root"},[y(It,{name:"modal",onBeforeEnter:p[0]||(p[0]=w=>s.value=!0),onAfterLeave:p[1]||(p[1]=w=>s.value=!1)},{default:B(()=>[dn(v("div",Ge({class:"modal-mask",onPointerdown:Mt(u,["self"])},h.$attrs),[v("div",Qr,[v("div",ea,[v("div",ta,[et(h.$slots,"header",{shown:a(o)},()=>[O(" default header ")])]),v("div",na,[y(ri,{ref_key:"contextRef",ref:c},{default:B(()=>[et(h.$slots,"body",{shown:a(o)},()=>[O(" default body ")])]),_:3},512)]),v("div",ia,[et(h.$slots,"footer",{shown:a(o)},()=>[v("div",{class:"modal-default-footer"},[ra,v("button",{class:"button modal-default-button",onClick:u}," Close ")])])])])])],16,Xr),[[Fi,e.modelValue]])]),_:3})]))}}),st=Symbol("ProxyState");function Tt(e,t={}){const n=t;let i=!1;function r(){return i||(Object.assign(n,e.call(n,n)),i=!0),n}return new Proxy(n,{get(o,u){if(u===st)return r();const s=r()[u];return s!=null&&typeof s=="object"&&Qe in s?s[Qe]:s},set(o,u,s){return r()[u]=s,!0},has(o,u){return u===st?!0:Reflect.has(r(),u)},ownKeys(){return Reflect.ownKeys(r())},getOwnPropertyDescriptor(o,u){return i||(Object.assign(n,e.call(n,n)),i=!0),Object.getOwnPropertyDescriptor(o,u)}})}var he=window.state=gn({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const St=Symbol("PersistentState"),Ut=Symbol("DefaultValue"),Kt=Symbol("StackTrace"),Xt=Symbol("Deleted"),Qe=Symbol("NonPersistent"),ut=Symbol("SaveDataPath"),aa=Symbol("SkipPersistence");function oa(){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 On(e,t){var n;if(l.isNaN(t))throw he.hasNaN||(G.autosave=!1,he.hasNaN=!0,he.NaNPath=e[ut],he.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[St].value=t}function vt(e,t=!0){const n=me(e)?e:A(e);me(e)&&(e=e.value);const i=M({get(){return n.value},set(o){t?On(r,o):r[St].value=o}});i[Ut]=e;const r={get value(){return n.value},set value(o){t?On(r,o):r[St].value=o},__v_isRef:!0,[St]:n,[Ut]:e,[Kt]:oa(),[Xt]:!1,[Qe]:i,[ut]:void 0};return Se.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,` +Created at: +`+r[Kt]):mt[Se[Se.length-1]].add(r),r}function sa(e){return e!=null&&typeof e=="object"&&St in e}function la(e){Se.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):mt[Se[Se.length-1]].delete(e),e[Xt]=!0}Ie.on("addLayer",(e,t)=>{const n=[],i=(r,o=[])=>{let u=!1;return Object.keys(r).forEach(s=>{let c=r[s];if(c!=null&&typeof c=="object"){if(c[aa]===!0)return;if(st in c&&(c=c[st]),sa(c)){if(u=!0,c[Xt]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` +Created at: +`+c[Kt]);return}mt[e.id].delete(c);const g=[e.id,...o,s];c[ut]!=null&&JSON.stringify(g)!==JSON.stringify(c[ut])&&console.error(`Persistent ref is being saved to \`${g.join(".")}\` when it's already present at \`${c[ut].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[ut]=g;const h=o.reduce((w,k)=>(k in w||(w[k]={}),w[k]),t),p=h[s];h[s]=c[St],Pi(h)?p!=null?h[s]=p:h[s]=c[Ut]:p!=null?h[s].value=p:h[s].value=c[Ut]}else!(c instanceof l)&&!me(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...o,s])&&($n(c)&&!$n(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.",st in r?r[st]:r,s):u=!0))}}),u};i(e[st]),mt[e.id].forEach(r=>{r[Xt]||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[Kt])}),mt[e.id].clear()});const pn=Symbol("RegisterNode"),vn=Symbol("UnregisterNode"),hn=Symbol("Nodes"),bn=Symbol("Bounds"),ye=gn({});window.layers=ye;const mt={},Se=[];function yn(e,t){return Tt(()=>{const n={},i=n.emitter=Gn();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=A({}),n.id=e,Se.push(e),mt[e]=new Set,n.minimized=vt(!1,!1),Object.assign(n,t.call(n,n)),Se[Se.length-1]==null||Se[Se.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen +Stack: ${Se} +Trying to pop ${n.id}`;Se.pop(),q(n,"color"),q(n,"display"),q(n,"classes"),q(n,"style"),q(n,"name"),ve(n,"name",n.id),q(n,"minWidth"),ve(n,"minWidth",600),q(n,"minimizable"),ve(n,"minimizable",!0),q(n,"minimizedDisplay");const r=n.style;return n.style=M(()=>{var u,s;let o=a(n.minWidth);return(typeof o=="number"||!Number.isNaN(parseInt(o)))&&(o=o+"px"),[(u=a(r))!=null?u:"",(s=n.minimized)!=null&&s.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:o,flexBasis:o,margin:""}]}),n})}function _n(e,t){if(console.info("Adding layer",e.id),ye[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ye[e.id]);return}ve(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ye[e.id]=e,Ie.emit("addLayer",e,t.layers[e.id])}function ua(e){return ye[e]}function ai(e){console.info("Removing layer",e.id),Ie.emit("removeLayer",e),ye[e.id]=void 0}function ca(e){ai(e),_n(e,G)}function da(e){const t=A(!1);return{openModal:()=>t.value=!0,modal:se(()=>y(rt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>y("h2",null,[a(e.name)]),body:a(e.display)}))}}Ie.on("update",function(t){Object.values(ye).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(ye).forEach(n=>{n==null||n.emit("update",t)}),Object.values(ye).forEach(n=>{n==null||n.emit("postUpdate",t)})});var ga=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:pn,UnregisterNodeInjectionKey:vn,NodesInjectionKey:hn,BoundsInjectionKey:bn,layers:ye,persistentRefs:mt,addingLayers:Se,createLayer:yn,addLayer:_n,getLayer:ua,removeLayer:ai,reloadLayer:ca,setupLayerModal:da},Symbol.toStringTag,{value:"Module"}));const fa=H({components:{Context:ri},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}=pe(e),o=ii(t),u=Et(r),s=M(()=>ne.allowGoBack&&n.value>0&&!xe(i));function c(){G.tabs.splice(a(e.index),1/0)}function g(h){e.nodes.value=h}return{component:o,minimizedComponent:u,showGoBack:s,updateNodes:g,unref:a,goBack:c}}}),ma={key:1};function pa(e,t,n,i,r,o){const u=Ht("Context");return C(),$("div",{class:"layer-container",style:Te({"--layer-color":e.unref(e.color)})},[e.showGoBack?(C(),$("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...s)=>e.goBack&&e.goBack(...s))},"\u274C")):L("",!0),e.unref(e.minimized)?(C(),$("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=s=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(C(),X(Me(e.minimizedComponent),{key:0})):(C(),$("div",ma,K(e.unref(e.name)),1))])):(C(),$("div",{key:2,class:ue(["layer-tab",{showGoBack:e.showGoBack}])},[y(u,{onUpdateNodes:e.updateNodes},{default:B(()=>[(C(),X(Me(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(C(),$("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=s=>e.$emit("setMinimized",!0))}," \u25BC ")):L("",!0)],4)}var va=ae(fa,[["render",pa],["__scopeId","data-v-72dd78b1"]]);const oi=e=>(ht("data-v-4b4bda40"),e=e(),bt(),e),ha=oi(()=>v("h2",null,"Changelog",-1)),ba=oi(()=>v("details",{open:""},[v("summary",null,[O("v0.0 Initial Commit - "),v("time",null,"2021-09-04")]),O(" This is the first release :D "),v("ul",null,[v("li",{class:"feature"},"Did everything"),v("li",{class:"fix"},"Had some fun"),v("li",{class:"breaking"},"Removed everything"),v("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),ya=H({__name:"Changelog",setup(e,{expose:t}){const n=A(!1);return t({open(){n.value=!0}}),(i,r)=>(C(),X(rt,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=o=>n.value=o)},{header:B(()=>[ha]),body:B(()=>[ba]),_:1},8,["modelValue"]))}});var _a=ae(ya,[["__scopeId","data-v-4b4bda40"]]),wa=H({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}=pe(e),r=A(!1),o=M(()=>(xe(i)||r.value)&&u.value),u=Et(n),s=Le(we(se(()=>{const h=xe(t);return h==null?"":je(h)})));function c(h){const p=i;h.shiftKey&&p&&(p.value=!p.value,h.stopPropagation(),h.preventDefault())}const g=M(()=>xe(i)&&Re[re.theme].showPin);return{Direction:W,isHovered:r,isShown:o,comp:u,elementComp:s,unref:a,togglePinned:c,showPin:g}}});const Na={key:0,class:"material-icons pinned"};function Ca(e,t,n,i,r,o){return C(),$("div",{class:ue(["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))},[et(e.$slots,"default",{},void 0,!0),e.elementComp?(C(),X(Me(e.elementComp),{key:0})):L("",!0),y(It,{name:"fade"},{default:B(()=>{var u;return[e.isShown?(C(),$("div",{key:0,class:ue(["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:Te([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(u=e.unref(e.style))!=null?u:{}])},[e.showPin?(C(),$("span",Na,"push_pin")):L("",!0),e.comp?(C(),X(Me(e.comp),{key:1})):L("",!0)],6)):L("",!0)]}),_:1})],34)}var be=ae(wa,[["render",Ca],["__scopeId","data-v-6102fa3a"]]);const yt=e=>(ht("data-v-4f97aa40"),e=e(),bt(),e),ka={class:"info-modal-header"},xa=["src","alt"],Sa={class:"info-modal-title"},Ma={key:0},Ia={key:0},$a={key:0},Ea=yt(()=>v("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),Ta=yt(()=>v("br",null,null,-1)),Fa=yt(()=>v("br",null,null,-1)),Da=["href"],Pa=yt(()=>v("span",{class:"material-icons info-modal-discord"},"discord",-1)),Aa=yt(()=>v("div",null,[v("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[v("span",{class:"material-icons info-modal-discord"},"discord"),O(" The Paper Pilot Community ")])],-1)),Oa=yt(()=>v("div",null,[v("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[v("span",{class:"material-icons info-modal-discord"},"discord"),O(" The Modding Tree ")])],-1)),Va=yt(()=>v("br",null,null,-1));var La=H({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:r,author:o,discordName:u,discordLink:s,versionNumber:c,versionTitle:g}=ne,h=pe(n),p=A(!1),w=M(()=>fn(G.timePlayed)),k=M(()=>we(se(()=>y(le,null,[Yr.map(Ke)]))));t({open(){p.value=!0}});function _(){var x;(x=a(h.changelog))==null||x.open()}return(x,P)=>(C(),X(rt,{modelValue:p.value,"onUpdate:modelValue":P[0]||(P[0]=V=>p.value=V)},{header:B(()=>[v("div",ka,[a(r)?(C(),$("img",{key:0,class:"info-modal-logo",src:a(r),alt:a(i)},null,8,xa)):L("",!0),v("div",Sa,[v("h2",null,K(a(i)),1),v("h4",null,[O(" v"+K(a(c)),1),a(g)?(C(),$("span",Ma,": "+K(a(g)),1)):L("",!0)])])])]),body:B(({shown:V})=>[V?(C(),$("div",Ia,[a(o)?(C(),$("div",$a,"By "+K(a(o)),1)):L("",!0),Ea,Ta,v("div",{class:"link",onClick:_},"Changelog"),Fa,v("div",null,[a(s)?(C(),$("a",{key:0,href:a(s),class:"info-modal-discord-link",target:"_blank"},[Pa,O(" "+K(a(u)),1)],8,Da)):L("",!0)]),Aa,Oa,Va,v("div",null,"Time Played: "+K(a(w)),1),(C(),X(Me(a(k))))])):L("",!0)]),_:1},8,["modelValue"]))}});var qa=ae(La,[["__scopeId","data-v-4f97aa40"]]);const Ba={class:"field"},Ra={key:0,class:"field-title"},si=H({__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=Et(nt(n,"title"),"span"),r=A((u=n.options.find(s=>s.value===n.modelValue))!=null?u:null);Oe(nt(n,"modelValue"),s=>{var c;xe(r)!==s&&(r.value=(c=n.options.find(g=>g.value===s))!=null?c:null)});function o(s){t("update:modelValue",s.value)}return(s,c)=>(C(),$("div",Ba,[a(i)?(C(),$("span",Ra,[(C(),X(Me(a(i))))])):L("",!0),y(a(qi),{options:e.options,modelValue:r.value,"onUpdate:modelValue":[c[0]||(c[0]=g=>r.value=g),o],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const za={class:"field"},Ua=H({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=M(()=>{var o;return we((o=a(n.title))!=null?o:"","span")}),r=M({get(){return!!n.modelValue},set(o){t("update:modelValue",o)}});return(o,u)=>(C(),$("label",za,[dn(v("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":u[0]||(u[0]=s=>me(r)?r.value=s:null)},null,512),[[Ai,a(r)]]),(C(),X(Me(a(i))))]))}});var ze=ae(Ua,[["__scopeId","data-v-11046116"]]);const ja=["onClick"],Ga=H({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=A(!1),i=A(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,tt(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(o,u)=>(C(),$("button",{onClick:Mt(r,["stop"]),class:ue(["feedback",{activated:n.value,left:e.left}])},[et(o.$slots,"default",{},void 0,!0)],10,ja))}});var li=ae(Ga,[["__scopeId","data-v-01a1b95c"]]);const Wa={class:"header"},Ha=v("h2",null,"Settings",-1),Za={class:"option-tabs"},Ya={key:0},Ja={key:1};var Ka=H({__name:"Options",setup(e,{expose:t}){const n=A(!1),i=A("behaviour");function r(ie){return ie==i.value}function o(ie){i.value=ie}t({isTab:r,setTab:o,save:Ee,open(){n.value=!0}});const u=Object.keys(Re).map(ie=>({label:Je(ie),value:ie})),s=M(()=>we(se(()=>y(le,null,[Zr.map(Ke)])))),{showTPS:c,theme:g,unthrottled:h,alignUnits:p}=pe(re),{autosave:w,offlineProd:k}=pe(G),_=M({get(){return G.devSpeed===0},set(ie){G.devSpeed=ie?0:null}}),x=se(()=>y("span",{class:"option-title"},[O("Unthrottled"),y("desc",null,[O("Allow the game to run as fast as possible. Not battery friendly.")])])),P=se(()=>y("span",{class:"option-title"},[O("Offline Production"),y(be,{display:"Save-specific",direction:W.Right},{default:()=>[O("*")]}),y("desc",null,[O("Simulate production that occurs while the game is closed.")])])),V=se(()=>y("span",{class:"option-title"},[O("Autosave"),y(be,{display:"Save-specific",direction:W.Right},{default:()=>[O("*")]}),y("desc",null,[O("Automatically save the game every second or when the game is closed.")])])),I=se(()=>y("span",{class:"option-title"},[O("Pause game"),y(be,{display:"Save-specific",direction:W.Right},{default:()=>[O("*")]}),y("desc",null,[O("Stop everything from moving.")])])),D=se(()=>y("span",{class:"option-title"},[O("Theme"),y("desc",null,[O("How the game looks.")])])),T=se(()=>y("span",{class:"option-title"},[O("Show TPS"),y("desc",null,[O("Show TPS meter at the bottom-left corner of the page.")])])),U=se(()=>y("span",{class:"option-title"},[O("Align modifier units"),y("desc",null,[O("Align numbers to the beginning of the unit in modifier view.")])]));return(ie,ee)=>(C(),X(rt,{modelValue:n.value,"onUpdate:modelValue":ee[10]||(ee[10]=Q=>n.value=Q)},{header:B(()=>[v("div",Wa,[Ha,v("div",Za,[v("button",{class:ue({selected:r("behaviour")}),onClick:ee[0]||(ee[0]=Q=>o("behaviour"))},"Behaviour",2),v("button",{class:ue({selected:r("appearance")}),onClick:ee[1]||(ee[1]=Q=>o("appearance"))},"Appearance",2)])])]),body:B(()=>[r("behaviour")?(C(),$("div",Ya,[y(ze,{title:a(x),modelValue:a(h),"onUpdate:modelValue":ee[2]||(ee[2]=Q=>me(h)?h.value=Q:null)},null,8,["title","modelValue"]),a(ne).enablePausing?(C(),X(ze,{key:0,title:a(I),modelValue:a(_),"onUpdate:modelValue":ee[3]||(ee[3]=Q=>me(_)?_.value=Q:null)},null,8,["title","modelValue"])):L("",!0),y(ze,{title:a(P),modelValue:a(k),"onUpdate:modelValue":ee[4]||(ee[4]=Q=>me(k)?k.value=Q:null)},null,8,["title","modelValue"]),y(ze,{title:a(V),modelValue:a(w),"onUpdate:modelValue":ee[5]||(ee[5]=Q=>me(w)?w.value=Q:null)},null,8,["title","modelValue"]),a(w)?L("",!0):(C(),X(li,{key:1,class:"button save-button",onClick:ee[6]||(ee[6]=Q=>a(Ee)())},{default:B(()=>[O("Manually save")]),_:1}))])):L("",!0),r("appearance")?(C(),$("div",Ja,[y(si,{title:a(D),options:a(u),modelValue:a(g),"onUpdate:modelValue":ee[7]||(ee[7]=Q=>me(g)?g.value=Q:null)},null,8,["title","options","modelValue"]),(C(),X(Me(a(s)))),y(ze,{title:a(T),modelValue:a(c),"onUpdate:modelValue":ee[8]||(ee[8]=Q=>me(c)?c.value=Q:null)},null,8,["title","modelValue"]),y(ze,{title:a(U),modelValue:a(p),"onUpdate:modelValue":ee[9]||(ee[9]=Q=>me(p)?p.value=Q:null)},null,8,["title","modelValue"])])):L("",!0)]),_:1},8,["modelValue"]))}});const Xa=["onSubmit"],Qa={class:"field"},eo={key:0,class:"field-title"},to=["placeholder"],no=H({__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=Et(nt(n,"title"),"span"),r=Le(null);Qt(()=>{var c;(c=r.value)==null||c.focus()});const o=M({get(){var c;return(c=a(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function u(){t("submit")}function s(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,g)=>(C(),$("form",{onSubmit:Mt(u,["prevent"])},[v("div",Qa,[a(i)?(C(),$("span",eo,[(C(),X(Me(a(i))))])):L("",!0),e.textArea?(C(),X(a(Ri),{key:1,modelValue:a(o),"onUpdate:modelValue":g[0]||(g[0]=h=>me(o)?o.value=h:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:s,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):dn((C(),$("input",{key:2,type:"text","onUpdate:modelValue":g[1]||(g[1]=h=>me(o)?o.value=h:null),placeholder:e.placeholder,class:ue({fullWidth:!e.title}),onBlur:s,ref_key:"field",ref:r},null,42,to)),[[Oi,a(o)]])])],40,Xa))}});var ui=ae(no,[["__scopeId","data-v-90bd4994"]]);const io={key:0},ro=["onClick","disabled"],ao={key:0},oo=["onClick"],so=H({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=pe(e),r=A(!1);Oe(r,s=>{t("confirmingChanged",s)});function o(){if(a(i.skipConfirm)){t("click");return}r.value&&t("click"),r.value=!r.value}function u(){r.value=!1}return(s,c)=>(C(),$("span",{class:ue(["container",{confirming:r.value}])},[r.value?(C(),$("span",io,"Are you sure?")):L("",!0),v("button",{onClick:Mt(o,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(C(),$("span",ao,"Yes")):et(s.$slots,"default",{key:1},void 0,!0)],8,ro),r.value?(C(),$("button",{key:1,class:"button",onClick:Mt(u,["stop"])},"No",8,oo)):L("",!0)],2))}});var lo=ae(so,[["__scopeId","data-v-2f8ef34c"]]);const He=e=>(ht("data-v-32313015"),e=e(),bt(),e),uo=He(()=>v("div",{class:"handle material-icons"},"drag_handle",-1)),co={key:0,class:"actions"},go=He(()=>v("span",{class:"material-icons"},"content_paste",-1)),fo=He(()=>v("span",{class:"material-icons"},"content_copy",-1)),mo=He(()=>v("span",{class:"material-icons"},"edit",-1)),po=He(()=>v("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),vo={key:1,class:"actions"},ho=He(()=>v("span",{class:"material-icons"},"check",-1)),bo=He(()=>v("span",{class:"material-icons"},"close",-1)),yo={key:2,class:"details"},_o={class:"save-version"},wo=He(()=>v("br",null,null,-1)),No={key:0},Co={key:3,class:"details"},ko={key:4,class:"details error"},xo=He(()=>v("br",null,null,-1)),So=H({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=pe(n),r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),o=A(!1),u=A(!1),s=A("");Oe(o,()=>{var p;return s.value=(p=i.value.name)!=null?p:""});const c=M(()=>i.value!=null&&i.value.id===G.id),g=M(()=>{var p;return c.value?G.time:(p=i.value!=null&&i.value.time)!=null?p:0});function h(){t("editName",s.value),o.value=!1}return(p,w)=>(C(),$("div",{class:ue(["save",{active:a(c)}])},[uo,o.value?(C(),$("div",vo,[v("button",{onClick:h,class:"button"},[y(be,{display:"Save",direction:a(W).Left,class:"info"},{default:B(()=>[ho]),_:1},8,["direction"])]),v("button",{onClick:w[5]||(w[5]=k=>o.value=!o.value),class:"button"},[y(be,{display:"Cancel",direction:a(W).Left,class:"info"},{default:B(()=>[bo]),_:1},8,["direction"])])])):(C(),$("div",co,[a(i).error==null&&!u.value?(C(),X(li,{key:0,onClick:w[0]||(w[0]=k=>t("export")),class:"button",left:""},{default:B(()=>[y(be,{display:"Export",direction:a(W).Left,class:"info"},{default:B(()=>[go]),_:1},8,["direction"])]),_:1})):L("",!0),a(i).error==null&&!u.value?(C(),$("button",{key:1,onClick:w[1]||(w[1]=k=>t("duplicate")),class:"button"},[y(be,{display:"Duplicate",direction:a(W).Left,class:"info"},{default:B(()=>[fo]),_:1},8,["direction"])])):L("",!0),a(i).error==null&&!u.value?(C(),$("button",{key:2,onClick:w[2]||(w[2]=k=>o.value=!o.value),class:"button"},[y(be,{display:"Edit Name",direction:a(W).Left,class:"info"},{default:B(()=>[mo]),_:1},8,["direction"])])):L("",!0),y(lo,{disabled:a(c),onClick:w[3]||(w[3]=k=>t("delete")),onConfirmingChanged:w[4]||(w[4]=k=>u.value=k)},{default:B(()=>[y(be,{display:"Delete",direction:a(W).Left,class:"info"},{default:B(()=>[po]),_:1},8,["direction"])]),_:1},8,["disabled"])])),a(i).error==null&&!o.value?(C(),$("div",yo,[v("button",{class:"button open",onClick:w[6]||(w[6]=k=>t("open"))},[v("h3",null,K(a(i).name),1)]),v("span",_o,"v"+K(a(i).modVersion),1),wo,a(g)?(C(),$("div",No,"Last played "+K(a(r).format(a(g))),1)):L("",!0)])):a(i).error==null&&o.value?(C(),$("div",Co,[y(ui,{modelValue:s.value,"onUpdate:modelValue":w[7]||(w[7]=k=>s.value=k),class:"editname",onSubmit:h},null,8,["modelValue"])])):(C(),$("div",ko,[O(" Error: Failed to load save with id "+K(a(i).id),1),xo,O(K(a(i).error),1)]))],2))}});var Mo=ae(So,[["__scopeId","data-v-32313015"]]);const wn=e=>(ht("data-v-2a4275be"),e=e(),bt(),e),Io=wn(()=>v("h2",null,"Saves Manager",-1)),$o={class:"modal-footer"},Eo={class:"field"},To=wn(()=>v("span",{class:"field-title"},"Create Save",-1)),Fo={class:"field-buttons"},Do={class:"footer"},Po=wn(()=>v("div",{style:{"flex-grow":"1"}},null,-1)),Ao=H({__name:"SavesManager",setup(e,{expose:t}){const n=A(!1),i=A(null);t({open(){n.value=!0}});const r=A(!1),o=A(""),u=A(null);Oe(o,I=>{I?tt(()=>{try{if(I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=Xe.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I),r.value=!0;return}const D=JSON.parse(I);if(typeof D!="object"){r.value=!0;return}const T=Wt();D.id=T,Ee(D),o.value="",r.value=!1,re.saves.push(T)}catch{r.value=!0}}):r.value=!1});let s={},c=A(Object.keys(s).reduce((I,D)=>(I.push({label:D.split("/").slice(-1)[0].slice(0,-4),value:s[D]}),I),[]));const g=gn({});function h(I){if(g[I]==null){let D=localStorage.getItem(I);if(D==null)g[I]={error:"Save doesn't exist in localStorage",id:I};else if(D==="dW5kZWZpbmVk")g[I]={error:"Save is undefined",id:I};else try{if(D[0]!=="{")if(D[0]==="e")D=decodeURIComponent(escape(atob(D)));else if(D[0]==="\u1BE1")D=Xe.decompressFromUTF16(D);else return console.warn("Unable to determine preset encoding",D),r.value=!0,g[I]={error:"Unable to determine preset encoding",id:I},g[I];g[I]={...JSON.parse(D),id:I}}catch(T){g[I]={error:T,id:I},console.warn(`SavesManager: Failed to load info about save with id ${I}: +${T} +${D}`)}}return g[I]}Oe(n,I=>{I&&Object.keys(g).forEach(D=>delete g[D])});const p=M(()=>re.saves.reduce((I,D)=>(I[D]=h(D),I),{}));function w(I){let D;switch(G.id===I?D=ei(G):D=JSON.stringify(p.value[I]),ne.exportEncoding){default:console.warn(`Unknown save encoding: ${ne.exportEncoding}. Defaulting to lz`);case"lz":D=Xe.compressToUTF16(D);break;case"base64":D=btoa(unescape(encodeURIComponent(D)));break;case"plain":break}const T=document.createElement("textarea");T.value=D,document.body.appendChild(T),T.select(),T.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(T)}function k(I){G.id===I&&Ee();const D={...p.value[I],id:Wt()};Ee(D),re.saves.push(D.id)}function _(I){re.saves=re.saves.filter(D=>D!==I),localStorage.removeItem(I),g[I]=void 0}function x(I){p.value[G.id].time=G.time,Ee(),g[G.id]=void 0,lt(p.value[I]),g[I]=void 0}function P(I){if(u.value=I,tt(()=>{u.value=null}),I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=Xe.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I);return}const D=JSON.parse(I);D.id=Wt(),Ee(D),re.saves.push(D.id),x(D.id)}function V(I,D){const T=p.value[I];T!=null&&(T.name=D,G.id===I?(G.name=D,Ee()):(Ee(T),g[I]=void 0))}return(I,D)=>(C(),X(rt,{modelValue:n.value,"onUpdate:modelValue":D[4]||(D[4]=T=>n.value=T),ref_key:"modal",ref:i},{header:B(()=>[Io]),body:B(({shown:T})=>[T?(C(),X(a(Bi),{key:0,list:a(re).saves,handle:".handle",itemKey:U=>U},{item:B(({element:U})=>[y(Mo,{save:a(p)[U],onOpen:ie=>x(U),onExport:ie=>w(U),onEditName:ie=>V(U,ie),onDuplicate:ie=>k(U),onDelete:ie=>_(U)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):L("",!0)]),footer:B(()=>[v("div",$o,[y(ui,{modelValue:o.value,"onUpdate:modelValue":D[0]||(D[0]=T=>o.value=T),title:"Import Save",placeholder:"Paste your save here!",class:ue({importingFailed:r.value})},null,8,["modelValue","class"]),v("div",Eo,[To,v("div",Fo,[v("button",{class:"button",onClick:D[1]||(D[1]=T=>x(a(xt)().id))},"New Game"),Object.keys(a(c)).length>0?(C(),X(si,{key:0,options:a(c),modelValue:u.value,"onUpdate:modelValue":D[2]||(D[2]=T=>P(T)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):L("",!0)])]),v("div",Do,[Po,v("button",{class:"button modal-default-button",onClick:D[3]||(D[3]=T=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var ci=ae(Ao,[["__scopeId","data-v-2a4275be"]]);const Fe=e=>(ht("data-v-318a1c31"),e=e(),bt(),e),Oo=["src","alt"],Vo={key:1,class:"title"},Lo=Fe(()=>v("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),qo={class:"discord"},Bo={class:"discord-links"},Ro={key:0},zo=["href"],Uo=Fe(()=>v("li",null,[v("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),jo=Fe(()=>v("li",null,[v("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Go={href:"https://forums.moddingtree.com/",target:"_blank"},Wo=Fe(()=>v("span",{class:"material-icons"},"forum",-1)),Ho=Fe(()=>v("span",{class:"material-icons"},"info",-1)),Zo=Fe(()=>v("span",{class:"material-icons"},"library_books",-1)),Yo=Fe(()=>v("span",{class:"material-icons"},"settings",-1)),Jo=Fe(()=>v("span",{class:"material-icons"},"library_books",-1)),Ko=Fe(()=>v("span",{class:"material-icons"},"settings",-1)),Xo=Fe(()=>v("span",{class:"material-icons"},"info",-1)),Qo={href:"https://forums.moddingtree.com/",target:"_blank"},es=Fe(()=>v("span",{class:"material-icons"},"forum",-1)),ts={class:"discord"},ns={class:"discord-links"},is={key:0},rs=["href"],as=Fe(()=>v("li",null,[v("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),os=Fe(()=>v("li",null,[v("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),ss=H({__name:"Nav",setup(e){const t=A(null),n=A(null),i=A(null),r=A(null),{useHeader:o,banner:u,title:s,discordName:c,discordLink:g,versionNumber:h}=ne;function p(){window.open(g,"mywindow")}return(w,k)=>(C(),$(le,null,[a(o)?(C(),$("div",Ge({key:0,class:"nav"},w.$attrs),[a(u)?(C(),$("img",{key:0,src:a(u),class:"banner",alt:a(s)},null,8,Oo)):(C(),$("div",Vo,K(a(s)),1)),v("div",{onClick:k[0]||(k[0]=_=>{var x;return(x=r.value)==null?void 0:x.open()}),class:"version-container"},[y(be,{display:"Changelog",direction:a(W).Down,class:"version"},{default:B(()=>[v("span",null,"v"+K(a(h)),1)]),_:1},8,["direction"])]),Lo,v("div",qo,[v("span",{onClick:p,class:"material-icons"},"discord"),v("ul",Bo,[a(g)?(C(),$("li",Ro,[v("a",{href:a(g),target:"_blank"},K(a(c)),9,zo)])):L("",!0),Uo,jo])]),v("div",null,[v("a",Go,[y(be,{display:"Forums",direction:a(W).Down,yoffset:"5px"},{default:B(()=>[Wo]),_:1},8,["direction"])])]),v("div",{onClick:k[1]||(k[1]=_=>{var x;return(x=t.value)==null?void 0:x.open()})},[y(be,{display:"Info",direction:a(W).Down,class:"info"},{default:B(()=>[Ho]),_:1},8,["direction"])]),v("div",{onClick:k[2]||(k[2]=_=>{var x;return(x=n.value)==null?void 0:x.open()})},[y(be,{display:"Saves",direction:a(W).Down,xoffset:"-20px"},{default:B(()=>[Zo]),_:1},8,["direction"])]),v("div",{onClick:k[3]||(k[3]=_=>{var x;return(x=i.value)==null?void 0:x.open()})},[y(be,{display:"Settings",direction:a(W).Down,xoffset:"-66px"},{default:B(()=>[Yo]),_:1},8,["direction"])])],16)):(C(),$("div",Ge({key:1,class:"overlay-nav"},w.$attrs),[v("div",{onClick:k[4]||(k[4]=_=>{var x;return(x=r.value)==null?void 0:x.open()}),class:"version-container"},[y(be,{display:"Changelog",direction:a(W).Right,xoffset:"25%",class:"version"},{default:B(()=>[v("span",null,"v"+K(a(h)),1)]),_:1},8,["direction"])]),v("div",{onClick:k[5]||(k[5]=_=>{var x;return(x=n.value)==null?void 0:x.open()})},[y(be,{display:"Saves",direction:a(W).Right},{default:B(()=>[Jo]),_:1},8,["direction"])]),v("div",{onClick:k[6]||(k[6]=_=>{var x;return(x=i.value)==null?void 0:x.open()})},[y(be,{display:"Settings",direction:a(W).Right},{default:B(()=>[Ko]),_:1},8,["direction"])]),v("div",{onClick:k[7]||(k[7]=_=>{var x;return(x=t.value)==null?void 0:x.open()})},[y(be,{display:"Info",direction:a(W).Right},{default:B(()=>[Xo]),_:1},8,["direction"])]),v("div",null,[v("a",Qo,[y(be,{display:"Forums",direction:a(W).Right,xoffset:"7px"},{default:B(()=>[es]),_:1},8,["direction"])])]),v("div",ts,[v("span",{onClick:p,class:"material-icons"},"discord"),v("ul",ns,[a(g)?(C(),$("li",is,[v("a",{href:a(g),target:"_blank"},K(a(c)),9,rs)])):L("",!0),as,os])])],16)),y(qa,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),y(ci,{ref_key:"savesManager",ref:n},null,512),y(Ka,{ref_key:"options",ref:i},null,512),y(_a,{ref_key:"changelog",ref:r},null,512)],64))}});var di=ae(ss,[["__scopeId","data-v-318a1c31"]]);const ls={class:"inner-tab"},us=H({__name:"Game",setup(e){const t=nt(G,"tabs"),n=M(()=>Object.keys(ye)),i=ne.useHeader;function r(o){const{display:u,minimized:s,name:c,color:g,minimizable:h,nodes:p,minimizedDisplay:w}=o;return{display:u,minimized:s,name:c,color:g,minimizable:h,nodes:p,minimizedDisplay:w}}return(o,u)=>(C(),$("div",{class:ue(["tabs-container",{useHeader:a(i)}])},[(C(!0),$(le,null,$t(a(t),(s,c)=>{var g,h;return C(),$("div",{key:c,class:ue(["tab",a((g=a(ye)[s])==null?void 0:g.classes)]),style:Te(a((h=a(ye)[s])==null?void 0:h.style))},[c===0&&!a(i)?(C(),X(di,{key:0})):L("",!0),v("div",ls,[a(n).includes(s)?(C(),X(va,Ge({key:0},r(a(ye)[s]),{index:c,onSetMinimized:p=>a(ye)[s].minimized.value=p}),null,16,["index","onSetMinimized"])):(C(),X(Me(s),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var cs=ae(us,[["__scopeId","data-v-dcd207b4"]]);const ds=H({__name:"Sticky",setup(e){const t=A("0"),n=new ResizeObserver(r),i=Le(null);function r(){let o=i.value;if(o==null)return;let u=0;for(;o.previousSibling;){const s=o.previousSibling;s.dataset&&"vSticky"in s.dataset&&(u+=s.offsetHeight),o=s}t.value=u+"px"}return tt(r),document.fonts.ready.then(r),Qt(()=>{var u;const o=(u=i.value)==null?void 0:u.parentElement;o&&n.observe(o)}),(o,u)=>(C(),$("div",{class:"sticky",style:Te({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[et(o.$slots,"default",{},void 0,!0)],4))}});var Nn=ae(ds,[["__scopeId","data-v-cccac690"]]);const gs=["x1","y1","x2","y2"],fs=H({__name:"BoardLink",props:{link:null},setup(e){const n=pe(e),i=M(()=>{const o=n.link.value.startNode.position;return n.link.value.offsetStart&&(o.x+=a(n.link.value.offsetStart).x,o.y+=a(n.link.value.offsetStart).y),o}),r=M(()=>{const o=n.link.value.endNode.position;return n.link.value.offsetEnd&&(o.x+=a(n.link.value.offsetEnd).x,o.y+=a(n.link.value.offsetEnd).y),o});return(o,u)=>(C(),$("line",Ge({class:"link"},e.link,{class:{pulsing:e.link.pulsing},x1:a(i).x,y1:a(i).y,x2:a(r).x,y2:a(r).y}),null,16,gs))}});var ms=ae(fs,[["__scopeId","data-v-57c4970a"]]);const ps={key:0},vs=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],hs=["fill","stroke-width","stroke"],bs=["fill"],ys=H({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const i=pe(e),r=M(()=>te(i.nodeType.value.size,a(i.node))),o=M(()=>{var h;return(h=te(i.nodeType.value.outlineColor,a(i.node)))!=null?h:Re[re.theme].variables["--outline"]}),u=M(()=>{var h;return(h=te(i.nodeType.value.titleColor,a(i.node)))!=null?h:Re[re.theme].variables["--foreground"]}),s=M(()=>te(i.nodeType.value.actionDistance,a(i.node)));function c(h,p){t("clickAction",p.id),h.preventDefault(),h.stopPropagation()}function g(h,p){var w;((w=a(i.selectedAction))==null?void 0:w.id)===p.id&&(h.preventDefault(),h.stopPropagation())}return(h,p)=>(C(),X(It,{name:"actions",appear:""},{default:B(()=>[e.isSelected&&e.actions?(C(),$("g",ps,[(C(!0),$(le,null,$t(e.actions,(w,k)=>{var _,x;return C(),$("g",{key:w.id,class:ue(["action",{selected:((_=e.selectedAction)==null?void 0:_.id)===w.id}]),transform:`translate( + ${(-a(r)-30)*Math.sin(((e.actions.length-1)/2-k)*a(s))}, + ${(a(r)+30)*Math.cos(((e.actions.length-1)/2-k)*a(s))} + )`,onMousedown:P=>c(P,w),onTouchstart:P=>c(P,w),onMouseup:P=>g(P,w),onTouchend:Mt(P=>g(P,w),["stop"])},[v("circle",{fill:a(te)(w.fillColor,e.node),r:"20","stroke-width":((x=e.selectedAction)==null?void 0:x.id)===w.id?4:0,stroke:a(o)},null,8,hs),v("text",{fill:a(u),class:"material-icons"},K(a(te)(w.icon,e.node)),9,bs)],42,vs)}),128))])):L("",!0)]),_:1}))}});var _s=ae(ys,[["__scopeId","data-v-9efb2a56"]]);const ws=["transform"],Ns={key:0},Cs=["r","fill","stroke"],ks=["r","fill","stroke"],xs=["r","fill"],Ss=["r","stroke-dasharray","stroke-dashoffset","stroke"],Ms={key:1,transform:"rotate(45, 0, 0)"},Is=["width","height","transform","fill","stroke"],$s=["width","height","transform","fill","stroke"],Es=["width","height","transform","fill"],Ts=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],Fs=["fill","y"],Ds=["fill"],Ps={key:0},As=["fill","y"],Os=["fill","y"],Vs=H({__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=pe(n),o=M(()=>a(r.selectedNode)===a(r.node)),u=M(()=>te(r.nodeType.value.draggable,a(r.node)));Oe(u,Y=>{const ge=a(r.node);a(r.dragging)===ge&&!Y&&t("endDragging",ge)});const s=M(()=>{var ge;const Y=a(r.node);return(ge=te(r.nodeType.value.actions,Y))==null?void 0:ge.filter(De=>it(te(De.visibility,Y)))}),c=M(()=>{var ge;const Y=a(r.node);if(te(r.nodeType.value.draggable,Y)&&((ge=a(r.dragging))==null?void 0:ge.id)===Y.id&&a(r.dragged)!=null){const{x:De,y:qe}=a(r.dragged);return{x:Y.position.x+Math.round(De/25)*25,y:Y.position.y+Math.round(qe/25)*25}}return Y.position}),g=M(()=>te(r.nodeType.value.shape,a(r.node))),h=M(()=>te(r.nodeType.value.title,a(r.node))),p=M(()=>te(r.nodeType.value.subtitle,a(r.node))),w=M(()=>{var Y;return(Y=o.value?a(r.selectedAction)&&te(a(r.selectedAction).tooltip,a(r.node)):null)!=null?Y:te(r.nodeType.value.label,a(r.node))}),k=M(()=>{var Y,ge;return te((ge=(Y=a(r.selectedAction))==null?void 0:Y.confirmationLabel)!=null?ge:{text:"Tap again to confirm"},a(r.node))}),_=M(()=>te(r.nodeType.value.size,a(r.node))),x=M(()=>{var Y;return(Y=te(r.nodeType.value.progress,a(r.node)))!=null?Y:0}),P=M(()=>Re[re.theme].variables["--background"]),V=M(()=>{var Y;return(Y=te(r.nodeType.value.outlineColor,a(r.node)))!=null?Y:Re[re.theme].variables["--outline"]}),I=M(()=>{var Y;return(Y=te(r.nodeType.value.fillColor,a(r.node)))!=null?Y:Re[re.theme].variables["--raised-background"]}),D=M(()=>te(r.nodeType.value.progressColor,a(r.node))),T=M(()=>{var Y;return(Y=te(r.nodeType.value.titleColor,a(r.node)))!=null?Y:Re[re.theme].variables["--foreground"]}),U=M(()=>te(r.nodeType.value.progressDisplay,a(r.node))),ie=M(()=>r.dragging.value!=null&&a(r.hasDragged)&&te(r.nodeType.value.canAccept,a(r.node),r.dragging.value)),ee=M(()=>te(r.nodeType.value.style,a(r.node))),Q=M(()=>te(r.nodeType.value.classes,a(r.node)));function Ne(Y){t("mouseDown",Y,r.node.value,u.value)}function Z(Y){var ge,De,qe;(ge=r.hasDragged)!=null&&ge.value||(t("endDragging",r.node.value),(qe=(De=r.nodeType.value).onClick)==null||qe.call(De,r.node.value),Y.stopPropagation())}return(Y,ge)=>{var De,qe,_t;return C(),$("g",{class:ue(["boardnode",{[e.node.type]:!0,isSelected:a(o),isDraggable:a(u),...a(Q)}]),style:Te([{opacity:((De=e.dragging)==null?void 0:De.id)===e.node.id&&e.hasDragged?.5:1},(qe=a(ee))!=null?qe:[]]),transform:`translate(${a(c).x},${a(c).y})${a(o)?" scale(1.2)":""}`},[y(_s,{actions:(_t=a(s))!=null?_t:[],"is-selected":a(o),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:ge[0]||(ge[0]=Be=>t("clickAction",Be))},null,8,["actions","is-selected","node","node-type","selected-action"]),v("g",{class:"node-container",onMousedown:Ne,onTouchstartPassive:Ne,onMouseup:Z,onTouchendPassive:Z},[a(g)===a($e).Circle?(C(),$("g",Ns,[a(ie)?(C(),$("circle",{key:0,class:"receiver",r:a(_)+8,fill:a(P),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,Cs)):L("",!0),v("circle",{class:"body",r:a(_),fill:a(I),stroke:a(V),"stroke-width":4},null,8,ks),a(U)===a(ct).Fill?(C(),$("circle",{key:1,class:"progress progressFill",r:Math.max(a(_)*a(x)-2,0),fill:a(D)},null,8,xs)):(C(),$("circle",{key:2,r:a(_)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(a(_)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(a(_)+4.5)*2*Math.PI-a(x)*(a(_)+4.5)*2*Math.PI,stroke:a(D)},null,8,Ss))])):a(g)===a($e).Diamond?(C(),$("g",Ms,[a(ie)?(C(),$("rect",{key:0,class:"receiver",width:a(_)*a(i)+16,height:a(_)*a(i)+16,transform:`translate(${-(a(_)*a(i)+16)/2}, ${-(a(_)*a(i)+16)/2})`,fill:a(P),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,Is)):L("",!0),v("rect",{class:"body",width:a(_)*a(i),height:a(_)*a(i),transform:`translate(${-a(_)*a(i)/2}, ${-a(_)*a(i)/2})`,fill:a(I),stroke:a(V),"stroke-width":4},null,8,$s),a(U)===a(ct).Fill?(C(),$("rect",{key:1,class:"progress progressFill",width:Math.max(a(_)*a(i)*a(x)-2,0),height:Math.max(a(_)*a(i)*a(x)-2,0),transform:`translate(${-Math.max(a(_)*a(i)*a(x)-2,0)/2}, ${-Math.max(a(_)*a(i)*a(x)-2,0)/2})`,fill:a(D)},null,8,Es)):(C(),$("rect",{key:2,class:"progress progressDiamond",width:a(_)*a(i)+9,height:a(_)*a(i)+9,transform:`translate(${-(a(_)*a(i)+9)/2}, ${-(a(_)*a(i)+9)/2})`,fill:"transparent","stroke-dasharray":(a(_)*a(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(a(_)*a(i)+9)*4-a(x)*(a(_)*a(i)+9)*4,stroke:a(D)},null,8,Ts))])):L("",!0),v("text",{fill:a(T),class:"node-title",y:a(p)?10:0},K(a(h)),9,Fs),a(p)?(C(),$("text",{key:2,fill:a(T),class:"node-subtitle",y:"-15"},K(a(p)),9,Ds)):L("",!0)],32),y(It,{name:"fade",appear:""},{default:B(()=>{var Be;return[a(w)?(C(),$("g",Ps,[v("text",{fill:(Be=a(w).color)!=null?Be:a(T),class:ue(["node-title",{pulsing:a(w).pulsing}]),y:-a(_)-20},K(a(w).text),11,As)])):L("",!0)]}),_:1}),y(It,{name:"fade",appear:""},{default:B(()=>{var Be;return[a(o)&&e.selectedAction?(C(),$("text",{key:0,fill:(Be=a(k).color)!=null?Be:a(T),class:ue(["node-title",{pulsing:a(k).pulsing}]),y:a(_)+75},K(a(k).text),11,Os)):L("",!0)]}),_:1})],14,ws)}}});var Ls=ae(Vs,[["__scopeId","data-v-4654be02"]]);const qs={class:"stage",width:"100%",height:"100%"},Bs={class:"g1"},Rs=H({__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=pe(e),i=A({x:0,y:0}),r=A({x:0,y:0}),o=A(!1),u=A(null),s=M(()=>{const k=n.nodes.value.slice();if(n.draggingNode.value){const _=k.splice(k.indexOf(n.draggingNode.value),1)[0];k.push(_)}return k});Ue(()=>{const k=n.draggingNode.value;if(k==null)return null;const _={x:k.position.x+r.value.x,y:k.position.y+r.value.y};let x=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((P,V)=>{if(V.id===k.id)return P;const I=n.types.value[V.type];if(!te(I.canAccept,V,k))return P;const T=Math.pow(_.x-V.position.x,2)+Math.pow(_.y-V.position.y,2);let U=te(I.size,V);return T>x||T>U*U?P:(x=T,V)},null))});function c(k){k.setTransformOrigin(null),k.moveTo(u.value.$el.clientWidth/2,u.value.$el.clientHeight/2)}function g(k,_=null,x=!1){if(n.draggingNode.value==null){k.preventDefault(),k.stopPropagation();let P,V;if("touches"in k)if(k.touches.length===1)P=k.touches[0].clientX,V=k.touches[0].clientY;else return;else P=k.clientX,V=k.clientY;i.value={x:P,y:V},r.value={x:0,y:0},o.value=!1,x&&n.setDraggingNode.value(_)}_!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function h(k){const{x:_,y:x,scale:P}=u.value.panZoomInstance.getTransform();let V,I;if("touches"in k)if(k.touches.length===1)V=k.touches[0].clientX,I=k.touches[0].clientY;else{p(n.draggingNode.value),n.mousePosition.value=null;return}else V=k.clientX,I=k.clientY;n.mousePosition.value={x:(V-_)/P,y:(I-x)/P},r.value={x:r.value.x+(V-i.value.x)/P,y:r.value.y+(I-i.value.y)/P},i.value={x:V,y:I},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(o.value=!0),n.draggingNode.value!=null&&(k.preventDefault(),k.stopPropagation())}function p(k,_=!1){var x,P;if(n.draggingNode.value!=null&&n.draggingNode.value===k){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 V=n.nodes.value;V.push(V.splice(V.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((P=(x=n.types.value[n.receivingNode.value.type]).onDrop)==null||P.call(x,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!o.value&&!_&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function w(k,_){n.state.value.selectedAction===_?a(n.selectedAction).onClick(a(n.selectedNode)):n.state.value={...n.state.value,selectedAction:_}}return(k,_)=>{const x=Ht("panZoom");return a(it)(e.visibility)?(C(),X(x,{key:0,style:Te([{width:e.width,height:e.height},e.style]),class:ue(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:u,onInit:c,onMousemove:h,onTouchmove:h,onMousedown:_[0]||(_[0]=P=>g(P)),onTouchstart:_[1]||(_[1]=P=>g(P)),onMouseup:_[2]||(_[2]=()=>p(a(e.draggingNode))),onTouchendPassive:_[3]||(_[3]=()=>p(a(e.draggingNode))),onMouseleave:_[4]||(_[4]=()=>p(a(e.draggingNode),!0))},{default:B(()=>[(C(),$("svg",qs,[v("g",Bs,[y(En,{name:"link",appear:""},{default:B(()=>[(C(!0),$(le,null,$t(a(e.links)||[],P=>(C(),$("g",{key:`${P.startNode.id}-${P.endNode.id}`},[y(ms,{link:P},null,8,["link"])]))),128))]),_:1}),y(En,{name:"grow",duration:500,appear:""},{default:B(()=>[(C(!0),$(le,null,$t(a(s),P=>{var V;return C(),$("g",{key:P.id,style:{"transition-duration":"0s"}},[y(Ls,{node:P,nodeType:e.types[P.type],dragging:a(e.draggingNode),dragged:a(e.draggingNode)===P?r.value:void 0,hasDragged:o.value,receivingNode:((V=a(e.receivingNode))==null?void 0:V.id)===P.id,selectedNode:a(e.selectedNode),selectedAction:a(e.selectedAction),onMouseDown:g,onEndDragging:p,onClickAction:I=>w(P,I)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","selectedNode","selectedAction","onClickAction"])])}),128))]),_:1})])]))]),_:1},8,["style","class","options"])):L("",!0)}}});Ie.on("setupVue",e=>zi.install(e));const gi=Symbol("Board");var ct=(e=>(e.Outline="Outline",e.Fill="Fill",e))(ct||{}),$e=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))($e||{});function zs(e){const t=vt({nodes:[],selectedNode:null,selectedAction:null},!1);return Tt(n=>{const i=e.call(n,n);i.id=Qn("board-"),i.type=gi,i[Rt]=Rs,i.state?(la(t),q(i,"state")):(t[Ut]={nodes:i.startNodes().map((s,c)=>(s.id=c,s)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=M(()=>a(u.state).nodes),i.selectedNode=M({get(){return u.nodes.value.find(s=>s.id===a(u.state).selectedNode)||null},set(s){var c,g;me(u.state)?u.state.value={...u.state.value,selectedNode:(c=s==null?void 0:s.id)!=null?c:null}:u.state.selectedNode=(g=s==null?void 0:s.id)!=null?g:null}}),i.selectedAction=M({get(){const s=u.selectedNode.value;if(s==null)return null;const c=u.types[s.type];return c.actions==null?null:c.actions.find(g=>g.id===a(u.state).selectedAction)||null},set(s){var c,g;me(u.state)?u.state.value={...u.state.value,selectedAction:(c=s==null?void 0:s.id)!=null?c:null}:u.state.selectedAction=(g=s==null?void 0:s.id)!=null?g:null}}),i.mousePosition=A(null),i.links?q(i,"links"):i.links=M(()=>u.selectedAction.value==null?null:u.selectedAction.value.links&&u.selectedNode.value?te(u.selectedAction.value.links,u.selectedNode.value):null),i.draggingNode=A(null),i.receivingNode=A(null),q(i,"visibility"),ve(i,"visibility",We.Visible),q(i,"width"),ve(i,"width","100%"),q(i,"height"),ve(i,"height","100%"),q(i,"classes"),q(i,"style");for(const s in i.types){const c=i.types[s];if(q(c,"title"),q(c,"subtitle"),q(c,"label"),q(c,"size"),ve(c,"size",50),q(c,"style"),q(c,"classes"),q(c,"draggable"),ve(c,"draggable",!1),q(c,"shape"),ve(c,"shape","Circle"),q(c,"canAccept"),ve(c,"canAccept",!1),q(c,"progress"),q(c,"progressDisplay"),ve(c,"progressDisplay","Fill"),q(c,"progressColor"),ve(c,"progressColor","none"),q(c,"fillColor"),q(c,"outlineColor"),q(c,"titleColor"),q(c,"actionDistance"),ve(c,"actionDistance",Math.PI/6),c.nodes=M(()=>a(u.state).nodes.filter(g=>g.type===s)),ve(c,"onClick",function(g){a(u.state).selectedNode=g.id}),c.actions)for(const g of c.actions)q(g,"visibility"),ve(g,"visibility",We.Visible),q(g,"icon"),q(g,"fillColor"),q(g,"tooltip"),q(g,"confirmationLabel"),ve(g,"confirmationLabel",{text:"Tap again to confirm"}),q(g,"links")}function r(s){i.draggingNode.value=s}function o(s){i.receivingNode.value=s}i.placeInAvailableSpace=function(s,c=100,g=W.Right){const h=u.nodes.value.slice().filter(p=>p===s||(g===W.Down||g===W.Up)&&Math.abs(p.position.x-s.position.x)>c||(g===W.Left||g===W.Right)&&Math.abs(p.position.y-s.position.y)>c?!1:!(g===W.Right&&p.position.xs.position.x+c||g===W.Up&&p.position.y>s.position.y+c||g===W.Down&&p.position.yp.position.x-w.position.x:g===W.Left?(p,w)=>w.position.x-p.position.x:g===W.Up?(p,w)=>w.position.y-p.position.y:(p,w)=>p.position.y-w.position.y);for(let p=0;p0&&k>c)break}},i[en]=function(){const{nodes:s,types:c,state:g,visibility:h,width:p,height:w,style:k,classes:_,links:x,selectedAction:P,selectedNode:V,mousePosition:I,draggingNode:D,receivingNode:T}=this;return{nodes:s,types:c,state:g,visibility:h,width:p,height:w,style:a(k),classes:_,links:x,selectedAction:P,selectedNode:V,mousePosition:I,draggingNode:D,receivingNode:T,setDraggingNode:r,setReceivingNode:o}};const u=i;return u})}function te(e,t,...n){return Jt(e)?e(t,...n):a(e)}function ln(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const Vt={};Ie.on("addLayer",e=>{const t=Rr(e,gi);Vt[e.id]=e.on("postUpdate",n=>{t.forEach(i=>{Object.values(i.types).forEach(r=>r.nodes.value.forEach(o=>{var u;return(u=r.update)==null?void 0:u.call(r,o,n)}))})})});Ie.on("removeLayer",e=>{var t;(t=Vt[e.id])==null||t.call(Vt),Vt[e.id]=void 0});function fi(e,t="points",n=0,i=void 0){const r=me(e)?e:vt(e);if(r.displayName=t,r.precision=n,r.small=i,!me(e)){const o=r[Qe];o.displayName=t,o.precision=n,o.small=i}return r}new l("10^^8");new l("1e100");function Us(e,t){const n=t!=null?t:e.value;return l.eq(e.precision,0)?Ve(e.small?n:l.floor(n)):dt(n,e.precision,e.small)}Ie.on("setupVue",e=>e.use(Ui));function js(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 Gs=H({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}=pe(e),o=ii(n),u=M(()=>{const c=xe(i);return c==null||c===""?{}:a(r)?js(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function s(){t("selectTab")}return{selectTab:s,component:o,glowColorStyle:u,unref:a,Visibility:We,isVisible:it,isHidden:tn}}});function Ws(e,t,n,i,r,o){var u;return e.isVisible(e.visibility)?(C(),$("button",{key:0,onClick:t[0]||(t[0]=(...s)=>e.selectTab&&e.selectTab(...s)),class:ue(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:Te([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(u=e.unref(e.style))!=null?u:{}])},[(C(),X(Me(e.component)))],6)):L("",!0)}var mi=ae(Gs,[["render",Ws],["__scopeId","data-v-21427abb"]]);const Hs=H({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:Nn,TabButton:mi},setup(e){const{activeTab:t}=pe(e),n=M(()=>Re[re.theme].floatingTabs),i=Le("");Ue(()=>{const s=xe(t);if(s==null){i.value="";return}if(ft(s)){i.value=we(s);return}i.value=we(a(s.display))});const r=M(()=>{const s=xe(t);return ft(s)||!s?void 0:a(s.classes)}),o=M(()=>{const s=xe(t);return ft(s)||!s?void 0:a(s.style)});function u(s){const{display:c,style:g,classes:h,glowColor:p,visibility:w}=s;return{display:c,style:a(g),classes:h,glowColor:p,visibility:w}}return{floating:n,tabClasses:r,tabStyle:o,Visibility:We,component:i,gatherButtonProps:u,unref:a,isVisible:it,isHidden:tn}}});function Zs(e,t,n,i,r,o){var c,g;const u=Ht("TabButton"),s=Ht("Sticky");return e.isVisible(e.visibility)?(C(),$("div",{key:0,class:ue(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:Te([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(g=e.tabStyle)!=null?g:[]])},[y(s,{class:ue(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:Te(e.unref(e.buttonContainerStyle))},{default:B(()=>[v("div",{class:ue(["tab-buttons",{floating:e.floating}])},[(C(!0),$(le,null,$t(e.unref(e.tabs),(h,p)=>(C(),X(u,Ge({onSelectTab:w=>e.selected.value=p,floating:e.floating,key:p,active:e.unref(h.tab)===e.unref(e.activeTab)},e.gatherButtonProps(h)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(C(),X(Me(e.unref(e.component)),{key:0})):L("",!0)],6)):L("",!0)}var Ys=ae(Hs,[["render",Zs],["__scopeId","data-v-58dbf83a"]]);const Js=Symbol("TabButton"),Ks=Symbol("TabFamily");function Xs(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=vt(Object.keys(e)[0],!1);return Tt(i=>{var u;const r=(u=t==null?void 0:t.call(i,i))!=null?u:{};r.id=Qn("tabFamily-"),r.type=Ks,r[Rt]=Ys,r.tabs=Object.keys(e).reduce((s,c)=>{const g=e[c]();return g.type=Js,g[Rt]=mi,q(g,"visibility"),ve(g,"visibility",We.Visible),q(g,"tab"),q(g,"display"),q(g,"classes"),q(g,"style"),q(g,"glowColor"),s[c]=g,s},{}),r.selected=n,r.activeTab=M(()=>{const s=a(o.tabs);if(n.value in s&&it(s[n.value].visibility))return a(s[n.value].tab);const c=Object.values(s).find(g=>it(g.visibility));return c?a(c.tab):null}),q(r,"visibility"),ve(r,"visibility",We.Visible),q(r,"classes"),q(r,"style"),q(r,"buttonContainerClasses"),q(r,"buttonContainerStyle"),r[en]=function(){const{visibility:s,activeTab:c,selected:g,tabs:h,style:p,classes:w,buttonContainerClasses:k,buttonContainerStyle:_}=this;return{visibility:s,activeTab:c,selected:g,tabs:h,style:a(p),classes:w,buttonContainerClasses:k,buttonContainerStyle:_}};const o=r;return o})}const pi=l.ln(10);function Lt(e){return e}function Qs(e,t){if(E(t))return t.invert(l.neg(e));throw new Error("Could not invert due to no input being a variable")}function el(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return f.neg(t.getIntegralFormula(e))}throw new Error("Could not integrate due to no input being a variable")}function tl(e){return f.neg(e)}function nl(e,t,n){if(E(t))return t.invert(l.sub(e,de(n)));if(E(n))return n.invert(l.sub(e,de(t)));throw new Error("Could not invert due to no input being a variable")}function il(e,t,n){var i,r;if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const o=t.getIntegralFormula(e);return f.times(n,(i=t.innermostVariable)!=null?i:0).add(o)}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const o=n.getIntegralFormula(e);return f.times(t,(r=n.innermostVariable)!=null?r:0).add(o)}throw new Error("Could not integrate due to no input being a variable")}function rl(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return f.add(i,n)}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return f.add(i,t)}throw new Error("Could not integrate due to no input being a variable")}function al(e,t,n){if(E(t))return t.invert(l.add(e,de(n)));if(E(n))return n.invert(l.sub(de(t),e));throw new Error("Could not invert due to no input being a variable")}function ol(e,t,n){var i,r;if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const o=t.getIntegralFormula(e);return f.sub(o,f.times(n,(i=t.innermostVariable)!=null?i:0))}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const o=n.getIntegralFormula(e);return f.times(t,(r=n.innermostVariable)!=null?r:0).sub(o)}throw new Error("Could not integrate due to no input being a variable")}function sl(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return f.sub(i,n)}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return f.sub(i,t)}throw new Error("Could not integrate due to no input being a variable")}function ll(e,t,n){if(E(t))return t.invert(l.div(e,de(n)));if(E(n))return n.invert(l.div(e,de(t)));throw new Error("Could not invert due to no input being a variable")}function ul(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return f.times(i,n)}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return f.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function cl(e,t,n){if(E(t))return f.div(e,n);if(E(n))return f.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function dl(e,t,n){if(E(t))return t.invert(l.mul(e,de(n)));if(E(n))return n.invert(l.div(de(t),e));throw new Error("Could not invert due to no input being a variable")}function gl(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return f.div(i,n)}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return f.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function fl(e,t,n){if(E(t))return f.mul(e,n);if(E(n))return f.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function ml(e,t){if(E(t))return t.invert(l.recip(e));throw new Error("Could not invert due to no input being a variable")}function pl(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function vl(e,t){if(E(t))return t.invert(l.pow10(e));throw new Error("Could not invert due to no input being a variable")}function hl(e){return l.ln(e).sub(1).times(e).div(pi)}function bl(e,t){if(E(t)){const n=pi.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 yl(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new f({inputs:[t.getIntegralFormula(e)],evaluate:hl,invert:bl})}throw new Error("Could not integrate due to no input being a variable")}function _l(e,t,n){if(E(t))return t.invert(l.pow(de(n),e));if(E(n))return n.invert(l.root(de(t),e));throw new Error("Could not invert due to no input being a variable")}function wl(e,t){return l.ln(e).sub(1).times(e).div(l.ln(t))}function Nl(e,t,n){if(E(t)){const i=l.ln(de(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 Cl(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new f({inputs:[t.getIntegralFormula(e),n],evaluate:wl,invert:Nl})}throw new Error("Could not integrate due to no input being a variable")}function kl(e,t){if(E(t))return t.invert(l.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function xl(e){return l.ln(e).sub(1).times(e).div(l.ln(2))}function Sl(e,t){if(E(t)){const n=l.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 Ml(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new f({inputs:[t.getIntegralFormula(e)],evaluate:xl,invert:Sl})}throw new Error("Could not integrate due to no input being a variable")}function Il(e,t){if(E(t))return t.invert(l.exp(e));throw new Error("Could not invert due to no input being a variable")}function $l(e){return l.ln(e).sub(1).times(e)}function El(e,t){if(E(t))return t.invert(l.div(e,l.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function Tl(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new f({inputs:[t.getIntegralFormula(e)],evaluate:$l,invert:El})}throw new Error("Could not integrate due to no input being a variable")}function Fl(e,t,n){if(E(t))return t.invert(l.root(e,de(n)));if(E(n))return n.invert(l.ln(e).div(l.ln(de(t))));throw new Error("Could not invert due to no input being a variable")}function Dl(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e),r=f.add(n,1);return f.pow(i,r).div(r)}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return f.pow(t,i).div(f.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function Pl(e,t){if(E(t))return t.invert(l.root(e,10));throw new Error("Could not invert due to no input being a variable")}function Al(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.pow10(n).div(f.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function Ol(e,t,n){if(E(t))return t.invert(l.ln(e).div(de(n)));if(E(n))return n.invert(l.root(de(t),e));throw new Error("Could not invert due to no input being a variable")}function Vl(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return f.pow(n,i).div(f.ln(n))}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e),r=f.add(t,1);return f.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function Ll(e,t,n){if(E(t))return t.invert(l.root(e,l.recip(de(n))));if(E(n))return n.invert(l.ln(de(t)).div(l.ln(e)));throw new Error("Could not invert due to no input being a variable")}function ql(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return f.pow(i,f.recip(n).add(1)).times(n).div(f.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function Bl(e,t){if(E(t))return t.invert(l.ln(e));throw new Error("Could not invert due to no input being a variable")}function Rl(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function zl(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){const i=l.minabs(t,1e308).toNumber();return l.tetrate(e,i,n)}function Ul(e,t,n,i){if(E(t))return t.invert(l.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function jl(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){const i=l.minabs(t,1e308).toNumber();return l.iteratedexp(e,i,new l(n))}function Gl(e,t,n,i){if(E(t))return t.invert(l.iteratedlog(e,Math.E,l.minabs(1e308,de(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Wl(e,t=10,n=2){const i=l.minabs(n,1e308).toNumber();return l.iteratedlog(e,t,i)}function Hl(e,t=10){const n=l.minabs(t,1e308).toNumber();return l.slog(e,n)}function Zl(e,t,n){if(E(t))return t.invert(l.tetrate(e,l.minabs(1e308,de(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Yl(e,t,n){const i=l.minabs(t,1e308).toNumber();return l.layeradd(e,i,n)}function Jl(e,t,n,i){if(E(t))return t.invert(l.layeradd(e,l.minabs(1e308,de(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function Kl(e,t){if(E(t))return t.invert(l.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function Xl(e,t){if(E(t))return t.invert(l.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function Ql(e,t,n){const i=l.minabs(t,1e308).toNumber();return l.pentate(e,i,n)}function eu(e,t){if(E(t))return t.invert(l.asin(e));throw new Error("Could not invert due to no input being a variable")}function tu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function nu(e,t){if(E(t))return t.invert(l.acos(e));throw new Error("Could not invert due to no input being a variable")}function iu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function ru(e,t){if(E(t))return t.invert(l.atan(e));throw new Error("Could not invert due to no input being a variable")}function au(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function ou(e,t){if(E(t))return t.invert(l.sin(e));throw new Error("Could not invert due to no input being a variable")}function su(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.asin(n).times(n).add(f.sqrt(f.sub(1,f.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function lu(e,t){if(E(t))return t.invert(l.cos(e));throw new Error("Could not invert due to no input being a variable")}function uu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.acos(n).times(n).sub(f.sqrt(f.sub(1,f.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function cu(e,t){if(E(t))return t.invert(l.tan(e));throw new Error("Could not invert due to no input being a variable")}function du(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.atan(n).times(n).sub(f.ln(f.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function gu(e,t){if(E(t))return t.invert(l.asinh(e));throw new Error("Could not invert due to no input being a variable")}function fu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function mu(e,t){if(E(t))return t.invert(l.acosh(e));throw new Error("Could not invert due to no input being a variable")}function pu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function vu(e,t){if(E(t))return t.invert(l.atanh(e));throw new Error("Could not invert due to no input being a variable")}function hu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function bu(e,t){if(E(t))return t.invert(l.sinh(e));throw new Error("Could not invert due to no input being a variable")}function yu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.asinh(n).times(n).sub(f.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function _u(e,t){if(E(t))return t.invert(l.cosh(e));throw new Error("Could not invert due to no input being a variable")}function wu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.acosh(n).times(n).sub(f.add(n,1).sqrt().times(f.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function Nu(e,t){if(E(t))return t.invert(l.tanh(e));throw new Error("Could not invert due to no input being a variable")}function Cu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return f.atanh(n).times(n).add(f.sub(1,f.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function Ft(e){return(t,n)=>new f({inputs:[t,n],evaluate:e,invert:Lt})}function E(e){return e instanceof ce&&e.hasVariable()}function de(e,t){return e instanceof ce?e.evaluate(t):a(e)}function ku(){return f.pow(this,2).div(2)}function xu(){return this}const fe=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"&&Qe in n?n[Qe]:n)),"variable"in e?(typeof e.variable=="object"&&Qe in e.variable&&(e.variable=e.variable[Qe]),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:ku,internalIntegrateInner:xu,applySubstitution:Lt}}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){const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:o,applySubstitution:u}=e,s=t.reduce((h,p)=>h+(p instanceof fe?p.internalVariables:0),0),c=t.find(h=>h instanceof fe&&h.hasVariable()),g=s===1?c==null?void 0:c.innermostVariable:void 0;return{inputs:t,internalEvaluate:n,internalInvert:i,internalIntegrate:r,internalIntegrateInner:o,applySubstitution:u,innermostVariable:g,internalVariables:s}}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=>de(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:de(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof fe&&e.inputs[n]instanceof fe?t.equals(e.inputs[n]):!(t instanceof fe)&&!(e.inputs[n]instanceof fe)&&l.eq(a(t),a(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new f({inputs:[e]})}static variable(e){return new f({variable:e})}static step(e,t,n){const i=A(0),r=n(f.variable(i)),o=ke(t);function u(c){return l.lt(c,a(o))?c:(i.value=l.sub(c,a(o)),l.add(r.evaluate(),a(o)))}function s(c,g){if(E(g)&&r.isInvertible())return l.gt(c,a(o))&&(c=l.add(r.invert(l.sub(c,a(o))),a(o))),g.invert(c);throw new Error("Could not invert due to no input being a variable")}return new f({inputs:[e],evaluate:u,invert:r.isInvertible()&&r.hasVariable()?s:void 0})}static if(e,t,n,i){const r=A(0),o=f.variable(r),u=n(o),s=i==null?void 0:i(o),c=ke(t);function g(p){return a(c)?(r.value=p,u.evaluate()):s?(r.value=p,s.evaluate()):p}function h(p,w){if(!E(w)||!u.isInvertible()||s!=null&&!s.isInvertible())throw new Error("Could not invert due to no input being a variable");return a(c)?w.invert(u.invert(p)):s?w.invert(s.invert(p)):w.invert(p)}return new f({inputs:[e],evaluate:g,invert:u.isInvertible()&&u.hasVariable()?h:void 0})}static conditional(e,t,n,i){return f.if(e,t,n,i)}static abs(e){return new f({inputs:[e],evaluate:l.abs})}static neg(e){return new f({inputs:[e],evaluate:l.neg,invert:Qs,applySubstitution:tl,integrate:el})}static sign(e){return new f({inputs:[e],evaluate:l.sign})}static round(e){return new f({inputs:[e],evaluate:l.round})}static floor(e){return new f({inputs:[e],evaluate:l.floor})}static ceil(e){return new f({inputs:[e],evaluate:l.ceil})}static trunc(e){return new f({inputs:[e],evaluate:l.trunc})}static add(e,t){return new f({inputs:[e,t],evaluate:l.add,invert:nl,integrate:il,integrateInner:rl,applySubstitution:Lt})}static sub(e,t){return new f({inputs:[e,t],evaluate:l.sub,invert:al,integrate:ol,integrateInner:sl,applySubstitution:Lt})}static mul(e,t){return new f({inputs:[e,t],evaluate:l.mul,invert:ll,integrate:ul,applySubstitution:cl})}static div(e,t){return new f({inputs:[e,t],evaluate:l.div,invert:dl,integrate:gl,applySubstitution:fl})}static recip(e){return new f({inputs:[e],evaluate:l.recip,invert:ml,integrate:pl})}static clamp(e,t,n){return new f({inputs:[e,t,n],evaluate:l.clamp,invert:Lt})}static pLog10(e){return new f({inputs:[e],evaluate:l.pLog10})}static absLog10(e){return new f({inputs:[e],evaluate:l.absLog10})}static log10(e){return new f({inputs:[e],evaluate:l.log10,invert:vl,integrate:yl})}static log(e,t){return new f({inputs:[e,t],evaluate:l.log,invert:_l,integrate:Cl})}static log2(e){return new f({inputs:[e],evaluate:l.log2,invert:kl,integrate:Ml})}static ln(e){return new f({inputs:[e],evaluate:l.ln,invert:Il,integrate:Tl})}static pow(e,t){return new f({inputs:[e,t],evaluate:l.pow,invert:Fl,integrate:Dl})}static pow10(e){return new f({inputs:[e],evaluate:l.pow10,invert:Pl,integrate:Al})}static pow_base(e,t){return new f({inputs:[e,t],evaluate:l.pow_base,invert:Ol,integrate:Vl})}static root(e,t){return new f({inputs:[e,t],evaluate:l.root,invert:Ll,integrate:ql})}static factorial(e){return new f({inputs:[e],evaluate:l.factorial})}static gamma(e){return new f({inputs:[e],evaluate:l.gamma})}static lngamma(e){return new f({inputs:[e],evaluate:l.lngamma})}static exp(e){return new f({inputs:[e],evaluate:l.exp,invert:Bl,integrate:Rl})}static sqr(e){return f.pow(e,2)}static sqrt(e){return f.root(e,2)}static cube(e){return f.pow(e,3)}static cbrt(e){return f.root(e,3)}static tetrate(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){return new f({inputs:[e,t,n],evaluate:zl,invert:Ul})}static iteratedexp(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){return new f({inputs:[e,t,n],evaluate:jl,invert:Gl})}static iteratedlog(e,t=10,n=1){return new f({inputs:[e,t,n],evaluate:Wl})}static slog(e,t=10){return new f({inputs:[e,t],evaluate:Hl,invert:Zl})}static layeradd10(e,t){return new f({inputs:[e,t],evaluate:l.layeradd10})}static layeradd(e,t,n=10){return new f({inputs:[e,t,n],evaluate:Yl,invert:Jl})}static lambertw(e){return new f({inputs:[e],evaluate:l.lambertw,invert:Kl})}static ssqrt(e){return new f({inputs:[e],evaluate:l.ssqrt,invert:Xl})}static pentate(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){return new f({inputs:[e,t,n],evaluate:Ql})}static sin(e){return new f({inputs:[e],evaluate:l.sin,invert:ou,integrate:tu})}static cos(e){return new f({inputs:[e],evaluate:l.cos,invert:lu,integrate:iu})}static tan(e){return new f({inputs:[e],evaluate:l.tan,invert:cu,integrate:au})}static asin(e){return new f({inputs:[e],evaluate:l.asin,invert:eu,integrate:su})}static acos(e){return new f({inputs:[e],evaluate:l.acos,invert:nu,integrate:uu})}static atan(e){return new f({inputs:[e],evaluate:l.atan,invert:ru,integrate:du})}static sinh(e){return new f({inputs:[e],evaluate:l.sinh,invert:bu,integrate:fu})}static cosh(e){return new f({inputs:[e],evaluate:l.cosh,invert:_u,integrate:pu})}static tanh(e){return new f({inputs:[e],evaluate:l.tanh,invert:Nu,integrate:hu})}static asinh(e){return new f({inputs:[e],evaluate:l.asinh,invert:gu,integrate:yu})}static acosh(e){return new f({inputs:[e],evaluate:l.acosh,invert:mu,integrate:wu})}static atanh(e){return new f({inputs:[e],evaluate:l.atanh,invert:vu,integrate:Cu})}step(e,t){return f.step(this,e,t)}if(e,t){return f.if(this,e,t)}conditional(e,t){return f.if(this,e,t)}abs(){return f.abs(this)}neg(){return f.neg(this)}sign(){return f.sign(this)}round(){return f.round(this)}floor(){return f.floor(this)}ceil(){return f.ceil(this)}trunc(){return f.trunc(this)}add(e){return f.add(this,e)}sub(e){return f.sub(this,e)}mul(e){return f.mul(this,e)}div(e){return f.div(this,e)}recip(){return f.recip(this)}max(e){return f.max(this,e)}min(e){return f.min(this,e)}maxabs(e){return f.maxabs(this,e)}minabs(e){return f.minabs(this,e)}clamp(e,t){return f.clamp(this,e,t)}clampMin(e){return f.clampMin(this,e)}clampMax(e){return f.clampMax(this,e)}pLog10(){return f.pLog10(this)}absLog10(){return f.absLog10(this)}log10(){return f.log10(this)}log(e){return f.log(this,e)}log2(){return f.log2(this)}ln(){return f.ln(this)}pow(e){return f.pow(this,e)}pow10(){return f.pow10(this)}pow_base(e){return f.pow_base(this,e)}root(e){return f.root(this,e)}factorial(){return f.factorial(this)}gamma(){return f.gamma(this)}lngamma(){return f.lngamma(this)}exp(){return f.exp(this)}sqr(){return f.pow(this,2)}sqrt(){return f.root(this,2)}cube(){return f.pow(this,3)}cbrt(){return f.root(this,3)}tetrate(e=2,t=l.fromComponents_noNormalize(1,0,1)){return f.tetrate(this,e,t)}iteratedexp(e=2,t=l.fromComponents_noNormalize(1,0,1)){return f.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return f.iteratedlog(this,e,t)}slog(e=10){return f.slog(this,e)}layeradd10(e){return f.layeradd10(this,e)}layeradd(e,t){return f.layeradd(this,e,t)}lambertw(){return f.lambertw(this)}ssqrt(){return f.ssqrt(this)}pentate(e=2,t=l.fromComponents_noNormalize(1,0,1)){return f.pentate(this,e,t)}sin(){return f.sin(this)}cos(){return f.cos(this)}tan(){return f.tan(this)}asin(){return f.asin(this)}acos(){return f.acos(this)}atan(){return f.atan(this)}sinh(){return f.sinh(this)}cosh(){return f.cosh(this)}tanh(){return f.tanh(this)}asinh(){return f.asinh(this)}acosh(){return f.acosh(this)}atanh(){return f.atanh(this)}};let ce=fe;ce.negate=fe.neg;ce.negated=fe.neg;ce.sgn=fe.sign;ce.plus=fe.add;ce.subtract=fe.sub;ce.minus=fe.sub;ce.multiply=fe.mul;ce.times=fe.mul;ce.divide=fe.div;ce.divideBy=fe.div;ce.dividedBy=fe.div;ce.reciprocal=fe.recip;ce.reciprocate=fe.recip;ce.max=Ft(l.max);ce.min=Ft(l.min);ce.minabs=Ft(l.minabs);ce.maxabs=Ft(l.maxabs);ce.clampMin=Ft(l.clampMin);ce.clampMax=Ft(l.clampMax);ce.logarithm=fe.log;class f extends ce{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=l.add(this.evaluate(0),this.evaluate(1)).div(2);return l.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 un(e,t,n=!0,i){var o,u,s;let r=l.add(t,(o=a(e.innermostVariable))!=null?o: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=a(e.innermostVariable))!=null?u:0);let g=l.sub(e.evaluateIntegral(r),e.evaluateIntegral());if(c.gt(1e308))return g.add(l.sub(c,r).times(e.evaluate(r)));for(let h=r.toNumber();h{const{addend:n,description:i,enabled:r,smallerIsBetter:o}=e.call(t,t),u=ke(n),s=ke(i),c=r==null?void 0:ke(r);return{apply:g=>l.add(g,a(u)),invert:g=>l.sub(g,a(u)),getFormula:g=>f.add(g,u),enabled:c,description:i==null?void 0:se(()=>y("div",{class:"modifier-container"},[a(s)!=null?y("span",{class:"modifier-description"},[je(a(s))]):null,y("span",{class:"modifier-amount",style:(o===!0?l.gt(a(u),0):l.lt(a(u),0))?"color: var(--danger)":""},[l.gte(a(u),0)?"+":"",gt(a(u))])]))}})}function Pt(e){return Tt(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:o}=e.call(t,t),u=ke(n),s=ke(i),c=r==null?void 0:ke(r);return{apply:g=>l.times(g,a(u)),invert:g=>l.div(g,a(u)),getFormula:g=>f.times(g,u),enabled:c,description:i==null?void 0:se(()=>y("div",{class:"modifier-container"},[a(s)!=null?y("span",{class:"modifier-description"},[je(a(s))]):null,y("span",{class:"modifier-amount",style:(o===!0?l.gt(a(u),1):l.lt(a(u),1))?"color: var(--danger)":""},[O("\xD7"),gt(a(u))])]))}})}function At(e){return Tt(()=>{const t=e();return{apply:n=>t.filter(i=>a(i.enabled)!==!1).reduce((i,r)=>r.apply(i),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(i=>a(i.enabled)!==!1).reduceRight((i,r)=>r.invert(i),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(i=>a(i.enabled)!==!1).reduce((i,r)=>r.getFormula(i),n):void 0,enabled:t.some(n=>n.enabled!=null)?M(()=>t.filter(n=>a(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?se(()=>y(le,null,[t.filter(n=>a(n.enabled)!==!1).map(n=>a(n.description)).filter(n=>n).map(je)])):void 0}})}const Su={key:0},Mu={key:0,class:"mark star"},Iu=["src"],$u=H({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(C(),$("div",Su,[e.mark===!0?(C(),$("div",Mu)):(C(),$("img",{key:1,class:"mark",src:e.mark},null,8,Iu))])):L("",!0)}});var vi=ae($u,[["__scopeId","data-v-2207999f"]]);const Eu=H({__name:"Node",props:{id:null},setup(e){const n=pe(e),i=Zt(pn,()=>{}),r=Zt(vn,()=>{}),o=Le(null),u=M(()=>o.value&&o.value.parentElement);return Oe([u,n.id],([s,c],[g,h])=>{g&&r(a(h)),s&&i(c,s)}),jn(()=>r(a(n.id))),(s,c)=>(C(),$("div",{class:"node",ref_key:"node",ref:o},null,512))}});var hi=ae(Eu,[["__scopeId","data-v-a48cb382"]]);H({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:hi,MarkNode:vi},setup(e){const{display:t,onClick:n,onHold:i}=pe(e),r=Le("");Ue(()=>{var h;const s=xe(t);if(s==null){r.value="";return}if(ft(s)){r.value=we(s);return}const c=we((h=s.title)!=null?h:"","h3"),g=we(s.description,"div");r.value=we(se(()=>y("span",null,[s.title!=null?y("div",null,[y(c,null,null)]):null,y(g,null,null)])))});const{start:o,stop:u}=ni(n,i);return{start:o,stop:u,comp:r,Visibility:We,isVisible:it,isHidden:tn,unref:a}}});const Tu=["x1","y1","x2","y2"],Fu=H({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=pe(e),i=M(()=>{const o=n.startNode.value.rect,u=n.boundingRect.value,s=u?{x:o.x+o.width/2-u.x,y:o.y+o.height/2-u.y}:{x:0,y:0};return n.link.value.offsetStart&&(s.x+=n.link.value.offsetStart.x,s.y+=n.link.value.offsetStart.y),s}),r=M(()=>{const o=n.endNode.value.rect,u=n.boundingRect.value,s=u?{x:o.x+o.width/2-u.x,y:o.y+o.height/2-u.y}:{x:0,y:0};return n.link.value.offsetEnd&&(s.x+=n.link.value.offsetEnd.x,s.y+=n.link.value.offsetEnd.y),s});return(o,u)=>(C(),$("line",Ge({"stroke-width":"15px",stroke:"white"},e.link,{x1:a(i).x,y1:a(i).y,x2:a(r).x,y2:a(r).y}),null,16,Tu))}});const Du=H({__name:"Links",props:{links:null},setup(e){var c;const n=nt(e,"links"),i=A(null),r=Zt(hn,A({})),o=Zt(bn,A(void 0)),u=A((c=i.value)==null?void 0:c.getBoundingClientRect());Oe(o,()=>{var g;return u.value=(g=i.value)==null?void 0:g.getBoundingClientRect()}),Qt(()=>{var g;return u.value=(g=i.value)==null?void 0:g.getBoundingClientRect()});const s=M(()=>{var h,p;const g=r.value;return(p=(h=n.value)==null?void 0:h.filter(w=>{var k,_;return((k=g[w.startNode.id])==null?void 0:k.rect)&&((_=g[w.startNode.id])==null?void 0:_.rect)}))!=null?p:[]});return(g,h)=>(C(),$(le,null,[a(s)?(C(),$("svg",Vi(Ge({key:0},g.$attrs)),[(C(!0),$(le,null,$t(a(s),(p,w)=>(C(),X(Fu,{key:w,link:p,boundingRect:u.value,startNode:a(r)[p.startNode.id],endNode:a(r)[p.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):L("",!0),v("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Pu=ae(Du,[["__scopeId","data-v-063f6d6b"]]);H({props:{nodes:{type:j(Array),required:!0},leftSideNodes:j(Array),rightSideNodes:j(Array),branches:j(Array)},components:{Links:Pu},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=pe(e),r=Le();Ue(()=>{const s=xe(t);r.value=we(se(()=>y(le,null,[s.map(c=>y("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(je)]))])))});const o=Le();Ue(()=>{const s=xe(n);o.value=s?we(se(()=>y("span",{class:"left-side-nodes small"},[s.map(je)]))):""});const u=Le();return Ue(()=>{const s=xe(i);u.value=s?we(se(()=>y("span",{class:"side-nodes small"},[s.map(je)]))):""}),{unref:a,nodesComp:r,leftNodesComp:o,rightNodesComp:u}}});H({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:vi,Node:hi},setup(e){const{onClick:t,onHold:n,display:i}=pe(e),r=Et(i),{start:o,stop:u}=ni(t,n);return{start:o,stop:u,comp:r,unref:a,Visibility:We,isCoercableComponent:ft,isVisible:it,isHidden:tn}}});function cn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(s=>ke(s.base)),n.baseText=t.map(s=>ke(s.baseText)),n.visible=t.map(s=>ke(s.visible)),n.title=t.map(s=>ke(s.title)),n.subtitle=t.map(s=>ke(s.subtitle)),i=!0),t}const o=vt({},!1);return[se(()=>{const s=r();let c=!0;const g=s.map((h,p)=>{var V,I,D;if(a(n.visible[p])===!1)return null;const w=y("h3",{onClick:()=>o.value[p]=!o.value[p],style:"cursor: pointer"},[y("span",{class:"modifier-toggle"+(a(o.value[p])?" collapsed":"")},[O("\u25BC")]),a(n.title[p]),a(n.subtitle[p])!=null?y("span",{class:"subtitle"},[O(" ("),a(n.subtitle[p]),O(")")]):null]),k=a(o.value[p])?null:y(le,null,[y("div",{class:"modifier-container"},[y("span",{class:"modifier-description"},[je((V=a(n.baseText[p]))!=null?V:"Base")]),y("span",{class:"modifier-amount"},[dt((I=a(n.base[p]))!=null?I:1),h.unit])]),h.modifier.description==null?null:je(a(h.modifier.description))]),_=!c;c=!1;const x=(D=a(n.base[p]))!=null?D:1,P=h.modifier.apply(x);return y(le,null,[_?y("br",null,null):null,y("div",{style:{"--unit":re.alignUnits&&h.unit!=null?"'"+h.unit+"'":""}},[w,y("br",null,null),k,y("hr",null,null),y("div",{class:"modifier-container"},[y("span",{class:"modifier-description"},[O("Total")]),y("span",{class:"modifier-amount",style:(h.smallerIsBetter===!0?l.gt(P,x!=null?x:1):l.lt(P,x!=null?x:1))?"color: var(--danger)":""},[gt(P),h.unit])])])])});return y(le,null,[g])}),o]}function Ln(e,t,n=1){const i=ke(t),r=ke(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return se(()=>{var o;if(a(i)){const u=gt(e.evaluate()),s=gt(e.evaluate(l.add(a((o=e.innermostVariable)!=null?o:0),a(r))));return y(le,null,[y("b",null,[y("i",null,[u,O(" \u2192 "),s])])])}return y(le,null,[gt(e.evaluate())])})}const Au=H({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,n=M(()=>Us(t.resource));return(i,r)=>(C(),$("h2",{style:Te({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},K(a(n)),5))}});const Ou={class:"main-display"},Vu={key:0},Lu={key:1},qu=H({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null},setup(e){const n=pe(e),i=A(null),r=Et(n.effectDisplay),o=M(()=>l.lt(n.resource.value,"1e1000"));return(u,s)=>(C(),X(Nn,null,{default:B(()=>{var c,g,h,p;return[v("div",{class:ue(["main-display-container",(c=e.classes)!=null?c:{}]),style:Te([{height:`${((h=(g=i.value)==null?void 0:g.$el.clientHeight)!=null?h:0)+50}px`},(p=e.style)!=null?p:{}])},[v("div",Ou,[a(o)?(C(),$("span",Vu,"You have ")):L("",!0),y(Au,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),O(" "+K(e.resource.displayName),1),a(r)?(C(),$("span",Lu,[O(", "),(C(),X(Me(a(r)),{ref_key:"effectRef",ref:i},null,512))])):L("",!0)])],6)]}),_:1}))}});function Bu(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 Ru={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"]},qn=[[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 Bn(e){const t=qn[Math.floor(e()*qn.length)];let n="";for(let i=0;in-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function bi(e,t,n){return yn(e,function(){const i=Bu(0,n>>0,n>>32,1);for(let c=0;c<12;c++)i();const r=Bn(i),o=Rn([.64,.75,.55],i),u=Rn([.18,.2,.25],i),s=fi(0,Bn(i));return{tier:vt(t),seed:vt(n),name:r,color:o,resource:s,background:u,style:{background:u,"--background":u},display:se(()=>y(le,null,[y("h1",null,[r]),y(qu,{resource:s,color:o},null)]))}})}const zn=Wn(),kt={dirt:120,sand:60,gravel:40,wood:30,stone:24,coal:20,copper:15,iron:12,silver:10,gold:8,emerald:6,platinum:5,diamond:4,berylium:3,unobtainium:2,ultimatum:1},Ct=Object.keys(kt),_e={dirt:{cost:1e3,name:"Pickaxe",type:"passive",state:"dirt"},sand:{cost:1e4,name:"Dowsing Rod",type:"dowsing",state:{resources:[],maxConnections:1,powered:!1}},gravel:{cost:1e5,name:"Ore Processor",type:"passive",state:"gravel"},wood:{cost:1e6,name:"Quarry",type:"quarry",state:{resources:[],maxConnections:1,powered:!1,progress:0}},stone:{cost:1e7,name:"Energizer",type:"passive",state:"stone"},coal:{cost:1e8,name:"Tool Empowerer",type:"empowerer",state:{tools:[],maxConnections:1,powered:!1}},copper:{cost:1e9,name:"Book",type:"passive",state:"copper"},iron:{cost:1e10,name:"Portal Generator",type:"portalGenerator",state:{tier:null,influences:[]}},silver:{cost:1e12,name:"Unknown Item",type:"unknownType"},gold:{cost:1e15,name:"Unknown Item",type:"unknownType"},emerald:{cost:1e19,name:"Unknown Item",type:"unknownType"},platinum:{cost:1e24,name:"Unknown Item",type:"unknownType"},diamond:{cost:1e30,name:"Unknown Item",type:"unknownType"},berylium:{cost:1e37,name:"Unknown Item",type:"unknownType"},unobtainium:{cost:1e45,name:"Unknown Item",type:"unknownType"},ultimatum:{cost:1e54,name:"Unknown Item",type:"unknownType"}},Un={dirt:{description:e=>e?"Quadruples mining speed":"Doubles mining speed"},gravel:{description:e=>e?"Quadruples material drops":"Doubles material 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"}},yi=yn("main",function(){const e=fi(0,"energy"),t=f.variable(0).add(1),n=M(()=>T.types.resource.nodes.value.reduce((N,d)=>(N[d.state.type]=d,N),{})),i=M(()=>({...T.types.passive.nodes.value.reduce((N,d)=>(N[d.state]=d,N),{}),sand:T.types.dowsing.nodes.value[0],wood:T.types.quarry.nodes.value[0],coal:T.types.empowerer.nodes.value[0],iron:T.types.portalGenerator.nodes.value[0]})),r=M(()=>Ct.reduce((N,d)=>{var oe,Ce,Ze;const S=(Ze=(Ce=(oe=n.value[d])==null?void 0:oe.state)==null?void 0:Ce.amount)!=null?Ze:0;let F=l.floor(t.invertIntegral(S)).sub(10).clampMin(0),R=un(t,F,!0,0);for(;;){const Nt=t.evaluate(F);if(l.add(R,Nt).lte(S))F=F.add(1),R=l.add(R,Nt);else break}return N[d]=F,N},{}));function o(N){var oe,Ce,Ze;const d=(Ze=(Ce=(oe=n.value[N])==null?void 0:oe.state)==null?void 0:Ce.amount)!=null?Ze:0,S=r.value[N],F=un(t,S,!0),R=un(t,l.add(S,1),!0);return l.sub(d,F).max(0).div(l.sub(R,F)).toNumber()}const u=pt({}),s=pt({});tt(()=>{Ct.forEach(N=>{Oe(()=>r.value[N],(d,S)=>{l.gt(d,S)&&re.active===G.id&&zn.info(y("div",null,[y("h3",null,[l.eq(d,1)?`${Je(N)} discovered`:`${Je(N)} is now Level ${Ve(d)}`,O("!")]),y("div",null,[O("Energy gain is now 1.01x higher.")])]))})})});const c=M(()=>[ie,Q,Ne,Z].filter(N=>{var d,S;return(S=(d=N.value)==null?void 0:d.state)==null?void 0:S.powered}).length),g=M(()=>l.eq(c.value,0)?10:l.add(c.value,1).pow_base(100).div(10).times(.99)),h=M(()=>Ne.value==null?0:Ne.value.state.resources.reduce((d,S)=>l.div(100,wt[S].computedModifier.value).add(d),l.dZero)),p={id:"deselect",icon:"close",tooltip:N=>({text:"resources"in N.state?"Disconnect resources":"Disconnect tools"}),onClick(N){"resources"in N.state?N.state={...N.state,resources:[]}:"tools"in N.state&&(N.state={...N.state,tools:[]}),T.selectedAction.value=null,T.selectedNode.value=null},visibility:N=>"resources"in N.state?N.state.resources.length>0:"tools"in N.state?N.state.tools.length>0:!0},w={id:"toggle",icon:"bolt",tooltip:N=>({text:N.state.powered?"Turn Off":`Turn On - Always runs for ${Ve(g.value)} energy/s`}),onClick(N){N.state={...N.state,powered:!N.state.powered},T.selectedAction.value=null},fillColor:N=>N.state.powered?"var(--accent1)":"var(--locked)"};function k(N,d=1/0){const S=N(f.variable(0));return{id:"moreConnections",icon:"hub",formula:S,tooltip(F){return{text:`Increase Connections - ${Ve(S.evaluate(F.state.maxConnections))} energy`}},confirmationLabel:F=>l.gte(e.value,S.evaluate(F.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(F){const R=S.evaluate(F.state.maxConnections);l.gte(e.value,R)&&(e.value=l.sub(e.value,R)),F.state={...F.state,maxConnections:F.state.maxConnections+1},T.selectedAction.value=null},visibility:F=>F.state.maxConnectionsR!==S)}:N.state={...N.state,resources:[...F,S]},T.selectedNode.value=N}function I(N,d){if(d.type!=="passive")return!1;const S=d.state,{maxConnections:F,tools:R}=N.state;return R.includes(S)?!0:R.length!==F}function D(N,d){if(d.type!=="passive")return;const S=d.state,F=N.state.tools;F.includes(S)?N.state={...N.state,tools:F.filter(R=>R!==S)}:N.state={...N.state,tools:[...F,S]},T.selectedNode.value=N}const T=zs(N=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:{mine:{shape:$e.Diamond,size:50,title:"\u{1FAA8}",label:d=>d===N.selectedNode.value?{text:"Mining"}:Object.keys(n.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[w],progress:d=>U(d)?new l(d.state.progress).toNumber():0,progressDisplay:ct.Outline,progressColor:"var(--accent2)",classes:d=>({running:U(d)}),draggable:!0},brokenFactory:{shape:$e.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:d=>d===N.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(d){l.gte(e.value,100)&&(d.type="factory",e.value=l.sub(e.value,100))},confirmationLabel:()=>l.gte(e.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},factory:{shape:$e.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:d=>{var S,F;if(d===N.selectedNode.value)return{text:d.state==null?"Forge - Drag a resource to me!":`Forging ${_e[d.state].name}`};if(((S=N.draggingNode.value)==null?void 0:S.type)==="resource"){const R=((F=N.draggingNode.value)==null?void 0:F.state).type,oe=d.state===R?"Disconnect":_e[R].name,Ce=d.state===R||l.gte(e.value,_e[R].cost)&&i.value[R]==null?"var(--accent2)":"var(--danger)";return{text:oe,color:Ce}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(d){d.state=void 0,N.selectedAction.value=null,N.selectedNode.value=null},visibility:d=>d.state!=null},{id:"craft",icon:"done",tooltip:d=>({text:`Forge ${_e[d.state].name} - ${Ve(_e[d.state].cost)} energy`}),onClick(d){const S=_e[d.state];if(l.gte(e.value,S.cost)&&i.value[d.state]==null){e.value=l.sub(e.value,S.cost);const F={id:ln(N),position:{...d.position},type:S.type,state:S.state};N.placeInAvailableSpace(F),N.nodes.value.push(F),N.selectedAction.value=null,N.selectedNode.value=null,d.state=void 0}},fillColor:d=>l.gte(e.value,_e[d.state].cost)&&i.value[d.state]==null?"var(--accent2)":"var(--danger)",visibility:d=>d.state!=null,confirmationLabel:d=>l.gte(e.value,_e[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:l.div(e.value,_e[d.state].cost).clampMax(1).toNumber(),progressDisplay:ct.Fill,progressColor:d=>d.state!=null&&l.gte(e.value,_e[d.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(d,S){return S.type==="resource"},onDrop(d,S){const F=S.state.type;d.state===F?d.state=void 0:d.state=F,N.selectedNode.value=d},draggable:!0},resource:{shape:$e.Circle,size:50,title:d=>Je(d.state.type),subtitle:d=>Ve(d.state.amount),progress:d=>o(d.state.type),onClick(){},progressDisplay:ct.Outline,progressColor:"var(--accent3)",classes:d=>({"affected-node":Q.value!=null&&U(Q.value)&&Q.value.state.resources.includes(d.state.type)}),draggable:!0},passive:{shape:$e.Circle,size:50,title:d=>_e[d.state].name,label:d=>d===N.selectedNode.value?{text:Un[d.state].description(Z.value!=null&&U(Z.value)&&Z.value.state.tools.includes(d.state))}:null,outlineColor:"var(--bought)",classes:d=>({"affected-node":Z.value!=null&&U(Z.value)&&Z.value.state.tools.includes(d.state)}),draggable:!0},dowsing:{shape:$e.Diamond,size:50,title:"\u{1F962}",label:d=>d===N.selectedNode.value?{text:d.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${d.state.resources.length}/${d.state.maxConnections})`}:_(d,S=>`Double ${S} odds`),actionDistance:Math.PI/4,actions:[p,k(d=>d.add(2).pow_base(100),16),w],classes:d=>({running:U(d)}),canAccept:P,onDrop:V,draggable:!0},quarry:{shape:$e.Diamond,size:50,title:"\u26CF\uFE0F",label:d=>d===N.selectedNode.value?{text:d.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${d.state.resources.length}/${d.state.maxConnections})`}:_(d,S=>`Gather ${dt(l.div(wt[S].computedModifier.value,100))} ${S}/s`),actionDistance:Math.PI/4,actions:[p,k(d=>d.add(2).pow_base(1e4),16),w],progress:d=>U(d)?l.eq(h.value,0)?0:new l(d.state.progress).div(h.value).toNumber():0,progressDisplay:ct.Outline,progressColor:"var(--accent2)",canAccept:P,onDrop:V,classes:d=>({running:U(d)}),draggable:!0},empowerer:{shape:$e.Diamond,size:50,title:"\u{1F50C}",label:d=>d===N.selectedNode.value?{text:d.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${d.state.tools.length}/${d.state.maxConnections})`}:x(d,S=>`Double ${_e[S].name}'s effect`),actionDistance:Math.PI/4,actions:[p,k(d=>d.add(3).pow_base(1e3),16),w],canAccept:I,onDrop:D,classes:d=>({running:U(d)}),draggable:!0},portalGenerator:{shape:$e.Diamond,size:50,title:"\u26E9\uFE0F",label:d=>{var S,F;if(d===N.selectedNode.value)return{text:d.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${d.state.tier}-tier portal`};if(((S=N.draggingNode.value)==null?void 0:S.type)==="resource"){const R=((F=N.draggingNode.value)==null?void 0:F.state).type;return{text:d.state.tier===R?"Disconnect":`${Je(R)}-tier Portal`,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:[]},N.selectedAction.value=null,N.selectedNode.value=null},visibility:d=>{const{tier:S,influences:F}=d.state;return S!=null||F.length>0}},{id:"makePortal",icon:"done",tooltip:d=>({text:`Spawn ${d.state.tier}-tier portal`}),onClick(d){let S=0;for(;`portal-${S}`in ye;)S++;_n(bi(`portal-${S}`,d.state.tier,Math.floor(Math.random()*4294967296)),G);const F={id:ln(N),position:{...d.position},type:"portal",state:{id:`portal-${S}`,powered:!1}};N.placeInAvailableSpace(F),N.nodes.value.push(F),N.selectedAction.value=null,N.selectedNode.value=null,d.state={tier:void 0,influences:[]}},visibility:d=>d.state.tier!=null}],canAccept(d,S){return S.type==="resource"||S.type==="influence"},onDrop(d,S){if(S.type==="resource"){const F=S.state.type,R=d.state.tier;d.state={...d.state,tier:F===R?void 0:F}}else if(S.type==="influence"){const F=S.state,R=d.state.influences;R.includes(F)?d.state={...d.state,influences:R.filter(oe=>oe!==F)}:d.state={...d.state,influences:[...R,F]}}N.selectedNode.value=d},draggable:!0},portal:{shape:$e.Diamond,size:50,title:"\u{1F300}",label:d=>d===N.selectedNode.value?{text:`Portal to ${ye[d.state.id].name}`,color:ye[d.state.id].color}:null,actionDistance:Math.PI/4,actions:[w],classes:d=>({running:U(d)}),outlineColor:d=>ye[d.state.id].background,draggable:!0}},style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const d=[];return d.push(...Object.keys(u).map(S=>({startNode:ie.value,endNode:n.value[S],stroke:"var(--accent3)",strokeWidth:5}))),ee.value!=null&&ee.value.state!=null&&d.push({startNode:ee.value,endNode:n.value[ee.value.state],stroke:"var(--foreground)",strokeWidth:4}),Q.value!=null&&Q.value.state.resources.forEach(S=>{d.push({startNode:Q.value,endNode:n.value[S],stroke:U(Q.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),Ne.value!=null&&Ne.value.state.resources.forEach(S=>{d.push({startNode:Ne.value,endNode:n.value[S],stroke:"var(--foreground)",strokeWidth:4})}),d.push(...Object.keys(s).map(S=>({startNode:Ne.value,endNode:n.value[S],stroke:"var(--accent3)",strokeWidth:5}))),Z.value!=null&&Z.value.state.tools.forEach(S=>{d.push({startNode:Z.value,endNode:i.value[S],stroke:U(Z.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),Y.value!=null&&Y.value.state.tier!=null&&d.push({startNode:Y.value,endNode:n.value[Y.value.state.tier],stroke:"var(--foreground)",strokeWidth:4}),d}}));function U(N){return N===T.selectedNode.value||N.state.powered}const ie=M(()=>T.types.mine.nodes.value[0]),ee=M(()=>T.types.factory.nodes.value[0]),Q=M(()=>i.value.sand),Ne=M(()=>i.value.wood),Z=M(()=>i.value.coal),Y=M(()=>i.value.iron);function ge(N,d){let S=n.value[N];if(S==null)S={id:ln(T),position:{...ie.value.position},type:"resource",state:{type:N,amount:d}},T.placeInAvailableSpace(S),T.nodes.value.push(S);else{const F=S.state;S.state={...F,amount:l.add(F.amount,d)}}}const De=M(()=>Object.keys(kt).reduce((N,d)=>N+new l(wt[d].computedModifier.value).toNumber(),0)),qe=At(()=>[...Ct.map(N=>Pt(()=>({description:()=>`${Je(N)} (Lv. ${Ve(r.value[N])}) (${dt(Sn.value)}x per level)`,multiplier:()=>l.pow(Sn.value,r.value[N]),enabled:()=>{var d,S;return N in n.value&&l.gt((S=(d=n.value[N].state)==null?void 0:d.amount)!=null?S:0,0)}}))),Pt(()=>({multiplier:()=>Z.value!=null&&U(Z.value)&&Z.value.state.tools.includes("stone")?4:2,description:()=>(Z.value!=null&&U(Z.value)&&Z.value.state.tools.includes("stone")?"Empowered ":"")+_e.stone.name,enabled:()=>i.value.stone!=null})),Vn(()=>({addend:()=>l.pow(100,c.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>l.gt(c.value,0)}))]),_t=M(()=>qe.apply(1)),Be=At(()=>[Pt(()=>({multiplier:()=>Z.value!=null&&U(Z.value)&&Z.value.state.tools.includes("dirt")?4:2,description:()=>(Z.value!=null&&U(Z.value)&&Z.value.state.tools.includes("dirt")?"Empowered ":"")+_e.dirt.name,enabled:()=>i.value.dirt!=null}))]),wi=M(()=>Be.apply(1)),Cn=At(()=>[Pt(()=>({multiplier:()=>Z.value!=null&&U(Z.value)&&Z.value.state.tools.includes("gravel")?4:2,description:()=>(Z.value!=null&&U(Z.value)&&Z.value.state.tools.includes("gravel")?"Empowered ":"")+_e.gravel.name,enabled:()=>i.value.gravel!=null}))]),kn=M(()=>Cn.apply(1)),xn=At(()=>[Vn(()=>({addend:()=>Z.value!=null&&U(Z.value)&&Z.value.state.tools.includes("copper")?.002:.001,description:()=>(Z.value!=null&&U(Z.value)&&Z.value.state.tools.includes("copper")?"Empowered ":"")+_e.copper.name,enabled:()=>i.value.copper!=null}))]),Sn=M(()=>xn.apply(1.01)),wt=Object.keys(kt).reduce((N,d)=>{const S=At(()=>[Pt(()=>({multiplier:2,description:"Dowsing",enabled:()=>Q.value!=null&&U(Q.value)&&Q.value.state.resources.includes(d)}))]),F=M(()=>S.apply(kt[d])),R={title:`${Je(d)} Drop Rate`,modifier:S,base:kt[d]};return N[d]={modifier:S,computedModifier:F,section:R},N},{}),[Ni,Ci]=cn(()=>[{title:"Energy Gain",modifier:qe,base:1,unit:"/s"}]),[ki,xi]=cn(()=>[{title:"Mining Speed",modifier:Be,base:1,unit:"/s",visible:()=>i.value.dirt!=null},{title:"Ore Dropped",modifier:Cn,base:1,visible:()=>i.value.gravel!=null},{title:"Material Level Effect",modifier:xn,base:1.01,visible:()=>i.value.copper!=null}]),[Si,Mi]=cn(()=>Object.values(wt).map(N=>N.section)),Dt=Xs({general:()=>({display:"Energy",glowColor(){return Dt.activeTab.value===this.tab?"white":""},tab:Ni,energyTabCollapsed:Ci}),mining:()=>({display:"Mining",glowColor(){return Dt.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(i.value).length>0,tab:ki,miningTabCollapsed:xi}),resources:()=>({display:"Resources",glowColor(){return Dt.activeTab.value===this.tab?"white":""},visibility:()=>Q.value!=null,tab:Si,resourcesCollapsed:Mi})}),rn=A(!1),Ii=se(()=>y(rt,{modelValue:rn.value,"onUpdate:modelValue":N=>rn.value=N},{header:()=>y("h2",null,[O("Modifiers")]),body:()=>Ke(Dt)}));this.on("preUpdate",N=>{if(Object.keys(u).forEach(d=>{u[d]-=N,u[d]<=0&&delete u[d]}),Object.keys(s).forEach(d=>{s[d]-=N,s[d]<=0&&delete s[d]}),U(ie.value)){const d=l.add(ie.value.state.progress,l.times(wi.value,N)),S=d.floor();ie.value.state={...ie.value.state,progress:l.sub(d,S)};const F=S.div(De.value).floor();F.gt(0)&&Ct.forEach(oe=>{ge(oe,l.times(new l(wt[oe].computedModifier.value).toNumber(),F).times(kn.value)),u[oe]=.3});const R=l.sub(S,F).toNumber();for(let oe=0;oe0){let F=l.add(d,N);const R=l.div(d,h.value).floor();F=l.sub(F,l.times(R,h.value)),Ne.value.state={...Ne.value.state,progress:F},l.gt(R,0)&&S.forEach(oe=>{ge(oe,R),s[oe]=.3})}}e.value=l.add(e.value,l.times(_t.value,N)),l.lt(e.value,0)&&(e.value=0,ie.value.state={...ie.value.state,powered:!1},zn.warning(y("div",null,[y("h3",null,[O("Ran out of energy!")]),y("div",null,[O("All machines have been turned off.")])])))});const Mn=M(()=>{var N,d;return T.selectedAction.value===T.types.brokenFactory.actions[0]?-100:T.selectedAction.value===T.types.factory.actions[1]?l.neg(_e[T.selectedNode.value.state].cost):((N=T.selectedAction.value)==null?void 0:N.id)==="moreConnections"?l.neg(T.selectedAction.value.formula.evaluate(((d=T.selectedNode.value)==null?void 0:d.state).maxConnections)):0}),$i=Ln(f.variable(0).add(e),()=>l.neq(Mn.value,0),Mn),In=M(()=>{var N;return T.selectedAction.value===w?((N=T.selectedNode.value)==null?void 0:N.state).powered?l.eq(c.value,1)?10:l.pow(100,c.value).div(10).times(.99):l.neg(g.value):0}),Ei=Ln(f.variable(0).add(_t),()=>l.neq(In.value,0),In),Ti=M(()=>T.types.portal.nodes.value.filter(N=>U(N)));return Oe(Ti,N=>{tt(()=>{G.tabs=["main",...N.map(d=>d.state.id)]})}),{name:"World",board:T,energy:e,modifierTabs:Dt,mineLootTable:kt,tools:_e,passives:Un,resourceNodes:n,toolNodes:i,display:se(()=>y(le,null,[y(Nn,{class:"nav-container"},{default:()=>[y("span",{class:"nav-segment"},[y("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[Ke($i)])," ",O("energy")]),y("span",{class:"nav-segment"},[O("("),y("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[l.gt(_t.value,0)?"+":"",Ke(Ei)]),O("/s)")]),l.gt(c.value,0)?y("span",{class:"nav-segment"},[y("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[Ve(c.value)])," ",O("machines powered")]):null,y("span",{class:"nav-segment"},[y("button",{class:"button",style:"display: inline",onClick:()=>rn.value=!0},[O("open modifiers")])]),G.devSpeed===0?y("span",{class:"nav-segment"},[O("Game Paused")]):G.devSpeed!=null&&G.devSpeed!==1?y("span",{class:"nav-segment"},[O("Dev Speed: "),dt(G.devSpeed),O("x")]):null]}),Ke(T),Ke(Ii)]))}}),ju=e=>{var i,r,o,u;const t=[yi];let n=0;for(;`portal-${n}`in((i=e.layers)!=null?i:{});){const s=(r=e.layers)==null?void 0:r[`portal-${n}`];t.push(bi(`portal-${n}`,(o=s.tier)!=null?o:"dirt",(u=s.seed)!=null?u:Math.floor(Math.random()*4294967296))),n++}return t},_i=M(()=>!1);function Gu(e,t){}var Wu=Object.freeze(Object.defineProperty({__proto__:null,main:yi,getInitialLayers:ju,hasWon:_i,fixOldSave:Gu},Symbol.toStringTag,{value:"Module"}));const jt=e=>(ht("data-v-4a50ce42"),e=e(),bt(),e),Hu={class:"game-over-modal-header"},Zu=["src","alt"],Yu={class:"game-over-modal-title"},Ju=jt(()=>v("h2",null,"Congratulations!",-1)),Ku={key:0},Xu=jt(()=>v("br",null,null,-1)),Qu=jt(()=>v("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),ec=jt(()=>v("br",null,null,-1)),tc=["href"],nc=jt(()=>v("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),ic=H({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:o,versionTitle:u}=ne,s=M(()=>fn(G.timePlayed)),c=M(()=>_i.value&&!G.keepGoing),g=nt(G,"autosave");function h(){G.keepGoing=!0}function p(){lt(xt())}return(w,k)=>(C(),X(rt,{"model-value":a(c)},{header:B(()=>[v("div",Hu,[a(n)?(C(),$("img",{key:0,class:"game-over-modal-logo",src:a(n),alt:a(t)},null,8,Zu)):L("",!0),v("div",Yu,[Ju,v("h4",null,"You've beaten "+K(a(t))+" v"+K(a(o))+": "+K(a(u)),1)])])]),body:B(({shown:_})=>[_?(C(),$("div",Ku,[v("div",null,"It took you "+K(a(s))+" to beat the game.",1),Xu,Qu,ec,v("div",null,[v("a",{href:a(r),class:"game-over-modal-discord-link"},[nc,O(" "+K(a(i)),1)],8,tc)]),y(ze,{title:"Autosave",modelValue:a(g),"onUpdate:modelValue":k[0]||(k[0]=x=>me(g)?g.value=x:null)},null,8,["modelValue"])])):L("",!0)]),footer:B(()=>[v("div",{class:"game-over-footer"},[v("button",{onClick:h,class:"button"},"Keep Going"),v("button",{onClick:p,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var rc=ae(ic,[["__scopeId","data-v-4a50ce42"]]);const nn=e=>(ht("data-v-2776d67d"),e=e(),bt(),e),ac=nn(()=>v("div",{class:"nan-modal-header"},[v("h2",null,"NaN value detected!")],-1)),oc={key:0},sc=nn(()=>v("br",null,null,-1)),lc=["href"],uc=nn(()=>v("span",{class:"material-icons nan-modal-discord"},"discord",-1)),cc=nn(()=>v("br",null,null,-1)),dc={class:"nan-footer"},gc=H({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=ne,i=A(!0),r=A(!0),o=nt(he,"hasNaN"),u=A(null);Oe(o,w=>{w?(i.value=G.autosave,r.value=G.devSpeed===0):(G.autosave=i.value,G.devSpeed=r.value?0:null)});const s=M(()=>{var w;return(w=he.NaNPath)==null?void 0:w.join(".")}),c=M(()=>he.NaNPersistent!=null?he.NaNPersistent.value:null);function g(){he.NaNPersistent!=null&&(he.NaNPersistent.value=new l(0),he.hasNaN=!1)}function h(){he.NaNPersistent&&(he.NaNPersistent.value=new l(1),he.hasNaN=!1)}function p(){he.NaNPersistent&&(he.NaNPersistent.value=new l(NaN),he.hasNaN=!1)}return(w,k)=>(C(),$(le,null,[y(rt,Ge({modelValue:a(o),"onUpdate:modelValue":k[4]||(k[4]=_=>me(o)?o.value=_:null)},w.$attrs),{header:B(()=>[ac]),body:B(()=>[v("div",null,[O(' Attempted to assign "'+K(a(s))+'" to NaN',1),a(c)?(C(),$("span",oc,K(" ")+"(previously "+K(a(dt)(a(c)))+")",1)):L("",!0),O(". Auto-saving has been "+K(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),sc,v("div",null,[v("a",{href:a(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[uc,O(" "+K(a(t)||"The Paper Pilot Community"),1)],8,lc)]),cc,y(ze,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":k[0]||(k[0]=_=>i.value=_)},null,8,["modelValue"]),a(ne).enablePausing?(C(),X(ze,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":k[1]||(k[1]=_=>r.value=_)},null,8,["modelValue"])):L("",!0)]),footer:B(()=>[v("div",dc,[v("button",{onClick:k[2]||(k[2]=_=>{var x;return(x=u.value)==null?void 0:x.open()}),class:"button"},"Open Saves Manager"),v("button",{onClick:g,class:"button"},"Set to 0"),v("button",{onClick:h,class:"button"},"Set to 1"),a(c)&&a(l).neq(a(c),0)&&a(l).neq(a(c),1)?(C(),$("button",{key:0,onClick:k[3]||(k[3]=_=>o.value=!1),class:"button"}," Set to previous ")):L("",!0),v("button",{onClick:p,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),y(ci,{ref_key:"savesManager",ref:u},null,512)],64))}});var fc=ae(gc,[["__scopeId","data-v-2776d67d"]]);const mc={key:0,class:"tpsDisplay"},pc={key:0,class:"low"},vc=H({__name:"TPS",setup(e){const t=M(()=>l.div(he.lastTenTicks.length,he.lastTenTicks.reduce((o,u)=>o+u,0))),n=A([]);Ue(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=M(()=>n.value.reduce((o,u)=>l.max(o,u),0)),r=M(()=>l.sub(t.value,i.value).gt(1));return(o,u)=>a(t).isNan()?L("",!0):(C(),$("div",mc,[O(" TPS: "+K(a(Ve)(a(t)))+" ",1),y(It,{name:"fade"},{default:B(()=>[a(r)?(C(),$("span",pc,K(a(Ve)(a(i))),1)):L("",!0)]),_:1})]))}});var hc=ae(vc,[["__scopeId","data-v-46a3ed5b"]]);var bc=H({__name:"App",setup(e){const t=ne.useHeader,n=M(()=>Re[re.theme].variables),i=nt(re,"showTPS"),r=M(()=>we(se(()=>y(le,null,[Jr.map(Ke)]))));return(o,u)=>(C(),$(le,null,[v("div",{id:"modal-root",style:Te(a(n))},null,4),v("div",{class:ue(["app",{useHeader:a(t)}]),style:Te(a(n))},[a(t)?(C(),X(di,{key:0})):L("",!0),y(cs),a(a(i))?(C(),X(hc,{key:1})):L("",!0),y(rc),y(fc),(C(),X(Me(a(r))))],6)],64))}});var yc=ae(bc,[["__scopeId","data-v-41d15e5e"]]);function _c(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:o,onRegisterError:u}=e;let s,c,g,h;const p=async(k=!0)=>{await g,k&&(s==null||s.addEventListener("controlling",_=>{_.isUpdate&&window.location.reload()})),await(h==null?void 0:h())};async function w(){if("serviceWorker"in navigator){const{Workbox:k,messageSW:_}=await qt(()=>import("./workbox-window.4a8794bb.js"),[]);h=async()=>{c&&c.waiting&&await _(c.waiting,{type:"SKIP_WAITING"})},s=new k("./sw.js",{scope:"./",type:"classic"}),s.addEventListener("activated",x=>{x.isUpdate||i==null||i()});{const x=()=>{n==null||n()};s.addEventListener("waiting",x),s.addEventListener("externalwaiting",x)}s.register({immediate:t}).then(x=>{c=x,o?o("./sw.js",x):r==null||r(x)}).catch(x=>{u==null||u(x)})}}return g=w(),p}function wc(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:o,onRegisterError:u}=e,s=A(!1),c=A(!1);return{updateServiceWorker:_c({immediate:t,onNeedRefresh(){s.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:r,onRegisteredSW:o,onRegisterError:u}),offlineReady:c,needRefresh:s}}document.title=ne.title;window.projInfo=ne;if(ne.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 jr();const{globalBus:e}=await qt(()=>Promise.resolve().then(function(){return zr}),void 0),{startGameLoop:t}=await qt(()=>import("./gameLoop.7364e043.js"),["assets/gameLoop.7364e043.js","assets/@fontsource.f66d05e7.css","assets/vue.804e2479.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6f8187b0.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.f5f69b1a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.ce650350.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.89be130f.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.5231d1bd.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=Li(yc);e.emit("setupVue",n),n.mount("#app"),tt(()=>{const i=Wn(),{updateServiceWorker:r}=wc({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(o){o&&setInterval(()=>o.update(),60*60*1e3)}})}),t()});export{l as D,qt as _,he as a,ne as b,Wu as c,Ie as g,Gr as l,G as p,re as s}; diff --git a/assets/index.e5429d96.css b/assets/index.53b6dde5.css similarity index 92% rename from assets/index.e5429d96.css rename to assets/index.53b6dde5.css index a460a76..052723f 100644 --- a/assets/index.e5429d96.css +++ b/assets/index.53b6dde5.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))}.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{border-right:solid 1px var(--outline);padding-right:10px;margin-right:10px}.affected-node{filter:drop-shadow(0px 0px 20px var(--accent1))}.main-display-container{vertical-align:middle;margin-bottom:20px;display:flex;transition-duration:0s}.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/assets/index.6f5e52cd.js b/assets/index.6f5e52cd.js deleted file mode 100644 index 1e08015..0000000 --- a/assets/index.6f5e52cd.js +++ /dev/null @@ -1,18 +0,0 @@ -/* empty css */import"./vue.804e2479.js";import{_ as I,C as a,l as me,q as gt,t as A,b2 as Ve,ab as J,aD as Ln,w as Oe,b3 as ze,a9 as _,O as se,az as Qt,as as ft,aF as C,a1 as M,aL as Qe,a2 as p,aH as Wt,A as be,$ as X,b7 as B,b9 as cn,ar as We,bv as St,a8 as O,bt as Si,bc as xt,T as xi,u as dn,j as Ii,bw as Sn,aM as Ht,a0 as V,aO as Ee,J as K,G as ue,I as Le,aI as mt,aG as vt,z as et,bo as Mi,bs as Ei,aK as It,bd as xn,am as Zt,H as $i,bf as Ti}from"./@vue.6f8187b0.js";import{c as qn}from"./nanoevents.1080beb7.js";import{L as Ke}from"./lz-string.dccec454.js";import{Y as Fi}from"./vue-next-select.f5f69b1a.js";import{D as Pi}from"./vuedraggable.ce650350.js";import{p as Di}from"./vue-textarea-autosize.35804eaf.js";import{P as Ai}from"./vue-panzoom.89be130f.js";import{s as Oi,u as Bn}from"./vue-toastification.5231d1bd.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 Vi=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 s of r)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerpolicy&&(s.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?s.credentials="include":r.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}};Vi();const Li="modulepreload",In={},qi="./",Vt=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${qi}${i}`,i in In)return;In[i]=!0;const r=i.endsWith(".css"),s=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${s}`))return;const u=document.createElement("link");if(u.rel=r?"stylesheet":Li,r||(u.as="script",u.crossOrigin=""),u.href=i,document.head.appendChild(u),r)return new Promise((o,c)=>{u.addEventListener("load",o),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},Bi="./projInfo-schema.json",Ri="Planar Pioneers",Ui="A game about controlling and exploiting planes!",zi="planar-pioneers",ji="thepaperpilot",Wi="",Gi="",Hi="0.0",Zi="Initial Commit",Yi=!0,Ji=!1,Ki=2,Xi=!0,Qi=null,er="",tr=["main"],nr=3600,ir=0,rr=!0,ar="base64";var ne={$schema:Bi,title:Ri,description:Ui,id:zi,author:ji,discordName:Wi,discordLink:Gi,versionNumber:Hi,versionTitle:Zi,allowGoBack:Yi,defaultShowSmall:Ji,defaultDecimalsShown:Ki,useHeader:Xi,banner:Qi,logo:er,initialTabs:tr,maxTickLength:nr,offlineLimit:ir,enablePausing:rr,exportEncoding:ar};class or{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 sr(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 sr{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const on=17,lr=9e15,ur=Math.log10(9e15),cr=1/9e15,dr=308,gr=-324,Mn=5,fr=(1<<10)-1,mr=function(){const e=[];for(let n=gr+1;n<=dr;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),it=[2,Math.E,3,4,5,6,7,8,9,10],vr=[[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]],pr=[[-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 h=function(t){return l.fromValue_noAlloc(t)},R=function(e,t,n){return l.fromComponents(e,t,n)},Y=function(t,n,i){return l.fromComponents_noNormalize(t,n,i)};const Ye=function(t,n){const i=n+1,r=Math.ceil(Math.log10(Math.abs(t))),s=Math.round(t*Math.pow(10,i-r))*Math.pow(10,r-i);return parseFloat(s.toFixed(Math.max(i-r,0)))},sn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},hr=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},Rn=.5671432904097838,En=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return Rn;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 Y(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)),R(t,n,r)}static affordGeometricSeries_core(e,t,n,i){const r=t.mul(n.pow(i));return m.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(m.sub(1,n.pow(e))).div(m.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const s=t.add(i.mul(n)).sub(n.div(2)),u=s.pow(2);return s.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=lr)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=m.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const y=parseFloat(i[0]),S=parseFloat(i[1]),T=i[1].split(";");let L=1;if(T.length===2&&(L=parseFloat(T[1]),isFinite(L)||(L=1)),isFinite(y)&&isFinite(S)){const x=m.pentate(y,S,L);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const y=parseFloat(r[0]),S=parseFloat(r[1]),T=r[1].split(";");let L=1;if(T.length===2&&(L=parseFloat(T[1]),isFinite(L)||(L=1)),isFinite(y)&&isFinite(S)){const x=m.tetrate(y,S,L);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}const s=e.split("^");if(s.length===2){const y=parseFloat(s[0]),S=parseFloat(s[1]);if(isFinite(y)&&isFinite(S)){const T=m.pow(y,S);return this.sign=T.sign,this.layer=T.layer,this.mag=T.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}e=e.trim().toLowerCase();let u,o,c=e.split("pt");if(c.length===2){u=10,o=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let y=parseFloat(c[1]);if(isFinite(y)||(y=1),isFinite(u)&&isFinite(o)){const S=m.tetrate(u,o,y);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){u=10,o=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let y=parseFloat(c[1]);if(isFinite(y)||(y=1),isFinite(u)&&isFinite(o)){const S=m.tetrate(u,o,y);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}const d=e.split("e"),b=d.length-1;if(b===0){const y=parseFloat(e);if(isFinite(y))return this.fromNumber(y),m.fromStringCache.size>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}else if(b===1){const y=parseFloat(e);if(isFinite(y)&&y!==0)return this.fromNumber(y),m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}const v=e.split("e^");if(v.length===2){this.sign=1,v[0].charAt(0)=="-"&&(this.sign=-1);let y="";for(let S=0;S=43&&T<=57||T===101)y+=v[1].charAt(S);else return this.layer=parseFloat(y),this.mag=parseFloat(v[1].substr(S+1)),this.normalize(),m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}}if(b<1)return this.sign=0,this.layer=0,this.mag=0,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this;const w=parseFloat(d[0]);if(w===0)return this.sign=0,this.layer=0,this.mag=0,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this;let N=parseFloat(d[d.length-1]);if(b>=2){const y=parseFloat(d[d.length-2]);isFinite(y)&&(N*=Math.sign(y),N+=sn(y))}if(!isFinite(w))this.sign=d[0]==="-"?-1:1,this.layer=b,this.mag=N;else if(b===1)this.sign=Math.sign(w),this.layer=1,this.mag=N+Math.log10(Math.abs(w));else if(this.sign=Math.sign(w),this.layer=b,b===2){const y=m.mul(R(1,2,N),h(w));return this.sign=y.sign,this.layer=y.layer,this.mag=y.mag,m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}else this.mag=N;return this.normalize(),m.fromStringCache.maxSize>=1&&m.fromStringCache.set(t,m.fromDecimal(this)),this}fromValue(e){return e instanceof m?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:Ye(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Ye(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<=Mn?(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):Ye(this.m,e)+"e"+Ye(this.e,e):this.layer===1?Ye(this.m,e)+"e"+Ye(this.e,e):this.layer<=Mn?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Ye(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Ye(this.mag,e)}abs(){return Y(this.sign===0?0:1,this.layer,this.mag)}neg(){return Y(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?m.dZero:this.layer===0?R(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?m.dZero:this.layer===0?R(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?m.dZero:this.layer===0?R(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?m.dZero:this.layer===0?R(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=h(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 Y(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(m.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return m.fromNumber(n.sign*n.mag+i.sign*i.mag);const r=n.layer*Math.sign(n.mag),s=i.layer*Math.sign(i.mag);if(r-s>=2)return n;if(r===0&&s===-1){if(Math.abs(i.mag-Math.log10(n.mag))>on)return n;{const u=Math.pow(10,Math.log10(n.mag)-i.mag),o=i.sign+n.sign*u;return R(Math.sign(o),1,i.mag+Math.log10(Math.abs(o)))}}if(r===1&&s===0){if(Math.abs(n.mag-Math.log10(i.mag))>on)return n;{const u=Math.pow(10,n.mag-Math.log10(i.mag)),o=i.sign+n.sign*u;return R(Math.sign(o),1,Math.log10(i.mag)+Math.log10(Math.abs(o)))}}if(Math.abs(n.mag-i.mag)>on)return n;{const u=Math.pow(10,n.mag-i.mag),o=i.sign+n.sign*u;return R(Math.sign(o),1,i.mag+Math.log10(Math.abs(o)))}}plus(e){return this.add(e)}sub(e){return this.add(h(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=h(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return Y(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return Y(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 m.fromNumber(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return R(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return R(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return R(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const r=R(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(R(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return R(n.sign*i.sign,r.layer+1,r.sign*r.mag)}if(n.layer===2&&i.layer===2){const r=R(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(R(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return R(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=h(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?m.dNaN:this.layer===0?R(this.sign,0,1/this.mag):R(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=h(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=h(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=h(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=sn(r)),this.layer0?R(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):R(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?m.dNaN:this.layer>0?R(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):R(this.sign,0,Math.log10(this.mag))}log(e){return e=h(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?m.dNaN:this.layer===0&&e.layer===0?R(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):m.div(this.log10(),e.log10())}log2(){return this.sign<=0?m.dNaN:this.layer===0?R(this.sign,0,Math.log2(this.mag)):this.layer===1?R(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?R(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):R(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?m.dNaN:this.layer===0?R(this.sign,0,Math.log(this.mag)):this.layer===1?R(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?R(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):R(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=h(e),n=this,i=t;if(n.sign===0)return i.eq(0)?Y(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return Y(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:m.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return m.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 R(1,0,t);if(e.sign===0)return m.dOne;e=Y(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?R(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?R(-e.sign,e.layer+1,-e.mag):m.dOne}pow_base(e){return h(e).pow(this)}root(e){const t=h(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?m.exp(m.mul(this,m.ln(this).sub(1))):m.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(Y(1,0,24)))return m.fromNumber(hr(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,s=1/r,u=t+s;if(u===t||(t=u,i=i*n,r=360*i,s=1/r,u=t-s,u===t))return m.exp(t);t=u,i=i*n,r=1260*i;let o=1/r;return t=t+o,i=i*n,r=1680*i,o=1/r,t=t-o,m.exp(t)}else return this.layer===1?m.exp(m.mul(this,m.ln(this).sub(1))):m.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?m.dOne:this.layer===0&&this.mag<=709.7?m.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?R(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?R(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):R(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return m.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return R(1,2,Math.log10(this.mag)-.3010299956639812);{const e=m.div(Y(this.sign,this.layer-1,this.mag),Y(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=Y(1,0,1)){if(e===1)return m.pow(this,t);if(e===0)return new m(t);if(this.eq(m.dOne))return m.dOne;if(this.eq(-1))return m.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return m.fromNumber(Math.E);const s=m.ln(this).neg();return s.lambertw().div(s)}else return r>1.444667861009766?m.fromNumber(Number.POSITIVE_INFINITY):m.dNaN}if(this.eq(m.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),m.fromNumber(r)}if(e<0)return m.iteratedlog(t,this,-e);t=h(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(m.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r3)return Y(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=Y(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return m.tetrate(e,-t,this);e=h(e);let n=m.fromDecimal(this);const i=t;t=Math.trunc(t);const r=i-t;if(n.layer-e.layer>3){const s=Math.min(t,n.layer-e.layer-3);t-=s,n.layer-=s}for(let s=0;s1e4)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,s=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),s+=n,n===0)break}return m.fromNumber(s)}slog_internal(e=10){if(e=h(e),e.lte(m.dZero)||e.eq(m.dOne))return m.dNaN;if(e.lt(m.dOne))return this.eq(m.dOne)?m.dZero:this.eq(m.dZero)?m.dNegOne:m.dNaN;if(this.mag<0||this.eq(m.dZero))return m.dNegOne;let t=0,n=m.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(m.dZero))n=m.pow(e,n),t-=1;else{if(n.lte(m.dOne))return m.fromNumber(t+m.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=m.log(n,e)}return m.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:m.critical_section(e,t,pr)}static tetrate_critical(e,t){return m.critical_section(e,t,vr)}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 o=(e-it[u])/(it[u+1]-it[u]);i=n[u][Math.floor(t)]*(1-o)+n[u+1][Math.floor(t)]*o,r=n[u][Math.ceil(t)]*(1-o)+n[u+1][Math.ceil(t)]*o;break}const s=t-Math.floor(t);return i<=0||r<=0?i*(1-s)+r*s:Math.pow(e,Math.log(i)/Math.log(e)*(1-s)+Math.log(r)/Math.log(e)*s)}layeradd10(e){e=m.fromValue_noAlloc(e).toNumber();const t=m.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?m.tetrate(t,i):Number.isFinite(i)?i>=-1?m.log(m.tetrate(t,i+1),t):m.log(m.log(m.tetrate(t,i+2),t),t):m.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return m.fromNumber(En(this.toNumber()));if(this.layer===0)return m.fromNumber(En(this.sign*this.mag));if(this.layer===1)return $n(this);if(this.layer===2)return $n(this);if(this.layer>=3)return Y(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return Y(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=Y(1,0,1)){t=h(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(m.dOne)?(++e,t=m.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?m.fromNumber(Math.sin(this.sign*this.mag)):Y(0,0,0)}cos(){return this.mag<0?m.dOne:this.layer===0?m.fromNumber(Math.cos(this.sign*this.mag)):Y(0,0,0)}tan(){return this.mag<0?this:this.layer===0?m.fromNumber(Math.tan(this.sign*this.mag)):Y(0,0,0)}asin(){return this.mag<0?this:this.layer===0?m.fromNumber(Math.asin(this.sign*this.mag)):Y(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?m.fromNumber(Math.acos(this.toNumber())):this.layer===0?m.fromNumber(Math.acos(this.sign*this.mag)):Y(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?m.fromNumber(Math.atan(this.sign*this.mag)):m.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 m.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return m.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?Y(Number.NaN,Number.NaN,Number.NaN):m.ln(this.add(1).div(m.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(m.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 l=m;l.fromStringCache=new or(fr);l.dZero=Y(0,0,0);l.dOne=Y(1,0,1);l.dNegOne=Y(-1,0,1);l.dTwo=Y(1,0,2);l.dTen=Y(1,0,10);l.dNaN=Y(Number.NaN,Number.NaN,Number.NaN);l.dInf=Y(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);l.dNegInf=Y(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);l.dNumberMax=R(1,0,Number.MAX_VALUE);l.dNumberMin=R(1,0,Number.MIN_VALUE);h=l.fromValue_noAlloc;R=l.fromComponents;Y=l.fromComponents_noNormalize;l.fromMantissaExponent;l.fromMantissaExponent_noNormalize;const br=new l(1);function Dt(e,t,n=!0){let i=l.log10(e).floor(),r=l.div(e,l.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=br,i=i.add(1));const s=i.gte(1e9)?Pe(i,Math.max(Math.max(t,3),ne.defaultDecimalsShown)):i.gte(1e4)?Yt(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+s:"e"+s}function Yt(e,t){if(e==null)return"NaN";if(e=new l(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 Un(e,t){return e==null?"NaN":(e=new l(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),ne.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const yr=new l("eeee1000"),_r=new l("e100000"),Tn=new l("e1000"),zn=new l(1e9),wr=new l(1e6),Nr=new l(1e3),Cr=new l(.98),kr=new l(.001),jn=new l(0);function Pe(e,t,n){if(t==null&&(t=ne.defaultDecimalsShown),n=n!=null?n:ne.defaultShowSmall,e=new l(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+Pe(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(yr)){const i=e.slog();return i.gte(wr)?"F"+Pe(i.floor()):l.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+Yt(i.floor(),0)}else{if(e.gte(_r))return Dt(e,0,!1);if(e.gte(Tn))return Dt(e,0);if(e.gte(zn))return Dt(e,t);if(e.gte(Nr))return Yt(e,0);if(e.gte(kr)||!n)return Un(e,t);if(e.eq(jn))return 0 .toFixed(t)}return e=Gn(e),e.lt(Tn)?Dt(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):Pe(e,t)+"\u207B\xB9"}function Fe(e){return e=new l(e),e.sign<0?"-"+Fe(e.neg()):e.gte(zn)||e.lte(Cr)&&!e.eq(jn)?Pe(e):Pe(e,0)}function Wn(e){return l.lt(e,0)?"-"+Wn(l.neg(e)):l.gt(e,2**51)?Pe(l.div(e,31536e3))+"y":(e=new l(e).toNumber(),e<60?Pe(e)+"s":e<3600?Fe(Math.floor(e/60))+"m "+Pe(e%60)+"s":e<86400?Fe(Math.floor(e/3600))+"h "+Fe(Math.floor(e/60)%60)+"m "+Fe(e%60)+"s":e<31536e3?Fe(Math.floor(e/84600)%365)+"d "+Fe(Math.floor(e/3600)%24)+"h "+Fe(Math.floor(e/60)%60)+"m":Fe(Math.floor(e/31536e3))+"y "+Fe(Math.floor(e/84600)%365)+"d "+Fe(Math.floor(e/3600)%24)+"h")}function Sr(e,t,n){e=new l(e);let i=e.toStringWithDecimalPlaces(t);return new l(i).gte(n)&&(i=l.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function xr(e,t){return Pe(e,t,!0)}function Gn(e){let t=l.log10(e).ceil();const n=l.div(e,l.pow(10,t));return t=t.neg(),e=new l(10).pow(t).times(n),e}var Ir=Object.freeze(Object.defineProperty({__proto__:null,default:l,exponentialFormat:Dt,commaFormat:Yt,regularFormat:Un,format:Pe,formatWhole:Fe,formatTime:Wn,toPlaces:Sr,formatSmall:xr,invertOOM:Gn},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:Mr,commaFormat:Er,regularFormat:$r,format:Nt,formatWhole:qe,formatTime:gn,toPlaces:Tr,formatSmall:ut,invertOOM:Fr}=Ir;window.Decimal=l;window.exponentialFormat=Mr;window.commaFormat=Er;window.regularFormat=$r;window.format=Nt;window.formatWhole=qe;window.formatTime=gn;window.toPlaces=Tr;window.formatSmall=ut;window.invertOOM=Fr;function _t(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Jt(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 Lt=Symbol("DoNotCache");function q(e,t){const n=e[t];Jt(n)&&n.length===0&&!n[Lt]?e[t]=I(n.bind(e)):Jt(n)&&(e[t]=n.bind(e),e[t][Lt]=!0)}function Ce(e){return Jt(e)&&!e[Lt]&&(e=I(e)),e}const qt=Symbol("Component"),en=Symbol("GatherProps");let Pr=0;function Hn(e="feature-"){return e+Pr++}var Ge=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(Ge||{});function tt(e){const t=a(e);return t!==2&&t!==!1}function tn(e){return a(e)===1}function oe(e){return e[Lt]=!0,e}function ve(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function Dr(e,...t){const n=[],i=r=>{Object.keys(r).forEach(s=>{const u=r[s];u!=null&&typeof u=="object"&&(t.includes(u.type)?n.push(u):!(u instanceof l)&&!me(u)&&i(u))})};return i(e),n}const rt={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 fn=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(fn||{}),Be={classic:rt,paper:{...rt,variables:{...rt.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:{...rt,variables:{...rt.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:{...rt,variables:{...rt.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const Ie=qn();"fonts"in document&&(document.fonts.onloadingdone=()=>Ie.emit("fontsLoaded"));var Ar=Object.freeze(Object.defineProperty({__proto__:null,globalBus:Ie},Symbol.toStringTag,{value:"Module"}));const Or=gt({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var H=window.player=Or;function Zn(e){return JSON.stringify(e,(t,n)=>a(n))}function Yn(e={}){return Object.assign({id:`${ne.id}-0`,name:"Default Save",tabs:ne.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:ne.id,modVersion:ne.versionNumber,layers:{}},e)}function Me(e){const t=Ke.compressToUTF16(Zn(e!=null?e:H));return localStorage.setItem((e!=null?e:H).id,t),t}async function Vr(){Br();try{let e=localStorage.getItem(re.active);if(e==null){await ot(Ct());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Ke.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==ne.id){await ot(Ct());return}t.id=re.active,await ot(t)}catch(e){console.error(`Failed to load save. Falling back to new save. -`,e),await ot(Ct())}}function Ct(){const e=Gt(),t=Yn({id:e});return Me(t),re.saves.push(e),t}function Gt(){let e,t=0;do e=`${ne.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const Lr=A(!1);async function ot(e){console.info("Loading save",e),Lr.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await Vt(()=>Promise.resolve().then(function(){return aa}),void 0),{fixOldSave:r,getInitialLayers:s}=await Vt(()=>Promise.resolve().then(function(){return $u}),void 0);for(const u in t){const o=t[u];o&&n(o)}s(e).forEach(u=>i(u,e)),e=Yn(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,ne.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ne.versionNumber&&(r(e.modVersion,e),e.modVersion=ne.versionNumber),Object.assign(H,e),re.active=H.id,Ie.emit("onLoad")}setInterval(()=>{H.autosave&&Me()},1e3);window.onbeforeunload=()=>{H.autosave&&Me()};window.save=Me;const qr=window.hardReset=async()=>{await ot(Ct())};window.deleteLowerSaves=()=>{const e=Object.values(re.saves).indexOf(H.id)+1;Object.values(re.saves).slice(e).forEach(t=>localStorage.removeItem(t)),re.saves=re.saves.slice(0,e)};const Bt=gt({active:"",saves:[],showTPS:!0,theme:fn.Nordic,unthrottled:!1,alignUnits:!1});Ve(Bt,e=>{const t=Ke.compressToUTF16(JSON.stringify(e));localStorage.setItem(ne.id,t)},{deep:!0});var re=window.settings=Bt;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:fn.Nordic,alignUnits:!1};Ie.emit("loadSettings",e),Object.assign(Bt,e),qr()};function Br(){try{let e=localStorage.getItem(ne.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Ke.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Bt,t)}Ie.emit("loadSettings",Bt)}catch{}}const Rr=gt([]),Ur=gt([]),zr=gt([]);function _e(e,t="span"){return typeof e=="function"?J({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),J({template:e})):J({render:()=>({})}):e}function Je(e){if(ct(e))return typeof e=="function"?e():_e(e);const t=e[qt];return _(t,e[en](),null)}function je(e){if(ct(e))return typeof e=="function"?e():typeof e=="string"?_(se,null,[e]):_(e,null,null);const t=e[qt];return _(t,e[en](),null)}function ct(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Lt]===!0}function Jn(e,t){const n=A(null),i=A(void 0);function r(o){n.value||(n.value=setInterval(u,250)),i.value=o}function s(){n.value&&(clearInterval(n.value),n.value=null)}function u(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return Ln(s),{start:r,stop:s,handleHolding:u}}function Kn(e,t="div"){const n=Oe();return ze(()=>{n.value=_e(Se(e),t)}),n}function Ut(e,t="div"){const n=Oe(null);return ze(()=>{const i=Se(e);n.value=i==""||i==null?null:_e(i,t)}),n}function Se(e){return a(a(e))}function U(...e){return e.includes(Object)||e.push(Object),e}var ae=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const jr=J({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var b;const n=A({}),i=new ResizeObserver(o),r=A(null);Qt(()=>{const v=r.value;v!=null&&i.observe(v)});let s=!0,u=A((b=r.value)==null?void 0:b.getBoundingClientRect());function o(){s&&(s=!1,ft(()=>{var v;u.value=(v=r.value)==null?void 0:v.getBoundingClientRect(),Object.values(n.value).filter(w=>w).forEach(w=>w.rect=w.element.getBoundingClientRect()),t("updateNodes",n.value),s=!0}))}Ie.on("fontsLoaded",o);const c={attributes:!1,childList:!0,subtree:!1};Wt(mn,(v,w)=>{const N=new MutationObserver(()=>d(v));N.observe(w,c),n.value[v]={element:w,observer:N,rect:w.getBoundingClientRect()},o()}),Wt(vn,v=>{var w;(w=n.value[v])==null||w.observer.disconnect(),n.value[v]=void 0,o()}),Wt(pn,n),Wt(hn,u);function d(v){const w=n.value[v];w!=null&&(w.rect=w.element.getBoundingClientRect(),t("updateNodes",n.value))}return(v,w)=>(C(),M(se,null,[Qe(v.$slots,"default",{},void 0,!0),p("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var Xn=ae(jr,[["__scopeId","data-v-2b1dc1bc"]]);const Wr=["onPointerdown"],Gr={class:"modal-wrapper"},Hr={class:"modal-container"},Zr={class:"modal-header"},Yr={class:"modal-body"},Jr={class:"modal-footer"},Kr=p("div",{class:"modal-default-flex-grow"},null,-1),nt=J({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=be(e),s=I(()=>a(r.modelValue)||o.value);function u(){n("update:modelValue",!1)}const o=A(!1),c=A(null),d=I(()=>{var b,v;return(v=(b=c.value)==null?void 0:b.nodes)!=null?v:null});return t({isOpen:s,nodes:d}),(b,v)=>(C(),X(xi,{to:"#modal-root"},[_(xt,{name:"modal",onBeforeEnter:v[0]||(v[0]=w=>o.value=!0),onAfterLeave:v[1]||(v[1]=w=>o.value=!1)},{default:B(()=>[cn(p("div",We({class:"modal-mask",onPointerdown:St(u,["self"])},b.$attrs),[p("div",Gr,[p("div",Hr,[p("div",Zr,[Qe(b.$slots,"header",{shown:a(s)},()=>[O(" default header ")])]),p("div",Yr,[_(Xn,{ref_key:"contextRef",ref:c},{default:B(()=>[Qe(b.$slots,"body",{shown:a(s)},()=>[O(" default body ")])]),_:3},512)]),p("div",Jr,[Qe(b.$slots,"footer",{shown:a(s)},()=>[p("div",{class:"modal-default-footer"},[Kr,p("button",{class:"button modal-default-button",onClick:u}," Close ")])])])])])],16,Wr),[[Si,e.modelValue]])]),_:3})]))}}),at=Symbol("ProxyState");function Mt(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(s,u){if(u===at)return r();const o=r()[u];return o!=null&&typeof o=="object"&&Xe in o?o[Xe]:o},set(s,u,o){return r()[u]=o,!0},has(s,u){return u===at?!0:Reflect.has(r(),u)},ownKeys(){return Reflect.ownKeys(r())},getOwnPropertyDescriptor(s,u){return i||(Object.assign(n,e.call(n,n)),i=!0),Object.getOwnPropertyDescriptor(s,u)}})}var pe=window.state=dn({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const kt=Symbol("PersistentState"),Rt=Symbol("DefaultValue"),Kt=Symbol("StackTrace"),Xt=Symbol("Deleted"),Xe=Symbol("NonPersistent"),st=Symbol("SaveDataPath"),Xr=Symbol("SkipPersistence");function Qr(){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 Fn(e,t){var n;if(l.isNaN(t))throw pe.hasNaN||(H.autosave=!1,pe.hasNaN=!0,pe.NaNPath=e[st],pe.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[st])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[kt].value=t}function zt(e,t=!0){const n=me(e)?e:A(e);me(e)&&(e=e.value);const i=I({get(){return n.value},set(s){t?Fn(r,s):r[kt].value=s}});i[Rt]=e;const r={get value(){return n.value},set value(s){t?Fn(r,s):r[kt].value=s},__v_isRef:!0,[kt]:n,[Rt]:e,[Kt]:Qr(),[Xt]:!1,[Xe]:i,[st]:void 0};return xe.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,` -Created at: -`+r[Kt]):dt[xe[xe.length-1]].add(r),r}function ea(e){return e!=null&&typeof e=="object"&&kt in e}function ta(e){xe.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):dt[xe[xe.length-1]].delete(e),e[Xt]=!0}Ie.on("addLayer",(e,t)=>{const n=[],i=(r,s=[])=>{let u=!1;return Object.keys(r).forEach(o=>{let c=r[o];if(c!=null&&typeof c=="object"){if(c[Xr]===!0)return;if(at in c&&(c=c[at]),ea(c)){if(u=!0,c[Xt]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` -Created at: -`+c[Kt]);return}dt[e.id].delete(c);const d=[e.id,...s,o];c[st]!=null&&JSON.stringify(d)!==JSON.stringify(c[st])&&console.error(`Persistent ref is being saved to \`${d.join(".")}\` when it's already present at \`${c[st].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[st]=d;const b=s.reduce((w,N)=>(N in w||(w[N]={}),w[N]),t),v=b[o];b[o]=c[kt],Ii(b)?v!=null?b[o]=v:b[o]=c[Rt]:v!=null?b[o].value=v:b[o].value=c[Rt]}else!(c instanceof l)&&!me(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...s,o])&&(Sn(c)&&!Sn(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.",at in r?r[at]:r,o):u=!0))}}),u};i(e[at]),dt[e.id].forEach(r=>{r[Xt]||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[Kt])}),dt[e.id].clear()});const mn=Symbol("RegisterNode"),vn=Symbol("UnregisterNode"),pn=Symbol("Nodes"),hn=Symbol("Bounds"),ke=dn({});window.layers=ke;const dt={},xe=[];function Qn(e,t){return Mt(()=>{const n={},i=n.emitter=qn();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=A({}),n.id=e,xe.push(e),dt[e]=new Set,n.minimized=zt(!1,!1),Object.assign(n,t.call(n,n)),xe[xe.length-1]==null||xe[xe.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen -Stack: ${xe} -Trying to pop ${n.id}`;xe.pop(),q(n,"color"),q(n,"display"),q(n,"classes"),q(n,"style"),q(n,"name"),ve(n,"name",n.id),q(n,"minWidth"),ve(n,"minWidth",600),q(n,"minimizable"),ve(n,"minimizable",!0),q(n,"minimizedDisplay");const r=n.style;return n.style=I(()=>{var u,o;let s=a(n.minWidth);return(typeof s=="number"||!Number.isNaN(parseInt(s)))&&(s=s+"px"),[(u=a(r))!=null?u:"",(o=n.minimized)!=null&&o.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:s,flexBasis:s,margin:""}]}),n})}function ei(e,t){if(console.info("Adding layer",e.id),ke[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ke[e.id]);return}ve(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ke[e.id]=e,Ie.emit("addLayer",e,t.layers[e.id])}function na(e){return ke[e]}function ti(e){console.info("Removing layer",e.id),Ie.emit("removeLayer",e),ke[e.id]=void 0}function ia(e){ti(e),ei(e,H)}function ra(e){const t=A(!1);return{openModal:()=>t.value=!0,modal:oe(()=>_(nt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>_("h2",null,[a(e.name)]),body:a(e.display)}))}}Ie.on("update",function(t){Object.values(ke).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(ke).forEach(n=>{n==null||n.emit("update",t)}),Object.values(ke).forEach(n=>{n==null||n.emit("postUpdate",t)})});var aa=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:mn,UnregisterNodeInjectionKey:vn,NodesInjectionKey:pn,BoundsInjectionKey:hn,layers:ke,persistentRefs:dt,addingLayers:xe,createLayer:Qn,addLayer:ei,getLayer:na,removeLayer:ti,reloadLayer:ia,setupLayerModal:ra},Symbol.toStringTag,{value:"Module"}));const oa=J({components:{Context:Xn},props:{index:{type:Number,required:!0},display:{type:U(Object,String,Function),required:!0},minimizedDisplay:U(Object,String,Function),minimized:{type:Object,required:!0},name:{type:U(String),required:!0},color:U(String),minimizable:U(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=be(e),s=Kn(t),u=Ut(r),o=I(()=>ne.allowGoBack&&n.value>0&&!Se(i));function c(){H.tabs.splice(a(e.index),1/0)}function d(b){e.nodes.value=b}return{component:s,minimizedComponent:u,showGoBack:o,updateNodes:d,unref:a,goBack:c}}}),sa={key:1};function la(e,t,n,i,r,s){const u=Ht("Context");return C(),M("div",{class:"layer-container",style:Le({"--layer-color":e.unref(e.color)})},[e.showGoBack?(C(),M("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...o)=>e.goBack&&e.goBack(...o))},"\u274C")):V("",!0),e.unref(e.minimized)?(C(),M("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=o=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(C(),X(Ee(e.minimizedComponent),{key:0})):(C(),M("div",sa,K(e.unref(e.name)),1))])):(C(),M("div",{key:2,class:ue(["layer-tab",{showGoBack:e.showGoBack}])},[_(u,{onUpdateNodes:e.updateNodes},{default:B(()=>[(C(),X(Ee(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(C(),M("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=o=>e.$emit("setMinimized",!0))}," \u25BC ")):V("",!0)],4)}var ua=ae(oa,[["render",la],["__scopeId","data-v-72dd78b1"]]);const ni=e=>(mt("data-v-4b4bda40"),e=e(),vt(),e),ca=ni(()=>p("h2",null,"Changelog",-1)),da=ni(()=>p("details",{open:""},[p("summary",null,[O("v0.0 Initial Commit - "),p("time",null,"2021-09-04")]),O(" This is the first release :D "),p("ul",null,[p("li",{class:"feature"},"Did everything"),p("li",{class:"fix"},"Had some fun"),p("li",{class:"breaking"},"Removed everything"),p("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),ga=J({__name:"Changelog",setup(e,{expose:t}){const n=A(!1);return t({open(){n.value=!0}}),(i,r)=>(C(),X(nt,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=s=>n.value=s)},{header:B(()=>[ca]),body:B(()=>[da]),_:1},8,["modelValue"]))}});var fa=ae(ga,[["__scopeId","data-v-4b4bda40"]]),ma=J({props:{element:Object,display:{type:U(Object,String,Function),required:!0},style:U(Object,String,Array),classes:U(Object),direction:U(String),xoffset:U(String),yoffset:U(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=be(e),r=A(!1),s=I(()=>(Se(i)||r.value)&&u.value),u=Ut(n),o=Oe(_e(oe(()=>{const b=Se(t);return b==null?"":je(b)})));function c(b){const v=i;b.shiftKey&&v&&(v.value=!v.value,b.stopPropagation(),b.preventDefault())}const d=I(()=>Se(i)&&Be[re.theme].showPin);return{Direction:j,isHovered:r,isShown:s,comp:u,elementComp:o,unref:a,togglePinned:c,showPin:d}}});const va={key:0,class:"material-icons pinned"};function pa(e,t,n,i,r,s){return C(),M("div",{class:ue(["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))},[Qe(e.$slots,"default",{},void 0,!0),e.elementComp?(C(),X(Ee(e.elementComp),{key:0})):V("",!0),_(xt,{name:"fade"},{default:B(()=>{var u;return[e.isShown?(C(),M("div",{key:0,class:ue(["tooltip",{top:e.unref(e.direction)===e.Direction.Up,left:e.unref(e.direction)===e.Direction.Left,right:e.unref(e.direction)===e.Direction.Right,bottom:e.unref(e.direction)===e.Direction.Down,...e.unref(e.classes)}]),style:Le([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(u=e.unref(e.style))!=null?u:{}])},[e.showPin?(C(),M("span",va,"push_pin")):V("",!0),e.comp?(C(),X(Ee(e.comp),{key:1})):V("",!0)],6)):V("",!0)]}),_:1})],34)}var he=ae(ma,[["render",pa],["__scopeId","data-v-6102fa3a"]]);const pt=e=>(mt("data-v-4f97aa40"),e=e(),vt(),e),ha={class:"info-modal-header"},ba=["src","alt"],ya={class:"info-modal-title"},_a={key:0},wa={key:0},Na={key:0},Ca=pt(()=>p("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),ka=pt(()=>p("br",null,null,-1)),Sa=pt(()=>p("br",null,null,-1)),xa=["href"],Ia=pt(()=>p("span",{class:"material-icons info-modal-discord"},"discord",-1)),Ma=pt(()=>p("div",null,[p("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[p("span",{class:"material-icons info-modal-discord"},"discord"),O(" The Paper Pilot Community ")])],-1)),Ea=pt(()=>p("div",null,[p("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[p("span",{class:"material-icons info-modal-discord"},"discord"),O(" The Modding Tree ")])],-1)),$a=pt(()=>p("br",null,null,-1));var Ta=J({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:r,author:s,discordName:u,discordLink:o,versionNumber:c,versionTitle:d}=ne,b=be(n),v=A(!1),w=I(()=>gn(H.timePlayed)),N=I(()=>_e(oe(()=>_(se,null,[Ur.map(Je)]))));t({open(){v.value=!0}});function y(){var S;(S=a(b.changelog))==null||S.open()}return(S,T)=>(C(),X(nt,{modelValue:v.value,"onUpdate:modelValue":T[0]||(T[0]=L=>v.value=L)},{header:B(()=>[p("div",ha,[a(r)?(C(),M("img",{key:0,class:"info-modal-logo",src:a(r),alt:a(i)},null,8,ba)):V("",!0),p("div",ya,[p("h2",null,K(a(i)),1),p("h4",null,[O(" v"+K(a(c)),1),a(d)?(C(),M("span",_a,": "+K(a(d)),1)):V("",!0)])])])]),body:B(({shown:L})=>[L?(C(),M("div",wa,[a(s)?(C(),M("div",Na,"By "+K(a(s)),1)):V("",!0),Ca,ka,p("div",{class:"link",onClick:y},"Changelog"),Sa,p("div",null,[a(o)?(C(),M("a",{key:0,href:a(o),class:"info-modal-discord-link",target:"_blank"},[Ia,O(" "+K(a(u)),1)],8,xa)):V("",!0)]),Ma,Ea,$a,p("div",null,"Time Played: "+K(a(w)),1),(C(),X(Ee(a(N))))])):V("",!0)]),_:1},8,["modelValue"]))}});var Fa=ae(Ta,[["__scopeId","data-v-4f97aa40"]]);const Pa={class:"field"},Da={key:0,class:"field-title"},ii=J({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var u;const n=e,i=Ut(et(n,"title"),"span"),r=A((u=n.options.find(o=>o.value===n.modelValue))!=null?u:null);Ve(et(n,"modelValue"),o=>{var c;Se(r)!==o&&(r.value=(c=n.options.find(d=>d.value===o))!=null?c:null)});function s(o){t("update:modelValue",o.value)}return(o,c)=>(C(),M("div",Pa,[a(i)?(C(),M("span",Da,[(C(),X(Ee(a(i))))])):V("",!0),_(a(Fi),{options:e.options,modelValue:r.value,"onUpdate:modelValue":[c[0]||(c[0]=d=>r.value=d),s],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const Aa={class:"field"},Oa=J({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=I(()=>{var s;return _e((s=a(n.title))!=null?s:"","span")}),r=I({get(){return!!n.modelValue},set(s){t("update:modelValue",s)}});return(s,u)=>(C(),M("label",Aa,[cn(p("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":u[0]||(u[0]=o=>me(r)?r.value=o:null)},null,512),[[Mi,a(r)]]),(C(),X(Ee(a(i))))]))}});var Ue=ae(Oa,[["__scopeId","data-v-11046116"]]);const Va=["onClick"],La=J({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=A(!1),i=A(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,ft(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(s,u)=>(C(),M("button",{onClick:St(r,["stop"]),class:ue(["feedback",{activated:n.value,left:e.left}])},[Qe(s.$slots,"default",{},void 0,!0)],10,Va))}});var ri=ae(La,[["__scopeId","data-v-01a1b95c"]]);const qa={class:"header"},Ba=p("h2",null,"Settings",-1),Ra={class:"option-tabs"},Ua={key:0},za={key:1};var ja=J({__name:"Options",setup(e,{expose:t}){const n=A(!1),i=A("behaviour");function r(ie){return ie==i.value}function s(ie){i.value=ie}t({isTab:r,setTab:s,save:Me,open(){n.value=!0}});const u=Object.keys(Be).map(ie=>({label:_t(ie),value:ie})),o=I(()=>_e(oe(()=>_(se,null,[Rr.map(Je)])))),{showTPS:c,theme:d,unthrottled:b,alignUnits:v}=be(re),{autosave:w,offlineProd:N}=be(H),y=I({get(){return H.devSpeed===0},set(ie){H.devSpeed=ie?0:null}}),S=oe(()=>_("span",{class:"option-title"},[O("Unthrottled"),_("desc",null,[O("Allow the game to run as fast as possible. Not battery friendly.")])])),T=oe(()=>_("span",{class:"option-title"},[O("Offline Production"),_(he,{display:"Save-specific",direction:j.Right},{default:()=>[O("*")]}),_("desc",null,[O("Simulate production that occurs while the game is closed.")])])),L=oe(()=>_("span",{class:"option-title"},[O("Autosave"),_(he,{display:"Save-specific",direction:j.Right},{default:()=>[O("*")]}),_("desc",null,[O("Automatically save the game every second or when the game is closed.")])])),x=oe(()=>_("span",{class:"option-title"},[O("Pause game"),_(he,{display:"Save-specific",direction:j.Right},{default:()=>[O("*")]}),_("desc",null,[O("Stop everything from moving.")])])),F=oe(()=>_("span",{class:"option-title"},[O("Theme"),_("desc",null,[O("How the game looks.")])])),P=oe(()=>_("span",{class:"option-title"},[O("Show TPS"),_("desc",null,[O("Show TPS meter at the bottom-left corner of the page.")])])),z=oe(()=>_("span",{class:"option-title"},[O("Align modifier units"),_("desc",null,[O("Align numbers to the beginning of the unit in modifier view.")])]));return(ie,ee)=>(C(),X(nt,{modelValue:n.value,"onUpdate:modelValue":ee[10]||(ee[10]=Q=>n.value=Q)},{header:B(()=>[p("div",qa,[Ba,p("div",Ra,[p("button",{class:ue({selected:r("behaviour")}),onClick:ee[0]||(ee[0]=Q=>s("behaviour"))},"Behaviour",2),p("button",{class:ue({selected:r("appearance")}),onClick:ee[1]||(ee[1]=Q=>s("appearance"))},"Appearance",2)])])]),body:B(()=>[r("behaviour")?(C(),M("div",Ua,[_(Ue,{title:a(S),modelValue:a(b),"onUpdate:modelValue":ee[2]||(ee[2]=Q=>me(b)?b.value=Q:null)},null,8,["title","modelValue"]),a(ne).enablePausing?(C(),X(Ue,{key:0,title:a(x),modelValue:a(y),"onUpdate:modelValue":ee[3]||(ee[3]=Q=>me(y)?y.value=Q:null)},null,8,["title","modelValue"])):V("",!0),_(Ue,{title:a(T),modelValue:a(N),"onUpdate:modelValue":ee[4]||(ee[4]=Q=>me(N)?N.value=Q:null)},null,8,["title","modelValue"]),_(Ue,{title:a(L),modelValue:a(w),"onUpdate:modelValue":ee[5]||(ee[5]=Q=>me(w)?w.value=Q:null)},null,8,["title","modelValue"]),a(w)?V("",!0):(C(),X(ri,{key:1,class:"button save-button",onClick:ee[6]||(ee[6]=Q=>a(Me)())},{default:B(()=>[O("Manually save")]),_:1}))])):V("",!0),r("appearance")?(C(),M("div",za,[_(ii,{title:a(F),options:a(u),modelValue:a(d),"onUpdate:modelValue":ee[7]||(ee[7]=Q=>me(d)?d.value=Q:null)},null,8,["title","options","modelValue"]),(C(),X(Ee(a(o)))),_(Ue,{title:a(P),modelValue:a(c),"onUpdate:modelValue":ee[8]||(ee[8]=Q=>me(c)?c.value=Q:null)},null,8,["title","modelValue"]),_(Ue,{title:a(z),modelValue:a(v),"onUpdate:modelValue":ee[9]||(ee[9]=Q=>me(v)?v.value=Q:null)},null,8,["title","modelValue"])])):V("",!0)]),_:1},8,["modelValue"]))}});const Wa=["onSubmit"],Ga={class:"field"},Ha={key:0,class:"field-title"},Za=["placeholder"],Ya=J({__name:"Text",props:{title:null,modelValue:null,textArea:{type:Boolean},placeholder:null,maxHeight:null,submitOnBlur:{type:Boolean}},emits:["update:modelValue","submit","cancel"],setup(e,{emit:t}){const n=e,i=Ut(et(n,"title"),"span"),r=Oe(null);Qt(()=>{var c;(c=r.value)==null||c.focus()});const s=I({get(){var c;return(c=a(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function u(){t("submit")}function o(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,d)=>(C(),M("form",{onSubmit:St(u,["prevent"])},[p("div",Ga,[a(i)?(C(),M("span",Ha,[(C(),X(Ee(a(i))))])):V("",!0),e.textArea?(C(),X(a(Di),{key:1,modelValue:a(s),"onUpdate:modelValue":d[0]||(d[0]=b=>me(s)?s.value=b:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:o,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):cn((C(),M("input",{key:2,type:"text","onUpdate:modelValue":d[1]||(d[1]=b=>me(s)?s.value=b:null),placeholder:e.placeholder,class:ue({fullWidth:!e.title}),onBlur:o,ref_key:"field",ref:r},null,42,Za)),[[Ei,a(s)]])])],40,Wa))}});var ai=ae(Ya,[["__scopeId","data-v-90bd4994"]]);const Ja={key:0},Ka=["onClick","disabled"],Xa={key:0},Qa=["onClick"],eo=J({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=be(e),r=A(!1);Ve(r,o=>{t("confirmingChanged",o)});function s(){if(a(i.skipConfirm)){t("click");return}r.value&&t("click"),r.value=!r.value}function u(){r.value=!1}return(o,c)=>(C(),M("span",{class:ue(["container",{confirming:r.value}])},[r.value?(C(),M("span",Ja,"Are you sure?")):V("",!0),p("button",{onClick:St(s,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(C(),M("span",Xa,"Yes")):Qe(o.$slots,"default",{key:1},void 0,!0)],8,Ka),r.value?(C(),M("button",{key:1,class:"button",onClick:St(u,["stop"])},"No",8,Qa)):V("",!0)],2))}});var to=ae(eo,[["__scopeId","data-v-2f8ef34c"]]);const He=e=>(mt("data-v-32313015"),e=e(),vt(),e),no=He(()=>p("div",{class:"handle material-icons"},"drag_handle",-1)),io={key:0,class:"actions"},ro=He(()=>p("span",{class:"material-icons"},"content_paste",-1)),ao=He(()=>p("span",{class:"material-icons"},"content_copy",-1)),oo=He(()=>p("span",{class:"material-icons"},"edit",-1)),so=He(()=>p("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),lo={key:1,class:"actions"},uo=He(()=>p("span",{class:"material-icons"},"check",-1)),co=He(()=>p("span",{class:"material-icons"},"close",-1)),go={key:2,class:"details"},fo={class:"save-version"},mo=He(()=>p("br",null,null,-1)),vo={key:0},po={key:3,class:"details"},ho={key:4,class:"details error"},bo=He(()=>p("br",null,null,-1)),yo=J({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=be(n),r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),s=A(!1),u=A(!1),o=A("");Ve(s,()=>{var v;return o.value=(v=i.value.name)!=null?v:""});const c=I(()=>i.value!=null&&i.value.id===H.id),d=I(()=>{var v;return c.value?H.time:(v=i.value!=null&&i.value.time)!=null?v:0});function b(){t("editName",o.value),s.value=!1}return(v,w)=>(C(),M("div",{class:ue(["save",{active:a(c)}])},[no,s.value?(C(),M("div",lo,[p("button",{onClick:b,class:"button"},[_(he,{display:"Save",direction:a(j).Left,class:"info"},{default:B(()=>[uo]),_:1},8,["direction"])]),p("button",{onClick:w[5]||(w[5]=N=>s.value=!s.value),class:"button"},[_(he,{display:"Cancel",direction:a(j).Left,class:"info"},{default:B(()=>[co]),_:1},8,["direction"])])])):(C(),M("div",io,[a(i).error==null&&!u.value?(C(),X(ri,{key:0,onClick:w[0]||(w[0]=N=>t("export")),class:"button",left:""},{default:B(()=>[_(he,{display:"Export",direction:a(j).Left,class:"info"},{default:B(()=>[ro]),_:1},8,["direction"])]),_:1})):V("",!0),a(i).error==null&&!u.value?(C(),M("button",{key:1,onClick:w[1]||(w[1]=N=>t("duplicate")),class:"button"},[_(he,{display:"Duplicate",direction:a(j).Left,class:"info"},{default:B(()=>[ao]),_:1},8,["direction"])])):V("",!0),a(i).error==null&&!u.value?(C(),M("button",{key:2,onClick:w[2]||(w[2]=N=>s.value=!s.value),class:"button"},[_(he,{display:"Edit Name",direction:a(j).Left,class:"info"},{default:B(()=>[oo]),_:1},8,["direction"])])):V("",!0),_(to,{disabled:a(c),onClick:w[3]||(w[3]=N=>t("delete")),onConfirmingChanged:w[4]||(w[4]=N=>u.value=N)},{default:B(()=>[_(he,{display:"Delete",direction:a(j).Left,class:"info"},{default:B(()=>[so]),_:1},8,["direction"])]),_:1},8,["disabled"])])),a(i).error==null&&!s.value?(C(),M("div",go,[p("button",{class:"button open",onClick:w[6]||(w[6]=N=>t("open"))},[p("h3",null,K(a(i).name),1)]),p("span",fo,"v"+K(a(i).modVersion),1),mo,a(d)?(C(),M("div",vo,"Last played "+K(a(r).format(a(d))),1)):V("",!0)])):a(i).error==null&&s.value?(C(),M("div",po,[_(ai,{modelValue:o.value,"onUpdate:modelValue":w[7]||(w[7]=N=>o.value=N),class:"editname",onSubmit:b},null,8,["modelValue"])])):(C(),M("div",ho,[O(" Error: Failed to load save with id "+K(a(i).id),1),bo,O(K(a(i).error),1)]))],2))}});var _o=ae(yo,[["__scopeId","data-v-32313015"]]);const bn=e=>(mt("data-v-2a4275be"),e=e(),vt(),e),wo=bn(()=>p("h2",null,"Saves Manager",-1)),No={class:"modal-footer"},Co={class:"field"},ko=bn(()=>p("span",{class:"field-title"},"Create Save",-1)),So={class:"field-buttons"},xo={class:"footer"},Io=bn(()=>p("div",{style:{"flex-grow":"1"}},null,-1)),Mo=J({__name:"SavesManager",setup(e,{expose:t}){const n=A(!1),i=A(null);t({open(){n.value=!0}});const r=A(!1),s=A(""),u=A(null);Ve(s,x=>{x?ft(()=>{try{if(x[0]!=="{")if(x[0]==="e")x=decodeURIComponent(escape(atob(x)));else if(x[0]==="\u1BE1")x=Ke.decompressFromUTF16(x);else{console.warn("Unable to determine preset encoding",x),r.value=!0;return}const F=JSON.parse(x);if(typeof F!="object"){r.value=!0;return}const P=Gt();F.id=P,Me(F),s.value="",r.value=!1,re.saves.push(P)}catch{r.value=!0}}):r.value=!1});let o={},c=A(Object.keys(o).reduce((x,F)=>(x.push({label:F.split("/").slice(-1)[0].slice(0,-4),value:o[F]}),x),[]));const d=dn({});function b(x){if(d[x]==null){let F=localStorage.getItem(x);if(F==null)d[x]={error:"Save doesn't exist in localStorage",id:x};else if(F==="dW5kZWZpbmVk")d[x]={error:"Save is undefined",id:x};else try{if(F[0]!=="{")if(F[0]==="e")F=decodeURIComponent(escape(atob(F)));else if(F[0]==="\u1BE1")F=Ke.decompressFromUTF16(F);else return console.warn("Unable to determine preset encoding",F),r.value=!0,d[x]={error:"Unable to determine preset encoding",id:x},d[x];d[x]={...JSON.parse(F),id:x}}catch(P){d[x]={error:P,id:x},console.warn(`SavesManager: Failed to load info about save with id ${x}: -${P} -${F}`)}}return d[x]}Ve(n,x=>{x&&Object.keys(d).forEach(F=>delete d[F])});const v=I(()=>re.saves.reduce((x,F)=>(x[F]=b(F),x),{}));function w(x){let F;switch(H.id===x?F=Zn(H):F=JSON.stringify(v.value[x]),ne.exportEncoding){default:console.warn(`Unknown save encoding: ${ne.exportEncoding}. Defaulting to lz`);case"lz":F=Ke.compressToUTF16(F);break;case"base64":F=btoa(unescape(encodeURIComponent(F)));break;case"plain":break}const P=document.createElement("textarea");P.value=F,document.body.appendChild(P),P.select(),P.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(P)}function N(x){H.id===x&&Me();const F={...v.value[x],id:Gt()};Me(F),re.saves.push(F.id)}function y(x){re.saves=re.saves.filter(F=>F!==x),localStorage.removeItem(x),d[x]=void 0}function S(x){v.value[H.id].time=H.time,Me(),d[H.id]=void 0,ot(v.value[x]),d[x]=void 0}function T(x){if(u.value=x,ft(()=>{u.value=null}),x[0]!=="{")if(x[0]==="e")x=decodeURIComponent(escape(atob(x)));else if(x[0]==="\u1BE1")x=Ke.decompressFromUTF16(x);else{console.warn("Unable to determine preset encoding",x);return}const F=JSON.parse(x);F.id=Gt(),Me(F),re.saves.push(F.id),S(F.id)}function L(x,F){const P=v.value[x];P!=null&&(P.name=F,H.id===x?(H.name=F,Me()):(Me(P),d[x]=void 0))}return(x,F)=>(C(),X(nt,{modelValue:n.value,"onUpdate:modelValue":F[4]||(F[4]=P=>n.value=P),ref_key:"modal",ref:i},{header:B(()=>[wo]),body:B(({shown:P})=>[P?(C(),X(a(Pi),{key:0,list:a(re).saves,handle:".handle",itemKey:z=>z},{item:B(({element:z})=>[_(_o,{save:a(v)[z],onOpen:ie=>S(z),onExport:ie=>w(z),onEditName:ie=>L(z,ie),onDuplicate:ie=>N(z),onDelete:ie=>y(z)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):V("",!0)]),footer:B(()=>[p("div",No,[_(ai,{modelValue:s.value,"onUpdate:modelValue":F[0]||(F[0]=P=>s.value=P),title:"Import Save",placeholder:"Paste your save here!",class:ue({importingFailed:r.value})},null,8,["modelValue","class"]),p("div",Co,[ko,p("div",So,[p("button",{class:"button",onClick:F[1]||(F[1]=P=>S(a(Ct)().id))},"New Game"),Object.keys(a(c)).length>0?(C(),X(ii,{key:0,options:a(c),modelValue:u.value,"onUpdate:modelValue":F[2]||(F[2]=P=>T(P)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):V("",!0)])]),p("div",xo,[Io,p("button",{class:"button modal-default-button",onClick:F[3]||(F[3]=P=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var oi=ae(Mo,[["__scopeId","data-v-2a4275be"]]);const $e=e=>(mt("data-v-318a1c31"),e=e(),vt(),e),Eo=["src","alt"],$o={key:1,class:"title"},To=$e(()=>p("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Fo={class:"discord"},Po={class:"discord-links"},Do={key:0},Ao=["href"],Oo=$e(()=>p("li",null,[p("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Vo=$e(()=>p("li",null,[p("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Lo={href:"https://forums.moddingtree.com/",target:"_blank"},qo=$e(()=>p("span",{class:"material-icons"},"forum",-1)),Bo=$e(()=>p("span",{class:"material-icons"},"info",-1)),Ro=$e(()=>p("span",{class:"material-icons"},"library_books",-1)),Uo=$e(()=>p("span",{class:"material-icons"},"settings",-1)),zo=$e(()=>p("span",{class:"material-icons"},"library_books",-1)),jo=$e(()=>p("span",{class:"material-icons"},"settings",-1)),Wo=$e(()=>p("span",{class:"material-icons"},"info",-1)),Go={href:"https://forums.moddingtree.com/",target:"_blank"},Ho=$e(()=>p("span",{class:"material-icons"},"forum",-1)),Zo={class:"discord"},Yo={class:"discord-links"},Jo={key:0},Ko=["href"],Xo=$e(()=>p("li",null,[p("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Qo=$e(()=>p("li",null,[p("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),es=J({__name:"Nav",setup(e){const t=A(null),n=A(null),i=A(null),r=A(null),{useHeader:s,banner:u,title:o,discordName:c,discordLink:d,versionNumber:b}=ne;function v(){window.open(d,"mywindow")}return(w,N)=>(C(),M(se,null,[a(s)?(C(),M("div",We({key:0,class:"nav"},w.$attrs),[a(u)?(C(),M("img",{key:0,src:a(u),class:"banner",alt:a(o)},null,8,Eo)):(C(),M("div",$o,K(a(o)),1)),p("div",{onClick:N[0]||(N[0]=y=>{var S;return(S=r.value)==null?void 0:S.open()}),class:"version-container"},[_(he,{display:"Changelog",direction:a(j).Down,class:"version"},{default:B(()=>[p("span",null,"v"+K(a(b)),1)]),_:1},8,["direction"])]),To,p("div",Fo,[p("span",{onClick:v,class:"material-icons"},"discord"),p("ul",Po,[a(d)?(C(),M("li",Do,[p("a",{href:a(d),target:"_blank"},K(a(c)),9,Ao)])):V("",!0),Oo,Vo])]),p("div",null,[p("a",Lo,[_(he,{display:"Forums",direction:a(j).Down,yoffset:"5px"},{default:B(()=>[qo]),_:1},8,["direction"])])]),p("div",{onClick:N[1]||(N[1]=y=>{var S;return(S=t.value)==null?void 0:S.open()})},[_(he,{display:"Info",direction:a(j).Down,class:"info"},{default:B(()=>[Bo]),_:1},8,["direction"])]),p("div",{onClick:N[2]||(N[2]=y=>{var S;return(S=n.value)==null?void 0:S.open()})},[_(he,{display:"Saves",direction:a(j).Down,xoffset:"-20px"},{default:B(()=>[Ro]),_:1},8,["direction"])]),p("div",{onClick:N[3]||(N[3]=y=>{var S;return(S=i.value)==null?void 0:S.open()})},[_(he,{display:"Settings",direction:a(j).Down,xoffset:"-66px"},{default:B(()=>[Uo]),_:1},8,["direction"])])],16)):(C(),M("div",We({key:1,class:"overlay-nav"},w.$attrs),[p("div",{onClick:N[4]||(N[4]=y=>{var S;return(S=r.value)==null?void 0:S.open()}),class:"version-container"},[_(he,{display:"Changelog",direction:a(j).Right,xoffset:"25%",class:"version"},{default:B(()=>[p("span",null,"v"+K(a(b)),1)]),_:1},8,["direction"])]),p("div",{onClick:N[5]||(N[5]=y=>{var S;return(S=n.value)==null?void 0:S.open()})},[_(he,{display:"Saves",direction:a(j).Right},{default:B(()=>[zo]),_:1},8,["direction"])]),p("div",{onClick:N[6]||(N[6]=y=>{var S;return(S=i.value)==null?void 0:S.open()})},[_(he,{display:"Settings",direction:a(j).Right},{default:B(()=>[jo]),_:1},8,["direction"])]),p("div",{onClick:N[7]||(N[7]=y=>{var S;return(S=t.value)==null?void 0:S.open()})},[_(he,{display:"Info",direction:a(j).Right},{default:B(()=>[Wo]),_:1},8,["direction"])]),p("div",null,[p("a",Go,[_(he,{display:"Forums",direction:a(j).Right,xoffset:"7px"},{default:B(()=>[Ho]),_:1},8,["direction"])])]),p("div",Zo,[p("span",{onClick:v,class:"material-icons"},"discord"),p("ul",Yo,[a(d)?(C(),M("li",Jo,[p("a",{href:a(d),target:"_blank"},K(a(c)),9,Ko)])):V("",!0),Xo,Qo])])],16)),_(Fa,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),_(oi,{ref_key:"savesManager",ref:n},null,512),_(ja,{ref_key:"options",ref:i},null,512),_(fa,{ref_key:"changelog",ref:r},null,512)],64))}});var si=ae(es,[["__scopeId","data-v-318a1c31"]]);const ts={class:"inner-tab"},ns=J({__name:"Game",setup(e){const t=et(H,"tabs"),n=I(()=>Object.keys(ke)),i=ne.useHeader;function r(s){const{display:u,minimized:o,name:c,color:d,minimizable:b,nodes:v,minimizedDisplay:w}=s;return{display:u,minimized:o,name:c,color:d,minimizable:b,nodes:v,minimizedDisplay:w}}return(s,u)=>(C(),M("div",{class:ue(["tabs-container",{useHeader:a(i)}])},[(C(!0),M(se,null,It(a(t),(o,c)=>{var d,b;return C(),M("div",{key:c,class:ue(["tab",a((d=a(ke)[o])==null?void 0:d.classes)]),style:Le(a((b=a(ke)[o])==null?void 0:b.style))},[c===0&&!a(i)?(C(),X(si,{key:0})):V("",!0),p("div",ts,[a(n).includes(o)?(C(),X(ua,We({key:0},r(a(ke)[o]),{index:c,onSetMinimized:v=>a(ke)[o].minimized.value=v}),null,16,["index","onSetMinimized"])):(C(),X(Ee(o),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var is=ae(ns,[["__scopeId","data-v-dcd207b4"]]);const rs=J({__name:"Sticky",setup(e){const t=A("0"),n=new ResizeObserver(r),i=Oe(null);function r(){let s=i.value;if(s==null)return;let u=0;for(;s.previousSibling;){const o=s.previousSibling;o.dataset&&"vSticky"in o.dataset&&(u+=o.offsetHeight),s=o}t.value=u+"px"}return ft(r),document.fonts.ready.then(r),Qt(()=>{var u;const s=(u=i.value)==null?void 0:u.parentElement;s&&n.observe(s)}),(s,u)=>(C(),M("div",{class:"sticky",style:Le({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[Qe(s.$slots,"default",{},void 0,!0)],4))}});var li=ae(rs,[["__scopeId","data-v-cccac690"]]);const as=["x1","y1","x2","y2"],os=J({__name:"BoardLink",props:{link:null},setup(e){const n=be(e),i=I(()=>{const s=n.link.value.startNode.position;return n.link.value.offsetStart&&(s.x+=a(n.link.value.offsetStart).x,s.y+=a(n.link.value.offsetStart).y),s}),r=I(()=>{const s=n.link.value.endNode.position;return n.link.value.offsetEnd&&(s.x+=a(n.link.value.offsetEnd).x,s.y+=a(n.link.value.offsetEnd).y),s});return(s,u)=>(C(),M("line",We({class:"link"},e.link,{class:{pulsing:e.link.pulsing},x1:a(i).x,y1:a(i).y,x2:a(r).x,y2:a(r).y}),null,16,as))}});var ss=ae(os,[["__scopeId","data-v-57c4970a"]]);const ls={key:0},us=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],cs=["fill","stroke-width","stroke"],ds=["fill"],gs=J({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const i=be(e),r=I(()=>te(i.nodeType.value.size,a(i.node))),s=I(()=>{var b;return(b=te(i.nodeType.value.outlineColor,a(i.node)))!=null?b:Be[re.theme].variables["--outline"]}),u=I(()=>{var b;return(b=te(i.nodeType.value.titleColor,a(i.node)))!=null?b:Be[re.theme].variables["--foreground"]}),o=I(()=>te(i.nodeType.value.actionDistance,a(i.node)));function c(b,v){t("clickAction",v.id),b.preventDefault(),b.stopPropagation()}function d(b,v){var w;((w=a(i.selectedAction))==null?void 0:w.id)===v.id&&(b.preventDefault(),b.stopPropagation())}return(b,v)=>(C(),X(xt,{name:"actions",appear:""},{default:B(()=>[e.isSelected&&e.actions?(C(),M("g",ls,[(C(!0),M(se,null,It(e.actions,(w,N)=>{var y,S;return C(),M("g",{key:w.id,class:ue(["action",{selected:((y=e.selectedAction)==null?void 0:y.id)===w.id}]),transform:`translate( - ${(-a(r)-30)*Math.sin(((e.actions.length-1)/2-N)*a(o))}, - ${(a(r)+30)*Math.cos(((e.actions.length-1)/2-N)*a(o))} - )`,onMousedown:T=>c(T,w),onTouchstart:T=>c(T,w),onMouseup:T=>d(T,w),onTouchend:St(T=>d(T,w),["stop"])},[p("circle",{fill:a(te)(w.fillColor,e.node),r:"20","stroke-width":((S=e.selectedAction)==null?void 0:S.id)===w.id?4:0,stroke:a(s)},null,8,cs),p("text",{fill:a(u),class:"material-icons"},K(a(te)(w.icon,e.node)),9,ds)],42,us)}),128))])):V("",!0)]),_:1}))}});var fs=ae(gs,[["__scopeId","data-v-9efb2a56"]]);const ms=["transform"],vs={key:0},ps=["r","fill","stroke"],hs=["r","fill","stroke"],bs=["r","fill"],ys=["r","stroke-dasharray","stroke-dashoffset","stroke"],_s={key:1,transform:"rotate(45, 0, 0)"},ws=["width","height","transform","fill","stroke"],Ns=["width","height","transform","fill","stroke"],Cs=["width","height","transform","fill"],ks=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],Ss=["fill","y"],xs=["fill"],Is={key:0},Ms=["fill","y"],Es=["fill","y"],$s=J({__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=be(n),s=I(()=>a(r.selectedNode)===a(r.node)),u=I(()=>te(r.nodeType.value.draggable,a(r.node)));Ve(u,Z=>{const fe=a(r.node);a(r.dragging)===fe&&!Z&&t("endDragging",fe)});const o=I(()=>{var fe;const Z=a(r.node);return(fe=te(r.nodeType.value.actions,Z))==null?void 0:fe.filter(Te=>tt(te(Te.visibility,Z)))}),c=I(()=>{var fe;const Z=a(r.node);if(te(r.nodeType.value.draggable,Z)&&((fe=a(r.dragging))==null?void 0:fe.id)===Z.id&&a(r.dragged)!=null){const{x:Te,y:De}=a(r.dragged);return{x:Z.position.x+Math.round(Te/25)*25,y:Z.position.y+Math.round(De/25)*25}}return Z.position}),d=I(()=>te(r.nodeType.value.shape,a(r.node))),b=I(()=>te(r.nodeType.value.title,a(r.node))),v=I(()=>te(r.nodeType.value.subtitle,a(r.node))),w=I(()=>{var Z;return(Z=s.value?a(r.selectedAction)&&te(a(r.selectedAction).tooltip,a(r.node)):null)!=null?Z:te(r.nodeType.value.label,a(r.node))}),N=I(()=>{var Z,fe;return te((fe=(Z=a(r.selectedAction))==null?void 0:Z.confirmationLabel)!=null?fe:{text:"Tap again to confirm"},a(r.node))}),y=I(()=>te(r.nodeType.value.size,a(r.node))),S=I(()=>{var Z;return(Z=te(r.nodeType.value.progress,a(r.node)))!=null?Z:0}),T=I(()=>Be[re.theme].variables["--background"]),L=I(()=>{var Z;return(Z=te(r.nodeType.value.outlineColor,a(r.node)))!=null?Z:Be[re.theme].variables["--outline"]}),x=I(()=>{var Z;return(Z=te(r.nodeType.value.fillColor,a(r.node)))!=null?Z:Be[re.theme].variables["--raised-background"]}),F=I(()=>te(r.nodeType.value.progressColor,a(r.node))),P=I(()=>{var Z;return(Z=te(r.nodeType.value.titleColor,a(r.node)))!=null?Z:Be[re.theme].variables["--foreground"]}),z=I(()=>te(r.nodeType.value.progressDisplay,a(r.node))),ie=I(()=>r.dragging.value!=null&&a(r.hasDragged)&&te(r.nodeType.value.canAccept,a(r.node),r.dragging.value)),ee=I(()=>te(r.nodeType.value.style,a(r.node))),Q=I(()=>te(r.nodeType.value.classes,a(r.node)));function we(Z){t("mouseDown",Z,r.node.value,u.value)}function W(Z){var fe,Te,De;(fe=r.hasDragged)!=null&&fe.value||(t("endDragging",r.node.value),(De=(Te=r.nodeType.value).onClick)==null||De.call(Te,r.node.value),Z.stopPropagation())}return(Z,fe)=>{var Te,De,$t;return C(),M("g",{class:ue(["boardnode",{[e.node.type]:!0,isSelected:a(s),isDraggable:a(u),...a(Q)}]),style:Le([{opacity:((Te=e.dragging)==null?void 0:Te.id)===e.node.id&&e.hasDragged?.5:1},(De=a(ee))!=null?De:[]]),transform:`translate(${a(c).x},${a(c).y})${a(s)?" scale(1.2)":""}`},[_(fs,{actions:($t=a(o))!=null?$t:[],"is-selected":a(s),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:fe[0]||(fe[0]=Re=>t("clickAction",Re))},null,8,["actions","is-selected","node","node-type","selected-action"]),p("g",{class:"node-container",onMousedown:we,onTouchstartPassive:we,onMouseup:W,onTouchendPassive:W},[a(d)===a(Ae).Circle?(C(),M("g",vs,[a(ie)?(C(),M("circle",{key:0,class:"receiver",r:a(y)+8,fill:a(T),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,ps)):V("",!0),p("circle",{class:"body",r:a(y),fill:a(x),stroke:a(L),"stroke-width":4},null,8,hs),a(z)===a(lt).Fill?(C(),M("circle",{key:1,class:"progress progressFill",r:Math.max(a(y)*a(S)-2,0),fill:a(F)},null,8,bs)):(C(),M("circle",{key:2,r:a(y)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(a(y)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(a(y)+4.5)*2*Math.PI-a(S)*(a(y)+4.5)*2*Math.PI,stroke:a(F)},null,8,ys))])):a(d)===a(Ae).Diamond?(C(),M("g",_s,[a(ie)?(C(),M("rect",{key:0,class:"receiver",width:a(y)*a(i)+16,height:a(y)*a(i)+16,transform:`translate(${-(a(y)*a(i)+16)/2}, ${-(a(y)*a(i)+16)/2})`,fill:a(T),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,ws)):V("",!0),p("rect",{class:"body",width:a(y)*a(i),height:a(y)*a(i),transform:`translate(${-a(y)*a(i)/2}, ${-a(y)*a(i)/2})`,fill:a(x),stroke:a(L),"stroke-width":4},null,8,Ns),a(z)===a(lt).Fill?(C(),M("rect",{key:1,class:"progress progressFill",width:Math.max(a(y)*a(i)*a(S)-2,0),height:Math.max(a(y)*a(i)*a(S)-2,0),transform:`translate(${-Math.max(a(y)*a(i)*a(S)-2,0)/2}, ${-Math.max(a(y)*a(i)*a(S)-2,0)/2})`,fill:a(F)},null,8,Cs)):(C(),M("rect",{key:2,class:"progress progressDiamond",width:a(y)*a(i)+9,height:a(y)*a(i)+9,transform:`translate(${-(a(y)*a(i)+9)/2}, ${-(a(y)*a(i)+9)/2})`,fill:"transparent","stroke-dasharray":(a(y)*a(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(a(y)*a(i)+9)*4-a(S)*(a(y)*a(i)+9)*4,stroke:a(F)},null,8,ks))])):V("",!0),p("text",{fill:a(P),class:"node-title",y:a(v)?10:0},K(a(b)),9,Ss),a(v)?(C(),M("text",{key:2,fill:a(P),class:"node-subtitle",y:"-15"},K(a(v)),9,xs)):V("",!0)],32),_(xt,{name:"fade",appear:""},{default:B(()=>{var Re;return[a(w)?(C(),M("g",Is,[p("text",{fill:(Re=a(w).color)!=null?Re:a(P),class:ue(["node-title",{pulsing:a(w).pulsing}]),y:-a(y)-20},K(a(w).text),11,Ms)])):V("",!0)]}),_:1}),_(xt,{name:"fade",appear:""},{default:B(()=>{var Re;return[a(s)&&e.selectedAction?(C(),M("text",{key:0,fill:(Re=a(N).color)!=null?Re:a(P),class:ue(["node-title",{pulsing:a(N).pulsing}]),y:a(y)+75},K(a(N).text),11,Es)):V("",!0)]}),_:1})],14,ms)}}});var Ts=ae($s,[["__scopeId","data-v-4654be02"]]);const Fs={class:"stage",width:"100%",height:"100%"},Ps={class:"g1"},Ds=J({__name:"Board",props:{nodes:null,types:null,state:null,visibility:null,width:null,height:null,style:null,classes:null,links:null,selectedAction:null,selectedNode:null,draggingNode:null,receivingNode:null,mousePosition:null,setReceivingNode:{type:Function},setDraggingNode:{type:Function}},setup(e){const n=be(e),i=A({x:0,y:0}),r=A({x:0,y:0}),s=A(!1),u=A(null),o=I(()=>{const N=n.nodes.value.slice();if(n.draggingNode.value){const y=N.splice(N.indexOf(n.draggingNode.value),1)[0];N.push(y)}return N});ze(()=>{const N=n.draggingNode.value;if(N==null)return null;const y={x:N.position.x+r.value.x,y:N.position.y+r.value.y};let S=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((T,L)=>{if(L.id===N.id)return T;const x=n.types.value[L.type];if(!te(x.canAccept,L,N))return T;const P=Math.pow(y.x-L.position.x,2)+Math.pow(y.y-L.position.y,2);let z=te(x.size,L);return P>S||P>z*z?T:(S=P,L)},null))});function c(N){N.setTransformOrigin(null),N.moveTo(u.value.$el.clientWidth/2,u.value.$el.clientHeight/2)}function d(N,y=null,S=!1){if(n.draggingNode.value==null){N.preventDefault(),N.stopPropagation();let T,L;if("touches"in N)if(N.touches.length===1)T=N.touches[0].clientX,L=N.touches[0].clientY;else return;else T=N.clientX,L=N.clientY;i.value={x:T,y:L},r.value={x:0,y:0},s.value=!1,S&&n.setDraggingNode.value(y)}y!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function b(N){const{x:y,y:S,scale:T}=u.value.panZoomInstance.getTransform();let L,x;if("touches"in N)if(N.touches.length===1)L=N.touches[0].clientX,x=N.touches[0].clientY;else{v(n.draggingNode.value),n.mousePosition.value=null;return}else L=N.clientX,x=N.clientY;n.mousePosition.value={x:(L-y)/T,y:(x-S)/T},r.value={x:r.value.x+(L-i.value.x)/T,y:r.value.y+(x-i.value.y)/T},i.value={x:L,y:x},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(s.value=!0),n.draggingNode.value!=null&&(N.preventDefault(),N.stopPropagation())}function v(N){var y,S;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 T=n.nodes.value;T.push(T.splice(T.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((S=(y=n.types.value[n.receivingNode.value.type]).onDrop)==null||S.call(y,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else s.value||(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function w(N,y){n.state.value.selectedAction===y?a(n.selectedAction).onClick(a(n.selectedNode)):n.state.value={...n.state.value,selectedAction:y}}return(N,y)=>{const S=Ht("panZoom");return a(tt)(e.visibility)?(C(),X(S,{key:0,style:Le([{width:e.width,height:e.height},e.style]),class:ue(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:u,onInit:c,onMousemove:b,onTouchmove:b,onMousedown:y[0]||(y[0]=T=>d(T)),onTouchstart:y[1]||(y[1]=T=>d(T)),onMouseup:y[2]||(y[2]=()=>v(a(e.draggingNode))),onTouchendPassive:y[3]||(y[3]=()=>v(a(e.draggingNode))),onMouseleave:y[4]||(y[4]=()=>v(a(e.draggingNode)))},{default:B(()=>[(C(),M("svg",Fs,[p("g",Ps,[_(xn,{name:"link",appear:""},{default:B(()=>[(C(!0),M(se,null,It(a(e.links)||[],T=>(C(),M("g",{key:`${T.startNode.id}-${T.endNode.id}`},[_(ss,{link:T},null,8,["link"])]))),128))]),_:1}),_(xn,{name:"grow",duration:500,appear:""},{default:B(()=>[(C(!0),M(se,null,It(a(o),T=>{var L;return C(),M("g",{key:T.id,style:{"transition-duration":"0s"}},[_(Ts,{node:T,nodeType:e.types[T.type],dragging:a(e.draggingNode),dragged:a(e.draggingNode)===T?r.value:void 0,hasDragged:s.value,receivingNode:((L=a(e.receivingNode))==null?void 0:L.id)===T.id,selectedNode:a(e.selectedNode),selectedAction:a(e.selectedAction),onMouseDown:d,onEndDragging:v,onClickAction:x=>w(T,x)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","selectedNode","selectedAction","onClickAction"])])}),128))]),_:1})])]))]),_:1},8,["style","class","options"])):V("",!0)}}});Ie.on("setupVue",e=>Ai.install(e));const ui=Symbol("Board");var lt=(e=>(e.Outline="Outline",e.Fill="Fill",e))(lt||{}),Ae=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(Ae||{});function As(e){const t=zt({nodes:[],selectedNode:null,selectedAction:null},!1);return Mt(n=>{const i=e.call(n,n);i.id=Hn("board-"),i.type=ui,i[qt]=Ds,i.state?(ta(t),q(i,"state")):(t[Rt]={nodes:i.startNodes().map((o,c)=>(o.id=c,o)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=I(()=>a(u.state).nodes),i.selectedNode=I({get(){return u.nodes.value.find(o=>o.id===a(u.state).selectedNode)||null},set(o){var c,d;me(u.state)?u.state.value={...u.state.value,selectedNode:(c=o==null?void 0:o.id)!=null?c:null}:u.state.selectedNode=(d=o==null?void 0:o.id)!=null?d:null}}),i.selectedAction=I({get(){const o=u.selectedNode.value;if(o==null)return null;const c=u.types[o.type];return c.actions==null?null:c.actions.find(d=>d.id===a(u.state).selectedAction)||null},set(o){var c,d;me(u.state)?u.state.value={...u.state.value,selectedAction:(c=o==null?void 0:o.id)!=null?c:null}:u.state.selectedAction=(d=o==null?void 0:o.id)!=null?d:null}}),i.mousePosition=A(null),i.links?q(i,"links"):i.links=I(()=>u.selectedAction.value==null?null:u.selectedAction.value.links&&u.selectedNode.value?te(u.selectedAction.value.links,u.selectedNode.value):null),i.draggingNode=A(null),i.receivingNode=A(null),q(i,"visibility"),ve(i,"visibility",Ge.Visible),q(i,"width"),ve(i,"width","100%"),q(i,"height"),ve(i,"height","100%"),q(i,"classes"),q(i,"style");for(const o in i.types){const c=i.types[o];if(q(c,"title"),q(c,"subtitle"),q(c,"label"),q(c,"size"),ve(c,"size",50),q(c,"style"),q(c,"classes"),q(c,"draggable"),ve(c,"draggable",!1),q(c,"shape"),ve(c,"shape","Circle"),q(c,"canAccept"),ve(c,"canAccept",!1),q(c,"progress"),q(c,"progressDisplay"),ve(c,"progressDisplay","Fill"),q(c,"progressColor"),ve(c,"progressColor","none"),q(c,"fillColor"),q(c,"outlineColor"),q(c,"titleColor"),q(c,"actionDistance"),ve(c,"actionDistance",Math.PI/6),c.nodes=I(()=>a(u.state).nodes.filter(d=>d.type===o)),ve(c,"onClick",function(d){a(u.state).selectedNode=d.id}),c.actions)for(const d of c.actions)q(d,"visibility"),ve(d,"visibility",Ge.Visible),q(d,"icon"),q(d,"fillColor"),q(d,"tooltip"),q(d,"confirmationLabel"),ve(d,"confirmationLabel",{text:"Tap again to confirm"}),q(d,"links")}function r(o){i.draggingNode.value=o}function s(o){i.receivingNode.value=o}i.placeInAvailableSpace=function(o,c=100,d=j.Right){const b=u.nodes.value.slice().filter(v=>v===o||(d===j.Down||d===j.Up)&&Math.abs(v.position.x-o.position.x)>c||(d===j.Left||d===j.Right)&&Math.abs(v.position.y-o.position.y)>c?!1:!(d===j.Right&&v.position.xo.position.x+c||d===j.Up&&v.position.y>o.position.y+c||d===j.Down&&v.position.yv.position.x-w.position.x:d===j.Left?(v,w)=>w.position.x-v.position.x:d===j.Up?(v,w)=>w.position.y-v.position.y:(v,w)=>v.position.y-w.position.y);for(let v=0;v0&&N>c)break}},i[en]=function(){const{nodes:o,types:c,state:d,visibility:b,width:v,height:w,style:N,classes:y,links:S,selectedAction:T,selectedNode:L,mousePosition:x,draggingNode:F,receivingNode:P}=this;return{nodes:o,types:c,state:d,visibility:b,width:v,height:w,style:a(N),classes:y,links:S,selectedAction:T,selectedNode:L,mousePosition:x,draggingNode:F,receivingNode:P,setDraggingNode:r,setReceivingNode:s}};const u=i;return u})}function te(e,t,...n){return Jt(e)?e(t,...n):a(e)}function Pn(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const At={};Ie.on("addLayer",e=>{const t=Dr(e,ui);At[e.id]=e.on("postUpdate",n=>{t.forEach(i=>{Object.values(i.types).forEach(r=>r.nodes.value.forEach(s=>{var u;return(u=r.update)==null?void 0:u.call(r,s,n)}))})})});Ie.on("removeLayer",e=>{var t;(t=At[e.id])==null||t.call(At),At[e.id]=void 0});function Os(e,t="points",n=0,i=void 0){const r=me(e)?e:zt(e);if(r.displayName=t,r.precision=n,r.small=i,!me(e)){const s=r[Xe];s.displayName=t,s.precision=n,s.small=i}return r}new l("10^^8");new l("1e100");Ie.on("setupVue",e=>e.use(Oi));function Vs(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 Ls=J({props:{visibility:{type:U(Number,Boolean),required:!0},display:{type:U(Object,String,Function),required:!0},style:U(String,Object,Array),classes:U(Object),glowColor:U(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=be(e),s=Kn(n),u=I(()=>{const c=Se(i);return c==null||c===""?{}:a(r)?Vs(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function o(){t("selectTab")}return{selectTab:o,component:s,glowColorStyle:u,unref:a,Visibility:Ge,isVisible:tt,isHidden:tn}}});function qs(e,t,n,i,r,s){var u;return e.isVisible(e.visibility)?(C(),M("button",{key:0,onClick:t[0]||(t[0]=(...o)=>e.selectTab&&e.selectTab(...o)),class:ue(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(u=e.unref(e.style))!=null?u:{}])},[(C(),X(Ee(e.component)))],6)):V("",!0)}var ci=ae(Ls,[["render",qs],["__scopeId","data-v-21427abb"]]);const Bs=J({props:{visibility:{type:U(Number,Boolean),required:!0},activeTab:{type:U(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:U(Object),required:!0},style:U(String,Object,Array),classes:U(Object),buttonContainerStyle:U(String,Object,Array),buttonContainerClasses:U(Object)},components:{Sticky:li,TabButton:ci},setup(e){const{activeTab:t}=be(e),n=I(()=>Be[re.theme].floatingTabs),i=Oe("");ze(()=>{const o=Se(t);if(o==null){i.value="";return}if(ct(o)){i.value=_e(o);return}i.value=_e(a(o.display))});const r=I(()=>{const o=Se(t);return ct(o)||!o?void 0:a(o.classes)}),s=I(()=>{const o=Se(t);return ct(o)||!o?void 0:a(o.style)});function u(o){const{display:c,style:d,classes:b,glowColor:v,visibility:w}=o;return{display:c,style:a(d),classes:b,glowColor:v,visibility:w}}return{floating:n,tabClasses:r,tabStyle:s,Visibility:Ge,component:i,gatherButtonProps:u,unref:a,isVisible:tt,isHidden:tn}}});function Rs(e,t,n,i,r,s){var c,d;const u=Ht("TabButton"),o=Ht("Sticky");return e.isVisible(e.visibility)?(C(),M("div",{key:0,class:ue(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(d=e.tabStyle)!=null?d:[]])},[_(o,{class:ue(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:Le(e.unref(e.buttonContainerStyle))},{default:B(()=>[p("div",{class:ue(["tab-buttons",{floating:e.floating}])},[(C(!0),M(se,null,It(e.unref(e.tabs),(b,v)=>(C(),X(u,We({onSelectTab:w=>e.selected.value=v,floating:e.floating,key:v,active:e.unref(b.tab)===e.unref(e.activeTab)},e.gatherButtonProps(b)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(C(),X(Ee(e.unref(e.component)),{key:0})):V("",!0)],6)):V("",!0)}var Us=ae(Bs,[["render",Rs],["__scopeId","data-v-58dbf83a"]]);const zs=Symbol("TabButton"),js=Symbol("TabFamily");function Ws(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=zt(Object.keys(e)[0],!1);return Mt(i=>{var u;const r=(u=t==null?void 0:t.call(i,i))!=null?u:{};r.id=Hn("tabFamily-"),r.type=js,r[qt]=Us,r.tabs=Object.keys(e).reduce((o,c)=>{const d=e[c]();return d.type=zs,d[qt]=ci,q(d,"visibility"),ve(d,"visibility",Ge.Visible),q(d,"tab"),q(d,"display"),q(d,"classes"),q(d,"style"),q(d,"glowColor"),o[c]=d,o},{}),r.selected=n,r.activeTab=I(()=>{const o=a(s.tabs);if(n.value in o&&tt(o[n.value].visibility))return a(o[n.value].tab);const c=Object.values(o).find(d=>tt(d.visibility));return c?a(c.tab):null}),q(r,"visibility"),ve(r,"visibility",Ge.Visible),q(r,"classes"),q(r,"style"),q(r,"buttonContainerClasses"),q(r,"buttonContainerStyle"),r[en]=function(){const{visibility:o,activeTab:c,selected:d,tabs:b,style:v,classes:w,buttonContainerClasses:N,buttonContainerStyle:y}=this;return{visibility:o,activeTab:c,selected:d,tabs:b,style:a(v),classes:w,buttonContainerClasses:N,buttonContainerStyle:y}};const s=r;return s})}const di=l.ln(10);function Ot(e){return e}function Gs(e,t){if(E(t))return t.invert(l.neg(e));throw new Error("Could not invert due to no input being a variable")}function Hs(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return g.neg(t.getIntegralFormula(e))}throw new Error("Could not integrate due to no input being a variable")}function Zs(e){return g.neg(e)}function Ys(e,t,n){if(E(t))return t.invert(l.sub(e,ce(n)));if(E(n))return n.invert(l.sub(e,ce(t)));throw new Error("Could not invert due to no input being a variable")}function Js(e,t,n){var i,r;if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const s=t.getIntegralFormula(e);return g.times(n,(i=t.innermostVariable)!=null?i:0).add(s)}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const s=n.getIntegralFormula(e);return g.times(t,(r=n.innermostVariable)!=null?r:0).add(s)}throw new Error("Could not integrate due to no input being a variable")}function Ks(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return g.add(i,n)}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return g.add(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Xs(e,t,n){if(E(t))return t.invert(l.add(e,ce(n)));if(E(n))return n.invert(l.sub(ce(t),e));throw new Error("Could not invert due to no input being a variable")}function Qs(e,t,n){var i,r;if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const s=t.getIntegralFormula(e);return g.sub(s,g.times(n,(i=t.innermostVariable)!=null?i:0))}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const s=n.getIntegralFormula(e);return g.times(t,(r=n.innermostVariable)!=null?r:0).sub(s)}throw new Error("Could not integrate due to no input being a variable")}function el(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return g.sub(i,n)}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return g.sub(i,t)}throw new Error("Could not integrate due to no input being a variable")}function tl(e,t,n){if(E(t))return t.invert(l.div(e,ce(n)));if(E(n))return n.invert(l.div(e,ce(t)));throw new Error("Could not invert due to no input being a variable")}function nl(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return g.times(i,n)}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return g.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function il(e,t,n){if(E(t))return g.div(e,n);if(E(n))return g.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function rl(e,t,n){if(E(t))return t.invert(l.mul(e,ce(n)));if(E(n))return n.invert(l.div(ce(t),e));throw new Error("Could not invert due to no input being a variable")}function al(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return g.div(i,n)}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return g.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function ol(e,t,n){if(E(t))return g.mul(e,n);if(E(n))return g.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function sl(e,t){if(E(t))return t.invert(l.recip(e));throw new Error("Could not invert due to no input being a variable")}function ll(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function ul(e,t){if(E(t))return t.invert(l.pow10(e));throw new Error("Could not invert due to no input being a variable")}function cl(e){return l.ln(e).sub(1).times(e).div(di)}function dl(e,t){if(E(t)){const n=di.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 gl(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:cl,invert:dl})}throw new Error("Could not integrate due to no input being a variable")}function fl(e,t,n){if(E(t))return t.invert(l.pow(ce(n),e));if(E(n))return n.invert(l.root(ce(t),e));throw new Error("Could not invert due to no input being a variable")}function ml(e,t){return l.ln(e).sub(1).times(e).div(l.ln(t))}function vl(e,t,n){if(E(t)){const i=l.ln(ce(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 pl(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e),n],evaluate:ml,invert:vl})}throw new Error("Could not integrate due to no input being a variable")}function hl(e,t){if(E(t))return t.invert(l.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function bl(e){return l.ln(e).sub(1).times(e).div(l.ln(2))}function yl(e,t){if(E(t)){const n=l.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 _l(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:bl,invert:yl})}throw new Error("Could not integrate due to no input being a variable")}function wl(e,t){if(E(t))return t.invert(l.exp(e));throw new Error("Could not invert due to no input being a variable")}function Nl(e){return l.ln(e).sub(1).times(e)}function Cl(e,t){if(E(t))return t.invert(l.div(e,l.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function kl(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:Nl,invert:Cl})}throw new Error("Could not integrate due to no input being a variable")}function Sl(e,t,n){if(E(t))return t.invert(l.root(e,ce(n)));if(E(n))return n.invert(l.ln(e).div(l.ln(ce(t))));throw new Error("Could not invert due to no input being a variable")}function xl(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e),r=g.add(n,1);return g.pow(i,r).div(r)}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return g.pow(t,i).div(g.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function Il(e,t){if(E(t))return t.invert(l.root(e,10));throw new Error("Could not invert due to no input being a variable")}function Ml(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.pow10(n).div(g.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function El(e,t,n){if(E(t))return t.invert(l.ln(e).div(ce(n)));if(E(n))return n.invert(l.root(ce(t),e));throw new Error("Could not invert due to no input being a variable")}function $l(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return g.pow(n,i).div(g.ln(n))}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e),r=g.add(t,1);return g.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function Tl(e,t,n){if(E(t))return t.invert(l.root(e,l.recip(ce(n))));if(E(n))return n.invert(l.ln(ce(t)).div(l.ln(e)));throw new Error("Could not invert due to no input being a variable")}function Fl(e,t,n){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return g.pow(i,g.recip(n).add(1)).times(n).div(g.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function Pl(e,t){if(E(t))return t.invert(l.ln(e));throw new Error("Could not invert due to no input being a variable")}function Dl(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function Al(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){const i=l.minabs(t,1e308).toNumber();return l.tetrate(e,i,n)}function Ol(e,t,n,i){if(E(t))return t.invert(l.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function Vl(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){const i=l.minabs(t,1e308).toNumber();return l.iteratedexp(e,i,new l(n))}function Ll(e,t,n,i){if(E(t))return t.invert(l.iteratedlog(e,Math.E,l.minabs(1e308,ce(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function ql(e,t=10,n=2){const i=l.minabs(n,1e308).toNumber();return l.iteratedlog(e,t,i)}function Bl(e,t=10){const n=l.minabs(t,1e308).toNumber();return l.slog(e,n)}function Rl(e,t,n){if(E(t))return t.invert(l.tetrate(e,l.minabs(1e308,ce(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Ul(e,t,n){const i=l.minabs(t,1e308).toNumber();return l.layeradd(e,i,n)}function zl(e,t,n,i){if(E(t))return t.invert(l.layeradd(e,l.minabs(1e308,ce(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function jl(e,t){if(E(t))return t.invert(l.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function Wl(e,t){if(E(t))return t.invert(l.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function Gl(e,t,n){const i=l.minabs(t,1e308).toNumber();return l.pentate(e,i,n)}function Hl(e,t){if(E(t))return t.invert(l.asin(e));throw new Error("Could not invert due to no input being a variable")}function Zl(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function Yl(e,t){if(E(t))return t.invert(l.acos(e));throw new Error("Could not invert due to no input being a variable")}function Jl(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function Kl(e,t){if(E(t))return t.invert(l.atan(e));throw new Error("Could not invert due to no input being a variable")}function Xl(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function Ql(e,t){if(E(t))return t.invert(l.sin(e));throw new Error("Could not invert due to no input being a variable")}function eu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.asin(n).times(n).add(g.sqrt(g.sub(1,g.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function tu(e,t){if(E(t))return t.invert(l.cos(e));throw new Error("Could not invert due to no input being a variable")}function nu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.acos(n).times(n).sub(g.sqrt(g.sub(1,g.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function iu(e,t){if(E(t))return t.invert(l.tan(e));throw new Error("Could not invert due to no input being a variable")}function ru(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.atan(n).times(n).sub(g.ln(g.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function au(e,t){if(E(t))return t.invert(l.asinh(e));throw new Error("Could not invert due to no input being a variable")}function ou(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function su(e,t){if(E(t))return t.invert(l.acosh(e));throw new Error("Could not invert due to no input being a variable")}function lu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function uu(e,t){if(E(t))return t.invert(l.atanh(e));throw new Error("Could not invert due to no input being a variable")}function cu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function du(e,t){if(E(t))return t.invert(l.sinh(e));throw new Error("Could not invert due to no input being a variable")}function gu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.asinh(n).times(n).sub(g.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function fu(e,t){if(E(t))return t.invert(l.cosh(e));throw new Error("Could not invert due to no input being a variable")}function mu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.acosh(n).times(n).sub(g.add(n,1).sqrt().times(g.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function vu(e,t){if(E(t))return t.invert(l.tanh(e));throw new Error("Could not invert due to no input being a variable")}function pu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.atanh(n).times(n).add(g.sub(1,g.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function Et(e){return(t,n)=>new g({inputs:[t,n],evaluate:e,invert:Ot})}function E(e){return e instanceof le&&e.hasVariable()}function ce(e,t){return e instanceof le?e.evaluate(t):a(e)}function hu(){return g.pow(this,2).div(2)}function bu(){return this}const ge=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"&&Xe in n?n[Xe]:n)),"variable"in e?(typeof e.variable=="object"&&Xe in e.variable&&(e.variable=e.variable[Xe]),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:hu,internalIntegrateInner:bu,applySubstitution:Ot}}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){const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:s,applySubstitution:u}=e,o=t.reduce((b,v)=>b+(v instanceof ge?v.internalVariables:0),0),c=t.find(b=>b instanceof ge&&b.hasVariable()),d=o===1?c==null?void 0:c.innermostVariable:void 0;return{inputs:t,internalEvaluate:n,internalInvert:i,internalIntegrate:r,internalIntegrateInner:s,applySubstitution:u,innermostVariable:d,internalVariables:o}}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=>ce(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:ce(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof ge&&e.inputs[n]instanceof ge?t.equals(e.inputs[n]):!(t instanceof ge)&&!(e.inputs[n]instanceof ge)&&l.eq(a(t),a(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new g({inputs:[e]})}static variable(e){return new g({variable:e})}static step(e,t,n){const i=A(0),r=n(g.variable(i)),s=Ce(t);function u(c){return l.lt(c,a(s))?c:(i.value=l.sub(c,a(s)),l.add(r.evaluate(),a(s)))}function o(c,d){if(E(d)&&r.isInvertible())return l.gt(c,a(s))&&(c=l.add(r.invert(l.sub(c,a(s))),a(s))),d.invert(c);throw new Error("Could not invert due to no input being a variable")}return new g({inputs:[e],evaluate:u,invert:r.isInvertible()&&r.hasVariable()?o:void 0})}static if(e,t,n,i){const r=A(0),s=g.variable(r),u=n(s),o=i==null?void 0:i(s),c=Ce(t);function d(v){return a(c)?(r.value=v,u.evaluate()):o?(r.value=v,o.evaluate()):v}function b(v,w){if(!E(w)||!u.isInvertible()||o!=null&&!o.isInvertible())throw new Error("Could not invert due to no input being a variable");return a(c)?w.invert(u.invert(v)):o?w.invert(o.invert(v)):w.invert(v)}return new g({inputs:[e],evaluate:d,invert:u.isInvertible()&&u.hasVariable()?b:void 0})}static conditional(e,t,n,i){return g.if(e,t,n,i)}static abs(e){return new g({inputs:[e],evaluate:l.abs})}static neg(e){return new g({inputs:[e],evaluate:l.neg,invert:Gs,applySubstitution:Zs,integrate:Hs})}static sign(e){return new g({inputs:[e],evaluate:l.sign})}static round(e){return new g({inputs:[e],evaluate:l.round})}static floor(e){return new g({inputs:[e],evaluate:l.floor})}static ceil(e){return new g({inputs:[e],evaluate:l.ceil})}static trunc(e){return new g({inputs:[e],evaluate:l.trunc})}static add(e,t){return new g({inputs:[e,t],evaluate:l.add,invert:Ys,integrate:Js,integrateInner:Ks,applySubstitution:Ot})}static sub(e,t){return new g({inputs:[e,t],evaluate:l.sub,invert:Xs,integrate:Qs,integrateInner:el,applySubstitution:Ot})}static mul(e,t){return new g({inputs:[e,t],evaluate:l.mul,invert:tl,integrate:nl,applySubstitution:il})}static div(e,t){return new g({inputs:[e,t],evaluate:l.div,invert:rl,integrate:al,applySubstitution:ol})}static recip(e){return new g({inputs:[e],evaluate:l.recip,invert:sl,integrate:ll})}static clamp(e,t,n){return new g({inputs:[e,t,n],evaluate:l.clamp,invert:Ot})}static pLog10(e){return new g({inputs:[e],evaluate:l.pLog10})}static absLog10(e){return new g({inputs:[e],evaluate:l.absLog10})}static log10(e){return new g({inputs:[e],evaluate:l.log10,invert:ul,integrate:gl})}static log(e,t){return new g({inputs:[e,t],evaluate:l.log,invert:fl,integrate:pl})}static log2(e){return new g({inputs:[e],evaluate:l.log2,invert:hl,integrate:_l})}static ln(e){return new g({inputs:[e],evaluate:l.ln,invert:wl,integrate:kl})}static pow(e,t){return new g({inputs:[e,t],evaluate:l.pow,invert:Sl,integrate:xl})}static pow10(e){return new g({inputs:[e],evaluate:l.pow10,invert:Il,integrate:Ml})}static pow_base(e,t){return new g({inputs:[e,t],evaluate:l.pow_base,invert:El,integrate:$l})}static root(e,t){return new g({inputs:[e,t],evaluate:l.root,invert:Tl,integrate:Fl})}static factorial(e){return new g({inputs:[e],evaluate:l.factorial})}static gamma(e){return new g({inputs:[e],evaluate:l.gamma})}static lngamma(e){return new g({inputs:[e],evaluate:l.lngamma})}static exp(e){return new g({inputs:[e],evaluate:l.exp,invert:Pl,integrate:Dl})}static sqr(e){return g.pow(e,2)}static sqrt(e){return g.root(e,2)}static cube(e){return g.pow(e,3)}static cbrt(e){return g.root(e,3)}static tetrate(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:Al,invert:Ol})}static iteratedexp(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:Vl,invert:Ll})}static iteratedlog(e,t=10,n=1){return new g({inputs:[e,t,n],evaluate:ql})}static slog(e,t=10){return new g({inputs:[e,t],evaluate:Bl,invert:Rl})}static layeradd10(e,t){return new g({inputs:[e,t],evaluate:l.layeradd10})}static layeradd(e,t,n=10){return new g({inputs:[e,t,n],evaluate:Ul,invert:zl})}static lambertw(e){return new g({inputs:[e],evaluate:l.lambertw,invert:jl})}static ssqrt(e){return new g({inputs:[e],evaluate:l.ssqrt,invert:Wl})}static pentate(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:Gl})}static sin(e){return new g({inputs:[e],evaluate:l.sin,invert:Ql,integrate:Zl})}static cos(e){return new g({inputs:[e],evaluate:l.cos,invert:tu,integrate:Jl})}static tan(e){return new g({inputs:[e],evaluate:l.tan,invert:iu,integrate:Xl})}static asin(e){return new g({inputs:[e],evaluate:l.asin,invert:Hl,integrate:eu})}static acos(e){return new g({inputs:[e],evaluate:l.acos,invert:Yl,integrate:nu})}static atan(e){return new g({inputs:[e],evaluate:l.atan,invert:Kl,integrate:ru})}static sinh(e){return new g({inputs:[e],evaluate:l.sinh,invert:du,integrate:ou})}static cosh(e){return new g({inputs:[e],evaluate:l.cosh,invert:fu,integrate:lu})}static tanh(e){return new g({inputs:[e],evaluate:l.tanh,invert:vu,integrate:cu})}static asinh(e){return new g({inputs:[e],evaluate:l.asinh,invert:au,integrate:gu})}static acosh(e){return new g({inputs:[e],evaluate:l.acosh,invert:su,integrate:mu})}static atanh(e){return new g({inputs:[e],evaluate:l.atanh,invert:uu,integrate:pu})}step(e,t){return g.step(this,e,t)}if(e,t){return g.if(this,e,t)}conditional(e,t){return g.if(this,e,t)}abs(){return g.abs(this)}neg(){return g.neg(this)}sign(){return g.sign(this)}round(){return g.round(this)}floor(){return g.floor(this)}ceil(){return g.ceil(this)}trunc(){return g.trunc(this)}add(e){return g.add(this,e)}sub(e){return g.sub(this,e)}mul(e){return g.mul(this,e)}div(e){return g.div(this,e)}recip(){return g.recip(this)}max(e){return g.max(this,e)}min(e){return g.min(this,e)}maxabs(e){return g.maxabs(this,e)}minabs(e){return g.minabs(this,e)}clamp(e,t){return g.clamp(this,e,t)}clampMin(e){return g.clampMin(this,e)}clampMax(e){return g.clampMax(this,e)}pLog10(){return g.pLog10(this)}absLog10(){return g.absLog10(this)}log10(){return g.log10(this)}log(e){return g.log(this,e)}log2(){return g.log2(this)}ln(){return g.ln(this)}pow(e){return g.pow(this,e)}pow10(){return g.pow10(this)}pow_base(e){return g.pow_base(this,e)}root(e){return g.root(this,e)}factorial(){return g.factorial(this)}gamma(){return g.gamma(this)}lngamma(){return g.lngamma(this)}exp(){return g.exp(this)}sqr(){return g.pow(this,2)}sqrt(){return g.root(this,2)}cube(){return g.pow(this,3)}cbrt(){return g.root(this,3)}tetrate(e=2,t=l.fromComponents_noNormalize(1,0,1)){return g.tetrate(this,e,t)}iteratedexp(e=2,t=l.fromComponents_noNormalize(1,0,1)){return g.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return g.iteratedlog(this,e,t)}slog(e=10){return g.slog(this,e)}layeradd10(e){return g.layeradd10(this,e)}layeradd(e,t){return g.layeradd(this,e,t)}lambertw(){return g.lambertw(this)}ssqrt(){return g.ssqrt(this)}pentate(e=2,t=l.fromComponents_noNormalize(1,0,1)){return g.pentate(this,e,t)}sin(){return g.sin(this)}cos(){return g.cos(this)}tan(){return g.tan(this)}asin(){return g.asin(this)}acos(){return g.acos(this)}atan(){return g.atan(this)}sinh(){return g.sinh(this)}cosh(){return g.cosh(this)}tanh(){return g.tanh(this)}asinh(){return g.asinh(this)}acosh(){return g.acosh(this)}atanh(){return g.atanh(this)}};let le=ge;le.negate=ge.neg;le.negated=ge.neg;le.sgn=ge.sign;le.plus=ge.add;le.subtract=ge.sub;le.minus=ge.sub;le.multiply=ge.mul;le.times=ge.mul;le.divide=ge.div;le.divideBy=ge.div;le.dividedBy=ge.div;le.reciprocal=ge.recip;le.reciprocate=ge.recip;le.max=Et(l.max);le.min=Et(l.min);le.minabs=Et(l.minabs);le.maxabs=Et(l.maxabs);le.clampMin=Et(l.clampMin);le.clampMax=Et(l.clampMax);le.logarithm=ge.log;class g extends le{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=l.add(this.evaluate(0),this.evaluate(1)).div(2);return l.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 ln(e,t,n=!0,i){var s,u,o;let r=l.add(t,(s=a(e.innermostVariable))!=null?s: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=a(e.innermostVariable))!=null?u:0);let d=l.sub(e.evaluateIntegral(r),e.evaluateIntegral());if(c.gt(1e308))return d.add(l.sub(c,r).times(e.evaluate(r)));for(let b=r.toNumber();b{const{addend:n,description:i,enabled:r,smallerIsBetter:s}=e.call(t,t),u=Ce(n),o=Ce(i),c=r==null?void 0:Ce(r);return{apply:d=>l.add(d,a(u)),invert:d=>l.sub(d,a(u)),getFormula:d=>g.add(d,u),enabled:c,description:i==null?void 0:oe(()=>_("div",{class:"modifier-container"},[a(o)!=null?_("span",{class:"modifier-description"},[je(a(o))]):null,_("span",{class:"modifier-amount",style:(s===!0?l.gt(a(u),0):l.lt(a(u),0))?"color: var(--danger)":""},[l.gte(a(u),0)?"+":"",ut(a(u))])]))}})}function Ft(e){return Mt(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:s}=e.call(t,t),u=Ce(n),o=Ce(i),c=r==null?void 0:Ce(r);return{apply:d=>l.times(d,a(u)),invert:d=>l.div(d,a(u)),getFormula:d=>g.times(d,u),enabled:c,description:i==null?void 0:oe(()=>_("div",{class:"modifier-container"},[a(o)!=null?_("span",{class:"modifier-description"},[je(a(o))]):null,_("span",{class:"modifier-amount",style:(s===!0?l.gt(a(u),1):l.lt(a(u),1))?"color: var(--danger)":""},[O("\xD7"),ut(a(u))])]))}})}function Pt(e){return Mt(()=>{const t=e();return{apply:n=>t.filter(i=>a(i.enabled)!==!1).reduce((i,r)=>r.apply(i),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(i=>a(i.enabled)!==!1).reduceRight((i,r)=>r.invert(i),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(i=>a(i.enabled)!==!1).reduce((i,r)=>r.getFormula(i),n):void 0,enabled:t.some(n=>n.enabled!=null)?I(()=>t.filter(n=>a(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?oe(()=>_(se,null,[t.filter(n=>a(n.enabled)!==!1).map(n=>a(n.description)).filter(n=>n).map(je)])):void 0}})}const yu={key:0},_u={key:0,class:"mark star"},wu=["src"],Nu=J({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(C(),M("div",yu,[e.mark===!0?(C(),M("div",_u)):(C(),M("img",{key:1,class:"mark",src:e.mark},null,8,wu))])):V("",!0)}});var gi=ae(Nu,[["__scopeId","data-v-2207999f"]]);const Cu=J({__name:"Node",props:{id:null},setup(e){const n=be(e),i=Zt(mn,()=>{}),r=Zt(vn,()=>{}),s=Oe(null),u=I(()=>s.value&&s.value.parentElement);return Ve([u,n.id],([o,c],[d,b])=>{d&&r(a(b)),o&&i(c,o)}),Ln(()=>r(a(n.id))),(o,c)=>(C(),M("div",{class:"node",ref_key:"node",ref:s},null,512))}});var fi=ae(Cu,[["__scopeId","data-v-a48cb382"]]);J({props:{display:{type:U(Object,String,Function),required:!0},visibility:{type:U(Number,Boolean),required:!0},style:U(Object,String,Array),classes:U(Object),onClick:Function,onHold:Function,canClick:{type:U(Boolean),required:!0},small:Boolean,mark:U(Boolean,String),id:{type:String,required:!0}},components:{Node:fi,MarkNode:gi},setup(e){const{display:t,onClick:n,onHold:i}=be(e),r=Oe("");ze(()=>{var b;const o=Se(t);if(o==null){r.value="";return}if(ct(o)){r.value=_e(o);return}const c=_e((b=o.title)!=null?b:"","h3"),d=_e(o.description,"div");r.value=_e(oe(()=>_("span",null,[o.title!=null?_("div",null,[_(c,null,null)]):null,_(d,null,null)])))});const{start:s,stop:u}=Jn(n,i);return{start:s,stop:u,comp:r,Visibility:Ge,isVisible:tt,isHidden:tn,unref:a}}});const ku=["x1","y1","x2","y2"],Su=J({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=be(e),i=I(()=>{const s=n.startNode.value.rect,u=n.boundingRect.value,o=u?{x:s.x+s.width/2-u.x,y:s.y+s.height/2-u.y}:{x:0,y:0};return n.link.value.offsetStart&&(o.x+=n.link.value.offsetStart.x,o.y+=n.link.value.offsetStart.y),o}),r=I(()=>{const s=n.endNode.value.rect,u=n.boundingRect.value,o=u?{x:s.x+s.width/2-u.x,y:s.y+s.height/2-u.y}:{x:0,y:0};return n.link.value.offsetEnd&&(o.x+=n.link.value.offsetEnd.x,o.y+=n.link.value.offsetEnd.y),o});return(s,u)=>(C(),M("line",We({"stroke-width":"15px",stroke:"white"},e.link,{x1:a(i).x,y1:a(i).y,x2:a(r).x,y2:a(r).y}),null,16,ku))}});const xu=J({__name:"Links",props:{links:null},setup(e){var c;const n=et(e,"links"),i=A(null),r=Zt(pn,A({})),s=Zt(hn,A(void 0)),u=A((c=i.value)==null?void 0:c.getBoundingClientRect());Ve(s,()=>{var d;return u.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),Qt(()=>{var d;return u.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const o=I(()=>{var b,v;const d=r.value;return(v=(b=n.value)==null?void 0:b.filter(w=>{var N,y;return((N=d[w.startNode.id])==null?void 0:N.rect)&&((y=d[w.startNode.id])==null?void 0:y.rect)}))!=null?v:[]});return(d,b)=>(C(),M(se,null,[a(o)?(C(),M("svg",$i(We({key:0},d.$attrs)),[(C(!0),M(se,null,It(a(o),(v,w)=>(C(),X(Su,{key:w,link:v,boundingRect:u.value,startNode:a(r)[v.startNode.id],endNode:a(r)[v.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):V("",!0),p("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Iu=ae(xu,[["__scopeId","data-v-063f6d6b"]]);J({props:{nodes:{type:U(Array),required:!0},leftSideNodes:U(Array),rightSideNodes:U(Array),branches:U(Array)},components:{Links:Iu},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=be(e),r=Oe();ze(()=>{const o=Se(t);r.value=_e(oe(()=>_(se,null,[o.map(c=>_("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(je)]))])))});const s=Oe();ze(()=>{const o=Se(n);s.value=o?_e(oe(()=>_("span",{class:"left-side-nodes small"},[o.map(je)]))):""});const u=Oe();return ze(()=>{const o=Se(i);u.value=o?_e(oe(()=>_("span",{class:"side-nodes small"},[o.map(je)]))):""}),{unref:a,nodesComp:r,leftNodesComp:s,rightNodesComp:u}}});J({props:{display:U(Object,String,Function),visibility:{type:U(Number,Boolean),required:!0},style:U(String,Object,Array),classes:U(Object),onClick:Function,onHold:Function,color:U(String),glowColor:U(String),canClick:{type:U(Boolean),required:!0},mark:U(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:gi,Node:fi},setup(e){const{onClick:t,onHold:n,display:i}=be(e),r=Ut(i),{start:s,stop:u}=Jn(t,n);return{start:s,stop:u,comp:r,unref:a,Visibility:Ge,isCoercableComponent:ct,isVisible:tt,isHidden:tn}}});function un(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(o=>Ce(o.base)),n.baseText=t.map(o=>Ce(o.baseText)),n.visible=t.map(o=>Ce(o.visible)),n.title=t.map(o=>Ce(o.title)),n.subtitle=t.map(o=>Ce(o.subtitle)),i=!0),t}const s=zt({},!1);return[oe(()=>{const o=r();let c=!0;const d=o.map((b,v)=>{var L,x,F;if(a(n.visible[v])===!1)return null;const w=_("h3",{onClick:()=>s.value[v]=!s.value[v],style:"cursor: pointer"},[_("span",{class:"modifier-toggle"+(a(s.value[v])?" collapsed":"")},[O("\u25BC")]),a(n.title[v]),a(n.subtitle[v])!=null?_("span",{class:"subtitle"},[O(" ("),a(n.subtitle[v]),O(")")]):null]),N=a(s.value[v])?null:_(se,null,[_("div",{class:"modifier-container"},[_("span",{class:"modifier-description"},[je((L=a(n.baseText[v]))!=null?L:"Base")]),_("span",{class:"modifier-amount"},[Nt((x=a(n.base[v]))!=null?x:1),b.unit])]),b.modifier.description==null?null:je(a(b.modifier.description))]),y=!c;c=!1;const S=(F=a(n.base[v]))!=null?F:1,T=b.modifier.apply(S);return _(se,null,[y?_("br",null,null):null,_("div",{style:{"--unit":re.alignUnits&&b.unit!=null?"'"+b.unit+"'":""}},[w,_("br",null,null),N,_("hr",null,null),_("div",{class:"modifier-container"},[_("span",{class:"modifier-description"},[O("Total")]),_("span",{class:"modifier-amount",style:(b.smallerIsBetter===!0?l.gt(T,S!=null?S:1):l.lt(T,S!=null?S:1))?"color: var(--danger)":""},[ut(T),b.unit])])])])});return _(se,null,[d])}),s]}function An(e,t,n=1){const i=Ce(t),r=Ce(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return oe(()=>{var s;if(a(i)){const u=ut(e.evaluate()),o=ut(e.evaluate(l.add(a((s=e.innermostVariable)!=null?s:0),a(r))));return _(se,null,[_("b",null,[_("i",null,[u,O(" \u2192 "),o])])])}return _(se,null,[ut(e.evaluate())])})}const On=Bn(),wt={dirt:120,sand:60,gravel:40,wood:30,stone:24,coal:20,copper:15,iron:12,silver:10,gold:8,emerald:6,platinum:5,diamond:4,berylium:3,unobtainium:2,ultimatum:1},yt=Object.keys(wt),ye={dirt:{cost:1e3,name:"Pickaxe",type:"passive",state:"dirt"},sand:{cost:1e4,name:"Dowsing Rod",type:"dowsing",state:{resources:[],maxConnections:1,powered:!1}},gravel:{cost:1e5,name:"Ore Processor",type:"passive",state:"gravel"},wood:{cost:1e6,name:"Quarry",type:"quarry",state:{resources:[],maxConnections:1,powered:!1,progress:0}},stone:{cost:1e7,name:"Energizer",type:"passive",state:"stone"},coal:{cost:1e8,name:"Tool Empowerer",type:"empowerer",state:{tools:[],maxConnections:1,powered:!1}},copper:{cost:1e9,name:"Book",type:"passive",state:"copper"},iron:{cost:1e10,name:"Portal Generator",type:"portalGenerator"},silver:{cost:1e12,name:"Unknown Item",type:"unknownType"},gold:{cost:1e15,name:"Unknown Item",type:"unknownType"},emerald:{cost:1e19,name:"Unknown Item",type:"unknownType"},platinum:{cost:1e24,name:"Unknown Item",type:"unknownType"},diamond:{cost:1e30,name:"Unknown Item",type:"unknownType"},berylium:{cost:1e37,name:"Unknown Item",type:"unknownType"},unobtainium:{cost:1e45,name:"Unknown Item",type:"unknownType"},ultimatum:{cost:1e54,name:"Unknown Item",type:"unknownType"}},Vn={dirt:{description:e=>e?"Quadruples mining speed":"Doubles mining speed"},gravel:{description:e=>e?"Quadruples material drops":"Doubles material 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"}},mi=Qn("main",function(){const e=Os(0,"energy"),t=g.variable(0).add(1),n=I(()=>P.types.resource.nodes.value.reduce((k,f)=>(k[f.state.type]=f,k),{})),i=I(()=>({...P.types.passive.nodes.value.reduce((k,f)=>(k[f.state]=f,k),{}),sand:P.types.dowsing.nodes.value[0],wood:P.types.quarry.nodes.value[0],coal:P.types.empowerer.nodes.value[0]})),r=I(()=>yt.reduce((k,f)=>{var de,Ne,Ze;const $=(Ze=(Ne=(de=n.value[f])==null?void 0:de.state)==null?void 0:Ne.amount)!=null?Ze:0;let D=l.floor(t.invertIntegral($)).sub(10).clampMin(0),G=ln(t,D,!0,0);for(;;){const bt=t.evaluate(D);if(l.add(G,bt).lte($))D=D.add(1),G=l.add(G,bt);else break}return k[f]=D,k},{}));function s(k){var de,Ne,Ze;const f=(Ze=(Ne=(de=n.value[k])==null?void 0:de.state)==null?void 0:Ne.amount)!=null?Ze:0,$=r.value[k],D=ln(t,$,!0),G=ln(t,l.add($,1),!0);return l.sub(f,D).max(0).div(l.sub(G,D)).toNumber()}const u=gt({}),o=gt({});ft(()=>{yt.forEach(k=>{Ve(()=>r.value[k],(f,$)=>{l.gt(f,$)&&re.active===H.id&&On.info(_("div",null,[_("h3",null,[l.eq(f,1)?`${_t(k)} discovered`:`${_t(k)} is now Level ${qe(f)}`,O("!")]),_("div",null,[O("Energy gain is now 1.01x higher.")])]))})})});const c=I(()=>[ie,Q,we,W].filter(k=>{var f,$;return($=(f=k.value)==null?void 0:f.state)==null?void 0:$.powered}).length),d=I(()=>l.eq(c.value,0)?10:l.add(c.value,1).pow_base(100).div(10).times(.99)),b=I(()=>we.value==null?0:we.value.state.resources.reduce((f,$)=>l.div(100,ht[$].computedModifier.value).add(f),l.dZero)),v={id:"deselect",icon:"close",tooltip:k=>({text:"resources"in k.state?"Disconnect resources":"Disconnect tools"}),onClick(k){"resources"in k.state?k.state={...k.state,resources:[]}:"tools"in k.state&&(k.state={...k.state,tools:[]}),P.selectedAction.value=null,P.selectedNode.value=null},visibility:k=>"resources"in k.state?k.state.resources.length>0:"tools"in k.state?k.state.tools.length>0:!0},w={id:"toggle",icon:"bolt",tooltip:k=>({text:k.state.powered?"Turn Off":`Turn On - Always runs for ${qe(d.value)} energy/s`}),onClick(k){k.state={...k.state,powered:!k.state.powered},P.selectedAction.value=null},fillColor:k=>k.state.powered?"var(--accent1)":"var(--locked)"};function N(k,f=1/0){const $=k(g.variable(0));return{id:"moreConnections",icon:"hub",formula:$,tooltip(D){return{text:`Increase Connections - ${qe($.evaluate(D.state.maxConnections))} energy`}},confirmationLabel:D=>l.gte(e.value,$.evaluate(D.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(D){const G=$.evaluate(D.state.maxConnections);l.gte(e.value,G)&&(e.value=l.sub(e.value,G)),D.state={...D.state,maxConnections:D.state.maxConnections+1},P.selectedAction.value=null},visibility:D=>D.state.maxConnectionsG!==$)}:k.state={...k.state,resources:[...D,$]},P.selectedNode.value=k}function x(k,f){if(f.type!=="passive")return!1;const $=f.state,{maxConnections:D,tools:G}=k.state;return G.includes($)?!0:G.length!==D}function F(k,f){if(f.type!=="passive")return;const $=f.state,D=k.state.tools;D.includes($)?k.state={...k.state,tools:D.filter(G=>G!==$)}:k.state={...k.state,tools:[...D,$]},P.selectedNode.value=k}const P=As(k=>({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:f=>f===k.selectedNode.value?{text:"Mining"}:Object.keys(n.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[w],progress:f=>z(f)?new l(f.state.progress).toNumber():0,progressDisplay:lt.Outline,progressColor:"var(--accent2)",classes:f=>({running:z(f)}),draggable:!0},brokenFactory:{shape:Ae.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:f=>f===k.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(f){l.gte(e.value,100)&&(f.type="factory",e.value=l.sub(e.value,100))},confirmationLabel:()=>l.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:f=>{var $,D;if(f===k.selectedNode.value)return{text:f.state==null?"Forge - Drag a resource to me!":`Forging ${ye[f.state].name}`};if((($=k.draggingNode.value)==null?void 0:$.type)==="resource"){const G=((D=k.draggingNode.value)==null?void 0:D.state).type,de=f.state===G?"Disconnect":ye[G].name,Ne=f.state===G||l.gte(e.value,ye[G].cost)&&i.value[G]==null?"var(--accent2)":"var(--danger)";return{text:de,color:Ne}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(f){f.state=void 0,k.selectedAction.value=null,k.selectedNode.value=null},visibility:f=>f.state!=null},{id:"craft",icon:"done",tooltip:f=>({text:`Forge ${ye[f.state].name} - ${qe(ye[f.state].cost)} energy`}),onClick(f){const $=ye[f.state];if(l.gte(e.value,$.cost)&&i.value[f.state]==null){e.value=l.sub(e.value,$.cost);const D={id:Pn(k),position:{...f.position},type:$.type,state:$.state};k.placeInAvailableSpace(D),k.nodes.value.push(D),k.selectedAction.value=null,k.selectedNode.value=null,f.state=void 0}},fillColor:f=>l.gte(e.value,ye[f.state].cost)&&i.value[f.state]==null?"var(--accent2)":"var(--danger)",visibility:f=>f.state!=null,confirmationLabel:f=>l.gte(e.value,ye[f.state].cost)?i.value[f.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:f=>f.state==null||i.value[f.state]!=null?0:l.div(e.value,ye[f.state].cost).clampMax(1).toNumber(),progressDisplay:lt.Fill,progressColor:f=>f.state!=null&&l.gte(e.value,ye[f.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(f,$){return $.type==="resource"},onDrop(f,$){const D=$.state.type;f.state===D?f.state=void 0:f.state=D,k.selectedNode.value=f},draggable:!0},resource:{shape:Ae.Circle,size:50,title:f=>_t(f.state.type),subtitle:f=>qe(f.state.amount),progress:f=>s(f.state.type),onClick(){},progressDisplay:lt.Outline,progressColor:"var(--accent3)",classes:f=>({"affected-node":Q.value!=null&&z(Q.value)&&Q.value.state.resources.includes(f.state.type)}),draggable:!0},passive:{shape:Ae.Circle,size:50,title:f=>ye[f.state].name,label:f=>f===k.selectedNode.value?{text:Vn[f.state].description(W.value!=null&&z(W.value)&&W.value.state.tools.includes(f.state))}:null,outlineColor:"var(--bought)",classes:f=>({"affected-node":W.value!=null&&z(W.value)&&W.value.state.tools.includes(f.state)}),draggable:!0},dowsing:{shape:Ae.Diamond,size:50,title:"\u{1F962}",label:f=>f===k.selectedNode.value?{text:f.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${f.state.resources.length}/${f.state.maxConnections})`}:y(f,$=>`Double ${$} odds`),actionDistance:Math.PI/4,actions:[v,N(f=>f.add(2).pow_base(100),16),w],classes:f=>({running:z(f)}),canAccept:T,onDrop:L,draggable:!0},quarry:{shape:Ae.Diamond,size:50,title:"\u26CF\uFE0F",label:f=>f===k.selectedNode.value?{text:f.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${f.state.resources.length}/${f.state.maxConnections})`}:y(f,$=>`Gather ${Nt(l.div(ht[$].computedModifier.value,100))} ${$}/s`),actionDistance:Math.PI/4,actions:[v,N(f=>f.add(2).pow_base(1e4),16),w],progress:f=>z(f)?l.eq(b.value,0)?0:new l(f.state.progress).div(b.value).toNumber():0,progressDisplay:lt.Outline,progressColor:"var(--accent2)",canAccept:T,onDrop:L,classes:f=>({running:z(f)}),draggable:!0},empowerer:{shape:Ae.Diamond,size:50,title:"\u{1F50C}",label:f=>f===k.selectedNode.value?{text:f.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${f.state.tools.length}/${f.state.maxConnections})`}:S(f,$=>`Double ${ye[$].name}'s effect`),actionDistance:Math.PI/4,actions:[v,N(f=>f.add(3).pow_base(1e3),16),w],canAccept:x,onDrop:F,classes:f=>({running:z(f)}),draggable:!0}},style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const f=[];return f.push(...Object.keys(u).map($=>({startNode:ie.value,endNode:n.value[$],stroke:"var(--accent3)",strokeWidth:5}))),ee.value!=null&&ee.value.state!=null&&f.push({startNode:ee.value,endNode:n.value[ee.value.state],stroke:"var(--foreground)",strokeWidth:4}),Q.value!=null&&Q.value.state.resources.forEach($=>{f.push({startNode:Q.value,endNode:n.value[$],stroke:z(Q.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),we.value!=null&&we.value.state.resources.forEach($=>{f.push({startNode:we.value,endNode:n.value[$],stroke:"var(--foreground)",strokeWidth:4})}),f.push(...Object.keys(o).map($=>({startNode:we.value,endNode:n.value[$],stroke:"var(--accent3)",strokeWidth:5}))),W.value!=null&&W.value.state.tools.forEach($=>{f.push({startNode:W.value,endNode:i.value[$],stroke:z(W.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),f}}));function z(k){return k===P.selectedNode.value||k.state.powered}const ie=I(()=>P.types.mine.nodes.value[0]),ee=I(()=>P.types.factory.nodes.value[0]),Q=I(()=>i.value.sand),we=I(()=>i.value.wood),W=I(()=>i.value.coal);function Z(k,f){let $=n.value[k];if($==null)$={id:Pn(P),position:{...ie.value.position},type:"resource",state:{type:k,amount:f}},P.placeInAvailableSpace($),P.nodes.value.push($);else{const D=$.state;$.state={...D,amount:l.add(D.amount,f)}}}const fe=I(()=>Object.keys(wt).reduce((k,f)=>k+new l(ht[f].computedModifier.value).toNumber(),0)),Te=Pt(()=>[...yt.map(k=>Ft(()=>({description:()=>`${_t(k)} (Lv. ${qe(r.value[k])}) (${Nt(Nn.value)}x per level)`,multiplier:()=>l.pow(Nn.value,r.value[k]),enabled:()=>{var f,$;return k in n.value&&l.gt(($=(f=n.value[k].state)==null?void 0:f.amount)!=null?$:0,0)}}))),Ft(()=>({multiplier:()=>W.value!=null&&z(W.value)&&W.value.state.tools.includes("stone")?4:2,description:()=>(W.value!=null&&z(W.value)&&W.value.state.tools.includes("stone")?"Empowered ":"")+ye.stone.name,enabled:()=>i.value.stone!=null})),Dn(()=>({addend:()=>l.pow(100,c.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>l.gt(c.value,0)}))]),De=I(()=>Te.apply(1)),$t=Pt(()=>[Ft(()=>({multiplier:()=>W.value!=null&&z(W.value)&&W.value.state.tools.includes("dirt")?4:2,description:()=>(W.value!=null&&z(W.value)&&W.value.state.tools.includes("dirt")?"Empowered ":"")+ye.dirt.name,enabled:()=>i.value.dirt!=null}))]),Re=I(()=>$t.apply(1)),yn=Pt(()=>[Ft(()=>({multiplier:()=>W.value!=null&&z(W.value)&&W.value.state.tools.includes("gravel")?4:2,description:()=>(W.value!=null&&z(W.value)&&W.value.state.tools.includes("gravel")?"Empowered ":"")+ye.gravel.name,enabled:()=>i.value.gravel!=null}))]),_n=I(()=>yn.apply(1)),wn=Pt(()=>[Dn(()=>({addend:()=>W.value!=null&&z(W.value)&&W.value.state.tools.includes("copper")?.002:.001,description:()=>(W.value!=null&&z(W.value)&&W.value.state.tools.includes("copper")?"Empowered ":"")+ye.copper.name,enabled:()=>i.value.copper!=null}))]),Nn=I(()=>wn.apply(1.01)),ht=Object.keys(wt).reduce((k,f)=>{const $=Pt(()=>[Ft(()=>({multiplier:2,description:"Dowsing",enabled:()=>Q.value!=null&&z(Q.value)&&Q.value.state.resources.includes(f)}))]),D=I(()=>$.apply(wt[f])),G={title:`${_t(f)} Drop Rate`,modifier:$,base:wt[f]};return k[f]={modifier:$,computedModifier:D,section:G},k},{}),[pi,hi]=un(()=>[{title:"Energy Gain",modifier:Te,base:1,unit:"/s"}]),[bi,yi]=un(()=>[{title:"Mining Speed",modifier:$t,base:1,unit:"/s",visible:()=>i.value.dirt!=null},{title:"Ore Dropped",modifier:yn,base:1,visible:()=>i.value.gravel!=null},{title:"Material Level Effect",modifier:wn,base:1.01,visible:()=>i.value.copper!=null}]),[_i,wi]=un(()=>Object.values(ht).map(k=>k.section)),Tt=Ws({general:()=>({display:"Energy",glowColor(){return Tt.activeTab.value===this.tab?"white":""},tab:pi,energyTabCollapsed:hi}),mining:()=>({display:"Mining",glowColor(){return Tt.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(i.value).length>0,tab:bi,miningTabCollapsed:yi}),resources:()=>({display:"Resources",glowColor(){return Tt.activeTab.value===this.tab?"white":""},visibility:()=>Q.value!=null,tab:_i,resourcesCollapsed:wi})}),rn=A(!1),Ni=oe(()=>_(nt,{modelValue:rn.value,"onUpdate:modelValue":k=>rn.value=k},{header:()=>_("h2",null,[O("Modifiers")]),body:()=>Je(Tt)}));this.on("preUpdate",k=>{if(Object.keys(u).forEach(f=>{u[f]-=k,u[f]<=0&&delete u[f]}),Object.keys(o).forEach(f=>{o[f]-=k,o[f]<=0&&delete o[f]}),z(ie.value)){const f=l.add(ie.value.state.progress,l.times(Re.value,k)),$=f.floor();ie.value.state={...ie.value.state,progress:l.sub(f,$)};const D=$.div(fe.value).floor();D.gt(0)&&yt.forEach(de=>{Z(de,l.times(new l(ht[de].computedModifier.value).toNumber(),D).times(_n.value)),u[de]=.3});const G=l.sub($,D).toNumber();for(let de=0;de0){let D=l.add(f,k);const G=l.div(f,b.value).floor();D=l.sub(D,l.times(G,b.value)),we.value.state={...we.value.state,progress:D},l.gt(G,0)&&$.forEach(de=>{Z(de,G),o[de]=.3})}}e.value=l.add(e.value,l.times(De.value,k)),l.lt(e.value,0)&&(e.value=0,ie.value.state={...ie.value.state,powered:!1},On.warning(_("div",null,[_("h3",null,[O("Ran out of energy!")]),_("div",null,[O("All machines have been turned off.")])])))});const Cn=I(()=>{var k,f;return P.selectedAction.value===P.types.brokenFactory.actions[0]?-100:P.selectedAction.value===P.types.factory.actions[1]?l.neg(ye[P.selectedNode.value.state].cost):((k=P.selectedAction.value)==null?void 0:k.id)==="moreConnections"?l.neg(P.selectedAction.value.formula.evaluate(((f=P.selectedNode.value)==null?void 0:f.state).maxConnections)):0}),Ci=An(g.variable(0).add(e),()=>l.neq(Cn.value,0),Cn),kn=I(()=>{var k;return P.selectedAction.value===w?((k=P.selectedNode.value)==null?void 0:k.state).powered?l.eq(c.value,1)?10:l.pow(100,c.value).div(10).times(.99):l.neg(d.value):0}),ki=An(g.variable(0).add(De),()=>l.neq(kn.value,0),kn);return{name:"World",board:P,energy:e,modifierTabs:Tt,mineLootTable:wt,tools:ye,passives:Vn,resourceNodes:n,toolNodes:i,display:oe(()=>_(se,null,[_(li,{class:"nav-container"},{default:()=>[_("span",{class:"nav-segment"},[_("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[Je(Ci)])," ",O("energy")]),_("span",{class:"nav-segment"},[O("("),_("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[l.gt(De.value,0)?"+":"",Je(ki)]),O("/s)")]),l.gt(c.value,0)?_("span",{class:"nav-segment"},[_("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[qe(c.value)])," ",O("machines powered")]):null,_("span",{class:"nav-segment"},[_("button",{class:"button",style:"display: inline",onClick:()=>rn.value=!0},[O("open modifiers")])]),H.devSpeed===0?_("span",{class:"nav-segment"},[O("Game Paused")]):H.devSpeed!=null&&H.devSpeed!==1?_("span",{class:"nav-segment"},[O("Dev Speed: "),Nt(H.devSpeed),O("x")]):null]}),Je(P),Je(Ni)]))}}),Mu=e=>[mi],vi=I(()=>!1);function Eu(e,t){}var $u=Object.freeze(Object.defineProperty({__proto__:null,main:mi,getInitialLayers:Mu,hasWon:vi,fixOldSave:Eu},Symbol.toStringTag,{value:"Module"}));const jt=e=>(mt("data-v-4a50ce42"),e=e(),vt(),e),Tu={class:"game-over-modal-header"},Fu=["src","alt"],Pu={class:"game-over-modal-title"},Du=jt(()=>p("h2",null,"Congratulations!",-1)),Au={key:0},Ou=jt(()=>p("br",null,null,-1)),Vu=jt(()=>p("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Lu=jt(()=>p("br",null,null,-1)),qu=["href"],Bu=jt(()=>p("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Ru=J({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:s,versionTitle:u}=ne,o=I(()=>gn(H.timePlayed)),c=I(()=>vi.value&&!H.keepGoing),d=et(H,"autosave");function b(){H.keepGoing=!0}function v(){ot(Ct())}return(w,N)=>(C(),X(nt,{"model-value":a(c)},{header:B(()=>[p("div",Tu,[a(n)?(C(),M("img",{key:0,class:"game-over-modal-logo",src:a(n),alt:a(t)},null,8,Fu)):V("",!0),p("div",Pu,[Du,p("h4",null,"You've beaten "+K(a(t))+" v"+K(a(s))+": "+K(a(u)),1)])])]),body:B(({shown:y})=>[y?(C(),M("div",Au,[p("div",null,"It took you "+K(a(o))+" to beat the game.",1),Ou,Vu,Lu,p("div",null,[p("a",{href:a(r),class:"game-over-modal-discord-link"},[Bu,O(" "+K(a(i)),1)],8,qu)]),_(Ue,{title:"Autosave",modelValue:a(d),"onUpdate:modelValue":N[0]||(N[0]=S=>me(d)?d.value=S:null)},null,8,["modelValue"])])):V("",!0)]),footer:B(()=>[p("div",{class:"game-over-footer"},[p("button",{onClick:b,class:"button"},"Keep Going"),p("button",{onClick:v,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var Uu=ae(Ru,[["__scopeId","data-v-4a50ce42"]]);const nn=e=>(mt("data-v-2776d67d"),e=e(),vt(),e),zu=nn(()=>p("div",{class:"nan-modal-header"},[p("h2",null,"NaN value detected!")],-1)),ju={key:0},Wu=nn(()=>p("br",null,null,-1)),Gu=["href"],Hu=nn(()=>p("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Zu=nn(()=>p("br",null,null,-1)),Yu={class:"nan-footer"},Ju=J({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=ne,i=A(!0),r=A(!0),s=et(pe,"hasNaN"),u=A(null);Ve(s,w=>{w?(i.value=H.autosave,r.value=H.devSpeed===0):(H.autosave=i.value,H.devSpeed=r.value?0:null)});const o=I(()=>{var w;return(w=pe.NaNPath)==null?void 0:w.join(".")}),c=I(()=>pe.NaNPersistent!=null?pe.NaNPersistent.value:null);function d(){pe.NaNPersistent!=null&&(pe.NaNPersistent.value=new l(0),pe.hasNaN=!1)}function b(){pe.NaNPersistent&&(pe.NaNPersistent.value=new l(1),pe.hasNaN=!1)}function v(){pe.NaNPersistent&&(pe.NaNPersistent.value=new l(NaN),pe.hasNaN=!1)}return(w,N)=>(C(),M(se,null,[_(nt,We({modelValue:a(s),"onUpdate:modelValue":N[4]||(N[4]=y=>me(s)?s.value=y:null)},w.$attrs),{header:B(()=>[zu]),body:B(()=>[p("div",null,[O(' Attempted to assign "'+K(a(o))+'" to NaN',1),a(c)?(C(),M("span",ju,K(" ")+"(previously "+K(a(Nt)(a(c)))+")",1)):V("",!0),O(". Auto-saving has been "+K(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Wu,p("div",null,[p("a",{href:a(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[Hu,O(" "+K(a(t)||"The Paper Pilot Community"),1)],8,Gu)]),Zu,_(Ue,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=y=>i.value=y)},null,8,["modelValue"]),a(ne).enablePausing?(C(),X(Ue,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":N[1]||(N[1]=y=>r.value=y)},null,8,["modelValue"])):V("",!0)]),footer:B(()=>[p("div",Yu,[p("button",{onClick:N[2]||(N[2]=y=>{var S;return(S=u.value)==null?void 0:S.open()}),class:"button"},"Open Saves Manager"),p("button",{onClick:d,class:"button"},"Set to 0"),p("button",{onClick:b,class:"button"},"Set to 1"),a(c)&&a(l).neq(a(c),0)&&a(l).neq(a(c),1)?(C(),M("button",{key:0,onClick:N[3]||(N[3]=y=>s.value=!1),class:"button"}," Set to previous ")):V("",!0),p("button",{onClick:v,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),_(oi,{ref_key:"savesManager",ref:u},null,512)],64))}});var Ku=ae(Ju,[["__scopeId","data-v-2776d67d"]]);const Xu={key:0,class:"tpsDisplay"},Qu={key:0,class:"low"},ec=J({__name:"TPS",setup(e){const t=I(()=>l.div(pe.lastTenTicks.length,pe.lastTenTicks.reduce((s,u)=>s+u,0))),n=A([]);ze(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=I(()=>n.value.reduce((s,u)=>l.max(s,u),0)),r=I(()=>l.sub(t.value,i.value).gt(1));return(s,u)=>a(t).isNan()?V("",!0):(C(),M("div",Xu,[O(" TPS: "+K(a(qe)(a(t)))+" ",1),_(xt,{name:"fade"},{default:B(()=>[a(r)?(C(),M("span",Qu,K(a(qe)(a(i))),1)):V("",!0)]),_:1})]))}});var tc=ae(ec,[["__scopeId","data-v-46a3ed5b"]]);var nc=J({__name:"App",setup(e){const t=ne.useHeader,n=I(()=>Be[re.theme].variables),i=et(re,"showTPS"),r=I(()=>_e(oe(()=>_(se,null,[zr.map(Je)]))));return(s,u)=>(C(),M(se,null,[p("div",{id:"modal-root",style:Le(a(n))},null,4),p("div",{class:ue(["app",{useHeader:a(t)}]),style:Le(a(n))},[a(t)?(C(),X(si,{key:0})):V("",!0),_(is),a(a(i))?(C(),X(tc,{key:1})):V("",!0),_(Uu),_(Ku),(C(),X(Ee(a(r))))],6)],64))}});var ic=ae(nc,[["__scopeId","data-v-41d15e5e"]]);function rc(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:s,onRegisterError:u}=e;let o,c,d,b;const v=async(N=!0)=>{await d,N&&(o==null||o.addEventListener("controlling",y=>{y.isUpdate&&window.location.reload()})),await(b==null?void 0:b())};async function w(){if("serviceWorker"in navigator){const{Workbox:N,messageSW:y}=await Vt(()=>import("./workbox-window.4a8794bb.js"),[]);b=async()=>{c&&c.waiting&&await y(c.waiting,{type:"SKIP_WAITING"})},o=new N("./sw.js",{scope:"./",type:"classic"}),o.addEventListener("activated",S=>{S.isUpdate||i==null||i()});{const S=()=>{n==null||n()};o.addEventListener("waiting",S),o.addEventListener("externalwaiting",S)}o.register({immediate:t}).then(S=>{c=S,s?s("./sw.js",S):r==null||r(S)}).catch(S=>{u==null||u(S)})}}return d=w(),v}function ac(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:s,onRegisterError:u}=e,o=A(!1),c=A(!1);return{updateServiceWorker:rc({immediate:t,onNeedRefresh(){o.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:r,onRegisteredSW:s,onRegisterError:u}),offlineReady:c,needRefresh:o}}document.title=ne.title;window.projInfo=ne;if(ne.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 Vr();const{globalBus:e}=await Vt(()=>Promise.resolve().then(function(){return Ar}),void 0),{startGameLoop:t}=await Vt(()=>import("./gameLoop.6a742dab.js"),["assets/gameLoop.6a742dab.js","assets/@fontsource.f66d05e7.css","assets/vue.804e2479.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6f8187b0.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.f5f69b1a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.ce650350.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.89be130f.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.5231d1bd.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=Ti(ic);e.emit("setupVue",n),n.mount("#app"),ft(()=>{const i=Bn(),{updateServiceWorker:r}=ac({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(s){s&&setInterval(()=>s.update(),60*60*1e3)}})}),t()});export{l as D,Vt as _,pe as a,ne as b,$u as c,Ie as g,Lr as l,H as p,re as s}; diff --git a/index.html b/index.html index 706a4e0..be7e8c5 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ Profectus - + @@ -31,7 +31,7 @@ - + diff --git a/sw.js b/sw.js index a0d5f9b..cc83de1 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 o={};const a=e=>i(e,r),u={module:{uri:r},exports:o,require:a};s[r]=Promise.all(n.map((e=>u[e]||a(e)))).then((e=>(l(...e),o)))}}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.6f8187b0.js",revision:null},{url:"assets/amator.1e5a40c8.js",revision:null},{url:"assets/bezier-easing.a990b400.js",revision:null},{url:"assets/gameLoop.6a742dab.js",revision:null},{url:"assets/index.6f5e52cd.js",revision:null},{url:"assets/index.e5429d96.css",revision:null},{url:"assets/lz-string.dccec454.js",revision:null},{url:"assets/nanoevents.1080beb7.js",revision:null},{url:"assets/ngraph.events.083734c6.js",revision:null},{url:"assets/panzoom.30c56ba6.js",revision:null},{url:"assets/sortablejs.a0f68e5e.js",revision:null},{url:"assets/vue-next-select.9e6f4164.css",revision:null},{url:"assets/vue-next-select.f5f69b1a.js",revision:null},{url:"assets/vue-panzoom.89be130f.js",revision:null},{url:"assets/vue-textarea-autosize.35804eaf.js",revision:null},{url:"assets/vue-toastification.4b5f8ac8.css",revision:null},{url:"assets/vue-toastification.5231d1bd.js",revision:null},{url:"assets/vue.804e2479.js",revision:null},{url:"assets/vuedraggable.ce650350.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:"599fe80b899165cc3824002e549ba449"},{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.6f8187b0.js",revision:null},{url:"assets/amator.1e5a40c8.js",revision:null},{url:"assets/bezier-easing.a990b400.js",revision:null},{url:"assets/gameLoop.7364e043.js",revision:null},{url:"assets/index.09a0ea01.js",revision:null},{url:"assets/index.53b6dde5.css",revision:null},{url:"assets/lz-string.dccec454.js",revision:null},{url:"assets/nanoevents.1080beb7.js",revision:null},{url:"assets/ngraph.events.083734c6.js",revision:null},{url:"assets/panzoom.30c56ba6.js",revision:null},{url:"assets/sortablejs.a0f68e5e.js",revision:null},{url:"assets/vue-next-select.9e6f4164.css",revision:null},{url:"assets/vue-next-select.f5f69b1a.js",revision:null},{url:"assets/vue-panzoom.89be130f.js",revision:null},{url:"assets/vue-textarea-autosize.35804eaf.js",revision:null},{url:"assets/vue-toastification.4b5f8ac8.css",revision:null},{url:"assets/vue-toastification.5231d1bd.js",revision:null},{url:"assets/vue.804e2479.js",revision:null},{url:"assets/vuedraggable.ce650350.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:"ba663ad78a33034d6efad968c7245863"},{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")))}));