mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-26 10:06:17 +00:00
18 lines
152 KiB
JavaScript
18 lines
152 KiB
JavaScript
/* empty css */import"./vue.804e2479.js";import{_ as I,C as a,l as ue,q as _t,t as F,b2 as Fe,ab as j,aD as $n,w as Te,b3 as Le,a9 as _,O as ie,az as Jt,as as ut,aF as N,a1 as S,aL as Je,a2 as p,aH as qt,A as me,$ as Z,b7 as O,b9 as an,ar as qe,bv as vt,a8 as D,bt as ci,bc as bt,T as di,u as on,j as gi,bw as hn,aM as jt,a0 as V,aO as Se,J as H,G as ae,I as Pe,aI as ct,aG as dt,z as Ke,bo as fi,bs as mi,aK as yt,bd as vn,am as Gt,H as pi,bf as hi}from"./@vue.6f8187b0.js";import{c as Tn}from"./nanoevents.1080beb7.js";import{L as Ze}from"./lz-string.dccec454.js";import{Y as vi}from"./vue-next-select.f5f69b1a.js";import{D as bi}from"./vuedraggable.ce650350.js";import{p as yi}from"./vue-textarea-autosize.35804eaf.js";import{P as _i}from"./vue-panzoom.89be130f.js";import{s as wi,u as Fn}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 Ni=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 l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).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)}};Ni();const Ci="modulepreload",bn={},ki="./",$t=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${ki}${i}`,i in bn)return;bn[i]=!0;const r=i.endsWith(".css"),s=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${s}`))return;const l=document.createElement("link");if(l.rel=r?"stylesheet":Ci,r||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),r)return new Promise((o,c)=>{l.addEventListener("load",o),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},Si="./projInfo-schema.json",xi="Planar Pioneers",Ii="A game about controlling and exploiting planes!",Mi="planar-pioneers",Ei="thepaperpilot",$i="",Ti="",Fi="0.0",Pi="Initial Commit",Di=!0,Vi=!1,Ai=2,Oi=!0,Li=null,Bi="",qi=["main"],Ri=3600,Ui=0,zi=!0,ji="base64";var J={$schema:Si,title:xi,description:Ii,id:Mi,author:Ei,discordName:$i,discordLink:Ti,versionNumber:Fi,versionTitle:Pi,allowGoBack:Di,defaultShowSmall:Vi,defaultDecimalsShown:Ai,useHeader:Oi,banner:Li,logo:Bi,initialTabs:qi,maxTickLength:Ri,offlineLimit:Ui,enablePausing:zi,exportEncoding:ji};class Gi{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 Wi(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 Wi{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const tn=17,Hi=9e15,Zi=Math.log10(9e15),Yi=1/9e15,Ji=308,Ki=-324,yn=5,Xi=(1<<10)-1,Qi=function(){const e=[];for(let n=Ki+1;n<=Ji;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),tt=[2,Math.E,3,4,5,6,7,8,9,10],er=[[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]],tr=[[-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 v=function(t){return u.fromValue_noAlloc(t)},L=function(e,t,n){return u.fromComponents(e,t,n)},z=function(t,n,i){return u.fromComponents_noNormalize(t,n,i)};const je=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)))},nn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},nr=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},Pn=.5671432904097838,_n=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return Pn;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)<t*Math.abs(i))return i;n=i}throw Error(`Iteration failed to converge: ${e.toString()}`)};function wn(e,t=1e-10){let n,i,r,s;if(!Number.isFinite(e.mag)||e.eq(u.dZero))return e;if(e.eq(u.dOne))return u.fromNumber(Pn);n=u.ln(e);for(let l=0;l<100;++l){if(i=n.neg().exp(),r=n.sub(e.mul(i)),s=n.sub(r.div(n.add(1).sub(n.add(2).mul(r).div(u.mul(2,n).add(2))))),u.abs(s.sub(n)).lt(u.abs(s).mul(t)))return s;n=s}throw Error(`Iteration failed to converge: ${e.toString()}`)}const f=class{constructor(e){this.sign=0,this.mag=0,this.layer=0,e instanceof f?this.fromDecimal(e):typeof e=="number"?this.fromNumber(e):typeof e=="string"&&this.fromString(e)}get m(){if(this.sign===0)return 0;if(this.layer===0){const e=Math.floor(Math.log10(this.mag));let t;return this.mag===5e-324?t=5:t=this.mag/Qi(e),this.sign*t}else if(this.layer===1){const e=this.mag-Math.floor(this.mag);return this.sign*Math.pow(10,e)}else return this.sign}set m(e){this.layer<=2?this.fromMantissaExponent(e,this.e):(this.sign=Math.sign(e),this.sign===0&&(this.layer=0,this.exponent=0))}get e(){return this.sign===0?0:this.layer===0?Math.floor(Math.log10(this.mag)):this.layer===1?Math.floor(this.mag):this.layer===2?Math.floor(Math.sign(this.mag)*Math.pow(10,Math.abs(this.mag))):this.mag*Number.POSITIVE_INFINITY}set e(e){this.fromMantissaExponent(this.m,e)}get s(){return this.sign}set s(e){e===0?(this.sign=0,this.layer=0,this.mag=0):this.sign=e}get mantissa(){return this.m}set mantissa(e){this.m=e}get exponent(){return this.e}set exponent(e){this.e=e}static fromComponents(e,t,n){return new f().fromComponents(e,t,n)}static fromComponents_noNormalize(e,t,n){return new f().fromComponents_noNormalize(e,t,n)}static fromMantissaExponent(e,t){return new f().fromMantissaExponent(e,t)}static fromMantissaExponent_noNormalize(e,t){return new f().fromMantissaExponent_noNormalize(e,t)}static fromDecimal(e){return new f().fromDecimal(e)}static fromNumber(e){return new f().fromNumber(e)}static fromString(e){return new f().fromString(e)}static fromValue(e){return new f().fromValue(e)}static fromValue_noAlloc(e){if(e instanceof f)return e;if(typeof e=="string"){const t=f.fromStringCache.get(e);return t!==void 0?t:f.fromString(e)}else return typeof e=="number"?f.fromNumber(e):f.dZero}static abs(e){return v(e).abs()}static neg(e){return v(e).neg()}static negate(e){return v(e).neg()}static negated(e){return v(e).neg()}static sign(e){return v(e).sign}static sgn(e){return v(e).sign}static round(e){return v(e).round()}static floor(e){return v(e).floor()}static ceil(e){return v(e).ceil()}static trunc(e){return v(e).trunc()}static add(e,t){return v(e).add(t)}static plus(e,t){return v(e).add(t)}static sub(e,t){return v(e).sub(t)}static subtract(e,t){return v(e).sub(t)}static minus(e,t){return v(e).sub(t)}static mul(e,t){return v(e).mul(t)}static multiply(e,t){return v(e).mul(t)}static times(e,t){return v(e).mul(t)}static div(e,t){return v(e).div(t)}static divide(e,t){return v(e).div(t)}static recip(e){return v(e).recip()}static reciprocal(e){return v(e).recip()}static reciprocate(e){return v(e).reciprocate()}static cmp(e,t){return v(e).cmp(t)}static cmpabs(e,t){return v(e).cmpabs(t)}static compare(e,t){return v(e).cmp(t)}static isNaN(e){return e=v(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag)}static isFinite(e){return e=v(e),isFinite(e.sign)&&isFinite(e.layer)&&isFinite(e.mag)}static eq(e,t){return v(e).eq(t)}static equals(e,t){return v(e).eq(t)}static neq(e,t){return v(e).neq(t)}static notEquals(e,t){return v(e).notEquals(t)}static lt(e,t){return v(e).lt(t)}static lte(e,t){return v(e).lte(t)}static gt(e,t){return v(e).gt(t)}static gte(e,t){return v(e).gte(t)}static max(e,t){return v(e).max(t)}static min(e,t){return v(e).min(t)}static minabs(e,t){return v(e).minabs(t)}static maxabs(e,t){return v(e).maxabs(t)}static clamp(e,t,n){return v(e).clamp(t,n)}static clampMin(e,t){return v(e).clampMin(t)}static clampMax(e,t){return v(e).clampMax(t)}static cmp_tolerance(e,t,n){return v(e).cmp_tolerance(t,n)}static compare_tolerance(e,t,n){return v(e).cmp_tolerance(t,n)}static eq_tolerance(e,t,n){return v(e).eq_tolerance(t,n)}static equals_tolerance(e,t,n){return v(e).eq_tolerance(t,n)}static neq_tolerance(e,t,n){return v(e).neq_tolerance(t,n)}static notEquals_tolerance(e,t,n){return v(e).notEquals_tolerance(t,n)}static lt_tolerance(e,t,n){return v(e).lt_tolerance(t,n)}static lte_tolerance(e,t,n){return v(e).lte_tolerance(t,n)}static gt_tolerance(e,t,n){return v(e).gt_tolerance(t,n)}static gte_tolerance(e,t,n){return v(e).gte_tolerance(t,n)}static pLog10(e){return v(e).pLog10()}static absLog10(e){return v(e).absLog10()}static log10(e){return v(e).log10()}static log(e,t){return v(e).log(t)}static log2(e){return v(e).log2()}static ln(e){return v(e).ln()}static logarithm(e,t){return v(e).logarithm(t)}static pow(e,t){return v(e).pow(t)}static pow10(e){return v(e).pow10()}static pow_base(e,t){return v(e).pow_base(t)}static root(e,t){return v(e).root(t)}static factorial(e,t){return v(e).factorial()}static gamma(e,t){return v(e).gamma()}static lngamma(e,t){return v(e).lngamma()}static exp(e){return v(e).exp()}static sqr(e){return v(e).sqr()}static sqrt(e){return v(e).sqrt()}static cube(e){return v(e).cube()}static cbrt(e){return v(e).cbrt()}static tetrate(e,t=2,n=z(1,0,1)){return v(e).tetrate(t,n)}static iteratedexp(e,t=2,n=z(1,0,1)){return v(e).iteratedexp(t,n)}static iteratedlog(e,t=10,n=1){return v(e).iteratedlog(t,n)}static layeradd10(e,t){return v(e).layeradd10(t)}static layeradd(e,t,n=10){return v(e).layeradd(t,n)}static slog(e,t=10){return v(e).slog(t)}static lambertw(e){return v(e).lambertw()}static ssqrt(e){return v(e).ssqrt()}static pentate(e,t=2,n=z(1,0,1)){return v(e).pentate(t,n)}static sin(e){return v(e).sin()}static cos(e){return v(e).cos()}static tan(e){return v(e).tan()}static asin(e){return v(e).asin()}static acos(e){return v(e).acos()}static atan(e){return v(e).atan()}static sinh(e){return v(e).sinh()}static cosh(e){return v(e).cosh()}static tanh(e){return v(e).tanh()}static asinh(e){return v(e).asinh()}static acosh(e){return v(e).acosh()}static atanh(e){return v(e).atanh()}static affordGeometricSeries(e,t,n,i){return this.affordGeometricSeries_core(v(e),v(t),v(n),i)}static sumGeometricSeries(e,t,n,i){return this.sumGeometricSeries_core(e,v(t),v(n),i)}static affordArithmeticSeries(e,t,n,i){return this.affordArithmeticSeries_core(v(e),v(t),v(n),v(i))}static sumArithmeticSeries(e,t,n,i){return this.sumArithmeticSeries_core(v(e),v(t),v(n),v(i))}static efficiencyOfPurchase(e,t,n){return this.efficiencyOfPurchase_core(v(e),v(t),v(n))}static randomDecimalForTesting(e){if(Math.random()*20<1)return z(0,0,0);const t=Math.random()>.5?1:-1;if(Math.random()*20<1)return z(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)),L(t,n,r)}static affordGeometricSeries_core(e,t,n,i){const r=t.mul(n.pow(i));return f.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(f.sub(1,n.pow(e))).div(f.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const s=t.add(i.mul(n)).sub(n.div(2)),l=s.pow(2);return s.neg().add(l.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<Yi)return this.layer+=1,this.mag=Math.log10(this.mag),this;let e=Math.abs(this.mag),t=Math.sign(this.mag);if(e>=Hi)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e<Zi&&this.layer>0;)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=f.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const h=parseFloat(i[0]),C=parseFloat(i[1]),$=i[1].split(";");let P=1;if($.length===2&&(P=parseFloat($[1]),isFinite(P)||(P=1)),isFinite(h)&&isFinite(C)){const k=f.pentate(h,C,P);return this.sign=k.sign,this.layer=k.layer,this.mag=k.mag,f.fromStringCache.maxSize>=1&&f.fromStringCache.set(t,f.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const h=parseFloat(r[0]),C=parseFloat(r[1]),$=r[1].split(";");let P=1;if($.length===2&&(P=parseFloat($[1]),isFinite(P)||(P=1)),isFinite(h)&&isFinite(C)){const k=f.tetrate(h,C,P);return this.sign=k.sign,this.layer=k.layer,this.mag=k.mag,f.fromStringCache.maxSize>=1&&f.fromStringCache.set(t,f.fromDecimal(this)),this}}const s=e.split("^");if(s.length===2){const h=parseFloat(s[0]),C=parseFloat(s[1]);if(isFinite(h)&&isFinite(C)){const $=f.pow(h,C);return this.sign=$.sign,this.layer=$.layer,this.mag=$.mag,f.fromStringCache.maxSize>=1&&f.fromStringCache.set(t,f.fromDecimal(this)),this}}e=e.trim().toLowerCase();let l,o,c=e.split("pt");if(c.length===2){l=10,o=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let h=parseFloat(c[1]);if(isFinite(h)||(h=1),isFinite(l)&&isFinite(o)){const C=f.tetrate(l,o,h);return this.sign=C.sign,this.layer=C.layer,this.mag=C.mag,f.fromStringCache.maxSize>=1&&f.fromStringCache.set(t,f.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){l=10,o=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let h=parseFloat(c[1]);if(isFinite(h)||(h=1),isFinite(l)&&isFinite(o)){const C=f.tetrate(l,o,h);return this.sign=C.sign,this.layer=C.layer,this.mag=C.mag,f.fromStringCache.maxSize>=1&&f.fromStringCache.set(t,f.fromDecimal(this)),this}}const d=e.split("e"),b=d.length-1;if(b===0){const h=parseFloat(e);if(isFinite(h))return this.fromNumber(h),f.fromStringCache.size>=1&&f.fromStringCache.set(t,f.fromDecimal(this)),this}else if(b===1){const h=parseFloat(e);if(isFinite(h)&&h!==0)return this.fromNumber(h),f.fromStringCache.maxSize>=1&&f.fromStringCache.set(t,f.fromDecimal(this)),this}const m=e.split("e^");if(m.length===2){this.sign=1,m[0].charAt(0)=="-"&&(this.sign=-1);let h="";for(let C=0;C<m[1].length;++C){const $=m[1].charCodeAt(C);if($>=43&&$<=57||$===101)h+=m[1].charAt(C);else return this.layer=parseFloat(h),this.mag=parseFloat(m[1].substr(C+1)),this.normalize(),f.fromStringCache.maxSize>=1&&f.fromStringCache.set(t,f.fromDecimal(this)),this}}if(b<1)return this.sign=0,this.layer=0,this.mag=0,f.fromStringCache.maxSize>=1&&f.fromStringCache.set(t,f.fromDecimal(this)),this;const w=parseFloat(d[0]);if(w===0)return this.sign=0,this.layer=0,this.mag=0,f.fromStringCache.maxSize>=1&&f.fromStringCache.set(t,f.fromDecimal(this)),this;let y=parseFloat(d[d.length-1]);if(b>=2){const h=parseFloat(d[d.length-2]);isFinite(h)&&(y*=Math.sign(h),y+=nn(h))}if(!isFinite(w))this.sign=d[0]==="-"?-1:1,this.layer=b,this.mag=y;else if(b===1)this.sign=Math.sign(w),this.layer=1,this.mag=y+Math.log10(Math.abs(w));else if(this.sign=Math.sign(w),this.layer=b,b===2){const h=f.mul(L(1,2,y),v(w));return this.sign=h.sign,this.layer=h.layer,this.mag=h.mag,f.fromStringCache.maxSize>=1&&f.fromStringCache.set(t,f.fromDecimal(this)),this}else this.mag=y;return this.normalize(),f.fromStringCache.maxSize>=1&&f.fromStringCache.set(t,f.fromDecimal(this)),this}fromValue(e){return e instanceof f?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:je(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:je(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<=yn?(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):je(this.m,e)+"e"+je(this.e,e):this.layer===1?je(this.m,e)+"e"+je(this.e,e):this.layer<=yn?(this.sign===-1?"-":"")+"e".repeat(this.layer)+je(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+je(this.mag,e)}abs(){return z(this.sign===0?0:1,this.layer,this.mag)}neg(){return z(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?f.dZero:this.layer===0?L(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?f.dZero:this.layer===0?L(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?f.dZero:this.layer===0?L(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?f.dZero:this.layer===0?L(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=v(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 z(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(f.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return f.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))>tn)return n;{const l=Math.pow(10,Math.log10(n.mag)-i.mag),o=i.sign+n.sign*l;return L(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))>tn)return n;{const l=Math.pow(10,n.mag-Math.log10(i.mag)),o=i.sign+n.sign*l;return L(Math.sign(o),1,Math.log10(i.mag)+Math.log10(Math.abs(o)))}}if(Math.abs(n.mag-i.mag)>tn)return n;{const l=Math.pow(10,n.mag-i.mag),o=i.sign+n.sign*l;return L(Math.sign(o),1,i.mag+Math.log10(Math.abs(o)))}}plus(e){return this.add(e)}sub(e){return this.add(v(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=v(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return z(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return z(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 f.fromNumber(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return L(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return L(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return L(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const r=L(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(L(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return L(n.sign*i.sign,r.layer+1,r.sign*r.mag)}if(n.layer===2&&i.layer===2){const r=L(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(L(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return L(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=v(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?f.dNaN:this.layer===0?L(this.sign,0,1/this.mag):L(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=v(e);return this.sign>t.sign?1:this.sign<t.sign?-1:this.sign*this.cmpabs(e)}cmpabs(e){const t=v(e),n=this.mag>0?this.layer:-this.layer,i=t.mag>0?t.layer:-t.layer;return n>i?1:n<i?-1:this.mag>t.mag?1:this.mag<t.mag?-1:0}compare(e){return this.cmp(e)}isNan(){return isNaN(this.sign)||isNaN(this.layer)||isNaN(this.mag)}isFinite(){return isFinite(this.sign)&&isFinite(this.layer)&&isFinite(this.mag)}eq(e){const t=v(e);return this.sign===t.sign&&this.layer===t.layer&&this.mag===t.mag}equals(e){return this.eq(e)}neq(e){return!this.eq(e)}notEquals(e){return this.neq(e)}lt(e){return this.cmp(e)===-1}lte(e){return!this.gt(e)}gt(e){return this.cmp(e)===1}gte(e){return!this.lt(e)}max(e){const t=v(e);return this.lt(t)?t:this}min(e){const t=v(e);return this.gt(t)?t:this}maxabs(e){const t=v(e);return this.cmpabs(t)<0?t:this}minabs(e){const t=v(e);return this.cmpabs(t)>0?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=v(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=v(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=nn(r)),this.layer<n.layer&&(i=nn(i)),Math.abs(i-r)<=t*Math.max(Math.abs(i),Math.abs(r))}equals_tolerance(e,t){return this.eq_tolerance(e,t)}neq_tolerance(e,t){return!this.eq_tolerance(e,t)}notEquals_tolerance(e,t){return this.neq_tolerance(e,t)}lt_tolerance(e,t){const n=v(e);return!this.eq_tolerance(n,t)&&this.lt(n)}lte_tolerance(e,t){const n=v(e);return this.eq_tolerance(n,t)||this.lt(n)}gt_tolerance(e,t){const n=v(e);return!this.eq_tolerance(n,t)&&this.gt(n)}gte_tolerance(e,t){const n=v(e);return this.eq_tolerance(n,t)||this.gt(n)}pLog10(){return this.lt(f.dZero)?f.dZero:this.log10()}absLog10(){return this.sign===0?f.dNaN:this.layer>0?L(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):L(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?f.dNaN:this.layer>0?L(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):L(this.sign,0,Math.log10(this.mag))}log(e){return e=v(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?f.dNaN:this.layer===0&&e.layer===0?L(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):f.div(this.log10(),e.log10())}log2(){return this.sign<=0?f.dNaN:this.layer===0?L(this.sign,0,Math.log2(this.mag)):this.layer===1?L(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?L(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):L(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?f.dNaN:this.layer===0?L(this.sign,0,Math.log(this.mag)):this.layer===1?L(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?L(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):L(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=v(e),n=this,i=t;if(n.sign===0)return i.eq(0)?z(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return z(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:f.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return f.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 L(1,0,t);if(e.sign===0)return f.dOne;e=z(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?L(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?L(-e.sign,e.layer+1,-e.mag):f.dOne}pow_base(e){return v(e).pow(this)}root(e){const t=v(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?f.exp(f.mul(this,f.ln(this).sub(1))):f.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(z(1,0,24)))return f.fromNumber(nr(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,l=t+s;if(l===t||(t=l,i=i*n,r=360*i,s=1/r,l=t-s,l===t))return f.exp(t);t=l,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,f.exp(t)}else return this.layer===1?f.exp(f.mul(this,f.ln(this).sub(1))):f.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?f.dOne:this.layer===0&&this.mag<=709.7?f.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?L(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?L(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):L(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return f.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return L(1,2,Math.log10(this.mag)-.3010299956639812);{const e=f.div(z(this.sign,this.layer-1,this.mag),z(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=z(1,0,1)){if(e===1)return f.pow(this,t);if(e===0)return new f(t);if(this.eq(f.dOne))return f.dOne;if(this.eq(-1))return f.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return f.fromNumber(Math.E);const s=f.ln(this).neg();return s.lambertw().div(s)}else return r>1.444667861009766?f.fromNumber(Number.POSITIVE_INFINITY):f.dNaN}if(this.eq(f.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),f.fromNumber(r)}if(e<0)return f.iteratedlog(t,this,-e);t=v(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(f.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r<e;++r){const s=t;if(t=this.pow(t),s.eq(t))return t}if(i!=0){const r=this.pow(t);return t.mul(1-i).add(r.mul(i))}return t}i!==0&&(t.eq(f.dOne)?this.gt(10)?t=this.pow(i):(t=f.fromNumber(f.tetrate_critical(this.toNumber(),i)),this.lt(2)&&(t=t.sub(1).mul(this.minus(1)).plus(1))):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let r=0;r<e;++r){if(t=this.pow(t),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(t.layer-this.layer>3)return z(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=z(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return f.tetrate(e,-t,this);e=v(e);let n=f.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;s<t;++s){if(n=n.log(e),!isFinite(n.layer)||!isFinite(n.mag))return n.normalize();if(s>1e4)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 l=1;l<t;++l){const c=new f(e).tetrate(s).gt(this);if(l>1&&r!=c&&(i=!0),r=c,i?n/=2:n*=2,n=Math.abs(n)*(c?-1:1),s+=n,n===0)break}return f.fromNumber(s)}slog_internal(e=10){if(e=v(e),e.lte(f.dZero)||e.eq(f.dOne))return f.dNaN;if(e.lt(f.dOne))return this.eq(f.dOne)?f.dZero:this.eq(f.dZero)?f.dNegOne:f.dNaN;if(this.mag<0||this.eq(f.dZero))return f.dNegOne;let t=0,n=f.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(f.dZero))n=f.pow(e,n),t-=1;else{if(n.lte(f.dOne))return f.fromNumber(t+f.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=f.log(n,e)}return f.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:f.critical_section(e,t,tr)}static tetrate_critical(e,t){return f.critical_section(e,t,er)}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 l=0;l<tt.length;++l)if(tt[l]==e){i=n[l][Math.floor(t)],r=n[l][Math.ceil(t)];break}else if(tt[l]<e&&tt[l+1]>e){const o=(e-tt[l])/(tt[l+1]-tt[l]);i=n[l][Math.floor(t)]*(1-o)+n[l+1][Math.floor(t)]*o,r=n[l][Math.ceil(t)]*(1-o)+n[l+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=f.fromValue_noAlloc(e).toNumber();const t=f.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?f.tetrate(t,i):Number.isFinite(i)?i>=-1?f.log(f.tetrate(t,i+1),t):f.log(f.log(f.tetrate(t,i+2),t),t):f.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return f.fromNumber(_n(this.toNumber()));if(this.layer===0)return f.fromNumber(_n(this.sign*this.mag));if(this.layer===1)return wn(this);if(this.layer===2)return wn(this);if(this.layer>=3)return z(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return z(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=z(1,0,1)){t=v(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(f.dOne)?(++e,t=f.fromNumber(i)):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let r=0;r<e;++r){if(t=this.tetrate(t.toNumber()),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(r>10)return t}return t}sin(){return this.mag<0?this:this.layer===0?f.fromNumber(Math.sin(this.sign*this.mag)):z(0,0,0)}cos(){return this.mag<0?f.dOne:this.layer===0?f.fromNumber(Math.cos(this.sign*this.mag)):z(0,0,0)}tan(){return this.mag<0?this:this.layer===0?f.fromNumber(Math.tan(this.sign*this.mag)):z(0,0,0)}asin(){return this.mag<0?this:this.layer===0?f.fromNumber(Math.asin(this.sign*this.mag)):z(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?f.fromNumber(Math.acos(this.toNumber())):this.layer===0?f.fromNumber(Math.acos(this.sign*this.mag)):z(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?f.fromNumber(Math.atan(this.sign*this.mag)):f.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 f.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return f.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?z(Number.NaN,Number.NaN,Number.NaN):f.ln(this.add(1).div(f.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(f.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 u=f;u.fromStringCache=new Gi(Xi);u.dZero=z(0,0,0);u.dOne=z(1,0,1);u.dNegOne=z(-1,0,1);u.dTwo=z(1,0,2);u.dTen=z(1,0,10);u.dNaN=z(Number.NaN,Number.NaN,Number.NaN);u.dInf=z(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);u.dNegInf=z(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);u.dNumberMax=L(1,0,Number.MAX_VALUE);u.dNumberMin=L(1,0,Number.MIN_VALUE);v=u.fromValue_noAlloc;L=u.fromComponents;z=u.fromComponents_noNormalize;u.fromMantissaExponent;u.fromMantissaExponent_noNormalize;const ir=new u(1);function xt(e,t,n=!0){let i=u.log10(e).floor(),r=u.div(e,u.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=ir,i=i.add(1));const s=i.gte(1e9)?Ee(i,Math.max(Math.max(t,3),J.defaultDecimalsShown)):i.gte(1e4)?Wt(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+s:"e"+s}function Wt(e,t){if(e==null)return"NaN";if(e=new u(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 Dn(e,t){return e==null?"NaN":(e=new u(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),J.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const rr=new u("eeee1000"),ar=new u("e100000"),Nn=new u("e1000"),Vn=new u(1e9),or=new u(1e6),sr=new u(1e3),lr=new u(.98),ur=new u(.001),An=new u(0);function Ee(e,t,n){if(t==null&&(t=J.defaultDecimalsShown),n=n!=null?n:J.defaultShowSmall,e=new u(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+Ee(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(rr)){const i=e.slog();return i.gte(or)?"F"+Ee(i.floor()):u.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+Wt(i.floor(),0)}else{if(e.gte(ar))return xt(e,0,!1);if(e.gte(Nn))return xt(e,0);if(e.gte(Vn))return xt(e,t);if(e.gte(sr))return Wt(e,0);if(e.gte(ur)||!n)return Dn(e,t);if(e.eq(An))return 0 .toFixed(t)}return e=Ln(e),e.lt(Nn)?xt(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):Ee(e,t)+"\u207B\xB9"}function Me(e){return e=new u(e),e.sign<0?"-"+Me(e.neg()):e.gte(Vn)||e.lte(lr)&&!e.eq(An)?Ee(e):Ee(e,0)}function On(e){return u.lt(e,0)?"-"+On(u.neg(e)):u.gt(e,2**51)?Ee(u.div(e,31536e3))+"y":(e=new u(e).toNumber(),e<60?Ee(e)+"s":e<3600?Me(Math.floor(e/60))+"m "+Ee(e%60)+"s":e<86400?Me(Math.floor(e/3600))+"h "+Me(Math.floor(e/60)%60)+"m "+Me(e%60)+"s":e<31536e3?Me(Math.floor(e/84600)%365)+"d "+Me(Math.floor(e/3600)%24)+"h "+Me(Math.floor(e/60)%60)+"m":Me(Math.floor(e/31536e3))+"y "+Me(Math.floor(e/84600)%365)+"d "+Me(Math.floor(e/3600)%24)+"h")}function cr(e,t,n){e=new u(e);let i=e.toStringWithDecimalPlaces(t);return new u(i).gte(n)&&(i=u.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function dr(e,t){return Ee(e,t,!0)}function Ln(e){let t=u.log10(e).ceil();const n=u.div(e,u.pow(10,t));return t=t.neg(),e=new u(10).pow(t).times(n),e}var gr=Object.freeze(Object.defineProperty({__proto__:null,default:u,exponentialFormat:xt,commaFormat:Wt,regularFormat:Dn,format:Ee,formatWhole:Me,formatTime:On,toPlaces:cr,formatSmall:dr,invertOOM:Ln},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:fr,commaFormat:mr,regularFormat:pr,format:Tt,formatWhole:Ge,formatTime:sn,toPlaces:hr,formatSmall:ot,invertOOM:vr}=gr;window.Decimal=u;window.exponentialFormat=fr;window.commaFormat=mr;window.regularFormat=pr;window.format=Tt;window.formatWhole=Ge;window.formatTime=sn;window.toPlaces=hr;window.formatSmall=ot;window.invertOOM=vr;function It(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Ht(e){return typeof e=="function"}var R=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(R||{});const Ft=Symbol("DoNotCache");function A(e,t){const n=e[t];Ht(n)&&n.length===0&&!n[Ft]?e[t]=I(n.bind(e)):Ht(n)&&(e[t]=n.bind(e),e[t][Ft]=!0)}function ye(e){return Ht(e)&&!e[Ft]&&(e=I(e)),e}const Pt=Symbol("Component"),Kt=Symbol("GatherProps");let br=0;function Bn(e="feature-"){return e+br++}var Re=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(Re||{});function Xe(e){const t=a(e);return t!==2&&t!==!1}function Xt(e){return a(e)===1}function ne(e){return e[Ft]=!0,e}function de(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function yr(e,...t){const n=[],i=r=>{Object.keys(r).forEach(s=>{const l=r[s];l!=null&&typeof l=="object"&&(t.includes(l.type)?n.push(l):!(l instanceof u)&&!ue(l)&&i(l))})};return i(e),n}const nt={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 ln=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(ln||{}),Ve={classic:nt,paper:{...nt,variables:{...nt.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:{...nt,variables:{...nt.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:{...nt,variables:{...nt.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const Ce=Tn();"fonts"in document&&(document.fonts.onloadingdone=()=>Ce.emit("fontsLoaded"));var _r=Object.freeze(Object.defineProperty({__proto__:null,globalBus:Ce},Symbol.toStringTag,{value:"Module"}));const wr=_t({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var U=window.player=wr;function qn(e){return JSON.stringify(e,(t,n)=>a(n))}function Rn(e={}){return Object.assign({id:`${J.id}-0`,name:"Default Save",tabs:J.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:J.id,modVersion:J.versionNumber,layers:{}},e)}function ke(e){const t=Ze.compressToUTF16(qn(e!=null?e:U));return localStorage.setItem((e!=null?e:U).id,t),t}async function Nr(){Sr();try{let e=localStorage.getItem(K.active);if(e==null){await rt(pt());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Ze.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==J.id){await rt(pt());return}t.id=K.active,await rt(t)}catch(e){console.error(`Failed to load save. Falling back to new save.
|
|
`,e),await rt(pt())}}function pt(){const e=zt(),t=Rn({id:e});return ke(t),K.saves.push(e),t}function zt(){let e,t=0;do e=`${J.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const Cr=F(!1);async function rt(e){console.info("Loading save",e),Cr.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await $t(()=>Promise.resolve().then(function(){return jr}),void 0),{fixOldSave:r,getInitialLayers:s}=await $t(()=>Promise.resolve().then(function(){return pu}),void 0);for(const l in t){const o=t[l];o&&n(o)}s(e).forEach(l=>i(l,e)),e=Rn(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,J.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==J.versionNumber&&(r(e.modVersion,e),e.modVersion=J.versionNumber),Object.assign(U,e),K.active=U.id,Ce.emit("onLoad")}setInterval(()=>{U.autosave&&ke()},1e3);window.onbeforeunload=()=>{U.autosave&&ke()};window.save=ke;const kr=window.hardReset=async()=>{await rt(pt())};window.deleteLowerSaves=()=>{const e=Object.values(K.saves).indexOf(U.id)+1;Object.values(K.saves).slice(e).forEach(t=>localStorage.removeItem(t)),K.saves=K.saves.slice(0,e)};const Dt=_t({active:"",saves:[],showTPS:!0,theme:ln.Nordic,unthrottled:!1,alignUnits:!1});Fe(Dt,e=>{const t=Ze.compressToUTF16(JSON.stringify(e));localStorage.setItem(J.id,t)},{deep:!0});var K=window.settings=Dt;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:ln.Nordic,alignUnits:!1};Ce.emit("loadSettings",e),Object.assign(Dt,e),kr()};function Sr(){try{let e=localStorage.getItem(J.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Ze.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Dt,t)}Ce.emit("loadSettings",Dt)}catch{}}const xr=_t([]),Ir=_t([]),Mr=_t([]);function he(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}</${t}>`),j({template:e})):j({render:()=>({})}):e}function We(e){if(st(e))return typeof e=="function"?e():he(e);const t=e[Pt];return _(t,e[Kt](),null)}function Be(e){if(st(e))return typeof e=="function"?e():typeof e=="string"?_(ie,null,[e]):_(e,null,null);const t=e[Pt];return _(t,e[Kt](),null)}function st(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Ft]===!0}function Un(e,t){const n=F(null),i=F(void 0);function r(o){n.value||(n.value=setInterval(l,250)),i.value=o}function s(){n.value&&(clearInterval(n.value),n.value=null)}function l(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return $n(s),{start:r,stop:s,handleHolding:l}}function zn(e,t="div"){const n=Te();return Le(()=>{n.value=he(we(e),t)}),n}function Ot(e,t="div"){const n=Te(null);return Le(()=>{const i=we(e);n.value=i==""||i==null?null:he(i,t)}),n}function we(e){return a(a(e))}function q(...e){return e.includes(Object)||e.push(Object),e}var Q=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const Er=j({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var b;const n=F({}),i=new ResizeObserver(o),r=F(null);Jt(()=>{const m=r.value;m!=null&&i.observe(m)});let s=!0,l=F((b=r.value)==null?void 0:b.getBoundingClientRect());function o(){s&&(s=!1,ut(()=>{var m;l.value=(m=r.value)==null?void 0:m.getBoundingClientRect(),Object.values(n.value).filter(w=>w).forEach(w=>w.rect=w.element.getBoundingClientRect()),t("updateNodes",n.value),s=!0}))}Ce.on("fontsLoaded",o);const c={attributes:!1,childList:!0,subtree:!1};qt(un,(m,w)=>{const y=new MutationObserver(()=>d(m));y.observe(w,c),n.value[m]={element:w,observer:y,rect:w.getBoundingClientRect()},o()}),qt(cn,m=>{var w;(w=n.value[m])==null||w.observer.disconnect(),n.value[m]=void 0,o()}),qt(dn,n),qt(gn,l);function d(m){const w=n.value[m];w!=null&&(w.rect=w.element.getBoundingClientRect(),t("updateNodes",n.value))}return(m,w)=>(N(),S(ie,null,[Je(m.$slots,"default",{},void 0,!0),p("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var jn=Q(Er,[["__scopeId","data-v-2b1dc1bc"]]);const $r=["onPointerdown"],Tr={class:"modal-wrapper"},Fr={class:"modal-container"},Pr={class:"modal-header"},Dr={class:"modal-body"},Vr={class:"modal-footer"},Ar=p("div",{class:"modal-default-flex-grow"},null,-1),Qe=j({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=me(e),s=I(()=>a(r.modelValue)||o.value);function l(){n("update:modelValue",!1)}const o=F(!1),c=F(null),d=I(()=>{var b,m;return(m=(b=c.value)==null?void 0:b.nodes)!=null?m:null});return t({isOpen:s,nodes:d}),(b,m)=>(N(),Z(di,{to:"#modal-root"},[_(bt,{name:"modal",onBeforeEnter:m[0]||(m[0]=w=>o.value=!0),onAfterLeave:m[1]||(m[1]=w=>o.value=!1)},{default:O(()=>[an(p("div",qe({class:"modal-mask",onPointerdown:vt(l,["self"])},b.$attrs),[p("div",Tr,[p("div",Fr,[p("div",Pr,[Je(b.$slots,"header",{shown:a(s)},()=>[D(" default header ")])]),p("div",Dr,[_(jn,{ref_key:"contextRef",ref:c},{default:O(()=>[Je(b.$slots,"body",{shown:a(s)},()=>[D(" default body ")])]),_:3},512)]),p("div",Vr,[Je(b.$slots,"footer",{shown:a(s)},()=>[p("div",{class:"modal-default-footer"},[Ar,p("button",{class:"button modal-default-button",onClick:l}," Close ")])])])])])],16,$r),[[ci,e.modelValue]])]),_:3})]))}}),it=Symbol("ProxyState");function wt(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,l){if(l===it)return r();const o=r()[l];return o!=null&&typeof o=="object"&&Ye in o?o[Ye]:o},set(s,l,o){return r()[l]=o,!0},has(s,l){return l===it?!0:Reflect.has(r(),l)},ownKeys(){return Reflect.ownKeys(r())},getOwnPropertyDescriptor(s,l){return i||(Object.assign(n,e.call(n,n)),i=!0),Object.getOwnPropertyDescriptor(s,l)}})}var ge=window.state=on({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const ht=Symbol("PersistentState"),Vt=Symbol("DefaultValue"),Zt=Symbol("StackTrace"),Yt=Symbol("Deleted"),Ye=Symbol("NonPersistent"),at=Symbol("SaveDataPath"),Or=Symbol("SkipPersistence");function Lr(){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 Cn(e,t){var n;if(u.isNaN(t))throw ge.hasNaN||(U.autosave=!1,ge.hasNaN=!0,ge.NaNPath=e[at],ge.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[at])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[ht].value=t}function Nt(e,t=!0){const n=ue(e)?e:F(e);ue(e)&&(e=e.value);const i=I({get(){return n.value},set(s){t?Cn(r,s):r[ht].value=s}});i[Vt]=e;const r={get value(){return n.value},set value(s){t?Cn(r,s):r[ht].value=s},__v_isRef:!0,[ht]:n,[Vt]:e,[Zt]:Lr(),[Yt]:!1,[Ye]:i,[at]:void 0};return Ne.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,`
|
|
Created at:
|
|
`+r[Zt]):lt[Ne[Ne.length-1]].add(r),r}function Br(e){return e!=null&&typeof e=="object"&&ht in e}function qr(e){Ne.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):lt[Ne[Ne.length-1]].delete(e),e[Yt]=!0}Ce.on("addLayer",(e,t)=>{const n=[],i=(r,s=[])=>{let l=!1;return Object.keys(r).forEach(o=>{let c=r[o];if(c!=null&&typeof c=="object"){if(c[Or]===!0)return;if(it in c&&(c=c[it]),Br(c)){if(l=!0,c[Yt]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,`
|
|
Created at:
|
|
`+c[Zt]);return}lt[e.id].delete(c);const d=[e.id,...s,o];c[at]!=null&&JSON.stringify(d)!==JSON.stringify(c[at])&&console.error(`Persistent ref is being saved to \`${d.join(".")}\` when it's already present at \`${c[at].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[at]=d;const b=s.reduce((w,y)=>(y in w||(w[y]={}),w[y]),t),m=b[o];b[o]=c[ht],gi(b)?m!=null?b[o]=m:b[o]=c[Vt]:m!=null?b[o].value=m:b[o].value=c[Vt]}else!(c instanceof u)&&!ue(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...s,o])&&(hn(c)&&!hn(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.",it in r?r[it]:r,o):l=!0))}}),l};i(e[it]),lt[e.id].forEach(r=>{r[Yt]||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[Zt])}),lt[e.id].clear()});const un=Symbol("RegisterNode"),cn=Symbol("UnregisterNode"),dn=Symbol("Nodes"),gn=Symbol("Bounds"),_e=on({});window.layers=_e;const lt={},Ne=[];function Gn(e,t){return wt(()=>{const n={},i=n.emitter=Tn();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=F({}),n.id=e,Ne.push(e),lt[e]=new Set,n.minimized=Nt(!1,!1),Object.assign(n,t.call(n,n)),Ne[Ne.length-1]==null||Ne[Ne.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
|
|
Stack: ${Ne}
|
|
Trying to pop ${n.id}`;Ne.pop(),A(n,"color"),A(n,"display"),A(n,"classes"),A(n,"style"),A(n,"name"),de(n,"name",n.id),A(n,"minWidth"),de(n,"minWidth",600),A(n,"minimizable"),de(n,"minimizable",!0),A(n,"minimizedDisplay");const r=n.style;return n.style=I(()=>{var l,o;let s=a(n.minWidth);return(typeof s=="number"||!Number.isNaN(parseInt(s)))&&(s=s+"px"),[(l=a(r))!=null?l:"",(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 Wn(e,t){if(console.info("Adding layer",e.id),_e[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,_e[e.id]);return}de(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),_e[e.id]=e,Ce.emit("addLayer",e,t.layers[e.id])}function Rr(e){return _e[e]}function Hn(e){console.info("Removing layer",e.id),Ce.emit("removeLayer",e),_e[e.id]=void 0}function Ur(e){Hn(e),Wn(e,U)}function zr(e){const t=F(!1);return{openModal:()=>t.value=!0,modal:ne(()=>_(Qe,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>_("h2",null,[a(e.name)]),body:a(e.display)}))}}Ce.on("update",function(t){Object.values(_e).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(_e).forEach(n=>{n==null||n.emit("update",t)}),Object.values(_e).forEach(n=>{n==null||n.emit("postUpdate",t)})});var jr=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:un,UnregisterNodeInjectionKey:cn,NodesInjectionKey:dn,BoundsInjectionKey:gn,layers:_e,persistentRefs:lt,addingLayers:Ne,createLayer:Gn,addLayer:Wn,getLayer:Rr,removeLayer:Hn,reloadLayer:Ur,setupLayerModal:zr},Symbol.toStringTag,{value:"Module"}));const Gr=j({components:{Context:jn},props:{index:{type:Number,required:!0},display:{type:q(Object,String,Function),required:!0},minimizedDisplay:q(Object,String,Function),minimized:{type:Object,required:!0},name:{type:q(String),required:!0},color:q(String),minimizable:q(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=me(e),s=zn(t),l=Ot(r),o=I(()=>J.allowGoBack&&n.value>0&&!we(i));function c(){U.tabs.splice(a(e.index),1/0)}function d(b){e.nodes.value=b}return{component:s,minimizedComponent:l,showGoBack:o,updateNodes:d,unref:a,goBack:c}}}),Wr={key:1};function Hr(e,t,n,i,r,s){const l=jt("Context");return N(),S("div",{class:"layer-container",style:Pe({"--layer-color":e.unref(e.color)})},[e.showGoBack?(N(),S("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...o)=>e.goBack&&e.goBack(...o))},"\u274C")):V("",!0),e.unref(e.minimized)?(N(),S("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=o=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(N(),Z(Se(e.minimizedComponent),{key:0})):(N(),S("div",Wr,H(e.unref(e.name)),1))])):(N(),S("div",{key:2,class:ae(["layer-tab",{showGoBack:e.showGoBack}])},[_(l,{onUpdateNodes:e.updateNodes},{default:O(()=>[(N(),Z(Se(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(N(),S("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=o=>e.$emit("setMinimized",!0))}," \u25BC ")):V("",!0)],4)}var Zr=Q(Gr,[["render",Hr],["__scopeId","data-v-72dd78b1"]]);const Zn=e=>(ct("data-v-4b4bda40"),e=e(),dt(),e),Yr=Zn(()=>p("h2",null,"Changelog",-1)),Jr=Zn(()=>p("details",{open:""},[p("summary",null,[D("v0.0 Initial Commit - "),p("time",null,"2021-09-04")]),D(" 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)),Kr=j({__name:"Changelog",setup(e,{expose:t}){const n=F(!1);return t({open(){n.value=!0}}),(i,r)=>(N(),Z(Qe,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=s=>n.value=s)},{header:O(()=>[Yr]),body:O(()=>[Jr]),_:1},8,["modelValue"]))}});var Xr=Q(Kr,[["__scopeId","data-v-4b4bda40"]]),Qr=j({props:{element:Object,display:{type:q(Object,String,Function),required:!0},style:q(Object,String,Array),classes:q(Object),direction:q(String),xoffset:q(String),yoffset:q(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=me(e),r=F(!1),s=I(()=>(we(i)||r.value)&&l.value),l=Ot(n),o=Te(he(ne(()=>{const b=we(t);return b==null?"":Be(b)})));function c(b){const m=i;b.shiftKey&&m&&(m.value=!m.value,b.stopPropagation(),b.preventDefault())}const d=I(()=>we(i)&&Ve[K.theme].showPin);return{Direction:R,isHovered:r,isShown:s,comp:l,elementComp:o,unref:a,togglePinned:c,showPin:d}}});const ea={key:0,class:"material-icons pinned"};function ta(e,t,n,i,r,s){return N(),S("div",{class:ae(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=l=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=l=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...l)=>e.togglePinned&&e.togglePinned(...l))},[Je(e.$slots,"default",{},void 0,!0),e.elementComp?(N(),Z(Se(e.elementComp),{key:0})):V("",!0),_(bt,{name:"fade"},{default:O(()=>{var l;return[e.isShown?(N(),S("div",{key:0,class:ae(["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:Pe([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(l=e.unref(e.style))!=null?l:{}])},[e.showPin?(N(),S("span",ea,"push_pin")):V("",!0),e.comp?(N(),Z(Se(e.comp),{key:1})):V("",!0)],6)):V("",!0)]}),_:1})],34)}var fe=Q(Qr,[["render",ta],["__scopeId","data-v-6102fa3a"]]);const gt=e=>(ct("data-v-4f97aa40"),e=e(),dt(),e),na={class:"info-modal-header"},ia=["src","alt"],ra={class:"info-modal-title"},aa={key:0},oa={key:0},sa={key:0},la=gt(()=>p("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),ua=gt(()=>p("br",null,null,-1)),ca=gt(()=>p("br",null,null,-1)),da=["href"],ga=gt(()=>p("span",{class:"material-icons info-modal-discord"},"discord",-1)),fa=gt(()=>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"),D(" The Paper Pilot Community ")])],-1)),ma=gt(()=>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"),D(" The Modding Tree ")])],-1)),pa=gt(()=>p("br",null,null,-1));var ha=j({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:r,author:s,discordName:l,discordLink:o,versionNumber:c,versionTitle:d}=J,b=me(n),m=F(!1),w=I(()=>sn(U.timePlayed)),y=I(()=>he(ne(()=>_(ie,null,[Ir.map(We)]))));t({open(){m.value=!0}});function h(){var C;(C=a(b.changelog))==null||C.open()}return(C,$)=>(N(),Z(Qe,{modelValue:m.value,"onUpdate:modelValue":$[0]||($[0]=P=>m.value=P)},{header:O(()=>[p("div",na,[a(r)?(N(),S("img",{key:0,class:"info-modal-logo",src:a(r),alt:a(i)},null,8,ia)):V("",!0),p("div",ra,[p("h2",null,H(a(i)),1),p("h4",null,[D(" v"+H(a(c)),1),a(d)?(N(),S("span",aa,": "+H(a(d)),1)):V("",!0)])])])]),body:O(({shown:P})=>[P?(N(),S("div",oa,[a(s)?(N(),S("div",sa,"By "+H(a(s)),1)):V("",!0),la,ua,p("div",{class:"link",onClick:h},"Changelog"),ca,p("div",null,[a(o)?(N(),S("a",{key:0,href:a(o),class:"info-modal-discord-link",target:"_blank"},[ga,D(" "+H(a(l)),1)],8,da)):V("",!0)]),fa,ma,pa,p("div",null,"Time Played: "+H(a(w)),1),(N(),Z(Se(a(y))))])):V("",!0)]),_:1},8,["modelValue"]))}});var va=Q(ha,[["__scopeId","data-v-4f97aa40"]]);const ba={class:"field"},ya={key:0,class:"field-title"},Yn=j({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var l;const n=e,i=Ot(Ke(n,"title"),"span"),r=F((l=n.options.find(o=>o.value===n.modelValue))!=null?l:null);Fe(Ke(n,"modelValue"),o=>{var c;we(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)=>(N(),S("div",ba,[a(i)?(N(),S("span",ya,[(N(),Z(Se(a(i))))])):V("",!0),_(a(vi),{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 _a={class:"field"},wa=j({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=I(()=>{var s;return he((s=a(n.title))!=null?s:"<span></span>","span")}),r=I({get(){return!!n.modelValue},set(s){t("update:modelValue",s)}});return(s,l)=>(N(),S("label",_a,[an(p("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":l[0]||(l[0]=o=>ue(r)?r.value=o:null)},null,512),[[fi,a(r)]]),(N(),Z(Se(a(i))))]))}});var Oe=Q(wa,[["__scopeId","data-v-11046116"]]);const Na=["onClick"],Ca=j({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=F(!1),i=F(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,ut(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(s,l)=>(N(),S("button",{onClick:vt(r,["stop"]),class:ae(["feedback",{activated:n.value,left:e.left}])},[Je(s.$slots,"default",{},void 0,!0)],10,Na))}});var Jn=Q(Ca,[["__scopeId","data-v-01a1b95c"]]);const ka={class:"header"},Sa=p("h2",null,"Settings",-1),xa={class:"option-tabs"},Ia={key:0},Ma={key:1};var Ea=j({__name:"Options",setup(e,{expose:t}){const n=F(!1),i=F("behaviour");function r(se){return se==i.value}function s(se){i.value=se}t({isTab:r,setTab:s,save:ke,open(){n.value=!0}});const l=Object.keys(Ve).map(se=>({label:It(se),value:se})),o=I(()=>he(ne(()=>_(ie,null,[xr.map(We)])))),{showTPS:c,theme:d,unthrottled:b,alignUnits:m}=me(K),{autosave:w,offlineProd:y}=me(U),h=I({get(){return U.devSpeed===0},set(se){U.devSpeed=se?0:null}}),C=ne(()=>_("span",{class:"option-title"},[D("Unthrottled"),_("desc",null,[D("Allow the game to run as fast as possible. Not battery friendly.")])])),$=ne(()=>_("span",{class:"option-title"},[D("Offline Production"),_(fe,{display:"Save-specific",direction:R.Right},{default:()=>[D("*")]}),_("desc",null,[D("Simulate production that occurs while the game is closed.")])])),P=ne(()=>_("span",{class:"option-title"},[D("Autosave"),_(fe,{display:"Save-specific",direction:R.Right},{default:()=>[D("*")]}),_("desc",null,[D("Automatically save the game every second or when the game is closed.")])])),k=ne(()=>_("span",{class:"option-title"},[D("Pause game"),_(fe,{display:"Save-specific",direction:R.Right},{default:()=>[D("*")]}),_("desc",null,[D("Stop everything from moving.")])])),E=ne(()=>_("span",{class:"option-title"},[D("Theme"),_("desc",null,[D("How the game looks.")])])),B=ne(()=>_("span",{class:"option-title"},[D("Show TPS"),_("desc",null,[D("Show TPS meter at the bottom-left corner of the page.")])])),pe=ne(()=>_("span",{class:"option-title"},[D("Align modifier units"),_("desc",null,[D("Align numbers to the beginning of the unit in modifier view.")])]));return(se,X)=>(N(),Z(Qe,{modelValue:n.value,"onUpdate:modelValue":X[10]||(X[10]=te=>n.value=te)},{header:O(()=>[p("div",ka,[Sa,p("div",xa,[p("button",{class:ae({selected:r("behaviour")}),onClick:X[0]||(X[0]=te=>s("behaviour"))},"Behaviour",2),p("button",{class:ae({selected:r("appearance")}),onClick:X[1]||(X[1]=te=>s("appearance"))},"Appearance",2)])])]),body:O(()=>[r("behaviour")?(N(),S("div",Ia,[_(Oe,{title:a(C),modelValue:a(b),"onUpdate:modelValue":X[2]||(X[2]=te=>ue(b)?b.value=te:null)},null,8,["title","modelValue"]),a(J).enablePausing?(N(),Z(Oe,{key:0,title:a(k),modelValue:a(h),"onUpdate:modelValue":X[3]||(X[3]=te=>ue(h)?h.value=te:null)},null,8,["title","modelValue"])):V("",!0),_(Oe,{title:a($),modelValue:a(y),"onUpdate:modelValue":X[4]||(X[4]=te=>ue(y)?y.value=te:null)},null,8,["title","modelValue"]),_(Oe,{title:a(P),modelValue:a(w),"onUpdate:modelValue":X[5]||(X[5]=te=>ue(w)?w.value=te:null)},null,8,["title","modelValue"]),a(w)?V("",!0):(N(),Z(Jn,{key:1,class:"button save-button",onClick:X[6]||(X[6]=te=>a(ke)())},{default:O(()=>[D("Manually save")]),_:1}))])):V("",!0),r("appearance")?(N(),S("div",Ma,[_(Yn,{title:a(E),options:a(l),modelValue:a(d),"onUpdate:modelValue":X[7]||(X[7]=te=>ue(d)?d.value=te:null)},null,8,["title","options","modelValue"]),(N(),Z(Se(a(o)))),_(Oe,{title:a(B),modelValue:a(c),"onUpdate:modelValue":X[8]||(X[8]=te=>ue(c)?c.value=te:null)},null,8,["title","modelValue"]),_(Oe,{title:a(pe),modelValue:a(m),"onUpdate:modelValue":X[9]||(X[9]=te=>ue(m)?m.value=te:null)},null,8,["title","modelValue"])])):V("",!0)]),_:1},8,["modelValue"]))}});const $a=["onSubmit"],Ta={class:"field"},Fa={key:0,class:"field-title"},Pa=["placeholder"],Da=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=Ot(Ke(n,"title"),"span"),r=Te(null);Jt(()=>{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 l(){t("submit")}function o(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,d)=>(N(),S("form",{onSubmit:vt(l,["prevent"])},[p("div",Ta,[a(i)?(N(),S("span",Fa,[(N(),Z(Se(a(i))))])):V("",!0),e.textArea?(N(),Z(a(yi),{key:1,modelValue:a(s),"onUpdate:modelValue":d[0]||(d[0]=b=>ue(s)?s.value=b:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:o,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):an((N(),S("input",{key:2,type:"text","onUpdate:modelValue":d[1]||(d[1]=b=>ue(s)?s.value=b:null),placeholder:e.placeholder,class:ae({fullWidth:!e.title}),onBlur:o,ref_key:"field",ref:r},null,42,Pa)),[[mi,a(s)]])])],40,$a))}});var Kn=Q(Da,[["__scopeId","data-v-90bd4994"]]);const Va={key:0},Aa=["onClick","disabled"],Oa={key:0},La=["onClick"],Ba=j({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=me(e),r=F(!1);Fe(r,o=>{t("confirmingChanged",o)});function s(){if(a(i.skipConfirm)){t("click");return}r.value&&t("click"),r.value=!r.value}function l(){r.value=!1}return(o,c)=>(N(),S("span",{class:ae(["container",{confirming:r.value}])},[r.value?(N(),S("span",Va,"Are you sure?")):V("",!0),p("button",{onClick:vt(s,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(N(),S("span",Oa,"Yes")):Je(o.$slots,"default",{key:1},void 0,!0)],8,Aa),r.value?(N(),S("button",{key:1,class:"button",onClick:vt(l,["stop"])},"No",8,La)):V("",!0)],2))}});var qa=Q(Ba,[["__scopeId","data-v-2f8ef34c"]]);const Ue=e=>(ct("data-v-32313015"),e=e(),dt(),e),Ra=Ue(()=>p("div",{class:"handle material-icons"},"drag_handle",-1)),Ua={key:0,class:"actions"},za=Ue(()=>p("span",{class:"material-icons"},"content_paste",-1)),ja=Ue(()=>p("span",{class:"material-icons"},"content_copy",-1)),Ga=Ue(()=>p("span",{class:"material-icons"},"edit",-1)),Wa=Ue(()=>p("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Ha={key:1,class:"actions"},Za=Ue(()=>p("span",{class:"material-icons"},"check",-1)),Ya=Ue(()=>p("span",{class:"material-icons"},"close",-1)),Ja={key:2,class:"details"},Ka={class:"save-version"},Xa=Ue(()=>p("br",null,null,-1)),Qa={key:0},eo={key:3,class:"details"},to={key:4,class:"details error"},no=Ue(()=>p("br",null,null,-1)),io=j({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=me(n),r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),s=F(!1),l=F(!1),o=F("");Fe(s,()=>{var m;return o.value=(m=i.value.name)!=null?m:""});const c=I(()=>i.value!=null&&i.value.id===U.id),d=I(()=>{var m;return c.value?U.time:(m=i.value!=null&&i.value.time)!=null?m:0});function b(){t("editName",o.value),s.value=!1}return(m,w)=>(N(),S("div",{class:ae(["save",{active:a(c)}])},[Ra,s.value?(N(),S("div",Ha,[p("button",{onClick:b,class:"button"},[_(fe,{display:"Save",direction:a(R).Left,class:"info"},{default:O(()=>[Za]),_:1},8,["direction"])]),p("button",{onClick:w[5]||(w[5]=y=>s.value=!s.value),class:"button"},[_(fe,{display:"Cancel",direction:a(R).Left,class:"info"},{default:O(()=>[Ya]),_:1},8,["direction"])])])):(N(),S("div",Ua,[a(i).error==null&&!l.value?(N(),Z(Jn,{key:0,onClick:w[0]||(w[0]=y=>t("export")),class:"button",left:""},{default:O(()=>[_(fe,{display:"Export",direction:a(R).Left,class:"info"},{default:O(()=>[za]),_:1},8,["direction"])]),_:1})):V("",!0),a(i).error==null&&!l.value?(N(),S("button",{key:1,onClick:w[1]||(w[1]=y=>t("duplicate")),class:"button"},[_(fe,{display:"Duplicate",direction:a(R).Left,class:"info"},{default:O(()=>[ja]),_:1},8,["direction"])])):V("",!0),a(i).error==null&&!l.value?(N(),S("button",{key:2,onClick:w[2]||(w[2]=y=>s.value=!s.value),class:"button"},[_(fe,{display:"Edit Name",direction:a(R).Left,class:"info"},{default:O(()=>[Ga]),_:1},8,["direction"])])):V("",!0),_(qa,{disabled:a(c),onClick:w[3]||(w[3]=y=>t("delete")),onConfirmingChanged:w[4]||(w[4]=y=>l.value=y)},{default:O(()=>[_(fe,{display:"Delete",direction:a(R).Left,class:"info"},{default:O(()=>[Wa]),_:1},8,["direction"])]),_:1},8,["disabled"])])),a(i).error==null&&!s.value?(N(),S("div",Ja,[p("button",{class:"button open",onClick:w[6]||(w[6]=y=>t("open"))},[p("h3",null,H(a(i).name),1)]),p("span",Ka,"v"+H(a(i).modVersion),1),Xa,a(d)?(N(),S("div",Qa,"Last played "+H(a(r).format(a(d))),1)):V("",!0)])):a(i).error==null&&s.value?(N(),S("div",eo,[_(Kn,{modelValue:o.value,"onUpdate:modelValue":w[7]||(w[7]=y=>o.value=y),class:"editname",onSubmit:b},null,8,["modelValue"])])):(N(),S("div",to,[D(" Error: Failed to load save with id "+H(a(i).id),1),no,D(H(a(i).error),1)]))],2))}});var ro=Q(io,[["__scopeId","data-v-32313015"]]);const fn=e=>(ct("data-v-2a4275be"),e=e(),dt(),e),ao=fn(()=>p("h2",null,"Saves Manager",-1)),oo={class:"modal-footer"},so={class:"field"},lo=fn(()=>p("span",{class:"field-title"},"Create Save",-1)),uo={class:"field-buttons"},co={class:"footer"},go=fn(()=>p("div",{style:{"flex-grow":"1"}},null,-1)),fo=j({__name:"SavesManager",setup(e,{expose:t}){const n=F(!1),i=F(null);t({open(){n.value=!0}});const r=F(!1),s=F(""),l=F(null);Fe(s,k=>{k?ut(()=>{try{if(k[0]!=="{")if(k[0]==="e")k=decodeURIComponent(escape(atob(k)));else if(k[0]==="\u1BE1")k=Ze.decompressFromUTF16(k);else{console.warn("Unable to determine preset encoding",k),r.value=!0;return}const E=JSON.parse(k);if(typeof E!="object"){r.value=!0;return}const B=zt();E.id=B,ke(E),s.value="",r.value=!1,K.saves.push(B)}catch{r.value=!0}}):r.value=!1});let o={},c=F(Object.keys(o).reduce((k,E)=>(k.push({label:E.split("/").slice(-1)[0].slice(0,-4),value:o[E]}),k),[]));const d=on({});function b(k){if(d[k]==null){let E=localStorage.getItem(k);if(E==null)d[k]={error:"Save doesn't exist in localStorage",id:k};else if(E==="dW5kZWZpbmVk")d[k]={error:"Save is undefined",id:k};else try{if(E[0]!=="{")if(E[0]==="e")E=decodeURIComponent(escape(atob(E)));else if(E[0]==="\u1BE1")E=Ze.decompressFromUTF16(E);else return console.warn("Unable to determine preset encoding",E),r.value=!0,d[k]={error:"Unable to determine preset encoding",id:k},d[k];d[k]={...JSON.parse(E),id:k}}catch(B){d[k]={error:B,id:k},console.warn(`SavesManager: Failed to load info about save with id ${k}:
|
|
${B}
|
|
${E}`)}}return d[k]}Fe(n,k=>{k&&Object.keys(d).forEach(E=>delete d[E])});const m=I(()=>K.saves.reduce((k,E)=>(k[E]=b(E),k),{}));function w(k){let E;switch(U.id===k?E=qn(U):E=JSON.stringify(m.value[k]),J.exportEncoding){default:console.warn(`Unknown save encoding: ${J.exportEncoding}. Defaulting to lz`);case"lz":E=Ze.compressToUTF16(E);break;case"base64":E=btoa(unescape(encodeURIComponent(E)));break;case"plain":break}const B=document.createElement("textarea");B.value=E,document.body.appendChild(B),B.select(),B.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(B)}function y(k){U.id===k&&ke();const E={...m.value[k],id:zt()};ke(E),K.saves.push(E.id)}function h(k){K.saves=K.saves.filter(E=>E!==k),localStorage.removeItem(k),d[k]=void 0}function C(k){m.value[U.id].time=U.time,ke(),d[U.id]=void 0,rt(m.value[k]),d[k]=void 0}function $(k){if(l.value=k,ut(()=>{l.value=null}),k[0]!=="{")if(k[0]==="e")k=decodeURIComponent(escape(atob(k)));else if(k[0]==="\u1BE1")k=Ze.decompressFromUTF16(k);else{console.warn("Unable to determine preset encoding",k);return}const E=JSON.parse(k);E.id=zt(),ke(E),K.saves.push(E.id),C(E.id)}function P(k,E){const B=m.value[k];B!=null&&(B.name=E,U.id===k?(U.name=E,ke()):(ke(B),d[k]=void 0))}return(k,E)=>(N(),Z(Qe,{modelValue:n.value,"onUpdate:modelValue":E[4]||(E[4]=B=>n.value=B),ref_key:"modal",ref:i},{header:O(()=>[ao]),body:O(({shown:B})=>[B?(N(),Z(a(bi),{key:0,list:a(K).saves,handle:".handle",itemKey:pe=>pe},{item:O(({element:pe})=>[_(ro,{save:a(m)[pe],onOpen:se=>C(pe),onExport:se=>w(pe),onEditName:se=>P(pe,se),onDuplicate:se=>y(pe),onDelete:se=>h(pe)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):V("",!0)]),footer:O(()=>[p("div",oo,[_(Kn,{modelValue:s.value,"onUpdate:modelValue":E[0]||(E[0]=B=>s.value=B),title:"Import Save",placeholder:"Paste your save here!",class:ae({importingFailed:r.value})},null,8,["modelValue","class"]),p("div",so,[lo,p("div",uo,[p("button",{class:"button",onClick:E[1]||(E[1]=B=>C(a(pt)().id))},"New Game"),Object.keys(a(c)).length>0?(N(),Z(Yn,{key:0,options:a(c),modelValue:l.value,"onUpdate:modelValue":E[2]||(E[2]=B=>$(B)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):V("",!0)])]),p("div",co,[go,p("button",{class:"button modal-default-button",onClick:E[3]||(E[3]=B=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Xn=Q(fo,[["__scopeId","data-v-2a4275be"]]);const xe=e=>(ct("data-v-318a1c31"),e=e(),dt(),e),mo=["src","alt"],po={key:1,class:"title"},ho=xe(()=>p("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),vo={class:"discord"},bo={class:"discord-links"},yo={key:0},_o=["href"],wo=xe(()=>p("li",null,[p("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),No=xe(()=>p("li",null,[p("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Co={href:"https://forums.moddingtree.com/",target:"_blank"},ko=xe(()=>p("span",{class:"material-icons"},"forum",-1)),So=xe(()=>p("span",{class:"material-icons"},"info",-1)),xo=xe(()=>p("span",{class:"material-icons"},"library_books",-1)),Io=xe(()=>p("span",{class:"material-icons"},"settings",-1)),Mo=xe(()=>p("span",{class:"material-icons"},"library_books",-1)),Eo=xe(()=>p("span",{class:"material-icons"},"settings",-1)),$o=xe(()=>p("span",{class:"material-icons"},"info",-1)),To={href:"https://forums.moddingtree.com/",target:"_blank"},Fo=xe(()=>p("span",{class:"material-icons"},"forum",-1)),Po={class:"discord"},Do={class:"discord-links"},Vo={key:0},Ao=["href"],Oo=xe(()=>p("li",null,[p("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Lo=xe(()=>p("li",null,[p("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Bo=j({__name:"Nav",setup(e){const t=F(null),n=F(null),i=F(null),r=F(null),{useHeader:s,banner:l,title:o,discordName:c,discordLink:d,versionNumber:b}=J;function m(){window.open(d,"mywindow")}return(w,y)=>(N(),S(ie,null,[a(s)?(N(),S("div",qe({key:0,class:"nav"},w.$attrs),[a(l)?(N(),S("img",{key:0,src:a(l),class:"banner",alt:a(o)},null,8,mo)):(N(),S("div",po,H(a(o)),1)),p("div",{onClick:y[0]||(y[0]=h=>{var C;return(C=r.value)==null?void 0:C.open()}),class:"version-container"},[_(fe,{display:"Changelog",direction:a(R).Down,class:"version"},{default:O(()=>[p("span",null,"v"+H(a(b)),1)]),_:1},8,["direction"])]),ho,p("div",vo,[p("span",{onClick:m,class:"material-icons"},"discord"),p("ul",bo,[a(d)?(N(),S("li",yo,[p("a",{href:a(d),target:"_blank"},H(a(c)),9,_o)])):V("",!0),wo,No])]),p("div",null,[p("a",Co,[_(fe,{display:"Forums",direction:a(R).Down,yoffset:"5px"},{default:O(()=>[ko]),_:1},8,["direction"])])]),p("div",{onClick:y[1]||(y[1]=h=>{var C;return(C=t.value)==null?void 0:C.open()})},[_(fe,{display:"Info",direction:a(R).Down,class:"info"},{default:O(()=>[So]),_:1},8,["direction"])]),p("div",{onClick:y[2]||(y[2]=h=>{var C;return(C=n.value)==null?void 0:C.open()})},[_(fe,{display:"Saves",direction:a(R).Down,xoffset:"-20px"},{default:O(()=>[xo]),_:1},8,["direction"])]),p("div",{onClick:y[3]||(y[3]=h=>{var C;return(C=i.value)==null?void 0:C.open()})},[_(fe,{display:"Settings",direction:a(R).Down,xoffset:"-66px"},{default:O(()=>[Io]),_:1},8,["direction"])])],16)):(N(),S("div",qe({key:1,class:"overlay-nav"},w.$attrs),[p("div",{onClick:y[4]||(y[4]=h=>{var C;return(C=r.value)==null?void 0:C.open()}),class:"version-container"},[_(fe,{display:"Changelog",direction:a(R).Right,xoffset:"25%",class:"version"},{default:O(()=>[p("span",null,"v"+H(a(b)),1)]),_:1},8,["direction"])]),p("div",{onClick:y[5]||(y[5]=h=>{var C;return(C=n.value)==null?void 0:C.open()})},[_(fe,{display:"Saves",direction:a(R).Right},{default:O(()=>[Mo]),_:1},8,["direction"])]),p("div",{onClick:y[6]||(y[6]=h=>{var C;return(C=i.value)==null?void 0:C.open()})},[_(fe,{display:"Settings",direction:a(R).Right},{default:O(()=>[Eo]),_:1},8,["direction"])]),p("div",{onClick:y[7]||(y[7]=h=>{var C;return(C=t.value)==null?void 0:C.open()})},[_(fe,{display:"Info",direction:a(R).Right},{default:O(()=>[$o]),_:1},8,["direction"])]),p("div",null,[p("a",To,[_(fe,{display:"Forums",direction:a(R).Right,xoffset:"7px"},{default:O(()=>[Fo]),_:1},8,["direction"])])]),p("div",Po,[p("span",{onClick:m,class:"material-icons"},"discord"),p("ul",Do,[a(d)?(N(),S("li",Vo,[p("a",{href:a(d),target:"_blank"},H(a(c)),9,Ao)])):V("",!0),Oo,Lo])])],16)),_(va,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),_(Xn,{ref_key:"savesManager",ref:n},null,512),_(Ea,{ref_key:"options",ref:i},null,512),_(Xr,{ref_key:"changelog",ref:r},null,512)],64))}});var Qn=Q(Bo,[["__scopeId","data-v-318a1c31"]]);const qo={class:"inner-tab"},Ro=j({__name:"Game",setup(e){const t=Ke(U,"tabs"),n=I(()=>Object.keys(_e)),i=J.useHeader;function r(s){const{display:l,minimized:o,name:c,color:d,minimizable:b,nodes:m,minimizedDisplay:w}=s;return{display:l,minimized:o,name:c,color:d,minimizable:b,nodes:m,minimizedDisplay:w}}return(s,l)=>(N(),S("div",{class:ae(["tabs-container",{useHeader:a(i)}])},[(N(!0),S(ie,null,yt(a(t),(o,c)=>{var d,b;return N(),S("div",{key:c,class:ae(["tab",a((d=a(_e)[o])==null?void 0:d.classes)]),style:Pe(a((b=a(_e)[o])==null?void 0:b.style))},[c===0&&!a(i)?(N(),Z(Qn,{key:0})):V("",!0),p("div",qo,[a(n).includes(o)?(N(),Z(Zr,qe({key:0},r(a(_e)[o]),{index:c,onSetMinimized:m=>a(_e)[o].minimized.value=m}),null,16,["index","onSetMinimized"])):(N(),Z(Se(o),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var Uo=Q(Ro,[["__scopeId","data-v-dcd207b4"]]);const zo=j({__name:"Sticky",setup(e){const t=F("0"),n=new ResizeObserver(r),i=Te(null);function r(){let s=i.value;if(s==null)return;let l=0;for(;s.previousSibling;){const o=s.previousSibling;o.dataset&&"vSticky"in o.dataset&&(l+=o.offsetHeight),s=o}t.value=l+"px"}return ut(r),document.fonts.ready.then(r),Jt(()=>{var l;const s=(l=i.value)==null?void 0:l.parentElement;s&&n.observe(s)}),(s,l)=>(N(),S("div",{class:"sticky",style:Pe({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[Je(s.$slots,"default",{},void 0,!0)],4))}});var ei=Q(zo,[["__scopeId","data-v-cccac690"]]);const jo=["x1","y1","x2","y2"],Go=j({__name:"BoardLink",props:{link:null},setup(e){const n=me(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,l)=>(N(),S("line",qe({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,jo))}});var Wo=Q(Go,[["__scopeId","data-v-57c4970a"]]);const Ho={key:0},Zo=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],Yo=["fill","stroke-width","stroke"],Jo=["fill"],Ko=j({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const i=me(e),r=I(()=>Y(i.nodeType.value.size,a(i.node))),s=I(()=>{var b;return(b=Y(i.nodeType.value.outlineColor,a(i.node)))!=null?b:Ve[K.theme].variables["--outline"]}),l=I(()=>{var b;return(b=Y(i.nodeType.value.titleColor,a(i.node)))!=null?b:Ve[K.theme].variables["--foreground"]}),o=I(()=>Y(i.nodeType.value.actionDistance,a(i.node)));function c(b,m){t("clickAction",m.id),b.preventDefault(),b.stopPropagation()}function d(b,m){var w;((w=a(i.selectedAction))==null?void 0:w.id)===m.id&&(b.preventDefault(),b.stopPropagation())}return(b,m)=>(N(),Z(bt,{name:"actions",appear:""},{default:O(()=>[e.isSelected&&e.actions?(N(),S("g",Ho,[(N(!0),S(ie,null,yt(e.actions,(w,y)=>{var h,C;return N(),S("g",{key:w.id,class:ae(["action",{selected:((h=e.selectedAction)==null?void 0:h.id)===w.id}]),transform:`translate(
|
|
${(-a(r)-30)*Math.sin(((e.actions.length-1)/2-y)*a(o))},
|
|
${(a(r)+30)*Math.cos(((e.actions.length-1)/2-y)*a(o))}
|
|
)`,onMousedown:$=>c($,w),onTouchstart:$=>c($,w),onMouseup:$=>d($,w),onTouchend:vt($=>d($,w),["stop"])},[p("circle",{fill:a(Y)(w.fillColor,e.node),r:"20","stroke-width":((C=e.selectedAction)==null?void 0:C.id)===w.id?4:0,stroke:a(s)},null,8,Yo),p("text",{fill:a(l),class:"material-icons"},H(a(Y)(w.icon,e.node)),9,Jo)],42,Zo)}),128))])):V("",!0)]),_:1}))}});var Xo=Q(Ko,[["__scopeId","data-v-9efb2a56"]]);const Qo=["transform"],es={key:0},ts=["r","fill","stroke"],ns=["r","fill","stroke"],is=["r","fill"],rs=["r","stroke-dasharray","stroke-dashoffset","stroke"],as={key:1,transform:"rotate(45, 0, 0)"},os=["width","height","transform","fill","stroke"],ss=["width","height","transform","fill","stroke"],ls=["width","height","transform","fill"],us=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],cs=["fill","y"],ds=["fill"],gs={key:0},fs=["fill","y"],ms=["fill","y"],ps=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=me(n),s=I(()=>a(r.selectedNode)===a(r.node)),l=I(()=>Y(r.nodeType.value.draggable,a(r.node)));Fe(l,G=>{const ce=a(r.node);a(r.dragging)===ce&&!G&&t("endDragging",ce)});const o=I(()=>{var ce;const G=a(r.node);return(ce=Y(r.nodeType.value.actions,G))==null?void 0:ce.filter($e=>Xe(Y($e.visibility,G)))}),c=I(()=>{var ce;const G=a(r.node);if(Y(r.nodeType.value.draggable,G)&&((ce=a(r.dragging))==null?void 0:ce.id)===G.id&&a(r.dragged)!=null){const{x:$e,y:Ie}=a(r.dragged);return{x:G.position.x+Math.round($e/25)*25,y:G.position.y+Math.round(Ie/25)*25}}return G.position}),d=I(()=>Y(r.nodeType.value.shape,a(r.node))),b=I(()=>Y(r.nodeType.value.title,a(r.node))),m=I(()=>Y(r.nodeType.value.subtitle,a(r.node))),w=I(()=>{var G;return(G=s.value?a(r.selectedAction)&&Y(a(r.selectedAction).tooltip,a(r.node)):null)!=null?G:Y(r.nodeType.value.label,a(r.node))}),y=I(()=>{var G,ce;return Y((ce=(G=a(r.selectedAction))==null?void 0:G.confirmationLabel)!=null?ce:{text:"Tap again to confirm"},a(r.node))}),h=I(()=>Y(r.nodeType.value.size,a(r.node))),C=I(()=>{var G;return(G=Y(r.nodeType.value.progress,a(r.node)))!=null?G:0}),$=I(()=>Ve[K.theme].variables["--background"]),P=I(()=>{var G;return(G=Y(r.nodeType.value.outlineColor,a(r.node)))!=null?G:Ve[K.theme].variables["--outline"]}),k=I(()=>{var G;return(G=Y(r.nodeType.value.fillColor,a(r.node)))!=null?G:Ve[K.theme].variables["--raised-background"]}),E=I(()=>Y(r.nodeType.value.progressColor,a(r.node))),B=I(()=>{var G;return(G=Y(r.nodeType.value.titleColor,a(r.node)))!=null?G:Ve[K.theme].variables["--foreground"]}),pe=I(()=>Y(r.nodeType.value.progressDisplay,a(r.node))),se=I(()=>r.dragging.value!=null&&a(r.hasDragged)&&Y(r.nodeType.value.canAccept,a(r.node),r.dragging.value)),X=I(()=>Y(r.nodeType.value.style,a(r.node))),te=I(()=>Y(r.nodeType.value.classes,a(r.node)));function kt(G){t("mouseDown",G,r.node.value,l.value)}function Bt(G){var ce,$e,Ie;(ce=r.hasDragged)!=null&&ce.value||(t("endDragging",r.node.value),(Ie=($e=r.nodeType.value).onClick)==null||Ie.call($e,r.node.value),G.stopPropagation())}return(G,ce)=>{var $e,Ie,ft;return N(),S("g",{class:ae(["boardnode",{[e.node.type]:!0,isSelected:a(s),isDraggable:a(l),...a(te)}]),style:Pe([{opacity:(($e=e.dragging)==null?void 0:$e.id)===e.node.id&&e.hasDragged?.5:1},(Ie=a(X))!=null?Ie:[]]),transform:`translate(${a(c).x},${a(c).y})${a(s)?" scale(1.2)":""}`},[_(Xo,{actions:(ft=a(o))!=null?ft:[],"is-selected":a(s),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:ce[0]||(ce[0]=Ae=>t("clickAction",Ae))},null,8,["actions","is-selected","node","node-type","selected-action"]),p("g",{class:"node-container",onMousedown:kt,onTouchstartPassive:kt,onMouseup:Bt,onTouchendPassive:Bt},[a(d)===a(He).Circle?(N(),S("g",es,[a(se)?(N(),S("circle",{key:0,class:"receiver",r:a(h)+8,fill:a($),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,ts)):V("",!0),p("circle",{class:"body",r:a(h),fill:a(k),stroke:a(P),"stroke-width":4},null,8,ns),a(pe)===a(At).Fill?(N(),S("circle",{key:1,class:"progress progressFill",r:Math.max(a(h)*a(C)-2,0),fill:a(E)},null,8,is)):(N(),S("circle",{key:2,r:a(h)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(a(h)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(a(h)+4.5)*2*Math.PI-a(C)*(a(h)+4.5)*2*Math.PI,stroke:a(E)},null,8,rs))])):a(d)===a(He).Diamond?(N(),S("g",as,[a(se)?(N(),S("rect",{key:0,class:"receiver",width:a(h)*a(i)+16,height:a(h)*a(i)+16,transform:`translate(${-(a(h)*a(i)+16)/2}, ${-(a(h)*a(i)+16)/2})`,fill:a($),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,os)):V("",!0),p("rect",{class:"body",width:a(h)*a(i),height:a(h)*a(i),transform:`translate(${-a(h)*a(i)/2}, ${-a(h)*a(i)/2})`,fill:a(k),stroke:a(P),"stroke-width":4},null,8,ss),a(pe)===a(At).Fill?(N(),S("rect",{key:1,class:"progress progressFill",width:Math.max(a(h)*a(i)*a(C)-2,0),height:Math.max(a(h)*a(i)*a(C)-2,0),transform:`translate(${-Math.max(a(h)*a(i)*a(C)-2,0)/2}, ${-Math.max(a(h)*a(i)*a(C)-2,0)/2})`,fill:a(E)},null,8,ls)):(N(),S("rect",{key:2,class:"progress progressDiamond",width:a(h)*a(i)+9,height:a(h)*a(i)+9,transform:`translate(${-(a(h)*a(i)+9)/2}, ${-(a(h)*a(i)+9)/2})`,fill:"transparent","stroke-dasharray":(a(h)*a(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(a(h)*a(i)+9)*4-a(C)*(a(h)*a(i)+9)*4,stroke:a(E)},null,8,us))])):V("",!0),p("text",{fill:a(B),class:"node-title",y:a(m)?10:0},H(a(b)),9,cs),a(m)?(N(),S("text",{key:2,fill:a(B),class:"node-subtitle",y:"-15"},H(a(m)),9,ds)):V("",!0)],32),_(bt,{name:"fade",appear:""},{default:O(()=>{var Ae;return[a(w)?(N(),S("g",gs,[p("text",{fill:(Ae=a(w).color)!=null?Ae:a(B),class:ae(["node-title",{pulsing:a(w).pulsing}]),y:-a(h)-20},H(a(w).text),11,fs)])):V("",!0)]}),_:1}),_(bt,{name:"fade",appear:""},{default:O(()=>{var Ae;return[a(s)&&e.selectedAction?(N(),S("text",{key:0,fill:(Ae=a(y).color)!=null?Ae:a(B),class:ae(["node-title",{pulsing:a(y).pulsing}]),y:a(h)+75},H(a(y).text),11,ms)):V("",!0)]}),_:1})],14,Qo)}}});var hs=Q(ps,[["__scopeId","data-v-4654be02"]]);const vs={class:"stage",width:"100%",height:"100%"},bs={class:"g1"},ys=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=me(e),i=F({x:0,y:0}),r=F({x:0,y:0}),s=F(!1),l=F(null),o=I(()=>{const y=n.nodes.value.slice();if(n.draggingNode.value){const h=y.splice(y.indexOf(n.draggingNode.value),1)[0];y.push(h)}return y});Le(()=>{const y=n.draggingNode.value;if(y==null)return null;const h={x:y.position.x+r.value.x,y:y.position.y+r.value.y};let C=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce(($,P)=>{if(P.id===y.id)return $;const k=n.types.value[P.type];if(!Y(k.canAccept,P,y))return $;const B=Math.pow(h.x-P.position.x,2)+Math.pow(h.y-P.position.y,2);let pe=Y(k.size,P);return B>C||B>pe*pe?$:(C=B,P)},null))});function c(y){y.setTransformOrigin(null),y.moveTo(l.value.$el.clientWidth/2,l.value.$el.clientHeight/2)}function d(y,h=null,C=!1){if(n.draggingNode.value==null){y.preventDefault(),y.stopPropagation();let $,P;if("touches"in y)if(y.touches.length===1)$=y.touches[0].clientX,P=y.touches[0].clientY;else return;else $=y.clientX,P=y.clientY;i.value={x:$,y:P},r.value={x:0,y:0},s.value=!1,C&&n.setDraggingNode.value(h)}h!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function b(y){const{x:h,y:C,scale:$}=l.value.panZoomInstance.getTransform();let P,k;if("touches"in y)if(y.touches.length===1)P=y.touches[0].clientX,k=y.touches[0].clientY;else{m(n.draggingNode.value),n.mousePosition.value=null;return}else P=y.clientX,k=y.clientY;n.mousePosition.value={x:(P-h)/$,y:(k-C)/$},r.value={x:r.value.x+(P-i.value.x)/$,y:r.value.y+(k-i.value.y)/$},i.value={x:P,y:k},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(s.value=!0),n.draggingNode.value!=null&&(y.preventDefault(),y.stopPropagation())}function m(y){var h,C;if(n.draggingNode.value!=null&&n.draggingNode.value===y){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 $=n.nodes.value;$.push($.splice($.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((C=(h=n.types.value[n.receivingNode.value.type]).onDrop)==null||C.call(h,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(y,h){n.state.value.selectedAction===h?a(n.selectedAction).onClick(a(n.selectedNode)):n.state.value={...n.state.value,selectedAction:h}}return(y,h)=>{const C=jt("panZoom");return a(Xe)(e.visibility)?(N(),Z(C,{key:0,style:Pe([{width:e.width,height:e.height},e.style]),class:ae(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:l,onInit:c,onMousemove:b,onTouchmove:b,onMousedown:h[0]||(h[0]=$=>d($)),onTouchstart:h[1]||(h[1]=$=>d($)),onMouseup:h[2]||(h[2]=()=>m(a(e.draggingNode))),onTouchendPassive:h[3]||(h[3]=()=>m(a(e.draggingNode))),onMouseleave:h[4]||(h[4]=()=>m(a(e.draggingNode)))},{default:O(()=>[(N(),S("svg",vs,[p("g",bs,[_(vn,{name:"link",appear:""},{default:O(()=>[(N(!0),S(ie,null,yt(a(e.links)||[],$=>(N(),S("g",{key:`${$.startNode.id}-${$.endNode.id}`},[_(Wo,{link:$},null,8,["link"])]))),128))]),_:1}),_(vn,{name:"grow",duration:500,appear:""},{default:O(()=>[(N(!0),S(ie,null,yt(a(o),$=>{var P;return N(),S("g",{key:$.id,style:{"transition-duration":"0s"}},[_(hs,{node:$,nodeType:e.types[$.type],dragging:a(e.draggingNode),dragged:a(e.draggingNode)===$?r.value:void 0,hasDragged:s.value,receivingNode:((P=a(e.receivingNode))==null?void 0:P.id)===$.id,selectedNode:a(e.selectedNode),selectedAction:a(e.selectedAction),onMouseDown:d,onEndDragging:m,onClickAction:k=>w($,k)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","selectedNode","selectedAction","onClickAction"])])}),128))]),_:1})])]))]),_:1},8,["style","class","options"])):V("",!0)}}});Ce.on("setupVue",e=>_i.install(e));const ti=Symbol("Board");var At=(e=>(e.Outline="Outline",e.Fill="Fill",e))(At||{}),He=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(He||{});function _s(e){const t=Nt({nodes:[],selectedNode:null,selectedAction:null},!1);return wt(n=>{const i=e.call(n,n);i.id=Bn("board-"),i.type=ti,i[Pt]=ys,i.state?(qr(t),A(i,"state")):(t[Vt]={nodes:i.startNodes().map((o,c)=>(o.id=c,o)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=I(()=>a(l.state).nodes),i.selectedNode=I({get(){return l.nodes.value.find(o=>o.id===a(l.state).selectedNode)||null},set(o){var c,d;ue(l.state)?l.state.value={...l.state.value,selectedNode:(c=o==null?void 0:o.id)!=null?c:null}:l.state.selectedNode=(d=o==null?void 0:o.id)!=null?d:null}}),i.selectedAction=I({get(){const o=l.selectedNode.value;if(o==null)return null;const c=l.types[o.type];return c.actions==null?null:c.actions.find(d=>d.id===a(l.state).selectedAction)||null},set(o){var c,d;ue(l.state)?l.state.value={...l.state.value,selectedAction:(c=o==null?void 0:o.id)!=null?c:null}:l.state.selectedAction=(d=o==null?void 0:o.id)!=null?d:null}}),i.selectedAction=I(()=>{const o=l.selectedNode.value;if(o==null)return null;const c=l.types[o.type];return c.actions==null?null:c.actions.find(d=>d.id===a(l.state).selectedAction)||null}),i.mousePosition=F(null),i.links?A(i,"links"):i.links=I(()=>l.selectedAction.value==null?null:l.selectedAction.value.links&&l.selectedNode.value?Y(l.selectedAction.value.links,l.selectedNode.value):null),i.draggingNode=F(null),i.receivingNode=F(null),A(i,"visibility"),de(i,"visibility",Re.Visible),A(i,"width"),de(i,"width","100%"),A(i,"height"),de(i,"height","100%"),A(i,"classes"),A(i,"style");for(const o in i.types){const c=i.types[o];if(A(c,"title"),A(c,"subtitle"),A(c,"label"),A(c,"size"),de(c,"size",50),A(c,"style"),A(c,"classes"),A(c,"draggable"),de(c,"draggable",!1),A(c,"shape"),de(c,"shape","Circle"),A(c,"canAccept"),de(c,"canAccept",!1),A(c,"progress"),A(c,"progressDisplay"),de(c,"progressDisplay","Fill"),A(c,"progressColor"),de(c,"progressColor","none"),A(c,"fillColor"),A(c,"outlineColor"),A(c,"titleColor"),A(c,"actionDistance"),de(c,"actionDistance",Math.PI/6),c.nodes=I(()=>a(l.state).nodes.filter(d=>d.type===o)),de(c,"onClick",function(d){a(l.state).selectedNode=d.id}),c.actions)for(const d of c.actions)A(d,"visibility"),de(d,"visibility",Re.Visible),A(d,"icon"),A(d,"fillColor"),A(d,"tooltip"),A(d,"confirmationLabel"),de(d,"confirmationLabel",{text:"Tap again to confirm"}),A(d,"links")}function r(o){i.draggingNode.value=o}function s(o){i.receivingNode.value=o}i.placeInAvailableSpace=function(o,c=100,d=R.Right){const b=l.nodes.value.slice().filter(m=>m===o||(d===R.Down||d===R.Up)&&Math.abs(m.position.x-o.position.x)>c||(d===R.Left||d===R.Right)&&Math.abs(m.position.y-o.position.y)>c?!1:!(d===R.Right&&m.position.x<o.position.x-c||d===R.Left&&m.position.x>o.position.x+c||d===R.Up&&m.position.y>o.position.y+c||d===R.Down&&m.position.y<o.position.y-c)).sort(d===R.Right?(m,w)=>m.position.x-w.position.x:d===R.Left?(m,w)=>w.position.x-m.position.x:d===R.Up?(m,w)=>w.position.y-m.position.y:(m,w)=>m.position.y-w.position.y);for(let m=0;m<b.length;m++){const w=b[m],y=d===R.Right||d===R.Left?Math.abs(o.position.x-w.position.x):Math.abs(o.position.y-w.position.y);if(y<c)d===R.Right?o.position.x=w.position.x+c:d===R.Left?o.position.x=w.position.x-c:d===R.Up?o.position.y=w.position.y-c:d===R.Down&&(o.position.y=w.position.y+c);else if(m>0&&y>c)break}},i[Kt]=function(){const{nodes:o,types:c,state:d,visibility:b,width:m,height:w,style:y,classes:h,links:C,selectedAction:$,selectedNode:P,mousePosition:k,draggingNode:E,receivingNode:B}=this;return{nodes:o,types:c,state:d,visibility:b,width:m,height:w,style:a(y),classes:h,links:C,selectedAction:$,selectedNode:P,mousePosition:k,draggingNode:E,receivingNode:B,setDraggingNode:r,setReceivingNode:s}};const l=i;return l})}function Y(e,t,...n){return Ht(e)?e(t,...n):a(e)}function kn(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const Mt={};Ce.on("addLayer",e=>{const t=yr(e,ti);Mt[e.id]=e.on("postUpdate",n=>{t.forEach(i=>{Object.values(i.types).forEach(r=>r.nodes.value.forEach(s=>{var l;return(l=r.update)==null?void 0:l.call(r,s,n)}))})})});Ce.on("removeLayer",e=>{var t;(t=Mt[e.id])==null||t.call(Mt),Mt[e.id]=void 0});function ws(e,t="points",n=0,i=void 0){const r=ue(e)?e:Nt(e);if(r.displayName=t,r.precision=n,r.small=i,!ue(e)){const s=r[Ye];s.displayName=t,s.precision=n,s.small=i}return r}new u("10^^8");new u("1e100");Ce.on("setupVue",e=>e.use(wi));function Ns(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 Cs=j({props:{visibility:{type:q(Number,Boolean),required:!0},display:{type:q(Object,String,Function),required:!0},style:q(String,Object,Array),classes:q(Object),glowColor:q(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=me(e),s=zn(n),l=I(()=>{const c=we(i);return c==null||c===""?{}:a(r)?Ns(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function o(){t("selectTab")}return{selectTab:o,component:s,glowColorStyle:l,unref:a,Visibility:Re,isVisible:Xe,isHidden:Xt}}});function ks(e,t,n,i,r,s){var l;return e.isVisible(e.visibility)?(N(),S("button",{key:0,onClick:t[0]||(t[0]=(...o)=>e.selectTab&&e.selectTab(...o)),class:ae(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:Pe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(l=e.unref(e.style))!=null?l:{}])},[(N(),Z(Se(e.component)))],6)):V("",!0)}var ni=Q(Cs,[["render",ks],["__scopeId","data-v-21427abb"]]);const Ss=j({props:{visibility:{type:q(Number,Boolean),required:!0},activeTab:{type:q(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:q(Object),required:!0},style:q(String,Object,Array),classes:q(Object),buttonContainerStyle:q(String,Object,Array),buttonContainerClasses:q(Object)},components:{Sticky:ei,TabButton:ni},setup(e){const{activeTab:t}=me(e),n=I(()=>Ve[K.theme].floatingTabs),i=Te("");Le(()=>{const o=we(t);if(o==null){i.value="";return}if(st(o)){i.value=he(o);return}i.value=he(a(o.display))});const r=I(()=>{const o=we(t);return st(o)||!o?void 0:a(o.classes)}),s=I(()=>{const o=we(t);return st(o)||!o?void 0:a(o.style)});function l(o){const{display:c,style:d,classes:b,glowColor:m,visibility:w}=o;return{display:c,style:a(d),classes:b,glowColor:m,visibility:w}}return{floating:n,tabClasses:r,tabStyle:s,Visibility:Re,component:i,gatherButtonProps:l,unref:a,isVisible:Xe,isHidden:Xt}}});function xs(e,t,n,i,r,s){var c,d;const l=jt("TabButton"),o=jt("Sticky");return e.isVisible(e.visibility)?(N(),S("div",{key:0,class:ae(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:Pe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(d=e.tabStyle)!=null?d:[]])},[_(o,{class:ae(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:Pe(e.unref(e.buttonContainerStyle))},{default:O(()=>[p("div",{class:ae(["tab-buttons",{floating:e.floating}])},[(N(!0),S(ie,null,yt(e.unref(e.tabs),(b,m)=>(N(),Z(l,qe({onSelectTab:w=>e.selected.value=m,floating:e.floating,key:m,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)?(N(),Z(Se(e.unref(e.component)),{key:0})):V("",!0)],6)):V("",!0)}var Is=Q(Ss,[["render",xs],["__scopeId","data-v-58dbf83a"]]);const Ms=Symbol("TabButton"),Es=Symbol("TabFamily");function $s(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=Nt(Object.keys(e)[0],!1);return wt(i=>{var l;const r=(l=t==null?void 0:t.call(i,i))!=null?l:{};r.id=Bn("tabFamily-"),r.type=Es,r[Pt]=Is,r.tabs=Object.keys(e).reduce((o,c)=>{const d=e[c]();return d.type=Ms,d[Pt]=ni,A(d,"visibility"),de(d,"visibility",Re.Visible),A(d,"tab"),A(d,"display"),A(d,"classes"),A(d,"style"),A(d,"glowColor"),o[c]=d,o},{}),r.selected=n,r.activeTab=I(()=>{const o=a(s.tabs);if(n.value in o&&Xe(o[n.value].visibility))return a(o[n.value].tab);const c=Object.values(o).find(d=>Xe(d.visibility));return c?a(c.tab):null}),A(r,"visibility"),de(r,"visibility",Re.Visible),A(r,"classes"),A(r,"style"),A(r,"buttonContainerClasses"),A(r,"buttonContainerStyle"),r[Kt]=function(){const{visibility:o,activeTab:c,selected:d,tabs:b,style:m,classes:w,buttonContainerClasses:y,buttonContainerStyle:h}=this;return{visibility:o,activeTab:c,selected:d,tabs:b,style:a(m),classes:w,buttonContainerClasses:y,buttonContainerStyle:h}};const s=r;return s})}const ii=u.ln(10);function Et(e){return e}function Ts(e,t){if(x(t))return t.invert(u.neg(e));throw new Error("Could not invert due to no input being a variable")}function Fs(e,t){if(x(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 Ps(e){return g.neg(e)}function Ds(e,t,n){if(x(t))return t.invert(u.sub(e,oe(n)));if(x(n))return n.invert(u.sub(e,oe(t)));throw new Error("Could not invert due to no input being a variable")}function Vs(e,t,n){var i,r;if(x(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(x(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 As(e,t,n){if(x(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(x(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 Os(e,t,n){if(x(t))return t.invert(u.add(e,oe(n)));if(x(n))return n.invert(u.sub(oe(t),e));throw new Error("Could not invert due to no input being a variable")}function Ls(e,t,n){var i,r;if(x(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(x(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 Bs(e,t,n){if(x(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(x(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 qs(e,t,n){if(x(t))return t.invert(u.div(e,oe(n)));if(x(n))return n.invert(u.div(e,oe(t)));throw new Error("Could not invert due to no input being a variable")}function Rs(e,t,n){if(x(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(x(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 Us(e,t,n){if(x(t))return g.div(e,n);if(x(n))return g.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function zs(e,t,n){if(x(t))return t.invert(u.mul(e,oe(n)));if(x(n))return n.invert(u.div(oe(t),e));throw new Error("Could not invert due to no input being a variable")}function js(e,t,n){if(x(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(x(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 Gs(e,t,n){if(x(t))return g.mul(e,n);if(x(n))return g.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Ws(e,t){if(x(t))return t.invert(u.recip(e));throw new Error("Could not invert due to no input being a variable")}function Hs(e,t){if(x(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 Zs(e,t){if(x(t))return t.invert(u.pow10(e));throw new Error("Could not invert due to no input being a variable")}function Ys(e){return u.ln(e).sub(1).times(e).div(ii)}function Js(e,t){if(x(t)){const n=ii.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 Ks(e,t){if(x(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:Ys,invert:Js})}throw new Error("Could not integrate due to no input being a variable")}function Xs(e,t,n){if(x(t))return t.invert(u.pow(oe(n),e));if(x(n))return n.invert(u.root(oe(t),e));throw new Error("Could not invert due to no input being a variable")}function Qs(e,t){return u.ln(e).sub(1).times(e).div(u.ln(t))}function el(e,t,n){if(x(t)){const i=u.ln(oe(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 tl(e,t,n){if(x(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:Qs,invert:el})}throw new Error("Could not integrate due to no input being a variable")}function nl(e,t){if(x(t))return t.invert(u.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function il(e){return u.ln(e).sub(1).times(e).div(u.ln(2))}function rl(e,t){if(x(t)){const n=u.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 al(e,t){if(x(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:il,invert:rl})}throw new Error("Could not integrate due to no input being a variable")}function ol(e,t){if(x(t))return t.invert(u.exp(e));throw new Error("Could not invert due to no input being a variable")}function sl(e){return u.ln(e).sub(1).times(e)}function ll(e,t){if(x(t))return t.invert(u.div(e,u.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function ul(e,t){if(x(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:sl,invert:ll})}throw new Error("Could not integrate due to no input being a variable")}function cl(e,t,n){if(x(t))return t.invert(u.root(e,oe(n)));if(x(n))return n.invert(u.ln(e).div(u.ln(oe(t))));throw new Error("Could not invert due to no input being a variable")}function dl(e,t,n){if(x(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(x(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 gl(e,t){if(x(t))return t.invert(u.root(e,10));throw new Error("Could not invert due to no input being a variable")}function fl(e,t){if(x(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 ml(e,t,n){if(x(t))return t.invert(u.ln(e).div(oe(n)));if(x(n))return n.invert(u.root(oe(t),e));throw new Error("Could not invert due to no input being a variable")}function pl(e,t,n){if(x(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(x(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 hl(e,t,n){if(x(t))return t.invert(u.root(e,u.recip(oe(n))));if(x(n))return n.invert(u.ln(oe(t)).div(u.ln(e)));throw new Error("Could not invert due to no input being a variable")}function vl(e,t,n){if(x(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 bl(e,t){if(x(t))return t.invert(u.ln(e));throw new Error("Could not invert due to no input being a variable")}function yl(e,t){if(x(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 _l(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){const i=u.minabs(t,1e308).toNumber();return u.tetrate(e,i,n)}function wl(e,t,n,i){if(x(t))return t.invert(u.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function Nl(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){const i=u.minabs(t,1e308).toNumber();return u.iteratedexp(e,i,new u(n))}function Cl(e,t,n,i){if(x(t))return t.invert(u.iteratedlog(e,Math.E,u.minabs(1e308,oe(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function kl(e,t=10,n=2){const i=u.minabs(n,1e308).toNumber();return u.iteratedlog(e,t,i)}function Sl(e,t=10){const n=u.minabs(t,1e308).toNumber();return u.slog(e,n)}function xl(e,t,n){if(x(t))return t.invert(u.tetrate(e,u.minabs(1e308,oe(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Il(e,t,n){const i=u.minabs(t,1e308).toNumber();return u.layeradd(e,i,n)}function Ml(e,t,n,i){if(x(t))return t.invert(u.layeradd(e,u.minabs(1e308,oe(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function El(e,t){if(x(t))return t.invert(u.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function $l(e,t){if(x(t))return t.invert(u.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function Tl(e,t,n){const i=u.minabs(t,1e308).toNumber();return u.pentate(e,i,n)}function Fl(e,t){if(x(t))return t.invert(u.asin(e));throw new Error("Could not invert due to no input being a variable")}function Pl(e,t){if(x(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 Dl(e,t){if(x(t))return t.invert(u.acos(e));throw new Error("Could not invert due to no input being a variable")}function Vl(e,t){if(x(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 Al(e,t){if(x(t))return t.invert(u.atan(e));throw new Error("Could not invert due to no input being a variable")}function Ol(e,t){if(x(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 Ll(e,t){if(x(t))return t.invert(u.sin(e));throw new Error("Could not invert due to no input being a variable")}function Bl(e,t){if(x(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 ql(e,t){if(x(t))return t.invert(u.cos(e));throw new Error("Could not invert due to no input being a variable")}function Rl(e,t){if(x(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 Ul(e,t){if(x(t))return t.invert(u.tan(e));throw new Error("Could not invert due to no input being a variable")}function zl(e,t){if(x(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 jl(e,t){if(x(t))return t.invert(u.asinh(e));throw new Error("Could not invert due to no input being a variable")}function Gl(e,t){if(x(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 Wl(e,t){if(x(t))return t.invert(u.acosh(e));throw new Error("Could not invert due to no input being a variable")}function Hl(e,t){if(x(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 Zl(e,t){if(x(t))return t.invert(u.atanh(e));throw new Error("Could not invert due to no input being a variable")}function Yl(e,t){if(x(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 Jl(e,t){if(x(t))return t.invert(u.sinh(e));throw new Error("Could not invert due to no input being a variable")}function Kl(e,t){if(x(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 Xl(e,t){if(x(t))return t.invert(u.cosh(e));throw new Error("Could not invert due to no input being a variable")}function Ql(e,t){if(x(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 eu(e,t){if(x(t))return t.invert(u.tanh(e));throw new Error("Could not invert due to no input being a variable")}function tu(e,t){if(x(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 Ct(e){return(t,n)=>new g({inputs:[t,n],evaluate:e,invert:Et})}function x(e){return e instanceof re&&e.hasVariable()}function oe(e,t){return e instanceof re?e.evaluate(t):a(e)}function nu(){return g.pow(this,2).div(2)}function iu(){return this}const le=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"&&Ye in n?n[Ye]:n)),"variable"in e?(typeof e.variable=="object"&&Ye in e.variable&&(e.variable=e.variable[Ye]),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:nu,internalIntegrateInner:iu,applySubstitution:Et}}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:l}=e,o=t.reduce((b,m)=>b+(m instanceof le?m.internalVariables:0),0),c=t.find(b=>b instanceof le&&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:l,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=>oe(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:oe(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof le&&e.inputs[n]instanceof le?t.equals(e.inputs[n]):!(t instanceof le)&&!(e.inputs[n]instanceof le)&&u.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=F(0),r=n(g.variable(i)),s=ye(t);function l(c){return u.lt(c,a(s))?c:(i.value=u.sub(c,a(s)),u.add(r.evaluate(),a(s)))}function o(c,d){if(x(d)&&r.isInvertible())return u.gt(c,a(s))&&(c=u.add(r.invert(u.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:l,invert:r.isInvertible()&&r.hasVariable()?o:void 0})}static if(e,t,n,i){const r=F(0),s=g.variable(r),l=n(s),o=i==null?void 0:i(s),c=ye(t);function d(m){return a(c)?(r.value=m,l.evaluate()):o?(r.value=m,o.evaluate()):m}function b(m,w){if(!x(w)||!l.isInvertible()||o!=null&&!o.isInvertible())throw new Error("Could not invert due to no input being a variable");return a(c)?w.invert(l.invert(m)):o?w.invert(o.invert(m)):w.invert(m)}return new g({inputs:[e],evaluate:d,invert:l.isInvertible()&&l.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:u.abs})}static neg(e){return new g({inputs:[e],evaluate:u.neg,invert:Ts,applySubstitution:Ps,integrate:Fs})}static sign(e){return new g({inputs:[e],evaluate:u.sign})}static round(e){return new g({inputs:[e],evaluate:u.round})}static floor(e){return new g({inputs:[e],evaluate:u.floor})}static ceil(e){return new g({inputs:[e],evaluate:u.ceil})}static trunc(e){return new g({inputs:[e],evaluate:u.trunc})}static add(e,t){return new g({inputs:[e,t],evaluate:u.add,invert:Ds,integrate:Vs,integrateInner:As,applySubstitution:Et})}static sub(e,t){return new g({inputs:[e,t],evaluate:u.sub,invert:Os,integrate:Ls,integrateInner:Bs,applySubstitution:Et})}static mul(e,t){return new g({inputs:[e,t],evaluate:u.mul,invert:qs,integrate:Rs,applySubstitution:Us})}static div(e,t){return new g({inputs:[e,t],evaluate:u.div,invert:zs,integrate:js,applySubstitution:Gs})}static recip(e){return new g({inputs:[e],evaluate:u.recip,invert:Ws,integrate:Hs})}static clamp(e,t,n){return new g({inputs:[e,t,n],evaluate:u.clamp,invert:Et})}static pLog10(e){return new g({inputs:[e],evaluate:u.pLog10})}static absLog10(e){return new g({inputs:[e],evaluate:u.absLog10})}static log10(e){return new g({inputs:[e],evaluate:u.log10,invert:Zs,integrate:Ks})}static log(e,t){return new g({inputs:[e,t],evaluate:u.log,invert:Xs,integrate:tl})}static log2(e){return new g({inputs:[e],evaluate:u.log2,invert:nl,integrate:al})}static ln(e){return new g({inputs:[e],evaluate:u.ln,invert:ol,integrate:ul})}static pow(e,t){return new g({inputs:[e,t],evaluate:u.pow,invert:cl,integrate:dl})}static pow10(e){return new g({inputs:[e],evaluate:u.pow10,invert:gl,integrate:fl})}static pow_base(e,t){return new g({inputs:[e,t],evaluate:u.pow_base,invert:ml,integrate:pl})}static root(e,t){return new g({inputs:[e,t],evaluate:u.root,invert:hl,integrate:vl})}static factorial(e){return new g({inputs:[e],evaluate:u.factorial})}static gamma(e){return new g({inputs:[e],evaluate:u.gamma})}static lngamma(e){return new g({inputs:[e],evaluate:u.lngamma})}static exp(e){return new g({inputs:[e],evaluate:u.exp,invert:bl,integrate:yl})}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=u.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:_l,invert:wl})}static iteratedexp(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:Nl,invert:Cl})}static iteratedlog(e,t=10,n=1){return new g({inputs:[e,t,n],evaluate:kl})}static slog(e,t=10){return new g({inputs:[e,t],evaluate:Sl,invert:xl})}static layeradd10(e,t){return new g({inputs:[e,t],evaluate:u.layeradd10})}static layeradd(e,t,n=10){return new g({inputs:[e,t,n],evaluate:Il,invert:Ml})}static lambertw(e){return new g({inputs:[e],evaluate:u.lambertw,invert:El})}static ssqrt(e){return new g({inputs:[e],evaluate:u.ssqrt,invert:$l})}static pentate(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:Tl})}static sin(e){return new g({inputs:[e],evaluate:u.sin,invert:Ll,integrate:Pl})}static cos(e){return new g({inputs:[e],evaluate:u.cos,invert:ql,integrate:Vl})}static tan(e){return new g({inputs:[e],evaluate:u.tan,invert:Ul,integrate:Ol})}static asin(e){return new g({inputs:[e],evaluate:u.asin,invert:Fl,integrate:Bl})}static acos(e){return new g({inputs:[e],evaluate:u.acos,invert:Dl,integrate:Rl})}static atan(e){return new g({inputs:[e],evaluate:u.atan,invert:Al,integrate:zl})}static sinh(e){return new g({inputs:[e],evaluate:u.sinh,invert:Jl,integrate:Gl})}static cosh(e){return new g({inputs:[e],evaluate:u.cosh,invert:Xl,integrate:Hl})}static tanh(e){return new g({inputs:[e],evaluate:u.tanh,invert:eu,integrate:Yl})}static asinh(e){return new g({inputs:[e],evaluate:u.asinh,invert:jl,integrate:Kl})}static acosh(e){return new g({inputs:[e],evaluate:u.acosh,invert:Wl,integrate:Ql})}static atanh(e){return new g({inputs:[e],evaluate:u.atanh,invert:Zl,integrate:tu})}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=u.fromComponents_noNormalize(1,0,1)){return g.tetrate(this,e,t)}iteratedexp(e=2,t=u.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=u.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 re=le;re.negate=le.neg;re.negated=le.neg;re.sgn=le.sign;re.plus=le.add;re.subtract=le.sub;re.minus=le.sub;re.multiply=le.mul;re.times=le.mul;re.divide=le.div;re.divideBy=le.div;re.dividedBy=le.div;re.reciprocal=le.recip;re.reciprocate=le.recip;re.max=Ct(u.max);re.min=Ct(u.min);re.minabs=Ct(u.minabs);re.maxabs=Ct(u.maxabs);re.clampMin=Ct(u.clampMin);re.clampMax=Ct(u.clampMax);re.logarithm=le.log;class g extends re{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=u.add(this.evaluate(0),this.evaluate(1)).div(2);return u.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 rn(e,t,n=!0,i){var s,l,o;let r=u.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((l=a(e.innermostVariable))!=null?l:0);let d=u.sub(e.evaluateIntegral(r),e.evaluateIntegral());if(c.gt(1e308))return d.add(u.sub(c,r).times(e.evaluate(r)));for(let b=r.toNumber();b<c.toNumber();b++)d=d.add(e.evaluate(b));return d}else{const c=r;r=r.sub(i!=null?i:0).clampMin((o=a(e.innermostVariable))!=null?o:0);let d=e.evaluate(r);if(c.gt(1e308))return u.sub(c,r).add(1).times(d);for(let b=r.toNumber();b<c.toNumber();b++)d=u.add(d,e.evaluate(b));return d}}function Sn(e){return wt(t=>{const{addend:n,description:i,enabled:r,smallerIsBetter:s}=e.call(t,t),l=ye(n),o=ye(i),c=r==null?void 0:ye(r);return{apply:d=>u.add(d,a(l)),invert:d=>u.sub(d,a(l)),getFormula:d=>g.add(d,l),enabled:c,description:i==null?void 0:ne(()=>_("div",{class:"modifier-container"},[a(o)!=null?_("span",{class:"modifier-description"},[Be(a(o))]):null,_("span",{class:"modifier-amount",style:(s===!0?u.gt(a(l),0):u.lt(a(l),0))?"color: var(--danger)":""},[u.gte(a(l),0)?"+":"",ot(a(l))])]))}})}function Rt(e){return wt(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:s}=e.call(t,t),l=ye(n),o=ye(i),c=r==null?void 0:ye(r);return{apply:d=>u.times(d,a(l)),invert:d=>u.div(d,a(l)),getFormula:d=>g.times(d,l),enabled:c,description:i==null?void 0:ne(()=>_("div",{class:"modifier-container"},[a(o)!=null?_("span",{class:"modifier-description"},[Be(a(o))]):null,_("span",{class:"modifier-amount",style:(s===!0?u.gt(a(l),1):u.lt(a(l),1))?"color: var(--danger)":""},[D("\xD7"),ot(a(l))])]))}})}function Ut(e){return wt(()=>{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)?ne(()=>_(ie,null,[t.filter(n=>a(n.enabled)!==!1).map(n=>a(n.description)).filter(n=>n).map(Be)])):void 0}})}const ru={key:0},au={key:0,class:"mark star"},ou=["src"],su=j({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(N(),S("div",ru,[e.mark===!0?(N(),S("div",au)):(N(),S("img",{key:1,class:"mark",src:e.mark},null,8,ou))])):V("",!0)}});var ri=Q(su,[["__scopeId","data-v-2207999f"]]);const lu=j({__name:"Node",props:{id:null},setup(e){const n=me(e),i=Gt(un,()=>{}),r=Gt(cn,()=>{}),s=Te(null),l=I(()=>s.value&&s.value.parentElement);return Fe([l,n.id],([o,c],[d,b])=>{d&&r(a(b)),o&&i(c,o)}),$n(()=>r(a(n.id))),(o,c)=>(N(),S("div",{class:"node",ref_key:"node",ref:s},null,512))}});var ai=Q(lu,[["__scopeId","data-v-a48cb382"]]);j({props:{display:{type:q(Object,String,Function),required:!0},visibility:{type:q(Number,Boolean),required:!0},style:q(Object,String,Array),classes:q(Object),onClick:Function,onHold:Function,canClick:{type:q(Boolean),required:!0},small:Boolean,mark:q(Boolean,String),id:{type:String,required:!0}},components:{Node:ai,MarkNode:ri},setup(e){const{display:t,onClick:n,onHold:i}=me(e),r=Te("");Le(()=>{var b;const o=we(t);if(o==null){r.value="";return}if(st(o)){r.value=he(o);return}const c=he((b=o.title)!=null?b:"","h3"),d=he(o.description,"div");r.value=he(ne(()=>_("span",null,[o.title!=null?_("div",null,[_(c,null,null)]):null,_(d,null,null)])))});const{start:s,stop:l}=Un(n,i);return{start:s,stop:l,comp:r,Visibility:Re,isVisible:Xe,isHidden:Xt,unref:a}}});const uu=["x1","y1","x2","y2"],cu=j({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=me(e),i=I(()=>{const s=n.startNode.value.rect,l=n.boundingRect.value,o=l?{x:s.x+s.width/2-l.x,y:s.y+s.height/2-l.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,l=n.boundingRect.value,o=l?{x:s.x+s.width/2-l.x,y:s.y+s.height/2-l.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,l)=>(N(),S("line",qe({"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,uu))}});const du=j({__name:"Links",props:{links:null},setup(e){var c;const n=Ke(e,"links"),i=F(null),r=Gt(dn,F({})),s=Gt(gn,F(void 0)),l=F((c=i.value)==null?void 0:c.getBoundingClientRect());Fe(s,()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),Jt(()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const o=I(()=>{var b,m;const d=r.value;return(m=(b=n.value)==null?void 0:b.filter(w=>{var y,h;return((y=d[w.startNode.id])==null?void 0:y.rect)&&((h=d[w.startNode.id])==null?void 0:h.rect)}))!=null?m:[]});return(d,b)=>(N(),S(ie,null,[a(o)?(N(),S("svg",pi(qe({key:0},d.$attrs)),[(N(!0),S(ie,null,yt(a(o),(m,w)=>(N(),Z(cu,{key:w,link:m,boundingRect:l.value,startNode:a(r)[m.startNode.id],endNode:a(r)[m.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 gu=Q(du,[["__scopeId","data-v-063f6d6b"]]);j({props:{nodes:{type:q(Array),required:!0},leftSideNodes:q(Array),rightSideNodes:q(Array),branches:q(Array)},components:{Links:gu},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=me(e),r=Te();Le(()=>{const o=we(t);r.value=he(ne(()=>_(ie,null,[o.map(c=>_("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(Be)]))])))});const s=Te();Le(()=>{const o=we(n);s.value=o?he(ne(()=>_("span",{class:"left-side-nodes small"},[o.map(Be)]))):""});const l=Te();return Le(()=>{const o=we(i);l.value=o?he(ne(()=>_("span",{class:"side-nodes small"},[o.map(Be)]))):""}),{unref:a,nodesComp:r,leftNodesComp:s,rightNodesComp:l}}});j({props:{display:q(Object,String,Function),visibility:{type:q(Number,Boolean),required:!0},style:q(String,Object,Array),classes:q(Object),onClick:Function,onHold:Function,color:q(String),glowColor:q(String),canClick:{type:q(Boolean),required:!0},mark:q(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:ri,Node:ai},setup(e){const{onClick:t,onHold:n,display:i}=me(e),r=Ot(i),{start:s,stop:l}=Un(t,n);return{start:s,stop:l,comp:r,unref:a,Visibility:Re,isCoercableComponent:st,isVisible:Xe,isHidden:Xt}}});function xn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(o=>ye(o.base)),n.baseText=t.map(o=>ye(o.baseText)),n.visible=t.map(o=>ye(o.visible)),n.title=t.map(o=>ye(o.title)),n.subtitle=t.map(o=>ye(o.subtitle)),i=!0),t}const s=Nt({},!1);return[ne(()=>{const o=r();let c=!0;const d=o.map((b,m)=>{var P,k,E;if(a(n.visible[m])===!1)return null;const w=_("h3",{onClick:()=>s.value[m]=!s.value[m],style:"cursor: pointer"},[_("span",{class:"modifier-toggle"+(a(s.value[m])?" collapsed":"")},[D("\u25BC")]),a(n.title[m]),a(n.subtitle[m])!=null?_("span",{class:"subtitle"},[D(" ("),a(n.subtitle[m]),D(")")]):null]),y=a(s.value[m])?null:_(ie,null,[_("div",{class:"modifier-container"},[_("span",{class:"modifier-description"},[Be((P=a(n.baseText[m]))!=null?P:"Base")]),_("span",{class:"modifier-amount"},[Tt((k=a(n.base[m]))!=null?k:1),b.unit])]),b.modifier.description==null?null:Be(a(b.modifier.description))]),h=!c;c=!1;const C=(E=a(n.base[m]))!=null?E:1,$=b.modifier.apply(C);return _(ie,null,[h?_("br",null,null):null,_("div",{style:{"--unit":K.alignUnits&&b.unit!=null?"'"+b.unit+"'":""}},[w,_("br",null,null),y,_("hr",null,null),_("div",{class:"modifier-container"},[_("span",{class:"modifier-description"},[D("Total")]),_("span",{class:"modifier-amount",style:(b.smallerIsBetter===!0?u.gt($,C!=null?C:1):u.lt($,C!=null?C:1))?"color: var(--danger)":""},[ot($),b.unit])])])])});return _(ie,null,[d])}),s]}function In(e,t,n=1){const i=ye(t),r=ye(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return ne(()=>{var s;if(a(i)){const l=ot(e.evaluate()),o=ot(e.evaluate(u.add(a((s=e.innermostVariable)!=null?s:0),a(r))));return _(ie,null,[_("b",null,[_("i",null,[l,D(" \u2192 "),o])])])}return _(ie,null,[ot(e.evaluate())])})}const Mn=Fn(),St={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},be={dirt:{cost:1e3,name:"Pickaxe",type:"passive",state:"dirt"},sand:{cost:1e4,name:"Dowsing Rod",type:"dowsing"},gravel:{cost:1e5,name:"Ore Processor",type:"passive",state:"gravel"},wood:{cost:1e6,name:"Unknown Item",type:"unknownType"},stone:{cost:1e7,name:"Energizer",type:"passive",state:"stone"},coal:{cost:1e8,name:"Tool Empowerer",type:"empowerer"},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"}},En={dirt:{description:"Doubles mining speed"},gravel:{description:"Doubles material drops"},stone:{description:"Doubles energy gain"},copper:{description:"Material level is 10% stronger"}},oi=Gn("main",function(){const e=ws(0,"energy"),t=Nt(!1),n=g.variable(0).add(1),i=I(()=>m.types.resource.nodes.value.reduce((T,M)=>(T[M.state.type]=M,T),{})),r=I(()=>m.types.passive.nodes.value.reduce((T,M)=>(T[M.state]=M,T),{})),s=I(()=>P.reduce((T,M)=>{var ve,et,ze;const W=(ze=(et=(ve=i.value[M])==null?void 0:ve.state)==null?void 0:et.amount)!=null?ze:0;let ee=u.floor(n.invertIntegral(W)).sub(10).clampMin(0),De=rn(n,ee,!0,0);for(;;){const mt=n.evaluate(ee);if(u.add(De,mt).lte(W))ee=ee.add(1),De=u.add(De,mt);else break}return T[M]=ee,T},{}));function l(T){var ve,et,ze;const M=(ze=(et=(ve=i.value[T])==null?void 0:ve.state)==null?void 0:et.amount)!=null?ze:0,W=s.value[T],ee=rn(n,W,!0),De=rn(n,u.add(W,1),!0);return u.sub(M,ee).max(0).div(u.sub(De,ee)).toNumber()}const o=_t({});ut(()=>{P.forEach(T=>{Fe(()=>s.value[T],(M,W)=>{u.gt(M,W)&&K.active===U.id&&Mn.info(_("div",null,[_("h3",null,[u.eq(M,1)?`${It(T)} discovered`:`${It(T)} is now Level ${Ge(M)}`,D("!")]),_("div",null,[D("Energy gain is now 1.01x higher.")])]))})})});const c=I(()=>{let T=0;return y.value.state.powered&&T++,T}),d=I(()=>u.eq(c.value,0)?10:u.add(c.value,1).pow10().times(.9)),b={id:"toggle",icon:"bolt",tooltip:T=>({text:T.state.powered?"Turn Off":`Turn On - Always runs for ${Ge(d.value)} energy/s`}),onClick(T){T.state={...T.state,powered:!T.state.powered},m.selectedAction.value=null},fillColor:T=>T.state.powered?"var(--accent1)":"var(--locked)"},m=_s(T=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:{mine:{shape:He.Diamond,size:50,title:"\u{1FAA8}",label:M=>M===T.selectedNode.value?{text:"Mining..."}:Object.keys(i.value).length===0?{text:"Click me!"}:null,actionDistance:100,actions:[b],progress:M=>w(M)?new u(M.state.progress).toNumber():0,progressDisplay:At.Outline,progressColor:"var(--accent2)",classes:M=>({running:w(M)}),draggable:!0},brokenFactory:{shape:He.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:M=>M===T.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:100,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(M){u.gte(e.value,100)&&(M.type="factory",e.value=u.sub(e.value,100))},confirmationLabel:()=>u.gte(e.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},factory:{shape:He.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:M=>{var W,ee,De,ve;return M===T.selectedNode.value?{text:M.state==null?t.value?"Forge":"Forge - Drag a material to me!":`Forge - ${be[M.state].name} selected`}:((W=T.draggingNode.value)==null?void 0:W.type)==="resource"?{text:be[((ee=T.draggingNode.value)==null?void 0:ee.state).type].name,color:u.gte(e.value,be[((De=T.draggingNode.value)==null?void 0:De.state).type].cost)&&!(((ve=T.draggingNode.value)==null?void 0:ve.state).type in r.value)?"var(--accent2)":"var(--danger)"}:null},actionDistance:100,actions:[{id:"craft",icon:"done",tooltip:M=>({text:`Forge ${be[M.state].name} - ${Ge(be[M.state].cost)} energy`}),onClick(M){const W=be[M.state];if(u.gte(e.value,W.cost)&&!(M.state in r.value)){e.value=u.sub(e.value,W.cost);const ee={id:kn(T),position:{...M.position},type:W.type,state:W.state};T.placeInAvailableSpace(ee),T.nodes.value.push(ee),T.selectedAction.value=null,T.selectedNode.value=null,M.state=void 0}},fillColor:M=>u.gte(e.value,be[M.state].cost)&&!(M.state in r.value)?"var(--accent2)":"var(--danger)",visibility:M=>M.state!=null,confirmationLabel:M=>u.gte(e.value,be[M.state].cost)?M.state in r.value?{text:"Already crafted",color:"var(--danger)"}:{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}},{id:"deselect",icon:"close",tooltip:{text:"De-select material"},onClick(M){M.state=void 0,T.selectedAction.value=null,T.selectedNode.value=null},visibility:M=>M.state!=null}],canAccept(M,W){return W.type==="resource"},onDrop(M,W){const ee=W.state.type;M.state===ee?M.state=void 0:M.state=ee,T.selectedNode.value=M},draggable:!0},resource:{shape:He.Circle,size:50,title:M=>It(M.state.type),subtitle:M=>Ge(M.state.amount),progress:M=>l(M.state.type),onClick(){},progressDisplay:At.Outline,progressColor:"var(--accent3)",draggable:!0},passive:{shape:He.Circle,size:50,title:M=>be[M.state].name,label:M=>M===T.selectedNode.value?{text:En[M.state].description}:null,outlineColor:"var(--bought)",draggable:!0}},style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const M=Object.keys(o).map(W=>({startNode:y.value,endNode:i.value[W],stroke:"var(--accent3)",strokeWidth:5}));return h.value!=null&&h.value.state!=null&&M.push({startNode:h.value,endNode:i.value[h.value.state],stroke:"var(--foreground)",strokeWidth:4}),M}}));function w(T){return T===m.selectedNode.value||T.state.powered}const y=I(()=>m.nodes.value.find(T=>T.type==="mine")),h=I(()=>m.nodes.value.find(T=>T.type==="factory"));function C(T,M){let W=i.value[T];if(W==null)W={id:kn(m),position:{...y.value.position},type:"resource",state:{type:T,amount:M}},m.placeInAvailableSpace(W),m.nodes.value.push(W);else{const ee=W.state;W.state={...ee,amount:u.add(ee.amount,M)}}}const $=Object.values(St).reduce((T,M)=>T+M),P=Object.keys(St),k=Ut(()=>[...P.map(T=>Rt(()=>({description:()=>`${It(T)} (Lv. ${Ge(s.value[T])}) (${Tt(kt.value)}x per level)`,multiplier:()=>u.pow(kt.value,s.value[T]),enabled:()=>{var M,W;return T in i.value&&u.gt((W=(M=i.value[T].state)==null?void 0:M.amount)!=null?W:0,0)}}))),Rt(()=>({multiplier:2,description:be.stone.name,enabled:()=>"stone"in r.value})),Sn(()=>({addend:()=>u.pow10(c.value).neg(),description:"Powered Machines (10^n energy/s)",enabled:()=>u.gt(c.value,0)}))]),E=I(()=>k.apply(1)),B=Ut(()=>[Rt(()=>({multiplier:2,description:be.dirt.name,enabled:()=>"dirt"in r.value}))]),pe=I(()=>B.apply(1)),se=Ut(()=>[Rt(()=>({multiplier:2,description:be.gravel.name,enabled:()=>"gravel"in r.value}))]),X=I(()=>se.apply(1)),te=Ut(()=>[Sn(()=>({addend:.001,description:be.copper.name,enabled:()=>"copper"in r.value}))]),kt=I(()=>te.apply(1.01)),[Bt,G]=xn(()=>[{title:"Energy Gain",modifier:k,base:1,unit:"/s"}]),[ce,$e]=xn(()=>[{title:"Mining Speed",modifier:B,base:1,unit:"/s",visible:()=>"dirt"in r.value},{title:"Ore Dropped",modifier:se,base:1,visible:()=>"gravel"in r.value},{title:"Material Level Effect",modifier:te,base:1.01,visible:()=>"copper"in r.value}]),Ie=$s({general:()=>({display:"Energy",glowColor(){return Ie.activeTab.value===this.tab?"white":""},tab:Bt,energyTabCollapsed:G}),mining:()=>({display:"Mining",glowColor(){return Ie.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(r.value).length>0,tab:ce,miningTabCollapsed:$e})}),ft=F(!1),Ae=ne(()=>_(Qe,{modelValue:ft.value,"onUpdate:modelValue":T=>ft.value=T},{header:()=>_("h2",null,[D("Modifiers")]),body:()=>We(Ie)}));this.on("preUpdate",T=>{if(Object.keys(o).forEach(M=>{o[M]-=T,o[M]<=0&&delete o[M]}),w(y.value)){const M=u.add(y.value.state.progress,u.times(pe.value,T)),W=M.floor();y.value.state={...y.value.state,progress:u.sub(M,W)};const ee=W.div($).floor();ee.gt(0)&&P.forEach(ve=>{C(ve,u.times(St[ve],ee).times(X.value)),o[ve]=.3});const De=u.sub(W,ee).toNumber();for(let ve=0;ve<De;ve++){const et=Math.floor(Math.random()*$);let ze=0;for(let mt=0;mt<P.length;mt++){const en=P[mt];if(ze+=St[en],et<=ze){C(en,X.value),o[en]=.3;break}}}}e.value=u.add(e.value,u.times(E.value,T)),u.lt(e.value,0)&&(e.value=0,y.value.state={...y.value.state,powered:!1},Mn.warning(_("div",null,[_("h3",null,[D("Ran out of energy!")]),_("div",null,[D("All machines have been turned off.")])])))});const mn=I(()=>m.selectedAction.value===m.types.brokenFactory.actions[0]?-100:m.selectedAction.value===m.types.factory.actions[0]?u.neg(be[m.selectedNode.value.state].cost):0),li=In(g.variable(0).add(e),()=>u.neq(mn.value,0),mn),pn=I(()=>{var T;return m.selectedAction.value===b?((T=m.selectedNode.value)==null?void 0:T.state).powered?u.eq(c.value,1)?10:u.pow10(c.value).times(.9):u.neg(d.value):0}),ui=In(g.variable(0).add(E),()=>u.neq(pn.value,0),pn);return{name:"World",board:m,energy:e,modifierTabs:Ie,hasForged:t,mineLootTable:St,tools:be,passives:En,resourceNodes:i,toolNodes:r,display:ne(()=>_(ie,null,[_(ei,{class:"nav-container"},{default:()=>[_("span",{class:"nav-segment"},[_("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[We(li)])," ",D("energy")]),_("span",{class:"nav-segment"},[D("("),_("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[u.gt(E.value,0)?"+":"",We(ui)]),D("/s)")]),_("span",{class:"nav-segment"},[_("button",{class:"button",style:"display: inline",onClick:()=>ft.value=!0},[D("open modifiers")])]),U.devSpeed===0?_("span",{class:"nav-segment"},[D("Game Paused")]):U.devSpeed!=null&&U.devSpeed!==1?_("span",{class:"nav-segment"},[D("Dev Speed: "),Tt(U.devSpeed),D("x")]):null]}),We(m),We(Ae)]))}}),fu=e=>[oi],si=I(()=>!1);function mu(e,t){}var pu=Object.freeze(Object.defineProperty({__proto__:null,main:oi,getInitialLayers:fu,hasWon:si,fixOldSave:mu},Symbol.toStringTag,{value:"Module"}));const Lt=e=>(ct("data-v-4a50ce42"),e=e(),dt(),e),hu={class:"game-over-modal-header"},vu=["src","alt"],bu={class:"game-over-modal-title"},yu=Lt(()=>p("h2",null,"Congratulations!",-1)),_u={key:0},wu=Lt(()=>p("br",null,null,-1)),Nu=Lt(()=>p("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Cu=Lt(()=>p("br",null,null,-1)),ku=["href"],Su=Lt(()=>p("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),xu=j({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:s,versionTitle:l}=J,o=I(()=>sn(U.timePlayed)),c=I(()=>si.value&&!U.keepGoing),d=Ke(U,"autosave");function b(){U.keepGoing=!0}function m(){rt(pt())}return(w,y)=>(N(),Z(Qe,{"model-value":a(c)},{header:O(()=>[p("div",hu,[a(n)?(N(),S("img",{key:0,class:"game-over-modal-logo",src:a(n),alt:a(t)},null,8,vu)):V("",!0),p("div",bu,[yu,p("h4",null,"You've beaten "+H(a(t))+" v"+H(a(s))+": "+H(a(l)),1)])])]),body:O(({shown:h})=>[h?(N(),S("div",_u,[p("div",null,"It took you "+H(a(o))+" to beat the game.",1),wu,Nu,Cu,p("div",null,[p("a",{href:a(r),class:"game-over-modal-discord-link"},[Su,D(" "+H(a(i)),1)],8,ku)]),_(Oe,{title:"Autosave",modelValue:a(d),"onUpdate:modelValue":y[0]||(y[0]=C=>ue(d)?d.value=C:null)},null,8,["modelValue"])])):V("",!0)]),footer:O(()=>[p("div",{class:"game-over-footer"},[p("button",{onClick:b,class:"button"},"Keep Going"),p("button",{onClick:m,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var Iu=Q(xu,[["__scopeId","data-v-4a50ce42"]]);const Qt=e=>(ct("data-v-2776d67d"),e=e(),dt(),e),Mu=Qt(()=>p("div",{class:"nan-modal-header"},[p("h2",null,"NaN value detected!")],-1)),Eu={key:0},$u=Qt(()=>p("br",null,null,-1)),Tu=["href"],Fu=Qt(()=>p("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Pu=Qt(()=>p("br",null,null,-1)),Du={class:"nan-footer"},Vu=j({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=J,i=F(!0),r=F(!0),s=Ke(ge,"hasNaN"),l=F(null);Fe(s,w=>{w?(i.value=U.autosave,r.value=U.devSpeed===0):(U.autosave=i.value,U.devSpeed=r.value?0:null)});const o=I(()=>{var w;return(w=ge.NaNPath)==null?void 0:w.join(".")}),c=I(()=>ge.NaNPersistent!=null?ge.NaNPersistent.value:null);function d(){ge.NaNPersistent!=null&&(ge.NaNPersistent.value=new u(0),ge.hasNaN=!1)}function b(){ge.NaNPersistent&&(ge.NaNPersistent.value=new u(1),ge.hasNaN=!1)}function m(){ge.NaNPersistent&&(ge.NaNPersistent.value=new u(NaN),ge.hasNaN=!1)}return(w,y)=>(N(),S(ie,null,[_(Qe,qe({modelValue:a(s),"onUpdate:modelValue":y[4]||(y[4]=h=>ue(s)?s.value=h:null)},w.$attrs),{header:O(()=>[Mu]),body:O(()=>[p("div",null,[D(' Attempted to assign "'+H(a(o))+'" to NaN',1),a(c)?(N(),S("span",Eu,H(" ")+"(previously "+H(a(Tt)(a(c)))+")",1)):V("",!0),D(". Auto-saving has been "+H(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),$u,p("div",null,[p("a",{href:a(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[Fu,D(" "+H(a(t)||"The Paper Pilot Community"),1)],8,Tu)]),Pu,_(Oe,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":y[0]||(y[0]=h=>i.value=h)},null,8,["modelValue"]),a(J).enablePausing?(N(),Z(Oe,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":y[1]||(y[1]=h=>r.value=h)},null,8,["modelValue"])):V("",!0)]),footer:O(()=>[p("div",Du,[p("button",{onClick:y[2]||(y[2]=h=>{var C;return(C=l.value)==null?void 0:C.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(u).neq(a(c),0)&&a(u).neq(a(c),1)?(N(),S("button",{key:0,onClick:y[3]||(y[3]=h=>s.value=!1),class:"button"}," Set to previous ")):V("",!0),p("button",{onClick:m,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),_(Xn,{ref_key:"savesManager",ref:l},null,512)],64))}});var Au=Q(Vu,[["__scopeId","data-v-2776d67d"]]);const Ou={key:0,class:"tpsDisplay"},Lu={key:0,class:"low"},Bu=j({__name:"TPS",setup(e){const t=I(()=>u.div(ge.lastTenTicks.length,ge.lastTenTicks.reduce((s,l)=>s+l,0))),n=F([]);Le(()=>{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,l)=>u.max(s,l),0)),r=I(()=>u.sub(t.value,i.value).gt(1));return(s,l)=>a(t).isNan()?V("",!0):(N(),S("div",Ou,[D(" TPS: "+H(a(Ge)(a(t)))+" ",1),_(bt,{name:"fade"},{default:O(()=>[a(r)?(N(),S("span",Lu,H(a(Ge)(a(i))),1)):V("",!0)]),_:1})]))}});var qu=Q(Bu,[["__scopeId","data-v-46a3ed5b"]]);var Ru=j({__name:"App",setup(e){const t=J.useHeader,n=I(()=>Ve[K.theme].variables),i=Ke(K,"showTPS"),r=I(()=>he(ne(()=>_(ie,null,[Mr.map(We)]))));return(s,l)=>(N(),S(ie,null,[p("div",{id:"modal-root",style:Pe(a(n))},null,4),p("div",{class:ae(["app",{useHeader:a(t)}]),style:Pe(a(n))},[a(t)?(N(),Z(Qn,{key:0})):V("",!0),_(Uo),a(a(i))?(N(),Z(qu,{key:1})):V("",!0),_(Iu),_(Au),(N(),Z(Se(a(r))))],6)],64))}});var Uu=Q(Ru,[["__scopeId","data-v-41d15e5e"]]);function zu(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:s,onRegisterError:l}=e;let o,c,d,b;const m=async(y=!0)=>{await d,y&&(o==null||o.addEventListener("controlling",h=>{h.isUpdate&&window.location.reload()})),await(b==null?void 0:b())};async function w(){if("serviceWorker"in navigator){const{Workbox:y,messageSW:h}=await $t(()=>import("./workbox-window.4a8794bb.js"),[]);b=async()=>{c&&c.waiting&&await h(c.waiting,{type:"SKIP_WAITING"})},o=new y("./sw.js",{scope:"./",type:"classic"}),o.addEventListener("activated",C=>{C.isUpdate||i==null||i()});{const C=()=>{n==null||n()};o.addEventListener("waiting",C),o.addEventListener("externalwaiting",C)}o.register({immediate:t}).then(C=>{c=C,s?s("./sw.js",C):r==null||r(C)}).catch(C=>{l==null||l(C)})}}return d=w(),m}function ju(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:s,onRegisterError:l}=e,o=F(!1),c=F(!1);return{updateServiceWorker:zu({immediate:t,onNeedRefresh(){o.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:r,onRegisteredSW:s,onRegisterError:l}),offlineReady:c,needRefresh:o}}document.title=J.title;window.projInfo=J;if(J.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 Nr();const{globalBus:e}=await $t(()=>Promise.resolve().then(function(){return _r}),void 0),{startGameLoop:t}=await $t(()=>import("./gameLoop.e346fc31.js"),["assets/gameLoop.e346fc31.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=hi(Uu);e.emit("setupVue",n),n.mount("#app"),ut(()=>{const i=Fn(),{updateServiceWorker:r}=ju({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{u as D,$t as _,ge as a,J as b,pu as c,Ce as g,Cr as l,U as p,K as s};
|