Advent-Incremental/assets/index.17d6a39f.js

19 lines
206 KiB
JavaScript

/* empty css */import"./vue.92681fcb.js";import{Z as C,l as Je,aa as X,t as O,ay as Zl,ar as dl,aE as b,a0 as N,aK as xt,a1 as f,O as E,aG as Ll,A as st,_ as z,a8 as o,b6 as H,b8 as en,bs as Xn,C as r,aq as cl,bu as Ml,bb as tn,T as Ha,a7 as c,u as ln,j as ja,bv as Fn,q as Dl,b1 as Pt,G as Qe,aC as Yn,w as Mt,b2 as _t,ao as Wa,I as Xe,J as ae,$ as P,aH as zt,aF as Kt,z as Ft,aN as Ue,al as jl,aL as ll,H as za,aJ as Zn,bn as Ka,br as Ja,be as Xa}from"./@vue.4ce677c2.js";import{c as ea}from"./nanoevents.1080beb7.js";import{L as Zt}from"./lz-string.731cedc5.js";import{i as Ya}from"./is-plain-object.906d88e8.js";import{Y as Za}from"./vue-next-select.a2bfab1d.js";import{s as ei,u as ta}from"./vue-toastification.6f567382.js";import{D as ti}from"./vuedraggable.7949458c.js";import{p as li}from"./vue-textarea-autosize.35804eaf.js";import{v as ni,n as ai}from"./workbox-window.8d14e8b7.js";import"./sortablejs.29100d8a.js";const ii=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))a(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function l(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerpolicy&&(s.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?s.credentials="include":i.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(i){if(i.ep)return;i.ep=!0;const s=l(i);fetch(i.href,s)}};ii();const oi="modulepreload",Tn={},si="./",Wl=function(t,l){return!l||l.length===0?t():Promise.all(l.map(a=>{if(a=`${si}${a}`,a in Tn)return;Tn[a]=!0;const i=a.endsWith(".css"),s=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${s}`))return;const u=document.createElement("link");if(u.rel=i?"stylesheet":oi,i||(u.as="script",u.crossOrigin=""),u.href=a,document.head.appendChild(u),i)return new Promise((d,m)=>{u.addEventListener("load",d),u.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>t())},ri="./projInfo-schema.json",ui="Advent Incremental",di="An incremental game you play a day at a time, leading up to Christmas!",ci="advent-incremental",mi="thepaperpilot and friends",pi="",fi="",gi="0.3",hi="Initial Commit",vi=!0,yi=!1,bi=2,wi=!0,Ci=null,_i="",ki=["main"],Ai=3600,Si=0,Ni=!0,Mi="base64";var Se={$schema:ri,title:ui,description:di,id:ci,author:mi,discordName:pi,discordLink:fi,versionNumber:gi,versionTitle:hi,allowGoBack:vi,defaultShowSmall:yi,defaultDecimalsShown:bi,useHeader:wi,banner:Ci,logo:_i,initialTabs:ki,maxTickLength:Ai,offlineLimit:Si,enablePausing:Ni,exportEncoding:Mi};const fn=17,Ii=9e15,Ei=Math.log10(9e15),Bi=1/9e15,xi=308,Di=-324,Rn=5,Pi=function(){const e=[];for(let l=Di+1;l<=xi;l++)e.push(Number("1e"+l));const t=323;return function(l){return e[l+t]}}(),sl=[2,Math.E,3,4,5,6,7,8,9,10],Fi=[[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]],Ti=[[-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]],v=function(t){return n.fromValue_noAlloc(t)},K=function(e,t,l){return n.fromComponents(e,t,l)},se=function(t,l,a){return n.fromComponents_noNormalize(t,l,a)},Yt=function(t,l){const a=l+1,i=Math.ceil(Math.log10(Math.abs(t))),s=Math.round(t*Math.pow(10,a-i))*Math.pow(10,i-a);return parseFloat(s.toFixed(Math.max(a-i,0)))},gn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Ri=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 l=.9189385332046727;l=l+(e+.5)*Math.log(e),l=l-e;const a=e*e;let i=e;return l=l+1/(12*i),i=i*a,l=l+1/(360*i),i=i*a,l=l+1/(1260*i),i=i*a,l=l+1/(1680*i),i=i*a,l=l+1/(1188*i),i=i*a,l=l+691/(360360*i),i=i*a,l=l+7/(1092*i),i=i*a,l=l+3617/(122400*i),Math.exp(l)/t},la=.5671432904097838,On=function(e,t=1e-10){let l,a;if(!Number.isFinite(e)||e===0)return e;if(e===1)return la;e<10?l=0:l=Math.log(e)-Math.log(Math.log(e));for(let i=0;i<100;++i){if(a=(e*Math.exp(-l)+l*l)/(l+1),Math.abs(a-l)<t*Math.abs(a))return a;l=a}throw Error(`Iteration failed to converge: ${e.toString()}`)};function Un(e,t=1e-10){let l,a,i,s;if(!Number.isFinite(e.mag)||e===n.dZero)return e;if(e===n.dOne)return v(la);n.abs(e),l=n.ln(e);for(let u=0;u<100;++u){if(a=n.exp(-l),i=l.sub(e.mul(a)),s=l.sub(i.div(l.add(1).sub(l.add(2).mul(i).div(n.mul(2,l).add(2))))),n.abs(s.sub(l)).lt(n.abs(s).mul(t)))return s;l=s}throw Error(`Iteration failed to converge: ${e.toString()}`)}const k=class{constructor(e){this.sign=Number.NaN,this.mag=Number.NaN,this.layer=Number.NaN,e instanceof k||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)}get m(){if(this.sign===0)return 0;if(this.layer===0){const e=Math.floor(Math.log10(this.mag));let t;return this.mag===5e-324?t=5:t=this.mag/Pi(e),this.sign*t}else if(this.layer===1){const e=this.mag-Math.floor(this.mag);return this.sign*Math.pow(10,e)}else return this.sign}set m(e){this.layer<=2?this.fromMantissaExponent(e,this.e):(this.sign=Math.sign(e),this.sign===0&&(this.layer,this.exponent))}get e(){return this.sign===0?0:this.layer===0?Math.floor(Math.log10(this.mag)):this.layer===1?Math.floor(this.mag):this.layer===2?Math.floor(Math.sign(this.mag)*Math.pow(10,Math.abs(this.mag))):this.mag*Number.POSITIVE_INFINITY}set e(e){this.fromMantissaExponent(this.m,e)}get s(){return this.sign}set s(e){e===0?(this.sign=0,this.layer=0,this.mag=0):this.sign=e}get mantissa(){return this.m}set mantissa(e){this.m=e}get exponent(){return this.e}set exponent(e){this.e=e}static fromComponents(e,t,l){return new k().fromComponents(e,t,l)}static fromComponents_noNormalize(e,t,l){return new k().fromComponents_noNormalize(e,t,l)}static fromMantissaExponent(e,t){return new k().fromMantissaExponent(e,t)}static fromMantissaExponent_noNormalize(e,t){return new k().fromMantissaExponent_noNormalize(e,t)}static fromDecimal(e){return new k().fromDecimal(e)}static fromNumber(e){return new k().fromNumber(e)}static fromString(e){return new k().fromString(e)}static fromValue(e){return new k().fromValue(e)}static fromValue_noAlloc(e){return e instanceof k?e:new k(e)}static abs(e){return v(e).abs()}static neg(e){return v(e).neg()}static negate(e){return v(e).neg()}static negated(e){return v(e).neg()}static sign(e){return v(e).sign}static sgn(e){return v(e).sign}static round(e){return v(e).round()}static floor(e){return v(e).floor()}static ceil(e){return v(e).ceil()}static trunc(e){return v(e).trunc()}static add(e,t){return v(e).add(t)}static plus(e,t){return v(e).add(t)}static sub(e,t){return v(e).sub(t)}static subtract(e,t){return v(e).sub(t)}static minus(e,t){return v(e).sub(t)}static mul(e,t){return v(e).mul(t)}static multiply(e,t){return v(e).mul(t)}static times(e,t){return v(e).mul(t)}static div(e,t){return v(e).div(t)}static divide(e,t){return v(e).div(t)}static recip(e){return v(e).recip()}static reciprocal(e){return v(e).recip()}static reciprocate(e){return v(e).reciprocate()}static cmp(e,t){return v(e).cmp(t)}static cmpabs(e,t){return v(e).cmpabs(t)}static compare(e,t){return v(e).cmp(t)}static isNaN(e){return e=v(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag)}static isFinite(e){return e=v(e),isFinite(e.sign)&&isFinite(e.layer)&&isFinite(e.mag)}static eq(e,t){return v(e).eq(t)}static equals(e,t){return v(e).eq(t)}static neq(e,t){return v(e).neq(t)}static notEquals(e,t){return v(e).notEquals(t)}static lt(e,t){return v(e).lt(t)}static lte(e,t){return v(e).lte(t)}static gt(e,t){return v(e).gt(t)}static gte(e,t){return v(e).gte(t)}static max(e,t){return v(e).max(t)}static min(e,t){return v(e).min(t)}static minabs(e,t){return v(e).minabs(t)}static maxabs(e,t){return v(e).maxabs(t)}static clamp(e,t,l){return v(e).clamp(t,l)}static clampMin(e,t){return v(e).clampMin(t)}static clampMax(e,t){return v(e).clampMax(t)}static cmp_tolerance(e,t,l){return v(e).cmp_tolerance(t,l)}static compare_tolerance(e,t,l){return v(e).cmp_tolerance(t,l)}static eq_tolerance(e,t,l){return v(e).eq_tolerance(t,l)}static equals_tolerance(e,t,l){return v(e).eq_tolerance(t,l)}static neq_tolerance(e,t,l){return v(e).neq_tolerance(t,l)}static notEquals_tolerance(e,t,l){return v(e).notEquals_tolerance(t,l)}static lt_tolerance(e,t,l){return v(e).lt_tolerance(t,l)}static lte_tolerance(e,t,l){return v(e).lte_tolerance(t,l)}static gt_tolerance(e,t,l){return v(e).gt_tolerance(t,l)}static gte_tolerance(e,t,l){return v(e).gte_tolerance(t,l)}static pLog10(e){return v(e).pLog10()}static absLog10(e){return v(e).absLog10()}static log10(e){return v(e).log10()}static log(e,t){return v(e).log(t)}static log2(e){return v(e).log2()}static ln(e){return v(e).ln()}static logarithm(e,t){return v(e).logarithm(t)}static pow(e,t){return v(e).pow(t)}static pow10(e){return v(e).pow10()}static root(e,t){return v(e).root(t)}static factorial(e,t){return v(e).factorial()}static gamma(e,t){return v(e).gamma()}static lngamma(e,t){return v(e).lngamma()}static exp(e){return v(e).exp()}static sqr(e){return v(e).sqr()}static sqrt(e){return v(e).sqrt()}static cube(e){return v(e).cube()}static cbrt(e){return v(e).cbrt()}static tetrate(e,t=2,l=se(1,0,1)){return v(e).tetrate(t,l)}static iteratedexp(e,t=2,l=se(1,0,1)){return v(e).iteratedexp(t,l)}static iteratedlog(e,t=10,l=1){return v(e).iteratedlog(t,l)}static layeradd10(e,t){return v(e).layeradd10(t)}static layeradd(e,t,l=10){return v(e).layeradd(t,l)}static slog(e,t=10){return v(e).slog(t)}static lambertw(e){return v(e).lambertw()}static ssqrt(e){return v(e).ssqrt()}static pentate(e,t=2,l=se(1,0,1)){return v(e).pentate(t,l)}static affordGeometricSeries(e,t,l,a){return this.affordGeometricSeries_core(v(e),v(t),v(l),a)}static sumGeometricSeries(e,t,l,a){return this.sumGeometricSeries_core(e,v(t),v(l),a)}static affordArithmeticSeries(e,t,l,a){return this.affordArithmeticSeries_core(v(e),v(t),v(l),v(a))}static sumArithmeticSeries(e,t,l,a){return this.sumArithmeticSeries_core(v(e),v(t),v(l),v(a))}static efficiencyOfPurchase(e,t,l){return this.efficiencyOfPurchase_core(v(e),v(t),v(l))}static randomDecimalForTesting(e){if(Math.random()*20<1)return se(0,0,0);const t=Math.random()>.5?1:-1;if(Math.random()*20<1)return se(t,0,1);const l=Math.floor(Math.random()*(e+1));let a=l===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(a=Math.trunc(a));let i=Math.pow(10,a);return Math.random()>.9&&(i=Math.trunc(i)),K(t,l,i)}static affordGeometricSeries_core(e,t,l,a){const i=t.mul(l.pow(a));return k.floor(e.div(i).mul(l.sub(1)).add(1).log10().div(l.log10()))}static sumGeometricSeries_core(e,t,l,a){return t.mul(l.pow(a)).mul(k.sub(1,l.pow(e))).div(k.sub(1,l))}static affordArithmeticSeries_core(e,t,l,a){const s=t.add(a.mul(l)).sub(l.div(2)),u=s.pow(2);return s.neg().add(u.add(l.mul(e).mul(2)).sqrt()).div(l).floor()}static sumArithmeticSeries_core(e,t,l,a){const i=t.add(a.mul(l));return e.div(2).mul(i.mul(2).plus(e.sub(1).mul(l)))}static efficiencyOfPurchase_core(e,t,l){return e.div(t).add(e.div(l))}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<Bi)return this.layer+=1,this.mag=Math.log10(this.mag),this;let e=Math.abs(this.mag),t=Math.sign(this.mag);if(e>=Ii)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e<Ei&&this.layer>0;)this.layer-=1,this.layer===0?this.mag=Math.pow(10,this.mag):(this.mag=t*Math.pow(10,e),e=Math.abs(this.mag),t=Math.sign(this.mag));return this.layer===0&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):this.mag===0&&(this.sign=0)),this}fromComponents(e,t,l){return this.sign=e,this.layer=t,this.mag=l,this.normalize(),this}fromComponents_noNormalize(e,t,l){return this.sign=e,this.layer=t,this.mag=l,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 w=parseFloat(t[0]),g=parseFloat(t[1]),_=t[1].split(";");let A=1;if(_.length===2&&(A=parseFloat(_[1]),isFinite(A)||(A=1)),isFinite(w)&&isFinite(g)){const x=k.pentate(w,g,A);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,this}}const l=e.split("^^");if(l.length===2){const w=parseFloat(l[0]),g=parseFloat(l[1]),_=l[1].split(";");let A=1;if(_.length===2&&(A=parseFloat(_[1]),isFinite(A)||(A=1)),isFinite(w)&&isFinite(g)){const x=k.tetrate(w,g,A);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,this}}const a=e.split("^");if(a.length===2){const w=parseFloat(a[0]),g=parseFloat(a[1]);if(isFinite(w)&&isFinite(g)){const _=k.pow(w,g);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,this}}e=e.trim().toLowerCase();let i,s,u=e.split("pt");if(u.length===2){i=10,s=parseFloat(u[0]),u[1]=u[1].replace("(",""),u[1]=u[1].replace(")","");let w=parseFloat(u[1]);if(isFinite(w)||(w=1),isFinite(i)&&isFinite(s)){const g=k.tetrate(i,s,w);return this.sign=g.sign,this.layer=g.layer,this.mag=g.mag,this}}if(u=e.split("p"),u.length===2){i=10,s=parseFloat(u[0]),u[1]=u[1].replace("(",""),u[1]=u[1].replace(")","");let w=parseFloat(u[1]);if(isFinite(w)||(w=1),isFinite(i)&&isFinite(s)){const g=k.tetrate(i,s,w);return this.sign=g.sign,this.layer=g.layer,this.mag=g.mag,this}}const d=e.split("e"),m=d.length-1;if(m===0){const w=parseFloat(e);if(isFinite(w))return this.fromNumber(w)}else if(m===1){const w=parseFloat(e);if(isFinite(w)&&w!==0)return this.fromNumber(w)}const p=e.split("e^");if(p.length===2){this.sign=1,p[0].charAt(0)=="-"&&(this.sign=-1);let w="";for(let g=0;g<p[1].length;++g){const _=p[1].charCodeAt(g);if(_>=43&&_<=57||_===101)w+=p[1].charAt(g);else return this.layer=parseFloat(w),this.mag=parseFloat(p[1].substr(g+1)),this.normalize(),this}}if(m<1)return this.sign=0,this.layer=0,this.mag=0,this;const y=parseFloat(d[0]);if(y===0)return this.sign=0,this.layer=0,this.mag=0,this;let h=parseFloat(d[d.length-1]);if(m>=2){const w=parseFloat(d[d.length-2]);isFinite(w)&&(h*=Math.sign(w),h+=gn(w))}if(!isFinite(y))this.sign=d[0]==="-"?-1:1,this.layer=m,this.mag=h;else if(m===1)this.sign=Math.sign(y),this.layer=1,this.mag=h+Math.log10(Math.abs(y));else if(this.sign=Math.sign(y),this.layer=m,m===2){const w=k.mul(K(1,2,h),v(y));return this.sign=w.sign,this.layer=w.layer,this.mag=w.mag,this}else this.mag=h;return this.normalize(),this}fromValue(e){return e instanceof k||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:Yt(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Yt(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<=Rn?(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):Yt(this.m,e)+"e"+Yt(this.e,e):this.layer===1?Yt(this.m,e)+"e"+Yt(this.e,e):this.layer<=Rn?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Yt(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Yt(this.mag,e)}abs(){return se(this.sign===0?0:1,this.layer,this.mag)}neg(){return se(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?k.dZero:this.layer===0?K(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?k.dZero:this.layer===0?K(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?k.dZero:this.layer===0?K(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?k.dZero:this.layer===0?K(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=v(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer)||this.sign===0)return t;if(t.sign===0)return this;if(this.sign===-t.sign&&this.layer===t.layer&&this.mag===t.mag)return se(0,0,0);let l,a;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(k.cmpabs(this,t)>0?(l=this,a=t):(l=t,a=this),l.layer===0&&a.layer===0)return v(l.sign*l.mag+a.sign*a.mag);const i=l.layer*Math.sign(l.mag),s=a.layer*Math.sign(a.mag);if(i-s>=2)return l;if(i===0&&s===-1){if(Math.abs(a.mag-Math.log10(l.mag))>fn)return l;{const u=Math.pow(10,Math.log10(l.mag)-a.mag),d=a.sign+l.sign*u;return K(Math.sign(d),1,a.mag+Math.log10(Math.abs(d)))}}if(i===1&&s===0){if(Math.abs(l.mag-Math.log10(a.mag))>fn)return l;{const u=Math.pow(10,l.mag-Math.log10(a.mag)),d=a.sign+l.sign*u;return K(Math.sign(d),1,Math.log10(a.mag)+Math.log10(Math.abs(d)))}}if(Math.abs(l.mag-a.mag)>fn)return l;{const u=Math.pow(10,l.mag-a.mag),d=a.sign+l.sign*u;return K(Math.sign(d),1,a.mag+Math.log10(Math.abs(d)))}}plus(e){return this.add(e)}sub(e){return this.add(v(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=v(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return se(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return se(this.sign*t.sign,0,1);let l,a;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(l=this,a=t):(l=t,a=this),l.layer===0&&a.layer===0)return v(l.sign*a.sign*l.mag*a.mag);if(l.layer>=3||l.layer-a.layer>=2)return K(l.sign*a.sign,l.layer,l.mag);if(l.layer===1&&a.layer===0)return K(l.sign*a.sign,1,l.mag+Math.log10(a.mag));if(l.layer===1&&a.layer===1)return K(l.sign*a.sign,1,l.mag+a.mag);if(l.layer===2&&a.layer===1){const i=K(Math.sign(l.mag),l.layer-1,Math.abs(l.mag)).add(K(Math.sign(a.mag),a.layer-1,Math.abs(a.mag)));return K(l.sign*a.sign,i.layer+1,i.sign*i.mag)}if(l.layer===2&&a.layer===2){const i=K(Math.sign(l.mag),l.layer-1,Math.abs(l.mag)).add(K(Math.sign(a.mag),a.layer-1,Math.abs(a.mag)));return K(l.sign*a.sign,i.layer+1,i.sign*i.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=v(e);return this.mul(t.recip())}divide(e){return this.div(e)}divideBy(e){return this.div(e)}dividedBy(e){return this.div(e)}recip(){return this.mag===0?k.dNaN:this.layer===0?K(this.sign,0,1/this.mag):K(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=v(e);return this.sign>t.sign?1:this.sign<t.sign?-1:this.sign*this.cmpabs(e)}cmpabs(e){const t=v(e),l=this.mag>0?this.layer:-this.layer,a=t.mag>0?t.layer:-t.layer;return l>a?1:l<a?-1:this.mag>t.mag?1:this.mag<t.mag?-1:0}compare(e){return this.cmp(e)}isNan(){return isNaN(this.sign)||isNaN(this.layer)||isNaN(this.mag)}isFinite(){return isFinite(this.sign)&&isFinite(this.layer)&&isFinite(this.mag)}eq(e){const t=v(e);return this.sign===t.sign&&this.layer===t.layer&&this.mag===t.mag}equals(e){return this.eq(e)}neq(e){return!this.eq(e)}notEquals(e){return this.neq(e)}lt(e){return this.cmp(e)===-1}lte(e){return!this.gt(e)}gt(e){return this.cmp(e)===1}gte(e){return!this.lt(e)}max(e){const t=v(e);return this.lt(t)?t:this}min(e){const t=v(e);return this.gt(t)?t:this}maxabs(e){const t=v(e);return this.cmpabs(t)<0?t:this}minabs(e){const t=v(e);return this.cmpabs(t)>0?t:this}clamp(e,t){return this.max(e).min(t)}clampMin(e){return this.max(e)}clampMax(e){return this.min(e)}cmp_tolerance(e,t){const l=v(e);return this.eq_tolerance(l,t)?0:this.cmp(l)}compare_tolerance(e,t){return this.cmp_tolerance(e,t)}eq_tolerance(e,t){const l=v(e);if(t==null&&(t=1e-7),this.sign!==l.sign||Math.abs(this.layer-l.layer)>1)return!1;let a=this.mag,i=l.mag;return this.layer>l.layer&&(i=gn(i)),this.layer<l.layer&&(a=gn(a)),Math.abs(a-i)<=t*Math.max(Math.abs(a),Math.abs(i))}equals_tolerance(e,t){return this.eq_tolerance(e,t)}neq_tolerance(e,t){return!this.eq_tolerance(e,t)}notEquals_tolerance(e,t){return this.neq_tolerance(e,t)}lt_tolerance(e,t){const l=v(e);return!this.eq_tolerance(l,t)&&this.lt(l)}lte_tolerance(e,t){const l=v(e);return this.eq_tolerance(l,t)||this.lt(l)}gt_tolerance(e,t){const l=v(e);return!this.eq_tolerance(l,t)&&this.gt(l)}gte_tolerance(e,t){const l=v(e);return this.eq_tolerance(l,t)||this.gt(l)}pLog10(){return this.lt(k.dZero)?k.dZero:this.log10()}absLog10(){return this.sign===0?k.dNaN:this.layer>0?K(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):K(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?k.dNaN:this.layer>0?K(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):K(this.sign,0,Math.log10(this.mag))}log(e){return e=v(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?k.dNaN:this.layer===0&&e.layer===0?K(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):k.div(this.log10(),e.log10())}log2(){return this.sign<=0?k.dNaN:this.layer===0?K(this.sign,0,Math.log2(this.mag)):this.layer===1?K(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?K(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):K(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?k.dNaN:this.layer===0?K(this.sign,0,Math.log(this.mag)):this.layer===1?K(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?K(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):K(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=v(e),l=this,a=t;if(l.sign===0)return a.eq(0)?se(1,0,1):l;if(l.sign===1&&l.layer===0&&l.mag===1)return l;if(a.sign===0)return se(1,0,1);if(a.sign===1&&a.layer===0&&a.mag===1)return l;const i=l.absLog10().mul(a).pow10();return this.sign===-1?Math.abs(a.toNumber()%2)%2===1?i.neg():Math.abs(a.toNumber()%2)%2===0?i:k.dNaN:i}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return k.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 K(1,0,t);if(e.sign===0)return k.dOne;e=se(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?K(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?K(-e.sign,e.layer+1,-e.mag):k.dOne}pow_base(e){return v(e).pow(this)}root(e){const t=v(e);return this.pow(t.recip())}factorial(){return this.mag<0?this.add(1).gamma():this.layer===0?this.add(1).gamma():this.layer===1?k.exp(k.mul(this,k.ln(this).sub(1))):k.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(se(1,0,24)))return v(Ri(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const l=e*e;let a=e,i=12*a,s=1/i,u=t+s;if(u===t||(t=u,a=a*l,i=360*a,s=1/i,u=t-s,u===t))return k.exp(t);t=u,a=a*l,i=1260*a;let d=1/i;return t=t+d,a=a*l,i=1680*a,d=1/i,t=t-d,k.exp(t)}else return this.layer===1?k.exp(k.mul(this,k.ln(this).sub(1))):k.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?k.dOne:this.layer===0&&this.mag<=709.7?v(Math.exp(this.sign*this.mag)):this.layer===0?K(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?K(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):K(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return v(Math.sqrt(this.sign*this.mag));if(this.layer===1)return K(1,2,Math.log10(this.mag)-.3010299956639812);{const e=k.div(se(this.sign,this.layer-1,this.mag),se(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=se(1,0,1)){if(e===1)return k.pow(this,t);if(e===0)return new k(t);if(this.eq(k.dOne))return k.dOne;if(this.eq(-1))return k.pow(this,t);if(e===Number.POSITIVE_INFINITY){const i=this.toNumber();if(i<=1.444667861009766&&i>=.06598803584531254){if(i>1.444667861009099)return new k(Math.E);const s=k.ln(this).neg();return s.lambertw().div(s)}else return i>1.444667861009766?new k(Number.POSITIVE_INFINITY):k.dNaN}if(this.eq(k.dZero)){let i=Math.abs((e+1)%2);return i>1&&(i=2-i),new k(i)}if(e<0)return k.iteratedlog(t,this,-e);t=v(t);const l=e;e=Math.trunc(e);const a=l-e;if(this.gt(k.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let i=0;i<e;++i){const s=t;if(t=this.pow(t),s.eq(t))return t}if(a!=0){const i=this.pow(t);return t.mul(1-a).add(i.mul(a))}return t}a!==0&&(t.eq(k.dOne)?this.gt(10)?t=this.pow(a):(t=v(k.tetrate_critical(this.toNumber(),a)),this.lt(2)&&(t=t.sub(1).mul(this.minus(1)).plus(1))):this.eq(10)?t=t.layeradd10(a):t=t.layeradd(a,this));for(let i=0;i<e;++i){if(t=this.pow(t),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(t.layer-this.layer>3)return se(t.sign,t.layer+(e-i-1),t.mag);if(i>1e4)return t}return t}iteratedexp(e=2,t=se(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return k.tetrate(e,-t,this);e=v(e);let l=v(this);const a=t;t=Math.trunc(t);const i=a-t;if(l.layer-e.layer>3){const s=Math.min(t,l.layer-e.layer-3);t-=s,l.layer-=s}for(let s=0;s<t;++s){if(l=l.log(e),!isFinite(l.layer)||!isFinite(l.mag))return l.normalize();if(s>1e4)return l}return i>0&&i<1&&(e.eq(10)?l=l.layeradd10(-i):l=l.layeradd(-i,e)),l}slog(e=10){if(e=v(e),e.lte(k.dZero)||e.eq(k.dOne))return k.dNaN;if(e.lt(k.dOne))return this.eq(k.dOne)?k.dZero:this.eq(k.dZero)?k.dNegOne:k.dNaN;if(this.mag<0||this.eq(k.dZero))return k.dNegOne;let t=0,l=v(this);if(l.layer-e.layer>3){const a=l.layer-e.layer-3;t+=a,l.layer-=a}for(let a=0;a<100;++a)if(l.lt(k.dZero))l=k.pow(e,l),t-=1;else{if(l.lte(k.dOne))return v(t+k.slog_critical(e.toNumber(),l.toNumber()));t+=1,l=k.log(l,e)}return v(t)}static slog_critical(e,t){return e>10?t-1:k.critical_section(e,t,Ti)}static tetrate_critical(e,t){return k.critical_section(e,t,Fi)}static critical_section(e,t,l){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let a=0,i=0;for(let d=0;d<sl.length;++d)if(sl[d]==e){a=l[d][Math.floor(t)],i=l[d][Math.ceil(t)];break}else if(sl[d]<e&&sl[d+1]>e){const m=(e-sl[d])/(sl[d+1]-sl[d]);a=l[d][Math.floor(t)]*(1-m)+l[d+1][Math.floor(t)]*m,i=l[d][Math.ceil(t)]*(1-m)+l[d+1][Math.ceil(t)]*m;break}const s=t-Math.floor(t);return a*(1-s)+i*s}layeradd10(e){e=k.fromValue_noAlloc(e).toNumber();const t=v(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 l=Math.trunc(e);e-=l,t.layer+=l}if(e<=-1){const l=Math.trunc(e);if(e-=l,t.layer+=l,t.layer<0)for(let a=0;a<100;++a){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 a=this.slog(t).toNumber()+e;return a>=0?k.tetrate(t,a):Number.isFinite(a)?a>=-1?k.log(k.tetrate(t,a+1),t):k.log(k.log(k.tetrate(t,a+2),t),t):k.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return v(On(this.toNumber()));if(this.layer===0)return v(On(this.sign*this.mag));if(this.layer===1)return Un(this);if(this.layer===2)return Un(this);if(this.layer>=3)return se(this.sign,this.layer-1,this.mag);throw"Unhandled behavior in lambertw()"}ssqrt(){if(this.sign==1&&this.layer>=3)return se(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=se(1,0,1)){t=v(t);const l=e;e=Math.trunc(e);const a=l-e;a!==0&&(t.eq(k.dOne)?(++e,t=new k(a)):this.eq(10)?t=t.layeradd10(a):t=t.layeradd(a,this));for(let i=0;i<e;++i){if(t=this.tetrate(t.toNumber()),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(i>10)return t}return t}sin(){return this.mag<0?this:this.layer===0?v(Math.sin(this.sign*this.mag)):se(0,0,0)}cos(){return this.mag<0?k.dOne:this.layer===0?v(Math.cos(this.sign*this.mag)):se(0,0,0)}tan(){return this.mag<0?this:this.layer===0?v(Math.tan(this.sign*this.mag)):se(0,0,0)}asin(){return this.mag<0?this:this.layer===0?v(Math.asin(this.sign*this.mag)):se(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?v(Math.acos(this.toNumber())):this.layer===0?v(Math.acos(this.sign*this.mag)):se(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?v(Math.atan(this.sign*this.mag)):v(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 k.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return k.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?se(Number.NaN,Number.NaN,Number.NaN):k.ln(this.add(1).div(v(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(k.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 n=k;n.dZero=se(0,0,0);n.dOne=se(1,0,1);n.dNegOne=se(-1,0,1);n.dTwo=se(1,0,2);n.dTen=se(1,0,10);n.dNaN=se(Number.NaN,Number.NaN,Number.NaN);n.dInf=se(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);n.dNegInf=se(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);n.dNumberMax=K(1,0,Number.MAX_VALUE);n.dNumberMin=K(1,0,Number.MIN_VALUE);const Oi=new n(1);function Al(e,t,l=!0){let a=n.log10(e).floor(),i=n.div(e,n.pow(10,a));i.toStringWithDecimalPlaces(t)==="10"&&(i=Oi,a=a.add(1));const s=a.gte(1e9)?Y(a,Math.max(Math.max(t,3),Se.defaultDecimalsShown)):a.gte(1e4)?zl(a,0):a.toStringWithDecimalPlaces(0);return l?i.toStringWithDecimalPlaces(t)+"e"+s:"e"+s}function zl(e,t){if(e==null)return"NaN";if(e=new n(e),e.mag<.001)return 0 .toFixed(t);const a=e.toStringWithDecimalPlaces(t).split(".");return a[0]=a[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),a.length==1?a[0]:a[0]+"."+a[1]}function na(e,t){return e==null?"NaN":(e=new n(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),Se.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Ui=new n("eeee1000"),$i=new n("e100000"),$n=new n("e1000"),aa=new n(1e9),qi=new n(1e6),Vi=new n(1e3),Gi=new n(.98),Li=new n(.001),ia=new n(0);function Y(e,t,l){if(t==null&&(t=Se.defaultDecimalsShown),l=l!=null?l:Se.defaultShowSmall,e=new n(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+Y(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Ui)){const a=e.slog();return a.gte(qi)?"F"+Y(a.floor()):n.pow(10,a.sub(a.floor())).toStringWithDecimalPlaces(3)+"F"+zl(a.floor(),0)}else{if(e.gte($i))return Al(e,0,!1);if(e.gte($n))return Al(e,0);if(e.gte(aa))return Al(e,t);if(e.gte(Vi))return zl(e,0);if(e.gte(Li)||!l)return na(e,t);if(e.eq(ia))return 0 .toFixed(t)}return e=oa(e),e.lt($n)?Al(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):Y(e,t)+"\u207B\xB9"}function J(e){return e=new n(e),e.sign<0?"-"+J(e.neg()):e.gte(aa)||e.lte(Gi)&&!e.eq(ia)?Y(e):Y(e,0)}function yn(e,t){return t==null&&(t=Se.defaultDecimalsShown),n.lt(e,0)?"-"+yn(n.neg(e),t):n.gt(e,2**51)?Y(n.div(e,31536e3))+"y":(e=new n(e).toNumber(),e<60?Y(e)+"s":e<3600?J(Math.floor(e/60))+"m "+Y(e%60,t)+"s":e<86400?J(Math.floor(e/3600))+"h "+J(Math.floor(e/60)%60)+"m "+J(e%60)+"s":e<31536e3?J(Math.floor(e/84600)%365)+"d "+J(Math.floor(e/3600)%24)+"h "+J(Math.floor(e/60)%60)+"m":J(Math.floor(e/31536e3))+"y "+J(Math.floor(e/84600)%365)+"d "+J(Math.floor(e/3600)%24)+"h")}function Qi(e,t,l){e=new n(e);let a=e.toStringWithDecimalPlaces(t);return new n(a).gte(l)&&(a=n.sub(l,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),a}function Hi(e,t){return Y(e,t,!0)}function oa(e){let t=n.log10(e).ceil();const l=n.div(e,n.pow(10,t));return t=t.neg(),e=new n(10).pow(t).times(l),e}function sa(e,t,l=n.dOne){let a=e[0][0],i=e[0][1];for(let s=1;s<e.length;s++)n.lt(e[s][0],a)&&(a=e[s][0],i=e[s][1]);return Y(n.times(a,l))+t+", limited by "+i}function ra(e){return{[-1]:`${Y(e)}/s`,0:"",1:`+${Y(e)}/s`}[n.compare(e,0)]}var ji=Object.freeze(Object.defineProperty({__proto__:null,default:n,exponentialFormat:Al,commaFormat:zl,regularFormat:na,format:Y,formatWhole:J,formatTime:yn,toPlaces:Qi,formatSmall:Hi,invertOOM:oa,formatLimit:sa,formatGain:ra},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:Wi,commaFormat:zi,regularFormat:Ki,format:ye,formatWhole:ce,formatTime:nn,toPlaces:Ji,formatSmall:Xi,formatLimit:ua,invertOOM:Yi,formatGain:Kl}=ji;window.Decimal=n;window.exponentialFormat=Wi;window.commaFormat=zi;window.regularFormat=Ki;window.format=ye;window.formatWhole=ce;window.formatTime=nn;window.toPlaces=Ji;window.formatSmall=Xi;window.formatLimit=ua;window.invertOOM=Yi;window.formatGain=Kl;function da(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function vn(e){return typeof e=="function"}var fe=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(fe||{});const Il=Symbol("DoNotCache");function $(e,t){const l=e[t];vn(l)&&l.length===0&&!l[Il]?e[t]=C(l.bind(e)):vn(l)&&(e[t]=l.bind(e),e[t][Il]=!0)}function at(e){return vn(e)&&!e[Il]&&(e=C(e)),e}const al=Symbol("Component"),il=Symbol("GatherProps");let Zi=0;function wl(e="feature-"){return e+Zi++}var et=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(et||{});function B(e){return e[Il]=!0,e}function F(e,t=2){return e?0:t}function it(e,t,l){e[t]===void 0&&l!=null&&(e[t]=l)}function ca(e,...t){const l=[],a=i=>{Object.keys(i).forEach(s=>{const u=i[s];u&&typeof u=="object"&&(t.includes(u.type)?l.push(u):!(u instanceof n)&&!Je(u)&&a(u))})};return a(e),l}const rl={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 bn=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(bn||{}),Pl={classic:rl,paper:{...rl,variables:{...rl.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:{...rl,variables:{...rl.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:{...rl,variables:{...rl.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const $e=ea();document.fonts.onloadingdone=()=>$e.emit("fontsLoaded");var eo=Object.freeze(Object.defineProperty({__proto__:null,globalBus:$e},Symbol.toStringTag,{value:"Module"}));var _e=(e,t)=>{const l=e.__vccOpts||e;for(const[a,i]of t)l[a]=i;return l};const to=X({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var y;const l=O({}),a=new ResizeObserver(d),i=O(null);Zl(()=>{const h=i.value;h!=null&&a.observe(h)});let s=!0,u=O((y=i.value)==null?void 0:y.getBoundingClientRect());function d(){s&&(s=!1,dl(()=>{var h;u.value=(h=i.value)==null?void 0:h.getBoundingClientRect(),Object.values(l.value).filter(w=>w).forEach(w=>w.rect=w.element.getBoundingClientRect()),t("updateNodes",l.value),s=!0}))}$e.on("fontsLoaded",d);const m={attributes:!1,childList:!0,subtree:!1};Ll(wn,(h,w)=>{const g=new MutationObserver(()=>p(h));g.observe(w,m),l.value[h]={element:w,observer:g,rect:w.getBoundingClientRect()},d()}),Ll(Cn,h=>{var w;(w=l.value[h])==null||w.observer.disconnect(),l.value[h]=void 0,d()}),Ll(_n,l),Ll(kn,u);function p(h){const w=l.value[h];w!=null&&(w.rect=w.element.getBoundingClientRect(),t("updateNodes",l.value))}return(h,w)=>(b(),N(E,null,[xt(h.$slots,"default",{},void 0,!0),f("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var ma=_e(to,[["__scopeId","data-v-2b1dc1bc"]]);const lo=["onPointerdown"],no={class:"modal-wrapper"},ao={class:"modal-container"},io={class:"modal-header"},oo=c(" default header "),so={class:"modal-body"},ro=c(" default body "),uo={class:"modal-footer"},co=f("div",{class:"modal-default-flex-grow"},null,-1),gt=X({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:l}){const i=st(e),s=C(()=>i.modelValue||d.value);function u(){l("update:modelValue",!1)}const d=O(!1),m=O(null),p=C(()=>{var y,h;return(h=(y=m.value)==null?void 0:y.nodes)!=null?h:null});return t({isOpen:s,nodes:p}),(y,h)=>(b(),z(Ha,{to:"#modal-root"},[o(tn,{name:"modal",onBeforeEnter:h[0]||(h[0]=w=>d.value=!0),onAfterLeave:h[1]||(h[1]=w=>d.value=!1)},{default:H(()=>[en(f("div",cl({class:"modal-mask",onPointerdown:Ml(u,["self"])},y.$attrs),[f("div",no,[f("div",ao,[f("div",io,[xt(y.$slots,"header",{shown:r(s)},()=>[oo])]),f("div",so,[o(ma,{ref_key:"contextRef",ref:m},{default:H(()=>[xt(y.$slots,"body",{shown:r(s)},()=>[ro])]),_:3},512)]),f("div",uo,[xt(y.$slots,"footer",{shown:r(s)},()=>[f("div",{class:"modal-default-footer"},[co,f("button",{class:"button modal-default-button",onClick:u}," Close ")])])])])])],16,lo),[[Xn,e.modelValue]])]),_:3})]))}}),wn=Symbol("RegisterNode"),Cn=Symbol("UnregisterNode"),_n=Symbol("Nodes"),kn=Symbol("Bounds"),ut=ln({});window.layers=ut;const vl={},Et=[];function Tt(e,t){return vt(()=>{const l={},a=l.emitter=ea();if(l.on=a.on.bind(a),l.emit=a.emit.bind(a),l.nodes=O({}),l.id=e,Et.push(e),vl[e]=new Set,l.minimized=ge(!1),Object.assign(l,t.call(l)),Et[Et.length-1]==null||Et[Et.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
Stack: ${Et}
Trying to pop ${l.id}`;return Et.pop(),$(l,"color"),$(l,"display"),$(l,"name"),it(l,"name",l.id),$(l,"minWidth"),it(l,"minWidth",600),$(l,"minimizable"),it(l,"minimizable",!0),l})}function pa(e,t){if(console.info("Adding layer",e.id),ut[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ut[e.id]);return}it(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ut[e.id]=e,$e.emit("addLayer",e,t.layers[e.id])}function mo(e){return ut[e]}function fa(e){console.info("Removing layer",e.id),$e.emit("removeLayer",e),ut[e.id]=void 0}function po(e){fa(e),pa(e,L)}function fo(e){const t=O(!1);return{openModal:()=>t.value=!0,modal:B(()=>o(gt,{modelValue:t.value,"onUpdate:modelValue":l=>t.value=l},{header:()=>o("h2",null,[r(e.name)]),body:r(e.display)}))}}$e.on("update",function(t){Object.values(ut).forEach(l=>{l==null||l.emit("preUpdate",t)}),Object.values(ut).forEach(l=>{l==null||l.emit("update",t)}),Object.values(ut).forEach(l=>{l==null||l.emit("postUpdate",t)})});var go=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:wn,UnregisterNodeInjectionKey:Cn,NodesInjectionKey:_n,BoundsInjectionKey:kn,layers:ut,persistentRefs:vl,addingLayers:Et,createLayer:Tt,addLayer:pa,getLayer:mo,removeLayer:fa,reloadLayer:po,setupLayerModal:fo},Symbol.toStringTag,{value:"Module"}));const An=Symbol("PersistentState"),tl=Symbol("DefaultValue"),Jl=Symbol("StackTrace"),ga=Symbol("Deleted"),El=Symbol("NonPersistent"),Sl=Symbol("SaveDataPath");function ho(){var e;return((e=new Error().stack)==null?void 0:e.split(`
`).slice(3,5).map(t=>t.trim()).join(`
`))||""}function ge(e){const t=Je(e)?e:O(e);t[An]=t,t[tl]=Je(e)?e.value:e,t[Jl]=ho(),t[ga]=!1;const l=C({get(){return t.value},set(a){t.value=a}});return l[tl]=t[tl],t[El]=l,t[Sl]=void 0,Et.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",t,`
Created at:
`+t[Jl]):vl[Et[Et.length-1]].add(t),t}function vo(e){return e&&typeof e=="object"&&An in e}function q(e){return e[El]}$e.on("addLayer",(e,t)=>{const l=[],a=(i,s=[])=>{let u=!1;return Object.keys(i).forEach(d=>{let m=i[d];if(m&&typeof m=="object")if(Ve in m&&(m=m[Ve]),vo(m)){if(u=!0,m[ga]){console.warn("Deleted persistent ref present in returned object. Ignoring...",m,`
Created at:
`+m[Jl]);return}vl[e.id].delete(m);const p=[e.id,...s,d];m[Sl]!=null&&JSON.stringify(p)!==JSON.stringify(m[Sl])&&console.error(`Persistent ref is being saved to \`${p.join(".")}\` when it's already present at \`${m[Sl].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,m),m[Sl]=p;const y=s.reduce((w,g)=>(g in w||(w[g]={}),w[g]),t),h=y[d];y[d]=m[An],ja(y)?h!=null?y[d]=h:y[d]=m[tl]:h!=null?y[d].value=h:y[d].value=m[tl]}else!(m instanceof n)&&!Je(m)&&!l.includes(m)&&(typeof m.type=="symbol"&&l.push(m),a(m,[...s,d])&&(Fn(m)&&!Fn(i)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",Ve in i?i[Ve]:i,d):u=!0))}),u};a(e[Ve]),vl[e.id].forEach(i=>{console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,i,`
Created at:
`+i[Jl])}),vl[e.id].clear()});const Ve=Symbol("ProxyState"),hl=Symbol("ProxyPath");function vt(e,t={}){const l=t;let a=!1;function i(){return a||(Object.assign(l,e(l)),a=!0),l}return new Proxy(l,{get(s,u){if(u===Ve)return i();const d=i()[u];return d&&typeof d=="object"&&El in d?d[El]:d},set(s,u,d){return i()[u]=d,!0},has(s,u){return u===Ve?!0:Reflect.has(i(),u)},ownKeys(){return Reflect.ownKeys(i())},getOwnPropertyDescriptor(s,u){return a||(Object.assign(l,e(l)),a=!0),Object.getOwnPropertyDescriptor(s,u)}})}var Le=window.state=ln({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const ha=Dl({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{},usingLog:!1});function va(e){return JSON.stringify(e,(t,l)=>r(l))}const ya={get(e,t){var a;if(t===Ve||t===hl)return e[t];const l=e[Ve][t];if(t!=="value"&&(Ya(l)||Array.isArray(l))){if(l!==((a=e[t])==null?void 0:a[Ve])){const i=[...e[hl],t];e[t]=new Proxy({[Ve]:l,[hl]:i},ya)}return e[t]}return l},set(e,t,l,a){if(!Le.hasNaN&&(typeof l=="number"&&isNaN(l)||l instanceof n&&(isNaN(l.sign)||isNaN(l.layer)||isNaN(l.mag)))){const i=e[Ve][t];if(!(typeof i=="number"&&isNaN(i)||i instanceof n&&(isNaN(i.sign)||isNaN(i.layer)||isNaN(i.mag))))throw ha.autosave=!1,Le.hasNaN=!0,Le.NaNPath=[...e[hl],t],Le.NaNReceiver=a,console.error("Attempted to set NaN value",[...e[hl],t],e[Ve]),"Attempted to set NaN value. See above for details"}return e[Ve][t]=l,!0},ownKeys(e){return Reflect.ownKeys(e[Ve])},has(e,t){return Reflect.has(e[Ve],t)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e[Ve],t)}};var L=window.player=new Proxy({[Ve]:ha,[hl]:["player"]},ya);function ba(e={}){return Object.assign({id:`${Se.id}-0`,name:"Default Save",tabs:Se.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:Se.id,modVersion:Se.versionNumber,layers:{}},e)}function Bt(e){const t=Zt.compressToUTF16(va(e!=null?e:L[Ve]));return localStorage.setItem((e!=null?e:L[Ve]).id,t),t}async function yo(){wo();try{let e=localStorage.getItem(Ge.active);if(e==null){await ul(yl());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Zt.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==Se.id){await ul(yl());return}t.id=Ge.active,await ul(t)}catch(e){console.error(`Failed to load save. Falling back to new save.
`,e),await ul(yl())}}function yl(){const e=Hl(),t=ba({id:e});return Bt(t),Ge.saves.push(e),t}function Hl(){let e,t=0;do e=`${Se.id}-${t++}`;while(localStorage.getItem(e));return e}const Sn=O(!1);async function ul(e){console.info("Loading save",e),Sn.value=!0;const{layers:t,removeLayer:l,addLayer:a}=await Wl(()=>Promise.resolve().then(function(){return go}),void 0),{fixOldSave:i,getInitialLayers:s}=await Wl(()=>Promise.resolve().then(function(){return rr}),void 0);for(const u in t){const d=t[u];d&&l(d)}s(e).forEach(u=>a(u,e)),e=ba(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,Se.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==Se.versionNumber&&i(e.modVersion,e),Object.assign(L,e),Ge.active=L.id,$e.emit("onLoad")}setInterval(()=>{L.autosave&&Bt()},1e3);window.onbeforeunload=()=>{L.autosave&&Bt()};window.save=Bt;const bo=window.hardReset=async()=>{await ul(yl())},Bl=Dl({active:"",saves:[],showTPS:!0,theme:bn.Nordic,unthrottled:!1});Pt(Bl,e=>{const t=Zt.compressToUTF16(JSON.stringify(e));localStorage.setItem(Se.id,t)},{deep:!0});var Ge=window.settings=Bl;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:bn.Nordic};$e.emit("loadSettings",e),Object.assign(Bl,e),bo()};function wo(){try{let e=localStorage.getItem(Se.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Zt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Bl,t)}$e.emit("loadSettings",Bl)}catch{}}const wa=Dl([]);function Co(e){wa.push(e)}const Ca=Dl([]);function _o(e){Ca.push(e)}const ko=Dl([]),Ao={class:"table"},bt=X({__name:"Column",setup(e){const t=C(()=>Pl[Ge.theme].mergeAdjacent);return(l,a)=>(b(),N("div",Ao,[f("div",{class:Qe(["col",{mergeAdjacent:r(t)}])},[xt(l.$slots,"default")],2)]))}}),So={class:"table"},xl=X({__name:"Row",setup(e){const t=C(()=>Pl[Ge.theme].mergeAdjacent);return(l,a)=>(b(),N("div",So,[f("div",{class:Qe(["row",{mergeAdjacent:r(t)}])},[xt(l.$slots,"default")],2)]))}});function Nn(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Wa(e)}function be(e,t="span"){return typeof e=="function"?X({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),X({template:e})):X({render:()=>({})}):e}function ne(e){if(Wt(e))return typeof e=="function"?e():be(e);const t=e[al];return o(t,e[il](),null)}function Ce(...e){let t;return o(xl,null,Nn(t=e.map(ne))?t:{default:()=>[t]})}function Nl(...e){let t;return o(bt,null,Nn(t=e.map(ne))?t:{default:()=>[t]})}function Dt(e){if(Wt(e))return typeof e=="function"?e():typeof e=="string"?o(E,null,[e]):o(e,null,null);const t=e[al];return o(t,e[il](),null)}function No(...e){let t;return o(bt,null,Nn(t=e.map(Dt))?t:{default:()=>[t]})}function Wt(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Il]===!0}function _a(e,t,l){const a=O(null),i=O(void 0);function s(m){a.value||(a.value=setInterval(d,250)),i.value=m,l&&(l.value=!0)}function u(){a.value&&(clearInterval(a.value),a.value=null),l&&(l.value=!1)}function d(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return Yn(u),{start:s,stop:u,handleHolding:d}}function Mo(e,t){const l=C(()=>e.filter(a=>r(a.visibility)===et.Visible&&t(a)));return{firstFeature:C(()=>l.value[0]),collapsedContent:B(()=>Nl(...l.value.slice(1))),hasCollapsedContent:C(()=>l.value.length>1)}}function Xl(e,t="div"){const l=Mt();return _t(()=>{l.value=be(tt(e),t)}),l}function nl(e,t="div"){const l=Mt(null);return _t(()=>{const a=tt(e);l.value=a==null?null:be(a,t)}),l}function Io(e){return C(()=>tt(e))}function tt(e){return r(r(e))}function V(...e){return e.includes(Object)||e.push(Object),e}const he=X({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,l)=>(b(),N("div",{style:Xe({width:e.width,height:e.height})},null,4))}});const Eo={},Bo={class:"notif"};function xo(e,t){return b(),N("div",Bo,"!")}var qn=_e(Eo,[["render",xo],["__scopeId","data-v-66323fd4"]]);const an=e=>(zt("data-v-9de19f28"),e=e(),Kt(),e),Do={key:0,class:"day feature dontMerge opened"},Po={class:"date"},Fo=c("Dec"),To=an(()=>f("br",null,null,-1)),Ro={class:"date"},Oo=c("Dec"),Uo=an(()=>f("br",null,null,-1)),$o=an(()=>f("div",{class:"doors"},null,-1)),qo={class:"date"},Vo=c("Dec"),Go=an(()=>f("br",null,null,-1)),Lo={key:0,class:"material-icons lock"},Qo={key:1,class:"timer"},Ho={key:2,class:"timer"},jo=X({__name:"Day",props:{day:null,symbol:null,layer:null,opened:null,recentlyUpdated:null,shouldNotify:null},emits:["openLore","openLayer","unlockLayer"],setup(e,{emit:t}){const l=e,a=C(()=>l.layer&&n.gte(j.day.value,l.day)&&new Date().getMonth()===11&&new Date().getDate()>=l.day);function i(){a.value&&t("unlockLayer")}return(s,u)=>e.opened.value?(b(),N("div",Do,[o(tn,{appear:"",name:"door"},{default:H(()=>[f("div",{class:"doors",onClick:u[0]||(u[0]=d=>t("openLayer"))},[f("div",Po,[Fo,To,c(ae(e.day),1)]),f("div",Ro,[Oo,Uo,c(ae(e.day),1)])])]),_:1}),f("div",{class:"icon",style:Xe({backgroundImage:`url(${e.symbol})`})},null,4),f("div",{class:"lore",onClick:u[1]||(u[1]=d=>t("openLore"))},"?"),r(e.shouldNotify)?(b(),z(qn,{key:0})):P("",!0)])):(b(),N("div",{key:1,class:Qe(["day feature dontMerge",{can:r(a),locked:!r(a),canOpen:r(a)}]),onClick:i},[$o,f("div",qo,[Vo,Go,c(ae(e.day),1)]),r(a)?P("",!0):(b(),N("div",Lo,"lock")),r(j).day.value===e.day&&!r(a)?(b(),N("div",Qo,ae(r(yn)(r(j).timeUntilNewDay.value,0)),1)):r(j).day.value===e.day&&e.layer==null?(b(),N("div",Ho,"NYI")):P("",!0),r(a)?(b(),z(qn,{key:3})):P("",!0)],2))}});var Wo=_e(jo,[["__scopeId","data-v-9de19f28"]]);const zo=X({__name:"Collapsible",props:{collapsed:null,display:null,content:null},setup(e){const t=e,l=Xl(Ft(t,"display")),a=Xl(Ft(t,"content"));return(i,s)=>(b(),z(bt,{class:"collapsible-container"},{default:H(()=>[f("button",{onClick:s[0]||(s[0]=u=>e.collapsed.value=!e.collapsed.value),class:"feature collapsible-toggle"},[(b(),z(Ue(r(l))))]),e.collapsed.value?P("",!0):(b(),z(Ue(r(a)),{key:0}))]),_:1}))}});var Ko=_e(zo,[["__scopeId","data-v-a72c16aa"]]);const Jo={key:0},Xo={key:0,class:"mark star"},Yo=["src"],Zo=X({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,l)=>e.mark?(b(),N("div",Jo,[e.mark===!0?(b(),N("div",Xo)):(b(),N("img",{key:1,class:"mark",src:e.mark},null,8,Yo))])):P("",!0)}});var on=_e(Zo,[["__scopeId","data-v-2207999f"]]);const es=X({__name:"Node",props:{id:null},setup(e){const l=st(e),a=jl(wn,()=>{}),i=jl(Cn,()=>{}),s=Mt(null),u=C(()=>s.value&&s.value.parentElement);return Pt([u,l.id],([d,m],[p,y])=>{p&&i(r(y)),d&&a(m,d)}),Yn(()=>i(r(l.id))),(d,m)=>(b(),N("div",{class:"node",ref_key:"node",ref:s},null,512))}});var Fl=_e(es,[["__scopeId","data-v-a48cb382"]]);const ts=X({props:{progress:{type:V(String,Object,Number),required:!0},width:{type:V(Number),required:!0},height:{type:V(Number),required:!0},direction:{type:V(String),required:!0},display:V(Object,String,Function),visibility:{type:V(Number),required:!0},style:V(Object,String,Array),classes:V(Object),borderStyle:V(Object,String,Array),textStyle:V(Object,String,Array),baseStyle:V(Object,String,Array),fillStyle:V(Object,String,Array),mark:V(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:on,Node:Fl},setup(e){const{progress:t,width:l,height:a,direction:i,display:s}=st(e),u=C(()=>{let p=t.value instanceof n?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(p,0),1))*100}),d=C(()=>{const p={width:tt(l)+.5+"px",height:tt(a)+.5+"px"};switch(r(i)){case fe.Up:p.clipPath=`inset(${u.value}% 0% 0% 0%)`,p.width=tt(l)+1+"px";break;case fe.Down:p.clipPath=`inset(0% 0% ${u.value}% 0%)`,p.width=tt(l)+1+"px";break;case fe.Right:p.clipPath=`inset(0% ${u.value}% 0% 0%)`;break;case fe.Left:p.clipPath=`inset(0% 0% 0% ${u.value} + '%)`;break;case fe.Default:p.clipPath="inset(0% 50% 0% 0%)";break}return p}),m=nl(s);return{normalizedProgress:u,barStyle:d,component:m,unref:r,Visibility:et}}});function ls(e,t,l,a,i,s){var m,p,y,h,w,g,_;const u=ll("MarkNode"),d=ll("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),N("div",{key:0,style:Xe([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(m=e.unref(e.style))!=null?m:{}]),class:Qe({bar:!0,...e.unref(e.classes)})},[f("div",{class:"overlayTextContainer border",style:Xe([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(p=e.unref(e.borderStyle))!=null?p:{}])},[e.component?(b(),N("span",{key:0,class:"overlayText",style:Xe(e.unref(e.textStyle))},[(b(),z(Ue(e.component)))],4)):P("",!0)],4),f("div",{class:"border",style:Xe([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(y=e.unref(e.style))!=null?y:{},(h=e.unref(e.baseStyle))!=null?h:{},(w=e.unref(e.borderStyle))!=null?w:{}])},[f("div",{class:"fill",style:Xe([e.barStyle,(g=e.unref(e.style))!=null?g:{},(_=e.unref(e.fillStyle))!=null?_:{}])},null,4)],4),o(u,{mark:e.unref(e.mark)},null,8,["mark"]),o(d,{id:e.id},null,8,["id"])],6)):P("",!0)}var ns=_e(ts,[["render",ls],["__scopeId","data-v-02d0d7b2"]]);const as=Symbol("Bar");function jt(e){return vt(()=>{const t=e();return t.id=wl("bar-"),t.type=as,t[al]=ns,$(t,"visibility"),it(t,"visibility",et.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[il]=function(){const{progress:l,width:a,height:i,direction:s,display:u,visibility:d,style:m,classes:p,borderStyle:y,textStyle:h,baseStyle:w,fillStyle:g,mark:_,id:A}=this;return{progress:l,width:a,height:i,direction:s,display:u,visibility:d,style:r(m),classes:p,borderStyle:y,textStyle:h,baseStyle:w,fillStyle:g,mark:_,id:A}},t})}var is=X({props:{display:{type:V(Object,String,Function),required:!0},visibility:{type:V(Number),required:!0},style:V(Object,String,Array),classes:V(Object),onClick:Function,onHold:Function,canClick:{type:V(Boolean),required:!0},small:Boolean,mark:V(Boolean,String),id:{type:String,required:!0},isHolding:Object},components:{Node:Fl,MarkNode:on},setup(e){const{display:t,onClick:l,onHold:a}=st(e),i=Mt("");_t(()=>{const d=tt(t);if(d==null){i.value="";return}if(Wt(d)){i.value=be(d);return}const m=be(d.title||"","h3"),p=be(d.description,"div");i.value=be(B(()=>o("span",null,[d.title?o("div",null,[o(m,null,null)]):null,o(p,null,null)])))});const{start:s,stop:u}=_a(l,a,e.isHolding);return{start:s,stop:u,comp:i,Visibility:et,unref:r}}});function os(e,t,l,a,i,s){var m;const u=ll("MarkNode"),d=ll("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),N("button",{key:0,style:Xe([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(m=e.unref(e.style))!=null?m:[]]),onClick:t[0]||(t[0]=(...p)=>e.onClick&&e.onClick(...p)),onMousedown:t[1]||(t[1]=(...p)=>e.start&&e.start(...p)),onMouseleave:t[2]||(t[2]=(...p)=>e.stop&&e.stop(...p)),onMouseup:t[3]||(t[3]=(...p)=>e.stop&&e.stop(...p)),onTouchstartPassive:t[4]||(t[4]=(...p)=>e.start&&e.start(...p)),onTouchendPassive:t[5]||(t[5]=(...p)=>e.stop&&e.stop(...p)),onTouchcancelPassive:t[6]||(t[6]=(...p)=>e.stop&&e.stop(...p)),class:Qe({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(),z(Ue(e.unref(e.comp)),{key:0})):P("",!0),o(u,{mark:e.unref(e.mark)},null,8,["mark"]),o(d,{id:e.id},null,8,["id"])],38)):P("",!0)}var ka=_e(is,[["render",os],["__scopeId","data-v-8cedd7da"]]);const ss=Symbol("Clickable");function Ct(e){return vt(()=>{var l;const t=(l=e==null?void 0:e())!=null?l:{};if(t.id=wl("clickable-"),t.type=ss,t[al]=ka,t.isHolding=O(!1),$(t,"visibility"),it(t,"visibility",et.Visible),$(t,"canClick"),it(t,"canClick",!0),$(t,"classes"),$(t,"style"),$(t,"mark"),$(t,"display"),t.onClick){const a=t.onClick.bind(t);t.onClick=function(i){r(t.canClick)&&a(i)}}if(t.onHold){const a=t.onHold.bind(t);t.onHold=function(){r(t.canClick)&&a()}}return t[il]=function(){const{display:a,visibility:i,style:s,classes:u,onClick:d,onHold:m,isHolding:p,canClick:y,small:h,mark:w,id:g}=this;return{display:a,visibility:i,style:r(s),classes:u,onClick:d,onHold:m,isHolding:p,canClick:y,small:h,mark:w,id:g}},t})}function ot(e,t="points",l=0,a=void 0){const i=Je(e)?e:ge(e);if(i.displayName=t,i.precision=l,i.small=a,!Je(e)){const s=i[El];s.displayName=t,s.precision=l,s.small=a}return i}function Vn(e){const t=ge(e.value);return Pt(e,l=>{Sn.value||n.gt(l,t.value)&&(t.value=l)}),t}function rs(e){const t=ge(e.value);return Pt(e,(l,a)=>{Sn.value||n.gt(l,a)&&(t.value=n.add(t.value,n.sub(l,a)))}),t}new n("10^^8");new n("1e100");function Tl(e,t){const l=t!=null?t:e.value;return n.eq(e.precision,0)?ce(e.small?l:n.floor(l)):ye(l,e.precision,e.small)}const us=["x1","y1","x2","y2"],ds=X({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const l=st(e),a=C(()=>{const s=l.startNode.value.rect,u=l.boundingRect.value,d=u?{x:s.x+s.width/2-u.x,y:s.y+s.height/2-u.y}:{x:0,y:0};return l.link.value.offsetStart&&(d.x+=l.link.value.offsetStart.x,d.y+=l.link.value.offsetStart.y),d}),i=C(()=>{const s=l.endNode.value.rect,u=l.boundingRect.value,d=u?{x:s.x+s.width/2-u.x,y:s.y+s.height/2-u.y}:{x:0,y:0};return l.link.value.offsetEnd&&(d.x+=l.link.value.offsetEnd.x,d.y+=l.link.value.offsetEnd.y),d});return(s,u)=>(b(),N("line",cl({"stroke-width":"15px",stroke:"white"},e.link,{x1:r(a).x,y1:r(a).y,x2:r(i).x,y2:r(i).y}),null,16,us))}});const cs=X({__name:"Links",props:{links:null},setup(e){var m;const l=Ft(e,"links"),a=O(null),i=jl(_n,O({})),s=jl(kn,O(void 0)),u=O((m=a.value)==null?void 0:m.getBoundingClientRect());Pt(s,()=>{var p;return u.value=(p=a.value)==null?void 0:p.getBoundingClientRect()}),Zl(()=>{var p;return u.value=(p=a.value)==null?void 0:p.getBoundingClientRect()});const d=C(()=>{var y,h;const p=i.value;return(h=(y=l.value)==null?void 0:y.filter(w=>{var g,_;return((g=p[w.startNode.id])==null?void 0:g.rect)&&((_=p[w.startNode.id])==null?void 0:_.rect)}))!=null?h:[]});return(p,y)=>(b(),N(E,null,[r(d)?(b(),N("svg",za(cl({key:0},p.$attrs)),[(b(!0),N(E,null,Zn(r(d),(h,w)=>(b(),z(ds,{key:w,link:h,boundingRect:u.value,startNode:r(i)[h.startNode.id],endNode:r(i)[h.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):P("",!0),f("div",{ref_key:"resizeListener",ref:a,class:"resize-listener"},null,512)],64))}});var ms=_e(cs,[["__scopeId","data-v-063f6d6b"]]);X({props:{nodes:{type:V(Array),required:!0},leftSideNodes:V(Array),rightSideNodes:V(Array),branches:V(Array)},components:{Links:ms},setup(e){const{nodes:t,leftSideNodes:l,rightSideNodes:a}=st(e),i=Mt();_t(()=>{const d=tt(t);i.value=be(B(()=>o(E,null,[d.map(m=>o("span",{class:"row tree-row",style:"margin: 50px auto;"},[m.map(Dt)]))])))});const s=Mt();_t(()=>{const d=tt(l);s.value=d?be(B(()=>o("span",{class:"left-side-nodes small"},[d.map(Dt)]))):""});const u=Mt();return _t(()=>{const d=tt(a);u.value=d?be(B(()=>o("span",{class:"side-nodes small"},[d.map(Dt)]))):""}),{unref:r,nodesComp:i,leftNodesComp:s,rightNodesComp:u}}});X({props:{display:V(Object,String,Function),visibility:{type:V(Number),required:!0},style:V(String,Object,Array),classes:V(Object),onClick:Function,onHold:Function,color:V(String),glowColor:V(String),canClick:{type:V(Boolean),required:!0},mark:V(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:on,Node:Fl},setup(e){const{onClick:t,onHold:l,display:a}=st(e),i=nl(a),{start:s,stop:u}=_a(t,l);return{start:s,stop:u,comp:i,unref:r,Visibility:et,isCoercableComponent:Wt}}});function ml(e){const t=[],l={};let a=!1;function i(){return a||(t.push(...e()),l.base=t.map(d=>at(d.base)),l.baseText=t.map(d=>at(d.baseText)),l.visible=t.map(d=>at(d.visible)),a=!0),t}const s=ge({});return[B(()=>{const d=i();let m=!0;const p=d.map((y,h)=>{var A,x,te;if(r(l.visible[h])===!1)return null;const w=o("h3",{onClick:()=>s.value[h]=!s.value[h],style:"cursor: pointer"},[o("span",{class:"modifier-toggle"+(r(s.value[h])?" collapsed":"")},[c("\u25BC")]),y.title,y.subtitle?o("span",{class:"subtitle"},[c(" ("),y.subtitle,c(")")]):null]),g=r(s.value[h])?null:o(E,null,[o("div",{class:"modifier-container"},[o("span",{class:"modifier-description"},[Dt((A=r(l.baseText[h]))!=null?A:"Base")]),o("span",{class:"modifier-amount"},[ye((x=r(l.base[h]))!=null?x:1),y.unit])]),Dt(r(y.modifier.description))]),_=!m;return m=!1,o(E,null,[_?o("br",null,null):null,o("div",null,[w,o("br",null,null),g,o("hr",null,null),o("div",{class:"modifier-container"},[o("span",{class:"modifier-description"},[c("Total")]),o("span",{class:"modifier-amount"},[ye(y.modifier.apply((te=r(l.base[h]))!=null?te:1)),y.unit])])])])});return o(E,null,[p])}),s]}function Yl(e){const t=Object.values(e).reverse(),l=ge(!0),a=C(()=>t.filter(m=>m.earned.value===!1)),{firstFeature:i,collapsedContent:s,hasCollapsedContent:u}=Mo(t,m=>m.earned.value),d=B(()=>{const m=[...a.value];return i.value&&m.push(i.value),No(...m,B(()=>en(o(Ko,{collapsed:l,content:s,display:l.value?"Show other completed milestones":"Hide other completed milestones"},null),[[Xn,r(u)]])))});return{collapseMilestones:l,display:d}}function pl(e){const t=rs(e.resource),l=()=>{var d,m;if(j.day.value!==e.day)return 1;let s=n.add(t.value,1),u=e.goal;return((m=(d=e.usingLog)==null?void 0:d.value)!=null?m:L.usingLog)&&(s=s.log10(),u=n.log10(u)),n.div(s,u)},a=jt(()=>({direction:fe.Right,width:600,height:25,fillStyle:{backgroundColor:e.color},textStyle:e.textColor?{color:e.textColor}:void 0,progress:l,display:B(()=>j.day.value===e.day?o(E,null,[J(t.value),c("/"),J(e.goal)]):"")})),i=B(()=>o(E,null,[o("div",null,[j.day.value===e.day?o(E,null,[c("Reach "),J(e.goal),c(" total "),e.resource.displayName,c(" to complete the day")]):o(E,null,[e.name,c(" Complete!")]),e.modal?o(E,null,[" ",c("-")," ",o("button",{class:"button",style:"display: inline-block;",onClick:()=>e.modal.show.value=!0},[c("Check Modifiers")])]):void 0]),ne(a),e.modal?ne(e.modal.display):void 0]));return _t(()=>{j.day.value===e.day&&n.gte(t.value,e.goal)&&j.completeDay()}),{total:t,trackerDisplay:i}}function Vt(e){var u;const t=(u=e.style)!=null?u:{minHeight:"20px",width:"40px",color:"var(--foreground)"},l=Ct(()=>({display:"0",style:t,canClick(){return n.gt(e.active.value,0)},onClick(){e.active.value=0}})),a=Ct(()=>({display:"-",style:t,canClick(){return n.gt(e.active.value,0)},onClick(){e.active.value=n.sub(e.active.value,1)}})),i=Ct(()=>({display:"+",style:t,canClick(){return n.lt(e.active.value,e.buyable.amount.value)},onClick(){e.active.value=n.add(e.active.value,1)}})),s=Ct(()=>({display:"Max",style:t,canClick(){return n.lt(e.active.value,e.buyable.amount.value)},onClick(){e.active.value=e.buyable.amount.value}}));return{min:l,remove:a,add:i,max:s}}const ps=Symbol("Buyable");function Be(e){const t=ge(0);return vt(()=>{var s,u,d;const l=e();if(l.canPurchase==null&&(l.resource==null||l.cost==null))throw console.warn("Cannot create buyable without a canPurchase property or a resource and cost property",l),"Cannot create buyable without a canPurchase property or a resource and cost property";l.id=wl("buyable-"),l.type=ps,l[al]=ka,l.amount=t,l.amount[tl]=(s=l.initialValue)!=null?s:0,l.canAfford=C(()=>{const m=l,p=r(m.cost);return m.resource!=null&&p!=null&&n.gte(m.resource.value,p)}),l.canPurchase==null&&(l.canPurchase=C(()=>r(l.visibility)===et.Visible&&r(l.canAfford)&&n.lt(l.amount.value,r(l.purchaseLimit)))),l.maxed=C(()=>n.gte(l.amount.value,r(l.purchaseLimit))),$(l,"classes");const a=l.classes;l.classes=C(()=>{const m=r(a)||{};return l.maxed.value&&(m.bought=!0),m}),$(l,"canPurchase"),l.canClick=l.canPurchase,l.onClick=l.purchase=(d=(u=l.onClick)!=null?u:l.purchase)!=null?d:function(){var y;const m=l;if(!r(m.canPurchase))return;const p=r(m.cost);m.cost!=null&&m.resource!=null&&(m.resource.value=n.sub(m.resource.value,p),m.amount.value=n.add(m.amount.value,1)),(y=m.onPurchase)==null||y.call(m,p)},$(l,"display");const i=l.display;return l.display=B(()=>{const m=r(i);if(Wt(m)){const p=be(m);return o(p,null,null)}if(m!=null&&l.cost!=null&&l.resource!=null){const p=l,y=be(m.title||"","h3"),h=be(m.description||""),w=be(m.effectDisplay||"");return o("span",null,[m.title?o("div",null,[o(y,null,null)]):null,m.description?o(h,null,null):null,m.showAmount===!1?null:o("div",null,[o("br",null,null),r(p.purchaseLimit)===n.dInf?o(E,null,[c("Amount: "),ce(p.amount.value)]):o(E,null,[c("Amount: "),ce(p.amount.value),c(" /")," ",ce(r(p.purchaseLimit))])]),m.effectDisplay?o("div",null,[o("br",null,null),c("Currently: "),o(w,null,null)]):null,p.cost&&!p.maxed.value?o("div",null,[c("Cost: "),ye(r(p.cost)||0)," ",l.resource.displayName]):null])}return""}),$(l,"visibility"),it(l,"visibility",et.Visible),$(l,"cost"),$(l,"resource"),$(l,"purchaseLimit"),it(l,"purchaseLimit",n.dInf),$(l,"style"),$(l,"mark"),$(l,"small"),l[il]=function(){const{display:m,visibility:p,style:y,classes:h,onClick:w,canClick:g,small:_,mark:A,id:x}=this;return{display:m,visibility:p,style:r(y),classes:h,onClick:w,canClick:g,small:_,mark:A,id:x}},l})}const sn=ln({}),Mn=Symbol("Hotkey");function bl(e){return vt(()=>{const t=e();return t.type=Mn,$(t,"enabled"),it(t,"enabled",!0),$(t,"description"),t})}$e.on("addLayer",e=>{ca(e,Mn).forEach(t=>{sn[t.key]=t})});$e.on("removeLayer",e=>{ca(e,Mn).forEach(t=>{sn[t.key]=void 0})});document.onkeydown=function(e){var a;if(((a=e.target)==null?void 0:a.tagName)==="INPUT"||Bn.value&&!L.keepGoing)return;let t=e.key;e.shiftKey&&(t="shift+"+t),e.ctrlKey&&(t="ctrl+"+t);const l=sn[t];l&&r(l.enabled)&&(e.preventDefault(),l.onPress())};_o(B(()=>{const e=Object.values(sn).filter(t=>r(t==null?void 0:t.enabled));return e.length===0?"":o("div",null,[o("br",null,null),o("h4",null,[c("Hotkeys")]),e.map(t=>o("div",null,[t==null?void 0:t.key,c(": "),t==null?void 0:t.description]))])}));const fs=X({__name:"Sticky",setup(e){const t=O("0"),l=new ResizeObserver(i),a=Mt(null);function i(){let s=a.value;if(s==null)return;let u=0;for(;s.previousSibling;){const d=s.previousSibling;d.dataset&&"vSticky"in d.dataset&&(u+=d.offsetHeight),s=d}t.value=u+"px"}return dl(i),document.fonts.ready.then(i),Zl(()=>{var u;const s=(u=a.value)==null?void 0:u.parentElement;s&&l.observe(s)}),(s,u)=>(b(),N("div",{class:"sticky",style:Xe({top:t.value}),ref_key:"element",ref:a,"data-v-sticky":""},[xt(s.$slots,"default",{},void 0,!0)],4))}});var gs=_e(fs,[["__scopeId","data-v-cccac690"]]);const Gn=X({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,l=C(()=>Tl(t.resource));return(a,i)=>(b(),N("h2",{style:Xe({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},ae(r(l)),5))}});const hs={class:"main-display"},vs={key:0},ys={key:1},bs=c(", "),ws={key:2},Cs=f("br",null,null,-1),_s={class:"main-display"},ks={key:0},As={key:1},Ss=c(", "),Ns={key:2},Ms=f("br",null,null,-1),kt=X({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null,productionDisplay:null,sticky:{type:Boolean,default:!0}},setup(e){const l=st(e),a=O(null),i=nl(l.effectDisplay),s=O(null),u=nl(l.productionDisplay),d=C(()=>n.lt(l.resource.value,"1e1000"));return(m,p)=>{var y,h;return e.sticky?(b(),z(gs,{key:0},{default:H(()=>{var w,g,_,A;return[f("div",{class:Qe(["main-display-container",(w=e.classes)!=null?w:{}]),style:Xe([{height:`${((_=(g=a.value)==null?void 0:g.$el.clientHeight)!=null?_:0)+50}px`},(A=e.style)!=null?A:{}])},[f("div",hs,[r(d)?(b(),N("span",vs,"You have ")):P("",!0),o(Gn,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),c(" "+ae(e.resource.displayName),1),r(i)?(b(),N("span",ys,[bs,(b(),z(Ue(r(i)),{ref_key:"effectRef",ref:a},null,512))])):P("",!0),r(u)?(b(),N("span",ws,[Cs,(b(),z(Ue(r(u)),{ref_key:"productionRef",ref:s},null,512))])):P("",!0)])],6)]}),_:1})):(b(),N("div",{key:1,class:Qe(["main-display-container",(y=e.classes)!=null?y:{}]),style:Xe([{height:"50px"},(h=e.style)!=null?h:{}])},[f("div",_s,[r(d)?(b(),N("span",ks,"You have ")):P("",!0),o(Gn,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),c(" "+ae(e.resource.displayName),1),r(i)?(b(),N("span",As,[Ss,(b(),z(Ue(r(i)),{ref_key:"effectRef",ref:a},null,512))])):P("",!0),r(u)?(b(),N("span",Ns,[Ms,(b(),z(Ue(r(u)),{ref_key:"productionRef",ref:s},null,512))])):P("",!0)])],6))}}});var Is=X({props:{display:{type:V(String,Object,Function),required:!0},visibility:{type:V(Number),required:!0},style:V(String,Object,Array),classes:V(Object),resource:Object,cost:V(String,Object,Number),canPurchase:{type:V(Boolean),required:!0},bought:{type:V(Boolean),required:!0},mark:V(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:Fl,MarkNode:on},setup(e){const{display:t,cost:l}=st(e),a=Mt("");return _t(()=>{const i=tt(t);if(i==null){a.value="";return}if(Wt(i)){a.value=be(i);return}const s=tt(l),u=be(i.title||"","h3"),d=be(i.description,"div"),m=be(i.effectDisplay||"");a.value=be(B(()=>{var p;return o("span",null,[i.title?o("div",null,[o(u,null,null)]):null,o(d,null,null),i.effectDisplay?o("div",null,[c("Currently: "),o(m,null,null)]):null,e.resource!=null&&i.showCost!==!1?o(E,null,[o("br",null,null),c("Cost: "),e.resource&&Tl(e.resource,s)," ",(p=e.resource)==null?void 0:p.displayName]):null])}))}),{component:a,unref:r,Visibility:et}}});const Es=["disabled"];function Bs(e,t,l,a,i,s){var m;const u=ll("MarkNode"),d=ll("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),N("button",{key:0,style:Xe([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(m=e.unref(e.style))!=null?m:{}]),onClick:t[0]||(t[0]=(...p)=>e.purchase&&e.purchase(...p)),class:Qe({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(),z(Ue(e.unref(e.component)),{key:0})):P("",!0),o(u,{mark:e.unref(e.mark)},null,8,["mark"]),o(d,{id:e.id},null,8,["id"])],14,Es)):P("",!0)}var xs=_e(Is,[["render",Bs],["__scopeId","data-v-7f411ac8"]]);const Ds=Symbol("Upgrade");function G(e){const t=ge(!1);return vt(()=>{const l=e();return l.id=wl("upgrade-"),l.type=Ds,l[al]=xs,l.canAfford==null&&(l.resource==null||l.cost==null)&&console.warn("Error: can't create upgrade without a canAfford property or a resource and cost property",l),l.bought=t,l.canAfford==null?l.canAfford=C(()=>{const a=l;return a.resource!=null&&a.cost!=null&&n.gte(a.resource.value,r(a.cost))}):$(l,"canAfford"),l.canPurchase=C(()=>r(l.visibility)===et.Visible&&r(l.canAfford)&&!r(l.bought)),l.purchase=function(){var i;const a=l;!r(a.canPurchase)||(a.resource!=null&&a.cost!=null&&(a.resource.value=n.sub(a.resource.value,r(a.cost))),t.value=!0,(i=a.onPurchase)==null||i.call(a))},$(l,"visibility"),it(l,"visibility",et.Visible),$(l,"classes"),$(l,"style"),$(l,"display"),$(l,"mark"),$(l,"cost"),$(l,"resource"),l[il]=function(){const{display:a,visibility:i,style:s,classes:u,resource:d,cost:m,canPurchase:p,bought:y,mark:h,id:w,purchase:g}=this;return{display:a,visibility:i,style:r(s),classes:u,resource:d,cost:m,canPurchase:p,bought:y,mark:h,id:w,purchase:g}},l})}function Z(e){return vt(()=>{const{addend:t,description:l,enabled:a}=e(),i=at(t),s=at(l),u=a==null?void 0:at(a);return{apply:d=>n.add(d,r(i)),revert:d=>n.sub(d,r(i)),enabled:u,description:l==null?void 0:B(()=>o("div",{class:"modifier-container"},[r(s)?o("span",{class:"modifier-description"},[Dt(r(s))]):null,o("span",{class:"modifier-amount"},[n.gte(r(i),0)?"+":"",ye(r(i))])]))}})}function I(e){return vt(()=>{const{multiplier:t,description:l,enabled:a}=e(),i=at(t),s=at(l),u=a==null?void 0:at(a);return{apply:d=>n.times(d,r(i)),revert:d=>n.div(d,r(i)),enabled:u,description:l==null?void 0:B(()=>o("div",{class:"modifier-container"},[r(s)?o("span",{class:"modifier-description"},[Dt(r(s))]):null,o("span",{class:"modifier-amount"},[c("\xD7"),ye(r(i))])]))}})}function Aa(e){return vt(()=>{const{exponent:t,description:l,enabled:a,supportLowNumbers:i}=e(),s=at(t),u=at(l),d=a==null?void 0:at(a);return{apply:m=>{let p=m;return i&&(p=n.add(p,1)),p=n.pow(p,r(s)),i&&(p=n.sub(p,1)),p},revert:m=>{let p=m;return i&&(p=n.add(p,1)),p=n.root(p,r(s)),i&&(p=n.sub(p,1)),p},enabled:d,description:l==null?void 0:B(()=>o("div",{class:"modifier-container"},[r(u)?o("span",{class:"modifier-description"},[Dt(r(u)),i?" (+1 effective)":null]):null,o("span",{class:"modifier-amount"},[c("^"),ye(r(s))])]))}})}function W(e){return vt(()=>{const t=e();return{apply:l=>t.filter(a=>r(a.enabled)!==!1).reduce((a,i)=>i.apply(a),l),revert:t.every(l=>l.revert!=null)?l=>t.filter(a=>r(a.enabled)!==!1).reduceRight((a,i)=>i.revert(a),l):void 0,enabled:C(()=>t.filter(l=>r(l.enabled)!==!1).length>0),description:B(()=>o(E,null,[t.filter(l=>r(l.enabled)!==!1).map(l=>r(l.description)).filter(l=>l).map(Dt)]))}})}function Sa(e){return vt(()=>{const t=e();return t.currentGain==null&&(t.currentGain=C(()=>{let l=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return l=n.floor(l).max(0),r(t.buyMax)||(l=l.min(1)),l})),t.actualGain==null&&(t.actualGain=t.currentGain),t.currentAt==null&&(t.currentAt=C(()=>{let l=t.scaling.currentAt(t);return t.roundUpCost&&(l=n.ceil(l)),l})),t.nextAt==null&&(t.nextAt=C(()=>{let l=t.scaling.nextAt(t);return t.roundUpCost&&(l=n.ceil(l)),l})),t.convert==null&&(t.convert=function(){var i;const l=r(t.currentGain),a=r(t.currentAt);t.gainResource.value=n.add(t.gainResource.value,l),t.spend(l,a),(i=t.onConvert)==null||i.call(t,l)}),t.spend==null&&(t.spend=function(){t.baseResource.value=0}),$(t,"currentGain"),$(t,"actualGain"),$(t,"currentAt"),$(t,"nextAt"),$(t,"buyMax"),it(t,"buyMax",!0),$(t,"roundUpCost"),it(t,"roundUpCost",!0),t})}function In(e,t){const l=at(e),a=at(t);return{currentGain(i){let s=r(i.baseResource.value);if(i.costModifier&&(s=i.costModifier.apply(s)),n.lt(s,r(l)))return 0;const u=n.div(s,r(l)).pow(r(a));return u.isNan()?new n(0):u},currentAt(i){let s=r(i.currentGain);return i.gainModifier&&(s=i.gainModifier.revert(s)),s=n.max(0,s).root(r(a)).times(r(l)),i.costModifier&&(s=i.costModifier.revert(s)),s},nextAt(i){let s=n.add(r(i.currentGain),1).floor();return i.gainModifier&&(s=i.gainModifier.revert(s)),s=n.max(0,s).root(r(a)).times(r(l)).max(r(l)),i.costModifier&&(s=i.costModifier.revert(s)),s}}}function Na(e){return Sa(e)}function Ps(e){return Sa(()=>{const t=e();return it(t,"buyMax",!1),t.currentGain==null&&(t.currentGain=C(()=>{let l=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return l=n.floor(l).max(t.gainResource.value),r(t.buyMax)||(l=l.min(n.add(t.gainResource.value,1))),l})),t.actualGain==null&&(t.actualGain=C(()=>{let l=n.sub(n.floor(t.scaling.currentGain(t)),t.gainResource.value).max(0);return r(t.buyMax)||(l=l.min(1)),l})),it(t,"convert",function(){var i;const l=r(t.actualGain),a=r(t.currentAt);t.gainResource.value=t.gainModifier?t.gainModifier.apply(r(t.currentGain)):r(t.currentGain),t.spend(l,a),(i=t.onConvert)==null||i.call(t,l)}),t})}const Fs="boxes",Ln=6,wt=Tt(Fs,function(){const e="Boxes",t="#964B00",l=ot(0,"boxes"),a=Na(()=>({scaling:In(1e10,1),baseResource:pe.logs,gainResource:q(l),roundUpCost:!0})),i=Ct(()=>({display:B(()=>o(E,null,[o("span",{style:"font-size: large"},[c("Create "),ce(a.currentGain.value),c(" "),l.displayName]),o("br",null,null),o("span",{style:"font-size: large"},[c("Cost:")," ",Tl(pe.logs,n.gte(a.actualGain.value,1)?a.currentAt.value:a.nextAt.value)," ",pe.logs.displayName])])),canClick:()=>n.gte(a.actualGain.value,1),onClick(){!r(this.canClick)||a.convert()},style:"width: 600px; min-height: unset"})),s=G(()=>({display:{title:"Carry logs in boxes",description:"Double log gain and unlock a new elf for training"},onPurchase(){j.days[3].recentlyUpdated.value=!0},resource:q(l),cost:100})),u=G(()=>({display:{title:"Carry ash in boxes",description:"Double ash gain and unlock a new elf for training"},onPurchase(){j.days[3].recentlyUpdated.value=!0},resource:q(l),cost:1e3})),d=G(()=>({display:{title:"Carry coal in boxes",description:"Double coal gain and unlock a new elf for training"},onPurchase(){j.days[3].recentlyUpdated.value=!0},resource:q(l),cost:4e3})),m={logsUpgrade:s,ashUpgrade:u,coalUpgrade:d},p=Be(()=>({display:{title:"Carry more logs",description:"Use boxes to carry even more logs, boosting their gain",effectDisplay:B(()=>o(E,null,[ye(n.div(p.amount.value,2).add(1)),c("x")]))},resource:q(l),cost(){return n.pow(3,p.amount.value).times(100)},visibility:()=>F(s.bought.value)})),y=Be(()=>({display:{title:"Carry more ash",description:"Use boxes to carry even more ash, boosting its gain",effectDisplay:B(()=>o(E,null,[ye(n.div(y.amount.value,2).add(1)),c("x")]))},resource:q(l),cost(){return n.pow(5,y.amount.value).times(1e3)},visibility:()=>F(u.bought.value)})),h=Be(()=>({display:{title:"Carry more coal",description:"Use boxes to carry even more coal, boosting its gain",effectDisplay:B(()=>o(E,null,[ye(n.div(h.amount.value,2).add(1)),c("x")]))},resource:q(l),cost(){return n.pow(7,h.amount.value).times(1e3)},visibility:()=>F(d.bought.value)})),w={logBoxesBuyable:p,ashBoxesBuyable:y,coalBoxesBuyable:h},{total:g,trackerDisplay:_}=pl({resource:l,goal:5e4,name:e,day:Ln,color:t});return{name:e,day:Ln,color:t,boxes:l,totalBoxes:g,boxesConversion:a,upgrades:m,buyables:w,minWidth:700,display:B(()=>o(E,null,[ne(_),o(he,null,null),o(kt,{resource:l,color:t,style:"margin-bottom: 0"},null),o(he,null,null),ne(i),o(he,null,null),Ce(...Object.values(m)),Ce(...Object.values(w))]))}});const Ts={class:"field"},Rs=X({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const l=e,a=C(()=>be(r(l.title)||"<span></span>","span")),i=C({get(){return!!l.modelValue},set(s){t("update:modelValue",s)}});return(s,u)=>(b(),N("label",Ts,[en(f("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":u[0]||(u[0]=d=>Je(i)?i.value=d:null)},null,512),[[Ka,r(i)]]),(b(),z(Ue(r(a))))]))}});var Ht=_e(Rs,[["__scopeId","data-v-33d57459"]]);const Os={class:"field"},Us={key:0,class:"field-title"},En=X({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var u;const l=e,a=nl(Ft(l,"title"),"span"),i=O((u=l.options.find(d=>d.value===l.modelValue))!=null?u:null);Pt(Ft(l,"modelValue"),d=>{var m;tt(i)!==d&&(i.value=(m=l.options.find(p=>p.value===d))!=null?m:null)});function s(d){t("update:modelValue",d.value)}return(d,m)=>(b(),N("div",Os,[r(a)?(b(),N("span",Us,[(b(),z(Ue(r(a))))])):P("",!0),o(r(Za),{options:e.options,modelValue:i.value,"onUpdate:modelValue":[m[0]||(m[0]=p=>i.value=p),s],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});var $s=X({props:{visibility:{type:V(Number),required:!0},display:{type:V(String,Object,Function),required:!0},style:V(String,Object,Array),classes:V(Object),earned:{type:V(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:Fl},setup(e){const{display:t}=st(e),l=Mt("");return _t(()=>{const a=tt(t);if(a==null){l.value="";return}if(Wt(a)){l.value=be(a);return}const i=be(a.requirement,"h3"),s=be(a.effectDisplay||"","b"),u=be(a.optionsDisplay||"","span");l.value=be(B(()=>o("span",null,[o(i,null,null),a.effectDisplay?o("div",null,[o(s,null,null)]):null,a.optionsDisplay?o("div",{class:"equal-spaced"},[o(u,null,null)]):null])))}),{comp:l,unref:r,Visibility:et}}});function qs(e,t,l,a,i,s){var d;const u=ll("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),N("div",{key:0,style:Xe([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(d=e.unref(e.style))!=null?d:{}]),class:Qe({feature:!0,milestone:!0,done:e.unref(e.earned),...e.unref(e.classes)})},[(b(),z(Ue(e.unref(e.comp)))),o(u,{id:e.id},null,8,["id"])],6)):P("",!0)}var Vs=_e($s,[["render",qs],["__scopeId","data-v-f4e8794e"]]);$e.on("setupVue",e=>e.use(ei));const Qn=ta(),Gs=Symbol("Milestone");let el;(function(e){e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none"})(el||(el={}));function Ne(e){const t=ge(!1);return vt(()=>{var i;const l=(i=e==null?void 0:e())!=null?i:{};l.id=wl("milestone-"),l.type=Gs,l[al]=Vs,l.earned=t,l.complete=function(){var u;const s=l;if(t.value=!0,(u=s.onComplete)==null||u.call(s),s.display&&r(s.showPopups)===!0){const d=r(s.display),m=be(Wt(d)?d:d.requirement);Qn(o(E,null,[o("h3",null,[c("Milestone earned!")]),o("div",null,[o(m,null,null)])]))}},$(l,"visibility"),it(l,"visibility",et.Visible);const a=l.visibility;if(l.visibility=C(()=>{const s=r(l.display);switch(Ge.msDisplay){default:case el.All:return r(a);case el.Configurable:return r(l.earned)&&!(s!=null&&typeof s=="object"&&"optionsDisplay"in s)?et.None:r(a);case el.Incomplete:return r(l.earned)?et.None:r(a);case el.None:return et.None}}),$(l,"style"),$(l,"classes"),$(l,"display"),$(l,"showPopups"),l[il]=function(){const{visibility:s,display:u,style:d,classes:m,earned:p,id:y}=this;return{visibility:s,display:u,style:r(d),classes:m,earned:p,id:y}},l.shouldEarn){const s=l;_t(()=>{var u,d;if(Ge.active===L.id&&!s.earned.value&&r(s.visibility)===et.Visible&&((u=s.shouldEarn)==null?void 0:u.call(s))&&(s.earned.value=!0,(d=s.onComplete)==null||d.call(s),s.display&&r(s.showPopups)===!0)){const m=r(s.display),p=be(Wt(m)?m:m.requirement);Qn(o(E,null,[o("h3",null,[c("Milestone earned!")]),o("div",null,[o(p,null,null)])]))}})}return l})}$e.on("loadSettings",e=>{it(e,"msDisplay",el.All)});const Ls=Object.values(el).map(e=>({label:da(e),value:e}));Co(B(()=>o(En,{title:"Show Milestones",options:Ls,"onUpdate:modelValue":e=>Ge.msDisplay=e,modelValue:Ge.msDisplay},null)));const Qs=Symbol("Reset");function Hs(e){return vt(()=>{const t=e();return t.id=wl("reset-"),t.type=Qs,t.reset=function(){var a;const l=i=>{if(i&&typeof i=="object")if(tl in i){const s=i;s.value=s[tl]}else!(i instanceof n)&&!Je(i)&&Object.values(i).forEach(s=>l(s))};r(t.thingsToReset).forEach(l),$e.emit("reset",t),(a=t.onReset)==null||a.call(t)},$(t,"thingsToReset"),t})}const Ql={};$e.on("removeLayer",e=>{var t;(t=Ql[e.id])==null||t.call(Ql),Ql[e.id]=void 0});const js="paper",Hn=5,Ae=Tt(js,function(){const e="Paper",t="#E8DCB8",l=ot(0,"paper"),a=ot(C(()=>n.min(n.div(pe.logs.value,1e9),n.div(U.ash.value,1e6))),"pulp"),i=Na(()=>({scaling:In(1,1.2),baseResource:a,gainResource:q(l),roundUpCost:!0,spend(ie,ee){pe.logs.value=n.sub(pe.logs.value,n.times(ee,1e9)),U.ash.value=n.sub(U.ash.value,n.times(ee,1e6))},gainModifier:te})),s=Ct(()=>({display:B(()=>{const ie=n.gte(i.actualGain.value,1)?i.currentAt.value:i.nextAt.value;return o(E,null,[o("span",{style:"font-size: large"},[c("Create "),ce(i.currentGain.value),c(" "),l.displayName]),o("br",null,null),o("span",{style:"font-size: large"},[c("Cost: "),Tl(pe.logs,ie),c(" "),a.displayName,c(" ("),ce(n.times(ie,1e9)),c(" "),pe.logs.displayName,c(";")," ",ce(n.times(ie,1e6)),c(" "),U.ash.displayName,c(")")])])}),canClick:()=>n.gte(i.actualGain.value,1),onClick(){!r(this.canClick)||i.convert()},style:"width: 600px; min-height: unset"}));function u(ie){const ee=Be(()=>({...ie,display:{title:ie.name,description:`Print a copy of "${ie.name}", which ${ie.elfName} will use to improve their skills! Each copy printed will reduce the "${ie.buyableName}" price scaling by 0.95x and make ${ie.elfName} purchase +10% faster!`,effectDisplay:B(()=>o(E,null,[ye(n.pow(.95,ee.amount.value)),c("x price scaling,")," ",ye(n.div(ee.amount.value,10).add(1)),c("x auto-purchase speed")])),showAmount:!1},resource:q(l),cost:()=>n.pow(5,ee.amount.value).times(10),style:"width: 600px"}));return ee}const d=u({name:"Now You're Logging!",elfName:"Holly",buyableName:"Generic Cutters"}),m=u({name:"The Man Who Planted Trees",elfName:"Ivy",buyableName:"Generic Planters"}),p=u({name:"Logjam",elfName:"Hope",buyableName:"Expand Forest"}),y=u({name:"Fahrenheit 451",elfName:"Jack",buyableName:"Heated Cutters"}),h=u({name:"Tillamook Burn Country",elfName:"Mary",buyableName:"Heated Planters"}),w=u({name:"The Garden Tree's Handbook",elfName:"Noel",buyableName:"Fertilized Soil"}),g=u({name:"Firestarter",elfName:"Joy",buyableName:"Small Fire",visibility:()=>F(Ke.elves.smallFireElf.bought.value)}),_=u({name:"An Arsonist's Guide to Writer's Homes in New England",elfName:"Faith",buyableName:"Bonfire",visibility:()=>F(Ke.elves.bonfireElf.bought.value)}),A=u({name:"Little Fires Everywhere",elfName:"Snowball",buyableName:"Kiln",visibility:()=>F(Ke.elves.kilnElf.bought.value)}),x={cuttersBook:d,plantersBook:m,expandersBook:p,heatedCuttersBook:y,heatedPlantersBook:h,fertilizerBook:w,smallFireBook:g,bonfireBook:_,kilnBook:A},te=W(()=>[I(()=>({multiplier:2,description:"Scholar's shoes",enabled:Gt.paperUpgrades.paperUpgrade1.bought})),I(()=>({multiplier:2,description:"Scholar's slacks",enabled:Gt.paperUpgrades.paperUpgrade2.bought})),I(()=>({multiplier:2,description:"Scholar's jacket",enabled:Gt.paperUpgrades.paperUpgrade3.bought}))]),[M,S]=ml(()=>[{title:"Paper Gain",modifier:te,base:1}]),T=O(!1),ke=B(()=>o(gt,{modelValue:T.value,"onUpdate:modelValue":ie=>T.value=ie},{header:()=>o("h2",null,[e,c(" Modifiers")]),body:M})),{total:Fe,trackerDisplay:me}=pl({resource:l,goal:5e3,name:e,day:Hn,color:t,textColor:"var(--feature-foreground)",modal:{show:T,display:ke}});return{name:e,day:Hn,color:t,paper:l,totalPaper:Fe,paperConversion:i,books:x,generalTabCollapsed:S,minWidth:700,display:B(()=>o(E,null,[ne(me),o(he,null,null),o(kt,{resource:l,color:t,style:"margin-bottom: 0"},null),o(he,null,null),ne(s),o(he,null,null),Nl(...Object.values(x))]))}}),Ws="workshop",_l=2,pt=Tt(Ws,function(){const e="Workshop",t="#D66B02",l="#D66B02",a=ot(0,"foundation progress"),i=Ps(()=>({scaling:In(250,1.5),baseResource:pe.logs,gainResource:q(a),roundUpCost:!0,buyMax:!1,spend(T,ke){pe.logs.value=n.sub(pe.logs.value,ke)}})),s=Ct(()=>({display:B(()=>o(E,null,[o("b",{style:"font-size: x-large"},[c("Build part of the foundation")]),o("br",null,null),o("br",null,null),o("span",{style:"font-size: large"},[c("Cost:")," ",Tl(pe.logs,n.gte(i.actualGain.value,1)?i.currentAt.value:i.nextAt.value)," ",pe.logs.displayName])])),visibility:()=>F(n.lt(a.value,100)),canClick:()=>n.gte(i.actualGain.value,1)&&n.lt(a.value,100),onClick(){!r(this.canClick)||i.convert()},style:"width: 600px; min-height: unset"})),u=bl(()=>({key:"w",description:"Build part of the foundation.",onPress:()=>{s.canClick.value&&s.onClick()}})),d=C(()=>!Ke.milestones[6].earned.value),m=Ne(()=>({display:{requirement:"1% Foundation Completed",effectDisplay:"Trees give 5% more logs for each % of foundation completed"},shouldEarn:()=>n.gte(a.value,1),showPopups:d})),p=Ne(()=>({display:{requirement:"10% Foundation Completed",effectDisplay:"Cut an additional tree per second for each 5% of foundation completed"},shouldEarn:()=>n.gte(a.value,10),visibility:()=>F(m.earned.value),showPopups:d})),y=Ne(()=>({display:{requirement:"20% Foundation Completed",effectDisplay:"Plant an additional tree per second for each 10% of foundation completed"},shouldEarn:()=>n.gte(a.value,20),visibility:()=>F(p.earned.value),showPopups:d})),h=Ne(()=>({display:{requirement:"30% Foundation Completed",effectDisplay:"All automatic tree cutting is doubled"},shouldEarn:()=>n.gte(a.value,30),visibility:()=>F(y.earned.value),showPopups:d})),w=Ne(()=>({display:{requirement:"40% Foundation Completed",effectDisplay:"All automatic tree planting is doubled"},shouldEarn:()=>n.gte(a.value,40),visibility:()=>F(h.earned.value),showPopups:d})),g=Ne(()=>({display:{requirement:"50% Foundation Completed",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>n.gte(a.value,50),visibility:()=>F(w.earned.value),showPopups:d})),_=Ne(()=>({display:{requirement:"75% Foundation Completed",effectDisplay:"The forest gains an extra tree for every 2% of foundation completed"},shouldEarn:()=>n.gte(a.value,75),visibility:()=>F(g.earned.value),showPopups:d})),A=Ne(()=>({display:{requirement:"100% Foundation Completed",effectDisplay:"Log per tree is raised to the 1.2th power"},shouldEarn:()=>n.gte(a.value,100),visibility:()=>F(_.earned.value),showPopups:d})),x={logGainMilestone1:m,autoCutMilestone1:p,autoPlantMilestone1:y,autoCutMilestone2:h,autoPlantMilestone2:w,logGainMilestone2:g,morePlantsMilestone1:_,logGainMilestone3:A},{collapseMilestones:te,display:M}=Yl(x),S=jt(()=>({direction:fe.Right,width:600,height:25,fillStyle:`backgroundColor: ${l}`,progress:()=>j.day.value===_l?n.div(a.value,100):1,display:B(()=>j.day.value===_l?o(E,null,[ce(a.value),c("%")]):"")}));return _t(()=>{j.day.value===_l&&n.gte(a.value,100)&&j.completeDay()}),{name:e,day:_l,color:t,foundationProgress:a,foundationConversion:i,milestones:x,collapseMilestones:te,minWidth:700,buildFoundationHK:u,display:B(()=>o(E,null,[o("div",null,[j.day.value===_l?"Complete the foundation to complete the day":`${e} Complete!`]),ne(S),o(he,null,null),o("div",null,[o("span",null,[c("The foundation is ")]),o("h2",{style:`color: ${t}; text-shadow: 0 0 10px ${t}`},[ce(a.value)]),c("% completed")]),n.lt(a.value,100)?o(he,null,null):null,ne(s),o(he,null,null),M()]))}}),zs="elves",kl=4,Ke=Tt(zs,function(){const e="Elves",t="red",l="#911D21",i=jt(()=>({direction:fe.Right,width:600,height:25,fillStyle:`backgroundColor: ${l}`,progress:()=>j.day.value===kl?n.div(oe.value,6).times(.8333333333333334).add(n.div(n.add(U.coal.value,1).log10(),n.log10(1e9)).clamp(0,1).div(6)):1,display:B(()=>j.day.value===kl?n.lt(oe.value,6)?o(E,null,[ce(oe.value),c("/6 elves")]):o(E,null,[ce(U.coal.value),c("/"),ce(1e9),c(" coal")]):"")})),s=Hs(()=>({thingsToReset:[pe,pt,U],onReset(){setTimeout(()=>{lt.earned.value?(pe.row1Upgrades.forEach(Q=>Q.bought.value=!0),pe.row2Upgrades.forEach(Q=>Q.bought.value=!0)):we.earned.value&&(pe.row1Upgrades[4].bought.value=!0,pe.row2Upgrades[4].bought.value=!0),ve.earned.value&&(pt.foundationProgress.value=100)})}})),u=W(()=>[I(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ie.earned})),I(()=>({multiplier:()=>n.times(Ae.books.cuttersBook.amount.value,.1).add(1),description:"Now You're Logging!",enabled:()=>n.gt(Ae.books.cuttersBook.amount.value,0)}))]),d=W(()=>[I(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ie.earned})),I(()=>({multiplier:()=>n.times(Ae.books.plantersBook.amount.value,.1).add(1),description:"The Man Who Planted Trees",enabled:()=>n.gt(Ae.books.plantersBook.amount.value,0)}))]),m=W(()=>[I(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ie.earned})),I(()=>({multiplier:()=>n.times(Ae.books.expandersBook.amount.value,.1).add(1),description:"Logjam",enabled:()=>n.gt(Ae.books.expandersBook.amount.value,0)}))]),p=W(()=>[I(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ie.earned})),I(()=>({multiplier:()=>n.times(Ae.books.heatedCuttersBook.amount.value,.1).add(1),description:"Fahrenheit 451",enabled:()=>n.gt(Ae.books.heatedCuttersBook.amount.value,0)}))]),y=W(()=>[I(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ie.earned})),I(()=>({multiplier:()=>n.times(Ae.books.heatedPlantersBook.amount.value,.1).add(1),description:"Tillamook Burn Country",enabled:()=>n.gt(Ae.books.heatedPlantersBook.amount.value,0)}))]),h=W(()=>[I(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ie.earned})),I(()=>({multiplier:()=>n.times(Ae.books.fertilizerBook.amount.value,.1).add(1),description:"The Garden Tree's Handbook",enabled:()=>n.gt(Ae.books.fertilizerBook.amount.value,0)}))]),w=W(()=>[I(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ie.earned})),I(()=>({multiplier:()=>n.times(Ae.books.smallFireBook.amount.value,.1).add(1),description:"Firestarter",enabled:()=>n.gt(Ae.books.smallFireBook.amount.value,0)}))]),g=W(()=>[I(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ie.earned})),I(()=>({multiplier:()=>n.times(Ae.books.bonfireBook.amount.value,.1).add(1),description:"An Arsonist's Guide to Writer's Homes in New England",enabled:()=>n.gt(Ae.books.bonfireBook.amount.value,0)}))]),_=W(()=>[I(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ie.earned})),I(()=>({multiplier:()=>n.times(Ae.books.kilnBook.amount.value,.1).add(1),description:"Little Fires Everywhere",enabled:()=>n.gt(Ae.books.kilnBook.amount.value,0)}))]),[A,x]=ml(()=>[{title:"Holly Auto-Buy Frequency",modifier:u,base:10,unit:"/s",visible:re.cuttersElf.bought},{title:"Ivy Auto-Buy Frequency",modifier:d,base:10,unit:"/s",visible:re.plantersElf.bought},{title:"Hope Auto-Buy Frequency",modifier:m,base:10,unit:"/s",visible:re.expandersElf.bought},{title:"Jack Auto-Buy Frequency",modifier:p,base:10,unit:"/s",visible:re.heatedCuttersElf.bought},{title:"Mary Auto-Buy Frequency",modifier:y,base:10,unit:"/s",visible:re.heatedPlantersElf.bought},{title:"Noel Auto-Buy Frequency",modifier:h,base:10,unit:"/s",visible:re.fertilizerElf.bought},{title:"Joy Auto-Buy Frequency",modifier:w,base:10,unit:"/s",visible:re.smallFireElf.bought},{title:"Faith Auto-Buy Frequency",modifier:g,base:10,unit:"/s",visible:re.bonfireElf.bought},{title:"Snowball Auto-Buy Frequency",modifier:_,base:10,unit:"/s",visible:re.kilnElf.bought}]),te=O(!1),M=B(()=>o(gt,{modelValue:te.value,"onUpdate:modelValue":Q=>te.value=Q},{header:()=>o("h2",null,[e,c(" Modifiers")]),body:A}));function S(Q){var Nt;const dt=C(()=>n.pow(4,oe.value).times(1e6)),De=ge(0),le=Q.hasToggle?ge(!1):O(!0),Lt=C(()=>Q.cooldownModifier.apply(10)),St=at((Nt=Q.canBuy)!=null?Nt:!0);function Rt(yt){var je;if(R.bought.value&&r(St)){De.value=n.add(De.value,yt);const Ot=n.recip(Lt.value);for(;n.gte(De.value,Ot);)if(Q.customCost==null?r(Q.buyable.canPurchase):n.gte(Q.buyable.resource.value,Q.customCost(Q.buyable.amount.value)))Q.buyable.amount.value=n.add(Q.buyable.amount.value,1),De.value=n.sub(De.value,Ot),(je=Q.onAutoPurchase)==null||je.call(Q);else{De.value=Ot;break}}}const R=G(()=>({...Q,buyable:void 0,toggle:le,buyProgress:De,update:Rt,resource:U.coal,cost:dt,computedAutoBuyCooldown:Lt,display:()=>({title:Q.name,description:B(()=>o(E,null,[Q.description,R.bought.value?null:o(E,null,[" ",c("Training this elf will require resetting all your progress from days 1-3.")]),R.bought.value&&Q.hasToggle===!0?o(E,null,[o(Ht,{title:Q.toggleDesc,"onUpdate:modelValue":yt=>le.value=yt,modelValue:le.value},null)]):null])),showCost:!R.bought.value}),style:"width: 190px",onPurchase(){var yt;(yt=Q.onPurchase)==null||yt.call(Q),s.reset()}}));return R}const T=S({name:"Holly",description:"Holly will automatically purchase cutters you can afford, without actually spending any logs.",buyable:pe.row1Buyables[0],cooldownModifier:u}),ke=S({name:"Ivy",description:"Ivy will automatically purchase planters you can afford, without actually spending any logs.",buyable:pe.row1Buyables[1],cooldownModifier:d}),Fe=S({name:"Hope",description:"Hope will automatically purchase forest expanders you can afford, without actually spending any logs.",buyable:pe.row1Buyables[2],cooldownModifier:m}),me=[T,ke,Fe],ie=S({name:"Jack",description:"Jack will automatically purchase heated cutters you can afford, without actually spending any coal.",buyable:U.heatedCutters,cooldownModifier:p}),ee=S({name:"Mary",description:"Mary will automatically purchase heated planters you can afford, without actually spending any coal.",buyable:U.heatedPlanters,cooldownModifier:y}),Ye=S({name:"Noel",description:"Noel will automatically purchase fertilized soil you can afford, without actually spending any ash.",buyable:U.moreFertilizer,cooldownModifier:h}),qe=[ie,ee,Ye],Te=S({name:"Joy",description:"Joy will automatically purchase small fires you can afford, without actually spending any logs. You can toggle whether or not to enable the purchased small fires automatically. Small fires will start giving a boost to ash and coal gain.",buyable:U.buildFire,cooldownModifier:w,visibility:()=>F(wt.upgrades.logsUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased small fires",onAutoPurchase(){Te.toggle.value&&(U.activeFires.value=n.add(U.activeFires.value,1))},onPurchase(){j.days[4].recentlyUpdated.value=!0}}),xe=S({name:"Faith",description:"Faith will automatically purchase bonfires you can afford. You can toggle whether or not to enable the purchased bonfires automatically. Bonfires will start giving a boost to ash and coal gain.",buyable:U.buildBonfire,cooldownModifier:g,visibility:()=>F(wt.upgrades.ashUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased bonfires",onAutoPurchase(){const Q=r(this.buyable.cost);U.activeFires.value=n.sub(U.activeFires.value,Q).max(0),U.buildFire.amount.value=n.sub(U.buildFire.amount.value,Q).max(0),xe.toggle.value&&(U.activeBonfires.value=n.add(U.activeBonfires.value,1))},onPurchase(){j.days[4].recentlyUpdated.value=!0},canBuy:U.unlockBonfire.bought}),He=S({name:"Snowball",description:"Snowball will automatically purchase kilns you can afford, without actually spending any logs. You can toggle whether or not to enable the purchased kilns automatically. Kilns will start giving a boost to ash and coal gain.",buyable:U.buildKiln,cooldownModifier:_,visibility:()=>F(wt.upgrades.coalUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased kilns",onAutoPurchase(){He.toggle.value&&(U.activeKilns.value=n.add(U.activeKilns.value,1))},onPurchase(){j.days[4].recentlyUpdated.value=!0},canBuy:U.unlockKiln.bought}),rt=[Te,xe,He],re={cuttersElf:T,plantersElf:ke,expandersElf:Fe,heatedCuttersElf:ie,heatedPlantersElf:ee,fertilizerElf:Ye,smallFireElf:Te,bonfireElf:xe,kilnElf:He},oe=C(()=>Object.values(re).filter(Q=>Q.bought.value).length),ue=Ne(()=>({display:{requirement:"1 Elf Trained",effectDisplay:"Manual cutting and planting can happen twice as often for each trained elf"},shouldEarn:()=>n.gte(oe.value,1)})),we=Ne(()=>({display:{requirement:"2 Elves Trained",effectDisplay:"Research I & II aren't reset after training"},shouldEarn:()=>n.gte(oe.value,2),visibility:()=>F(ue.earned.value)})),Me=Ne(()=>({display:{requirement:"3 Elves Trained",effectDisplay:"Coal gain is raised to the 1.25"},shouldEarn:()=>n.gte(oe.value,3),visibility:()=>F(we.earned.value)})),Ze=Ne(()=>({display:{requirement:"4 Elves Trained",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>n.gte(oe.value,4),visibility:()=>F(Me.earned.value)})),Re=Ne(()=>({display:{requirement:"5 Elves Trained",effectDisplay:"Forest is twice as large"},shouldEarn:()=>n.gte(oe.value,5),visibility:()=>F(Ze.earned.value)})),Ie=Ne(()=>({display:{requirement:"6 Elves Trained",effectDisplay:"Elves work twice as fast"},shouldEarn:()=>n.gte(oe.value,6),visibility:()=>F(Re.earned.value)})),ve=Ne(()=>({display:{requirement:"7 Elves Trained",effectDisplay:"Workshop Foundation starts at 100% complete after training"},shouldEarn:()=>n.gte(oe.value,7),visibility:()=>F(Ie.earned.value&&j.day.value>5)})),Ee=Ne(()=>({display:{requirement:"8 Elves Trained",effectDisplay:"Forest is twice as large (again)"},shouldEarn:()=>n.gte(oe.value,8),visibility:()=>F(ve.earned.value)})),lt=Ne(()=>({display:{requirement:"9 Elves Trained",effectDisplay:"Trees upgrades aren't reset after training"},shouldEarn:()=>n.gte(oe.value,9),visibility:()=>F(Ee.earned.value)})),Oe=[ue,we,Me,Ze,Re,Ie,ve,Ee,lt],de={manualMilestone:ue,researchMilestone:we,coalGainMilestone:Me,logGainMilestone:Ze,forestMilestone:Re,elvesMilestone:Ie,foundationMilestone:ve,forestMilestone2:Ee,treeUpgradesMilestone:lt},{collapseMilestones:ht,display:nt}=Yl(de);return $e.on("update",Q=>{n.lt(j.day.value,kl)||Object.values(re).forEach(dt=>dt.update(Q))}),_t(()=>{j.day.value===kl&&n.gte(oe.value,6)&&n.gte(U.coal.value,1e9)&&j.completeDay()}),{name:e,color:t,elves:re,totalElves:oe,milestones:Oe,collapseMilestones:ht,generalTabCollapsed:x,minWidth:700,display:B(()=>o(E,null,[o("div",null,[j.day.value===kl?`Reach ${ce(6)} trained elves and ${ce(1e9)} ${U.coal.displayName} to complete the day`:`${e} Complete!`," ",c("-")," ",o("button",{class:"button",style:"display: inline-block;",onClick:()=>te.value=!0},[c("Check Modifiers")])]),ne(i),ne(M),o(he,null,null),o("div",{style:"width: 600px"},[Ce(...me),Ce(...qe),Ce(...rt)]),nt()]))}}),Ks={},Js={style:{"white-space":"nowrap"}},Xs=f("span",{style:{"font-size":"larger","font-family":"initial"}},"\u221A",-1),Ys={style:{"text-decoration":"overline"}};function Zs(e,t){return b(),N("span",Js,[Xs,f("span",Ys,[xt(e.$slots,"default")])])}var er=_e(Ks,[["render",Zs]]);const tr="oil",hn=9,We=Tt(tr,function(){const e="Oil",t="#000000",l="var(--foreground)",a=ot(0,"oil"),i=ot(0,"depth"),s=ge(0),u=C(()=>n.lt(i.value,990)?n.add(10,i.value):n.pow(1.001,n.sub(i.value,990)).mul(1e3));function d(){if(n.lt(i.value,990)){const Pe=n.min(n.affordArithmeticSeries(s.value,10,1,i.value),n.sub(990,i.value)),mt=n.sumArithmeticSeries(Pe,10,1,i.value);s.value=n.sub(s.value,mt),i.value=n.add(i.value,Pe)}if(n.gte(i.value,990)){const Pe=n.affordGeometricSeries(s.value,1e3,1.001,n.sub(i.value,990)),mt=n.sumGeometricSeries(Pe,1e3,1.001,n.sub(i.value,990));s.value=n.sub(s.value,mt),i.value=n.add(i.value,Pe)}}const m=ge(0),p=C(()=>n.times(n.pow(m.value,te.value).pow(2),1e14)),y=C(()=>n.times(n.pow(m.value,te.value),1)),h=Be(()=>({resource:ft.metal,cost(){const Pe=new n(this.amount.value);return n.pow(1.3,Pe).times(25e3)},display:B(()=>o(E,null,[o("h3",null,[c("Heavy Drill")]),o("br",null,null),c("A large drill specialized at deep mining."),o("br",null,null),c("Consumes 1e14*(Heavy Drills amount)"),o("sup",null,[c("2")]),c(" coal/sec for (Heavy Drills amount) drill power."),o("br",null,null),o("br",null,null),c("Currently:"),o("br",null,null),c("-"),Y(p.value),c(" coal/sec"),o("br",null,null),c("+"),Y(y.value),c(" drill power"),o("br",null,null),o("br",null,null),c("Cost: "),J(r(h.cost)),c(" "),h.resource.displayName])),onPurchase(){m.value=n.add(m.value,1)},style:{color:l,width:"160px"}})),{min:w,max:g,add:_,remove:A}=Vt({buyable:h,active:m}),x=ge(0),te=C(()=>n.add(x.value,Math.E).ln()),M=Be(()=>({resource:ft.metal,cost(){const Pe=new n(this.amount.value);return n.pow(2,Pe).times(1e5)},display:B(()=>o(E,null,[o("h3",null,[c("Heavy Drill Drill")]),o("br",null,null),c("Attach extra drills to Heavy Drills to make them faster"),o("br",null,null),c("Raise amount of effective Heavy Drills by ^ln(Heavy Drill Drill amount + e)."),o("br",null,null),c("(also affects coal consumption)."),o("br",null,null),o("br",null,null),c("Currently:"),o("br",null,null),c("^"),Y(te.value),c(" Heavy Drill amount"),o("br",null,null),o("br",null,null),c("Cost: "),J(r(M.cost)),c(" "),M.resource.displayName])),onPurchase(){x.value=n.add(x.value,1)},style:{color:l,width:"160px"}})),{min:S,max:T,add:ke,remove:Fe}=Vt({buyable:M,active:x}),me=ge(0),ie=C(()=>n.pow(1/3,me.value)),ee=C(()=>n.pow(2,me.value)),Ye=C(()=>n.pow(1.2,me.value)),qe=Be(()=>({resource:ft.metal,cost(){const Pe=new n(this.amount.value);return n.pow(8,Pe).times(2e5)},display:B(()=>o(E,null,[o("h3",null,[c("Heavy Extractor")]),o("br",null,null),c("Attach extractors to the drill to mine coal and ore, but with a price."),o("br",null,null),c("Divides drill power by 3 to multiply coal gain by 2 and ore gain by 1.2."),o("br",null,null),o("br",null,null),c("Currently:"),o("br",null,null),c("\xD7"),Y(ie.value),c(" drill power"),o("br",null,null),c("\xD7"),Y(ee.value),c(" coal/sec"),o("br",null,null),c("\xD7"),Y(Ye.value),c(" ore/sec"),o("br",null,null),o("br",null,null),c("Cost: "),J(r(qe.cost))," ",qe.resource.displayName])),onPurchase(){me.value=n.add(me.value,1)},style:{color:l,width:"160px"}})),{min:Te,max:xe,add:He,remove:rt}=Vt({buyable:qe,active:me}),re=ge(0),oe=C(()=>n.pow(It[3].bought.value?4:5,re.value)),ue=C(()=>n.pow(re.value,2).mul(m.value).mul(n.add(x.value,1)).mul(me.value).mul(i.value).div(1e5)),we=Be(()=>({resource:ft.metal,cost(){const Pe=new n(this.amount.value);let mt=n.pow(16,Pe).times(2e6);return It[4].bought.value&&(mt=mt.div(n.add(ol.value,1).root(6))),mt},display:B(()=>o(E,null,[o("h3",null,[c("Oil Pump")]),o("br",null,null),c("Pump that oil from the ground."),o("br",null,null),c("Gain oil based on the number of Heavy Drills and Heavy Drill Drills active and well depth, but coal usage is multiplied by "),It[3].bought.value?4:5,c("\xD7."),o("br",null,null),o("br",null,null),c("Currently:"),o("br",null,null),c("\xD7"),Y(oe.value),c(" coal usage"),o("br",null,null),c("+"),Y(ue.value),c(" oil/sec"),o("br",null,null),o("br",null,null),c("Cost: "),J(r(we.cost)),c(" "),we.resource.displayName])),onPurchase(){re.value=n.add(re.value,1)},style:{color:l,width:"160px"}})),{max:Me,min:Ze,add:Re,remove:Ie}=Vt({buyable:we,active:re}),ve=ge(0),Ee=C(()=>n.pow(ve.value,2)),lt=C(()=>n.pow(ve.value,3).mul(1e19)),Oe=C(()=>n.add(ve.value,1)),de=Be(()=>({resource:q(a),cost(){const Pe=new n(this.amount.value);return n.pow(2,Pe).times(50)},display:B(()=>o(E,null,[o("h3",null,[c("Oil Burner")]),o("br",null,null),c("Burn oil as fuel."),o("br",null,null),c("(Oil Burner Amount)"),o("sup",null,[c("2")]),c(" unit of oil can give 1e19*(Oil Burner Amount)"),o("sup",null,[c("3")]),c(" units of coal."),o("br",null,null),o("br",null,null),c("Currently:"),o("br",null,null),c("-"),Y(Ee.value),c(" oil/sec"),o("br",null,null),c("-"),Y(lt.value),c(" coal consumption"),It[2].bought.value?o(E,null,[o("br",null,null),c("\xD7"),Y(Oe.value),c(" to auto smelting multi")]):"",o("br",null,null),o("br",null,null),c("Cost: "),J(r(de.cost)),c(" "),de.resource.displayName])),onPurchase(){ve.value=n.add(ve.value,1)},style:{color:l,width:"160px"}})),{max:ht,min:nt,add:Q,remove:dt}=Vt({buyable:de,active:ve}),De=ge(0),le=C(()=>n.pow(De.value,2).mul(100)),Lt=C(()=>n.add(De.value,1)),St=Be(()=>({resource:ft.metal,cost(){const Pe=new n(this.amount.value);let mt=n.pow(10,Pe).times(1e7);return It[4].bought.value&&(mt=mt.div(n.add(ol.value,1).root(6))),mt},display:B(()=>o(E,null,[o("h3",null,[c("Oil Smelter")]),o("br",null,null),c("Use oil as a crucible fuel."),o("br",null,null),c("Burn 100x"),o("sup",null,[c("2")]),c(" oil to smelt +100% faster."),o("br",null,null),o("br",null,null),c("Currently:"),o("br",null,null),c("-"),Y(le.value),c(" oil/sec"),o("br",null,null),c("\xD7"),Y(Lt.value),c(" smelting speed"),o("br",null,null),o("br",null,null),c("Cost: "),J(r(St.cost)),c(" "),St.resource.displayName])),onPurchase(){De.value=n.add(De.value,1)},style:{color:l,width:"160px"}})),{max:Rt,min:R,add:Nt,remove:yt}=Vt({buyable:St,active:De}),je=[Ne(()=>({display:{requirement:"5m Well Depth",effectDisplay:"Gain 25% more coal for each metre of well depth (after the 3 elf milestone)."},shouldEarn:()=>n.gte(i.value,5)})),Ne(()=>({display:{requirement:"10m Well Depth",effectDisplay:"Drill too slow? Unlock some drill upgrades!"},shouldEarn:()=>n.gte(i.value,10),visibility:()=>F(je[0].earned.value)})),Ne(()=>({display:{requirement:"25m Well Depth",effectDisplay:"Gain 5% more ore for each metre of well depth."},shouldEarn:()=>n.gte(i.value,25),visibility:()=>F(je[1].earned.value)})),Ne(()=>({display:{requirement:"60m Well Depth",effectDisplay:"Drill still too slow? Try unlocking another drill!"},shouldEarn:()=>n.gte(i.value,60),visibility:()=>F(je[2].earned.value)})),Ne(()=>({display:{requirement:"150m Well Depth",effectDisplay:"It appears that coal and metal appear a lot more when you go this deep! Unlock more coal and metal upgrades!"},shouldEarn:()=>n.gte(i.value,150),visibility:()=>F(je[3].earned.value)})),Ne(()=>({display:{requirement:"350m Well Depth",effectDisplay:"There is even more coal and metal than you thought. Why don't you utilize your heavy drill to mine them? Unlock a new drill upgrade!"},shouldEarn:()=>n.gte(i.value,350),visibility:()=>F(je[4].earned.value)})),Ne(()=>({display:{requirement:"1,000m Well Depth",effectDisplay:"You've finally found oil! Maybe it's time to make those oil useful! Unfortunately extracting them would use more coal, and also it's becoming much harder to mine deeper due to the thermal heat and pressure."},shouldEarn:()=>n.gte(i.value,1e3),visibility:()=>F(n.gte(i.value,1e3))})),Ne(()=>({display:{requirement:"3,000m Well Depth",effectDisplay:"You found a large oil spot! Double oil gain!"},shouldEarn:()=>n.gte(i.value,3e3),visibility:()=>F(n.gte(i.value,2e3))}))],{collapseMilestones:Ot,display:un}=Yl(je),Ut=[Ne(()=>({display:{requirement:"100 total oil",effectDisplay:"Hmm, these oil pumps are really expensive. Maybe you should find a way to solve this problem... maybe you can use oil as fuel instead of coal?"},shouldEarn:()=>n.gte(ol.value,100)})),Ne(()=>({display:{requirement:"500 total oil",effectDisplay:"Unlocks oil upgrades! These can be bought with oil."},shouldEarn:()=>n.gte(ol.value,500),visibility:()=>F(Ut[0].earned.value)})),Ne(()=>({display:{requirement:"10,000 total oil",effectDisplay:"Wow, this is really bright when you burn it. Maybe it can be helpful to use them to smelt metal?"},shouldEarn:()=>n.gte(ol.value,1e4),visibility:()=>F(Ut[1].earned.value)}))],{collapseMilestones:dn,display:Ol}=Yl(Ut),$t=[G(()=>({resource:U.coal,cost:1e18,display:{title:"Coal Drill Synergy",description:"Increase drill power by +4% per coal Mining Drill owned.",effectDisplay:B(()=>o(E,null,[c("x"),Y(ct[0].value)]))},style:{color:l}})),G(()=>({resource:ft.metal,cost:15e4,display:{title:"Metal Drill Synergy",description:"Increase drill power by +4% per ore Mining Drill owned.",effectDisplay:B(()=>o(E,null,[c("x"),Y(ct[1].value)]))},style:{color:l}})),G(()=>({resource:U.coal,cost:1e20,display:{title:"Coal Drill Upgrade",description:"Increase drill power by +6% per OoM of coal owned.",effectDisplay:B(()=>o(E,null,[c("x"),Y(ct[2].value)]))},style:{color:l}})),G(()=>({resource:ft.metal,cost:15e5,display:{title:"Metal Drill Upgrade",description:"Increase drill power by +10% per OoM of metal ingot owned.",effectDisplay:B(()=>o(E,null,[c("x"),Y(ct[3].value)]))},style:{color:l}})),G(()=>({resource:q(a),cost:100,display:{title:"Drill Oil",description:"Increase previous upgrades' effect by +0.1% per Heavy Drill owned.",effectDisplay:B(()=>o(E,null,[c("+"),Y(n.mul(ct[4].value,100)),c("%")]))},style:{color:l}}))],ct=[C(()=>n.mul(U.buildDrill.amount.value,n.add(.04,Qt.value)).add(1)),C(()=>n.mul(ft.oreDrill.amount.value,n.add(.04,Qt.value)).add(1)),C(()=>n.mul(n.max(U.coal.value,1).log10().floor(),n.add(.06,Qt.value)).add(1)),C(()=>n.mul(n.max(ft.metal.value,1).log10().floor(),n.add(.1,Qt.value)).add(1)),C(()=>n.mul(h.amount.value,.001))],It=[G(()=>({resource:q(a),cost:100,display:{title:"Oil the Oil Pump",description:"Double oil gain."},style:{color:l}})),G(()=>({resource:q(a),cost:500,display:{title:"Oil the Mining Drills",description:"Double ore mining speed and square the coal drill amount in its effect."},style:{color:l}})),G(()=>({resource:q(a),cost:1500,display:{title:"Blaster Burner",description:"The Oil Burner can now increase your metal gain."},style:{color:l}})),G(()=>({resource:q(a),cost:25e3,display:{title:"Oil Integration",description:"Reduce Oil Well's coal consumption multipler from 5 to 4"},style:{color:l}})),G(()=>({resource:q(a),cost:5e4,display:{title:"Be One with the Oil",description:B(()=>o(E,null,[c("Divide metal ingot prices of oil buildings by "),o("sup",null,[c("6")]),o(er,null,{default:()=>[c("total oil + 1")]})]))},style:{color:l}}))],fl=W(()=>[Z(()=>({addend:()=>n.negate(p.value),description:"Heavy Drill",enabled:()=>n.gt(m.value,0)})),I(()=>({multiplier:oe,description:"Oil Pump",enabled:()=>n.gt(re.value,0)})),Z(()=>({addend:cn,description:"Oil to Coal Substitution",enabled:()=>n.gt(cn.value,0)}))]),Ul=C(()=>fl.apply(0)),Cl=W(()=>[Z(()=>({addend:y,description:"Heavy Drill",enabled:()=>n.gt(m.value,0)})),I(()=>({multiplier:ie,description:"Heavy Extractor",enabled:()=>n.gt(me.value,0)})),I(()=>({multiplier:ct[0],description:"Coal Drill Synergy",enabled:$t[0].bought})),I(()=>({multiplier:ct[1],description:"Metal Drill Synergy",enabled:$t[1].bought})),I(()=>({multiplier:ct[2],description:"Coal Drill Upgrade",enabled:$t[2].bought})),I(()=>({multiplier:ct[3],description:"Metal Drill Upgrade",enabled:$t[3].bought})),I(()=>({multiplier:()=>qt.value,description:"Effectiveness",enabled:()=>n.lt(qt.value,1)}))]),$l=C(()=>Cl.apply(0)),ql=W(()=>[Z(()=>({addend:ct[4],description:"Drill Oil",enabled:$t[4].bought}))]),Qt=C(()=>ql.apply(0)),Vl=W(()=>[Z(()=>({addend:ue,description:"Oil Pump",enabled:()=>n.gt(re.value,0)})),I(()=>({multiplier:2,description:"Oil the Oil Pump",enabled:It[0].bought})),I(()=>({multiplier:2,description:"3000m Well Depth",enabled:je[7].earned})),I(()=>({multiplier:()=>qt.value,description:"Effectiveness",enabled:()=>n.lt(qt.value,1)}))]),gl=C(()=>Vl.apply(0)),Gl=W(()=>[Z(()=>({addend:()=>n.negate(Ee.value),description:"Oil Burner",enabled:()=>n.gt(ve.value,0)})),Z(()=>({addend:()=>n.negate(le.value),description:"Oil Smelter",enabled:()=>n.gt(De.value,0)}))]),D=C(()=>Gl.apply(0)),Pn=W(()=>[Z(()=>({addend:lt,description:"Oil Burner",enabled:()=>n.gt(ve.value,0)})),I(()=>({multiplier:()=>Xt.value,description:"Effectiveness",enabled:()=>n.lt(Xt.value,1)}))]),cn=C(()=>Pn.apply(0)),[Va,Ga]=ml(()=>[{title:"Coal Consumption",modifier:fl,unit:"/s",base:0},{title:"Drill Power",modifier:Cl,base:0},{title:"Upgrade Bonus",modifier:ql,base:0,visible(){return n.gt(Qt.value,0)}},{title:"Oil Speed",modifier:Vl,unit:"/s",base:0,visible(){return n.gt(gl.value,0)}},{title:"Oil Consumption",modifier:Gl,unit:"/s",base:0,visible(){return n.lt(D.value,0)}},{title:"Oil to Coal Substitution",modifier:Pn,unit:"/s",base:0,visible(){return n.gt(cn.value,0)}}]),mn=O(!1),La=B(()=>o(gt,{modelValue:mn.value,"onUpdate:modelValue":Pe=>mn.value=Pe},{header:()=>o("h2",null,[e,c(" Modifiers")]),body:Va})),qt=O(n.dOne),Xt=O(n.dOne);$e.on("update",Pe=>{if(n.lt(j.day.value,hn))return;const mt=n.negate(Ul.value);n.gt(mt,0)?(qt.value=n.min(n.div(U.coal.value,mt),1),U.coal.value=n.sub(U.coal.value,n.mul(mt,qt.value).mul(Pe))):qt.value=n.dOne,s.value=n.add(s.value,n.mul($l.value,Pe)),a.value=n.add(a.value,n.mul(gl.value,Pe)),d();const pn=n.negate(D.value);n.gt(pn,0)?(Xt.value=n.min(n.div(a.value,pn),1),a.value=n.sub(a.value,n.mul(pn,Xt.value).mul(Pe))):Xt.value=n.dOne});const{total:ol,trackerDisplay:Qa}=pl({resource:a,goal:25e4,name:e,day:hn,color:t,modal:{show:mn,display:La}});return{name:e,day:hn,color:t,oil:a,totalOil:ol,depth:i,drillProgress:s,activeHeavy:m,buildHeavy:h,activeHeavy2:x,buildHeavy2:M,activeExtractor:me,buildExtractor:qe,activePump:re,buildPump:we,activeBurner:ve,buildBurner:de,activeSmelter:De,buildSmelter:St,extractorCoal:ee,extractorOre:Ye,coalEffectiveness:qt,oilEffectiveness:Xt,depthMilestones:je,collapsedDepthMilestones:Ot,row1Upgrades:$t,row2Upgrades:It,minWidth:700,oilMilestones:Ut,collapsedOilMilestones:dn,generalTabCollapsed:Ga,display:B(()=>o(E,null,[ne(Qa),o(he,null,null),n.lt(qt.value,1)?"Coal efficiency: "+Y(n.mul(qt.value,100))+"%":null,n.lt(Xt.value,1)?"Oil efficiency: "+Y(n.mul(Xt.value,100))+"%":null,o(kt,{resource:a,color:t,sticky:!0,productionDisplay:B(()=>o(E,null,[n.lt(i.value,1e3)?"Reach 1000m to start gaining oil":o(E,null,[Kl(n.add(gl.value,D.value))])]))},null),n.eq(gl.value,0)?o(E,null,[c("(Need at least 1 Oil Pump, 1 Heavy Drill and 1 Heavy Extractor active to gain oil)"),o("br",null,null)]):"",o(xl,null,{default:()=>[je[6].earned.value?o(bt,null,{default:()=>[ne(we),o("div",null,[J(n.floor(re.value)),c("/"),J(n.floor(we.amount.value))]),Ce(Ze,Ie,Re,Me)]}):null,Ut[0].earned.value?o(bt,null,{default:()=>[ne(de),o("div",null,[J(n.floor(ve.value)),c("/"),J(n.floor(de.amount.value))]),Ce(nt,dt,Q,ht)]}):null,Ut[2].earned.value?o(bt,null,{default:()=>[ne(St),o("div",null,[J(n.floor(De.value)),c("/"),J(n.floor(St.amount.value))]),Ce(R,yt,Nt,Rt)]}):null]}),o("br",null,null),o("div",null,[o("span",null,[c("The well is ")]),o("h2",{style:"color: #6f767f; text-shadow: 0 0 10px #6f767f"},[J(i.value)]),c("m deep"),o("br",null,null),c("Next at "),Y(n.sub(u.value,s.value)),c(" drill power seconds")]),o("div",null,[o("span",null,[c("Your drill power is ")]),o("h2",{style:"color: #6f767f; text-shadow: 0 0 10px #6f767f"},[Y($l.value)])]),o(he,null,null),o(xl,null,{default:()=>[o(bt,null,{default:()=>[ne(h),o("div",null,[J(n.floor(m.value)),c("/"),J(n.floor(h.amount.value))]),Ce(w,A,_,g)]}),je[3].earned.value?o(bt,null,{default:()=>[ne(M),o("div",null,[J(n.floor(x.value)),c("/"),J(n.floor(M.amount.value))]),Ce(S,Fe,ke,T)]}):null,je[5].earned.value?o(bt,null,{default:()=>[ne(qe),o("div",null,[J(n.floor(me.value)),c("/"),J(n.floor(qe.amount.value))]),Ce(Te,rt,He,xe)]}):null]}),o(he,null,null),je[1].earned.value?Ce(...$t):null,Ut[1].earned.value?Ce(...It):null,o(he,null,null),un(),n.gte(ol.value,50)?Ol():""]))}}),lr="coal",jn=3,U=Tt(lr,function(){const e="Coal",t="#151716",l="#B2BeB5",a="var(--foreground)",i=ot(0,"coal"),s=ot(0,"ash"),u=ge(0),d=C(()=>n.times(u.value,1e3)),m=C(()=>n.times(u.value,.1)),p=C(()=>n.times(u.value,50)),y=Be(()=>({resource:pe.logs,cost(){let D=n.times(T.amount.value,r(T.cost)).plus(this.amount.value);return n.gte(D,100)&&(D=n.pow(D,2).div(100)),n.gte(D,1e4)&&(D=n.pow(D,2).div(1e4)),D=n.pow(.95,Ae.books.smallFireBook.amount.value).times(D),D.pow(1.5).times(1e4)},display:B(()=>o(E,null,[o("h3",null,[c("Small Fire")]),o("br",null,null),c("Burn 1000 logs for 0.1 coal and 50 ash"),o("br",null,null),o("br",null,null),c("Currently:"),o("br",null,null),c("-"),ye(d.value),c(" logs/sec"),o("br",null,null),c("+"),ye(m.value),c(" coal/sec"),o("br",null,null),c("+"),ye(p.value),c(" ash/sec"),o("br",null,null),o("br",null,null),c("Cost: "),ce(r(y.cost)),c(" "),y.resource.displayName])),onPurchase(){u.value=n.add(u.value,1)},style:{color:a,width:"160px"}})),{min:h,max:w,add:g,remove:_}=Vt({active:u,buyable:y}),A=ot(y.amount,"small fires"),x=ge(0),te=C(()=>n.times(x.value,1e4)),M=C(()=>n.times(x.value,10)),S=C(()=>n.times(x.value,1e3)),T=Be(()=>({resource:A,cost(){return n.pow(.95,Ae.books.bonfireBook.amount.value).times(10)},display:B(()=>o(E,null,[o("h3",null,[c("Bonfire")]),o("br",null,null),c("Burn 10,000 logs for 10 coal and 1000 ash"),o("br",null,null),o("br",null,null),c("Currently:"),o("br",null,null),c("-"),ye(te.value),c(" logs/sec"),o("br",null,null),c("+"),ye(M.value),c(" coal/sec"),o("br",null,null),c("+"),ye(S.value),c(" ash/sec"),o("br",null,null),o("br",null,null),c("Cost: "),ce(r(T.cost)),c(" "),T.resource.displayName])),onPurchase(D){u.value=n.sub(u.value,D).max(0),x.value=n.add(x.value,1)},style:{color:a,width:"160px"},visibility:()=>F(de.bought.value)})),{min:ke,max:Fe,add:me,remove:ie}=Vt({buyable:T,active:x}),ee=ge(0),Ye=C(()=>n.times(ee.value,1e6)),qe=C(()=>n.times(ee.value,1e4)),Te=C(()=>n.times(ee.value,1e4)),xe=Be(()=>({resource:pe.logs,cost(){let D=this.amount.value;return n.gte(D,100)&&(D=n.pow(D,2).div(100)),n.gte(D,1e4)&&(D=n.pow(D,2).div(1e4)),D=n.pow(.95,Ae.books.kilnBook.amount.value).times(D),n.pow(1.1,D).times(1e7)},display:B(()=>o(E,null,[o("h3",null,[c("Charcoal Kiln")]),o("br",null,null),c("Burn 1,000,000 logs for 10,000 coal and 10,000 ash"),o("br",null,null),o("br",null,null),c("Currently:"),o("br",null,null),c("-"),ye(Ye.value),c(" logs/sec"),o("br",null,null),c("+"),ye(qe.value),c(" coal/sec"),o("br",null,null),c("+"),ye(Te.value),c(" ash/sec"),o("br",null,null),o("br",null,null),c("Cost: "),ce(r(xe.cost)),c(" "),xe.resource.displayName])),onPurchase(){ee.value=n.add(ee.value,1)},style:{color:a,width:"160px"},visibility:()=>F(De.bought.value)})),{min:He,max:rt,add:re,remove:oe}=Vt({buyable:xe,active:ee}),ue=ge(0),we=C(()=>n.times(n.pow(ue.value,We.row2Upgrades[1].bought.value?2:1),5e7).times(ft.efficientDrill.bought.value?2:1)),Me=Be(()=>({resource:ft.metal,cost(){let D=this.amount.value;return n.gte(D,100)&&(D=n.pow(D,2).div(100)),n.gte(D,1e4)&&(D=n.pow(D,2).div(1e4)),n.pow(1.15,D).times(10)},display:B(()=>o(E,null,[o("h3",null,[c("Mining Drill")]),o("br",null,null),c("Dig through the ground to find 50,000,000 coal"),o("br",null,null),o("br",null,null),c("Currently:"),o("br",null,null),c("+"),ye(we.value),c(" coal/sec"),o("br",null,null),o("br",null,null),c("Cost: "),ce(r(Me.cost)),c(" "),Me.resource.displayName])),onPurchase(){ue.value=n.add(ue.value,1)},style:{color:a,width:"160px"},visibility:()=>F(ft.coalDrill.bought.value)})),{max:Ze,min:Re,add:Ie,remove:ve}=Vt({buyable:Me,active:ue}),Ee=G(()=>({resource:q(i),cost:5,display:{title:"Warmer Cutters",description:"Cut down twice as many trees/s"},style:{color:a}})),lt=G(()=>({resource:q(i),cost:5,display:{title:"Warmer Planters",description:"Plant twice as many trees/s"},style:{color:a}})),Oe=G(()=>({resource:q(s),cost:5e3,display:{title:"Ashy Soil",description:"Trees give 25% more logs"},style:{color:a}})),de=G(()=>({resource:A,cost:10,display:{title:"Bigger Fires",description:"Put all those fires together into a larger blaze"},onPurchase(){A.value=n.add(A.value,this.cost)},style:{color:a}})),ht=[Ee,lt,Oe,de],nt=G(()=>({resource:q(i),cost:250,display:{title:"Dedicated Cutter Heaters",description:"Double the bonus from Heated Cutters"},style:{color:a},visibility:()=>F(de.bought.value)})),Q=G(()=>({resource:q(i),cost:250,display:{title:"Dedicated Planter Heaters",description:"Double the bonus from Heated Planters"},style:{color:a},visibility:()=>F(de.bought.value)})),dt=G(()=>({canAfford(){return n.gte(pe.logs.value,1e5)&&n.gte(s.value,1e5)},onPurchase(){pe.logs.value=n.sub(pe.logs.value,1e5),s.value=n.sub(s.value,1e5)},display:B(()=>o(E,null,[o("h3",null,[c("Mulched Soil")]),o("br",null,null),c("Double the bonus from Fertilized Soil"),o("br",null,null),o("br",null,null),c("Cost: "),ce(1e5),c(" "),pe.logs.displayName,o("br",null,null),ce(1e5),c(" "),s.displayName])),style:{color:a},visibility:()=>F(de.bought.value)})),De=G(()=>({resource:pe.logs,cost:1e7,display:{title:"Efficient Fires",description:"Move the fires underground to keep the coal from turning to ash"},style:{color:a},visibility:()=>F(de.bought.value)})),le=[nt,Q,dt,De],Lt=G(()=>({resource:q(i),cost:1e19,display:{title:"Efficient Crucibles",description:"Double auto smelting speed and triple metal gain from auto smelting"},style:{color:a},visibility:()=>F(We.depthMilestones[4].earned.value)})),St=[Lt],Rt=Be(()=>({resource:q(i),cost(){let D=this.amount.value;return n.gte(D,50)&&(D=n.pow(D,2).div(50)),n.gte(D,200)&&(D=n.pow(D,2).div(200)),n.gte(D,2e6)&&(D=n.pow(D,2).div(2e6)),D=n.pow(.95,Ae.books.heatedCuttersBook.amount.value).times(D),n.add(D,1).pow(2.5).times(10)},display:{title:"Heated Cutters",description:"Even warmer cutters cut down trees faster",effectDisplay:B(()=>o(E,null,[c("Cutters cut down trees "),ye(Ot.value),c("x faster")]))},style:{color:a},visibility:()=>F(Ee.bought.value)})),R=Be(()=>({resource:q(i),cost(){let D=this.amount.value;return n.gte(D,50)&&(D=n.pow(D,2).div(50)),n.gte(D,200)&&(D=n.pow(D,2).div(200)),n.gte(D,2e6)&&(D=n.pow(D,2).div(2e6)),D=n.pow(.95,Ae.books.heatedPlantersBook.amount.value).times(D),n.add(D,1).pow(2.5).times(10)},display:{title:"Heated Planters",description:"Even warmer planters plant trees faster",effectDisplay:B(()=>o(E,null,[c("Planters plant trees "),ye(Ut.value),c("x faster")]))},style:{color:a},visibility:()=>F(lt.bought.value)})),Nt=Be(()=>({resource:q(s),cost(){let D=this.amount.value;return n.gte(D,50)&&(D=n.pow(D,2).div(50)),n.gte(D,200)&&(D=n.pow(D,2).div(200)),n.gte(D,2e6)&&(D=n.pow(D,2).div(2e6)),D=n.pow(.95,Ae.books.fertilizerBook.amount.value).times(D),n.add(D,1).pow(1.5).times(5e4)},display:{title:"Fertilized Soil",description:"More fertilizer helps trees grow bigger",effectDisplay:B(()=>o(E,null,[c("Trees give "),ye(Ol.value),c("x more logs")]))},style:{color:a},visibility:()=>F(Oe.bought.value)})),yt=[Rt,R,Nt],je=W(()=>[Z(()=>({addend(){return n.times(Rt.amount.value,.25)},description:"Heated Cutters",enabled(){return n.gt(Rt.amount.value,0)}})),I(()=>({multiplier:2,description:"Dedicated Cutter Heaters",enabled:nt.bought}))]),Ot=C(()=>je.apply(1)),un=W(()=>[Z(()=>({addend(){return n.times(R.amount.value,.25)},description:"Heated Planters",enabled(){return n.gt(R.amount.value,0)}})),I(()=>({multiplier:2,description:"Dedicated Planter Heaters",enabled:Q.bought}))]),Ut=C(()=>un.apply(1)),dn=W(()=>[Z(()=>({addend(){return n.times(Nt.amount.value,.25)},description:"Fertilized Soil",enabled(){return n.gt(Nt.amount.value,0)}})),I(()=>({multiplier:2,description:"Mulched Soil",enabled:dt.bought}))]),Ol=C(()=>dn.apply(1)),$t=W(()=>[Z(()=>({addend(){return m.value},description:"Small Fires",enabled(){return n.gt(u.value,0)}})),Z(()=>({addend(){return M.value},description:"Bonfires",enabled(){return n.gt(x.value,0)}})),Z(()=>({addend(){return qe.value},description:"Charcoal Kilns",enabled(){return n.gt(ee.value,0)}})),Z(()=>({addend(){return we.value},description:"Mining Drills",enabled(){return n.gt(ue.value,0)}})),I(()=>({multiplier:2,description:"Carry coal in boxes",enabled:wt.upgrades.coalUpgrade.bought})),I(()=>({multiplier:()=>n.div(wt.buyables.coalBoxesBuyable.amount.value,2).add(1),description:"Carry more coal",enabled:wt.upgrades.coalUpgrade.bought})),I(()=>({multiplier:()=>n.div(y.amount.value,1e4).add(1),description:"Small Fires Synergy",enabled:Ke.elves.smallFireElf.bought})),I(()=>({multiplier:()=>n.div(T.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:Ke.elves.bonfireElf.bought})),I(()=>({multiplier:()=>n.div(xe.amount.value,100).add(1),description:"Kiln Synergy",enabled:Ke.elves.kilnElf.bought})),I(()=>({multiplier:2,description:"Mining overalls",enabled:Gt.metalUpgrades.metalUpgrade2.bought})),I(()=>({multiplier:3,description:"Mining helmet",enabled:Gt.metalUpgrades.metalUpgrade3.bought})),Aa(()=>({exponent:1.25,description:"3 Elves Trained",enabled:Ke.milestones[2].earned,supportLowNumbers:!0})),I(()=>({multiplier:()=>n.mul(We.depth.value,.25).add(1),description:"5m Well Depth",enabled:We.depthMilestones[0].earned})),I(()=>({multiplier:We.extractorCoal,description:"Heavy Extractor",enabled:()=>n.gt(We.activeExtractor.value,0)}))]),ct=C(()=>$t.apply(0)),It=W(()=>[Z(()=>({addend(){return p.value},description:"Small Fires",enabled(){return n.gt(u.value,0)}})),Z(()=>({addend(){return S.value},description:"Bonfires",enabled(){return n.gt(x.value,0)}})),Z(()=>({addend(){return Te.value},description:"Charcoal Kilns",enabled(){return n.gt(ee.value,0)}})),I(()=>({multiplier:2,description:"Carry ash in boxes",enabled:wt.upgrades.ashUpgrade.bought})),I(()=>({multiplier:()=>n.div(wt.buyables.ashBoxesBuyable.amount.value,2).add(1),description:"Carry more ash",enabled:wt.upgrades.ashUpgrade.bought})),I(()=>({multiplier:()=>n.div(y.amount.value,1e3).add(1),description:"Small Fires Synergy",enabled:Ke.elves.smallFireElf.bought})),I(()=>({multiplier:()=>n.div(T.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:Ke.elves.bonfireElf.bought})),I(()=>({multiplier:()=>n.div(xe.amount.value,100).add(1),description:"Kiln Synergy",enabled:Ke.elves.kilnElf.bought})),I(()=>({multiplier:4,description:"Mining boots",enabled:Gt.metalUpgrades.metalUpgrade1.bought}))]),fl=C(()=>It.apply(0)),Ul=W(()=>[Z(()=>({addend(){return n.negate(d.value)},description:"Small Fires",enabled(){return n.gt(u.value,0)}})),Z(()=>({addend(){return n.negate(te.value)},description:"Bonfires",enabled(){return n.gt(x.value,0)}})),Z(()=>({addend(){return n.negate(Ye.value)},description:"Charcoal Kilns",enabled(){return n.gt(ee.value,0)}}))]),Cl=C(()=>Ul.apply(0)),[$l,ql]=ml(()=>[{title:"Log Consumption",modifier:Ul,base:0,visible(){return n.gt(u.value,0)||n.gt(x.value,0)||n.gt(ee.value,0)}},{title:"Coal Gain",modifier:$t,base:0,visible(){return n.gt(u.value,0)||n.gt(x.value,0)||n.gt(ee.value,0)}},{title:"Ash Gain",modifier:It,base:0,visible(){return n.gt(u.value,0)||n.gt(x.value,0)||n.gt(ee.value,0)}}]),Qt=O(!1),Vl=B(()=>o(gt,{modelValue:Qt.value,"onUpdate:modelValue":D=>Qt.value=D},{header:()=>o("h2",null,[e,c(" Modifiers")]),body:$l}));$e.on("update",D=>{n.lt(j.day.value,jn)||n.times(D,Cl.value).negate().gt(pe.logs.value)||(pe.logs.value=n.times(D,Cl.value).plus(pe.logs.value),i.value=n.times(D,ct.value).plus(i.value),s.value=n.times(D,fl.value).plus(s.value),u.value=n.max(u.value,0))});const{total:gl,trackerDisplay:Gl}=pl({resource:i,goal:1e7,name:e,day:jn,color:t,modal:{show:Qt,display:Vl}});return{name:e,color:t,coal:i,totalCoal:gl,computedCoalGain:ct,ash:s,activeFires:u,buildFire:y,activeBonfires:x,buildBonfire:T,activeKilns:ee,buildKiln:xe,activeDrills:ue,buildDrill:Me,warmerCutters:Ee,warmerPlanters:lt,basicFertilizer:Oe,unlockBonfire:de,dedicatedCutters:nt,dedicatedPlanters:Q,betterFertilizer:dt,unlockKiln:De,efficientSmelther:Lt,heatedCutters:Rt,heatedPlanters:R,moreFertilizer:Nt,computedHeatedCutterEffect:Ot,computedHeatedPlanterEffect:Ut,computedFertilizerEffect:Ol,generalTabCollapsed:ql,minWidth:700,display:B(()=>o(E,null,[ne(Gl),o(he,null,null),o(kt,{resource:i,color:t,style:"margin-bottom: 0",effectDisplay:n.gt(ct.value,0)?`+${ye(ct.value)}/s`:void 0},null),o(he,null,null),o(kt,{resource:s,color:l,style:"margin-bottom: 0",effectDisplay:n.gt(fl.value,0)?`+${ye(fl.value)}/s`:void 0},null),o(he,null,null),o(xl,null,{default:()=>[o(bt,null,{default:()=>[ne(y),o("div",null,[ce(n.floor(u.value)),c("/"),ce(n.floor(y.amount.value))]),Ce(h,_,g,w)]}),de.bought.value?o(E,null,[o(he,null,null),o(bt,null,{default:()=>[ne(T),o("div",null,[ce(x.value),c("/"),ce(T.amount.value)]),Ce(ke,ie,me,Fe)]})]):void 0,De.bought.value?o(E,null,[o(he,null,null),o(bt,null,{default:()=>[ne(xe),o("div",null,[ce(ee.value),c("/"),ce(xe.amount.value)]),Ce(He,oe,re,rt)]})]):void 0,ft.coalDrill.bought.value?o(E,null,[o(he,null,null),o(bt,null,{default:()=>[ne(Me),o("div",null,[ce(ue.value),c("/"),ce(Me.amount.value)]),Ce(Re,ve,Ie,Ze)]})]):void 0]}),o(he,null,null),Ce(...ht),Ce(...le),Ce(...St),Ce(...yt)]))}}),nr="metal",Wn=7,ft=Tt(nr,function(){const e="Metal",t="#888B8D",l=ot(0,"metal ingots",void 0,!0),a=Vn(l),i=ot(0,"ore"),s=Vn(i),u=W(()=>[I(()=>({multiplier:5,description:"Crucible",enabled:xe.bought})),I(()=>({multiplier:1.5,description:"Industrial Crucible",enabled:()=>n.gte(ue.amount.value,1)})),I(()=>({multiplier:2,description:"Industrial Furnace",enabled:rt.bought})),I(()=>({multiplier:()=>n.add(Ze.value,1),description:"Hotter Forges",enabled:()=>n.gte(Me.amount.value,1)}))]),d=C(()=>u.apply(.1)),m=W(()=>[Z(()=>({addend:()=>n.times(ue.amount.value,10),description:"Industrial Crucibles",enabled:()=>n.gte(ue.amount.value,1)})),I(()=>({multiplier:2,description:"Efficient Crucibles",enabled:U.efficientSmelther.bought})),I(()=>({multiplier:()=>n.mul(We.activeSmelter.value,We.oilEffectiveness.value).add(1),description:"Oil Smelter",enabled:()=>n.gt(We.activeSmelter.value,0)}))]),p=C(()=>m.apply(0)),y=W(()=>[I(()=>({multiplier:3,description:"Efficient Crucibles",enabled:U.efficientSmelther.bought})),I(()=>({multiplier:()=>n.add(We.activeBurner.value,1).mul(We.oilEffectiveness.value),description:"Blaster Burner",enabled:We.row2Upgrades[2].bought}))]),h=C(()=>y.apply(1)),w=1e10,g=C(()=>n.min(i.value,n.div(U.coal.value,w)).floor().max(0)),_=Ct(()=>({display:B(()=>{const de=n.gte(g.value,1)?g.value:n.add(g.value,1);return o(E,null,[o("span",{style:"font-size: large"},[c("Smelt "),Y(n.times(g.value,d.value))," ",l.displayName]),o("br",null,null),o("span",{style:"font-size: large"},[c("Cost: "),J(de),c(" "),i.displayName,c(";")," ",J(n.times(de,w)),c(" "),U.coal.displayName])])}),canClick:()=>n.gte(g.value,1),onClick(){!r(this.canClick)||A(g.value)},style:{width:"600px",minHeight:"unset"}}));function A(de,ht=1){const[nt,Q,dt]=[n.times(de,d.value).times(ht),de,n.times(de,w)];l.value=n.add(l.value,nt),i.value=n.sub(i.value,Q),U.coal.value=n.sub(U.coal.value,dt)}const x=W(()=>[Z(()=>({addend:()=>oe.amount.value,description:"Mining Drills",enabled:()=>n.gte(oe.amount.value,1)})),I(()=>({multiplier:()=>n.mul(We.depth.value,.05).add(1),description:"25m Well Depth",enabled:We.depthMilestones[2].earned})),I(()=>({multiplier:We.extractorOre,description:"Heavy Extractor",enabled:()=>n.gt(We.activeExtractor.value,0)}))]),te=C(()=>x.apply(1)),M=W(()=>[I(()=>({multiplier:2,description:"A Simple Pickaxe",enabled:qe.bought})),I(()=>({multiplier:2,description:"Double Pickaxe",enabled:Te.bought})),I(()=>({multiplier:2.5,description:"Mining Drills",enabled:()=>n.gte(oe.amount.value,1)})),I(()=>({multiplier:2,description:"Efficient Drills",enabled:re.bought})),I(()=>({multiplier:2,description:"Oil the Mining Drills",enabled:We.row2Upgrades[1].bought}))]),S=C(()=>M.apply(n.recip(ke))),T=ge(0),ke=10,Fe=jt(()=>({width:400,height:25,direction:fe.Right,fillStyle:{backgroundColor:t},progress:()=>T.value})),me=W(()=>[Z(()=>({addend:te})),I(()=>({multiplier:S}))]),ie=C(()=>me.apply(0)),ee=W(()=>[Z(()=>({addend:ie})),Z(()=>({addend:()=>n.negate(p.value),enabled:we}))]),Ye=C(()=>ee.apply(0)),qe=G(()=>({resource:q(l),cost:.1,display:{title:"A Simple Pickaxe",description:"Make a simple pickaxe to help mine faster.<br/><br/>Halve the time to mine more ore"}})),Te=G(()=>({resource:q(l),cost:.1,display:{title:"Double Pickaxe",description:"This is too slow. What if you swung two pickaxes at once?<br/><br/>Halve the time to mine ore, again"},visibility:()=>F(Te.bought.value)})),xe=G(()=>({resource:q(l),cost:1,display:{title:"Crucible",description:"Smelting this all by hand is rather painful, and a lot of the metal is left in the slag. A small crucible should help a lot!<br/><br/>Increase the metal extracted per ore by 5x"},visibility:()=>F(xe.bought.value||n.div(s.value,d.value).plus(a.value).gte(1))})),He=G(()=>({resource:q(l),cost:0,display:{title:"Coal Drilling",description:"These mining drills are pretty powerful, mining more ore than you can actually smelt. Could be worth making some to mine coal instead"},visibility:()=>F(n.gte(oe.amount.value,1)&&(He.bought.value||n.lt(U.computedCoalGain.value,n.times(te.value,S.value).times(w)))),onPurchase(){j.days[2].recentlyUpdated.value=!0}})),rt=G(()=>({canAfford(){return n.gte(l.value,50)&&n.gte(U.coal.value,1e11)},onPurchase(){l.value=n.sub(l.value,50),U.coal.value=n.sub(U.coal.value,1e11)},display:{title:"Industrial Furnace",description:`Moving smelting out of the open air and into a dedicated furnace should make efficiency even better. Double metal gained per ore
<br/>
<br/>
Cost: 50 ${l.displayName}<br/>${Y(1e11)} ${U.coal.displayName}`}})),re=G(()=>({resource:q(l),cost:1e5,display:{title:"Efficient Drills",description:"Use metal and a bunch of R&D to make drilling stuff faster. Double coal and ore mining speed."},visibility:()=>F(We.depthMilestones[4].earned.value)})),oe=Be(()=>({resource:q(l),cost(){return n.pow(1.15,this.amount.value).times(10)},display:{title:"Mining Drill",description:"An automated machine to help you mine more ore, faster",effectDisplay:B(()=>o(E,null,[c("Mine 2.5x faster. Increase ore mining amount by")," ",J(oe.amount.value),c(" ore per operation")]))},visibility:()=>F(n.gte(oe.amount.value,1)||n.div(s.value,d.value).plus(a.value).gte(10)),style:{width:"200px"}})),ue=Be(()=>({resource:q(l),cost(){return n.pow(1.15,n.times(this.amount.value,10)).times(10)},display:{title:"Industrial Crucible",description:"A giant automated crucible furnace, letting you smelt ore faster",effectDisplay:B(()=>o(E,null,[c("Automatically smelts")," ",J(n.times(ue.amount.value,10)),c(" ore per second")]))},visibility:()=>F(n.gte(ue.amount.value,1)||n.gte(oe.amount.value,4)||n.gte(s.value,50)),style:{width:"200px"}})),we=ge(!0),Me=Be(()=>({resource:U.coal,cost(){return n.pow(10,this.amount.value).times(1e12)},display:{title:"Hotter Forges",description:"More coal makes the fires burn hotter, getting just a little more metal out of each bit of ore",effectDisplay:B(()=>o(E,null,[c("Gain "),J(n.times(Ze.value,100)),c("% more metal per ore")]))},visibility:()=>F(n.gte(Me.amount.value,1)||rt.bought.value),style:{width:"200px"}})),Ze=C(()=>n.times(Me.amount.value,.25));$e.on("update",de=>{T.value=n.times(de,S.value).plus(T.value);const ht=T.value.trunc();T.value=T.value.minus(ht),i.value=n.add(i.value,n.times(ht,te.value)),we.value&&A(n.min(g.value,n.times(p.value,de)),h.value)});const[Re,Ie]=ml(()=>[{title:"Auto Smelt Speed",modifier:m,base:0,unit:"/s",visible(){return n.gt(ue.amount.value,0)}},{title:"Auto Smelt Multiplier",modifier:y,base:1,visible(){return n.gt(h.value,1)}},{title:"Metal per Ore",modifier:u,base:.1},{title:"Ore per Mining Operation",modifier:x,base:1},{title:"Mining Speed",modifier:M,base:.1,unit:"/s"}]),ve=O(!1),Ee=B(()=>o(gt,{modelValue:ve.value,"onUpdate:modelValue":de=>ve.value=de},{header:()=>o("h2",null,[e,c(" Modifiers")]),body:Re})),{total:lt,trackerDisplay:Oe}=pl({resource:l,goal:25e3,name:e,day:Wn,color:t,modal:{show:ve,display:Ee}});return{name:e,day:Wn,color:t,ore:i,bestOre:s,oreProgress:T,metal:l,bestMetal:a,totalMetal:lt,simplePickaxe:qe,doublePickaxe:Te,crucible:xe,coalDrill:He,industrialFurnace:rt,efficientDrill:re,oreDrill:oe,industrialCrucible:ue,autoSmeltEnabled:we,hotterForge:Me,generalTabCollapsed:Ie,minWidth:700,display:B(()=>o(E,null,[ne(Oe),o(he,null,null),o(kt,{resource:l,color:t,style:"margin-bottom: 0",sticky:!1,productionDisplay:B(()=>o(E,null,[we.value&&n.gte(ue.amount.value,1)?`+${sa([[p.value,"smelting speed"],[ie.value,"ore gain"],[n.div(U.computedCoalGain.value,w),"coal gain"]],"/s",n.mul(d.value,h.value))}`:void 0]))},null),o(he,null,null),ne(_),n.gte(ue.amount.value,1)?o("div",{style:{width:"150px"}},[o(Ht,{title:"Auto Smelt",modelValue:we.value,"onUpdate:modelValue":de=>we.value=de},null)]):void 0,o(he,null,null),o(kt,{resource:i,color:t,style:"margin-bottom: 0",sticky:!1,productionDisplay:B(()=>o(E,null,[ra(Ye.value)]))},null),o(he,null,null),o("div",null,[c("Currently mining "),Y(te.value),c(" ore every")," ",Y(n.recip(S.value)),c(" seconds")]),ne(Fe),o(he,null,null),Ce(qe,Te,xe,He,rt,re),Ce(oe,ue,Me)]))}}),ar="cloth",zn=8,Gt=Tt(ar,function(){const e="Cloth",t="white",l=ot(0,"cloth"),a=ot(0,"wool"),i=ot(10,"sheep"),s=ge(0),u=jt(()=>({direction:fe.Right,width:100,height:10,style:"margin-top: 8px",borderStyle:"border-color: black",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s; background: black",progress:()=>n.div(s.value,we.value)})),d=Ct(()=>({display:{title:"Breed sheep",description:B(()=>o(E,null,[c("Breed "),J(n.floor(oe.value)),c(" sheep"),o("br",null,null),ne(u)]))},style:{minHeight:"80px"},canClick:()=>n.gte(s.value,we.value),onClick(){if(n.lt(s.value,we.value))return;const le=n.floor(oe.value);i.value=n.add(i.value,le),s.value=0}})),m=ge(0),p=jt(()=>({direction:fe.Right,width:100,height:10,style:"margin-top: 8px",borderStyle:"border-color: black",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s; background: black",progress:()=>n.div(m.value,Ie.value)})),y=Ct(()=>({display:{title:"Shear sheep",description:B(()=>o(E,null,[c("Shear up to "),J(n.floor(Ze.value)),c(" sheep"),o("br",null,null),ne(p)]))},style:{minHeight:"80px"},canClick:()=>n.gte(m.value,Ie.value),onClick(){if(n.lt(m.value,Ie.value))return;const le=n.min(i.value,Ze.value).floor();a.value=n.add(a.value,le),m.value=0}})),h=ge(0),w=jt(()=>({direction:fe.Right,width:100,height:10,style:"margin-top: 8px",borderStyle:"border-color: black",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s; background: black",progress:()=>n.div(h.value,Oe.value)})),g=Ct(()=>({display:{title:"Spinning wool",description:B(()=>o(E,null,[c("Spin "),J(n.floor(Ee.value)),c(" wool"),o("br",null,null),ne(w)]))},style:{minHeight:"80px"},canClick:()=>n.gte(h.value,Oe.value),onClick(){if(n.lt(h.value,Oe.value))return;const le=n.min(a.value,Ee.value).floor();l.value=n.add(l.value,le),a.value=n.sub(a.value,le),h.value=0}})),_=bl(()=>({key:"b",description:'Press the "Breed Sheep" button',onPress:()=>{d.canClick.value&&d.onClick()}})),A=bl(()=>({key:"h",description:'Press the "Shear Sheep" button',onPress:()=>{y.canClick.value&&y.onClick()}})),x=bl(()=>({key:"s",description:'Press the "Spin Wool" button',onPress:()=>{g.canClick.value&&g.onClick()}})),te=Be(()=>({resource:pe.logs,cost(){let le=this.amount.value;return n.gte(le,100)&&(le=n.pow(le,2).div(100)),n.pow(1.5,le).times(1e14)},display:{title:"Build more pens",description:"Breed +1 sheep at once"}})),M=Be(()=>({resource:ft.metal,cost(){let le=this.amount.value;return n.gte(le,100)&&(le=n.pow(le,2).div(100)),n.pow(1.4,le).times(1e4)},display:{title:"Make stronger shears",description:"Shear +1 sheep at once"}})),S=Be(()=>({resource:Ae.paper,cost(){let le=this.amount.value;return n.gte(le,100)&&(le=n.pow(le,2).div(100)),n.pow(1.3,le).times(1e6)},display:{title:"Learn how to spin",description:"Spin +1 wool at once"}})),T=G(()=>({resource:q(l),cost:100,display:{title:"Lumberjack Boots",description:"Quadruple log gain"}})),ke=G(()=>({resource:q(a),cost:150,visibility:()=>F(T.bought.value),display:{title:"Lumberjack Jeans",description:"Quadruple trees cut"}})),me={treesUpgrade3:G(()=>({resource:q(i),cost:200,visibility:()=>F(ke.bought.value),display:{title:"Lumberjack Plaid",description:"Quadruple trees planted"}})),treesUpgrade2:ke,treesUpgrade1:T},ie=G(()=>({resource:q(l),cost:150,display:{title:"Mining boots",description:"Quadruple ash gain"}})),ee=G(()=>({resource:q(a),cost:225,visibility:()=>F(ie.bought.value),display:{title:"Mining overalls",description:"Double coal gain"}})),qe={metalUpgrade3:G(()=>({resource:q(i),cost:300,visibility:()=>F(ee.bought.value),display:{title:"Mining helmet",description:"Triple coal gain"}})),metalUpgrade2:ee,metalUpgrade1:ie},Te=G(()=>({resource:q(l),cost:200,display:{title:"Scholar's shoes",description:"Double paper gain"}})),xe=G(()=>({resource:q(a),cost:200,visibility:()=>F(Te.bought.value),display:{title:"Scholar's slacks",description:"Double paper gain"}})),rt={paperUpgrade3:G(()=>({resource:q(i),cost:400,visibility:()=>F(xe.bought.value),display:{title:"Scholar's jacket",description:"Double paper gain"}})),paperUpgrade2:xe,paperUpgrade1:Te},re=W(()=>[Z(()=>({addend:te.amount,description:"Build more pens"}))]),oe=C(()=>re.apply(1)),ue=W(()=>[]),we=C(()=>ue.apply(1)),Me=W(()=>[Z(()=>({addend:M.amount,description:"Make stronger shears"}))]),Ze=C(()=>Me.apply(1)),Re=W(()=>[]),Ie=C(()=>Re.apply(1)),ve=W(()=>[Z(()=>({addend:S.amount,description:"Learn how to spin"}))]),Ee=C(()=>ve.apply(1)),lt=W(()=>[]),Oe=C(()=>lt.apply(1)),[de,ht]=ml(()=>[{title:"Sheep Gain",modifier:re,base:1},{title:"Sheep Breeding Cooldown",modifier:ue,base:1,visible:!1,unit:"s"},{title:"Shearing Amount",modifier:Me,base:1},{title:"Shearing Cooldown",modifier:Re,base:1,visible:!1,unit:"s"},{title:"Spinning Amount",modifier:ve,base:1},{title:"Spinning Cooldown",modifier:lt,base:1,visible:!1,unit:"s"}]),nt=O(!1),Q=B(()=>o(gt,{modelValue:nt.value,"onUpdate:modelValue":le=>nt.value=le},{header:()=>o("h2",null,[e,c(" Modifiers")]),body:de}));$e.on("update",le=>{n.lt(j.day.value,zn)||(n.gte(s.value,we.value)?s.value=we.value:(s.value=n.add(s.value,le),d.isHolding.value&&d.onClick()),n.gte(m.value,Ie.value)?m.value=Ie.value:(m.value=n.add(m.value,le),y.isHolding.value&&y.onClick()),n.gte(h.value,Oe.value)?h.value=Oe.value:(h.value=n.add(h.value,le),g.isHolding.value&&g.onClick()))});const{total:dt,trackerDisplay:De}=pl({resource:l,goal:1e3,name:e,day:zn,color:t,textColor:"var(--feature-foreground)",modal:{show:nt,display:Q}});return{name:e,color:t,cloth:l,totalCloth:dt,wool:a,sheep:i,buildPens:te,betterShears:M,fasterSpinning:S,treesUpgrades:me,metalUpgrades:qe,paperUpgrades:rt,generalTabCollapsed:ht,breedingProgress:s,shearingProgress:m,spinningProgress:h,breedSheepHK:_,shearSheepHK:A,spinWoolHK:x,minWidth:700,display:B(()=>o(E,null,[ne(De),o(he,null,null),o(kt,{resource:l,style:"margin-bottom: 0"},null),o(kt,{resource:a,style:"margin-bottom: 0"},null),o(kt,{resource:i,style:"margin-bottom: 0"},null),Ce(d,y,g),Ce(te,M,S),o(he,null,null),o(xl,null,{default:()=>[Nl(...Object.values(me)),Nl(...Object.values(qe)),Nl(...Object.values(rt))]})]))}}),ir="trees",Kn=1,Jn=.1,pe=Tt(ir,function(){const e="Trees",t="#4BDC13",l="green",a=ot(0,"logs"),i=ot(0,"saplings"),s=O(0),u=W(()=>[Z(()=>({addend:()=>n.times(me.amount.value,10),description:"Expand Forest",enabled:S.bought})),Z(()=>({addend:()=>n.div(pt.foundationProgress.value,2),description:"75% Foundation Completed",enabled:pt.milestones.morePlantsMilestone1.earned})),I(()=>({multiplier:2,description:"5 Elves Trained",enabled:Ke.milestones[4].earned})),I(()=>({multiplier:2,description:"8 Elves Trained",enabled:Ke.milestones[7].earned})),I(()=>({multiplier:4,description:"Lumberjack Boots",enabled:Gt.treesUpgrades.treesUpgrade1.bought}))]),d=ot(C(()=>n.sub(u.apply(10),i.value)),"trees"),m=C(()=>u.apply(10)),p=G(()=>({resource:q(a),cost:10,display:{title:"Wooden Fingers",description:"Cut down an additional tree per click"}})),y=G(()=>({resource:q(a),cost:10,display:{title:"Leafy Fingers",description:"Plant an additional tree per click"}})),h=G(()=>({resource:q(a),cost:25,display:{title:"Automated Knives",description:"Cut down a tree every second"}})),w=G(()=>({resource:q(a),cost:25,display:{title:"Automated Spade",description:"Plant a tree every second"}})),g=G(()=>({resource:q(a),cost:40,display:{title:"Research I",description:"Trees give 25% more logs, and unlock more upgrades"}})),_=[p,y,h,w,g],A=G(()=>({resource:q(a),cost:50,visibility:()=>F(g.bought.value),display:{title:"Sharper Fingers",description:"Manually cut trees twice as often"}})),x=G(()=>({resource:q(a),cost:50,visibility:()=>F(g.bought.value),display:{title:"Greener Fingers",description:"Manually Plant trees twice as often"}})),te=G(()=>({resource:q(a),cost:150,visibility:()=>F(g.bought.value),display:{title:"Smart Knives",description:"Each time you manually chop trees, gain 1s of automatic tree chopping production"}})),M=G(()=>({resource:q(a),cost:150,visibility:()=>F(g.bought.value),display:{title:"Smart Spades",description:"Each time you manually plant trees, gain 1s of automatic tree planting production"}})),S=G(()=>({resource:q(a),cost:300,visibility:()=>F(g.bought.value),display:{title:"Research II",description:"Trees give 25% more logs, and unlock repeatable purchases"}})),T=[A,x,te,M,S],ke=Be(()=>({resource:q(a),cost(){let R=this.amount.value;return n.gte(R,50)&&(R=n.pow(R,2).div(50)),n.gte(R,200)&&(R=n.pow(R,2).div(200)),n.gte(R,2e6)&&(R=n.pow(R,2).div(2e6)),R=n.pow(.95,Ae.books.cuttersBook.amount.value).times(R),n.times(100,R).add(200)},display:{title:"Generic Cutters",description:"Each cutter cuts down 1 tree/s"},visibility:()=>F(S.bought.value)})),Fe=Be(()=>({resource:q(a),cost(){let R=this.amount.value;return n.gte(R,50)&&(R=n.pow(R,2).div(50)),n.gte(R,200)&&(R=n.pow(R,2).div(200)),n.gte(R,2e6)&&(R=n.pow(R,2).div(2e6)),R=n.pow(.95,Ae.books.plantersBook.amount.value).times(R),n.times(100,R).add(200)},display:{title:"Generic Planters",description:"Each planter plants 0.5 trees/s"},visibility:()=>F(S.bought.value)})),me=Be(()=>({resource:q(a),cost(){let R=this.amount.value;return n.gte(R,100)&&(R=n.pow(R,2).div(100)),n.gte(R,1e5)&&(R=n.pow(R,2).div(1e5)),R=n.pow(.95,Ae.books.expandersBook.amount.value).times(R),n.pow(n.add(R,1),1.5).times(500)},display:{title:"Expand Forest",description:"Add 10 trees to the forest"},visibility:()=>F(S.bought.value)})),ie=[ke,Fe,me],ee=W(()=>[Z(()=>({addend:1,description:"Wooden Fingers",enabled:p.bought})),Z(()=>({addend:He,description:"Smart Knives",enabled:te.bought}))]),Ye=C(()=>ee.apply(1)),qe=W(()=>[I(()=>({multiplier:.5,description:"Sharper Fingers",enabled:A.bought})),I(()=>({multiplier:()=>n.pow(.5,Ke.totalElves.value),description:"1 Elf Trained",enabled:Ke.milestones[0].earned}))]),Te=C(()=>qe.apply(1)),xe=W(()=>[Z(()=>({addend:1,description:"Automated Knives",enabled:h.bought})),Z(()=>({addend:ke.amount,description:"Generic Cutters",enabled:S.bought})),Z(()=>({addend:()=>n.div(pt.foundationProgress.value,5).floor(),description:"10% Foundation Completed",enabled:pt.milestones.autoCutMilestone1.earned})),I(()=>({multiplier:2,description:"30% Foundation Completed",enabled:pt.milestones.autoCutMilestone2.earned})),I(()=>({multiplier:2,description:"Warmer Cutters",enabled:U.warmerCutters.bought})),I(()=>({multiplier:U.computedHeatedCutterEffect,description:"Heated Cutters",enabled:()=>n.gt(U.heatedCutters.amount.value,0)})),I(()=>({multiplier:4,description:"Lumberjack Jeans",enabled:Gt.treesUpgrades.treesUpgrade2.bought}))]),He=C(()=>xe.apply(0)),rt=W(()=>[Z(()=>({addend:1,description:"Leafy Fingers",enabled:y.bought})),Z(()=>({addend:Me,description:"Smart Spades",enabled:M.bought}))]),re=C(()=>rt.apply(1)),oe=W(()=>[I(()=>({multiplier:.5,description:"Greener Fingers",enabled:x.bought})),I(()=>({multiplier:()=>n.pow(.5,Ke.totalElves.value),description:"1 Elf Trained",enabled:Ke.milestones[0].earned}))]),ue=C(()=>oe.apply(1)),we=W(()=>[Z(()=>({addend:1,description:"Automated Spade",enabled:w.bought})),Z(()=>({addend:()=>n.div(Fe.amount.value,2),description:"Generic Planters",enabled:S.bought})),Z(()=>({addend:()=>n.div(pt.foundationProgress.value,10).floor(),description:"20% Foundation Completed",enabled:pt.milestones.autoPlantMilestone1.earned})),I(()=>({multiplier:2,description:"40% Foundation Completed",enabled:pt.milestones.autoPlantMilestone2.earned})),I(()=>({multiplier:2,description:"Warmer Planters",enabled:U.warmerPlanters.bought})),I(()=>({multiplier:U.computedHeatedPlanterEffect,description:"Heated Planters",enabled:()=>n.gt(U.heatedPlanters.amount.value,0)})),I(()=>({multiplier:4,description:"Lumberjack Plaid",enabled:Gt.treesUpgrades.treesUpgrade3.bought}))]),Me=C(()=>we.apply(0)),Ze=W(()=>[I(()=>({multiplier:1.25,description:"Research I",enabled:g.bought})),I(()=>({multiplier:1.25,description:"Research II",enabled:S.bought})),I(()=>({multiplier:()=>n.div(pt.foundationProgress.value,20).add(1),description:"1% Foundation Completed",enabled:pt.milestones.logGainMilestone1.earned})),I(()=>({multiplier:2,description:"50% Foundation Completed",enabled:pt.milestones.logGainMilestone2.earned})),I(()=>({multiplier:1.25,description:"Ashy Soil",enabled:U.basicFertilizer.bought})),I(()=>({multiplier:U.computedFertilizerEffect,description:"Fertilized Soil",enabled:()=>n.gt(U.moreFertilizer.amount.value,0)})),I(()=>({multiplier:2,description:"4 Elves Trained",enabled:Ke.milestones[3].earned})),I(()=>({multiplier:2,description:"Carry logs in boxes",enabled:wt.upgrades.logsUpgrade.bought})),I(()=>({multiplier:()=>n.div(wt.buyables.logBoxesBuyable.amount.value,2).add(1),description:"Carry more logs",enabled:wt.upgrades.logsUpgrade.bought})),Aa(()=>({exponent:1.2,description:"100% Foundation Completed",enabled:pt.milestones.logGainMilestone3.earned}))]),Re=ge(0),Ie=jt(()=>({direction:fe.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>n.div(Re.value,Te.value)})),ve=Ct(()=>({display:{title:"Cut trees",description:B(()=>o(E,null,[c("Cut down up to "),ce(n.floor(Ye.value))," ",c("tree"),n.eq(Ye.value,1)?"":"s",c(" at once!"),o("br",null,null),ne(Ie)]))},style:{minHeight:"80px"},canClick:()=>n.gte(d.value,1)&&n.gte(Re.value,Te.value),onClick(){if(n.lt(Re.value,Te.value))return;const R=n.floor(n.min(d.value,n.times(Ye.value,n.div(Re.value,Te.value).floor())));a.value=n.add(a.value,n.times(Ze.apply(1),R)),i.value=n.add(i.value,R),Re.value=0}})),Ee=ge(0),lt=jt(()=>({direction:fe.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>n.div(Ee.value,ue.value)})),Oe=Ct(()=>({display:{title:"Plant trees",description:B(()=>o(E,null,[c("Plant up to "),ce(n.floor(re.value))," ",c("tree"),n.eq(re.value,1)?"":"s",c(" at once!"),o("br",null,null),ne(lt)]))},style:{minHeight:"80px"},canClick:()=>n.gte(i.value,1)&&n.gte(Ee.value,ue.value),onClick(){if(n.lt(Ee.value,ue.value))return;const R=n.floor(n.min(i.value,n.times(re.value,n.div(Ee.value,ue.value).floor())));i.value=n.sub(i.value,R),Ee.value=0}})),[de,ht]=ml(()=>[{title:"Logs per Tree",modifier:Ze,base:1,visible:g.bought},{title:"Manual Cutting Amount",modifier:ee,base:1,visible:p.bought,unit:"/click"},{title:"Manual Cutting Cooldown",modifier:qe,base:1,visible:p.bought,unit:"s"},{title:"Manual Planting Amount",modifier:rt,base:1,visible:y.bought,unit:"/click"},{title:"Manual Planting Cooldown",modifier:oe,base:1,visible:y.bought,unit:"s"},{title:"Auto Cutting Amount",modifier:xe,base:0,visible:h.bought,unit:"/s"},{title:"Auto Planting Amount",modifier:we,base:0,visible:w.bought,unit:"/s"},{title:"Forest Size",modifier:u,base:10,visible:S.bought}]),nt=O(!1),Q=B(()=>o(gt,{modelValue:nt.value,"onUpdate:modelValue":R=>nt.value=R},{header:()=>o("h2",null,[e,c(" Modifiers")]),body:de}));$e.on("update",R=>{if(n.lt(j.day.value,Kn))return;n.gte(Re.value,Te.value)?Re.value=Te.value:(Re.value=n.add(Re.value,R),ve.isHolding.value&&ve.onClick()),n.gte(Ee.value,ue.value)?Ee.value=ue.value:(Ee.value=n.add(Ee.value,R),Oe.isHolding.value&&Oe.onClick());const Nt=n.min(d.value,n.times(He.value,R)),yt=n.mul(Ze.apply(1),Nt),je=n.div(yt,R);s.value=n.mul(je,Jn).add(n.mul(s.value,n.dOne.sub(Jn))),a.value=n.add(a.value,yt),i.value=n.add(i.value,Nt);const Ot=n.min(i.value,n.times(Me.value,R));i.value=n.sub(i.value,Ot)});const dt=C(()=>n.sub(He.value,Me.value)),De=C(()=>n.sub(Me.value,He.value)),le=bl(()=>({key:"c",description:'Press the "Cut trees" button.',onPress:()=>{ve.canClick.value&&ve.onClick()}})),Lt=bl(()=>({key:"p",description:'Press the "Plant trees" button.',onPress:()=>{Oe.canClick.value&&Oe.onClick()}})),{total:St,trackerDisplay:Rt}=pl({resource:a,goal:1e4,name:e,day:Kn,color:l,modal:{show:nt,display:Q}});return{name:e,color:t,logs:a,totalLogs:St,trees:d,saplings:i,cutTree:ve,plantTree:Oe,cutTreeHK:le,plantTreeHK:Lt,row1Upgrades:_,row2Upgrades:T,row1Buyables:ie,manualCutProgress:Re,manualPlantProgress:Ee,generalTabCollapsed:ht,minWidth:700,display:B(()=>o(E,null,[ne(Rt),o(he,null,null),o(kt,{resource:a,color:t,style:"margin-bottom: 0",productionDisplay:n.gt(He.value,0)?`+${ye(s.value)}/s average<br/>equilibrium: +${ua([[He.value,"cutting speed"],[Me.value,"planting speed"],[n.mul(m.value,20),"forest cap"]],"/s",Ze.apply(1))}`:void 0},null),o(kt,{resource:i,color:l,style:"margin-bottom: 0",productionDisplay:Kl(dt.value)},null),o(kt,{resource:d,color:l,style:"margin-bottom: 0",productionDisplay:Kl(De.value)},null),o(he,null,null),Ce(ve,Oe),o("div",null,[c("Tip: You can hold down on actions to perform them automatically")]),o(he,null,null),Ce(..._),Ce(...T),Ce(...ie)]))}});var Ma="./assets/tree.35808197.png",Ia="./assets/sws.714ad454.png",Ea="data:image/png;base64,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",Ba="./assets/elf.9fbfa563.png",xa="./assets/paperStacks.4c96ec8c.png",Da="data:image/png;base64,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",Pa="./assets/metal.7407f5d1.png",Fa="./assets/cloth.7bcd7f37.png",Ta="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAFxGAABcRgEUlENBAAAAG3RFWHRTb2Z0d2FyZQBDZWxzeXMgU3R1ZGlvIFRvb2zBp+F8AAAE/ElEQVR42u3dW3baMBRAURhzO4x2zO5P25WPPAhIuq99JhAsayNwbHG/rusm6f3ugEiASIBIgEiASIBIgEiASIBIgNQ+mPv9/8Fc13V3ejUeyFsUnwWMRgF5FAYoGgXkWRiQqD2QFThAUUsgq3FAIkAgESCQCJDtQCARIJAIEEAECCQCJArISSQfHRekgIxG4h4yQCBZdAyQADLi+0jlGyw/e+2dAY+7mzdqgr76ek9OQjeENgBSDUl2IO51awjkJJRXTnTWd2T/WxoCJDOSla9r1UQ7faGjMpKWmzZk+riQCUgEjOpIWu9qsmNCfOckZ3nAKxpGZSRjtv2JeCePXj0ywQBkEJZHTnLk6pERBiDDsHx1oqOAZMZREYmdFZ+YYBlXkAowABmAJuqd/LO/WwkHIDqGoxoM30F0DEhFHIBoO5CqMADRFiBwAALIA5MKDkCWTbTIk7Hj41V1HIAknmCnT06HyQxHUiDVd0+EoxeOVEA6PKMASC8caYBkmFjVn7WAoymQrBPr7ZfjTvdBwVEISPVbJcDojQMQwQGI4ABEcAAiMAARMIAAAgwggKg8FEAECSACBBBB0gsIJIAAAogAgUS+gwAiQCARHAmBQAIIIJCoGKCU+2JBAgwgkKgAFiuIQPElXZAUBgKGsiJxq4kgyQgEDFVAEgIEDlVBchwIHAIEDDVBcgQIHAIEDgEChwABRJDsBgKHAIFDgAAiQOAQIIAIEEAECCASIBIgUk4cgAgQQAQHIAKkBhBI1AXHNiCgqAOO7UAgUWUcR4DAooowQoAAo0o4woFAoqwwrCACAxCBURQIHMoMIxQIHLKCAKIGWGxeLVCyAIFD1ZAAIlAyAInG8dXgwgvJWCDfHVRYIDkKJGLCrRhEUABpB2T14EEyG0mr50F2DRokgJQHsn13C0hGImnxyO2RgSoI5N+4dMUNSLblNvlEm3a1rjSQbjiyT6iJV+0ASQYk8yRaOQ5VoACSEMjfY/t1u91+JJknv6/r+ukNoRCQDpd2AckNBRBAUgHJhgWQpDgSvpseBxI9FuVvNekOJNEqEooj4ryXv5u3+8crQOLmQYvnQSasHoCcnxdtth4FpAaQj85T0EWPK9O5BaTPl/WngDzyujPvVQVIkZMXDGT56gELIIC88NonQgFkKBBImgLJdoICkSy5gvXs658Cpdw/CgFZC+TVY+gOpRSQlJsbNwACCSDdgGz5ByEkh4DsmDhZT0AnIJAcBLJyAmUf+AAkKYF0RAIIIJBEApmwbAPSF0nqnz+oMsiAAHJ08CsO7uG7e0ts1NABSaqfga48oAeBbH8GZOWKWB1JKJBOdQEy5fI8IH2/h5RaQcp/MgAEkN3HAYhOfsyyggACSCcglZEAAggggAACCCCAAAIIIDV3cwdEp5AAAgggnYC4zKt2QFYiAUQtgaxA4l4stQbyChK3u2sEkGeRAKIxQL4DxTPpikSS5kdz3sNiVxMB8g4UG8cJkInnEhBABAggAgQQAQIIIIAAAgggkAACCCCAACJAABEggAgQAQKIAAFEgAAiQACBBBBAAAEEEEAAESCACBBABAggRqEeEEgAAQQQQAABBBBAAAFEp4FAAggggAACCCCAAAIJIAIEECXCAQgggEACCCCAAAIIIIAoAggkgAACCCBwAAIIIJAAAggggCgZEEgAgQMQQACBBBBAAAEEDkgK9wfV+oLa+LwMvQAAAABJRU5ErkJggg==";const j=Tt("main",function(){const e=ge(1),t=C(()=>(+new Date(new Date().getFullYear(),11,e.value)-L.time)/1e3),l=O(!1),a=O(-1),i=O(""),s=O();function u(p){const y=ge(!1),h=ge(!1);return vt(()=>{const w=p(),g=at(w.shouldNotify),_=at(()=>r(g)||r(h));return{...w,opened:y,shouldNotify:_,recentlyUpdated:h,[al]:Wo,[il]:function(){const{day:A,layer:x,symbol:te,opened:M,shouldNotify:S,story:T,completedStory:ke,recentlyUpdated:Fe}=this;return{day:A,symbol:te,layer:x,opened:M,recentlyUpdated:Fe,shouldNotify:S,onOpenLore(){var ee,Ye;const me=j.day.value>A;a.value=me?A-1:-1;const ie=r((Ye=(ee=ut[x!=null?x:"trees"])==null?void 0:ee.name)!=null?Ye:"");i.value=me?`${ie} - Completed!`:ie,s.value=me?`${T}<hr style="
margin: 10px 0;"/>${ke}`:T,l.value=!0},onOpenLayer(){if(Fe.value=!1,window.matchMedia("(min-width: 1468px)").matches)if(L.tabs.includes(x!=null?x:"trees")){const me=L.tabs.lastIndexOf(x!=null?x:"trees");L.tabs.splice(me,1)}else L.tabs.push(x!=null?x:"trees"),j.minimized.value=!0;else L.tabs.splice(1,1/0,x!=null?x:"trees")},onUnlockLayer(){x&&(M.value=!0,setTimeout(()=>{var me,ie;a.value=-1,i.value=r((ie=(me=ut[x!=null?x:"trees"])==null?void 0:me.name)!=null?ie:""),s.value=T,L.devSpeed=null,l.value=!0},1e3))}}}}})}const d=[u(()=>({day:1,shouldNotify:!1,layer:"trees",symbol:Ma,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!"})),u(()=>({day:2,shouldNotify:!1,layer:"workshop",symbol:Ia,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!"})),u(()=>({day:3,shouldNotify:!1,layer:"coal",symbol:Ea,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!"})),u(()=>({day:4,shouldNotify:!1,layer:"elves",symbol:Ba,story:"Alright, it seems you finally have enough things set up to start bringing in the elves! Unfortunately, it seems they'll need to be retrained on how to help, since they've stopped practicing for 11 months!",completedStory:"The workshop now hums with the bustling elves working on everything. They can take it from here - you deserve a break after such a long day! Good Job!"})),u(()=>({day:5,shouldNotify:!1,layer:"paper",symbol:xa,story:"With the elves trained, we're almost ready to start working on these presents! Just a couple more pre-reqs first, starting with turning all this wood into wood pulp and finally into paper, which will be required for wrapping paper later on but in the meantime can be used to help write guides which will help these elves continue their education!",completedStory:"You look upon your rivers of book pulp as you hand out stacks of papers to elves to read through. You've continued getting closer and closer to preparing for Christmas, and can go to bed satisfied with your progress. Good Job!"})),u(()=>({day:6,shouldNotify:!1,layer:"boxes",symbol:Da,story:"You watch all these elves carrying incredibly large loads just in their open elf-sized hands, and realize there's probably a better way. You need to put the toys in boxes anyways, so why don't we get started working on those so the workers can take advantage as well?",completedStory:"Wow, those boxes are really convenient! The workshop feels more and more proper with every day. You tick another requirement on your list and start looking towards tomorrow. Good Job!"})),u(()=>({day:7,shouldNotify:!1,layer:"metal",symbol:Pa,story:"You woke up ready to make some toys, before realizing most toys these days are made out of more than just wood! You're sure you're close to really getting to work, but there's a few more materials you're going to need - like metal! Lots of things need metal!",completedStory:"The sounds of drills and metal clanging join the already loud din as yet another piece of the puzzle fits into place. You're making solid progress, Good Job!"})),u(()=>({day:8,shouldNotify:!1,layer:"cloth",symbol:Fa,story:"Another resource you're going to need for gifts is cloth! Fortunately you think this should be pretty easy to prepare using a sheep farm - and as you've already proven with the tree farm, that's something you can handle!",completedStory:"You fall into a pile of wool, sighing contentedly as you look at all the progress you've made today. Good Job!"})),u(()=>({day:9,shouldNotify:!1,layer:"oil",symbol:Ta,story:"Looks like you just need one more thing before the toy factory can start running: plastic! Every toy nowadays is made with plastic! But wait, how are you going to get plastic? What can make plastic? Wait that's right, oil! You figured out you might as well repurpose your coal and ore drills into something that can get you oil, but unfortunately you'll need to mine much deeper that you're currently doing, so let's get to work!",completedStory:"It took a while, but you finally got enough oil for the next step! You deserve a good rest after all this digging work - tomorrow will be a busy day! Good Job!"})),u(()=>({day:10,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),u(()=>({day:11,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),u(()=>({day:12,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),u(()=>({day:13,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),u(()=>({day:14,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),u(()=>({day:15,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),u(()=>({day:16,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),u(()=>({day:17,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),u(()=>({day:18,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),u(()=>({day:19,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),u(()=>({day:20,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),u(()=>({day:21,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),u(()=>({day:22,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),u(()=>({day:23,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),u(()=>({day:24,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""}))];function m(){a.value=e.value-1,i.value="Day Complete!",s.value=d[e.value-1].completedStory,l.value=!0,e.value++,j.minimized.value=!1,L.devSpeed=0}return{name:"Calendar",days:d,day:e,timeUntilNewDay:t,loreScene:a,loreTitle:i,loreBody:s,showLoreModal:l,completeDay:m,minWidth:700,display:B(()=>o(E,null,[L.devSpeed===0?o("div",null,[c("Game Paused")]):null,L.devSpeed&&L.devSpeed!==1?o("div",null,[c("Dev Speed: "),ye(L.devSpeed),c("x")]):null,L.offlineTime?o("div",null,[c("Offline Time: "),nn(L.offlineTime)]):null,o(he,null,null),o("div",{class:"advent"},[d.reduce((p,y)=>(p[p.length-1].length===4&&p.push([]),p[p.length-1].push(y),p),[[]]).map(p=>Ce(...p))])]))}}),or=e=>[j,pe,pt,U,Ke,Ae,wt,ft,Gt,We],Bn=C(()=>!1);function sr(e,t){t.offlineProd=!1}var rr=Object.freeze(Object.defineProperty({__proto__:null,main:j,getInitialLayers:or,hasWon:Bn,fixOldSave:sr},Symbol.toStringTag,{value:"Module"}));const ur={class:"scene"},dr=["src"],cr=["src"],mr=["src"],pr=["src"],fr=["src"],gr=["src"],hr=["src"],vr={key:7,class:"scene-bubble",style:{left:"50%",bottom:"38%"}},yr=["src"],br=["src"],wr=X({__name:"Scene",props:{day:null},setup(e){return(t,l)=>(b(),N("div",ur,[e.day>=7?(b(),N("img",{key:0,src:r(Fa),class:"scene-item",style:{left:"4%",bottom:"3%",width:"40px",height:"40px"}},null,8,dr)):P("",!0),e.day>=0?(b(),N("img",{key:1,src:r(Ma),class:"scene-item",style:{left:"10%",bottom:"10%"}},null,8,cr)):P("",!0),e.day>=1?(b(),N("img",{key:2,src:r(Ia),class:"scene-item",style:{left:"40%",bottom:"12%"}},null,8,mr)):P("",!0),e.day>=2?(b(),N("img",{key:3,src:r(Ea),class:"scene-item",style:{left:"65%",bottom:"12%",width:"40px",height:"40px"}},null,8,pr)):P("",!0),e.day>=6?(b(),N("img",{key:4,src:r(Pa),class:"scene-item",style:{left:"72%",bottom:"8%",width:"40px",height:"40px"}},null,8,fr)):P("",!0),e.day>=8?(b(),N("img",{key:5,src:r(Ta),class:"scene-item",style:{left:"80%",bottom:"6%"}},null,8,gr)):P("",!0),e.day>=3?(b(),N("img",{key:6,src:r(Ba),class:"scene-item",style:{left:"52%",bottom:"12%"}},null,8,hr)):P("",!0),e.day>=4?(b(),N("div",vr,[e.day>=4?(b(),N("img",{key:0,src:r(xa),class:"scene-item"},null,8,yr)):P("",!0),e.day>=5?(b(),N("img",{key:1,src:r(Da),class:"scene-item"},null,8,br)):P("",!0)])):P("",!0)]))}});var Cr=_e(wr,[["__scopeId","data-v-09c4ca12"]]);const _r=X({components:{Context:ma},props:{index:{type:Number,required:!0},tab:{type:Function,required:!0},display:{type:V(Object,String,Function),required:!0},minimized:{type:Object,required:!0},minWidth:{type:V(Number,String),required:!0},name:{type:V(String),required:!0},color:V(String),minimizable:V(Boolean),nodes:{type:Object,required:!0}},setup(e){const{display:t,index:l,minimized:a,minWidth:i,tab:s}=st(e),u=Xl(t),d=C(()=>Se.allowGoBack&&l.value>0&&!a.value);function m(){L.tabs.splice(r(e.index),1)}dl(()=>y(a.value,r(i.value))),Pt([a,Io(i)],([h,w])=>y(h,w));function p(h){e.nodes.value=h}function y(h,w){const g=typeof w=="number"||Number.isNaN(parseInt(w))?w+"px":w,_=s.value();_!=null&&(h?(_.style.flexGrow="0",_.style.flexShrink="0",_.style.width="60px",_.style.minWidth=_.style.flexBasis="",_.style.margin="0"):(_.style.flexGrow="",_.style.flexShrink="",_.style.width="",_.style.minWidth=_.style.flexBasis=g,_.style.margin=""))}return{component:u,showGoBack:d,updateNodes:p,unref:r,goBack:m}}});function kr(e,t,l,a,i,s){const u=ll("Context");return b(),N("div",{class:"layer-container",style:Xe({"--layer-color":e.unref(e.color)})},[e.showGoBack?(b(),N("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...d)=>e.goBack&&e.goBack(...d))},"\u274C")):P("",!0),e.minimized.value?(b(),N("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=d=>e.minimized.value=!1)},[f("div",null,ae(e.unref(e.name)),1)])):(b(),N("div",{key:2,class:Qe(["layer-tab",{showGoBack:e.showGoBack}])},[o(u,{onUpdateNodes:e.updateNodes},{default:H(()=>[(b(),z(Ue(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(b(),N("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=d=>e.minimized.value=!0)}," \u25BC ")):P("",!0)],4)}var Ar=_e(_r,[["render",kr],["__scopeId","data-v-0158bec3"]]);const Ra=e=>(zt("data-v-4b4bda40"),e=e(),Kt(),e),Sr=Ra(()=>f("h2",null,"Changelog",-1)),Nr=Ra(()=>f("details",{open:""},[f("summary",null,[c("v0.0 Initial Commit - "),f("time",null,"2021-09-04")]),c(" This is the first release :D "),f("ul",null,[f("li",{class:"feature"},"Did everything"),f("li",{class:"fix"},"Had some fun"),f("li",{class:"breaking"},"Removed everything"),f("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Mr=X({__name:"Changelog",setup(e,{expose:t}){const l=O(!1);return t({open(){l.value=!0}}),(a,i)=>(b(),z(gt,{modelValue:l.value,"onUpdate:modelValue":i[0]||(i[0]=s=>l.value=s)},{header:H(()=>[Sr]),body:H(()=>[Nr]),_:1},8,["modelValue"]))}});var Ir=_e(Mr,[["__scopeId","data-v-4b4bda40"]]),Er=X({props:{element:Object,display:{type:V(Object,String,Function),required:!0},style:V(Object,String,Array),classes:V(Object),direction:V(String),xoffset:V(String),yoffset:V(String),pinned:Object},setup(e){const{element:t,display:l,pinned:a}=st(e),i=O(!1),s=C(()=>(tt(a)||i.value)&&u.value),u=nl(l),d=Mt(be(B(()=>{const y=tt(t);return y==null?"":Dt(y)})));function m(y){const h=a;y.shiftKey&&h&&(h.value=!h.value,y.stopPropagation(),y.preventDefault())}const p=C(()=>tt(a)&&Pl[Ge.theme].showPin);return{Direction:fe,isHovered:i,isShown:s,comp:u,elementComp:d,unref:r,togglePinned:m,showPin:p}}});const Br={key:0,class:"material-icons pinned"};function xr(e,t,l,a,i,s){return b(),N("div",{class:Qe(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=u=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=u=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...u)=>e.togglePinned&&e.togglePinned(...u))},[xt(e.$slots,"default",{},void 0,!0),e.elementComp?(b(),z(Ue(e.elementComp),{key:0})):P("",!0),o(tn,{name:"fade"},{default:H(()=>{var u;return[e.isShown?(b(),N("div",{key:0,class:Qe(["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:Xe([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(u=e.unref(e.style))!=null?u:{}])},[e.showPin?(b(),N("span",Br,"push_pin")):P("",!0),e.comp?(b(),z(Ue(e.comp),{key:1})):P("",!0)],6)):P("",!0)]}),_:1})],34)}var ze=_e(Er,[["render",xr],["__scopeId","data-v-6102fa3a"]]);const Dr={class:"info-modal-header"},Pr=["src","alt"],Fr={class:"info-modal-title"},Tr={key:0},Rr=c(" - "),Or={key:0},Ur={key:0},$r=f("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1),qr=f("br",null,null,-1),Vr=f("br",null,null,-1),Gr=["href"],Lr=f("span",{class:"material-icons info-modal-discord"},"discord",-1),Qr=f("div",null,[f("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),c(" The Paper Pilot Community ")])],-1),Hr=f("div",null,[f("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),c(" The Modding Tree ")])],-1),jr=f("br",null,null,-1);var Wr=X({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const l=e,{title:a,logo:i,author:s,discordName:u,discordLink:d,versionNumber:m,versionTitle:p}=Se,y=st(l),h=O(!1),w=C(()=>nn(L.timePlayed)),g=C(()=>be(B(()=>o(E,null,[Ca.map(ne)]))));t({open(){h.value=!0}});function _(){var A;(A=r(y.changelog))==null||A.open()}return(A,x)=>(b(),z(gt,{class:"info-modal",modelValue:h.value,"onUpdate:modelValue":x[0]||(x[0]=te=>h.value=te)},{header:H(()=>[f("div",Dr,[r(i)?(b(),N("img",{key:0,class:"info-modal-logo",src:r(i),alt:r(a)},null,8,Pr)):P("",!0),f("div",Fr,[f("h2",null,"- "+ae(r(a))+" -",1),f("h4",null,[c(" - v"+ae(r(m)),1),r(p)?(b(),N("span",Tr,": "+ae(r(p)),1)):P("",!0),Rr])])])]),body:H(({shown:te})=>[te?(b(),N("div",Or,[r(s)?(b(),N("div",Ur,"By "+ae(r(s)),1)):P("",!0),$r,qr,f("div",{class:"link",onClick:_},"Changelog"),Vr,f("div",null,[r(d)?(b(),N("a",{key:0,href:r(d),class:"info-modal-discord-link",target:"_blank"},[Lr,c(" "+ae(r(u)),1)],8,Gr)):P("",!0)]),Qr,Hr,jr,f("div",null,"Time Played: "+ae(r(w)),1),(b(),z(Ue(r(g))))])):P("",!0)]),_:1},8,["modelValue"]))}});const Oa=e=>(zt("data-v-0d685451"),e=e(),Kt(),e),zr=Oa(()=>f("h2",null,"Options",-1)),Kr=Oa(()=>f("hr",null,null,-1));var Jr=X({__name:"Options",setup(e,{expose:t}){const l=O(!1);t({open(){l.value=!0}});const a=Object.keys(Pl).map(g=>({label:da(g),value:g})),i=C(()=>be(B(()=>o(E,null,[wa.map(ne)])))),{showTPS:s,theme:u}=st(Ge),{autosave:d,usingLog:m}=st(L),p=C({get(){return L.devSpeed===0},set(g){L.devSpeed=g?0:null}}),y=B(()=>o("span",null,[c("Autosave"),o(ze,{display:"Save-specific"},{default:()=>[c("*")]})])),h=B(()=>o("span",null,[c("Pause game"),o(ze,{display:"Save-specific"},{default:()=>[c("*")]})])),w=B(()=>o("span",null,[c("Use log for progress bar"),o(ze,{display:"Save-specific"},{default:()=>[c("*")]})]));return(g,_)=>(b(),z(gt,{modelValue:l.value,"onUpdate:modelValue":_[5]||(_[5]=A=>l.value=A)},{header:H(()=>[zr]),body:H(()=>[o(En,{title:"Theme",options:r(a),modelValue:r(u),"onUpdate:modelValue":_[0]||(_[0]=A=>Je(u)?u.value=A:null)},null,8,["options","modelValue"]),(b(),z(Ue(r(i)))),o(Ht,{title:"Show TPS",modelValue:r(s),"onUpdate:modelValue":_[1]||(_[1]=A=>Je(s)?s.value=A:null)},null,8,["modelValue"]),Kr,o(Ht,{title:r(y),modelValue:r(d),"onUpdate:modelValue":_[2]||(_[2]=A=>Je(d)?d.value=A:null)},null,8,["title","modelValue"]),r(Se).enablePausing?(b(),z(Ht,{key:0,title:r(h),modelValue:r(p),"onUpdate:modelValue":_[3]||(_[3]=A=>Je(p)?p.value=A:null)},null,8,["title","modelValue"])):P("",!0),o(Ht,{title:r(w),modelValue:r(m),"onUpdate:modelValue":_[4]||(_[4]=A=>Je(m)?m.value=A:null)},null,8,["title","modelValue"])]),_:1},8,["modelValue"]))}});var Xr=_e(Jr,[["__scopeId","data-v-0d685451"]]);const Yr=["onSubmit"],Zr={class:"field"},eu={key:0,class:"field-title"},tu=["placeholder"],lu=X({__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 l=e,a=nl(Ft(l,"title"),"span"),i=Mt(null);Zl(()=>{var m;(m=i.value)==null||m.focus()});const s=C({get(){return r(l.modelValue)||""},set(m){t("update:modelValue",m)}});function u(){t("submit")}function d(){l.submitOnBlur!==!1?t("submit"):t("cancel")}return(m,p)=>(b(),N("form",{onSubmit:Ml(u,["prevent"])},[f("div",Zr,[r(a)?(b(),N("span",eu,[(b(),z(Ue(r(a))))])):P("",!0),e.textArea?(b(),z(r(li),{key:1,modelValue:r(s),"onUpdate:modelValue":p[0]||(p[0]=y=>Je(s)?s.value=y:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:d,ref_key:"field",ref:i},null,8,["modelValue","placeholder","maxHeight"])):en((b(),N("input",{key:2,type:"text","onUpdate:modelValue":p[1]||(p[1]=y=>Je(s)?s.value=y:null),placeholder:e.placeholder,class:Qe({fullWidth:!e.title}),onBlur:d,ref_key:"field",ref:i},null,42,tu)),[[Ja,r(s)]])])],40,Yr))}});var Ua=_e(lu,[["__scopeId","data-v-67b44a54"]]);const nu={key:0},au=["onClick","disabled"],iu={key:0},ou=["onClick"],su=X({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const a=st(e),i=O(!1);Pt(i,d=>{t("confirmingChanged",d)});function s(){if(r(a.skipConfirm)){t("click");return}i.value&&t("click"),i.value=!i.value}function u(){i.value=!1}return(d,m)=>(b(),N("span",{class:Qe(["container",{confirming:i.value}])},[i.value?(b(),N("span",nu,"Are you sure?")):P("",!0),f("button",{onClick:Ml(s,["stop"]),class:"button danger",disabled:e.disabled},[i.value?(b(),N("span",iu,"Yes")):xt(d.$slots,"default",{key:1},void 0,!0)],8,au),i.value?(b(),N("button",{key:1,class:"button",onClick:Ml(u,["stop"])},"No",8,ou)):P("",!0)],2))}});var ru=_e(su,[["__scopeId","data-v-2f8ef34c"]]);const uu=["onClick"],du=X({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const l=O(!1),a=O(null);function i(){t("click"),a.value&&clearTimeout(a.value),l.value=!1,dl(()=>{l.value=!0,a.value=setTimeout(()=>l.value=!1,500)})}return(s,u)=>(b(),N("button",{onClick:Ml(i,["stop"]),class:Qe(["feedback",{activated:l.value,left:e.left}])},[xt(s.$slots,"default",{},void 0,!0)],10,uu))}});var cu=_e(du,[["__scopeId","data-v-01a1b95c"]]);const Jt=e=>(zt("data-v-5285ac49"),e=e(),Kt(),e),mu=Jt(()=>f("div",{class:"handle material-icons"},"drag_handle",-1)),pu={key:0,class:"actions"},fu=Jt(()=>f("span",{class:"material-icons"},"content_paste",-1)),gu=Jt(()=>f("span",{class:"material-icons"},"content_copy",-1)),hu=Jt(()=>f("span",{class:"material-icons"},"edit",-1)),vu=Jt(()=>f("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),yu={key:1,class:"actions"},bu=Jt(()=>f("span",{class:"material-icons"},"check",-1)),wu=Jt(()=>f("span",{class:"material-icons"},"close",-1)),Cu={key:2,class:"details"},_u={class:"save-version"},ku=Jt(()=>f("br",null,null,-1)),Au={key:0},Su={key:1},Nu={key:3,class:"details"},Mu={key:4,class:"details error"},Iu=Jt(()=>f("br",null,null,-1)),Eu=X({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const l=e,{save:a}=st(l),i=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),s=O(!1),u=O(!1),d=O("");Pt(s,()=>d.value=a.value.name||"");const m=C(()=>a.value&&a.value.id===L.id),p=C(()=>m.value?L.time:a.value&&a.value.time||0),y=Xl(C(()=>{var w,g,_,A;return`Day ${(A=(_=(g=(w=a.value)==null?void 0:w.layers)==null?void 0:g.main)==null?void 0:_.day)!=null?A:1}`}));function h(){t("editName",d.value),s.value=!1}return(w,g)=>(b(),N("div",{class:Qe(["save",{active:r(m)}])},[mu,s.value?(b(),N("div",yu,[f("button",{onClick:h,class:"button"},[o(ze,{display:"Save",direction:r(fe).Left,class:"info"},{default:H(()=>[bu]),_:1},8,["direction"])]),f("button",{onClick:g[5]||(g[5]=_=>s.value=!s.value),class:"button"},[o(ze,{display:"Cancel",direction:r(fe).Left,class:"info"},{default:H(()=>[wu]),_:1},8,["direction"])])])):(b(),N("div",pu,[r(a).error==null&&!u.value?(b(),z(cu,{key:0,onClick:g[0]||(g[0]=_=>t("export")),class:"button",left:""},{default:H(()=>[o(ze,{display:"Export",direction:r(fe).Left,class:"info"},{default:H(()=>[fu]),_:1},8,["direction"])]),_:1})):P("",!0),r(a).error==null&&!u.value?(b(),N("button",{key:1,onClick:g[1]||(g[1]=_=>t("duplicate")),class:"button"},[o(ze,{display:"Duplicate",direction:r(fe).Left,class:"info"},{default:H(()=>[gu]),_:1},8,["direction"])])):P("",!0),r(a).error==null&&!u.value?(b(),N("button",{key:2,onClick:g[2]||(g[2]=_=>s.value=!s.value),class:"button"},[o(ze,{display:"Edit Name",direction:r(fe).Left,class:"info"},{default:H(()=>[hu]),_:1},8,["direction"])])):P("",!0),o(ru,{disabled:r(m),onClick:g[3]||(g[3]=_=>t("delete")),onConfirmingChanged:g[4]||(g[4]=_=>u.value=_)},{default:H(()=>[o(ze,{display:"Delete",direction:r(fe).Left,class:"info"},{default:H(()=>[vu]),_:1},8,["direction"])]),_:1},8,["disabled"])])),r(a).error==null&&!s.value?(b(),N("div",Cu,[f("button",{class:"button open",onClick:g[6]||(g[6]=_=>t("open"))},[f("h3",null,ae(r(a).name),1)]),f("span",_u,"v"+ae(r(a).modVersion),1),ku,r(p)?(b(),N("div",Au,"Last played "+ae(r(i).format(r(p))),1)):P("",!0),r(y)?(b(),N("div",Su,[(b(),z(Ue(r(y))))])):P("",!0)])):r(a).error==null&&s.value?(b(),N("div",Nu,[o(Ua,{modelValue:d.value,"onUpdate:modelValue":g[7]||(g[7]=_=>d.value=_),class:"editname",onSubmit:h},null,8,["modelValue"])])):(b(),N("div",Mu,[c(" Error: Failed to load save with id "+ae(r(a).id),1),Iu,c(ae(r(a).error),1)]))],2))}});var Bu=_e(Eu,[["__scopeId","data-v-5285ac49"]]);const xn=e=>(zt("data-v-3b9991aa"),e=e(),Kt(),e),xu=xn(()=>f("h2",null,"Saves Manager",-1)),Du={class:"modal-footer"},Pu={class:"field"},Fu=xn(()=>f("span",{class:"field-title"},"Create Save",-1)),Tu={class:"field-buttons"},Ru={class:"footer"},Ou=xn(()=>f("div",{style:{"flex-grow":"1"}},null,-1)),Uu=X({__name:"SavesManager",setup(e,{expose:t}){const l=O(!1),a=O(null);t({open(){l.value=!0}});const i=O(!1),s=O(""),u=O(null);Pt(s,M=>{M?dl(()=>{try{if(M[0]!=="{")if(M[0]==="e")M=decodeURIComponent(escape(atob(M)));else if(M[0]==="\u1BE1")M=Zt.decompressFromUTF16(M);else{console.warn("Unable to determine preset encoding",M),i.value=!0;return}const S=JSON.parse(M);if(typeof S!="object"){i.value=!0;return}const T=Hl();S.id=T,Bt(S),s.value="",i.value=!1,Ge.saves.push(T)}catch{i.value=!0}}):i.value=!1});let d={},m=O(Object.keys(d).reduce((M,S)=>(M.push({label:S.split("/").slice(-1)[0].slice(0,-4),value:d[S]}),M),[]));const p=ln({});function y(M){if(p[M]==null){let S=localStorage.getItem(M);if(S==null)p[M]={error:"Save doesn't exist in localStorage",id:M};else if(S==="dW5kZWZpbmVk")p[M]={error:"Save is undefined",id:M};else try{if(S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Zt.decompressFromUTF16(S);else return console.warn("Unable to determine preset encoding",S),i.value=!0,p[M]={error:"Unable to determine preset encoding",id:M},p[M];p[M]={...JSON.parse(S),id:M}}catch(T){p[M]={error:T,id:M},console.warn(`SavesManager: Failed to load info about save with id ${M}:
${T}
${S}`)}}return p[M]}Pt(l,M=>{M&&Object.keys(p).forEach(S=>delete p[S])});const h=C(()=>Ge.saves.reduce((M,S)=>(M[S]=y(S),M),{}));function w(M){let S;switch(L.id===M?S=va(L[Ve]):S=JSON.stringify(h.value[M]),Se.exportEncoding){default:console.warn(`Unknown save encoding: ${Se.exportEncoding}. Defaulting to lz`);case"lz":S=Zt.compressToUTF16(S);break;case"base64":S=btoa(unescape(encodeURIComponent(S)));break;case"plain":break}const T=document.createElement("textarea");T.value=S,document.body.appendChild(T),T.select(),T.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(T)}function g(M){L.id===M&&Bt();const S={...h.value[M],id:Hl()};Bt(S),Ge.saves.push(S.id)}function _(M){Ge.saves=Ge.saves.filter(S=>S!==M),localStorage.removeItem(M),p[M]=void 0}function A(M){h.value[L.id].time=L.time,Bt(),p[L.id]=void 0,ul(h.value[M]),p[M]=void 0}function x(M){if(u.value=M,dl(()=>{u.value=null}),M[0]!=="{")if(M[0]==="e")M=decodeURIComponent(escape(atob(M)));else if(M[0]==="\u1BE1")M=Zt.decompressFromUTF16(M);else{console.warn("Unable to determine preset encoding",M);return}const S=JSON.parse(M);S.id=Hl(),Bt(S),Ge.saves.push(S.id),A(S.id)}function te(M,S){const T=h.value[M];T&&(T.name=S,L.id===M?(L.name=S,Bt()):(Bt(T),p[M]=void 0))}return(M,S)=>(b(),z(gt,{modelValue:l.value,"onUpdate:modelValue":S[4]||(S[4]=T=>l.value=T),ref_key:"modal",ref:a},{header:H(()=>[xu]),body:H(({shown:T})=>[T?(b(),z(r(ti),{key:0,list:r(Ge).saves,handle:".handle",itemKey:ke=>ke},{item:H(({element:ke})=>[o(Bu,{save:r(h)[ke],onOpen:Fe=>A(ke),onExport:Fe=>w(ke),onEditName:Fe=>te(ke,Fe),onDuplicate:Fe=>g(ke),onDelete:Fe=>_(ke)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):P("",!0)]),footer:H(()=>[f("div",Du,[o(Ua,{modelValue:s.value,"onUpdate:modelValue":S[0]||(S[0]=T=>s.value=T),title:"Import Save",placeholder:"Paste your save here!",class:Qe({importingFailed:i.value})},null,8,["modelValue","class"]),f("div",Pu,[Fu,f("div",Tu,[f("button",{class:"button",onClick:S[1]||(S[1]=T=>A(r(yl)().id))},"New Game"),Object.keys(r(m)).length>0?(b(),z(En,{key:0,options:r(m),modelValue:u.value,"onUpdate:modelValue":S[2]||(S[2]=T=>x(T)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):P("",!0)])]),f("div",Ru,[Ou,f("button",{class:"button modal-default-button",onClick:S[3]||(S[3]=T=>l.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var $a=_e(Uu,[["__scopeId","data-v-3b9991aa"]]);const At=e=>(zt("data-v-8495e562"),e=e(),Kt(),e),$u=["src","alt"],qu={key:1,class:"title"},Vu=At(()=>f("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Gu={class:"discord"},Lu={class:"discord-links"},Qu={key:0},Hu=["href"],ju=At(()=>f("li",null,[f("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Wu=At(()=>f("li",null,[f("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),zu={href:"https://forums.moddingtree.com/",target:"_blank"},Ku=At(()=>f("span",{class:"material-icons"},"forum",-1)),Ju=At(()=>f("span",{class:"material-icons"},"info",-1)),Xu=At(()=>f("span",{class:"material-icons"},"library_books",-1)),Yu=At(()=>f("span",{class:"material-icons"},"settings",-1)),Zu=At(()=>f("span",{class:"material-icons"},"library_books",-1)),ed=At(()=>f("span",{class:"material-icons"},"settings",-1)),td=At(()=>f("span",{class:"material-icons"},"info",-1)),ld={href:"https://forums.moddingtree.com/",target:"_blank"},nd=At(()=>f("span",{class:"material-icons"},"forum",-1)),ad={class:"discord"},id={class:"discord-links"},od={key:0},sd=["href"],rd=At(()=>f("li",null,[f("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),ud=At(()=>f("li",null,[f("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),dd=X({__name:"Nav",setup(e){const t=O(null),l=O(null),a=O(null),i=O(null),{useHeader:s,banner:u,title:d,discordName:m,discordLink:p,versionNumber:y}=Se;function h(){window.open(p,"mywindow")}return(w,g)=>(b(),N(E,null,[r(s)?(b(),N("div",cl({key:0,class:"nav"},w.$attrs),[r(u)?(b(),N("img",{key:0,src:r(u),class:"banner",alt:r(d)},null,8,$u)):(b(),N("div",qu,ae(r(d)),1)),f("div",{onClick:g[0]||(g[0]=_=>{var A;return(A=i.value)==null?void 0:A.open()}),class:"version-container"},[o(ze,{display:"Changelog",direction:r(fe).Down,class:"version"},{default:H(()=>[f("span",null,"v"+ae(r(y)),1)]),_:1},8,["direction"])]),Vu,f("div",Gu,[f("span",{onClick:h,class:"material-icons"},"discord"),f("ul",Lu,[r(p)?(b(),N("li",Qu,[f("a",{href:r(p),target:"_blank"},ae(r(m)),9,Hu)])):P("",!0),ju,Wu])]),f("div",null,[f("a",zu,[o(ze,{display:"Forums",direction:r(fe).Down,yoffset:"5px"},{default:H(()=>[Ku]),_:1},8,["direction"])])]),f("div",{onClick:g[1]||(g[1]=_=>{var A;return(A=t.value)==null?void 0:A.open()})},[o(ze,{display:"Info",direction:r(fe).Down,class:"info"},{default:H(()=>[Ju]),_:1},8,["direction"])]),f("div",{onClick:g[2]||(g[2]=_=>{var A;return(A=l.value)==null?void 0:A.open()})},[o(ze,{display:"Saves",direction:r(fe).Down,xoffset:"-20px"},{default:H(()=>[Xu]),_:1},8,["direction"])]),f("div",{onClick:g[3]||(g[3]=_=>{var A;return(A=a.value)==null?void 0:A.open()})},[o(ze,{display:"Options",direction:r(fe).Down,xoffset:"-66px"},{default:H(()=>[Yu]),_:1},8,["direction"])])],16)):(b(),N("div",cl({key:1,class:"overlay-nav"},w.$attrs),[f("div",{onClick:g[4]||(g[4]=_=>{var A;return(A=i.value)==null?void 0:A.open()}),class:"version-container"},[o(ze,{display:"Changelog",direction:r(fe).Right,xoffset:"25%",class:"version"},{default:H(()=>[f("span",null,"v"+ae(r(y)),1)]),_:1},8,["direction"])]),f("div",{onClick:g[5]||(g[5]=_=>{var A;return(A=l.value)==null?void 0:A.open()})},[o(ze,{display:"Saves",direction:r(fe).Right},{default:H(()=>[Zu]),_:1},8,["direction"])]),f("div",{onClick:g[6]||(g[6]=_=>{var A;return(A=a.value)==null?void 0:A.open()})},[o(ze,{display:"Options",direction:r(fe).Right},{default:H(()=>[ed]),_:1},8,["direction"])]),f("div",{onClick:g[7]||(g[7]=_=>{var A;return(A=t.value)==null?void 0:A.open()})},[o(ze,{display:"Info",direction:r(fe).Right},{default:H(()=>[td]),_:1},8,["direction"])]),f("div",null,[f("a",ld,[o(ze,{display:"Forums",direction:r(fe).Right,xoffset:"7px"},{default:H(()=>[nd]),_:1},8,["direction"])])]),f("div",ad,[f("span",{onClick:h,class:"material-icons"},"discord"),f("ul",id,[r(p)?(b(),N("li",od,[f("a",{href:r(p),target:"_blank"},ae(r(m)),9,sd)])):P("",!0),rd,ud])])],16)),o(Wr,{ref_key:"info",ref:t,changelog:i.value},null,8,["changelog"]),o($a,{ref_key:"savesManager",ref:l},null,512),o(Xr,{ref_key:"options",ref:a},null,512),o(Ir,{ref_key:"changelog",ref:i},null,512)],64))}});var qa=_e(dd,[["__scopeId","data-v-8495e562"]]);const Dn=e=>(zt("data-v-248e2ebb"),e=e(),Kt(),e),cd={class:"inner-tab"},md={key:1},pd=Dn(()=>f("br",null,null,-1)),fd=c(" You can help continue the "),gd=Dn(()=>f("i",null,"advent",-1)),hd=c("ure at: "),vd=Dn(()=>f("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),c(" The Paper Pilot Community ")],-1)),yd=X({__name:"Game",setup(e){const t=Ft(L,"tabs"),l=C(()=>Object.keys(ut)),a=Se.useHeader,i=nl(j.loreBody);function s(u){const{display:d,minimized:m,minWidth:p,name:y,color:h,minimizable:w,nodes:g}=u;return{display:d,minimized:m,minWidth:p,name:y,color:h,minimizable:w,nodes:g}}return(u,d)=>(b(),N("div",{class:Qe(["tabs-container",{useHeader:r(a)}])},[(b(!0),N(E,null,Zn(r(t),(m,p)=>{var y,h;return b(),N("div",{key:p,class:Qe(["tab",r((y=r(ut)[m])==null?void 0:y.classes)]),ref_for:!0,ref:`tab-${p}`,style:Xe(r((h=r(ut)[m])==null?void 0:h.style))},[p===0&&!r(a)?(b(),z(qa,{key:0})):P("",!0),f("div",cd,[r(l).includes(m)?(b(),z(Ar,cl({key:0},s(r(ut)[m]),{index:p,tab:()=>{var w;return(w=u.$refs[`tab-${p}`])==null?void 0:w[0]}}),null,16,["index","tab"])):(b(),z(Ue(m),{key:1,index:p},null,8,["index"]))])],6)}),128)),o(gt,{modelValue:r(j).showLoreModal.value,"onUpdate:modelValue":d[0]||(d[0]=m=>r(j).showLoreModal.value=m)},{header:H(()=>[f("h2",null,ae(r(j).loreTitle.value),1)]),body:H(()=>[r(i)?(b(),z(Ue(r(i)),{key:0})):P("",!0),r(j).loreScene.value!==-1?(b(),N("div",md,[o(Cr,{day:r(j).loreScene.value},null,8,["day"]),pd,fd,gd,hd,vd])):P("",!0)]),_:1},8,["modelValue"])],2))}});var bd=_e(yd,[["__scopeId","data-v-248e2ebb"]]);const Rl=e=>(zt("data-v-4a50ce42"),e=e(),Kt(),e),wd={class:"game-over-modal-header"},Cd=["src","alt"],_d={class:"game-over-modal-title"},kd=Rl(()=>f("h2",null,"Congratulations!",-1)),Ad={key:0},Sd=Rl(()=>f("br",null,null,-1)),Nd=Rl(()=>f("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Md=Rl(()=>f("br",null,null,-1)),Id=["href"],Ed=Rl(()=>f("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Bd=X({__name:"GameOverScreen",setup(e){const{title:t,logo:l,discordName:a,discordLink:i,versionNumber:s,versionTitle:u}=Se,d=C(()=>nn(L.timePlayed)),m=C(()=>Bn.value&&!L.keepGoing),p=Ft(L,"autosave");function y(){L.keepGoing=!0}function h(){ul(yl())}return(w,g)=>(b(),z(gt,{"model-value":r(m)},{header:H(()=>[f("div",wd,[r(l)?(b(),N("img",{key:0,class:"game-over-modal-logo",src:r(l),alt:r(t)},null,8,Cd)):P("",!0),f("div",_d,[kd,f("h4",null,"You've beaten "+ae(r(t))+" v"+ae(r(s))+": "+ae(r(u)),1)])])]),body:H(({shown:_})=>[_?(b(),N("div",Ad,[f("div",null,"It took you "+ae(r(d))+" to beat the game.",1),Sd,Nd,Md,f("div",null,[f("a",{href:r(i),class:"game-over-modal-discord-link"},[Ed,c(" "+ae(r(a)),1)],8,Id)]),o(Ht,{title:"Autosave",modelValue:r(p),"onUpdate:modelValue":g[0]||(g[0]=A=>Je(p)?p.value=A:null)},null,8,["modelValue"])])):P("",!0)]),footer:H(()=>[f("div",{class:"game-over-footer"},[f("button",{onClick:y,class:"button"},"Keep Going"),f("button",{onClick:h,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var xd=_e(Bd,[["__scopeId","data-v-4a50ce42"]]);const rn=e=>(zt("data-v-3de07c06"),e=e(),Kt(),e),Dd=rn(()=>f("div",{class:"nan-modal-header"},[f("h2",null,"NaN value detected!")],-1)),Pd={key:0},Fd=rn(()=>f("br",null,null,-1)),Td=["href"],Rd=rn(()=>f("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Od=rn(()=>f("br",null,null,-1)),Ud={class:"nan-footer"},$d=X({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:l}=Se,a=Ft(L,"autosave"),i=Ft(Le,"hasNaN"),s=O(null),u=C(()=>{var g;return(g=Le.NaNPath)==null?void 0:g.join(".")}),d=C(()=>{var g;return(g=Le.NaNPath)==null?void 0:g.slice(-1)[0]}),m=C(()=>Le.NaNReceiver&&d.value?Le.NaNReceiver[d.value]:null),p=C({get(){return L.devSpeed===0},set(g){L.devSpeed=g?null:0}});function y(){Le.NaNReceiver&&d.value&&(Le.NaNReceiver[d.value]=new n(0),Le.hasNaN=!1)}function h(){Le.NaNReceiver&&d.value&&(Le.NaNReceiver[d.value]=new n(1),Le.hasNaN=!1)}function w(){Le.NaNReceiver&&d.value&&(Le.NaNReceiver[d.value]=new n(NaN),Le.hasNaN=!1)}return(g,_)=>(b(),N(E,null,[o(gt,cl({modelValue:r(i),"onUpdate:modelValue":_[4]||(_[4]=A=>Je(i)?i.value=A:null)},g.$attrs),{header:H(()=>[Dd]),body:H(()=>[f("div",null,[c(' Attempted to assign "'+ae(r(u))+'" to NaN',1),r(m)?(b(),N("span",Pd,ae(" ")+"(previously "+ae(r(ye)(r(m)))+")",1)):P("",!0),c(". Auto-saving has been "+ae(r(a)?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Fd,f("div",null,[f("a",{href:r(l),class:"nan-modal-discord-link"},[Rd,c(" "+ae(r(t)),1)],8,Td)]),Od,o(Ht,{title:"Autosave",modelValue:r(a),"onUpdate:modelValue":_[0]||(_[0]=A=>Je(a)?a.value=A:null)},null,8,["modelValue"]),r(Se).enablePausing?(b(),z(Ht,{key:0,title:"Pause game",modelValue:r(p),"onUpdate:modelValue":_[1]||(_[1]=A=>Je(p)?p.value=A:null)},null,8,["modelValue"])):P("",!0)]),footer:H(()=>[f("div",Ud,[f("button",{onClick:_[2]||(_[2]=A=>{var x;return(x=s.value)==null?void 0:x.open()}),class:"button"},"Open Saves Manager"),f("button",{onClick:y,class:"button"},"Set to 0"),f("button",{onClick:h,class:"button"},"Set to 1"),r(m)&&r(n).neq(r(m),0)&&r(n).neq(r(m),1)?(b(),N("button",{key:0,onClick:_[3]||(_[3]=A=>i.value=!1),class:"button"}," Set to previous ")):P("",!0),f("button",{onClick:w,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),o($a,{ref_key:"savesManager",ref:s},null,512)],64))}});var qd=_e($d,[["__scopeId","data-v-3de07c06"]]);const Vd={key:0,class:"tpsDisplay"},Gd={key:0,class:"low"},Ld=X({__name:"TPS",setup(e){const t=C(()=>n.div(Le.lastTenTicks.length,Le.lastTenTicks.reduce((s,u)=>s+u,0))),l=O([]);_t(()=>{l.value.push(Math.round(t.value.toNumber())),l.value.length>10&&(l.value=l.value.slice(1))});const a=C(()=>l.value.reduce((s,u)=>n.max(s,u),0)),i=C(()=>n.sub(t.value,a.value).gt(1));return(s,u)=>r(t).isNan()?P("",!0):(b(),N("div",Vd,[c(" TPS: "+ae(r(ce)(r(t)))+" ",1),o(tn,{name:"fade"},{default:H(()=>[r(i)?(b(),N("span",Gd,ae(r(ce)(r(a))),1)):P("",!0)]),_:1})]))}});var Qd=_e(Ld,[["__scopeId","data-v-46a3ed5b"]]);var Hd=X({__name:"App",setup(e){const t=Se.useHeader,l=C(()=>Pl[Ge.theme].variables),a=Ft(Ge,"showTPS"),i=C(()=>be(B(()=>o(E,null,[ko.map(ne)]))));return(s,u)=>(b(),N(E,null,[f("div",{id:"modal-root",style:Xe(r(l))},null,4),f("div",{class:Qe(["app",{useHeader:r(t)}]),style:Xe(r(l))},[r(t)?(b(),z(qa,{key:0})):P("",!0),o(bd),r(r(a))?(b(),z(Qd,{key:1})):P("",!0),o(xd),o(qd),(b(),z(Ue(r(i))))],6)],64))}});var jd=_e(Hd,[["__scopeId","data-v-580927bb"]]);function Wd(e={}){const{immediate:t=!1,onNeedRefresh:l,onOfflineReady:a,onRegistered:i,onRegisterError:s}=e;let u,d;const m=async(p=!0)=>{p&&(u==null||u.addEventListener("controlling",y=>{y.isUpdate&&window.location.reload()})),d&&d.waiting&&await ai(d.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){u=new ni("./sw.js",{scope:"./",type:"classic"}),u.addEventListener("activated",p=>{p.isUpdate||a==null||a()});{const p=()=>{l==null||l()};u.addEventListener("waiting",p),u.addEventListener("externalwaiting",p)}u.register({immediate:t}).then(p=>{d=p,i==null||i(p)}).catch(p=>{s==null||s(p)})}return m}function zd(e={}){const{immediate:t=!0,onNeedRefresh:l,onOfflineReady:a,onRegistered:i,onRegisterError:s}=e,u=O(!1),d=O(!1);return{updateServiceWorker:Wd({immediate:t,onNeedRefresh(){u.value=!0,l==null||l()},onOfflineReady(){d.value=!0,a==null||a()},onRegistered:i,onRegisterError:s}),offlineReady:d,needRefresh:u}}document.title=Se.title;window.projInfo=Se;if(Se.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 yo();const{globalBus:e}=await Wl(()=>Promise.resolve().then(function(){return eo}),void 0),{startGameLoop:t}=await Wl(()=>import("./gameLoop.a8ab48f2.js"),["assets/gameLoop.a8ab48f2.js","assets/@fontsource.c175eac8.css","assets/vue.92681fcb.js","assets/lz-string.731cedc5.js","assets/@vue.4ce677c2.js","assets/nanoevents.1080beb7.js","assets/is-plain-object.906d88e8.js","assets/vue-next-select.a2bfab1d.js","assets/vue-next-select.9e6f4164.css","assets/vue-toastification.6f567382.js","assets/vue-toastification.4b5f8ac8.css","assets/vuedraggable.7949458c.js","assets/sortablejs.29100d8a.js","assets/vue-textarea-autosize.35804eaf.js","assets/workbox-window.8d14e8b7.js"]),l=window.vue=Xa(jd);e.emit("setupVue",l),l.mount("#app"),dl(()=>{const a=ta(),{updateServiceWorker:i}=zd({onNeedRefresh(){a.info("New content available, click or reload to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){i()}})},onOfflineReady(){a.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(s){s&&setInterval(()=>s.update(),60*60*1e3)}})}),t()});export{n as D,Wl as _,Le as a,Se as b,rr as c,$e as g,Sn as l,L as p,Ge as s};