/* empty css */import"./vue.92681fcb.js";import{Z as $,u as sn,q as bt,C as a,b1 as Me,aa as A,aE as g,a0 as k,a1 as m,aK as Fe,G as Q,t as O,aC as In,w as ye,b2 as ve,a8 as f,O as j,ao as ps,I as se,ay as qt,ar as Qe,aG as Pt,A as re,_ as V,b6 as D,b8 as rn,bs as gs,aq as et,bu as gt,bb as Lt,T as ys,a7 as C,j as vs,l as ne,bv as kn,z as xe,J as L,aN as ae,$ as F,aH as De,aF as Ee,al as Ot,aL as We,H as bs,aJ as Fn,bn as _s,br as Ns,be as ws}from"./@vue.4ce677c2.js";import{i as ks}from"./is-plain-object.906d88e8.js";import{c as On}from"./nanoevents.1080beb7.js";import{L as je}from"./lz-string.731cedc5.js";import{Y as Ss}from"./vue-next-select.a2bfab1d.js";import{s as Ms,u as xn}from"./vue-toastification.6f567382.js";import{D as Cs}from"./vuedraggable.7949458c.js";import{p as $s}from"./vue-textarea-autosize.35804eaf.js";import{v as Ps,n as Ts}from"./workbox-window.8d14e8b7.js";import"./sortablejs.29100d8a.js";const Is=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerpolicy&&(r.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?r.credentials="include":i.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=n(i);fetch(i.href,r)}};Is();const Fs="modulepreload",Sn={},Os="./",xt=function(t,n){return!n||n.length===0?t():Promise.all(n.map(s=>{if(s=`${Os}${s}`,s in Sn)return;Sn[s]=!0;const i=s.endsWith(".css"),r=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${r}`))return;const l=document.createElement("link");if(l.rel=i?"stylesheet":Fs,i||(l.as="script",l.crossOrigin=""),l.href=s,document.head.appendChild(l),i)return new Promise((o,c)=>{l.addEventListener("load",o),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>t())},xs="./projInfo-schema.json",Ds="Advent Incremental",Es="An incremental game you play a day at a time, leading up to Christmas!",As="advent-incremental",Vs="thepaperpilot",qs="",Ls="",Bs="0.2",Rs="Initial Commit",Us=!0,Gs=!1,js=2,zs=!0,Ws=null,Hs="",Ks=["main"],Ys=3600,Zs=0,Js=!0,Xs="base64";var U={$schema:xs,title:Ds,description:Es,id:As,author:Vs,discordName:qs,discordLink:Ls,versionNumber:Bs,versionTitle:Rs,allowGoBack:Us,defaultShowSmall:Gs,defaultDecimalsShown:js,useHeader:zs,banner:Ws,logo:Hs,initialTabs:Ks,maxTickLength:Ys,offlineLimit:Zs,enablePausing:Js,exportEncoding:Xs};const Zt=17,Qs=9e15,ei=Math.log10(9e15),ti=1/9e15,ni=308,si=-324,Mn=5,ii=function(){const e=[];for(let n=si+1;n<=ni;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),Ze=[2,Math.E,3,4,5,6,7,8,9,10],ri=[[1,1.0891168053867777,1.1789745164521264,1.2701428397304229,1.3632066654400328,1.4587804913784246,1.557523817412741,1.660158301473385,1.767487542936873,1.8804205225512542,2],[1,1.1121114330934,1.23103892493161,1.35838369631113,1.49605193039935,1.64635423375119,1.81213853570186,1.99697132461829,2.20538955455724,2.44325744833852,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.18422737399915,1.4066113788546144,1.680911177655277,2.027492094355525,2.4775152854601967,3.080455730250329,3.918234505962507,5.1332705696484595,6.9878696918072905,10]],ai=[[-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]],h=function(t){return d.fromValue_noAlloc(t)},E=function(e,t,n){return d.fromComponents(e,t,n)},q=function(t,n,s){return d.fromComponents_noNormalize(t,n,s)},Le=function(t,n){const s=n+1,i=Math.ceil(Math.log10(Math.abs(t))),r=Math.round(t*Math.pow(10,s-i))*Math.pow(10,i-s);return parseFloat(r.toFixed(Math.max(s-i,0)))},Jt=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},oi=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 s=e*e;let i=e;return n=n+1/(12*i),i=i*s,n=n+1/(360*i),i=i*s,n=n+1/(1260*i),i=i*s,n=n+1/(1680*i),i=i*s,n=n+1/(1188*i),i=i*s,n=n+691/(360360*i),i=i*s,n=n+7/(1092*i),i=i*s,n=n+3617/(122400*i),Math.exp(n)/t},Dn=.5671432904097838,Cn=function(e,t=1e-10){let n,s;if(!Number.isFinite(e)||e===0)return e;if(e===1)return Dn;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let i=0;i<100;++i){if(s=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(s-n).5?1:-1;if(Math.random()*20<1)return q(t,0,1);const n=Math.floor(Math.random()*(e+1));let s=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(s=Math.trunc(s));let i=Math.pow(10,s);return Math.random()>.9&&(i=Math.trunc(i)),E(t,n,i)}static affordGeometricSeries_core(e,t,n,s){const i=t.mul(n.pow(s));return _.floor(e.div(i).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,s){return t.mul(n.pow(s)).mul(_.sub(1,n.pow(e))).div(_.sub(1,n))}static affordArithmeticSeries_core(e,t,n,s){const r=t.add(s.mul(n)).sub(n.div(2)),l=r.pow(2);return r.neg().add(l.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,s){const i=t.add(s.mul(n));return e.div(2).mul(i.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=Qs)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e0;)this.layer-=1,this.layer===0?this.mag=Math.pow(10,this.mag):(this.mag=t*Math.pow(10,e),e=Math.abs(this.mag),t=Math.sign(this.mag));return this.layer===0&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):this.mag===0&&(this.sign=0)),this}fromComponents(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this.normalize(),this}fromComponents_noNormalize(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this}fromMantissaExponent(e,t){return this.layer=1,this.sign=Math.sign(e),e=Math.abs(e),this.mag=t+Math.log10(e),this.normalize(),this}fromMantissaExponent_noNormalize(e,t){return this.fromMantissaExponent(e,t),this}fromDecimal(e){return this.sign=e.sign,this.layer=e.layer,this.mag=e.mag,this}fromNumber(e){return this.mag=Math.abs(e),this.sign=Math.sign(e),this.layer=0,this.normalize(),this}fromString(e){e=e.replace(",","");const t=e.split("^^^");if(t.length===2){const v=parseFloat(t[0]),b=parseFloat(t[1]),N=t[1].split(";");let w=1;if(N.length===2&&(w=parseFloat(N[1]),isFinite(w)||(w=1)),isFinite(v)&&isFinite(b)){const x=_.pentate(v,b,w);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,this}}const n=e.split("^^");if(n.length===2){const v=parseFloat(n[0]),b=parseFloat(n[1]),N=n[1].split(";");let w=1;if(N.length===2&&(w=parseFloat(N[1]),isFinite(w)||(w=1)),isFinite(v)&&isFinite(b)){const x=_.tetrate(v,b,w);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,this}}const s=e.split("^");if(s.length===2){const v=parseFloat(s[0]),b=parseFloat(s[1]);if(isFinite(v)&&isFinite(b)){const N=_.pow(v,b);return this.sign=N.sign,this.layer=N.layer,this.mag=N.mag,this}}e=e.trim().toLowerCase();let i,r,l=e.split("pt");if(l.length===2){i=10,r=parseFloat(l[0]),l[1]=l[1].replace("(",""),l[1]=l[1].replace(")","");let v=parseFloat(l[1]);if(isFinite(v)||(v=1),isFinite(i)&&isFinite(r)){const b=_.tetrate(i,r,v);return this.sign=b.sign,this.layer=b.layer,this.mag=b.mag,this}}if(l=e.split("p"),l.length===2){i=10,r=parseFloat(l[0]),l[1]=l[1].replace("(",""),l[1]=l[1].replace(")","");let v=parseFloat(l[1]);if(isFinite(v)||(v=1),isFinite(i)&&isFinite(r)){const b=_.tetrate(i,r,v);return this.sign=b.sign,this.layer=b.layer,this.mag=b.mag,this}}const o=e.split("e"),c=o.length-1;if(c===0){const v=parseFloat(e);if(isFinite(v))return this.fromNumber(v)}else if(c===1){const v=parseFloat(e);if(isFinite(v)&&v!==0)return this.fromNumber(v)}const u=e.split("e^");if(u.length===2){this.sign=1,u[0].charAt(0)=="-"&&(this.sign=-1);let v="";for(let b=0;b=43&&N<=57||N===101)v+=u[1].charAt(b);else return this.layer=parseFloat(v),this.mag=parseFloat(u[1].substr(b+1)),this.normalize(),this}}if(c<1)return this.sign=0,this.layer=0,this.mag=0,this;const p=parseFloat(o[0]);if(p===0)return this.sign=0,this.layer=0,this.mag=0,this;let y=parseFloat(o[o.length-1]);if(c>=2){const v=parseFloat(o[o.length-2]);isFinite(v)&&(y*=Math.sign(v),y+=Jt(v))}if(!isFinite(p))this.sign=o[0]==="-"?-1:1,this.layer=c,this.mag=y;else if(c===1)this.sign=Math.sign(p),this.layer=1,this.mag=y+Math.log10(Math.abs(p));else if(this.sign=Math.sign(p),this.layer=c,c===2){const v=_.mul(E(1,2,y),h(p));return this.sign=v.sign,this.layer=v.layer,this.mag=v.mag,this}else this.mag=y;return this.normalize(),this}fromValue(e){return e instanceof _||e!=null&&typeof e=="object"&&"sign"in e&&"mag"in e&&"layer"in e?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:Le(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Le(this.mag,e)}toString(){return isNaN(this.layer)||isNaN(this.sign)||isNaN(this.mag)?"NaN":this.mag===Number.POSITIVE_INFINITY||this.layer===Number.POSITIVE_INFINITY?this.sign===1?"Infinity":"-Infinity":this.layer===0?this.mag<1e21&&this.mag>1e-7||this.mag===0?(this.sign*this.mag).toString():this.m+"e"+this.e:this.layer===1?this.m+"e"+this.e:this.layer<=Mn?(this.sign===-1?"-":"")+"e".repeat(this.layer)+this.mag:(this.sign===-1?"-":"")+"(e^"+this.layer+")"+this.mag}toExponential(e){return this.layer===0?(this.sign*this.mag).toExponential(e):this.toStringWithDecimalPlaces(e)}toFixed(e){return this.layer===0?(this.sign*this.mag).toFixed(e):this.toStringWithDecimalPlaces(e)}toPrecision(e){return this.e<=-7?this.toExponential(e-1):e>this.e?this.toFixed(e-this.exponent-1):this.toExponential(e-1)}valueOf(){return this.toString()}toJSON(){return this.toString()}toStringWithDecimalPlaces(e){return this.layer===0?this.mag<1e21&&this.mag>1e-7||this.mag===0?(this.sign*this.mag).toFixed(e):Le(this.m,e)+"e"+Le(this.e,e):this.layer===1?Le(this.m,e)+"e"+Le(this.e,e):this.layer<=Mn?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Le(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Le(this.mag,e)}abs(){return q(this.sign===0?0:1,this.layer,this.mag)}neg(){return q(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?_.dZero:this.layer===0?E(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?_.dZero:this.layer===0?E(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?_.dZero:this.layer===0?E(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?_.dZero:this.layer===0?E(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=h(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer)||this.sign===0)return t;if(t.sign===0)return this;if(this.sign===-t.sign&&this.layer===t.layer&&this.mag===t.mag)return q(0,0,0);let n,s;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(_.cmpabs(this,t)>0?(n=this,s=t):(n=t,s=this),n.layer===0&&s.layer===0)return h(n.sign*n.mag+s.sign*s.mag);const i=n.layer*Math.sign(n.mag),r=s.layer*Math.sign(s.mag);if(i-r>=2)return n;if(i===0&&r===-1){if(Math.abs(s.mag-Math.log10(n.mag))>Zt)return n;{const l=Math.pow(10,Math.log10(n.mag)-s.mag),o=s.sign+n.sign*l;return E(Math.sign(o),1,s.mag+Math.log10(Math.abs(o)))}}if(i===1&&r===0){if(Math.abs(n.mag-Math.log10(s.mag))>Zt)return n;{const l=Math.pow(10,n.mag-Math.log10(s.mag)),o=s.sign+n.sign*l;return E(Math.sign(o),1,Math.log10(s.mag)+Math.log10(Math.abs(o)))}}if(Math.abs(n.mag-s.mag)>Zt)return n;{const l=Math.pow(10,n.mag-s.mag),o=s.sign+n.sign*l;return E(Math.sign(o),1,s.mag+Math.log10(Math.abs(o)))}}plus(e){return this.add(e)}sub(e){return this.add(h(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=h(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return q(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return q(this.sign*t.sign,0,1);let n,s;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,s=t):(n=t,s=this),n.layer===0&&s.layer===0)return h(n.sign*s.sign*n.mag*s.mag);if(n.layer>=3||n.layer-s.layer>=2)return E(n.sign*s.sign,n.layer,n.mag);if(n.layer===1&&s.layer===0)return E(n.sign*s.sign,1,n.mag+Math.log10(s.mag));if(n.layer===1&&s.layer===1)return E(n.sign*s.sign,1,n.mag+s.mag);if(n.layer===2&&s.layer===1){const i=E(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(E(Math.sign(s.mag),s.layer-1,Math.abs(s.mag)));return E(n.sign*s.sign,i.layer+1,i.sign*i.mag)}if(n.layer===2&&s.layer===2){const i=E(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(E(Math.sign(s.mag),s.layer-1,Math.abs(s.mag)));return E(n.sign*s.sign,i.layer+1,i.sign*i.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=h(e);return this.mul(t.recip())}divide(e){return this.div(e)}divideBy(e){return this.div(e)}dividedBy(e){return this.div(e)}recip(){return this.mag===0?_.dNaN:this.layer===0?E(this.sign,0,1/this.mag):E(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=h(e);return this.sign>t.sign?1:this.sign0?this.layer:-this.layer,s=t.mag>0?t.layer:-t.layer;return n>s?1:nt.mag?1:this.mag0?t:this}clamp(e,t){return this.max(e).min(t)}clampMin(e){return this.max(e)}clampMax(e){return this.min(e)}cmp_tolerance(e,t){const n=h(e);return this.eq_tolerance(n,t)?0:this.cmp(n)}compare_tolerance(e,t){return this.cmp_tolerance(e,t)}eq_tolerance(e,t){const n=h(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let s=this.mag,i=n.mag;return this.layer>n.layer&&(i=Jt(i)),this.layer0?E(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):E(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?_.dNaN:this.layer>0?E(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):E(this.sign,0,Math.log10(this.mag))}log(e){return e=h(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?_.dNaN:this.layer===0&&e.layer===0?E(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):_.div(this.log10(),e.log10())}log2(){return this.sign<=0?_.dNaN:this.layer===0?E(this.sign,0,Math.log2(this.mag)):this.layer===1?E(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?E(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):E(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?_.dNaN:this.layer===0?E(this.sign,0,Math.log(this.mag)):this.layer===1?E(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?E(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):E(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=h(e),n=this,s=t;if(n.sign===0)return s.eq(0)?q(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(s.sign===0)return q(1,0,1);if(s.sign===1&&s.layer===0&&s.mag===1)return n;const i=n.absLog10().mul(s).pow10();return this.sign===-1?Math.abs(s.toNumber()%2)%2===1?i.neg():Math.abs(s.toNumber()%2)%2===0?i:_.dNaN:i}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return _.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 E(1,0,t);if(e.sign===0)return _.dOne;e=q(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?E(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?E(-e.sign,e.layer+1,-e.mag):_.dOne}pow_base(e){return h(e).pow(this)}root(e){const t=h(e);return this.pow(t.recip())}factorial(){return this.mag<0?this.add(1).gamma():this.layer===0?this.add(1).gamma():this.layer===1?_.exp(_.mul(this,_.ln(this).sub(1))):_.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(q(1,0,24)))return h(oi(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 s=e,i=12*s,r=1/i,l=t+r;if(l===t||(t=l,s=s*n,i=360*s,r=1/i,l=t-r,l===t))return _.exp(t);t=l,s=s*n,i=1260*s;let o=1/i;return t=t+o,s=s*n,i=1680*s,o=1/i,t=t-o,_.exp(t)}else return this.layer===1?_.exp(_.mul(this,_.ln(this).sub(1))):_.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?_.dOne:this.layer===0&&this.mag<=709.7?h(Math.exp(this.sign*this.mag)):this.layer===0?E(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?E(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):E(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return h(Math.sqrt(this.sign*this.mag));if(this.layer===1)return E(1,2,Math.log10(this.mag)-.3010299956639812);{const e=_.div(q(this.sign,this.layer-1,this.mag),q(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=q(1,0,1)){if(e===1)return _.pow(this,t);if(e===0)return new _(t);if(this.eq(_.dOne))return _.dOne;if(this.eq(-1))return _.pow(this,t);if(e===Number.POSITIVE_INFINITY){const i=this.toNumber();if(i<=1.444667861009766&&i>=.06598803584531254){if(i>1.444667861009099)return new _(Math.E);const r=_.ln(this).neg();return r.lambertw().div(r)}else return i>1.444667861009766?new _(Number.POSITIVE_INFINITY):_.dNaN}if(this.eq(_.dZero)){let i=Math.abs((e+1)%2);return i>1&&(i=2-i),new _(i)}if(e<0)return _.iteratedlog(t,this,-e);t=h(t);const n=e;e=Math.trunc(e);const s=n-e;if(this.gt(_.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let i=0;i3)return q(t.sign,t.layer+(e-i-1),t.mag);if(i>1e4)return t}return t}iteratedexp(e=2,t=q(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return _.tetrate(e,-t,this);e=h(e);let n=h(this);const s=t;t=Math.trunc(t);const i=s-t;if(n.layer-e.layer>3){const r=Math.min(t,n.layer-e.layer-3);t-=r,n.layer-=r}for(let r=0;r1e4)return n}return i>0&&i<1&&(e.eq(10)?n=n.layeradd10(-i):n=n.layeradd(-i,e)),n}slog(e=10){if(e=h(e),e.lte(_.dZero)||e.eq(_.dOne))return _.dNaN;if(e.lt(_.dOne))return this.eq(_.dOne)?_.dZero:this.eq(_.dZero)?_.dNegOne:_.dNaN;if(this.mag<0||this.eq(_.dZero))return _.dNegOne;let t=0,n=h(this);if(n.layer-e.layer>3){const s=n.layer-e.layer-3;t+=s,n.layer-=s}for(let s=0;s<100;++s)if(n.lt(_.dZero))n=_.pow(e,n),t-=1;else{if(n.lte(_.dOne))return h(t+_.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=_.log(n,e)}return h(t)}static slog_critical(e,t){return e>10?t-1:_.critical_section(e,t,ai)}static tetrate_critical(e,t){return _.critical_section(e,t,ri)}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 s=0,i=0;for(let o=0;oe){const c=(e-Ze[o])/(Ze[o+1]-Ze[o]);s=n[o][Math.floor(t)]*(1-c)+n[o+1][Math.floor(t)]*c,i=n[o][Math.ceil(t)]*(1-c)+n[o+1][Math.ceil(t)]*c;break}const r=t-Math.floor(t);return s*(1-r)+i*r}layeradd10(e){e=_.fromValue_noAlloc(e).toNumber();const t=h(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 s=0;s<100;++s){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 s=this.slog(t).toNumber()+e;return s>=0?_.tetrate(t,s):Number.isFinite(s)?s>=-1?_.log(_.tetrate(t,s+1),t):_.log(_.log(_.tetrate(t,s+2),t),t):_.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return h(Cn(this.toNumber()));if(this.layer===0)return h(Cn(this.sign*this.mag));if(this.layer===1)return $n(this);if(this.layer===2)return $n(this);if(this.layer>=3)return q(this.sign,this.layer-1,this.mag);throw"Unhandled behavior in lambertw()"}ssqrt(){if(this.sign==1&&this.layer>=3)return q(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=q(1,0,1)){t=h(t);const n=e;e=Math.trunc(e);const s=n-e;s!==0&&(t.eq(_.dOne)?(++e,t=new _(s)):this.eq(10)?t=t.layeradd10(s):t=t.layeradd(s,this));for(let i=0;i10)return t}return t}sin(){return this.mag<0?this:this.layer===0?h(Math.sin(this.sign*this.mag)):q(0,0,0)}cos(){return this.mag<0?_.dOne:this.layer===0?h(Math.cos(this.sign*this.mag)):q(0,0,0)}tan(){return this.mag<0?this:this.layer===0?h(Math.tan(this.sign*this.mag)):q(0,0,0)}asin(){return this.mag<0?this:this.layer===0?h(Math.asin(this.sign*this.mag)):q(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?h(Math.acos(this.toNumber())):this.layer===0?h(Math.acos(this.sign*this.mag)):q(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?h(Math.atan(this.sign*this.mag)):h(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 _.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return _.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?q(Number.NaN,Number.NaN,Number.NaN):_.ln(this.add(1).div(h(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(_.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 d=_;d.dZero=q(0,0,0);d.dOne=q(1,0,1);d.dNegOne=q(-1,0,1);d.dTwo=q(1,0,2);d.dTen=q(1,0,10);d.dNaN=q(Number.NaN,Number.NaN,Number.NaN);d.dInf=q(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);d.dNegInf=q(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);d.dNumberMax=E(1,0,Number.MAX_VALUE);d.dNumberMin=E(1,0,Number.MIN_VALUE);const li=new d(1);function mt(e,t,n=!0){let s=d.log10(e).floor(),i=d.div(e,d.pow(10,s));i.toStringWithDecimalPlaces(t)==="10"&&(i=li,s=s.add(1));const r=s.gte(1e9)?be(s,Math.max(Math.max(t,3),U.defaultDecimalsShown)):s.gte(1e4)?Dt(s,0):s.toStringWithDecimalPlaces(0);return n?i.toStringWithDecimalPlaces(t)+"e"+r:"e"+r}function Dt(e,t){if(e==null)return"NaN";if(e=new d(e),e.mag<.001)return 0 .toFixed(t);const s=e.toStringWithDecimalPlaces(t).split(".");return s[0]=s[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),s.length==1?s[0]:s[0]+"."+s[1]}function En(e,t){return e==null?"NaN":(e=new d(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),U.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const ui=new d("eeee1000"),ci=new d("e100000"),Pn=new d("e1000"),An=new d(1e9),di=new d(1e6),fi=new d(1e3),mi=new d(.98),hi=new d(.001),Vn=new d(0);function be(e,t,n){if(t==null&&(t=U.defaultDecimalsShown),n=n!=null?n:U.defaultShowSmall,e=new d(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+be(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(ui)){const s=e.slog();return s.gte(di)?"F"+be(s.floor()):d.pow(10,s.sub(s.floor())).toStringWithDecimalPlaces(3)+"F"+Dt(s.floor(),0)}else{if(e.gte(ci))return mt(e,0,!1);if(e.gte(Pn))return mt(e,0);if(e.gte(An))return mt(e,t);if(e.gte(fi))return Dt(e,0);if(e.gte(hi)||!n)return En(e,t);if(e.eq(Vn))return 0 .toFixed(t)}return e=Ln(e),e.lt(Pn)?mt(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):be(e,t)+"\u207B\xB9"}function ge(e){return e=new d(e),e.sign<0?"-"+ge(e.neg()):e.gte(An)||e.lte(mi)&&!e.eq(Vn)?be(e):be(e,0)}function qn(e){return d.lt(e,0)?"-"+qn(d.neg(e)):d.gt(e,2**51)?be(d.div(e,31536e3))+"y":(e=new d(e).toNumber(),e<60?be(e)+"s":e<3600?ge(Math.floor(e/60))+"m "+be(e%60)+"s":e<86400?ge(Math.floor(e/3600))+"h "+ge(Math.floor(e/60)%60)+"m "+ge(e%60)+"s":e<31536e3?ge(Math.floor(e/84600)%365)+"d "+ge(Math.floor(e/3600)%24)+"h "+ge(Math.floor(e/60)%60)+"m":ge(Math.floor(e/31536e3))+"y "+ge(Math.floor(e/84600)%365)+"d "+ge(Math.floor(e/3600)%24)+"h")}function pi(e,t,n){e=new d(e);let s=e.toStringWithDecimalPlaces(t);return new d(s).gte(n)&&(s=d.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),s}function gi(e,t){return be(e,t,!0)}function Ln(e){let t=d.log10(e).ceil();const n=d.div(e,d.pow(10,t));return t=t.neg(),e=new d(10).pow(t).times(n),e}var yi=Object.freeze(Object.defineProperty({__proto__:null,default:d,exponentialFormat:mt,commaFormat:Dt,regularFormat:En,format:be,formatWhole:ge,formatTime:qn,toPlaces:pi,formatSmall:gi,invertOOM:Ln},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:vi,commaFormat:bi,regularFormat:_i,format:Ce,formatWhole:te,formatTime:Bt,toPlaces:Ni,formatSmall:wi,invertOOM:ki}=yi;window.Decimal=d;window.exponentialFormat=vi;window.commaFormat=bi;window.regularFormat=_i;window.format=Ce;window.formatWhole=te;window.formatTime=Bt;window.toPlaces=Ni;window.formatSmall=wi;window.invertOOM=ki;function Bn(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function en(e){return typeof e=="function"}var z=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(z||{});const yt=Symbol("DoNotCache");function I(e,t){const n=e[t];en(n)&&n.length===0&&!n[yt]?e[t]=$(n.bind(e)):en(n)&&(e[t]=n.bind(e),e[t][yt]=!0)}function ce(e){return en(e)&&!e[yt]&&(e=$(e)),e}const He=Symbol("Component"),Ke=Symbol("GatherProps");let Si=0;function _t(e="feature-"){return e+Si++}var ie=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(ie||{});function B(e){return e[yt]=!0,e}function oe(e,t=2){return e?0:t}function ue(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}const Je={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 an=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(an||{}),Nt={classic:Je,paper:{...Je,variables:{...Je.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:{...Je,variables:{...Je.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:{...Je,variables:{...Je.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const J=Symbol("ProxyState"),rt=Symbol("ProxyPath");function _e(e,t={}){const n=t;let s=!1;function i(){return s||(Object.assign(n,e(n)),s=!0),n}return new Proxy(n,{get(r,l){return l===J?i():i()[l]},set(r,l,o){return i()[l]=o,!0},has(r,l){return l===J?!0:Reflect.has(i(),l)},ownKeys(){return Reflect.ownKeys(i())},getOwnPropertyDescriptor(r,l){return s||(Object.assign(n,e(n)),s=!0),Object.getOwnPropertyDescriptor(r,l)}})}var K=window.state=sn({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Rn=bt({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});function Un(e){return JSON.stringify(e,(t,n)=>a(n))}const Gn={get(e,t){var s;if(t===J||t===rt)return e[t];const n=e[J][t];if(t!=="value"&&(ks(n)||Array.isArray(n))){if(n!==((s=e[t])==null?void 0:s[J])){const i=[...e[rt],t];e[t]=new Proxy({[J]:n,[rt]:i},Gn)}return e[t]}return n},set(e,t,n,s){if(!K.hasNaN&&(typeof n=="number"&&isNaN(n)||n instanceof d&&(isNaN(n.sign)||isNaN(n.layer)||isNaN(n.mag)))){const i=e[J][t];if(!(typeof i=="number"&&isNaN(i)||i instanceof d&&(isNaN(i.sign)||isNaN(i.layer)||isNaN(i.mag))))throw Rn.autosave=!1,K.hasNaN=!0,K.NaNPath=[...e[rt],t],K.NaNReceiver=s,console.error("Attempted to set NaN value",[...e[rt],t],e[J]),"Attempted to set NaN value. See above for details"}return e[J][t]=n,!0},ownKeys(e){return Reflect.ownKeys(e[J])},has(e,t){return Reflect.has(e[J],t)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e[J],t)}};var P=window.player=new Proxy({[J]:Rn,[rt]:["player"]},Gn);const de=On();let at=null,pt=null;function Et(){const e=Date.now();let t=(e-P.time)/1e3;P.time=e;const n=t;if(K.lastTenTicks.push(n),K.lastTenTicks.length>10&&(K.lastTenTicks=K.lastTenTicks.slice(1)),!((pt==null?void 0:pt.value)&&!P.keepGoing)&&!K.hasNaN&&(t=Math.max(t,0),P.devSpeed!==0)){if(P.offlineTime!=null){if(d.gt(P.offlineTime,U.offlineLimit*3600)&&(P.offlineTime=U.offlineLimit*3600),d.gt(P.offlineTime,0)&&P.devSpeed!==0){const s=Math.max(P.offlineTime/10,t);P.offlineTime=P.offlineTime-s,t+=s}else P.devSpeed===0&&(P.offlineTime+=t);(!P.offlineProd||d.lt(P.offlineTime,0))&&(P.offlineTime=null)}t=Math.min(t,U.maxTickLength),P.devSpeed!=null&&(t*=P.devSpeed),Number.isFinite(t)||(t=1e308),!d.eq(t,0)&&(P.timePlayed+=t,Number.isFinite(P.timePlayed)||(P.timePlayed=1e308),de.emit("update",t,n),Y.unthrottled?(requestAnimationFrame(Et),at!=null&&(clearInterval(at),at=null)):at==null&&(at=setInterval(Et,50)))}}async function Mi(){pt=(await xt(()=>Promise.resolve().then(function(){return es}),void 0)).hasWon,Me(pt,e=>{e&&de.emit("gameWon")}),Y.unthrottled?requestAnimationFrame(Et):at=setInterval(Et,50)}document.fonts.onloadingdone=()=>de.emit("fontsLoaded");var Ci=Object.freeze(Object.defineProperty({__proto__:null,globalBus:de,startGameLoop:Mi},Symbol.toStringTag,{value:"Module"}));function jn(e={}){return Object.assign({id:`${U.id}-0`,name:"Default Save",tabs:U.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:U.id,modVersion:U.versionNumber,layers:{}},e)}function we(e){const t=je.compressToUTF16(Un(e!=null?e:P[J]));return localStorage.setItem((e!=null?e:P[J]).id,t),t}async function $i(){Ti();try{let e=localStorage.getItem(Y.active);if(e==null){await Xe(lt());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=je.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==U.id){await Xe(lt());return}t.id=Y.active,await Xe(t)}catch(e){console.error(`Failed to load save. Falling back to new save. `,e),await Xe(lt())}}function lt(){const e=Tt(),t=jn({id:e});return we(t),Y.saves.push(e),t}function Tt(){let e,t=0;do e=`${U.id}-${t++}`;while(localStorage.getItem(e));return e}async function Xe(e){console.info("Loading save",e);const{layers:t,removeLayer:n,addLayer:s}=await xt(()=>Promise.resolve().then(function(){return Qi}),void 0),{fixOldSave:i,getInitialLayers:r}=await xt(()=>Promise.resolve().then(function(){return es}),void 0);for(const l in t){const o=t[l];o&&n(o)}r(e).forEach(l=>s(l,e)),e=jn(e),e.offlineProd&&e.time&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=(Date.now()-e.time)/1e3),e.time=Date.now(),e.modVersion!==U.versionNumber&&i(e.modVersion,e),Object.assign(P,e),Y.active=P.id,de.emit("onLoad")}setInterval(()=>{P.autosave&&we()},1e3);window.onbeforeunload=()=>{P.autosave&&we()};window.save=we;const Pi=window.hardReset=async()=>{await Xe(lt())},vt=bt({active:"",saves:[],showTPS:!0,theme:an.Nordic,unthrottled:!1});Me(vt,e=>{const t=je.compressToUTF16(JSON.stringify(e));localStorage.setItem(U.id,t)},{deep:!0});var Y=window.settings=vt;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:an.Nordic};de.emit("loadSettings",e),Object.assign(vt,e),Pi()};function Ti(){try{let e=localStorage.getItem(U.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=je.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(vt,t)}de.emit("loadSettings",vt)}catch{}}const zn=bt([]);function Ii(e){zn.push(e)}const Fi=bt([]),Oi=bt([]),xi={class:"table"},Di=A({__name:"Column",setup(e){const t=$(()=>Nt[Y.theme].mergeAdjacent);return(n,s)=>(g(),k("div",xi,[m("div",{class:Q(["col",{mergeAdjacent:a(t)}])},[Fe(n.$slots,"default")],2)]))}}),Ei={class:"table"},Ai=A({__name:"Row",setup(e){const t=$(()=>Nt[Y.theme].mergeAdjacent);return(n,s)=>(g(),k("div",Ei,[m("div",{class:Q(["row",{mergeAdjacent:a(t)}])},[Fe(n.$slots,"default")],2)]))}});function Wn(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!ps(e)}function R(e,t="span"){return typeof e=="function"?A({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),A({template:e})):A({render:()=>({})}):e}function Se(e){if(Ye(e))return typeof e=="function"?e():R(e);const t=e[He];return f(t,e[Ke](),null)}function ht(...e){let t;return f(Ai,null,Wn(t=e.map(Se))?t:{default:()=>[t]})}function Vi(...e){let t;return f(Di,null,Wn(t=e.map(Se))?t:{default:()=>[t]})}function Oe(e){if(Ye(e))return typeof e=="function"?e():typeof e=="string"?f(j,null,[e]):f(e,null,null);const t=e[He];return f(t,e[Ke](),null)}function Ye(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[yt]===!0}function Hn(e,t,n){const s=O(null),i=O(void 0);function r(c){s.value||(s.value=setInterval(o,250)),i.value=c,n&&(n.value=!0)}function l(){s.value&&(clearInterval(s.value),s.value=null),n&&(n.value=!1)}function o(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return In(l),{start:r,stop:l,handleHolding:o}}function on(e,t="div"){const n=ye();return ve(()=>{n.value=R(ee(e),t)}),n}function dt(e,t="div"){const n=ye(null);return ve(()=>{const s=ee(e);n.value=s==null?null:R(s,t)}),n}function qi(e){return $(()=>ee(e))}function ee(e){return a(a(e))}function T(...e){return e.includes(Object)||e.push(Object),e}const ut=A({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(g(),k("div",{style:se({width:e.width,height:e.height})},null,4))}});var W=(e,t)=>{const n=e.__vccOpts||e;for(const[s,i]of t)n[s]=i;return n};const Li=A({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var p;const n=O({}),s=new ResizeObserver(o),i=O(null);qt(()=>{const y=i.value;y!=null&&s.observe(y)});let r=!0,l=O((p=i.value)==null?void 0:p.getBoundingClientRect());function o(){r&&(r=!1,Qe(()=>{var y;l.value=(y=i.value)==null?void 0:y.getBoundingClientRect(),Object.values(n.value).filter(v=>v).forEach(v=>v.rect=v.element.getBoundingClientRect()),t("updateNodes",n.value),r=!0}))}de.on("fontsLoaded",o);const c={attributes:!1,childList:!0,subtree:!1};Pt(ln,(y,v)=>{const b=new MutationObserver(()=>u(y));b.observe(v,c),n.value[y]={element:v,observer:b,rect:v.getBoundingClientRect()},o()}),Pt(un,y=>{var v;(v=n.value[y])==null||v.observer.disconnect(),n.value[y]=void 0,o()}),Pt(cn,n),Pt(dn,l);function u(y){const v=n.value[y];v!=null&&(v.rect=v.element.getBoundingClientRect(),t("updateNodes",n.value))}return(y,v)=>(g(),k(j,null,[Fe(y.$slots,"default",{},void 0,!0),m("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Kn=W(Li,[["__scopeId","data-v-2b1dc1bc"]]);const Bi=["onPointerdown"],Ri={class:"modal-wrapper"},Ui={class:"modal-container"},Gi={class:"modal-header"},ji=C(" default header "),zi={class:"modal-body"},Wi=C(" default body "),Hi={class:"modal-footer"},Ki=m("div",{class:"modal-default-flex-grow"},null,-1),Ae=A({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const i=re(e),r=$(()=>i.modelValue||o.value);function l(){n("update:modelValue",!1)}const o=O(!1),c=O(null),u=$(()=>{var p,y;return(y=(p=c.value)==null?void 0:p.nodes)!=null?y:null});return t({isOpen:r,nodes:u}),(p,y)=>(g(),V(ys,{to:"#modal-root"},[f(Lt,{name:"modal",onBeforeEnter:y[0]||(y[0]=v=>o.value=!0),onAfterLeave:y[1]||(y[1]=v=>o.value=!1)},{default:D(()=>[rn(m("div",et({class:"modal-mask",onPointerdown:gt(l,["self"])},p.$attrs),[m("div",Ri,[m("div",Ui,[m("div",Gi,[Fe(p.$slots,"header",{shown:a(r)},()=>[ji])]),m("div",zi,[f(Kn,{ref_key:"contextRef",ref:c},{default:D(()=>[Fe(p.$slots,"body",{shown:a(r)},()=>[Wi])]),_:3},512)]),m("div",Hi,[Fe(p.$slots,"footer",{shown:a(r)},()=>[m("div",{class:"modal-default-footer"},[Ki,m("button",{class:"button modal-default-button",onClick:l}," Close ")])])])])])],16,Bi),[[gs,e.modelValue]])]),_:3})]))}}),tn=Symbol("PersistentState"),At=Symbol("DefaultValue"),Vt=Symbol("StackTrace"),Yn=Symbol("Deleted");function Yi(){var e;return((e=new Error().stack)==null?void 0:e.split(` `).slice(3,5).map(t=>t.trim()).join(` `))||""}function $e(e){const t=ne(e)?e:O(e);return t[tn]=t,t[At]=ne(e)?e.value:e,t[Vt]=Yi(),t[Yn]=!1,ke.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",t,` Created at: `+t[Vt]):ct[ke[ke.length-1]].add(t),t}de.on("addLayer",(e,t)=>{const n=[],s=(i,r=[])=>{let l=!1;return Object.keys(i).forEach(o=>{const c=i[o];if(c&&typeof c=="object")if(tn in c){if(l=!0,c[Yn]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` Created at: `+c[Vt]);return}ct[e.id].delete(J in c?c[J]:c);const u=r.reduce((y,v)=>(v in y||(y[v]={}),y[v]),t),p=u[o];u[o]=c[tn],vs(u)?p!=null?u[o]=p:u[o]=c[At]:p!=null?u[o].value=p:u[o].value=c[At]}else!(c instanceof d)&&!ne(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),s(c,[...r,o])&&(kn(c)&&!kn(i)?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.",J in i?i[J]:i,o):l=!0))}),l};s(e),ct[e.id].forEach(i=>{console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,i,` Created at: `+i[Vt])}),ct[e.id].clear()});const ln=Symbol("RegisterNode"),un=Symbol("UnregisterNode"),cn=Symbol("Nodes"),dn=Symbol("Bounds"),le=sn({});window.layers=le;const ct={},ke=[];function Rt(e,t){return _e(()=>{const n={},s=n.emitter=On();if(n.on=s.on.bind(s),n.emit=s.emit.bind(s),n.nodes=O({}),n.id=e,ke.push(e),ct[e]=new Set,n.minimized=$e(!1),Object.assign(n,t.call(n)),ke[ke.length-1]==null||ke[ke.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen Stack: ${ke} Trying to pop ${n.id}`;return ke.pop(),I(n,"color"),I(n,"display"),I(n,"name"),ue(n,"name",n.id),I(n,"minWidth"),ue(n,"minWidth",600),I(n,"minimizable"),ue(n,"minimizable",!0),n})}function Zn(e,t){if(console.info("Adding layer",e.id),le[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,le[e.id]);return}ue(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),le[e.id]=e,de.emit("addLayer",e,t.layers[e.id])}function Zi(e){return le[e]}function Jn(e){console.info("Removing layer",e.id),de.emit("removeLayer",e),le[e.id]=void 0}function Ji(e){Jn(e),Zn(e,P)}function Xi(e){const t=O(!1);return{openModal:()=>t.value=!0,modal:B(()=>f(Ae,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>f("h2",null,[a(e.name)]),body:a(e.display)}))}}de.on("update",function(t){Object.values(le).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(le).forEach(n=>{n==null||n.emit("update",t)}),Object.values(le).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Qi=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:ln,UnregisterNodeInjectionKey:un,NodesInjectionKey:cn,BoundsInjectionKey:dn,layers:le,persistentRefs:ct,addingLayers:ke,createLayer:Rt,addLayer:Zn,getLayer:Zi,removeLayer:Jn,reloadLayer:Ji,setupLayerModal:Xi},Symbol.toStringTag,{value:"Module"}));const er={},tr={class:"notif"};function nr(e,t){return g(),k("div",tr,"!")}var Tn=W(er,[["render",nr],["__scopeId","data-v-66323fd4"]]);const Ut=e=>(De("data-v-0aae340d"),e=e(),Ee(),e),sr={key:0,class:"day feature dontMerge opened"},ir={class:"date"},rr=C("Dec"),ar=Ut(()=>m("br",null,null,-1)),or={class:"date"},lr=C("Dec"),ur=Ut(()=>m("br",null,null,-1)),cr={key:0,class:"icon"},dr=Ut(()=>m("div",{class:"doors"},null,-1)),fr={class:"date"},mr=C("Dec"),hr=Ut(()=>m("br",null,null,-1)),pr={key:0,class:"material-icons lock"},gr=A({__name:"Day",props:{day:null,symbol:null,opened:null,shouldNotify:null},emits:["openLore","openLayer","unlockLayer"],setup(e,{emit:t}){const n=e,s=on(xe(n,"symbol")),i=$(()=>d.gte(H.day.value,n.day)&&new Date().getMonth()===11&&new Date().getDate()>=n.day);function r(){i.value&&t("unlockLayer")}return(l,o)=>e.opened.value?(g(),k("div",sr,[f(Lt,{appear:"",name:"door"},{default:D(()=>[m("div",{class:"doors",onClick:o[0]||(o[0]=c=>t("openLayer"))},[m("div",ir,[rr,ar,C(L(e.day),1)]),m("div",or,[lr,ur,C(L(e.day),1)])])]),_:1}),a(s)?(g(),k("div",cr,[(g(),V(ae(a(s))))])):F("",!0),m("div",{class:"lore",onClick:o[1]||(o[1]=c=>t("openLore"))},"?"),a(e.shouldNotify)?(g(),V(Tn,{key:1})):F("",!0)])):(g(),k("div",{key:1,class:Q(["day feature dontMerge",{can:a(i),locked:!a(i),canOpen:a(i)}]),onClick:r},[dr,m("div",fr,[mr,hr,C(L(e.day),1)]),a(i)?F("",!0):(g(),k("div",pr,"lock")),a(i)?(g(),V(Tn,{key:1})):F("",!0)],2))}});var yr=W(gr,[["__scopeId","data-v-0aae340d"]]);const vr={key:0},br={key:0,class:"mark star"},_r=["src"],Nr=A({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(g(),k("div",vr,[e.mark===!0?(g(),k("div",br)):(g(),k("img",{key:1,class:"mark",src:e.mark},null,8,_r))])):F("",!0)}});var Gt=W(Nr,[["__scopeId","data-v-2207999f"]]);const wr=A({__name:"Node",props:{id:null},setup(e){const n=re(e),s=Ot(ln,()=>{}),i=Ot(un,()=>{}),r=ye(null),l=$(()=>r.value&&r.value.parentElement);return Me([l,n.id],([o,c],[u,p])=>{u&&i(a(p)),o&&s(c,o)}),In(()=>i(a(n.id))),(o,c)=>(g(),k("div",{class:"node",ref_key:"node",ref:r},null,512))}});var wt=W(wr,[["__scopeId","data-v-a48cb382"]]),kr=A({props:{display:{type:T(Object,String,Function),required:!0},visibility:{type:T(Number),required:!0},style:T(Object,String,Array),classes:T(Object),onClick:Function,onHold:Function,canClick:{type:T(Boolean),required:!0},small:Boolean,mark:T(Boolean,String),id:{type:String,required:!0},isHolding:Object},components:{Node:wt,MarkNode:Gt},setup(e){const{display:t,onClick:n,onHold:s}=re(e),i=ye("");ve(()=>{const o=ee(t);if(o==null){i.value="";return}if(Ye(o)){i.value=R(o);return}const c=R(o.title||"","h3"),u=R(o.description,"div");i.value=R(B(()=>f("span",null,[o.title?f("div",null,[f(c,null,null)]):null,f(u,null,null)])))});const{start:r,stop:l}=Hn(n,s,e.isHolding);return{start:r,stop:l,comp:i,Visibility:ie,unref:a}}});function Sr(e,t,n,s,i,r){var c;const l=We("MarkNode"),o=We("Node");return e.unref(e.visibility)!==e.Visibility.None?(g(),k("button",{key:0,style:se([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...u)=>e.onClick&&e.onClick(...u)),onMousedown:t[1]||(t[1]=(...u)=>e.start&&e.start(...u)),onMouseleave:t[2]||(t[2]=(...u)=>e.stop&&e.stop(...u)),onMouseup:t[3]||(t[3]=(...u)=>e.stop&&e.stop(...u)),onTouchstartPassive:t[4]||(t[4]=(...u)=>e.start&&e.start(...u)),onTouchendPassive:t[5]||(t[5]=(...u)=>e.stop&&e.stop(...u)),onTouchcancelPassive:t[6]||(t[6]=(...u)=>e.stop&&e.stop(...u)),class:Q({feature:!0,clickable:!0,can:e.unref(e.canClick),locked:!e.unref(e.canClick),small:e.small,...e.unref(e.classes)})},[e.unref(e.comp)?(g(),V(ae(e.unref(e.comp)),{key:0})):F("",!0),f(l,{mark:e.unref(e.mark)},null,8,["mark"]),f(o,{id:e.id},null,8,["id"])],38)):F("",!0)}var Xn=W(kr,[["render",Sr],["__scopeId","data-v-8cedd7da"]]);const Mr=Symbol("Clickable");function nn(e){return _e(()=>{var n;const t=(n=e==null?void 0:e())!=null?n:{};if(t.id=_t("clickable-"),t.type=Mr,t[He]=Xn,t.isHolding=O(!1),I(t,"visibility"),ue(t,"visibility",ie.Visible),I(t,"canClick"),ue(t,"canClick",!0),I(t,"classes"),I(t,"style"),I(t,"mark"),I(t,"display"),t.onClick){const s=t.onClick.bind(t);t.onClick=function(i){a(t.canClick)&&s(i)}}if(t.onHold){const s=t.onHold.bind(t);t.onHold=function(){a(t.canClick)&&s()}}return t[Ke]=function(){const{display:s,visibility:i,style:r,classes:l,onClick:o,onHold:c,isHolding:u,canClick:p,small:y,mark:v,id:b}=this;return{display:s,visibility:i,style:a(r),classes:l,onClick:o,onHold:c,isHolding:u,canClick:p,small:y,mark:v,id:b}},t})}function It(e,t="points",n=0,s=void 0){const i=ne(e)?e:$e(e);return i.displayName=t,i.precision=n,i.small=s,i}function Cr(e){const t=$e(e.value);return Me(e,(n,s)=>{d.gt(n,s)&&(t.value=d.add(t.value,d.sub(n,s)))}),t}new d("10^^8");new d("1e100");function fn(e,t){const n=t!=null?t:e.value;return d.eq(e.precision,0)?te(e.small?n:d.floor(n)):Ce(n,e.precision,e.small)}const $r=["x1","y1","x2","y2"],Pr=A({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=re(e),s=$(()=>{const r=n.startNode.value.rect,l=n.boundingRect.value,o=l?{x:r.x+r.width/2-l.x,y:r.y+r.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}),i=$(()=>{const r=n.endNode.value.rect,l=n.boundingRect.value,o=l?{x:r.x+r.width/2-l.x,y:r.y+r.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(r,l)=>(g(),k("line",et({"stroke-width":"15px",stroke:"white"},e.link,{x1:a(s).x,y1:a(s).y,x2:a(i).x,y2:a(i).y}),null,16,$r))}});const Tr=A({__name:"Links",props:{links:null},setup(e){var c;const n=xe(e,"links"),s=O(null),i=Ot(cn,O({})),r=Ot(dn,O(void 0)),l=O((c=s.value)==null?void 0:c.getBoundingClientRect());Me(r,()=>{var u;return l.value=(u=s.value)==null?void 0:u.getBoundingClientRect()}),qt(()=>{var u;return l.value=(u=s.value)==null?void 0:u.getBoundingClientRect()});const o=$(()=>{var p,y;const u=i.value;return(y=(p=n.value)==null?void 0:p.filter(v=>{var b,N;return((b=u[v.startNode.id])==null?void 0:b.rect)&&((N=u[v.startNode.id])==null?void 0:N.rect)}))!=null?y:[]});return(u,p)=>(g(),k(j,null,[a(o)?(g(),k("svg",bs(et({key:0},u.$attrs)),[(g(!0),k(j,null,Fn(a(o),(y,v)=>(g(),V(Pr,{key:v,link:y,boundingRect:l.value,startNode:a(i)[y.startNode.id],endNode:a(i)[y.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):F("",!0),m("div",{ref_key:"resizeListener",ref:s,class:"resize-listener"},null,512)],64))}});var Ir=W(Tr,[["__scopeId","data-v-063f6d6b"]]);A({props:{nodes:{type:T(Array),required:!0},leftSideNodes:T(Array),rightSideNodes:T(Array),branches:T(Array)},components:{Links:Ir},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:s}=re(e),i=ye();ve(()=>{const o=ee(t);i.value=R(B(()=>f(j,null,[o.map(c=>f("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(Oe)]))])))});const r=ye();ve(()=>{const o=ee(n);r.value=o?R(B(()=>f("span",{class:"left-side-nodes small"},[o.map(Oe)]))):""});const l=ye();return ve(()=>{const o=ee(s);l.value=o?R(B(()=>f("span",{class:"side-nodes small"},[o.map(Oe)]))):""}),{unref:a,nodesComp:i,leftNodesComp:r,rightNodesComp:l}}});A({props:{display:T(Object,String,Function),visibility:{type:T(Number),required:!0},style:T(String,Object,Array),classes:T(Object),onClick:Function,onHold:Function,color:T(String),glowColor:T(String),canClick:{type:T(Boolean),required:!0},mark:T(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Gt,Node:wt},setup(e){const{onClick:t,onHold:n,display:s}=re(e),i=dt(s),{start:r,stop:l}=Hn(t,n);return{start:r,stop:l,comp:i,unref:a,Visibility:ie,isCoercableComponent:Ye}}});function Fr(e){const t=[],n={};let s=!1;function i(){return s||(t.push(...e()),n.base=t.map(o=>ce(o.base)),n.baseText=t.map(o=>ce(o.baseText)),n.visible=t.map(o=>ce(o.visible)),s=!0),t}const r=$e({});return[B(()=>{const o=i();let c=!0;const u=o.map((p,y)=>{var w,x,fe;if(a(n.visible[y])===!1)return null;const v=f("h3",{onClick:()=>r.value[y]=!r.value[y],style:"cursor: pointer"},[f("span",{class:"modifier-toggle"+(a(r.value[y])?" collapsed":"")},[C("\u25BC")]),p.title,p.subtitle?f("span",{class:"subtitle"},[C(" ("),p.subtitle,C(")")]):null]),b=a(r.value[y])?null:f(j,null,[f("div",{class:"modifier-container"},[f("span",{class:"modifier-amount"},[Ce((w=a(n.base[y]))!=null?w:1),p.unit]),f("span",{class:"modifier-description"},[Oe((x=a(n.baseText[y]))!=null?x:"Base")])]),Oe(a(p.modifier.description))]),N=!c;return c=!1,f(j,null,[N?f("br",null,null):null,f("div",null,[v,f("br",null,null),b,f("hr",null,null),C("Total: "),Ce(p.modifier.apply((fe=a(n.base[y]))!=null?fe:1)),p.unit])])});return f(j,null,[u])}),r]}const Or=A({props:{progress:{type:T(String,Object,Number),required:!0},width:{type:T(Number),required:!0},height:{type:T(Number),required:!0},direction:{type:T(String),required:!0},display:T(Object,String,Function),visibility:{type:T(Number),required:!0},style:T(Object,String,Array),classes:T(Object),borderStyle:T(Object,String,Array),textStyle:T(Object,String,Array),baseStyle:T(Object,String,Array),fillStyle:T(Object,String,Array),mark:T(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Gt,Node:wt},setup(e){const{progress:t,width:n,height:s,direction:i,display:r}=re(e),l=$(()=>{let u=t.value instanceof d?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(u,0),1))*100}),o=$(()=>{const u={width:ee(n)+.5+"px",height:ee(s)+.5+"px"};switch(a(i)){case z.Up:u.clipPath=`inset(${l.value}% 0% 0% 0%)`,u.width=ee(n)+1+"px";break;case z.Down:u.clipPath=`inset(0% 0% ${l.value}% 0%)`,u.width=ee(n)+1+"px";break;case z.Right:u.clipPath=`inset(0% ${l.value}% 0% 0%)`;break;case z.Left:u.clipPath=`inset(0% 0% 0% ${l.value} + '%)`;break;case z.Default:u.clipPath="inset(0% 50% 0% 0%)";break}return u}),c=dt(r);return{normalizedProgress:l,barStyle:o,component:c,unref:a,Visibility:ie}}});function xr(e,t,n,s,i,r){var c,u,p,y,v,b,N;const l=We("MarkNode"),o=We("Node");return e.unref(e.visibility)!==e.Visibility.None?(g(),k("div",{key:0,style:se([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:Q({bar:!0,...e.unref(e.classes)})},[m("div",{class:"overlayTextContainer border",style:se([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(u=e.unref(e.borderStyle))!=null?u:{}])},[e.component?(g(),k("span",{key:0,class:"overlayText",style:se(e.unref(e.textStyle))},[(g(),V(ae(e.component)))],4)):F("",!0)],4),m("div",{class:"border",style:se([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(p=e.unref(e.style))!=null?p:{},(y=e.unref(e.baseStyle))!=null?y:{},(v=e.unref(e.borderStyle))!=null?v:{}])},[m("div",{class:"fill",style:se([e.barStyle,(b=e.unref(e.style))!=null?b:{},(N=e.unref(e.fillStyle))!=null?N:{}])},null,4)],4),f(l,{mark:e.unref(e.mark)},null,8,["mark"]),f(o,{id:e.id},null,8,["id"])],6)):F("",!0)}var Dr=W(Or,[["render",xr],["__scopeId","data-v-02d0d7b2"]]);const Er=Symbol("Bar");function Ft(e){return _e(()=>{const t=e();return t.id=_t("bar-"),t.type=Er,t[He]=Dr,I(t,"visibility"),ue(t,"visibility",ie.Visible),I(t,"width"),I(t,"height"),I(t,"direction"),I(t,"style"),I(t,"classes"),I(t,"borderStyle"),I(t,"baseStyle"),I(t,"textStyle"),I(t,"fillStyle"),I(t,"progress"),I(t,"display"),I(t,"mark"),t[Ke]=function(){const{progress:n,width:s,height:i,direction:r,display:l,visibility:o,style:c,classes:u,borderStyle:p,textStyle:y,baseStyle:v,fillStyle:b,mark:N,id:w}=this;return{progress:n,width:s,height:i,direction:r,display:l,visibility:o,style:a(c),classes:u,borderStyle:p,textStyle:y,baseStyle:v,fillStyle:b,mark:N,id:w}},t})}const Ar=Symbol("Buyable");function Xt(e){const t=$e(0);return _e(()=>{var r,l,o;const n=e();if(n.canPurchase==null&&(n.resource==null||n.cost==null))throw console.warn("Cannot create buyable without a canPurchase property or a resource and cost property",n),"Cannot create buyable without a canPurchase property or a resource and cost property";n.id=_t("buyable-"),n.type=Ar,n[He]=Xn,n.amount=t,n.amount[At]=(r=n.initialValue)!=null?r:0,n.canAfford=$(()=>{const c=n,u=a(c.cost);return c.resource!=null&&u!=null&&d.gte(c.resource.value,u)}),n.canPurchase==null&&(n.canPurchase=$(()=>a(n.visibility)===ie.Visible&&a(n.canAfford)&&d.lt(n.amount.value,a(n.purchaseLimit)))),n.maxed=$(()=>d.gte(n.amount.value,a(n.purchaseLimit))),I(n,"classes");const s=n.classes;n.classes=$(()=>{const c=a(s)||{};return n.maxed.value&&(c.bought=!0),c}),I(n,"canPurchase"),n.canClick=n.canPurchase,n.onClick=n.purchase=(o=(l=n.onClick)!=null?l:n.purchase)!=null?o:function(){var p;const c=n;if(!a(c.canPurchase))return;const u=a(c.cost);c.cost!=null&&c.resource!=null&&(c.resource.value=d.sub(c.resource.value,u),c.amount.value=d.add(c.amount.value,1)),(p=c.onPurchase)==null||p.call(c,u)},I(n,"display");const i=n.display;return n.display=B(()=>{const c=a(i);if(Ye(c)){const u=R(c);return f(u,null,null)}if(c!=null&&n.cost!=null&&n.resource!=null){const u=n,p=R(c.title||"","h3"),y=R(c.description||""),v=R(c.effectDisplay||"");return f("span",null,[c.title?f("div",null,[f(p,null,null)]):null,c.description?f(y,null,null):null,c.showAmount===!1?null:f("div",null,[f("br",null,null),a(u.purchaseLimit)===d.dInf?f(j,null,[C("Amount: "),te(u.amount.value)]):f(j,null,[C("Amount: "),te(u.amount.value),C(" /")," ",te(a(u.purchaseLimit))])]),c.effectDisplay?f("div",null,[f("br",null,null),C("Currently: "),f(v,null,null)]):null,u.cost&&!u.maxed.value?f("div",null,[f("br",null,null),C("Cost: "),Ce(a(u.cost)||0)," ",n.resource.displayName]):null])}return""}),I(n,"visibility"),ue(n,"visibility",ie.Visible),I(n,"cost"),I(n,"resource"),I(n,"purchaseLimit"),ue(n,"purchaseLimit",d.dInf),I(n,"style"),I(n,"mark"),I(n,"small"),n[Ke]=function(){const{display:c,visibility:u,style:p,classes:y,onClick:v,canClick:b,small:N,mark:w,id:x}=this;return{display:c,visibility:u,style:a(p),classes:y,onClick:v,canClick:b,small:N,mark:w,id:x}},n})}const Vr=A({__name:"Sticky",setup(e){const t=O("0"),n=new ResizeObserver(i),s=ye(null);function i(){let r=s.value;if(r==null)return;let l=0;for(;r.previousSibling;){const o=r.previousSibling;o.dataset&&"vSticky"in o.dataset&&(l+=o.offsetHeight),r=o}t.value=l+"px"}return Qe(i),document.fonts.ready.then(i),qt(()=>{var l;const r=(l=s.value)==null?void 0:l.parentElement;r&&n.observe(r)}),(r,l)=>(g(),k("div",{class:"sticky",style:se({top:t.value}),ref_key:"element",ref:s,"data-v-sticky":""},[Fe(r.$slots,"default",{},void 0,!0)],4))}});var qr=W(Vr,[["__scopeId","data-v-cccac690"]]);const Lr=A({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,n=$(()=>fn(t.resource));return(s,i)=>(g(),k("h2",{style:se({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},L(a(n)),5))}});const Br={class:"main-display"},Rr={key:0},Ur={key:1},Gr=C(", "),Qt=A({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null},setup(e){const n=re(e),s=O(null),i=dt(n.effectDisplay),r=$(()=>d.lt(n.resource.value,"1e1000"));return(l,o)=>(g(),V(qr,null,{default:D(()=>{var c,u,p,y;return[m("div",{class:Q(["main-display-container",(c=e.classes)!=null?c:{}]),style:se([{height:`${((p=(u=s.value)==null?void 0:u.$el.clientHeight)!=null?p:0)+50}px`},(y=e.style)!=null?y:{}])},[m("div",Br,[a(r)?(g(),k("span",Rr,"You have ")):F("",!0),f(Lr,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),C(" "+L(e.resource.displayName),1),a(i)?(g(),k("span",Ur,[Gr,(g(),V(ae(a(i)),{ref_key:"effectRef",ref:s},null,512))])):F("",!0)])],6)]}),_:1}))}});var jr=A({props:{display:{type:T(String,Object,Function),required:!0},visibility:{type:T(Number),required:!0},style:T(String,Object,Array),classes:T(Object),resource:Object,cost:T(String,Object,Number),canPurchase:{type:T(Boolean),required:!0},bought:{type:T(Boolean),required:!0},mark:T(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:wt,MarkNode:Gt},setup(e){const{display:t,cost:n}=re(e),s=ye("");return ve(()=>{const i=ee(t);if(i==null){s.value="";return}if(Ye(i)){s.value=R(i);return}const r=ee(n),l=R(i.title||"","h3"),o=R(i.description,"div"),c=R(i.effectDisplay||"");s.value=R(B(()=>{var u;return f("span",null,[i.title?f("div",null,[f(l,null,null)]):null,f(o,null,null),i.effectDisplay?f("div",null,[C("Currently: "),f(c,null,null)]):null,e.resource!=null?f(j,null,[f("br",null,null),C("Cost: "),e.resource&&fn(e.resource,r)," ",(u=e.resource)==null?void 0:u.displayName]):null])}))}),{component:s,unref:a,Visibility:ie}}});const zr=["disabled"];function Wr(e,t,n,s,i,r){var c;const l=We("MarkNode"),o=We("Node");return e.unref(e.visibility)!==e.Visibility.None?(g(),k("button",{key:0,style:se([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...u)=>e.purchase&&e.purchase(...u)),class:Q({feature:!0,upgrade:!0,can:e.unref(e.canPurchase),locked:!e.unref(e.canPurchase),bought:e.unref(e.bought),...e.unref(e.classes)}),disabled:!e.unref(e.canPurchase)},[e.unref(e.component)?(g(),V(ae(e.unref(e.component)),{key:0})):F("",!0),f(l,{mark:e.unref(e.mark)},null,8,["mark"]),f(o,{id:e.id},null,8,["id"])],14,zr)):F("",!0)}var Hr=W(jr,[["render",Wr],["__scopeId","data-v-7742f590"]]);const Kr=Symbol("Upgrade");function Ie(e){const t=$e(!1);return _e(()=>{const n=e();return n.id=_t("upgrade-"),n.type=Kr,n[He]=Hr,n.canAfford==null&&(n.resource==null||n.cost==null)&&console.warn("Error: can't create upgrade without a canAfford property or a resource and cost property",n),n.bought=t,n.canAfford==null?n.canAfford=$(()=>{const s=n;return s.resource!=null&&s.cost!=null&&d.gte(s.resource.value,a(s.cost))}):I(n,"canAfford"),n.canPurchase=$(()=>a(n.visibility)===ie.Visible&&a(n.canAfford)&&!a(n.bought)),n.purchase=function(){var i;const s=n;!a(s.canPurchase)||(s.resource!=null&&s.cost!=null&&(s.resource.value=d.sub(s.resource.value,a(s.cost))),t.value=!0,(i=s.onPurchase)==null||i.call(s))},I(n,"visibility"),ue(n,"visibility",ie.Visible),I(n,"classes"),I(n,"style"),I(n,"display"),I(n,"mark"),I(n,"cost"),I(n,"resource"),n[Ke]=function(){const{display:s,visibility:i,style:r,classes:l,resource:o,cost:c,canPurchase:u,bought:p,mark:y,id:v,purchase:b}=this;return{display:s,visibility:i,style:a(r),classes:l,resource:o,cost:c,canPurchase:u,bought:p,mark:y,id:v,purchase:b}},n})}function pe(e){return _e(()=>{const{addend:t,description:n,enabled:s}=e(),i=ce(t),r=ce(n),l=s==null?void 0:ce(s);return{apply:o=>d.add(o,a(i)),revert:o=>d.sub(o,a(i)),enabled:l,description:n==null?void 0:B(()=>f("div",{class:"modifier-container"},[f("span",{class:"modifier-amount"},[d.gte(a(i),0)?"+":"",Ce(a(i))]),a(r)?f("span",{class:"modifier-description"},[Oe(a(r))]):null]))}})}function Be(e){return _e(()=>{const{multiplier:t,description:n,enabled:s}=e(),i=ce(t),r=ce(n),l=s==null?void 0:ce(s);return{apply:o=>d.times(o,a(i)),revert:o=>d.div(o,a(i)),enabled:l,description:n==null?void 0:B(()=>f("div",{class:"modifier-container"},[f("span",{class:"modifier-amount"},[C("x"),Ce(a(i))]),a(r)?f("span",{class:"modifier-description"},[Oe(a(r))]):null]))}})}function Yr(e){return _e(()=>{const{exponent:t,description:n,enabled:s,supportLowNumbers:i}=e(),r=ce(t),l=ce(n),o=s==null?void 0:ce(s);return{apply:c=>{let u=c;return i&&(u=d.add(u,1)),u=d.pow(u,a(r)),i&&(u=d.sub(u,1)),u},revert:c=>{let u=c;return i&&(u=d.add(u,1)),u=d.root(u,a(r)),i&&(u=d.sub(u,1)),u},enabled:o,description:n==null?void 0:B(()=>f("div",{class:"modifier-container"},[f("span",{class:"modifier-amount"},[C("^"),Ce(a(r))]),a(l)?f("span",{class:"modifier-description"},[Oe(a(l)),i?" (+1 effective)":null]):null]))}})}function Re(e){return _e(()=>{const t=e();return{apply:n=>t.filter(s=>a(s.enabled)!==!1).reduce((s,i)=>i.apply(s),n),revert:t.every(n=>n.revert!=null)?n=>t.filter(s=>a(s.enabled)!==!1).reduceRight((s,i)=>i.revert(s),n):void 0,enabled:$(()=>t.filter(n=>a(n.enabled)!==!1).length>0),description:B(()=>f(j,null,[t.filter(n=>a(n.enabled)!==!1).map(n=>a(n.description)).filter(n=>n).map(Oe)]))}})}function Zr(e){return _e(()=>{const t=e();return t.currentGain==null&&(t.currentGain=$(()=>{let n=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return n=d.floor(n).max(0),a(t.buyMax)||(n=n.min(1)),n})),t.actualGain==null&&(t.actualGain=t.currentGain),t.currentAt==null&&(t.currentAt=$(()=>{let n=t.scaling.currentAt(t);return t.roundUpCost&&(n=d.ceil(n)),n})),t.nextAt==null&&(t.nextAt=$(()=>{let n=t.scaling.nextAt(t);return t.roundUpCost&&(n=d.ceil(n)),n})),t.convert==null&&(t.convert=function(){var i;const n=a(t.currentGain),s=a(t.currentAt);t.gainResource.value=d.add(t.gainResource.value,n),t.spend(n,s),(i=t.onConvert)==null||i.call(t,n)}),t.spend==null&&(t.spend=function(){t.baseResource.value=0}),I(t,"currentGain"),I(t,"actualGain"),I(t,"currentAt"),I(t,"nextAt"),I(t,"buyMax"),ue(t,"buyMax",!0),I(t,"roundUpCost"),ue(t,"roundUpCost",!0),t})}function Jr(e,t){const n=ce(e),s=ce(t);return{currentGain(i){let r=a(i.baseResource.value);if(i.costModifier&&(r=i.costModifier.apply(r)),d.lt(r,a(n)))return 0;const l=d.div(r,a(n)).pow(a(s));return l.isNan()?new d(0):l},currentAt(i){let r=a(i.currentGain);return i.gainModifier&&(r=i.gainModifier.revert(r)),r=d.max(0,r).root(a(s)).times(a(n)),i.costModifier&&(r=i.costModifier.revert(r)),r},nextAt(i){let r=d.add(a(i.currentGain),1).floor();return i.gainModifier&&(r=i.gainModifier.revert(r)),r=d.max(0,r).root(a(s)).times(a(n)).max(a(n)),i.costModifier&&(r=i.costModifier.revert(r)),r}}}function Xr(e){return Zr(()=>{const t=e();return ue(t,"buyMax",!1),t.currentGain==null&&(t.currentGain=$(()=>{let n=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return n=d.floor(n).max(t.gainResource.value),a(t.buyMax)||(n=n.min(d.add(t.gainResource.value,1))),n})),t.actualGain==null&&(t.actualGain=$(()=>{let n=d.sub(d.floor(t.scaling.currentGain(t)),t.gainResource.value).max(0);return a(t.buyMax)||(n=n.min(1)),n})),ue(t,"convert",function(){var i;const n=a(t.actualGain),s=a(t.currentAt);t.gainResource.value=t.gainModifier?t.gainModifier.apply(a(t.currentGain)):a(t.currentGain),t.spend(n,s),(i=t.onConvert)==null||i.call(t,n)}),t})}const Qr={class:"field"},ea={key:0,class:"field-title"},mn=A({__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,s=dt(xe(n,"title"),"span"),i=O((l=n.options.find(o=>o.value===n.modelValue))!=null?l:null);Me(xe(n,"modelValue"),o=>{var c;ee(i)!==o&&(i.value=(c=n.options.find(u=>u.value===o))!=null?c:null)});function r(o){t("update:modelValue",o.value)}return(o,c)=>(g(),k("div",Qr,[a(s)?(g(),k("span",ea,[(g(),V(ae(a(s))))])):F("",!0),f(a(Ss),{options:e.options,modelValue:i.value,"onUpdate:modelValue":[c[0]||(c[0]=u=>i.value=u),r],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});var ta=A({props:{visibility:{type:T(Number),required:!0},display:{type:T(String,Object,Function),required:!0},style:T(String,Object,Array),classes:T(Object),earned:{type:T(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:wt},setup(e){const{display:t}=re(e),n=ye("");return ve(()=>{const s=ee(t);if(s==null){n.value="";return}if(Ye(s)){n.value=R(s);return}const i=R(s.requirement,"h3"),r=R(s.effectDisplay||"","b"),l=R(s.optionsDisplay||"","span");n.value=R(B(()=>f("span",null,[f(i,null,null),s.effectDisplay?f("div",null,[f(r,null,null)]):null,s.optionsDisplay?f("div",{class:"equal-spaced"},[f(l,null,null)]):null])))}),{comp:n,unref:a,Visibility:ie}}});function na(e,t,n,s,i,r){var o;const l=We("Node");return e.unref(e.visibility)!==e.Visibility.None?(g(),k("div",{key:0,style:se([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(o=e.unref(e.style))!=null?o:{}]),class:Q({feature:!0,milestone:!0,done:e.unref(e.earned),...e.unref(e.classes)})},[(g(),V(ae(e.unref(e.comp)))),f(l,{id:e.id},null,8,["id"])],6)):F("",!0)}var sa=W(ta,[["render",na],["__scopeId","data-v-f4e8794e"]]);de.on("setupVue",e=>e.use(Ms));const ia=xn(),ra=Symbol("Milestone");let ze;(function(e){e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none"})(ze||(ze={}));function Ue(e){const t=$e(!1);return _e(()=>{var i;const n=(i=e==null?void 0:e())!=null?i:{};n.id=_t("milestone-"),n.type=ra,n[He]=sa,n.earned=t,n.complete=function(){t.value=!0},I(n,"visibility"),ue(n,"visibility",ie.Visible);const s=n.visibility;if(n.visibility=$(()=>{const r=a(n.display);switch(Y.msDisplay){default:case ze.All:return a(s);case ze.Configurable:return a(n.earned)&&!(r!=null&&typeof r=="object"&&"optionsDisplay"in r)?ie.None:a(s);case ze.Incomplete:return a(n.earned)?ie.None:a(s);case ze.None:return ie.None}}),I(n,"style"),I(n,"classes"),I(n,"display"),n[Ke]=function(){const{visibility:r,display:l,style:o,classes:c,earned:u,id:p}=this;return{visibility:r,display:l,style:a(o),classes:c,earned:u,id:p}},n.shouldEarn){const r=n;ve(()=>{var l,o;if(Y.active===P.id&&!r.earned.value&&a(r.visibility)===ie.Visible&&((l=r.shouldEarn)==null?void 0:l.call(r))&&(r.earned.value=!0,(o=r.onComplete)==null||o.call(r),r.display)){const c=a(r.display),u=R(Ye(c)?c:c.requirement);ia(f(j,null,[f("h3",null,[C("Milestone earned!")]),f("div",null,[f(u,null,null)])]))}})}return n})}de.on("loadSettings",e=>{ue(e,"msDisplay",ze.All)});const aa=Object.values(ze).map(e=>({label:Bn(e),value:e}));Ii(B(()=>f(mn,{title:"Show Milestones",options:aa,"onUpdate:modelValue":e=>Y.msDisplay=e,modelValue:Y.msDisplay},null)));const oa="workshop",it=2,me=Rt(oa,function(){const e="Workshop",t="#D66B02",n="#D66B02",s=It(0,"foundation progress"),i=Xr(()=>({scaling:Jr(250,1.5),baseResource:ot.logs,gainResource:s,roundUpCost:!0,buyMax:!1,spend(x,fe){ot.logs.value=d.sub(ot.logs.value,fe)}})),r=nn(()=>({display:B(()=>f(j,null,[f("b",{style:"font-size: x-large"},[C("Build part of the foundation")]),f("br",null,null),f("br",null,null),f("span",{style:"font-size: large"},[C("Cost:")," ",fn(ot.logs,d.gte(i.actualGain.value,1)?i.currentAt.value:i.nextAt.value)," ",ot.logs.displayName])])),visibility:()=>oe(H.day.value===it),canClick:()=>d.gte(i.actualGain.value,1),onClick(){!a(this.canClick)||i.convert()},style:"width: 600px; min-height: unset"})),l=Ue(()=>({display:{requirement:"1% Foundation Completed",effectDisplay:"Trees give 5% more logs for each % of foundation completed"},shouldEarn:()=>d.gte(s.value,1)})),o=Ue(()=>({display:{requirement:"10% Foundation Completed",effectDisplay:"Cut an additional tree per second for each 5% of foundation completed"},shouldEarn:()=>d.gte(s.value,10),visibility:()=>oe(l.earned.value)})),c=Ue(()=>({display:{requirement:"20% Foundation Completed",effectDisplay:"Plant an additional tree per second for each 10% of foundation completed"},shouldEarn:()=>d.gte(s.value,20),visibility:()=>oe(o.earned.value)})),u=Ue(()=>({display:{requirement:"30% Foundation Completed",effectDisplay:"All automatic tree cutting is doubled"},shouldEarn:()=>d.gte(s.value,30),visibility:()=>oe(c.earned.value)})),p=Ue(()=>({display:{requirement:"40% Foundation Completed",effectDisplay:"All automatic tree planting is doubled"},shouldEarn:()=>d.gte(s.value,40),visibility:()=>oe(u.earned.value)})),y=Ue(()=>({display:{requirement:"50% Foundation Completed",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>d.gte(s.value,50),visibility:()=>oe(p.earned.value)})),v=Ue(()=>({display:{requirement:"75% Foundation Completed",effectDisplay:"The forest gains an extra tree for every 2% of foundation completed"},shouldEarn:()=>d.gte(s.value,75),visibility:()=>oe(y.earned.value)})),b=Ue(()=>({display:{requirement:"100% Foundation Completed",effectDisplay:"Trees' log gain is now raised to the 1.1th power"},shouldEarn:()=>d.gte(s.value,100),visibility:()=>oe(v.earned.value)})),N={logGainMilestone1:l,autoCutMilestone1:o,autoPlantMilestone1:c,autoCutMilestone2:u,autoPlantMilestone2:p,logGainMilestone2:y,morePlantsMilestone1:v,logGainMilestone3:b},w=Ft(()=>({direction:z.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,progress:()=>d.div(s.value,100),display:B(()=>H.day.value===it?f(j,null,[te(s.value),C("%")]):"")}));return ve(()=>{H.day.value===it&&d.gte(s.value,100)&&(H.loreTitle.value="Day complete!",H.loreBody.value="The workshop complete, Santa once again dismisses you for the day. With a strong foundation, this workshop should suffice for supporting future work toward this impossible mission. Good Job!",H.day.value=it+1,H.minimized.value=!1)}),{name:e,day:it,color:t,foundationProgress:s,foundationConversion:i,milestones:N,minWidth:700,display:B(()=>f(j,null,[f("div",null,[H.day.value===it?"Complete the foundation to complete the day":"Day Complete!"]),Se(w),f(ut,null,null),Se(r),f(ut,null,null),Vi(...Object.values(N))]))}}),la="trees",ft=1,ot=Rt(la,function(){const e="Trees",t="#4BDC13",n="green",s=It(0,"logs"),i=Cr(s),r=It(0,"saplings"),l=1e4,o=Re(()=>[pe(()=>({addend:()=>d.times(gn.amount.value,10),description:"Expand Forest",enabled:S.bought})),pe(()=>({addend:()=>d.div(me.foundationProgress.value,2),description:"75% Foundation Completed",enabled:me.milestones.morePlantsMilestone1.earned}))]),c=It($(()=>d.sub(o.apply(10),r.value)),"trees"),u=Ie(()=>({resource:s,cost:10,display:{title:"Wooden Fingers",description:"Cut down an additional tree per click"}})),p=Ie(()=>({resource:s,cost:10,display:{title:"Leafy Fingers",description:"Plant an additional tree per click"}})),y=Ie(()=>({resource:s,cost:25,display:{title:"Automated Knives",description:"Cut down a tree every second"}})),v=Ie(()=>({resource:s,cost:25,display:{title:"Automated Spade",description:"Plant a tree every second"}})),b=Ie(()=>({resource:s,cost:40,display:{title:"Research I",description:"Trees give 25% more logs, and unlock more upgrades"}})),N=[u,p,y,v,b],w=Ie(()=>({resource:s,cost:50,visibility:()=>oe(b.bought.value),display:{title:"Sharper Fingers",description:"Manually cut trees twice as often"}})),x=Ie(()=>({resource:s,cost:50,visibility:()=>oe(b.bought.value),display:{title:"Greener Fingers",description:"Manually Plant trees twice as often"}})),fe=Ie(()=>({resource:s,cost:150,visibility:()=>oe(b.bought.value),display:{title:"Smart Knives",description:"Each time you manually chop trees, gain 1s of automatic tree chopping production"}})),M=Ie(()=>({resource:s,cost:150,visibility:()=>oe(b.bought.value),display:{title:"Smart Spades",description:"Each time you manually plant trees, gain 1s of automatic tree planting production"}})),S=Ie(()=>({resource:s,cost:300,visibility:()=>oe(b.bought.value),display:{title:"Research II",description:"Trees give 25% more logs, and unlock repeatable purchases"}})),G=[w,x,fe,M,S],Ne=Xt(()=>({resource:s,cost(){let Z=this.amount.value;return d.gte(Z,50)&&(Z=d.pow(Z,2).div(50)),d.times(100,Z).add(200)},display:{title:"Generic Cutters",description:"Each cutter cuts down 1 tree/s"},visibility:()=>oe(S.bought.value)})),qe=Xt(()=>({resource:s,cost(){let Z=this.amount.value;return d.gte(Z,50)&&(Z=d.pow(Z,2).div(50)),d.times(100,Z).add(200)},display:{title:"Generic Planters",description:"Each planter plants 0.5 trees/s"},visibility:()=>oe(S.bought.value)})),gn=Xt(()=>({resource:s,cost(){return d.pow(d.add(this.amount.value,1),1.5).times(500)},display:{title:"Expand Forest",description:"Add 10 trees to the forest"},visibility:()=>oe(S.bought.value)})),yn=[Ne,qe,gn],as=Ft(()=>({direction:z.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,progress:()=>d.log10(i.value).div(Math.log10(l)),display:B(()=>H.day.value===ft?f(j,null,[te(i.value),C("/"),te(l)]):"")})),vn=Re(()=>[pe(()=>({addend:1,description:"Wooden Fingers",enabled:u.bought})),pe(()=>({addend:nt,description:"Smart Knives",enabled:fe.bought}))]),zt=$(()=>vn.apply(1)),os=Re(()=>[Be(()=>({multiplier:.5,description:"Sharper Fingers",enabled:w.bought}))]),tt=$(()=>os.apply(1)),bn=Re(()=>[pe(()=>({addend:1,description:"Automated Knives",enabled:y.bought})),pe(()=>({addend:Ne.amount,description:"Generic Cutters",enabled:S.bought})),pe(()=>({addend:()=>d.div(me.foundationProgress.value,5).floor(),description:"10% Foundation Completed",enabled:me.milestones.autoCutMilestone1.earned})),Be(()=>({multiplier:2,description:"30% Foundation Completed",enabled:me.milestones.autoCutMilestone2.earned}))]),nt=$(()=>bn.apply(0)),_n=Re(()=>[pe(()=>({addend:1,description:"Leafy Fingers",enabled:p.bought})),pe(()=>({addend:St,description:"Smart Spades",enabled:M.bought}))]),Wt=$(()=>_n.apply(1)),ls=Re(()=>[Be(()=>({multiplier:.5,description:"Greener Fingers",enabled:x.bought}))]),st=$(()=>ls.apply(1)),Nn=Re(()=>[pe(()=>({addend:1,description:"Automated Spade",enabled:v.bought})),pe(()=>({addend:()=>d.div(qe.amount.value,2),description:"Generic Planters",enabled:S.bought})),pe(()=>({addend:()=>d.div(me.foundationProgress.value,10).floor(),description:"20% Foundation Completed",enabled:me.milestones.autoPlantMilestone1.earned})),Be(()=>({multiplier:2,description:"40% Foundation Completed",enabled:me.milestones.autoPlantMilestone2.earned}))]),St=$(()=>Nn.apply(0)),Mt=Re(()=>[Be(()=>({multiplier:1.25,description:"Research I",enabled:b.bought})),Be(()=>({multiplier:1.25,description:"Research II",enabled:S.bought})),Be(()=>({multiplier:()=>d.div(me.foundationProgress.value,20).add(1),description:"1% Foundation Completed",enabled:me.milestones.logGainMilestone1.earned})),Be(()=>({multiplier:2,description:"50% Foundation Completed",enabled:me.milestones.logGainMilestone2.earned})),Yr(()=>({exponent:1.1,description:"100% Foundation Completed",enabled:me.milestones.logGainMilestone3.earned}))]),Pe=$e(0),us=Ft(()=>({direction:z.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>d.div(Pe.value,tt.value)})),Ct=nn(()=>({display:{title:"Cut trees",description:B(()=>f(j,null,[C("Cut down up to "),te(d.floor(zt.value))," ",C("tree"),d.eq(zt.value,1)?"":"s",C(" at once!"),f("br",null,null),Se(us)]))},style:{minHeight:"80px"},canClick:()=>d.gte(c.value,1)&&d.gte(Pe.value,tt.value),onClick(){if(d.lt(Pe.value,tt.value))return;const Z=d.floor(d.min(c.value,d.times(zt.value,d.div(Pe.value,tt.value).floor())));s.value=d.add(s.value,Mt.apply(Z)),r.value=d.add(r.value,Z),Pe.value=0}})),Te=$e(0),cs=Ft(()=>({direction:z.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>d.div(Te.value,st.value)})),$t=nn(()=>({display:{title:"Plant trees",description:B(()=>f(j,null,[C("Plant up to "),te(d.floor(Wt.value))," ",C("tree"),d.eq(Wt.value,1)?"":"s",C(" at once!"),f("br",null,null),Se(cs)]))},style:{minHeight:"80px"},canClick:()=>d.gte(r.value,1)&&d.gte(Te.value,st.value),onClick(){if(d.lt(Te.value,st.value))return;const Z=d.floor(d.min(r.value,d.times(Wt.value,d.div(Te.value,st.value).floor())));r.value=d.sub(r.value,Z),Te.value=0}})),[ds,fs]=Fr(()=>[{title:"Logs per Tree",modifier:Mt,base:1,visible:b.bought},{title:"Manual Cutting Amount",modifier:vn,base:1,visible:u.bought,unit:"/click"},{title:"Manual Planting Amount",modifier:_n,base:1,visible:p.bought,unit:"/click"},{title:"Auto Cutting Amount",modifier:bn,base:0,visible:y.bought,unit:"/s"},{title:"Auto Planting Amount",modifier:Nn,base:0,visible:v.bought,unit:"/s"},{title:"Forest Size",modifier:o,base:10,visible:S.bought}]),Ht=O(!1),ms=B(()=>f(Ae,{modelValue:Ht.value,"onUpdate:modelValue":Z=>Ht.value=Z},{header:()=>f("h2",null,[e,C(" Modifiers")]),body:ds}));de.on("update",Z=>{if(d.lt(H.day.value,ft))return;d.gte(Pe.value,tt.value)?Pe.value=tt.value:(Pe.value=d.add(Pe.value,Z),Ct.isHolding.value&&Ct.onClick()),d.gte(Te.value,st.value)?Te.value=st.value:(Te.value=d.add(Te.value,Z),$t.isHolding.value&&$t.onClick());const wn=d.min(c.value,d.times(nt.value,Z));s.value=d.add(s.value,Mt.apply(wn)),r.value=d.add(r.value,wn);const hs=d.min(r.value,d.times(St.value,Z));r.value=d.sub(r.value,hs)}),ve(()=>{H.day.value===ft&&d.gte(i.value,l)&&(H.loreTitle.value="Day complete!",H.loreBody.value="Santa looks at all the wood you've gathered and tells you you've done well! He says you should take the rest of the day off so you're refreshed for tomorrow's work. Good Job!",H.day.value=ft+1,H.minimized.value=!1)});const Kt=$(()=>d.sub(nt.value,St.value)),Yt=$(()=>d.sub(St.value,nt.value));return{name:e,color:t,logs:s,totalLogs:i,trees:c,saplings:r,cutTree:Ct,plantTree:$t,row1Upgrades:N,row2Upgrades:G,row1Buyables:yn,manualCutProgress:Pe,manualPlantProgress:Te,generalTabCollapsed:fs,minWidth:700,display:B(()=>f(j,null,[f("div",null,[H.day.value===ft?`Reach ${te(1e4)} ${s.displayName} to complete the day`:"Day Complete!"," ",C("-")," ",f("button",{class:"button",style:"display: inline-block;",onClick:()=>Ht.value=!0},[C("Check Modifiers")])]),Se(as),Se(ms),f(ut,null,null),f(Qt,{resource:s,color:t,style:"margin-bottom: 0",effectDisplay:d.gt(nt.value,0)?`+${Ce(Mt.apply(nt.value))}/s`:void 0},null),f(Qt,{resource:r,color:n,style:"margin-bottom: 0",effectDisplay:{[-1]:`${te(Kt.value)}/s`,0:void 0,1:`+${te(Kt.value)}/s`}[d.compare(Kt.value,0)]},null),f(Qt,{resource:c,color:n,style:"margin-bottom: 0",effectDisplay:{[-1]:`${te(Yt.value)}/s`,0:void 0,1:`+${te(Yt.value)}/s`}[d.compare(Yt.value,0)]},null),f(ut,null,null),ht(Ct,$t),f("div",null,[C("Tip: You can hold down on actions to perform them automatically")]),f(ut,null,null),ht(...N),ht(...G),ht(...yn)]))}}),H=Rt("main",function(){const e=$e(1),t=O(""),n=O("");function s(r){const l=$e(!1);return _e(()=>{const o=r(),c=ce(o.shouldNotify);return{...o,opened:l,shouldNotify:c,[He]:yr,[Ke]:function(){const{day:u,layer:p,symbol:y,opened:v,shouldNotify:b,story:N}=this;return{day:u,symbol:y,opened:v,shouldNotify:b,onOpenLore(){var w,x;t.value=a((x=(w=le[p!=null?p:"trees"])==null?void 0:w.name)!=null?x:""),n.value=N},onOpenLayer(){if(P.tabs.includes(p!=null?p:"trees")){const w=P.tabs.lastIndexOf(p!=null?p:"trees");P.tabs.splice(w,1)}else P.tabs.push(p!=null?p:"trees");H.minimized.value=!0},onUnlockLayer(){v.value=!0,setTimeout(()=>{var w,x;t.value=a((x=(w=le[p!=null?p:"trees"])==null?void 0:w.name)!=null?x:""),n.value=N},1e3)}}}}})}const i=[s(()=>({day:1,shouldNotify:!1,layer:"trees",symbol:"\u{1F384}",story:"Oh no! Santa forgot about Christmas and it's only 25 days away! He's asked for your help due to your history getting large quantities of things in short amounts of time. Unfortunately you're really starting from scratch here - let's start with getting wood, which you'll need for everything from building workshops to wrapping paper to many of the toys themselves!"})),s(()=>({day:2,shouldNotify:!1,layer:"workshop",symbol:"cabin",story:"Santa looked over your tree farm and was impressed with how much you could accomplish in just one day. Today's goal is to get a workshop built up for the elves to work in - and apparently, they need quite a lot of space to work!"})),s(()=>({day:3,shouldNotify:!1,layer:null,symbol:"\u{1F9DD}",story:"With this unbelievably large workshop complete, it's time to get the elves to work! But it appears they've forgotten how to make toys over the last 11 months - guess it's time to setup training sessions!"})),s(()=>({day:4,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:5,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:6,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:7,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:8,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:9,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:10,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:11,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:12,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:13,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:14,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:15,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:16,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:17,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:18,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:19,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:20,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:21,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:22,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:23,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:24,shouldNotify:!1,layer:null,symbol:"",story:""}))];return{name:"Calendar",days:i,day:e,loreTitle:t,loreBody:n,minWidth:710,display:B(()=>f(j,null,[P.devSpeed===0?f("div",null,[C("Game Paused")]):null,P.devSpeed&&P.devSpeed!==1?f("div",null,[C("Dev Speed: "),Ce(P.devSpeed),C("x")]):null,P.offlineTime?f("div",null,[C("Offline Time: "),Bt(P.offlineTime)]):null,f(ut,null,null),f("div",{class:"advent"},[i.reduce((r,l)=>(r[r.length-1].length===4&&r.push([]),r[r.length-1].push(l),r),[[]]).map(r=>ht(...r))])]))}}),ua=e=>[H,ot,me],Qn=$(()=>!1);function ca(e,t){}var es=Object.freeze(Object.defineProperty({__proto__:null,main:H,getInitialLayers:ua,hasWon:Qn,fixOldSave:ca},Symbol.toStringTag,{value:"Module"}));const da=A({components:{Context:Kn},props:{index:{type:Number,required:!0},tab:{type:Function,required:!0},display:{type:T(Object,String,Function),required:!0},minimized:{type:Object,required:!0},minWidth:{type:T(Number,String),required:!0},name:{type:T(String),required:!0},color:T(String),minimizable:T(Boolean),nodes:{type:Object,required:!0}},setup(e){const{display:t,index:n,minimized:s,minWidth:i,tab:r}=re(e),l=on(t),o=$(()=>U.allowGoBack&&n.value>0&&!s.value);function c(){P.tabs.splice(a(e.index),1)}Qe(()=>p(s.value,a(i.value))),Me([s,qi(i)],([y,v])=>p(y,v));function u(y){e.nodes.value=y}function p(y,v){const b=typeof v=="number"||Number.isNaN(parseInt(v))?v+"px":v,N=r.value();N!=null&&(y?(N.style.flexGrow="0",N.style.flexShrink="0",N.style.width="60px",N.style.minWidth=N.style.flexBasis="",N.style.margin="0"):(N.style.flexGrow="",N.style.flexShrink="",N.style.width="",N.style.minWidth=N.style.flexBasis=b,N.style.margin=""))}return{component:l,showGoBack:o,updateNodes:u,unref:a,goBack:c}}});function fa(e,t,n,s,i,r){const l=We("Context");return g(),k("div",{class:"layer-container",style:se({"--layer-color":e.unref(e.color)})},[e.showGoBack?(g(),k("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...o)=>e.goBack&&e.goBack(...o))},"\u274C")):F("",!0),e.minimized.value?(g(),k("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=o=>e.minimized.value=!1)},[m("div",null,L(e.unref(e.name)),1)])):(g(),k("div",{key:2,class:Q(["layer-tab",{showGoBack:e.showGoBack}])},[f(l,{onUpdateNodes:e.updateNodes},{default:D(()=>[(g(),V(ae(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(g(),k("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=o=>e.minimized.value=!0)}," \u25BC ")):F("",!0)],4)}var ma=W(da,[["render",fa],["__scopeId","data-v-0158bec3"]]);const ts=e=>(De("data-v-4b4bda40"),e=e(),Ee(),e),ha=ts(()=>m("h2",null,"Changelog",-1)),pa=ts(()=>m("details",{open:""},[m("summary",null,[C("v0.0 Initial Commit - "),m("time",null,"2021-09-04")]),C(" This is the first release :D "),m("ul",null,[m("li",{class:"feature"},"Did everything"),m("li",{class:"fix"},"Had some fun"),m("li",{class:"breaking"},"Removed everything"),m("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),ga=A({__name:"Changelog",setup(e,{expose:t}){const n=O(!1);return t({open(){n.value=!0}}),(s,i)=>(g(),V(Ae,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r)},{header:D(()=>[ha]),body:D(()=>[pa]),_:1},8,["modelValue"]))}});var ya=W(ga,[["__scopeId","data-v-4b4bda40"]]),va=A({props:{element:Object,display:{type:T(Object,String,Function),required:!0},style:T(Object,String,Array),classes:T(Object),direction:T(String),xoffset:T(String),yoffset:T(String),pinned:Object},setup(e){const{element:t,display:n,pinned:s}=re(e),i=O(!1),r=$(()=>(ee(s)||i.value)&&l.value),l=dt(n),o=ye(R(B(()=>{const p=ee(t);return p==null?"":Oe(p)})));function c(p){const y=s;p.shiftKey&&y&&(y.value=!y.value,p.stopPropagation(),p.preventDefault())}const u=$(()=>ee(s)&&Nt[Y.theme].showPin);return{Direction:z,isHovered:i,isShown:r,comp:l,elementComp:o,unref:a,togglePinned:c,showPin:u}}});const ba={key:0,class:"material-icons pinned"};function _a(e,t,n,s,i,r){return g(),k("div",{class:Q(["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))},[Fe(e.$slots,"default",{},void 0,!0),e.elementComp?(g(),V(ae(e.elementComp),{key:0})):F("",!0),f(Lt,{name:"fade"},{default:D(()=>{var l;return[e.isShown?(g(),k("div",{key:0,class:Q(["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:se([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(l=e.unref(e.style))!=null?l:{}])},[e.showPin?(g(),k("span",ba,"push_pin")):F("",!0),e.comp?(g(),V(ae(e.comp),{key:1})):F("",!0)],6)):F("",!0)]}),_:1})],34)}var X=W(va,[["render",_a],["__scopeId","data-v-6102fa3a"]]);const Na={class:"info-modal-header"},wa=["src","alt"],ka={class:"info-modal-title"},Sa={key:0},Ma={key:0},Ca={key:0},$a=m("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1),Pa=m("br",null,null,-1),Ta=m("br",null,null,-1),Ia=["href"],Fa=m("span",{class:"material-icons info-modal-discord"},"discord",-1),Oa=m("div",null,[m("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link"},[m("span",{class:"material-icons info-modal-discord"},"discord"),C(" The Paper Pilot Community ")])],-1),xa=m("div",null,[m("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link"},[m("span",{class:"material-icons info-modal-discord"},"discord"),C(" The Modding Tree ")])],-1),Da=m("br",null,null,-1);var Ea=A({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:s,logo:i,author:r,discordName:l,discordLink:o,versionNumber:c,versionTitle:u}=U,p=re(n),y=O(!1),v=$(()=>Bt(P.timePlayed)),b=$(()=>R(B(()=>f(j,null,[Fi.map(Se)]))));t({open(){y.value=!0}});function N(){var w;(w=a(p.changelog))==null||w.open()}return(w,x)=>(g(),V(Ae,{modelValue:y.value,"onUpdate:modelValue":x[0]||(x[0]=fe=>y.value=fe)},{header:D(()=>[m("div",Na,[a(i)?(g(),k("img",{key:0,class:"info-modal-logo",src:a(i),alt:a(s)},null,8,wa)):F("",!0),m("div",ka,[m("h2",null,L(a(s)),1),m("h4",null,[C(" v"+L(a(c)),1),a(u)?(g(),k("span",Sa,": "+L(a(u)),1)):F("",!0)])])])]),body:D(({shown:fe})=>[fe?(g(),k("div",Ma,[a(r)?(g(),k("div",Ca,"By "+L(a(r)),1)):F("",!0),$a,Pa,m("div",{class:"link",onClick:N},"Changelog"),Ta,m("div",null,[a(o)?(g(),k("a",{key:0,href:a(o),class:"info-modal-discord-link"},[Fa,C(" "+L(a(l)),1)],8,Ia)):F("",!0)]),Oa,xa,Da,m("div",null,"Time Played: "+L(a(v)),1),(g(),V(ae(a(b))))])):F("",!0)]),_:1},8,["modelValue"]))}});const Aa={class:"field"},Va=A({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,s=$(()=>R(a(n.title)||"","span")),i=$({get(){return!!n.modelValue},set(r){t("update:modelValue",r)}});return(r,l)=>(g(),k("label",Aa,[rn(m("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":l[0]||(l[0]=o=>ne(i)?i.value=o:null)},null,512),[[_s,a(i)]]),(g(),V(ae(a(s))))]))}});var Ge=W(Va,[["__scopeId","data-v-2b109500"]]);const ns=e=>(De("data-v-bc13791c"),e=e(),Ee(),e),qa=ns(()=>m("div",{class:"header"},[m("h2",null,"Options")],-1)),La=ns(()=>m("hr",null,null,-1));var Ba=A({__name:"Options",setup(e,{expose:t}){const n=O(!1);t({open(){n.value=!0}});const s=Object.keys(Nt).map(N=>({label:Bn(N),value:N})),i=$(()=>R(B(()=>f(j,null,[zn.map(Se)])))),{showTPS:r,theme:l,unthrottled:o}=re(Y),{autosave:c,offlineProd:u}=re(P),p=$({get(){return P.devSpeed===0},set(N){P.devSpeed=N?0:null}}),y=B(()=>f("span",null,[C("Offline Production"),f(X,{display:"Save-specific"},{default:()=>[C("*")]})])),v=B(()=>f("span",null,[C("Autosave"),f(X,{display:"Save-specific"},{default:()=>[C("*")]})])),b=B(()=>f("span",null,[C("Pause game"),f(X,{display:"Save-specific"},{default:()=>[C("*")]})]));return(N,w)=>(g(),V(Ae,{modelValue:n.value,"onUpdate:modelValue":w[6]||(w[6]=x=>n.value=x)},{header:D(()=>[qa]),body:D(()=>[f(mn,{title:"Theme",options:a(s),modelValue:a(l),"onUpdate:modelValue":w[0]||(w[0]=x=>ne(l)?l.value=x:null)},null,8,["options","modelValue"]),(g(),V(ae(a(i)))),f(Ge,{title:"Show TPS",modelValue:a(r),"onUpdate:modelValue":w[1]||(w[1]=x=>ne(r)?r.value=x:null)},null,8,["modelValue"]),La,f(Ge,{title:"Unthrottled",modelValue:a(o),"onUpdate:modelValue":w[2]||(w[2]=x=>ne(o)?o.value=x:null)},null,8,["modelValue"]),f(Ge,{title:a(y),modelValue:a(u),"onUpdate:modelValue":w[3]||(w[3]=x=>ne(u)?u.value=x:null)},null,8,["title","modelValue"]),f(Ge,{title:a(v),modelValue:a(c),"onUpdate:modelValue":w[4]||(w[4]=x=>ne(c)?c.value=x:null)},null,8,["title","modelValue"]),a(U).enablePausing?(g(),V(Ge,{key:0,title:a(b),modelValue:a(p),"onUpdate:modelValue":w[5]||(w[5]=x=>ne(p)?p.value=x:null)},null,8,["title","modelValue"])):F("",!0)]),_:1},8,["modelValue"]))}});var Ra=W(Ba,[["__scopeId","data-v-bc13791c"]]);const Ua=["onSubmit"],Ga={class:"field"},ja={key:0,class:"field-title"},za=["placeholder"],Wa=A({__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,s=dt(xe(n,"title"),"span"),i=ye(null);qt(()=>{var c;(c=i.value)==null||c.focus()});const r=$({get(){return a(n.modelValue)||""},set(c){t("update:modelValue",c)}});function l(){t("submit")}function o(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,u)=>(g(),k("form",{onSubmit:gt(l,["prevent"])},[m("div",Ga,[a(s)?(g(),k("span",ja,[(g(),V(ae(a(s))))])):F("",!0),e.textArea?(g(),V(a($s),{key:1,modelValue:a(r),"onUpdate:modelValue":u[0]||(u[0]=p=>ne(r)?r.value=p:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:o,ref_key:"field",ref:i},null,8,["modelValue","placeholder","maxHeight"])):rn((g(),k("input",{key:2,type:"text","onUpdate:modelValue":u[1]||(u[1]=p=>ne(r)?r.value=p:null),placeholder:e.placeholder,class:Q({fullWidth:!e.title}),onBlur:o,ref_key:"field",ref:i},null,42,za)),[[Ns,a(r)]])])],40,Ua))}});var ss=W(Wa,[["__scopeId","data-v-67b44a54"]]);const Ha={key:0},Ka=["onClick","disabled"],Ya={key:0},Za=["onClick"],Ja=A({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const s=re(e),i=O(!1);Me(i,o=>{t("confirmingChanged",o)});function r(){if(a(s.skipConfirm)){t("click");return}i.value&&t("click"),i.value=!i.value}function l(){i.value=!1}return(o,c)=>(g(),k("span",{class:Q(["container",{confirming:i.value}])},[i.value?(g(),k("span",Ha,"Are you sure?")):F("",!0),m("button",{onClick:gt(r,["stop"]),class:"button danger",disabled:e.disabled},[i.value?(g(),k("span",Ya,"Yes")):Fe(o.$slots,"default",{key:1},void 0,!0)],8,Ka),i.value?(g(),k("button",{key:1,class:"button",onClick:gt(l,["stop"])},"No",8,Za)):F("",!0)],2))}});var Xa=W(Ja,[["__scopeId","data-v-2f8ef34c"]]);const Qa=["onClick"],eo=A({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=O(!1),s=O(null);function i(){t("click"),s.value&&clearTimeout(s.value),n.value=!1,Qe(()=>{n.value=!0,s.value=setTimeout(()=>n.value=!1,500)})}return(r,l)=>(g(),k("button",{onClick:gt(i,["stop"]),class:Q(["feedback",{activated:n.value,left:e.left}])},[Fe(r.$slots,"default",{},void 0,!0)],10,Qa))}});var to=W(eo,[["__scopeId","data-v-01a1b95c"]]);const Ve=e=>(De("data-v-5285ac49"),e=e(),Ee(),e),no=Ve(()=>m("div",{class:"handle material-icons"},"drag_handle",-1)),so={key:0,class:"actions"},io=Ve(()=>m("span",{class:"material-icons"},"content_paste",-1)),ro=Ve(()=>m("span",{class:"material-icons"},"content_copy",-1)),ao=Ve(()=>m("span",{class:"material-icons"},"edit",-1)),oo=Ve(()=>m("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),lo={key:1,class:"actions"},uo=Ve(()=>m("span",{class:"material-icons"},"check",-1)),co=Ve(()=>m("span",{class:"material-icons"},"close",-1)),fo={key:2,class:"details"},mo={class:"save-version"},ho=Ve(()=>m("br",null,null,-1)),po={key:0},go={key:1},yo={key:3,class:"details"},vo={key:4,class:"details error"},bo=Ve(()=>m("br",null,null,-1)),_o=A({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:s}=re(n),i=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),r=O(!1),l=O(!1),o=O("");Me(r,()=>o.value=s.value.name||"");const c=$(()=>s.value&&s.value.id===P.id),u=$(()=>c.value?P.time:s.value&&s.value.time||0),p=on($(()=>{var v,b,N,w;return`Day ${(w=(N=(b=(v=s.value)==null?void 0:v.layers)==null?void 0:b.main)==null?void 0:N.day)!=null?w:1}`}));function y(){t("editName",o.value),r.value=!1}return(v,b)=>(g(),k("div",{class:Q(["save",{active:a(c)}])},[no,r.value?(g(),k("div",lo,[m("button",{onClick:y,class:"button"},[f(X,{display:"Save",direction:a(z).Left,class:"info"},{default:D(()=>[uo]),_:1},8,["direction"])]),m("button",{onClick:b[5]||(b[5]=N=>r.value=!r.value),class:"button"},[f(X,{display:"Cancel",direction:a(z).Left,class:"info"},{default:D(()=>[co]),_:1},8,["direction"])])])):(g(),k("div",so,[a(s).error==null&&!l.value?(g(),V(to,{key:0,onClick:b[0]||(b[0]=N=>t("export")),class:"button",left:""},{default:D(()=>[f(X,{display:"Export",direction:a(z).Left,class:"info"},{default:D(()=>[io]),_:1},8,["direction"])]),_:1})):F("",!0),a(s).error==null&&!l.value?(g(),k("button",{key:1,onClick:b[1]||(b[1]=N=>t("duplicate")),class:"button"},[f(X,{display:"Duplicate",direction:a(z).Left,class:"info"},{default:D(()=>[ro]),_:1},8,["direction"])])):F("",!0),a(s).error==null&&!l.value?(g(),k("button",{key:2,onClick:b[2]||(b[2]=N=>r.value=!r.value),class:"button"},[f(X,{display:"Edit Name",direction:a(z).Left,class:"info"},{default:D(()=>[ao]),_:1},8,["direction"])])):F("",!0),f(Xa,{disabled:a(c),onClick:b[3]||(b[3]=N=>t("delete")),onConfirmingChanged:b[4]||(b[4]=N=>l.value=N)},{default:D(()=>[f(X,{display:"Delete",direction:a(z).Left,class:"info"},{default:D(()=>[oo]),_:1},8,["direction"])]),_:1},8,["disabled"])])),a(s).error==null&&!r.value?(g(),k("div",fo,[m("button",{class:"button open",onClick:b[6]||(b[6]=N=>t("open"))},[m("h3",null,L(a(s).name),1)]),m("span",mo,"v"+L(a(s).modVersion),1),ho,a(u)?(g(),k("div",po,"Last played "+L(a(i).format(a(u))),1)):F("",!0),a(p)?(g(),k("div",go,[(g(),V(ae(a(p))))])):F("",!0)])):a(s).error==null&&r.value?(g(),k("div",yo,[f(ss,{modelValue:o.value,"onUpdate:modelValue":b[7]||(b[7]=N=>o.value=N),class:"editname",onSubmit:y},null,8,["modelValue"])])):(g(),k("div",vo,[C(" Error: Failed to load save with id "+L(a(s).id),1),bo,C(L(a(s).error),1)]))],2))}});var No=W(_o,[["__scopeId","data-v-5285ac49"]]);const hn=e=>(De("data-v-3b9991aa"),e=e(),Ee(),e),wo=hn(()=>m("h2",null,"Saves Manager",-1)),ko={class:"modal-footer"},So={class:"field"},Mo=hn(()=>m("span",{class:"field-title"},"Create Save",-1)),Co={class:"field-buttons"},$o={class:"footer"},Po=hn(()=>m("div",{style:{"flex-grow":"1"}},null,-1)),To=A({__name:"SavesManager",setup(e,{expose:t}){const n=O(!1),s=O(null);t({open(){n.value=!0}});const i=O(!1),r=O(""),l=O(null);Me(r,M=>{M?Qe(()=>{try{if(M[0]!=="{")if(M[0]==="e")M=decodeURIComponent(escape(atob(M)));else if(M[0]==="\u1BE1")M=je.decompressFromUTF16(M);else{console.warn("Unable to determine preset encoding",M),i.value=!0;return}const S=JSON.parse(M);if(typeof S!="object"){i.value=!0;return}const G=Tt();S.id=G,we(S),r.value="",i.value=!1,Y.saves.push(G)}catch{i.value=!0}}):i.value=!1});let o={},c=O(Object.keys(o).reduce((M,S)=>(M.push({label:S.split("/").slice(-1)[0].slice(0,-4),value:o[S]}),M),[]));const u=sn({});function p(M){if(u[M]==null){let S=localStorage.getItem(M);if(S==null)u[M]={error:"Save doesn't exist in localStorage",id:M};else if(S==="dW5kZWZpbmVk")u[M]={error:"Save is undefined",id:M};else try{if(S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=je.decompressFromUTF16(S);else return console.warn("Unable to determine preset encoding",S),i.value=!0,u[M]={error:"Unable to determine preset encoding",id:M},u[M];u[M]={...JSON.parse(S),id:M}}catch(G){u[M]={error:G,id:M},console.warn(`SavesManager: Failed to load info about save with id ${M}: ${G} ${S}`)}}return u[M]}Me(n,M=>{M&&Object.keys(u).forEach(S=>delete u[S])});const y=$(()=>Y.saves.reduce((M,S)=>(M[S]=p(S),M),{}));function v(M){let S;switch(P.id===M?S=Un(P[J]):S=JSON.stringify(y.value[M]),U.exportEncoding){default:console.warn(`Unknown save encoding: ${U.exportEncoding}. Defaulting to lz`);case"lz":S=je.compressToUTF16(S);break;case"base64":S=btoa(unescape(encodeURIComponent(S)));break;case"plain":break}const G=document.createElement("textarea");G.value=S,document.body.appendChild(G),G.select(),G.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(G)}function b(M){P.id===M&&we();const S={...y.value[M],id:Tt()};we(S),Y.saves.push(S.id)}function N(M){Y.saves=Y.saves.filter(S=>S!==M),localStorage.removeItem(M),u[M]=void 0}function w(M){y.value[P.id].time=P.time,we(),u[P.id]=void 0,Xe(y.value[M]),u[M]=void 0}function x(M){if(l.value=M,Qe(()=>{l.value=null}),M[0]!=="{")if(M[0]==="e")M=decodeURIComponent(escape(atob(M)));else if(M[0]==="\u1BE1")M=je.decompressFromUTF16(M);else{console.warn("Unable to determine preset encoding",M);return}const S=JSON.parse(M);S.id=Tt(),we(S),Y.saves.push(S.id),w(S.id)}function fe(M,S){const G=y.value[M];G&&(G.name=S,P.id===M?(P.name=S,we()):(we(G),u[M]=void 0))}return(M,S)=>(g(),V(Ae,{modelValue:n.value,"onUpdate:modelValue":S[4]||(S[4]=G=>n.value=G),ref_key:"modal",ref:s},{header:D(()=>[wo]),body:D(({shown:G})=>[G?(g(),V(a(Cs),{key:0,list:a(Y).saves,handle:".handle",itemKey:Ne=>Ne},{item:D(({element:Ne})=>[f(No,{save:a(y)[Ne],onOpen:qe=>w(Ne),onExport:qe=>v(Ne),onEditName:qe=>fe(Ne,qe),onDuplicate:qe=>b(Ne),onDelete:qe=>N(Ne)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):F("",!0)]),footer:D(()=>[m("div",ko,[f(ss,{modelValue:r.value,"onUpdate:modelValue":S[0]||(S[0]=G=>r.value=G),title:"Import Save",placeholder:"Paste your save here!",class:Q({importingFailed:i.value})},null,8,["modelValue","class"]),m("div",So,[Mo,m("div",Co,[m("button",{class:"button",onClick:S[1]||(S[1]=G=>w(a(lt)().id))},"New Game"),Object.keys(a(c)).length>0?(g(),V(mn,{key:0,options:a(c),modelValue:l.value,"onUpdate:modelValue":S[2]||(S[2]=G=>x(G)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):F("",!0)])]),m("div",$o,[Po,m("button",{class:"button modal-default-button",onClick:S[3]||(S[3]=G=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var is=W(To,[["__scopeId","data-v-3b9991aa"]]);const he=e=>(De("data-v-4a3f8425"),e=e(),Ee(),e),Io=["src","alt"],Fo={key:1,class:"title"},Oo=he(()=>m("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),xo={class:"discord"},Do={class:"discord-links"},Eo={key:0},Ao=["href"],Vo=he(()=>m("li",null,[m("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),qo=he(()=>m("li",null,[m("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Lo={href:"https://forums.moddingtree.com/",target:"_blank"},Bo=he(()=>m("span",{class:"material-icons"},"forum",-1)),Ro=he(()=>m("span",{class:"material-icons"},"info",-1)),Uo=he(()=>m("span",{class:"material-icons"},"library_books",-1)),Go=he(()=>m("span",{class:"material-icons"},"settings",-1)),jo=he(()=>m("span",{class:"material-icons"},"library_books",-1)),zo=he(()=>m("span",{class:"material-icons"},"settings",-1)),Wo=he(()=>m("span",{class:"material-icons"},"info",-1)),Ho={href:"https://forums.moddingtree.com/",target:"_blank"},Ko=he(()=>m("span",{class:"material-icons"},"forum",-1)),Yo={class:"discord"},Zo={class:"discord-links"},Jo={key:0},Xo=["href"],Qo=he(()=>m("li",null,[m("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),el=he(()=>m("li",null,[m("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),tl=A({__name:"Nav",setup(e){const t=O(null),n=O(null),s=O(null),i=O(null),{useHeader:r,banner:l,title:o,discordName:c,discordLink:u,versionNumber:p}=U;function y(){window.open(u,"mywindow")}return(v,b)=>(g(),k(j,null,[a(r)?(g(),k("div",et({key:0,class:"nav"},v.$attrs),[a(l)?(g(),k("img",{key:0,src:a(l),class:"banner",alt:a(o)},null,8,Io)):(g(),k("div",Fo,L(a(o)),1)),m("div",{onClick:b[0]||(b[0]=N=>{var w;return(w=i.value)==null?void 0:w.open()}),class:"version-container"},[f(X,{display:"Changelog",direction:a(z).Down,class:"version"},{default:D(()=>[m("span",null,"v"+L(a(p)),1)]),_:1},8,["direction"])]),Oo,m("div",xo,[m("span",{onClick:y,class:"material-icons"},"discord"),m("ul",Do,[a(u)?(g(),k("li",Eo,[m("a",{href:a(u),target:"_blank"},L(a(c)),9,Ao)])):F("",!0),Vo,qo])]),m("div",null,[m("a",Lo,[f(X,{display:"Forums",direction:a(z).Down,yoffset:"5px"},{default:D(()=>[Bo]),_:1},8,["direction"])])]),m("div",{onClick:b[1]||(b[1]=N=>{var w;return(w=t.value)==null?void 0:w.open()})},[f(X,{display:"Info",direction:a(z).Down,class:"info"},{default:D(()=>[Ro]),_:1},8,["direction"])]),m("div",{onClick:b[2]||(b[2]=N=>{var w;return(w=n.value)==null?void 0:w.open()})},[f(X,{display:"Saves",direction:a(z).Down,xoffset:"-20px"},{default:D(()=>[Uo]),_:1},8,["direction"])]),m("div",{onClick:b[3]||(b[3]=N=>{var w;return(w=s.value)==null?void 0:w.open()})},[f(X,{display:"Options",direction:a(z).Down,xoffset:"-66px"},{default:D(()=>[Go]),_:1},8,["direction"])])],16)):(g(),k("div",et({key:1,class:"overlay-nav"},v.$attrs),[m("div",{onClick:b[4]||(b[4]=N=>{var w;return(w=i.value)==null?void 0:w.open()}),class:"version-container"},[f(X,{display:"Changelog",direction:a(z).Right,xoffset:"25%",class:"version"},{default:D(()=>[m("span",null,"v"+L(a(p)),1)]),_:1},8,["direction"])]),m("div",{onClick:b[5]||(b[5]=N=>{var w;return(w=n.value)==null?void 0:w.open()})},[f(X,{display:"Saves",direction:a(z).Right},{default:D(()=>[jo]),_:1},8,["direction"])]),m("div",{onClick:b[6]||(b[6]=N=>{var w;return(w=s.value)==null?void 0:w.open()})},[f(X,{display:"Options",direction:a(z).Right},{default:D(()=>[zo]),_:1},8,["direction"])]),m("div",{onClick:b[7]||(b[7]=N=>{var w;return(w=t.value)==null?void 0:w.open()})},[f(X,{display:"Info",direction:a(z).Right},{default:D(()=>[Wo]),_:1},8,["direction"])]),m("div",null,[m("a",Ho,[f(X,{display:"Forums",direction:a(z).Right,xoffset:"7px"},{default:D(()=>[Ko]),_:1},8,["direction"])])]),m("div",Yo,[m("span",{onClick:y,class:"material-icons"},"discord"),m("ul",Zo,[a(u)?(g(),k("li",Jo,[m("a",{href:a(u),target:"_blank"},L(a(c)),9,Xo)])):F("",!0),Qo,el])])],16)),f(Ea,{ref_key:"info",ref:t,changelog:i.value},null,8,["changelog"]),f(is,{ref_key:"savesManager",ref:n},null,512),f(Ra,{ref_key:"options",ref:s},null,512),f(ya,{ref_key:"changelog",ref:i},null,512)],64))}});var rs=W(tl,[["__scopeId","data-v-4a3f8425"]]);const pn=e=>(De("data-v-62ae8bac"),e=e(),Ee(),e),nl={class:"inner-tab"},sl={key:0},il=pn(()=>m("br",null,null,-1)),rl=C(" You can help continue the "),al=pn(()=>m("i",null,"advent",-1)),ol=C("ure at: "),ll=pn(()=>m("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link"},[m("span",{class:"material-icons info-modal-discord"},"discord"),C(" The Paper Pilot Community ")],-1)),ul=[il,rl,al,ol,ll],cl=A({__name:"Game",setup(e){const t=xe(P,"tabs"),n=$(()=>Object.keys(le)),s=U.useHeader;function i(r){const{display:l,minimized:o,minWidth:c,name:u,color:p,minimizable:y,nodes:v}=r;return{display:l,minimized:o,minWidth:c,name:u,color:p,minimizable:y,nodes:v}}return(r,l)=>(g(),k("div",{class:Q(["tabs-container",{useHeader:a(s)}])},[(g(!0),k(j,null,Fn(a(t),(o,c)=>{var u,p;return g(),k("div",{key:c,class:Q(["tab",a((u=a(le)[o])==null?void 0:u.classes)]),ref_for:!0,ref:`tab-${c}`,style:se(a((p=a(le)[o])==null?void 0:p.style))},[c===0&&!a(s)?(g(),V(rs,{key:0})):F("",!0),m("div",nl,[a(n).includes(o)?(g(),V(ma,et({key:0},i(a(le)[o]),{index:c,tab:()=>{var y;return(y=r.$refs[`tab-${c}`])==null?void 0:y[0]}}),null,16,["index","tab"])):(g(),V(ae(o),{key:1,index:c},null,8,["index"]))])],6)}),128)),f(Ae,{"model-value":a(H).loreBody.value!=="","onUpdate:modelValue":l[0]||(l[0]=()=>a(H).loreBody.value="")},{header:D(()=>[m("h2",null,L(a(H).loreTitle.value),1)]),body:D(()=>[C(L(a(H).loreBody.value)+" ",1),a(H).days[a(H).day.value-1].opened.value?F("",!0):(g(),k("div",sl,ul))]),_:1},8,["model-value"])],2))}});var dl=W(cl,[["__scopeId","data-v-62ae8bac"]]);const kt=e=>(De("data-v-4a50ce42"),e=e(),Ee(),e),fl={class:"game-over-modal-header"},ml=["src","alt"],hl={class:"game-over-modal-title"},pl=kt(()=>m("h2",null,"Congratulations!",-1)),gl={key:0},yl=kt(()=>m("br",null,null,-1)),vl=kt(()=>m("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),bl=kt(()=>m("br",null,null,-1)),_l=["href"],Nl=kt(()=>m("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),wl=A({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:s,discordLink:i,versionNumber:r,versionTitle:l}=U,o=$(()=>Bt(P.timePlayed)),c=$(()=>Qn.value&&!P.keepGoing),u=xe(P,"autosave");function p(){P.keepGoing=!0}function y(){Xe(lt())}return(v,b)=>(g(),V(Ae,{"model-value":a(c)},{header:D(()=>[m("div",fl,[a(n)?(g(),k("img",{key:0,class:"game-over-modal-logo",src:a(n),alt:a(t)},null,8,ml)):F("",!0),m("div",hl,[pl,m("h4",null,"You've beaten "+L(a(t))+" v"+L(a(r))+": "+L(a(l)),1)])])]),body:D(({shown:N})=>[N?(g(),k("div",gl,[m("div",null,"It took you "+L(a(o))+" to beat the game.",1),yl,vl,bl,m("div",null,[m("a",{href:a(i),class:"game-over-modal-discord-link"},[Nl,C(" "+L(a(s)),1)],8,_l)]),f(Ge,{title:"Autosave",modelValue:a(u),"onUpdate:modelValue":b[0]||(b[0]=w=>ne(u)?u.value=w:null)},null,8,["modelValue"])])):F("",!0)]),footer:D(()=>[m("div",{class:"game-over-footer"},[m("button",{onClick:p,class:"button"},"Keep Going"),m("button",{onClick:y,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var kl=W(wl,[["__scopeId","data-v-4a50ce42"]]);const jt=e=>(De("data-v-3de07c06"),e=e(),Ee(),e),Sl=jt(()=>m("div",{class:"nan-modal-header"},[m("h2",null,"NaN value detected!")],-1)),Ml={key:0},Cl=jt(()=>m("br",null,null,-1)),$l=["href"],Pl=jt(()=>m("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Tl=jt(()=>m("br",null,null,-1)),Il={class:"nan-footer"},Fl=A({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=U,s=xe(P,"autosave"),i=xe(K,"hasNaN"),r=O(null),l=$(()=>{var b;return(b=K.NaNPath)==null?void 0:b.join(".")}),o=$(()=>{var b;return(b=K.NaNPath)==null?void 0:b.slice(-1)[0]}),c=$(()=>K.NaNReceiver&&o.value?K.NaNReceiver[o.value]:null),u=$({get(){return P.devSpeed===0},set(b){P.devSpeed=b?null:0}});function p(){K.NaNReceiver&&o.value&&(K.NaNReceiver[o.value]=new d(0),K.hasNaN=!1)}function y(){K.NaNReceiver&&o.value&&(K.NaNReceiver[o.value]=new d(1),K.hasNaN=!1)}function v(){K.NaNReceiver&&o.value&&(K.NaNReceiver[o.value]=new d(NaN),K.hasNaN=!1)}return(b,N)=>(g(),k(j,null,[f(Ae,et({modelValue:a(i),"onUpdate:modelValue":N[4]||(N[4]=w=>ne(i)?i.value=w:null)},b.$attrs),{header:D(()=>[Sl]),body:D(()=>[m("div",null,[C(' Attempted to assign "'+L(a(l))+'" to NaN',1),a(c)?(g(),k("span",Ml,L(" ")+"(previously "+L(a(Ce)(a(c)))+")",1)):F("",!0),C(". Auto-saving has been "+L(a(s)?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Cl,m("div",null,[m("a",{href:a(n),class:"nan-modal-discord-link"},[Pl,C(" "+L(a(t)),1)],8,$l)]),Tl,f(Ge,{title:"Autosave",modelValue:a(s),"onUpdate:modelValue":N[0]||(N[0]=w=>ne(s)?s.value=w:null)},null,8,["modelValue"]),a(U).enablePausing?(g(),V(Ge,{key:0,title:"Pause game",modelValue:a(u),"onUpdate:modelValue":N[1]||(N[1]=w=>ne(u)?u.value=w:null)},null,8,["modelValue"])):F("",!0)]),footer:D(()=>[m("div",Il,[m("button",{onClick:N[2]||(N[2]=w=>{var x;return(x=r.value)==null?void 0:x.open()}),class:"button"},"Open Saves Manager"),m("button",{onClick:p,class:"button"},"Set to 0"),m("button",{onClick:y,class:"button"},"Set to 1"),a(c)&&a(d).neq(a(c),0)&&a(d).neq(a(c),1)?(g(),k("button",{key:0,onClick:N[3]||(N[3]=w=>i.value=!1),class:"button"}," Set to previous ")):F("",!0),m("button",{onClick:v,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),f(is,{ref_key:"savesManager",ref:r},null,512)],64))}});var Ol=W(Fl,[["__scopeId","data-v-3de07c06"]]);const xl={key:0,class:"tpsDisplay"},Dl={key:0,class:"low"},El=A({__name:"TPS",setup(e){const t=$(()=>d.div(K.lastTenTicks.length,K.lastTenTicks.reduce((r,l)=>r+l,0))),n=O([]);ve(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const s=$(()=>n.value.reduce((r,l)=>d.max(r,l),0)),i=$(()=>d.sub(t.value,s.value).gt(1));return(r,l)=>a(t).isNan()?F("",!0):(g(),k("div",xl,[C(" TPS: "+L(a(te)(a(t)))+" ",1),f(Lt,{name:"fade"},{default:D(()=>[a(i)?(g(),k("span",Dl,L(a(te)(a(s))),1)):F("",!0)]),_:1})]))}});var Al=W(El,[["__scopeId","data-v-46a3ed5b"]]);var Vl=A({__name:"App",setup(e){const t=U.useHeader,n=$(()=>Nt[Y.theme].variables),s=xe(Y,"showTPS"),i=$(()=>R(B(()=>f(j,null,[Oi.map(Se)]))));return(r,l)=>(g(),k(j,null,[m("div",{id:"modal-root",style:se(a(n))},null,4),m("div",{class:Q(["app",{useHeader:a(t)}]),style:se(a(n))},[a(t)?(g(),V(rs,{key:0})):F("",!0),f(dl),a(a(s))?(g(),V(Al,{key:1})):F("",!0),f(kl),f(Ol),(g(),V(ae(a(i))))],6)],64))}});var ql=W(Vl,[["__scopeId","data-v-7c41425b"]]);function Ll(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:s,onRegistered:i,onRegisterError:r}=e;let l,o;const c=async(u=!0)=>{u&&(l==null||l.addEventListener("controlling",p=>{p.isUpdate&&window.location.reload()})),o&&o.waiting&&await Ts(o.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){l=new Ps("./sw.js",{scope:"./",type:"classic"}),l.addEventListener("activated",u=>{u.isUpdate||s==null||s()});{const u=()=>{n==null||n()};l.addEventListener("waiting",u),l.addEventListener("externalwaiting",u)}l.register({immediate:t}).then(u=>{o=u,i==null||i(u)}).catch(u=>{r==null||r(u)})}return c}function Bl(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:s,onRegistered:i,onRegisterError:r}=e,l=O(!1),o=O(!1);return{updateServiceWorker:Ll({immediate:t,onNeedRefresh(){l.value=!0,n==null||n()},onOfflineReady(){o.value=!0,s==null||s()},onRegistered:i,onRegisterError:r}),offlineReady:o,needRefresh:l}}document.title=U.title;window.projInfo=U;if(U.id==="")throw"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 $i();const{globalBus:e,startGameLoop:t}=await xt(()=>Promise.resolve().then(function(){return Ci}),void 0),n=window.vue=ws(ql);e.emit("setupVue",n),n.mount("#app"),Qe(()=>{const s=xn(),{updateServiceWorker:i}=Bl({onNeedRefresh(){s.info("New content available, click or reload to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){i()}})},onOfflineReady(){s.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(r){r&&setInterval(r.update,60*60*1e3)}})}),t()});