pages/advent/assets/index.2d92bfa3.js

19 lines
260 KiB
JavaScript

/* empty css */import"./vue.92681fcb.js";import{Z as g,l as yt,aa as pe,t as j,ay as sa,ar as Sl,aE as A,a0 as D,aK as Ht,a1 as f,O as N,aG as Yl,A as vt,_ as oe,a8 as n,b6 as de,b8 as ra,bs as si,C as u,aq as hl,bu as Ll,bb as ua,T as nn,a7 as r,u as da,j as on,bv as _a,q as jl,b1 as zt,G as et,aC as ri,w as Ft,b2 as Pt,ao as sn,I as nt,aN as Xe,$ as L,J as Se,aH as rl,aF as ul,z as Kt,al as ta,aL as ll,H as rn,aJ as Ba,bn as un,br as dn,be as cn}from"./@vue.4ce677c2.js";import{c as ui}from"./nanoevents.1080beb7.js";import{L as gl}from"./lz-string.731cedc5.js";import{i as pn}from"./is-plain-object.906d88e8.js";import{Y as mn}from"./vue-next-select.a2bfab1d.js";import{s as vn,u as di}from"./vue-toastification.6f567382.js";import{D as gn}from"./vuedraggable.7949458c.js";import{p as fn}from"./vue-textarea-autosize.35804eaf.js";import{v as yn,n as hn}from"./workbox-window.8d14e8b7.js";import"./sortablejs.29100d8a.js";const bn=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 s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function l(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerpolicy&&(s.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?s.credentials="include":o.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(o){if(o.ep)return;o.ep=!0;const s=l(o);fetch(o.href,s)}};bn();const wn="modulepreload",ja={},An="./",la=function(t,l){return!l||l.length===0?t():Promise.all(l.map(i=>{if(i=`${An}${i}`,i in ja)return;ja[i]=!0;const o=i.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${s}`))return;const c=document.createElement("link");if(c.rel=o?"stylesheet":wn,o||(c.as="script",c.crossOrigin=""),c.href=i,document.head.appendChild(c),o)return new Promise((d,p)=>{c.addEventListener("load",d),c.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},Cn="./projInfo-schema.json",kn="Advent Incremental",En="An incremental game you play a day at a time, leading up to Christmas!",_n="advent-incremental",Sn="thepaperpilot and friends",Bn="",Nn="",Mn="0.4",In="Initial Commit",Dn=!0,xn=!1,Pn=2,Tn=!0,Fn=null,Un="",Rn=["main"],On=3600,qn=0,Gn=!0,Ln="base64";var Oe={$schema:Cn,title:kn,description:En,id:_n,author:Sn,discordName:Bn,discordLink:Nn,versionNumber:Mn,versionTitle:In,allowGoBack:Dn,defaultShowSmall:xn,defaultDecimalsShown:Pn,useHeader:Tn,banner:Fn,logo:Un,initialTabs:Rn,maxTickLength:On,offlineLimit:qn,enablePausing:Gn,exportEncoding:Ln};const ba=17,$n=9e15,Qn=Math.log10(9e15),Vn=1/9e15,Hn=308,jn=-324,Wa=5,Wn=function(){const e=[];for(let l=jn+1;l<=Hn;l++)e.push(Number("1e"+l));const t=323;return function(l){return e[l+t]}}(),kl=[2,Math.E,3,4,5,6,7,8,9,10],Jn=[[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]],zn=[[-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)},fe=function(e,t,l){return a.fromComponents(e,t,l)},Ne=function(t,l,i){return a.fromComponents_noNormalize(t,l,i)},vl=function(t,l){const i=l+1,o=Math.ceil(Math.log10(Math.abs(t))),s=Math.round(t*Math.pow(10,i-o))*Math.pow(10,o-i);return parseFloat(s.toFixed(Math.max(i-o,0)))},wa=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Kn=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},ci=.5671432904097838,Ja=function(e,t=1e-10){let l,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return ci;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,s;if(!Number.isFinite(e.mag)||e===a.dZero)return e;if(e===a.dOne)return C(ci);a.abs(e),l=a.ln(e);for(let c=0;c<100;++c){if(i=a.exp(-l),o=l.sub(e.mul(i)),s=l.sub(o.div(l.add(1).sub(l.add(2).mul(o).div(a.mul(2,l).add(2))))),a.abs(s.sub(l)).lt(a.abs(s).mul(t)))return s;l=s}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/Wn(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=Ne(1,0,1)){return C(e).tetrate(t,l)}static iteratedexp(e,t=2,l=Ne(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=Ne(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 Ne(0,0,0);const t=Math.random()>.5?1:-1;if(Math.random()*20<1)return Ne(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)),fe(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 s=t.add(i.mul(l)).sub(l.div(2)),c=s.pow(2);return s.neg().add(c.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>=$n)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e<Qn&&this.layer>0;)this.layer-=1,this.layer===0?this.mag=Math.pow(10,this.mag):(this.mag=t*Math.pow(10,e),e=Math.abs(this.mag),t=Math.sign(this.mag));return this.layer===0&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):this.mag===0&&(this.sign=0)),this}fromComponents(e,t,l){return this.sign=e,this.layer=t,this.mag=l,this.normalize(),this}fromComponents_noNormalize(e,t,l){return this.sign=e,this.layer=t,this.mag=l,this}fromMantissaExponent(e,t){return this.layer=1,this.sign=Math.sign(e),e=Math.abs(e),this.mag=t+Math.log10(e),this.normalize(),this}fromMantissaExponent_noNormalize(e,t){return this.fromMantissaExponent(e,t),this}fromDecimal(e){return this.sign=e.sign,this.layer=e.layer,this.mag=e.mag,this}fromNumber(e){return this.mag=Math.abs(e),this.sign=Math.sign(e),this.layer=0,this.normalize(),this}fromString(e){e=e.replace(",","");const t=e.split("^^^");if(t.length===2){const w=parseFloat(t[0]),v=parseFloat(t[1]),E=t[1].split(";");let S=1;if(E.length===2&&(S=parseFloat(E[1]),isFinite(S)||(S=1)),isFinite(w)&&isFinite(v)){const x=I.pentate(w,v,S);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,this}}const l=e.split("^^");if(l.length===2){const w=parseFloat(l[0]),v=parseFloat(l[1]),E=l[1].split(";");let S=1;if(E.length===2&&(S=parseFloat(E[1]),isFinite(S)||(S=1)),isFinite(w)&&isFinite(v)){const x=I.tetrate(w,v,S);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,this}}const i=e.split("^");if(i.length===2){const w=parseFloat(i[0]),v=parseFloat(i[1]);if(isFinite(w)&&isFinite(v)){const E=I.pow(w,v);return this.sign=E.sign,this.layer=E.layer,this.mag=E.mag,this}}e=e.trim().toLowerCase();let o,s,c=e.split("pt");if(c.length===2){o=10,s=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let w=parseFloat(c[1]);if(isFinite(w)||(w=1),isFinite(o)&&isFinite(s)){const v=I.tetrate(o,s,w);return this.sign=v.sign,this.layer=v.layer,this.mag=v.mag,this}}if(c=e.split("p"),c.length===2){o=10,s=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let w=parseFloat(c[1]);if(isFinite(w)||(w=1),isFinite(o)&&isFinite(s)){const v=I.tetrate(o,s,w);return this.sign=v.sign,this.layer=v.layer,this.mag=v.mag,this}}const d=e.split("e"),p=d.length-1;if(p===0){const w=parseFloat(e);if(isFinite(w))return this.fromNumber(w)}else if(p===1){const w=parseFloat(e);if(isFinite(w)&&w!==0)return this.fromNumber(w)}const m=e.split("e^");if(m.length===2){this.sign=1,m[0].charAt(0)=="-"&&(this.sign=-1);let w="";for(let v=0;v<m[1].length;++v){const E=m[1].charCodeAt(v);if(E>=43&&E<=57||E===101)w+=m[1].charAt(v);else return this.layer=parseFloat(w),this.mag=parseFloat(m[1].substr(v+1)),this.normalize(),this}}if(p<1)return this.sign=0,this.layer=0,this.mag=0,this;const h=parseFloat(d[0]);if(h===0)return this.sign=0,this.layer=0,this.mag=0,this;let y=parseFloat(d[d.length-1]);if(p>=2){const w=parseFloat(d[d.length-2]);isFinite(w)&&(y*=Math.sign(w),y+=wa(w))}if(!isFinite(h))this.sign=d[0]==="-"?-1:1,this.layer=p,this.mag=y;else if(p===1)this.sign=Math.sign(h),this.layer=1,this.mag=y+Math.log10(Math.abs(h));else if(this.sign=Math.sign(h),this.layer=p,p===2){const w=I.mul(fe(1,2,y),C(h));return this.sign=w.sign,this.layer=w.layer,this.mag=w.mag,this}else this.mag=y;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:vl(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:vl(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<=Wa?(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):vl(this.m,e)+"e"+vl(this.e,e):this.layer===1?vl(this.m,e)+"e"+vl(this.e,e):this.layer<=Wa?(this.sign===-1?"-":"")+"e".repeat(this.layer)+vl(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+vl(this.mag,e)}abs(){return Ne(this.sign===0?0:1,this.layer,this.mag)}neg(){return Ne(-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?fe(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?I.dZero:this.layer===0?fe(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?I.dZero:this.layer===0?fe(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?I.dZero:this.layer===0?fe(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 Ne(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),s=i.layer*Math.sign(i.mag);if(o-s>=2)return l;if(o===0&&s===-1){if(Math.abs(i.mag-Math.log10(l.mag))>ba)return l;{const c=Math.pow(10,Math.log10(l.mag)-i.mag),d=i.sign+l.sign*c;return fe(Math.sign(d),1,i.mag+Math.log10(Math.abs(d)))}}if(o===1&&s===0){if(Math.abs(l.mag-Math.log10(i.mag))>ba)return l;{const c=Math.pow(10,l.mag-Math.log10(i.mag)),d=i.sign+l.sign*c;return fe(Math.sign(d),1,Math.log10(i.mag)+Math.log10(Math.abs(d)))}}if(Math.abs(l.mag-i.mag)>ba)return l;{const c=Math.pow(10,l.mag-i.mag),d=i.sign+l.sign*c;return fe(Math.sign(d),1,i.mag+Math.log10(Math.abs(d)))}}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 Ne(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return Ne(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 fe(l.sign*i.sign,l.layer,l.mag);if(l.layer===1&&i.layer===0)return fe(l.sign*i.sign,1,l.mag+Math.log10(i.mag));if(l.layer===1&&i.layer===1)return fe(l.sign*i.sign,1,l.mag+i.mag);if(l.layer===2&&i.layer===1){const o=fe(Math.sign(l.mag),l.layer-1,Math.abs(l.mag)).add(fe(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return fe(l.sign*i.sign,o.layer+1,o.sign*o.mag)}if(l.layer===2&&i.layer===2){const o=fe(Math.sign(l.mag),l.layer-1,Math.abs(l.mag)).add(fe(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return fe(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?fe(this.sign,0,1/this.mag):fe(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=wa(o)),this.layer<l.layer&&(i=wa(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?fe(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):fe(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?I.dNaN:this.layer>0?fe(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):fe(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?fe(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?fe(this.sign,0,Math.log2(this.mag)):this.layer===1?fe(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?fe(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):fe(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?I.dNaN:this.layer===0?fe(this.sign,0,Math.log(this.mag)):this.layer===1?fe(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?fe(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):fe(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)?Ne(1,0,1):l;if(l.sign===1&&l.layer===0&&l.mag===1)return l;if(i.sign===0)return Ne(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 fe(1,0,t);if(e.sign===0)return I.dOne;e=Ne(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?fe(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?fe(-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(Ne(1,0,24)))return C(Kn(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,s=1/o,c=t+s;if(c===t||(t=c,i=i*l,o=360*i,s=1/o,c=t-s,c===t))return I.exp(t);t=c,i=i*l,o=1260*i;let d=1/o;return t=t+d,i=i*l,o=1680*i,d=1/o,t=t-d,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?fe(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?fe(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):fe(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 fe(1,2,Math.log10(this.mag)-.3010299956639812);{const e=I.div(Ne(this.sign,this.layer-1,this.mag),Ne(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=Ne(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 s=I.ln(this).neg();return s.lambertw().div(s)}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 s=t;if(t=this.pow(t),s.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 Ne(t.sign,t.layer+(e-o-1),t.mag);if(o>1e4)return t}return t}iteratedexp(e=2,t=Ne(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 s=Math.min(t,l.layer-e.layer-3);t-=s,l.layer-=s}for(let s=0;s<t;++s){if(l=l.log(e),!isFinite(l.layer)||!isFinite(l.mag))return l.normalize();if(s>1e4)return l}return 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,zn)}static tetrate_critical(e,t){return I.critical_section(e,t,Jn)}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 d=0;d<kl.length;++d)if(kl[d]==e){i=l[d][Math.floor(t)],o=l[d][Math.ceil(t)];break}else if(kl[d]<e&&kl[d+1]>e){const p=(e-kl[d])/(kl[d+1]-kl[d]);i=l[d][Math.floor(t)]*(1-p)+l[d+1][Math.floor(t)]*p,o=l[d][Math.ceil(t)]*(1-p)+l[d+1][Math.ceil(t)]*p;break}const s=t-Math.floor(t);return i*(1-s)+o*s}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(Ja(this.toNumber()));if(this.layer===0)return C(Ja(this.sign*this.mag));if(this.layer===1)return za(this);if(this.layer===2)return za(this);if(this.layer>=3)return Ne(this.sign,this.layer-1,this.mag);throw"Unhandled behavior in lambertw()"}ssqrt(){if(this.sign==1&&this.layer>=3)return Ne(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=Ne(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)):Ne(0,0,0)}cos(){return this.mag<0?I.dOne:this.layer===0?C(Math.cos(this.sign*this.mag)):Ne(0,0,0)}tan(){return this.mag<0?this:this.layer===0?C(Math.tan(this.sign*this.mag)):Ne(0,0,0)}asin(){return this.mag<0?this:this.layer===0?C(Math.asin(this.sign*this.mag)):Ne(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)):Ne(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)?Ne(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=Ne(0,0,0);a.dOne=Ne(1,0,1);a.dNegOne=Ne(-1,0,1);a.dTwo=Ne(1,0,2);a.dTen=Ne(1,0,10);a.dNaN=Ne(Number.NaN,Number.NaN,Number.NaN);a.dInf=Ne(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);a.dNegInf=Ne(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);a.dNumberMax=fe(1,0,Number.MAX_VALUE);a.dNumberMin=fe(1,0,Number.MIN_VALUE);const Xn=new a(1);function ql(e,t,l=!0){let i=a.log10(e).floor(),o=a.div(e,a.pow(10,i));o.toStringWithDecimalPlaces(t)==="10"&&(o=Xn,i=i.add(1));const s=i.gte(1e9)?be(i,Math.max(Math.max(t,3),Oe.defaultDecimalsShown)):i.gte(1e4)?aa(i,0):i.toStringWithDecimalPlaces(0);return l?o.toStringWithDecimalPlaces(t)+"e"+s:"e"+s}function aa(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 pi(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()),Oe.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Yn=new a("eeee1000"),Zn=new a("e100000"),Ka=new a("e1000"),mi=new a(1e9),eo=new a(1e6),to=new a(1e3),lo=new a(.98),ao=new a(.001),vi=new a(0);function be(e,t,l){if(t==null&&(t=Oe.defaultDecimalsShown),l=l!=null?l:Oe.defaultShowSmall,e=new a(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+be(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Yn)){const i=e.slog();return i.gte(eo)?"F"+be(i.floor()):a.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+aa(i.floor(),0)}else{if(e.gte(Zn))return ql(e,0,!1);if(e.gte(Ka))return ql(e,0);if(e.gte(mi))return ql(e,t);if(e.gte(to))return aa(e,0);if(e.gte(ao)||!l)return pi(e,t);if(e.eq(vi))return 0 .toFixed(t)}return e=gi(e),e.lt(Ka)?ql(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):be(e,t)+"\u207B\xB9"}function ye(e){return e=new a(e),e.sign<0?"-"+ye(e.neg()):e.gte(mi)||e.lte(lo)&&!e.eq(vi)?be(e):be(e,0)}function Na(e,t){return t==null&&(t=Oe.defaultDecimalsShown),a.lt(e,0)?"-"+Na(a.neg(e),t):a.gt(e,2**51)?be(a.div(e,31536e3))+"y":(e=new a(e).toNumber(),e<60?be(e)+"s":e<3600?ye(Math.floor(e/60))+"m "+be(e%60,t)+"s":e<86400?ye(Math.floor(e/3600))+"h "+ye(Math.floor(e/60)%60)+"m "+ye(e%60)+"s":e<31536e3?ye(Math.floor(e/84600)%365)+"d "+ye(Math.floor(e/3600)%24)+"h "+ye(Math.floor(e/60)%60)+"m":ye(Math.floor(e/31536e3))+"y "+ye(Math.floor(e/84600)%365)+"d "+ye(Math.floor(e/3600)%24)+"h")}function io(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 no(e,t){return be(e,t,!0)}function gi(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 fi(e,t,l=a.dOne){let i=e[0][0],o=e[0][1];for(let s=1;s<e.length;s++)a.lt(e[s][0],i)&&(i=e[s][0],o=e[s][1]);return be(a.times(i,l))+t+", limited by "+o}function yi(e){return{[-1]:`${be(e)}/s`,0:"",1:`+${be(e)}/s`}[a.compare(e,0)]}var oo=Object.freeze(Object.defineProperty({__proto__:null,default:a,exponentialFormat:ql,commaFormat:aa,regularFormat:pi,format:be,formatWhole:ye,formatTime:Na,toPlaces:io,formatSmall:no,invertOOM:gi,formatLimit:fi,formatGain:yi},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:so,commaFormat:ro,regularFormat:uo,format:H,formatWhole:ae,formatTime:ca,toPlaces:co,formatSmall:po,formatLimit:hi,invertOOM:mo,formatGain:ia}=oo;window.Decimal=a;window.exponentialFormat=so;window.commaFormat=ro;window.regularFormat=uo;window.format=H;window.formatWhole=ae;window.formatTime=ca;window.toPlaces=co;window.formatSmall=po;window.formatLimit=hi;window.invertOOM=mo;window.formatGain=ia;function bi(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Sa(e){return typeof e=="function"}var De=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(De||{});const $l=Symbol("DoNotCache");function Q(e,t){const l=e[t];Sa(l)&&l.length===0&&!l[$l]?e[t]=g(l.bind(e)):Sa(l)&&(e[t]=l.bind(e),e[t][$l]=!0)}function bt(e){return Sa(e)&&!e[$l]&&(e=g(e)),e}const Xt=Symbol("Component"),al=Symbol("GatherProps");let vo=0;function wl(e="feature-"){return e+vo++}var Ke=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(Ke||{});function B(e){return e[$l]=!0,e}function b(e,t=2){return e?0:t}function ht(e,t,l){e[t]===void 0&&l!=null&&(e[t]=l)}function wi(e,...t){const l=[],i=o=>{Object.keys(o).forEach(s=>{const c=o[s];c&&typeof c=="object"&&(t.includes(c.type)?l.push(c):!(c instanceof a)&&!yt(c)&&i(c))})};return i(e),l}const El={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 Ma=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Ma||{}),Nl={classic:El,paper:{...El,variables:{...El.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:{...El,variables:{...El.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:{...El,variables:{...El.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const je=ui();document.fonts.onloadingdone=()=>je.emit("fontsLoaded");var go=Object.freeze(Object.defineProperty({__proto__:null,globalBus:je},Symbol.toStringTag,{value:"Module"}));var Ue=(e,t)=>{const l=e.__vccOpts||e;for(const[i,o]of t)l[i]=o;return l};const fo=pe({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var h;const l=j({}),i=new ResizeObserver(d),o=j(null);sa(()=>{const y=o.value;y!=null&&i.observe(y)});let s=!0,c=j((h=o.value)==null?void 0:h.getBoundingClientRect());function d(){s&&(s=!1,Sl(()=>{var y;c.value=(y=o.value)==null?void 0:y.getBoundingClientRect(),Object.values(l.value).filter(w=>w).forEach(w=>w.rect=w.element.getBoundingClientRect()),t("updateNodes",l.value),s=!0}))}je.on("fontsLoaded",d);const p={attributes:!1,childList:!0,subtree:!1};Yl(Ia,(y,w)=>{const v=new MutationObserver(()=>m(y));v.observe(w,p),l.value[y]={element:w,observer:v,rect:w.getBoundingClientRect()},d()}),Yl(Da,y=>{var w;(w=l.value[y])==null||w.observer.disconnect(),l.value[y]=void 0,d()}),Yl(xa,l),Yl(Pa,c);function m(y){const w=l.value[y];w!=null&&(w.rect=w.element.getBoundingClientRect(),t("updateNodes",l.value))}return(y,w)=>(A(),D(N,null,[Ht(y.$slots,"default",{},void 0,!0),f("div",{ref_key:"resizeListener",ref:o,class:"resize-listener"},null,512)],64))}});var Ai=Ue(fo,[["__scopeId","data-v-2b1dc1bc"]]);const yo=["onPointerdown"],ho={class:"modal-wrapper"},bo={class:"modal-container"},wo={class:"modal-header"},Ao=r(" default header "),Co={class:"modal-body"},ko=r(" default body "),Eo={class:"modal-footer"},_o=f("div",{class:"modal-default-flex-grow"},null,-1),wt=pe({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:l}){const o=vt(e),s=g(()=>o.modelValue||d.value);function c(){l("update:modelValue",!1)}const d=j(!1),p=j(null),m=g(()=>{var h,y;return(y=(h=p.value)==null?void 0:h.nodes)!=null?y:null});return t({isOpen:s,nodes:m}),(h,y)=>(A(),oe(nn,{to:"#modal-root"},[n(ua,{name:"modal",onBeforeEnter:y[0]||(y[0]=w=>d.value=!0),onAfterLeave:y[1]||(y[1]=w=>d.value=!1)},{default:de(()=>[ra(f("div",hl({class:"modal-mask",onPointerdown:Ll(c,["self"])},h.$attrs),[f("div",ho,[f("div",bo,[f("div",wo,[Ht(h.$slots,"header",{shown:u(s)},()=>[Ao])]),f("div",Co,[n(Ai,{ref_key:"contextRef",ref:p},{default:de(()=>[Ht(h.$slots,"body",{shown:u(s)},()=>[ko])]),_:3},512)]),f("div",Eo,[Ht(h.$slots,"footer",{shown:u(s)},()=>[f("div",{class:"modal-default-footer"},[_o,f("button",{class:"button modal-default-button",onClick:c}," Close ")])])])])])],16,yo),[[si,e.modelValue]])]),_:3})]))}}),Ia=Symbol("RegisterNode"),Da=Symbol("UnregisterNode"),xa=Symbol("Nodes"),Pa=Symbol("Bounds"),Et=da({});window.layers=Et;const Dl={},$t=[];function Tt(e,t){return St(()=>{const l={},i=l.emitter=ui();if(l.on=i.on.bind(i),l.emit=i.emit.bind(i),l.nodes=j({}),l.id=e,$t.push(e),Dl[e]=new Set,l.minimized=_e(!1),Object.assign(l,t.call(l)),$t[$t.length-1]==null||$t[$t.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
Stack: ${$t}
Trying to pop ${l.id}`;return $t.pop(),Q(l,"color"),Q(l,"display"),Q(l,"name"),ht(l,"name",l.id),Q(l,"minWidth"),ht(l,"minWidth",600),Q(l,"minimizable"),ht(l,"minimizable",!0),l})}function Ci(e,t){if(console.info("Adding layer",e.id),Et[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,Et[e.id]);return}ht(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),Et[e.id]=e,je.emit("addLayer",e,t.layers[e.id])}function So(e){return Et[e]}function ki(e){console.info("Removing layer",e.id),je.emit("removeLayer",e),Et[e.id]=void 0}function Bo(e){ki(e),Ci(e,ne)}function No(e){const t=j(!1);return{openModal:()=>t.value=!0,modal:B(()=>n(wt,{modelValue:t.value,"onUpdate:modelValue":l=>t.value=l},{header:()=>n("h2",null,[u(e.name)]),body:u(e.display)}))}}je.on("update",function(t){Object.values(Et).forEach(l=>{l==null||l.emit("preUpdate",t)}),Object.values(Et).forEach(l=>{l==null||l.emit("update",t)}),Object.values(Et).forEach(l=>{l==null||l.emit("postUpdate",t)})});var Mo=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Ia,UnregisterNodeInjectionKey:Da,NodesInjectionKey:xa,BoundsInjectionKey:Pa,layers:Et,persistentRefs:Dl,addingLayers:$t,createLayer:Tt,addLayer:Ci,getLayer:So,removeLayer:ki,reloadLayer:Bo,setupLayerModal:No},Symbol.toStringTag,{value:"Module"}));const Ta=Symbol("PersistentState"),yl=Symbol("DefaultValue"),na=Symbol("StackTrace"),Ei=Symbol("Deleted"),Ql=Symbol("NonPersistent"),Gl=Symbol("SaveDataPath");function Io(){var e;return((e=new Error().stack)==null?void 0:e.split(`
`).slice(3,5).map(t=>t.trim()).join(`
`))||""}function _e(e){const t=yt(e)?e:j(e);t[Ta]=t,t[yl]=yt(e)?e.value:e,t[na]=Io(),t[Ei]=!1;const l=g({get(){return t.value},set(i){t.value=i}});return l[yl]=t[yl],t[Ql]=l,t[Gl]=void 0,$t.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",t,`
Created at:
`+t[na]):Dl[$t[$t.length-1]].add(t),t}function Do(e){return e&&typeof e=="object"&&Ta in e}function F(e){return e[Ql]}je.on("addLayer",(e,t)=>{const l=[],i=(o,s=[])=>{let c=!1;return Object.keys(o).forEach(d=>{let p=o[d];if(p&&typeof p=="object")if(st in p&&(p=p[st]),Do(p)){if(c=!0,p[Ei]){console.warn("Deleted persistent ref present in returned object. Ignoring...",p,`
Created at:
`+p[na]);return}Dl[e.id].delete(p);const m=[e.id,...s,d];p[Gl]!=null&&JSON.stringify(m)!==JSON.stringify(p[Gl])&&console.error(`Persistent ref is being saved to \`${m.join(".")}\` when it's already present at \`${p[Gl].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,p),p[Gl]=m;const h=s.reduce((w,v)=>(v in w||(w[v]={}),w[v]),t),y=h[d];h[d]=p[Ta],on(h)?y!=null?h[d]=y:h[d]=p[yl]:y!=null?h[d].value=y:h[d].value=p[yl]}else!(p instanceof a)&&!yt(p)&&!l.includes(p)&&(typeof p.type=="symbol"&&l.push(p),i(p,[...s,d])&&(_a(p)&&!_a(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.",st in o?o[st]:o,d):c=!0))}),c};i(e[st]),Dl[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[na])}),Dl[e.id].clear()});const st=Symbol("ProxyState"),Il=Symbol("ProxyPath");function St(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(s,c){if(c===st)return o();const d=o()[c];return d&&typeof d=="object"&&Ql in d?d[Ql]:d},set(s,c,d){return o()[c]=d,!0},has(s,c){return c===st?!0:Reflect.has(o(),c)},ownKeys(){return Reflect.ownKeys(o())},getOwnPropertyDescriptor(s,c){return i||(Object.assign(l,e(l)),i=!0),Object.getOwnPropertyDescriptor(s,c)}})}var ct=window.state=da({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const _i=jl({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{},usingLog:!1});function Si(e){return JSON.stringify(e,(t,l)=>u(l))}const Bi={get(e,t){var i;if(t===st||t===Il)return e[t];const l=e[st][t];if(t!=="value"&&(pn(l)||Array.isArray(l))){if(l!==((i=e[t])==null?void 0:i[st])){const o=[...e[Il],t];e[t]=new Proxy({[st]:l,[Il]:o},Bi)}return e[t]}return l},set(e,t,l,i){if(!ct.hasNaN&&(typeof l=="number"&&isNaN(l)||l instanceof a&&(isNaN(l.sign)||isNaN(l.layer)||isNaN(l.mag)))){const o=e[st][t];if(!(typeof o=="number"&&isNaN(o)||o instanceof a&&(isNaN(o.sign)||isNaN(o.layer)||isNaN(o.mag))))throw _i.autosave=!1,ct.hasNaN=!0,ct.NaNPath=[...e[Il],t],ct.NaNReceiver=i,console.error("Attempted to set NaN value",[...e[Il],t],e[st]),"Attempted to set NaN value. See above for details"}return e[st][t]=l,!0},ownKeys(e){return Reflect.ownKeys(e[st])},has(e,t){return Reflect.has(e[st],t)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e[st],t)}};var ne=window.player=new Proxy({[st]:_i,[Il]:["player"]},Bi);function Ni(e={}){return Object.assign({id:`${Oe.id}-0`,name:"Default Save",tabs:Oe.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:Oe.id,modVersion:Oe.versionNumber,layers:{}},e)}function Qt(e){const t=gl.compressToUTF16(Si(e!=null?e:ne[st]));return localStorage.setItem((e!=null?e:ne[st]).id,t),t}async function xo(){To();try{let e=localStorage.getItem(lt.active);if(e==null){await _l(xl());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=gl.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==Oe.id){await _l(xl());return}t.id=lt.active,await _l(t)}catch(e){console.error(`Failed to load save. Falling back to new save.
`,e),await _l(xl())}}function xl(){const e=ea(),t=Ni({id:e});return Qt(t),lt.saves.push(e),t}function ea(){let e,t=0;do e=`${Oe.id}-${t++}`;while(localStorage.getItem(e));return e}const Fa=j(!1);async function _l(e){console.info("Loading save",e),Fa.value=!0;const{layers:t,removeLayer:l,addLayer:i}=await la(()=>Promise.resolve().then(function(){return Mo}),void 0),{fixOldSave:o,getInitialLayers:s}=await la(()=>Promise.resolve().then(function(){return Or}),void 0);for(const c in t){const d=t[c];d&&l(d)}s(e).forEach(c=>i(c,e)),e=Ni(e),e.offlineProd&&e.time&&e.devSpeed!==0&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=Math.min(e.offlineTime+(Date.now()-e.time)/1e3,Oe.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==Oe.versionNumber&&(o(e.modVersion,e),e.modVersion=Oe.versionNumber),Object.assign(ne,e),lt.active=ne.id,je.emit("onLoad")}setInterval(()=>{ne.autosave&&Qt()},1e3);window.onbeforeunload=()=>{ne.autosave&&Qt()};window.save=Qt;const Po=window.hardReset=async()=>{await _l(xl())},Vl=jl({active:"",saves:[],showTPS:!0,theme:Ma.Nordic,unthrottled:!1});zt(Vl,e=>{const t=gl.compressToUTF16(JSON.stringify(e));localStorage.setItem(Oe.id,t)},{deep:!0});var lt=window.settings=Vl;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Ma.Nordic};je.emit("loadSettings",e),Object.assign(Vl,e),Po()};function To(){try{let e=localStorage.getItem(Oe.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=gl.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Vl,t)}je.emit("loadSettings",Vl)}catch{}}const Mi=jl([]);function Fo(e){Mi.push(e)}const Ii=jl([]);function Uo(e){Ii.push(e)}const Ro=jl([]),Oo={class:"table"},Dt=pe({__name:"Column",setup(e){const t=g(()=>Nl[lt.theme].mergeAdjacent);return(l,i)=>(A(),D("div",Oo,[f("div",{class:et(["col",{mergeAdjacent:u(t)}])},[Ht(l.$slots,"default")],2)]))}}),qo={class:"table"},Tl=pe({__name:"Row",setup(e){const t=g(()=>Nl[lt.theme].mergeAdjacent);return(l,i)=>(A(),D("div",qo,[f("div",{class:et(["row",{mergeAdjacent:u(t)}])},[Ht(l.$slots,"default")],2)]))}});function Ua(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!sn(e)}function Te(e,t="span"){return typeof e=="function"?pe({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),pe({template:e})):pe({render:()=>({})}):e}function le(e){if(Gt(e))return typeof e=="function"?e():Te(e);const t=e[Xt];return n(t,e[al](),null)}function ze(...e){let t;return n(Tl,null,Ua(t=e.map(le))?t:{default:()=>[t]})}function jt(...e){let t;return n(Dt,null,Ua(t=e.map(le))?t:{default:()=>[t]})}function Bl(...e){return n("div",{class:"table-grid"},[e.map(t=>n("div",{class:{["row-grid"]:!0,mergeAdjacent:Nl[lt.theme].mergeAdjacent}},[t.map(le)]))])}function Wt(e){if(Gt(e))return typeof e=="function"?e():typeof e=="string"?n(N,null,[e]):n(e,null,null);const t=e[Xt];return n(t,e[al](),null)}function Go(...e){let t;return n(Dt,null,Ua(t=e.map(Wt))?t:{default:()=>[t]})}function Gt(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[$l]===!0}function Di(e,t,l){const i=j(null),o=j(void 0);function s(p){i.value||(i.value=setInterval(d,250)),o.value=p,l&&(l.value=!0)}function c(){i.value&&(clearInterval(i.value),i.value=null),l&&(l.value=!1)}function d(){t&&t.value?t.value():e&&e.value&&e.value(o.value)}return ri(c),{start:s,stop:c,handleHolding:d}}function Lo(e,t){const l=g(()=>e.filter(i=>u(i.visibility)===Ke.Visible&&t(i)));return{firstFeature:g(()=>l.value[0]),collapsedContent:B(()=>jt(...l.value.slice(1))),hasCollapsedContent:g(()=>l.value.length>1)}}function Fl(e,t="div"){const l=Ft();return Pt(()=>{l.value=Te(ot(e),t)}),l}function bl(e,t="div"){const l=Ft(null);return Pt(()=>{const i=ot(e);l.value=i==null?null:Te(i,t)}),l}function $o(e){return g(()=>ot(e))}function ot(e){return u(u(e))}function V(...e){return e.includes(Object)||e.push(Object),e}const we=pe({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,l)=>(A(),D("div",{style:nt({width:e.width,height:e.height})},null,4))}});const Qo={},Vo={class:"notif"};function Ho(e,t){return A(),D("div",Vo,"!")}var Xa=Ue(Qo,[["render",Ho],["__scopeId","data-v-66323fd4"]]),jo=pe({props:{element:Object,display:{type:V(Object,String,Function),required:!0},style:V(Object,String,Array),classes:V(Object),direction:V(String),xoffset:V(String),yoffset:V(String),pinned:Object},setup(e){const{element:t,display:l,pinned:i}=vt(e),o=j(!1),s=g(()=>(ot(i)||o.value)&&c.value),c=bl(l),d=Ft(Te(B(()=>{const h=ot(t);return h==null?"":Wt(h)})));function p(h){const y=i;h.shiftKey&&y&&(y.value=!y.value,h.stopPropagation(),h.preventDefault())}const m=g(()=>ot(i)&&Nl[lt.theme].showPin);return{Direction:De,isHovered:o,isShown:s,comp:c,elementComp:d,unref:u,togglePinned:p,showPin:m}}});const Wo={key:0,class:"material-icons pinned"};function Jo(e,t,l,i,o,s){return A(),D("div",{class:et(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=c=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=c=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...c)=>e.togglePinned&&e.togglePinned(...c))},[Ht(e.$slots,"default",{},void 0,!0),e.elementComp?(A(),oe(Xe(e.elementComp),{key:0})):L("",!0),n(ua,{name:"fade"},{default:de(()=>{var c;return[e.isShown?(A(),D("div",{key:0,class:et(["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:nt([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(c=e.unref(e.style))!=null?c:{}])},[e.showPin?(A(),D("span",Wo,"push_pin")):L("",!0),e.comp?(A(),oe(Xe(e.comp),{key:1})):L("",!0)],6)):L("",!0)]}),_:1})],34)}var pt=Ue(jo,[["render",Jo],["__scopeId","data-v-6102fa3a"]]);const pa=e=>(rl("data-v-14ecc7bd"),e=e(),ul(),e),zo={key:0,class:"day feature dontMerge opened"},Ko={class:"date"},Xo=r("Dec"),Yo=pa(()=>f("br",null,null,-1)),Zo={class:"date"},es=r("Dec"),ts=pa(()=>f("br",null,null,-1)),ls=pa(()=>f("div",{class:"doors"},null,-1)),as={class:"date"},is=r("Dec"),ns=pa(()=>f("br",null,null,-1)),os={key:0,class:"material-icons lock"},ss={key:1,class:"timer"},rs=pe({__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=g(()=>l.layer&&a.gte(O.day.value,l.day)&&new Date().getMonth()===11&&new Date().getDate()>=l.day);function o(){i.value&&t("unlockLayer")}return(s,c)=>{var d,p,m;return e.opened.value?(A(),D("div",zo,[n(pt,{display:(m=(p=u(Et)[(d=e.layer)!=null?d:""])==null?void 0:p.name)!=null?m:"",direction:u(De).Up,yoffset:"5px"},{default:de(()=>[n(ua,{appear:"",name:"door"},{default:de(()=>[f("div",{class:"doors",onClick:c[0]||(c[0]=h=>t("openLayer"))},[f("div",Ko,[Xo,Yo,r(Se(e.day),1)]),f("div",Zo,[es,ts,r(Se(e.day),1)])])]),_:1}),f("div",{class:"icon",onClick:c[1]||(c[1]=h=>t("openLayer")),style:nt({backgroundImage:`url(${e.symbol})`})},null,4),f("div",{class:"lore",onClick:c[2]||(c[2]=h=>t("openLore"))},"?"),u(e.shouldNotify)?(A(),oe(Xa,{key:0})):L("",!0)]),_:1},8,["display","direction"])])):(A(),D("div",{key:1,class:et(["day feature dontMerge",{can:u(i),locked:!u(i),canOpen:u(i)}]),onClick:o},[ls,f("div",as,[is,ns,r(Se(e.day),1)]),u(i)?L("",!0):(A(),D("div",os,"lock")),u(O).day.value===e.day&&!u(i)?(A(),D("div",ss,Se(u(O).timeUntilNewDay.value<0?"NYI, sorry":u(Na)(u(O).timeUntilNewDay.value,0)),1)):L("",!0),u(i)?(A(),oe(Xa,{key:2})):L("",!0)],2))}}});var us=Ue(rs,[["__scopeId","data-v-14ecc7bd"]]);const ds=pe({__name:"Collapsible",props:{collapsed:null,display:null,content:null},setup(e){const t=e,l=Fl(Kt(t,"display")),i=Fl(Kt(t,"content"));return(o,s)=>(A(),oe(Dt,{class:"collapsible-container"},{default:de(()=>[f("button",{onClick:s[0]||(s[0]=c=>e.collapsed.value=!e.collapsed.value),class:"feature collapsible-toggle"},[(A(),oe(Xe(u(l))))]),e.collapsed.value?L("",!0):(A(),oe(Xe(u(i)),{key:0}))]),_:1}))}});var cs=Ue(ds,[["__scopeId","data-v-a72c16aa"]]);const ps={key:0},ms={key:0,class:"mark star"},vs=["src"],gs=pe({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,l)=>e.mark?(A(),D("div",ps,[e.mark===!0?(A(),D("div",ms)):(A(),D("img",{key:1,class:"mark",src:e.mark},null,8,vs))])):L("",!0)}});var ma=Ue(gs,[["__scopeId","data-v-2207999f"]]);const fs=pe({__name:"Node",props:{id:null},setup(e){const l=vt(e),i=ta(Ia,()=>{}),o=ta(Da,()=>{}),s=Ft(null),c=g(()=>s.value&&s.value.parentElement);return zt([c,l.id],([d,p],[m,h])=>{m&&o(u(h)),d&&i(p,d)}),ri(()=>o(u(l.id))),(d,p)=>(A(),D("div",{class:"node",ref_key:"node",ref:s},null,512))}});var Wl=Ue(fs,[["__scopeId","data-v-a48cb382"]]);const ys=pe({props:{progress:{type:V(String,Object,Number),required:!0},width:{type:V(Number),required:!0},height:{type:V(Number),required:!0},direction:{type:V(String),required:!0},display:V(Object,String,Function),visibility:{type:V(Number),required:!0},style:V(Object,String,Array),classes:V(Object),borderStyle:V(Object,String,Array),textStyle:V(Object,String,Array),baseStyle:V(Object,String,Array),fillStyle:V(Object,String,Array),mark:V(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:ma,Node:Wl},setup(e){const{progress:t,width:l,height:i,direction:o,display:s}=vt(e),c=g(()=>{let m=t.value instanceof a?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(m,0),1))*100}),d=g(()=>{const m={width:ot(l)+.5+"px",height:ot(i)+.5+"px"};switch(u(o)){case De.Up:m.clipPath=`inset(${c.value}% -2px -2px -2px)`,m.width=ot(l)+2+"px";break;case De.Down:m.clipPath=`inset(-2px -2px ${c.value}% -2px)`,m.width=ot(l)+2+"px";break;case De.Right:m.clipPath=`inset(-2px ${c.value}% -2px -2px)`;break;case De.Left:m.clipPath=`inset(-2px -2px -2px ${c.value} + '%)`;break;case De.Default:m.clipPath="inset(-2px 50% -2px -2px)";break}return m}),p=bl(s);return{normalizedProgress:c,barStyle:d,component:p,unref:u,Visibility:Ke}}});function hs(e,t,l,i,o,s){var p,m,h,y,w,v,E;const c=ll("MarkNode"),d=ll("Node");return e.unref(e.visibility)!==e.Visibility.None?(A(),D("div",{key:0,style:nt([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(p=e.unref(e.style))!=null?p:{}]),class:et({bar:!0,...e.unref(e.classes)})},[f("div",{class:"overlayTextContainer border",style:nt([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(m=e.unref(e.borderStyle))!=null?m:{}])},[e.component?(A(),D("span",{key:0,class:"overlayText",style:nt(e.unref(e.textStyle))},[(A(),oe(Xe(e.component)))],4)):L("",!0)],4),f("div",{class:"border",style:nt([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(h=e.unref(e.style))!=null?h:{},(y=e.unref(e.baseStyle))!=null?y:{},(w=e.unref(e.borderStyle))!=null?w:{}])},[f("div",{class:"fill",style:nt([e.barStyle,(v=e.unref(e.style))!=null?v:{},(E=e.unref(e.fillStyle))!=null?E:{}])},null,4)],4),n(c,{mark:e.unref(e.mark)},null,8,["mark"]),n(d,{id:e.id},null,8,["id"])],6)):L("",!0)}var bs=Ue(ys,[["render",hs],["__scopeId","data-v-730cc7a0"]]);const ws=Symbol("Bar");function Jt(e){return St(()=>{const t=e();return t.id=wl("bar-"),t.type=ws,t[Xt]=bs,Q(t,"visibility"),ht(t,"visibility",Ke.Visible),Q(t,"width"),Q(t,"height"),Q(t,"direction"),Q(t,"style"),Q(t,"classes"),Q(t,"borderStyle"),Q(t,"baseStyle"),Q(t,"textStyle"),Q(t,"fillStyle"),Q(t,"progress"),Q(t,"display"),Q(t,"mark"),t[al]=function(){const{progress:l,width:i,height:o,direction:s,display:c,visibility:d,style:p,classes:m,borderStyle:h,textStyle:y,baseStyle:w,fillStyle:v,mark:E,id:S}=this;return{progress:l,width:i,height:o,direction:s,display:c,visibility:d,style:u(p),classes:m,borderStyle:h,textStyle:y,baseStyle:w,fillStyle:v,mark:E,id:S}},t})}var As=pe({props:{display:{type:V(Object,String,Function),required:!0},visibility:{type:V(Number),required:!0},style:V(Object,String,Array),classes:V(Object),onClick:Function,onHold:Function,canClick:{type:V(Boolean),required:!0},small:Boolean,mark:V(Boolean,String),id:{type:String,required:!0},isHolding:Object},components:{Node:Wl,MarkNode:ma},setup(e){const{display:t,onClick:l,onHold:i}=vt(e),o=Ft("");Pt(()=>{const d=ot(t);if(d==null){o.value="";return}if(Gt(d)){o.value=Te(d);return}const p=Te(d.title||"","h3"),m=Te(d.description,"div");o.value=Te(B(()=>n("span",null,[d.title?n("div",null,[n(p,null,null)]):null,n(m,null,null)])))});const{start:s,stop:c}=Di(l,i,e.isHolding);return{start:s,stop:c,comp:o,Visibility:Ke,unref:u}}});function Cs(e,t,l,i,o,s){var p;const c=ll("MarkNode"),d=ll("Node");return e.unref(e.visibility)!==e.Visibility.None?(A(),D("button",{key:0,style:nt([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(p=e.unref(e.style))!=null?p:[]]),onClick:t[0]||(t[0]=(...m)=>e.onClick&&e.onClick(...m)),onMousedown:t[1]||(t[1]=(...m)=>e.start&&e.start(...m)),onMouseleave:t[2]||(t[2]=(...m)=>e.stop&&e.stop(...m)),onMouseup:t[3]||(t[3]=(...m)=>e.stop&&e.stop(...m)),onTouchstartPassive:t[4]||(t[4]=(...m)=>e.start&&e.start(...m)),onTouchendPassive:t[5]||(t[5]=(...m)=>e.stop&&e.stop(...m)),onTouchcancelPassive:t[6]||(t[6]=(...m)=>e.stop&&e.stop(...m)),class:et({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(),oe(Xe(e.unref(e.comp)),{key:0})):L("",!0),n(c,{mark:e.unref(e.mark)},null,8,["mark"]),n(d,{id:e.id},null,8,["id"])],38)):L("",!0)}var xi=Ue(As,[["render",Cs],["__scopeId","data-v-8cedd7da"]]);const ks=Symbol("Clickable");function xt(e){return St(()=>{var l;const t=(l=e==null?void 0:e())!=null?l:{};if(t.id=wl("clickable-"),t.type=ks,t[Xt]=xi,t.isHolding=j(!1),Q(t,"visibility"),ht(t,"visibility",Ke.Visible),Q(t,"canClick"),ht(t,"canClick",!0),Q(t,"classes"),Q(t,"style"),Q(t,"mark"),Q(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[al]=function(){const{display:i,visibility:o,style:s,classes:c,onClick:d,onHold:p,isHolding:m,canClick:h,small:y,mark:w,id:v}=this;return{display:i,visibility:o,style:u(s),classes:c,onClick:d,onHold:p,isHolding:m,canClick:h,small:y,mark:w,id:v}},t})}function mt(e,t="points",l=0,i=void 0){const o=yt(e)?e:_e(e);if(o.displayName=t,o.precision=l,o.small=i,!yt(e)){const s=o[Ql];s.displayName=t,s.precision=l,s.small=i}return o}function Ya(e){const t=_e(e.value);return zt(e,l=>{Fa.value||a.gt(l,t.value)&&(t.value=l)}),t}function Es(e){const t=_e(e.value);return zt(e,(l,i)=>{Fa.value||a.gt(l,i)&&(t.value=a.add(t.value,a.sub(l,i)))}),t}new a("10^^8");new a("1e100");function Jl(e,t){const l=t!=null?t:e.value;return a.eq(e.precision,0)?ae(e.small?l:a.floor(l)):H(l,e.precision,e.small)}const _s=["x1","y1","x2","y2"],Ss=pe({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const l=vt(e),i=g(()=>{const s=l.startNode.value.rect,c=l.boundingRect.value,d=c?{x:s.x+s.width/2-c.x,y:s.y+s.height/2-c.y}:{x:0,y:0};return l.link.value.offsetStart&&(d.x+=l.link.value.offsetStart.x,d.y+=l.link.value.offsetStart.y),d}),o=g(()=>{const s=l.endNode.value.rect,c=l.boundingRect.value,d=c?{x:s.x+s.width/2-c.x,y:s.y+s.height/2-c.y}:{x:0,y:0};return l.link.value.offsetEnd&&(d.x+=l.link.value.offsetEnd.x,d.y+=l.link.value.offsetEnd.y),d});return(s,c)=>(A(),D("line",hl({"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,_s))}});const Bs=pe({__name:"Links",props:{links:null},setup(e){var p;const l=Kt(e,"links"),i=j(null),o=ta(xa,j({})),s=ta(Pa,j(void 0)),c=j((p=i.value)==null?void 0:p.getBoundingClientRect());zt(s,()=>{var m;return c.value=(m=i.value)==null?void 0:m.getBoundingClientRect()}),sa(()=>{var m;return c.value=(m=i.value)==null?void 0:m.getBoundingClientRect()});const d=g(()=>{var h,y;const m=o.value;return(y=(h=l.value)==null?void 0:h.filter(w=>{var v,E;return((v=m[w.startNode.id])==null?void 0:v.rect)&&((E=m[w.startNode.id])==null?void 0:E.rect)}))!=null?y:[]});return(m,h)=>(A(),D(N,null,[u(d)?(A(),D("svg",rn(hl({key:0},m.$attrs)),[(A(!0),D(N,null,Ba(u(d),(y,w)=>(A(),oe(Ss,{key:w,link:y,boundingRect:c.value,startNode:u(o)[y.startNode.id],endNode:u(o)[y.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):L("",!0),f("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Ns=Ue(Bs,[["__scopeId","data-v-063f6d6b"]]);pe({props:{nodes:{type:V(Array),required:!0},leftSideNodes:V(Array),rightSideNodes:V(Array),branches:V(Array)},components:{Links:Ns},setup(e){const{nodes:t,leftSideNodes:l,rightSideNodes:i}=vt(e),o=Ft();Pt(()=>{const d=ot(t);o.value=Te(B(()=>n(N,null,[d.map(p=>n("span",{class:"row tree-row",style:"margin: 50px auto;"},[p.map(Wt)]))])))});const s=Ft();Pt(()=>{const d=ot(l);s.value=d?Te(B(()=>n("span",{class:"left-side-nodes small"},[d.map(Wt)]))):""});const c=Ft();return Pt(()=>{const d=ot(i);c.value=d?Te(B(()=>n("span",{class:"side-nodes small"},[d.map(Wt)]))):""}),{unref:u,nodesComp:o,leftNodesComp:s,rightNodesComp:c}}});pe({props:{display:V(Object,String,Function),visibility:{type:V(Number),required:!0},style:V(String,Object,Array),classes:V(Object),onClick:Function,onHold:Function,color:V(String),glowColor:V(String),canClick:{type:V(Boolean),required:!0},mark:V(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:ma,Node:Wl},setup(e){const{onClick:t,onHold:l,display:i}=vt(e),o=bl(i),{start:s,stop:c}=Di(t,l);return{start:s,stop:c,comp:o,unref:u,Visibility:Ke,isCoercableComponent:Gt}}});function il(e){const t=[],l={};let i=!1;function o(){return i||(t.push(...e()),l.base=t.map(d=>bt(d.base)),l.baseText=t.map(d=>bt(d.baseText)),l.visible=t.map(d=>bt(d.visible)),i=!0),t}const s=_e({});return[B(()=>{const d=o();let p=!0;const m=d.map((h,y)=>{var S,x,W;if(u(l.visible[y])===!1)return null;const w=n("h3",{onClick:()=>s.value[y]=!s.value[y],style:"cursor: pointer"},[n("span",{class:"modifier-toggle"+(u(s.value[y])?" collapsed":"")},[r("\u25BC")]),h.title,h.subtitle?n("span",{class:"subtitle"},[r(" ("),h.subtitle,r(")")]):null]),v=u(s.value[y])?null:n(N,null,[n("div",{class:"modifier-container"},[n("span",{class:"modifier-description"},[Wt((S=u(l.baseText[y]))!=null?S:"Base")]),n("span",{class:"modifier-amount"},[H((x=u(l.base[y]))!=null?x:1),h.unit])]),Wt(u(h.modifier.description))]),E=!p;return p=!1,n(N,null,[E?n("br",null,null):null,n("div",null,[w,n("br",null,null),v,n("hr",null,null),n("div",{class:"modifier-container"},[n("span",{class:"modifier-description"},[r("Total")]),n("span",{class:"modifier-amount"},[H(h.modifier.apply((W=u(l.base[y]))!=null?W:1)),h.unit])])])])});return n(N,null,[m])}),s]}function Hl(e){const t=Object.values(e).reverse(),l=_e(!0),i=g(()=>t.filter(p=>p.earned.value===!1)),{firstFeature:o,collapsedContent:s,hasCollapsedContent:c}=Lo(t,p=>p.earned.value),d=B(()=>{const p=[...i.value];return o.value&&p.push(o.value),Go(...p,B(()=>ra(n(cs,{collapsed:l,content:s,display:l.value?"Show other completed milestones":"Hide other completed milestones"},null),[[si,u(c)]])))});return{collapseMilestones:l,display:d}}function dl(e){const t=e.ignoreTotal?e.resource:Es(e.resource),l=()=>{var d,p;if(O.day.value!==e.day)return 1;let s=a.add(t.value,1),c=e.goal;return((p=(d=e.usingLog)==null?void 0:d.value)!=null?p:ne.usingLog)&&(s=s.log10(),c=a.log10(c)),a.div(s,c)},i=Jt(()=>({direction:De.Right,width:600,height:25,fillStyle:{backgroundColor:e.color},textStyle:e.textColor?{color:e.textColor}:void 0,progress:l,display:B(()=>O.day.value===e.day?n(N,null,[ye(t.value),r("/"),ye(e.goal)]):"")})),o=B(()=>n(N,null,[n("div",null,[O.day.value===e.day?n(N,null,[r("Reach "),ye(e.goal),r(" "),e.ignoreTotal?"":"total ",e.resource.displayName,r(" to complete the day")]):n(N,null,[e.name,r(" Complete!")]),e.modal?n(N,null,[" ",r("-")," ",n("button",{class:"button",style:"display: inline-block;",onClick:()=>e.modal.show.value=!0},[r("Check Modifiers")])]):void 0]),le(i),e.modal?le(e.modal.display):void 0]));return Pt(()=>{O.day.value===e.day&&a.gte(t.value,e.goal)&&O.completeDay()}),{total:t,trackerDisplay:o}}function Vt(e){var c;const t=(c=e.style)!=null?c:{minHeight:"20px",width:"40px",color:"var(--foreground)"},l=xt(()=>({display:"0",style:t,canClick(){return a.gt(e.active.value,0)},onClick(){e.active.value=0}})),i=xt(()=>({display:"-",style:t,canClick(){return a.gt(e.active.value,0)},onClick(){e.active.value=a.sub(e.active.value,1)}})),o=xt(()=>({display:"+",style:t,canClick(){return a.lt(e.active.value,e.buyable.amount.value)},onClick(){e.active.value=a.add(e.active.value,1)}})),s=xt(()=>({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:s}}const Ms=Symbol("Buyable");function Pe(e){const t=_e(0);return St(()=>{var s,c,d;const l=e();if(l.canPurchase==null&&(l.resource==null||l.cost==null))throw console.warn("Cannot create buyable without a canPurchase property or a resource and cost property",l),"Cannot create buyable without a canPurchase property or a resource and cost property";l.id=wl("buyable-"),l.type=Ms,l[Xt]=xi,l.amount=t,l.amount[yl]=(s=l.initialValue)!=null?s:0,l.canAfford=g(()=>{const p=l,m=u(p.cost);return p.resource!=null&&m!=null&&a.gte(p.resource.value,m)}),l.canPurchase==null&&(l.canPurchase=g(()=>u(l.visibility)===Ke.Visible&&u(l.canAfford)&&a.lt(l.amount.value,u(l.purchaseLimit)))),l.maxed=g(()=>a.gte(l.amount.value,u(l.purchaseLimit))),Q(l,"classes");const i=l.classes;l.classes=g(()=>{const p=u(i)||{};return l.maxed.value&&(p.bought=!0),p}),Q(l,"canPurchase"),l.canClick=l.canPurchase,l.onClick=l.purchase=(d=(c=l.onClick)!=null?c:l.purchase)!=null?d:function(){var h;const p=l;if(!u(p.canPurchase))return;const m=u(p.cost);p.cost!=null&&p.resource!=null&&(p.resource.value=a.sub(p.resource.value,m),p.amount.value=a.add(p.amount.value,1)),(h=p.onPurchase)==null||h.call(p,m)},Q(l,"display");const o=l.display;return l.display=B(()=>{const p=u(o);if(Gt(p)){const m=Te(p);return n(m,null,null)}if(p!=null&&l.cost!=null&&l.resource!=null){const m=l,h=Te(p.title||"","h3"),y=Te(p.description||""),w=Te(p.effectDisplay||"");return n("span",null,[p.title?n("div",null,[n(h,null,null)]):null,p.description?n(y,null,null):null,p.showAmount===!1?null:n("div",null,[n("br",null,null),u(m.purchaseLimit)===a.dInf?n(N,null,[r("Amount: "),ae(m.amount.value)]):n(N,null,[r("Amount: "),ae(m.amount.value),r(" /")," ",ae(u(m.purchaseLimit))])]),p.effectDisplay?n("div",null,[n("br",null,null),r("Currently: "),n(w,null,null)]):null,m.cost&&!m.maxed.value?n("div",null,[r("Cost: "),H(u(m.cost)||0)," ",l.resource.displayName]):null])}return""}),Q(l,"visibility"),ht(l,"visibility",Ke.Visible),Q(l,"cost"),Q(l,"resource"),Q(l,"purchaseLimit"),ht(l,"purchaseLimit",a.dInf),Q(l,"style"),Q(l,"mark"),Q(l,"small"),l[al]=function(){const{display:p,visibility:m,style:h,classes:y,onClick:w,canClick:v,small:E,mark:S,id:x}=this;return{display:p,visibility:m,style:u(h),classes:y,onClick:w,canClick:v,small:E,mark:S,id:x}},l})}const va=da({}),Ra=Symbol("Hotkey");function Pl(e){return St(()=>{const t=e();return t.type=Ra,Q(t,"enabled"),ht(t,"enabled",!0),Q(t,"description"),t})}je.on("addLayer",e=>{wi(e,Ra).forEach(t=>{va[t.key]=t})});je.on("removeLayer",e=>{wi(e,Ra).forEach(t=>{va[t.key]=void 0})});document.onkeydown=function(e){var i;if(((i=e.target)==null?void 0:i.tagName)==="INPUT"||Ga.value&&!ne.keepGoing)return;let t=e.key;e.shiftKey&&(t="shift+"+t),e.ctrlKey&&(t="ctrl+"+t);const l=va[t];l&&u(l.enabled)&&(e.preventDefault(),l.onPress())};Uo(B(()=>{const e=Object.values(va).filter(t=>u(t==null?void 0:t.enabled));return e.length===0?"":n("div",null,[n("br",null,null),n("h4",null,[r("Hotkeys")]),e.map(t=>n("div",null,[t==null?void 0:t.key,r(": "),t==null?void 0:t.description]))])}));const Is=pe({__name:"Sticky",setup(e){const t=j("0"),l=new ResizeObserver(o),i=Ft(null);function o(){let s=i.value;if(s==null)return;let c=0;for(;s.previousSibling;){const d=s.previousSibling;d.dataset&&"vSticky"in d.dataset&&(c+=d.offsetHeight),s=d}t.value=c+"px"}return Sl(o),document.fonts.ready.then(o),sa(()=>{var c;const s=(c=i.value)==null?void 0:c.parentElement;s&&l.observe(s)}),(s,c)=>(A(),D("div",{class:"sticky",style:nt({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[Ht(s.$slots,"default",{},void 0,!0)],4))}});var Pi=Ue(Is,[["__scopeId","data-v-cccac690"]]);const Za=pe({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,l=g(()=>Jl(t.resource));return(i,o)=>(A(),D("h2",{style:nt({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},Se(u(l)),5))}});const Ds={class:"main-display"},xs={key:0},Ps={key:1},Ts=r(", "),Fs={key:2},Us=f("br",null,null,-1),Rs={class:"main-display"},Os={key:0},qs={key:1},Gs=r(", "),Ls={key:2},$s=f("br",null,null,-1),It=pe({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null,productionDisplay:null,sticky:{type:Boolean,default:!0}},setup(e){const l=vt(e),i=j(null),o=bl(l.effectDisplay),s=j(null),c=bl(l.productionDisplay),d=g(()=>a.lt(l.resource.value,"1e1000"));return(p,m)=>{var h,y;return e.sticky?(A(),oe(Pi,{key:0},{default:de(()=>{var w,v,E,S;return[f("div",{class:et(["main-display-container",(w=e.classes)!=null?w:{}]),style:nt([{"min-height":`${((E=(v=i.value)==null?void 0:v.$el.clientHeight)!=null?E:0)+50}px`},(S=e.style)!=null?S:{}])},[f("div",Ds,[u(d)?(A(),D("span",xs,"You have ")):L("",!0),n(Za,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),r(" "+Se(e.resource.displayName),1),u(o)?(A(),D("span",Ps,[Ts,(A(),oe(Xe(u(o)),{ref_key:"effectRef",ref:i},null,512))])):L("",!0),u(c)?(A(),D("span",Fs,[Us,(A(),oe(Xe(u(c)),{ref_key:"productionRef",ref:s},null,512))])):L("",!0)])],6)]}),_:1})):(A(),D("div",{key:1,class:et(["main-display-container",(h=e.classes)!=null?h:{}]),style:nt([{"min-height":"50px"},(y=e.style)!=null?y:{}])},[f("div",Rs,[u(d)?(A(),D("span",Os,"You have ")):L("",!0),n(Za,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),r(" "+Se(e.resource.displayName),1),u(o)?(A(),D("span",qs,[Gs,(A(),oe(Xe(u(o)),{ref_key:"effectRef",ref:i},null,512))])):L("",!0),u(c)?(A(),D("span",Ls,[$s,(A(),oe(Xe(u(c)),{ref_key:"productionRef",ref:s},null,512))])):L("",!0)])],6))}}});var Qs=pe({props:{display:{type:V(String,Object,Function),required:!0},visibility:{type:V(Number),required:!0},style:V(String,Object,Array),classes:V(Object),resource:Object,cost:V(String,Object,Number),canPurchase:{type:V(Boolean),required:!0},bought:{type:V(Boolean),required:!0},mark:V(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:Wl,MarkNode:ma},setup(e){const{display:t,cost:l}=vt(e),i=Ft("");return Pt(()=>{const o=ot(t);if(o==null){i.value="";return}if(Gt(o)){i.value=Te(o);return}const s=ot(l),c=Te(o.title||"","h3"),d=Te(o.description,"div"),p=Te(o.effectDisplay||"");i.value=Te(B(()=>{var m;return n("span",null,[o.title?n("div",null,[n(c,null,null)]):null,n(d,null,null),o.effectDisplay?n("div",null,[r("Currently: "),n(p,null,null)]):null,e.resource!=null&&o.showCost!==!1?n(N,null,[n("br",null,null),r("Cost: "),e.resource&&Jl(e.resource,s)," ",(m=e.resource)==null?void 0:m.displayName]):null])}))}),{component:i,unref:u,Visibility:Ke}}});const Vs=["disabled"];function Hs(e,t,l,i,o,s){var p;const c=ll("MarkNode"),d=ll("Node");return e.unref(e.visibility)!==e.Visibility.None?(A(),D("button",{key:0,style:nt([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(p=e.unref(e.style))!=null?p:{}]),onClick:t[0]||(t[0]=(...m)=>e.purchase&&e.purchase(...m)),class:et({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(),oe(Xe(e.unref(e.component)),{key:0})):L("",!0),n(c,{mark:e.unref(e.mark)},null,8,["mark"]),n(d,{id:e.id},null,8,["id"])],14,Vs)):L("",!0)}var js=Ue(Qs,[["render",Hs],["__scopeId","data-v-7f411ac8"]]);const Ws=Symbol("Upgrade");function q(e){const t=_e(!1);return St(()=>{const l=e();return l.id=wl("upgrade-"),l.type=Ws,l[Xt]=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=g(()=>{const i=l;return i.resource!=null&&i.cost!=null&&a.gte(i.resource.value,u(i.cost))}):Q(l,"canAfford"),l.canPurchase=g(()=>u(l.visibility)===Ke.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))},Q(l,"visibility"),ht(l,"visibility",Ke.Visible),Q(l,"classes"),Q(l,"style"),Q(l,"display"),Q(l,"mark"),Q(l,"cost"),Q(l,"resource"),l[al]=function(){const{display:i,visibility:o,style:s,classes:c,resource:d,cost:p,canPurchase:m,bought:h,mark:y,id:w,purchase:v}=this;return{display:i,visibility:o,style:u(s),classes:c,resource:d,cost:p,canPurchase:m,bought:h,mark:y,id:w,purchase:v}},l})}function ue(e){return St(()=>{const{addend:t,description:l,enabled:i}=e(),o=bt(t),s=bt(l),c=i==null?void 0:bt(i);return{apply:d=>a.add(d,u(o)),revert:d=>a.sub(d,u(o)),enabled:c,description:l==null?void 0:B(()=>n("div",{class:"modifier-container"},[u(s)?n("span",{class:"modifier-description"},[Wt(u(s))]):null,n("span",{class:"modifier-amount"},[a.gte(u(o),0)?"+":"",H(u(o))])]))}})}function k(e){return St(()=>{const{multiplier:t,description:l,enabled:i}=e(),o=bt(t),s=bt(l),c=i==null?void 0:bt(i);return{apply:d=>a.times(d,u(o)),revert:d=>a.div(d,u(o)),enabled:c,description:l==null?void 0:B(()=>n("div",{class:"modifier-container"},[u(s)?n("span",{class:"modifier-description"},[Wt(u(s))]):null,n("span",{class:"modifier-amount"},[r("\xD7"),H(u(o))])]))}})}function Ti(e){return St(()=>{const{exponent:t,description:l,enabled:i,supportLowNumbers:o}=e(),s=bt(t),c=bt(l),d=i==null?void 0:bt(i);return{apply:p=>{let m=p;return o&&(m=a.add(m,1)),m=a.pow(m,u(s)),o&&(m=a.sub(m,1)),m},revert:p=>{let m=p;return o&&(m=a.add(m,1)),m=a.root(m,u(s)),o&&(m=a.sub(m,1)),m},enabled:d,description:l==null?void 0:B(()=>n("div",{class:"modifier-container"},[u(c)?n("span",{class:"modifier-description"},[Wt(u(c)),o?" (+1 effective)":null]):null,n("span",{class:"modifier-amount"},[r("^"),H(u(s))])]))}})}function ee(e){return St(()=>{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:g(()=>t.filter(l=>u(l.enabled)!==!1).length>0),description:B(()=>n(N,null,[t.filter(l=>u(l.enabled)!==!1).map(l=>u(l.description)).filter(l=>l).map(Wt)]))}})}function Fi(e){return St(()=>{const t=e();return t.currentGain==null&&(t.currentGain=g(()=>{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=g(()=>{let l=t.scaling.currentAt(t);return t.roundUpCost&&(l=a.ceil(l)),l})),t.nextAt==null&&(t.nextAt=g(()=>{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}),Q(t,"currentGain"),Q(t,"actualGain"),Q(t,"currentAt"),Q(t,"nextAt"),Q(t,"buyMax"),ht(t,"buyMax",!0),Q(t,"roundUpCost"),ht(t,"roundUpCost",!0),t})}function Oa(e,t){const l=bt(e),i=bt(t);return{currentGain(o){let s=u(o.baseResource.value);if(o.costModifier&&(s=o.costModifier.apply(s)),a.lt(s,u(l)))return 0;const c=a.div(s,u(l)).pow(u(i));return c.isNan()?new a(0):c},currentAt(o){let s=u(o.currentGain);return o.gainModifier&&(s=o.gainModifier.revert(s)),s=a.max(0,s).root(u(i)).times(u(l)),o.costModifier&&(s=o.costModifier.revert(s)),s},nextAt(o){let s=a.add(u(o.currentGain),1).floor();return o.gainModifier&&(s=o.gainModifier.revert(s)),s=a.max(0,s).root(u(i)).times(u(l)).max(u(l)),o.costModifier&&(s=o.costModifier.revert(s)),s}}}function Ui(e){return Fi(e)}function Js(e){return Fi(()=>{const t=e();return ht(t,"buyMax",!1),t.currentGain==null&&(t.currentGain=g(()=>{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=g(()=>{let l=a.sub(a.floor(t.scaling.currentGain(t)),t.gainResource.value).max(0);return u(t.buyMax)||(l=l.min(1)),l})),ht(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})}const zs={},Ks={style:{"white-space":"nowrap"}},Xs=f("span",{style:{"font-size":"larger","font-family":"initial"}},"\u221A",-1),Ys={style:{display:"inline-block","border-top":"1px solid","padding-left":"2px"}};function Zs(e,t){return A(),D("span",Ks,[Xs,f("div",Ys,[Ht(e.$slots,"default")])])}var oa=Ue(zs,[["render",Zs]]);const er={class:"field"},tr={key:0,class:"field-title"},qa=pe({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var c;const l=e,i=bl(Kt(l,"title"),"span"),o=j((c=l.options.find(d=>d.value===l.modelValue))!=null?c:null);zt(Kt(l,"modelValue"),d=>{var p;ot(o)!==d&&(o.value=(p=l.options.find(m=>m.value===d))!=null?p:null)});function s(d){t("update:modelValue",d.value)}return(d,p)=>(A(),D("div",er,[u(i)?(A(),D("span",tr,[(A(),oe(Xe(u(i))))])):L("",!0),n(u(mn),{options:e.options,modelValue:o.value,"onUpdate:modelValue":[p[0]||(p[0]=m=>o.value=m),s],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});var lr=pe({props:{visibility:{type:V(Number),required:!0},display:{type:V(String,Object,Function),required:!0},style:V(String,Object,Array),classes:V(Object),earned:{type:V(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:Wl},setup(e){const{display:t}=vt(e),l=Ft("");return Pt(()=>{const i=ot(t);if(i==null){l.value="";return}if(Gt(i)){l.value=Te(i);return}const o=Te(i.requirement,"h3"),s=Te(i.effectDisplay||"","b"),c=Te(i.optionsDisplay||"","span");l.value=Te(B(()=>n("span",null,[n(o,null,null),i.effectDisplay?n("div",null,[n(s,null,null)]):null,i.optionsDisplay?n("div",{class:"equal-spaced"},[n(c,null,null)]):null])))}),{comp:l,unref:u,Visibility:Ke}}});function ar(e,t,l,i,o,s){var d;const c=ll("Node");return e.unref(e.visibility)!==e.Visibility.None?(A(),D("div",{key:0,style:nt([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(d=e.unref(e.style))!=null?d:{}]),class:et({feature:!0,milestone:!0,done:e.unref(e.earned),...e.unref(e.classes)})},[(A(),oe(Xe(e.unref(e.comp)))),n(c,{id:e.id},null,8,["id"])],6)):L("",!0)}var ir=Ue(lr,[["render",ar],["__scopeId","data-v-f4e8794e"]]);je.on("setupVue",e=>e.use(vn));function nr(e="white",t="8px"){return{transform:"scale(1.05, 1.05)",borderColor:"rgba(0, 0, 0, 0.125)",boxShadow:`-4px -4px 4px rgba(0, 0, 0, 0.25) inset, 0 0 ${t} ${e}`,zIndex:1}}const ei=di(),or=Symbol("Milestone");let fl;(function(e){e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none"})(fl||(fl={}));function P(e){const t=_e(!1);return St(()=>{var o;const l=(o=e==null?void 0:e())!=null?o:{};l.id=wl("milestone-"),l.type=or,l[Xt]=ir,l.earned=t,l.complete=function(){var c;const s=l;if(t.value=!0,(c=s.onComplete)==null||c.call(s),s.display&&u(s.showPopups)===!0){const d=u(s.display),p=Te(Gt(d)?d:d.requirement);ei(n(N,null,[n("h3",null,[r("Milestone earned!")]),n("div",null,[n(p,null,null)])]))}},Q(l,"visibility"),ht(l,"visibility",Ke.Visible);const i=l.visibility;if(l.visibility=g(()=>{const s=u(l.display);switch(lt.msDisplay){default:case fl.All:return u(i);case fl.Configurable:return u(l.earned)&&!(s!=null&&typeof s=="object"&&"optionsDisplay"in s)?Ke.None:u(i);case fl.Incomplete:return u(l.earned)?Ke.None:u(i);case fl.None:return Ke.None}}),Q(l,"style"),Q(l,"classes"),Q(l,"display"),Q(l,"showPopups"),l[al]=function(){const{visibility:s,display:c,style:d,classes:p,earned:m,id:h}=this;return{visibility:s,display:c,style:u(d),classes:p,earned:m,id:h}},l.shouldEarn){const s=l;Pt(()=>{var c,d;if(lt.active===ne.id&&!s.earned.value&&u(s.visibility)===Ke.Visible&&((c=s.shouldEarn)==null?void 0:c.call(s))&&(s.earned.value=!0,(d=s.onComplete)==null||d.call(s),s.display&&u(s.showPopups)===!0)){const p=u(s.display),m=Te(Gt(p)?p:p.requirement);ei(n(N,null,[n("h3",null,[r("Milestone earned!")]),n("div",null,[n(m,null,null)])]))}})}return l})}je.on("loadSettings",e=>{ht(e,"msDisplay",fl.All)});const sr=Object.values(fl).map(e=>({label:bi(e),value:e}));Fo(B(()=>n(qa,{title:"Show Milestones",options:sr,"onUpdate:modelValue":e=>lt.msDisplay=e,modelValue:lt.msDisplay},null)));const rr=pe({props:{visibility:{type:V(Number),required:!0},display:{type:V(Object,String,Function),required:!0},style:V(String,Object,Array),classes:V(Object),glowColor:V(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:l,glowColor:i,floating:o}=vt(e),s=Fl(l),c=g(()=>{const p=ot(i);return p?u(o)?nr(p):{boxShadow:`0px 9px 5px -6px ${p}`}:{}});function d(){t("selectTab")}return{selectTab:d,component:s,glowColorStyle:c,unref:u,Visibility:Ke}}});function ur(e,t,l,i,o,s){var c;return e.unref(e.visibility)!==e.Visibility.None?(A(),D("button",{key:0,onClick:t[0]||(t[0]=(...d)=>e.selectTab&&e.selectTab(...d)),class:et(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:nt([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},e.glowColorStyle,(c=e.unref(e.style))!=null?c:{}])},[(A(),oe(Xe(e.component)))],6)):L("",!0)}var Ri=Ue(rr,[["render",ur],["__scopeId","data-v-610a2549"]]);const dr=pe({props:{visibility:{type:V(Number),required:!0},activeTab:{type:V(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:V(Object),required:!0},style:V(String,Object,Array),classes:V(Object),buttonContainerStyle:V(String,Object,Array),buttonContainerClasses:V(Object)},components:{Sticky:Pi,TabButton:Ri},setup(e){const{activeTab:t}=vt(e),l=g(()=>Nl[lt.theme].floatingTabs),i=Ft("");Pt(()=>{const d=ot(t);if(d==null){i.value="";return}if(Gt(d)){i.value=Te(d);return}i.value=Te(u(d.display))});const o=g(()=>{const d=ot(t);return Gt(d)||!d?void 0:u(d.classes)}),s=g(()=>{const d=ot(t);return Gt(d)||!d?void 0:u(d.style)});function c(d){const{display:p,style:m,classes:h,glowColor:y,visibility:w}=d;return{display:p,style:u(m),classes:h,glowColor:y,visibility:w}}return{floating:l,tabClasses:o,tabStyle:s,Visibility:Ke,component:i,gatherButtonProps:c,unref:u}}});function cr(e,t,l,i,o,s){var p,m;const c=ll("TabButton"),d=ll("Sticky");return e.unref(e.visibility)!==e.Visibility.None?(A(),D("div",{key:0,class:et(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:nt([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(p=e.unref(e.style))!=null?p:[],(m=e.tabStyle)!=null?m:[]])},[n(d,{class:et(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:nt(e.unref(e.buttonContainerStyle))},{default:de(()=>[f("div",{class:et(["tab-buttons",{floating:e.floating}])},[(A(!0),D(N,null,Ba(e.unref(e.tabs),(h,y)=>(A(),oe(c,hl({onSelectTab:w=>e.selected.value=y,floating:e.floating,key:y,active:e.unref(h.tab)===e.unref(e.activeTab)},e.gatherButtonProps(h)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(A(),oe(Xe(e.unref(e.component)),{key:0})):L("",!0)],6)):L("",!0)}var pr=Ue(dr,[["render",cr],["__scopeId","data-v-11575f45"]]);const mr=Symbol("TabButton"),vr=Symbol("TabFamily");function gr(e,t){if(Object.keys(e).length===0)throw console.warn("Cannot create tab family with 0 tabs"),"Cannot create tab family with 0 tabs";const l=_e(Object.keys(e)[0]);return St(()=>{var s;const i=(s=t==null?void 0:t())!=null?s:{};i.id=wl("tabFamily-"),i.type=vr,i[Xt]=pr,i.tabs=Object.keys(e).reduce((c,d)=>{const p=e[d]();return p.type=mr,p[Xt]=Ri,Q(p,"visibility"),ht(p,"visibility",Ke.Visible),Q(p,"tab"),Q(p,"display"),Q(p,"classes"),Q(p,"style"),Q(p,"glowColor"),c[d]=p,c},{}),i.selected=l,i.activeTab=g(()=>{const c=u(o.tabs);if(l.value in c&&u(c[l.value].visibility)===Ke.Visible)return u(c[l.value].tab);const d=Object.values(c).find(p=>u(p.visibility)===Ke.Visible);return d?u(d.tab):null}),Q(i,"visibility"),ht(i,"visibility",Ke.Visible),Q(i,"classes"),Q(i,"style"),Q(i,"buttonContainerClasses"),Q(i,"buttonContainerStyle"),i[al]=function(){const{visibility:c,activeTab:d,selected:p,tabs:m,style:h,classes:y,buttonContainerClasses:w,buttonContainerStyle:v}=this;return{visibility:c,activeTab:d,selected:p,tabs:m,style:u(h),classes:y,buttonContainerClasses:w,buttonContainerStyle:v}};const o=i;return o})}const fr=pe({__name:"Tab",props:{display:null},setup(e){const t=e,{display:l}=vt(t),i=Fl(l);return(o,s)=>(A(),oe(Xe(u(i))))}}),yr=Symbol("Tab");function Aa(e){return St(()=>{const t=e();return t.id=wl("tab-"),t.type=yr,t[Xt]=fr,t[al]=function(){const{display:l}=this;return{display:l}},t})}const hr={class:"field"},br=pe({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const l=e,i=g(()=>Te(u(l.title)||"<span></span>","span")),o=g({get(){return!!l.modelValue},set(s){t("update:modelValue",s)}});return(s,c)=>(A(),D("label",hr,[ra(f("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":c[0]||(c[0]=d=>yt(o)?o.value=d:null)},null,512),[[un,u(o)]]),(A(),oe(Xe(u(i))))]))}});var sl=Ue(br,[["__scopeId","data-v-33d57459"]]);const wr=Symbol("Reset");function Ar(e){return St(()=>{const t=e();return t.id=wl("reset-"),t.type=wr,t.reset=function(){var i;const l=o=>{if(o&&typeof o=="object")if(yl in o){const s=o;s.value=s[yl]}else!(o instanceof a)&&!yt(o)&&Object.values(o).forEach(s=>l(s))};u(t.thingsToReset).forEach(l),je.emit("reset",t),(i=t.onReset)==null||i.call(t)},Q(t,"thingsToReset"),t})}const Zl={};je.on("removeLayer",e=>{var t;(t=Zl[e.id])==null||t.call(Zl),Zl[e.id]=void 0});const Cr="dyes",kr=11,Ve=Tt(Cr,function(){const e="Dyes",t="#D4D4F4";function l(v){const E=mt(0,v.name),S=ee(()=>[ue(()=>({addend:()=>a.add(W.amount.value,1),description:`${v.name} Chambers`})),k(()=>({multiplier:o.orange1,description:"Orange Dye Boost 1",enabled:v.color=="red"||v.color=="yellow"})),k(()=>({multiplier:o.green1,description:"Green Dye Boost 1",enabled:v.color=="yellow"||v.color=="blue"})),k(()=>({multiplier:o.purple1,description:"Purple Dye Boost 1",enabled:v.color=="red"||v.color=="blue"})),k(()=>({multiplier:2,description:"Wetter Dyes",enabled:()=>d.yellowDyeUpg.bought.value&&(v.color=="red"||v.color=="yellow"||v.color=="blue")}))]),x=g(()=>S.apply(0)),W=Pe(()=>{const M=bt(v.costs);return{...v,style:()=>({backgroundColor:u(W.canPurchase)?t:"#545454",minWidth:"200px"}),display:B(()=>n("span",null,[n("h3",null,[v.name,r(" Chambers")]),n("br",null,null),r("Create "),H(x.value),r(" "),v.name,v.dyesToReset.length>0?", but reset "+v.dyesToReset.map(_=>_.name).join(", "):"",r("."),n("br",null,null),n("br",null,null),n("span",{class:"white-space: pre-wrap"},[r("Currently:")," ",v.listedBoosts.filter(_=>u(_.visible)).map(_=>le(B(()=>n("div",null,[u(_.desc)]))))]),n("br",null,null),n("div",null,[r("Cost:")," ",u(M).map(_=>le(B(()=>{var T,X;return n("div",null,[H(u(a.pow((T=u(W.cost))!=null?T:a.dInf,u((X=_.root)!=null?X:1)).times(u(_.base))))," ",_.res.displayName,n("br",null,null)])})))])])),cost(){let _=W.amount.value;return a.gte(_,25)&&(_=a.pow(_,2).div(20)),a.gte(_,10)&&(_=a.pow(_,2).div(5)),a.div(_,10).plus(1)},canPurchase:g(_=>{var X;if(u(W.visibility)!=Ke.Visible)return!1;const T=(X=_!=null?_:u(W.cost))!=null?X:a.dInf;return u(M).every(me=>{var R;return a.div(me.res.value,u(me.base)).root(u((R=me.root)!=null?R:1)).gte(T)})}),onPurchase(_){var X;const T=(X=_!=null?_:u(W.cost))!=null?X:a.dInf;u(M).forEach(me=>{var R;me.res.value=a.sub(me.res.value,a.pow(T,u((R=me.root)!=null?R:1)).times(u(me.base)))}),E.value=a.add(E.value,x.value),W.amount.value=a.add(W.amount.value,1),v.dyesToReset.forEach(me=>me.reset())}}});return{name:v.name,amount:E,buyable:W,toGenerate:S,computedToGenerate:x,display:B(()=>n(It,{resource:E,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:ce.logs},{base:g(()=>d.yellowDyeUpg2.bought.value?"2.5e5":"5e5"),root:2,res:Ye.oil}],listedBoosts:[{visible:!0,desc:g(()=>`+${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:ce.logs},{base:g(()=>d.yellowDyeUpg2.bought.value?"5e5":"1e6"),root:2,res:Ye.oil}],listedBoosts:[{visible:!0,desc:g(()=>`x${H(o.yellow1.value)} Paper & Plastic gain`)}],dyesToReset:[]}),blue:l({name:"Blue Dye",color:"blue",costs:()=>[{base:"5e17",root:5,res:ce.logs},{base:g(()=>d.yellowDyeUpg2.bought.value?"1e6":"2e6"),root:2,res:Ye.oil}],listedBoosts:[{visible:!0,desc:g(()=>`+${ae(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:g(()=>`x${H(o.orange1.value)} Red and Yellow Dye gain`)},{visible:!0,desc:g(()=>`/${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:g(()=>`x${H(o.green1.value)} Yellow and Blue Dye gain`)},{visible:!0,desc:g(()=>`+${ae(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:g(()=>`x${H(o.purple1.value)} Red and Blue Dye gain`)},{visible:!0,desc:g(()=>`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:g(()=>a.pow(a.add(i.red.amount.value,1).log2().plus(1).log2().div(2),d.blueDyeUpg2.bought.value?1.5:1)),yellow1:g(()=>a.add(i.yellow.amount.value,1).log2().plus(1)),blue1:g(()=>a.add(i.blue.amount.value,1).log2().sqrt().times(5e6)),orange1:g(()=>a.pow(2,a.add(i.orange.amount.value,1).log2().sqrt()).pow(d.coalUpg.bought.value?1.2:1)),orange2:g(()=>a.add(i.orange.amount.value,1).log2().plus(1)),green1:g(()=>a.pow(2,a.add(i.green.amount.value,1).log2().sqrt()).pow(d.coalUpg.bought.value?1.2:1)),green2:g(()=>a.add(i.green.amount.value,1).log2().plus(1).pow(d.coalUpg.bought.value?2:1)),purple1:g(()=>a.pow(2,a.add(i.purple.amount.value,1).log2().sqrt()).pow(d.coalUpg.bought.value?1.2:1)),purple2:g(()=>a.add(i.purple.amount.value,1).log2().plus(1))},[s,c]=il(()=>[{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}]),d={blueDyeUpg:q(()=>({visibility:()=>b(a.add(i.orange.amount.value,i.green.amount.value).add(i.purple.amount.value).gte(1)||d.blueDyeUpg.bought.value),display:{title:"Is Blue Dye just Water?",description:B(()=>n(N,null,[r("Multiply Log gain by log"),n("sub",null,[r("10")]),r("(Auto Cutting Amount)+1.")]))},cost:1e3,resource:F(i.blue.amount),onPurchase(){i.blue.amount.value=0,i.blue.buyable.amount.value=0}})),redDyeUpg:q(()=>({visibility:()=>b(a.add(i.orange.amount.value,i.green.amount.value).add(i.purple.amount.value).gte(10)||d.redDyeUpg.bought.value),display:{title:"Glistening Paint",description:B(()=>n(N,null,[r("Multiply Ore Purity by log"),n("sub",null,[r("10")]),r("(Cloth)+1.")]))},cost:1500,resource:F(i.red.amount),onPurchase(){i.red.amount.value=0,i.red.buyable.amount.value=0}})),yellowDyeUpg:q(()=>({visibility:()=>b(a.add(i.orange.amount.value,i.green.amount.value).add(i.purple.amount.value).gte(100)||d.yellowDyeUpg.bought.value),display:{title:"Wetter Dyes",description:"Double Red, Yellow, and Blue Dye gain, but reset their amounts."},cost:2e3,resource:F(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:q(()=>({visibility:()=>b(d.yellowDyeUpg.bought.value),display:{title:"Golden Wash",description:"Halve the Oil cost of Red, Yellow, and Blue Dyes."},cost:5e3,resource:F(i.yellow.amount),onPurchase(){i.yellow.amount.value=0,i.yellow.buyable.amount.value=0}})),redDyeUpg2:q(()=>({visibility:()=>b(d.redDyeUpg.bought.value),display:{title:"De Louvre",description:B(()=>n(N,null,[r("Multiply Smelting Speed by "),n(oa,null,{default:()=>[r("Refineries+1")]}),r(".")]))},cost:6e3,resource:F(i.red.amount),onPurchase(){i.red.amount.value=0,i.red.buyable.amount.value=0}})),blueDyeUpg2:q(()=>({visibility:()=>b(d.blueDyeUpg.bought.value),display:{title:"Hydrophobia",description:"Raise Red Dye's effect ^1.5."},cost:7500,resource:F(i.blue.amount),onPurchase(){i.blue.amount.value=0,i.blue.buyable.amount.value=0}})),coalUpg:q(()=>({visibility:()=>b(d.blueDyeUpg2.bought.value&&d.redDyeUpg2.bought.value&&d.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:G.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}}))},p=j(!1),m=B(()=>n(wt,{modelValue:p.value,"onUpdate:modelValue":v=>p.value=v},{header:()=>n("h2",null,[e,r(" Modifiers")]),body:s})),h=mt(g(()=>Object.values(i).reduce((v,E)=>a.add(v,E.amount.value),0)),"Sum of Dyes"),{total:y,trackerDisplay:w}=dl({resource:h,goal:6e4,name:e,day:kr,color:t,textColor:"var(--feature-foreground)",modal:{show:p,display:m},ignoreTotal:!0});return{name:e,color:t,dyes:i,dyeSum:h,boosts:o,totalDyeSum:y,minWidth:700,generalTabCollapsed:c,upgrades:d,display:B(()=>n(N,null,[le(w),n(we,null,null),n("div",{style:"width: 620px"},[ze(i.red.display,i.yellow.display,i.blue.display),ze(i.red.buyable,i.yellow.buyable,i.blue.buyable),n(we,null,null),ze(i.orange.display,i.green.display,i.purple.display),ze(i.orange.buyable,i.green.buyable,i.purple.buyable)]),n(we,null,null),n("div",{class:"row",style:"vertical-align: top"},[jt(d.redDyeUpg,d.redDyeUpg2),jt(d.yellowDyeUpg,d.yellowDyeUpg2),jt(d.blueDyeUpg,d.blueDyeUpg2)]),le(d.coalUpg)]))}}),Er="plastic",ti=10,Re=Tt(Er,function(){const e="Plastic",t="#DCD9CD",l=mt(0,"plastic"),[i,o]=il(()=>[{title:"Plastic Gain",modifier:Be,base:0}]),s=j(!1),c=B(()=>n(wt,{modelValue:s.value,"onUpdate:modelValue":z=>s.value=z},{header:()=>n("h2",null,[e,r(" Modifiers")]),body:i})),d=_e(0),p=g(()=>a.times(d.value,100)),m=Pe(()=>({resource:it.metal,cost(){const z=new a(this.amount.value);return a.pow(1.2,z).times(1e7)},display:B(()=>n(N,null,[n("h3",null,[r("Refinery")]),n("br",null,null),r("Refines oil into plastic pellets"),n("br",null,null),r("Consumes 100 oil/s to create 1 plastic/s"),n("br",null,null),n("br",null,null),r("Currently:"),n("br",null,null),r("-"),H(p.value),r(" oil/sec"),n("br",null,null),r("+"),H(d.value),r(" plastic/sec"),n("br",null,null),n("br",null,null),r("Cost: "),ae(u(m.cost))," ",m.resource.displayName])),onPurchase(){d.value=a.add(d.value,1)},style:{width:"300px"}})),{min:h,max:y,add:w,remove:v}=Vt({buyable:m,active:d,style:{minHeight:"20px",width:"40px",color:"var(--feature-foreground)"}}),E=g(()=>a.pow(5,a.add([...Object.values(M),...Object.values(me)].filter(z=>z.bought.value).length,2))),S=q(()=>({resource:F(l),cost:E,display:()=>({title:"Plastic Scissors",description:"Unlock paper upgrades",showCost:!S.bought.value})})),x=q(()=>({resource:F(l),cost:E,display:()=>({title:"Plastic Level",description:"Unlock box upgrades",showCost:!x.bought.value})})),W=q(()=>({resource:F(l),cost:E,display:()=>({title:"Plastic Cane",description:"Unlock cloth upgrades",showCost:!W.bought.value})})),M={paperTools:S,boxTools:x,clothTools:W},_=q(()=>({resource:F(l),cost:E,visibility:()=>b(S.bought.value),display:()=>({title:"Paper Elf Recruitment",description:"Double plastic gain and unlock a new elf for training",showCost:!_.bought.value})})),T=q(()=>({resource:F(l),cost:E,visibility:()=>b(x.bought.value),display:()=>({title:"Box Elf Recruitment",description:"Double plastic gain and unlock a new elf for training",showCost:!T.bought.value})})),X=q(()=>({resource:F(l),cost:E,visibility:()=>b(W.bought.value),display:()=>({title:"Cloth Elf Recruitment",description:"Double plastic gain and unlock a new elf for training",showCost:!X.bought.value})})),me={paperElf:_,boxElf:T,clothElf:X},R=Pe(()=>({resource:F(l),cost(){const z=this.amount.value;return a.pow(1.3,z).times(100)},visibility:()=>b(_.bought.value),display:{title:"Plastic Printing Press",description:"Gain +1% of your paper gain per second",effectDisplay:B(()=>n(N,null,[ae(R.amount.value),r("%")])),showAmount:!1}})),Ae=Pe(()=>({resource:F(l),cost(){const z=this.amount.value;return a.pow(1.3,z).times(100)},visibility:()=>b(T.bought.value),display:{title:"Plastic Box Folder",description:"Gain +1% of your box gain per second",effectDisplay:B(()=>n(N,null,[ae(Ae.amount.value),r("%")])),showAmount:!1}})),ie=Pe(()=>({resource:F(l),cost(){const z=this.amount.value;return a.pow(1.3,z).times(100)},visibility:()=>b(X.bought.value),display:{title:"Plastic Shepherd",description:"All cloth actions are +10% more efficient",effectDisplay:B(()=>n(N,null,[ae(a.times(ie.amount.value,10)),r("%")])),showAmount:!1}})),Le={passivePaper:R,passiveBoxes:Ae,clothGains:ie},Be=ee(()=>[ue(()=>({addend:d,description:"Oil Refinery",enabled:()=>a.gt(d.value,0)})),k(()=>({multiplier:2,description:"Paper Elf Recruitment",enabled:_.bought})),k(()=>({multiplier:2,description:"Box Elf Recruitment",enabled:T.bought})),k(()=>({multiplier:2,description:"Cloth Elf Recruitment",enabled:X.bought})),k(()=>({multiplier:2,description:"Carry plastic in boxes",enabled:Ze.row2Upgrades.plasticUpgrade.bought})),k(()=>({multiplier:()=>Ye.oilEffectiveness.value,description:"Effectiveness",enabled:()=>a.lt(Ye.oilEffectiveness.value,1)})),k(()=>({multiplier:Ve.boosts.yellow1,description:"Yellow Dye Boost 1",enabled:()=>a.gte(Ve.dyes.yellow.amount.value,1)}))]),Ce=g(()=>Be.apply(0));je.on("update",z=>{a.lt(O.day.value,ti)||(l.value=a.times(z,Ce.value).add(l.value))});const{total:Fe,trackerDisplay:qe}=dl({resource:l,goal:25e4,name:e,day:ti,color:t,textColor:"var(--feature-foreground)",modal:{show:s,display:c}});return{name:e,color:t,plastic:l,totalPlastic:Fe,buildRefinery:m,activeRefinery:d,oilCost:p,upgrades:M,elfUpgrades:me,buyables:Le,generalTabCollapsed:o,minWidth:700,display:B(()=>n(N,null,[le(qe),n(we,null,null),n(It,{resource:l,color:t,style:"margin-bottom: 0",effectDisplay:a.gt(Ce.value,0)?`+${H(Ce.value)}/s`:void 0},null),n(we,null,null),n(Dt,null,{default:()=>[le(m),n("div",null,[ae(a.floor(d.value)),r("/"),ae(a.floor(m.amount.value))]),ze(h,v,w,y)]}),n(Tl,null,{default:()=>[jt(S,_,R),jt(x,T,Ae),jt(W,X,ie)]})]))}}),_r="oil",Ca=9,Ye=Tt(_r,function(){const e="Oil",t="#000000",l="var(--foreground)",i=mt(0,"oil"),o=mt(0,"depth"),s=_e(0),c=g(()=>a.lt(o.value,990)?a.add(10,o.value):a.pow(1.001,a.sub(o.value,990)).mul(1e3));function d(){if(a.lt(o.value,990)){const $e=a.min(a.affordArithmeticSeries(s.value,10,1,o.value),a.sub(990,o.value)),Nt=a.sumArithmeticSeries($e,10,1,o.value);s.value=a.sub(s.value,Nt),o.value=a.add(o.value,$e)}if(a.gte(o.value,990)){const $e=a.affordGeometricSeries(s.value,1e3,1.001,a.sub(o.value,990)),Nt=a.sumGeometricSeries($e,1e3,1.001,a.sub(o.value,990));s.value=a.sub(s.value,Nt),o.value=a.add(o.value,$e)}}const p=_e(0),m=g(()=>a.times(a.pow(p.value,W.value).pow(2),1e14)),h=g(()=>a.times(a.pow(p.value,W.value),1)),y=Pe(()=>({resource:it.metal,cost(){const $e=new a(this.amount.value);return a.pow(1.3,$e).times(25e3)},display:B(()=>n(N,null,[n("h3",null,[r("Heavy Drill")]),n("br",null,null),r("A large drill specialized at deep mining."),n("br",null,null),r("Consumes 1e14*(Heavy Drills amount)"),n("sup",null,[r("2")]),r(" coal/sec for (Heavy Drills amount) drill power."),n("br",null,null),n("br",null,null),r("Currently:"),n("br",null,null),r("-"),be(m.value),r(" coal/sec"),n("br",null,null),r("+"),be(h.value),r(" drill power"),n("br",null,null),n("br",null,null),r("Cost: "),ye(u(y.cost)),r(" "),y.resource.displayName])),onPurchase(){p.value=a.add(p.value,1)},style:{color:l,width:"160px"}})),{min:w,max:v,add:E,remove:S}=Vt({buyable:y,active:p}),x=_e(0),W=g(()=>a.add(x.value,Math.E).ln()),M=Pe(()=>({resource:it.metal,cost(){const $e=new a(this.amount.value);return a.pow(2,$e).times(1e5)},display:B(()=>n(N,null,[n("h3",null,[r("Heavy Drill Drill")]),n("br",null,null),r("Attach extra drills to Heavy Drills to make them faster"),n("br",null,null),r("Raise amount of effective Heavy Drills by ^ln(Heavy Drill Drill amount + e)."),n("br",null,null),r("(also affects coal consumption)."),n("br",null,null),n("br",null,null),r("Currently:"),n("br",null,null),r("^"),be(W.value),r(" Heavy Drill amount"),n("br",null,null),n("br",null,null),r("Cost: "),ye(u(M.cost)),r(" "),M.resource.displayName])),onPurchase(){x.value=a.add(x.value,1)},style:{color:l,width:"160px"}})),{min:_,max:T,add:X,remove:me}=Vt({buyable:M,active:x}),R=_e(0),Ae=g(()=>a.pow(1/3,R.value)),ie=g(()=>a.pow(2,R.value)),Le=g(()=>a.pow(1.2,R.value)),Be=Pe(()=>({resource:it.metal,cost(){const $e=new a(this.amount.value);return a.pow(8,$e).times(2e5)},display:B(()=>n(N,null,[n("h3",null,[r("Heavy Extractor")]),n("br",null,null),r("Attach extractors to the drill to mine coal and ore, but with a price."),n("br",null,null),r("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),r("Currently:"),n("br",null,null),r("\xD7"),be(Ae.value),r(" drill power"),n("br",null,null),r("\xD7"),be(ie.value),r(" coal/sec"),n("br",null,null),r("\xD7"),be(Le.value),r(" ore/sec"),n("br",null,null),n("br",null,null),r("Cost: "),ye(u(Be.cost))," ",Be.resource.displayName])),onPurchase(){R.value=a.add(R.value,1)},style:{color:l,width:"160px"}})),{min:Ce,max:Fe,add:qe,remove:z}=Vt({buyable:Be,active:R}),he=_e(0),ve=g(()=>a.pow(kt[3].bought.value?4:5,he.value)),ke=g(()=>a.add(he.value,Ha.value).pow(2).mul(p.value).mul(a.add(x.value,1)).mul(R.value).mul(o.value).div(1e5)),xe=Pe(()=>({resource:it.metal,cost(){const $e=new a(this.amount.value);let Nt=a.pow(16,$e).times(2e6);return kt[4].bought.value&&(Nt=Nt.div(a.add(Cl.value,1).root(6))),Nt},display:B(()=>n(N,null,[n("h3",null,[r("Oil Pump")]),n("br",null,null),r("Pump that oil from the ground."),n("br",null,null),r("Gain oil based on the number of Heavy buildings active and well depth, but coal usage is multiplied by "),kt[3].bought.value?4:5,r("\xD7."),n("br",null,null),n("br",null,null),r("Currently:"),n("br",null,null),r("\xD7"),be(ve.value),r(" coal usage"),n("br",null,null),r("+"),be(ke.value),r(" oil/sec"),n("br",null,null),n("br",null,null),r("Cost: "),ye(u(xe.cost)),r(" "),xe.resource.displayName])),onPurchase(){he.value=a.add(he.value,1)},style:{color:l,width:"160px"}})),{max:Me,min:He,add:Qe,remove:At}=Vt({buyable:xe,active:he}),$=_e(0),K=g(()=>a.pow($.value,2)),se=g(()=>a.pow($.value,3).mul(1e19)),We=g(()=>a.add($.value,1)),ge=Pe(()=>({resource:F(i),cost(){const $e=new a(this.amount.value);return a.pow(2,$e).times(50)},display:B(()=>n(N,null,[n("h3",null,[r("Oil Burner")]),n("br",null,null),r("Burn oil as fuel."),n("br",null,null),r("(Oil Burner Amount)"),n("sup",null,[r("2")]),r(" unit of oil can give 1e19*(Oil Burner Amount)"),n("sup",null,[r("3")]),r(" units of coal."),n("br",null,null),n("br",null,null),r("Currently:"),n("br",null,null),r("-"),be(K.value),r(" oil/sec"),n("br",null,null),r("-"),be(se.value),r(" coal consumption"),kt[2].bought.value?n(N,null,[n("br",null,null),r("\xD7"),be(We.value),r(" to auto smelting multi")]):"",n("br",null,null),n("br",null,null),r("Cost: "),ye(u(ge.cost)),r(" "),ge.resource.displayName])),onPurchase(){$.value=a.add($.value,1)},style:{color:l,width:"160px"}})),{max:rt,min:tt,add:Ge,remove:ut}=Vt({buyable:ge,active:$}),Je=_e(0),Y=g(()=>a.pow(Je.value,2).mul(100)),Ie=g(()=>a.add(Je.value,1)),gt=Pe(()=>({resource:it.metal,cost(){const $e=new a(this.amount.value);let Nt=a.pow(10,$e).times(1e7);return kt[4].bought.value&&(Nt=Nt.div(a.add(Cl.value,1).root(6))),Nt},display:B(()=>n(N,null,[n("h3",null,[r("Oil Smelter")]),n("br",null,null),r("Use oil as a crucible fuel."),n("br",null,null),r("Burn 100*(Oil Smelter amount)"),n("sup",null,[r("2")]),r(" oil to smelt +100% faster."),n("br",null,null),n("br",null,null),r("Currently:"),n("br",null,null),r("-"),be(Y.value),r(" oil/sec"),n("br",null,null),r("\xD7"),be(Ie.value),r(" smelting speed"),n("br",null,null),n("br",null,null),r("Cost: "),ye(u(gt.cost)),r(" "),gt.resource.displayName])),onPurchase(){Je.value=a.add(Je.value,1)},style:{color:l,width:"160px"}})),{max:te,min:J,add:ft,remove:Lt}=Vt({buyable:gt,active:Je}),dt=[P(()=>({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)})),P(()=>({display:{requirement:"10m Well Depth",effectDisplay:"Drill too slow? Unlock some drill upgrades!"},shouldEarn:()=>a.gte(o.value,10),visibility:()=>b(dt[0].earned.value)})),P(()=>({display:{requirement:"25m Well Depth",effectDisplay:"Gain 5% more ore for each metre of well depth."},shouldEarn:()=>a.gte(o.value,25),visibility:()=>b(dt[1].earned.value)})),P(()=>({display:{requirement:"60m Well Depth",effectDisplay:"Drill still too slow? Try unlocking another drill!"},shouldEarn:()=>a.gte(o.value,60),visibility:()=>b(dt[2].earned.value)})),P(()=>({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:()=>b(dt[3].earned.value)})),P(()=>({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:()=>b(dt[4].earned.value)})),P(()=>({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:()=>b(a.gte(o.value,1e3))})),P(()=>({display:{requirement:"3,000m Well Depth",effectDisplay:"You found a large oil spot! Double oil gain!"},shouldEarn:()=>a.gte(o.value,3e3),visibility:()=>b(a.gte(o.value,2e3))}))],{collapseMilestones:re,display:Bt}=Hl(dt),_t=[P(()=>({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(Cl.value,100)})),P(()=>({display:{requirement:"500 total oil",effectDisplay:"Unlocks oil upgrades! These can be bought with oil."},shouldEarn:()=>a.gte(Cl.value,500),visibility:()=>b(_t[0].earned.value)})),P(()=>({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(Cl.value,1e4),visibility:()=>b(_t[1].earned.value)}))],{collapseMilestones:Yt,display:pl}=Hl(_t),Rt=[q(()=>({resource:G.coal,cost:1e18,display:{title:"Coal Drill Synergy",description:"Increase drill power by +4% per coal Mining Drill owned.",effectDisplay:B(()=>n(N,null,[r("x"),be(Ct[0].value)]))},style:{color:l}})),q(()=>({resource:it.metal,cost:15e4,display:{title:"Metal Drill Synergy",description:"Increase drill power by +4% per ore Mining Drill owned.",effectDisplay:B(()=>n(N,null,[r("x"),be(Ct[1].value)]))},style:{color:l}})),q(()=>({resource:G.coal,cost:1e20,display:{title:"Coal Drill Upgrade",description:"Increase drill power by +6% per OoM of coal owned.",effectDisplay:B(()=>n(N,null,[r("x"),be(Ct[2].value)]))},style:{color:l}})),q(()=>({resource:it.metal,cost:15e5,display:{title:"Metal Drill Upgrade",description:"Increase drill power by +10% per OoM of metal ingot owned.",effectDisplay:B(()=>n(N,null,[r("x"),be(Ct[3].value)]))},style:{color:l}})),q(()=>({resource:F(i),cost:100,display:{title:"Drill Oil",description:"Increase previous upgrades' effect by +0.1% per Heavy Drill owned.",effectDisplay:B(()=>n(N,null,[r("+"),be(a.mul(Ct[4].value,100)),r("%")]))},style:{color:l}}))],Ct=[g(()=>a.mul(G.buildDrill.amount.value,a.add(.04,ol.value)).add(1)),g(()=>a.mul(it.oreDrill.amount.value,a.add(.04,ol.value)).add(1)),g(()=>a.mul(a.max(G.coal.value,1).log10().floor(),a.add(.06,ol.value)).add(1)),g(()=>a.mul(a.max(it.metal.value,1).log10().floor(),a.add(.1,ol.value)).add(1)),g(()=>a.mul(y.amount.value,.001))],kt=[q(()=>({resource:F(i),cost:100,display:{title:"Oil the Oil Pump",description:"Double oil gain."},style:{color:l}})),q(()=>({resource:F(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}})),q(()=>({resource:F(i),cost:1500,display:{title:"Blaster Burner",description:"The Oil Burner can now increase your metal gain."},style:{color:l}})),q(()=>({resource:F(i),cost:25e3,display:{title:"Oil Integration",description:"Reduce Oil Pump's coal consumption multipler from 5 to 4"},style:{color:l}})),q(()=>({resource:F(i),cost:5e4,display:{title:"Be One with the Oil",description:B(()=>n(N,null,[r("Divide metal ingot prices of oil buildings by "),n("sup",null,[r("6")]),n(oa,null,{default:()=>[r("total oil + 1")]})]))},style:{color:l}}))],nl=ee(()=>[ue(()=>({addend:()=>a.negate(m.value),description:"Heavy Drill",enabled:()=>a.gt(p.value,0)})),k(()=>({multiplier:ve,description:"Oil Pump",enabled:()=>a.gt(he.value,0)})),ue(()=>({addend:fa,description:"Oil to Coal Substitution",enabled:()=>a.gt(fa.value,0)}))]),Ot=g(()=>nl.apply(0)),Zt=ee(()=>[ue(()=>({addend:h,description:"Heavy Drill",enabled:()=>a.gt(p.value,0)})),k(()=>({multiplier:Ae,description:"Heavy Extractor",enabled:()=>a.gt(R.value,0)})),k(()=>({multiplier:Ct[0],description:"Coal Drill Synergy",enabled:Rt[0].bought})),k(()=>({multiplier:Ct[1],description:"Metal Drill Synergy",enabled:Rt[1].bought})),k(()=>({multiplier:Ct[2],description:"Coal Drill Upgrade",enabled:Rt[2].bought})),k(()=>({multiplier:Ct[3],description:"Metal Drill Upgrade",enabled:Rt[3].bought})),k(()=>({multiplier:2,description:"Guide to drilling",enabled:Z.upgrades.drillingUpgrade.bought})),k(()=>({multiplier:()=>tl.value,description:"Effectiveness",enabled:()=>a.lt(tl.value,1)}))]),el=g(()=>Zt.apply(0)),Al=ee(()=>[ue(()=>({addend:Ct[4],description:"Drill Oil",enabled:Rt[4].bought}))]),ol=g(()=>Al.apply(0)),Kl=ee(()=>[ue(()=>({addend:ke,description:"Oil Pump",enabled:()=>a.gt(he.value,0)})),k(()=>({multiplier:2,description:"Oil the Oil Pump",enabled:kt[0].bought})),k(()=>({multiplier:2,description:"3000m Well Depth",enabled:dt[7].earned})),k(()=>({multiplier:2,description:"Oil and where to find it",enabled:Z.upgrades.oilUpgrade.bought})),k(()=>({multiplier:()=>tl.value,description:"Effectiveness",enabled:()=>a.lt(tl.value,1)}))]),Ml=g(()=>Kl.apply(0)),Xl=ee(()=>[ue(()=>({addend:()=>a.negate(K.value),description:"Oil Burner",enabled:()=>a.gt($.value,0)})),ue(()=>({addend:()=>a.negate(Y.value),description:"Oil Smelter",enabled:()=>a.gt(Je.value,0)})),ue(()=>({addend:()=>a.negate(Re.oilCost.value),description:"Oil Refinery",enabled:()=>a.gt(Re.activeRefinery.value,0)}))]),U=g(()=>Xl.apply(0)),Qa=ee(()=>[ue(()=>({addend:se,description:"Oil Burner",enabled:()=>a.gt($.value,0)})),k(()=>({multiplier:()=>ml.value,description:"Effectiveness",enabled:()=>a.lt(ml.value,1)}))]),fa=g(()=>Qa.apply(0)),Va=ee(()=>[ue(()=>({addend:Ve.boosts.red1,description:"Red Dye Boost 1",enabled:()=>a.gte(Ve.dyes.red.amount.value,1)}))]),Ha=g(()=>Va.apply(0)),[en,tn]=il(()=>[{title:"Coal Consumption",modifier:nl,unit:"/s",base:0},{title:"Drill Power",modifier:Zt,base:0},{title:"Upgrade Bonus",modifier:Al,base:0,visible(){return a.gt(ol.value,0)}},{title:"Oil Speed",modifier:Kl,unit:"/s",base:0,visible(){return a.gt(Ml.value,0)}},{title:"Oil Consumption",modifier:Xl,unit:"/s",base:0,visible(){return a.lt(U.value,0)}},{title:"Oil to Coal Substitution",modifier:Qa,unit:"/s",base:0,visible(){return a.gt(fa.value,0)}},{title:"Extra Oil Pumps",modifier:Va,base:0,visible(){return a.gt(Ha.value,0)}}]),ya=j(!1),ln=B(()=>n(wt,{modelValue:ya.value,"onUpdate:modelValue":$e=>ya.value=$e},{header:()=>n("h2",null,[e,r(" Modifiers")]),body:en})),tl=j(a.dOne),ml=j(a.dOne);je.on("update",$e=>{if(a.lt(O.day.value,Ca))return;const Nt=a.negate(Ot.value);a.gt(Nt,0)?(tl.value=a.min(a.div(G.coal.value,Nt),1),G.coal.value=a.sub(G.coal.value,a.mul(Nt,tl.value).mul($e))):tl.value=a.dOne,s.value=a.add(s.value,a.mul(el.value,$e)),i.value=a.add(i.value,a.mul(Ml.value,$e)),d();const ha=a.negate(U.value);a.gt(ha,0)?(ml.value=a.min(a.div(i.value,ha),1),i.value=a.sub(i.value,a.mul(ha,ml.value).mul($e)).max(0)):ml.value=a.dOne});const{total:Cl,trackerDisplay:an}=dl({resource:i,goal:25e4,name:e,day:Ca,color:t,modal:{show:ya,display:ln}});return{name:e,day:Ca,color:t,oil:i,totalOil:Cl,depth:o,drillProgress:s,activeHeavy:p,buildHeavy:y,activeHeavy2:x,buildHeavy2:M,activeExtractor:R,buildExtractor:Be,activePump:he,buildPump:xe,activeBurner:$,buildBurner:ge,activeSmelter:Je,buildSmelter:gt,extractorCoal:ie,extractorOre:Le,coalEffectiveness:tl,oilEffectiveness:ml,depthMilestones:dt,collapsedDepthMilestones:re,row1Upgrades:Rt,row2Upgrades:kt,minWidth:700,oilMilestones:_t,collapsedOilMilestones:Yt,generalTabCollapsed:tn,display:B(()=>{const $e=[];return dt[1].earned.value&&$e.push(Rt),_t[1].earned.value&&$e.push(kt),n(N,null,[le(an),n(we,null,null),a.lt(tl.value,1)?n("div",null,[r("Coal efficiency: "),be(a.mul(tl.value,100)),r("%")]):null,a.lt(ml.value,1)?n("div",null,[r("Oil efficiency: "),be(a.mul(ml.value,100)),r("%")]):null,n(It,{resource:i,color:t,sticky:!0,productionDisplay:B(()=>n(N,null,[a.lt(o.value,1e3)?"Reach 1000m to start gaining oil":n(N,null,[ia(a.add(Ml.value,U.value))])]))},null),a.eq(Ml.value,0)?n(N,null,[r("(Need at least 1 Oil Pump, 1 Heavy Drill and 1 Heavy Extractor active to gain oil)"),n("br",null,null)]):"",n(Tl,null,{default:()=>[dt[6].earned.value?n(Dt,null,{default:()=>[le(xe),n("div",null,[ye(a.floor(he.value)),r("/"),ye(a.floor(xe.amount.value))]),ze(He,At,Qe,Me)]}):null,_t[0].earned.value?n(Dt,null,{default:()=>[le(ge),n("div",null,[ye(a.floor($.value)),r("/"),ye(a.floor(ge.amount.value))]),ze(tt,ut,Ge,rt)]}):null,_t[2].earned.value?n(Dt,null,{default:()=>[le(gt),n("div",null,[ye(a.floor(Je.value)),r("/"),ye(a.floor(gt.amount.value))]),ze(J,Lt,ft,te)]}):null]}),n("br",null,null),n("div",null,[n("span",null,[r("The well is ")]),n("h2",{style:"color: #6f767f; text-shadow: 0 0 10px #6f767f"},[ye(o.value)]),r("m deep"),n("br",null,null),r("Next at "),be(a.sub(c.value,s.value))," ",r("drill power seconds")]),n("div",null,[n("span",null,[r("Your drill power is ")]),n("h2",{style:"color: #6f767f; text-shadow: 0 0 10px #6f767f"},[be(el.value)])]),n(we,null,null),n(Tl,null,{default:()=>[n(Dt,null,{default:()=>[le(y),n("div",null,[ye(a.floor(p.value)),r("/"),ye(a.floor(y.amount.value))]),ze(w,S,E,v)]}),dt[3].earned.value?n(Dt,null,{default:()=>[le(M),n("div",null,[ye(a.floor(x.value)),r("/"),ye(a.floor(M.amount.value))]),ze(_,me,X,T)]}):null,dt[5].earned.value?n(Dt,null,{default:()=>[le(Be),n("div",null,[ye(a.floor(R.value)),r("/"),ye(a.floor(Be.amount.value))]),ze(Ce,z,qe,Fe)]}):null]}),n(we,null,null),Bl(...$e),n(we,null,null),Bt(),a.gte(Cl.value,50)?pl():""])})}}),Sr="metal",li=7,it=Tt(Sr,function(){const e="Metal",t="#888B8D",l=mt(0,"metal ingots",void 0,!0),i=Ya(l),o=mt(0,"ore"),s=Ya(o),c=ee(()=>[k(()=>({multiplier:5,description:"Crucible",enabled:Fe.bought})),k(()=>({multiplier:1.5,description:"Industrial Crucible",enabled:()=>a.gte(ke.amount.value,1)})),k(()=>({multiplier:2,description:"Industrial Furnace",enabled:z.bought})),k(()=>({multiplier:()=>a.add(He.value,1),description:"Hotter Forges",enabled:()=>a.gte(Me.amount.value,1)})),k(()=>({multiplier:2,description:"Carry metal in boxes",enabled:Ze.row2Upgrades.metalUpgrade.bought})),k(()=>({multiplier:Ve.boosts.purple2,description:"Purple Dye Boost 2",enabled:()=>a.gte(Ve.dyes.purple.amount.value,1)})),k(()=>({multiplier:()=>a.add(at.cloth.value,1).log10().plus(1),description:"Glistening Paint",enabled:Ve.upgrades.redDyeUpg.bought}))]),d=g(()=>c.apply(.1)),p=ee(()=>[ue(()=>({addend:()=>a.times(ke.amount.value,10),description:"Industrial Crucibles",enabled:()=>a.gte(ke.amount.value,1)})),k(()=>({multiplier:2,description:"Efficient Crucibles",enabled:G.efficientSmelther.bought})),k(()=>({multiplier:()=>a.mul(Ye.activeSmelter.value,Ye.oilEffectiveness.value).add(1),description:"Oil Smelter",enabled:()=>a.gt(Ye.activeSmelter.value,0)})),k(()=>({multiplier:Ve.boosts.purple2,description:"Purple Dye Boost 2",enabled:()=>a.gte(Ve.dyes.purple.amount.value,1)})),k(()=>({multiplier:()=>a.add(Re.activeRefinery.value,1).sqrt(),description:"De Louvre",enabled:Ve.upgrades.redDyeUpg2.bought}))]),m=g(()=>p.apply(0)),h=ee(()=>[k(()=>({multiplier:3,description:"Efficient Crucibles",enabled:G.efficientSmelther.bought})),k(()=>({multiplier:()=>a.add(Ye.activeBurner.value,1).mul(Ye.oilEffectiveness.value),description:"Blaster Burner",enabled:Ye.row2Upgrades[2].bought}))]),y=g(()=>h.apply(1)),w=1e10,v=g(()=>a.min(o.value,a.div(G.coal.value,w)).floor().max(0)),E=xt(()=>({display:B(()=>{const ge=a.gte(v.value,1)?v.value:a.add(v.value,1);return n(N,null,[n("span",{style:"font-size: large"},[r("Smelt "),be(a.times(v.value,d.value))," ",l.displayName]),n("br",null,null),n("span",{style:"font-size: large"},[r("Cost: "),ye(ge),r(" "),o.displayName,r(";")," ",ye(a.times(ge,w)),r(" "),G.coal.displayName])])}),canClick:()=>a.gte(v.value,1),onClick(){!u(this.canClick)||S(v.value)},style:{width:"600px",minHeight:"unset"}}));function S(ge,rt=1){const[tt,Ge,ut]=[a.times(ge,d.value).times(rt),ge,a.times(ge,w)];l.value=a.add(l.value,tt),o.value=a.sub(o.value,Ge),G.coal.value=a.sub(G.coal.value,ut)}const x=ee(()=>[ue(()=>({addend:()=>ve.amount.value,description:"Mining Drills",enabled:()=>a.gte(ve.amount.value,1)})),k(()=>({multiplier:()=>a.mul(Ye.depth.value,.05).add(1),description:"25m Well Depth",enabled:Ye.depthMilestones[2].earned})),k(()=>({multiplier:Ye.extractorOre,description:"Heavy Extractor",enabled:()=>a.gt(Ye.activeExtractor.value,0)})),k(()=>({multiplier:2,description:"Carry ore in boxes",enabled:Ze.row2Upgrades.oreUpgrade.bought}))]),W=g(()=>x.apply(1)),M=ee(()=>[k(()=>({multiplier:2,description:"A Simple Pickaxe",enabled:Be.bought})),k(()=>({multiplier:2,description:"Double Pickaxe",enabled:Ce.bought})),k(()=>({multiplier:2.5,description:"Mining Drills",enabled:()=>a.gte(ve.amount.value,1)})),k(()=>({multiplier:2,description:"Efficient Drills",enabled:he.bought})),k(()=>({multiplier:2,description:"Oil the Mining Drills",enabled:Ye.row2Upgrades[1].bought}))]),_=g(()=>M.apply(a.recip(X))),T=_e(0),X=10,me=Jt(()=>({width:400,height:25,direction:De.Right,fillStyle:{backgroundColor:t},progress:()=>T.value})),R=ee(()=>[ue(()=>({addend:W})),k(()=>({multiplier:_}))]),Ae=g(()=>R.apply(0)),ie=ee(()=>[ue(()=>({addend:Ae})),ue(()=>({addend:()=>a.negate(m.value),enabled:xe}))]),Le=g(()=>ie.apply(0)),Be=q(()=>({resource:F(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"}})),Ce=q(()=>({resource:F(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:()=>b(Ce.bought.value)})),Fe=q(()=>({resource:F(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:()=>b(Fe.bought.value||a.div(s.value,d.value).plus(i.value).gte(1))})),qe=q(()=>({resource:F(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:()=>b(a.gte(ve.amount.value,1)&&(qe.bought.value||O.days[7].opened.value||a.lt(G.computedCoalGain.value,a.times(W.value,_.value).times(w)))),onPurchase(){O.days[2].recentlyUpdated.value=!0}})),z=q(()=>({canAfford(){return a.gte(l.value,50)&&a.gte(G.coal.value,1e11)},onPurchase(){l.value=a.sub(l.value,50),G.coal.value=a.sub(G.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/>${be(1e11)} ${G.coal.displayName}`}})),he=q(()=>({resource:F(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:()=>b(Ye.depthMilestones[4].earned.value)})),ve=Pe(()=>({resource:F(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:B(()=>n(N,null,[r("Mine 2.5x faster. Increase ore mining amount by")," ",ye(ve.amount.value),r(" ore per operation")]))},visibility:()=>b(a.gte(ve.amount.value,1)||a.div(s.value,d.value).plus(i.value).gte(10)),style:{width:"200px"}})),ke=Pe(()=>({resource:F(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:B(()=>n(N,null,[r("Automatically smelts")," ",ye(a.times(ke.amount.value,10)),r(" ore per second")]))},visibility:()=>b(a.gte(ke.amount.value,1)||a.gte(ve.amount.value,4)||a.gte(s.value,50)),style:{width:"200px"}})),xe=_e(!0),Me=Pe(()=>({resource:G.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:B(()=>n(N,null,[r("Gain "),ye(a.times(He.value,100)),r("% more metal per ore")]))},visibility:()=>b(a.gte(Me.amount.value,1)||z.bought.value),style:{width:"200px"}})),He=g(()=>a.times(Me.amount.value,.25));je.on("update",ge=>{T.value=a.times(ge,_.value).plus(T.value);const rt=T.value.trunc();T.value=T.value.minus(rt),o.value=a.add(o.value,a.times(rt,W.value)),xe.value&&S(a.min(v.value,a.times(m.value,ge)),y.value)});const[Qe,At]=il(()=>[{title:"Auto Smelt Speed",modifier:p,base:0,unit:"/s",visible(){return a.gt(ke.amount.value,0)}},{title:"Auto Smelt Multiplier",modifier:h,base:1,visible(){return a.gt(y.value,1)}},{title:"Metal per Ore",modifier:c,base:.1},{title:"Ore per Mining Operation",modifier:x,base:1},{title:"Mining Speed",modifier:M,base:.1,unit:"/s"}]),$=j(!1),K=B(()=>n(wt,{modelValue:$.value,"onUpdate:modelValue":ge=>$.value=ge},{header:()=>n("h2",null,[e,r(" Modifiers")]),body:Qe})),{total:se,trackerDisplay:We}=dl({resource:l,goal:25e3,name:e,day:li,color:t,modal:{show:$,display:K}});return{name:e,day:li,color:t,ore:o,bestOre:s,oreProgress:T,metal:l,bestMetal:i,totalMetal:se,simplePickaxe:Be,doublePickaxe:Ce,crucible:Fe,coalDrill:qe,industrialFurnace:z,efficientDrill:he,oreDrill:ve,industrialCrucible:ke,autoSmeltEnabled:xe,hotterForge:Me,generalTabCollapsed:At,minWidth:700,display:B(()=>n(N,null,[le(We),n(we,null,null),n(It,{resource:l,color:t,style:"margin-bottom: 0",sticky:!1,productionDisplay:B(()=>n(N,null,[xe.value&&a.gte(ke.amount.value,1)?`+${fi([[m.value,"smelting speed"],[Ae.value,"ore gain"],[a.div(G.computedCoalGain.value,w),"coal gain"]],"/s",a.mul(d.value,y.value))}`:void 0]))},null),n(we,null,null),le(E),a.gte(ke.amount.value,1)?n("div",{style:{width:"150px"}},[n(sl,{title:"Auto Smelt",modelValue:xe.value,"onUpdate:modelValue":ge=>xe.value=ge},null)]):void 0,n(we,null,null),n(It,{resource:o,color:t,style:"margin-bottom: 0",sticky:!1,productionDisplay:B(()=>n(N,null,[yi(Le.value)]))},null),n(we,null,null),n("div",null,[r("Currently mining "),be(W.value),r(" ore every")," ",be(a.recip(_.value)),r(" seconds")]),le(me),n(we,null,null),ze(Be,Ce,Fe,qe,z,he),ze(ve,ke,Me)]))}}),Br="coal",ai=3,G=Tt(Br,function(){const e="Coal",t="#151716",l="#B2BeB5",i="var(--foreground)",o=mt(0,"coal"),s=mt(0,"ash"),c=_e(0),d=g(()=>a.times(c.value,1e3)),p=g(()=>a.times(c.value,.1)),m=g(()=>a.times(c.value,50)),h=Pe(()=>({resource:ce.logs,cost(){let U=a.times(T.amount.value,u(T.cost)).plus(this.amount.value);return a.gte(U,100)&&(U=a.pow(U,2).div(100)),a.gte(U,1e4)&&(U=a.pow(U,2).div(1e4)),U=a.pow(.95,Z.books.smallFireBook.amount.value).times(U),U.pow(1.5).times(1e4)},display:B(()=>n(N,null,[n("h3",null,[r("Small Fire")]),n("br",null,null),r("Burn 1000 logs for 0.1 coal and 50 ash"),n("br",null,null),n("br",null,null),r("Currently:"),n("br",null,null),r("-"),H(d.value),r(" logs/sec"),n("br",null,null),r("+"),H(p.value),r(" coal/sec"),n("br",null,null),r("+"),H(m.value),r(" ash/sec"),n("br",null,null),n("br",null,null),r("Cost: "),ae(u(h.cost)),r(" "),h.resource.displayName])),onPurchase(){c.value=a.add(c.value,1)},style:{color:i,width:"160px"}})),{min:y,max:w,add:v,remove:E}=Vt({active:c,buyable:h}),S=mt(h.amount,"small fires"),x=_e(0),W=g(()=>a.times(x.value,1e4)),M=g(()=>a.times(x.value,10)),_=g(()=>a.times(x.value,1e3)),T=Pe(()=>({resource:S,cost(){return a.pow(.95,Z.books.bonfireBook.amount.value).times(10)},display:B(()=>n(N,null,[n("h3",null,[r("Bonfire")]),n("br",null,null),r("Burn 10,000 logs for 10 coal and 1000 ash"),n("br",null,null),n("br",null,null),r("Currently:"),n("br",null,null),r("-"),H(W.value),r(" logs/sec"),n("br",null,null),r("+"),H(M.value),r(" coal/sec"),n("br",null,null),r("+"),H(_.value),r(" ash/sec"),n("br",null,null),n("br",null,null),r("Cost: "),ae(u(T.cost)),r(" "),T.resource.displayName])),onPurchase(U){c.value=a.sub(c.value,U).max(0),x.value=a.add(x.value,1)},style:{color:i,width:"160px"},visibility:()=>b(ge.bought.value)})),{min:X,max:me,add:R,remove:Ae}=Vt({buyable:T,active:x}),ie=_e(0),Le=g(()=>a.times(ie.value,1e6)),Be=g(()=>a.times(ie.value,1e4)),Ce=g(()=>a.times(ie.value,1e4)),Fe=Pe(()=>({resource:ce.logs,cost(){let U=this.amount.value;return a.gte(U,100)&&(U=a.pow(U,2).div(100)),a.gte(U,1e4)&&(U=a.pow(U,2).div(1e4)),U=a.pow(.95,Z.books.kilnBook.amount.value).times(U),a.pow(1.1,U).times(1e7)},display:B(()=>n(N,null,[n("h3",null,[r("Charcoal Kiln")]),n("br",null,null),r("Burn 1,000,000 logs for 10,000 coal and 10,000 ash"),n("br",null,null),n("br",null,null),r("Currently:"),n("br",null,null),r("-"),H(Le.value),r(" logs/sec"),n("br",null,null),r("+"),H(Be.value),r(" coal/sec"),n("br",null,null),r("+"),H(Ce.value),r(" ash/sec"),n("br",null,null),n("br",null,null),r("Cost: "),ae(u(Fe.cost)),r(" "),Fe.resource.displayName])),onPurchase(){ie.value=a.add(ie.value,1)},style:{color:i,width:"160px"},visibility:()=>b(Je.bought.value)})),{min:qe,max:z,add:he,remove:ve}=Vt({buyable:Fe,active:ie}),ke=_e(0),xe=g(()=>a.times(a.pow(ke.value,Ye.row2Upgrades[1].bought.value?2:1),5e7).times(it.efficientDrill.bought.value?2:1)),Me=Pe(()=>({resource:it.metal,cost(){let U=this.amount.value;return a.gte(U,100)&&(U=a.pow(U,2).div(100)),a.gte(U,1e4)&&(U=a.pow(U,2).div(1e4)),a.pow(1.15,U).times(10)},display:B(()=>n(N,null,[n("h3",null,[r("Mining Drill")]),n("br",null,null),r("Dig through the ground to find 50,000,000 coal"),n("br",null,null),n("br",null,null),r("Currently:"),n("br",null,null),r("+"),H(xe.value),r(" coal/sec"),n("br",null,null),n("br",null,null),r("Cost: "),ae(u(Me.cost)),r(" "),Me.resource.displayName])),onPurchase(){ke.value=a.add(ke.value,1)},style:{color:i,width:"160px"},visibility:()=>b(it.coalDrill.bought.value)})),{max:He,min:Qe,add:At,remove:$}=Vt({buyable:Me,active:ke}),K=q(()=>({resource:F(o),cost:5,display:{title:"Warmer Cutters",description:"Cut down twice as many trees/s"},style:{color:i}})),se=q(()=>({resource:F(o),cost:5,display:{title:"Warmer Planters",description:"Plant twice as many trees/s"},style:{color:i}})),We=q(()=>({resource:F(s),cost:5e3,display:{title:"Ashy Soil",description:"Trees give 25% more logs"},style:{color:i}})),ge=q(()=>({resource:S,cost:10,display:{title:"Bigger Fires",description:"Put all those fires together into a larger blaze"},onPurchase(){S.value=a.add(S.value,this.cost)},style:{color:i}})),rt=[K,se,We,ge],tt=q(()=>({resource:F(o),cost:250,display:{title:"Dedicated Cutter Heaters",description:"Double the bonus from Heated Cutters"},style:{color:i},visibility:()=>b(ge.bought.value)})),Ge=q(()=>({resource:F(o),cost:250,display:{title:"Dedicated Planter Heaters",description:"Double the bonus from Heated Planters"},style:{color:i},visibility:()=>b(ge.bought.value)})),ut=q(()=>({canAfford(){return a.gte(ce.logs.value,1e5)&&a.gte(s.value,1e5)},onPurchase(){ce.logs.value=a.sub(ce.logs.value,1e5),s.value=a.sub(s.value,1e5)},display:B(()=>n(N,null,[n("h3",null,[r("Mulched Soil")]),n("br",null,null),r("Double the bonus from Fertilized Soil"),n("br",null,null),n("br",null,null),r("Cost: "),ae(1e5),r(" "),ce.logs.displayName,n("br",null,null),ae(1e5),r(" "),s.displayName])),style:{color:i},visibility:()=>b(ge.bought.value)})),Je=q(()=>({resource:ce.logs,cost:1e7,display:{title:"Efficient Fires",description:"Move the fires underground to keep the coal from turning to ash"},style:{color:i},visibility:()=>b(ge.bought.value)})),Y=[tt,Ge,ut,Je],Ie=q(()=>({resource:F(o),cost:1e19,display:{title:"Efficient Crucibles",description:"Double auto smelting speed and triple metal gain from auto smelting"},style:{color:i},visibility:()=>b(Ye.depthMilestones[4].earned.value)})),gt=[Ie],te=Pe(()=>({resource:F(o),cost(){let U=this.amount.value;return a.gte(U,50)&&(U=a.pow(U,2).div(50)),a.gte(U,200)&&(U=a.pow(U,2).div(200)),a.gte(U,2e6)&&(U=a.pow(U,2).div(2e6)),U=a.pow(.95,Z.books.heatedCuttersBook.amount.value).times(U),a.add(U,1).pow(2.5).times(10)},display:{title:"Heated Cutters",description:"Even warmer cutters cut down trees faster",effectDisplay:B(()=>n(N,null,[r("Cutters cut down trees "),H(re.value),r("x faster")]))},style:{color:i},visibility:()=>b(K.bought.value)})),J=Pe(()=>({resource:F(o),cost(){let U=this.amount.value;return a.gte(U,50)&&(U=a.pow(U,2).div(50)),a.gte(U,200)&&(U=a.pow(U,2).div(200)),a.gte(U,2e6)&&(U=a.pow(U,2).div(2e6)),U=a.pow(.95,Z.books.heatedPlantersBook.amount.value).times(U),a.add(U,1).pow(2.5).times(10)},display:{title:"Heated Planters",description:"Even warmer planters plant trees faster",effectDisplay:B(()=>n(N,null,[r("Planters plant trees "),H(_t.value),r("x faster")]))},style:{color:i},visibility:()=>b(se.bought.value)})),ft=Pe(()=>({resource:F(s),cost(){let U=this.amount.value;return a.gte(U,50)&&(U=a.pow(U,2).div(50)),a.gte(U,200)&&(U=a.pow(U,2).div(200)),a.gte(U,2e6)&&(U=a.pow(U,2).div(2e6)),U=a.pow(.95,Z.books.fertilizerBook.amount.value).times(U),a.add(U,1).pow(1.5).times(5e4)},display:{title:"Fertilized Soil",description:"More fertilizer helps trees grow bigger",effectDisplay:B(()=>n(N,null,[r("Trees give "),H(pl.value),r("x more logs")]))},style:{color:i},visibility:()=>b(We.bought.value)})),Lt=[te,J,ft],dt=ee(()=>[ue(()=>({addend(){return a.times(te.amount.value,.25)},description:"Heated Cutters",enabled(){return a.gt(te.amount.value,0)}})),k(()=>({multiplier:2,description:"Dedicated Cutter Heaters",enabled:tt.bought}))]),re=g(()=>dt.apply(1)),Bt=ee(()=>[ue(()=>({addend(){return a.times(J.amount.value,.25)},description:"Heated Planters",enabled(){return a.gt(J.amount.value,0)}})),k(()=>({multiplier:2,description:"Dedicated Planter Heaters",enabled:Ge.bought}))]),_t=g(()=>Bt.apply(1)),Yt=ee(()=>[ue(()=>({addend(){return a.times(ft.amount.value,.25)},description:"Fertilized Soil",enabled(){return a.gt(ft.amount.value,0)}})),k(()=>({multiplier:2,description:"Mulched Soil",enabled:ut.bought}))]),pl=g(()=>Yt.apply(1)),Rt=ee(()=>[ue(()=>({addend(){return p.value},description:"Small Fires",enabled(){return a.gt(c.value,0)}})),ue(()=>({addend(){return M.value},description:"Bonfires",enabled(){return a.gt(x.value,0)}})),ue(()=>({addend(){return Be.value},description:"Charcoal Kilns",enabled(){return a.gt(ie.value,0)}})),ue(()=>({addend(){return xe.value},description:"Mining Drills",enabled(){return a.gt(ke.value,0)}})),k(()=>({multiplier:2,description:"Carry coal in boxes",enabled:Ze.upgrades.coalUpgrade.bought})),k(()=>({multiplier:()=>a.div(Ze.buyables.coalBoxesBuyable.amount.value,2).add(1),description:"Carry more coal",enabled:Ze.upgrades.coalUpgrade.bought})),k(()=>({multiplier:()=>a.div(h.amount.value,1e4).add(1),description:"Small Fires Synergy",enabled:Ee.elves.smallFireElf.bought})),k(()=>({multiplier:()=>a.div(T.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:Ee.elves.bonfireElf.bought})),k(()=>({multiplier:()=>a.div(Fe.amount.value,100).times(Ve.boosts.green2.value).add(1),description:"Kiln Synergy",enabled:Ee.elves.kilnElf.bought})),k(()=>({multiplier:2,description:"Mining overalls",enabled:at.metalUpgrades.metalUpgrade2.bought})),k(()=>({multiplier:3,description:"Mining helmet",enabled:at.metalUpgrades.metalUpgrade3.bought})),k(()=>({multiplier:4,description:"Felt-Gripped Pick",enabled:at.metalUpgrades.metalUpgrade4.bought})),k(()=>({multiplier:2,description:"12 Elves Trained",enabled:Ee.milestones[11].earned})),Ti(()=>({exponent:1.25,description:"3 Elves Trained",enabled:Ee.milestones[2].earned,supportLowNumbers:!0})),k(()=>({multiplier:()=>a.mul(Ye.depth.value,.25).add(1),description:"5m Well Depth",enabled:Ye.depthMilestones[0].earned})),k(()=>({multiplier:Ye.extractorCoal,description:"Heavy Extractor",enabled:()=>a.gt(Ye.activeExtractor.value,0)}))]),Ct=g(()=>Rt.apply(0)),kt=ee(()=>[ue(()=>({addend(){return m.value},description:"Small Fires",enabled(){return a.gt(c.value,0)}})),ue(()=>({addend(){return _.value},description:"Bonfires",enabled(){return a.gt(x.value,0)}})),ue(()=>({addend(){return Ce.value},description:"Charcoal Kilns",enabled(){return a.gt(ie.value,0)}})),k(()=>({multiplier:2,description:"Carry ash in boxes",enabled:Ze.upgrades.ashUpgrade.bought})),k(()=>({multiplier:()=>a.div(Ze.buyables.ashBoxesBuyable.amount.value,2).add(1),description:"Carry more ash",enabled:Ze.upgrades.ashUpgrade.bought})),k(()=>({multiplier:()=>a.div(h.amount.value,1e3).add(1),description:"Small Fires Synergy",enabled:Ee.elves.smallFireElf.bought})),k(()=>({multiplier:()=>a.div(T.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:Ee.elves.bonfireElf.bought})),k(()=>({multiplier:()=>a.div(Fe.amount.value,100).times(Ve.boosts.green2.value).add(1),description:"Kiln Synergy",enabled:Ee.elves.kilnElf.bought})),k(()=>({multiplier:4,description:"Mining boots",enabled:at.metalUpgrades.metalUpgrade1.bought}))]),nl=g(()=>kt.apply(0)),Ot=ee(()=>[ue(()=>({addend(){return a.negate(d.value)},description:"Small Fires",enabled(){return a.gt(c.value,0)}})),ue(()=>({addend(){return a.negate(W.value)},description:"Bonfires",enabled(){return a.gt(x.value,0)}})),ue(()=>({addend(){return a.negate(Le.value)},description:"Charcoal Kilns",enabled(){return a.gt(ie.value,0)}}))]),Zt=g(()=>Ot.apply(0)),[el,Al]=il(()=>[{title:"Log Consumption",modifier:Ot,base:0,visible(){return a.gt(c.value,0)||a.gt(x.value,0)||a.gt(ie.value,0)}},{title:"Coal Gain",modifier:Rt,base:0,visible(){return a.gt(c.value,0)||a.gt(x.value,0)||a.gt(ie.value,0)}},{title:"Ash Gain",modifier:kt,base:0,visible(){return a.gt(c.value,0)||a.gt(x.value,0)||a.gt(ie.value,0)}}]),ol=j(!1),Kl=B(()=>n(wt,{modelValue:ol.value,"onUpdate:modelValue":U=>ol.value=U},{header:()=>n("h2",null,[e,r(" Modifiers")]),body:el}));je.on("update",U=>{a.lt(O.day.value,ai)||a.times(U,Zt.value).negate().gt(ce.logs.value)||(ce.logs.value=a.times(U,Zt.value).plus(ce.logs.value),o.value=a.times(U,Ct.value).plus(o.value),s.value=a.times(U,nl.value).plus(s.value),c.value=a.max(c.value,0))});const{total:Ml,trackerDisplay:Xl}=dl({resource:o,goal:1e7,name:e,day:ai,color:t,modal:{show:ol,display:Kl}});return{name:e,color:t,coal:o,totalCoal:Ml,computedCoalGain:Ct,ash:s,activeFires:c,buildFire:h,activeBonfires:x,buildBonfire:T,activeKilns:ie,buildKiln:Fe,activeDrills:ke,buildDrill:Me,warmerCutters:K,warmerPlanters:se,basicFertilizer:We,unlockBonfire:ge,dedicatedCutters:tt,dedicatedPlanters:Ge,betterFertilizer:ut,unlockKiln:Je,efficientSmelther:Ie,heatedCutters:te,heatedPlanters:J,moreFertilizer:ft,computedHeatedCutterEffect:re,computedHeatedPlanterEffect:_t,computedFertilizerEffect:pl,generalTabCollapsed:Al,minWidth:700,display:B(()=>n(N,null,[le(Xl),n(we,null,null),n(It,{resource:o,color:t,style:"margin-bottom: 0",effectDisplay:a.gt(Ct.value,0)?`+${H(Ct.value)}/s`:void 0},null),n(we,null,null),n(It,{resource:s,color:l,style:"margin-bottom: 0",effectDisplay:a.gt(nl.value,0)?`+${H(nl.value)}/s`:void 0},null),n(we,null,null),n(Tl,null,{default:()=>[n(Dt,null,{default:()=>[le(h),n("div",null,[ae(a.floor(c.value)),r("/"),ae(a.floor(h.amount.value))]),ze(y,E,v,w)]}),ge.bought.value?n(N,null,[n(we,null,null),n(Dt,null,{default:()=>[le(T),n("div",null,[ae(x.value),r("/"),ae(T.amount.value)]),ze(X,Ae,R,me)]})]):void 0,Je.bought.value?n(N,null,[n(we,null,null),n(Dt,null,{default:()=>[le(Fe),n("div",null,[ae(ie.value),r("/"),ae(Fe.amount.value)]),ze(qe,ve,he,z)]})]):void 0,it.coalDrill.bought.value?n(N,null,[n(we,null,null),n(Dt,null,{default:()=>[le(Me),n("div",null,[ae(ke.value),r("/"),ae(Me.amount.value)]),ze(Qe,$,At,He)]})]):void 0]}),n(we,null,null),Bl(rt,Y,gt),ze(...Lt)]))}}),Nr="workshop",Ul=2,Mt=Tt(Nr,function(){const e="Workshop",t="#D66B02",l="#D66B02",i=mt(0,"foundation progress"),o=Js(()=>({scaling:Oa(250,1.5),baseResource:ce.logs,gainResource:F(i),roundUpCost:!0,buyMax:!1,spend(ie,Le){ce.logs.value=a.sub(ce.logs.value,Le)}})),s=xt(()=>({display:B(()=>n(N,null,[n("b",{style:"font-size: x-large"},[r("Build part of the foundation")]),n("br",null,null),n("br",null,null),n("span",{style:"font-size: large"},[r("Cost:")," ",Jl(ce.logs,a.gte(o.actualGain.value,1)?o.currentAt.value:o.nextAt.value)," ",ce.logs.displayName])])),visibility:()=>b(a.lt(i.value,100)),canClick:()=>a.gte(o.actualGain.value,1)&&a.lt(i.value,100),onClick(){!u(this.canClick)||o.convert()},style:"width: 600px; min-height: unset"})),c=Pl(()=>({key:"w",description:"Build part of the foundation.",onPress:()=>{s.canClick.value&&s.onClick()}})),d=g(()=>!Ee.milestones[6].earned.value),p=P(()=>({display:{requirement:"1% Foundation Completed",effectDisplay:"Trees give 5% more logs for each % of foundation completed"},shouldEarn:()=>a.gte(i.value,1),showPopups:d})),m=P(()=>({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:()=>b(p.earned.value),showPopups:d})),h=P(()=>({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:()=>b(m.earned.value),showPopups:d})),y=P(()=>({display:{requirement:"30% Foundation Completed",effectDisplay:"All automatic tree cutting is doubled"},shouldEarn:()=>a.gte(i.value,30),visibility:()=>b(h.earned.value),showPopups:d})),w=P(()=>({display:{requirement:"40% Foundation Completed",effectDisplay:"All automatic tree planting is doubled"},shouldEarn:()=>a.gte(i.value,40),visibility:()=>b(y.earned.value),showPopups:d})),v=P(()=>({display:{requirement:"50% Foundation Completed",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>a.gte(i.value,50),visibility:()=>b(w.earned.value),showPopups:d})),E=P(()=>({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:()=>b(v.earned.value),showPopups:d})),S=P(()=>({display:{requirement:"100% Foundation Completed",effectDisplay:"Log per tree is raised to the 1.2th power"},shouldEarn:()=>a.gte(i.value,100),visibility:()=>b(E.earned.value),showPopups:d})),x=P(()=>({display:{requirement:"120% Foundation Completed",effectDisplay:"The 1% milestone is now +2% and multiplicative"},shouldEarn:()=>a.gte(i.value,120),visibility:()=>b(qt.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:d})),W=P(()=>({display:{requirement:"140% Foundation Completed",effectDisplay:"Gain +10% metal for every 10% foundation completed"},shouldEarn:()=>a.gte(i.value,140),visibility:()=>b(qt.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:d})),M=P(()=>({display:{requirement:"160% Foundation Completed",effectDisplay:"Gain +10% oil for every 10% foundation completed"},shouldEarn:()=>a.gte(i.value,160),visibility:()=>b(qt.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:d})),_=P(()=>({display:{requirement:"180% Foundation Completed",effectDisplay:"Gain +10% plastic for every 10% foundation completed"},shouldEarn:()=>a.gte(i.value,180),visibility:()=>b(qt.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:d})),T=P(()=>({display:{requirement:"200% Foundation Completed",effectDisplay:"Double paper, boxes, and all cloth actions"},shouldEarn:()=>a.gte(i.value,200),visibility:()=>b(qt.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:d})),X={logGainMilestone1:p,autoCutMilestone1:m,autoPlantMilestone1:h,autoCutMilestone2:y,autoPlantMilestone2:w,logGainMilestone2:v,morePlantsMilestone1:E,logGainMilestone3:S,extraExpansionMilestone1:x,extraExpansionMilestone2:W,extraExpansionMilestone3:M,extraExpansionMilestone4:_,extraExpansionMilestone5:T},{collapseMilestones:me,display:R}=Hl(X),Ae=Jt(()=>({direction:De.Right,width:600,height:25,fillStyle:`backgroundColor: ${l}`,progress:()=>O.day.value===Ul?a.div(i.value,100):1,display:B(()=>O.day.value===Ul?n(N,null,[ae(i.value),r("%")]):"")}));return Pt(()=>{O.day.value===Ul&&a.gte(i.value,100)&&O.completeDay()}),{name:e,day:Ul,color:t,foundationProgress:i,foundationConversion:o,milestones:X,collapseMilestones:me,minWidth:700,buildFoundationHK:c,display:B(()=>n(N,null,[n("div",null,[O.day.value===Ul?"Complete the foundation to complete the day":`${e} Complete!`]),le(Ae),n(we,null,null),n("div",null,[n("span",null,[r("The foundation is ")]),n("h2",{style:`color: ${t}; text-shadow: 0 0 10px ${t}`},[ae(i.value)]),r("% completed")]),a.lt(i.value,100)?n(we,null,null):null,le(s),n(we,null,null),R()]))}}),Mr="elves",Rl=4,Ee=Tt(Mr,function(){const e="Elves",t="red",l="#911D21",o=Jt(()=>({direction:De.Right,width:600,height:25,fillStyle:`backgroundColor: ${l}`,progress:()=>O.day.value===Rl?a.div(K.value,6).times(.8333333333333334).add(a.div(a.add(G.coal.value,1).log10(),a.log10(1e9)).clamp(0,1).div(6)):1,display:B(()=>O.day.value===Rl?a.lt(K.value,6)?n(N,null,[ae(K.value),r("/6 elves")]):n(N,null,[ae(G.coal.value),r("/"),ae(1e9),r(" coal")]):"")})),s=Ar(()=>({thingsToReset:[ce,Mt,G],onReset(){setTimeout(()=>{Y.earned.value?(ce.row1Upgrades.forEach(re=>re.bought.value=!0),ce.row2Upgrades.forEach(re=>re.bought.value=!0)):We.earned.value&&(ce.row1Upgrades[4].bought.value=!0,ce.row2Upgrades[4].bought.value=!0),ut.earned.value&&(Mt.foundationProgress.value=100),gt.earned.value&&(G.warmerCutters.bought.value=!0,G.warmerPlanters.bought.value=!0,G.basicFertilizer.bought.value=!0,G.unlockBonfire.bought.value=!0,G.dedicatedCutters.bought.value=!0,G.dedicatedPlanters.bought.value=!0,G.betterFertilizer.bought.value=!0,G.unlockKiln.bought.value=!0,G.efficientSmelther.bought.value=!0)})}})),c=ee(()=>[k(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ge.earned})),k(()=>({multiplier:()=>a.times(Z.books.cuttersBook.amount.value,.1).add(1),description:"Now You're Logging!",enabled:()=>a.gt(Z.books.cuttersBook.amount.value,0)})),k(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ie.earned}))]),d=ee(()=>[k(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ge.earned})),k(()=>({multiplier:()=>a.times(Z.books.plantersBook.amount.value,.1).add(1),description:"The Man Who Planted Trees",enabled:()=>a.gt(Z.books.plantersBook.amount.value,0)})),k(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ie.earned}))]),p=ee(()=>[k(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ge.earned})),k(()=>({multiplier:()=>a.times(Z.books.expandersBook.amount.value,.1).add(1),description:"Logjam",enabled:()=>a.gt(Z.books.expandersBook.amount.value,0)})),k(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ie.earned}))]),m=ee(()=>[k(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ge.earned})),k(()=>({multiplier:()=>a.times(Z.books.heatedCuttersBook.amount.value,.1).add(1),description:"Fahrenheit 451",enabled:()=>a.gt(Z.books.heatedCuttersBook.amount.value,0)})),k(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ie.earned}))]),h=ee(()=>[k(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ge.earned})),k(()=>({multiplier:()=>a.times(Z.books.heatedPlantersBook.amount.value,.1).add(1),description:"Tillamook Burn Country",enabled:()=>a.gt(Z.books.heatedPlantersBook.amount.value,0)})),k(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ie.earned}))]),y=ee(()=>[k(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ge.earned})),k(()=>({multiplier:()=>a.times(Z.books.fertilizerBook.amount.value,.1).add(1),description:"The Garden Tree's Handbook",enabled:()=>a.gt(Z.books.fertilizerBook.amount.value,0)})),k(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ie.earned}))]),w=ee(()=>[k(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ge.earned})),k(()=>({multiplier:()=>a.times(Z.books.smallFireBook.amount.value,.1).add(1),description:"Firestarter",enabled:()=>a.gt(Z.books.smallFireBook.amount.value,0)})),k(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ie.earned}))]),v=ee(()=>[k(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ge.earned})),k(()=>({multiplier:()=>a.times(Z.books.bonfireBook.amount.value,.1).add(1),description:"An Arsonist's Guide to Writer's Homes in New England",enabled:()=>a.gt(Z.books.bonfireBook.amount.value,0)})),k(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ie.earned}))]),E=ee(()=>[k(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ge.earned})),k(()=>({multiplier:()=>a.times(Z.books.kilnBook.amount.value,.1).add(1),description:"Little Fires Everywhere",enabled:()=>a.gt(Z.books.kilnBook.amount.value,0)})),k(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ie.earned}))]),S=ee(()=>[k(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ge.earned})),k(()=>({multiplier:()=>a.times(Z.books.paperBook.amount.value,.1).add(1),description:"The Book Thief",enabled:()=>a.gt(Z.books.paperBook.amount.value,0)})),k(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ie.earned}))]),x=ee(()=>[k(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ge.earned})),k(()=>({multiplier:()=>a.times(Z.books.boxBook.amount.value,.1).add(1),description:"Not a box",enabled:()=>a.gt(Z.books.boxBook.amount.value,0)})),k(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ie.earned}))]),W=ee(()=>[k(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ge.earned})),k(()=>({multiplier:()=>a.times(Z.books.clothBook.amount.value,.1).add(1),description:"Fuzzy Bee and Friends",enabled:()=>a.gt(Z.books.clothBook.amount.value,0)})),k(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ie.earned}))]),[M,_]=il(()=>[{title:"Holly Auto-Buy Frequency",modifier:c,base:10,unit:"/s",visible:$.cuttersElf.bought},{title:"Ivy Auto-Buy Frequency",modifier:d,base:10,unit:"/s",visible:$.plantersElf.bought},{title:"Hope Auto-Buy Frequency",modifier:p,base:10,unit:"/s",visible:$.expandersElf.bought},{title:"Jack Auto-Buy Frequency",modifier:m,base:10,unit:"/s",visible:$.heatedCuttersElf.bought},{title:"Mary Auto-Buy Frequency",modifier:h,base:10,unit:"/s",visible:$.heatedPlantersElf.bought},{title:"Noel Auto-Buy Frequency",modifier:y,base:10,unit:"/s",visible:$.fertilizerElf.bought},{title:"Joy Auto-Buy Frequency",modifier:w,base:10,unit:"/s",visible:$.smallFireElf.bought},{title:"Faith Auto-Buy Frequency",modifier:v,base:10,unit:"/s",visible:$.bonfireElf.bought},{title:"Snowball Auto-Buy Frequency",modifier:E,base:10,unit:"/s",visible:$.kilnElf.bought},{title:"Star Auto-Buy Frequency",modifier:S,base:10,unit:"/s",visible:$.paperElf.bought},{title:"Bell Auto-Buy Frequency",modifier:x,base:10,unit:"/s",visible:$.boxElf.bought},{title:"Gingersnap Auto-Buy Frequency",modifier:W,base:10,unit:"/s",visible:$.clothElf.bought}]),T=j(!1),X=B(()=>n(wt,{modelValue:T.value,"onUpdate:modelValue":re=>T.value=re},{header:()=>n("h2",null,[e,r(" Modifiers")]),body:M})),me=g(()=>{let re=a.pow(4,K.value).times(1e6);return a.gte(K.value,9)&&(re=a.times(re,1e15)),re});function R(re){var nl;const Bt=_e(0),_t=_e(0),Yt=re.hasToggle?_e(!1):j(!0),pl=g(()=>re.cooldownModifier.apply(10)),Rt=bt((nl=re.canBuy)!=null?nl:!0);function Ct(Ot){if(kt.bought.value&&u(Rt)){Bt.value=a.add(Bt.value,Ot);const Zt=a.recip(pl.value);_t.value+=Ot/Zt.toNumber(),(_a(re.buyable)?re.buyable:[re.buyable]).forEach(el=>{var Al;for(;a.gte(Bt.value,Zt);)if(re.customCost==null?u(el.canPurchase):a.gte(el.resource.value,re.customCost(el.amount.value)))el.amount.value=a.add(el.amount.value,1),Bt.value=a.sub(Bt.value,Zt),(Al=re.onAutoPurchase)==null||Al.call(re);else{Bt.value=Zt;break}})}}const kt=q(()=>({...re,buyable:void 0,toggle:Yt,buyProgress:Bt,update:Ct,resource:G.coal,cost:me,computedAutoBuyCooldown:pl,amountOfTimesDone:_t,name:re.name,display:()=>({title:re.name,description:B(()=>n(N,null,[re.description,kt.bought.value?null:n(N,null,[" ",r("Training this elf will require resetting all your progress from days 1-3.")]),kt.bought.value&&re.hasToggle===!0?n(N,null,[n(sl,{title:re.toggleDesc,"onUpdate:modelValue":Ot=>Yt.value=Ot,modelValue:Yt.value},null)]):null])),showCost:!kt.bought.value}),style:"width: 190px",onPurchase(){var Ot;(Ot=re.onPurchase)==null||Ot.call(re),s.reset()}}));return kt}const Ae=R({name:"Holly",description:"Holly will automatically purchase cutters you can afford, without actually spending any logs.",buyable:ce.row1Buyables[0],cooldownModifier:c}),ie=R({name:"Ivy",description:"Ivy will automatically purchase planters you can afford, without actually spending any logs.",buyable:ce.row1Buyables[1],cooldownModifier:d}),Le=R({name:"Hope",description:"Hope will automatically purchase forest expanders you can afford, without actually spending any logs.",buyable:ce.row1Buyables[2],cooldownModifier:p}),Be=[Ae,ie,Le],Ce=R({name:"Jack",description:"Jack will automatically purchase heated cutters you can afford, without actually spending any coal.",buyable:G.heatedCutters,cooldownModifier:m}),Fe=R({name:"Mary",description:"Mary will automatically purchase heated planters you can afford, without actually spending any coal.",buyable:G.heatedPlanters,cooldownModifier:h}),qe=R({name:"Noel",description:"Noel will automatically purchase fertilized soil you can afford, without actually spending any ash.",buyable:G.moreFertilizer,cooldownModifier:y}),z=[Ce,Fe,qe],he=R({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:G.buildFire,cooldownModifier:w,visibility:()=>b(Ze.upgrades.logsUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased small fires",onAutoPurchase(){he.toggle.value&&(G.activeFires.value=a.add(G.activeFires.value,1))},onPurchase(){O.days[4].recentlyUpdated.value=!0}}),ve=R({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:G.buildBonfire,cooldownModifier:v,visibility:()=>b(Ze.upgrades.ashUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased bonfires",onAutoPurchase(){const re=u(this.buyable.cost);G.activeFires.value=a.sub(G.activeFires.value,re).max(0),G.buildFire.amount.value=a.sub(G.buildFire.amount.value,re).max(0),ve.toggle.value&&(G.activeBonfires.value=a.add(G.activeBonfires.value,1))},onPurchase(){O.days[4].recentlyUpdated.value=!0},canBuy:G.unlockBonfire.bought}),ke=R({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:G.buildKiln,cooldownModifier:E,visibility:()=>b(Ze.upgrades.coalUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased kilns",onAutoPurchase(){ke.toggle.value&&(G.activeKilns.value=a.add(G.activeKilns.value,1))},onPurchase(){O.days[4].recentlyUpdated.value=!0},canBuy:G.unlockKiln.bought}),xe=[he,ve,ke],Me=R({name:"Star",description:"Star will automatically purchase all books you can afford, without actually spending any paper.",buyable:Object.values(Z.books),cooldownModifier:S,visibility:()=>b(Re.elfUpgrades.paperElf.bought.value)}),He=R({name:"Bell",description:"Bell will automatically purchase all box buyables you can afford, without actually spending any boxes.",buyable:Object.values(Ze.buyables),cooldownModifier:x,visibility:()=>b(Re.elfUpgrades.boxElf.bought.value)}),Qe=R({name:"Gingersnap",description:"Gingersnap will automatically purchase all cloth buyables you can afford, without actually spending any resources.",buyable:[at.buildPens,at.betterShears,at.fasterSpinning],cooldownModifier:W,visibility:()=>b(Re.elfUpgrades.clothElf.bought.value)}),At=[Me,He,Qe],$={cuttersElf:Ae,plantersElf:ie,expandersElf:Le,heatedCuttersElf:Ce,heatedPlantersElf:Fe,fertilizerElf:qe,smallFireElf:he,bonfireElf:ve,kilnElf:ke,paperElf:Me,boxElf:He,clothElf:Qe},K=g(()=>Object.values($).filter(re=>re.bought.value).length),se=P(()=>({display:{requirement:"1 Elf Trained",effectDisplay:"Manual cutting and planting can happen twice as often for each trained elf"},shouldEarn:()=>a.gte(K.value,1)})),We=P(()=>({display:{requirement:"2 Elves Trained",effectDisplay:"Research I & II aren't reset after training"},shouldEarn:()=>a.gte(K.value,2),visibility:()=>b(se.earned.value)})),ge=P(()=>({display:{requirement:"3 Elves Trained",effectDisplay:"Coal gain is raised to the 1.25"},shouldEarn:()=>a.gte(K.value,3),visibility:()=>b(We.earned.value)})),rt=P(()=>({display:{requirement:"4 Elves Trained",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>a.gte(K.value,4),visibility:()=>b(ge.earned.value)})),tt=P(()=>({display:{requirement:"5 Elves Trained",effectDisplay:"Forest is twice as large"},shouldEarn:()=>a.gte(K.value,5),visibility:()=>b(rt.earned.value)})),Ge=P(()=>({display:{requirement:"6 Elves Trained",effectDisplay:"Elves work twice as fast"},shouldEarn:()=>a.gte(K.value,6),visibility:()=>b(tt.earned.value)})),ut=P(()=>({display:{requirement:"7 Elves Trained",effectDisplay:"Workshop Foundation starts at 100% complete after training"},shouldEarn:()=>a.gte(K.value,7),visibility:()=>b(Ge.earned.value&&O.day.value>5)})),Je=P(()=>({display:{requirement:"8 Elves Trained",effectDisplay:"Forest is twice as large (again)"},shouldEarn:()=>a.gte(K.value,8),visibility:()=>b(ut.earned.value)})),Y=P(()=>({display:{requirement:"9 Elves Trained",effectDisplay:"Trees upgrades aren't reset after training"},shouldEarn:()=>a.gte(K.value,9),visibility:()=>b(Je.earned.value)})),Ie=P(()=>({display:{requirement:"10 Elves Trained",effectDisplay:"Elves work twice as fast (again)"},shouldEarn:()=>a.gte(K.value,10),visibility:()=>b(O.day.value>=10)})),gt=P(()=>({display:{requirement:"11 Elves Trained",effectDisplay:"Coal upgrades aren't reset after training"},shouldEarn:()=>a.gte(K.value,11),visibility:()=>b(Ie.earned.value)})),te=P(()=>({display:{requirement:"12 Elves Trained",effectDisplay:"Double coal gain"},shouldEarn:()=>a.gte(K.value,12),visibility:()=>b(gt.earned.value)})),J=[se,We,ge,rt,tt,Ge,ut,Je,Y,Ie,gt,te],ft={manualMilestone:se,researchMilestone:We,coalGainMilestone:ge,logGainMilestone:rt,forestMilestone:tt,elvesMilestone:Ge,foundationMilestone:ut,forestMilestone2:Je,treeUpgradesMilestone:Y,elvesMilestone2:Ie,coalUpgradesMilestone:gt,coalGainMilestone2:te},{collapseMilestones:Lt,display:dt}=Hl(ft);return je.on("update",re=>{a.lt(O.day.value,Rl)||Object.values($).forEach(Bt=>Bt.update(re))}),Pt(()=>{O.day.value===Rl&&a.gte(K.value,6)&&a.gte(G.coal.value,1e9)&&O.completeDay()}),{name:e,color:t,elves:$,totalElves:K,milestones:J,collapseMilestones:Lt,generalTabCollapsed:_,minWidth:700,display:B(()=>n(N,null,[n("div",null,[O.day.value===Rl?`Reach ${ae(6)} trained elves and ${ae(1e9)} ${G.coal.displayName} to complete the day`:`${e} Complete!`," ",r("-")," ",n("button",{class:"button",style:"display: inline-block;",onClick:()=>T.value=!0},[r("Check Modifiers")])]),le(o),le(X),n(we,null,null),n("div",{style:"width: 600px"},[Bl(Be,z,xe,At)]),dt()]))}}),Ir="management",Ol=12,qt=Tt(Ir,()=>{const e="Management",t="green",l=Jt(()=>({direction:De.Right,width:600,height:25,fillStyle:`backgroundColor: ${t}`,progress:()=>O.day.value===Ol?i.value/(Ee.totalElves.value*5):1,display:B(()=>O.day.value===Ol?n(N,null,[ae(i.value),r("/"),ae(Ee.totalElves.value*5)," ",r("elf levels")]):"")})),i=g(()=>{let Y=0;for(const Ie of Object.values(At))Y+=Ie.level.value;return Y}),o=q(()=>({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:ce.logs,cost:1e21})),s=q(()=>({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:()=>b(o.bought.value),resource:Ze.boxes,style:"width: 150px",cost:1e13})),c=ee(()=>[k(()=>({multiplier:()=>We.value,description:"Classroom Effect",enabled:()=>s.bought.value}))]),d=c.apply(1);function p(Y,Ie,...gt){const te=_e(0),J=g(()=>a.pow(10,ft.value).mul(1e4)),ft=g(()=>a.min(a.mul(9,te.value).div(1e4).add(1).log10().floor(),K.amount.value).toNumber()),Lt=g(()=>a.sub(te.value,a.pow(10,ft.value).sub(1).div(9).mul(1e4))),dt=Jt(()=>({direction:De.Right,width:160,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",borderStyle:()=>a.gte(ft.value,K.amount.value)?"border-color: red":"",progress:()=>a.div(Lt.value,J.value),display:B(()=>a.gte(ft.value,K.amount.value)?n(N,null,[r("Limit reached")]):n(N,null,[H(Lt.value),r("/"),H(J.value),r(" XP")]))})),{collapseMilestones:re,display:Bt}=Hl(Ie),_t=ee(()=>[k(()=>({multiplier:d,description:"Global XP Multiplier"})),...gt]),Yt=g(()=>_t.apply(1));return xt(()=>({display:{title:Y.name,description:B(()=>n(N,null,[Y.name,r(" is currently at level "),ae(ft.value),r(", and have achieved a total of "),H(te.value),r(" XP. They buy buyables "),ae(Y.computedAutoBuyCooldown.value),r(" times per second, gaining")," ",a.gte(ft.value,K.amount.value)?0:H(a.mul(Yt.value,Y.computedAutoBuyCooldown.value))," ",r("XP/sec."),le(dt)]))},style:()=>({width:"190px",background:X.value==Y.name?"var(--bought)":""}),onClick(){X.value=Y.name},canClick(){return X.value!==Y.name},state:re,displayMilestone:Bt,level:ft,exp:te,milestones:Ie,timeForExp:Y.computedAutoBuyCooldown,amountOfTimesDone:Y.amountOfTimesDone,elfXPGainComputed:Yt,elfXPGain:_t}))}const m=[P(()=>({display:{requirement:"Holly Level 1",effectDisplay:"Cutting speed multiplies log gain."},shouldEarn:()=>R.level.value>=1})),P(()=>({display:{requirement:"Holly Level 2",effectDisplay:"Holly now buys max."},visibility:()=>b(m[0].earned.value),shouldEarn:()=>R.level.value>=2})),P(()=>({display:{requirement:"Holly Level 3",effectDisplay:"Cutting speed multiplies cloth gain, wool gain (increasing the requirement as well), and sheep gain."},visibility:()=>b(m[1].earned.value),shouldEarn:()=>R.level.value>=3})),P(()=>({display:{requirement:"Holly Level 4",effectDisplay:"Multiply cutting speed by 1.1 per day completed"},visibility:()=>b(m[2].earned.value&&O.day.value>=13),shouldEarn:()=>R.level.value>=4})),P(()=>({display:{requirement:"Holly Level 5",effectDisplay:"Reduce workshop expansion cost by ^0.95"},visibility:()=>b(m[3].earned.value&&O.day.value>=13),shouldEarn:()=>R.level.value>=5}))],h=[P(()=>({display:{requirement:"Ivy Level 1",effectDisplay:"Planters are now twice as efficent."},shouldEarn:()=>Ae.level.value>=1})),P(()=>({display:{requirement:"Ivy Level 2",effectDisplay:"Ivy now buys max."},visibility:()=>b(h[0].earned.value),shouldEarn:()=>Ae.level.value>=2})),P(()=>({display:{requirement:"Ivy Level 3",effectDisplay:B(()=>n(N,null,[r("Planting speed is multiplied by x2^(log"),n("sub",null,[r("10")]),r("(logs)^0.2)")]))},visibility:()=>b(h[1].earned.value),shouldEarn:()=>Ae.level.value>=3})),P(()=>({display:{requirement:"Ivy Level 4",effectDisplay:"Divide planter cost by 10"},visibility:()=>b(h[2].earned.value&&O.day.value>=13),shouldEarn:()=>Ae.level.value>=4})),P(()=>({display:{requirement:"Ivy Level 5",effectDisplay:"Boost planting/cutting speed based on which is falling behind"},visibility:()=>b(h[3].earned.value&&O.day.value>=13),shouldEarn:()=>Ae.level.value>=5}))],y=[P(()=>({display:{requirement:"Hope Level 1",effectDisplay:"Planting speed boosts forest size"},shouldEarn:()=>ie.level.value>=1})),P(()=>({display:{requirement:"Hope Level 2",effectDisplay:"Hope now buys max."},visibility:()=>b(y[0].earned.value),shouldEarn:()=>ie.level.value>=2})),P(()=>({display:{requirement:"Hope Level 3",effectDisplay:"The workshop can be expanded past 100%, but costs scale faster."},visibility:()=>b(y[1].earned.value),shouldEarn:()=>ie.level.value>=3})),P(()=>({display:{requirement:"Hope Level 4",effectDisplay:"Unlock an elf that autobuys mining drills."},visibility:()=>b(y[2].earned.value&&O.day.value>=13),shouldEarn:()=>ie.level.value>=4})),P(()=>({display:{requirement:"Hope Level 5",effectDisplay:"Unlock an elf that autobuys metal buyables."},visibility:()=>b(y[3].earned.value&&O.day.value>=13),shouldEarn:()=>ie.level.value>=5}))],w=[P(()=>({display:{requirement:"Jack Level 1",effectDisplay:"Heated cutters are less expensive."},shouldEarn:()=>Be.level.value>=1})),P(()=>({display:{requirement:"Jack Level 2",effectDisplay:"Coal gain is raised to the ^1.05"},visibility:()=>b(w[0].earned.value),shouldEarn:()=>Be.level.value>=2})),P(()=>({display:{requirement:"Jack Level 3",effectDisplay:"Jack now buys max."},visibility:()=>b(w[1].earned.value),shouldEarn:()=>Be.level.value>=3})),P(()=>({display:{requirement:"Jack Level 4",effectDisplay:"Oil gain is multiplied based on total elf levels."},visibility:()=>b(w[2].earned.value&&O.day.value>=13),shouldEarn:()=>Be.level.value>=4})),P(()=>({display:{requirement:"Jack Level 5",effectDisplay:"Unlock an elf that autobuys oil buyables."},visibility:()=>b(w[3].earned.value&&O.day.value>=13),shouldEarn:()=>Be.level.value>=5}))],v=[P(()=>({display:{requirement:"Mary Level 1",effectDisplay:"Heated planters are less expensive."},shouldEarn:()=>Ce.level.value>=1})),P(()=>({display:{requirement:"Mary Level 2",effectDisplay:"Double tree planting speed"},visibility:()=>b(v[0].earned.value),shouldEarn:()=>Ce.level.value>=2})),P(()=>({display:{requirement:"Mary Level 3",effectDisplay:"Mary now buys max."},visibility:()=>b(v[1].earned.value),shouldEarn:()=>Ce.level.value>=3})),P(()=>({display:{requirement:"Mary Level 4",effectDisplay:"Metal gain is raised to the 1.1."},visibility:()=>b(v[2].earned.value&&O.day.value>=13),shouldEarn:()=>Ce.level.value>=4})),P(()=>({display:{requirement:"Mary Level 5",effectDisplay:"Auto smelting speed is multiplied by (total XP/1000)^0.5"},visibility:()=>b(v[3].earned.value&&O.day.value>=13),shouldEarn:()=>Ce.level.value>=5}))],E=[P(()=>({display:{requirement:"Noel Level 1",effectDisplay:"Log gain is increased based on total elf level."},shouldEarn:()=>Ce.level.value>=1})),P(()=>({display:{requirement:"Noel Level 2",effectDisplay:"Fertilized soil is less expensive"},visibility:()=>b(E[0].earned.value),shouldEarn:()=>Ce.level.value>=2})),P(()=>({display:{requirement:"Noel Level 3",effectDisplay:"Divide the mining drill cost based on total logs produced"},visibility:()=>b(E[1].earned.value),shouldEarn:()=>Ce.level.value>=3})),P(()=>({display:{requirement:"Noel Level 4",effectDisplay:B(()=>n(N,null,[r("Plastic"),n("sup",null,[r("2")]),r(" subtracts from oil refinery cost")]))},visibility:()=>b(E[2].earned.value&&O.day.value>=13),shouldEarn:()=>Ce.level.value>=4})),P(()=>({display:{requirement:"Noel Level 5",effectDisplay:"Unlock an elf that autobuys drills and extractors"},visibility:()=>b(E[3].earned.value&&O.day.value>=13),shouldEarn:()=>Ce.level.value>=5}))],S=[P(()=>({display:{requirement:"Joy Level 1",effectDisplay:"Multiply small fire efficiency by 5."},shouldEarn:()=>z.level.value>=1})),P(()=>({display:{requirement:"Joy Level 2",effectDisplay:"Raise ash gain to the 1.1"},visibility:()=>b(S[0].earned.value),shouldEarn:()=>z.level.value>=2})),P(()=>({display:{requirement:"Joy Level 3",effectDisplay:"Mining drill is 2x more powerful"},visibility:()=>b(S[1].earned.value),shouldEarn:()=>z.level.value>=3})),P(()=>({display:{requirement:"Joy Level 4",effectDisplay:"Metal gain is boosted by heavy drills"},visibility:()=>b(S[2].earned.value&&O.day.value>=13),shouldEarn:()=>z.level.value>=4})),P(()=>({display:{requirement:"Joy Level 5",effectDisplay:"Raise Industrial Crucible's effect to the 1.1"},visibility:()=>b(S[3].earned.value&&O.day.value>=13),shouldEarn:()=>z.level.value>=5}))],x=[P(()=>({display:{requirement:"Faith Level 1",effectDisplay:"Multiply bonfire efficiency by 5."},shouldEarn:()=>he.level.value>=1})),P(()=>({display:{requirement:"Faith Level 2",effectDisplay:"Raise ash gain to the 1.1"},visibility:()=>b(x[0].earned.value),shouldEarn:()=>he.level.value>=2})),P(()=>({display:{requirement:"Faith Level 3",effectDisplay:"Mining drill is 2x more powerful"},visibility:()=>b(x[1].earned.value),shouldEarn:()=>he.level.value>=3})),P(()=>({display:{requirement:"Faith Level 4",effectDisplay:"Oil gain is boosted by heavy drill drills"},visibility:()=>b(x[2].earned.value&&O.day.value>=13),shouldEarn:()=>he.level.value>=4})),P(()=>({display:{requirement:"Faith Level 5",effectDisplay:"Raise Industrial Crucible's effect to the 1.1"},visibility:()=>b(x[3].earned.value&&O.day.value>=13),shouldEarn:()=>he.level.value>=5}))],W=[P(()=>({display:{requirement:"Snowball Level 1",effectDisplay:"Multiply kiln efficiency by 5."},shouldEarn:()=>ve.level.value>=1})),P(()=>({display:{requirement:"Snowball Level 2",effectDisplay:"Raise ash gain to the 1.1"},visibility:()=>b(W[0].earned.value),shouldEarn:()=>ve.level.value>=2})),P(()=>({display:{requirement:"Snowball Level 3",effectDisplay:"Mining drill is 2x more powerful"},visibility:()=>b(W[1].earned.value),shouldEarn:()=>ve.level.value>=3})),P(()=>({display:{requirement:"Snowball Level 4",effectDisplay:"Plastic gain is boosted by heavy extractors"},visibility:()=>b(W[2].earned.value&&O.day.value>=13),shouldEarn:()=>ve.level.value>=4})),P(()=>({display:{requirement:"Snowball Level 5",effectDisplay:"Raise Industrial Crucible's effect to the 1.1"},visibility:()=>b(W[3].earned.value&&O.day.value>=13),shouldEarn:()=>ve.level.value>=5}))],M=[P(()=>({display:{requirement:"Star Level 1",effectDisplay:"Book cost is divided by total books bought."},shouldEarn:()=>xe.level.value>=1})),P(()=>({display:{requirement:"Star Level 2",effectDisplay:"Paper requires 10x less ash"},visibility:()=>b(M[0].earned.value),shouldEarn:()=>xe.level.value>=2})),P(()=>({display:{requirement:"Star Level 3",effectDisplay:"Book cost scaling 5x -> 4x"},visibility:()=>b(M[1].earned.value),shouldEarn:()=>xe.level.value>=3})),P(()=>({display:{requirement:"Star Level 4",effectDisplay:"0.95^(total books) multiplies XP requirement"},visibility:()=>b(M[2].earned.value&&O.day.value>=13),shouldEarn:()=>xe.level.value>=4})),P(()=>({display:{requirement:"Star Level 5",effectDisplay:"Gain 5 free books for all level 5 elves"},visibility:()=>b(M[3].earned.value&&O.day.value>=13),shouldEarn:()=>xe.level.value>=5}))],_=[P(()=>({display:{requirement:"Bell Level 1",effectDisplay:"Every box buyable adds sqrt(level) levels to same-row box buyables."},shouldEarn:()=>Me.level.value>=1})),P(()=>({display:{requirement:"Bell Level 2",effectDisplay:"Box gain ^1.1"},visibility:()=>b(_[0].earned.value),shouldEarn:()=>Me.level.value>=2})),P(()=>({display:{requirement:"Bell Level 3",effectDisplay:"All box buyables scaling bases -1"},visibility:()=>b(_[1].earned.value),shouldEarn:()=>Me.level.value>=3})),P(()=>({display:{requirement:"Bell Level 4",effectDisplay:"Unlock a second row of box buyables"},visibility:()=>b(_[2].earned.value&&O.day.value>=13),shouldEarn:()=>Me.level.value>=4})),P(()=>({display:{requirement:"Bell Level 5",effectDisplay:"Unlock another row of box upgrades"},visibility:()=>b(_[3].earned.value&&O.day.value>=13),shouldEarn:()=>Me.level.value>=5}))],T=[P(()=>({display:{requirement:"Gingersnap Level 1",effectDisplay:"Multiply all primary dye colors by ln(cloth+e)."},shouldEarn:()=>He.level.value>=1})),P(()=>({display:{requirement:"Gingersnap Level 2",effectDisplay:B(()=>n(N,null,[r("Multiply all cloth actions by log"),n("sub",null,[r("10")]),r("(dye sum + 10)")]))},visibility:()=>b(T[0].earned.value),shouldEarn:()=>He.level.value>=2})),P(()=>({display:{requirement:"Gingersnap Level 3",effectDisplay:"Double all dye colors and cloth actions, but reset all dyes."},visibility:()=>b(T[1].earned.value),shouldEarn:()=>He.level.value>=3})),P(()=>({display:{requirement:"Gingersnap Level 4",effectDisplay:B(()=>n(N,null,[n(oa,null,{default:()=>[r("classrooms")]}),r("/2+1 multiplies ALL dye gain, but reset all dyes.")]))},visibility:()=>b(T[2].earned.value&&O.day.value>=13),shouldEarn:()=>He.level.value>=4})),P(()=>({display:{requirement:"Gingersnap Level 5",effectDisplay:"Well depth divides metal machine costs"},visibility:()=>b(T[3].earned.value&&O.day.value>=13),shouldEarn:()=>He.level.value>=5}))],X=_e("Holly"),me=B(()=>{const Y=Object.values(At).find(Ie=>Ie.display.title===X.value);return Y==null?(console.warn("This should not happen.",X.value),""):n(N,null,[X.value,r("'s milestones: "),Y.displayMilestone()])}),R=p(Ee.elves.cuttersElf,m),Ae=p(Ee.elves.plantersElf,h),ie=p(Ee.elves.expandersElf,y),Le=[R,Ae,ie],Be=p(Ee.elves.heatedCuttersElf,w),Ce=p(Ee.elves.heatedPlantersElf,v),Fe=p(Ee.elves.fertilizerElf,E),qe=[Be,Ce,Fe],z=p(Ee.elves.smallFireElf,S),he=p(Ee.elves.bonfireElf,x),ve=p(Ee.elves.kilnElf,W),ke=[z,he,ve],xe=p(Ee.elves.paperElf,M),Me=p(Ee.elves.boxElf,_),He=p(Ee.elves.clothElf,T),Qe=[xe,Me,He],At={cutterElfTraining:R,planterElfTraining:Ae,expandersElfTraining:ie,heatedCutterElfTraining:Be,heatedPlanterElfTraining:Ce,fertilizerElfTraining:Fe,smallfireElfTraining:z,bonfireElfTraining:he,kilnElfTraining:ve,paperElfTraining:xe,boxElfTraining:Me,clothElfTraining:He};je.on("update",()=>{if(!(O.day.value<Ol))for(const Y of Object.values(At)){const Ie=Math.floor(Y.amountOfTimesDone.value);Ie>=1&&(Y.amountOfTimesDone.value-=Ie,a.lt(Y.level.value,K.amount.value)&&(Y.exp.value=a.mul(Y.elfXPGainComputed.value,Ie).add(Y.exp.value)))}});const $=g(()=>{const Y=a.pow(10,K.amount.value);return{wood:Y.mul(1e21),coal:Y.mul(1e32),paper:Y.mul(1e19),boxes:Y.mul(1e13),metalIngots:Y.mul(1e12),cloth:Y.mul(1e4),plastic:Y.mul(1e6),dye:a.add(K.amount.value,1).mul(1e4)}}),K=Pe(()=>({display:B(()=>n(N,null,[n("h3",null,[r("Build a School")]),n("div",null,[r("You gotta start somewhere, right? Each school increases the maximum level for elves by 1, up to 5.")]),n("div",null,[r("You have "),ae(K.amount.value),r(" schools, which are currently letting elves learn up to level")," ",ae(K.amount.value),r(".")]),n("div",null,[r("Costs "),H($.value.wood),r(" logs, "),H($.value.coal)," ",r("coal, "),H($.value.paper),r(" paper, "),H($.value.boxes)," ",r("boxes, "),H($.value.metalIngots),r(" metal ingots,")," ",H($.value.cloth),r(" cloth, "),H($.value.plastic)," ",r("plastic, and requires "),H($.value.dye),r(" of red, yellow, and blue dye")])])),canPurchase(){return $.value.wood.lte(ce.logs.value)&&$.value.coal.lte(G.coal.value)&&$.value.paper.lte(Z.paper.value)&&$.value.boxes.lte(Ze.boxes.value)&&$.value.metalIngots.lte(it.metal.value)&&$.value.cloth.lte(at.cloth.value)&&$.value.plastic.lte(Re.plastic.value)&&$.value.dye.lte(Ve.dyes.blue.amount.value)&&$.value.dye.lte(Ve.dyes.red.amount.value)&&$.value.dye.lte(Ve.dyes.yellow.amount.value)},onPurchase(){ce.logs.value=a.sub(ce.logs.value,$.value.wood),G.coal.value=a.sub(G.coal.value,$.value.coal),Z.paper.value=a.sub(Z.paper.value,$.value.paper),Ze.boxes.value=a.sub(Ze.boxes.value,$.value.boxes),it.metal.value=a.sub(it.metal.value,$.value.metalIngots),at.cloth.value=a.sub(at.cloth.value,$.value.cloth),Re.plastic.value=a.sub(Re.plastic.value,$.value.plastic),this.amount.value=a.add(this.amount.value,1)},purchaseLimit:5,visibility:g(()=>b(o.bought.value)),style:"width: 600px"})),se=g(()=>{const Y=a.add(K.amount.value,1).pow(1.5);return{wood:Y.mul(1e21),coal:Y.mul(1e32),paper:Y.mul(1e19),boxes:Y.mul(1e13),metalIngots:Y.mul(1e12),cloth:Y.mul(1e4),plastic:Y.mul(1e6),dye:Y.mul(1e4)}}),We=g(()=>a.add(ge.amount.value,1).sqrt()),ge=Pe(()=>({display:B(()=>n(N,null,[n("h3",null,[r("Build a Classroom")]),n("div",null,[r("Hopefully it makes the school a bit less boring. Multiplies elves' XP gain by")," ",n(oa,null,{default:()=>[r("Classrooms + 1")]}),r(".")]),n("div",null,[r("You have "),ae(K.amount.value),r(" classrooms, which are currently multiplying elves' XP gain by "),H(We.value)]),n("div",null,[r("Costs "),H(se.value.wood),r(" logs,")," ",H(se.value.coal),r(" coal, "),H(se.value.paper)," ",r("paper, "),H(se.value.boxes),r(" boxes,")," ",H(se.value.metalIngots),r(" metal ingots,")," ",H(se.value.cloth),r(" cloth, "),H(se.value.plastic)," ",r("plastic, and requires "),H(se.value.dye),r(" of red, yellow, and blue dye")])])),canPurchase(){return se.value.wood.lte(ce.logs.value)&&se.value.coal.lte(G.coal.value)&&se.value.paper.lte(Z.paper.value)&&se.value.boxes.lte(Ze.boxes.value)&&se.value.metalIngots.lte(it.metal.value)&&se.value.cloth.lte(at.cloth.value)&&se.value.plastic.lte(Re.plastic.value)&&se.value.dye.lte(Ve.dyes.blue.amount.value)&&se.value.dye.lte(Ve.dyes.red.amount.value)&&se.value.dye.lte(Ve.dyes.yellow.amount.value)},onPurchase(){ce.logs.value=a.sub(ce.logs.value,se.value.wood),G.coal.value=a.sub(G.coal.value,se.value.coal),Z.paper.value=a.sub(Z.paper.value,se.value.paper),Ze.boxes.value=a.sub(Ze.boxes.value,se.value.boxes),it.metal.value=a.sub(it.metal.value,se.value.metalIngots),at.cloth.value=a.sub(at.cloth.value,se.value.cloth),Re.plastic.value=a.sub(Re.plastic.value,se.value.plastic),this.amount.value=a.add(this.amount.value,1)},visibility:g(()=>b(s.bought.value)),style:"width: 600px"})),rt=gr({training:()=>({tab:Aa(()=>({display:B(()=>n(N,null,[n("br",null,null),r("Click on an elf to see their milestones."),n("br",null,null),n("br",null,null),Bl(Le,qe,ke,Qe),n(we,null,null),me()]))})),display:"Elf Training"}),teaching:()=>({tab:Aa(()=>({display:B(()=>n(N,null,[le(K),r(" "),le(ge)," ",Bl([o,s])]))})),display:"The Schools"}),info:()=>({tab:Aa(()=>({display:B(()=>n(N,null,[r("Each elf gains experience points (XP) every time they perform their action (they don't have to buy anything though). When they get enough XP, they can level up, granting special rewards.")]))})),display:"Info"})}),[tt,Ge]=il(()=>[{title:"Global XP Gain",modifier:c,unit:" XP"},{title:"Holly XP Gain per Action",modifier:R.elfXPGain,unit:" XP"},{title:"Ivy XP Gain per Action",modifier:Ae.elfXPGain,unit:" XP"},{title:"Hope XP Gain per Action",modifier:ie.elfXPGain,unit:" XP"},{title:"Jack XP Gain per Action",modifier:Be.elfXPGain,unit:" XP"},{title:"Mary XP Gain per Action",modifier:Ce.elfXPGain,unit:" XP"},{title:"Noel XP Gain per Action",modifier:Fe.elfXPGain,unit:" XP"},{title:"Joy XP Gain per Action",modifier:z.elfXPGain,unit:" XP"},{title:"Faith XP Gain per Action",modifier:he.elfXPGain,unit:" XP"},{title:"Snowball XP Gain per Action",modifier:ve.elfXPGain,unit:" XP"},{title:"Star XP Gain per Action",modifier:xe.elfXPGain,unit:" XP"},{title:"Bell XP Gain per Action",modifier:Me.elfXPGain,unit:" XP"},{title:"Gingersnap XP Gain per Action",modifier:He.elfXPGain,unit:" XP"}]),ut=j(!1),Je=B(()=>n(wt,{modelValue:ut.value,"onUpdate:modelValue":Y=>ut.value=Y},{header:()=>n("h2",null,[e,r(" Modifiers")]),body:tt}));return{name:e,day:Ol,color:t,minWidth:700,elfTraining:At,currentShown:X,tabs:rt,generalTabCollapsed:Ge,teaching:o,schools:K,classrooms:ge,classroomUpgrade:s,display:B(()=>n(N,null,[O.day.value===Ol?"Get all elves to level 5.":`${e} Complete!`,r(" -"),n("button",{class:"button",style:"display: inline-block;",onClick:()=>ut.value=!0},[r("Check Modifiers")]),le(Je),le(l),le(rt)]))}}),Dr="cloth",ii=8,at=Tt(Dr,function(){const e="Cloth",t="white",l=mt(0,"cloth"),i=mt(0,"wool"),o=mt(10,"sheep"),s=_e(0),c=Jt(()=>({direction:De.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(s.value,Qe.value)})),d=xt(()=>({display:{title:"Breed sheep",description:B(()=>n(N,null,[r("Breed "),ye(a.floor(Me.value)),r(" sheep"),n("br",null,null),le(c)]))},style:{minHeight:"80px"},canClick:()=>a.gte(s.value,Qe.value),onClick(){if(a.lt(s.value,Qe.value))return;const te=a.floor(Me.value);o.value=a.add(o.value,te),s.value=0}})),p=_e(0),m=Jt(()=>({direction:De.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(p.value,se.value)})),h=xt(()=>({display:{title:"Shear sheep",description:B(()=>n(N,null,[r("Shear up to "),ye(a.floor($.value)),r(" sheep"),n("br",null,null),le(m)]))},style:{minHeight:"80px"},canClick:()=>a.gte(p.value,se.value),onClick(){if(a.lt(p.value,se.value))return;const te=a.min(o.value,$.value).floor();i.value=a.add(i.value,te),p.value=0}})),y=_e(0),w=Jt(()=>({direction:De.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(y.value,tt.value)})),v=xt(()=>({display:{title:"Spinning wool",description:B(()=>n(N,null,[r("Spin "),ye(a.floor(ge.value)),r(" wool"),n("br",null,null),le(w)]))},style:{minHeight:"80px"},canClick:()=>a.gte(y.value,tt.value),onClick(){if(a.lt(y.value,tt.value))return;const te=a.min(i.value,ge.value).floor();l.value=a.add(l.value,te),i.value=a.sub(i.value,te),y.value=0}})),E=Pl(()=>({key:"b",description:'Press the "Breed Sheep" button',onPress:()=>{d.canClick.value&&d.onClick()}})),S=Pl(()=>({key:"h",description:'Press the "Shear Sheep" button',onPress:()=>{h.canClick.value&&h.onClick()}})),x=Pl(()=>({key:"s",description:'Press the "Spin Wool" button',onPress:()=>{v.canClick.value&&v.onClick()}})),W=Pe(()=>({resource:ce.logs,cost(){let te=this.amount.value;return a.gte(te,100)&&(te=a.pow(te,2).div(100)),te=a.pow(.95,Z.books.clothBook.amount.value).times(te),a.pow(1.5,te).times(1e14)},display:{title:"Build more pens",description:"Breed +1 sheep at once"}})),M=Pe(()=>({resource:it.metal,cost(){let te=this.amount.value;return a.gte(te,100)&&(te=a.pow(te,2).div(100)),te=a.pow(.95,Z.books.clothBook.amount.value).times(te),a.pow(1.4,te).times(1e4)},display:{title:"Make stronger shears",description:"Shear +1 sheep at once"}})),_=Pe(()=>({resource:Z.paper,cost(){let te=this.amount.value;return a.gte(te,100)&&(te=a.pow(te,2).div(100)),te=a.pow(.95,Z.books.clothBook.amount.value).times(te),a.pow(1.3,te).times(1e6)},display:{title:"Learn how to spin",description:"Spin +1 wool at once"}})),T=q(()=>({resource:F(l),cost:100,display:{title:"Lumberjack Boots",description:"Quadruple log gain"}})),X=q(()=>({resource:F(i),cost:150,visibility:()=>b(T.bought.value),display:{title:"Lumberjack Jeans",description:"Quadruple trees cut"}})),me=q(()=>({resource:F(o),cost:200,visibility:()=>b(X.bought.value),display:{title:"Lumberjack Plaid",description:"Quadruple trees planted"}})),Ae={treesUpgrade4:q(()=>({resource:F(l),cost:1e3,visibility:()=>b(Re.upgrades.clothTools.bought.value),display:{title:"Felt-Gripped Axe",description:"10x log gain"}})),treesUpgrade3:me,treesUpgrade2:X,treesUpgrade1:T},ie=q(()=>({resource:F(l),cost:150,display:{title:"Mining boots",description:"Quadruple ash gain"}})),Le=q(()=>({resource:F(i),cost:225,visibility:()=>b(ie.bought.value),display:{title:"Mining overalls",description:"Double coal gain"}})),Be=q(()=>({resource:F(o),cost:300,visibility:()=>b(Le.bought.value),display:{title:"Mining helmet",description:"Triple coal gain"}})),Fe={metalUpgrade4:q(()=>({resource:F(l),cost:2e3,visibility:()=>b(Re.upgrades.clothTools.bought.value),display:{title:"Felt-Gripped Pick",description:"Quadruple coal gain"}})),metalUpgrade3:Be,metalUpgrade2:Le,metalUpgrade1:ie},qe=q(()=>({resource:F(l),cost:200,display:{title:"Scholar's shoes",description:"Double paper gain"}})),z=q(()=>({resource:F(i),cost:200,visibility:()=>b(qe.bought.value),display:{title:"Scholar's slacks",description:"Double paper gain"}})),he=q(()=>({resource:F(o),cost:400,visibility:()=>b(z.bought.value),display:{title:"Scholar's jacket",description:"Double paper gain"}})),ke={paperUpgrade4:q(()=>({resource:F(l),cost:4e3,visibility:()=>b(Re.upgrades.clothTools.bought.value),display:{title:"Felt Elbow Pads",description:"10x paper gain"}})),paperUpgrade3:he,paperUpgrade2:z,paperUpgrade1:qe},xe=ee(()=>[ue(()=>({addend:W.amount,description:"Build more pens"})),k(()=>({multiplier:()=>a.div(Re.buyables.clothGains.amount.value,10).add(1),description:"Plastic Shepherd",enabled:()=>a.gte(Re.buyables.clothGains.amount.value,1)})),k(()=>({multiplier:2,description:"Shepherding for Dummies",enabled:Z.upgrades.clothUpgrade.bought}))]),Me=g(()=>xe.apply(1)),He=ee(()=>[]),Qe=g(()=>He.apply(1)),At=ee(()=>[ue(()=>({addend:M.amount,description:"Make stronger shears"})),k(()=>({multiplier:()=>a.div(Re.buyables.clothGains.amount.value,10).add(1),description:"Plastic Shepherd",enabled:()=>a.gte(Re.buyables.clothGains.amount.value,1)})),k(()=>({multiplier:2,description:"Shepherding for Dummies",enabled:Z.upgrades.clothUpgrade.bought})),k(()=>({multiplier:()=>a.add(ce.computedAutoCuttingAmount.value,1).log10().add(1),description:"Holly Level 3",enabled:qt.elfTraining.cutterElfTraining.milestones[2].earned}))]),$=g(()=>At.apply(1)),K=ee(()=>[]),se=g(()=>K.apply(1)),We=ee(()=>[ue(()=>({addend:_.amount,description:"Learn how to spin"})),k(()=>({multiplier:()=>a.div(Re.buyables.clothGains.amount.value,10).add(1),description:"Plastic Shepherd",enabled:()=>a.gte(Re.buyables.clothGains.amount.value,1)})),k(()=>({multiplier:2,description:"Shepherding for Dummies",enabled:Z.upgrades.clothUpgrade.bought})),k(()=>({multiplier:()=>a.add(ce.computedAutoCuttingAmount.value,1).log10().add(1),description:"Holly Level 3",enabled:qt.elfTraining.cutterElfTraining.milestones[2].earned}))]),ge=g(()=>We.apply(1)),rt=ee(()=>[]),tt=g(()=>rt.apply(1)),[Ge,ut]=il(()=>[{title:"Sheep Gain",modifier:xe,base:1},{title:"Sheep Breeding Cooldown",modifier:He,base:1,visible:!1,unit:"s"},{title:"Shearing Amount",modifier:At,base:1},{title:"Shearing Cooldown",modifier:K,base:1,visible:!1,unit:"s"},{title:"Spinning Amount",modifier:We,base:1},{title:"Spinning Cooldown",modifier:rt,base:1,visible:!1,unit:"s"}]),Je=j(!1),Y=B(()=>n(wt,{modelValue:Je.value,"onUpdate:modelValue":te=>Je.value=te},{header:()=>n("h2",null,[e,r(" Modifiers")]),body:Ge}));je.on("update",te=>{a.lt(O.day.value,ii)||(a.gte(s.value,Qe.value)?s.value=Qe.value:(s.value=a.add(s.value,te),d.isHolding.value&&d.onClick()),a.gte(p.value,se.value)?p.value=se.value:(p.value=a.add(p.value,te),h.isHolding.value&&h.onClick()),a.gte(y.value,tt.value)?y.value=tt.value:(y.value=a.add(y.value,te),v.isHolding.value&&v.onClick()))});const{total:Ie,trackerDisplay:gt}=dl({resource:l,goal:1e3,name:e,day:ii,color:t,textColor:"var(--feature-foreground)",modal:{show:Je,display:Y}});return{name:e,color:t,cloth:l,totalCloth:Ie,wool:i,sheep:o,buildPens:W,betterShears:M,fasterSpinning:_,treesUpgrades:Ae,metalUpgrades:Fe,paperUpgrades:ke,generalTabCollapsed:ut,breedingProgress:s,shearingProgress:p,spinningProgress:y,breedSheepHK:E,shearSheepHK:S,spinWoolHK:x,minWidth:700,display:B(()=>n(N,null,[le(gt),n(we,null,null),n(It,{resource:l,style:"margin-bottom: 0"},null),n(It,{resource:i,style:"margin-bottom: 0"},null),n(It,{resource:o,style:"margin-bottom: 0"},null),ze(d,h,v),ze(W,M,_),n(we,null,null),n(Tl,null,{default:()=>[jt(...Object.values(Ae)),jt(...Object.values(Fe)),jt(...Object.values(ke))]})]))}}),xr="paper",ka=5,Z=Tt(xr,function(){const e="Paper",t="#E8DCB8",l=mt(0,"paper"),i=mt(g(()=>a.min(a.div(ce.logs.value,1e9),a.div(G.ash.value,1e6))),"pulp"),o=Ui(()=>({scaling:Oa(1,1.2),baseResource:i,gainResource:F(l),roundUpCost:!0,spend(z,he){ce.logs.value=a.sub(ce.logs.value,a.times(he,1e9)),G.ash.value=a.sub(G.ash.value,a.times(he,1e6))},gainModifier:Ae})),s=xt(()=>({display:B(()=>{const z=a.gte(o.actualGain.value,1)?o.currentAt.value:o.nextAt.value;return n(N,null,[n("span",{style:"font-size: large"},[r("Create "),ae(o.currentGain.value),r(" "),l.displayName]),n("br",null,null),n("span",{style:"font-size: large"},[r("Cost: "),Jl(ce.logs,z),r(" "),i.displayName,r(" ("),ae(a.times(z,1e9)),r(" "),ce.logs.displayName,r(";")," ",ae(a.times(z,1e6)),r(" "),G.ash.displayName,r(")")])])}),canClick:()=>a.gte(o.actualGain.value,1),onClick(){!u(this.canClick)||o.convert()},style:"width: 600px; min-height: unset"}));function c(z){const he=Pe(()=>({...z,display:{title:z.name,description:`Print a copy of "${z.name}", which ${z.elfName} will use to improve their skills! Each copy printed will reduce the "${z.buyableName}" price scaling by 0.95x and make ${z.elfName} purchase +10% faster!`,effectDisplay:B(()=>n(N,null,[H(a.pow(.95,he.amount.value)),r("x price scaling,")," ",H(a.div(he.amount.value,10).add(1)),r("x auto-purchase speed")])),showAmount:!1},resource:F(l),cost(){let ve=this.amount.value;return(z.elfName==="Star"||z.elfName==="Bell")&&(ve=a.pow(ve,2)),a.gte(ve,100)&&(ve=a.pow(ve,2).div(100)),a.gte(ve,1e4)&&(ve=a.pow(ve,2).div(1e4)),ve=a.pow(.95,x.amount.value).times(ve),a.pow(5,ve).times(10)},style:"width: 600px"}));return he}const d=c({name:"Now You're Logging!",elfName:"Holly",buyableName:"Generic Cutters"}),p=c({name:"The Man Who Planted Trees",elfName:"Ivy",buyableName:"Generic Planters"}),m=c({name:"Logjam",elfName:"Hope",buyableName:"Expand Forest"}),h=c({name:"Fahrenheit 451",elfName:"Jack",buyableName:"Heated Cutters"}),y=c({name:"Tillamook Burn Country",elfName:"Mary",buyableName:"Heated Planters"}),w=c({name:"The Garden Tree's Handbook",elfName:"Noel",buyableName:"Fertilized Soil"}),v=c({name:"Firestarter",elfName:"Joy",buyableName:"Small Fire",visibility:()=>b(Ee.elves.smallFireElf.bought.value)}),E=c({name:"An Arsonist's Guide to Writer's Homes in New England",elfName:"Faith",buyableName:"Bonfire",visibility:()=>b(Ee.elves.bonfireElf.bought.value)}),S=c({name:"Little Fires Everywhere",elfName:"Snowball",buyableName:"Kiln",visibility:()=>b(Ee.elves.kilnElf.bought.value)}),x=c({name:"The Book Thief",elfName:"Star",buyableName:"Paper Buyables",visibility:()=>b(Ee.elves.paperElf.bought.value)}),W=c({name:"Not a box",elfName:"Bell",buyableName:"Box Buyables",visibility:()=>b(Ee.elves.boxElf.bought.value)}),M=c({name:"Fuzzy Bee and Friends",elfName:"Gingersnap",buyableName:"Cloth Buyables",visibility:()=>b(Ee.elves.clothElf.bought.value)}),_={cuttersBook:d,plantersBook:p,expandersBook:m,heatedCuttersBook:h,heatedPlantersBook:y,fertilizerBook:w,smallFireBook:v,bonfireBook:E,kilnBook:S,paperBook:x,boxBook:W,clothBook:M},T=q(()=>({resource:F(l),cost:1e8,visibility:()=>b(Re.upgrades.paperTools.bought.value),display:{title:"Shepherding for Dummies",description:"Double effectiveness of all cloth actions"}})),X=q(()=>({resource:F(l),cost:1e9,visibility:()=>b(Re.upgrades.paperTools.bought.value),display:{title:"Guide to drilling",description:"Double drilling power"}})),me=q(()=>({resource:F(l),cost:1e10,visibility:()=>b(Re.upgrades.paperTools.bought.value),display:{title:"Oil and where to find it",description:"Double oil gain"}})),R={clothUpgrade:T,drillingUpgrade:X,oilUpgrade:me},Ae=ee(()=>[k(()=>({multiplier:2,description:"Scholar's shoes",enabled:at.paperUpgrades.paperUpgrade1.bought})),k(()=>({multiplier:2,description:"Scholar's slacks",enabled:at.paperUpgrades.paperUpgrade2.bought})),k(()=>({multiplier:2,description:"Scholar's jacket",enabled:at.paperUpgrades.paperUpgrade3.bought})),k(()=>({multiplier:10,description:"Felt Elbow Pads",enabled:at.paperUpgrades.paperUpgrade4.bought})),k(()=>({multiplier:Ve.boosts.yellow1,description:"Yellow Dye Boost 1",enabled:()=>a.gte(Ve.dyes.yellow.amount.value,1)}))]),[ie,Le]=il(()=>[{title:"Paper Gain",modifier:Ae,base:1}]),Be=j(!1),Ce=B(()=>n(wt,{modelValue:Be.value,"onUpdate:modelValue":z=>Be.value=z},{header:()=>n("h2",null,[e,r(" Modifiers")]),body:ie}));je.on("update",z=>{a.lt(O.day.value,ka)||(l.value=a.times(z,Re.buyables.passivePaper.amount.value).times(o.currentGain.value).div(100).add(l.value))});const{total:Fe,trackerDisplay:qe}=dl({resource:l,goal:5e3,name:e,day:ka,color:t,textColor:"var(--feature-foreground)",modal:{show:Be,display:Ce}});return{name:e,day:ka,color:t,paper:l,totalPaper:Fe,paperConversion:o,books:_,upgrades:R,generalTabCollapsed:Le,minWidth:700,display:B(()=>n(N,null,[le(qe),n(we,null,null),n(It,{resource:l,color:t,style:"margin-bottom: 0"},null),n(we,null,null),le(s),n(we,null,null),ze(...Object.values(R)),n(we,null,null),jt(...Object.values(_))]))}}),Pr="boxes",Ea=6,Ze=Tt(Pr,function(){const e="Boxes",t="#964B00",l=mt(0,"boxes"),i=Ui(()=>({scaling:Oa(1e10,1),baseResource:ce.logs,gainResource:F(l),roundUpCost:!0})),o=xt(()=>({display:B(()=>n(N,null,[n("span",{style:"font-size: large"},[r("Create "),ae(i.currentGain.value),r(" "),l.displayName]),n("br",null,null),n("span",{style:"font-size: large"},[r("Cost:")," ",Jl(ce.logs,a.gte(i.actualGain.value,1)?i.currentAt.value:i.nextAt.value)," ",ce.logs.displayName])])),canClick:()=>a.gte(i.actualGain.value,1),onClick(){!u(this.canClick)||i.convert()},style:"width: 600px; min-height: unset"})),s=q(()=>({display:{title:"Carry logs in boxes",description:"Double log gain and unlock a new elf for training"},onPurchase(){O.days[3].recentlyUpdated.value=!0},resource:F(l),cost:100})),c=q(()=>({display:{title:"Carry ash in boxes",description:"Double ash gain and unlock a new elf for training"},onPurchase(){O.days[3].recentlyUpdated.value=!0},resource:F(l),cost:1e3})),d=q(()=>({display:{title:"Carry coal in boxes",description:"Double coal gain and unlock a new elf for training"},onPurchase(){O.days[3].recentlyUpdated.value=!0},resource:F(l),cost:4e3})),p={logsUpgrade:s,ashUpgrade:c,coalUpgrade:d},m=q(()=>({resource:F(l),cost:1e8,visibility:()=>b(Re.upgrades.boxTools.bought.value),display:{title:"Carry ore in boxes",description:"Double ore per mining op"}})),h=q(()=>({resource:F(l),cost:1e9,visibility:()=>b(Re.upgrades.boxTools.bought.value),display:{title:"Carry metal in boxes",description:"Double ore purity"}})),y=q(()=>({resource:F(l),cost:1e10,visibility:()=>b(Re.upgrades.boxTools.bought.value),display:{title:"Carry plastic in boxes",description:"Double plastic gain"}})),w={oreUpgrade:m,metalUpgrade:h,plasticUpgrade:y},v=q(()=>({resource:F(l),cost:1e16,visibility:()=>b(qt.elfTraining.boxElfTraining.milestones[4].earned.value),display:{title:"Carry cloth in boxes",description:"Double all cloth actions"}})),E=q(()=>({resource:F(l),cost:1e17,visibility:()=>b(qt.elfTraining.boxElfTraining.milestones[4].earned.value),display:{title:"Carry dye in boxes",description:"Double all dye gain"}})),S=q(()=>({resource:F(l),cost:1e18,visibility:()=>b(qt.elfTraining.boxElfTraining.milestones[4].earned.value),display:{title:"Carry experience in boxes???",description:"Double xp gain"}})),x={clothUpgrade:v,dyeUpgrade:E,xpUpgrade:S},W=Pe(()=>({display:{title:"Carry more logs",description:"Use boxes to carry even more logs, boosting their gain",effectDisplay:B(()=>n(N,null,[H(a.div(W.amount.value,2).add(1)),r("x")]))},resource:F(l),cost(){let R=this.amount.value;return R=a.pow(.95,Z.books.boxBook.amount.value).times(R),a.pow(3,R).times(100).div(Ve.boosts.orange2.value)},visibility:()=>b(s.bought.value)})),M=Pe(()=>({display:{title:"Carry more ash",description:"Use boxes to carry even more ash, boosting its gain",effectDisplay:B(()=>n(N,null,[H(a.div(M.amount.value,2).add(1)),r("x")]))},resource:F(l),cost(){let R=this.amount.value;return R=a.pow(.95,Z.books.boxBook.amount.value).times(R),a.pow(5,R).times(1e3).div(Ve.boosts.orange2.value)},visibility:()=>b(c.bought.value)})),_=Pe(()=>({display:{title:"Carry more coal",description:"Use boxes to carry even more coal, boosting its gain",effectDisplay:B(()=>n(N,null,[H(a.div(_.amount.value,2).add(1)),r("x")]))},resource:F(l),cost(){let R=this.amount.value;return R=a.pow(.95,Z.books.boxBook.amount.value).times(R),a.pow(7,R).times(1e3).div(Ve.boosts.orange2.value)},visibility:()=>b(d.bought.value)})),T={logBoxesBuyable:W,ashBoxesBuyable:M,coalBoxesBuyable:_};je.on("update",R=>{a.lt(O.day.value,Ea)||(l.value=a.times(R,Re.buyables.passiveBoxes.amount.value).times(i.currentGain.value).div(100).add(l.value))});const{total:X,trackerDisplay:me}=dl({resource:l,goal:5e4,name:e,day:Ea,color:t});return{name:e,day:Ea,color:t,boxes:l,totalBoxes:X,boxesConversion:i,upgrades:p,row2Upgrades:w,row3Upgrades:x,buyables:T,minWidth:700,display:B(()=>n(N,null,[le(me),n(we,null,null),n(It,{resource:l,color:t,style:"margin-bottom: 0"},null),n(we,null,null),le(o),n(we,null,null),Bl(Object.values(p),Object.values(w),Object.values(x)),n(we,null,null),ze(...Object.values(T))]))}}),Tr="trees",ni=1,oi=.1,ce=Tt(Tr,function(){const e="Trees",t="#4BDC13",l="green",i=mt(0,"logs"),o=mt(0,"saplings"),s=j(0),c=ee(()=>[ue(()=>({addend:()=>a.times(R.amount.value,10),description:"Expand Forest",enabled:_.bought})),ue(()=>({addend:()=>a.div(Mt.foundationProgress.value,2),description:"75% Foundation Completed",enabled:Mt.milestones.morePlantsMilestone1.earned})),k(()=>({multiplier:2,description:"5 Elves Trained",enabled:Ee.milestones[4].earned})),k(()=>({multiplier:2,description:"8 Elves Trained",enabled:Ee.milestones[7].earned})),k(()=>({multiplier:4,description:"Lumberjack Boots",enabled:at.treesUpgrades.treesUpgrade1.bought})),ue(()=>({addend:Ve.boosts.blue1,description:"Blue Dye Boost 1",enabled:()=>a.gte(Ve.dyes.blue.amount.value,1)}))]),d=mt(g(()=>a.sub(c.apply(10),o.value)),"trees"),p=g(()=>c.apply(10)),m=q(()=>({resource:F(i),cost:10,display:{title:"Wooden Fingers",description:"Cut down an additional tree per click"}})),h=q(()=>({resource:F(i),cost:10,display:{title:"Leafy Fingers",description:"Plant an additional tree per click"}})),y=q(()=>({resource:F(i),cost:25,display:{title:"Automated Knives",description:"Cut down a tree every second"}})),w=q(()=>({resource:F(i),cost:25,display:{title:"Automated Spade",description:"Plant a tree every second"}})),v=q(()=>({resource:F(i),cost:40,display:{title:"Research I",description:"Trees give 25% more logs, and unlock more upgrades"}})),E=[m,h,y,w,v],S=q(()=>({resource:F(i),cost:50,visibility:()=>b(v.bought.value),display:{title:"Sharper Fingers",description:"Manually cut trees twice as often"}})),x=q(()=>({resource:F(i),cost:50,visibility:()=>b(v.bought.value),display:{title:"Greener Fingers",description:"Manually Plant trees twice as often"}})),W=q(()=>({resource:F(i),cost:150,visibility:()=>b(v.bought.value),display:{title:"Smart Knives",description:"Each time you manually chop trees, gain 1s of automatic tree chopping production"}})),M=q(()=>({resource:F(i),cost:150,visibility:()=>b(v.bought.value),display:{title:"Smart Spades",description:"Each time you manually plant trees, gain 1s of automatic tree planting production"}})),_=q(()=>({resource:F(i),cost:300,visibility:()=>b(v.bought.value),display:{title:"Research II",description:"Trees give 25% more logs, and unlock repeatable purchases"}})),T=[S,x,W,M,_],X=Pe(()=>({resource:F(i),cost(){let J=this.amount.value;return a.gte(J,50)&&(J=a.pow(J,2).div(50)),a.gte(J,200)&&(J=a.pow(J,2).div(200)),a.gte(J,2e6)&&(J=a.pow(J,2).div(2e6)),J=a.pow(.95,Z.books.cuttersBook.amount.value).times(J),a.times(100,J).add(200)},display:{title:"Generic Cutters",description:"Each cutter cuts down 1 tree/s"},visibility:()=>b(_.bought.value)})),me=Pe(()=>({resource:F(i),cost(){let J=this.amount.value;return a.gte(J,50)&&(J=a.pow(J,2).div(50)),a.gte(J,200)&&(J=a.pow(J,2).div(200)),a.gte(J,2e6)&&(J=a.pow(J,2).div(2e6)),J=a.pow(.95,Z.books.plantersBook.amount.value).times(J),a.times(100,J).add(200)},display:{title:"Generic Planters",description:"Each planter plants 0.5 trees/s"},visibility:()=>b(_.bought.value)})),R=Pe(()=>({resource:F(i),cost(){let J=this.amount.value;return a.gte(J,100)&&(J=a.pow(J,2).div(100)),a.gte(J,1e5)&&(J=a.pow(J,2).div(1e5)),J=a.pow(.95,Z.books.expandersBook.amount.value).times(J),a.pow(a.add(J,1),1.5).times(500)},display:{title:"Expand Forest",description:"Add 10 trees to the forest"},visibility:()=>b(_.bought.value)})),Ae=[X,me,R],ie=ee(()=>[ue(()=>({addend:1,description:"Wooden Fingers",enabled:m.bought})),ue(()=>({addend:qe,description:"Smart Knives",enabled:W.bought}))]),Le=g(()=>ie.apply(1)),Be=ee(()=>[k(()=>({multiplier:.5,description:"Sharper Fingers",enabled:S.bought})),k(()=>({multiplier:()=>a.pow(.5,Ee.totalElves.value),description:"1 Elf Trained",enabled:Ee.milestones[0].earned}))]),Ce=g(()=>Be.apply(1)),Fe=ee(()=>[ue(()=>({addend:1,description:"Automated Knives",enabled:y.bought})),ue(()=>({addend:X.amount,description:"Generic Cutters",enabled:_.bought})),ue(()=>({addend:()=>a.div(Mt.foundationProgress.value,5).floor(),description:"10% Foundation Completed",enabled:Mt.milestones.autoCutMilestone1.earned})),k(()=>({multiplier:2,description:"30% Foundation Completed",enabled:Mt.milestones.autoCutMilestone2.earned})),k(()=>({multiplier:2,description:"Warmer Cutters",enabled:G.warmerCutters.bought})),k(()=>({multiplier:G.computedHeatedCutterEffect,description:"Heated Cutters",enabled:()=>a.gt(G.heatedCutters.amount.value,0)})),k(()=>({multiplier:4,description:"Lumberjack Jeans",enabled:at.treesUpgrades.treesUpgrade2.bought}))]),qe=g(()=>Fe.apply(0)),z=ee(()=>[ue(()=>({addend:1,description:"Leafy Fingers",enabled:h.bought})),ue(()=>({addend:Me,description:"Smart Spades",enabled:M.bought}))]),he=g(()=>z.apply(1)),ve=ee(()=>[k(()=>({multiplier:.5,description:"Greener Fingers",enabled:x.bought})),k(()=>({multiplier:()=>a.pow(.5,Ee.totalElves.value),description:"1 Elf Trained",enabled:Ee.milestones[0].earned}))]),ke=g(()=>ve.apply(1)),xe=ee(()=>[ue(()=>({addend:1,description:"Automated Spade",enabled:w.bought})),ue(()=>({addend:()=>a.div(me.amount.value,2),description:"Generic Planters",enabled:_.bought})),ue(()=>({addend:()=>a.div(Mt.foundationProgress.value,10).floor(),description:"20% Foundation Completed",enabled:Mt.milestones.autoPlantMilestone1.earned})),k(()=>({multiplier:2,description:"40% Foundation Completed",enabled:Mt.milestones.autoPlantMilestone2.earned})),k(()=>({multiplier:2,description:"Warmer Planters",enabled:G.warmerPlanters.bought})),k(()=>({multiplier:G.computedHeatedPlanterEffect,description:"Heated Planters",enabled:()=>a.gt(G.heatedPlanters.amount.value,0)})),k(()=>({multiplier:4,description:"Lumberjack Plaid",enabled:at.treesUpgrades.treesUpgrade3.bought})),k(()=>({multiplier:2,description:"Ivy Level 1",enabled:qt.elfTraining.planterElfTraining.milestones[0].earned}))]),Me=g(()=>xe.apply(0)),He=ee(()=>[k(()=>({multiplier:1.25,description:"Research I",enabled:v.bought})),k(()=>({multiplier:1.25,description:"Research II",enabled:_.bought})),k(()=>({multiplier:()=>a.div(Mt.foundationProgress.value,20).add(1),description:"1% Foundation Completed",enabled:Mt.milestones.logGainMilestone1.earned})),k(()=>({multiplier:2,description:"50% Foundation Completed",enabled:Mt.milestones.logGainMilestone2.earned})),k(()=>({multiplier:1.25,description:"Ashy Soil",enabled:G.basicFertilizer.bought})),k(()=>({multiplier:G.computedFertilizerEffect,description:"Fertilized Soil",enabled:()=>a.gt(G.moreFertilizer.amount.value,0)})),k(()=>({multiplier:2,description:"4 Elves Trained",enabled:Ee.milestones[3].earned})),k(()=>({multiplier:2,description:"Carry logs in boxes",enabled:Ze.upgrades.logsUpgrade.bought})),k(()=>({multiplier:()=>a.div(Ze.buyables.logBoxesBuyable.amount.value,2).add(1),description:"Carry more logs",enabled:Ze.upgrades.logsUpgrade.bought})),k(()=>({multiplier:10,description:"Felt-Gripped Axe",enabled:at.treesUpgrades.treesUpgrade4.bought})),k(()=>({multiplier:g(()=>a.add(qe.value,1).log10().plus(1)),description:"Is Blue Dye just Water?",enabled:Ve.upgrades.blueDyeUpg.bought})),k(()=>({multiplier:g(()=>a.add(qe.value,1).log10().plus(1)),description:"Holly Level 1",enabled:qt.elfTraining.cutterElfTraining.milestones[0].earned})),Ti(()=>({exponent:1.2,description:"100% Foundation Completed",enabled:Mt.milestones.logGainMilestone3.earned}))]),Qe=_e(0),At=Jt(()=>({direction:De.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>a.div(Qe.value,Ce.value)})),$=xt(()=>({display:{title:"Cut trees",description:B(()=>n(N,null,[r("Cut down up to "),ae(a.floor(Le.value))," ",r("tree"),a.eq(Le.value,1)?"":"s",r(" at once!"),n("br",null,null),le(At)]))},style:{minHeight:"80px"},canClick:()=>a.gte(d.value,1)&&a.gte(Qe.value,Ce.value),onClick(){if(a.lt(Qe.value,Ce.value))return;const J=a.floor(a.min(d.value,a.times(Le.value,a.div(Qe.value,Ce.value).floor())));i.value=a.add(i.value,a.times(He.apply(1),J)),o.value=a.add(o.value,J),Qe.value=0}})),K=_e(0),se=Jt(()=>({direction:De.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>a.div(K.value,ke.value)})),We=xt(()=>({display:{title:"Plant trees",description:B(()=>n(N,null,[r("Plant up to "),ae(a.floor(he.value))," ",r("tree"),a.eq(he.value,1)?"":"s",r(" at once!"),n("br",null,null),le(se)]))},style:{minHeight:"80px"},canClick:()=>a.gte(o.value,1)&&a.gte(K.value,ke.value),onClick(){if(a.lt(K.value,ke.value))return;const J=a.floor(a.min(o.value,a.times(he.value,a.div(K.value,ke.value).floor())));o.value=a.sub(o.value,J),K.value=0}})),[ge,rt]=il(()=>[{title:"Logs per Tree",modifier:He,base:1,visible:v.bought},{title:"Manual Cutting Amount",modifier:ie,base:1,visible:m.bought,unit:"/click"},{title:"Manual Cutting Cooldown",modifier:Be,base:1,visible:m.bought,unit:"s"},{title:"Manual Planting Amount",modifier:z,base:1,visible:h.bought,unit:"/click"},{title:"Manual Planting Cooldown",modifier:ve,base:1,visible:h.bought,unit:"s"},{title:"Auto Cutting Amount",modifier:Fe,base:0,visible:y.bought,unit:"/s"},{title:"Auto Planting Amount",modifier:xe,base:0,visible:w.bought,unit:"/s"},{title:"Forest Size",modifier:c,base:10,visible:_.bought}]),tt=j(!1),Ge=B(()=>n(wt,{modelValue:tt.value,"onUpdate:modelValue":J=>tt.value=J},{header:()=>n("h2",null,[e,r(" Modifiers")]),body:ge}));je.on("update",J=>{if(a.lt(O.day.value,ni))return;a.gte(Qe.value,Ce.value)?Qe.value=Ce.value:(Qe.value=a.add(Qe.value,J),$.isHolding.value&&$.onClick()),a.gte(K.value,ke.value)?K.value=ke.value:(K.value=a.add(K.value,J),We.isHolding.value&&We.onClick());const ft=a.min(d.value,a.times(qe.value,J)),Lt=a.mul(He.apply(1),ft),dt=a.div(Lt,J);s.value=a.mul(dt,oi).add(a.mul(s.value,a.dOne.sub(oi))),i.value=a.add(i.value,Lt),o.value=a.add(o.value,ft);const re=a.min(o.value,a.times(Me.value,J));o.value=a.sub(o.value,re)});const ut=g(()=>a.sub(qe.value,Me.value)),Je=g(()=>a.sub(Me.value,qe.value)),Y=Pl(()=>({key:"c",description:'Press the "Cut trees" button.',onPress:()=>{$.canClick.value&&$.onClick()}})),Ie=Pl(()=>({key:"p",description:'Press the "Plant trees" button.',onPress:()=>{We.canClick.value&&We.onClick()}})),{total:gt,trackerDisplay:te}=dl({resource:i,goal:1e4,name:e,day:ni,color:l,modal:{show:tt,display:Ge}});return{name:e,color:t,logs:i,totalLogs:gt,trees:d,saplings:o,cutTree:$,plantTree:We,cutTreeHK:Y,plantTreeHK:Ie,row1Upgrades:E,row2Upgrades:T,row1Buyables:Ae,manualCutProgress:Qe,manualPlantProgress:K,generalTabCollapsed:rt,computedAutoCuttingAmount:qe,minWidth:700,display:B(()=>n(N,null,[le(te),n(we,null,null),n(It,{resource:i,color:t,style:"margin-bottom: 0",productionDisplay:a.gt(qe.value,0)?`+${H(s.value)}/s average<br/>equilibrium: +${hi([[qe.value,"cutting speed"],[Me.value,"planting speed"],[a.mul(p.value,20),"forest cap"]],"/s",He.apply(1))}`:void 0},null),n(It,{resource:o,color:l,style:"margin-bottom: 0",productionDisplay:ia(ut.value)},null),n(It,{resource:d,color:l,style:"margin-bottom: 0",productionDisplay:ia(Je.value)},null),n(we,null,null),ze($,We),n("div",null,[r("Tip: You can hold down on actions to perform them automatically")]),n(we,null,null),Bl(E,T),n(we,null,null),ze(...Ae)]))}});var Oi="./assets/tree.35808197.png",qi="./assets/sws.714ad454.png",Gi="data:image/png;base64,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",Li="./assets/elf.9fbfa563.png",$i="./assets/paperStacks.4c96ec8c.png",Qi="data:image/png;base64,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",Vi="./assets/metal.7407f5d1.png",Hi="./assets/cloth.7bcd7f37.png",ji="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==",Wi="./assets/plastic.b8ac74ff.png",Ji="data:image/png;base64,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",Fr="./assets/elfManagement.436c8744.png";const O=Tt("main",function(){const e=_e(1),t=g(()=>(+new Date(new Date().getFullYear(),11,e.value)-ne.time)/1e3),l=j(!1),i=j(-1),o=j(""),s=j();function c(m){const h=_e(!1),y=_e(!1);return St(()=>{const w=m(),v=bt(w.shouldNotify),E=bt(()=>u(v)||u(y));return{...w,opened:h,shouldNotify:E,recentlyUpdated:y,[Xt]:us,[al]:function(){const{day:S,layer:x,symbol:W,opened:M,shouldNotify:_,story:T,completedStory:X,recentlyUpdated:me}=this;return{day:S,symbol:W,layer:x,opened:M,recentlyUpdated:me,shouldNotify:_,onOpenLore(){var ie,Le;const R=O.day.value>S;i.value=R?S-1:-1;const Ae=u((Le=(ie=Et[x!=null?x:"trees"])==null?void 0:ie.name)!=null?Le:"");o.value=R?`${Ae} - Completed!`:Ae,s.value=R?`${T}<hr style="
margin: 10px 0;"/>${X}`:T,l.value=!0},onOpenLayer(){if(me.value=!1,window.matchMedia("(min-width: 1468px)").matches)if(ne.tabs.includes(x!=null?x:"trees")){const R=ne.tabs.lastIndexOf(x!=null?x:"trees");ne.tabs.splice(R,1)}else ne.tabs.push(x!=null?x:"trees"),O.minimized.value=!0;else ne.tabs.splice(1,1/0,x!=null?x:"trees")},onUnlockLayer(){x&&(M.value=!0,setTimeout(()=>{var R,Ae;i.value=-1,o.value=u((Ae=(R=Et[x!=null?x:"trees"])==null?void 0:R.name)!=null?Ae:""),s.value=T,ne.devSpeed=null,l.value=!0},1e3))}}}}})}const d=[c(()=>({day:1,shouldNotify:!1,layer:"trees",symbol:Oi,story:"Oh no! Santa forgot about Christmas and it's only 25 days away! He's asked for your help due to your history getting large quantities of things in short amounts of time. Unfortunately you're really starting from scratch here - let's start with getting wood, which you'll need for everything from building workshops to wrapping paper to many of the toys themselves!",completedStory:"Santa looks at all the wood you've gathered and tells you you've done well! He says you should take the rest of the day off so you're refreshed for tomorrow's work. Good Job!"})),c(()=>({day:2,shouldNotify:!1,layer:"workshop",symbol:qi,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!"})),c(()=>({day:3,shouldNotify:!1,layer:"coal",symbol:Gi,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!"})),c(()=>({day:4,shouldNotify:!1,layer:"elves",symbol:Li,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!"})),c(()=>({day:5,shouldNotify:!1,layer:"paper",symbol:$i,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!"})),c(()=>({day:6,shouldNotify:!1,layer:"boxes",symbol:Qi,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!"})),c(()=>({day:7,shouldNotify:!1,layer:"metal",symbol:Vi,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!"})),c(()=>({day:8,shouldNotify:!1,layer:"cloth",symbol:Hi,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!"})),c(()=>({day:9,shouldNotify:!1,layer:"oil",symbol:ji,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!"})),c(()=>({day:10,shouldNotify:!1,layer:"plastic",symbol:Wi,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!"})),c(()=>({day:11,shouldNotify:!1,layer:"dyes",symbol:Ji,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..."})),c(()=>({day:12,shouldNotify:!1,layer:null,symbol:Fr,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:""})),c(()=>({day:13,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),c(()=>({day:14,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),c(()=>({day:15,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),c(()=>({day:16,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),c(()=>({day:17,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),c(()=>({day:18,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),c(()=>({day:19,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),c(()=>({day:20,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),c(()=>({day:21,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),c(()=>({day:22,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),c(()=>({day:23,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),c(()=>({day:24,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""}))];function p(){i.value=e.value-1,o.value="Day Complete!",s.value=d[e.value-1].completedStory,l.value=!0,e.value++,O.minimized.value=!1,ne.devSpeed=0}return{name:"Calendar",days:d,day:e,timeUntilNewDay:t,loreScene:i,loreTitle:o,loreBody:s,showLoreModal:l,completeDay:p,minWidth:700,display:B(()=>n(N,null,[ne.devSpeed===0?n("div",null,[r("Game Paused")]):null,ne.devSpeed&&ne.devSpeed!==1?n("div",null,[r("Dev Speed: "),H(ne.devSpeed),r("x")]):null,ne.offlineTime?n("div",null,[r("Offline Time: "),ca(ne.offlineTime)]):null,n(we,null,null),n("div",{class:"advent"},[d.reduce((m,h)=>(m[m.length-1].length===4&&m.push([]),m[m.length-1].push(h),m),[[]]).map(m=>ze(...m))])]))}}),Ur=e=>[O,ce,Mt,G,Ee,Z,Ze,it,at,Ye,Re,Ve],Ga=g(()=>!1);function Rr(e,t){var l,i,o,s,c,d;e==="0.0"&&(t.offlineProd=!1,(l=t.layers)==null||delete l.management,(s=(o=(i=t.layers)==null?void 0:i.main)==null?void 0:o.days)!=null&&s[11]&&(t.layers.main.days[11].opened=!1),((d=(c=t.layers)==null?void 0:c.main)==null?void 0:d.day)===12&&(t.layers.main.day,t.devSpeed=0),t.tabs&&(t.tabs=t.tabs.filter(p=>p!=="management")))}var Or=Object.freeze(Object.defineProperty({__proto__:null,main:O,getInitialLayers:Ur,hasWon:Ga,fixOldSave:Rr},Symbol.toStringTag,{value:"Module"}));const qr={class:"scene"},Gr=["src"],Lr=["src"],$r=["src"],Qr=["src"],Vr=["src"],Hr=["src"],jr=["src"],Wr={key:7,class:"scene-bubble",style:{left:"50%",bottom:"38%"}},Jr=["src"],zr=["src"],Kr=["src"],Xr=["src"],Yr=pe({__name:"Scene",props:{day:null},setup(e){return(t,l)=>(A(),D("div",qr,[e.day>=7?(A(),D("img",{key:0,src:u(Hi),class:"scene-item",style:{left:"4%",bottom:"3%",width:"40px",height:"40px"}},null,8,Gr)):L("",!0),e.day>=0?(A(),D("img",{key:1,src:u(Oi),class:"scene-item",style:{left:"10%",bottom:"10%"}},null,8,Lr)):L("",!0),e.day>=1?(A(),D("img",{key:2,src:u(qi),class:"scene-item",style:{left:"40%",bottom:"12%"}},null,8,$r)):L("",!0),e.day>=2?(A(),D("img",{key:3,src:u(Gi),class:"scene-item",style:{left:"65%",bottom:"12%",width:"40px",height:"40px"}},null,8,Qr)):L("",!0),e.day>=6?(A(),D("img",{key:4,src:u(Vi),class:"scene-item",style:{left:"72%",bottom:"8%",width:"40px",height:"40px"}},null,8,Vr)):L("",!0),e.day>=8?(A(),D("img",{key:5,src:u(ji),class:"scene-item",style:{left:"80%",bottom:"6%"}},null,8,Hr)):L("",!0),e.day>=3?(A(),D("img",{key:6,src:u(Li),class:"scene-item",style:{left:"52%",bottom:"12%"}},null,8,jr)):L("",!0),e.day>=4?(A(),D("div",Wr,[e.day>=4?(A(),D("img",{key:0,src:u($i),class:"scene-item"},null,8,Jr)):L("",!0),e.day>=5?(A(),D("img",{key:1,src:u(Qi),class:"scene-item"},null,8,zr)):L("",!0),e.day>=9?(A(),D("img",{key:2,src:u(Wi),class:"scene-item"},null,8,Kr)):L("",!0),e.day>=10?(A(),D("img",{key:3,src:u(Ji),class:"scene-item"},null,8,Xr)):L("",!0)])):L("",!0)]))}});var Zr=Ue(Yr,[["__scopeId","data-v-47b4d886"]]);const eu=pe({components:{Context:Ai},props:{index:{type:Number,required:!0},tab:{type:Function,required:!0},display:{type:V(Object,String,Function),required:!0},minimized:{type:Object,required:!0},minWidth:{type:V(Number,String),required:!0},name:{type:V(String),required:!0},color:V(String),minimizable:V(Boolean),nodes:{type:Object,required:!0}},setup(e){const{display:t,index:l,minimized:i,minWidth:o,tab:s}=vt(e),c=Fl(t),d=g(()=>Oe.allowGoBack&&l.value>0&&!i.value);function p(){ne.tabs.splice(u(e.index),1)}Sl(()=>h(i.value,u(o.value))),zt([i,$o(o)],([y,w])=>h(y,w));function m(y){e.nodes.value=y}function h(y,w){const v=typeof w=="number"||Number.isNaN(parseInt(w))?w+"px":w,E=s.value();E!=null&&(y?(E.style.flexGrow="0",E.style.flexShrink="0",E.style.width="60px",E.style.minWidth=E.style.flexBasis="",E.style.margin="0"):(E.style.flexGrow="",E.style.flexShrink="",E.style.width="",E.style.minWidth=E.style.flexBasis=v,E.style.margin=""))}return{component:c,showGoBack:d,updateNodes:m,unref:u,goBack:p}}});function tu(e,t,l,i,o,s){const c=ll("Context");return A(),D("div",{class:"layer-container",style:nt({"--layer-color":e.unref(e.color)})},[e.showGoBack?(A(),D("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...d)=>e.goBack&&e.goBack(...d))},"\u274C")):L("",!0),e.minimized.value?(A(),D("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=d=>e.minimized.value=!1)},[f("div",null,Se(e.unref(e.name)),1)])):(A(),D("div",{key:2,class:et(["layer-tab",{showGoBack:e.showGoBack}])},[n(c,{onUpdateNodes:e.updateNodes},{default:de(()=>[(A(),oe(Xe(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(A(),D("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=d=>e.minimized.value=!0)}," \u25BC ")):L("",!0)],4)}var lu=Ue(eu,[["render",tu],["__scopeId","data-v-0158bec3"]]);const zi=e=>(rl("data-v-4b4bda40"),e=e(),ul(),e),au=zi(()=>f("h2",null,"Changelog",-1)),iu=zi(()=>f("details",{open:""},[f("summary",null,[r("v0.0 Initial Commit - "),f("time",null,"2021-09-04")]),r(" This is the first release :D "),f("ul",null,[f("li",{class:"feature"},"Did everything"),f("li",{class:"fix"},"Had some fun"),f("li",{class:"breaking"},"Removed everything"),f("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),nu=pe({__name:"Changelog",setup(e,{expose:t}){const l=j(!1);return t({open(){l.value=!0}}),(i,o)=>(A(),oe(wt,{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=s=>l.value=s)},{header:de(()=>[au]),body:de(()=>[iu]),_:1},8,["modelValue"]))}});var ou=Ue(nu,[["__scopeId","data-v-4b4bda40"]]);const su={class:"info-modal-header"},ru=["src","alt"],uu={class:"info-modal-title"},du={key:0},cu=r(" - "),pu={key:0},mu={key:0},vu=f("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1),gu=f("br",null,null,-1),fu=f("br",null,null,-1),yu=["href"],hu=f("span",{class:"material-icons info-modal-discord"},"discord",-1),bu=f("div",null,[f("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),r(" The Paper Pilot Community ")])],-1),wu=f("div",null,[f("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),r(" The Modding Tree ")])],-1),Au=f("br",null,null,-1);var Cu=pe({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const l=e,{title:i,logo:o,author:s,discordName:c,discordLink:d,versionNumber:p,versionTitle:m}=Oe,h=vt(l),y=j(!1),w=g(()=>ca(ne.timePlayed)),v=g(()=>Te(B(()=>n(N,null,[Ii.map(le)]))));t({open(){y.value=!0}});function E(){var S;(S=u(h.changelog))==null||S.open()}return(S,x)=>(A(),oe(wt,{class:"info-modal",modelValue:y.value,"onUpdate:modelValue":x[0]||(x[0]=W=>y.value=W)},{header:de(()=>[f("div",su,[u(o)?(A(),D("img",{key:0,class:"info-modal-logo",src:u(o),alt:u(i)},null,8,ru)):L("",!0),f("div",uu,[f("h2",null,"- "+Se(u(i))+" -",1),f("h4",null,[r(" - v"+Se(u(p)),1),u(m)?(A(),D("span",du,": "+Se(u(m)),1)):L("",!0),cu])])])]),body:de(({shown:W})=>[W?(A(),D("div",pu,[u(s)?(A(),D("div",mu,"By "+Se(u(s)),1)):L("",!0),vu,gu,f("div",{class:"link",onClick:E},"Changelog"),fu,f("div",null,[u(d)?(A(),D("a",{key:0,href:u(d),class:"info-modal-discord-link",target:"_blank"},[hu,r(" "+Se(u(c)),1)],8,yu)):L("",!0)]),bu,wu,Au,f("div",null,"Time Played: "+Se(u(w)),1),(A(),oe(Xe(u(v))))])):L("",!0)]),_:1},8,["modelValue"]))}});const Ki=e=>(rl("data-v-0d685451"),e=e(),ul(),e),ku=Ki(()=>f("h2",null,"Options",-1)),Eu=Ki(()=>f("hr",null,null,-1));var _u=pe({__name:"Options",setup(e,{expose:t}){const l=j(!1);t({open(){l.value=!0}});const i=Object.keys(Nl).map(v=>({label:bi(v),value:v})),o=g(()=>Te(B(()=>n(N,null,[Mi.map(le)])))),{showTPS:s,theme:c}=vt(lt),{autosave:d,usingLog:p}=vt(ne),m=g({get(){return ne.devSpeed===0},set(v){ne.devSpeed=v?0:null}}),h=B(()=>n("span",null,[r("Autosave"),n(pt,{display:"Save-specific"},{default:()=>[r("*")]})])),y=B(()=>n("span",null,[r("Pause game"),n(pt,{display:"Save-specific"},{default:()=>[r("*")]})])),w=B(()=>n("span",null,[r("Use log for progress bar"),n(pt,{display:"Save-specific"},{default:()=>[r("*")]})]));return(v,E)=>(A(),oe(wt,{modelValue:l.value,"onUpdate:modelValue":E[5]||(E[5]=S=>l.value=S)},{header:de(()=>[ku]),body:de(()=>[n(qa,{title:"Theme",options:u(i),modelValue:u(c),"onUpdate:modelValue":E[0]||(E[0]=S=>yt(c)?c.value=S:null)},null,8,["options","modelValue"]),(A(),oe(Xe(u(o)))),n(sl,{title:"Show TPS",modelValue:u(s),"onUpdate:modelValue":E[1]||(E[1]=S=>yt(s)?s.value=S:null)},null,8,["modelValue"]),Eu,n(sl,{title:u(h),modelValue:u(d),"onUpdate:modelValue":E[2]||(E[2]=S=>yt(d)?d.value=S:null)},null,8,["title","modelValue"]),u(Oe).enablePausing?(A(),oe(sl,{key:0,title:u(y),modelValue:u(m),"onUpdate:modelValue":E[3]||(E[3]=S=>yt(m)?m.value=S:null)},null,8,["title","modelValue"])):L("",!0),n(sl,{title:u(w),modelValue:u(p),"onUpdate:modelValue":E[4]||(E[4]=S=>yt(p)?p.value=S:null)},null,8,["title","modelValue"])]),_:1},8,["modelValue"]))}});var Su=Ue(_u,[["__scopeId","data-v-0d685451"]]);const Bu=["onSubmit"],Nu={class:"field"},Mu={key:0,class:"field-title"},Iu=["placeholder"],Du=pe({__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=bl(Kt(l,"title"),"span"),o=Ft(null);sa(()=>{var p;(p=o.value)==null||p.focus()});const s=g({get(){return u(l.modelValue)||""},set(p){t("update:modelValue",p)}});function c(){t("submit")}function d(){l.submitOnBlur!==!1?t("submit"):t("cancel")}return(p,m)=>(A(),D("form",{onSubmit:Ll(c,["prevent"])},[f("div",Nu,[u(i)?(A(),D("span",Mu,[(A(),oe(Xe(u(i))))])):L("",!0),e.textArea?(A(),oe(u(fn),{key:1,modelValue:u(s),"onUpdate:modelValue":m[0]||(m[0]=h=>yt(s)?s.value=h:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:d,ref_key:"field",ref:o},null,8,["modelValue","placeholder","maxHeight"])):ra((A(),D("input",{key:2,type:"text","onUpdate:modelValue":m[1]||(m[1]=h=>yt(s)?s.value=h:null),placeholder:e.placeholder,class:et({fullWidth:!e.title}),onBlur:d,ref_key:"field",ref:o},null,42,Iu)),[[dn,u(s)]])])],40,Bu))}});var Xi=Ue(Du,[["__scopeId","data-v-67b44a54"]]);const xu={key:0},Pu=["onClick","disabled"],Tu={key:0},Fu=["onClick"],Uu=pe({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=vt(e),o=j(!1);zt(o,d=>{t("confirmingChanged",d)});function s(){if(u(i.skipConfirm)){t("click");return}o.value&&t("click"),o.value=!o.value}function c(){o.value=!1}return(d,p)=>(A(),D("span",{class:et(["container",{confirming:o.value}])},[o.value?(A(),D("span",xu,"Are you sure?")):L("",!0),f("button",{onClick:Ll(s,["stop"]),class:"button danger",disabled:e.disabled},[o.value?(A(),D("span",Tu,"Yes")):Ht(d.$slots,"default",{key:1},void 0,!0)],8,Pu),o.value?(A(),D("button",{key:1,class:"button",onClick:Ll(c,["stop"])},"No",8,Fu)):L("",!0)],2))}});var Ru=Ue(Uu,[["__scopeId","data-v-2f8ef34c"]]);const Ou=["onClick"],qu=pe({__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,Sl(()=>{l.value=!0,i.value=setTimeout(()=>l.value=!1,500)})}return(s,c)=>(A(),D("button",{onClick:Ll(o,["stop"]),class:et(["feedback",{activated:l.value,left:e.left}])},[Ht(s.$slots,"default",{},void 0,!0)],10,Ou))}});var Gu=Ue(qu,[["__scopeId","data-v-01a1b95c"]]);const cl=e=>(rl("data-v-5285ac49"),e=e(),ul(),e),Lu=cl(()=>f("div",{class:"handle material-icons"},"drag_handle",-1)),$u={key:0,class:"actions"},Qu=cl(()=>f("span",{class:"material-icons"},"content_paste",-1)),Vu=cl(()=>f("span",{class:"material-icons"},"content_copy",-1)),Hu=cl(()=>f("span",{class:"material-icons"},"edit",-1)),ju=cl(()=>f("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Wu={key:1,class:"actions"},Ju=cl(()=>f("span",{class:"material-icons"},"check",-1)),zu=cl(()=>f("span",{class:"material-icons"},"close",-1)),Ku={key:2,class:"details"},Xu={class:"save-version"},Yu=cl(()=>f("br",null,null,-1)),Zu={key:0},ed={key:1},td={key:3,class:"details"},ld={key:4,class:"details error"},ad=cl(()=>f("br",null,null,-1)),id=pe({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const l=e,{save:i}=vt(l),o=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),s=j(!1),c=j(!1),d=j("");zt(s,()=>d.value=i.value.name||"");const p=g(()=>i.value&&i.value.id===ne.id),m=g(()=>p.value?ne.time:i.value&&i.value.time||0),h=Fl(g(()=>{var w,v,E,S;return`Day ${(S=(E=(v=(w=i.value)==null?void 0:w.layers)==null?void 0:v.main)==null?void 0:E.day)!=null?S:1}`}));function y(){t("editName",d.value),s.value=!1}return(w,v)=>(A(),D("div",{class:et(["save",{active:u(p)}])},[Lu,s.value?(A(),D("div",Wu,[f("button",{onClick:y,class:"button"},[n(pt,{display:"Save",direction:u(De).Left,class:"info"},{default:de(()=>[Ju]),_:1},8,["direction"])]),f("button",{onClick:v[5]||(v[5]=E=>s.value=!s.value),class:"button"},[n(pt,{display:"Cancel",direction:u(De).Left,class:"info"},{default:de(()=>[zu]),_:1},8,["direction"])])])):(A(),D("div",$u,[u(i).error==null&&!c.value?(A(),oe(Gu,{key:0,onClick:v[0]||(v[0]=E=>t("export")),class:"button",left:""},{default:de(()=>[n(pt,{display:"Export",direction:u(De).Left,class:"info"},{default:de(()=>[Qu]),_:1},8,["direction"])]),_:1})):L("",!0),u(i).error==null&&!c.value?(A(),D("button",{key:1,onClick:v[1]||(v[1]=E=>t("duplicate")),class:"button"},[n(pt,{display:"Duplicate",direction:u(De).Left,class:"info"},{default:de(()=>[Vu]),_:1},8,["direction"])])):L("",!0),u(i).error==null&&!c.value?(A(),D("button",{key:2,onClick:v[2]||(v[2]=E=>s.value=!s.value),class:"button"},[n(pt,{display:"Edit Name",direction:u(De).Left,class:"info"},{default:de(()=>[Hu]),_:1},8,["direction"])])):L("",!0),n(Ru,{disabled:u(p),onClick:v[3]||(v[3]=E=>t("delete")),onConfirmingChanged:v[4]||(v[4]=E=>c.value=E)},{default:de(()=>[n(pt,{display:"Delete",direction:u(De).Left,class:"info"},{default:de(()=>[ju]),_:1},8,["direction"])]),_:1},8,["disabled"])])),u(i).error==null&&!s.value?(A(),D("div",Ku,[f("button",{class:"button open",onClick:v[6]||(v[6]=E=>t("open"))},[f("h3",null,Se(u(i).name),1)]),f("span",Xu,"v"+Se(u(i).modVersion),1),Yu,u(m)?(A(),D("div",Zu,"Last played "+Se(u(o).format(u(m))),1)):L("",!0),u(h)?(A(),D("div",ed,[(A(),oe(Xe(u(h))))])):L("",!0)])):u(i).error==null&&s.value?(A(),D("div",td,[n(Xi,{modelValue:d.value,"onUpdate:modelValue":v[7]||(v[7]=E=>d.value=E),class:"editname",onSubmit:y},null,8,["modelValue"])])):(A(),D("div",ld,[r(" Error: Failed to load save with id "+Se(u(i).id),1),ad,r(Se(u(i).error),1)]))],2))}});var nd=Ue(id,[["__scopeId","data-v-5285ac49"]]);const La=e=>(rl("data-v-3b9991aa"),e=e(),ul(),e),od=La(()=>f("h2",null,"Saves Manager",-1)),sd={class:"modal-footer"},rd={class:"field"},ud=La(()=>f("span",{class:"field-title"},"Create Save",-1)),dd={class:"field-buttons"},cd={class:"footer"},pd=La(()=>f("div",{style:{"flex-grow":"1"}},null,-1)),md=pe({__name:"SavesManager",setup(e,{expose:t}){const l=j(!1),i=j(null);t({open(){l.value=!0}});const o=j(!1),s=j(""),c=j(null);zt(s,M=>{M?Sl(()=>{try{if(M[0]!=="{")if(M[0]==="e")M=decodeURIComponent(escape(atob(M)));else if(M[0]==="\u1BE1")M=gl.decompressFromUTF16(M);else{console.warn("Unable to determine preset encoding",M),o.value=!0;return}const _=JSON.parse(M);if(typeof _!="object"){o.value=!0;return}const T=ea();_.id=T,Qt(_),s.value="",o.value=!1,lt.saves.push(T)}catch{o.value=!0}}):o.value=!1});let d={},p=j(Object.keys(d).reduce((M,_)=>(M.push({label:_.split("/").slice(-1)[0].slice(0,-4),value:d[_]}),M),[]));const m=da({});function h(M){if(m[M]==null){let _=localStorage.getItem(M);if(_==null)m[M]={error:"Save doesn't exist in localStorage",id:M};else if(_==="dW5kZWZpbmVk")m[M]={error:"Save is undefined",id:M};else try{if(_[0]!=="{")if(_[0]==="e")_=decodeURIComponent(escape(atob(_)));else if(_[0]==="\u1BE1")_=gl.decompressFromUTF16(_);else return console.warn("Unable to determine preset encoding",_),o.value=!0,m[M]={error:"Unable to determine preset encoding",id:M},m[M];m[M]={...JSON.parse(_),id:M}}catch(T){m[M]={error:T,id:M},console.warn(`SavesManager: Failed to load info about save with id ${M}:
${T}
${_}`)}}return m[M]}zt(l,M=>{M&&Object.keys(m).forEach(_=>delete m[_])});const y=g(()=>lt.saves.reduce((M,_)=>(M[_]=h(_),M),{}));function w(M){let _;switch(ne.id===M?_=Si(ne[st]):_=JSON.stringify(y.value[M]),Oe.exportEncoding){default:console.warn(`Unknown save encoding: ${Oe.exportEncoding}. Defaulting to lz`);case"lz":_=gl.compressToUTF16(_);break;case"base64":_=btoa(unescape(encodeURIComponent(_)));break;case"plain":break}const T=document.createElement("textarea");T.value=_,document.body.appendChild(T),T.select(),T.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(T)}function v(M){ne.id===M&&Qt();const _={...y.value[M],id:ea()};Qt(_),lt.saves.push(_.id)}function E(M){lt.saves=lt.saves.filter(_=>_!==M),localStorage.removeItem(M),m[M]=void 0}function S(M){y.value[ne.id].time=ne.time,Qt(),m[ne.id]=void 0,_l(y.value[M]),m[M]=void 0}function x(M){if(c.value=M,Sl(()=>{c.value=null}),M[0]!=="{")if(M[0]==="e")M=decodeURIComponent(escape(atob(M)));else if(M[0]==="\u1BE1")M=gl.decompressFromUTF16(M);else{console.warn("Unable to determine preset encoding",M);return}const _=JSON.parse(M);_.id=ea(),Qt(_),lt.saves.push(_.id),S(_.id)}function W(M,_){const T=y.value[M];T&&(T.name=_,ne.id===M?(ne.name=_,Qt()):(Qt(T),m[M]=void 0))}return(M,_)=>(A(),oe(wt,{modelValue:l.value,"onUpdate:modelValue":_[4]||(_[4]=T=>l.value=T),ref_key:"modal",ref:i},{header:de(()=>[od]),body:de(({shown:T})=>[T?(A(),oe(u(gn),{key:0,list:u(lt).saves,handle:".handle",itemKey:X=>X},{item:de(({element:X})=>[n(nd,{save:u(y)[X],onOpen:me=>S(X),onExport:me=>w(X),onEditName:me=>W(X,me),onDuplicate:me=>v(X),onDelete:me=>E(X)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):L("",!0)]),footer:de(()=>[f("div",sd,[n(Xi,{modelValue:s.value,"onUpdate:modelValue":_[0]||(_[0]=T=>s.value=T),title:"Import Save",placeholder:"Paste your save here!",class:et({importingFailed:o.value})},null,8,["modelValue","class"]),f("div",rd,[ud,f("div",dd,[f("button",{class:"button",onClick:_[1]||(_[1]=T=>S(u(xl)().id))},"New Game"),Object.keys(u(p)).length>0?(A(),oe(qa,{key:0,options:u(p),modelValue:c.value,"onUpdate:modelValue":_[2]||(_[2]=T=>x(T)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):L("",!0)])]),f("div",cd,[pd,f("button",{class:"button modal-default-button",onClick:_[3]||(_[3]=T=>l.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Yi=Ue(md,[["__scopeId","data-v-3b9991aa"]]);const Ut=e=>(rl("data-v-8495e562"),e=e(),ul(),e),vd=["src","alt"],gd={key:1,class:"title"},fd=Ut(()=>f("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),yd={class:"discord"},hd={class:"discord-links"},bd={key:0},wd=["href"],Ad=Ut(()=>f("li",null,[f("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Cd=Ut(()=>f("li",null,[f("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),kd={href:"https://forums.moddingtree.com/",target:"_blank"},Ed=Ut(()=>f("span",{class:"material-icons"},"forum",-1)),_d=Ut(()=>f("span",{class:"material-icons"},"info",-1)),Sd=Ut(()=>f("span",{class:"material-icons"},"library_books",-1)),Bd=Ut(()=>f("span",{class:"material-icons"},"settings",-1)),Nd=Ut(()=>f("span",{class:"material-icons"},"library_books",-1)),Md=Ut(()=>f("span",{class:"material-icons"},"settings",-1)),Id=Ut(()=>f("span",{class:"material-icons"},"info",-1)),Dd={href:"https://forums.moddingtree.com/",target:"_blank"},xd=Ut(()=>f("span",{class:"material-icons"},"forum",-1)),Pd={class:"discord"},Td={class:"discord-links"},Fd={key:0},Ud=["href"],Rd=Ut(()=>f("li",null,[f("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Od=Ut(()=>f("li",null,[f("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),qd=pe({__name:"Nav",setup(e){const t=j(null),l=j(null),i=j(null),o=j(null),{useHeader:s,banner:c,title:d,discordName:p,discordLink:m,versionNumber:h}=Oe;function y(){window.open(m,"mywindow")}return(w,v)=>(A(),D(N,null,[u(s)?(A(),D("div",hl({key:0,class:"nav"},w.$attrs),[u(c)?(A(),D("img",{key:0,src:u(c),class:"banner",alt:u(d)},null,8,vd)):(A(),D("div",gd,Se(u(d)),1)),f("div",{onClick:v[0]||(v[0]=E=>{var S;return(S=o.value)==null?void 0:S.open()}),class:"version-container"},[n(pt,{display:"Changelog",direction:u(De).Down,class:"version"},{default:de(()=>[f("span",null,"v"+Se(u(h)),1)]),_:1},8,["direction"])]),fd,f("div",yd,[f("span",{onClick:y,class:"material-icons"},"discord"),f("ul",hd,[u(m)?(A(),D("li",bd,[f("a",{href:u(m),target:"_blank"},Se(u(p)),9,wd)])):L("",!0),Ad,Cd])]),f("div",null,[f("a",kd,[n(pt,{display:"Forums",direction:u(De).Down,yoffset:"5px"},{default:de(()=>[Ed]),_:1},8,["direction"])])]),f("div",{onClick:v[1]||(v[1]=E=>{var S;return(S=t.value)==null?void 0:S.open()})},[n(pt,{display:"Info",direction:u(De).Down,class:"info"},{default:de(()=>[_d]),_:1},8,["direction"])]),f("div",{onClick:v[2]||(v[2]=E=>{var S;return(S=l.value)==null?void 0:S.open()})},[n(pt,{display:"Saves",direction:u(De).Down,xoffset:"-20px"},{default:de(()=>[Sd]),_:1},8,["direction"])]),f("div",{onClick:v[3]||(v[3]=E=>{var S;return(S=i.value)==null?void 0:S.open()})},[n(pt,{display:"Options",direction:u(De).Down,xoffset:"-66px"},{default:de(()=>[Bd]),_:1},8,["direction"])])],16)):(A(),D("div",hl({key:1,class:"overlay-nav"},w.$attrs),[f("div",{onClick:v[4]||(v[4]=E=>{var S;return(S=o.value)==null?void 0:S.open()}),class:"version-container"},[n(pt,{display:"Changelog",direction:u(De).Right,xoffset:"25%",class:"version"},{default:de(()=>[f("span",null,"v"+Se(u(h)),1)]),_:1},8,["direction"])]),f("div",{onClick:v[5]||(v[5]=E=>{var S;return(S=l.value)==null?void 0:S.open()})},[n(pt,{display:"Saves",direction:u(De).Right},{default:de(()=>[Nd]),_:1},8,["direction"])]),f("div",{onClick:v[6]||(v[6]=E=>{var S;return(S=i.value)==null?void 0:S.open()})},[n(pt,{display:"Options",direction:u(De).Right},{default:de(()=>[Md]),_:1},8,["direction"])]),f("div",{onClick:v[7]||(v[7]=E=>{var S;return(S=t.value)==null?void 0:S.open()})},[n(pt,{display:"Info",direction:u(De).Right},{default:de(()=>[Id]),_:1},8,["direction"])]),f("div",null,[f("a",Dd,[n(pt,{display:"Forums",direction:u(De).Right,xoffset:"7px"},{default:de(()=>[xd]),_:1},8,["direction"])])]),f("div",Pd,[f("span",{onClick:y,class:"material-icons"},"discord"),f("ul",Td,[u(m)?(A(),D("li",Fd,[f("a",{href:u(m),target:"_blank"},Se(u(p)),9,Ud)])):L("",!0),Rd,Od])])],16)),n(Cu,{ref_key:"info",ref:t,changelog:o.value},null,8,["changelog"]),n(Yi,{ref_key:"savesManager",ref:l},null,512),n(Su,{ref_key:"options",ref:i},null,512),n(ou,{ref_key:"changelog",ref:o},null,512)],64))}});var Zi=Ue(qd,[["__scopeId","data-v-8495e562"]]);const $a=e=>(rl("data-v-248e2ebb"),e=e(),ul(),e),Gd={class:"inner-tab"},Ld={key:1},$d=$a(()=>f("br",null,null,-1)),Qd=r(" You can help continue the "),Vd=$a(()=>f("i",null,"advent",-1)),Hd=r("ure at: "),jd=$a(()=>f("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),r(" The Paper Pilot Community ")],-1)),Wd=pe({__name:"Game",setup(e){const t=Kt(ne,"tabs"),l=g(()=>Object.keys(Et)),i=Oe.useHeader,o=bl(O.loreBody);function s(c){const{display:d,minimized:p,minWidth:m,name:h,color:y,minimizable:w,nodes:v}=c;return{display:d,minimized:p,minWidth:m,name:h,color:y,minimizable:w,nodes:v}}return(c,d)=>(A(),D("div",{class:et(["tabs-container",{useHeader:u(i)}])},[(A(!0),D(N,null,Ba(u(t),(p,m)=>{var h,y;return A(),D("div",{key:m,class:et(["tab",u((h=u(Et)[p])==null?void 0:h.classes)]),ref_for:!0,ref:`tab-${m}`,style:nt(u((y=u(Et)[p])==null?void 0:y.style))},[m===0&&!u(i)?(A(),oe(Zi,{key:0})):L("",!0),f("div",Gd,[u(l).includes(p)?(A(),oe(lu,hl({key:0},s(u(Et)[p]),{index:m,tab:()=>{var w;return(w=c.$refs[`tab-${m}`])==null?void 0:w[0]}}),null,16,["index","tab"])):(A(),oe(Xe(p),{key:1,index:m},null,8,["index"]))])],6)}),128)),n(wt,{modelValue:u(O).showLoreModal.value,"onUpdate:modelValue":d[0]||(d[0]=p=>u(O).showLoreModal.value=p)},{header:de(()=>[f("h2",null,Se(u(O).loreTitle.value),1)]),body:de(()=>[u(o)?(A(),oe(Xe(u(o)),{key:0})):L("",!0),u(O).loreScene.value!==-1?(A(),D("div",Ld,[n(Zr,{day:u(O).loreScene.value},null,8,["day"]),$d,Qd,Vd,Hd,jd])):L("",!0)]),_:1},8,["modelValue"])],2))}});var Jd=Ue(Wd,[["__scopeId","data-v-248e2ebb"]]);const zl=e=>(rl("data-v-4a50ce42"),e=e(),ul(),e),zd={class:"game-over-modal-header"},Kd=["src","alt"],Xd={class:"game-over-modal-title"},Yd=zl(()=>f("h2",null,"Congratulations!",-1)),Zd={key:0},ec=zl(()=>f("br",null,null,-1)),tc=zl(()=>f("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),lc=zl(()=>f("br",null,null,-1)),ac=["href"],ic=zl(()=>f("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),nc=pe({__name:"GameOverScreen",setup(e){const{title:t,logo:l,discordName:i,discordLink:o,versionNumber:s,versionTitle:c}=Oe,d=g(()=>ca(ne.timePlayed)),p=g(()=>Ga.value&&!ne.keepGoing),m=Kt(ne,"autosave");function h(){ne.keepGoing=!0}function y(){_l(xl())}return(w,v)=>(A(),oe(wt,{"model-value":u(p)},{header:de(()=>[f("div",zd,[u(l)?(A(),D("img",{key:0,class:"game-over-modal-logo",src:u(l),alt:u(t)},null,8,Kd)):L("",!0),f("div",Xd,[Yd,f("h4",null,"You've beaten "+Se(u(t))+" v"+Se(u(s))+": "+Se(u(c)),1)])])]),body:de(({shown:E})=>[E?(A(),D("div",Zd,[f("div",null,"It took you "+Se(u(d))+" to beat the game.",1),ec,tc,lc,f("div",null,[f("a",{href:u(o),class:"game-over-modal-discord-link"},[ic,r(" "+Se(u(i)),1)],8,ac)]),n(sl,{title:"Autosave",modelValue:u(m),"onUpdate:modelValue":v[0]||(v[0]=S=>yt(m)?m.value=S:null)},null,8,["modelValue"])])):L("",!0)]),footer:de(()=>[f("div",{class:"game-over-footer"},[f("button",{onClick:h,class:"button"},"Keep Going"),f("button",{onClick:y,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var oc=Ue(nc,[["__scopeId","data-v-4a50ce42"]]);const ga=e=>(rl("data-v-3de07c06"),e=e(),ul(),e),sc=ga(()=>f("div",{class:"nan-modal-header"},[f("h2",null,"NaN value detected!")],-1)),rc={key:0},uc=ga(()=>f("br",null,null,-1)),dc=["href"],cc=ga(()=>f("span",{class:"material-icons nan-modal-discord"},"discord",-1)),pc=ga(()=>f("br",null,null,-1)),mc={class:"nan-footer"},vc=pe({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:l}=Oe,i=Kt(ne,"autosave"),o=Kt(ct,"hasNaN"),s=j(null),c=g(()=>{var v;return(v=ct.NaNPath)==null?void 0:v.join(".")}),d=g(()=>{var v;return(v=ct.NaNPath)==null?void 0:v.slice(-1)[0]}),p=g(()=>ct.NaNReceiver&&d.value?ct.NaNReceiver[d.value]:null),m=g({get(){return ne.devSpeed===0},set(v){ne.devSpeed=v?null:0}});function h(){ct.NaNReceiver&&d.value&&(ct.NaNReceiver[d.value]=new a(0),ct.hasNaN=!1)}function y(){ct.NaNReceiver&&d.value&&(ct.NaNReceiver[d.value]=new a(1),ct.hasNaN=!1)}function w(){ct.NaNReceiver&&d.value&&(ct.NaNReceiver[d.value]=new a(NaN),ct.hasNaN=!1)}return(v,E)=>(A(),D(N,null,[n(wt,hl({modelValue:u(o),"onUpdate:modelValue":E[4]||(E[4]=S=>yt(o)?o.value=S:null)},v.$attrs),{header:de(()=>[sc]),body:de(()=>[f("div",null,[r(' Attempted to assign "'+Se(u(c))+'" to NaN',1),u(p)?(A(),D("span",rc,Se(" ")+"(previously "+Se(u(H)(u(p)))+")",1)):L("",!0),r(". Auto-saving has been "+Se(u(i)?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),uc,f("div",null,[f("a",{href:u(l),class:"nan-modal-discord-link"},[cc,r(" "+Se(u(t)),1)],8,dc)]),pc,n(sl,{title:"Autosave",modelValue:u(i),"onUpdate:modelValue":E[0]||(E[0]=S=>yt(i)?i.value=S:null)},null,8,["modelValue"]),u(Oe).enablePausing?(A(),oe(sl,{key:0,title:"Pause game",modelValue:u(m),"onUpdate:modelValue":E[1]||(E[1]=S=>yt(m)?m.value=S:null)},null,8,["modelValue"])):L("",!0)]),footer:de(()=>[f("div",mc,[f("button",{onClick:E[2]||(E[2]=S=>{var x;return(x=s.value)==null?void 0:x.open()}),class:"button"},"Open Saves Manager"),f("button",{onClick:h,class:"button"},"Set to 0"),f("button",{onClick:y,class:"button"},"Set to 1"),u(p)&&u(a).neq(u(p),0)&&u(a).neq(u(p),1)?(A(),D("button",{key:0,onClick:E[3]||(E[3]=S=>o.value=!1),class:"button"}," Set to previous ")):L("",!0),f("button",{onClick:w,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),n(Yi,{ref_key:"savesManager",ref:s},null,512)],64))}});var gc=Ue(vc,[["__scopeId","data-v-3de07c06"]]);const fc={key:0,class:"tpsDisplay"},yc={key:0,class:"low"},hc=pe({__name:"TPS",setup(e){const t=g(()=>a.div(ct.lastTenTicks.length,ct.lastTenTicks.reduce((s,c)=>s+c,0))),l=j([]);Pt(()=>{l.value.push(Math.round(t.value.toNumber())),l.value.length>10&&(l.value=l.value.slice(1))});const i=g(()=>l.value.reduce((s,c)=>a.max(s,c),0)),o=g(()=>a.sub(t.value,i.value).gt(1));return(s,c)=>u(t).isNan()?L("",!0):(A(),D("div",fc,[r(" TPS: "+Se(u(ae)(u(t)))+" ",1),n(ua,{name:"fade"},{default:de(()=>[u(o)?(A(),D("span",yc,Se(u(ae)(u(i))),1)):L("",!0)]),_:1})]))}});var bc=Ue(hc,[["__scopeId","data-v-46a3ed5b"]]);var wc=pe({__name:"App",setup(e){const t=Oe.useHeader,l=g(()=>Nl[lt.theme].variables),i=Kt(lt,"showTPS"),o=g(()=>Te(B(()=>n(N,null,[Ro.map(le)]))));return(s,c)=>(A(),D(N,null,[f("div",{id:"modal-root",style:nt(u(l))},null,4),f("div",{class:et(["app",{useHeader:u(t)}]),style:nt(u(l))},[u(t)?(A(),oe(Zi,{key:0})):L("",!0),n(Jd),u(u(i))?(A(),oe(bc,{key:1})):L("",!0),n(oc),n(gc),(A(),oe(Xe(u(o))))],6)],64))}});var Ac=Ue(wc,[["__scopeId","data-v-580927bb"]]);function Cc(e={}){const{immediate:t=!1,onNeedRefresh:l,onOfflineReady:i,onRegistered:o,onRegisterError:s}=e;let c,d;const p=async(m=!0)=>{m&&(c==null||c.addEventListener("controlling",h=>{h.isUpdate&&window.location.reload()})),d&&d.waiting&&await hn(d.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){c=new yn("./sw.js",{scope:"./",type:"classic"}),c.addEventListener("activated",m=>{m.isUpdate||i==null||i()});{const m=()=>{l==null||l()};c.addEventListener("waiting",m),c.addEventListener("externalwaiting",m)}c.register({immediate:t}).then(m=>{d=m,o==null||o(m)}).catch(m=>{s==null||s(m)})}return p}function kc(e={}){const{immediate:t=!0,onNeedRefresh:l,onOfflineReady:i,onRegistered:o,onRegisterError:s}=e,c=j(!1),d=j(!1);return{updateServiceWorker:Cc({immediate:t,onNeedRefresh(){c.value=!0,l==null||l()},onOfflineReady(){d.value=!0,i==null||i()},onRegistered:o,onRegisterError:s}),offlineReady:d,needRefresh:c}}document.title=Oe.title;window.projInfo=Oe;if(Oe.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 xo();const{globalBus:e}=await la(()=>Promise.resolve().then(function(){return go}),void 0),{startGameLoop:t}=await la(()=>import("./gameLoop.c218583d.js"),["assets/gameLoop.c218583d.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=cn(Ac);e.emit("setupVue",l),l.mount("#app"),Sl(()=>{const i=di(),{updateServiceWorker:o}=kc({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(s){s&&setInterval(()=>s.update(),60*60*1e3)}})}),t()});export{a as D,la as _,ct as a,Oe as b,Or as c,je as g,Fa as l,ne as p,lt as s};