Advent-Incremental/assets/index.52043ec0.js

19 lines
277 KiB
JavaScript

/* empty css */import"./vue.92681fcb.js";import{Z as f,l as gt,aa as _e,t as j,ay as ya,ar as Ol,aE as A,a0 as T,aK as Yt,a1 as y,O as S,aG as ra,A as It,_ as ye,a8 as n,b6 as fe,b8 as ha,bs as pi,C as u,aq as Ll,bu as Zl,bb as ba,T as on,a7 as s,u as wa,j as sn,bv as Ia,q as ia,b1 as Jt,G as vt,aC as mi,w as Zt,b2 as Qt,ao as rn,I as At,aN as ct,$ as G,J as Te,aH as Bl,aF as Nl,z as sl,al as ca,aL as xl,H as un,aJ as vi,bn as dn,br as cn,be as pn}from"./@vue.4ce677c2.js";import{c as fi}from"./nanoevents.1080beb7.js";import{L as El}from"./lz-string.731cedc5.js";import{i as mn}from"./is-plain-object.906d88e8.js";import{Y as vn}from"./vue-next-select.a2bfab1d.js";import{s as fn,u as gi}from"./vue-toastification.6f567382.js";import{D as gn}from"./vuedraggable.7949458c.js";import{p as yn}from"./vue-textarea-autosize.35804eaf.js";import{v as hn,n as bn}from"./workbox-window.8d14e8b7.js";import"./sortablejs.29100d8a.js";const wn=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const d of r.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function l(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerpolicy&&(r.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?r.credentials="include":o.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(o){if(o.ep)return;o.ep=!0;const r=l(o);fetch(o.href,r)}};wn();const An="modulepreload",Ka={},kn="./",pa=function(t,l){return!l||l.length===0?t():Promise.all(l.map(i=>{if(i=`${kn}${i}`,i in Ka)return;Ka[i]=!0;const o=i.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${r}`))return;const d=document.createElement("link");if(d.rel=o?"stylesheet":An,o||(d.as="script",d.crossOrigin=""),d.href=i,document.head.appendChild(d),o)return new Promise((c,m)=>{d.addEventListener("load",c),d.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},Cn="./projInfo-schema.json",En="Advent Incremental",_n="An incremental game you play a day at a time, leading up to Christmas!",Sn="advent-incremental",Mn="thepaperpilot and friends",xn="",Bn="",Nn="0.5",Dn="Initial Commit",In=!0,Tn=!1,Pn=2,Fn=!0,Un=null,Rn="",On=["main"],Ln=3600,qn=0,Gn=!0,$n="base64";var Ve={$schema:Cn,title:En,description:_n,id:Sn,author:Mn,discordName:xn,discordLink:Bn,versionNumber:Nn,versionTitle:Dn,allowGoBack:In,defaultShowSmall:Tn,defaultDecimalsShown:Pn,useHeader:Fn,banner:Un,logo:Rn,initialTabs:On,maxTickLength:Ln,offlineLimit:qn,enablePausing:Gn,exportEncoding:$n};const Sa=17,Qn=9e15,Hn=Math.log10(9e15),Vn=1/9e15,jn=308,zn=-324,Xa=5,Jn=function(){const e=[];for(let l=zn+1;l<=jn;l++)e.push(Number("1e"+l));const t=323;return function(l){return e[l+t]}}(),Fl=[2,Math.E,3,4,5,6,7,8,9,10],Wn=[[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]],Kn=[[-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]],C=function(t){return a.fromValue_noAlloc(t)},ke=function(e,t,l){return a.fromComponents(e,t,l)},Pe=function(t,l,i){return a.fromComponents_noNormalize(t,l,i)},kl=function(t,l){const i=l+1,o=Math.ceil(Math.log10(Math.abs(t))),r=Math.round(t*Math.pow(10,i-o))*Math.pow(10,o-i);return parseFloat(r.toFixed(Math.max(i-o,0)))},Ma=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Xn=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 i=e*e;let o=e;return l=l+1/(12*o),o=o*i,l=l+1/(360*o),o=o*i,l=l+1/(1260*o),o=o*i,l=l+1/(1680*o),o=o*i,l=l+1/(1188*o),o=o*i,l=l+691/(360360*o),o=o*i,l=l+7/(1092*o),o=o*i,l=l+3617/(122400*o),Math.exp(l)/t},yi=.5671432904097838,Ya=function(e,t=1e-10){let l,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return yi;e<10?l=0:l=Math.log(e)-Math.log(Math.log(e));for(let o=0;o<100;++o){if(i=(e*Math.exp(-l)+l*l)/(l+1),Math.abs(i-l)<t*Math.abs(i))return i;l=i}throw Error(`Iteration failed to converge: ${e.toString()}`)};function Za(e,t=1e-10){let l,i,o,r;if(!Number.isFinite(e.mag)||e===a.dZero)return e;if(e===a.dOne)return C(yi);a.abs(e),l=a.ln(e);for(let d=0;d<100;++d){if(i=a.exp(-l),o=l.sub(e.mul(i)),r=l.sub(o.div(l.add(1).sub(l.add(2).mul(o).div(a.mul(2,l).add(2))))),a.abs(r.sub(l)).lt(a.abs(r).mul(t)))return r;l=r}throw Error(`Iteration failed to converge: ${e.toString()}`)}const I=class{constructor(e){this.sign=Number.NaN,this.mag=Number.NaN,this.layer=Number.NaN,e instanceof I||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/Jn(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 I().fromComponents(e,t,l)}static fromComponents_noNormalize(e,t,l){return new I().fromComponents_noNormalize(e,t,l)}static fromMantissaExponent(e,t){return new I().fromMantissaExponent(e,t)}static fromMantissaExponent_noNormalize(e,t){return new I().fromMantissaExponent_noNormalize(e,t)}static fromDecimal(e){return new I().fromDecimal(e)}static fromNumber(e){return new I().fromNumber(e)}static fromString(e){return new I().fromString(e)}static fromValue(e){return new I().fromValue(e)}static fromValue_noAlloc(e){return e instanceof I?e:new I(e)}static abs(e){return C(e).abs()}static neg(e){return C(e).neg()}static negate(e){return C(e).neg()}static negated(e){return C(e).neg()}static sign(e){return C(e).sign}static sgn(e){return C(e).sign}static round(e){return C(e).round()}static floor(e){return C(e).floor()}static ceil(e){return C(e).ceil()}static trunc(e){return C(e).trunc()}static add(e,t){return C(e).add(t)}static plus(e,t){return C(e).add(t)}static sub(e,t){return C(e).sub(t)}static subtract(e,t){return C(e).sub(t)}static minus(e,t){return C(e).sub(t)}static mul(e,t){return C(e).mul(t)}static multiply(e,t){return C(e).mul(t)}static times(e,t){return C(e).mul(t)}static div(e,t){return C(e).div(t)}static divide(e,t){return C(e).div(t)}static recip(e){return C(e).recip()}static reciprocal(e){return C(e).recip()}static reciprocate(e){return C(e).reciprocate()}static cmp(e,t){return C(e).cmp(t)}static cmpabs(e,t){return C(e).cmpabs(t)}static compare(e,t){return C(e).cmp(t)}static isNaN(e){return e=C(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag)}static isFinite(e){return e=C(e),isFinite(e.sign)&&isFinite(e.layer)&&isFinite(e.mag)}static eq(e,t){return C(e).eq(t)}static equals(e,t){return C(e).eq(t)}static neq(e,t){return C(e).neq(t)}static notEquals(e,t){return C(e).notEquals(t)}static lt(e,t){return C(e).lt(t)}static lte(e,t){return C(e).lte(t)}static gt(e,t){return C(e).gt(t)}static gte(e,t){return C(e).gte(t)}static max(e,t){return C(e).max(t)}static min(e,t){return C(e).min(t)}static minabs(e,t){return C(e).minabs(t)}static maxabs(e,t){return C(e).maxabs(t)}static clamp(e,t,l){return C(e).clamp(t,l)}static clampMin(e,t){return C(e).clampMin(t)}static clampMax(e,t){return C(e).clampMax(t)}static cmp_tolerance(e,t,l){return C(e).cmp_tolerance(t,l)}static compare_tolerance(e,t,l){return C(e).cmp_tolerance(t,l)}static eq_tolerance(e,t,l){return C(e).eq_tolerance(t,l)}static equals_tolerance(e,t,l){return C(e).eq_tolerance(t,l)}static neq_tolerance(e,t,l){return C(e).neq_tolerance(t,l)}static notEquals_tolerance(e,t,l){return C(e).notEquals_tolerance(t,l)}static lt_tolerance(e,t,l){return C(e).lt_tolerance(t,l)}static lte_tolerance(e,t,l){return C(e).lte_tolerance(t,l)}static gt_tolerance(e,t,l){return C(e).gt_tolerance(t,l)}static gte_tolerance(e,t,l){return C(e).gte_tolerance(t,l)}static pLog10(e){return C(e).pLog10()}static absLog10(e){return C(e).absLog10()}static log10(e){return C(e).log10()}static log(e,t){return C(e).log(t)}static log2(e){return C(e).log2()}static ln(e){return C(e).ln()}static logarithm(e,t){return C(e).logarithm(t)}static pow(e,t){return C(e).pow(t)}static pow10(e){return C(e).pow10()}static root(e,t){return C(e).root(t)}static factorial(e,t){return C(e).factorial()}static gamma(e,t){return C(e).gamma()}static lngamma(e,t){return C(e).lngamma()}static exp(e){return C(e).exp()}static sqr(e){return C(e).sqr()}static sqrt(e){return C(e).sqrt()}static cube(e){return C(e).cube()}static cbrt(e){return C(e).cbrt()}static tetrate(e,t=2,l=Pe(1,0,1)){return C(e).tetrate(t,l)}static iteratedexp(e,t=2,l=Pe(1,0,1)){return C(e).iteratedexp(t,l)}static iteratedlog(e,t=10,l=1){return C(e).iteratedlog(t,l)}static layeradd10(e,t){return C(e).layeradd10(t)}static layeradd(e,t,l=10){return C(e).layeradd(t,l)}static slog(e,t=10){return C(e).slog(t)}static lambertw(e){return C(e).lambertw()}static ssqrt(e){return C(e).ssqrt()}static pentate(e,t=2,l=Pe(1,0,1)){return C(e).pentate(t,l)}static affordGeometricSeries(e,t,l,i){return this.affordGeometricSeries_core(C(e),C(t),C(l),i)}static sumGeometricSeries(e,t,l,i){return this.sumGeometricSeries_core(e,C(t),C(l),i)}static affordArithmeticSeries(e,t,l,i){return this.affordArithmeticSeries_core(C(e),C(t),C(l),C(i))}static sumArithmeticSeries(e,t,l,i){return this.sumArithmeticSeries_core(C(e),C(t),C(l),C(i))}static efficiencyOfPurchase(e,t,l){return this.efficiencyOfPurchase_core(C(e),C(t),C(l))}static randomDecimalForTesting(e){if(Math.random()*20<1)return Pe(0,0,0);const t=Math.random()>.5?1:-1;if(Math.random()*20<1)return Pe(t,0,1);const l=Math.floor(Math.random()*(e+1));let i=l===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(i=Math.trunc(i));let o=Math.pow(10,i);return Math.random()>.9&&(o=Math.trunc(o)),ke(t,l,o)}static affordGeometricSeries_core(e,t,l,i){const o=t.mul(l.pow(i));return I.floor(e.div(o).mul(l.sub(1)).add(1).log10().div(l.log10()))}static sumGeometricSeries_core(e,t,l,i){return t.mul(l.pow(i)).mul(I.sub(1,l.pow(e))).div(I.sub(1,l))}static affordArithmeticSeries_core(e,t,l,i){const r=t.add(i.mul(l)).sub(l.div(2)),d=r.pow(2);return r.neg().add(d.add(l.mul(e).mul(2)).sqrt()).div(l).floor()}static sumArithmeticSeries_core(e,t,l,i){const o=t.add(i.mul(l));return e.div(2).mul(o.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<Vn)return this.layer+=1,this.mag=Math.log10(this.mag),this;let e=Math.abs(this.mag),t=Math.sign(this.mag);if(e>=Qn)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e<Hn&&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 k=parseFloat(t[0]),v=parseFloat(t[1]),x=t[1].split(";");let D=1;if(x.length===2&&(D=parseFloat(x[1]),isFinite(D)||(D=1)),isFinite(k)&&isFinite(v)){const N=I.pentate(k,v,D);return this.sign=N.sign,this.layer=N.layer,this.mag=N.mag,this}}const l=e.split("^^");if(l.length===2){const k=parseFloat(l[0]),v=parseFloat(l[1]),x=l[1].split(";");let D=1;if(x.length===2&&(D=parseFloat(x[1]),isFinite(D)||(D=1)),isFinite(k)&&isFinite(v)){const N=I.tetrate(k,v,D);return this.sign=N.sign,this.layer=N.layer,this.mag=N.mag,this}}const i=e.split("^");if(i.length===2){const k=parseFloat(i[0]),v=parseFloat(i[1]);if(isFinite(k)&&isFinite(v)){const x=I.pow(k,v);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,this}}e=e.trim().toLowerCase();let o,r,d=e.split("pt");if(d.length===2){o=10,r=parseFloat(d[0]),d[1]=d[1].replace("(",""),d[1]=d[1].replace(")","");let k=parseFloat(d[1]);if(isFinite(k)||(k=1),isFinite(o)&&isFinite(r)){const v=I.tetrate(o,r,k);return this.sign=v.sign,this.layer=v.layer,this.mag=v.mag,this}}if(d=e.split("p"),d.length===2){o=10,r=parseFloat(d[0]),d[1]=d[1].replace("(",""),d[1]=d[1].replace(")","");let k=parseFloat(d[1]);if(isFinite(k)||(k=1),isFinite(o)&&isFinite(r)){const v=I.tetrate(o,r,k);return this.sign=v.sign,this.layer=v.layer,this.mag=v.mag,this}}const c=e.split("e"),m=c.length-1;if(m===0){const k=parseFloat(e);if(isFinite(k))return this.fromNumber(k)}else if(m===1){const k=parseFloat(e);if(isFinite(k)&&k!==0)return this.fromNumber(k)}const p=e.split("e^");if(p.length===2){this.sign=1,p[0].charAt(0)=="-"&&(this.sign=-1);let k="";for(let v=0;v<p[1].length;++v){const x=p[1].charCodeAt(v);if(x>=43&&x<=57||x===101)k+=p[1].charAt(v);else return this.layer=parseFloat(k),this.mag=parseFloat(p[1].substr(v+1)),this.normalize(),this}}if(m<1)return this.sign=0,this.layer=0,this.mag=0,this;const b=parseFloat(c[0]);if(b===0)return this.sign=0,this.layer=0,this.mag=0,this;let w=parseFloat(c[c.length-1]);if(m>=2){const k=parseFloat(c[c.length-2]);isFinite(k)&&(w*=Math.sign(k),w+=Ma(k))}if(!isFinite(b))this.sign=c[0]==="-"?-1:1,this.layer=m,this.mag=w;else if(m===1)this.sign=Math.sign(b),this.layer=1,this.mag=w+Math.log10(Math.abs(b));else if(this.sign=Math.sign(b),this.layer=m,m===2){const k=I.mul(ke(1,2,w),C(b));return this.sign=k.sign,this.layer=k.layer,this.mag=k.mag,this}else this.mag=w;return this.normalize(),this}fromValue(e){return e instanceof I||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:kl(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:kl(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<=Xa?(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):kl(this.m,e)+"e"+kl(this.e,e):this.layer===1?kl(this.m,e)+"e"+kl(this.e,e):this.layer<=Xa?(this.sign===-1?"-":"")+"e".repeat(this.layer)+kl(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+kl(this.mag,e)}abs(){return Pe(this.sign===0?0:1,this.layer,this.mag)}neg(){return Pe(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?I.dZero:this.layer===0?ke(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?I.dZero:this.layer===0?ke(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?I.dZero:this.layer===0?ke(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?I.dZero:this.layer===0?ke(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=C(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 Pe(0,0,0);let l,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(I.cmpabs(this,t)>0?(l=this,i=t):(l=t,i=this),l.layer===0&&i.layer===0)return C(l.sign*l.mag+i.sign*i.mag);const o=l.layer*Math.sign(l.mag),r=i.layer*Math.sign(i.mag);if(o-r>=2)return l;if(o===0&&r===-1){if(Math.abs(i.mag-Math.log10(l.mag))>Sa)return l;{const d=Math.pow(10,Math.log10(l.mag)-i.mag),c=i.sign+l.sign*d;return ke(Math.sign(c),1,i.mag+Math.log10(Math.abs(c)))}}if(o===1&&r===0){if(Math.abs(l.mag-Math.log10(i.mag))>Sa)return l;{const d=Math.pow(10,l.mag-Math.log10(i.mag)),c=i.sign+l.sign*d;return ke(Math.sign(c),1,Math.log10(i.mag)+Math.log10(Math.abs(c)))}}if(Math.abs(l.mag-i.mag)>Sa)return l;{const d=Math.pow(10,l.mag-i.mag),c=i.sign+l.sign*d;return ke(Math.sign(c),1,i.mag+Math.log10(Math.abs(c)))}}plus(e){return this.add(e)}sub(e){return this.add(C(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=C(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return Pe(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return Pe(this.sign*t.sign,0,1);let l,i;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(l=this,i=t):(l=t,i=this),l.layer===0&&i.layer===0)return C(l.sign*i.sign*l.mag*i.mag);if(l.layer>=3||l.layer-i.layer>=2)return ke(l.sign*i.sign,l.layer,l.mag);if(l.layer===1&&i.layer===0)return ke(l.sign*i.sign,1,l.mag+Math.log10(i.mag));if(l.layer===1&&i.layer===1)return ke(l.sign*i.sign,1,l.mag+i.mag);if(l.layer===2&&i.layer===1){const o=ke(Math.sign(l.mag),l.layer-1,Math.abs(l.mag)).add(ke(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return ke(l.sign*i.sign,o.layer+1,o.sign*o.mag)}if(l.layer===2&&i.layer===2){const o=ke(Math.sign(l.mag),l.layer-1,Math.abs(l.mag)).add(ke(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return ke(l.sign*i.sign,o.layer+1,o.sign*o.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=C(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?I.dNaN:this.layer===0?ke(this.sign,0,1/this.mag):ke(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=C(e);return this.sign>t.sign?1:this.sign<t.sign?-1:this.sign*this.cmpabs(e)}cmpabs(e){const t=C(e),l=this.mag>0?this.layer:-this.layer,i=t.mag>0?t.layer:-t.layer;return l>i?1:l<i?-1:this.mag>t.mag?1:this.mag<t.mag?-1:0}compare(e){return this.cmp(e)}isNan(){return isNaN(this.sign)||isNaN(this.layer)||isNaN(this.mag)}isFinite(){return isFinite(this.sign)&&isFinite(this.layer)&&isFinite(this.mag)}eq(e){const t=C(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=C(e);return this.lt(t)?t:this}min(e){const t=C(e);return this.gt(t)?t:this}maxabs(e){const t=C(e);return this.cmpabs(t)<0?t:this}minabs(e){const t=C(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=C(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=C(e);if(t==null&&(t=1e-7),this.sign!==l.sign||Math.abs(this.layer-l.layer)>1)return!1;let i=this.mag,o=l.mag;return this.layer>l.layer&&(o=Ma(o)),this.layer<l.layer&&(i=Ma(i)),Math.abs(i-o)<=t*Math.max(Math.abs(i),Math.abs(o))}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=C(e);return!this.eq_tolerance(l,t)&&this.lt(l)}lte_tolerance(e,t){const l=C(e);return this.eq_tolerance(l,t)||this.lt(l)}gt_tolerance(e,t){const l=C(e);return!this.eq_tolerance(l,t)&&this.gt(l)}gte_tolerance(e,t){const l=C(e);return this.eq_tolerance(l,t)||this.gt(l)}pLog10(){return this.lt(I.dZero)?I.dZero:this.log10()}absLog10(){return this.sign===0?I.dNaN:this.layer>0?ke(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):ke(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?I.dNaN:this.layer>0?ke(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):ke(this.sign,0,Math.log10(this.mag))}log(e){return e=C(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?I.dNaN:this.layer===0&&e.layer===0?ke(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):I.div(this.log10(),e.log10())}log2(){return this.sign<=0?I.dNaN:this.layer===0?ke(this.sign,0,Math.log2(this.mag)):this.layer===1?ke(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?ke(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):ke(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?I.dNaN:this.layer===0?ke(this.sign,0,Math.log(this.mag)):this.layer===1?ke(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?ke(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):ke(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=C(e),l=this,i=t;if(l.sign===0)return i.eq(0)?Pe(1,0,1):l;if(l.sign===1&&l.layer===0&&l.mag===1)return l;if(i.sign===0)return Pe(1,0,1);if(i.sign===1&&i.layer===0&&i.mag===1)return l;const o=l.absLog10().mul(i).pow10();return this.sign===-1?Math.abs(i.toNumber()%2)%2===1?o.neg():Math.abs(i.toNumber()%2)%2===0?o:I.dNaN:o}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return I.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 ke(1,0,t);if(e.sign===0)return I.dOne;e=Pe(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?ke(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?ke(-e.sign,e.layer+1,-e.mag):I.dOne}pow_base(e){return C(e).pow(this)}root(e){const t=C(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?I.exp(I.mul(this,I.ln(this).sub(1))):I.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(Pe(1,0,24)))return C(Xn(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 i=e,o=12*i,r=1/o,d=t+r;if(d===t||(t=d,i=i*l,o=360*i,r=1/o,d=t-r,d===t))return I.exp(t);t=d,i=i*l,o=1260*i;let c=1/o;return t=t+c,i=i*l,o=1680*i,c=1/o,t=t-c,I.exp(t)}else return this.layer===1?I.exp(I.mul(this,I.ln(this).sub(1))):I.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?I.dOne:this.layer===0&&this.mag<=709.7?C(Math.exp(this.sign*this.mag)):this.layer===0?ke(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?ke(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):ke(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return C(Math.sqrt(this.sign*this.mag));if(this.layer===1)return ke(1,2,Math.log10(this.mag)-.3010299956639812);{const e=I.div(Pe(this.sign,this.layer-1,this.mag),Pe(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=Pe(1,0,1)){if(e===1)return I.pow(this,t);if(e===0)return new I(t);if(this.eq(I.dOne))return I.dOne;if(this.eq(-1))return I.pow(this,t);if(e===Number.POSITIVE_INFINITY){const o=this.toNumber();if(o<=1.444667861009766&&o>=.06598803584531254){if(o>1.444667861009099)return new I(Math.E);const r=I.ln(this).neg();return r.lambertw().div(r)}else return o>1.444667861009766?new I(Number.POSITIVE_INFINITY):I.dNaN}if(this.eq(I.dZero)){let o=Math.abs((e+1)%2);return o>1&&(o=2-o),new I(o)}if(e<0)return I.iteratedlog(t,this,-e);t=C(t);const l=e;e=Math.trunc(e);const i=l-e;if(this.gt(I.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let o=0;o<e;++o){const r=t;if(t=this.pow(t),r.eq(t))return t}if(i!=0){const o=this.pow(t);return t.mul(1-i).add(o.mul(i))}return t}i!==0&&(t.eq(I.dOne)?this.gt(10)?t=this.pow(i):(t=C(I.tetrate_critical(this.toNumber(),i)),this.lt(2)&&(t=t.sub(1).mul(this.minus(1)).plus(1))):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let o=0;o<e;++o){if(t=this.pow(t),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(t.layer-this.layer>3)return Pe(t.sign,t.layer+(e-o-1),t.mag);if(o>1e4)return t}return t}iteratedexp(e=2,t=Pe(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return I.tetrate(e,-t,this);e=C(e);let l=C(this);const i=t;t=Math.trunc(t);const o=i-t;if(l.layer-e.layer>3){const r=Math.min(t,l.layer-e.layer-3);t-=r,l.layer-=r}for(let r=0;r<t;++r){if(l=l.log(e),!isFinite(l.layer)||!isFinite(l.mag))return l.normalize();if(r>1e4)return l}return o>0&&o<1&&(e.eq(10)?l=l.layeradd10(-o):l=l.layeradd(-o,e)),l}slog(e=10){if(e=C(e),e.lte(I.dZero)||e.eq(I.dOne))return I.dNaN;if(e.lt(I.dOne))return this.eq(I.dOne)?I.dZero:this.eq(I.dZero)?I.dNegOne:I.dNaN;if(this.mag<0||this.eq(I.dZero))return I.dNegOne;let t=0,l=C(this);if(l.layer-e.layer>3){const i=l.layer-e.layer-3;t+=i,l.layer-=i}for(let i=0;i<100;++i)if(l.lt(I.dZero))l=I.pow(e,l),t-=1;else{if(l.lte(I.dOne))return C(t+I.slog_critical(e.toNumber(),l.toNumber()));t+=1,l=I.log(l,e)}return C(t)}static slog_critical(e,t){return e>10?t-1:I.critical_section(e,t,Kn)}static tetrate_critical(e,t){return I.critical_section(e,t,Wn)}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 i=0,o=0;for(let c=0;c<Fl.length;++c)if(Fl[c]==e){i=l[c][Math.floor(t)],o=l[c][Math.ceil(t)];break}else if(Fl[c]<e&&Fl[c+1]>e){const m=(e-Fl[c])/(Fl[c+1]-Fl[c]);i=l[c][Math.floor(t)]*(1-m)+l[c+1][Math.floor(t)]*m,o=l[c][Math.ceil(t)]*(1-m)+l[c+1][Math.ceil(t)]*m;break}const r=t-Math.floor(t);return i*(1-r)+o*r}layeradd10(e){e=I.fromValue_noAlloc(e).toNumber();const t=C(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 i=0;i<100;++i){if(t.layer++,t.mag=Math.log10(t.mag),!isFinite(t.mag))return t.sign===0&&(t.sign=1),t.layer<0&&(t.layer=0),t.normalize();if(t.layer>=0)break}}for(;t.layer<0;)t.layer++,t.mag=Math.log10(t.mag);return t.sign===0&&(t.sign=1,t.mag===0&&t.layer>=1&&(t.layer-=1,t.mag=1)),t.normalize(),e!==0?t.layeradd(e,10):t}layeradd(e,t){const i=this.slog(t).toNumber()+e;return i>=0?I.tetrate(t,i):Number.isFinite(i)?i>=-1?I.log(I.tetrate(t,i+1),t):I.log(I.log(I.tetrate(t,i+2),t),t):I.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return C(Ya(this.toNumber()));if(this.layer===0)return C(Ya(this.sign*this.mag));if(this.layer===1)return Za(this);if(this.layer===2)return Za(this);if(this.layer>=3)return Pe(this.sign,this.layer-1,this.mag);throw"Unhandled behavior in lambertw()"}ssqrt(){if(this.sign==1&&this.layer>=3)return Pe(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=Pe(1,0,1)){t=C(t);const l=e;e=Math.trunc(e);const i=l-e;i!==0&&(t.eq(I.dOne)?(++e,t=new I(i)):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let o=0;o<e;++o){if(t=this.tetrate(t.toNumber()),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(o>10)return t}return t}sin(){return this.mag<0?this:this.layer===0?C(Math.sin(this.sign*this.mag)):Pe(0,0,0)}cos(){return this.mag<0?I.dOne:this.layer===0?C(Math.cos(this.sign*this.mag)):Pe(0,0,0)}tan(){return this.mag<0?this:this.layer===0?C(Math.tan(this.sign*this.mag)):Pe(0,0,0)}asin(){return this.mag<0?this:this.layer===0?C(Math.asin(this.sign*this.mag)):Pe(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?C(Math.acos(this.toNumber())):this.layer===0?C(Math.acos(this.sign*this.mag)):Pe(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?C(Math.atan(this.sign*this.mag)):C(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 I.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return I.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?Pe(Number.NaN,Number.NaN,Number.NaN):I.ln(this.add(1).div(C(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(I.pow(10,e))}egg(){return this.add(9)}lessThanOrEqualTo(e){return this.cmp(e)<1}lessThan(e){return this.cmp(e)<0}greaterThanOrEqualTo(e){return this.cmp(e)>-1}greaterThan(e){return this.cmp(e)>0}};let a=I;a.dZero=Pe(0,0,0);a.dOne=Pe(1,0,1);a.dNegOne=Pe(-1,0,1);a.dTwo=Pe(1,0,2);a.dTen=Pe(1,0,10);a.dNaN=Pe(Number.NaN,Number.NaN,Number.NaN);a.dInf=Pe(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);a.dNegInf=Pe(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);a.dNumberMax=ke(1,0,Number.MAX_VALUE);a.dNumberMin=ke(1,0,Number.MIN_VALUE);const Yn=new a(1);function Xl(e,t,l=!0){let i=a.log10(e).floor(),o=a.div(e,a.pow(10,i));o.toStringWithDecimalPlaces(t)==="10"&&(o=Yn,i=i.add(1));const r=i.gte(1e9)?we(i,Math.max(Math.max(t,3),Ve.defaultDecimalsShown)):i.gte(1e4)?ma(i,0):i.toStringWithDecimalPlaces(0);return l?o.toStringWithDecimalPlaces(t)+"e"+r:"e"+r}function ma(e,t){if(e==null)return"NaN";if(e=new a(e),e.mag<.001)return 0 .toFixed(t);const i=e.toStringWithDecimalPlaces(t).split(".");return i[0]=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),i.length==1?i[0]:i[0]+"."+i[1]}function hi(e,t){return e==null?"NaN":(e=new a(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),Ve.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Zn=new a("eeee1000"),eo=new a("e100000"),ei=new a("e1000"),bi=new a(1e9),to=new a(1e6),lo=new a(1e3),ao=new a(.98),io=new a(.001),wi=new a(0);function we(e,t,l){if(t==null&&(t=Ve.defaultDecimalsShown),l=l!=null?l:Ve.defaultShowSmall,e=new a(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+we(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Zn)){const i=e.slog();return i.gte(to)?"F"+we(i.floor()):a.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+ma(i.floor(),0)}else{if(e.gte(eo))return Xl(e,0,!1);if(e.gte(ei))return Xl(e,0);if(e.gte(bi))return Xl(e,t);if(e.gte(lo))return ma(e,0);if(e.gte(io)||!l)return hi(e,t);if(e.eq(wi))return 0 .toFixed(t)}return e=Ai(e),e.lt(ei)?Xl(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):we(e,t)+"\u207B\xB9"}function Ce(e){return e=new a(e),e.sign<0?"-"+Ce(e.neg()):e.gte(bi)||e.lte(ao)&&!e.eq(wi)?we(e):we(e,0)}function Pa(e,t){return t==null&&(t=Ve.defaultDecimalsShown),a.lt(e,0)?"-"+Pa(a.neg(e),t):a.gt(e,2**51)?we(a.div(e,31536e3))+"y":(e=new a(e).toNumber(),e<60?we(e)+"s":e<3600?Ce(Math.floor(e/60))+"m "+we(e%60,t)+"s":e<86400?Ce(Math.floor(e/3600))+"h "+Ce(Math.floor(e/60)%60)+"m "+Ce(e%60)+"s":e<31536e3?Ce(Math.floor(e/84600)%365)+"d "+Ce(Math.floor(e/3600)%24)+"h "+Ce(Math.floor(e/60)%60)+"m":Ce(Math.floor(e/31536e3))+"y "+Ce(Math.floor(e/84600)%365)+"d "+Ce(Math.floor(e/3600)%24)+"h")}function no(e,t,l){e=new a(e);let i=e.toStringWithDecimalPlaces(t);return new a(i).gte(l)&&(i=a.sub(l,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function oo(e,t){return we(e,t,!0)}function Ai(e){let t=a.log10(e).ceil();const l=a.div(e,a.pow(10,t));return t=t.neg(),e=new a(10).pow(t).times(l),e}function ki(e,t,l=a.dOne){let i=e[0][0],o=e[0][1];for(let r=1;r<e.length;r++)a.lt(e[r][0],i)&&(i=e[r][0],o=e[r][1]);return we(a.times(i,l))+t+", limited by "+o}function Ci(e){return{[-1]:`${we(e)}/s`,0:"",1:`+${we(e)}/s`}[a.compare(e,0)]}var so=Object.freeze(Object.defineProperty({__proto__:null,default:a,exponentialFormat:Xl,commaFormat:ma,regularFormat:hi,format:we,formatWhole:Ce,formatTime:Pa,toPlaces:no,formatSmall:oo,invertOOM:Ai,formatLimit:ki,formatGain:Ci},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:ro,commaFormat:uo,regularFormat:co,format:H,formatWhole:le,formatTime:Vl,toPlaces:po,formatSmall:mo,formatLimit:Ei,invertOOM:vo,formatGain:va}=so;window.Decimal=a;window.exponentialFormat=ro;window.commaFormat=uo;window.regularFormat=co;window.format=H;window.formatWhole=le;window.formatTime=Vl;window.toPlaces=po;window.formatSmall=mo;window.formatLimit=Ei;window.invertOOM=vo;window.formatGain=va;function _i(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Ta(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 ea=Symbol("DoNotCache");function Y(e,t){const l=e[t];Ta(l)&&l.length===0&&!l[ea]?e[t]=f(l.bind(e)):Ta(l)&&(e[t]=l.bind(e),e[t][ea]=!0)}function Et(e){return Ta(e)&&!e[ea]&&(e=f(e)),e}const Dl=Symbol("Component"),Il=Symbol("GatherProps");let fo=0;function zl(e="feature-"){return e+fo++}var Ct=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(Ct||{});function _(e){return e[ea]=!0,e}function h(e,t=2){return e?0:t}function Dt(e,t,l){e[t]===void 0&&l!=null&&(e[t]=l)}function Si(e,...t){const l=[],i=o=>{Object.keys(o).forEach(r=>{const d=o[r];d&&typeof d=="object"&&(t.includes(d.type)?l.push(d):!(d instanceof a)&&!gt(d)&&i(d))})};return i(e),l}const Ul={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 Fa=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Fa||{}),Jl={classic:Ul,paper:{...Ul,variables:{...Ul.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:{...Ul,variables:{...Ul.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:{...Ul,variables:{...Ul.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const lt=fi();document.fonts.onloadingdone=()=>lt.emit("fontsLoaded");var go=Object.freeze(Object.defineProperty({__proto__:null,globalBus:lt},Symbol.toStringTag,{value:"Module"}));var je=(e,t)=>{const l=e.__vccOpts||e;for(const[i,o]of t)l[i]=o;return l};const yo=_e({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var b;const l=j({}),i=new ResizeObserver(c),o=j(null);ya(()=>{const w=o.value;w!=null&&i.observe(w)});let r=!0,d=j((b=o.value)==null?void 0:b.getBoundingClientRect());function c(){r&&(r=!1,Ol(()=>{var w;d.value=(w=o.value)==null?void 0:w.getBoundingClientRect(),Object.values(l.value).filter(k=>k).forEach(k=>k.rect=k.element.getBoundingClientRect()),t("updateNodes",l.value),r=!0}))}lt.on("fontsLoaded",c);const m={attributes:!1,childList:!0,subtree:!1};ra(Ua,(w,k)=>{const v=new MutationObserver(()=>p(w));v.observe(k,m),l.value[w]={element:k,observer:v,rect:k.getBoundingClientRect()},c()}),ra(Ra,w=>{var k;(k=l.value[w])==null||k.observer.disconnect(),l.value[w]=void 0,c()}),ra(Oa,l),ra(La,d);function p(w){const k=l.value[w];k!=null&&(k.rect=k.element.getBoundingClientRect(),t("updateNodes",l.value))}return(w,k)=>(A(),T(S,null,[Yt(w.$slots,"default",{},void 0,!0),y("div",{ref_key:"resizeListener",ref:o,class:"resize-listener"},null,512)],64))}});var Mi=je(yo,[["__scopeId","data-v-2b1dc1bc"]]);const ho=["onPointerdown"],bo={class:"modal-wrapper"},wo={class:"modal-container"},Ao={class:"modal-header"},ko=s(" default header "),Co={class:"modal-body"},Eo=s(" default body "),_o={class:"modal-footer"},So=y("div",{class:"modal-default-flex-grow"},null,-1),_t=_e({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:l}){const o=It(e),r=f(()=>o.modelValue||c.value);function d(){l("update:modelValue",!1)}const c=j(!1),m=j(null),p=f(()=>{var b,w;return(w=(b=m.value)==null?void 0:b.nodes)!=null?w:null});return t({isOpen:r,nodes:p}),(b,w)=>(A(),ye(on,{to:"#modal-root"},[n(ba,{name:"modal",onBeforeEnter:w[0]||(w[0]=k=>c.value=!0),onAfterLeave:w[1]||(w[1]=k=>c.value=!1)},{default:fe(()=>[ha(y("div",Ll({class:"modal-mask",onPointerdown:Zl(d,["self"])},b.$attrs),[y("div",bo,[y("div",wo,[y("div",Ao,[Yt(b.$slots,"header",{shown:u(r)},()=>[ko])]),y("div",Co,[n(Mi,{ref_key:"contextRef",ref:m},{default:fe(()=>[Yt(b.$slots,"body",{shown:u(r)},()=>[Eo])]),_:3},512)]),y("div",_o,[Yt(b.$slots,"footer",{shown:u(r)},()=>[y("div",{class:"modal-default-footer"},[So,y("button",{class:"button modal-default-button",onClick:d}," Close ")])])])])])],16,ho),[[pi,e.modelValue]])]),_:3})]))}}),Ua=Symbol("RegisterNode"),Ra=Symbol("UnregisterNode"),Oa=Symbol("Nodes"),La=Symbol("Bounds"),Nt=wa({});window.layers=Nt;const $l={},al=[];function Ht(e,t){return Vt(()=>{const l={},i=l.emitter=fi();if(l.on=i.on.bind(i),l.emit=i.emit.bind(i),l.nodes=j({}),l.id=e,al.push(e),$l[e]=new Set,l.minimized=xe(!1),Object.assign(l,t.call(l)),al[al.length-1]==null||al[al.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
Stack: ${al}
Trying to pop ${l.id}`;return al.pop(),Y(l,"color"),Y(l,"display"),Y(l,"name"),Dt(l,"name",l.id),Y(l,"minWidth"),Dt(l,"minWidth",600),Y(l,"minimizable"),Dt(l,"minimizable",!0),Y(l,"minimizedDisplay"),l})}function xi(e,t){if(console.info("Adding layer",e.id),Nt[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,Nt[e.id]);return}Dt(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),Nt[e.id]=e,lt.emit("addLayer",e,t.layers[e.id])}function Mo(e){return Nt[e]}function Bi(e){console.info("Removing layer",e.id),lt.emit("removeLayer",e),Nt[e.id]=void 0}function xo(e){Bi(e),xi(e,pe)}function Bo(e){const t=j(!1);return{openModal:()=>t.value=!0,modal:_(()=>n(_t,{modelValue:t.value,"onUpdate:modelValue":l=>t.value=l},{header:()=>n("h2",null,[u(e.name)]),body:u(e.display)}))}}lt.on("update",function(t){Object.values(Nt).forEach(l=>{l==null||l.emit("preUpdate",t)}),Object.values(Nt).forEach(l=>{l==null||l.emit("update",t)}),Object.values(Nt).forEach(l=>{l==null||l.emit("postUpdate",t)})});var No=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Ua,UnregisterNodeInjectionKey:Ra,NodesInjectionKey:Oa,BoundsInjectionKey:La,layers:Nt,persistentRefs:$l,addingLayers:al,createLayer:Ht,addLayer:xi,getLayer:Mo,removeLayer:Bi,reloadLayer:xo,setupLayerModal:Bo},Symbol.toStringTag,{value:"Module"}));const qa=Symbol("PersistentState"),Sl=Symbol("DefaultValue"),fa=Symbol("StackTrace"),Ni=Symbol("Deleted"),ta=Symbol("NonPersistent"),Yl=Symbol("SaveDataPath");function Do(){var e;return((e=new Error().stack)==null?void 0:e.split(`
`).slice(3,5).map(t=>t.trim()).join(`
`))||""}function xe(e){const t=gt(e)?e:j(e);t[qa]=t,t[Sl]=gt(e)?e.value:e,t[fa]=Do(),t[Ni]=!1;const l=f({get(){return t.value},set(i){t.value=i}});return l[Sl]=t[Sl],t[ta]=l,t[Yl]=void 0,al.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",t,`
Created at:
`+t[fa]):$l[al[al.length-1]].add(t),t}function Io(e){return e&&typeof e=="object"&&qa in e}function O(e){return e[ta]}lt.on("addLayer",(e,t)=>{const l=[],i=(o,r=[])=>{let d=!1;return Object.keys(o).forEach(c=>{let m=o[c];if(m&&typeof m=="object")if(ft in m&&(m=m[ft]),Io(m)){if(d=!0,m[Ni]){console.warn("Deleted persistent ref present in returned object. Ignoring...",m,`
Created at:
`+m[fa]);return}$l[e.id].delete(m);const p=[e.id,...r,c];m[Yl]!=null&&JSON.stringify(p)!==JSON.stringify(m[Yl])&&console.error(`Persistent ref is being saved to \`${p.join(".")}\` when it's already present at \`${m[Yl].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,m),m[Yl]=p;const b=r.reduce((k,v)=>(v in k||(k[v]={}),k[v]),t),w=b[c];b[c]=m[qa],sn(b)?w!=null?b[c]=w:b[c]=m[Sl]:w!=null?b[c].value=w:b[c].value=m[Sl]}else!(m instanceof a)&&!gt(m)&&!l.includes(m)&&(typeof m.type=="symbol"&&l.push(m),i(m,[...r,c])&&(Ia(m)&&!Ia(o)?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.",ft in o?o[ft]:o,c):d=!0))}),d};i(e[ft]),$l[e.id].forEach(o=>{console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,o,`
Created at:
`+o[fa])}),$l[e.id].clear()});const ft=Symbol("ProxyState"),Gl=Symbol("ProxyPath");function Vt(e,t={}){const l=t;let i=!1;function o(){return i||(Object.assign(l,e(l)),i=!0),l}return new Proxy(l,{get(r,d){if(d===ft)return o();const c=o()[d];return c&&typeof c=="object"&&ta in c?c[ta]:c},set(r,d,c){return o()[d]=c,!0},has(r,d){return d===ft?!0:Reflect.has(o(),d)},ownKeys(){return Reflect.ownKeys(o())},getOwnPropertyDescriptor(r,d){return i||(Object.assign(l,e(l)),i=!0),Object.getOwnPropertyDescriptor(r,d)}})}var bt=window.state=wa({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Di=ia({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{},autoPause:!0});function Ii(e){return JSON.stringify(e,(t,l)=>u(l))}const Ti={get(e,t){var i;if(t===ft||t===Gl)return e[t];const l=e[ft][t];if(t!=="value"&&(mn(l)||Array.isArray(l))){if(l!==((i=e[t])==null?void 0:i[ft])){const o=[...e[Gl],t];e[t]=new Proxy({[ft]:l,[Gl]:o},Ti)}return e[t]}return l},set(e,t,l,i){if(!bt.hasNaN&&(typeof l=="number"&&isNaN(l)||l instanceof a&&(isNaN(l.sign)||isNaN(l.layer)||isNaN(l.mag)))){const o=e[ft][t];if(!(typeof o=="number"&&isNaN(o)||o instanceof a&&(isNaN(o.sign)||isNaN(o.layer)||isNaN(o.mag))))throw Di.autosave=!1,bt.hasNaN=!0,bt.NaNPath=[...e[Gl],t],bt.NaNReceiver=i,console.error("Attempted to set NaN value",[...e[Gl],t],e[ft]),"Attempted to set NaN value. See above for details"}return e[ft][t]=l,!0},ownKeys(e){return Reflect.ownKeys(e[ft])},has(e,t){return Reflect.has(e[ft],t)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e[ft],t)}};var pe=window.player=new Proxy({[ft]:Di,[Gl]:["player"]},Ti);function Pi(e={}){return Object.assign({id:`${Ve.id}-0`,name:"Default Save",tabs:Ve.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:Ve.id,modVersion:Ve.versionNumber,layers:{}},e)}function zt(e){const t=El.compressToUTF16(Ii(e!=null?e:pe[ft]));return localStorage.setItem((e!=null?e:pe[ft]).id,t),t}async function To(){Fo();try{let e=localStorage.getItem(ot.active);if(e==null){await Rl(Ql());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=El.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==Ve.id){await Rl(Ql());return}t.id=ot.active,await Rl(t)}catch(e){console.error(`Failed to load save. Falling back to new save.
`,e),await Rl(Ql())}}function Ql(){const e=da(),t=Pi({id:e});return zt(t),ot.saves.push(e),t}function da(){let e,t=0;do e=`${Ve.id}-${t++}`;while(localStorage.getItem(e));return e}const Ga=j(!1);async function Rl(e){console.info("Loading save",e),Ga.value=!0;const{layers:t,removeLayer:l,addLayer:i}=await pa(()=>Promise.resolve().then(function(){return No}),void 0),{fixOldSave:o,getInitialLayers:r}=await pa(()=>Promise.resolve().then(function(){return Ir}),void 0);for(const d in t){const c=t[d];c&&l(c)}r(e).forEach(d=>i(d,e)),e=Pi(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,Ve.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==Ve.versionNumber&&(o(e.modVersion,e),e.modVersion=Ve.versionNumber),Object.assign(pe,e),ot.active=pe.id,lt.emit("onLoad")}setInterval(()=>{pe.autosave&&zt()},1e3);window.onbeforeunload=()=>{pe.autosave&&zt()};window.save=zt;const Po=window.hardReset=async()=>{await Rl(Ql())},la=ia({active:"",saves:[],showTPS:!0,theme:Fa.Nordic,unthrottled:!1,usingLog:!1,alignUnits:!1});Jt(la,e=>{const t=El.compressToUTF16(JSON.stringify(e));localStorage.setItem(Ve.id,t)},{deep:!0});var ot=window.settings=la;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Fa.Nordic,usingLog:!1,alignUnits:!1};lt.emit("loadSettings",e),Object.assign(la,e),Po()};function Fo(){try{let e=localStorage.getItem(Ve.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=El.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(la,t)}lt.emit("loadSettings",la)}catch{}}const Fi=ia([]);function Uo(e){Fi.push(e)}const Ui=ia([]);function Ro(e){Ui.push(e)}const Oo=ia([]),Lo={class:"table"},$t=_e({__name:"Column",setup(e){const t=f(()=>Jl[ot.theme].mergeAdjacent);return(l,i)=>(A(),T("div",Lo,[y("div",{class:vt(["col",{mergeAdjacent:u(t)}])},[Yt(l.$slots,"default")],2)]))}}),qo={class:"table"},jl=_e({__name:"Row",setup(e){const t=f(()=>Jl[ot.theme].mergeAdjacent);return(l,i)=>(A(),T("div",qo,[y("div",{class:vt(["row",{mergeAdjacent:u(t)}])},[Yt(l.$slots,"default")],2)]))}});function $a(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!rn(e)}function He(e,t="span"){return typeof e=="function"?_e({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),_e({template:e})):_e({render:()=>({})}):e}function me(e){if(gl(e))return typeof e=="function"?e():He(e);const t=e[Dl];return n(t,e[Il](),null)}function nt(...e){let t;return n(jl,null,$a(t=e.map(me))?t:{default:()=>[t]})}function el(...e){let t;return n($t,null,$a(t=e.map(me))?t:{default:()=>[t]})}function Ml(...e){return n("div",{class:"table-grid"},[e.map(t=>n("div",{class:{["row-grid"]:!0,mergeAdjacent:Jl[ot.theme].mergeAdjacent}},[t.map(me)]))])}function ol(e){if(gl(e))return typeof e=="function"?e():typeof e=="string"?n(S,null,[e]):n(e,null,null);const t=e[Dl];return n(t,e[Il](),null)}function Go(...e){let t;return n($t,null,$a(t=e.map(ol))?t:{default:()=>[t]})}function gl(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[ea]===!0}function Ri(e,t,l){const i=j(null),o=j(void 0);function r(m){i.value||(i.value=setInterval(c,250)),o.value=m,l&&(l.value=!0)}function d(){i.value&&(clearInterval(i.value),i.value=null),l&&(l.value=!1)}function c(){t&&t.value?t.value():e&&e.value&&e.value(o.value)}return mi(d),{start:r,stop:d,handleHolding:c}}function $o(e,t){const l=f(()=>e.filter(i=>u(i.visibility)===Ct.Visible&&t(i)));return{firstFeature:f(()=>l.value[0]),collapsedContent:_(()=>el(...l.value.slice(1))),hasCollapsedContent:f(()=>l.value.length>1)}}function ga(e,t="div"){const l=Zt();return Qt(()=>{l.value=He(Mt(e),t)}),l}function yl(e,t="div"){const l=Zt(null);return Qt(()=>{const i=Mt(e);l.value=i==null?null:He(i,t)}),l}function Qo(e){return f(()=>Mt(e))}function Mt(e){return u(u(e))}function ee(...e){return e.includes(Object)||e.push(Object),e}const Ee=_e({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,l)=>(A(),T("div",{style:At({width:e.width,height:e.height})},null,4))}});const Ho={},Vo={class:"notif"};function jo(e,t){return A(),T("div",Vo,"!")}var ti=je(Ho,[["render",jo],["__scopeId","data-v-66323fd4"]]),zo=_e({props:{element:Object,display:{type:ee(Object,String,Function),required:!0},style:ee(Object,String,Array),classes:ee(Object),direction:ee(String),xoffset:ee(String),yoffset:ee(String),pinned:Object},setup(e){const{element:t,display:l,pinned:i}=It(e),o=j(!1),r=f(()=>(Mt(i)||o.value)&&d.value),d=yl(l),c=Zt(He(_(()=>{const b=Mt(t);return b==null?"":ol(b)})));function m(b){const w=i;b.shiftKey&&w&&(w.value=!w.value,b.stopPropagation(),b.preventDefault())}const p=f(()=>Mt(i)&&Jl[ot.theme].showPin);return{Direction:Fe,isHovered:o,isShown:r,comp:d,elementComp:c,unref:u,togglePinned:m,showPin:p}}});const Jo={key:0,class:"material-icons pinned"};function Wo(e,t,l,i,o,r){return A(),T("div",{class:vt(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=d=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=d=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...d)=>e.togglePinned&&e.togglePinned(...d))},[Yt(e.$slots,"default",{},void 0,!0),e.elementComp?(A(),ye(ct(e.elementComp),{key:0})):G("",!0),n(ba,{name:"fade"},{default:fe(()=>{var d;return[e.isShown?(A(),T("div",{key:0,class:vt(["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:At([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(d=e.unref(e.style))!=null?d:{}])},[e.showPin?(A(),T("span",Jo,"push_pin")):G("",!0),e.comp?(A(),ye(ct(e.comp),{key:1})):G("",!0)],6)):G("",!0)]}),_:1})],34)}var wt=je(zo,[["render",Wo],["__scopeId","data-v-6102fa3a"]]);const Aa=e=>(Bl("data-v-14ecc7bd"),e=e(),Nl(),e),Ko={key:0,class:"day feature dontMerge opened"},Xo={class:"date"},Yo=s("Dec"),Zo=Aa(()=>y("br",null,null,-1)),es={class:"date"},ts=s("Dec"),ls=Aa(()=>y("br",null,null,-1)),as=Aa(()=>y("div",{class:"doors"},null,-1)),is={class:"date"},ns=s("Dec"),os=Aa(()=>y("br",null,null,-1)),ss={key:0,class:"material-icons lock"},rs={key:1,class:"timer"},us=_e({__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,i=f(()=>l.layer&&a.gte(U.day.value,l.day)&&new Date().getMonth()===11&&new Date().getDate()>=l.day);function o(){i.value&&t("unlockLayer")}return(r,d)=>{var c,m,p;return e.opened.value?(A(),T("div",Ko,[n(wt,{display:(p=(m=u(Nt)[(c=e.layer)!=null?c:""])==null?void 0:m.name)!=null?p:"",direction:u(Fe).Up,yoffset:"5px"},{default:fe(()=>[n(ba,{appear:"",name:"door"},{default:fe(()=>[y("div",{class:"doors",onClick:d[0]||(d[0]=b=>t("openLayer"))},[y("div",Xo,[Yo,Zo,s(Te(e.day),1)]),y("div",es,[ts,ls,s(Te(e.day),1)])])]),_:1}),y("div",{class:"icon",onClick:d[1]||(d[1]=b=>t("openLayer")),style:At({backgroundImage:`url(${e.symbol})`})},null,4),y("div",{class:"lore",onClick:d[2]||(d[2]=b=>t("openLore"))},"?"),u(e.shouldNotify)?(A(),ye(ti,{key:0})):G("",!0)]),_:1},8,["display","direction"])])):(A(),T("div",{key:1,class:vt(["day feature dontMerge",{can:u(i),locked:!u(i),canOpen:u(i)}]),onClick:o},[as,y("div",is,[ns,os,s(Te(e.day),1)]),u(i)?G("",!0):(A(),T("div",ss,"lock")),u(U).day.value===e.day&&!u(i)?(A(),T("div",rs,Te(u(U).timeUntilNewDay.value<0?"NYI, sorry":u(Pa)(u(U).timeUntilNewDay.value,0)),1)):G("",!0),u(i)?(A(),ye(ti,{key:2})):G("",!0)],2))}}});var ds=je(us,[["__scopeId","data-v-14ecc7bd"]]);const cs=_e({__name:"Collapsible",props:{collapsed:null,display:null,content:null},setup(e){const t=e,l=ga(sl(t,"display")),i=ga(sl(t,"content"));return(o,r)=>(A(),ye($t,{class:"collapsible-container"},{default:fe(()=>[y("button",{onClick:r[0]||(r[0]=d=>e.collapsed.value=!e.collapsed.value),class:"feature collapsible-toggle"},[(A(),ye(ct(u(l))))]),e.collapsed.value?G("",!0):(A(),ye(ct(u(i)),{key:0}))]),_:1}))}});var ps=je(cs,[["__scopeId","data-v-a72c16aa"]]);const ms={key:0},vs={key:0,class:"mark star"},fs=["src"],gs=_e({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,l)=>e.mark?(A(),T("div",ms,[e.mark===!0?(A(),T("div",vs)):(A(),T("img",{key:1,class:"mark",src:e.mark},null,8,fs))])):G("",!0)}});var ka=je(gs,[["__scopeId","data-v-2207999f"]]);const ys=_e({__name:"Node",props:{id:null},setup(e){const l=It(e),i=ca(Ua,()=>{}),o=ca(Ra,()=>{}),r=Zt(null),d=f(()=>r.value&&r.value.parentElement);return Jt([d,l.id],([c,m],[p,b])=>{p&&o(u(b)),c&&i(m,c)}),mi(()=>o(u(l.id))),(c,m)=>(A(),T("div",{class:"node",ref_key:"node",ref:r},null,512))}});var na=je(ys,[["__scopeId","data-v-a48cb382"]]);const hs=_e({props:{progress:{type:ee(String,Object,Number),required:!0},width:{type:ee(Number),required:!0},height:{type:ee(Number),required:!0},direction:{type:ee(String),required:!0},display:ee(Object,String,Function),visibility:{type:ee(Number),required:!0},style:ee(Object,String,Array),classes:ee(Object),borderStyle:ee(Object,String,Array),textStyle:ee(Object,String,Array),baseStyle:ee(Object,String,Array),fillStyle:ee(Object,String,Array),mark:ee(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:ka,Node:na},setup(e){const{progress:t,width:l,height:i,direction:o,display:r}=It(e),d=f(()=>{let p=t.value instanceof a?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(p,0),1))*100}),c=f(()=>{const p={width:Mt(l)+.5+"px",height:Mt(i)+.5+"px"};switch(u(o)){case Fe.Up:p.clipPath=`inset(${d.value}% -2px -2px -2px)`,p.width=Mt(l)+2+"px";break;case Fe.Down:p.clipPath=`inset(-2px -2px ${d.value}% -2px)`,p.width=Mt(l)+2+"px";break;case Fe.Right:p.clipPath=`inset(-2px ${d.value}% -2px -2px)`;break;case Fe.Left:p.clipPath=`inset(-2px -2px -2px ${d.value} + '%)`;break;case Fe.Default:p.clipPath="inset(-2px 50% -2px -2px)";break}return p}),m=yl(r);return{normalizedProgress:d,barStyle:c,component:m,unref:u,Visibility:Ct}}});function bs(e,t,l,i,o,r){var m,p,b,w,k,v,x;const d=xl("MarkNode"),c=xl("Node");return e.unref(e.visibility)!==e.Visibility.None?(A(),T("div",{key:0,style:At([{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:vt({bar:!0,...e.unref(e.classes)})},[y("div",{class:"overlayTextContainer border",style:At([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(p=e.unref(e.borderStyle))!=null?p:{}])},[e.component?(A(),T("span",{key:0,class:"overlayText",style:At(e.unref(e.textStyle))},[(A(),ye(ct(e.component)))],4)):G("",!0)],4),y("div",{class:"border",style:At([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(b=e.unref(e.style))!=null?b:{},(w=e.unref(e.baseStyle))!=null?w:{},(k=e.unref(e.borderStyle))!=null?k:{}])},[y("div",{class:"fill",style:At([e.barStyle,(v=e.unref(e.style))!=null?v:{},(x=e.unref(e.fillStyle))!=null?x:{}])},null,4)],4),n(d,{mark:e.unref(e.mark)},null,8,["mark"]),n(c,{id:e.id},null,8,["id"])],6)):G("",!0)}var ws=je(hs,[["render",bs],["__scopeId","data-v-730cc7a0"]]);const As=Symbol("Bar");function tl(e){return Vt(()=>{const t=e();return t.id=zl("bar-"),t.type=As,t[Dl]=ws,Y(t,"visibility"),Dt(t,"visibility",Ct.Visible),Y(t,"width"),Y(t,"height"),Y(t,"direction"),Y(t,"style"),Y(t,"classes"),Y(t,"borderStyle"),Y(t,"baseStyle"),Y(t,"textStyle"),Y(t,"fillStyle"),Y(t,"progress"),Y(t,"display"),Y(t,"mark"),t[Il]=function(){const{progress:l,width:i,height:o,direction:r,display:d,visibility:c,style:m,classes:p,borderStyle:b,textStyle:w,baseStyle:k,fillStyle:v,mark:x,id:D}=this;return{progress:l,width:i,height:o,direction:r,display:d,visibility:c,style:u(m),classes:p,borderStyle:b,textStyle:w,baseStyle:k,fillStyle:v,mark:x,id:D}},t})}var ks=_e({props:{display:{type:ee(Object,String,Function),required:!0},visibility:{type:ee(Number),required:!0},style:ee(Object,String,Array),classes:ee(Object),onClick:Function,onHold:Function,canClick:{type:ee(Boolean),required:!0},small:Boolean,mark:ee(Boolean,String),id:{type:String,required:!0},isHolding:Object},components:{Node:na,MarkNode:ka},setup(e){const{display:t,onClick:l,onHold:i}=It(e),o=Zt("");Qt(()=>{const c=Mt(t);if(c==null){o.value="";return}if(gl(c)){o.value=He(c);return}const m=He(c.title||"","h3"),p=He(c.description,"div");o.value=He(_(()=>n("span",null,[c.title?n("div",null,[n(m,null,null)]):null,n(p,null,null)])))});const{start:r,stop:d}=Ri(l,i,e.isHolding);return{start:r,stop:d,comp:o,Visibility:Ct,unref:u}}});function Cs(e,t,l,i,o,r){var m;const d=xl("MarkNode"),c=xl("Node");return e.unref(e.visibility)!==e.Visibility.None?(A(),T("button",{key:0,style:At([{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:vt({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)?(A(),ye(ct(e.unref(e.comp)),{key:0})):G("",!0),n(d,{mark:e.unref(e.mark)},null,8,["mark"]),n(c,{id:e.id},null,8,["id"])],38)):G("",!0)}var Oi=je(ks,[["render",Cs],["__scopeId","data-v-8cedd7da"]]);const Es=Symbol("Clickable");function Lt(e){return Vt(()=>{var l;const t=(l=e==null?void 0:e())!=null?l:{};if(t.id=zl("clickable-"),t.type=Es,t[Dl]=Oi,t.isHolding=j(!1),Y(t,"visibility"),Dt(t,"visibility",Ct.Visible),Y(t,"canClick"),Dt(t,"canClick",!0),Y(t,"classes"),Y(t,"style"),Y(t,"mark"),Y(t,"display"),t.onClick){const i=t.onClick.bind(t);t.onClick=function(o){u(t.canClick)&&i(o)}}if(t.onHold){const i=t.onHold.bind(t);t.onHold=function(){u(t.canClick)&&i()}}return t[Il]=function(){const{display:i,visibility:o,style:r,classes:d,onClick:c,onHold:m,isHolding:p,canClick:b,small:w,mark:k,id:v}=this;return{display:i,visibility:o,style:u(r),classes:d,onClick:c,onHold:m,isHolding:p,canClick:b,small:w,mark:k,id:v}},t})}function kt(e,t="points",l=0,i=void 0){const o=gt(e)?e:xe(e);if(o.displayName=t,o.precision=l,o.small=i,!gt(e)){const r=o[ta];r.displayName=t,r.precision=l,r.small=i}return o}function li(e){const t=xe(e.value);return Jt(e,l=>{Ga.value||a.gt(l,t.value)&&(t.value=l)}),t}function _s(e){const t=xe(e.value);return Jt(e,(l,i)=>{Ga.value||a.gt(l,i)&&(t.value=a.add(t.value,a.sub(l,i)))}),t}new a("10^^8");new a("1e100");function oa(e,t){const l=t!=null?t:e.value;return a.eq(e.precision,0)?le(e.small?l:a.floor(l)):H(l,e.precision,e.small)}const Ss=["x1","y1","x2","y2"],Ms=_e({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const l=It(e),i=f(()=>{const r=l.startNode.value.rect,d=l.boundingRect.value,c=d?{x:r.x+r.width/2-d.x,y:r.y+r.height/2-d.y}:{x:0,y:0};return l.link.value.offsetStart&&(c.x+=l.link.value.offsetStart.x,c.y+=l.link.value.offsetStart.y),c}),o=f(()=>{const r=l.endNode.value.rect,d=l.boundingRect.value,c=d?{x:r.x+r.width/2-d.x,y:r.y+r.height/2-d.y}:{x:0,y:0};return l.link.value.offsetEnd&&(c.x+=l.link.value.offsetEnd.x,c.y+=l.link.value.offsetEnd.y),c});return(r,d)=>(A(),T("line",Ll({"stroke-width":"15px",stroke:"white"},e.link,{x1:u(i).x,y1:u(i).y,x2:u(o).x,y2:u(o).y}),null,16,Ss))}});const xs=_e({__name:"Links",props:{links:null},setup(e){var m;const l=sl(e,"links"),i=j(null),o=ca(Oa,j({})),r=ca(La,j(void 0)),d=j((m=i.value)==null?void 0:m.getBoundingClientRect());Jt(r,()=>{var p;return d.value=(p=i.value)==null?void 0:p.getBoundingClientRect()}),ya(()=>{var p;return d.value=(p=i.value)==null?void 0:p.getBoundingClientRect()});const c=f(()=>{var b,w;const p=o.value;return(w=(b=l.value)==null?void 0:b.filter(k=>{var v,x;return((v=p[k.startNode.id])==null?void 0:v.rect)&&((x=p[k.startNode.id])==null?void 0:x.rect)}))!=null?w:[]});return(p,b)=>(A(),T(S,null,[u(c)?(A(),T("svg",un(Ll({key:0},p.$attrs)),[(A(!0),T(S,null,vi(u(c),(w,k)=>(A(),ye(Ms,{key:k,link:w,boundingRect:d.value,startNode:u(o)[w.startNode.id],endNode:u(o)[w.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):G("",!0),y("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Bs=je(xs,[["__scopeId","data-v-063f6d6b"]]);_e({props:{nodes:{type:ee(Array),required:!0},leftSideNodes:ee(Array),rightSideNodes:ee(Array),branches:ee(Array)},components:{Links:Bs},setup(e){const{nodes:t,leftSideNodes:l,rightSideNodes:i}=It(e),o=Zt();Qt(()=>{const c=Mt(t);o.value=He(_(()=>n(S,null,[c.map(m=>n("span",{class:"row tree-row",style:"margin: 50px auto;"},[m.map(ol)]))])))});const r=Zt();Qt(()=>{const c=Mt(l);r.value=c?He(_(()=>n("span",{class:"left-side-nodes small"},[c.map(ol)]))):""});const d=Zt();return Qt(()=>{const c=Mt(i);d.value=c?He(_(()=>n("span",{class:"side-nodes small"},[c.map(ol)]))):""}),{unref:u,nodesComp:o,leftNodesComp:r,rightNodesComp:d}}});_e({props:{display:ee(Object,String,Function),visibility:{type:ee(Number),required:!0},style:ee(String,Object,Array),classes:ee(Object),onClick:Function,onHold:Function,color:ee(String),glowColor:ee(String),canClick:{type:ee(Boolean),required:!0},mark:ee(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:ka,Node:na},setup(e){const{onClick:t,onHold:l,display:i}=It(e),o=yl(i),{start:r,stop:d}=Ri(t,l);return{start:r,stop:d,comp:o,unref:u,Visibility:Ct,isCoercableComponent:gl}}});function rl(e){const t=[],l={};let i=!1;function o(){return i||(t.push(...e()),l.base=t.map(c=>Et(c.base)),l.baseText=t.map(c=>Et(c.baseText)),l.visible=t.map(c=>Et(c.visible)),i=!0),t}const r=xe({});return[_(()=>{const c=o();let m=!0;const p=c.map((b,w)=>{var D,N,J;if(u(l.visible[w])===!1)return null;const k=n("h3",{onClick:()=>r.value[w]=!r.value[w],style:"cursor: pointer"},[n("span",{class:"modifier-toggle"+(u(r.value[w])?" collapsed":"")},[s("\u25BC")]),b.title,b.subtitle?n("span",{class:"subtitle"},[s(" ("),b.subtitle,s(")")]):null]),v=u(r.value[w])?null:n(S,null,[n("div",{class:"modifier-container"},[n("span",{class:"modifier-description"},[ol((D=u(l.baseText[w]))!=null?D:"Base")]),n("span",{class:"modifier-amount"},[H((N=u(l.base[w]))!=null?N:1),b.unit])]),ol(u(b.modifier.description))]),x=!m;return m=!1,n(S,null,[x?n("br",null,null):null,n("div",{style:{"--unit":ot.alignUnits&&b.unit?"'"+b.unit+"'":""}},[k,n("br",null,null),v,n("hr",null,null),n("div",{class:"modifier-container"},[n("span",{class:"modifier-description"},[s("Total")]),n("span",{class:"modifier-amount"},[H(b.modifier.apply((J=u(l.base[w]))!=null?J:1)),b.unit])])])])});return n(S,null,[p])}),r]}function aa(e){const t=Object.values(e).reverse(),l=xe(!0),i=f(()=>t.filter(m=>m.earned.value===!1)),{firstFeature:o,collapsedContent:r,hasCollapsedContent:d}=$o(t,m=>m.earned.value),c=_(()=>{const m=[...i.value];return o.value&&m.push(o.value),Go(...m,_(()=>ha(n(ps,{collapsed:l,content:r,display:l.value?"Show other completed milestones":"Hide other completed milestones"},null),[[pi,u(d)]])))});return{collapseMilestones:l,display:c}}function hl(e){const t=e.ignoreTotal?e.resource:_s(e.resource),l=()=>{var c,m;if(U.day.value!==e.day)return 1;let r=a.add(t.value,1),d=e.goal;return((m=(c=e.usingLog)==null?void 0:c.value)!=null?m:ot.usingLog)&&(r=r.log10(),d=a.log10(d)),a.div(r,d)},i=tl(()=>({direction:Fe.Right,width:600,height:25,fillStyle:{backgroundColor:e.color},textStyle:e.textColor?{color:e.textColor}:void 0,progress:l,display:_(()=>U.day.value===e.day?n(S,null,[Ce(t.value),s("/"),Ce(e.goal)]):"")})),o=_(()=>n(S,null,[n("div",null,[U.day.value===e.day?n(S,null,[s("Reach "),Ce(e.goal),s(" "),e.ignoreTotal?"":"total ",e.resource.displayName,s(" to complete the day")]):n(S,null,[e.name,s(" Complete!")]),e.modal?n(S,null,[" ",s("-")," ",n("button",{class:"button",style:"display: inline-block;",onClick:()=>e.modal.show.value=!0},[s("Check Modifiers")])]):void 0]),me(i),e.modal?me(e.modal.display):void 0]));return Qt(()=>{U.day.value===e.day&&a.gte(t.value,e.goal)&&U.completeDay()}),{total:t,trackerDisplay:o}}function il(e){var d;const t=(d=e.style)!=null?d:{minHeight:"20px",width:"40px",color:"var(--foreground)"},l=Lt(()=>({display:"0",style:t,canClick(){return a.gt(e.active.value,0)},onClick(){e.active.value=0}})),i=Lt(()=>({display:"-",style:t,canClick(){return a.gt(e.active.value,0)},onClick(){e.active.value=a.sub(e.active.value,1)}})),o=Lt(()=>({display:"+",style:t,canClick(){return a.lt(e.active.value,e.buyable.amount.value)},onClick(){e.active.value=a.add(e.active.value,1)}})),r=Lt(()=>({display:"Max",style:t,canClick(){return a.lt(e.active.value,e.buyable.amount.value)},onClick(){e.active.value=e.buyable.amount.value}}));return{min:l,remove:i,add:o,max:r}}const Ns=Symbol("Buyable");function qe(e){const t=xe(0);return Vt(()=>{var r,d,c;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=zl("buyable-"),l.type=Ns,l[Dl]=Oi,l.amount=t,l.amount[Sl]=(r=l.initialValue)!=null?r:0,l.canAfford=f(()=>{const m=l,p=u(m.cost);return m.resource!=null&&p!=null&&a.gte(m.resource.value,p)}),l.canPurchase==null&&(l.canPurchase=f(()=>u(l.visibility)===Ct.Visible&&u(l.canAfford)&&a.lt(l.amount.value,u(l.purchaseLimit)))),l.maxed=f(()=>a.gte(l.amount.value,u(l.purchaseLimit))),Y(l,"classes");const i=l.classes;l.classes=f(()=>{const m=u(i)||{};return l.maxed.value&&(m.bought=!0),m}),Y(l,"canPurchase"),l.canClick=l.canPurchase,l.onClick=l.purchase=(c=(d=l.onClick)!=null?d:l.purchase)!=null?c:function(){var b;const m=l;if(!u(m.canPurchase))return;const p=u(m.cost);m.cost!=null&&m.resource!=null&&(m.resource.value=a.sub(m.resource.value,p),m.amount.value=a.add(m.amount.value,1)),(b=m.onPurchase)==null||b.call(m,p)},Y(l,"display");const o=l.display;return l.display=_(()=>{const m=u(o);if(gl(m)){const p=He(m);return n(p,null,null)}if(m!=null&&l.cost!=null&&l.resource!=null){const p=l,b=He(m.title||"","h3"),w=He(m.description||""),k=He(m.effectDisplay||"");return n("span",null,[m.title?n("div",null,[n(b,null,null)]):null,m.description?n(w,null,null):null,m.showAmount===!1?null:n("div",null,[n("br",null,null),u(p.purchaseLimit)===a.dInf?n(S,null,[s("Amount: "),le(p.amount.value)]):n(S,null,[s("Amount: "),le(p.amount.value),s(" /")," ",le(u(p.purchaseLimit))])]),m.effectDisplay?n("div",null,[n("br",null,null),s("Currently: "),n(k,null,null)]):null,p.cost&&!p.maxed.value?n("div",null,[s("Cost: "),H(u(p.cost)||0)," ",l.resource.displayName]):null])}return""}),Y(l,"visibility"),Dt(l,"visibility",Ct.Visible),Y(l,"cost"),Y(l,"resource"),Y(l,"purchaseLimit"),Dt(l,"purchaseLimit",a.dInf),Y(l,"style"),Y(l,"mark"),Y(l,"small"),l[Il]=function(){const{display:m,visibility:p,style:b,classes:w,onClick:k,canClick:v,small:x,mark:D,id:N}=this;return{display:m,visibility:p,style:u(b),classes:w,onClick:k,canClick:v,small:x,mark:D,id:N}},l})}const Ca=wa({}),Qa=Symbol("Hotkey");function Hl(e){return Vt(()=>{const t=e();return t.type=Qa,Y(t,"enabled"),Dt(t,"enabled",!0),Y(t,"description"),t})}lt.on("addLayer",e=>{Si(e,Qa).forEach(t=>{Ca[t.key]=t})});lt.on("removeLayer",e=>{Si(e,Qa).forEach(t=>{Ca[t.key]=void 0})});document.onkeydown=function(e){var i;if(((i=e.target)==null?void 0:i.tagName)==="INPUT"||ja.value&&!pe.keepGoing)return;let t=e.key;e.shiftKey&&(t="shift+"+t),e.ctrlKey&&(t="ctrl+"+t);const l=Ca[t];l&&u(l.enabled)&&(e.preventDefault(),l.onPress())};Ro(_(()=>{const e=Object.values(Ca).filter(t=>u(t==null?void 0:t.enabled));return e.length===0?"":n("div",null,[n("br",null,null),n("h4",null,[s("Hotkeys")]),e.map(t=>n("div",null,[t==null?void 0:t.key,s(": "),t==null?void 0:t.description]))])}));const Ds=_e({__name:"Sticky",setup(e){const t=j("0"),l=new ResizeObserver(o),i=Zt(null);function o(){let r=i.value;if(r==null)return;let d=0;for(;r.previousSibling;){const c=r.previousSibling;c.dataset&&"vSticky"in c.dataset&&(d+=c.offsetHeight),r=c}t.value=d+"px"}return Ol(o),document.fonts.ready.then(o),ya(()=>{var d;const r=(d=i.value)==null?void 0:d.parentElement;r&&l.observe(r)}),(r,d)=>(A(),T("div",{class:"sticky",style:At({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[Yt(r.$slots,"default",{},void 0,!0)],4))}});var Is=je(Ds,[["__scopeId","data-v-cccac690"]]);const ai=_e({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,l=f(()=>oa(t.resource));return(i,o)=>(A(),T("h2",{style:At({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},Te(u(l)),5))}});const Ts={class:"main-display"},Ps={key:0},Fs={key:1},Us=s(", "),Rs={key:2},Os=y("br",null,null,-1),Ls={class:"main-display"},qs={key:0},Gs={key:1},$s=s(", "),Qs={key:2},Hs=y("br",null,null,-1),qt=_e({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null,productionDisplay:null,sticky:{type:Boolean,default:!0}},setup(e){const l=It(e),i=j(null),o=yl(l.effectDisplay),r=j(null),d=yl(l.productionDisplay),c=f(()=>a.lt(l.resource.value,"1e1000"));return(m,p)=>{var b,w;return e.sticky?(A(),ye(Is,{key:0},{default:fe(()=>{var k,v,x,D;return[y("div",{class:vt(["main-display-container",(k=e.classes)!=null?k:{}]),style:At([{"min-height":`${((x=(v=i.value)==null?void 0:v.$el.clientHeight)!=null?x:0)+50}px`},(D=e.style)!=null?D:{}])},[y("div",Ts,[u(c)?(A(),T("span",Ps,"You have ")):G("",!0),n(ai,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),s(" "+Te(e.resource.displayName),1),u(o)?(A(),T("span",Fs,[Us,(A(),ye(ct(u(o)),{ref_key:"effectRef",ref:i},null,512))])):G("",!0),u(d)?(A(),T("span",Rs,[Os,(A(),ye(ct(u(d)),{ref_key:"productionRef",ref:r},null,512))])):G("",!0)])],6)]}),_:1})):(A(),T("div",{key:1,class:vt(["main-display-container",(b=e.classes)!=null?b:{}]),style:At([{"min-height":"50px"},(w=e.style)!=null?w:{}])},[y("div",Ls,[u(c)?(A(),T("span",qs,"You have ")):G("",!0),n(ai,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),s(" "+Te(e.resource.displayName),1),u(o)?(A(),T("span",Gs,[$s,(A(),ye(ct(u(o)),{ref_key:"effectRef",ref:i},null,512))])):G("",!0),u(d)?(A(),T("span",Qs,[Hs,(A(),ye(ct(u(d)),{ref_key:"productionRef",ref:r},null,512))])):G("",!0)])],6))}}});var Vs=_e({props:{display:{type:ee(String,Object,Function),required:!0},visibility:{type:ee(Number),required:!0},style:ee(String,Object,Array),classes:ee(Object),resource:Object,cost:ee(String,Object,Number),canPurchase:{type:ee(Boolean),required:!0},bought:{type:ee(Boolean),required:!0},mark:ee(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:na,MarkNode:ka},setup(e){const{display:t,cost:l}=It(e),i=Zt("");return Qt(()=>{const o=Mt(t);if(o==null){i.value="";return}if(gl(o)){i.value=He(o);return}const r=Mt(l),d=He(o.title||"","h3"),c=He(o.description,"div"),m=He(o.effectDisplay||"");i.value=He(_(()=>{var p;return n("span",null,[o.title?n("div",null,[n(d,null,null)]):null,n(c,null,null),o.effectDisplay?n("div",null,[s("Currently: "),n(m,null,null)]):null,e.resource!=null&&o.showCost!==!1?n(S,null,[n("br",null,null),s("Cost: "),e.resource&&oa(e.resource,r)," ",(p=e.resource)==null?void 0:p.displayName]):null])}))}),{component:i,unref:u,Visibility:Ct}}});const js=["disabled"];function zs(e,t,l,i,o,r){var m;const d=xl("MarkNode"),c=xl("Node");return e.unref(e.visibility)!==e.Visibility.None?(A(),T("button",{key:0,style:At([{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:vt({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)?(A(),ye(ct(e.unref(e.component)),{key:0})):G("",!0),n(d,{mark:e.unref(e.mark)},null,8,["mark"]),n(c,{id:e.id},null,8,["id"])],14,js)):G("",!0)}var Js=je(Vs,[["render",zs],["__scopeId","data-v-7f411ac8"]]);const Ws=Symbol("Upgrade");function L(e){const t=xe(!1);return Vt(()=>{const l=e();return l.id=zl("upgrade-"),l.type=Ws,l[Dl]=Js,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=f(()=>{const i=l;return i.resource!=null&&i.cost!=null&&a.gte(i.resource.value,u(i.cost))}):Y(l,"canAfford"),l.canPurchase=f(()=>u(l.visibility)===Ct.Visible&&u(l.canAfford)&&!u(l.bought)),l.purchase=function(){var o;const i=l;!u(i.canPurchase)||(i.resource!=null&&i.cost!=null&&(i.resource.value=a.sub(i.resource.value,u(i.cost))),t.value=!0,(o=i.onPurchase)==null||o.call(i))},Y(l,"visibility"),Dt(l,"visibility",Ct.Visible),Y(l,"classes"),Y(l,"style"),Y(l,"display"),Y(l,"mark"),Y(l,"cost"),Y(l,"resource"),l[Il]=function(){const{display:i,visibility:o,style:r,classes:d,resource:c,cost:m,canPurchase:p,bought:b,mark:w,id:k,purchase:v}=this;return{display:i,visibility:o,style:u(r),classes:d,resource:c,cost:m,canPurchase:p,bought:b,mark:w,id:k,purchase:v}},l})}function ne(e){return Vt(()=>{const{addend:t,description:l,enabled:i}=e(),o=Et(t),r=Et(l),d=i==null?void 0:Et(i);return{apply:c=>a.add(c,u(o)),revert:c=>a.sub(c,u(o)),enabled:d,description:l==null?void 0:_(()=>n("div",{class:"modifier-container"},[u(r)?n("span",{class:"modifier-description"},[ol(u(r))]):null,n("span",{class:"modifier-amount"},[a.gte(u(o),0)?"+":"",H(u(o))])]))}})}function g(e){return Vt(()=>{const{multiplier:t,description:l,enabled:i}=e(),o=Et(t),r=Et(l),d=i==null?void 0:Et(i);return{apply:c=>a.times(c,u(o)),revert:c=>a.div(c,u(o)),enabled:d,description:l==null?void 0:_(()=>n("div",{class:"modifier-container"},[u(r)?n("span",{class:"modifier-description"},[ol(u(r))]):null,n("span",{class:"modifier-amount"},[s("\xD7"),H(u(o))])]))}})}function fl(e){return Vt(()=>{const{exponent:t,description:l,enabled:i,supportLowNumbers:o}=e(),r=Et(t),d=Et(l),c=i==null?void 0:Et(i);return{apply:m=>{let p=m;return o&&(p=a.add(p,1)),p=a.pow(p,u(r)),o&&(p=a.sub(p,1)),p},revert:m=>{let p=m;return o&&(p=a.add(p,1)),p=a.root(p,u(r)),o&&(p=a.sub(p,1)),p},enabled:c,description:l==null?void 0:_(()=>n("div",{class:"modifier-container"},[u(d)?n("span",{class:"modifier-description"},[ol(u(d)),o?" (+1 effective)":null]):null,n("span",{class:"modifier-amount"},[s("^"),H(u(r))])]))}})}function K(e){return Vt(()=>{const t=e();return{apply:l=>t.filter(i=>u(i.enabled)!==!1).reduce((i,o)=>o.apply(i),l),revert:t.every(l=>l.revert!=null)?l=>t.filter(i=>u(i.enabled)!==!1).reduceRight((i,o)=>o.revert(i),l):void 0,enabled:f(()=>t.filter(l=>u(l.enabled)!==!1).length>0),description:_(()=>n(S,null,[t.filter(l=>u(l.enabled)!==!1).map(l=>u(l.description)).filter(l=>l).map(ol)]))}})}function Li(e){return Vt(()=>{const t=e();return t.currentGain==null&&(t.currentGain=f(()=>{let l=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return l=a.floor(l).max(0),u(t.buyMax)||(l=l.min(1)),l})),t.actualGain==null&&(t.actualGain=t.currentGain),t.currentAt==null&&(t.currentAt=f(()=>{let l=t.scaling.currentAt(t);return t.roundUpCost&&(l=a.ceil(l)),l})),t.nextAt==null&&(t.nextAt=f(()=>{let l=t.scaling.nextAt(t);return t.roundUpCost&&(l=a.ceil(l)),l})),t.convert==null&&(t.convert=function(){var o;const l=u(t.currentGain),i=u(t.currentAt);t.gainResource.value=a.add(t.gainResource.value,l),t.spend(l,i),(o=t.onConvert)==null||o.call(t,l)}),t.spend==null&&(t.spend=function(){t.baseResource.value=0}),Y(t,"currentGain"),Y(t,"actualGain"),Y(t,"currentAt"),Y(t,"nextAt"),Y(t,"buyMax"),Dt(t,"buyMax",!0),Y(t,"roundUpCost"),Dt(t,"roundUpCost",!0),t})}function Ha(e,t){const l=Et(e),i=Et(t);return{currentGain(o){let r=u(o.baseResource.value);if(o.costModifier&&(r=o.costModifier.apply(r)),a.lt(r,u(l)))return 0;const d=a.div(r,u(l)).pow(u(i));return d.isNan()?new a(0):d},currentAt(o){let r=u(o.currentGain);return o.gainModifier&&(r=o.gainModifier.revert(r)),r=a.max(0,r).root(u(i)).times(u(l)),o.costModifier&&(r=o.costModifier.revert(r)),r},nextAt(o){let r=a.add(u(o.currentGain),1).floor();return o.gainModifier&&(r=o.gainModifier.revert(r)),r=a.max(0,r).root(u(i)).times(u(l)).max(u(l)),o.costModifier&&(r=o.costModifier.revert(r)),r}}}function qi(e){return Li(e)}function Ks(e){return Li(()=>{const t=e();return Dt(t,"buyMax",!1),t.currentGain==null&&(t.currentGain=f(()=>{let l=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return l=a.floor(l).max(t.gainResource.value),u(t.buyMax)||(l=l.min(a.add(t.gainResource.value,1))),l})),t.actualGain==null&&(t.actualGain=f(()=>{let l=a.sub(a.floor(t.scaling.currentGain(t)),t.gainResource.value).max(0);return u(t.buyMax)||(l=l.min(1)),l})),Dt(t,"convert",function(){var o;const l=u(t.actualGain),i=u(t.currentAt);t.gainResource.value=t.gainModifier?t.gainModifier.apply(u(t.currentGain)):u(t.currentGain),t.spend(l,i),(o=t.onConvert)==null||o.call(t,l)}),t})}function xa(e,t,l=.5){return a.lte(e,t)?e:a.pow(e,l).times(a.pow(t,a.sub(1,l)))}function ii(e,t,l=.5){return{...e,currentAt:i=>xa(e.currentAt(i),u(t),a.recip(u(l))),nextAt:i=>xa(e.nextAt(i),u(t),a.recip(u(l))),currentGain:i=>xa(e.currentGain(i),u(t),u(l))}}const Xs={},Ys={style:{"white-space":"nowrap"}},Zs=y("span",{style:{"font-size":"larger","font-family":"initial"}},"\u221A",-1),er={style:{display:"inline-block","border-top":"1px solid","padding-left":".2em"}};function tr(e,t){return A(),T("span",Ys,[Zs,y("div",er,[Yt(e.$slots,"default")])])}var Cl=je(Xs,[["render",tr]]);const lr={},ar={class:"fraction"};function ir(e,t){return A(),T("div",ar,[Yt(e.$slots,"default")])}var nr=je(lr,[["render",ir]]);const or={class:"field"},sr={key:0,class:"field-title"},Va=_e({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var d;const l=e,i=yl(sl(l,"title"),"span"),o=j((d=l.options.find(c=>c.value===l.modelValue))!=null?d:null);Jt(sl(l,"modelValue"),c=>{var m;Mt(o)!==c&&(o.value=(m=l.options.find(p=>p.value===c))!=null?m:null)});function r(c){t("update:modelValue",c.value)}return(c,m)=>(A(),T("div",or,[u(i)?(A(),T("span",sr,[(A(),ye(ct(u(i))))])):G("",!0),n(u(vn),{options:e.options,modelValue:o.value,"onUpdate:modelValue":[m[0]||(m[0]=p=>o.value=p),r],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});var rr=_e({props:{visibility:{type:ee(Number),required:!0},display:{type:ee(String,Object,Function),required:!0},style:ee(String,Object,Array),classes:ee(Object),earned:{type:ee(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:na},setup(e){const{display:t}=It(e),l=Zt("");return Qt(()=>{const i=Mt(t);if(i==null){l.value="";return}if(gl(i)){l.value=He(i);return}const o=He(i.requirement,"h3"),r=He(i.effectDisplay||"","b"),d=He(i.optionsDisplay||"","span");l.value=He(_(()=>n("span",null,[n(o,null,null),i.effectDisplay?n("div",null,[n(r,null,null)]):null,i.optionsDisplay?n("div",{class:"equal-spaced"},[n(d,null,null)]):null])))}),{comp:l,unref:u,Visibility:Ct}}});function ur(e,t,l,i,o,r){var c;const d=xl("Node");return e.unref(e.visibility)!==e.Visibility.None?(A(),T("div",{key:0,style:At([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:vt({feature:!0,milestone:!0,done:e.unref(e.earned),...e.unref(e.classes)})},[(A(),ye(ct(e.unref(e.comp)))),n(d,{id:e.id},null,8,["id"])],6)):G("",!0)}var dr=je(rr,[["render",ur],["__scopeId","data-v-f4e8794e"]]);lt.on("setupVue",e=>e.use(fn));const ni=gi(),cr=Symbol("Milestone");let _l;(function(e){e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none"})(_l||(_l={}));function F(e){const t=xe(!1);return Vt(()=>{var o;const l=(o=e==null?void 0:e())!=null?o:{};l.id=zl("milestone-"),l.type=cr,l[Dl]=dr,l.earned=t,l.complete=function(){var d;const r=l;if(t.value=!0,(d=r.onComplete)==null||d.call(r),r.display&&u(r.showPopups)===!0){const c=u(r.display),m=He(gl(c)?c:c.requirement);ni(n(S,null,[n("h3",null,[s("Milestone earned!")]),n("div",null,[n(m,null,null)])]))}},Y(l,"visibility"),Dt(l,"visibility",Ct.Visible);const i=l.visibility;if(l.visibility=f(()=>{const r=u(l.display);switch(ot.msDisplay){default:case _l.All:return u(i);case _l.Configurable:return u(l.earned)&&!(r!=null&&typeof r=="object"&&"optionsDisplay"in r)?Ct.None:u(i);case _l.Incomplete:return u(l.earned)?Ct.None:u(i);case _l.None:return Ct.None}}),Y(l,"style"),Y(l,"classes"),Y(l,"display"),Y(l,"showPopups"),l[Il]=function(){const{visibility:r,display:d,style:c,classes:m,earned:p,id:b}=this;return{visibility:r,display:d,style:u(c),classes:m,earned:p,id:b}},l.shouldEarn){const r=l;Qt(()=>{var d,c;if(ot.active===pe.id&&!r.earned.value&&u(r.visibility)===Ct.Visible&&((d=r.shouldEarn)==null?void 0:d.call(r))&&(r.earned.value=!0,(c=r.onComplete)==null||c.call(r),r.display&&u(r.showPopups)===!0)){const m=u(r.display),p=He(gl(m)?m:m.requirement);ni(n(S,null,[n("h3",null,[s("Milestone earned!")]),n("div",null,[n(p,null,null)])]))}})}return l})}lt.on("loadSettings",e=>{Dt(e,"msDisplay",_l.All)});const pr=Object.values(_l).map(e=>({label:_i(e),value:e}));Uo(_(()=>n(Va,{title:_(()=>n("span",{class:"option-title"},[s("Show milestones"),n("desc",null,[s("Select which milestones to display based on criterias.")])])),options:pr,"onUpdate:modelValue":e=>ot.msDisplay=e,modelValue:ot.msDisplay},null)));const mr={class:"field"},vr=_e({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const l=e,i=f(()=>He(u(l.title)||"<span></span>","span")),o=f({get(){return!!l.modelValue},set(r){t("update:modelValue",r)}});return(r,d)=>(A(),T("label",mr,[ha(y("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":d[0]||(d[0]=c=>gt(o)?o.value=c:null)},null,512),[[dn,u(o)]]),(A(),ye(ct(u(i))))]))}});var nl=je(vr,[["__scopeId","data-v-41d33d58"]]);const fr=Symbol("Reset");function gr(e){return Vt(()=>{const t=e();return t.id=zl("reset-"),t.type=fr,t.reset=function(){var i;const l=o=>{if(o&&typeof o=="object")if(Sl in o){const r=o;r.value=r[Sl]}else!(o instanceof a)&&!gt(o)&&Object.values(o).forEach(r=>l(r))};u(t.thingsToReset).forEach(l),lt.emit("reset",t),(i=t.onReset)==null||i.call(t)},Y(t,"thingsToReset"),t})}const ua={};lt.on("removeLayer",e=>{var t;(t=ua[e.id])==null||t.call(ua),ua[e.id]=void 0});const yr="workshop",Wl=2,Ye=Ht(yr,function(){const e="Workshop",t="#D66B02",l="#D66B02",i=kt(0,"foundation progress"),o=Ks(()=>({scaling:ii(ii(Ha(250,1.5),5387,1/1e10),1e20,3e8),baseResource:ue.logs,gainResource:O(i),roundUpCost:!0,spend(oe,Be){ue.logs.value=a.sub(ue.logs.value,Be)},costModifier:K(()=>[fl(()=>({exponent:.95,description:"Holly Level 5",enabled:R.elfTraining.cutterElfTraining.milestones[4].earned}))])})),r=Lt(()=>({display:_(()=>n(S,null,[n("b",{style:"font-size: x-large"},[s("Build "),le(o.actualGain.value),s("% of the foundation")]),n("br",null,null),n("br",null,null),n("span",{style:"font-size: large"},[s("Cost:")," ",oa(ue.logs,a.gte(o.actualGain.value,1)?o.currentAt.value:o.nextAt.value)," ",ue.logs.displayName])])),visibility:()=>h(a.lt(i.value,100)||R.elfTraining.expandersElfTraining.milestones[2].earned.value),canClick:()=>a.gte(ue.logs.value,o.currentAt.value)&&(a.lt(i.value,100)||R.elfTraining.expandersElfTraining.milestones[2].earned.value),onClick(){!u(this.canClick)||o.convert()},style:"width: 600px; min-height: unset"})),d=Hl(()=>({key:"w",description:"Build part of the foundation.",onPress:()=>{r.canClick.value&&r.onClick()}})),c=f(()=>!Re.milestones[6].earned.value),m=F(()=>({display:{requirement:"1% Foundation Completed",effectDisplay:"Trees give 5% more logs for each % of foundation completed"},shouldEarn:()=>a.gte(i.value,1),showPopups:c})),p=F(()=>({display:{requirement:"10% Foundation Completed",effectDisplay:"Cut an additional tree per second for each 5% of foundation completed"},shouldEarn:()=>a.gte(i.value,10),visibility:()=>h(m.earned.value),showPopups:c})),b=F(()=>({display:{requirement:"20% Foundation Completed",effectDisplay:"Plant an additional tree per second for each 10% of foundation completed"},shouldEarn:()=>a.gte(i.value,20),visibility:()=>h(p.earned.value),showPopups:c})),w=F(()=>({display:{requirement:"30% Foundation Completed",effectDisplay:"All automatic tree cutting is doubled"},shouldEarn:()=>a.gte(i.value,30),visibility:()=>h(b.earned.value),showPopups:c})),k=F(()=>({display:{requirement:"40% Foundation Completed",effectDisplay:"All automatic tree planting is doubled"},shouldEarn:()=>a.gte(i.value,40),visibility:()=>h(w.earned.value),showPopups:c})),v=F(()=>({display:{requirement:"50% Foundation Completed",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>a.gte(i.value,50),visibility:()=>h(k.earned.value),showPopups:c})),x=F(()=>({display:{requirement:"75% Foundation Completed",effectDisplay:"The forest gains an extra tree for every 2% of foundation completed"},shouldEarn:()=>a.gte(i.value,75),visibility:()=>h(v.earned.value),showPopups:c})),D=F(()=>({display:{requirement:"100% Foundation Completed",effectDisplay:"Log per tree is raised to the 1.2th power"},shouldEarn:()=>a.gte(i.value,100),visibility:()=>h(x.earned.value),showPopups:c})),N=F(()=>({display:{requirement:"200% Foundation Completed",effectDisplay:"The 1% milestone is now +2% and multiplicative"},shouldEarn:()=>a.gte(i.value,200),visibility:()=>h(D.earned.value&&R.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),J=F(()=>({display:{requirement:"400% Foundation Completed",effectDisplay:"Gain +10% metal for every 10% foundation completed"},shouldEarn:()=>a.gte(i.value,400),visibility:()=>h(N.earned.value&&R.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),M=F(()=>({display:{requirement:"600% Foundation Completed",effectDisplay:"Gain +10% oil for every 10% foundation completed"},shouldEarn:()=>a.gte(i.value,600),visibility:()=>h(J.earned.value&&R.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),E=F(()=>({display:{requirement:"800% Foundation Completed",effectDisplay:"Gain +10% plastic for every 10% foundation completed"},shouldEarn:()=>a.gte(i.value,800),visibility:()=>h(M.earned.value&&R.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),P=F(()=>({display:{requirement:"1000% Foundation Completed",effectDisplay:"Double paper, boxes, and all cloth actions"},shouldEarn:()=>a.gte(i.value,1e3),visibility:()=>h(E.earned.value&&R.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),Z={logGainMilestone1:m,autoCutMilestone1:p,autoPlantMilestone1:b,autoCutMilestone2:w,autoPlantMilestone2:k,logGainMilestone2:v,morePlantsMilestone1:x,logGainMilestone3:D,extraExpansionMilestone1:N,extraExpansionMilestone2:J,extraExpansionMilestone3:M,extraExpansionMilestone4:E,extraExpansionMilestone5:P},{collapseMilestones:X,display:$}=aa(Z),z=tl(()=>({direction:Fe.Right,width:600,height:25,fillStyle:`backgroundColor: ${l}`,progress:()=>U.day.value===Wl?a.div(i.value,100):1,display:_(()=>U.day.value===Wl?n(S,null,[le(i.value),s("%")]):"")}));return Qt(()=>{U.day.value===Wl&&a.gte(i.value,100)&&U.completeDay()}),{name:e,day:Wl,color:t,foundationProgress:i,foundationConversion:o,milestones:Z,collapseMilestones:X,minWidth:700,buildFoundationHK:d,display:_(()=>n(S,null,[n("div",null,[U.day.value===Wl?"Complete the foundation to complete the day":`${e} Complete!`]),me(z),n(Ee,null,null),n("div",null,[n("span",null,[s("The foundation is ")]),n("h2",{style:`color: ${t}; text-shadow: 0 0 10px ${t}`},[le(i.value)]),s("% completed")]),a.lt(i.value,100)||R.elfTraining.expandersElfTraining.milestones[2].earned.value?n(Ee,null,null):null,me(r),n(Ee,null,null),$()])),minimizedDisplay:_(()=>n("div",null,[e,s(" - "),H(i.value),s(" "),i.displayName]))}}),hr="plastic",oi=10,et=Ht(hr,function(){const e="Plastic",t="#DCD9CD",l=kt(0,"plastic"),[i,o]=rl(()=>[{title:"Plastic Gain",modifier:he,base:0}]),r=j(!1),d=_(()=>n(_t,{modelValue:r.value,"onUpdate:modelValue":Ie=>r.value=Ie},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:i})),c=xe(0),m=f(()=>a.times(c.value,100)),p=qe(()=>({resource:it.metal,cost(){const Ie=new a(this.amount.value);let Se=a.pow(1.2,Ie).times(1e7);return R.elfTraining.fertilizerElfTraining.milestones[3].earned.value&&(Se=a.sub(Se,a.pow(l.value,2)).max(0)),Se},display:_(()=>n(S,null,[n("h3",null,[s("Refinery")]),n("br",null,null),s("Refines oil into plastic pellets"),n("br",null,null),s("Consumes 100 oil/s to create 1 plastic/s"),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("-"),H(m.value),s(" oil/sec"),n("br",null,null),s("+"),H(c.value),s(" plastic/sec"),n("br",null,null),n("br",null,null),s("Cost: "),le(u(p.cost))," ",p.resource.displayName])),onPurchase(){c.value=a.add(c.value,1)},style:{width:"300px"}})),{min:b,max:w,add:k,remove:v}=il({buyable:p,active:c,style:{minHeight:"20px",width:"40px",color:"var(--feature-foreground)"}}),x=f(()=>a.pow(5,a.add([...Object.values(M),...Object.values(X)].filter(Ie=>Ie.bought.value).length,2))),D=L(()=>({resource:O(l),cost:x,display:()=>({title:"Plastic Scissors",description:"Unlock paper upgrades",showCost:!D.bought.value})})),N=L(()=>({resource:O(l),cost:x,display:()=>({title:"Plastic Level",description:"Unlock box upgrades",showCost:!N.bought.value})})),J=L(()=>({resource:O(l),cost:x,display:()=>({title:"Plastic Cane",description:"Unlock cloth upgrades",showCost:!J.bought.value})})),M={paperTools:D,boxTools:N,clothTools:J},E=L(()=>({resource:O(l),cost:x,visibility:()=>h(D.bought.value),display:()=>({title:"Paper Elf Recruitment",description:"Double plastic gain and unlock a new elf for training",showCost:!E.bought.value})})),P=L(()=>({resource:O(l),cost:x,visibility:()=>h(N.bought.value),display:()=>({title:"Box Elf Recruitment",description:"Double plastic gain and unlock a new elf for training",showCost:!P.bought.value})})),Z=L(()=>({resource:O(l),cost:x,visibility:()=>h(J.bought.value),display:()=>({title:"Cloth Elf Recruitment",description:"Double plastic gain and unlock a new elf for training",showCost:!Z.bought.value})})),X={paperElf:E,boxElf:P,clothElf:Z},$=qe(()=>({resource:O(l),cost(){const Ie=this.amount.value;return a.pow(1.3,Ie).times(100)},visibility:()=>h(E.bought.value),display:{title:"Plastic Printing Press",description:"Gain +1% of your paper gain per second",effectDisplay:_(()=>n(S,null,[le($.amount.value),s("%")])),showAmount:!1}})),z=qe(()=>({resource:O(l),cost(){const Ie=this.amount.value;return a.pow(1.3,Ie).times(100)},visibility:()=>h(P.bought.value),display:{title:"Plastic Box Folder",description:"Gain +1% of your box gain per second",effectDisplay:_(()=>n(S,null,[le(z.amount.value),s("%")])),showAmount:!1}})),oe=qe(()=>({resource:O(l),cost(){const Ie=this.amount.value;return a.pow(1.3,Ie).times(100)},visibility:()=>h(Z.bought.value),display:{title:"Plastic Shepherd",description:"All cloth actions are +10% more efficient",effectDisplay:_(()=>n(S,null,[le(a.times(oe.amount.value,10)),s("%")])),showAmount:!1}})),Be={passivePaper:$,passiveBoxes:z,clothGains:oe},he=K(()=>[ne(()=>({addend:c,description:"Oil Refinery",enabled:()=>a.gt(c.value,0)})),g(()=>({multiplier:2,description:"Paper Elf Recruitment",enabled:E.bought})),g(()=>({multiplier:2,description:"Box Elf Recruitment",enabled:P.bought})),g(()=>({multiplier:2,description:"Cloth Elf Recruitment",enabled:Z.bought})),g(()=>({multiplier:2,description:"Carry plastic in boxes",enabled:st.row2Upgrades.plasticUpgrade.bought})),g(()=>({multiplier:()=>ce.oilEffectiveness.value,description:"Effectiveness",enabled:()=>a.lt(ce.oilEffectiveness.value,1)})),g(()=>({multiplier:We.boosts.yellow1,description:"Yellow Dye Boost 1",enabled:()=>a.gte(We.dyes.yellow.amount.value,1)})),g(()=>({multiplier:()=>a.div(Ye.foundationProgress.value,10).floor().div(10).add(1),description:"800% Foundation Completed",enabled:Ye.milestones.extraExpansionMilestone4.earned}))]),ae=f(()=>he.apply(0));lt.on("update",Ie=>{a.lt(U.day.value,oi)||(l.value=a.times(Ie,ae.value).add(l.value))});const{total:se,trackerDisplay:Ne}=hl({resource:l,goal:25e4,name:e,day:oi,color:t,textColor:"var(--feature-foreground)",modal:{show:r,display:d}});return{name:e,color:t,plastic:l,totalPlastic:se,buildRefinery:p,activeRefinery:c,oilCost:m,upgrades:M,elfUpgrades:X,buyables:Be,generalTabCollapsed:o,minWidth:700,display:_(()=>n(S,null,[me(Ne),n(Ee,null,null),n(qt,{resource:l,color:t,style:"margin-bottom: 0",effectDisplay:a.gt(ae.value,0)?`+${H(ae.value)}/s`:void 0},null),n(Ee,null,null),n($t,null,{default:()=>[me(p),n("div",null,[le(a.floor(c.value)),s("/"),le(a.floor(p.amount.value))]),nt(b,v,k,w)]}),n(jl,null,{default:()=>[el(D,E,$),el(N,P,z),el(J,Z,oe)]})])),minimizedDisplay:_(()=>n("div",null,[e,s(" - "),H(l.value),s(" "),l.displayName]))}}),br="paper",Ba=5,W=Ht(br,function(){const e="Paper",t="#E8DCB8",l=kt(0,"paper"),i=kt(f(()=>a.min(a.div(ue.logs.value,1e9),a.div(q.ash.value,Ie.value))),"pulp"),o=qi(()=>({scaling:Ha(1,1.2),baseResource:i,gainResource:O(l),roundUpCost:!0,spend(ve,tt){ue.logs.value=a.sub(ue.logs.value,a.times(tt,1e9)),q.ash.value=a.sub(q.ash.value,a.times(tt,Ie.value))},gainModifier:se})),r=Lt(()=>({display:_(()=>{const ve=a.gte(o.actualGain.value,1)?o.currentAt.value:o.nextAt.value;return n(S,null,[n("span",{style:"font-size: large"},[s("Create "),le(o.currentGain.value),s(" "),l.displayName]),n("br",null,null),n("span",{style:"font-size: large"},[s("Cost: "),oa(ue.logs,ve),s(" "),i.displayName,s(" ("),le(a.times(ve,1e9)),s(" "),ue.logs.displayName,s(";")," ",le(a.times(ve,Ie.value))," ",q.ash.displayName,s(")")])])}),canClick:()=>a.gte(o.actualGain.value,1),onClick(){!u(this.canClick)||o.convert()},style:"width: 600px; min-height: unset"}));function d(ve){const tt=qe(()=>({...ve,display:{title:ve.name,description:`Print a copy of "${ve.name}", which ${ve.elfName} will use to improve their skills! Each copy printed will reduce the "${ve.buyableName}" price scaling by 0.95x and make ${ve.elfName} purchase +10% faster!`,effectDisplay:_(()=>n(S,null,[H(a.pow(.95,tt.amount.value)),s("x price scaling,")," ",H(a.div(tt.amount.value,10).add(1)),s("x auto-purchase speed")])),showAmount:!1},resource:O(l),cost(){let te=this.amount.value;(ve.elfName==="Star"||ve.elfName==="Bell")&&(te=a.pow(te,2)),a.gte(te,100)&&(te=a.pow(te,2).div(100)),a.gte(te,1e4)&&(te=a.pow(te,2).div(1e4)),te=a.pow(.95,N.amount.value).times(te);let rt=5;R.elfTraining.paperElfTraining.milestones[0].earned.value&&rt--;let ze=a.pow(rt,te).times(10);return R.elfTraining.paperElfTraining.milestones[0].earned.value&&(ze=a.div(ze,z.value.max(1))),ze},style:"width: 600px"}));return tt}const c=d({name:"Now You're Logging!",elfName:"Holly",buyableName:"Generic Cutters"}),m=d({name:"The Man Who Planted Trees",elfName:"Ivy",buyableName:"Generic Planters"}),p=d({name:"Logjam",elfName:"Hope",buyableName:"Expand Forest"}),b=d({name:"Fahrenheit 451",elfName:"Jack",buyableName:"Heated Cutters"}),w=d({name:"Tillamook Burn Country",elfName:"Mary",buyableName:"Heated Planters"}),k=d({name:"The Garden Tree's Handbook",elfName:"Noel",buyableName:"Fertilized Soil"}),v=d({name:"Firestarter",elfName:"Joy",buyableName:"Small Fire",visibility:()=>h(Re.elves.smallFireElf.bought.value)}),x=d({name:"An Arsonist's Guide to Writer's Homes in New England",elfName:"Faith",buyableName:"Bonfire",visibility:()=>h(Re.elves.bonfireElf.bought.value)}),D=d({name:"Little Fires Everywhere",elfName:"Snowball",buyableName:"Kiln",visibility:()=>h(Re.elves.kilnElf.bought.value)}),N=d({name:"The Book Thief",elfName:"Star",buyableName:"Paper Buyables",visibility:()=>h(Re.elves.paperElf.bought.value)}),J=d({name:"Not a box",elfName:"Bell",buyableName:"Box Buyables",visibility:()=>h(Re.elves.boxElf.bought.value)}),M=d({name:"Fuzzy Bee and Friends",elfName:"Gingersnap",buyableName:"Cloth Buyables",visibility:()=>h(Re.elves.clothElf.bought.value)}),E=d({name:"Drills and Mills",elfName:"Peppermint",buyableName:"Mining Drill",visibility:()=>h(R.elfTraining.expandersElfTraining.milestones[3].earned.value)}),P=d({name:"Deep in the Earth",elfName:"Frosty",buyableName:"Oil Drills",visibility:()=>h(R.elfTraining.fertilizerElfTraining.milestones[4].earned.value)}),Z=d({name:"Burning the Midnight Oil",elfName:"Cocoa",buyableName:"Oil-Consuming Machines",visibility:()=>h(R.elfTraining.heatedCutterElfTraining.milestones[4].earned.value)}),X=d({name:"Physical Metallurgy",elfName:"Twinkle",buyableName:"Metal Buyables",visibility:()=>h(R.elfTraining.expandersElfTraining.milestones[4].earned.value)}),$={cuttersBook:c,plantersBook:m,expandersBook:p,heatedCuttersBook:b,heatedPlantersBook:w,fertilizerBook:k,smallFireBook:v,bonfireBook:x,kilnBook:D,paperBook:N,boxBook:J,clothBook:M,miningDrillBook:E,heavyDrillBook:P,oilBook:Z,metalBook:X},z=f(()=>Object.values($).reduce((ve,tt)=>ve.add(tt.amount.value),new a(0))),oe=L(()=>({resource:O(l),cost:1e8,visibility:()=>h(et.upgrades.paperTools.bought.value),display:{title:"Shepherding for Dummies",description:"Double effectiveness of all cloth actions"}})),Be=L(()=>({resource:O(l),cost:1e9,visibility:()=>h(et.upgrades.paperTools.bought.value),display:{title:"Guide to drilling",description:"Double drilling power"}})),he=L(()=>({resource:O(l),cost:1e10,visibility:()=>h(et.upgrades.paperTools.bought.value),display:{title:"Oil and where to find it",description:"Double oil gain"}})),ae={clothUpgrade:oe,drillingUpgrade:Be,oilUpgrade:he},se=K(()=>[g(()=>({multiplier:2,description:"Scholar's shoes",enabled:yt.paperUpgrades.paperUpgrade1.bought})),g(()=>({multiplier:2,description:"Scholar's slacks",enabled:yt.paperUpgrades.paperUpgrade2.bought})),g(()=>({multiplier:2,description:"Scholar's jacket",enabled:yt.paperUpgrades.paperUpgrade3.bought})),g(()=>({multiplier:10,description:"Felt Elbow Pads",enabled:yt.paperUpgrades.paperUpgrade4.bought})),g(()=>({multiplier:We.boosts.yellow1,description:"Yellow Dye Boost 1",enabled:()=>a.gte(We.dyes.yellow.amount.value,1)})),g(()=>({multiplier:2,description:"1000% Foundation Completed",enabled:Ye.milestones.extraExpansionMilestone5.earned}))]),Ne=K(()=>[g(()=>({multiplier:.1,description:"Star Level 2",enabled:R.elfTraining.paperElfTraining.milestones[1].earned}))]),Ie=f(()=>Ne.apply(1e6)),[Se,Ue]=rl(()=>[{title:"Paper Gain",modifier:se,base:1},{title:"Ash Cost",modifier:Ne,base:1e6,unit:" ash/pulp"}]),ge=j(!1),Oe=_(()=>n(_t,{modelValue:ge.value,"onUpdate:modelValue":ve=>ge.value=ve},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:Se}));lt.on("update",ve=>{a.lt(U.day.value,Ba)||(l.value=a.times(ve,et.buyables.passivePaper.amount.value).times(o.currentGain.value).div(100).add(l.value))});const{total:De,trackerDisplay:Le}=hl({resource:l,goal:5e3,name:e,day:Ba,color:t,textColor:"var(--feature-foreground)",modal:{show:ge,display:Oe}});return{name:e,day:Ba,color:t,paper:l,totalPaper:De,paperConversion:o,books:$,upgrades:ae,generalTabCollapsed:Ue,minWidth:700,display:_(()=>n(S,null,[me(Le),n(Ee,null,null),n(qt,{resource:l,color:t,style:"margin-bottom: 0"},null),n(Ee,null,null),me(r),n(Ee,null,null),nt(...Object.values(ae)),n(Ee,null,null),el(...Object.values($))])),minimizedDisplay:_(()=>n("div",null,[e,s(" - "),H(l.value),s(" "),l.displayName]))}}),wr="oil",Na=9,ce=Ht(wr,function(){const e="Oil",t="#000000",l="var(--foreground)",i=kt(0,"oil"),o=kt(0,"depth"),r=xe(0),d=f(()=>a.lt(o.value,990)?a.add(10,o.value):a.pow(1.001,a.sub(o.value,990)).mul(1e3));function c(){if(a.lt(o.value,990)){const Xe=a.min(a.affordArithmeticSeries(r.value,10,1,o.value),a.sub(990,o.value)),Ot=a.sumArithmeticSeries(Xe,10,1,o.value);r.value=a.sub(r.value,Ot),o.value=a.add(o.value,Xe)}if(a.gte(o.value,990)){const Xe=a.affordGeometricSeries(r.value,1e3,1.001,a.sub(o.value,990)),Ot=a.sumGeometricSeries(Xe,1e3,1.001,a.sub(o.value,990));r.value=a.sub(r.value,Ot),o.value=a.add(o.value,Xe)}}const m=xe(0),p=f(()=>a.times(a.pow(m.value,J.value).pow(2),1e14)),b=f(()=>a.times(a.pow(m.value,J.value),1)),w=qe(()=>({resource:it.metal,cost(){const Xe=new a(this.amount.value);return a.pow(1.3,Xe).times(25e3)},display:_(()=>n(S,null,[n("h3",null,[s("Heavy Drill")]),n("br",null,null),s("A large drill specialized at deep mining."),n("br",null,null),s("Consumes 1e14*(Heavy Drills amount)"),n("sup",null,[s("2")]),s(" coal/sec for (Heavy Drills amount) drill power."),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("-"),we(p.value),s(" coal/sec"),n("br",null,null),s("+"),we(b.value),s(" drill power"),n("br",null,null),n("br",null,null),s("Cost: "),Ce(u(w.cost)),s(" "),w.resource.displayName])),onPurchase(){m.value=a.add(m.value,1)},style:{color:l,width:"160px"}})),{min:k,max:v,add:x,remove:D}=il({buyable:w,active:m}),N=xe(0),J=f(()=>a.add(N.value,Math.E).ln()),M=qe(()=>({resource:it.metal,cost(){const Xe=new a(this.amount.value);return a.pow(2,Xe).times(1e5)},display:_(()=>n(S,null,[n("h3",null,[s("Heavy Drill Drill")]),n("br",null,null),s("Attach extra drills to Heavy Drills to make them faster"),n("br",null,null),s("Raise amount of effective Heavy Drills by ^ln(Heavy Drill Drill amount + e)."),n("br",null,null),s("(also affects coal consumption)."),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("^"),we(J.value),s(" Heavy Drill amount"),n("br",null,null),n("br",null,null),s("Cost: "),Ce(u(M.cost)),s(" "),M.resource.displayName])),onPurchase(){N.value=a.add(N.value,1)},style:{color:l,width:"160px"}})),{min:E,max:P,add:Z,remove:X}=il({buyable:M,active:N}),$=xe(0),z=f(()=>a.pow(1/3,$.value)),oe=f(()=>a.pow(2,$.value)),Be=f(()=>a.pow(1.2,$.value)),he=qe(()=>({resource:it.metal,cost(){const Xe=new a(this.amount.value);return a.pow(8,Xe).times(2e5)},display:_(()=>n(S,null,[n("h3",null,[s("Heavy Extractor")]),n("br",null,null),s("Attach extractors to the drill to mine coal and ore, but with a price."),n("br",null,null),s("Divides drill power by 3 to multiply coal gain by 2 and ore gain by 1.2."),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("\xD7"),we(z.value),s(" drill power"),n("br",null,null),s("\xD7"),we(oe.value),s(" coal/sec"),n("br",null,null),s("\xD7"),we(Be.value),s(" ore/sec"),n("br",null,null),n("br",null,null),s("Cost: "),Ce(u(he.cost))," ",he.resource.displayName])),onPurchase(){$.value=a.add($.value,1)},style:{color:l,width:"160px"}})),{min:ae,max:se,add:Ne,remove:Ie}=il({buyable:he,active:$}),Se=xe(0),Ue=f(()=>a.pow(Rt[3].bought.value?4:5,Se.value)),ge=f(()=>a.add(Se.value,Xt.value).pow(2).mul(m.value).mul(a.add(N.value,1)).mul($.value).mul(o.value).div(1e5)),Oe=qe(()=>({resource:it.metal,cost(){const Xe=new a(this.amount.value);let Ot=a.pow(16,Xe).times(2e6);return Rt[4].bought.value&&(Ot=Ot.div(a.add(Pl.value,1).root(6))),Ot},display:_(()=>n(S,null,[n("h3",null,[s("Oil Pump")]),n("br",null,null),s("Pump that oil from the ground."),n("br",null,null),s("Gain oil based on the number of Heavy buildings active and well depth, but coal usage is multiplied by "),Rt[3].bought.value?4:5,s("\xD7."),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("\xD7"),we(Ue.value),s(" coal usage"),n("br",null,null),s("+"),we(ge.value),s(" oil/sec"),n("br",null,null),n("br",null,null),s("Cost: "),Ce(u(Oe.cost)),s(" "),Oe.resource.displayName])),onPurchase(){Se.value=a.add(Se.value,1)},style:{color:l,width:"160px"}})),{max:De,min:Le,add:ve,remove:tt}=il({buyable:Oe,active:Se}),te=xe(0),rt=f(()=>a.pow(te.value,2)),ze=f(()=>a.pow(te.value,3).mul(1e19)),Je=f(()=>a.add(te.value,1)),re=qe(()=>({resource:O(i),cost(){const Xe=new a(this.amount.value);return a.pow(2,Xe).times(50)},display:_(()=>n(S,null,[n("h3",null,[s("Oil Burner")]),n("br",null,null),s("Burn oil as fuel."),n("br",null,null),s("(Oil Burner Amount)"),n("sup",null,[s("2")]),s(" unit of oil can give 1e19*(Oil Burner Amount)"),n("sup",null,[s("3")]),s(" units of coal."),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("-"),we(rt.value),s(" oil/sec"),n("br",null,null),s("-"),we(ze.value),s(" coal consumption"),Rt[2].bought.value?n(S,null,[n("br",null,null),s("\xD7"),we(Je.value),s(" to auto smelting multi")]):"",n("br",null,null),n("br",null,null),s("Cost: "),Ce(u(re.cost)),s(" "),re.resource.displayName])),onPurchase(){te.value=a.add(te.value,1)},style:{color:l,width:"160px"}})),{max:Qe,min:Ze,add:xt,remove:ut}=il({buyable:re,active:te}),pt=xe(0),Ke=f(()=>a.pow(pt.value,2).mul(100)),Ge=f(()=>a.add(pt.value,1)),St=qe(()=>({resource:it.metal,cost(){const Xe=new a(this.amount.value);let Ot=a.pow(10,Xe).times(1e7);return Rt[4].bought.value&&(Ot=Ot.div(a.add(Pl.value,1).root(6))),Ot},display:_(()=>n(S,null,[n("h3",null,[s("Oil Smelter")]),n("br",null,null),s("Use oil as a crucible fuel."),n("br",null,null),s("Burn 100*(Oil Smelter amount)"),n("sup",null,[s("2")]),s(" oil to smelt +100% faster."),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("-"),we(Ke.value),s(" oil/sec"),n("br",null,null),s("\xD7"),we(Ge.value),s(" smelting speed"),n("br",null,null),n("br",null,null),s("Cost: "),Ce(u(St.cost)),s(" "),St.resource.displayName])),onPurchase(){pt.value=a.add(pt.value,1)},style:{color:l,width:"160px"}})),{max:Bt,min:Tt,add:de,remove:V}=il({buyable:St,active:pt}),be=[F(()=>({display:{requirement:"5m Well Depth",effectDisplay:"Gain 25% more coal for each metre of well depth (after the 3 elf milestone)."},shouldEarn:()=>a.gte(o.value,5)})),F(()=>({display:{requirement:"10m Well Depth",effectDisplay:"Drill too slow? Unlock some drill upgrades!"},shouldEarn:()=>a.gte(o.value,10),visibility:()=>h(be[0].earned.value)})),F(()=>({display:{requirement:"25m Well Depth",effectDisplay:"Gain 5% more ore for each metre of well depth."},shouldEarn:()=>a.gte(o.value,25),visibility:()=>h(be[1].earned.value)})),F(()=>({display:{requirement:"60m Well Depth",effectDisplay:"Drill still too slow? Try unlocking another drill!"},shouldEarn:()=>a.gte(o.value,60),visibility:()=>h(be[2].earned.value)})),F(()=>({display:{requirement:"150m Well Depth",effectDisplay:"It appears that coal and metal appear a lot more when you go this deep! Unlock an upgrade apiece for coal and metal!"},shouldEarn:()=>a.gte(o.value,150),visibility:()=>h(be[3].earned.value)})),F(()=>({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:()=>a.gte(o.value,350),visibility:()=>h(be[4].earned.value)})),F(()=>({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:()=>a.gte(o.value,1e3),visibility:()=>h(a.gte(o.value,1e3))})),F(()=>({display:{requirement:"3,000m Well Depth",effectDisplay:"You found a large oil spot! Double oil gain!"},shouldEarn:()=>a.gte(o.value,3e3),visibility:()=>h(a.gte(o.value,2e3))}))],{collapseMilestones:Ut,display:Kt}=aa(be),Ae=[F(()=>({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:()=>a.gte(Pl.value,100)})),F(()=>({display:{requirement:"500 total oil",effectDisplay:"Unlocks oil upgrades! These can be bought with oil."},shouldEarn:()=>a.gte(Pl.value,500),visibility:()=>h(Ae[0].earned.value)})),F(()=>({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:()=>a.gte(Pl.value,1e4),visibility:()=>h(Ae[1].earned.value)}))],{collapseMilestones:Me,display:mt}=aa(Ae),Pt=[L(()=>({resource:q.coal,cost:1e18,display:{title:"Coal Drill Synergy",description:"Increase drill power by +4% per coal Mining Drill owned.",effectDisplay:_(()=>n(S,null,[s("x"),we(dt[0].value)]))},style:{color:l}})),L(()=>({resource:it.metal,cost:15e4,display:{title:"Metal Drill Synergy",description:"Increase drill power by +4% per ore Mining Drill owned.",effectDisplay:_(()=>n(S,null,[s("x"),we(dt[1].value)]))},style:{color:l}})),L(()=>({resource:q.coal,cost:1e20,display:{title:"Coal Drill Upgrade",description:"Increase drill power by +6% per OoM of coal owned.",effectDisplay:_(()=>n(S,null,[s("x"),we(dt[2].value)]))},style:{color:l}})),L(()=>({resource:it.metal,cost:15e5,display:{title:"Metal Drill Upgrade",description:"Increase drill power by +10% per OoM of metal ingot owned.",effectDisplay:_(()=>n(S,null,[s("x"),we(dt[3].value)]))},style:{color:l}})),L(()=>({resource:O(i),cost:100,display:{title:"Drill Oil",description:"Increase previous upgrades' effect by +0.1% per Heavy Drill owned.",effectDisplay:_(()=>n(S,null,[s("+"),we(a.mul(dt[4].value,100)),s("%")]))},style:{color:l}}))],dt=[f(()=>a.mul(q.buildDrill.amount.value,a.add(.04,at.value)).add(1)),f(()=>a.mul(it.oreDrill.amount.value,a.add(.04,at.value)).add(1)),f(()=>a.mul(a.max(q.coal.value,1).log10().floor(),a.add(.06,at.value)).add(1)),f(()=>a.mul(a.max(it.metal.value,1).log10().floor(),a.add(.1,at.value)).add(1)),f(()=>a.mul(w.amount.value,.001))],Rt=[L(()=>({resource:O(i),cost:100,display:{title:"Oil the Oil Pump",description:"Double oil gain."},style:{color:l}})),L(()=>({resource:O(i),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}})),L(()=>({resource:O(i),cost:1500,display:{title:"Blaster Burner",description:"The Oil Burner can now increase your metal gain."},style:{color:l}})),L(()=>({resource:O(i),cost:25e3,display:{title:"Oil Integration",description:"Reduce Oil Pump's coal consumption multipler from 5 to 4"},style:{color:l}})),L(()=>({resource:O(i),cost:5e4,display:{title:"Be One with the Oil",description:_(()=>n(S,null,[s("Divide metal ingot prices of oil buildings by "),n("sup",null,[s("6")]),n(Cl,null,{default:()=>[s("total oil + 1")]})]))},style:{color:l}}))],ul=K(()=>[ne(()=>({addend:()=>a.negate(p.value),description:"Heavy Drill",enabled:()=>a.gt(m.value,0)})),g(()=>({multiplier:Ue,description:"Oil Pump",enabled:()=>a.gt(Se.value,0)})),ne(()=>({addend:ml,description:"Oil to Coal Substitution",enabled:()=>a.gt(ml.value,0)}))]),dl=f(()=>ul.apply(0)),ie=K(()=>[ne(()=>({addend:b,description:"Heavy Drill",enabled:()=>a.gt(m.value,0)})),g(()=>({multiplier:z,description:"Heavy Extractor",enabled:()=>a.gt($.value,0)})),g(()=>({multiplier:dt[0],description:"Coal Drill Synergy",enabled:Pt[0].bought})),g(()=>({multiplier:dt[1],description:"Metal Drill Synergy",enabled:Pt[1].bought})),g(()=>({multiplier:dt[2],description:"Coal Drill Upgrade",enabled:Pt[2].bought})),g(()=>({multiplier:dt[3],description:"Metal Drill Upgrade",enabled:Pt[3].bought})),g(()=>({multiplier:2,description:"Guide to drilling",enabled:W.upgrades.drillingUpgrade.bought})),g(()=>({multiplier:()=>cl.value,description:"Effectiveness",enabled:()=>a.lt(cl.value,1)}))]),Q=f(()=>ie.apply(0)),$e=K(()=>[ne(()=>({addend:dt[4],description:"Drill Oil",enabled:Pt[4].bought}))]),at=f(()=>$e.apply(0)),Ft=K(()=>[ne(()=>({addend:ge,description:"Oil Pump",enabled:()=>a.gt(Se.value,0)})),g(()=>({multiplier:2,description:"Oil the Oil Pump",enabled:Rt[0].bought})),g(()=>({multiplier:2,description:"3000m Well Depth",enabled:be[7].earned})),g(()=>({multiplier:2,description:"Oil and where to find it",enabled:W.upgrades.oilUpgrade.bought})),g(()=>({multiplier:()=>cl.value,description:"Effectiveness",enabled:()=>a.lt(cl.value,1)})),g(()=>({multiplier:()=>a.div(Ye.foundationProgress.value,10).floor().div(10).add(1),description:"600% Foundation Completed",enabled:Ye.milestones.extraExpansionMilestone3.earned})),g(()=>({multiplier:()=>a.sqrt(R.totalElfLevels.value),description:"Jack Level 4",enabled:R.elfTraining.heatedCutterElfTraining.milestones[3].earned}))]),Gt=f(()=>Ft.apply(0)),jt=K(()=>[ne(()=>({addend:()=>a.negate(rt.value),description:"Oil Burner",enabled:()=>a.gt(te.value,0)})),ne(()=>({addend:()=>a.negate(Ke.value),description:"Oil Smelter",enabled:()=>a.gt(pt.value,0)})),ne(()=>({addend:()=>a.negate(et.oilCost.value),description:"Oil Refinery",enabled:()=>a.gt(et.activeRefinery.value,0)}))]),B=f(()=>jt.apply(0)),ht=K(()=>[ne(()=>({addend:ze,description:"Oil Burner",enabled:()=>a.gt(te.value,0)})),g(()=>({multiplier:()=>Al.value,description:"Effectiveness",enabled:()=>a.lt(Al.value,1)}))]),ml=f(()=>ht.apply(0)),Tl=K(()=>[ne(()=>({addend:We.boosts.red1,description:"Red Dye Boost 1",enabled:()=>a.gte(We.dyes.red.amount.value,1)}))]),Xt=f(()=>Tl.apply(0)),[wl,ll]=rl(()=>[{title:"Coal Consumption",modifier:ul,unit:"/s",base:0},{title:"Drill Power",modifier:ie,base:0},{title:"Upgrade Bonus",modifier:$e,base:0,visible(){return a.gt(at.value,0)}},{title:"Oil Speed",modifier:Ft,unit:"/s",base:0,visible(){return a.gt(Gt.value,0)}},{title:"Oil Consumption",modifier:jt,unit:"/s",base:0,visible(){return a.lt(B.value,0)}},{title:"Oil to Coal Substitution",modifier:ht,unit:"/s",base:0,visible(){return a.gt(ml.value,0)}},{title:"Extra Oil Pumps",modifier:Tl,base:0,visible(){return a.gt(Xt.value,0)}}]),vl=j(!1),Wa=_(()=>n(_t,{modelValue:vl.value,"onUpdate:modelValue":Xe=>vl.value=Xe},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:wl})),cl=j(a.dOne),Al=j(a.dOne);lt.on("update",Xe=>{if(a.lt(U.day.value,Na))return;const Ot=a.negate(dl.value);a.gt(Ot,0)?(cl.value=a.min(a.div(q.coal.value,Ot),1),q.coal.value=a.sub(q.coal.value,a.mul(Ot,cl.value).mul(Xe))):cl.value=a.dOne,r.value=a.add(r.value,a.mul(Q.value,Xe)),i.value=a.add(i.value,a.mul(Gt.value,Xe)),c();const _a=a.negate(B.value);a.gt(_a,0)?(Al.value=a.min(a.div(i.value,_a),1),i.value=a.sub(i.value,a.mul(_a,Al.value).mul(Xe)).max(0)):Al.value=a.dOne});const{total:Pl,trackerDisplay:nn}=hl({resource:i,goal:25e4,name:e,day:Na,color:t,modal:{show:vl,display:Wa}});return{name:e,day:Na,color:t,oil:i,totalOil:Pl,depth:o,drillProgress:r,activeHeavy:m,buildHeavy:w,activeHeavy2:N,buildHeavy2:M,activeExtractor:$,buildExtractor:he,activePump:Se,buildPump:Oe,activeBurner:te,buildBurner:re,activeSmelter:pt,buildSmelter:St,extractorCoal:oe,extractorOre:Be,coalEffectiveness:cl,oilEffectiveness:Al,depthMilestones:be,collapsedDepthMilestones:Ut,row1Upgrades:Pt,row2Upgrades:Rt,minWidth:700,oilMilestones:Ae,collapsedOilMilestones:Me,generalTabCollapsed:ll,display:_(()=>{const Xe=[];return be[1].earned.value&&Xe.push(Pt),Ae[1].earned.value&&Xe.push(Rt),n(S,null,[me(nn),n(Ee,null,null),a.lt(cl.value,1)?n("div",null,[s("Coal efficiency: "),we(a.mul(cl.value,100)),s("%")]):null,a.lt(Al.value,1)?n("div",null,[s("Oil efficiency: "),we(a.mul(Al.value,100)),s("%")]):null,n(qt,{resource:i,color:t,sticky:!0,productionDisplay:_(()=>n(S,null,[a.lt(o.value,1e3)?"Reach 1000m to start gaining oil":n(S,null,[va(a.add(Gt.value,B.value))])]))},null),a.eq(Gt.value,0)?n(S,null,[s("(Need at least 1 Oil Pump, 1 Heavy Drill and 1 Heavy Extractor active to gain oil)"),n("br",null,null)]):"",n(jl,null,{default:()=>[be[6].earned.value?n($t,null,{default:()=>[me(Oe),n("div",null,[Ce(a.floor(Se.value)),s("/"),Ce(a.floor(Oe.amount.value))]),nt(Le,tt,ve,De)]}):null,Ae[0].earned.value?n($t,null,{default:()=>[me(re),n("div",null,[Ce(a.floor(te.value)),s("/"),Ce(a.floor(re.amount.value))]),nt(Ze,ut,xt,Qe)]}):null,Ae[2].earned.value?n($t,null,{default:()=>[me(St),n("div",null,[Ce(a.floor(pt.value)),s("/"),Ce(a.floor(St.amount.value))]),nt(Tt,V,de,Bt)]}):null]}),n("br",null,null),n("div",null,[n("span",null,[s("The well is ")]),n("h2",{style:"color: #6f767f; text-shadow: 0 0 10px #6f767f"},[Ce(o.value)]),s("m deep"),n("br",null,null),s("Next at "),we(a.sub(d.value,r.value))," ",s("drill power seconds")]),n("div",null,[n("span",null,[s("Your drill power is ")]),n("h2",{style:"color: #6f767f; text-shadow: 0 0 10px #6f767f"},[we(Q.value)])]),n(Ee,null,null),n(jl,null,{default:()=>[n($t,null,{default:()=>[me(w),n("div",null,[Ce(a.floor(m.value)),s("/"),Ce(a.floor(w.amount.value))]),nt(k,D,x,v)]}),be[3].earned.value?n($t,null,{default:()=>[me(M),n("div",null,[Ce(a.floor(N.value)),s("/"),Ce(a.floor(M.amount.value))]),nt(E,X,Z,P)]}):null,be[5].earned.value?n($t,null,{default:()=>[me(he),n("div",null,[Ce(a.floor($.value)),s("/"),Ce(a.floor(he.amount.value))]),nt(ae,Ie,Ne,se)]}):null]}),n(Ee,null,null),Ml(...Xe),n(Ee,null,null),Kt(),a.gte(Pl.value,50)?mt():""])}),minimizedDisplay:_(()=>n("div",null,[e,s(" - "),we(i.value),s(" "),i.displayName]))}}),Ar="metal",si=7,it=Ht(Ar,function(){const e="Metal",t="#888B8D",l=kt(0,"metal ingots",void 0,!0),i=li(l),o=kt(0,"ore"),r=li(o),d=K(()=>[g(()=>({multiplier:5,description:"Crucible",enabled:se.bought})),g(()=>({multiplier:1.5,description:"Industrial Crucible",enabled:()=>a.gte(ge.amount.value,1)})),g(()=>({multiplier:2,description:"Industrial Furnace",enabled:Ie.bought})),g(()=>({multiplier:()=>a.add(Le.value,1),description:"Hotter Forges",enabled:()=>a.gte(De.amount.value,1)})),g(()=>({multiplier:2,description:"Carry metal in boxes",enabled:st.row2Upgrades.metalUpgrade.bought})),g(()=>({multiplier:We.boosts.purple2,description:"Purple Dye Boost 2",enabled:()=>a.gte(We.dyes.purple.amount.value,1)})),g(()=>({multiplier:()=>a.add(yt.cloth.value,1).log10().plus(1),description:"Glistening Paint",enabled:We.upgrades.redDyeUpg.bought})),g(()=>({multiplier:()=>a.div(Ye.foundationProgress.value,10).floor().div(10).add(1),description:"400% Foundation Completed",enabled:Ye.milestones.extraExpansionMilestone2.earned})),fl(()=>({exponent:1.1,description:"Mary Level 2",enabled:R.elfTraining.heatedPlanterElfTraining.milestones[1].earned}))]),c=f(()=>d.apply(.1)),m=K(()=>[ne(()=>({addend:()=>a.times(ge.amount.value,10),description:"Industrial Crucibles",enabled:()=>a.gte(ge.amount.value,1)})),g(()=>({multiplier:2,description:"Efficient Crucibles",enabled:q.efficientSmelther.bought})),g(()=>({multiplier:()=>a.mul(ce.activeSmelter.value,ce.oilEffectiveness.value).add(1),description:"Oil Smelter",enabled:()=>a.gt(ce.activeSmelter.value,0)})),g(()=>({multiplier:We.boosts.purple2,description:"Purple Dye Boost 2",enabled:()=>a.gte(We.dyes.purple.amount.value,1)})),g(()=>({multiplier:()=>a.add(et.activeRefinery.value,1).sqrt(),description:"De Louvre",enabled:We.upgrades.redDyeUpg2.bought})),g(()=>({multiplier:()=>a.div(R.totalElfExp.value,1e3).add(1).sqrt(),description:"Mary Level 5",enabled:R.elfTraining.heatedPlanterElfTraining.milestones[4].earned}))]),p=f(()=>m.apply(0)),b=K(()=>[g(()=>({multiplier:3,description:"Efficient Crucibles",enabled:q.efficientSmelther.bought})),g(()=>({multiplier:()=>a.add(ce.activeBurner.value,1).mul(ce.oilEffectiveness.value),description:"Blaster Burner",enabled:ce.row2Upgrades[2].bought}))]),w=f(()=>b.apply(1)),k=1e10,v=f(()=>a.min(o.value,a.div(q.coal.value,k)).floor().max(0)),x=Lt(()=>({display:_(()=>{const re=a.gte(v.value,1)?v.value:a.add(v.value,1);return n(S,null,[n("span",{style:"font-size: large"},[s("Smelt "),we(a.times(v.value,c.value))," ",l.displayName]),n("br",null,null),n("span",{style:"font-size: large"},[s("Cost: "),Ce(re),s(" "),o.displayName,s(";")," ",Ce(a.times(re,k)),s(" "),q.coal.displayName])])}),canClick:()=>a.gte(v.value,1),onClick(){!u(this.canClick)||D(v.value)},style:{width:"600px",minHeight:"unset"}}));function D(re,Qe=1){const[Ze,xt,ut]=[a.times(re,c.value).times(Qe),re,a.times(re,k)];l.value=a.add(l.value,Ze),o.value=a.sub(o.value,xt),q.coal.value=a.sub(q.coal.value,ut)}const N=K(()=>[ne(()=>({addend:()=>Ue.amount.value,description:"Mining Drills",enabled:()=>a.gte(Ue.amount.value,1)})),g(()=>({multiplier:()=>a.mul(ce.depth.value,.05).add(1),description:"25m Well Depth",enabled:ce.depthMilestones[2].earned})),g(()=>({multiplier:ce.extractorOre,description:"Heavy Extractor",enabled:()=>a.gt(ce.activeExtractor.value,0)})),g(()=>({multiplier:2,description:"Carry ore in boxes",enabled:st.row2Upgrades.oreUpgrade.bought}))]),J=f(()=>N.apply(1)),M=K(()=>[g(()=>({multiplier:2,description:"A Simple Pickaxe",enabled:he.bought})),g(()=>({multiplier:2,description:"Double Pickaxe",enabled:ae.bought})),g(()=>({multiplier:2.5,description:"Mining Drills",enabled:()=>a.gte(Ue.amount.value,1)})),g(()=>({multiplier:2,description:"Efficient Drills",enabled:Se.bought})),g(()=>({multiplier:2,description:"Oil the Mining Drills",enabled:ce.row2Upgrades[1].bought}))]),E=f(()=>M.apply(a.recip(Z))),P=xe(0),Z=10,X=tl(()=>({width:400,height:25,direction:Fe.Right,fillStyle:{backgroundColor:t},progress:()=>P.value})),$=K(()=>[ne(()=>({addend:J})),g(()=>({multiplier:E}))]),z=f(()=>$.apply(0)),oe=K(()=>[ne(()=>({addend:z})),ne(()=>({addend:()=>a.negate(p.value),enabled:Oe}))]),Be=f(()=>oe.apply(0)),he=L(()=>({resource:O(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"}})),ae=L(()=>({resource:O(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:()=>h(ae.bought.value)})),se=L(()=>({resource:O(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:()=>h(se.bought.value||a.div(r.value,c.value).plus(i.value).gte(1))})),Ne=L(()=>({resource:O(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:()=>h(a.gte(Ue.amount.value,1)&&(Ne.bought.value||U.days[7].opened.value||a.lt(q.computedCoalGain.value,a.times(J.value,E.value).times(k)))),onPurchase(){U.days[2].recentlyUpdated.value=!0}})),Ie=L(()=>({canAfford(){return a.gte(l.value,50)&&a.gte(q.coal.value,1e11)},onPurchase(){l.value=a.sub(l.value,50),q.coal.value=a.sub(q.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/>${we(1e11)} ${q.coal.displayName}`}})),Se=L(()=>({resource:O(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:()=>h(ce.depthMilestones[4].earned.value)})),Ue=qe(()=>({resource:O(l),cost(){return a.pow(1.15,this.amount.value).times(10)},display:{title:"Mining Drill",description:"An automated machine to help you mine more ore, faster",effectDisplay:_(()=>n(S,null,[s("Mine 2.5x faster. Increase ore mining amount by")," ",Ce(Ue.amount.value),s(" ore per operation")]))},visibility:()=>h(a.gte(Ue.amount.value,1)||a.div(r.value,c.value).plus(i.value).gte(10)),style:{width:"200px"}})),ge=qe(()=>({resource:O(l),cost(){return a.pow(1.15,a.times(this.amount.value,10)).times(10)},display:{title:"Industrial Crucible",description:"A giant automated crucible furnace, letting you smelt ore faster",effectDisplay:_(()=>n(S,null,[s("Automatically smelts")," ",Ce(a.times(ge.amount.value,10)),s(" ore per second")]))},visibility:()=>h(a.gte(ge.amount.value,1)||a.gte(Ue.amount.value,4)||a.gte(r.value,50)),style:{width:"200px"}})),Oe=xe(!0),De=qe(()=>({resource:q.coal,cost(){return a.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:_(()=>n(S,null,[s("Gain "),Ce(a.times(Le.value,100)),s("% more metal per ore")]))},visibility:()=>h(a.gte(De.amount.value,1)||Ie.bought.value),style:{width:"200px"}})),Le=f(()=>a.times(De.amount.value,.25));lt.on("update",re=>{P.value=a.times(re,E.value).plus(P.value);const Qe=P.value.trunc();P.value=P.value.minus(Qe),o.value=a.add(o.value,a.times(Qe,J.value)),Oe.value&&D(a.min(v.value,a.times(p.value,re)),w.value)});const[ve,tt]=rl(()=>[{title:"Auto Smelt Speed",modifier:m,base:0,unit:"/s",visible(){return a.gt(ge.amount.value,0)}},{title:"Auto Smelt Multiplier",modifier:b,base:1,visible(){return a.gt(w.value,1)}},{title:"Metal per Ore",modifier:d,base:.1},{title:"Ore per Mining Operation",modifier:N,base:1},{title:"Mining Speed",modifier:M,base:.1,unit:"/s"}]),te=j(!1),rt=_(()=>n(_t,{modelValue:te.value,"onUpdate:modelValue":re=>te.value=re},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:ve})),{total:ze,trackerDisplay:Je}=hl({resource:l,goal:25e3,name:e,day:si,color:t,modal:{show:te,display:rt}});return{name:e,day:si,color:t,ore:o,bestOre:r,oreProgress:P,metal:l,bestMetal:i,totalMetal:ze,simplePickaxe:he,doublePickaxe:ae,crucible:se,coalDrill:Ne,industrialFurnace:Ie,efficientDrill:Se,oreDrill:Ue,industrialCrucible:ge,autoSmeltEnabled:Oe,hotterForge:De,generalTabCollapsed:tt,minWidth:700,display:_(()=>n(S,null,[me(Je),n(Ee,null,null),n(qt,{resource:l,color:t,style:"margin-bottom: 0",sticky:!1,productionDisplay:_(()=>n(S,null,[Oe.value&&a.gte(ge.amount.value,1)?`+${ki([[p.value,"smelting speed"],[z.value,"ore gain"],[a.div(q.computedCoalGain.value,k),"coal gain"]],"/s",a.mul(c.value,w.value))}`:void 0]))},null),n(Ee,null,null),me(x),a.gte(ge.amount.value,1)?n("div",{style:{width:"150px"}},[n(nl,{title:"Auto Smelt",modelValue:Oe.value,"onUpdate:modelValue":re=>Oe.value=re},null)]):void 0,n(Ee,null,null),n(qt,{resource:o,color:t,style:"margin-bottom: 0",sticky:!1,productionDisplay:_(()=>n(S,null,[Ci(Be.value)]))},null),n(Ee,null,null),n("div",null,[s("Currently mining "),we(J.value),s(" ore every")," ",we(a.recip(E.value)),s(" seconds")]),me(X),n(Ee,null,null),nt(he,ae,se,Ne,Ie,Se),nt(Ue,ge,De)])),minimizedDisplay:_(()=>n("div",null,[e,s(" - "),we(l.value),s(" "),l.displayName]))}}),kr="elves",Kl=4,Re=Ht(kr,function(){const e="Elves",t="red",l="#911D21",o=tl(()=>({direction:Fe.Right,width:600,height:25,fillStyle:`backgroundColor: ${l}`,progress:()=>U.day.value===Kl?a.div(Ge.value,6).times(.8333333333333334).add(a.div(a.add(q.coal.value,1).log10(),a.log10(1e9)).clamp(0,1).div(6)):1,display:_(()=>U.day.value===Kl?a.lt(Ge.value,6)?n(S,null,[le(Ge.value),s("/6 elves")]):n(S,null,[le(q.coal.value),s("/"),le(1e9),s(" coal")]):"")})),r=gr(()=>({thingsToReset:[ue,Ye,q],onReset(){setTimeout(()=>{Ae.earned.value?(ue.row1Upgrades.forEach(ie=>ie.bought.value=!0),ue.row2Upgrades.forEach(ie=>ie.bought.value=!0)):Bt.earned.value&&(ue.row1Upgrades[4].bought.value=!0,ue.row2Upgrades[4].bought.value=!0),Ut.earned.value&&(Ye.foundationProgress.value=100),mt.earned.value&&(q.warmerCutters.bought.value=!0,q.warmerPlanters.bought.value=!0,q.basicFertilizer.bought.value=!0,q.unlockBonfire.bought.value=!0,q.dedicatedCutters.bought.value=!0,q.dedicatedPlanters.bought.value=!0,q.betterFertilizer.bought.value=!0,q.unlockKiln.bought.value=!0,q.efficientSmelther.bought.value=!0)})}})),d=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.cuttersBook.amount.value,.1).add(1),description:"Now You're Logging!",enabled:()=>a.gt(W.books.cuttersBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),c=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.plantersBook.amount.value,.1).add(1),description:"The Man Who Planted Trees",enabled:()=>a.gt(W.books.plantersBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),m=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.expandersBook.amount.value,.1).add(1),description:"Logjam",enabled:()=>a.gt(W.books.expandersBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),p=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.heatedCuttersBook.amount.value,.1).add(1),description:"Fahrenheit 451",enabled:()=>a.gt(W.books.heatedCuttersBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),b=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.heatedPlantersBook.amount.value,.1).add(1),description:"Tillamook Burn Country",enabled:()=>a.gt(W.books.heatedPlantersBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),w=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.fertilizerBook.amount.value,.1).add(1),description:"The Garden Tree's Handbook",enabled:()=>a.gt(W.books.fertilizerBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),k=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.smallFireBook.amount.value,.1).add(1),description:"Firestarter",enabled:()=>a.gt(W.books.smallFireBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),v=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.bonfireBook.amount.value,.1).add(1),description:"An Arsonist's Guide to Writer's Homes in New England",enabled:()=>a.gt(W.books.bonfireBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),x=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.kilnBook.amount.value,.1).add(1),description:"Little Fires Everywhere",enabled:()=>a.gt(W.books.kilnBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),D=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.paperBook.amount.value,.1).add(1),description:"The Book Thief",enabled:()=>a.gt(W.books.paperBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),N=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.boxBook.amount.value,.1).add(1),description:"Not a box",enabled:()=>a.gt(W.books.boxBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),J=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.clothBook.amount.value,.1).add(1),description:"Fuzzy Bee and Friends",enabled:()=>a.gt(W.books.clothBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),M=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.miningDrillBook.amount.value,.1).add(1),description:"Drills and Mills",enabled:()=>a.gt(W.books.miningDrillBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),E=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.heavyDrillBook.amount.value,.1).add(1),description:"Deep in the Earth",enabled:()=>a.gt(W.books.heavyDrillBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),P=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.oilBook.amount.value,.1).add(1),description:"Burning the Midnight Oil",enabled:()=>a.gt(W.books.oilBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),Z=K(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:be.earned})),g(()=>({multiplier:()=>a.times(W.books.metalBook.amount.value,.1).add(1),description:"Physical Metallurgy",enabled:()=>a.gt(W.books.metalBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Me.earned}))]),[X,$]=rl(()=>[{title:"Holly Auto-Buy Frequency",modifier:d,base:10,unit:"/s",visible:Ke.cuttersElf.bought},{title:"Ivy Auto-Buy Frequency",modifier:c,base:10,unit:"/s",visible:Ke.plantersElf.bought},{title:"Hope Auto-Buy Frequency",modifier:m,base:10,unit:"/s",visible:Ke.expandersElf.bought},{title:"Jack Auto-Buy Frequency",modifier:p,base:10,unit:"/s",visible:Ke.heatedCuttersElf.bought},{title:"Mary Auto-Buy Frequency",modifier:b,base:10,unit:"/s",visible:Ke.heatedPlantersElf.bought},{title:"Noel Auto-Buy Frequency",modifier:w,base:10,unit:"/s",visible:Ke.fertilizerElf.bought},{title:"Joy Auto-Buy Frequency",modifier:k,base:10,unit:"/s",visible:Ke.smallFireElf.bought},{title:"Faith Auto-Buy Frequency",modifier:v,base:10,unit:"/s",visible:Ke.bonfireElf.bought},{title:"Snowball Auto-Buy Frequency",modifier:x,base:10,unit:"/s",visible:Ke.kilnElf.bought},{title:"Star Auto-Buy Frequency",modifier:D,base:10,unit:"/s",visible:Ke.paperElf.bought},{title:"Bell Auto-Buy Frequency",modifier:N,base:10,unit:"/s",visible:Ke.boxElf.bought},{title:"Gingersnap Auto-Buy Frequency",modifier:J,base:10,unit:"/s",visible:Ke.clothElf.bought},{title:"Peppermint Auto-Buy Frequency",modifier:M,base:10,unit:"/s",visible:R.elfTraining.expandersElfTraining.milestones[3].earned},{title:"Frosty Auto-Buy Frequency",modifier:E,base:10,unit:"/s",visible:R.elfTraining.fertilizerElfTraining.milestones[4].earned.value},{title:"Cocoa Auto-Buy Frequency",modifier:P,base:10,unit:"/s",visible:R.elfTraining.heatedCutterElfTraining.milestones[4].earned.value},{title:"Twinkle Auto-Buy Frequency",modifier:Z,base:10,unit:"/s",visible:R.elfTraining.expandersElfTraining.milestones[4].earned}]),z=j(!1),oe=_(()=>n(_t,{modelValue:z.value,"onUpdate:modelValue":ie=>z.value=ie},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:X})),Be=f(()=>{let ie=a.pow(4,Ge.value).times(1e6);return a.gte(Ge.value,9)&&(ie=a.times(ie,1e15)),ie});function he(ie){var ml,Tl;const Q=xe(0),$e=xe(0),at=ie.hasToggle?xe(!1):j(!0),Ft=f(()=>ie.cooldownModifier.apply(10)),Gt=Et((ml=ie.canBuy)!=null?ml:!0),jt=Et((Tl=ie.buyMax)!=null?Tl:!1);function B(Xt){if(ht.bought.value&&u(Gt)){Q.value=a.add(Q.value,Xt);const wl=a.recip(Ft.value);$e.value+=Xt/wl.toNumber(),(Ia(ie.buyable)?ie.buyable:[ie.buyable]).forEach(ll=>{var vl;for(;jt||a.gte(Q.value,wl);)if(ie.customCost==null?u(ll.canPurchase):a.gte(ll.resource.value,ie.customCost(ll.amount.value)))ll.amount.value=a.add(ll.amount.value,1),Q.value=a.sub(Q.value,wl),(vl=ie.onAutoPurchase)==null||vl.call(ie,ll);else{Q.value=wl;break}})}}const ht=L(()=>({...ie,buyable:void 0,toggle:at,buyProgress:Q,update:B,resource:q.coal,cost:Be,computedAutoBuyCooldown:Ft,amountOfTimesDone:$e,name:ie.name,display:()=>({title:ie.name,description:_(()=>n(S,null,[ie.description,ht.bought.value?null:n(S,null,[" ",s("Training this elf will require resetting all your progress from days 1-3.")]),ht.bought.value&&ie.hasToggle===!0?n(S,null,[n(nl,{title:ie.toggleDesc,"onUpdate:modelValue":Xt=>at.value=Xt,modelValue:at.value},null)]):null])),showCost:!ht.bought.value}),style:"width: 190px",onPurchase(){var Xt;(Xt=ie.onPurchase)==null||Xt.call(ie),r.reset()}}));return ht}const ae=he({name:"Holly",description:"Holly will automatically purchase cutters you can afford, without actually spending any logs.",buyable:ue.row1Buyables[0],cooldownModifier:d,buyMax:()=>R.elfTraining.cutterElfTraining.milestones[1].earned.value}),se=he({name:"Ivy",description:"Ivy will automatically purchase planters you can afford, without actually spending any logs.",buyable:ue.row1Buyables[1],cooldownModifier:c,buyMax:()=>R.elfTraining.planterElfTraining.milestones[1].earned.value}),Ne=he({name:"Hope",description:"Hope will automatically purchase forest expanders you can afford, without actually spending any logs.",buyable:ue.row1Buyables[2],cooldownModifier:m,buyMax:()=>R.elfTraining.expandersElfTraining.milestones[1].earned.value}),Ie=[ae,se,Ne],Se=he({name:"Jack",description:"Jack will automatically purchase heated cutters you can afford, without actually spending any coal.",buyable:q.heatedCutters,cooldownModifier:p,buyMax:()=>R.elfTraining.heatedCutterElfTraining.milestones[2].earned.value}),Ue=he({name:"Mary",description:"Mary will automatically purchase heated planters you can afford, without actually spending any coal.",buyable:q.heatedPlanters,cooldownModifier:b,buyMax:()=>R.elfTraining.heatedPlanterElfTraining.milestones[2].earned.value}),ge=he({name:"Noel",description:"Noel will automatically purchase fertilized soil you can afford, without actually spending any ash.",buyable:q.moreFertilizer,cooldownModifier:w}),Oe=[Se,Ue,ge],De=he({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:q.buildFire,cooldownModifier:k,visibility:()=>h(st.upgrades.logsUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased small fires",onAutoPurchase(){De.toggle.value&&(q.activeFires.value=a.add(q.activeFires.value,1))},onPurchase(){U.days[4].recentlyUpdated.value=!0}}),Le=he({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:q.buildBonfire,cooldownModifier:v,visibility:()=>h(st.upgrades.ashUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased bonfires",onAutoPurchase(){const ie=u(this.buyable.cost);q.activeFires.value=a.sub(q.activeFires.value,ie).max(0),q.buildFire.amount.value=a.sub(q.buildFire.amount.value,ie).max(0),Le.toggle.value&&(q.activeBonfires.value=a.add(q.activeBonfires.value,1))},onPurchase(){U.days[4].recentlyUpdated.value=!0},canBuy:q.unlockBonfire.bought}),ve=he({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:q.buildKiln,cooldownModifier:x,visibility:()=>h(st.upgrades.coalUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased kilns",onAutoPurchase(){ve.toggle.value&&(q.activeKilns.value=a.add(q.activeKilns.value,1))},onPurchase(){U.days[4].recentlyUpdated.value=!0},canBuy:q.unlockKiln.bought}),tt=[De,Le,ve],te=he({name:"Star",description:"Star will automatically purchase all books you can afford, without actually spending any paper.",buyable:Object.values(W.books),cooldownModifier:D,visibility:()=>h(et.elfUpgrades.paperElf.bought.value)}),rt=he({name:"Bell",description:"Bell will automatically purchase all box buyables you can afford, without actually spending any boxes.",buyable:Object.values(st.buyables),cooldownModifier:N,visibility:()=>h(et.elfUpgrades.boxElf.bought.value)}),ze=he({name:"Gingersnap",description:"Gingersnap will automatically purchase all cloth buyables you can afford, without actually spending any resources.",buyable:[yt.buildPens,yt.betterShears,yt.fasterSpinning],cooldownModifier:J,visibility:()=>h(et.elfUpgrades.clothElf.bought.value)}),Je=[te,rt,ze],re=he({name:"Peppermint",description:"Peppermint will automatically purchase all mining drills you can afford, without actually spending any resources.",buyable:q.buildDrill,cooldownModifier:M,visibility:()=>h(R.elfTraining.expandersElfTraining.milestones[3].earned.value),hasToggle:!0,toggleDesc:"Activate auto-purchased mining drills",onAutoPurchase(){re.toggle.value&&(q.activeDrills.value=a.add(q.activeDrills.value,1))}}),Qe=he({name:"Frosty",description:"Frosty will automatically purchase all drill types in the oil section, without actually spending any resources.",buyable:[ce.buildHeavy,ce.buildHeavy2,ce.buildExtractor],cooldownModifier:E,visibility:()=>h(R.elfTraining.fertilizerElfTraining.milestones[4].earned.value),hasToggle:!0,toggleDesc:"Activate auto-purchased oil drills",onAutoPurchase(ie){Qe.toggle.value&&(ie===ce.buildHeavy||ie===ce.buildHeavy||ie===ce.buildHeavy)&&(ce.activeHeavy.value=a.add(ce.activeHeavy.value,1))}}),Ze=he({name:"Cocoa",description:"Cocoa will automatically purchase all oil-using machines you can afford, without actually spending any resources.",buyable:[ce.buildPump,ce.buildBurner,ce.buildSmelter],cooldownModifier:P,visibility:()=>h(R.elfTraining.heatedCutterElfTraining.milestones[4].earned.value),hasToggle:!0,toggleDesc:"Activate auto-purchased oil-using machines",onAutoPurchase(ie){Qe.toggle.value&&(ie===ce.buildPump?ce.activePump.value=a.add(ce.activePump.value,1):ie===ce.buildBurner?ce.activeBurner.value=a.add(ce.activeBurner.value,1):ie===ce.buildSmelter&&(ce.activeSmelter.value=a.add(ce.activeSmelter.value,1)))}}),xt=[re,Qe,Ze],ut=he({name:"Twinkle",description:"Twinkle will automatically purchase all metal buyables you can afford, without actually spending any resources.",buyable:[it.oreDrill,it.industrialCrucible,it.hotterForge],cooldownModifier:Z,visibility:()=>h(R.elfTraining.expandersElfTraining.milestones[4].earned.value)}),pt=[ut],Ke={cuttersElf:ae,plantersElf:se,expandersElf:Ne,heatedCuttersElf:Se,heatedPlantersElf:Ue,fertilizerElf:ge,smallFireElf:De,bonfireElf:Le,kilnElf:ve,paperElf:te,boxElf:rt,clothElf:ze,miningDrillElf:re,heavyDrillElf:Qe,oilElf:Ze,metalElf:ut},Ge=f(()=>Object.values(Ke).filter(ie=>ie.bought.value).length),St=F(()=>({display:{requirement:"1 Elf Trained",effectDisplay:"Manual cutting and planting can happen twice as often for each trained elf"},shouldEarn:()=>a.gte(Ge.value,1)})),Bt=F(()=>({display:{requirement:"2 Elves Trained",effectDisplay:"Research I & II aren't reset after training"},shouldEarn:()=>a.gte(Ge.value,2),visibility:()=>h(St.earned.value)})),Tt=F(()=>({display:{requirement:"3 Elves Trained",effectDisplay:"Coal gain is raised to the 1.25"},shouldEarn:()=>a.gte(Ge.value,3),visibility:()=>h(Bt.earned.value)})),de=F(()=>({display:{requirement:"4 Elves Trained",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>a.gte(Ge.value,4),visibility:()=>h(Tt.earned.value)})),V=F(()=>({display:{requirement:"5 Elves Trained",effectDisplay:"Forest is twice as large"},shouldEarn:()=>a.gte(Ge.value,5),visibility:()=>h(de.earned.value)})),be=F(()=>({display:{requirement:"6 Elves Trained",effectDisplay:"Elves work twice as fast"},shouldEarn:()=>a.gte(Ge.value,6),visibility:()=>h(V.earned.value)})),Ut=F(()=>({display:{requirement:"7 Elves Trained",effectDisplay:"Workshop Foundation starts at 100% complete after training"},shouldEarn:()=>a.gte(Ge.value,7),visibility:()=>h(be.earned.value&&U.day.value>5)})),Kt=F(()=>({display:{requirement:"8 Elves Trained",effectDisplay:"Forest is twice as large (again)"},shouldEarn:()=>a.gte(Ge.value,8),visibility:()=>h(Ut.earned.value)})),Ae=F(()=>({display:{requirement:"9 Elves Trained",effectDisplay:"Trees upgrades aren't reset after training"},shouldEarn:()=>a.gte(Ge.value,9),visibility:()=>h(Kt.earned.value)})),Me=F(()=>({display:{requirement:"10 Elves Trained",effectDisplay:"Elves work twice as fast (again)"},shouldEarn:()=>a.gte(Ge.value,10),visibility:()=>h(U.day.value>=10)})),mt=F(()=>({display:{requirement:"11 Elves Trained",effectDisplay:"Coal upgrades aren't reset after training"},shouldEarn:()=>a.gte(Ge.value,11),visibility:()=>h(Me.earned.value)})),Pt=F(()=>({display:{requirement:"12 Elves Trained",effectDisplay:"Double coal gain"},shouldEarn:()=>a.gte(Ge.value,12),visibility:()=>h(mt.earned.value)})),dt=[St,Bt,Tt,de,V,be,Ut,Kt,Ae,Me,mt,Pt],Rt={manualMilestone:St,researchMilestone:Bt,coalGainMilestone:Tt,logGainMilestone:de,forestMilestone:V,elvesMilestone:be,foundationMilestone:Ut,forestMilestone2:Kt,treeUpgradesMilestone:Ae,elvesMilestone2:Me,coalUpgradesMilestone:mt,coalGainMilestone2:Pt},{collapseMilestones:ul,display:dl}=aa(Rt);return lt.on("update",ie=>{a.lt(U.day.value,Kl)||Object.values(Ke).forEach(Q=>Q.update(ie))}),Qt(()=>{U.day.value===Kl&&a.gte(Ge.value,6)&&a.gte(q.coal.value,1e9)&&U.completeDay()}),{name:e,color:t,elves:Ke,totalElves:Ge,milestones:dt,collapseMilestones:ul,generalTabCollapsed:$,minWidth:700,display:_(()=>n(S,null,[n("div",null,[U.day.value===Kl?`Reach ${le(6)} trained elves and ${le(1e9)} ${q.coal.displayName} to complete the day`:`${e} Complete!`," ",s("-")," ",n("button",{class:"button",style:"display: inline-block;",onClick:()=>z.value=!0},[s("Check Modifiers")])]),me(o),me(oe),n(Ee,null,null),n("div",{style:"width: 600px"},[Ml(Ie,Oe,tt,Je,xt,pt)]),dl()]))}}),Cr="coal",ri=3,q=Ht(Cr,function(){const e="Coal",t="#151716",l="#B2BeB5",i="var(--foreground)",o=kt(0,"coal"),r=kt(0,"ash"),d=xe(0),c=f(()=>a.times(d.value,1e3)),m=f(()=>a.times(d.value,.1)),p=f(()=>{let B=a.times(d.value,50);return R.elfTraining.smallfireElfTraining.milestones[0].earned.value&&(B=B.times(5)),B}),b=qe(()=>({resource:ue.logs,cost(){let B=a.times(P.amount.value,u(P.cost)).plus(this.amount.value);return a.gte(B,100)&&(B=a.pow(B,2).div(100)),a.gte(B,1e4)&&(B=a.pow(B,2).div(1e4)),B=a.pow(.95,W.books.smallFireBook.amount.value).times(B),B.pow(1.5).times(1e4)},display:_(()=>n(S,null,[n("h3",null,[s("Small Fire")]),n("br",null,null),s("Burn 1000 logs for 0.1 coal and 50 ash"),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("-"),H(c.value),s(" logs/sec"),n("br",null,null),s("+"),H(m.value),s(" coal/sec"),n("br",null,null),s("+"),H(p.value),s(" ash/sec"),n("br",null,null),n("br",null,null),s("Cost: "),le(u(b.cost)),s(" "),b.resource.displayName])),onPurchase(){d.value=a.add(d.value,1)},style:{color:i,width:"160px"}})),{min:w,max:k,add:v,remove:x}=il({active:d,buyable:b}),D=kt(b.amount,"small fires"),N=xe(0),J=f(()=>a.times(N.value,1e4)),M=f(()=>{let B=a.times(N.value,10);return R.elfTraining.bonfireElfTraining.milestones[0].earned.value&&(B=B.times(5)),B}),E=f(()=>{let B=a.times(N.value,1e3);return R.elfTraining.bonfireElfTraining.milestones[0].earned.value&&(B=B.times(5)),B}),P=qe(()=>({resource:D,cost(){return a.pow(.95,W.books.bonfireBook.amount.value).times(10)},display:_(()=>n(S,null,[n("h3",null,[s("Bonfire")]),n("br",null,null),s("Burn 10,000 logs for 10 coal and 1000 ash"),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("-"),H(J.value),s(" logs/sec"),n("br",null,null),s("+"),H(M.value),s(" coal/sec"),n("br",null,null),s("+"),H(E.value),s(" ash/sec"),n("br",null,null),n("br",null,null),s("Cost: "),le(u(P.cost)),s(" "),P.resource.displayName])),onPurchase(B){d.value=a.sub(d.value,B).max(0),N.value=a.add(N.value,1)},style:{color:i,width:"160px"},visibility:()=>h(re.bought.value)})),{min:Z,max:X,add:$,remove:z}=il({buyable:P,active:N}),oe=xe(0),Be=f(()=>a.times(oe.value,1e6)),he=f(()=>{let B=a.times(oe.value,1e4);return R.elfTraining.kilnElfTraining.milestones[0].earned.value&&(B=B.times(5)),B}),ae=f(()=>{let B=a.times(oe.value,1e4);return R.elfTraining.kilnElfTraining.milestones[0].earned.value&&(B=B.times(5)),B}),se=qe(()=>({resource:ue.logs,cost(){let B=this.amount.value;return a.gte(B,100)&&(B=a.pow(B,2).div(100)),a.gte(B,1e4)&&(B=a.pow(B,2).div(1e4)),B=a.pow(.95,W.books.kilnBook.amount.value).times(B),a.pow(1.1,B).times(1e7)},display:_(()=>n(S,null,[n("h3",null,[s("Charcoal Kiln")]),n("br",null,null),s("Burn 1,000,000 logs for 10,000 coal and 10,000 ash"),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("-"),H(Be.value),s(" logs/sec"),n("br",null,null),s("+"),H(he.value),s(" coal/sec"),n("br",null,null),s("+"),H(ae.value),s(" ash/sec"),n("br",null,null),n("br",null,null),s("Cost: "),le(u(se.cost)),s(" "),se.resource.displayName])),onPurchase(){oe.value=a.add(oe.value,1)},style:{color:i,width:"160px"},visibility:()=>h(pt.bought.value)})),{min:Ne,max:Ie,add:Se,remove:Ue}=il({buyable:se,active:oe}),ge=xe(0),Oe=f(()=>a.times(a.pow(ge.value,ce.row2Upgrades[1].bought.value?2:1),5e7).times(it.efficientDrill.bought.value?2:1).times(R.elfTraining.smallfireElfTraining.milestones[2].earned.value?2:1).times(R.elfTraining.bonfireElfTraining.milestones[2].earned.value?2:1).times(R.elfTraining.kilnElfTraining.milestones[2].earned.value?2:1)),De=qe(()=>({resource:it.metal,cost(){let B=this.amount.value;a.gte(B,100)&&(B=a.pow(B,2).div(100)),a.gte(B,1e4)&&(B=a.pow(B,2).div(1e4));let ht=a.pow(1.15,B).times(10);return R.elfTraining.fertilizerElfTraining.milestones[2].earned.value&&(ht=ht.div(a.add(ue.totalLogs.value,Math.E).ln())),ht},display:_(()=>n(S,null,[n("h3",null,[s("Mining Drill")]),n("br",null,null),s("Dig through the ground to find 50,000,000 coal"),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("+"),H(Oe.value),s(" coal/sec"),n("br",null,null),n("br",null,null),s("Cost: "),le(u(De.cost)),s(" "),De.resource.displayName])),onPurchase(){ge.value=a.add(ge.value,1)},style:{color:i,width:"160px"},visibility:()=>h(it.coalDrill.bought.value)})),{max:Le,min:ve,add:tt,remove:te}=il({buyable:De,active:ge}),rt=L(()=>({resource:O(o),cost:5,display:{title:"Warmer Cutters",description:"Cut down twice as many trees/s"},style:{color:i}})),ze=L(()=>({resource:O(o),cost:5,display:{title:"Warmer Planters",description:"Plant twice as many trees/s"},style:{color:i}})),Je=L(()=>({resource:O(r),cost:5e3,display:{title:"Ashy Soil",description:"Trees give 25% more logs"},style:{color:i}})),re=L(()=>({resource:D,cost:10,display:{title:"Bigger Fires",description:"Put all those fires together into a larger blaze"},onPurchase(){D.value=a.add(D.value,this.cost)},style:{color:i}})),Qe=[rt,ze,Je,re],Ze=L(()=>({resource:O(o),cost:250,display:{title:"Dedicated Cutter Heaters",description:"Double the bonus from Heated Cutters"},style:{color:i},visibility:()=>h(re.bought.value)})),xt=L(()=>({resource:O(o),cost:250,display:{title:"Dedicated Planter Heaters",description:"Double the bonus from Heated Planters"},style:{color:i},visibility:()=>h(re.bought.value)})),ut=L(()=>({canAfford(){return a.gte(ue.logs.value,1e5)&&a.gte(r.value,1e5)},onPurchase(){ue.logs.value=a.sub(ue.logs.value,1e5),r.value=a.sub(r.value,1e5)},display:_(()=>n(S,null,[n("h3",null,[s("Mulched Soil")]),n("br",null,null),s("Double the bonus from Fertilized Soil"),n("br",null,null),n("br",null,null),s("Cost: "),le(1e5),s(" "),ue.logs.displayName,n("br",null,null),le(1e5),s(" "),r.displayName])),style:{color:i},visibility:()=>h(re.bought.value)})),pt=L(()=>({resource:ue.logs,cost:1e7,display:{title:"Efficient Fires",description:"Move the fires underground to keep the coal from turning to ash"},style:{color:i},visibility:()=>h(re.bought.value)})),Ke=[Ze,xt,ut,pt],Ge=L(()=>({resource:O(o),cost:1e19,display:{title:"Efficient Crucibles",description:"Double auto smelting speed and triple metal gain from auto smelting"},style:{color:i},visibility:()=>h(ce.depthMilestones[4].earned.value)})),St=[Ge],Bt=qe(()=>({resource:O(o),cost(){let B=this.amount.value;return a.gte(B,50)&&(B=a.pow(B,2).div(50)),a.gte(B,200)&&(B=a.pow(B,2).div(200)),a.gte(B,2e6)&&(B=a.pow(B,2).div(2e6)),B=a.pow(.95,W.books.heatedCuttersBook.amount.value).times(B),R.elfTraining.heatedCutterElfTraining.milestones[0].earned.value&&(B=a.pow(.95,W.books.heatedCuttersBook.amount.value).times(B)),a.add(B,1).pow(2.5).times(10)},display:{title:"Heated Cutters",description:"Even warmer cutters cut down trees faster",effectDisplay:_(()=>n(S,null,[s("Cutters cut down trees "),H(Ut.value),s("x faster")]))},style:{color:i},visibility:()=>h(rt.bought.value)})),Tt=qe(()=>({resource:O(o),cost(){let B=this.amount.value;return a.gte(B,50)&&(B=a.pow(B,2).div(50)),a.gte(B,200)&&(B=a.pow(B,2).div(200)),a.gte(B,2e6)&&(B=a.pow(B,2).div(2e6)),B=a.pow(.95,W.books.heatedPlantersBook.amount.value).times(B),R.elfTraining.heatedPlanterElfTraining.milestones[0].earned.value&&(B=a.pow(.95,W.books.heatedPlantersBook.amount.value).times(B)),a.add(B,1).pow(2.5).times(10)},display:{title:"Heated Planters",description:"Even warmer planters plant trees faster",effectDisplay:_(()=>n(S,null,[s("Planters plant trees "),H(Ae.value),s("x faster")]))},style:{color:i},visibility:()=>h(ze.bought.value)})),de=qe(()=>({resource:O(r),cost(){let B=this.amount.value;return a.gte(B,50)&&(B=a.pow(B,2).div(50)),a.gte(B,200)&&(B=a.pow(B,2).div(200)),a.gte(B,2e6)&&(B=a.pow(B,2).div(2e6)),B=a.pow(.95,W.books.fertilizerBook.amount.value).times(B),R.elfTraining.fertilizerElfTraining.milestones[1].earned.value&&(B=a.pow(.95,W.books.fertilizerBook.amount.value).times(B)),a.add(B,1).pow(1.5).times(5e4)},display:{title:"Fertilized Soil",description:"More fertilizer helps trees grow bigger",effectDisplay:_(()=>n(S,null,[s("Trees give "),H(mt.value),s("x more logs")]))},style:{color:i},visibility:()=>h(Je.bought.value)})),V=[Bt,Tt,de],be=K(()=>[ne(()=>({addend(){return a.times(Bt.amount.value,.25)},description:"Heated Cutters",enabled(){return a.gt(Bt.amount.value,0)}})),g(()=>({multiplier:2,description:"Dedicated Cutter Heaters",enabled:Ze.bought}))]),Ut=f(()=>be.apply(1)),Kt=K(()=>[ne(()=>({addend(){return a.times(Tt.amount.value,.25)},description:"Heated Planters",enabled(){return a.gt(Tt.amount.value,0)}})),g(()=>({multiplier:2,description:"Dedicated Planter Heaters",enabled:xt.bought}))]),Ae=f(()=>Kt.apply(1)),Me=K(()=>[ne(()=>({addend(){return a.times(de.amount.value,.25)},description:"Fertilized Soil",enabled(){return a.gt(de.amount.value,0)}})),g(()=>({multiplier:2,description:"Mulched Soil",enabled:ut.bought}))]),mt=f(()=>Me.apply(1)),Pt=K(()=>[ne(()=>({addend(){return m.value},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),ne(()=>({addend(){return M.value},description:"Bonfires",enabled(){return a.gt(N.value,0)}})),ne(()=>({addend(){return he.value},description:"Charcoal Kilns",enabled(){return a.gt(oe.value,0)}})),ne(()=>({addend(){return Oe.value},description:"Mining Drills",enabled(){return a.gt(ge.value,0)}})),g(()=>({multiplier:2,description:"Carry coal in boxes",enabled:st.upgrades.coalUpgrade.bought})),g(()=>({multiplier:()=>a.div(st.buyables.coalBoxesBuyable.amount.value,2).add(1),description:"Carry more coal",enabled:st.upgrades.coalUpgrade.bought})),g(()=>({multiplier:()=>{let B=b.amount.value;return R.elfTraining.smallfireElfTraining.milestones[0].earned.value&&(B=a.div(P.amount.value,10).add(B)),a.div(B,1e4).add(1)},description:"Small Fires Synergy",enabled:Re.elves.smallFireElf.bought})),g(()=>({multiplier:()=>a.div(P.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:Re.elves.bonfireElf.bought})),g(()=>({multiplier:()=>a.div(se.amount.value,100).times(We.boosts.green2.value).add(1),description:"Kiln Synergy",enabled:Re.elves.kilnElf.bought})),g(()=>({multiplier:2,description:"Mining overalls",enabled:yt.metalUpgrades.metalUpgrade2.bought})),g(()=>({multiplier:3,description:"Mining helmet",enabled:yt.metalUpgrades.metalUpgrade3.bought})),g(()=>({multiplier:4,description:"Felt-Gripped Pick",enabled:yt.metalUpgrades.metalUpgrade4.bought})),g(()=>({multiplier:2,description:"12 Elves Trained",enabled:Re.milestones[11].earned})),fl(()=>({exponent:1.25,description:"3 Elves Trained",enabled:Re.milestones[2].earned,supportLowNumbers:!0})),g(()=>({multiplier:()=>a.mul(ce.depth.value,.25).add(1),description:"5m Well Depth",enabled:ce.depthMilestones[0].earned})),g(()=>({multiplier:ce.extractorCoal,description:"Heavy Extractor",enabled:()=>a.gt(ce.activeExtractor.value,0)})),fl(()=>({exponent:1.05,description:"Jack Level 2",enabled:R.elfTraining.heatedCutterElfTraining.milestones[1].earned}))]),dt=f(()=>Pt.apply(0)),Rt=K(()=>[ne(()=>({addend(){return p.value},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),ne(()=>({addend(){return E.value},description:"Bonfires",enabled(){return a.gt(N.value,0)}})),ne(()=>({addend(){return ae.value},description:"Charcoal Kilns",enabled(){return a.gt(oe.value,0)}})),g(()=>({multiplier:2,description:"Carry ash in boxes",enabled:st.upgrades.ashUpgrade.bought})),g(()=>({multiplier:()=>a.div(st.buyables.ashBoxesBuyable.amount.value,2).add(1),description:"Carry more ash",enabled:st.upgrades.ashUpgrade.bought})),g(()=>({multiplier:()=>{let B=b.amount.value;return R.elfTraining.smallfireElfTraining.milestones[0].earned.value&&(B=a.div(P.amount.value,100).add(B)),a.div(B,1e3).add(1)},description:"Small Fires Synergy",enabled:Re.elves.smallFireElf.bought})),g(()=>({multiplier:()=>a.div(P.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:Re.elves.bonfireElf.bought})),g(()=>({multiplier:()=>a.div(se.amount.value,100).times(We.boosts.green2.value).add(1),description:"Kiln Synergy",enabled:Re.elves.kilnElf.bought})),g(()=>({multiplier:4,description:"Mining boots",enabled:yt.metalUpgrades.metalUpgrade1.bought})),fl(()=>({exponent:1.1,description:"Joy Level 2",enabled:R.elfTraining.smallfireElfTraining.milestones[1].earned})),fl(()=>({exponent:1.1,description:"Faith Level 2",enabled:R.elfTraining.bonfireElfTraining.milestones[1].earned})),fl(()=>({exponent:1.1,description:"Snowball Level 2",enabled:R.elfTraining.kilnElfTraining.milestones[1].earned}))]),ul=f(()=>Rt.apply(0)),dl=K(()=>[ne(()=>({addend(){return a.negate(c.value)},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),ne(()=>({addend(){return a.negate(J.value)},description:"Bonfires",enabled(){return a.gt(N.value,0)}})),ne(()=>({addend(){return a.negate(Be.value)},description:"Charcoal Kilns",enabled(){return a.gt(oe.value,0)}}))]),ie=f(()=>dl.apply(0)),[Q,$e]=rl(()=>[{title:"Log Consumption",modifier:dl,base:0,visible(){return a.gt(d.value,0)||a.gt(N.value,0)||a.gt(oe.value,0)}},{title:"Coal Gain",modifier:Pt,base:0,visible(){return a.gt(d.value,0)||a.gt(N.value,0)||a.gt(oe.value,0)}},{title:"Ash Gain",modifier:Rt,base:0,visible(){return a.gt(d.value,0)||a.gt(N.value,0)||a.gt(oe.value,0)}}]),at=j(!1),Ft=_(()=>n(_t,{modelValue:at.value,"onUpdate:modelValue":B=>at.value=B},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:Q}));lt.on("update",B=>{a.lt(U.day.value,ri)||a.times(B,ie.value).negate().gt(ue.logs.value)||(ue.logs.value=a.times(B,ie.value).plus(ue.logs.value),o.value=a.times(B,dt.value).plus(o.value),r.value=a.times(B,ul.value).plus(r.value),d.value=a.max(d.value,0))});const{total:Gt,trackerDisplay:jt}=hl({resource:o,goal:1e7,name:e,day:ri,color:t,modal:{show:at,display:Ft}});return{name:e,color:t,coal:o,totalCoal:Gt,computedCoalGain:dt,ash:r,activeFires:d,buildFire:b,activeBonfires:N,buildBonfire:P,activeKilns:oe,buildKiln:se,activeDrills:ge,buildDrill:De,warmerCutters:rt,warmerPlanters:ze,basicFertilizer:Je,unlockBonfire:re,dedicatedCutters:Ze,dedicatedPlanters:xt,betterFertilizer:ut,unlockKiln:pt,efficientSmelther:Ge,heatedCutters:Bt,heatedPlanters:Tt,moreFertilizer:de,computedHeatedCutterEffect:Ut,computedHeatedPlanterEffect:Ae,computedFertilizerEffect:mt,generalTabCollapsed:$e,minWidth:700,display:_(()=>n(S,null,[me(jt),n(Ee,null,null),n(qt,{resource:o,color:t,style:"margin-bottom: 0",effectDisplay:a.gt(dt.value,0)?`+${H(dt.value)}/s`:void 0},null),n(Ee,null,null),n(qt,{resource:r,color:l,style:"margin-bottom: 0",effectDisplay:a.gt(ul.value,0)?`+${H(ul.value)}/s`:void 0},null),n(Ee,null,null),n(jl,null,{default:()=>[n($t,null,{default:()=>[me(b),n("div",null,[le(a.floor(d.value)),s("/"),le(a.floor(b.amount.value))]),nt(w,x,v,k)]}),re.bought.value?n(S,null,[n(Ee,null,null),n($t,null,{default:()=>[me(P),n("div",null,[le(N.value),s("/"),le(P.amount.value)]),nt(Z,z,$,X)]})]):void 0,pt.bought.value?n(S,null,[n(Ee,null,null),n($t,null,{default:()=>[me(se),n("div",null,[le(oe.value),s("/"),le(se.amount.value)]),nt(Ne,Ue,Se,Ie)]})]):void 0,it.coalDrill.bought.value?n(S,null,[n(Ee,null,null),n($t,null,{default:()=>[me(De),n("div",null,[le(ge.value),s("/"),le(De.amount.value)]),nt(ve,te,tt,Le)]})]):void 0]}),n(Ee,null,null),Ml(Qe,Ke,St),nt(...V)])),minimizedDisplay:_(()=>n("div",null,[e,s(" - "),H(o.value),s(" "),o.displayName]))}}),Er="management",ql=12,pl=13,R=Ht(Er,()=>{const e="Management",t="green",l=tl(()=>({direction:Fe.Right,width:600,height:25,fillStyle:`backgroundColor: ${t}`,progress:()=>U.day.value===ql?rt.reduce((Q,$e)=>Q+Math.min(1,$e.level.value/3),0)/rt.length:U.day.value===pl&&U.days[pl-1].opened.value?ze.reduce((Q,$e)=>Q+Math.min(1,$e.level.value/5),0)/ze.length:1,display:_(()=>U.day.value===ql||U.day.value===pl&&U.days[pl-1].opened.value?n(S,null,[le(a.times(u(l.progress),U.day.value===pl?80:36)),s("/"),U.day.value===pl?80:36,s(" elf levels")]):"")})),i=f(()=>{let Q=0;for(const $e of Object.values(te))Q+=$e.level.value;return Q}),o=f(()=>Object.values(te).reduce((Q,$e)=>Q.add($e.exp.value),new a(0))),r=L(()=>({display:{title:"Teach the Elves",description:"The Elves probably need to be taught if they're to do better. Maybe you'll build a school so you can teach them?"},resource:ue.logs,cost:1e21})),d=L(()=>({display:{title:"Add a Classroom?",description:"Yay, you have a school. Too bad it has pretty much nothing in it. Maybe you could add some classrooms to make it less boring and more enticing to the Elves?"},visibility:()=>h(r.bought.value),resource:st.boxes,style:"width: 150px",cost:1e13})),c=K(()=>[g(()=>({multiplier:Pt,description:"Classroom Effect",enabled:d.bought}))]),m=f(()=>c.apply(1));function p(Q,$e,...at){const Ft=xe(0);let Gt=["Holly","Ivy","Hope","Jack","Mary","Noel","Joy","Faith","Snowball","Star","Bell","Gingersnap"].indexOf(Q.name)+1;(Q.name=="Star"||Q.name=="Bell")&&(Gt/=3);const jt=a.mul(4e3,Gt),B=f(()=>a.pow(5,ht.value).mul(jt)),ht=f(()=>a.affordGeometricSeries(Ft.value,jt,5,0).min(Me.amount.value).toNumber()),ml=f(()=>a.sub(Ft.value,a.sumGeometricSeries(ht.value,jt,5,0))),Tl=tl(()=>({direction:Fe.Right,width:160,height:12,style:()=>({"margin-top":"8px","box-shadow":re.value[Q.name]?"0 0 12px "+(X.value==Q.name?"black":"white"):""}),baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",borderStyle:()=>a.gte(ht.value,Me.amount.value)?"border-color: red":"",progress:()=>a.div(ml.value,B.value),display:_(()=>a.gte(ht.value,Me.amount.value)?n(S,null,[s("Limit reached")]):n(S,null,[H(ml.value),s("/"),H(B.value),s(" XP")]))})),{collapseMilestones:Xt,display:wl}=aa($e),ll=K(()=>[g(()=>({multiplier:m,description:"Global XP Multiplier"})),g(()=>({multiplier:Je,description:"Focus Multiplier",enabled:()=>a.gt(Ze.value,0)&&re.value[Q.name]==!0})),...at]),vl=f(()=>ll.apply(.1));return Lt(()=>({display:{title:_(()=>n(S,null,[Q.name,s(" - LV "),le(ht.value)])),description:_(()=>n(S,null,[Q.name,s(" can buy buyables "),le(Q.computedAutoBuyCooldown.value)," ",s("times per second, gaining")," ",a.gte(ht.value,Me.amount.value)?0:H(a.mul(vl.value,Q.computedAutoBuyCooldown.value))," ",s("XP/sec."),me(Tl)]))},style:()=>({width:"190px",background:X.value==Q.name?"var(--foreground)":""}),onClick(){X.value=Q.name},canClick(){return X.value!==Q.name},name:Q.name,state:Xt,displayMilestone:wl,level:ht,exp:Ft,milestones:$e,timeForExp:Q.computedAutoBuyCooldown,amountOfTimesDone:Q.amountOfTimesDone,elfXPGainComputed:vl,elfXPGain:ll}))}const b=[F(()=>({display:{requirement:"Holly Level 1",effectDisplay:_(()=>n(S,null,[s("Multiply log gain by "),n("sup",null,[s("9")]),n(Cl,null,{default:()=>[s("Cutter amount")]}),s(".")]))},shouldEarn:()=>z.level.value>=1})),F(()=>({display:{requirement:"Holly Level 2",effectDisplay:"Holly now buys max."},visibility:()=>h(b[0].earned.value),shouldEarn:()=>z.level.value>=2})),F(()=>({display:{requirement:"Holly Level 3",effectDisplay:_(()=>n(S,null,[s("Multiply all cloth actions' effectiveness by log"),n("sub",null,[s("10")]),s("(Cutter amount).")]))},visibility:()=>h(b[1].earned.value),shouldEarn:()=>z.level.value>=3})),F(()=>({display:{requirement:"Holly Level 4",effectDisplay:"Multiply auto cutting amount by 1.1 per day completed"},visibility:()=>h(b[2].earned.value&&U.day.value>=13),shouldEarn:()=>z.level.value>=4})),F(()=>({display:{requirement:"Holly Level 5",effectDisplay:"Raise workshop expansion cost by 0.95"},visibility:()=>h(b[3].earned.value&&U.day.value>=13),shouldEarn:()=>z.level.value>=5}))],w=[F(()=>({display:{requirement:"Ivy Level 1",effectDisplay:"Planters are now twice as efficent."},shouldEarn:()=>oe.level.value>=1})),F(()=>({display:{requirement:"Ivy Level 2",effectDisplay:"Ivy now buys max."},visibility:()=>h(w[0].earned.value),shouldEarn:()=>oe.level.value>=2})),F(()=>({display:{requirement:"Ivy Level 3",effectDisplay:_(()=>n(S,null,[s("Auto planting speed is multiplied by 2"),n("sup",null,[s("(log"),n("sub",null,[s("10")]),s("(logs)"),n("sup",null,[s("0.2")]),s(")")])]))},visibility:()=>h(w[1].earned.value),shouldEarn:()=>oe.level.value>=3})),F(()=>({display:{requirement:"Ivy Level 4",effectDisplay:"Divide planter cost by 10"},visibility:()=>h(w[2].earned.value&&U.day.value>=13),shouldEarn:()=>oe.level.value>=4})),F(()=>({display:{requirement:"Ivy Level 5",effectDisplay:"The lesser of auto planting and cutting amounts is increased to match the greater"},visibility:()=>h(w[3].earned.value&&U.day.value>=13),shouldEarn:()=>oe.level.value>=5}))],k=[F(()=>({display:{requirement:"Hope Level 1",effectDisplay:"Forest size grows by trees planted per second raised to ^0.99"},shouldEarn:()=>Be.level.value>=1})),F(()=>({display:{requirement:"Hope Level 2",effectDisplay:"Hope now buys max."},visibility:()=>h(k[0].earned.value),shouldEarn:()=>Be.level.value>=2})),F(()=>({display:{requirement:"Hope Level 3",effectDisplay:"The workshop can be expanded past 100%, but costs scale faster. It also buys max now."},visibility:()=>h(k[1].earned.value),shouldEarn:()=>Be.level.value>=3})),F(()=>({display:{requirement:"Hope Level 4",effectDisplay:"Unlock an elf that autobuys mining drills."},visibility:()=>h(k[2].earned.value&&U.day.value>=13),shouldEarn:()=>Be.level.value>=4})),F(()=>({display:{requirement:"Hope Level 5",effectDisplay:"Unlock an elf that autobuys metal buyables."},visibility:()=>h(k[3].earned.value&&U.day.value>=13),shouldEarn:()=>Be.level.value>=5}))],v=[F(()=>({display:{requirement:"Jack Level 1",effectDisplay:'"Fahrenheit 451" affects "Heated Cutters" twice.'},shouldEarn:()=>ae.level.value>=1})),F(()=>({display:{requirement:"Jack Level 2",effectDisplay:"Coal gain is raised to the ^1.05"},visibility:()=>h(v[0].earned.value),shouldEarn:()=>ae.level.value>=2})),F(()=>({display:{requirement:"Jack Level 3",effectDisplay:"Jack now buys max."},visibility:()=>h(v[1].earned.value),shouldEarn:()=>ae.level.value>=3})),F(()=>({display:{requirement:"Jack Level 4",effectDisplay:_(()=>n(S,null,[s("Oil gain is multiplied by "),n(Cl,null,{default:()=>[s("total elf levels")]}),s(".")]))},visibility:()=>h(v[2].earned.value&&U.day.value>=13),shouldEarn:()=>ae.level.value>=4})),F(()=>({display:{requirement:"Jack Level 5",effectDisplay:"Unlock an elf that autobuys oil-using machines."},visibility:()=>h(v[3].earned.value&&U.day.value>=13),shouldEarn:()=>ae.level.value>=5}))],x=[F(()=>({display:{requirement:"Mary Level 1",effectDisplay:'"Tillamook Burn Country" affects "Heated Planters" twice.'},shouldEarn:()=>se.level.value>=1})),F(()=>({display:{requirement:"Mary Level 2",effectDisplay:"Metal gain is raised to the 1.1."},visibility:()=>h(x[0].earned.value),shouldEarn:()=>se.level.value>=2})),F(()=>({display:{requirement:"Mary Level 3",effectDisplay:"Mary now buys max."},visibility:()=>h(x[1].earned.value),shouldEarn:()=>se.level.value>=3})),F(()=>({display:{requirement:"Mary Level 4",effectDisplay:"Double automatic tree planting speed"},visibility:()=>h(x[2].earned.value&&U.day.value>=13),shouldEarn:()=>se.level.value>=4})),F(()=>({display:{requirement:"Mary Level 5",effectDisplay:_(()=>n(S,null,[s("Auto smelting speed is multiplied by "),n(Cl,null,{default:()=>[s("total XP/1000")]}),s(".")]))},visibility:()=>h(x[3].earned.value&&U.day.value>=13),shouldEarn:()=>se.level.value>=5}))],D=[F(()=>({display:{requirement:"Noel Level 1",effectDisplay:_(()=>n(S,null,[s("Log gain is multiplied by "),n(Cl,null,{default:()=>[s("total elf levels")]}),s(".")]))},shouldEarn:()=>Ne.level.value>=1})),F(()=>({display:{requirement:"Noel Level 2",effectDisplay:`"The Garden Tree's Handbook" affects "Fertilized Soil" twice`},visibility:()=>h(D[0].earned.value),shouldEarn:()=>Ne.level.value>=2})),F(()=>({display:{requirement:"Noel Level 3",effectDisplay:"Divide the mining drill cost by ln(Total logs + e)"},visibility:()=>h(D[1].earned.value),shouldEarn:()=>Ne.level.value>=3})),F(()=>({display:{requirement:"Noel Level 4",effectDisplay:_(()=>n(S,null,[s("Reduce oil refinery cost by (Plastic amount)"),n("sup",null,[s("2")])]))},visibility:()=>h(D[2].earned.value&&U.day.value>=13),shouldEarn:()=>Ne.level.value>=4})),F(()=>({display:{requirement:"Noel Level 5",effectDisplay:"Unlock an elf that autobuys drills and extractors"},visibility:()=>h(D[3].earned.value&&U.day.value>=13),shouldEarn:()=>se.level.value>=5}))],N=[F(()=>({display:{requirement:"Joy Level 1",effectDisplay:"Small Fire synergy counts bonfires at reduced rate."},shouldEarn:()=>Se.level.value>=1})),F(()=>({display:{requirement:"Joy Level 2",effectDisplay:"Raise ash gain to the 1.1"},visibility:()=>h(N[0].earned.value),shouldEarn:()=>Se.level.value>=2})),F(()=>({display:{requirement:"Joy Level 3",effectDisplay:"Mining drill is 2x more powerful"},visibility:()=>h(N[1].earned.value),shouldEarn:()=>Se.level.value>=3})),F(()=>({display:{requirement:"Joy Level 4",effectDisplay:"Metal gain is boosted by heavy drills"},visibility:()=>h(N[2].earned.value&&U.day.value>=13),shouldEarn:()=>Se.level.value>=4})),F(()=>({display:{requirement:"Joy Level 5",effectDisplay:"Raise Industrial Crucible's effect to the 1.1"},visibility:()=>h(N[3].earned.value&&U.day.value>=13),shouldEarn:()=>Se.level.value>=5}))],J=[F(()=>({display:{requirement:"Faith Level 1",effectDisplay:"Multiply bonfire efficiency by 5."},shouldEarn:()=>Ue.level.value>=1})),F(()=>({display:{requirement:"Faith Level 2",effectDisplay:"Raise ash gain to the 1.1"},visibility:()=>h(J[0].earned.value),shouldEarn:()=>Ue.level.value>=2})),F(()=>({display:{requirement:"Faith Level 3",effectDisplay:"Mining drill is 2x more powerful"},visibility:()=>h(J[1].earned.value),shouldEarn:()=>Ue.level.value>=3})),F(()=>({display:{requirement:"Faith Level 4",effectDisplay:"Oil gain is boosted by heavy drill drills"},visibility:()=>h(J[2].earned.value&&U.day.value>=13),shouldEarn:()=>Ue.level.value>=4})),F(()=>({display:{requirement:"Faith Level 5",effectDisplay:"Raise Industrial Crucible's effect to the 1.1"},visibility:()=>h(J[3].earned.value&&U.day.value>=13),shouldEarn:()=>Ue.level.value>=5}))],M=[F(()=>({display:{requirement:"Snowball Level 1",effectDisplay:"Multiply kiln efficiency by 5."},shouldEarn:()=>ge.level.value>=1})),F(()=>({display:{requirement:"Snowball Level 2",effectDisplay:"Raise ash gain to the 1.1"},visibility:()=>h(M[0].earned.value),shouldEarn:()=>ge.level.value>=2})),F(()=>({display:{requirement:"Snowball Level 3",effectDisplay:"Mining drill is 2x more powerful"},visibility:()=>h(M[1].earned.value),shouldEarn:()=>ge.level.value>=3})),F(()=>({display:{requirement:"Snowball Level 4",effectDisplay:"Plastic gain is boosted by heavy extractors"},visibility:()=>h(M[2].earned.value&&U.day.value>=13),shouldEarn:()=>ge.level.value>=4})),F(()=>({display:{requirement:"Snowball Level 5",effectDisplay:"Raise Industrial Crucible's effect to the 1.1"},visibility:()=>h(M[3].earned.value&&U.day.value>=13),shouldEarn:()=>ge.level.value>=5}))],E=[F(()=>({display:{requirement:"Star Level 1",effectDisplay:"Book cost is divided by total books bought."},shouldEarn:()=>De.level.value>=1})),F(()=>({display:{requirement:"Star Level 2",effectDisplay:"Pulp requires 10x less ash"},visibility:()=>h(E[0].earned.value),shouldEarn:()=>De.level.value>=2})),F(()=>({display:{requirement:"Star Level 3",effectDisplay:"Book cost scaling 5x -> 4x"},visibility:()=>h(E[1].earned.value),shouldEarn:()=>De.level.value>=3})),F(()=>({display:{requirement:"Star Level 4",effectDisplay:_(()=>n(S,null,[s("Multiply XP requirements by 0.95"),n("sup",null,[s("(total books)")])]))},visibility:()=>h(E[2].earned.value&&U.day.value>=13),shouldEarn:()=>De.level.value>=4})),F(()=>({display:{requirement:"Star Level 5",effectDisplay:"Gain 5 free books for all elves that are at level 5 or above."},visibility:()=>h(E[3].earned.value&&U.day.value>=13),shouldEarn:()=>De.level.value>=5}))],P=[F(()=>({display:{requirement:"Bell Level 1",effectDisplay:_(()=>n(S,null,[s("Every box buyable adds "),n(Cl,null,{default:()=>[s("level")]}),s(" levels to same-row box buyables.")]))},shouldEarn:()=>Le.level.value>=1})),F(()=>({display:{requirement:"Bell Level 2",effectDisplay:"Box gain ^1.1"},visibility:()=>h(P[0].earned.value),shouldEarn:()=>Le.level.value>=2})),F(()=>({display:{requirement:"Bell Level 3",effectDisplay:"All box buyables scaling bases -1"},visibility:()=>h(P[1].earned.value),shouldEarn:()=>Le.level.value>=3})),F(()=>({display:{requirement:"Bell Level 4",effectDisplay:"Unlock a second row of box buyables"},visibility:()=>h(P[2].earned.value&&U.day.value>=13),shouldEarn:()=>Le.level.value>=4})),F(()=>({display:{requirement:"Bell Level 5",effectDisplay:"Unlock another row of box upgrades"},visibility:()=>h(P[3].earned.value&&U.day.value>=13),shouldEarn:()=>Le.level.value>=5}))],Z=[F(()=>({display:{requirement:"Gingersnap Level 1",effectDisplay:"Multiply all primary dye colors by ln(cloth + e)."},shouldEarn:()=>ve.level.value>=1})),F(()=>({display:{requirement:"Gingersnap Level 2",effectDisplay:_(()=>n(S,null,[s("Multiply all cloth actions' effectiveness by log"),n("sub",null,[s("10")]),s("(dye sum + 10)")]))},visibility:()=>h(Z[0].earned.value),shouldEarn:()=>ve.level.value>=2})),F(()=>({display:{requirement:"Gingersnap Level 3",effectDisplay:"Double all dye colors and cloth actions, but reset all dyes."},visibility:()=>h(Z[1].earned.value),shouldEarn:()=>ve.level.value>=3,onComplete(){["red","yellow","blue","orange","green","purple"].forEach(Q=>{We.dyes[Q].amount.value=0,We.dyes[Q].buyable.amount.value=0})}})),F(()=>({display:{requirement:"Gingersnap Level 4",effectDisplay:_(()=>n(S,null,[s("Multiply ALL dye gain by")," ",n(nr,null,{default:()=>[n("div",null,[n(Cl,null,{default:()=>[s("classrooms")]})]),n("div",null,[s("2")])]}),s("+1, but reset all dyes.")]))},visibility:()=>h(Z[2].earned.value&&U.day.value>=13),shouldEarn:()=>ve.level.value>=4,onComplete(){["red","yellow","blue","orange","green","purple"].forEach(Q=>{We.dyes[Q].amount.value=0,We.dyes[Q].buyable.amount.value=0})}})),F(()=>({display:{requirement:"Gingersnap Level 5",effectDisplay:"Well depth divides metal machine costs"},visibility:()=>h(Z[3].earned.value&&U.day.value>=13),shouldEarn:()=>ve.level.value>=5}))],X=xe("Holly"),$=_(()=>{const Q=Object.values(te).find($e=>$e.name===X.value);return Q==null?(console.warn("This should not happen.",X.value),""):n(S,null,[X.value,s("'s milestones: "),Q.displayMilestone()])}),z=p(Re.elves.cuttersElf,b),oe=p(Re.elves.plantersElf,w),Be=p(Re.elves.expandersElf,k),he=[z,oe,Be],ae=p(Re.elves.heatedCuttersElf,v),se=p(Re.elves.heatedPlantersElf,x),Ne=p(Re.elves.fertilizerElf,D),Ie=[ae,se,Ne],Se=p(Re.elves.smallFireElf,N),Ue=p(Re.elves.bonfireElf,J),ge=p(Re.elves.kilnElf,M),Oe=[Se,Ue,ge],De=p(Re.elves.paperElf,E),Le=p(Re.elves.boxElf,P),ve=p(Re.elves.clothElf,Z),tt=[De,Le,ve],te={cutterElfTraining:z,planterElfTraining:oe,expandersElfTraining:Be,heatedCutterElfTraining:ae,heatedPlanterElfTraining:se,fertilizerElfTraining:Ne,smallfireElfTraining:Se,bonfireElfTraining:Ue,kilnElfTraining:ge,paperElfTraining:De,boxElfTraining:Le,clothElfTraining:ve},rt=[z,oe,Be,ae,se,Ne,Se,Ue,ge,De,Le,ve],ze=[z,oe,Be,ae,se,Ne,Se,Ue,ge,De,Le,ve];lt.on("update",Q=>{if(!(U.day.value<ql)){for(const $e of Object.values(te)){const at=Math.floor($e.amountOfTimesDone.value);at>=1&&($e.amountOfTimesDone.value-=at,a.lt($e.level.value,Me.amount.value)&&($e.exp.value=a.mul($e.elfXPGainComputed.value,at).add($e.exp.value)))}Ze.value=Math.max(Ze.value-Q,0),Qe.value=Math.max(Qe.value-Q,0),a.eq(Ze.value,0)&&(re.value={},Je.value=a.pow(Ke.value,1-Math.abs(Math.sin(Date.now()/1e3*2))))}});const Je=xe(1),re=xe({}),Qe=xe(0),Ze=xe(0),xt=K(()=>[g(()=>({multiplier:2,description:"Focus Upgrade 1",enabled:V.bought}))]),ut=K(()=>[ne(()=>({addend:1,description:"Focus Upgrade 2",enabled:be.bought}))]),pt=K(()=>[ne(()=>({addend:-5,description:"Focus Upgrade 3",enabled:Ut.bought}))]),Ke=f(()=>xt.apply(10)),Ge=f(()=>ut.apply(3)),St=f(()=>pt.apply(15)),Bt=tl(()=>({direction:Fe.Right,width:566,height:25,style:"border-radius: 4px 4px 0 0",borderStyle:"border-radius: 4px 4px 0 0",fillStyle:()=>({background:Ze.value>0?t:"#7f7f00",opacity:Ze.value>0?Ze.value/10:1,transition:"none"}),progress:()=>a.sub(Je.value,1).div(a.sub(Ke.value,1)).toNumber(),display:_(()=>n(S,null,[H(Je.value),s("x"),Ze.value>0?n(S,null,[" ",s("to "),Object.keys(re.value).join(", "),s(" for")," ",Vl(Ze.value)]):""]))})),Tt=Lt(()=>({display:{title:"Focus",description:_(()=>n(S,null,[s("Motivate elves to focus, multiplying 3 random elves' XP gain by up to")," ",H(Ke.value),s("x for 10 seconds, equal to the focus bar's effect."),a.gte(Qe.value,0)?n(S,null,[n("br",null,null),s("Reroll cooldown: "),Vl(Qe.value)]):""]))},style:{width:"300px"},canClick:()=>a.eq(Qe.value,0),onClick(){Qe.value=a.fromValue(St.value).toNumber(),Ze.value=10,de(12,Ge.value)}}));function de(Q,$e){var Gt,jt;let at=0;re.value={};const Ft=a.min($e,Q);for(;Ft.gt(at);){const B=(jt=(Gt=Object.values(te)[Math.floor(Math.random()*Q)])==null?void 0:Gt.name)!=null?jt:"";re.value[B]||(re.value[B]=!0,at++)}}const V=L(()=>({display:{title:"Focus Booster",description:"Multiplies the maximum experience multiplier from focus by 2"},resource:ue.logs,cost:1e25})),be=L(()=>({display:{title:"Focus Buffer",description:"Increase elves affected by focus by 1"},resource:ue.logs,cost:1e30})),Ut=L(()=>({display:{title:"Focus Upgrader",description:"Focus can now be rerolled every 10 seconds"},resource:ue.logs,cost:1e35})),Kt=[V,be,Ut],Ae=f(()=>{const Q=a.pow(10,Me.amount.value),$e=a.pow(5,Me.amount.value),at=a.pow(2e4,a.pow(Me.amount.value,.75)),Ft=a.pow(2e3,Me.amount.value);return{wood:at.mul(1e21),coal:Ft.mul(1e32),paper:Ft.mul(1e18),boxes:at.mul(1e13),metalIngots:$e.mul(1e12),cloth:Q.mul(1e4),plastic:$e.mul(1e6),dye:a.add(Me.amount.value,1).mul(1e4)}}),Me=qe(()=>({display:_(()=>n(S,null,[n("h3",null,[s("Build a School")]),n("div",null,[s("You gotta start somewhere, right? Each school increases the maximum level for elves by 1, up to 5.")]),n("div",null,[s("You have "),le(Me.amount.value),s(" schools, which are currently letting elves learn up to level "),le(Me.amount.value),s(".")]),n("div",null,[s("Costs "),H(Ae.value.wood),s(" logs, "),H(Ae.value.coal)," ",s("coal, "),H(Ae.value.paper),s(" paper, "),H(Ae.value.boxes)," ",s("boxes, "),H(Ae.value.metalIngots),s(" metal ingots,")," ",H(Ae.value.cloth),s(" cloth, "),H(Ae.value.plastic)," ",s("plastic, and requires "),H(Ae.value.dye),s(" of red, yellow, and blue dye")])])),canPurchase(){return a.gte(Me.amount.value,3)&&!U.days[pl-1].opened.value?!1:Ae.value.wood.lte(ue.logs.value)&&Ae.value.coal.lte(q.coal.value)&&Ae.value.paper.lte(W.paper.value)&&Ae.value.boxes.lte(st.boxes.value)&&Ae.value.metalIngots.lte(it.metal.value)&&Ae.value.cloth.lte(yt.cloth.value)&&Ae.value.plastic.lte(et.plastic.value)&&Ae.value.dye.lte(We.dyes.blue.amount.value)&&Ae.value.dye.lte(We.dyes.red.amount.value)&&Ae.value.dye.lte(We.dyes.yellow.amount.value)},onPurchase(){ue.logs.value=a.sub(ue.logs.value,Ae.value.wood),q.coal.value=a.sub(q.coal.value,Ae.value.coal),W.paper.value=a.sub(W.paper.value,Ae.value.paper),st.boxes.value=a.sub(st.boxes.value,Ae.value.boxes),it.metal.value=a.sub(it.metal.value,Ae.value.metalIngots),yt.cloth.value=a.sub(yt.cloth.value,Ae.value.cloth),et.plastic.value=a.sub(et.plastic.value,Ae.value.plastic),this.amount.value=a.add(this.amount.value,1)},purchaseLimit:5,visibility:f(()=>h(r.bought.value)),style:"width: 600px"})),mt=f(()=>{const Q=a.add(dt.amount.value,1).pow(1.5);return{wood:Q.mul(1e21),paper:Q.mul(1e18),boxes:Q.mul(1e13),metalIngots:Q.mul(1e12)}}),Pt=f(()=>a.add(dt.amount.value,1).pow(.9)),dt=qe(()=>({display:_(()=>n(S,null,[n("h3",null,[s("Build a Classroom")]),n("div",null,[s("Hopefully it makes the school a bit less boring. Multiplies elves' XP gain by")," ",s("(Classrooms + 1)"),n("sup",null,[s("0.9")]),s(".")]),n("div",null,[s("You have "),le(dt.amount.value),s(" classrooms, which are currently multiplying elves' XP gain by "),H(Pt.value)]),n("div",null,[s("Costs "),H(mt.value.wood),s(" logs,"),H(mt.value.paper),s(" paper, "),H(mt.value.boxes)," ",s("boxes, "),H(mt.value.metalIngots),s(" metal ingots")])])),canPurchase(){return mt.value.wood.lte(ue.logs.value)&&mt.value.paper.lte(W.paper.value)&&mt.value.boxes.lte(st.boxes.value)&&mt.value.metalIngots.lte(it.metal.value)},onPurchase(){ue.logs.value=a.sub(ue.logs.value,mt.value.wood),W.paper.value=a.sub(W.paper.value,mt.value.paper),st.boxes.value=a.sub(st.boxes.value,mt.value.boxes),it.metal.value=a.sub(it.metal.value,mt.value.metalIngots),this.amount.value=a.add(this.amount.value,1)},visibility:f(()=>h(d.bought.value)),style:"width: 600px"})),[Rt,ul]=rl(()=>[{title:"Elves affected by Focus",modifier:ut,base:3},{title:"Maximum Focus Effect",modifier:xt,base:10},{title:"Focus Cooldown",modifier:pt,unit:" secs",base:15},{title:"Global XP Gain",modifier:c,unit:" XP"},{title:"Holly XP Gain per Action",modifier:z.elfXPGain,base:.1,unit:" XP"},{title:"Ivy XP Gain per Action",modifier:oe.elfXPGain,base:.1,unit:" XP"},{title:"Hope XP Gain per Action",modifier:Be.elfXPGain,base:.1,unit:" XP"},{title:"Jack XP Gain per Action",modifier:ae.elfXPGain,base:.1,unit:" XP"},{title:"Mary XP Gain per Action",modifier:se.elfXPGain,base:.1,unit:" XP"},{title:"Noel XP Gain per Action",modifier:Ne.elfXPGain,base:.1,unit:" XP"},{title:"Joy XP Gain per Action",modifier:Se.elfXPGain,base:.1,unit:" XP"},{title:"Faith XP Gain per Action",modifier:Ue.elfXPGain,base:.1,unit:" XP"},{title:"Snowball XP Gain per Action",modifier:ge.elfXPGain,base:.1,unit:" XP"},{title:"Star XP Gain per Action",modifier:De.elfXPGain,base:.1,unit:" XP"},{title:"Bell XP Gain per Action",modifier:Le.elfXPGain,base:.1,unit:" XP"},{title:"Gingersnap XP Gain per Action",modifier:ve.elfXPGain,base:.1,unit:" XP"}]),dl=j(!1),ie=_(()=>n(_t,{modelValue:dl.value,"onUpdate:modelValue":Q=>dl.value=Q},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:Rt}));return Qt(()=>{(U.day.value===ql&&rt.every(Q=>Q.level.value>=3)||U.day.value===pl&&ze.every(Q=>Q.level.value>=5))&&U.completeDay()}),{name:e,day:ql,color:t,minWidth:700,elfTraining:te,totalElfLevels:i,totalElfExp:o,currentShown:X,generalTabCollapsed:ul,teaching:r,schools:Me,classrooms:dt,classroomUpgrade:d,focusMultiplier:Je,upgrades:Kt,focusTargets:re,focusCooldown:Qe,focusTime:Ze,display:_(()=>n(S,null,[U.day.value===ql?"Get all elves to level 3.":U.day.value===pl&&U.days[pl-1].opened.value?"Get all elves to level 5.":`${e} Complete!`," ",s("-"),n("button",{class:"button",style:"display: inline-block;",onClick:()=>dl.value=!0},[s("Check Modifiers")]),me(ie),me(l),n("br",null,null),el(Me,dt),Ml([r,d]),n(Ee,null,null),a.gt(Me.amount.value,0)?n(S,null,[n("br",null,null),s("Click on an elf to see their milestones."),n("br",null,null),n("br",null,null),me(Tt),Ml(Kt),n("br",null,null),Ml([Bt],he,Ie,Oe,tt),n(Ee,null,null),$()]):""]))}}),_r="cloth",ui=8,yt=Ht(_r,function(){const e="Cloth",t="white",l=kt(0,"cloth"),i=kt(0,"wool"),o=kt(10,"sheep"),r=xe(0),d=tl(()=>({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:()=>a.div(r.value,te.value)})),c=Lt(()=>({display:{title:"Breed sheep",description:_(()=>n(S,null,[s("Breed "),Ce(a.floor(ve.value)),s(" sheep"),n("br",null,null),me(d)]))},style:{minHeight:"80px"},canClick:()=>a.gte(r.value,te.value),onClick(){if(a.lt(r.value,te.value))return;const de=a.floor(ve.value);o.value=a.add(o.value,de),r.value=0}})),m=xe(0),p=tl(()=>({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:()=>a.div(m.value,re.value)})),b=Lt(()=>({display:{title:"Shear sheep",description:_(()=>n(S,null,[s("Shear up to "),Ce(a.floor(ze.value)),s(" sheep"),n("br",null,null),me(p)]))},style:{minHeight:"80px"},canClick:()=>a.gte(m.value,re.value),onClick(){if(a.lt(m.value,re.value))return;const de=a.min(o.value,ze.value).floor();i.value=a.add(i.value,de),m.value=0}})),w=xe(0),k=tl(()=>({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:()=>a.div(w.value,ut.value)})),v=Lt(()=>({display:{title:"Spinning wool",description:_(()=>n(S,null,[s("Spin "),Ce(a.floor(Ze.value)),s(" wool"),n("br",null,null),me(k)]))},style:{minHeight:"80px"},canClick:()=>a.gte(w.value,ut.value),onClick(){if(a.lt(w.value,ut.value))return;const de=a.min(i.value,Ze.value).floor();l.value=a.add(l.value,de),i.value=a.sub(i.value,de),w.value=0}})),x=Hl(()=>({key:"b",description:'Press the "Breed Sheep" button',onPress:()=>{c.canClick.value&&c.onClick()}})),D=Hl(()=>({key:"h",description:'Press the "Shear Sheep" button',onPress:()=>{b.canClick.value&&b.onClick()}})),N=Hl(()=>({key:"s",description:'Press the "Spin Wool" button',onPress:()=>{v.canClick.value&&v.onClick()}})),J=qe(()=>({resource:ue.logs,cost(){let de=this.amount.value;return a.gte(de,100)&&(de=a.pow(de,2).div(100)),de=a.pow(.95,W.books.clothBook.amount.value).times(de),a.pow(1.5,de).times(1e14)},display:{title:"Build more pens",description:"Breed +1 sheep at once"}})),M=qe(()=>({resource:it.metal,cost(){let de=this.amount.value;return a.gte(de,100)&&(de=a.pow(de,2).div(100)),de=a.pow(.95,W.books.clothBook.amount.value).times(de),a.pow(1.4,de).times(1e4)},display:{title:"Make stronger shears",description:"Shear +1 sheep at once"}})),E=qe(()=>({resource:W.paper,cost(){let de=this.amount.value;return a.gte(de,100)&&(de=a.pow(de,2).div(100)),de=a.pow(.95,W.books.clothBook.amount.value).times(de),a.pow(1.3,de).times(1e6)},display:{title:"Learn how to spin",description:"Spin +1 wool at once"}})),P=L(()=>({resource:O(l),cost:100,display:{title:"Lumberjack Boots",description:"Quadruple log gain"}})),Z=L(()=>({resource:O(i),cost:150,visibility:()=>h(P.bought.value),display:{title:"Lumberjack Jeans",description:"Quadruple trees cut"}})),X=L(()=>({resource:O(o),cost:200,visibility:()=>h(Z.bought.value),display:{title:"Lumberjack Plaid",description:"Quadruple trees planted"}})),z={treesUpgrade4:L(()=>({resource:O(l),cost:1e3,visibility:()=>h(et.upgrades.clothTools.bought.value),display:{title:"Felt-Gripped Axe",description:"10x log gain"}})),treesUpgrade3:X,treesUpgrade2:Z,treesUpgrade1:P},oe=L(()=>({resource:O(l),cost:150,display:{title:"Mining boots",description:"Quadruple ash gain"}})),Be=L(()=>({resource:O(i),cost:225,visibility:()=>h(oe.bought.value),display:{title:"Mining overalls",description:"Double coal gain"}})),he=L(()=>({resource:O(o),cost:300,visibility:()=>h(Be.bought.value),display:{title:"Mining helmet",description:"Triple coal gain"}})),se={metalUpgrade4:L(()=>({resource:O(l),cost:2e3,visibility:()=>h(et.upgrades.clothTools.bought.value),display:{title:"Felt-Gripped Pick",description:"Quadruple coal gain"}})),metalUpgrade3:he,metalUpgrade2:Be,metalUpgrade1:oe},Ne=L(()=>({resource:O(l),cost:200,display:{title:"Scholar's shoes",description:"Double paper gain"}})),Ie=L(()=>({resource:O(i),cost:200,visibility:()=>h(Ne.bought.value),display:{title:"Scholar's slacks",description:"Double paper gain"}})),Se=L(()=>({resource:O(o),cost:400,visibility:()=>h(Ie.bought.value),display:{title:"Scholar's jacket",description:"Double paper gain"}})),ge={paperUpgrade4:L(()=>({resource:O(l),cost:4e3,visibility:()=>h(et.upgrades.clothTools.bought.value),display:{title:"Felt Elbow Pads",description:"10x paper gain"}})),paperUpgrade3:Se,paperUpgrade2:Ie,paperUpgrade1:Ne},Oe=f(()=>a.add(ue.computedAutoCuttingAmount.value,1).root(9)),De=f(()=>a.add(We.dyeSum.value,10).log10()),Le=K(()=>[ne(()=>({addend:J.amount,description:"Build more pens"})),g(()=>({multiplier:()=>a.div(et.buyables.clothGains.amount.value,10).add(1),description:"Plastic Shepherd",enabled:()=>a.gte(et.buyables.clothGains.amount.value,1)})),g(()=>({multiplier:2,description:"Shepherding for Dummies",enabled:W.upgrades.clothUpgrade.bought})),g(()=>({multiplier:De,description:"Gingersnap Level 2",enabled:R.elfTraining.clothElfTraining.milestones[1].earned})),g(()=>({multiplier:Oe,description:"Holly Level 3",enabled:R.elfTraining.cutterElfTraining.milestones[2].earned})),g(()=>({multiplier:2,description:"1000% Foundation Completed",enabled:Ye.milestones.extraExpansionMilestone5.earned}))]),ve=f(()=>Le.apply(1)),tt=K(()=>[]),te=f(()=>tt.apply(1)),rt=K(()=>[ne(()=>({addend:M.amount,description:"Make stronger shears"})),g(()=>({multiplier:()=>a.div(et.buyables.clothGains.amount.value,10).add(1),description:"Plastic Shepherd",enabled:()=>a.gte(et.buyables.clothGains.amount.value,1)})),g(()=>({multiplier:2,description:"Shepherding for Dummies",enabled:W.upgrades.clothUpgrade.bought})),g(()=>({multiplier:De,description:"Gingersnap Level 2",enabled:R.elfTraining.clothElfTraining.milestones[1].earned})),g(()=>({multiplier:Oe,description:"Holly Level 3",enabled:R.elfTraining.cutterElfTraining.milestones[2].earned})),g(()=>({multiplier:2,description:"1000% Foundation Completed",enabled:Ye.milestones.extraExpansionMilestone5.earned}))]),ze=f(()=>rt.apply(1)),Je=K(()=>[]),re=f(()=>Je.apply(1)),Qe=K(()=>[ne(()=>({addend:E.amount,description:"Learn how to spin"})),g(()=>({multiplier:()=>a.div(et.buyables.clothGains.amount.value,10).add(1),description:"Plastic Shepherd",enabled:()=>a.gte(et.buyables.clothGains.amount.value,1)})),g(()=>({multiplier:2,description:"Shepherding for Dummies",enabled:W.upgrades.clothUpgrade.bought})),g(()=>({multiplier:De,description:"Gingersnap Level 2",enabled:R.elfTraining.clothElfTraining.milestones[1].earned})),g(()=>({multiplier:Oe,description:"Holly Level 3",enabled:R.elfTraining.cutterElfTraining.milestones[2].earned})),g(()=>({multiplier:2,description:"1000% Foundation Completed",enabled:Ye.milestones.extraExpansionMilestone5.earned}))]),Ze=f(()=>Qe.apply(1)),xt=K(()=>[]),ut=f(()=>xt.apply(1)),[pt,Ke]=rl(()=>[{title:"Sheep Gain",modifier:Le,base:1},{title:"Sheep Breeding Cooldown",modifier:tt,base:1,visible:!1,unit:"s"},{title:"Shearing Amount",modifier:rt,base:1},{title:"Shearing Cooldown",modifier:Je,base:1,visible:!1,unit:"s"},{title:"Spinning Amount",modifier:Qe,base:1},{title:"Spinning Cooldown",modifier:xt,base:1,visible:!1,unit:"s"}]),Ge=j(!1),St=_(()=>n(_t,{modelValue:Ge.value,"onUpdate:modelValue":de=>Ge.value=de},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:pt}));lt.on("update",de=>{a.lt(U.day.value,ui)||(a.gte(r.value,te.value)?r.value=te.value:(r.value=a.add(r.value,de),c.isHolding.value&&c.onClick()),a.gte(m.value,re.value)?m.value=re.value:(m.value=a.add(m.value,de),b.isHolding.value&&b.onClick()),a.gte(w.value,ut.value)?w.value=ut.value:(w.value=a.add(w.value,de),v.isHolding.value&&v.onClick()))});const{total:Bt,trackerDisplay:Tt}=hl({resource:l,goal:1e3,name:e,day:ui,color:t,textColor:"var(--feature-foreground)",modal:{show:Ge,display:St}});return{name:e,color:t,cloth:l,totalCloth:Bt,wool:i,sheep:o,buildPens:J,betterShears:M,fasterSpinning:E,treesUpgrades:z,metalUpgrades:se,paperUpgrades:ge,generalTabCollapsed:Ke,breedingProgress:r,shearingProgress:m,spinningProgress:w,breedSheepHK:x,shearSheepHK:D,spinWoolHK:N,minWidth:700,display:_(()=>n(S,null,[me(Tt),n(Ee,null,null),n(qt,{resource:l,style:"margin-bottom: 0"},null),n(qt,{resource:i,style:"margin-bottom: 0"},null),n(qt,{resource:o,style:"margin-bottom: 0"},null),nt(c,b,v),nt(J,M,E),n(Ee,null,null),n(jl,null,{default:()=>[el(...Object.values(z)),el(...Object.values(se)),el(...Object.values(ge))]})])),minimizedDisplay:_(()=>n("div",null,[e,s(" - "),H(l.value),s(" "),l.displayName]))}}),Sr="dyes",Mr=11,We=Ht(Sr,function(){const e="Dyes",t="#D4D4F4";function l(v){const x=kt(0,v.name),D=K(()=>{const M=[ne(()=>({addend:()=>a.add(J.amount.value,1),description:`${v.name} Chambers`}))];return(v.color==="red"||v.color==="yellow")&&M.push(g(()=>({multiplier:o.orange1,description:"Orange Dye Boost 1"}))),(v.color=="yellow"||v.color=="blue")&&M.push(g(()=>({multiplier:o.green1,description:"Green Dye Boost 1"}))),(v.color=="red"||v.color=="blue")&&M.push(g(()=>({multiplier:o.purple1,description:"Purple Dye Boost 1"}))),(v.color=="red"||v.color=="yellow"||v.color=="blue")&&(M.push(g(()=>({multiplier:2,description:"Wetter Dyes",enabled:c.yellowDyeUpg.bought}))),M.push(g(()=>({multiplier:()=>a.add(yt.cloth.value,Math.E).ln(),description:"Gingersnap Level 1",enabled:R.elfTraining.clothElfTraining.milestones[0].earned})))),M.push(g(()=>({multiplier:2,description:"Gingersnap Level 3",enabled:R.elfTraining.clothElfTraining.milestones[2].earned}))),M}),N=f(()=>D.apply(0)),J=qe(()=>{const M=Et(v.costs);return{...v,style:()=>({backgroundColor:u(J.canPurchase)?t:"#545454",minWidth:"200px"}),display:_(()=>n("span",null,[n("h3",null,[v.name,s(" Chambers")]),n("br",null,null),s("Create "),H(N.value),s(" "),v.name,v.dyesToReset.length>0?", but reset "+v.dyesToReset.map(E=>E.name).join(", "):"",s("."),n("br",null,null),n("br",null,null),n("span",{class:"white-space: pre-wrap"},[s("Currently:")," ",v.listedBoosts.filter(E=>u(E.visible)).map(E=>me(_(()=>n("div",null,[u(E.desc)]))))]),n("br",null,null),n("div",null,[s("Cost:")," ",u(M).map(E=>me(_(()=>{var P,Z;return n("div",null,[H(u(a.pow((P=u(J.cost))!=null?P:a.dInf,u((Z=E.root)!=null?Z:1)).times(u(E.base))))," ",E.res.displayName,n("br",null,null)])})))])])),cost(){let E=J.amount.value;return a.gte(E,25)&&(E=a.pow(E,2).div(20)),a.gte(E,10)&&(E=a.pow(E,2).div(5)),a.div(E,10).plus(1)},canPurchase:f(E=>{var Z;if(u(J.visibility)!=Ct.Visible)return!1;const P=(Z=E!=null?E:u(J.cost))!=null?Z:a.dInf;return u(M).every(X=>{var $;return a.div(X.res.value,u(X.base)).root(u(($=X.root)!=null?$:1)).gte(P)})}),onPurchase(E){var Z;const P=(Z=E!=null?E:u(J.cost))!=null?Z:a.dInf;u(M).forEach(X=>{var $;X.res.value=a.sub(X.res.value,a.pow(P,u(($=X.root)!=null?$:1)).times(u(X.base)))}),x.value=a.add(x.value,N.value),J.amount.value=a.add(J.amount.value,1),v.dyesToReset.forEach(X=>X.reset())}}});return{name:v.name,amount:x,buyable:J,toGenerate:D,computedToGenerate:N,display:_(()=>n(qt,{resource:x,color:v.color,style:"margin: 0; width: 200px; width: 180px; padding: 10px;",sticky:!1},null))}}const i={red:l({name:"Red Dye",color:"red",costs:()=>[{base:"2e18",root:5,res:ue.logs},{base:f(()=>c.yellowDyeUpg2.bought.value?"2.5e5":"5e5"),root:2,res:ce.oil}],listedBoosts:[{visible:!0,desc:f(()=>`+${H(o.red1.value)} effective Oil Pumps (does not impact coal consumption)`)}],dyesToReset:[]}),yellow:l({name:"Yellow Dye",color:"yellow",costs:()=>[{base:"1e18",root:5,res:ue.logs},{base:f(()=>c.yellowDyeUpg2.bought.value?"5e5":"1e6"),root:2,res:ce.oil}],listedBoosts:[{visible:!0,desc:f(()=>`x${H(o.yellow1.value)} Paper & Plastic gain`)}],dyesToReset:[]}),blue:l({name:"Blue Dye",color:"blue",costs:()=>[{base:"5e17",root:5,res:ue.logs},{base:f(()=>c.yellowDyeUpg2.bought.value?"1e6":"2e6"),root:2,res:ce.oil}],listedBoosts:[{visible:!0,desc:f(()=>`+${le(o.blue1.value)} forest size (after all other modifiers).`)}],dyesToReset:[]}),orange:l({name:"Orange Dye",color:"orange",costs:()=>[{base:15,root:2,res:i.red.amount},{base:10,root:2,res:i.yellow.amount}],listedBoosts:[{visible:!0,desc:f(()=>`x${H(o.orange1.value)} Red and Yellow Dye gain`)},{visible:!0,desc:f(()=>`/${H(o.orange2.value)} Box buyable costs.`)}],dyesToReset:[{name:"Red Dye",reset(){i.red.amount.value=0,i.red.buyable.amount.value=0}},{name:"Yellow Dye",reset(){i.yellow.amount.value=0,i.yellow.buyable.amount.value=0}}]}),green:l({name:"Green Dye",color:"green",costs:()=>[{base:15,root:2,res:i.yellow.amount},{base:10,root:2,res:i.blue.amount}],listedBoosts:[{visible:!0,desc:f(()=>`x${H(o.green1.value)} Yellow and Blue Dye gain`)},{visible:!0,desc:f(()=>`+${le(a.sub(o.green2.value,1).times(100))}% Kiln synergy effect.`)}],dyesToReset:[{name:"Yellow Dye",reset(){i.yellow.amount.value=0,i.yellow.buyable.amount.value=0}},{name:"Blue Dye",reset(){i.blue.amount.value=0,i.blue.buyable.amount.value=0}}]}),purple:l({name:"Purple Dye",color:"purple",costs:()=>[{base:15,root:2,res:i.blue.amount},{base:10,root:2,res:i.red.amount}],listedBoosts:[{visible:!0,desc:f(()=>`x${H(o.purple1.value)} Red and Blue Dye gain`)},{visible:!0,desc:f(()=>`x${H(o.purple2.value)} Smelting Speed and Ore Purity`)}],dyesToReset:[{name:"Blue Dye",reset(){i.blue.amount.value=0,i.blue.buyable.amount.value=0}},{name:"Red Dye",reset(){i.red.amount.value=0,i.red.buyable.amount.value=0}}]})},o={red1:f(()=>a.pow(a.add(i.red.amount.value,1).log2().plus(1).log2().div(2),c.blueDyeUpg2.bought.value?1.5:1)),yellow1:f(()=>a.add(i.yellow.amount.value,1).log2().plus(1)),blue1:f(()=>a.add(i.blue.amount.value,1).log2().sqrt().times(5e6)),orange1:f(()=>a.pow(2,a.add(i.orange.amount.value,1).log2().sqrt()).pow(c.coalUpg.bought.value?1.2:1)),orange2:f(()=>a.add(i.orange.amount.value,1).log2().plus(1)),green1:f(()=>a.pow(2,a.add(i.green.amount.value,1).log2().sqrt()).pow(c.coalUpg.bought.value?1.2:1)),green2:f(()=>a.add(i.green.amount.value,1).log2().plus(1).pow(c.coalUpg.bought.value?2:1)),purple1:f(()=>a.pow(2,a.add(i.purple.amount.value,1).log2().sqrt()).pow(c.coalUpg.bought.value?1.2:1)),purple2:f(()=>a.add(i.purple.amount.value,1).log2().plus(1))},[r,d]=rl(()=>[{title:"Red Dye Creation",modifier:i.red.toGenerate,base:0},{title:"Yellow Dye Creation",modifier:i.yellow.toGenerate,base:0},{title:"Blue Dye Creation",modifier:i.blue.toGenerate,base:0},{title:"Orange Dye Creation",modifier:i.orange.toGenerate,base:0},{title:"Green Dye Creation",modifier:i.green.toGenerate,base:0},{title:"Purple Dye Creation",modifier:i.purple.toGenerate,base:0}]),c={blueDyeUpg:L(()=>({visibility:()=>h(a.add(i.orange.amount.value,i.green.amount.value).add(i.purple.amount.value).gte(1)||c.blueDyeUpg.bought.value),display:{title:"Is Blue Dye just Water?",description:_(()=>n(S,null,[s("Multiply Log gain by log"),n("sub",null,[s("10")]),s("(Auto Cutting Amount)+1.")]))},cost:1e3,resource:O(i.blue.amount),onPurchase(){i.blue.amount.value=0,i.blue.buyable.amount.value=0}})),redDyeUpg:L(()=>({visibility:()=>h(a.add(i.orange.amount.value,i.green.amount.value).add(i.purple.amount.value).gte(10)||c.redDyeUpg.bought.value),display:{title:"Glistening Paint",description:_(()=>n(S,null,[s("Multiply Ore Purity by log"),n("sub",null,[s("10")]),s("(Cloth)+1.")]))},cost:1500,resource:O(i.red.amount),onPurchase(){i.red.amount.value=0,i.red.buyable.amount.value=0}})),yellowDyeUpg:L(()=>({visibility:()=>h(a.add(i.orange.amount.value,i.green.amount.value).add(i.purple.amount.value).gte(100)||c.yellowDyeUpg.bought.value),display:{title:"Wetter Dyes",description:"Double Red, Yellow, and Blue Dye gain, but reset their amounts."},cost:2e3,resource:O(i.yellow.amount),onPurchase(){i.red.amount.value=0,i.red.buyable.amount.value=0,i.yellow.amount.value=0,i.yellow.buyable.amount.value=0,i.blue.amount.value=0,i.blue.buyable.amount.value=0}})),yellowDyeUpg2:L(()=>({visibility:()=>h(c.yellowDyeUpg.bought.value),display:{title:"Golden Wash",description:"Halve the Oil cost of Red, Yellow, and Blue Dyes."},cost:5e3,resource:O(i.yellow.amount),onPurchase(){i.yellow.amount.value=0,i.yellow.buyable.amount.value=0}})),redDyeUpg2:L(()=>({visibility:()=>h(c.redDyeUpg.bought.value),display:{title:"De Louvre",description:_(()=>n(S,null,[s("Multiply Smelting Speed by "),n(Cl,null,{default:()=>[s("Refineries+1")]}),s(".")]))},cost:6e3,resource:O(i.red.amount),onPurchase(){i.red.amount.value=0,i.red.buyable.amount.value=0}})),blueDyeUpg2:L(()=>({visibility:()=>h(c.blueDyeUpg.bought.value),display:{title:"Hydrophobia",description:"Raise Red Dye's effect ^1.5."},cost:7500,resource:O(i.blue.amount),onPurchase(){i.blue.amount.value=0,i.blue.buyable.amount.value=0}})),coalUpg:L(()=>({visibility:()=>h(c.blueDyeUpg2.bought.value&&c.redDyeUpg2.bought.value&&c.yellowDyeUpg2.bought.value),display:{title:"Denser Spectrum",description:"Orange, Green, and Purple Dyes' first effect is raised ^1.2, and Green Dye's second effect is squared. Buying this resets Red, Yellow, and Blue Dyes."},cost:"5e30",resource:q.coal,onPurchase(){i.red.amount.value=0,i.red.buyable.amount.value=0,i.yellow.amount.value=0,i.yellow.buyable.amount.value=0,i.blue.amount.value=0,i.blue.buyable.amount.value=0}}))},m=j(!1),p=_(()=>n(_t,{modelValue:m.value,"onUpdate:modelValue":v=>m.value=v},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:r})),b=kt(f(()=>Object.values(i).reduce((v,x)=>a.add(v,x.amount.value),0)),"Sum of Dyes"),{total:w,trackerDisplay:k}=hl({resource:b,goal:6e4,name:e,day:Mr,color:t,textColor:"var(--feature-foreground)",modal:{show:m,display:p},ignoreTotal:!0});return{name:e,color:t,dyes:i,dyeSum:b,boosts:o,totalDyeSum:w,minWidth:700,generalTabCollapsed:d,upgrades:c,display:_(()=>n(S,null,[me(k),n(Ee,null,null),n("div",{style:"width: 620px"},[nt(i.red.display,i.yellow.display,i.blue.display),nt(i.red.buyable,i.yellow.buyable,i.blue.buyable),n(Ee,null,null),nt(i.orange.display,i.green.display,i.purple.display),nt(i.orange.buyable,i.green.buyable,i.purple.buyable)]),n(Ee,null,null),n("div",{class:"row",style:"vertical-align: top"},[el(c.redDyeUpg,c.redDyeUpg2),el(c.yellowDyeUpg,c.yellowDyeUpg2),el(c.blueDyeUpg,c.blueDyeUpg2)]),me(c.coalUpg)]))}}),xr="boxes",Da=6,st=Ht(xr,function(){const e="Boxes",t="#964B00",l=kt(0,"boxes"),i=K(()=>[g(()=>({multiplier:2,description:"1000% Foundation Completed",enabled:Ye.milestones.extraExpansionMilestone5.earned})),fl(()=>({exponent:1.1,description:"Bell Level 2",enabled:R.elfTraining.boxElfTraining.milestones[1].earned}))]),o=qi(()=>({scaling:Ha(1e10,1),baseResource:ue.logs,gainResource:O(l),roundUpCost:!0,gainModifier:i})),r=Lt(()=>({display:_(()=>n(S,null,[n("span",{style:"font-size: large"},[s("Create "),le(o.currentGain.value),s(" "),l.displayName]),n("br",null,null),n("span",{style:"font-size: large"},[s("Cost:")," ",oa(ue.logs,a.gte(o.actualGain.value,1)?o.currentAt.value:o.nextAt.value)," ",ue.logs.displayName])])),canClick:()=>a.gte(o.actualGain.value,1),onClick(){!u(this.canClick)||o.convert()},style:"width: 600px; min-height: unset"})),d=L(()=>({display:{title:"Carry logs in boxes",description:"Double log gain and unlock a new elf for training"},onPurchase(){U.days[3].recentlyUpdated.value=!0},resource:O(l),cost:100})),c=L(()=>({display:{title:"Carry ash in boxes",description:"Double ash gain and unlock a new elf for training"},onPurchase(){U.days[3].recentlyUpdated.value=!0},resource:O(l),cost:1e3})),m=L(()=>({display:{title:"Carry coal in boxes",description:"Double coal gain and unlock a new elf for training"},onPurchase(){U.days[3].recentlyUpdated.value=!0},resource:O(l),cost:4e3})),p={logsUpgrade:d,ashUpgrade:c,coalUpgrade:m},b=L(()=>({resource:O(l),cost:1e8,visibility:()=>h(et.upgrades.boxTools.bought.value),display:{title:"Carry ore in boxes",description:"Double ore per mining op"}})),w=L(()=>({resource:O(l),cost:1e9,visibility:()=>h(et.upgrades.boxTools.bought.value),display:{title:"Carry metal in boxes",description:"Double ore purity"}})),k=L(()=>({resource:O(l),cost:1e10,visibility:()=>h(et.upgrades.boxTools.bought.value),display:{title:"Carry plastic in boxes",description:"Double plastic gain"}})),v={oreUpgrade:b,metalUpgrade:w,plasticUpgrade:k},x=L(()=>({resource:O(l),cost:1e16,visibility:()=>h(R.elfTraining.boxElfTraining.milestones[4].earned.value),display:{title:"Carry cloth in boxes",description:"Double all cloth actions"}})),D=L(()=>({resource:O(l),cost:1e17,visibility:()=>h(R.elfTraining.boxElfTraining.milestones[4].earned.value),display:{title:"Carry dye in boxes",description:"Double all dye gain"}})),N=L(()=>({resource:O(l),cost:1e18,visibility:()=>h(R.elfTraining.boxElfTraining.milestones[4].earned.value),display:{title:"Carry experience in boxes???",description:"Double xp gain"}})),J={clothUpgrade:x,dyeUpgrade:D,xpUpgrade:N},M=qe(()=>({display:{title:"Carry more logs",description:_(()=>n(S,null,[s("Use boxes to carry even more logs, boosting their gain"),n("br",null,null),n("br",null,null),n("div",null,[s("Amount: "),le(M.amount.value),a.gt(M.freeLevels.value,0)?n(S,null,[s(" (+"),le(M.freeLevels.value),s(")")]):null])])),effectDisplay:_(()=>n(S,null,[H(a.div(M.totalAmount.value,2).add(1)),s("x")])),showAmount:!1},resource:O(l),cost(){let ae=this.amount.value;ae=a.pow(.95,W.books.boxBook.amount.value).times(ae);let se=3;return R.elfTraining.boxElfTraining.milestones[2].earned.value&&se--,a.pow(se,ae).times(100).div(We.boosts.orange2.value)},visibility:()=>h(d.bought.value),freeLevels:f(()=>R.elfTraining.boxElfTraining.milestones[0].earned.value?a.max(E.amount.value,1).sqrt().floor().add(a.max(P.amount.value,1).sqrt().floor()):0),totalAmount:f(()=>a.add(M.amount.value,M.freeLevels.value))})),E=qe(()=>({display:{title:"Carry more ash",description:_(()=>n(S,null,[s("Use boxes to carry even more ash, boosting its gain"),n("br",null,null),n("br",null,null),n("div",null,[s("Amount: "),le(E.amount.value),a.gt(E.freeLevels.value,0)?n(S,null,[s(" (+"),le(E.freeLevels.value),s(")")]):null])])),effectDisplay:_(()=>n(S,null,[H(a.div(E.totalAmount.value,2).add(1)),s("x")])),showAmount:!1},resource:O(l),cost(){let ae=this.amount.value;ae=a.pow(.95,W.books.boxBook.amount.value).times(ae);let se=5;return R.elfTraining.boxElfTraining.milestones[2].earned.value&&se--,a.pow(se,ae).times(1e3).div(We.boosts.orange2.value)},visibility:()=>h(c.bought.value),freeLevels:f(()=>R.elfTraining.boxElfTraining.milestones[0].earned.value?a.max(M.amount.value,1).sqrt().floor().add(a.max(P.amount.value,1).sqrt().floor()):0),totalAmount:f(()=>a.add(E.amount.value,E.freeLevels.value))})),P=qe(()=>({display:{title:"Carry more coal",description:_(()=>n(S,null,[s("Use boxes to carry even more coal, boosting its gain"),n("br",null,null),n("br",null,null),n("div",null,[s("Amount: "),le(P.amount.value),a.gt(P.freeLevels.value,0)?n(S,null,[s(" (+"),le(P.freeLevels.value),s(")")]):null])])),effectDisplay:_(()=>n(S,null,[H(a.div(P.totalAmount.value,2).add(1)),s("x")])),showAmount:!1},resource:O(l),cost(){let ae=this.amount.value;ae=a.pow(.95,W.books.boxBook.amount.value).times(ae);let se=7;return R.elfTraining.boxElfTraining.milestones[2].earned.value&&se--,a.pow(se,ae).times(1e3).div(We.boosts.orange2.value)},visibility:()=>h(m.bought.value),freeLevels:f(()=>R.elfTraining.boxElfTraining.milestones[0].earned.value?a.max(M.amount.value,1).sqrt().floor().add(a.max(E.amount.value,1).sqrt().floor()):0),totalAmount:f(()=>a.add(P.amount.value,P.freeLevels.value))})),Z={logBoxesBuyable:M,ashBoxesBuyable:E,coalBoxesBuyable:P};lt.on("update",ae=>{a.lt(U.day.value,Da)||(l.value=a.times(ae,et.buyables.passiveBoxes.amount.value).times(o.currentGain.value).div(100).add(l.value))});const[X,$]=rl(()=>[{title:"Boxes Gain",modifier:i,base:()=>o.scaling.currentGain(o)}]),z=j(!1),oe=_(()=>n(_t,{modelValue:z.value,"onUpdate:modelValue":ae=>z.value=ae},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:X})),{total:Be,trackerDisplay:he}=hl({resource:l,goal:5e4,name:e,day:Da,color:t,modal:{display:oe,show:z}});return{name:e,day:Da,color:t,boxes:l,totalBoxes:Be,boxesConversion:o,upgrades:p,row2Upgrades:v,row3Upgrades:J,buyables:Z,minWidth:700,generalTabCollapsed:$,display:_(()=>n(S,null,[me(he),n(Ee,null,null),n(qt,{resource:l,color:t,style:"margin-bottom: 0"},null),n(Ee,null,null),me(r),n(Ee,null,null),Ml(Object.values(p),Object.values(v),Object.values(J)),n(Ee,null,null),nt(...Object.values(Z))])),minimizedDisplay:_(()=>n("div",null,[e,s(" - "),H(l.value),s(" "),l.displayName]))}}),Br="trees",di=1,ci=.1,ue=Ht(Br,function(){const e="Trees",t="#4BDC13",l="green",i=kt(0,"logs"),o=kt(0,"saplings"),r=j(0),d=K(()=>[ne(()=>({addend:()=>a.times($.amount.value,10),description:"Expand Forest",enabled:E.bought})),ne(()=>({addend:()=>a.div(Ye.foundationProgress.value,2),description:"75% Foundation Completed",enabled:Ye.milestones.morePlantsMilestone1.earned})),g(()=>({multiplier:2,description:"5 Elves Trained",enabled:Re.milestones[4].earned})),g(()=>({multiplier:2,description:"8 Elves Trained",enabled:Re.milestones[7].earned})),g(()=>({multiplier:4,description:"Lumberjack Boots",enabled:yt.treesUpgrades.treesUpgrade1.bought})),ne(()=>({addend:We.boosts.blue1,description:"Blue Dye Boost 1",enabled:()=>a.gte(We.dyes.blue.amount.value,1)})),ne(()=>({addend:()=>a.pow(Be.value,.99),description:"Hope Level 1",enabled:R.elfTraining.expandersElfTraining.milestones[0].earned}))]),c=kt(f(()=>a.sub(d.apply(10),o.value)),"trees"),m=f(()=>d.apply(10)),p=L(()=>({resource:O(i),cost:10,display:{title:"Wooden Fingers",description:"Cut down an additional tree per click"}})),b=L(()=>({resource:O(i),cost:10,display:{title:"Leafy Fingers",description:"Plant an additional tree per click"}})),w=L(()=>({resource:O(i),cost:25,display:{title:"Automated Knives",description:"Cut down a tree every second"}})),k=L(()=>({resource:O(i),cost:25,display:{title:"Automated Spade",description:"Plant a tree every second"}})),v=L(()=>({resource:O(i),cost:40,display:{title:"Research I",description:"Trees give 25% more logs, and unlock more upgrades"}})),x=[p,b,w,k,v],D=L(()=>({resource:O(i),cost:50,visibility:()=>h(v.bought.value),display:{title:"Sharper Fingers",description:"Manually cut trees twice as often"}})),N=L(()=>({resource:O(i),cost:50,visibility:()=>h(v.bought.value),display:{title:"Greener Fingers",description:"Manually Plant trees twice as often"}})),J=L(()=>({resource:O(i),cost:150,visibility:()=>h(v.bought.value),display:{title:"Smart Knives",description:"Each time you manually chop trees, gain 1s of automatic tree chopping production"}})),M=L(()=>({resource:O(i),cost:150,visibility:()=>h(v.bought.value),display:{title:"Smart Spades",description:"Each time you manually plant trees, gain 1s of automatic tree planting production"}})),E=L(()=>({resource:O(i),cost:300,visibility:()=>h(v.bought.value),display:{title:"Research II",description:"Trees give 25% more logs, and unlock repeatable purchases"}})),P=[D,N,J,M,E],Z=qe(()=>({resource:O(i),cost(){let V=this.amount.value;return a.gte(V,50)&&(V=a.pow(V,2).div(50)),a.gte(V,200)&&(V=a.pow(V,2).div(200)),a.gte(V,2e6)&&(V=a.pow(V,2).div(2e6)),V=a.pow(.95,W.books.cuttersBook.amount.value).times(V),a.times(100,V).add(200)},display:{title:"Generic Cutters",description:"Each cutter cuts down 1 tree/s"},visibility:()=>h(E.bought.value)})),X=qe(()=>({resource:O(i),cost(){let V=this.amount.value;a.gte(V,50)&&(V=a.pow(V,2).div(50)),a.gte(V,200)&&(V=a.pow(V,2).div(200)),a.gte(V,2e6)&&(V=a.pow(V,2).div(2e6)),V=a.pow(.95,W.books.plantersBook.amount.value).times(V);let be=a.times(100,V).add(200);return R.elfTraining.planterElfTraining.milestones[3].earned.value&&(be=a.div(be,10)),be},display:{title:"Generic Planters",description:"Each planter plants 0.5 trees/s"},visibility:()=>h(E.bought.value)})),$=qe(()=>({resource:O(i),cost(){let V=this.amount.value;return a.gte(V,100)&&(V=a.pow(V,2).div(100)),a.gte(V,1e5)&&(V=a.pow(V,2).div(1e5)),a.gte(V,1e15)&&(V=a.pow(V,10).div(1e135)),V=a.pow(.95,W.books.expandersBook.amount.value).times(V),a.pow(a.add(V,1),1.5).times(500)},display:{title:"Expand Forest",description:"Add 10 trees to the forest"},visibility:()=>h(E.bought.value)})),z=[Z,X,$],oe=K(()=>[ne(()=>({addend:1,description:"Wooden Fingers",enabled:p.bought})),ne(()=>({addend:Ne,description:"Smart Knives",enabled:J.bought}))]),Be=f(()=>oe.apply(1)),he=K(()=>[g(()=>({multiplier:.5,description:"Sharper Fingers",enabled:D.bought})),g(()=>({multiplier:()=>a.pow(.5,Re.totalElves.value),description:"1 Elf Trained",enabled:Re.milestones[0].earned}))]),ae=f(()=>he.apply(1)),se=K(()=>[ne(()=>({addend:1,description:"Automated Knives",enabled:w.bought})),ne(()=>({addend:Z.amount,description:"Generic Cutters",enabled:E.bought})),ne(()=>({addend:()=>a.div(Ye.foundationProgress.value,5).floor(),description:"10% Foundation Completed",enabled:Ye.milestones.autoCutMilestone1.earned})),g(()=>({multiplier:2,description:"30% Foundation Completed",enabled:Ye.milestones.autoCutMilestone2.earned})),g(()=>({multiplier:2,description:"Warmer Cutters",enabled:q.warmerCutters.bought})),g(()=>({multiplier:q.computedHeatedCutterEffect,description:"Heated Cutters",enabled:()=>a.gt(q.heatedCutters.amount.value,0)})),g(()=>({multiplier:4,description:"Lumberjack Jeans",enabled:yt.treesUpgrades.treesUpgrade2.bought})),g(()=>({multiplier:()=>a.pow(1.1,U.day.value),description:"Holly Level 4",enabled:R.elfTraining.cutterElfTraining.milestones[3].earned})),ne(()=>({addend:()=>a.sub(Ie.value,ve.value).max(0),description:"Ivy Level 5",enabled:R.elfTraining.planterElfTraining.milestones[4].earned}))]),Ne=f(()=>se.apply(0)),Ie=j(0);setInterval(()=>Jt(Ne,V=>{Ie.value=V}),0);const Se=K(()=>[ne(()=>({addend:1,description:"Leafy Fingers",enabled:b.bought})),ne(()=>({addend:Le,description:"Smart Spades",enabled:M.bought}))]),Ue=f(()=>Se.apply(1)),ge=K(()=>[g(()=>({multiplier:.5,description:"Greener Fingers",enabled:N.bought})),g(()=>({multiplier:()=>a.pow(.5,Re.totalElves.value),description:"1 Elf Trained",enabled:Re.milestones[0].earned}))]),Oe=f(()=>ge.apply(1)),De=K(()=>[ne(()=>({addend:1,description:"Automated Spade",enabled:k.bought})),ne(()=>({addend:()=>a.div(X.amount.value,2),description:"Generic Planters",enabled:E.bought})),ne(()=>({addend:()=>a.div(Ye.foundationProgress.value,10).floor(),description:"20% Foundation Completed",enabled:Ye.milestones.autoPlantMilestone1.earned})),g(()=>({multiplier:2,description:"40% Foundation Completed",enabled:Ye.milestones.autoPlantMilestone2.earned})),g(()=>({multiplier:2,description:"Warmer Planters",enabled:q.warmerPlanters.bought})),g(()=>({multiplier:q.computedHeatedPlanterEffect,description:"Heated Planters",enabled:()=>a.gt(q.heatedPlanters.amount.value,0)})),g(()=>({multiplier:4,description:"Lumberjack Plaid",enabled:yt.treesUpgrades.treesUpgrade3.bought})),g(()=>({multiplier:2,description:"Ivy Level 1",enabled:R.elfTraining.planterElfTraining.milestones[0].earned})),g(()=>({multiplier:()=>a.pow(c.value,.2).log10().pow_base(2),description:"Ivy Level 3",enabled:R.elfTraining.planterElfTraining.milestones[2].earned})),g(()=>({multiplier:2,description:"Mary Level 4",enabled:R.elfTraining.heatedPlanterElfTraining.milestones[3].earned})),ne(()=>({addend:()=>a.sub(ve.value,Ie.value).max(0),description:"Ivy Level 5",enabled:R.elfTraining.planterElfTraining.milestones[4].earned}))]),Le=f(()=>De.apply(0)),ve=j(0);setInterval(()=>Jt(Le,V=>{ve.value=V}),0);const tt=K(()=>[g(()=>({multiplier:1.25,description:"Research I",enabled:v.bought})),g(()=>({multiplier:1.25,description:"Research II",enabled:E.bought})),g(()=>({multiplier:()=>Ye.milestones.extraExpansionMilestone1.earned.value?a.pow(1.02,Ye.foundationProgress.value):a.div(Ye.foundationProgress.value,20).add(1),description:"1% Foundation Completed",enabled:Ye.milestones.logGainMilestone1.earned})),g(()=>({multiplier:2,description:"50% Foundation Completed",enabled:Ye.milestones.logGainMilestone2.earned})),g(()=>({multiplier:1.25,description:"Ashy Soil",enabled:q.basicFertilizer.bought})),g(()=>({multiplier:q.computedFertilizerEffect,description:"Fertilized Soil",enabled:()=>a.gt(q.moreFertilizer.amount.value,0)})),g(()=>({multiplier:2,description:"4 Elves Trained",enabled:Re.milestones[3].earned})),g(()=>({multiplier:2,description:"Carry logs in boxes",enabled:st.upgrades.logsUpgrade.bought})),g(()=>({multiplier:()=>a.div(st.buyables.logBoxesBuyable.amount.value,2).add(1),description:"Carry more logs",enabled:st.upgrades.logsUpgrade.bought})),g(()=>({multiplier:10,description:"Felt-Gripped Axe",enabled:yt.treesUpgrades.treesUpgrade4.bought})),g(()=>({multiplier:f(()=>a.add(Ne.value,1).log10().plus(1)),description:"Is Blue Dye just Water?",enabled:We.upgrades.blueDyeUpg.bought})),g(()=>({multiplier:f(()=>a.add(Ne.value,1).root(9)),description:"Holly Level 1",enabled:R.elfTraining.cutterElfTraining.milestones[0].earned})),g(()=>({multiplier:()=>a.sqrt(R.totalElfLevels.value),description:"Noel Level 1",enabled:R.elfTraining.fertilizerElfTraining.milestones[0].earned})),fl(()=>({exponent:1.2,description:"100% Foundation Completed",enabled:Ye.milestones.logGainMilestone3.earned}))]),te=xe(0),rt=tl(()=>({direction:Fe.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>a.div(te.value,ae.value)})),ze=Lt(()=>({display:{title:"Cut trees",description:_(()=>n(S,null,[s("Cut down up to "),le(a.floor(Be.value))," ",s("tree"),a.eq(Be.value,1)?"":"s",s(" at once!"),n("br",null,null),me(rt)]))},style:{minHeight:"80px"},canClick:()=>a.gte(c.value,1)&&a.gte(te.value,ae.value),onClick(){if(a.lt(te.value,ae.value))return;const V=a.floor(a.min(c.value,a.times(Be.value,a.div(te.value,ae.value).floor())));i.value=a.add(i.value,a.times(tt.apply(1),V)),o.value=a.add(o.value,V),te.value=0}})),Je=xe(0),re=tl(()=>({direction:Fe.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>a.div(Je.value,Oe.value)})),Qe=Lt(()=>({display:{title:"Plant trees",description:_(()=>n(S,null,[s("Plant up to "),le(a.floor(Ue.value))," ",s("tree"),a.eq(Ue.value,1)?"":"s",s(" at once!"),n("br",null,null),me(re)]))},style:{minHeight:"80px"},canClick:()=>a.gte(o.value,1)&&a.gte(Je.value,Oe.value),onClick(){if(a.lt(Je.value,Oe.value))return;const V=a.floor(a.min(o.value,a.times(Ue.value,a.div(Je.value,Oe.value).floor())));o.value=a.sub(o.value,V),Je.value=0}})),[Ze,xt]=rl(()=>[{title:"Logs per Tree",modifier:tt,base:1,visible:v.bought},{title:"Manual Cutting Amount",modifier:oe,base:1,visible:p.bought,unit:"/click"},{title:"Manual Cutting Cooldown",modifier:he,base:1,visible:p.bought,unit:"s"},{title:"Manual Planting Amount",modifier:Se,base:1,visible:b.bought,unit:"/click"},{title:"Manual Planting Cooldown",modifier:ge,base:1,visible:b.bought,unit:"s"},{title:"Auto Cutting Amount",modifier:se,base:0,visible:w.bought,unit:"/s"},{title:"Auto Planting Amount",modifier:De,base:0,visible:k.bought,unit:"/s"},{title:"Forest Size",modifier:d,base:10,visible:E.bought}]),ut=j(!1),pt=_(()=>n(_t,{modelValue:ut.value,"onUpdate:modelValue":V=>ut.value=V},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:Ze}));lt.on("update",V=>{if(a.lt(U.day.value,di))return;a.gte(te.value,ae.value)?te.value=ae.value:(te.value=a.add(te.value,V),ze.isHolding.value&&ze.onClick()),a.gte(Je.value,Oe.value)?Je.value=Oe.value:(Je.value=a.add(Je.value,V),Qe.isHolding.value&&Qe.onClick());const be=a.min(c.value,a.times(Ne.value,V)),Ut=a.mul(tt.apply(1),be),Kt=a.div(Ut,V);r.value=a.mul(Kt,ci).add(a.mul(r.value,a.dOne.sub(ci))),i.value=a.add(i.value,Ut),o.value=a.add(o.value,be);const Ae=a.min(o.value,a.times(Le.value,V));o.value=a.sub(o.value,Ae)});const Ke=f(()=>a.sub(Ne.value,Le.value)),Ge=f(()=>a.sub(Le.value,Ne.value)),St=Hl(()=>({key:"c",description:'Press the "Cut trees" button.',onPress:()=>{ze.canClick.value&&ze.onClick()}})),Bt=Hl(()=>({key:"p",description:'Press the "Plant trees" button.',onPress:()=>{Qe.canClick.value&&Qe.onClick()}})),{total:Tt,trackerDisplay:de}=hl({resource:i,goal:1e4,name:e,day:di,color:l,modal:{show:ut,display:pt}});return{name:e,color:t,logs:i,totalLogs:Tt,trees:c,saplings:o,cutTree:ze,plantTree:Qe,cutTreeHK:St,plantTreeHK:Bt,row1Upgrades:x,row2Upgrades:P,row1Buyables:z,manualCutProgress:te,manualPlantProgress:Je,generalTabCollapsed:xt,computedAutoCuttingAmount:Ne,minWidth:700,display:_(()=>n(S,null,[me(de),n(Ee,null,null),n(qt,{resource:i,color:t,style:"margin-bottom: 0",productionDisplay:a.gt(Ne.value,0)?`+${H(r.value)}/s average<br/>equilibrium: +${Ei([[Ne.value,"cutting speed"],[Le.value,"planting speed"],[a.mul(m.value,20),"forest cap"]],"/s",tt.apply(1))}`:void 0},null),n(qt,{resource:o,color:l,style:"margin-bottom: 0",productionDisplay:va(Ke.value)},null),n(qt,{resource:c,color:l,style:"margin-bottom: 0",productionDisplay:va(Ge.value)},null),n(Ee,null,null),nt(ze,Qe),n("div",null,[s("Tip: You can hold down on actions to perform them automatically")]),n(Ee,null,null),Ml(x,P),n(Ee,null,null),nt(...z)])),minimizedDisplay:_(()=>n("div",null,[e,s(" - "),H(i.value),s(" "),i.displayName]))}});var Gi="./assets/tree.35808197.png",$i="./assets/sws.714ad454.png",Qi="data:image/png;base64,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",Hi="./assets/elf.9fbfa563.png",Vi="./assets/paperStacks.4c96ec8c.png",ji="data:image/png;base64,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",zi="./assets/metal.7407f5d1.png",Ji="./assets/cloth.7bcd7f37.png",Wi="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==",Ki="./assets/plastic.b8ac74ff.png",Xi="data:image/png;base64,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",Yi="./assets/elfManagement.436c8744.png";const U=Ht("main",function(){const e=xe(1),t=f(()=>(+new Date(new Date().getFullYear(),11,e.value)-pe.time)/1e3),l=j(!1),i=j(-1),o=j(""),r=j();function d(p){const b=xe(!1),w=xe(!1);return Vt(()=>{const k=p(),v=Et(k.shouldNotify),x=Et(()=>u(v)||u(w));return{...k,opened:b,shouldNotify:x,recentlyUpdated:w,[Dl]:ds,[Il]:function(){const{day:D,layer:N,symbol:J,opened:M,shouldNotify:E,story:P,completedStory:Z,recentlyUpdated:X}=this;return{day:D,symbol:J,layer:N,opened:M,recentlyUpdated:X,shouldNotify:E,onOpenLore(){var oe,Be;const $=U.day.value>D;i.value=$?D-1:-1;const z=u((Be=(oe=Nt[N!=null?N:"trees"])==null?void 0:oe.name)!=null?Be:"");o.value=$?`${z} - Completed!`:z,r.value=$?`${P}<hr style="
margin: 10px 0;"/>${Z}`:P,l.value=!0},onOpenLayer(){if(X.value=!1,window.matchMedia("(min-width: 1468px)").matches)if(pe.tabs.includes(N!=null?N:"trees")){const $=pe.tabs.lastIndexOf(N!=null?N:"trees");pe.tabs.splice($,1)}else pe.tabs.push(N!=null?N:"trees"),U.minimized.value=!0;else pe.tabs.splice(1,1/0,N!=null?N:"trees")},onUnlockLayer(){N&&(M.value=!0,setTimeout(()=>{var $,z;i.value=-1,o.value=u((z=($=Nt[N!=null?N:"trees"])==null?void 0:$.name)!=null?z:""),r.value=P,pe.autoPause&&(pe.devSpeed=null),l.value=!0},1e3))}}}}})}const c=[d(()=>({day:1,shouldNotify:!1,layer:"trees",symbol:Gi,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!"})),d(()=>({day:2,shouldNotify:!1,layer:"workshop",symbol:$i,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!"})),d(()=>({day:3,shouldNotify:!1,layer:"coal",symbol:Qi,story:"Santa tells you that unfortunately there are quite a few naughty children out there this year, and he's going to need you to gather as much coal as you can for him to give out.",completedStory:"Santa looks at all the coal you've gathered and tells you you've done well! He says you should take the rest of the day off so you're refreshed for tomorrow's work. Good Job!"})),d(()=>({day:4,shouldNotify:!1,layer:"elves",symbol:Hi,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!"})),d(()=>({day:5,shouldNotify:!1,layer:"paper",symbol:Vi,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!"})),d(()=>({day:6,shouldNotify:!1,layer:"boxes",symbol:ji,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!"})),d(()=>({day:7,shouldNotify:!1,layer:"metal",symbol:zi,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!"})),d(()=>({day:8,shouldNotify:!1,layer:"cloth",symbol:Ji,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!"})),d(()=>({day:9,shouldNotify:!1,layer:"oil",symbol:Wi,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!"})),d(()=>({day:10,shouldNotify:!1,layer:"plastic",symbol:Ki,story:"Now that plenty of oil has been prepared, it's time to start refining it into plastic! This should be incredibly useful not only for toys, but making tools and other items!",completedStory:"You've started refining massive amounts of oil into slightly less massive amounts of plastic. You have a slight pang of regret thinking of the environmental impact, but ultimately decide Christmas is worth it. Good Job!"})),d(()=>({day:11,shouldNotify:!1,layer:"dyes",symbol:Xi,story:"To make toys, we're going to need some color to make them look nice and enticing! We can't just give kids clear toys after all! To add some color to our toys, we'll need some dyes!",completedStory:"After all that effort, you finally have a rainbow of dyes to choose from! Now the children won't be able to resist the toys you have to offer, once you get them made of course..."})),d(()=>({day:12,shouldNotify:!1,layer:"management",symbol:Yi,story:"You watch as the elves work, and you realize that they could probably be trained to help out better. Just then, Santa comes over to check on your progress. You reply that you're doing fine, except that the elves may need a bit of behavior management. Santa offers to help, saying that he doesn't want to leave you to do everything. Unfortunately for you, the behavior problems won't fix themselves, so let's get to work!",completedStory:"Woo! You are exhausted - this layer felt really long to you. It's great seeing the elves so productive, although you worry a bit about your own job security now! Good Job!"})),d(()=>({day:13,shouldNotify:!1,layer:null,symbol:"",story:"So after a good night's rest you decide that maybe making these elves able to do all the work for you isn't something to be scared of, but rather encouraged. Let's spend another day continuing to train them up and really get this place spinning. They are Santa's elves after all, they're supposed to be able to run everything without you!",completedStory:"The elves are doing an incredible job, and Santa does not seem keen on firing you - Score! Now you can get to work on guiding this properly trained highly functional group of hard workers to make Christmas as great as possible. Good Job!"})),d(()=>({day:14,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:15,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:16,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:17,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:18,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:19,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:20,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:21,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:22,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:23,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:24,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""}))];function m(){i.value=e.value-1,o.value="Day Complete!",r.value=c[e.value-1].completedStory,l.value=!0,e.value++,U.minimized.value=!1,pe.autoPause&&(pe.devSpeed=0)}return{name:"Calendar",days:c,day:e,timeUntilNewDay:t,loreScene:i,loreTitle:o,loreBody:r,showLoreModal:l,completeDay:m,minWidth:700,display:_(()=>n(S,null,[pe.devSpeed===0?n("div",null,[s("Game Paused")]):null,pe.devSpeed&&pe.devSpeed!==1?n("div",null,[s("Dev Speed: "),H(pe.devSpeed),s("x")]):null,pe.offlineTime?n("div",null,[s("Offline Time: "),Vl(pe.offlineTime)]):null,n(Ee,null,null),n("div",{class:"advent"},[c.reduce((p,b)=>(p[p.length-1].length===4&&p.push([]),p[p.length-1].push(b),p),[[]]).map(p=>nt(...p))])]))}}),Nr=e=>[U,ue,Ye,q,Re,W,st,it,yt,ce,et,We,R],ja=f(()=>!1);function Dr(e,t){["0.0","0.1","0.2","0.3","0.4"].includes(e!=null?e:"")}var Ir=Object.freeze(Object.defineProperty({__proto__:null,main:U,getInitialLayers:Nr,hasWon:ja,fixOldSave:Dr},Symbol.toStringTag,{value:"Module"})),Tr="./assets/workshopMansion.f5e58b53.png";const Pr={class:"scene"},Fr=["src"],Ur=["src"],Rr=["src"],Or=["src"],Lr=["src"],qr=["src"],Gr=["src"],$r=["src"],Qr=["src"],Hr=["src"],Vr=["src"],jr=["src"],zr=["src"],Jr=_e({__name:"Scene",props:{day:null},setup(e){return(t,l)=>(A(),T("div",Pr,[e.day>=7?(A(),T("img",{key:0,src:u(Ji),class:"scene-item",style:{left:"4%",bottom:"3%",width:"40px",height:"40px"}},null,8,Fr)):G("",!0),e.day>=0?(A(),T("img",{key:1,src:u(Gi),class:"scene-item",style:{left:"10%",bottom:"10%"}},null,8,Ur)):G("",!0),e.day>=12?(A(),T("img",{key:2,src:u(Tr),class:"scene-item",style:{left:"33%",bottom:"12%",width:"30%",height:"60%"}},null,8,Rr)):(A(),T(S,{key:3},[e.day>=11?(A(),T("img",{key:0,src:u(Yi),class:"scene-item",style:{left:"28%",bottom:"12%"}},null,8,Or)):G("",!0),e.day>=1?(A(),T("img",{key:1,src:u($i),class:"scene-item",style:{left:"40%",bottom:"12%"}},null,8,Lr)):G("",!0),e.day>=3?(A(),T("img",{key:2,src:u(Hi),class:"scene-item",style:{left:"52%",bottom:"12%"}},null,8,qr)):G("",!0)],64)),e.day>=2?(A(),T("img",{key:4,src:u(Qi),class:"scene-item",style:{left:"65%",bottom:"12%",width:"40px",height:"40px"}},null,8,Gr)):G("",!0),e.day>=6?(A(),T("img",{key:5,src:u(zi),class:"scene-item",style:{left:"72%",bottom:"8%",width:"40px",height:"40px"}},null,8,$r)):G("",!0),e.day>=8?(A(),T("img",{key:6,src:u(Wi),class:"scene-item",style:{left:"80%",bottom:"6%"}},null,8,Qr)):G("",!0),e.day>=4?(A(),T("div",{key:7,class:"scene-bubble",style:At(e.day>=12?"left: 33%; bottom: 73%":"left: 50%; bottom: 38%")},[e.day>=4?(A(),T("img",{key:0,src:u(Vi),class:"scene-item"},null,8,Hr)):G("",!0),e.day>=5?(A(),T("img",{key:1,src:u(ji),class:"scene-item"},null,8,Vr)):G("",!0),e.day>=9?(A(),T("img",{key:2,src:u(Ki),class:"scene-item"},null,8,jr)):G("",!0),e.day>=10?(A(),T("img",{key:3,src:u(Xi),class:"scene-item"},null,8,zr)):G("",!0)],4)):G("",!0)]))}});var Wr=je(Jr,[["__scopeId","data-v-ebad6520"]]);const Kr=_e({components:{Context:Mi},props:{index:{type:Number,required:!0},tab:{type:Function,required:!0},display:{type:ee(Object,String,Function),required:!0},minimizedDisplay:ee(Object,String,Function),minimized:{type:Object,required:!0},minWidth:{type:ee(Number,String),required:!0},name:{type:ee(String),required:!0},color:ee(String),minimizable:ee(Boolean),nodes:{type:Object,required:!0}},setup(e){const{display:t,index:l,minimized:i,minWidth:o,tab:r,minimizedDisplay:d}=It(e),c=ga(t),m=yl(d),p=f(()=>Ve.allowGoBack&&l.value>0&&!i.value);function b(){pe.tabs.splice(u(e.index),1)}Ol(()=>k(i.value,u(o.value))),Jt([i,Qo(o)],([v,x])=>k(v,x));function w(v){e.nodes.value=v}function k(v,x){const D=typeof x=="number"||Number.isNaN(parseInt(x))?x+"px":x,N=r.value();N!=null&&(v?(N.style.flexGrow="0",N.style.flexShrink="0",N.style.width="60px",N.style.minWidth=N.style.flexBasis="",N.style.margin="0"):(N.style.flexGrow="",N.style.flexShrink="",N.style.width="",N.style.minWidth=N.style.flexBasis=D,N.style.margin=""))}return{component:c,minimizedComponent:m,showGoBack:p,updateNodes:w,unref:u,goBack:b}}}),Xr={key:1};function Yr(e,t,l,i,o,r){const d=xl("Context");return A(),T("div",{class:"layer-container",style:At({"--layer-color":e.unref(e.color)})},[e.showGoBack?(A(),T("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):G("",!0),e.minimized.value?(A(),T("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.minimized.value=!1)},[e.minimizedComponent?(A(),ye(ct(e.minimizedComponent),{key:0})):(A(),T("div",Xr,Te(e.unref(e.name)),1))])):(A(),T("div",{key:2,class:vt(["layer-tab",{showGoBack:e.showGoBack}])},[n(d,{onUpdateNodes:e.updateNodes},{default:fe(()=>[(A(),ye(ct(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(A(),T("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.minimized.value=!0)}," \u25BC ")):G("",!0)],4)}var Zr=je(Kr,[["render",Yr],["__scopeId","data-v-259fef03"]]);const Zi=e=>(Bl("data-v-4b4bda40"),e=e(),Nl(),e),eu=Zi(()=>y("h2",null,"Changelog",-1)),tu=Zi(()=>y("details",{open:""},[y("summary",null,[s("v0.0 Initial Commit - "),y("time",null,"2021-09-04")]),s(" This is the first release :D "),y("ul",null,[y("li",{class:"feature"},"Did everything"),y("li",{class:"fix"},"Had some fun"),y("li",{class:"breaking"},"Removed everything"),y("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),lu=_e({__name:"Changelog",setup(e,{expose:t}){const l=j(!1);return t({open(){l.value=!0}}),(i,o)=>(A(),ye(_t,{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=r=>l.value=r)},{header:fe(()=>[eu]),body:fe(()=>[tu]),_:1},8,["modelValue"]))}});var au=je(lu,[["__scopeId","data-v-4b4bda40"]]);const iu={class:"info-modal-header"},nu=["src","alt"],ou={class:"info-modal-title"},su={key:0},ru=s(" - "),uu={key:0},du={key:0},cu=y("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1),pu=y("br",null,null,-1),mu=y("br",null,null,-1),vu=["href"],fu=y("span",{class:"material-icons info-modal-discord"},"discord",-1),gu=y("div",null,[y("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[y("span",{class:"material-icons info-modal-discord"},"discord"),s(" The Paper Pilot Community ")])],-1),yu=y("div",null,[y("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[y("span",{class:"material-icons info-modal-discord"},"discord"),s(" The Modding Tree ")])],-1),hu=y("br",null,null,-1);var bu=_e({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const l=e,{title:i,logo:o,author:r,discordName:d,discordLink:c,versionNumber:m,versionTitle:p}=Ve,b=It(l),w=j(!1),k=f(()=>Vl(pe.timePlayed)),v=f(()=>He(_(()=>n(S,null,[Ui.map(me)]))));t({open(){w.value=!0}});function x(){var D;(D=u(b.changelog))==null||D.open()}return(D,N)=>(A(),ye(_t,{class:"info-modal",modelValue:w.value,"onUpdate:modelValue":N[0]||(N[0]=J=>w.value=J)},{header:fe(()=>[y("div",iu,[u(o)?(A(),T("img",{key:0,class:"info-modal-logo",src:u(o),alt:u(i)},null,8,nu)):G("",!0),y("div",ou,[y("h2",null,"- "+Te(u(i))+" -",1),y("h4",null,[s(" - v"+Te(u(m)),1),u(p)?(A(),T("span",su,": "+Te(u(p)),1)):G("",!0),ru])])])]),body:fe(({shown:J})=>[J?(A(),T("div",uu,[u(r)?(A(),T("div",du,"By "+Te(u(r)),1)):G("",!0),cu,pu,y("div",{class:"link",onClick:x},"Changelog"),mu,y("div",null,[u(c)?(A(),T("a",{key:0,href:u(c),class:"info-modal-discord-link",target:"_blank"},[fu,s(" "+Te(u(d)),1)],8,vu)):G("",!0)]),gu,yu,hu,y("div",null,"Time Played: "+Te(u(k)),1),(A(),ye(ct(u(v))))])):G("",!0)]),_:1},8,["modelValue"]))}});const wu=["onClick"],Au=_e({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const l=j(!1),i=j(null);function o(){t("click"),i.value&&clearTimeout(i.value),l.value=!1,Ol(()=>{l.value=!0,i.value=setTimeout(()=>l.value=!1,500)})}return(r,d)=>(A(),T("button",{onClick:Zl(o,["stop"]),class:vt(["feedback",{activated:l.value,left:e.left}])},[Yt(r.$slots,"default",{},void 0,!0)],10,wu))}});var en=je(Au,[["__scopeId","data-v-01a1b95c"]]);const ku=y("h2",null,"Settings",-1),Cu={class:"option-tabs"},Eu={key:0},_u=s("Manually save"),Su={key:1};var Mu=_e({__name:"Options",setup(e,{expose:t}){const l=j(!1),i=j("behaviour");t({isTab:o,setTab:r,save(){zt()},open(){l.value=!0}});function o(X){return X==i.value}function r(X){i.value=X}const d=Object.keys(Jl).map(X=>({label:_i(X),value:X})),c=f(()=>He(_(()=>n(S,null,[Fi.map(me)])))),{showTPS:m,theme:p,usingLog:b,alignUnits:w}=It(ot),{autosave:k,autoPause:v}=It(pe),x=f({get(){return pe.devSpeed===0},set(X){pe.devSpeed=X?0:null}}),D=_(()=>n("span",{class:"option-title"},[s("Autosave"),n(wt,{display:"Save-specific"},{default:()=>[s("*")]}),n("desc",null,[s("Automatically save the game every second or when the game is closed.")])])),N=_(()=>n("span",{class:"option-title"},[s("Pause game"),n(wt,{display:"Save-specific"},{default:()=>[s("*")]}),n("desc",null,[s("Stop everything from moving.")])])),J=_(()=>n("span",{class:"option-title"},[s("Auto-pause"),n(wt,{display:"Save-specific"},{default:()=>[s("*")]}),n("desc",null,[s("Automatically pause the game when a day is completed. It is best to keep this on to avoid over-grinding.")])])),M=_(()=>n("span",{class:"option-title"},[s("Theme"),n("desc",null,[s("How the game looks.")])])),E=_(()=>n("span",{class:"option-title"},[s("Show TPS"),n("desc",null,[s("Show TPS meter at the bottom-left corner of the page.")])])),P=_(()=>n("span",{class:"option-title"},[s("Logarithmic progress bars"),n("desc",null,[s("Whether progress bars should be normalized for exponential growth.")])])),Z=_(()=>n("span",{class:"option-title"},[s("Align modifier units"),n("desc",null,[s("Align numbers to the beginning of the unit in modifier view.")])]));return(X,$)=>(A(),ye(_t,{modelValue:l.value,"onUpdate:modelValue":$[10]||($[10]=z=>l.value=z)},{header:fe(()=>[ku,y("div",Cu,[y("button",{class:vt({selected:o("behaviour")}),onClick:$[0]||($[0]=z=>r("behaviour"))}," Behaviour ",2),y("button",{class:vt({selected:o("appearance")}),onClick:$[1]||($[1]=z=>r("appearance"))}," Appearance ",2)])]),body:fe(()=>[o("behaviour")?(A(),T("div",Eu,[n(nl,{title:u(D),modelValue:u(k),"onUpdate:modelValue":$[2]||($[2]=z=>gt(k)?k.value=z:null)},null,8,["title","modelValue"]),u(k)?G("",!0):(A(),ye(en,{key:0,class:"button save-button",onClick:$[3]||($[3]=z=>u(zt)())},{default:fe(()=>[_u]),_:1})),u(Ve).enablePausing?(A(),ye(nl,{key:1,title:u(N),modelValue:u(x),"onUpdate:modelValue":$[4]||($[4]=z=>gt(x)?x.value=z:null)},null,8,["title","modelValue"])):G("",!0),n(nl,{title:u(J),modelValue:u(v),"onUpdate:modelValue":$[5]||($[5]=z=>gt(v)?v.value=z:null)},null,8,["title","modelValue"])])):G("",!0),o("appearance")?(A(),T("div",Su,[n(Va,{title:u(M),options:u(d),modelValue:u(p),"onUpdate:modelValue":$[6]||($[6]=z=>gt(p)?p.value=z:null)},null,8,["title","options","modelValue"]),(A(),ye(ct(u(c)))),n(nl,{title:u(E),modelValue:u(m),"onUpdate:modelValue":$[7]||($[7]=z=>gt(m)?m.value=z:null)},null,8,["title","modelValue"]),n(nl,{title:u(P),modelValue:u(b),"onUpdate:modelValue":$[8]||($[8]=z=>gt(b)?b.value=z:null)},null,8,["title","modelValue"]),n(nl,{title:u(Z),modelValue:u(w),"onUpdate:modelValue":$[9]||($[9]=z=>gt(w)?w.value=z:null)},null,8,["title","modelValue"])])):G("",!0)]),_:1},8,["modelValue"]))}});const xu=["onSubmit"],Bu={class:"field"},Nu={key:0,class:"field-title"},Du=["placeholder"],Iu=_e({__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,i=yl(sl(l,"title"),"span"),o=Zt(null);ya(()=>{var m;(m=o.value)==null||m.focus()});const r=f({get(){return u(l.modelValue)||""},set(m){t("update:modelValue",m)}});function d(){t("submit")}function c(){l.submitOnBlur!==!1?t("submit"):t("cancel")}return(m,p)=>(A(),T("form",{onSubmit:Zl(d,["prevent"])},[y("div",Bu,[u(i)?(A(),T("span",Nu,[(A(),ye(ct(u(i))))])):G("",!0),e.textArea?(A(),ye(u(yn),{key:1,modelValue:u(r),"onUpdate:modelValue":p[0]||(p[0]=b=>gt(r)?r.value=b:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:c,ref_key:"field",ref:o},null,8,["modelValue","placeholder","maxHeight"])):ha((A(),T("input",{key:2,type:"text","onUpdate:modelValue":p[1]||(p[1]=b=>gt(r)?r.value=b:null),placeholder:e.placeholder,class:vt({fullWidth:!e.title}),onBlur:c,ref_key:"field",ref:o},null,42,Du)),[[cn,u(r)]])])],40,xu))}});var tn=je(Iu,[["__scopeId","data-v-67b44a54"]]);const Tu={key:0},Pu=["onClick","disabled"],Fu={key:0},Uu=["onClick"],Ru=_e({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=It(e),o=j(!1);Jt(o,c=>{t("confirmingChanged",c)});function r(){if(u(i.skipConfirm)){t("click");return}o.value&&t("click"),o.value=!o.value}function d(){o.value=!1}return(c,m)=>(A(),T("span",{class:vt(["container",{confirming:o.value}])},[o.value?(A(),T("span",Tu,"Are you sure?")):G("",!0),y("button",{onClick:Zl(r,["stop"]),class:"button danger",disabled:e.disabled},[o.value?(A(),T("span",Fu,"Yes")):Yt(c.$slots,"default",{key:1},void 0,!0)],8,Pu),o.value?(A(),T("button",{key:1,class:"button",onClick:Zl(d,["stop"])},"No",8,Uu)):G("",!0)],2))}});var Ou=je(Ru,[["__scopeId","data-v-2f8ef34c"]]);const bl=e=>(Bl("data-v-5285ac49"),e=e(),Nl(),e),Lu=bl(()=>y("div",{class:"handle material-icons"},"drag_handle",-1)),qu={key:0,class:"actions"},Gu=bl(()=>y("span",{class:"material-icons"},"content_paste",-1)),$u=bl(()=>y("span",{class:"material-icons"},"content_copy",-1)),Qu=bl(()=>y("span",{class:"material-icons"},"edit",-1)),Hu=bl(()=>y("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Vu={key:1,class:"actions"},ju=bl(()=>y("span",{class:"material-icons"},"check",-1)),zu=bl(()=>y("span",{class:"material-icons"},"close",-1)),Ju={key:2,class:"details"},Wu={class:"save-version"},Ku=bl(()=>y("br",null,null,-1)),Xu={key:0},Yu={key:1},Zu={key:3,class:"details"},ed={key:4,class:"details error"},td=bl(()=>y("br",null,null,-1)),ld=_e({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const l=e,{save:i}=It(l),o=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),r=j(!1),d=j(!1),c=j("");Jt(r,()=>c.value=i.value.name||"");const m=f(()=>i.value&&i.value.id===pe.id),p=f(()=>m.value?pe.time:i.value&&i.value.time||0),b=ga(f(()=>{var k,v,x,D;return`Day ${(D=(x=(v=(k=i.value)==null?void 0:k.layers)==null?void 0:v.main)==null?void 0:x.day)!=null?D:1}`}));function w(){t("editName",c.value),r.value=!1}return(k,v)=>(A(),T("div",{class:vt(["save",{active:u(m)}])},[Lu,r.value?(A(),T("div",Vu,[y("button",{onClick:w,class:"button"},[n(wt,{display:"Save",direction:u(Fe).Left,class:"info"},{default:fe(()=>[ju]),_:1},8,["direction"])]),y("button",{onClick:v[5]||(v[5]=x=>r.value=!r.value),class:"button"},[n(wt,{display:"Cancel",direction:u(Fe).Left,class:"info"},{default:fe(()=>[zu]),_:1},8,["direction"])])])):(A(),T("div",qu,[u(i).error==null&&!d.value?(A(),ye(en,{key:0,onClick:v[0]||(v[0]=x=>t("export")),class:"button",left:""},{default:fe(()=>[n(wt,{display:"Export",direction:u(Fe).Left,class:"info"},{default:fe(()=>[Gu]),_:1},8,["direction"])]),_:1})):G("",!0),u(i).error==null&&!d.value?(A(),T("button",{key:1,onClick:v[1]||(v[1]=x=>t("duplicate")),class:"button"},[n(wt,{display:"Duplicate",direction:u(Fe).Left,class:"info"},{default:fe(()=>[$u]),_:1},8,["direction"])])):G("",!0),u(i).error==null&&!d.value?(A(),T("button",{key:2,onClick:v[2]||(v[2]=x=>r.value=!r.value),class:"button"},[n(wt,{display:"Edit Name",direction:u(Fe).Left,class:"info"},{default:fe(()=>[Qu]),_:1},8,["direction"])])):G("",!0),n(Ou,{disabled:u(m),onClick:v[3]||(v[3]=x=>t("delete")),onConfirmingChanged:v[4]||(v[4]=x=>d.value=x)},{default:fe(()=>[n(wt,{display:"Delete",direction:u(Fe).Left,class:"info"},{default:fe(()=>[Hu]),_:1},8,["direction"])]),_:1},8,["disabled"])])),u(i).error==null&&!r.value?(A(),T("div",Ju,[y("button",{class:"button open",onClick:v[6]||(v[6]=x=>t("open"))},[y("h3",null,Te(u(i).name),1)]),y("span",Wu,"v"+Te(u(i).modVersion),1),Ku,u(p)?(A(),T("div",Xu,"Last played "+Te(u(o).format(u(p))),1)):G("",!0),u(b)?(A(),T("div",Yu,[(A(),ye(ct(u(b))))])):G("",!0)])):u(i).error==null&&r.value?(A(),T("div",Zu,[n(tn,{modelValue:c.value,"onUpdate:modelValue":v[7]||(v[7]=x=>c.value=x),class:"editname",onSubmit:w},null,8,["modelValue"])])):(A(),T("div",ed,[s(" Error: Failed to load save with id "+Te(u(i).id),1),td,s(Te(u(i).error),1)]))],2))}});var ad=je(ld,[["__scopeId","data-v-5285ac49"]]);const za=e=>(Bl("data-v-3b9991aa"),e=e(),Nl(),e),id=za(()=>y("h2",null,"Saves Manager",-1)),nd={class:"modal-footer"},od={class:"field"},sd=za(()=>y("span",{class:"field-title"},"Create Save",-1)),rd={class:"field-buttons"},ud={class:"footer"},dd=za(()=>y("div",{style:{"flex-grow":"1"}},null,-1)),cd=_e({__name:"SavesManager",setup(e,{expose:t}){const l=j(!1),i=j(null);t({open(){l.value=!0}});const o=j(!1),r=j(""),d=j(null);Jt(r,M=>{M?Ol(()=>{try{if(M[0]!=="{")if(M[0]==="e")M=decodeURIComponent(escape(atob(M)));else if(M[0]==="\u1BE1")M=El.decompressFromUTF16(M);else{console.warn("Unable to determine preset encoding",M),o.value=!0;return}const E=JSON.parse(M);if(typeof E!="object"){o.value=!0;return}const P=da();E.id=P,zt(E),r.value="",o.value=!1,ot.saves.push(P)}catch{o.value=!0}}):o.value=!1});let c={},m=j(Object.keys(c).reduce((M,E)=>(M.push({label:E.split("/").slice(-1)[0].slice(0,-4),value:c[E]}),M),[]));const p=wa({});function b(M){if(p[M]==null){let E=localStorage.getItem(M);if(E==null)p[M]={error:"Save doesn't exist in localStorage",id:M};else if(E==="dW5kZWZpbmVk")p[M]={error:"Save is undefined",id:M};else try{if(E[0]!=="{")if(E[0]==="e")E=decodeURIComponent(escape(atob(E)));else if(E[0]==="\u1BE1")E=El.decompressFromUTF16(E);else return console.warn("Unable to determine preset encoding",E),o.value=!0,p[M]={error:"Unable to determine preset encoding",id:M},p[M];p[M]={...JSON.parse(E),id:M}}catch(P){p[M]={error:P,id:M},console.warn(`SavesManager: Failed to load info about save with id ${M}:
${P}
${E}`)}}return p[M]}Jt(l,M=>{M&&Object.keys(p).forEach(E=>delete p[E])});const w=f(()=>ot.saves.reduce((M,E)=>(M[E]=b(E),M),{}));function k(M){let E;switch(pe.id===M?E=Ii(pe[ft]):E=JSON.stringify(w.value[M]),Ve.exportEncoding){default:console.warn(`Unknown save encoding: ${Ve.exportEncoding}. Defaulting to lz`);case"lz":E=El.compressToUTF16(E);break;case"base64":E=btoa(unescape(encodeURIComponent(E)));break;case"plain":break}const P=document.createElement("textarea");P.value=E,document.body.appendChild(P),P.select(),P.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(P)}function v(M){pe.id===M&&zt();const E={...w.value[M],id:da()};zt(E),ot.saves.push(E.id)}function x(M){ot.saves=ot.saves.filter(E=>E!==M),localStorage.removeItem(M),p[M]=void 0}function D(M){w.value[pe.id].time=pe.time,zt(),p[pe.id]=void 0,Rl(w.value[M]),p[M]=void 0}function N(M){if(d.value=M,Ol(()=>{d.value=null}),M[0]!=="{")if(M[0]==="e")M=decodeURIComponent(escape(atob(M)));else if(M[0]==="\u1BE1")M=El.decompressFromUTF16(M);else{console.warn("Unable to determine preset encoding",M);return}const E=JSON.parse(M);E.id=da(),zt(E),ot.saves.push(E.id),D(E.id)}function J(M,E){const P=w.value[M];P&&(P.name=E,pe.id===M?(pe.name=E,zt()):(zt(P),p[M]=void 0))}return(M,E)=>(A(),ye(_t,{modelValue:l.value,"onUpdate:modelValue":E[4]||(E[4]=P=>l.value=P),ref_key:"modal",ref:i},{header:fe(()=>[id]),body:fe(({shown:P})=>[P?(A(),ye(u(gn),{key:0,list:u(ot).saves,handle:".handle",itemKey:Z=>Z},{item:fe(({element:Z})=>[n(ad,{save:u(w)[Z],onOpen:X=>D(Z),onExport:X=>k(Z),onEditName:X=>J(Z,X),onDuplicate:X=>v(Z),onDelete:X=>x(Z)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):G("",!0)]),footer:fe(()=>[y("div",nd,[n(tn,{modelValue:r.value,"onUpdate:modelValue":E[0]||(E[0]=P=>r.value=P),title:"Import Save",placeholder:"Paste your save here!",class:vt({importingFailed:o.value})},null,8,["modelValue","class"]),y("div",od,[sd,y("div",rd,[y("button",{class:"button",onClick:E[1]||(E[1]=P=>D(u(Ql)().id))},"New Game"),Object.keys(u(m)).length>0?(A(),ye(Va,{key:0,options:u(m),modelValue:d.value,"onUpdate:modelValue":E[2]||(E[2]=P=>N(P)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):G("",!0)])]),y("div",ud,[dd,y("button",{class:"button modal-default-button",onClick:E[3]||(E[3]=P=>l.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var ln=je(cd,[["__scopeId","data-v-3b9991aa"]]);const Wt=e=>(Bl("data-v-8495e562"),e=e(),Nl(),e),pd=["src","alt"],md={key:1,class:"title"},vd=Wt(()=>y("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),fd={class:"discord"},gd={class:"discord-links"},yd={key:0},hd=["href"],bd=Wt(()=>y("li",null,[y("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),wd=Wt(()=>y("li",null,[y("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Ad={href:"https://forums.moddingtree.com/",target:"_blank"},kd=Wt(()=>y("span",{class:"material-icons"},"forum",-1)),Cd=Wt(()=>y("span",{class:"material-icons"},"info",-1)),Ed=Wt(()=>y("span",{class:"material-icons"},"library_books",-1)),_d=Wt(()=>y("span",{class:"material-icons"},"settings",-1)),Sd=Wt(()=>y("span",{class:"material-icons"},"library_books",-1)),Md=Wt(()=>y("span",{class:"material-icons"},"settings",-1)),xd=Wt(()=>y("span",{class:"material-icons"},"info",-1)),Bd={href:"https://forums.moddingtree.com/",target:"_blank"},Nd=Wt(()=>y("span",{class:"material-icons"},"forum",-1)),Dd={class:"discord"},Id={class:"discord-links"},Td={key:0},Pd=["href"],Fd=Wt(()=>y("li",null,[y("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Ud=Wt(()=>y("li",null,[y("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Rd=_e({__name:"Nav",setup(e){const t=j(null),l=j(null),i=j(null),o=j(null),{useHeader:r,banner:d,title:c,discordName:m,discordLink:p,versionNumber:b}=Ve;function w(){window.open(p,"mywindow")}return(k,v)=>(A(),T(S,null,[u(r)?(A(),T("div",Ll({key:0,class:"nav"},k.$attrs),[u(d)?(A(),T("img",{key:0,src:u(d),class:"banner",alt:u(c)},null,8,pd)):(A(),T("div",md,Te(u(c)),1)),y("div",{onClick:v[0]||(v[0]=x=>{var D;return(D=o.value)==null?void 0:D.open()}),class:"version-container"},[n(wt,{display:"Changelog",direction:u(Fe).Down,class:"version"},{default:fe(()=>[y("span",null,"v"+Te(u(b)),1)]),_:1},8,["direction"])]),vd,y("div",fd,[y("span",{onClick:w,class:"material-icons"},"discord"),y("ul",gd,[u(p)?(A(),T("li",yd,[y("a",{href:u(p),target:"_blank"},Te(u(m)),9,hd)])):G("",!0),bd,wd])]),y("div",null,[y("a",Ad,[n(wt,{display:"Forums",direction:u(Fe).Down,yoffset:"5px"},{default:fe(()=>[kd]),_:1},8,["direction"])])]),y("div",{onClick:v[1]||(v[1]=x=>{var D;return(D=t.value)==null?void 0:D.open()})},[n(wt,{display:"Info",direction:u(Fe).Down,class:"info"},{default:fe(()=>[Cd]),_:1},8,["direction"])]),y("div",{onClick:v[2]||(v[2]=x=>{var D;return(D=l.value)==null?void 0:D.open()})},[n(wt,{display:"Saves",direction:u(Fe).Down,xoffset:"-20px"},{default:fe(()=>[Ed]),_:1},8,["direction"])]),y("div",{onClick:v[3]||(v[3]=x=>{var D;return(D=i.value)==null?void 0:D.open()})},[n(wt,{display:"Options",direction:u(Fe).Down,xoffset:"-66px"},{default:fe(()=>[_d]),_:1},8,["direction"])])],16)):(A(),T("div",Ll({key:1,class:"overlay-nav"},k.$attrs),[y("div",{onClick:v[4]||(v[4]=x=>{var D;return(D=o.value)==null?void 0:D.open()}),class:"version-container"},[n(wt,{display:"Changelog",direction:u(Fe).Right,xoffset:"25%",class:"version"},{default:fe(()=>[y("span",null,"v"+Te(u(b)),1)]),_:1},8,["direction"])]),y("div",{onClick:v[5]||(v[5]=x=>{var D;return(D=l.value)==null?void 0:D.open()})},[n(wt,{display:"Saves",direction:u(Fe).Right},{default:fe(()=>[Sd]),_:1},8,["direction"])]),y("div",{onClick:v[6]||(v[6]=x=>{var D;return(D=i.value)==null?void 0:D.open()})},[n(wt,{display:"Options",direction:u(Fe).Right},{default:fe(()=>[Md]),_:1},8,["direction"])]),y("div",{onClick:v[7]||(v[7]=x=>{var D;return(D=t.value)==null?void 0:D.open()})},[n(wt,{display:"Info",direction:u(Fe).Right},{default:fe(()=>[xd]),_:1},8,["direction"])]),y("div",null,[y("a",Bd,[n(wt,{display:"Forums",direction:u(Fe).Right,xoffset:"7px"},{default:fe(()=>[Nd]),_:1},8,["direction"])])]),y("div",Dd,[y("span",{onClick:w,class:"material-icons"},"discord"),y("ul",Id,[u(p)?(A(),T("li",Td,[y("a",{href:u(p),target:"_blank"},Te(u(m)),9,Pd)])):G("",!0),Fd,Ud])])],16)),n(bu,{ref_key:"info",ref:t,changelog:o.value},null,8,["changelog"]),n(ln,{ref_key:"savesManager",ref:l},null,512),n(Mu,{ref_key:"options",ref:i},null,512),n(au,{ref_key:"changelog",ref:o},null,512)],64))}});var an=je(Rd,[["__scopeId","data-v-8495e562"]]);const Ja=e=>(Bl("data-v-e251e576"),e=e(),Nl(),e),Od={class:"inner-tab"},Ld={key:1},qd=Ja(()=>y("br",null,null,-1)),Gd=s(" You can help continue the "),$d=Ja(()=>y("i",null,"advent",-1)),Qd=s("ure at: "),Hd=Ja(()=>y("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[y("span",{class:"material-icons info-modal-discord"},"discord"),s(" The Paper Pilot Community ")],-1)),Vd=_e({__name:"Game",setup(e){const t=sl(pe,"tabs"),l=f(()=>Object.keys(Nt)),i=Ve.useHeader,o=yl(U.loreBody);function r(d){const{display:c,minimized:m,minWidth:p,name:b,color:w,minimizable:k,nodes:v,minimizedDisplay:x}=d;return{display:c,minimized:m,minWidth:p,name:b,color:w,minimizable:k,nodes:v,minimizedDisplay:x}}return(d,c)=>(A(),T("div",{class:vt(["tabs-container",{useHeader:u(i)}])},[(A(!0),T(S,null,vi(u(t),(m,p)=>{var b,w;return A(),T("div",{key:p,class:vt(["tab",u((b=u(Nt)[m])==null?void 0:b.classes)]),ref_for:!0,ref:`tab-${p}`,style:At(u((w=u(Nt)[m])==null?void 0:w.style))},[p===0&&!u(i)?(A(),ye(an,{key:0})):G("",!0),y("div",Od,[u(l).includes(m)?(A(),ye(Zr,Ll({key:0},r(u(Nt)[m]),{index:p,tab:()=>{var k;return(k=d.$refs[`tab-${p}`])==null?void 0:k[0]}}),null,16,["index","tab"])):(A(),ye(ct(m),{key:1,index:p},null,8,["index"]))])],6)}),128)),n(_t,{modelValue:u(U).showLoreModal.value,"onUpdate:modelValue":c[0]||(c[0]=m=>u(U).showLoreModal.value=m)},{header:fe(()=>[y("h2",null,Te(u(U).loreTitle.value),1)]),body:fe(()=>[u(o)?(A(),ye(ct(u(o)),{key:0})):G("",!0),u(U).loreScene.value!==-1?(A(),T("div",Ld,[n(Wr,{day:u(U).loreScene.value},null,8,["day"]),qd,Gd,$d,Qd,Hd])):G("",!0)]),_:1},8,["modelValue"])],2))}});var jd=je(Vd,[["__scopeId","data-v-e251e576"]]);const sa=e=>(Bl("data-v-4a50ce42"),e=e(),Nl(),e),zd={class:"game-over-modal-header"},Jd=["src","alt"],Wd={class:"game-over-modal-title"},Kd=sa(()=>y("h2",null,"Congratulations!",-1)),Xd={key:0},Yd=sa(()=>y("br",null,null,-1)),Zd=sa(()=>y("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),ec=sa(()=>y("br",null,null,-1)),tc=["href"],lc=sa(()=>y("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),ac=_e({__name:"GameOverScreen",setup(e){const{title:t,logo:l,discordName:i,discordLink:o,versionNumber:r,versionTitle:d}=Ve,c=f(()=>Vl(pe.timePlayed)),m=f(()=>ja.value&&!pe.keepGoing),p=sl(pe,"autosave");function b(){pe.keepGoing=!0}function w(){Rl(Ql())}return(k,v)=>(A(),ye(_t,{"model-value":u(m)},{header:fe(()=>[y("div",zd,[u(l)?(A(),T("img",{key:0,class:"game-over-modal-logo",src:u(l),alt:u(t)},null,8,Jd)):G("",!0),y("div",Wd,[Kd,y("h4",null,"You've beaten "+Te(u(t))+" v"+Te(u(r))+": "+Te(u(d)),1)])])]),body:fe(({shown:x})=>[x?(A(),T("div",Xd,[y("div",null,"It took you "+Te(u(c))+" to beat the game.",1),Yd,Zd,ec,y("div",null,[y("a",{href:u(o),class:"game-over-modal-discord-link"},[lc,s(" "+Te(u(i)),1)],8,tc)]),n(nl,{title:"Autosave",modelValue:u(p),"onUpdate:modelValue":v[0]||(v[0]=D=>gt(p)?p.value=D:null)},null,8,["modelValue"])])):G("",!0)]),footer:fe(()=>[y("div",{class:"game-over-footer"},[y("button",{onClick:b,class:"button"},"Keep Going"),y("button",{onClick:w,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var ic=je(ac,[["__scopeId","data-v-4a50ce42"]]);const Ea=e=>(Bl("data-v-3de07c06"),e=e(),Nl(),e),nc=Ea(()=>y("div",{class:"nan-modal-header"},[y("h2",null,"NaN value detected!")],-1)),oc={key:0},sc=Ea(()=>y("br",null,null,-1)),rc=["href"],uc=Ea(()=>y("span",{class:"material-icons nan-modal-discord"},"discord",-1)),dc=Ea(()=>y("br",null,null,-1)),cc={class:"nan-footer"},pc=_e({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:l}=Ve,i=sl(pe,"autosave"),o=sl(bt,"hasNaN"),r=j(null),d=f(()=>{var v;return(v=bt.NaNPath)==null?void 0:v.join(".")}),c=f(()=>{var v;return(v=bt.NaNPath)==null?void 0:v.slice(-1)[0]}),m=f(()=>bt.NaNReceiver&&c.value?bt.NaNReceiver[c.value]:null),p=f({get(){return pe.devSpeed===0},set(v){pe.devSpeed=v?null:0}});function b(){bt.NaNReceiver&&c.value&&(bt.NaNReceiver[c.value]=new a(0),bt.hasNaN=!1)}function w(){bt.NaNReceiver&&c.value&&(bt.NaNReceiver[c.value]=new a(1),bt.hasNaN=!1)}function k(){bt.NaNReceiver&&c.value&&(bt.NaNReceiver[c.value]=new a(NaN),bt.hasNaN=!1)}return(v,x)=>(A(),T(S,null,[n(_t,Ll({modelValue:u(o),"onUpdate:modelValue":x[4]||(x[4]=D=>gt(o)?o.value=D:null)},v.$attrs),{header:fe(()=>[nc]),body:fe(()=>[y("div",null,[s(' Attempted to assign "'+Te(u(d))+'" to NaN',1),u(m)?(A(),T("span",oc,Te(" ")+"(previously "+Te(u(H)(u(m)))+")",1)):G("",!0),s(". Auto-saving has been "+Te(u(i)?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),sc,y("div",null,[y("a",{href:u(l),class:"nan-modal-discord-link"},[uc,s(" "+Te(u(t)),1)],8,rc)]),dc,n(nl,{title:"Autosave",modelValue:u(i),"onUpdate:modelValue":x[0]||(x[0]=D=>gt(i)?i.value=D:null)},null,8,["modelValue"]),u(Ve).enablePausing?(A(),ye(nl,{key:0,title:"Pause game",modelValue:u(p),"onUpdate:modelValue":x[1]||(x[1]=D=>gt(p)?p.value=D:null)},null,8,["modelValue"])):G("",!0)]),footer:fe(()=>[y("div",cc,[y("button",{onClick:x[2]||(x[2]=D=>{var N;return(N=r.value)==null?void 0:N.open()}),class:"button"},"Open Saves Manager"),y("button",{onClick:b,class:"button"},"Set to 0"),y("button",{onClick:w,class:"button"},"Set to 1"),u(m)&&u(a).neq(u(m),0)&&u(a).neq(u(m),1)?(A(),T("button",{key:0,onClick:x[3]||(x[3]=D=>o.value=!1),class:"button"}," Set to previous ")):G("",!0),y("button",{onClick:k,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),n(ln,{ref_key:"savesManager",ref:r},null,512)],64))}});var mc=je(pc,[["__scopeId","data-v-3de07c06"]]);const vc={key:0,class:"tpsDisplay"},fc={key:0,class:"low"},gc=_e({__name:"TPS",setup(e){const t=f(()=>a.div(bt.lastTenTicks.length,bt.lastTenTicks.reduce((r,d)=>r+d,0))),l=j([]);Qt(()=>{l.value.push(Math.round(t.value.toNumber())),l.value.length>10&&(l.value=l.value.slice(1))});const i=f(()=>l.value.reduce((r,d)=>a.max(r,d),0)),o=f(()=>a.sub(t.value,i.value).gt(1));return(r,d)=>u(t).isNan()?G("",!0):(A(),T("div",vc,[s(" TPS: "+Te(u(le)(u(t)))+" ",1),n(ba,{name:"fade"},{default:fe(()=>[u(o)?(A(),T("span",fc,Te(u(le)(u(i))),1)):G("",!0)]),_:1})]))}});var yc=je(gc,[["__scopeId","data-v-46a3ed5b"]]);var hc=_e({__name:"App",setup(e){const t=Ve.useHeader,l=f(()=>Jl[ot.theme].variables),i=sl(ot,"showTPS"),o=f(()=>He(_(()=>n(S,null,[Oo.map(me)]))));return(r,d)=>(A(),T(S,null,[y("div",{id:"modal-root",style:At(u(l))},null,4),y("div",{class:vt(["app",{useHeader:u(t)}]),style:At(u(l))},[u(t)?(A(),ye(an,{key:0})):G("",!0),n(jd),u(u(i))?(A(),ye(yc,{key:1})):G("",!0),n(ic),n(mc),(A(),ye(ct(u(o))))],6)],64))}});var bc=je(hc,[["__scopeId","data-v-580927bb"]]);function wc(e={}){const{immediate:t=!1,onNeedRefresh:l,onOfflineReady:i,onRegistered:o,onRegisterError:r}=e;let d,c;const m=async(p=!0)=>{p&&(d==null||d.addEventListener("controlling",b=>{b.isUpdate&&window.location.reload()})),c&&c.waiting&&await bn(c.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){d=new hn("./sw.js",{scope:"./",type:"classic"}),d.addEventListener("activated",p=>{p.isUpdate||i==null||i()});{const p=()=>{l==null||l()};d.addEventListener("waiting",p),d.addEventListener("externalwaiting",p)}d.register({immediate:t}).then(p=>{c=p,o==null||o(p)}).catch(p=>{r==null||r(p)})}return m}function Ac(e={}){const{immediate:t=!0,onNeedRefresh:l,onOfflineReady:i,onRegistered:o,onRegisterError:r}=e,d=j(!1),c=j(!1);return{updateServiceWorker:wc({immediate:t,onNeedRefresh(){d.value=!0,l==null||l()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:o,onRegisterError:r}),offlineReady:c,needRefresh:d}}document.title=Ve.title;window.projInfo=Ve;if(Ve.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 To();const{globalBus:e}=await pa(()=>Promise.resolve().then(function(){return go}),void 0),{startGameLoop:t}=await pa(()=>import("./gameLoop.922f516c.js"),["assets/gameLoop.922f516c.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=pn(bc);e.emit("setupVue",l),l.mount("#app"),Ol(()=>{const i=gi(),{updateServiceWorker:o}=Ac({onNeedRefresh(){i.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){o()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(r){r&&setInterval(()=>r.update(),60*60*1e3)}})}),t()});export{a as D,pa as _,bt as a,Ve as b,Ir as c,lt as g,Ga as l,pe as p,ot as s};