/* empty css */import"./vue.92681fcb.js";import{Z as S,l as we,u as _n,q as sn,C as r,b1 as je,aa as L,aE as b,a0 as M,a1 as m,aK as Je,G as pe,t as T,aC as ri,w as Le,b2 as Fe,a8 as u,O as D,ao as Ji,I as ge,ay as wn,ar as wt,aG as dn,A as ke,_ as U,b6 as O,b8 as On,bs as Xi,aq as Nt,bu as Zt,bb as Nn,T as Zi,a7 as g,j as Yi,bv as Yn,J as j,$ as P,aH as nt,aF as it,al as hn,aL as dt,aN as Ce,z as tt,H as es,aJ as oi,bn as ts,br as ns,be as is}from"./@vue.4ce677c2.js";import{i as ss}from"./is-plain-object.906d88e8.js";import{c as ui}from"./nanoevents.1080beb7.js";import{L as ut}from"./lz-string.731cedc5.js";import{Y as as}from"./vue-next-select.a2bfab1d.js";import{s as ls,u as ci}from"./vue-toastification.6f567382.js";import{D as rs}from"./vuedraggable.7949458c.js";import{p as os}from"./vue-textarea-autosize.35804eaf.js";import{v as us,n as cs}from"./workbox-window.8d14e8b7.js";import"./sortablejs.29100d8a.js";const ds=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}};ds();const fs="modulepreload",ei={},ms="./",gn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${ms}${i}`,i in ei)return;ei[i]=!0;const s=i.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${l}`))return;const o=document.createElement("link");if(o.rel=s?"stylesheet":fs,s||(o.as="script",o.crossOrigin=""),o.href=i,document.head.appendChild(o),s)return new Promise((c,f)=>{o.addEventListener("load",c),o.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},ps="./projInfo-schema.json",hs="Advent Incremental",gs="An incremental game you play a day at a time, leading up to Christmas!",vs="advent-incremental",ys="thepaperpilot",bs="",_s="",ws="0.3",Ns="Initial Commit",ks=!0,Cs=!1,Ss=2,Ms=!0,Is=null,As="",$s=["main"],Es=3600,Ps=0,Ts=!0,xs="base64";var Q={$schema:ps,title:hs,description:gs,id:vs,author:ys,discordName:bs,discordLink:_s,versionNumber:ws,versionTitle:Ns,allowGoBack:ks,defaultShowSmall:Cs,defaultDecimalsShown:Ss,useHeader:Ms,banner:Is,logo:As,initialTabs:$s,maxTickLength:Es,offlineLimit:Ps,enablePausing:Ts,exportEncoding:xs};const xn=17,Fs=9e15,Bs=Math.log10(9e15),Ds=1/9e15,Os=308,Rs=-324,ti=5,qs=function(){const e=[];for(let n=Rs+1;n<=Os;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),vt=[2,Math.E,3,4,5,6,7,8,9,10],Vs=[[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]],Ls=[[-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]],p=function(t){return a.fromValue_noAlloc(t)},q=function(e,t,n){return a.fromComponents(e,t,n)},H=function(t,n,i){return a.fromComponents_noNormalize(t,n,i)},rt=function(t,n){const i=n+1,s=Math.ceil(Math.log10(Math.abs(t))),l=Math.round(t*Math.pow(10,i-s))*Math.pow(10,s-i);return parseFloat(l.toFixed(Math.max(i-s,0)))},Fn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Gs=function(e){if(!isFinite(e))return e;if(e<-50)return e===Math.trunc(e)?Number.NEGATIVE_INFINITY:0;let t=1;for(;e<10;)t=t*e,++e;e-=1;let n=.9189385332046727;n=n+(e+.5)*Math.log(e),n=n-e;const i=e*e;let s=e;return n=n+1/(12*s),s=s*i,n=n+1/(360*s),s=s*i,n=n+1/(1260*s),s=s*i,n=n+1/(1680*s),s=s*i,n=n+1/(1188*s),s=s*i,n=n+691/(360360*s),s=s*i,n=n+7/(1092*s),s=s*i,n=n+3617/(122400*s),Math.exp(n)/t},di=.5671432904097838,ni=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return di;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let s=0;s<100;++s){if(i=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(i-n).5?1:-1;if(Math.random()*20<1)return H(t,0,1);const n=Math.floor(Math.random()*(e+1));let i=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(i=Math.trunc(i));let s=Math.pow(10,i);return Math.random()>.9&&(s=Math.trunc(s)),q(t,n,s)}static affordGeometricSeries_core(e,t,n,i){const s=t.mul(n.pow(i));return N.floor(e.div(s).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,i){return t.mul(n.pow(i)).mul(N.sub(1,n.pow(e))).div(N.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const l=t.add(i.mul(n)).sub(n.div(2)),o=l.pow(2);return l.neg().add(o.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,i){const s=t.add(i.mul(n));return e.div(2).mul(s.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=Fs)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]),h=parseFloat(t[1]),w=t[1].split(";");let C=1;if(w.length===2&&(C=parseFloat(w[1]),isFinite(C)||(C=1)),isFinite(v)&&isFinite(h)){const R=N.pentate(v,h,C);return this.sign=R.sign,this.layer=R.layer,this.mag=R.mag,this}}const n=e.split("^^");if(n.length===2){const v=parseFloat(n[0]),h=parseFloat(n[1]),w=n[1].split(";");let C=1;if(w.length===2&&(C=parseFloat(w[1]),isFinite(C)||(C=1)),isFinite(v)&&isFinite(h)){const R=N.tetrate(v,h,C);return this.sign=R.sign,this.layer=R.layer,this.mag=R.mag,this}}const i=e.split("^");if(i.length===2){const v=parseFloat(i[0]),h=parseFloat(i[1]);if(isFinite(v)&&isFinite(h)){const w=N.pow(v,h);return this.sign=w.sign,this.layer=w.layer,this.mag=w.mag,this}}e=e.trim().toLowerCase();let s,l,o=e.split("pt");if(o.length===2){s=10,l=parseFloat(o[0]),o[1]=o[1].replace("(",""),o[1]=o[1].replace(")","");let v=parseFloat(o[1]);if(isFinite(v)||(v=1),isFinite(s)&&isFinite(l)){const h=N.tetrate(s,l,v);return this.sign=h.sign,this.layer=h.layer,this.mag=h.mag,this}}if(o=e.split("p"),o.length===2){s=10,l=parseFloat(o[0]),o[1]=o[1].replace("(",""),o[1]=o[1].replace(")","");let v=parseFloat(o[1]);if(isFinite(v)||(v=1),isFinite(s)&&isFinite(l)){const h=N.tetrate(s,l,v);return this.sign=h.sign,this.layer=h.layer,this.mag=h.mag,this}}const c=e.split("e"),f=c.length-1;if(f===0){const v=parseFloat(e);if(isFinite(v))return this.fromNumber(v)}else if(f===1){const v=parseFloat(e);if(isFinite(v)&&v!==0)return this.fromNumber(v)}const d=e.split("e^");if(d.length===2){this.sign=1,d[0].charAt(0)=="-"&&(this.sign=-1);let v="";for(let h=0;h=43&&w<=57||w===101)v+=d[1].charAt(h);else return this.layer=parseFloat(v),this.mag=parseFloat(d[1].substr(h+1)),this.normalize(),this}}if(f<1)return this.sign=0,this.layer=0,this.mag=0,this;const _=parseFloat(c[0]);if(_===0)return this.sign=0,this.layer=0,this.mag=0,this;let y=parseFloat(c[c.length-1]);if(f>=2){const v=parseFloat(c[c.length-2]);isFinite(v)&&(y*=Math.sign(v),y+=Fn(v))}if(!isFinite(_))this.sign=c[0]==="-"?-1:1,this.layer=f,this.mag=y;else if(f===1)this.sign=Math.sign(_),this.layer=1,this.mag=y+Math.log10(Math.abs(_));else if(this.sign=Math.sign(_),this.layer=f,f===2){const v=N.mul(q(1,2,y),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 N||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:rt(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:rt(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<=ti?(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):rt(this.m,e)+"e"+rt(this.e,e):this.layer===1?rt(this.m,e)+"e"+rt(this.e,e):this.layer<=ti?(this.sign===-1?"-":"")+"e".repeat(this.layer)+rt(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+rt(this.mag,e)}abs(){return H(this.sign===0?0:1,this.layer,this.mag)}neg(){return H(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?N.dZero:this.layer===0?q(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?N.dZero:this.layer===0?q(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?N.dZero:this.layer===0?q(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?N.dZero:this.layer===0?q(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=p(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 H(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(N.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return p(n.sign*n.mag+i.sign*i.mag);const s=n.layer*Math.sign(n.mag),l=i.layer*Math.sign(i.mag);if(s-l>=2)return n;if(s===0&&l===-1){if(Math.abs(i.mag-Math.log10(n.mag))>xn)return n;{const o=Math.pow(10,Math.log10(n.mag)-i.mag),c=i.sign+n.sign*o;return q(Math.sign(c),1,i.mag+Math.log10(Math.abs(c)))}}if(s===1&&l===0){if(Math.abs(n.mag-Math.log10(i.mag))>xn)return n;{const o=Math.pow(10,n.mag-Math.log10(i.mag)),c=i.sign+n.sign*o;return q(Math.sign(c),1,Math.log10(i.mag)+Math.log10(Math.abs(c)))}}if(Math.abs(n.mag-i.mag)>xn)return n;{const o=Math.pow(10,n.mag-i.mag),c=i.sign+n.sign*o;return q(Math.sign(c),1,i.mag+Math.log10(Math.abs(c)))}}plus(e){return this.add(e)}sub(e){return this.add(p(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=p(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return H(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return H(this.sign*t.sign,0,1);let n,i;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return p(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return q(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return q(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return q(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const s=q(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(q(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return q(n.sign*i.sign,s.layer+1,s.sign*s.mag)}if(n.layer===2&&i.layer===2){const s=q(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(q(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return q(n.sign*i.sign,s.layer+1,s.sign*s.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=p(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?N.dNaN:this.layer===0?q(this.sign,0,1/this.mag):q(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=p(e);return this.sign>t.sign?1:this.sign0?this.layer:-this.layer,i=t.mag>0?t.layer:-t.layer;return n>i?1:nt.mag?1:this.mag0?t:this}clamp(e,t){return this.max(e).min(t)}clampMin(e){return this.max(e)}clampMax(e){return this.min(e)}cmp_tolerance(e,t){const n=p(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=p(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let i=this.mag,s=n.mag;return this.layer>n.layer&&(s=Fn(s)),this.layer0?q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):q(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?N.dNaN:this.layer>0?q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):q(this.sign,0,Math.log10(this.mag))}log(e){return e=p(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?N.dNaN:this.layer===0&&e.layer===0?q(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):N.div(this.log10(),e.log10())}log2(){return this.sign<=0?N.dNaN:this.layer===0?q(this.sign,0,Math.log2(this.mag)):this.layer===1?q(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?q(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?N.dNaN:this.layer===0?q(this.sign,0,Math.log(this.mag)):this.layer===1?q(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?q(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=p(e),n=this,i=t;if(n.sign===0)return i.eq(0)?H(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return H(1,0,1);if(i.sign===1&&i.layer===0&&i.mag===1)return n;const s=n.absLog10().mul(i).pow10();return this.sign===-1?Math.abs(i.toNumber()%2)%2===1?s.neg():Math.abs(i.toNumber()%2)%2===0?s:N.dNaN:s}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return N.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 q(1,0,t);if(e.sign===0)return N.dOne;e=H(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?q(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?q(-e.sign,e.layer+1,-e.mag):N.dOne}pow_base(e){return p(e).pow(this)}root(e){const t=p(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?N.exp(N.mul(this,N.ln(this).sub(1))):N.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(H(1,0,24)))return p(Gs(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const n=e*e;let i=e,s=12*i,l=1/s,o=t+l;if(o===t||(t=o,i=i*n,s=360*i,l=1/s,o=t-l,o===t))return N.exp(t);t=o,i=i*n,s=1260*i;let c=1/s;return t=t+c,i=i*n,s=1680*i,c=1/s,t=t-c,N.exp(t)}else return this.layer===1?N.exp(N.mul(this,N.ln(this).sub(1))):N.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?N.dOne:this.layer===0&&this.mag<=709.7?p(Math.exp(this.sign*this.mag)):this.layer===0?q(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?q(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):q(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return p(Math.sqrt(this.sign*this.mag));if(this.layer===1)return q(1,2,Math.log10(this.mag)-.3010299956639812);{const e=N.div(H(this.sign,this.layer-1,this.mag),H(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=H(1,0,1)){if(e===1)return N.pow(this,t);if(e===0)return new N(t);if(this.eq(N.dOne))return N.dOne;if(this.eq(-1))return N.pow(this,t);if(e===Number.POSITIVE_INFINITY){const s=this.toNumber();if(s<=1.444667861009766&&s>=.06598803584531254){if(s>1.444667861009099)return new N(Math.E);const l=N.ln(this).neg();return l.lambertw().div(l)}else return s>1.444667861009766?new N(Number.POSITIVE_INFINITY):N.dNaN}if(this.eq(N.dZero)){let s=Math.abs((e+1)%2);return s>1&&(s=2-s),new N(s)}if(e<0)return N.iteratedlog(t,this,-e);t=p(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(N.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let s=0;s3)return H(t.sign,t.layer+(e-s-1),t.mag);if(s>1e4)return t}return t}iteratedexp(e=2,t=H(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return N.tetrate(e,-t,this);e=p(e);let n=p(this);const i=t;t=Math.trunc(t);const s=i-t;if(n.layer-e.layer>3){const l=Math.min(t,n.layer-e.layer-3);t-=l,n.layer-=l}for(let l=0;l1e4)return n}return s>0&&s<1&&(e.eq(10)?n=n.layeradd10(-s):n=n.layeradd(-s,e)),n}slog(e=10){if(e=p(e),e.lte(N.dZero)||e.eq(N.dOne))return N.dNaN;if(e.lt(N.dOne))return this.eq(N.dOne)?N.dZero:this.eq(N.dZero)?N.dNegOne:N.dNaN;if(this.mag<0||this.eq(N.dZero))return N.dNegOne;let t=0,n=p(this);if(n.layer-e.layer>3){const i=n.layer-e.layer-3;t+=i,n.layer-=i}for(let i=0;i<100;++i)if(n.lt(N.dZero))n=N.pow(e,n),t-=1;else{if(n.lte(N.dOne))return p(t+N.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=N.log(n,e)}return p(t)}static slog_critical(e,t){return e>10?t-1:N.critical_section(e,t,Ls)}static tetrate_critical(e,t){return N.critical_section(e,t,Vs)}static critical_section(e,t,n){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let i=0,s=0;for(let c=0;ce){const f=(e-vt[c])/(vt[c+1]-vt[c]);i=n[c][Math.floor(t)]*(1-f)+n[c+1][Math.floor(t)]*f,s=n[c][Math.ceil(t)]*(1-f)+n[c+1][Math.ceil(t)]*f;break}const l=t-Math.floor(t);return i*(1-l)+s*l}layeradd10(e){e=N.fromValue_noAlloc(e).toNumber();const t=p(this);if(e>=1){t.mag<0&&t.layer>0?(t.sign=0,t.mag=0,t.layer=0):t.sign===-1&&t.layer==0&&(t.sign=1,t.mag=-t.mag);const n=Math.trunc(e);e-=n,t.layer+=n}if(e<=-1){const n=Math.trunc(e);if(e-=n,t.layer+=n,t.layer<0)for(let i=0;i<100;++i){if(t.layer++,t.mag=Math.log10(t.mag),!isFinite(t.mag))return t.sign===0&&(t.sign=1),t.layer<0&&(t.layer=0),t.normalize();if(t.layer>=0)break}}for(;t.layer<0;)t.layer++,t.mag=Math.log10(t.mag);return t.sign===0&&(t.sign=1,t.mag===0&&t.layer>=1&&(t.layer-=1,t.mag=1)),t.normalize(),e!==0?t.layeradd(e,10):t}layeradd(e,t){const i=this.slog(t).toNumber()+e;return i>=0?N.tetrate(t,i):Number.isFinite(i)?i>=-1?N.log(N.tetrate(t,i+1),t):N.log(N.log(N.tetrate(t,i+2),t),t):N.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return p(ni(this.toNumber()));if(this.layer===0)return p(ni(this.sign*this.mag));if(this.layer===1)return ii(this);if(this.layer===2)return ii(this);if(this.layer>=3)return H(this.sign,this.layer-1,this.mag);throw"Unhandled behavior in lambertw()"}ssqrt(){if(this.sign==1&&this.layer>=3)return H(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=H(1,0,1)){t=p(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(N.dOne)?(++e,t=new N(i)):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let s=0;s10)return t}return t}sin(){return this.mag<0?this:this.layer===0?p(Math.sin(this.sign*this.mag)):H(0,0,0)}cos(){return this.mag<0?N.dOne:this.layer===0?p(Math.cos(this.sign*this.mag)):H(0,0,0)}tan(){return this.mag<0?this:this.layer===0?p(Math.tan(this.sign*this.mag)):H(0,0,0)}asin(){return this.mag<0?this:this.layer===0?p(Math.asin(this.sign*this.mag)):H(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?p(Math.acos(this.toNumber())):this.layer===0?p(Math.acos(this.sign*this.mag)):H(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?p(Math.atan(this.sign*this.mag)):p(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 N.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return N.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?H(Number.NaN,Number.NaN,Number.NaN):N.ln(this.add(1).div(p(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(N.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 a=N;a.dZero=H(0,0,0);a.dOne=H(1,0,1);a.dNegOne=H(-1,0,1);a.dTwo=H(1,0,2);a.dTen=H(1,0,10);a.dNaN=H(Number.NaN,Number.NaN,Number.NaN);a.dInf=H(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);a.dNegInf=H(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);a.dNumberMax=q(1,0,Number.MAX_VALUE);a.dNumberMin=q(1,0,Number.MIN_VALUE);const Us=new a(1);function Kt(e,t,n=!0){let i=a.log10(e).floor(),s=a.div(e,a.pow(10,i));s.toStringWithDecimalPlaces(t)==="10"&&(s=Us,i=i.add(1));const l=i.gte(1e9)?Ge(i,Math.max(Math.max(t,3),Q.defaultDecimalsShown)):i.gte(1e4)?vn(i,0):i.toStringWithDecimalPlaces(0);return n?s.toStringWithDecimalPlaces(t)+"e"+l:"e"+l}function vn(e,t){if(e==null)return"NaN";if(e=new a(e),e.mag<.001)return 0 .toFixed(t);const i=e.toStringWithDecimalPlaces(t).split(".");return i[0]=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),i.length==1?i[0]:i[0]+"."+i[1]}function fi(e,t){return e==null?"NaN":(e=new a(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),Q.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Hs=new a("eeee1000"),js=new a("e100000"),si=new a("e1000"),mi=new a(1e9),zs=new a(1e6),Ws=new a(1e3),Qs=new a(.98),Ks=new a(.001),pi=new a(0);function Ge(e,t,n){if(t==null&&(t=Q.defaultDecimalsShown),n=n!=null?n:Q.defaultShowSmall,e=new a(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+Ge(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Hs)){const i=e.slog();return i.gte(zs)?"F"+Ge(i.floor()):a.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+vn(i.floor(),0)}else{if(e.gte(js))return Kt(e,0,!1);if(e.gte(si))return Kt(e,0);if(e.gte(mi))return Kt(e,t);if(e.gte(Ws))return vn(e,0);if(e.gte(Ks)||!n)return fi(e,t);if(e.eq(pi))return 0 .toFixed(t)}return e=gi(e),e.lt(si)?Kt(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):Ge(e,t)+"\u207B\xB9"}function Ve(e){return e=new a(e),e.sign<0?"-"+Ve(e.neg()):e.gte(mi)||e.lte(Qs)&&!e.eq(pi)?Ge(e):Ge(e,0)}function hi(e){return a.lt(e,0)?"-"+hi(a.neg(e)):a.gt(e,2**51)?Ge(a.div(e,31536e3))+"y":(e=new a(e).toNumber(),e<60?Ge(e)+"s":e<3600?Ve(Math.floor(e/60))+"m "+Ge(e%60)+"s":e<86400?Ve(Math.floor(e/3600))+"h "+Ve(Math.floor(e/60)%60)+"m "+Ve(e%60)+"s":e<31536e3?Ve(Math.floor(e/84600)%365)+"d "+Ve(Math.floor(e/3600)%24)+"h "+Ve(Math.floor(e/60)%60)+"m":Ve(Math.floor(e/31536e3))+"y "+Ve(Math.floor(e/84600)%365)+"d "+Ve(Math.floor(e/3600)%24)+"h")}function Js(e,t,n){e=new a(e);let i=e.toStringWithDecimalPlaces(t);return new a(i).gte(n)&&(i=a.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function Xs(e,t){return Ge(e,t,!0)}function gi(e){let t=a.log10(e).ceil();const n=a.div(e,a.pow(10,t));return t=t.neg(),e=new a(10).pow(t).times(n),e}var Zs=Object.freeze(Object.defineProperty({__proto__:null,default:a,exponentialFormat:Kt,commaFormat:vn,regularFormat:fi,format:Ge,formatWhole:Ve,formatTime:hi,toPlaces:Js,formatSmall:Xs,invertOOM:gi},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:Ys,commaFormat:ea,regularFormat:ta,format:Y,formatWhole:G,formatTime:kn,toPlaces:na,formatSmall:ia,invertOOM:sa}=Zs;window.Decimal=a;window.exponentialFormat=Ys;window.commaFormat=ea;window.regularFormat=ta;window.format=Y;window.formatWhole=G;window.formatTime=kn;window.toPlaces=na;window.formatSmall=ia;window.invertOOM=sa;function vi(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Bn(e){return typeof e=="function"}var J=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(J||{});const Yt=Symbol("DoNotCache");function $(e,t){const n=e[t];Bn(n)&&n.length===0&&!n[Yt]?e[t]=S(n.bind(e)):Bn(n)&&(e[t]=n.bind(e),e[t][Yt]=!0)}function $e(e){return Bn(e)&&!e[Yt]&&(e=S(e)),e}const ft=Symbol("Component"),mt=Symbol("GatherProps");let aa=0;function Ot(e="feature-"){return e+aa++}var _e=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(_e||{});function B(e){return e[Yt]=!0,e}function X(e,t=2){return e?0:t}function Ne(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function yi(e,...t){const n=[],i=s=>{Object.keys(s).forEach(l=>{const o=s[l];o&&typeof o=="object"&&(t.includes(o.type)?n.push(o):!(o instanceof a)&&!we(o)&&i(o))})};return i(e),n}const yt={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 Rn=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Rn||{}),an={classic:yt,paper:{...yt,variables:{...yt.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:{...yt,variables:{...yt.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:{...yt,variables:{...yt.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const ce=Symbol("ProxyState"),Pt=Symbol("ProxyPath");function Be(e,t={}){const n=t;let i=!1;function s(){return i||(Object.assign(n,e(n)),i=!0),n}return new Proxy(n,{get(l,o){return o===ce?s():s()[o]},set(l,o,c){return s()[o]=c,!0},has(l,o){return o===ce?!0:Reflect.has(s(),o)},ownKeys(){return Reflect.ownKeys(s())},getOwnPropertyDescriptor(l,o){return i||(Object.assign(n,e(n)),i=!0),Object.getOwnPropertyDescriptor(l,o)}})}var ee=window.state=_n({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const bi=sn({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});function _i(e){return JSON.stringify(e,(t,n)=>r(n))}const wi={get(e,t){var i;if(t===ce||t===Pt)return e[t];const n=e[ce][t];if(t!=="value"&&(ss(n)||Array.isArray(n))){if(n!==((i=e[t])==null?void 0:i[ce])){const s=[...e[Pt],t];e[t]=new Proxy({[ce]:n,[Pt]:s},wi)}return e[t]}return n},set(e,t,n,i){if(!ee.hasNaN&&(typeof n=="number"&&isNaN(n)||n instanceof a&&(isNaN(n.sign)||isNaN(n.layer)||isNaN(n.mag)))){const s=e[ce][t];if(!(typeof s=="number"&&isNaN(s)||s instanceof a&&(isNaN(s.sign)||isNaN(s.layer)||isNaN(s.mag))))throw bi.autosave=!1,ee.hasNaN=!0,ee.NaNPath=[...e[Pt],t],ee.NaNReceiver=i,console.error("Attempted to set NaN value",[...e[Pt],t],e[ce]),"Attempted to set NaN value. See above for details"}return e[ce][t]=n,!0},ownKeys(e){return Reflect.ownKeys(e[ce])},has(e,t){return Reflect.has(e[ce],t)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e[ce],t)}};var A=window.player=new Proxy({[ce]:bi,[Pt]:["player"]},wi);const oe=ui();let Tt=null,Jt=null;function yn(){const e=Date.now();let t=(e-A.time)/1e3;A.time=e;const n=t;if(ee.lastTenTicks.push(n),ee.lastTenTicks.length>10&&(ee.lastTenTicks=ee.lastTenTicks.slice(1)),!((Jt==null?void 0:Jt.value)&&!A.keepGoing)&&!ee.hasNaN&&(t=Math.max(t,0),A.devSpeed!==0)){if(A.offlineTime!=null){if(a.gt(A.offlineTime,Q.offlineLimit*3600)&&(A.offlineTime=Q.offlineLimit*3600),a.gt(A.offlineTime,0)&&A.devSpeed!==0){const i=Math.max(A.offlineTime/10,t);A.offlineTime=A.offlineTime-i,t+=i}else A.devSpeed===0&&(A.offlineTime+=t);(!A.offlineProd||a.lt(A.offlineTime,0))&&(A.offlineTime=null)}t=Math.min(t,Q.maxTickLength),A.devSpeed!=null&&(t*=A.devSpeed),Number.isFinite(t)||(t=1e308),!a.eq(t,0)&&(A.timePlayed+=t,Number.isFinite(A.timePlayed)||(A.timePlayed=1e308),oe.emit("update",t,n),ie.unthrottled?(requestAnimationFrame(yn),Tt!=null&&(clearInterval(Tt),Tt=null)):Tt==null&&(Tt=setInterval(yn,50)))}}async function la(){Jt=(await gn(()=>Promise.resolve().then(function(){return Li}),void 0)).hasWon,je(Jt,e=>{e&&oe.emit("gameWon")}),ie.unthrottled?requestAnimationFrame(yn):Tt=setInterval(yn,50)}document.fonts.onloadingdone=()=>oe.emit("fontsLoaded");var ra=Object.freeze(Object.defineProperty({__proto__:null,globalBus:oe,startGameLoop:la},Symbol.toStringTag,{value:"Module"}));function Ni(e={}){return Object.assign({id:`${Q.id}-0`,name:"Default Save",tabs:Q.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:Q.id,modVersion:Q.versionNumber,layers:{}},e)}function Ue(e){const t=ut.compressToUTF16(_i(e!=null?e:A[ce]));return localStorage.setItem((e!=null?e:A[ce]).id,t),t}async function oa(){ca();try{let e=localStorage.getItem(ie.active);if(e==null){await bt(xt());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=ut.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==Q.id){await bt(xt());return}t.id=ie.active,await bt(t)}catch(e){console.error(`Failed to load save. Falling back to new save. `,e),await bt(xt())}}function xt(){const e=mn(),t=Ni({id:e});return Ue(t),ie.saves.push(e),t}function mn(){let e,t=0;do e=`${Q.id}-${t++}`;while(localStorage.getItem(e));return e}async function bt(e){console.info("Loading save",e);const{layers:t,removeLayer:n,addLayer:i}=await gn(()=>Promise.resolve().then(function(){return Pa}),void 0),{fixOldSave:s,getInitialLayers:l}=await gn(()=>Promise.resolve().then(function(){return Li}),void 0);for(const o in t){const c=t[o];c&&n(c)}l(e).forEach(o=>i(o,e)),e=Ni(e),e.offlineProd&&e.time&&e.devSpeed!==0&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=Math.min(e.offlineTime+(Date.now()-e.time)/1e3,Q.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==Q.versionNumber&&s(e.modVersion,e),Object.assign(A,e),ie.active=A.id,oe.emit("onLoad")}setInterval(()=>{A.autosave&&Ue()},1e3);window.onbeforeunload=()=>{A.autosave&&Ue()};window.save=Ue;const ua=window.hardReset=async()=>{await bt(xt())},en=sn({active:"",saves:[],showTPS:!0,theme:Rn.Nordic,unthrottled:!1});je(en,e=>{const t=ut.compressToUTF16(JSON.stringify(e));localStorage.setItem(Q.id,t)},{deep:!0});var ie=window.settings=en;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Rn.Nordic};oe.emit("loadSettings",e),Object.assign(en,e),ua()};function ca(){try{let e=localStorage.getItem(Q.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=ut.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(en,t)}oe.emit("loadSettings",en)}catch{}}const ki=sn([]);function da(e){ki.push(e)}const Ci=sn([]);function fa(e){Ci.push(e)}const ma=sn([]),pa={class:"table"},pn=L({__name:"Column",setup(e){const t=S(()=>an[ie.theme].mergeAdjacent);return(n,i)=>(b(),M("div",pa,[m("div",{class:pe(["col",{mergeAdjacent:r(t)}])},[Je(n.$slots,"default")],2)]))}}),ha={class:"table"},Si=L({__name:"Row",setup(e){const t=S(()=>an[ie.theme].mergeAdjacent);return(n,i)=>(b(),M("div",ha,[m("div",{class:pe(["row",{mergeAdjacent:r(t)}])},[Je(n.$slots,"default")],2)]))}});function Mi(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Ji(e)}function K(e,t="span"){return typeof e=="function"?L({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),L({template:e})):L({render:()=>({})}):e}function ve(e){if(pt(e))return typeof e=="function"?e():K(e);const t=e[ft];return u(t,e[mt](),null)}function De(...e){let t;return u(Si,null,Mi(t=e.map(ve))?t:{default:()=>[t]})}function Ii(...e){let t;return u(pn,null,Mi(t=e.map(ve))?t:{default:()=>[t]})}function Xe(e){if(pt(e))return typeof e=="function"?e():typeof e=="string"?u(D,null,[e]):u(e,null,null);const t=e[ft];return u(t,e[mt](),null)}function pt(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 Ai(e,t,n){const i=T(null),s=T(void 0);function l(f){i.value||(i.value=setInterval(c,250)),s.value=f,n&&(n.value=!0)}function o(){i.value&&(clearInterval(i.value),i.value=null),n&&(n.value=!1)}function c(){t&&t.value?t.value():e&&e.value&&e.value(s.value)}return ri(o),{start:l,stop:o,handleHolding:c}}function $i(e,t="div"){const n=Le();return Fe(()=>{n.value=K(ye(e),t)}),n}function kt(e,t="div"){const n=Le(null);return Fe(()=>{const i=ye(e);n.value=i==null?null:K(i,t)}),n}function ga(e){return S(()=>ye(e))}function ye(e){return r(r(e))}function E(...e){return e.includes(Object)||e.push(Object),e}const Oe=L({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(b(),M("div",{style:ge({width:e.width,height:e.height})},null,4))}});var Z=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n};const va=L({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var _;const n=T({}),i=new ResizeObserver(c),s=T(null);wn(()=>{const y=s.value;y!=null&&i.observe(y)});let l=!0,o=T((_=s.value)==null?void 0:_.getBoundingClientRect());function c(){l&&(l=!1,wt(()=>{var y;o.value=(y=s.value)==null?void 0:y.getBoundingClientRect(),Object.values(n.value).filter(v=>v).forEach(v=>v.rect=v.element.getBoundingClientRect()),t("updateNodes",n.value),l=!0}))}oe.on("fontsLoaded",c);const f={attributes:!1,childList:!0,subtree:!1};dn(qn,(y,v)=>{const h=new MutationObserver(()=>d(y));h.observe(v,f),n.value[y]={element:v,observer:h,rect:v.getBoundingClientRect()},c()}),dn(Vn,y=>{var v;(v=n.value[y])==null||v.observer.disconnect(),n.value[y]=void 0,c()}),dn(Ln,n),dn(Gn,o);function d(y){const v=n.value[y];v!=null&&(v.rect=v.element.getBoundingClientRect(),t("updateNodes",n.value))}return(y,v)=>(b(),M(D,null,[Je(y.$slots,"default",{},void 0,!0),m("div",{ref_key:"resizeListener",ref:s,class:"resize-listener"},null,512)],64))}});var Ei=Z(va,[["__scopeId","data-v-2b1dc1bc"]]);const ya=["onPointerdown"],ba={class:"modal-wrapper"},_a={class:"modal-container"},wa={class:"modal-header"},Na=g(" default header "),ka={class:"modal-body"},Ca=g(" default body "),Sa={class:"modal-footer"},Ma=m("div",{class:"modal-default-flex-grow"},null,-1),ze=L({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const s=ke(e),l=S(()=>s.modelValue||c.value);function o(){n("update:modelValue",!1)}const c=T(!1),f=T(null),d=S(()=>{var _,y;return(y=(_=f.value)==null?void 0:_.nodes)!=null?y:null});return t({isOpen:l,nodes:d}),(_,y)=>(b(),U(Zi,{to:"#modal-root"},[u(Nn,{name:"modal",onBeforeEnter:y[0]||(y[0]=v=>c.value=!0),onAfterLeave:y[1]||(y[1]=v=>c.value=!1)},{default:O(()=>[On(m("div",Nt({class:"modal-mask",onPointerdown:Zt(o,["self"])},_.$attrs),[m("div",ba,[m("div",_a,[m("div",wa,[Je(_.$slots,"header",{shown:r(l)},()=>[Na])]),m("div",ka,[u(Ei,{ref_key:"contextRef",ref:f},{default:O(()=>[Je(_.$slots,"body",{shown:r(l)},()=>[Ca])]),_:3},512)]),m("div",Sa,[Je(_.$slots,"footer",{shown:r(l)},()=>[m("div",{class:"modal-default-footer"},[Ma,m("button",{class:"button modal-default-button",onClick:o}," Close ")])])])])])],16,ya),[[Xi,e.modelValue]])]),_:3})]))}}),tn=Symbol("PersistentState"),nn=Symbol("DefaultValue"),bn=Symbol("StackTrace"),Pi=Symbol("Deleted");function Ia(){var e;return((e=new Error().stack)==null?void 0:e.split(` `).slice(3,5).map(t=>t.trim()).join(` `))||""}function Ee(e){const t=we(e)?e:T(e);return t[tn]=t,t[nn]=we(e)?e.value:e,t[bn]=Ia(),t[Pi]=!1,He.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",t,` Created at: `+t[bn]):Ft[He[He.length-1]].add(t),t}oe.on("addLayer",(e,t)=>{const n=[],i=(s,l=[])=>{let o=!1;return Object.keys(s).forEach(c=>{const f=s[c];if(f&&typeof f=="object")if(tn in f){if(o=!0,f[Pi]){console.warn("Deleted persistent ref present in returned object. Ignoring...",f,` Created at: `+f[bn]);return}Ft[e.id].delete(ce in f?f[ce]:f);const d=l.reduce((y,v)=>(v in y||(y[v]={}),y[v]),t),_=d[c];d[c]=f[tn],Yi(d)?_!=null?d[c]=_:d[c]=f[nn]:_!=null?d[c].value=_:d[c].value=f[nn]}else!(f instanceof a)&&!we(f)&&!n.includes(f)&&(typeof f.type=="symbol"&&n.push(f),i(f,[...l,c])&&(Yn(f)&&!Yn(s)?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.",ce in s?s[ce]:s,c):o=!0))}),o};i(e),Ft[e.id].forEach(s=>{console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,s,` Created at: `+s[bn])}),Ft[e.id].clear()});const qn=Symbol("RegisterNode"),Vn=Symbol("UnregisterNode"),Ln=Symbol("Nodes"),Gn=Symbol("Bounds"),Se=_n({});window.layers=Se;const Ft={},He=[];function Rt(e,t){return Be(()=>{const n={},i=n.emitter=ui();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=T({}),n.id=e,He.push(e),Ft[e]=new Set,n.minimized=Ee(!1),Object.assign(n,t.call(n)),He[He.length-1]==null||He[He.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen Stack: ${He} Trying to pop ${n.id}`;return He.pop(),$(n,"color"),$(n,"display"),$(n,"name"),Ne(n,"name",n.id),$(n,"minWidth"),Ne(n,"minWidth",600),$(n,"minimizable"),Ne(n,"minimizable",!0),n})}function Ti(e,t){if(console.info("Adding layer",e.id),Se[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,Se[e.id]);return}Ne(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),Se[e.id]=e,oe.emit("addLayer",e,t.layers[e.id])}function Aa(e){return Se[e]}function xi(e){console.info("Removing layer",e.id),oe.emit("removeLayer",e),Se[e.id]=void 0}function $a(e){xi(e),Ti(e,A)}function Ea(e){const t=T(!1);return{openModal:()=>t.value=!0,modal:B(()=>u(ze,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>u("h2",null,[r(e.name)]),body:r(e.display)}))}}oe.on("update",function(t){Object.values(Se).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(Se).forEach(n=>{n==null||n.emit("update",t)}),Object.values(Se).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Pa=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:qn,UnregisterNodeInjectionKey:Vn,NodesInjectionKey:Ln,BoundsInjectionKey:Gn,layers:Se,persistentRefs:Ft,addingLayers:He,createLayer:Rt,addLayer:Ti,getLayer:Aa,removeLayer:xi,reloadLayer:$a,setupLayerModal:Ea},Symbol.toStringTag,{value:"Module"}));const Ta={},xa={class:"notif"};function Fa(e,t){return b(),M("div",xa,"!")}var ai=Z(Ta,[["render",Fa],["__scopeId","data-v-66323fd4"]]);const Cn=e=>(nt("data-v-949cc93c"),e=e(),it(),e),Ba={key:0,class:"day feature dontMerge opened"},Da={class:"date"},Oa=g("Dec"),Ra=Cn(()=>m("br",null,null,-1)),qa={class:"date"},Va=g("Dec"),La=Cn(()=>m("br",null,null,-1)),Ga=Cn(()=>m("div",{class:"doors"},null,-1)),Ua={class:"date"},Ha=g("Dec"),ja=Cn(()=>m("br",null,null,-1)),za={key:0,class:"material-icons lock"},Wa=L({__name:"Day",props:{day:null,symbol:null,opened:null,shouldNotify:null},emits:["openLore","openLayer","unlockLayer"],setup(e,{emit:t}){const n=e,i=S(()=>a.gte(z.day.value,n.day)&&new Date().getMonth()===11&&new Date().getDate()>=n.day);function s(){i.value&&t("unlockLayer")}return(l,o)=>e.opened.value?(b(),M("div",Ba,[u(Nn,{appear:"",name:"door"},{default:O(()=>[m("div",{class:"doors",onClick:o[0]||(o[0]=c=>t("openLayer"))},[m("div",Da,[Oa,Ra,g(j(e.day),1)]),m("div",qa,[Va,La,g(j(e.day),1)])])]),_:1}),m("div",{class:"icon",style:ge({backgroundImage:`url(${e.symbol})`})},null,4),m("div",{class:"lore",onClick:o[1]||(o[1]=c=>t("openLore"))},"?"),r(e.shouldNotify)?(b(),U(ai,{key:0})):P("",!0)])):(b(),M("div",{key:1,class:pe(["day feature dontMerge",{can:r(i),locked:!r(i),canOpen:r(i)}]),onClick:s},[Ga,m("div",Ua,[Ha,ja,g(j(e.day),1)]),r(i)?P("",!0):(b(),M("div",za,"lock")),r(i)?(b(),U(ai,{key:1})):P("",!0)],2))}});var Qa=Z(Wa,[["__scopeId","data-v-949cc93c"]]);const Ka={key:0},Ja={key:0,class:"mark star"},Xa=["src"],Za=L({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(b(),M("div",Ka,[e.mark===!0?(b(),M("div",Ja)):(b(),M("img",{key:1,class:"mark",src:e.mark},null,8,Xa))])):P("",!0)}});var Sn=Z(Za,[["__scopeId","data-v-2207999f"]]);const Ya=L({__name:"Node",props:{id:null},setup(e){const n=ke(e),i=hn(qn,()=>{}),s=hn(Vn,()=>{}),l=Le(null),o=S(()=>l.value&&l.value.parentElement);return je([o,n.id],([c,f],[d,_])=>{d&&s(r(_)),c&&i(f,c)}),ri(()=>s(r(n.id))),(c,f)=>(b(),M("div",{class:"node",ref_key:"node",ref:l},null,512))}});var ln=Z(Ya,[["__scopeId","data-v-a48cb382"]]),el=L({props:{display:{type:E(Object,String,Function),required:!0},visibility:{type:E(Number),required:!0},style:E(Object,String,Array),classes:E(Object),onClick:Function,onHold:Function,canClick:{type:E(Boolean),required:!0},small:Boolean,mark:E(Boolean,String),id:{type:String,required:!0},isHolding:Object},components:{Node:ln,MarkNode:Sn},setup(e){const{display:t,onClick:n,onHold:i}=ke(e),s=Le("");Fe(()=>{const c=ye(t);if(c==null){s.value="";return}if(pt(c)){s.value=K(c);return}const f=K(c.title||"","h3"),d=K(c.description,"div");s.value=K(B(()=>u("span",null,[c.title?u("div",null,[u(f,null,null)]):null,u(d,null,null)])))});const{start:l,stop:o}=Ai(n,i,e.isHolding);return{start:l,stop:o,comp:s,Visibility:_e,unref:r}}});function tl(e,t,n,i,s,l){var f;const o=dt("MarkNode"),c=dt("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),M("button",{key:0,style:ge([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(f=e.unref(e.style))!=null?f:[]]),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:pe({feature:!0,clickable:!0,can:e.unref(e.canClick),locked:!e.unref(e.canClick),small:e.small,...e.unref(e.classes)})},[e.unref(e.comp)?(b(),U(Ce(e.unref(e.comp)),{key:0})):P("",!0),u(o,{mark:e.unref(e.mark)},null,8,["mark"]),u(c,{id:e.id},null,8,["id"])],38)):P("",!0)}var Fi=Z(el,[["render",tl],["__scopeId","data-v-8cedd7da"]]);const nl=Symbol("Clickable");function Ie(e){return Be(()=>{var n;const t=(n=e==null?void 0:e())!=null?n:{};if(t.id=Ot("clickable-"),t.type=nl,t[ft]=Fi,t.isHolding=T(!1),$(t,"visibility"),Ne(t,"visibility",_e.Visible),$(t,"canClick"),Ne(t,"canClick",!0),$(t,"classes"),$(t,"style"),$(t,"mark"),$(t,"display"),t.onClick){const i=t.onClick.bind(t);t.onClick=function(s){r(t.canClick)&&i(s)}}if(t.onHold){const i=t.onHold.bind(t);t.onHold=function(){r(t.canClick)&&i()}}return t[mt]=function(){const{display:i,visibility:s,style:l,classes:o,onClick:c,onHold:f,isHolding:d,canClick:_,small:y,mark:v,id:h}=this;return{display:i,visibility:s,style:r(l),classes:o,onClick:c,onHold:f,isHolding:d,canClick:_,small:y,mark:v,id:h}},t})}function _t(e,t="points",n=0,i=void 0){const s=we(e)?e:Ee(e);return s.displayName=t,s.precision=n,s.small=i,s}function Bi(e){const t=Ee(e.value);return je(e,(n,i)=>{a.gt(n,i)&&(t.value=a.add(t.value,a.sub(n,i)))}),t}new a("10^^8");new a("1e100");function Un(e,t){const n=t!=null?t:e.value;return a.eq(e.precision,0)?G(e.small?n:a.floor(n)):Y(n,e.precision,e.small)}const il=["x1","y1","x2","y2"],sl=L({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=ke(e),i=S(()=>{const l=n.startNode.value.rect,o=n.boundingRect.value,c=o?{x:l.x+l.width/2-o.x,y:l.y+l.height/2-o.y}:{x:0,y:0};return n.link.value.offsetStart&&(c.x+=n.link.value.offsetStart.x,c.y+=n.link.value.offsetStart.y),c}),s=S(()=>{const l=n.endNode.value.rect,o=n.boundingRect.value,c=o?{x:l.x+l.width/2-o.x,y:l.y+l.height/2-o.y}:{x:0,y:0};return n.link.value.offsetEnd&&(c.x+=n.link.value.offsetEnd.x,c.y+=n.link.value.offsetEnd.y),c});return(l,o)=>(b(),M("line",Nt({"stroke-width":"15px",stroke:"white"},e.link,{x1:r(i).x,y1:r(i).y,x2:r(s).x,y2:r(s).y}),null,16,il))}});const al=L({__name:"Links",props:{links:null},setup(e){var f;const n=tt(e,"links"),i=T(null),s=hn(Ln,T({})),l=hn(Gn,T(void 0)),o=T((f=i.value)==null?void 0:f.getBoundingClientRect());je(l,()=>{var d;return o.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),wn(()=>{var d;return o.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const c=S(()=>{var _,y;const d=s.value;return(y=(_=n.value)==null?void 0:_.filter(v=>{var h,w;return((h=d[v.startNode.id])==null?void 0:h.rect)&&((w=d[v.startNode.id])==null?void 0:w.rect)}))!=null?y:[]});return(d,_)=>(b(),M(D,null,[r(c)?(b(),M("svg",es(Nt({key:0},d.$attrs)),[(b(!0),M(D,null,oi(r(c),(y,v)=>(b(),U(sl,{key:v,link:y,boundingRect:o.value,startNode:r(s)[y.startNode.id],endNode:r(s)[y.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):P("",!0),m("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var ll=Z(al,[["__scopeId","data-v-063f6d6b"]]);L({props:{nodes:{type:E(Array),required:!0},leftSideNodes:E(Array),rightSideNodes:E(Array),branches:E(Array)},components:{Links:ll},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=ke(e),s=Le();Fe(()=>{const c=ye(t);s.value=K(B(()=>u(D,null,[c.map(f=>u("span",{class:"row tree-row",style:"margin: 50px auto;"},[f.map(Xe)]))])))});const l=Le();Fe(()=>{const c=ye(n);l.value=c?K(B(()=>u("span",{class:"left-side-nodes small"},[c.map(Xe)]))):""});const o=Le();return Fe(()=>{const c=ye(i);o.value=c?K(B(()=>u("span",{class:"side-nodes small"},[c.map(Xe)]))):""}),{unref:r,nodesComp:s,leftNodesComp:l,rightNodesComp:o}}});L({props:{display:E(Object,String,Function),visibility:{type:E(Number),required:!0},style:E(String,Object,Array),classes:E(Object),onClick:Function,onHold:Function,color:E(String),glowColor:E(String),canClick:{type:E(Boolean),required:!0},mark:E(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Sn,Node:ln},setup(e){const{onClick:t,onHold:n,display:i}=ke(e),s=kt(i),{start:l,stop:o}=Ai(t,n);return{start:l,stop:o,comp:s,unref:r,Visibility:_e,isCoercableComponent:pt}}});function Hn(e){const t=[],n={};let i=!1;function s(){return i||(t.push(...e()),n.base=t.map(c=>$e(c.base)),n.baseText=t.map(c=>$e(c.baseText)),n.visible=t.map(c=>$e(c.visible)),i=!0),t}const l=Ee({});return[B(()=>{const c=s();let f=!0;const d=c.map((_,y)=>{var C,R,le;if(r(n.visible[y])===!1)return null;const v=u("h3",{onClick:()=>l.value[y]=!l.value[y],style:"cursor: pointer"},[u("span",{class:"modifier-toggle"+(r(l.value[y])?" collapsed":"")},[g("\u25BC")]),_.title,_.subtitle?u("span",{class:"subtitle"},[g(" ("),_.subtitle,g(")")]):null]),h=r(l.value[y])?null:u(D,null,[u("div",{class:"modifier-container"},[u("span",{class:"modifier-amount"},[Y((C=r(n.base[y]))!=null?C:1),_.unit]),u("span",{class:"modifier-description"},[Xe((R=r(n.baseText[y]))!=null?R:"Base")])]),Xe(r(_.modifier.description))]),w=!f;return f=!1,u(D,null,[w?u("br",null,null):null,u("div",null,[v,u("br",null,null),h,u("hr",null,null),g("Total: "),Y(_.modifier.apply((le=r(n.base[y]))!=null?le:1)),_.unit])])});return u(D,null,[d])}),l]}const rl=L({props:{progress:{type:E(String,Object,Number),required:!0},width:{type:E(Number),required:!0},height:{type:E(Number),required:!0},direction:{type:E(String),required:!0},display:E(Object,String,Function),visibility:{type:E(Number),required:!0},style:E(Object,String,Array),classes:E(Object),borderStyle:E(Object,String,Array),textStyle:E(Object,String,Array),baseStyle:E(Object,String,Array),fillStyle:E(Object,String,Array),mark:E(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Sn,Node:ln},setup(e){const{progress:t,width:n,height:i,direction:s,display:l}=ke(e),o=S(()=>{let d=t.value instanceof a?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),c=S(()=>{const d={width:ye(n)+.5+"px",height:ye(i)+.5+"px"};switch(r(s)){case J.Up:d.clipPath=`inset(${o.value}% 0% 0% 0%)`,d.width=ye(n)+1+"px";break;case J.Down:d.clipPath=`inset(0% 0% ${o.value}% 0%)`,d.width=ye(n)+1+"px";break;case J.Right:d.clipPath=`inset(0% ${o.value}% 0% 0%)`;break;case J.Left:d.clipPath=`inset(0% 0% 0% ${o.value} + '%)`;break;case J.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),f=kt(l);return{normalizedProgress:o,barStyle:c,component:f,unref:r,Visibility:_e}}});function ol(e,t,n,i,s,l){var f,d,_,y,v,h,w;const o=dt("MarkNode"),c=dt("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),M("div",{key:0,style:ge([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(f=e.unref(e.style))!=null?f:{}]),class:pe({bar:!0,...e.unref(e.classes)})},[m("div",{class:"overlayTextContainer border",style:ge([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(b(),M("span",{key:0,class:"overlayText",style:ge(e.unref(e.textStyle))},[(b(),U(Ce(e.component)))],4)):P("",!0)],4),m("div",{class:"border",style:ge([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(_=e.unref(e.style))!=null?_:{},(y=e.unref(e.baseStyle))!=null?y:{},(v=e.unref(e.borderStyle))!=null?v:{}])},[m("div",{class:"fill",style:ge([e.barStyle,(h=e.unref(e.style))!=null?h:{},(w=e.unref(e.fillStyle))!=null?w:{}])},null,4)],4),u(o,{mark:e.unref(e.mark)},null,8,["mark"]),u(c,{id:e.id},null,8,["id"])],6)):P("",!0)}var ul=Z(rl,[["render",ol],["__scopeId","data-v-02d0d7b2"]]);const cl=Symbol("Bar");function Bt(e){return Be(()=>{const t=e();return t.id=Ot("bar-"),t.type=cl,t[ft]=ul,$(t,"visibility"),Ne(t,"visibility",_e.Visible),$(t,"width"),$(t,"height"),$(t,"direction"),$(t,"style"),$(t,"classes"),$(t,"borderStyle"),$(t,"baseStyle"),$(t,"textStyle"),$(t,"fillStyle"),$(t,"progress"),$(t,"display"),$(t,"mark"),t[mt]=function(){const{progress:n,width:i,height:s,direction:l,display:o,visibility:c,style:f,classes:d,borderStyle:_,textStyle:y,baseStyle:v,fillStyle:h,mark:w,id:C}=this;return{progress:n,width:i,height:s,direction:l,display:o,visibility:c,style:r(f),classes:d,borderStyle:_,textStyle:y,baseStyle:v,fillStyle:h,mark:w,id:C}},t})}const dl=Symbol("Buyable");function et(e){const t=Ee(0);return Be(()=>{var l,o,c;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=Ot("buyable-"),n.type=dl,n[ft]=Fi,n.amount=t,n.amount[nn]=(l=n.initialValue)!=null?l:0,n.canAfford=S(()=>{const f=n,d=r(f.cost);return f.resource!=null&&d!=null&&a.gte(f.resource.value,d)}),n.canPurchase==null&&(n.canPurchase=S(()=>r(n.visibility)===_e.Visible&&r(n.canAfford)&&a.lt(n.amount.value,r(n.purchaseLimit)))),n.maxed=S(()=>a.gte(n.amount.value,r(n.purchaseLimit))),$(n,"classes");const i=n.classes;n.classes=S(()=>{const f=r(i)||{};return n.maxed.value&&(f.bought=!0),f}),$(n,"canPurchase"),n.canClick=n.canPurchase,n.onClick=n.purchase=(c=(o=n.onClick)!=null?o:n.purchase)!=null?c:function(){var _;const f=n;if(!r(f.canPurchase))return;const d=r(f.cost);f.cost!=null&&f.resource!=null&&(f.resource.value=a.sub(f.resource.value,d),f.amount.value=a.add(f.amount.value,1)),(_=f.onPurchase)==null||_.call(f,d)},$(n,"display");const s=n.display;return n.display=B(()=>{const f=r(s);if(pt(f)){const d=K(f);return u(d,null,null)}if(f!=null&&n.cost!=null&&n.resource!=null){const d=n,_=K(f.title||"","h3"),y=K(f.description||""),v=K(f.effectDisplay||"");return u("span",null,[f.title?u("div",null,[u(_,null,null)]):null,f.description?u(y,null,null):null,f.showAmount===!1?null:u("div",null,[u("br",null,null),r(d.purchaseLimit)===a.dInf?u(D,null,[g("Amount: "),G(d.amount.value)]):u(D,null,[g("Amount: "),G(d.amount.value),g(" /")," ",G(r(d.purchaseLimit))])]),f.effectDisplay?u("div",null,[u("br",null,null),g("Currently: "),u(v,null,null)]):null,d.cost&&!d.maxed.value?u("div",null,[u("br",null,null),g("Cost: "),Y(r(d.cost)||0)," ",n.resource.displayName]):null])}return""}),$(n,"visibility"),Ne(n,"visibility",_e.Visible),$(n,"cost"),$(n,"resource"),$(n,"purchaseLimit"),Ne(n,"purchaseLimit",a.dInf),$(n,"style"),$(n,"mark"),$(n,"small"),n[mt]=function(){const{display:f,visibility:d,style:_,classes:y,onClick:v,canClick:h,small:w,mark:C,id:R}=this;return{display:f,visibility:d,style:r(_),classes:y,onClick:v,canClick:h,small:w,mark:C,id:R}},n})}const Mn=_n({}),jn=Symbol("Hotkey");function Dn(e){return Be(()=>{const t=e();return t.type=jn,$(t,"enabled"),Ne(t,"enabled",!0),$(t,"description"),t})}oe.on("addLayer",e=>{yi(e,jn).forEach(t=>{Mn[t.key]=t})});oe.on("removeLayer",e=>{yi(e,jn).forEach(t=>{Mn[t.key]=void 0})});document.onkeydown=function(e){var i;if(((i=e.target)==null?void 0:i.tagName)==="INPUT"||Wn.value&&!A.keepGoing)return;let t=e.key;e.shiftKey&&(t="shift+"+t),e.ctrlKey&&(t="ctrl+"+t);const n=Mn[t];n&&r(n.enabled)&&(e.preventDefault(),n.onPress())};fa(B(()=>{const e=Object.values(Mn).filter(t=>r(t==null?void 0:t.enabled));return e.length===0?"":u("div",null,[u("br",null,null),u("h4",null,[g("Hotkeys")]),e.map(t=>u("div",null,[t==null?void 0:t.key,g(": "),t==null?void 0:t.description]))])}));const fl=L({__name:"Sticky",setup(e){const t=T("0"),n=new ResizeObserver(s),i=Le(null);function s(){let l=i.value;if(l==null)return;let o=0;for(;l.previousSibling;){const c=l.previousSibling;c.dataset&&"vSticky"in c.dataset&&(o+=c.offsetHeight),l=c}t.value=o+"px"}return wt(s),document.fonts.ready.then(s),wn(()=>{var o;const l=(o=i.value)==null?void 0:o.parentElement;l&&n.observe(l)}),(l,o)=>(b(),M("div",{class:"sticky",style:ge({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[Je(l.$slots,"default",{},void 0,!0)],4))}});var ml=Z(fl,[["__scopeId","data-v-cccac690"]]);const pl=L({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,n=S(()=>Un(t.resource));return(i,s)=>(b(),M("h2",{style:ge({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},j(r(n)),5))}});const hl={class:"main-display"},gl={key:0},vl={key:1},yl=g(", "),Xt=L({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null},setup(e){const n=ke(e),i=T(null),s=kt(n.effectDisplay),l=S(()=>a.lt(n.resource.value,"1e1000"));return(o,c)=>(b(),U(ml,null,{default:O(()=>{var f,d,_,y;return[m("div",{class:pe(["main-display-container",(f=e.classes)!=null?f:{}]),style:ge([{height:`${((_=(d=i.value)==null?void 0:d.$el.clientHeight)!=null?_:0)+50}px`},(y=e.style)!=null?y:{}])},[m("div",hl,[r(l)?(b(),M("span",gl,"You have ")):P("",!0),u(pl,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),g(" "+j(e.resource.displayName),1),r(s)?(b(),M("span",vl,[yl,(b(),U(Ce(r(s)),{ref_key:"effectRef",ref:i},null,512))])):P("",!0)])],6)]}),_:1}))}});var bl=L({props:{display:{type:E(String,Object,Function),required:!0},visibility:{type:E(Number),required:!0},style:E(String,Object,Array),classes:E(Object),resource:Object,cost:E(String,Object,Number),canPurchase:{type:E(Boolean),required:!0},bought:{type:E(Boolean),required:!0},mark:E(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:ln,MarkNode:Sn},setup(e){const{display:t,cost:n}=ke(e),i=Le("");return Fe(()=>{const s=ye(t);if(s==null){i.value="";return}if(pt(s)){i.value=K(s);return}const l=ye(n),o=K(s.title||"","h3"),c=K(s.description,"div"),f=K(s.effectDisplay||"");i.value=K(B(()=>{var d;return u("span",null,[s.title?u("div",null,[u(o,null,null)]):null,u(c,null,null),s.effectDisplay?u("div",null,[g("Currently: "),u(f,null,null)]):null,e.resource!=null&&s.showCost!==!1?u(D,null,[u("br",null,null),g("Cost: "),e.resource&&Un(e.resource,l)," ",(d=e.resource)==null?void 0:d.displayName]):null])}))}),{component:i,unref:r,Visibility:_e}}});const _l=["disabled"];function wl(e,t,n,i,s,l){var f;const o=dt("MarkNode"),c=dt("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),M("button",{key:0,style:ge([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(f=e.unref(e.style))!=null?f:{}]),onClick:t[0]||(t[0]=(...d)=>e.purchase&&e.purchase(...d)),class:pe({feature:!0,upgrade:!0,can:e.unref(e.canPurchase),locked:!e.unref(e.canPurchase),bought:e.unref(e.bought),...e.unref(e.classes)}),disabled:!e.unref(e.canPurchase)},[e.unref(e.component)?(b(),U(Ce(e.unref(e.component)),{key:0})):P("",!0),u(o,{mark:e.unref(e.mark)},null,8,["mark"]),u(c,{id:e.id},null,8,["id"])],14,_l)):P("",!0)}var Nl=Z(bl,[["render",wl],["__scopeId","data-v-7f411ac8"]]);const kl=Symbol("Upgrade");function de(e){const t=Ee(!1);return Be(()=>{const n=e();return n.id=Ot("upgrade-"),n.type=kl,n[ft]=Nl,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=S(()=>{const i=n;return i.resource!=null&&i.cost!=null&&a.gte(i.resource.value,r(i.cost))}):$(n,"canAfford"),n.canPurchase=S(()=>r(n.visibility)===_e.Visible&&r(n.canAfford)&&!r(n.bought)),n.purchase=function(){var s;const i=n;!r(i.canPurchase)||(i.resource!=null&&i.cost!=null&&(i.resource.value=a.sub(i.resource.value,r(i.cost))),t.value=!0,(s=i.onPurchase)==null||s.call(i))},$(n,"visibility"),Ne(n,"visibility",_e.Visible),$(n,"classes"),$(n,"style"),$(n,"display"),$(n,"mark"),$(n,"cost"),$(n,"resource"),n[mt]=function(){const{display:i,visibility:s,style:l,classes:o,resource:c,cost:f,canPurchase:d,bought:_,mark:y,id:v,purchase:h}=this;return{display:i,visibility:s,style:r(l),classes:o,resource:c,cost:f,canPurchase:d,bought:_,mark:y,id:v,purchase:h}},n})}function te(e){return Be(()=>{const{addend:t,description:n,enabled:i}=e(),s=$e(t),l=$e(n),o=i==null?void 0:$e(i);return{apply:c=>a.add(c,r(s)),revert:c=>a.sub(c,r(s)),enabled:o,description:n==null?void 0:B(()=>u("div",{class:"modifier-container"},[u("span",{class:"modifier-amount"},[a.gte(r(s),0)?"+":"",Y(r(s))]),r(l)?u("span",{class:"modifier-description"},[Xe(r(l))]):null]))}})}function se(e){return Be(()=>{const{multiplier:t,description:n,enabled:i}=e(),s=$e(t),l=$e(n),o=i==null?void 0:$e(i);return{apply:c=>a.times(c,r(s)),revert:c=>a.div(c,r(s)),enabled:o,description:n==null?void 0:B(()=>u("div",{class:"modifier-container"},[u("span",{class:"modifier-amount"},[g("x"),Y(r(s))]),r(l)?u("span",{class:"modifier-description"},[Xe(r(l))]):null]))}})}function Di(e){return Be(()=>{const{exponent:t,description:n,enabled:i,supportLowNumbers:s}=e(),l=$e(t),o=$e(n),c=i==null?void 0:$e(i);return{apply:f=>{let d=f;return s&&(d=a.add(d,1)),d=a.pow(d,r(l)),s&&(d=a.sub(d,1)),d},revert:f=>{let d=f;return s&&(d=a.add(d,1)),d=a.root(d,r(l)),s&&(d=a.sub(d,1)),d},enabled:c,description:n==null?void 0:B(()=>u("div",{class:"modifier-container"},[u("span",{class:"modifier-amount"},[g("^"),Y(r(l))]),r(o)?u("span",{class:"modifier-description"},[Xe(r(o)),s?" (+1 effective)":null]):null]))}})}function Ae(e){return Be(()=>{const t=e();return{apply:n=>t.filter(i=>r(i.enabled)!==!1).reduce((i,s)=>s.apply(i),n),revert:t.every(n=>n.revert!=null)?n=>t.filter(i=>r(i.enabled)!==!1).reduceRight((i,s)=>s.revert(i),n):void 0,enabled:S(()=>t.filter(n=>r(n.enabled)!==!1).length>0),description:B(()=>u(D,null,[t.filter(n=>r(n.enabled)!==!1).map(n=>r(n.description)).filter(n=>n).map(Xe)]))}})}const Cl={class:"field"},Sl={key:0,class:"field-title"},zn=L({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var o;const n=e,i=kt(tt(n,"title"),"span"),s=T((o=n.options.find(c=>c.value===n.modelValue))!=null?o:null);je(tt(n,"modelValue"),c=>{var f;ye(s)!==c&&(s.value=(f=n.options.find(d=>d.value===c))!=null?f:null)});function l(c){t("update:modelValue",c.value)}return(c,f)=>(b(),M("div",Cl,[r(i)?(b(),M("span",Sl,[(b(),U(Ce(r(i))))])):P("",!0),u(r(as),{options:e.options,modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=d=>s.value=d),l],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});var Ml=L({props:{visibility:{type:E(Number),required:!0},display:{type:E(String,Object,Function),required:!0},style:E(String,Object,Array),classes:E(Object),earned:{type:E(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:ln},setup(e){const{display:t}=ke(e),n=Le("");return Fe(()=>{const i=ye(t);if(i==null){n.value="";return}if(pt(i)){n.value=K(i);return}const s=K(i.requirement,"h3"),l=K(i.effectDisplay||"","b"),o=K(i.optionsDisplay||"","span");n.value=K(B(()=>u("span",null,[u(s,null,null),i.effectDisplay?u("div",null,[u(l,null,null)]):null,i.optionsDisplay?u("div",{class:"equal-spaced"},[u(o,null,null)]):null])))}),{comp:n,unref:r,Visibility:_e}}});function Il(e,t,n,i,s,l){var c;const o=dt("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),M("div",{key:0,style:ge([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:pe({feature:!0,milestone:!0,done:e.unref(e.earned),...e.unref(e.classes)})},[(b(),U(Ce(e.unref(e.comp)))),u(o,{id:e.id},null,8,["id"])],6)):P("",!0)}var Al=Z(Ml,[["render",Il],["__scopeId","data-v-f4e8794e"]]);oe.on("setupVue",e=>e.use(ls));const $l=ci(),El=Symbol("Milestone");let ct;(function(e){e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none"})(ct||(ct={}));function xe(e){const t=Ee(!1);return Be(()=>{var s;const n=(s=e==null?void 0:e())!=null?s:{};n.id=Ot("milestone-"),n.type=El,n[ft]=Al,n.earned=t,n.complete=function(){t.value=!0},$(n,"visibility"),Ne(n,"visibility",_e.Visible);const i=n.visibility;if(n.visibility=S(()=>{const l=r(n.display);switch(ie.msDisplay){default:case ct.All:return r(i);case ct.Configurable:return r(n.earned)&&!(l!=null&&typeof l=="object"&&"optionsDisplay"in l)?_e.None:r(i);case ct.Incomplete:return r(n.earned)?_e.None:r(i);case ct.None:return _e.None}}),$(n,"style"),$(n,"classes"),$(n,"display"),n[mt]=function(){const{visibility:l,display:o,style:c,classes:f,earned:d,id:_}=this;return{visibility:l,display:o,style:r(c),classes:f,earned:d,id:_}},n.shouldEarn){const l=n;Fe(()=>{var o,c;if(ie.active===A.id&&!l.earned.value&&r(l.visibility)===_e.Visible&&((o=l.shouldEarn)==null?void 0:o.call(l))&&(l.earned.value=!0,(c=l.onComplete)==null||c.call(l),l.display)){const f=r(l.display),d=K(pt(f)?f:f.requirement);$l(u(D,null,[u("h3",null,[g("Milestone earned!")]),u("div",null,[u(d,null,null)])]))}})}return n})}oe.on("loadSettings",e=>{Ne(e,"msDisplay",ct.All)});const Pl=Object.values(ct).map(e=>({label:vi(e),value:e}));da(B(()=>u(zn,{title:"Show Milestones",options:Pl,"onUpdate:modelValue":e=>ie.msDisplay=e,modelValue:ie.msDisplay},null)));const Tl=Symbol("Reset");function xl(e){return Be(()=>{const t=e();return t.id=Ot("reset-"),t.type=Tl,t.reset=function(){var i;const n=s=>{s&&typeof s=="object"&&(tn in s?s[tn].value=s[nn]:!(s instanceof a)&&!we(s)&&Object.values(s).forEach(l=>n(l)))};r(t.thingsToReset).forEach(n),oe.emit("reset",t),(i=t.onReset)==null||i.call(t)},$(t,"thingsToReset"),t})}const fn={};oe.on("removeLayer",e=>{var t;(t=fn[e.id])==null||t.call(fn),fn[e.id]=void 0});function Fl(e){return Be(()=>{const t=e();return t.currentGain==null&&(t.currentGain=S(()=>{let n=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return n=a.floor(n).max(0),r(t.buyMax)||(n=n.min(1)),n})),t.actualGain==null&&(t.actualGain=t.currentGain),t.currentAt==null&&(t.currentAt=S(()=>{let n=t.scaling.currentAt(t);return t.roundUpCost&&(n=a.ceil(n)),n})),t.nextAt==null&&(t.nextAt=S(()=>{let n=t.scaling.nextAt(t);return t.roundUpCost&&(n=a.ceil(n)),n})),t.convert==null&&(t.convert=function(){var s;const n=r(t.currentGain),i=r(t.currentAt);t.gainResource.value=a.add(t.gainResource.value,n),t.spend(n,i),(s=t.onConvert)==null||s.call(t,n)}),t.spend==null&&(t.spend=function(){t.baseResource.value=0}),$(t,"currentGain"),$(t,"actualGain"),$(t,"currentAt"),$(t,"nextAt"),$(t,"buyMax"),Ne(t,"buyMax",!0),$(t,"roundUpCost"),Ne(t,"roundUpCost",!0),t})}function Bl(e,t){const n=$e(e),i=$e(t);return{currentGain(s){let l=r(s.baseResource.value);if(s.costModifier&&(l=s.costModifier.apply(l)),a.lt(l,r(n)))return 0;const o=a.div(l,r(n)).pow(r(i));return o.isNan()?new a(0):o},currentAt(s){let l=r(s.currentGain);return s.gainModifier&&(l=s.gainModifier.revert(l)),l=a.max(0,l).root(r(i)).times(r(n)),s.costModifier&&(l=s.costModifier.revert(l)),l},nextAt(s){let l=a.add(r(s.currentGain),1).floor();return s.gainModifier&&(l=s.gainModifier.revert(l)),l=a.max(0,l).root(r(i)).times(r(n)).max(r(n)),s.costModifier&&(l=s.costModifier.revert(l)),l}}}function Dl(e){return Fl(()=>{const t=e();return Ne(t,"buyMax",!1),t.currentGain==null&&(t.currentGain=S(()=>{let n=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return n=a.floor(n).max(t.gainResource.value),r(t.buyMax)||(n=n.min(a.add(t.gainResource.value,1))),n})),t.actualGain==null&&(t.actualGain=S(()=>{let n=a.sub(a.floor(t.scaling.currentGain(t)),t.gainResource.value).max(0);return r(t.buyMax)||(n=n.min(1)),n})),Ne(t,"convert",function(){var s;const n=r(t.actualGain),i=r(t.currentAt);t.gainResource.value=t.gainModifier?t.gainModifier.apply(r(t.currentGain)):r(t.currentGain),t.spend(n,i),(s=t.onConvert)==null||s.call(t,n)}),t})}const Ol="workshop",jt=2,Te=Rt(Ol,function(){const e="Workshop",t="#D66B02",n="#D66B02",i=_t(0,"foundation progress"),s=Dl(()=>({scaling:Bl(250,1.5),baseResource:ae.logs,gainResource:i,roundUpCost:!0,buyMax:!1,spend(le,I){ae.logs.value=a.sub(ae.logs.value,I)}})),l=Ie(()=>({display:B(()=>u(D,null,[u("b",{style:"font-size: x-large"},[g("Build part of the foundation")]),u("br",null,null),u("br",null,null),u("span",{style:"font-size: large"},[g("Cost:")," ",Un(ae.logs,a.gte(s.actualGain.value,1)?s.currentAt.value:s.nextAt.value)," ",ae.logs.displayName])])),visibility:()=>X(a.lt(i.value,100)),canClick:()=>a.gte(s.actualGain.value,1)&&a.lt(i.value,100),onClick(){!r(this.canClick)||s.convert()},style:"width: 600px; min-height: unset"})),o=Dn(()=>({key:"w",description:"Build part of the foundation.",onPress:()=>{l.canClick.value&&l.onClick()}})),c=xe(()=>({display:{requirement:"1% Foundation Completed",effectDisplay:"Trees give 5% more logs for each % of foundation completed"},shouldEarn:()=>a.gte(i.value,1)})),f=xe(()=>({display:{requirement:"10% Foundation Completed",effectDisplay:"Cut an additional tree per second for each 5% of foundation completed"},shouldEarn:()=>a.gte(i.value,10),visibility:()=>X(c.earned.value)})),d=xe(()=>({display:{requirement:"20% Foundation Completed",effectDisplay:"Plant an additional tree per second for each 10% of foundation completed"},shouldEarn:()=>a.gte(i.value,20),visibility:()=>X(f.earned.value)})),_=xe(()=>({display:{requirement:"30% Foundation Completed",effectDisplay:"All automatic tree cutting is doubled"},shouldEarn:()=>a.gte(i.value,30),visibility:()=>X(d.earned.value)})),y=xe(()=>({display:{requirement:"40% Foundation Completed",effectDisplay:"All automatic tree planting is doubled"},shouldEarn:()=>a.gte(i.value,40),visibility:()=>X(_.earned.value)})),v=xe(()=>({display:{requirement:"50% Foundation Completed",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>a.gte(i.value,50),visibility:()=>X(y.earned.value)})),h=xe(()=>({display:{requirement:"75% Foundation Completed",effectDisplay:"The forest gains an extra tree for every 2% of foundation completed"},shouldEarn:()=>a.gte(i.value,75),visibility:()=>X(v.earned.value)})),w=xe(()=>({display:{requirement:"100% Foundation Completed",effectDisplay:"Trees' log gain is now raised to the 1.1th power"},shouldEarn:()=>a.gte(i.value,100),visibility:()=>X(h.earned.value)})),C={logGainMilestone1:c,autoCutMilestone1:f,autoPlantMilestone1:d,autoCutMilestone2:_,autoPlantMilestone2:y,logGainMilestone2:v,morePlantsMilestone1:h,logGainMilestone3:w},R=Bt(()=>({direction:J.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,progress:()=>z.day.value===jt?a.div(i.value,100):1,display:B(()=>z.day.value===jt?u(D,null,[G(i.value),g("%")]):"")}));return Fe(()=>{z.day.value===jt&&a.gte(i.value,100)&&z.completeDay()}),{name:e,day:jt,color:t,foundationProgress:i,foundationConversion:s,milestones:C,minWidth:700,buildFoundationHK:o,display:B(()=>u(D,null,[u("div",null,[z.day.value===jt?"Complete the foundation to complete the day":`${e} Complete!`]),ve(R),u(Oe,null,null),ve(l),a.lt(i.value,100)?u("div",null,[g("You have "),G(i.value),g("% completed")]):null,u(Oe,null,null),Ii(...Object.values(C))]))}}),Rl="elves",zt=4,ot=Rt(Rl,function(){const e="Elves",t="red",n="#911D21",s=Bt(()=>({direction:J.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,progress:()=>z.day.value===zt?a.div(R.value,6).times(.8333333333333334).add(a.div(a.add(me.coal.value,1).log10(),a.log10(1e9)).clamp(0,1).div(6)):1,display:B(()=>z.day.value===zt?a.lt(R.value,6)?u(D,null,[G(R.value),g("/6 elves")]):u(D,null,[G(me.coal.value),g("/"),G(1e9),g(" coal")]):"")})),l=xl(()=>({thingsToReset:[ae,Te,me],onReset(){setTimeout(()=>{I.earned.value&&(ae.row1Upgrades[4].bought.value=!0,ae.row2Upgrades[4].bought.value=!0)})}}));function o(re){const Ze=S(()=>a.pow(4,R.value).times(1e6)),ne=Ee(0);function Mt(It){if(We.bought.value){ne.value=a.add(ne.value,It);const qe=a.recip(Ct.value);for(;a.gte(ne.value,qe);)if(r(re.buyable.canPurchase))re.buyable.amount.value=a.add(re.buyable.amount.value,1),ne.value=qe.sub(.1);else{ne.value=qe;break}}}const We=de(()=>({buyProgress:ne,update:Mt,resource:me.coal,cost:Ze,display:()=>({title:re.name,description:B(()=>u(D,null,[re.description,We.bought.value?null:u(D,null,[" ",g("Training this elf will require resetting all your progress from days 1-3.")])])),showCost:!We.bought.value}),style:"width: 190px",onPurchase:l.reset}));return We}const c=o({name:"Holly",description:"Holly will automatically purchase cutters you can afford, without actually spending any logs.",buyable:ae.row1Buyables[0]}),f=o({name:"Ivy",description:"Ivy will automatically purchase planters you can afford, without actually spending any logs.",buyable:ae.row1Buyables[1]}),d=o({name:"Hope",description:"Hope will automatically purchase forest expanders you can afford, without actually spending any logs.",buyable:ae.row1Buyables[2]}),_=[c,f,d],y=o({name:"Jack",description:"Jack will automatically purchase heated cutters you can afford, without actually spending any coal.",buyable:me.heatedCutters}),v=o({name:"Mary",description:"Mary will automatically purchase heated planters you can afford, without actually spending any coal.",buyable:me.heatedPlanters}),h=o({name:"Noel",description:"Noel will automatically purchase fertilized soil you can afford, without actually spending any ash.",buyable:me.moreFertilizer}),w=[y,v,h],C={cuttersElf:c,plantersElf:f,expandersElf:d,heatedCuttersElf:y,heatedPlantersElf:v,fertilizerElf:h},R=S(()=>Object.values(C).filter(re=>re.bought.value).length),le=xe(()=>({display:{requirement:"1 Elf Trained",effectDisplay:"Manual cutting and planting can happen twice as often for each trained elf"},shouldEarn:()=>a.gte(R.value,1)})),I=xe(()=>({display:{requirement:"2 Elves Trained",effectDisplay:"Research I & II are't reset after training"},shouldEarn:()=>a.gte(R.value,2),visibility:()=>X(le.earned.value)})),k=xe(()=>({display:{requirement:"3 Elves Trained",effectDisplay:"Coal gain is raised to the 1.25"},shouldEarn:()=>a.gte(R.value,3),visibility:()=>X(I.earned.value)})),x=xe(()=>({display:{requirement:"4 Elves Trained",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>a.gte(R.value,4),visibility:()=>X(k.earned.value)})),ue=xe(()=>({display:{requirement:"5 Elves Trained",effectDisplay:"Forest is twice as large"},shouldEarn:()=>a.gte(R.value,5),visibility:()=>X(x.earned.value)})),be=xe(()=>({display:{requirement:"6 Elves Trained",effectDisplay:"Elves work twice as fast"},shouldEarn:()=>a.gte(R.value,6),visibility:()=>X(ue.earned.value)})),Me=[le,I,k,x,ue,be],ht=Ae(()=>[se(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned}))]),Ct=S(()=>ht.apply(.1)),[qt,St]=Hn(()=>[{title:"Elf Auto-Buy Frequency",modifier:ht,base:10,unit:"/s"}]),W=T(!1),gt=B(()=>u(ze,{modelValue:W.value,"onUpdate:modelValue":re=>W.value=re},{header:()=>u("h2",null,[e,g(" Modifiers")]),body:qt}));return oe.on("update",re=>{a.lt(z.day.value,zt)||Object.values(C).forEach(Ze=>Ze.update(re))}),Fe(()=>{z.day.value===zt&&a.gte(R.value,6)&&a.gte(me.coal.value,1e9)&&z.completeDay()}),{name:e,color:t,elves:C,totalElves:R,milestones:Me,generalTabCollapsed:St,minWidth:700,display:B(()=>u(D,null,[u("div",null,[z.day.value===zt?`Reach ${G(6)} trained elves and ${G(1e9)} ${me.coal.displayName} to complete the day`:`${e} Complete!`," ",g("-")," ",u("button",{class:"button",style:"display: inline-block;",onClick:()=>W.value=!0},[g("Check Modifiers")])]),ve(s),ve(gt),u(Oe,null,null),u("div",{style:"width: 600px"},[De(..._),De(...w)]),Ii(...Me)]))}}),ql="coal",Wt=3,me=Rt(ql,function(){const e="Coal",t="#151716",n="#B2BeB5",i="var(--foreground)",s=_t(0,"coal"),l=Bi(s),o=_t(0,"ash"),c=1e7,f=Bt(()=>({direction:J.Right,width:600,height:25,fillStyle:`backgroundColor: ${t}`,progress:()=>z.day.value===Wt?a.log10(l.value).div(Math.log10(c)):1,display:B(()=>z.day.value===Wt?u(D,null,[G(l.value),g("/"),G(c)]):"")})),d=Ee(0),_=S(()=>a.times(d.value,1e3)),y=S(()=>a.times(d.value,.1)),v=S(()=>a.times(d.value,50)),h=et(()=>({resource:ae.logs,cost(){return a.times(Me.amount.value,10).plus(this.amount.value).pow(1.5).times(1e4)},display:B(()=>u(D,null,[u("h3",null,[g("Small Fire")]),u("br",null,null),g("Burn 1000 logs for 0.1 coal and 50 ash"),u("br",null,null),u("br",null,null),g("Currently:"),u("br",null,null),g("-"),Y(_.value),g(" logs/sec"),u("br",null,null),g("+"),Y(y.value),g(" coal/sec"),u("br",null,null),g("+"),Y(v.value),g(" ash/sec"),u("br",null,null),u("br",null,null),g("Cost: "),G(r(h.cost)),g(" "),h.resource.displayName])),onPurchase(){d.value=a.add(d.value,1)},style:{color:i,width:"160px"}})),w=Ie(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(d.value,0)},onClick(){d.value=0}})),C=Ie(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(d.value,0)},onClick(){d.value=a.sub(d.value,1)}})),R=Ie(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(d.value,h.amount.value)},onClick(){d.value=a.add(d.value,1)}})),le=Ie(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(d.value,h.amount.value)},onClick(){d.value=h.amount.value}})),I=_t(h.amount,"small fires"),k=Ee(0),x=S(()=>a.times(k.value,1e4)),ue=S(()=>a.times(k.value,10)),be=S(()=>a.times(k.value,1e3)),Me=et(()=>({resource:I,cost:10,display:B(()=>u(D,null,[u("h3",null,[g("Bonfire")]),u("br",null,null),g("Burn 10,000 logs for 10 coal and 1000 ash"),u("br",null,null),u("br",null,null),g("Currently:"),u("br",null,null),g("-"),Y(x.value),g(" logs/sec"),u("br",null,null),g("+"),Y(ue.value),g(" coal/sec"),u("br",null,null),g("+"),Y(be.value),g(" ash/sec"),u("br",null,null),u("br",null,null),g("Cost: "),G(r(Me.cost)),g(" "),Me.resource.displayName])),onPurchase(V){d.value=a.sub(d.value,V).max(0),k.value=a.add(k.value,1)},style:{color:i,width:"160px"}})),ht=Ie(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(k.value,0)},onClick(){k.value=0}})),Ct=Ie(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(k.value,0)},onClick(){k.value=a.sub(k.value,1)}})),qt=Ie(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(k.value,Me.amount.value)},onClick(){k.value=a.add(k.value,1)}})),St=Ie(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(k.value,Me.amount.value)},onClick(){k.value=Me.amount.value}})),W=Ee(0),gt=S(()=>a.times(W.value,1e6)),re=S(()=>a.times(W.value,1e4)),Ze=S(()=>a.times(W.value,1e4)),ne=et(()=>({resource:ae.logs,cost(){return a.pow(1.1,this.amount.value).times(1e7)},display:B(()=>u(D,null,[u("h3",null,[g("Charcoal Kiln")]),u("br",null,null),g("Burn 1,000,000 logs for 10,000 coal and 10,000 ash"),u("br",null,null),u("br",null,null),g("Currently:"),u("br",null,null),g("-"),Y(gt.value),g(" logs/sec"),u("br",null,null),g("+"),Y(re.value),g(" coal/sec"),u("br",null,null),g("+"),Y(Ze.value),g(" ash/sec"),u("br",null,null),u("br",null,null),g("Cost: "),G(r(ne.cost)),g(" "),ne.resource.displayName])),onPurchase(){W.value=a.add(W.value,1)},style:{color:i,width:"160px"}})),Mt=Ie(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(W.value,0)},onClick(){W.value=0}})),We=Ie(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(W.value,0)},onClick(){W.value=a.sub(W.value,1)}})),It=Ie(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(W.value,ne.amount.value)},onClick(){W.value=a.add(W.value,1)}})),qe=Ie(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(W.value,ne.amount.value)},onClick(){W.value=ne.amount.value}})),At=de(()=>({resource:s,cost:5,display:{title:"Warmer Cutters",description:"Cut down twice as many trees/s"},style:{color:i}})),at=de(()=>({resource:s,cost:5,display:{title:"Warmer Planters",description:"Plant twice as many trees/s"},style:{color:i}})),Ye=de(()=>({resource:o,cost:5e3,display:{title:"Ashy Soil",description:"Trees give 25% more logs"},style:{color:i}})),he=de(()=>({resource:I,cost:10,display:{title:"Bigger Fires",description:"Put all those fires together into a larger blaze"},onPurchase(){I.value=a.add(I.value,this.cost)},style:{color:i}})),An=[At,at,Ye,he],Qe=de(()=>({resource:s,cost:250,display:{title:"Dedicated Cutter Heaters",description:"Double the bonus from Heated Cutters"},style:{color:i},visibility:()=>X(he.bought.value)})),Pe=de(()=>({resource:s,cost:250,display:{title:"Dedicated Planter Heaters",description:"Double the bonus from Heated Planters"},style:{color:i},visibility:()=>X(he.bought.value)})),Vt=de(()=>({canAfford(){return a.gte(ae.logs.value,1e5)&&a.gte(o.value,1e5)},onPurchase(){ae.logs.value=a.sub(ae.logs.value,1e5),o.value=a.sub(o.value,1e5)},display:B(()=>u(D,null,[u("h3",null,[g("Mulched Soil")]),u("br",null,null),g("Double the bonus from Fertilized Soil"),u("br",null,null),u("br",null,null),g("Cost: "),G(1e5),g(" "),ae.logs.displayName,u("br",null,null),G(1e5),g(" "),o.displayName])),style:{color:i},visibility:()=>X(he.bought.value)})),Ke=de(()=>({resource:ae.logs,cost:1e7,display:{title:"Efficient Fires",description:"Move the fires underground to keep the coal from turning to ash"},style:{color:i},visibility:()=>X(he.bought.value)})),$n=[Qe,Pe,Vt,Ke],$t=et(()=>({resource:s,cost(){let V=this.amount.value;return a.gte(V,50)&&(V=a.pow(V,2).div(50)),a.gte(V,200)&&(V=a.pow(V,2).div(200)),a.gte(V,2e6)&&(V=a.pow(V,2).div(2e6)),a.add(V,1).pow(2.5).times(10)},display:{title:"Heated Cutters",description:"Even warmer cutters cut down trees faster",effectDisplay:B(()=>u(D,null,[g("Cutters cut down trees "),Y(on.value),g("x faster")]))},style:{color:i},visibility:()=>X(At.bought.value)})),lt=et(()=>({resource:s,cost(){let V=this.amount.value;return a.gte(V,50)&&(V=a.pow(V,2).div(50)),a.gte(V,200)&&(V=a.pow(V,2).div(200)),a.gte(V,2e6)&&(V=a.pow(V,2).div(2e6)),a.add(V,1).pow(2.5).times(10)},display:{title:"Heated Planters",description:"Even warmer planters plant trees faster",effectDisplay:B(()=>u(D,null,[g("Planters plant trees "),Y(F.value),g("x faster")]))},style:{color:i},visibility:()=>X(at.bought.value)})),Et=et(()=>({resource:o,cost(){let V=this.amount.value;return a.gte(V,50)&&(V=a.pow(V,2).div(50)),a.gte(V,200)&&(V=a.pow(V,2).div(200)),a.gte(V,2e6)&&(V=a.pow(V,2).div(2e6)),a.add(V,1).pow(1.5).times(5e4)},display:{title:"Fertilized Soil",description:"More fertilizer helps trees grow bigger",effectDisplay:B(()=>u(D,null,[g("Trees give "),Y(Ut.value),g("x more logs")]))},style:{color:i},visibility:()=>X(Ye.bought.value)})),Lt=[$t,lt,Et],Gt=Ae(()=>[te(()=>({addend(){return a.times($t.amount.value,.25)},description:"Heated Cutters",enabled(){return a.gt($t.amount.value,0)}})),se(()=>({multiplier:2,description:"Dedicated Cutter Heaters",enabled:Qe.bought}))]),on=S(()=>Gt.apply(1)),En=Ae(()=>[te(()=>({addend(){return a.times(lt.amount.value,.25)},description:"Heated Planters",enabled(){return a.gt(lt.amount.value,0)}})),se(()=>({multiplier:2,description:"Dedicated Planter Heaters",enabled:Pe.bought}))]),F=S(()=>En.apply(1)),un=Ae(()=>[te(()=>({addend(){return a.times(Et.amount.value,.25)},description:"Fertilized Soil",enabled(){return a.gt(Et.amount.value,0)}})),se(()=>({multiplier:2,description:"Mulched Soil",enabled:Vt.bought}))]),Ut=S(()=>un.apply(1)),cn=Ae(()=>[te(()=>({addend(){return y.value},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),te(()=>({addend(){return ue.value},description:"Bonfires",enabled(){return a.gt(k.value,0)}})),te(()=>({addend(){return re.value},description:"Charcoal Kilns",enabled(){return a.gt(W.value,0)}})),Di(()=>({exponent:1.25,description:"3 Elves Trained",enabled:ot.milestones[2].earned}))]),Ht=S(()=>cn.apply(0)),Jn=Ae(()=>[te(()=>({addend(){return v.value},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),te(()=>({addend(){return be.value},description:"Bonfires",enabled(){return a.gt(k.value,0)}})),te(()=>({addend(){return Ze.value},description:"Charcoal Kilns",enabled(){return a.gt(W.value,0)}}))]),Pn=S(()=>Jn.apply(0)),Xn=Ae(()=>[te(()=>({addend(){return a.negate(_.value)},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),te(()=>({addend(){return a.negate(x.value)},description:"Bonfires",enabled(){return a.gt(k.value,0)}})),te(()=>({addend(){return a.negate(gt.value)},description:"Charcoal Kilns",enabled(){return a.gt(W.value,0)}}))]),Zn=S(()=>Xn.apply(0)),[Wi,Qi]=Hn(()=>[{title:"Log Consumption",modifier:Xn,base:0,visible(){return a.gt(d.value,0)||a.gt(k.value,0)||a.gt(W.value,0)}},{title:"Coal Gain",modifier:cn,base:0,visible(){return a.gt(d.value,0)||a.gt(k.value,0)||a.gt(W.value,0)}},{title:"Ash Gain",modifier:Jn,base:0,visible(){return a.gt(d.value,0)||a.gt(k.value,0)||a.gt(W.value,0)}}]),Tn=T(!1),Ki=B(()=>u(ze,{modelValue:Tn.value,"onUpdate:modelValue":V=>Tn.value=V},{header:()=>u("h2",null,[e,g(" Modifiers")]),body:Wi}));return oe.on("update",V=>{a.lt(z.day.value,Wt)||a.times(V,Zn.value).negate().gt(ae.logs.value)||(ae.logs.value=a.times(V,Zn.value).plus(ae.logs.value),s.value=a.times(V,Ht.value).plus(s.value),o.value=a.times(V,Pn.value).plus(o.value))}),Fe(()=>{z.day.value===Wt&&a.gte(l.value,c)&&z.completeDay()}),{name:e,color:t,coal:s,totalCoal:l,ash:o,activeFires:d,buildFire:h,activeBonfires:k,buildBonfire:Me,activeKilns:W,buildKiln:ne,warmerCutters:At,warmerPlanters:at,basicFertilizer:Ye,unlockBonfire:he,dedicatedCutters:Qe,dedicatedPlanters:Pe,betterFertilizer:Vt,unlockKiln:Ke,heatedCutters:$t,heatedPlanters:lt,moreFertilizer:Et,computedHeatedCutterEffect:on,computedHeatedPlanterEffect:F,computedFertilizerEffect:Ut,generalTabCollapsed:Qi,minWidth:700,display:B(()=>u(D,null,[u("div",null,[z.day.value===Wt?`Reach ${G(c)} ${s.displayName} to complete the day`:`${e} Complete!`," ",g("-")," ",u("button",{class:"button",style:"display: inline-block;",onClick:()=>Tn.value=!0},[g("Check Modifiers")])]),ve(f),ve(Ki),u(Oe,null,null),u(Xt,{resource:s,color:t,style:"margin-bottom: 0",effectDisplay:a.gt(Ht.value,0)?`+${Y(Ht.value)}/s`:void 0},null),u(Oe,null,null),u(Xt,{resource:o,color:n,style:"margin-bottom: 0",effectDisplay:a.gt(Pn.value,0)?`+${Y(Pn.value)}/s`:void 0},null),u(Oe,null,null),u(Si,null,{default:()=>[u(pn,null,{default:()=>[ve(h),u("div",null,[G(d.value),g("/"),G(h.amount.value)]),De(w,C,R,le)]}),he.bought.value?u(D,null,[u(Oe,null,null),u(pn,null,{default:()=>[ve(Me),u("div",null,[G(k.value),g("/"),G(Me.amount.value)]),De(ht,Ct,qt,St)]})]):void 0,Ke.bought.value?u(D,null,[u(Oe,null,null),u(pn,null,{default:()=>[ve(ne),u("div",null,[G(W.value),g("/"),G(ne.amount.value)]),De(Mt,We,It,qe)]})]):void 0]}),u(Oe,null,null),De(...An),De(...$n),De(...Lt)]))}}),Vl="trees",Qt=1,li=.5,ae=Rt(Vl,function(){const e="Trees",t="#4BDC13",n="green",i=_t(0,"logs"),s=Bi(i),l=_t(0,"saplings"),o=1e4,c=T(0),f=Ae(()=>[te(()=>({addend:()=>a.times(ht.amount.value,10),description:"Expand Forest",enabled:x.bought})),te(()=>({addend:()=>a.div(Te.foundationProgress.value,2),description:"75% Foundation Completed",enabled:Te.milestones.morePlantsMilestone1.earned})),se(()=>({multiplier:2,description:"5 Elves Trained",enabled:ot.milestones[4].earned}))]),d=_t(S(()=>a.sub(f.apply(10),l.value)),"trees"),_=de(()=>({resource:i,cost:10,display:{title:"Wooden Fingers",description:"Cut down an additional tree per click"}})),y=de(()=>({resource:i,cost:10,display:{title:"Leafy Fingers",description:"Plant an additional tree per click"}})),v=de(()=>({resource:i,cost:25,display:{title:"Automated Knives",description:"Cut down a tree every second"}})),h=de(()=>({resource:i,cost:25,display:{title:"Automated Spade",description:"Plant a tree every second"}})),w=de(()=>({resource:i,cost:40,display:{title:"Research I",description:"Trees give 25% more logs, and unlock more upgrades"}})),C=[_,y,v,h,w],R=de(()=>({resource:i,cost:50,visibility:()=>X(w.bought.value),display:{title:"Sharper Fingers",description:"Manually cut trees twice as often"}})),le=de(()=>({resource:i,cost:50,visibility:()=>X(w.bought.value),display:{title:"Greener Fingers",description:"Manually Plant trees twice as often"}})),I=de(()=>({resource:i,cost:150,visibility:()=>X(w.bought.value),display:{title:"Smart Knives",description:"Each time you manually chop trees, gain 1s of automatic tree chopping production"}})),k=de(()=>({resource:i,cost:150,visibility:()=>X(w.bought.value),display:{title:"Smart Spades",description:"Each time you manually plant trees, gain 1s of automatic tree planting production"}})),x=de(()=>({resource:i,cost:300,visibility:()=>X(w.bought.value),display:{title:"Research II",description:"Trees give 25% more logs, and unlock repeatable purchases"}})),ue=[R,le,I,k,x],be=et(()=>({resource:i,cost(){let F=this.amount.value;return a.gte(F,50)&&(F=a.pow(F,2).div(50)),a.gte(F,200)&&(F=a.pow(F,2).div(200)),a.gte(F,2e6)&&(F=a.pow(F,2).div(2e6)),a.times(100,F).add(200)},display:{title:"Generic Cutters",description:"Each cutter cuts down 1 tree/s"},visibility:()=>X(x.bought.value)})),Me=et(()=>({resource:i,cost(){let F=this.amount.value;return a.gte(F,50)&&(F=a.pow(F,2).div(50)),a.gte(F,200)&&(F=a.pow(F,2).div(200)),a.gte(F,2e6)&&(F=a.pow(F,2).div(2e6)),a.times(100,F).add(200)},display:{title:"Generic Planters",description:"Each planter plants 0.5 trees/s"},visibility:()=>X(x.bought.value)})),ht=et(()=>({resource:i,cost(){let F=this.amount.value;return a.gte(F,100)&&(F=a.pow(F,2).div(100)),a.gte(F,1e5)&&(F=a.pow(F,2).div(1e5)),a.pow(a.add(F,1),1.5).times(500)},display:{title:"Expand Forest",description:"Add 10 trees to the forest"},visibility:()=>X(x.bought.value)})),Ct=[be,Me,ht],qt=Bt(()=>({direction:J.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,progress:()=>z.day.value===Qt?a.log10(s.value).div(Math.log10(o)):1,display:B(()=>z.day.value===Qt?u(D,null,[G(s.value),g("/"),G(o)]):"")})),St=Ae(()=>[te(()=>({addend:1,description:"Wooden Fingers",enabled:_.bought})),te(()=>({addend:ne,description:"Smart Knives",enabled:I.bought}))]),W=S(()=>St.apply(1)),gt=Ae(()=>[se(()=>({multiplier:.5,description:"Sharper Fingers",enabled:R.bought})),se(()=>({multiplier:()=>a.pow(.5,ot.totalElves.value),description:"1 Elf Trained",enabled:ot.milestones[0].earned}))]),re=S(()=>gt.apply(1)),Ze=Ae(()=>[te(()=>({addend:1,description:"Automated Knives",enabled:v.bought})),te(()=>({addend:be.amount,description:"Generic Cutters",enabled:x.bought})),te(()=>({addend:()=>a.div(Te.foundationProgress.value,5).floor(),description:"10% Foundation Completed",enabled:Te.milestones.autoCutMilestone1.earned})),se(()=>({multiplier:2,description:"30% Foundation Completed",enabled:Te.milestones.autoCutMilestone2.earned})),se(()=>({multiplier:2,description:"Warmer Cutters",enabled:me.warmerCutters.bought})),se(()=>({multiplier:me.computedHeatedCutterEffect,description:"Heated Cutters",enabled:()=>a.gt(me.heatedCutters.amount.value,0)}))]),ne=S(()=>Ze.apply(0)),Mt=Ae(()=>[te(()=>({addend:1,description:"Leafy Fingers",enabled:y.bought})),te(()=>({addend:at,description:"Smart Spades",enabled:k.bought}))]),We=S(()=>Mt.apply(1)),It=Ae(()=>[se(()=>({multiplier:.5,description:"Greener Fingers",enabled:le.bought})),se(()=>({multiplier:()=>a.pow(.5,ot.totalElves.value),description:"1 Elf Trained",enabled:ot.milestones[0].earned}))]),qe=S(()=>It.apply(1)),At=Ae(()=>[te(()=>({addend:1,description:"Automated Spade",enabled:h.bought})),te(()=>({addend:()=>a.div(Me.amount.value,2),description:"Generic Planters",enabled:x.bought})),te(()=>({addend:()=>a.div(Te.foundationProgress.value,10).floor(),description:"20% Foundation Completed",enabled:Te.milestones.autoPlantMilestone1.earned})),se(()=>({multiplier:2,description:"40% Foundation Completed",enabled:Te.milestones.autoPlantMilestone2.earned})),se(()=>({multiplier:2,description:"Warmer Planters",enabled:me.warmerPlanters.bought})),se(()=>({multiplier:me.computedHeatedPlanterEffect,description:"Heated Planters",enabled:()=>a.gt(me.heatedPlanters.amount.value,0)}))]),at=S(()=>At.apply(0)),Ye=Ae(()=>[se(()=>({multiplier:1.25,description:"Research I",enabled:w.bought})),se(()=>({multiplier:1.25,description:"Research II",enabled:x.bought})),se(()=>({multiplier:()=>a.div(Te.foundationProgress.value,20).add(1),description:"1% Foundation Completed",enabled:Te.milestones.logGainMilestone1.earned})),se(()=>({multiplier:2,description:"50% Foundation Completed",enabled:Te.milestones.logGainMilestone2.earned})),se(()=>({multiplier:1.25,description:"Ashy Soil",enabled:me.basicFertilizer.bought})),se(()=>({multiplier:me.computedFertilizerEffect,description:"Fertilized Soil",enabled:()=>a.gt(me.moreFertilizer.amount.value,0)})),se(()=>({multiplier:2,description:"4 Elves Trained",enabled:ot.milestones[3].earned})),Di(()=>({exponent:1.1,description:"100% Foundation Completed",enabled:Te.milestones.logGainMilestone3.earned}))]),he=Ee(0),An=Bt(()=>({direction:J.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>a.div(he.value,re.value)})),Qe=Ie(()=>({display:{title:"Cut trees",description:B(()=>u(D,null,[g("Cut down up to "),G(a.floor(W.value))," ",g("tree"),a.eq(W.value,1)?"":"s",g(" at once!"),u("br",null,null),ve(An)]))},style:{minHeight:"80px"},canClick:()=>a.gte(d.value,1)&&a.gte(he.value,re.value),onClick(){if(a.lt(he.value,re.value))return;const F=a.floor(a.min(d.value,a.times(W.value,a.div(he.value,re.value).floor())));i.value=a.add(i.value,Ye.apply(F)),l.value=a.add(l.value,F),he.value=0}})),Pe=Ee(0),Vt=Bt(()=>({direction:J.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>a.div(Pe.value,qe.value)})),Ke=Ie(()=>({display:{title:"Plant trees",description:B(()=>u(D,null,[g("Plant up to "),G(a.floor(We.value))," ",g("tree"),a.eq(We.value,1)?"":"s",g(" at once!"),u("br",null,null),ve(Vt)]))},style:{minHeight:"80px"},canClick:()=>a.gte(l.value,1)&&a.gte(Pe.value,qe.value),onClick(){if(a.lt(Pe.value,qe.value))return;const F=a.floor(a.min(l.value,a.times(We.value,a.div(Pe.value,qe.value).floor())));l.value=a.sub(l.value,F),Pe.value=0}})),[$n,$t]=Hn(()=>[{title:"Logs per Tree",modifier:Ye,base:1,visible:w.bought},{title:"Manual Cutting Amount",modifier:St,base:1,visible:_.bought,unit:"/click"},{title:"Manual Cutting Cooldown",modifier:gt,base:1,visible:_.bought,unit:"s"},{title:"Manual Planting Amount",modifier:Mt,base:1,visible:y.bought,unit:"/click"},{title:"Manual Planting Cooldown",modifier:It,base:1,visible:y.bought,unit:"s"},{title:"Auto Cutting Amount",modifier:Ze,base:0,visible:v.bought,unit:"/s"},{title:"Auto Planting Amount",modifier:At,base:0,visible:h.bought,unit:"/s"},{title:"Forest Size",modifier:f,base:10,visible:x.bought}]),lt=T(!1),Et=B(()=>u(ze,{modelValue:lt.value,"onUpdate:modelValue":F=>lt.value=F},{header:()=>u("h2",null,[e,g(" Modifiers")]),body:$n}));oe.on("update",F=>{if(a.lt(z.day.value,Qt))return;a.gte(he.value,re.value)?he.value=re.value:(he.value=a.add(he.value,F),Qe.isHolding.value&&Qe.onClick()),a.gte(Pe.value,qe.value)?Pe.value=qe.value:(Pe.value=a.add(Pe.value,F),Ke.isHolding.value&&Ke.onClick());const un=a.min(d.value,a.times(ne.value,F)),Ut=Ye.apply(un),cn=a.div(Ut,F);c.value=a.mul(cn,li).add(a.mul(c.value,a.dOne.sub(li))),i.value=a.add(i.value,Ut),l.value=a.add(l.value,un);const Ht=a.min(l.value,a.times(at.value,F));l.value=a.sub(l.value,Ht)}),Fe(()=>{z.day.value===Qt&&a.gte(s.value,o)&&z.completeDay()});const Lt=S(()=>a.sub(ne.value,at.value)),Gt=S(()=>a.sub(at.value,ne.value)),on=Dn(()=>({key:"c",description:'Press the "Cut trees" button.',onPress:()=>{Qe.canClick.value&&Qe.onClick()}})),En=Dn(()=>({key:"p",description:'Press the "Plant trees" button.',onPress:()=>{Ke.canClick.value&&Ke.onClick()}}));return{name:e,color:t,logs:i,totalLogs:s,trees:d,saplings:l,cutTree:Qe,plantTree:Ke,cutTreeHK:on,plantTreeHK:En,row1Upgrades:C,row2Upgrades:ue,row1Buyables:Ct,manualCutProgress:he,manualPlantProgress:Pe,generalTabCollapsed:$t,minWidth:700,display:B(()=>u(D,null,[u("div",null,[z.day.value===Qt?`Reach ${G(1e4)} ${i.displayName} to complete the day`:`${e} Complete!`," ",g("-")," ",u("button",{class:"button",style:"display: inline-block;",onClick:()=>lt.value=!0},[g("Check Modifiers")])]),ve(qt),ve(Et),u(Oe,null,null),u(Xt,{resource:i,color:t,style:"margin-bottom: 0",effectDisplay:a.gt(ne.value,0)?`expected: +${Y(Ye.apply(ne.value))}/s, average: +${Y(c.value)}/s (${Y(a.div(c.value,Ye.apply(ne.value)).mul(100))}% efficent)`:void 0},null),u(Xt,{resource:l,color:n,style:"margin-bottom: 0",effectDisplay:{[-1]:`${G(Lt.value)}/s`,0:void 0,1:`+${G(Lt.value)}/s`}[a.compare(Lt.value,0)]},null),u(Xt,{resource:d,color:n,style:"margin-bottom: 0",effectDisplay:{[-1]:`${G(Gt.value)}/s`,0:void 0,1:`+${G(Gt.value)}/s`}[a.compare(Gt.value,0)]},null),u(Oe,null,null),De(Qe,Ke),u("div",null,[g("Tip: You can hold down on actions to perform them automatically")]),u("div",null,[g("Note: your average log gain will be equal to your expected log gain if you have enough trees to support your chopping")]),u(Oe,null,null),De(...C),De(...ue),De(...Ct)]))}});var Oi="./assets/tree.35808197.png",Ri="./assets/sws.714ad454.png",qi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAFxGAABcRgEUlENBAAAAG3RFWHRTb2Z0d2FyZQBDZWxzeXMgU3R1ZGlvIFRvb2zBp+F8AAAMuElEQVR42u3dO4zkSAEG4L/Kr5me6dl1QkJAjkDiElJISAiO7CQSyCBHQis08QQrXUJISExKxCNBguQICJCIkBAZOqlmH0LbPW27CKa78XjtabddZVeV/z/ZXe12r11V39TDdllorcEwTHsEgTAMgTAMgTAMgTAMgTAMgTAMgTz5z4Ro/c+01oJVwSwaSBcOQmEWD6QPDiJhFgnkHBxEwiwKyBAcBMIQCIEwBDIcCJEwBEIgDIEQCEMgBMIQCIEwBOIQECJhggfCXoQhEAJhCIRAGAIhEIbxCQiRMARCIMySgXCYxRAIgTAEQiAMgRAIw/gEhEiY4IGwF2EIhEAYAiEQhkAIhGF8AkIkDIEQCLNkIBxmMQRCIAyBEAhDIATCMD4BIRImeCDsRRgCIRCGQAiEIRACYQjEJyBEwhAIgTBLBsJhFkMgBMIQCIEwBEIgDIH4BIRImOCBsBdhCIRAGAIhEIZACIQhEE7UGYZAGMYPIBxmMQRCIAyBEAhDIATCEAgn6gzjEBD2IgyBEAhDIATCEAiBMATCiTrDEAjD+AGEwyyGQAiEIRACYQiEQBgC4USdYRwCwl6EIRACYQiEQBgCIRCGQDhRZxgCYRg/gHCYxRAIgTAEQiAMgRAIQyCcqDME4hAQ9iIMgRAIQyAEwhCIs0CGfgeBMUEDsRGiIRD3DsoxJMRCIARCJK318Nz5ttVTaOVDIERitex9LysngRBJeGXua3k5C4RIwixr38qMQAhk8rL2qdw4xCKS2crah7LjJJ1IZi1v18uOFwoJZPYyz/P820qpLwgkQBwhIHGh3PM8/41S6jMCmaiSbm9fnfXv7+5eLxKJSz+U8jz/m1LqEwKxUEnngqhlB0AAkPtfi7u71wmBzAJkB+BzAL9USv2HQObHUQCo9jB0rTdJl9CLuDikzfN8A+AHSqnfEYiBShqBowJQ7mEcGvXh9zp0JKZw7H/qxwBwf38vDH3n35VS31w8EAM46o37nJR7IM3P16EMRuL80uXAcs/zvM/nxP39fTALILMBmRGHrgFpw1H/d+Lu7nXsK5JmGWutxZhyPwHko/M1DWWOcvUSyO3tq3rjPrfAqlrv0fX5Iz7fgNicV+R5fuxd9+Vz8hxtIJmyfGcBMhJH2VI5fQtL14ZYuu9nXUcyxWR7j6NZjr3Oz2ckkwMxgKOtYsSZSIoeFfykEQxBYrsCp1qFauAYFF+ReAPk9vbVrmVYJQYg0bVhlujTW9zevtq5dG1k6uVZE0BsIrEJZVIgI3HgxLCqfi2jAHBo0LLja4uxQ6g5Ks5XHL4i8QXIA9pXmXTHSoro+PeHv4vxuIw7yRzBRMXNcVHPNA7bQKz8QJoKyMjeQ7c09CYKWfv7LhyHHiOZsqGNrbRQcBCI4UquzTvaeouuIVcTSP1zwuZwykbFhYTDRySTABnRe1QNHBrdV79PZi4cQyttZhxDL8QGhcRZIHscBwBVA0l9Ut61kqX3KCI4knMrbUogtnuNqcF4A2Rk79HsIQ4XCWXHfOTQU0g4mHMqbUk4bKExsjjiIpAOHJ3l4DqMWkP8XCn18x5l9msAP1oiCpNQlgDk5DxjqqVagw3zT0qp77SU0wrAdwF8CuCnBsq9OJS9lBJpmsrdblcB0HEci4uLi8RmA+0LsOu7m5+fC4lVIANxoDEhb4OiXe8tTjScPwP4sVLqn/ty+iqAvwD4F4AbAN8a+v1SygKAllKiLMt6XUAIgTiORZqmMo5jaQPGOVhOfb8JJCED6UTiW6/RUukawKdKqd8KIb4B4PcAHgB8ZT/Puhrw1UWtzMVj29BHHFEUIU1TmWVZr0ULG6tM9Qbf9/uHfMYkEqeAnHo60MTGClNVSh8kWuufvXnz5ocAPsH/V+vSAeVcPG0P+ohCSikA6Kqq9Hq9TufCYaAuNAY+jOUkEAO9x+w4bA853r17V1ZVVWito9rw8axlaSllUVUVhHj8eBw/XuqpqkoLIbBer8+6a8AlHG1AhhxjnufXSqn/eg3EBRx9J5djG1Ge59hsNtXDw4Muy1I0hpHRmeVcRFEEIQS01ojjWMRxLJIkGTRHcw1IY1iKIb1InudfAvi+UuqvwQFxDYephpRlWVkUBfZAjh3CkOFVkiQyyzIRx/GouZmLOBpAxJjjzPP8a0qpfwc1xHJhaGWjUa1Wq+rDhw/Yl//gFbn9PANJkiDLMoQGpOvWl6km7E4DcR3HmMqK47gqimIUjn05I4oiXFxcIEmSoHA8VzdjjvesOxpcXcUyjSNN0w9XV1eXzYI9A0fbLfd638DFXA1MCAEpJW5ubkLuPYwec57nN0qp994B2SM57Ek1+kKglHKzX/LUUkq9Xq9XI76ueUdxs7JmuylSSokXL14QiIVexEUgFYBqzK3pQoiN1loeGrOUUqdpqi8vL1cjcOhnehQA0Pf397PcTp9lGVarVVBA9ntwtd2xbeyY+yBx7l6s29tX5dBb1GswjkunQogqSRJcXV1djG0seZ5XDSD1JdpZgAghsD+/SYHYmBs0cDw5TQIZn+3jfyeOJ34YWt3c3GSmGkoDyZOeZOph1mH+kWXZ5CtYNq4XPbNzo5hrmBUKkK14fOu9kFKiqqoDkCrLMnF5eZmYbCQtPQn2E3U5B5CxE3RbQPp+f489f8VccxGnH7k9I81tgQ6/VnmeJ6YbSEsvUv+eyZBEUWQEx8AyMHkqeiiOsVCWBOSj59SjKNI3NzexhcbRtYnEpEBevnx5vAcrUCDC5jksCUhzK1EhhNBxHIvr62srzz109SJLADICR9eKlDaBw1sgEyApmwUrpUQURTgFZCCOrnPRPgPpuUhhqqcQzwARtpEvEYhoTmDTNBWr1cr4CshzQKbqRQ6Tc9NAniuXATiab+/CM0B6v1JhynmIF1uP9kh9k4djpcRxjPV6bXwN/cSqyyS9iOkJ+gQx1ktM2YuECKTZiIQpGH2AmHpP34lyRBRFWK/XvuKwCsVbIBaRVF0FnSQJdrudsUo4tWZvG8hh84U0TXF5eekyCHHizwQyIRBjy4RnAPloRWaK3qPH8bnYW1iZkAcJxAKS5uvArO0p2+g9nAQyM5I+y7Xe9B4hANG2Ctq1oZVHUE6tVh3LqnbHLoEYRjLZioivOBwCcrKMTB7ngHvKcqXUG+eAGEQyKw6XgcyARA8tn7neg5jn+deVUv8IEYj1XF9fI0kS7SuOGcDoMeUzx94AeZ7/QSn1PSeBuIwkSRJUVYU4jrFarXQoQCxi0SbKY8wxjbgz4hcAvlBK/dE5IC4iOVxrONzGcXju4urqSoeCwzQU2xtd2z6Orsm6E0Bc7kkO+05VVQUp5fERVykl3r9/j1AypGHaeo59IJLBe/cSiIEepf4rAFRVhdAy5c6SlnoR40icAeLDpL0OxqVym7pxTrEDysA7h0cNfZ0H4hOSkDPFDveGkYxaPXsOiXDxJyGREMgZQDrvwzPxbIhwdahAJO4hmWNzuR5IjAJpIhEuj6WJhEB6HOOzd3KP7UWE65NNInECyOgJsMXjPPmow5gbGIUPqzFEMjsSZ4F0HeeigBCKO73IECC2X4pqemHBWyBE4sQwq9fkd+qVMAIhFGeAPNfoGnOC1tcX2AJSliU2mw2klNi//xFCiLPveggCCJFMDuQjJB1/1zZZ1mPnBVMmGCCE4hSQNiTNHqRXL0QghOIbkHM3WuhTDzaQGHnK1HkgQxr6k5MiFFNAxmyn9NFni6IQVVVBCIGHhwcUReHkXdFOAzHRuOtvmGIzH9V7jNpvbLfbHX+/3W6Pd0DvX3/NOcjcQyT2KtMD2W63xycwt9styrJEWZZenftigLSdMMGczmq1OrzzsPd7O7bbLaSUeHh4gNYaZVl6+1CZk0BsN9iTG4QRTHNi3jWXEG09RlEU0FpDa/1kaEUgHuDoi2TJcA6bVGRZhouLi15ANpsNiqKAEAK73e74pKXvK6OLBTIUyVKgSCkhpUSSJCeRFEWB7Xb7pLcI4ZKBcw9MzdHwzkWypOFXkiSIoqjt1QpProW8ffsWQHibVzgDZO5Gdw6SJQGRUj4ZcjX3BwNwXJkKbeOK2TdtcKmhEQjjBBBXGxeBMH3ag1UgLjcsAmH6tAVrQFxvVATC9GkHVoD40KAIhOnTBowDCQ0HgSwXh3EgIeIgkGXCWCSQoVfRiWR5MBYHZAwOIlkWCgIhEIIgEHsFRyhhNH4CsViwRBIWhEmAuNRwpixoYgkThxUgLjSYOQuaWAjE2cbiXPdMLF7jsA7EdsNxtVCJLJw6FKG+rXXpCfWuBgJhpob0EwC/IgwCYWbqgXweChMIwxAIwxAIwxAIwxAIwxAIwxAIwxAIw4Sa/wGDtUAHUuMNRQAAAABJRU5ErkJggg==",Vi="./assets/elf.9fbfa563.png";const z=Rt("main",function(){const e=Ee(1),t=T(!1),n=T(-1),i=T(""),s=T();function l(f){const d=Ee(!1);return Be(()=>{const _=f(),y=$e(_.shouldNotify);return{..._,opened:d,shouldNotify:y,[ft]:Qa,[mt]:function(){const{day:v,layer:h,symbol:w,opened:C,shouldNotify:R,story:le,completedStory:I}=this;return{day:v,symbol:w,opened:C,shouldNotify:R,onOpenLore(){var ue,be;const k=z.day.value>v-1;n.value=k?v-1:-1;const x=r((be=(ue=Se[h!=null?h:"trees"])==null?void 0:ue.name)!=null?be:"");i.value=k?`${x} - Completed!`:x,s.value=k?`${le}
${I}`:le,t.value=!0},onOpenLayer(){if(window.matchMedia("(min-width: 1468px)").matches)if(A.tabs.includes(h!=null?h:"trees")){const k=A.tabs.lastIndexOf(h!=null?h:"trees");A.tabs.splice(k,1)}else A.tabs.push(h!=null?h:"trees"),z.minimized.value=!0;else A.tabs.splice(1,1/0,h!=null?h:"trees")},onUnlockLayer(){C.value=!0,setTimeout(()=>{var k,x;n.value=-1,i.value=r((x=(k=Se[h!=null?h:"trees"])==null?void 0:k.name)!=null?x:""),s.value=le,A.devSpeed=null,t.value=!0},1e3)}}}}})}const o=[l(()=>({day:1,shouldNotify:!1,layer:"trees",symbol:Oi,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!",completedStory:"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!"})),l(()=>({day:2,shouldNotify:!1,layer:"workshop",symbol:Ri,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!",completedStory:"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!"})),l(()=>({day:3,shouldNotify:!1,layer:"coal",symbol:qi,story:"Santa tells you that unfortunately there are quite a few naughty children out there this year, and he's going to need you to gather as much coal as you can for him to give out.",completedStory:"Santa looks at all the coal 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!"})),l(()=>({day:4,shouldNotify:!1,layer:"elves",symbol:Vi,story:"Alright, it seems you finally have enough things setup to start bringing in the elves! Unfortunately, it seems they'll need to be retrained on how to help, since they're out of practice by 11 months!",completedStory:"The workshop now hums with the bustling elves working everything. They can take it from here - you deserve a break after such a long day! Good Job!"})),l(()=>({day:5,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:6,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:7,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:8,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:9,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:10,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:11,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:12,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:13,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:14,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:15,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:16,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:17,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:18,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:19,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:20,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:21,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:22,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:23,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:24,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""}))];function c(){n.value=e.value-1,i.value="Day Complete!",s.value=o[e.value-1].completedStory,t.value=!0,e.value++,z.minimized.value=!1,A.devSpeed=0}return{name:"Calendar",days:o,day:e,loreScene:n,loreTitle:i,loreBody:s,showLoreModal:t,completeDay:c,minWidth:700,display:B(()=>u(D,null,[A.devSpeed===0?u("div",null,[g("Game Paused")]):null,A.devSpeed&&A.devSpeed!==1?u("div",null,[g("Dev Speed: "),Y(A.devSpeed),g("x")]):null,A.offlineTime?u("div",null,[g("Offline Time: "),kn(A.offlineTime)]):null,u(Oe,null,null),u("div",{class:"advent"},[o.reduce((f,d)=>(f[f.length-1].length===4&&f.push([]),f[f.length-1].push(d),f),[[]]).map(f=>De(...f))])]))}}),Ll=e=>[z,ae,Te,me,ot],Wn=S(()=>!1);function Gl(e,t){["0.0","0.1","0.2"].includes(e!=null?e:"")&&(t.offlineProd=!1)}var Li=Object.freeze(Object.defineProperty({__proto__:null,main:z,getInitialLayers:Ll,hasWon:Wn,fixOldSave:Gl},Symbol.toStringTag,{value:"Module"}));const Ul={class:"scene"},Hl=["src"],jl=["src"],zl=["src"],Wl=["src"],Ql=L({__name:"Scene",props:{day:null},setup(e){return(t,n)=>(b(),M("div",Ul,[e.day>=0?(b(),M("img",{key:0,src:r(Oi),class:"scene-item",style:{left:"10%",bottom:"10%"}},null,8,Hl)):P("",!0),e.day>=1?(b(),M("img",{key:1,src:r(Ri),class:"scene-item",style:{left:"40%",bottom:"12%"}},null,8,jl)):P("",!0),e.day>=2?(b(),M("img",{key:2,src:r(qi),class:"scene-item",style:{left:"65%",bottom:"12%",width:"40px",height:"40px"}},null,8,zl)):P("",!0),e.day>=3?(b(),M("img",{key:3,src:r(Vi),class:"scene-item",style:{left:"52%",bottom:"12%"}},null,8,Wl)):P("",!0)]))}});var Kl=Z(Ql,[["__scopeId","data-v-080e23dc"]]);const Jl=L({components:{Context:Ei},props:{index:{type:Number,required:!0},tab:{type:Function,required:!0},display:{type:E(Object,String,Function),required:!0},minimized:{type:Object,required:!0},minWidth:{type:E(Number,String),required:!0},name:{type:E(String),required:!0},color:E(String),minimizable:E(Boolean),nodes:{type:Object,required:!0}},setup(e){const{display:t,index:n,minimized:i,minWidth:s,tab:l}=ke(e),o=$i(t),c=S(()=>Q.allowGoBack&&n.value>0&&!i.value);function f(){A.tabs.splice(r(e.index),1)}wt(()=>_(i.value,r(s.value))),je([i,ga(s)],([y,v])=>_(y,v));function d(y){e.nodes.value=y}function _(y,v){const h=typeof v=="number"||Number.isNaN(parseInt(v))?v+"px":v,w=l.value();w!=null&&(y?(w.style.flexGrow="0",w.style.flexShrink="0",w.style.width="60px",w.style.minWidth=w.style.flexBasis="",w.style.margin="0"):(w.style.flexGrow="",w.style.flexShrink="",w.style.width="",w.style.minWidth=w.style.flexBasis=h,w.style.margin=""))}return{component:o,showGoBack:c,updateNodes:d,unref:r,goBack:f}}});function Xl(e,t,n,i,s,l){const o=dt("Context");return b(),M("div",{class:"layer-container",style:ge({"--layer-color":e.unref(e.color)})},[e.showGoBack?(b(),M("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):P("",!0),e.minimized.value?(b(),M("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.minimized.value=!1)},[m("div",null,j(e.unref(e.name)),1)])):(b(),M("div",{key:2,class:pe(["layer-tab",{showGoBack:e.showGoBack}])},[u(o,{onUpdateNodes:e.updateNodes},{default:O(()=>[(b(),U(Ce(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(b(),M("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.minimized.value=!0)}," \u25BC ")):P("",!0)],4)}var Zl=Z(Jl,[["render",Xl],["__scopeId","data-v-0158bec3"]]);const Gi=e=>(nt("data-v-4b4bda40"),e=e(),it(),e),Yl=Gi(()=>m("h2",null,"Changelog",-1)),er=Gi(()=>m("details",{open:""},[m("summary",null,[g("v0.0 Initial Commit - "),m("time",null,"2021-09-04")]),g(" 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)),tr=L({__name:"Changelog",setup(e,{expose:t}){const n=T(!1);return t({open(){n.value=!0}}),(i,s)=>(b(),U(ze,{modelValue:n.value,"onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l)},{header:O(()=>[Yl]),body:O(()=>[er]),_:1},8,["modelValue"]))}});var nr=Z(tr,[["__scopeId","data-v-4b4bda40"]]),ir=L({props:{element:Object,display:{type:E(Object,String,Function),required:!0},style:E(Object,String,Array),classes:E(Object),direction:E(String),xoffset:E(String),yoffset:E(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=ke(e),s=T(!1),l=S(()=>(ye(i)||s.value)&&o.value),o=kt(n),c=Le(K(B(()=>{const _=ye(t);return _==null?"":Xe(_)})));function f(_){const y=i;_.shiftKey&&y&&(y.value=!y.value,_.stopPropagation(),_.preventDefault())}const d=S(()=>ye(i)&&an[ie.theme].showPin);return{Direction:J,isHovered:s,isShown:l,comp:o,elementComp:c,unref:r,togglePinned:f,showPin:d}}});const sr={key:0,class:"material-icons pinned"};function ar(e,t,n,i,s,l){return b(),M("div",{class:pe(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=o=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=o=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...o)=>e.togglePinned&&e.togglePinned(...o))},[Je(e.$slots,"default",{},void 0,!0),e.elementComp?(b(),U(Ce(e.elementComp),{key:0})):P("",!0),u(Nn,{name:"fade"},{default:O(()=>{var o;return[e.isShown?(b(),M("div",{key:0,class:pe(["tooltip",{top:e.unref(e.direction)===e.Direction.Up,left:e.unref(e.direction)===e.Direction.Left,right:e.unref(e.direction)===e.Direction.Right,bottom:e.unref(e.direction)===e.Direction.Down,...e.unref(e.classes)}]),style:ge([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(o=e.unref(e.style))!=null?o:{}])},[e.showPin?(b(),M("span",sr,"push_pin")):P("",!0),e.comp?(b(),U(Ce(e.comp),{key:1})):P("",!0)],6)):P("",!0)]}),_:1})],34)}var fe=Z(ir,[["render",ar],["__scopeId","data-v-6102fa3a"]]);const lr={class:"info-modal-header"},rr=["src","alt"],or={class:"info-modal-title"},ur={key:0},cr={key:0},dr={key:0},fr=m("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1),mr=m("br",null,null,-1),pr=m("br",null,null,-1),hr=["href"],gr=m("span",{class:"material-icons info-modal-discord"},"discord",-1),vr=m("div",null,[m("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link"},[m("span",{class:"material-icons info-modal-discord"},"discord"),g(" The Paper Pilot Community ")])],-1),yr=m("div",null,[m("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link"},[m("span",{class:"material-icons info-modal-discord"},"discord"),g(" The Modding Tree ")])],-1),br=m("br",null,null,-1);var _r=L({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:s,author:l,discordName:o,discordLink:c,versionNumber:f,versionTitle:d}=Q,_=ke(n),y=T(!1),v=S(()=>kn(A.timePlayed)),h=S(()=>K(B(()=>u(D,null,[Ci.map(ve)]))));t({open(){y.value=!0}});function w(){var C;(C=r(_.changelog))==null||C.open()}return(C,R)=>(b(),U(ze,{modelValue:y.value,"onUpdate:modelValue":R[0]||(R[0]=le=>y.value=le)},{header:O(()=>[m("div",lr,[r(s)?(b(),M("img",{key:0,class:"info-modal-logo",src:r(s),alt:r(i)},null,8,rr)):P("",!0),m("div",or,[m("h2",null,j(r(i)),1),m("h4",null,[g(" v"+j(r(f)),1),r(d)?(b(),M("span",ur,": "+j(r(d)),1)):P("",!0)])])])]),body:O(({shown:le})=>[le?(b(),M("div",cr,[r(l)?(b(),M("div",dr,"By "+j(r(l)),1)):P("",!0),fr,mr,m("div",{class:"link",onClick:w},"Changelog"),pr,m("div",null,[r(c)?(b(),M("a",{key:0,href:r(c),class:"info-modal-discord-link"},[gr,g(" "+j(r(o)),1)],8,hr)):P("",!0)]),vr,yr,br,m("div",null,"Time Played: "+j(r(v)),1),(b(),U(Ce(r(h))))])):P("",!0)]),_:1},8,["modelValue"]))}});const wr={class:"field"},Nr=L({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=S(()=>K(r(n.title)||"","span")),s=S({get(){return!!n.modelValue},set(l){t("update:modelValue",l)}});return(l,o)=>(b(),M("label",wr,[On(m("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":o[0]||(o[0]=c=>we(s)?s.value=c:null)},null,512),[[ts,r(s)]]),(b(),U(Ce(r(i))))]))}});var Dt=Z(Nr,[["__scopeId","data-v-2b109500"]]);const Ui=e=>(nt("data-v-1975661c"),e=e(),it(),e),kr=Ui(()=>m("div",{class:"header"},[m("h2",null,"Options")],-1)),Cr=Ui(()=>m("hr",null,null,-1));var Sr=L({__name:"Options",setup(e,{expose:t}){const n=T(!1);t({open(){n.value=!0}});const i=Object.keys(an).map(h=>({label:vi(h),value:h})),s=S(()=>K(B(()=>u(D,null,[ki.map(ve)])))),{showTPS:l,theme:o,unthrottled:c}=ke(ie),{autosave:f,offlineProd:d}=ke(A),_=S({get(){return A.devSpeed===0},set(h){A.devSpeed=h?0:null}});B(()=>u("span",null,[g("Offline Production"),u(fe,{display:"Save-specific"},{default:()=>[g("*")]})]));const y=B(()=>u("span",null,[g("Autosave"),u(fe,{display:"Save-specific"},{default:()=>[g("*")]})])),v=B(()=>u("span",null,[g("Pause game"),u(fe,{display:"Save-specific"},{default:()=>[g("*")]})]));return(h,w)=>(b(),U(ze,{modelValue:n.value,"onUpdate:modelValue":w[4]||(w[4]=C=>n.value=C)},{header:O(()=>[kr]),body:O(()=>[u(zn,{title:"Theme",options:r(i),modelValue:r(o),"onUpdate:modelValue":w[0]||(w[0]=C=>we(o)?o.value=C:null)},null,8,["options","modelValue"]),(b(),U(Ce(r(s)))),u(Dt,{title:"Show TPS",modelValue:r(l),"onUpdate:modelValue":w[1]||(w[1]=C=>we(l)?l.value=C:null)},null,8,["modelValue"]),Cr,u(Dt,{title:r(y),modelValue:r(f),"onUpdate:modelValue":w[2]||(w[2]=C=>we(f)?f.value=C:null)},null,8,["title","modelValue"]),r(Q).enablePausing?(b(),U(Dt,{key:0,title:r(v),modelValue:r(_),"onUpdate:modelValue":w[3]||(w[3]=C=>we(_)?_.value=C:null)},null,8,["title","modelValue"])):P("",!0)]),_:1},8,["modelValue"]))}});var Mr=Z(Sr,[["__scopeId","data-v-1975661c"]]);const Ir=["onSubmit"],Ar={class:"field"},$r={key:0,class:"field-title"},Er=["placeholder"],Pr=L({__name:"Text",props:{title:null,modelValue:null,textArea:{type:Boolean},placeholder:null,maxHeight:null,submitOnBlur:{type:Boolean}},emits:["update:modelValue","submit","cancel"],setup(e,{emit:t}){const n=e,i=kt(tt(n,"title"),"span"),s=Le(null);wn(()=>{var f;(f=s.value)==null||f.focus()});const l=S({get(){return r(n.modelValue)||""},set(f){t("update:modelValue",f)}});function o(){t("submit")}function c(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(f,d)=>(b(),M("form",{onSubmit:Zt(o,["prevent"])},[m("div",Ar,[r(i)?(b(),M("span",$r,[(b(),U(Ce(r(i))))])):P("",!0),e.textArea?(b(),U(r(os),{key:1,modelValue:r(l),"onUpdate:modelValue":d[0]||(d[0]=_=>we(l)?l.value=_:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:c,ref_key:"field",ref:s},null,8,["modelValue","placeholder","maxHeight"])):On((b(),M("input",{key:2,type:"text","onUpdate:modelValue":d[1]||(d[1]=_=>we(l)?l.value=_:null),placeholder:e.placeholder,class:pe({fullWidth:!e.title}),onBlur:c,ref_key:"field",ref:s},null,42,Er)),[[ns,r(l)]])])],40,Ir))}});var Hi=Z(Pr,[["__scopeId","data-v-67b44a54"]]);const Tr={key:0},xr=["onClick","disabled"],Fr={key:0},Br=["onClick"],Dr=L({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=ke(e),s=T(!1);je(s,c=>{t("confirmingChanged",c)});function l(){if(r(i.skipConfirm)){t("click");return}s.value&&t("click"),s.value=!s.value}function o(){s.value=!1}return(c,f)=>(b(),M("span",{class:pe(["container",{confirming:s.value}])},[s.value?(b(),M("span",Tr,"Are you sure?")):P("",!0),m("button",{onClick:Zt(l,["stop"]),class:"button danger",disabled:e.disabled},[s.value?(b(),M("span",Fr,"Yes")):Je(c.$slots,"default",{key:1},void 0,!0)],8,xr),s.value?(b(),M("button",{key:1,class:"button",onClick:Zt(o,["stop"])},"No",8,Br)):P("",!0)],2))}});var Or=Z(Dr,[["__scopeId","data-v-2f8ef34c"]]);const Rr=["onClick"],qr=L({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=T(!1),i=T(null);function s(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,wt(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(l,o)=>(b(),M("button",{onClick:Zt(s,["stop"]),class:pe(["feedback",{activated:n.value,left:e.left}])},[Je(l.$slots,"default",{},void 0,!0)],10,Rr))}});var Vr=Z(qr,[["__scopeId","data-v-01a1b95c"]]);const st=e=>(nt("data-v-5285ac49"),e=e(),it(),e),Lr=st(()=>m("div",{class:"handle material-icons"},"drag_handle",-1)),Gr={key:0,class:"actions"},Ur=st(()=>m("span",{class:"material-icons"},"content_paste",-1)),Hr=st(()=>m("span",{class:"material-icons"},"content_copy",-1)),jr=st(()=>m("span",{class:"material-icons"},"edit",-1)),zr=st(()=>m("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Wr={key:1,class:"actions"},Qr=st(()=>m("span",{class:"material-icons"},"check",-1)),Kr=st(()=>m("span",{class:"material-icons"},"close",-1)),Jr={key:2,class:"details"},Xr={class:"save-version"},Zr=st(()=>m("br",null,null,-1)),Yr={key:0},eo={key:1},to={key:3,class:"details"},no={key:4,class:"details error"},io=st(()=>m("br",null,null,-1)),so=L({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=ke(n),s=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),l=T(!1),o=T(!1),c=T("");je(l,()=>c.value=i.value.name||"");const f=S(()=>i.value&&i.value.id===A.id),d=S(()=>f.value?A.time:i.value&&i.value.time||0),_=$i(S(()=>{var v,h,w,C;return`Day ${(C=(w=(h=(v=i.value)==null?void 0:v.layers)==null?void 0:h.main)==null?void 0:w.day)!=null?C:1}`}));function y(){t("editName",c.value),l.value=!1}return(v,h)=>(b(),M("div",{class:pe(["save",{active:r(f)}])},[Lr,l.value?(b(),M("div",Wr,[m("button",{onClick:y,class:"button"},[u(fe,{display:"Save",direction:r(J).Left,class:"info"},{default:O(()=>[Qr]),_:1},8,["direction"])]),m("button",{onClick:h[5]||(h[5]=w=>l.value=!l.value),class:"button"},[u(fe,{display:"Cancel",direction:r(J).Left,class:"info"},{default:O(()=>[Kr]),_:1},8,["direction"])])])):(b(),M("div",Gr,[r(i).error==null&&!o.value?(b(),U(Vr,{key:0,onClick:h[0]||(h[0]=w=>t("export")),class:"button",left:""},{default:O(()=>[u(fe,{display:"Export",direction:r(J).Left,class:"info"},{default:O(()=>[Ur]),_:1},8,["direction"])]),_:1})):P("",!0),r(i).error==null&&!o.value?(b(),M("button",{key:1,onClick:h[1]||(h[1]=w=>t("duplicate")),class:"button"},[u(fe,{display:"Duplicate",direction:r(J).Left,class:"info"},{default:O(()=>[Hr]),_:1},8,["direction"])])):P("",!0),r(i).error==null&&!o.value?(b(),M("button",{key:2,onClick:h[2]||(h[2]=w=>l.value=!l.value),class:"button"},[u(fe,{display:"Edit Name",direction:r(J).Left,class:"info"},{default:O(()=>[jr]),_:1},8,["direction"])])):P("",!0),u(Or,{disabled:r(f),onClick:h[3]||(h[3]=w=>t("delete")),onConfirmingChanged:h[4]||(h[4]=w=>o.value=w)},{default:O(()=>[u(fe,{display:"Delete",direction:r(J).Left,class:"info"},{default:O(()=>[zr]),_:1},8,["direction"])]),_:1},8,["disabled"])])),r(i).error==null&&!l.value?(b(),M("div",Jr,[m("button",{class:"button open",onClick:h[6]||(h[6]=w=>t("open"))},[m("h3",null,j(r(i).name),1)]),m("span",Xr,"v"+j(r(i).modVersion),1),Zr,r(d)?(b(),M("div",Yr,"Last played "+j(r(s).format(r(d))),1)):P("",!0),r(_)?(b(),M("div",eo,[(b(),U(Ce(r(_))))])):P("",!0)])):r(i).error==null&&l.value?(b(),M("div",to,[u(Hi,{modelValue:c.value,"onUpdate:modelValue":h[7]||(h[7]=w=>c.value=w),class:"editname",onSubmit:y},null,8,["modelValue"])])):(b(),M("div",no,[g(" Error: Failed to load save with id "+j(r(i).id),1),io,g(j(r(i).error),1)]))],2))}});var ao=Z(so,[["__scopeId","data-v-5285ac49"]]);const Qn=e=>(nt("data-v-3b9991aa"),e=e(),it(),e),lo=Qn(()=>m("h2",null,"Saves Manager",-1)),ro={class:"modal-footer"},oo={class:"field"},uo=Qn(()=>m("span",{class:"field-title"},"Create Save",-1)),co={class:"field-buttons"},fo={class:"footer"},mo=Qn(()=>m("div",{style:{"flex-grow":"1"}},null,-1)),po=L({__name:"SavesManager",setup(e,{expose:t}){const n=T(!1),i=T(null);t({open(){n.value=!0}});const s=T(!1),l=T(""),o=T(null);je(l,I=>{I?wt(()=>{try{if(I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=ut.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I),s.value=!0;return}const k=JSON.parse(I);if(typeof k!="object"){s.value=!0;return}const x=mn();k.id=x,Ue(k),l.value="",s.value=!1,ie.saves.push(x)}catch{s.value=!0}}):s.value=!1});let c={},f=T(Object.keys(c).reduce((I,k)=>(I.push({label:k.split("/").slice(-1)[0].slice(0,-4),value:c[k]}),I),[]));const d=_n({});function _(I){if(d[I]==null){let k=localStorage.getItem(I);if(k==null)d[I]={error:"Save doesn't exist in localStorage",id:I};else if(k==="dW5kZWZpbmVk")d[I]={error:"Save is undefined",id:I};else try{if(k[0]!=="{")if(k[0]==="e")k=decodeURIComponent(escape(atob(k)));else if(k[0]==="\u1BE1")k=ut.decompressFromUTF16(k);else return console.warn("Unable to determine preset encoding",k),s.value=!0,d[I]={error:"Unable to determine preset encoding",id:I},d[I];d[I]={...JSON.parse(k),id:I}}catch(x){d[I]={error:x,id:I},console.warn(`SavesManager: Failed to load info about save with id ${I}: ${x} ${k}`)}}return d[I]}je(n,I=>{I&&Object.keys(d).forEach(k=>delete d[k])});const y=S(()=>ie.saves.reduce((I,k)=>(I[k]=_(k),I),{}));function v(I){let k;switch(A.id===I?k=_i(A[ce]):k=JSON.stringify(y.value[I]),Q.exportEncoding){default:console.warn(`Unknown save encoding: ${Q.exportEncoding}. Defaulting to lz`);case"lz":k=ut.compressToUTF16(k);break;case"base64":k=btoa(unescape(encodeURIComponent(k)));break;case"plain":break}const x=document.createElement("textarea");x.value=k,document.body.appendChild(x),x.select(),x.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(x)}function h(I){A.id===I&&Ue();const k={...y.value[I],id:mn()};Ue(k),ie.saves.push(k.id)}function w(I){ie.saves=ie.saves.filter(k=>k!==I),localStorage.removeItem(I),d[I]=void 0}function C(I){y.value[A.id].time=A.time,Ue(),d[A.id]=void 0,bt(y.value[I]),d[I]=void 0}function R(I){if(o.value=I,wt(()=>{o.value=null}),I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=ut.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I);return}const k=JSON.parse(I);k.id=mn(),Ue(k),ie.saves.push(k.id),C(k.id)}function le(I,k){const x=y.value[I];x&&(x.name=k,A.id===I?(A.name=k,Ue()):(Ue(x),d[I]=void 0))}return(I,k)=>(b(),U(ze,{modelValue:n.value,"onUpdate:modelValue":k[4]||(k[4]=x=>n.value=x),ref_key:"modal",ref:i},{header:O(()=>[lo]),body:O(({shown:x})=>[x?(b(),U(r(rs),{key:0,list:r(ie).saves,handle:".handle",itemKey:ue=>ue},{item:O(({element:ue})=>[u(ao,{save:r(y)[ue],onOpen:be=>C(ue),onExport:be=>v(ue),onEditName:be=>le(ue,be),onDuplicate:be=>h(ue),onDelete:be=>w(ue)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):P("",!0)]),footer:O(()=>[m("div",ro,[u(Hi,{modelValue:l.value,"onUpdate:modelValue":k[0]||(k[0]=x=>l.value=x),title:"Import Save",placeholder:"Paste your save here!",class:pe({importingFailed:s.value})},null,8,["modelValue","class"]),m("div",oo,[uo,m("div",co,[m("button",{class:"button",onClick:k[1]||(k[1]=x=>C(r(xt)().id))},"New Game"),Object.keys(r(f)).length>0?(b(),U(zn,{key:0,options:r(f),modelValue:o.value,"onUpdate:modelValue":k[2]||(k[2]=x=>R(x)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):P("",!0)])]),m("div",fo,[mo,m("button",{class:"button modal-default-button",onClick:k[3]||(k[3]=x=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var ji=Z(po,[["__scopeId","data-v-3b9991aa"]]);const Re=e=>(nt("data-v-4a3f8425"),e=e(),it(),e),ho=["src","alt"],go={key:1,class:"title"},vo=Re(()=>m("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),yo={class:"discord"},bo={class:"discord-links"},_o={key:0},wo=["href"],No=Re(()=>m("li",null,[m("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),ko=Re(()=>m("li",null,[m("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Co={href:"https://forums.moddingtree.com/",target:"_blank"},So=Re(()=>m("span",{class:"material-icons"},"forum",-1)),Mo=Re(()=>m("span",{class:"material-icons"},"info",-1)),Io=Re(()=>m("span",{class:"material-icons"},"library_books",-1)),Ao=Re(()=>m("span",{class:"material-icons"},"settings",-1)),$o=Re(()=>m("span",{class:"material-icons"},"library_books",-1)),Eo=Re(()=>m("span",{class:"material-icons"},"settings",-1)),Po=Re(()=>m("span",{class:"material-icons"},"info",-1)),To={href:"https://forums.moddingtree.com/",target:"_blank"},xo=Re(()=>m("span",{class:"material-icons"},"forum",-1)),Fo={class:"discord"},Bo={class:"discord-links"},Do={key:0},Oo=["href"],Ro=Re(()=>m("li",null,[m("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),qo=Re(()=>m("li",null,[m("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Vo=L({__name:"Nav",setup(e){const t=T(null),n=T(null),i=T(null),s=T(null),{useHeader:l,banner:o,title:c,discordName:f,discordLink:d,versionNumber:_}=Q;function y(){window.open(d,"mywindow")}return(v,h)=>(b(),M(D,null,[r(l)?(b(),M("div",Nt({key:0,class:"nav"},v.$attrs),[r(o)?(b(),M("img",{key:0,src:r(o),class:"banner",alt:r(c)},null,8,ho)):(b(),M("div",go,j(r(c)),1)),m("div",{onClick:h[0]||(h[0]=w=>{var C;return(C=s.value)==null?void 0:C.open()}),class:"version-container"},[u(fe,{display:"Changelog",direction:r(J).Down,class:"version"},{default:O(()=>[m("span",null,"v"+j(r(_)),1)]),_:1},8,["direction"])]),vo,m("div",yo,[m("span",{onClick:y,class:"material-icons"},"discord"),m("ul",bo,[r(d)?(b(),M("li",_o,[m("a",{href:r(d),target:"_blank"},j(r(f)),9,wo)])):P("",!0),No,ko])]),m("div",null,[m("a",Co,[u(fe,{display:"Forums",direction:r(J).Down,yoffset:"5px"},{default:O(()=>[So]),_:1},8,["direction"])])]),m("div",{onClick:h[1]||(h[1]=w=>{var C;return(C=t.value)==null?void 0:C.open()})},[u(fe,{display:"Info",direction:r(J).Down,class:"info"},{default:O(()=>[Mo]),_:1},8,["direction"])]),m("div",{onClick:h[2]||(h[2]=w=>{var C;return(C=n.value)==null?void 0:C.open()})},[u(fe,{display:"Saves",direction:r(J).Down,xoffset:"-20px"},{default:O(()=>[Io]),_:1},8,["direction"])]),m("div",{onClick:h[3]||(h[3]=w=>{var C;return(C=i.value)==null?void 0:C.open()})},[u(fe,{display:"Options",direction:r(J).Down,xoffset:"-66px"},{default:O(()=>[Ao]),_:1},8,["direction"])])],16)):(b(),M("div",Nt({key:1,class:"overlay-nav"},v.$attrs),[m("div",{onClick:h[4]||(h[4]=w=>{var C;return(C=s.value)==null?void 0:C.open()}),class:"version-container"},[u(fe,{display:"Changelog",direction:r(J).Right,xoffset:"25%",class:"version"},{default:O(()=>[m("span",null,"v"+j(r(_)),1)]),_:1},8,["direction"])]),m("div",{onClick:h[5]||(h[5]=w=>{var C;return(C=n.value)==null?void 0:C.open()})},[u(fe,{display:"Saves",direction:r(J).Right},{default:O(()=>[$o]),_:1},8,["direction"])]),m("div",{onClick:h[6]||(h[6]=w=>{var C;return(C=i.value)==null?void 0:C.open()})},[u(fe,{display:"Options",direction:r(J).Right},{default:O(()=>[Eo]),_:1},8,["direction"])]),m("div",{onClick:h[7]||(h[7]=w=>{var C;return(C=t.value)==null?void 0:C.open()})},[u(fe,{display:"Info",direction:r(J).Right},{default:O(()=>[Po]),_:1},8,["direction"])]),m("div",null,[m("a",To,[u(fe,{display:"Forums",direction:r(J).Right,xoffset:"7px"},{default:O(()=>[xo]),_:1},8,["direction"])])]),m("div",Fo,[m("span",{onClick:y,class:"material-icons"},"discord"),m("ul",Bo,[r(d)?(b(),M("li",Do,[m("a",{href:r(d),target:"_blank"},j(r(f)),9,Oo)])):P("",!0),Ro,qo])])],16)),u(_r,{ref_key:"info",ref:t,changelog:s.value},null,8,["changelog"]),u(ji,{ref_key:"savesManager",ref:n},null,512),u(Mr,{ref_key:"options",ref:i},null,512),u(nr,{ref_key:"changelog",ref:s},null,512)],64))}});var zi=Z(Vo,[["__scopeId","data-v-4a3f8425"]]);const Kn=e=>(nt("data-v-6f125a90"),e=e(),it(),e),Lo={class:"inner-tab"},Go={key:1},Uo=Kn(()=>m("br",null,null,-1)),Ho=g(" You can help continue the "),jo=Kn(()=>m("i",null,"advent",-1)),zo=g("ure at: "),Wo=Kn(()=>m("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link"},[m("span",{class:"material-icons info-modal-discord"},"discord"),g(" The Paper Pilot Community ")],-1)),Qo=L({__name:"Game",setup(e){const t=tt(A,"tabs"),n=S(()=>Object.keys(Se)),i=Q.useHeader,s=kt(z.loreBody);function l(o){const{display:c,minimized:f,minWidth:d,name:_,color:y,minimizable:v,nodes:h}=o;return{display:c,minimized:f,minWidth:d,name:_,color:y,minimizable:v,nodes:h}}return(o,c)=>(b(),M("div",{class:pe(["tabs-container",{useHeader:r(i)}])},[(b(!0),M(D,null,oi(r(t),(f,d)=>{var _,y;return b(),M("div",{key:d,class:pe(["tab",r((_=r(Se)[f])==null?void 0:_.classes)]),ref_for:!0,ref:`tab-${d}`,style:ge(r((y=r(Se)[f])==null?void 0:y.style))},[d===0&&!r(i)?(b(),U(zi,{key:0})):P("",!0),m("div",Lo,[r(n).includes(f)?(b(),U(Zl,Nt({key:0},l(r(Se)[f]),{index:d,tab:()=>{var v;return(v=o.$refs[`tab-${d}`])==null?void 0:v[0]}}),null,16,["index","tab"])):(b(),U(Ce(f),{key:1,index:d},null,8,["index"]))])],6)}),128)),u(ze,{modelValue:r(z).showLoreModal.value,"onUpdate:modelValue":c[0]||(c[0]=f=>r(z).showLoreModal.value=f)},{header:O(()=>[m("h2",null,j(r(z).loreTitle.value),1)]),body:O(()=>[r(s)?(b(),U(Ce(r(s)),{key:0})):P("",!0),r(z).loreScene.value!==-1?(b(),M("div",Go,[u(Kl,{day:r(z).loreScene.value},null,8,["day"]),Uo,Ho,jo,zo,Wo])):P("",!0)]),_:1},8,["modelValue"])],2))}});var Ko=Z(Qo,[["__scopeId","data-v-6f125a90"]]);const rn=e=>(nt("data-v-4a50ce42"),e=e(),it(),e),Jo={class:"game-over-modal-header"},Xo=["src","alt"],Zo={class:"game-over-modal-title"},Yo=rn(()=>m("h2",null,"Congratulations!",-1)),eu={key:0},tu=rn(()=>m("br",null,null,-1)),nu=rn(()=>m("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),iu=rn(()=>m("br",null,null,-1)),su=["href"],au=rn(()=>m("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),lu=L({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:s,versionNumber:l,versionTitle:o}=Q,c=S(()=>kn(A.timePlayed)),f=S(()=>Wn.value&&!A.keepGoing),d=tt(A,"autosave");function _(){A.keepGoing=!0}function y(){bt(xt())}return(v,h)=>(b(),U(ze,{"model-value":r(f)},{header:O(()=>[m("div",Jo,[r(n)?(b(),M("img",{key:0,class:"game-over-modal-logo",src:r(n),alt:r(t)},null,8,Xo)):P("",!0),m("div",Zo,[Yo,m("h4",null,"You've beaten "+j(r(t))+" v"+j(r(l))+": "+j(r(o)),1)])])]),body:O(({shown:w})=>[w?(b(),M("div",eu,[m("div",null,"It took you "+j(r(c))+" to beat the game.",1),tu,nu,iu,m("div",null,[m("a",{href:r(s),class:"game-over-modal-discord-link"},[au,g(" "+j(r(i)),1)],8,su)]),u(Dt,{title:"Autosave",modelValue:r(d),"onUpdate:modelValue":h[0]||(h[0]=C=>we(d)?d.value=C:null)},null,8,["modelValue"])])):P("",!0)]),footer:O(()=>[m("div",{class:"game-over-footer"},[m("button",{onClick:_,class:"button"},"Keep Going"),m("button",{onClick:y,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var ru=Z(lu,[["__scopeId","data-v-4a50ce42"]]);const In=e=>(nt("data-v-3de07c06"),e=e(),it(),e),ou=In(()=>m("div",{class:"nan-modal-header"},[m("h2",null,"NaN value detected!")],-1)),uu={key:0},cu=In(()=>m("br",null,null,-1)),du=["href"],fu=In(()=>m("span",{class:"material-icons nan-modal-discord"},"discord",-1)),mu=In(()=>m("br",null,null,-1)),pu={class:"nan-footer"},hu=L({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=Q,i=tt(A,"autosave"),s=tt(ee,"hasNaN"),l=T(null),o=S(()=>{var h;return(h=ee.NaNPath)==null?void 0:h.join(".")}),c=S(()=>{var h;return(h=ee.NaNPath)==null?void 0:h.slice(-1)[0]}),f=S(()=>ee.NaNReceiver&&c.value?ee.NaNReceiver[c.value]:null),d=S({get(){return A.devSpeed===0},set(h){A.devSpeed=h?null:0}});function _(){ee.NaNReceiver&&c.value&&(ee.NaNReceiver[c.value]=new a(0),ee.hasNaN=!1)}function y(){ee.NaNReceiver&&c.value&&(ee.NaNReceiver[c.value]=new a(1),ee.hasNaN=!1)}function v(){ee.NaNReceiver&&c.value&&(ee.NaNReceiver[c.value]=new a(NaN),ee.hasNaN=!1)}return(h,w)=>(b(),M(D,null,[u(ze,Nt({modelValue:r(s),"onUpdate:modelValue":w[4]||(w[4]=C=>we(s)?s.value=C:null)},h.$attrs),{header:O(()=>[ou]),body:O(()=>[m("div",null,[g(' Attempted to assign "'+j(r(o))+'" to NaN',1),r(f)?(b(),M("span",uu,j(" ")+"(previously "+j(r(Y)(r(f)))+")",1)):P("",!0),g(". Auto-saving has been "+j(r(i)?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),cu,m("div",null,[m("a",{href:r(n),class:"nan-modal-discord-link"},[fu,g(" "+j(r(t)),1)],8,du)]),mu,u(Dt,{title:"Autosave",modelValue:r(i),"onUpdate:modelValue":w[0]||(w[0]=C=>we(i)?i.value=C:null)},null,8,["modelValue"]),r(Q).enablePausing?(b(),U(Dt,{key:0,title:"Pause game",modelValue:r(d),"onUpdate:modelValue":w[1]||(w[1]=C=>we(d)?d.value=C:null)},null,8,["modelValue"])):P("",!0)]),footer:O(()=>[m("div",pu,[m("button",{onClick:w[2]||(w[2]=C=>{var R;return(R=l.value)==null?void 0:R.open()}),class:"button"},"Open Saves Manager"),m("button",{onClick:_,class:"button"},"Set to 0"),m("button",{onClick:y,class:"button"},"Set to 1"),r(f)&&r(a).neq(r(f),0)&&r(a).neq(r(f),1)?(b(),M("button",{key:0,onClick:w[3]||(w[3]=C=>s.value=!1),class:"button"}," Set to previous ")):P("",!0),m("button",{onClick:v,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),u(ji,{ref_key:"savesManager",ref:l},null,512)],64))}});var gu=Z(hu,[["__scopeId","data-v-3de07c06"]]);const vu={key:0,class:"tpsDisplay"},yu={key:0,class:"low"},bu=L({__name:"TPS",setup(e){const t=S(()=>a.div(ee.lastTenTicks.length,ee.lastTenTicks.reduce((l,o)=>l+o,0))),n=T([]);Fe(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=S(()=>n.value.reduce((l,o)=>a.max(l,o),0)),s=S(()=>a.sub(t.value,i.value).gt(1));return(l,o)=>r(t).isNan()?P("",!0):(b(),M("div",vu,[g(" TPS: "+j(r(G)(r(t)))+" ",1),u(Nn,{name:"fade"},{default:O(()=>[r(s)?(b(),M("span",yu,j(r(G)(r(i))),1)):P("",!0)]),_:1})]))}});var _u=Z(bu,[["__scopeId","data-v-46a3ed5b"]]);var wu=L({__name:"App",setup(e){const t=Q.useHeader,n=S(()=>an[ie.theme].variables),i=tt(ie,"showTPS"),s=S(()=>K(B(()=>u(D,null,[ma.map(ve)]))));return(l,o)=>(b(),M(D,null,[m("div",{id:"modal-root",style:ge(r(n))},null,4),m("div",{class:pe(["app",{useHeader:r(t)}]),style:ge(r(n))},[r(t)?(b(),U(zi,{key:0})):P("",!0),u(Ko),r(r(i))?(b(),U(_u,{key:1})):P("",!0),u(ru),u(gu),(b(),U(Ce(r(s))))],6)],64))}});var Nu=Z(wu,[["__scopeId","data-v-7c41425b"]]);function ku(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:s,onRegisterError:l}=e;let o,c;const f=async(d=!0)=>{d&&(o==null||o.addEventListener("controlling",_=>{_.isUpdate&&window.location.reload()})),c&&c.waiting&&await cs(c.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){o=new us("./sw.js",{scope:"./",type:"classic"}),o.addEventListener("activated",d=>{d.isUpdate||i==null||i()});{const d=()=>{n==null||n()};o.addEventListener("waiting",d),o.addEventListener("externalwaiting",d)}o.register({immediate:t}).then(d=>{c=d,s==null||s(d)}).catch(d=>{l==null||l(d)})}return f}function Cu(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:s,onRegisterError:l}=e,o=T(!1),c=T(!1);return{updateServiceWorker:ku({immediate:t,onNeedRefresh(){o.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:s,onRegisterError:l}),offlineReady:c,needRefresh:o}}document.title=Q.title;window.projInfo=Q;if(Q.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 oa();const{globalBus:e,startGameLoop:t}=await gn(()=>Promise.resolve().then(function(){return ra}),void 0),n=window.vue=is(Nu);e.emit("setupVue",n),n.mount("#app"),wt(()=>{const i=ci(),{updateServiceWorker:s}=Cu({onNeedRefresh(){i.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(){s()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(l){l&&setInterval(l.update,60*60*1e3)}})}),t()});