diff --git a/assets/index.21638797.js b/assets/index.51edb8ac.js similarity index 89% rename from assets/index.21638797.js rename to assets/index.51edb8ac.js index 7dabfb3..220a4b0 100644 --- a/assets/index.21638797.js +++ b/assets/index.51edb8ac.js @@ -10,7 +10,7 @@ Created at: `+s[kn])}),qt[e.id].clear()});const Hn=Symbol("RegisterNode"),Un=Symbol("UnregisterNode"),jn=Symbol("Nodes"),zn=Symbol("Bounds"),$e=Nn({});window.layers=$e;const qt={},Ke=[];function Tt(e,t){return Le(()=>{const n={},i=n.emitter=mi();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=x({}),n.id=e,Ke.push(e),qt[e]=new Set,n.minimized=Fe(!1),Object.assign(n,t.call(n)),Ke[Ke.length-1]==null||Ke[Ke.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen Stack: ${Ke} Trying to pop ${n.id}`;return Ke.pop(),$(n,"color"),$(n,"display"),$(n,"name"),Ce(n,"name",n.id),$(n,"minWidth"),Ce(n,"minWidth",600),$(n,"minimizable"),Ce(n,"minimizable",!0),n})}function Fi(e,t){if(console.info("Adding layer",e.id),$e[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,$e[e.id]);return}Ce(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),$e[e.id]=e,oe.emit("addLayer",e,t.layers[e.id])}function xa(e){return $e[e]}function Di(e){console.info("Removing layer",e.id),oe.emit("removeLayer",e),$e[e.id]=void 0}function Ba(e){Di(e),Fi(e,A)}function Fa(e){const t=x(!1);return{openModal:()=>t.value=!0,modal:B(()=>o(Xe,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>o("h2",null,[r(e.name)]),body:r(e.display)}))}}oe.on("update",function(t){Object.values($e).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values($e).forEach(n=>{n==null||n.emit("update",t)}),Object.values($e).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Da=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Hn,UnregisterNodeInjectionKey:Un,NodesInjectionKey:jn,BoundsInjectionKey:zn,layers:$e,persistentRefs:qt,addingLayers:Ke,createLayer:Tt,addLayer:Fi,getLayer:xa,removeLayer:Di,reloadLayer:Ba,setupLayerModal:Fa},Symbol.toStringTag,{value:"Module"}));const Oa={},Ra={class:"notif"};function qa(e,t){return b(),M("div",Ra,"!")}var ui=Y(Oa,[["render",qa],["__scopeId","data-v-66323fd4"]]);const In=e=>(rt("data-v-949cc93c"),e=e(),ot(),e),Va={key:0,class:"day feature dontMerge opened"},La={class:"date"},Ga=g("Dec"),Ha=In(()=>m("br",null,null,-1)),Ua={class:"date"},ja=g("Dec"),za=In(()=>m("br",null,null,-1)),Wa=In(()=>m("div",{class:"doors"},null,-1)),Qa={class:"date"},Ka=g("Dec"),Ja=In(()=>m("br",null,null,-1)),Xa={key:0,class:"material-icons lock"},Za=L({__name:"Day",props:{day:null,symbol:null,opened:null,shouldNotify:null},emits:["openLore","openLayer","unlockLayer"],setup(e,{emit:t}){const n=e,i=I(()=>a.gte(G.day.value,n.day)&&new Date().getMonth()===11&&new Date().getDate()>=n.day);function s(){i.value&&t("unlockLayer")}return(l,u)=>e.opened.value?(b(),M("div",Va,[o(Sn,{appear:"",name:"door"},{default:q(()=>[m("div",{class:"doors",onClick:u[0]||(u[0]=c=>t("openLayer"))},[m("div",La,[Ga,Ha,g(z(e.day),1)]),m("div",Ua,[ja,za,g(z(e.day),1)])])]),_:1}),m("div",{class:"icon",style:be({backgroundImage:`url(${e.symbol})`})},null,4),m("div",{class:"lore",onClick:u[1]||(u[1]=c=>t("openLore"))},"?"),r(e.shouldNotify)?(b(),U(ui,{key:0})):P("",!0)])):(b(),M("div",{key:1,class:ye(["day feature dontMerge",{can:r(i),locked:!r(i),canOpen:r(i)}]),onClick:s},[Wa,m("div",Qa,[Ka,Ja,g(z(e.day),1)]),r(i)?P("",!0):(b(),M("div",Xa,"lock")),r(i)?(b(),U(ui,{key:1})):P("",!0)],2))}});var Ya=Y(Za,[["__scopeId","data-v-949cc93c"]]);const el={key:0},tl={key:0,class:"mark star"},nl=["src"],il=L({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(b(),M("div",el,[e.mark===!0?(b(),M("div",tl)):(b(),M("img",{key:1,class:"mark",src:e.mark},null,8,nl))])):P("",!0)}});var An=Y(il,[["__scopeId","data-v-2207999f"]]);const sl=L({__name:"Node",props:{id:null},setup(e){const n=Se(e),i=yn(Hn,()=>{}),s=yn(Un,()=>{}),l=ze(null),u=I(()=>l.value&&l.value.parentElement);return Je([u,n.id],([c,f],[d,_])=>{d&&s(r(_)),c&&i(f,c)}),di(()=>s(r(n.id))),(c,f)=>(b(),M("div",{class:"node",ref_key:"node",ref:l},null,512))}});var un=Y(sl,[["__scopeId","data-v-a48cb382"]]),al=L({props:{display:{type:E(Object,String,Function),required:!0},visibility:{type:E(Number),required:!0},style:E(Object,String,Array),classes:E(Object),onClick:Function,onHold:Function,canClick:{type:E(Boolean),required:!0},small:Boolean,mark:E(Boolean,String),id:{type:String,required:!0},isHolding:Object},components:{Node:un,MarkNode:An},setup(e){const{display:t,onClick:n,onHold:i}=Se(e),s=ze("");xe(()=>{const c=_e(t);if(c==null){s.value="";return}if(wt(c)){s.value=X(c);return}const f=X(c.title||"","h3"),d=X(c.description,"div");s.value=X(B(()=>o("span",null,[c.title?o("div",null,[o(f,null,null)]):null,o(d,null,null)])))});const{start:l,stop:u}=Ei(n,i,e.isHolding);return{start:l,stop:u,comp:s,Visibility:ke,unref:r}}});function ll(e,t,n,i,s,l){var f;const u=yt("MarkNode"),c=yt("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),M("button",{key:0,style:be([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(f=e.unref(e.style))!=null?f:[]]),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:ye({feature:!0,clickable:!0,can:e.unref(e.canClick),locked:!e.unref(e.canClick),small:e.small,...e.unref(e.classes)})},[e.unref(e.comp)?(b(),U(Me(e.unref(e.comp)),{key:0})):P("",!0),o(u,{mark:e.unref(e.mark)},null,8,["mark"]),o(c,{id:e.id},null,8,["id"])],38)):P("",!0)}var Oi=Y(al,[["render",ll],["__scopeId","data-v-8cedd7da"]]);const rl=Symbol("Clickable");function Ae(e){return Le(()=>{var n;const t=(n=e==null?void 0:e())!=null?n:{};if(t.id=Gt("clickable-"),t.type=rl,t[bt]=Oi,t.isHolding=x(!1),$(t,"visibility"),Ce(t,"visibility",ke.Visible),$(t,"canClick"),Ce(t,"canClick",!0),$(t,"classes"),$(t,"style"),$(t,"mark"),$(t,"display"),t.onClick){const i=t.onClick.bind(t);t.onClick=function(s){r(t.canClick)&&i(s)}}if(t.onHold){const i=t.onHold.bind(t);t.onHold=function(){r(t.canClick)&&i()}}return t[_t]=function(){const{display:i,visibility:s,style:l,classes:u,onClick:c,onHold:f,isHolding:d,canClick:_,small:y,mark:v,id:p}=this;return{display:i,visibility:s,style:r(l),classes:u,onClick:c,onHold:f,isHolding:d,canClick:_,small:y,mark:v,id:p}},t})}function at(e,t="points",n=0,i=void 0){const s=Ne(e)?e:Fe(e);return s.displayName=t,s.precision=n,s.small=i,s}function Wn(e){const t=Fe(e.value);return Je(e,(n,i)=>{a.gt(n,i)&&(t.value=a.add(t.value,a.sub(n,i)))}),t}new a("10^^8");new a("1e100");function Pn(e,t){const n=t!=null?t:e.value;return a.eq(e.precision,0)?R(e.small?n:a.floor(n)):ee(n,e.precision,e.small)}const ol=["x1","y1","x2","y2"],ul=L({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=Se(e),i=I(()=>{const l=n.startNode.value.rect,u=n.boundingRect.value,c=u?{x:l.x+l.width/2-u.x,y:l.y+l.height/2-u.y}:{x:0,y:0};return n.link.value.offsetStart&&(c.x+=n.link.value.offsetStart.x,c.y+=n.link.value.offsetStart.y),c}),s=I(()=>{const l=n.endNode.value.rect,u=n.boundingRect.value,c=u?{x:l.x+l.width/2-u.x,y:l.y+l.height/2-u.y}:{x:0,y:0};return n.link.value.offsetEnd&&(c.x+=n.link.value.offsetEnd.x,c.y+=n.link.value.offsetEnd.y),c});return(l,u)=>(b(),M("line",$t({"stroke-width":"15px",stroke:"white"},e.link,{x1:r(i).x,y1:r(i).y,x2:r(s).x,y2:r(s).y}),null,16,ol))}});const cl=L({__name:"Links",props:{links:null},setup(e){var f;const n=lt(e,"links"),i=x(null),s=yn(jn,x({})),l=yn(zn,x(void 0)),u=x((f=i.value)==null?void 0:f.getBoundingClientRect());Je(l,()=>{var d;return u.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),Cn(()=>{var d;return u.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const c=I(()=>{var _,y;const d=s.value;return(y=(_=n.value)==null?void 0:_.filter(v=>{var p,w;return((p=d[v.startNode.id])==null?void 0:p.rect)&&((w=d[v.startNode.id])==null?void 0:w.rect)}))!=null?y:[]});return(d,_)=>(b(),M(D,null,[r(c)?(b(),M("svg",as($t({key:0},d.$attrs)),[(b(!0),M(D,null,fi(r(c),(y,v)=>(b(),U(ul,{key:v,link:y,boundingRect:u.value,startNode:r(s)[y.startNode.id],endNode:r(s)[y.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):P("",!0),m("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var dl=Y(cl,[["__scopeId","data-v-063f6d6b"]]);L({props:{nodes:{type:E(Array),required:!0},leftSideNodes:E(Array),rightSideNodes:E(Array),branches:E(Array)},components:{Links:dl},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=Se(e),s=ze();xe(()=>{const c=_e(t);s.value=X(B(()=>o(D,null,[c.map(f=>o("span",{class:"row tree-row",style:"margin: 50px auto;"},[f.map(it)]))])))});const l=ze();xe(()=>{const c=_e(n);l.value=c?X(B(()=>o("span",{class:"left-side-nodes small"},[c.map(it)]))):""});const u=ze();return xe(()=>{const c=_e(i);u.value=c?X(B(()=>o("span",{class:"side-nodes small"},[c.map(it)]))):""}),{unref:r,nodesComp:s,leftNodesComp:l,rightNodesComp:u}}});L({props:{display:E(Object,String,Function),visibility:{type:E(Number),required:!0},style:E(String,Object,Array),classes:E(Object),onClick:Function,onHold:Function,color:E(String),glowColor:E(String),canClick:{type:E(Boolean),required:!0},mark:E(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:An,Node:un},setup(e){const{onClick:t,onHold:n,display:i}=Se(e),s=Et(i),{start:l,stop:u}=Ei(t,n);return{start:l,stop:u,comp:s,unref:r,Visibility:ke,isCoercableComponent:wt}}});function Qn(e){const t=[],n={};let i=!1;function s(){return i||(t.push(...e()),n.base=t.map(c=>Be(c.base)),n.baseText=t.map(c=>Be(c.baseText)),n.visible=t.map(c=>Be(c.visible)),i=!0),t}const l=Fe({});return[B(()=>{const c=s();let f=!0;const d=c.map((_,y)=>{var S,H,ae;if(r(n.visible[y])===!1)return null;const v=o("h3",{onClick:()=>l.value[y]=!l.value[y],style:"cursor: pointer"},[o("span",{class:"modifier-toggle"+(r(l.value[y])?" collapsed":"")},[g("\u25BC")]),_.title,_.subtitle?o("span",{class:"subtitle"},[g(" ("),_.subtitle,g(")")]):null]),p=r(l.value[y])?null:o(D,null,[o("div",{class:"modifier-container"},[o("span",{class:"modifier-amount"},[ee((S=r(n.base[y]))!=null?S:1),_.unit]),o("span",{class:"modifier-description"},[it((H=r(n.baseText[y]))!=null?H:"Base")])]),it(r(_.modifier.description))]),w=!f;return f=!1,o(D,null,[w?o("br",null,null):null,o("div",null,[v,o("br",null,null),p,o("hr",null,null),g("Total: "),ee(_.modifier.apply((ae=r(n.base[y]))!=null?ae:1)),_.unit])])});return o(D,null,[d])}),l]}const fl=L({props:{progress:{type:E(String,Object,Number),required:!0},width:{type:E(Number),required:!0},height:{type:E(Number),required:!0},direction:{type:E(String),required:!0},display:E(Object,String,Function),visibility:{type:E(Number),required:!0},style:E(Object,String,Array),classes:E(Object),borderStyle:E(Object,String,Array),textStyle:E(Object,String,Array),baseStyle:E(Object,String,Array),fillStyle:E(Object,String,Array),mark:E(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:An,Node:un},setup(e){const{progress:t,width:n,height:i,direction:s,display:l}=Se(e),u=I(()=>{let d=t.value instanceof a?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),c=I(()=>{const d={width:_e(n)+.5+"px",height:_e(i)+.5+"px"};switch(r(s)){case J.Up:d.clipPath=`inset(${u.value}% 0% 0% 0%)`,d.width=_e(n)+1+"px";break;case J.Down:d.clipPath=`inset(0% 0% ${u.value}% 0%)`,d.width=_e(n)+1+"px";break;case J.Right:d.clipPath=`inset(0% ${u.value}% 0% 0%)`;break;case J.Left:d.clipPath=`inset(0% 0% 0% ${u.value} + '%)`;break;case J.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),f=Et(l);return{normalizedProgress:u,barStyle:c,component:f,unref:r,Visibility:ke}}});function ml(e,t,n,i,s,l){var f,d,_,y,v,p,w;const u=yt("MarkNode"),c=yt("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),M("div",{key:0,style:be([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(f=e.unref(e.style))!=null?f:{}]),class:ye({bar:!0,...e.unref(e.classes)})},[m("div",{class:"overlayTextContainer border",style:be([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(b(),M("span",{key:0,class:"overlayText",style:be(e.unref(e.textStyle))},[(b(),U(Me(e.component)))],4)):P("",!0)],4),m("div",{class:"border",style:be([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(_=e.unref(e.style))!=null?_:{},(y=e.unref(e.baseStyle))!=null?y:{},(v=e.unref(e.borderStyle))!=null?v:{}])},[m("div",{class:"fill",style:be([e.barStyle,(p=e.unref(e.style))!=null?p:{},(w=e.unref(e.fillStyle))!=null?w:{}])},null,4)],4),o(u,{mark:e.unref(e.mark)},null,8,["mark"]),o(c,{id:e.id},null,8,["id"])],6)):P("",!0)}var pl=Y(fl,[["render",ml],["__scopeId","data-v-02d0d7b2"]]);const hl=Symbol("Bar");function At(e){return Le(()=>{const t=e();return t.id=Gt("bar-"),t.type=hl,t[bt]=pl,$(t,"visibility"),Ce(t,"visibility",ke.Visible),$(t,"width"),$(t,"height"),$(t,"direction"),$(t,"style"),$(t,"classes"),$(t,"borderStyle"),$(t,"baseStyle"),$(t,"textStyle"),$(t,"fillStyle"),$(t,"progress"),$(t,"display"),$(t,"mark"),t[_t]=function(){const{progress:n,width:i,height:s,direction:l,display:u,visibility:c,style:f,classes:d,borderStyle:_,textStyle:y,baseStyle:v,fillStyle:p,mark:w,id:S}=this;return{progress:n,width:i,height:s,direction:l,display:u,visibility:c,style:r(f),classes:d,borderStyle:_,textStyle:y,baseStyle:v,fillStyle:p,mark:w,id:S}},t})}const gl=Symbol("Buyable");function tt(e){const t=Fe(0);return Le(()=>{var l,u,c;const n=e();if(n.canPurchase==null&&(n.resource==null||n.cost==null))throw console.warn("Cannot create buyable without a canPurchase property or a resource and cost property",n),"Cannot create buyable without a canPurchase property or a resource and cost property";n.id=Gt("buyable-"),n.type=gl,n[bt]=Oi,n.amount=t,n.amount[ln]=(l=n.initialValue)!=null?l:0,n.canAfford=I(()=>{const f=n,d=r(f.cost);return f.resource!=null&&d!=null&&a.gte(f.resource.value,d)}),n.canPurchase==null&&(n.canPurchase=I(()=>r(n.visibility)===ke.Visible&&r(n.canAfford)&&a.lt(n.amount.value,r(n.purchaseLimit)))),n.maxed=I(()=>a.gte(n.amount.value,r(n.purchaseLimit))),$(n,"classes");const i=n.classes;n.classes=I(()=>{const f=r(i)||{};return n.maxed.value&&(f.bought=!0),f}),$(n,"canPurchase"),n.canClick=n.canPurchase,n.onClick=n.purchase=(c=(u=n.onClick)!=null?u:n.purchase)!=null?c:function(){var _;const f=n;if(!r(f.canPurchase))return;const d=r(f.cost);f.cost!=null&&f.resource!=null&&(f.resource.value=a.sub(f.resource.value,d),f.amount.value=a.add(f.amount.value,1)),(_=f.onPurchase)==null||_.call(f,d)},$(n,"display");const s=n.display;return n.display=B(()=>{const f=r(s);if(wt(f)){const d=X(f);return o(d,null,null)}if(f!=null&&n.cost!=null&&n.resource!=null){const d=n,_=X(f.title||"","h3"),y=X(f.description||""),v=X(f.effectDisplay||"");return o("span",null,[f.title?o("div",null,[o(_,null,null)]):null,f.description?o(y,null,null):null,f.showAmount===!1?null:o("div",null,[o("br",null,null),r(d.purchaseLimit)===a.dInf?o(D,null,[g("Amount: "),R(d.amount.value)]):o(D,null,[g("Amount: "),R(d.amount.value),g(" /")," ",R(r(d.purchaseLimit))])]),f.effectDisplay?o("div",null,[o("br",null,null),g("Currently: "),o(v,null,null)]):null,d.cost&&!d.maxed.value?o("div",null,[o("br",null,null),g("Cost: "),ee(r(d.cost)||0)," ",n.resource.displayName]):null])}return""}),$(n,"visibility"),Ce(n,"visibility",ke.Visible),$(n,"cost"),$(n,"resource"),$(n,"purchaseLimit"),Ce(n,"purchaseLimit",a.dInf),$(n,"style"),$(n,"mark"),$(n,"small"),n[_t]=function(){const{display:f,visibility:d,style:_,classes:y,onClick:v,canClick:p,small:w,mark:S,id:H}=this;return{display:f,visibility:d,style:r(_),classes:y,onClick:v,canClick:p,small:w,mark:S,id:H}},n})}const $n=Nn({}),Kn=Symbol("Hotkey");function qn(e){return Le(()=>{const t=e();return t.type=Kn,$(t,"enabled"),Ce(t,"enabled",!0),$(t,"description"),t})}oe.on("addLayer",e=>{ki(e,Kn).forEach(t=>{$n[t.key]=t})});oe.on("removeLayer",e=>{ki(e,Kn).forEach(t=>{$n[t.key]=void 0})});document.onkeydown=function(e){var i;if(((i=e.target)==null?void 0:i.tagName)==="INPUT"||Xn.value&&!A.keepGoing)return;let t=e.key;e.shiftKey&&(t="shift+"+t),e.ctrlKey&&(t="ctrl+"+t);const n=$n[t];n&&r(n.enabled)&&(e.preventDefault(),n.onPress())};va(B(()=>{const e=Object.values($n).filter(t=>r(t==null?void 0:t.enabled));return e.length===0?"":o("div",null,[o("br",null,null),o("h4",null,[g("Hotkeys")]),e.map(t=>o("div",null,[t==null?void 0:t.key,g(": "),t==null?void 0:t.description]))])}));const vl=L({__name:"Sticky",setup(e){const t=x("0"),n=new ResizeObserver(s),i=ze(null);function s(){let l=i.value;if(l==null)return;let u=0;for(;l.previousSibling;){const c=l.previousSibling;c.dataset&&"vSticky"in c.dataset&&(u+=c.offsetHeight),l=c}t.value=u+"px"}return Pt(s),document.fonts.ready.then(s),Cn(()=>{var u;const l=(u=i.value)==null?void 0:u.parentElement;l&&n.observe(l)}),(l,u)=>(b(),M("div",{class:"sticky",style:be({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[nt(l.$slots,"default",{},void 0,!0)],4))}});var yl=Y(vl,[["__scopeId","data-v-cccac690"]]);const bl=L({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,n=I(()=>Pn(t.resource));return(i,s)=>(b(),M("h2",{style:be({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},z(r(n)),5))}});const _l={class:"main-display"},wl={key:0},kl={key:1},Nl=g(", "),Vt=L({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null},setup(e){const n=Se(e),i=x(null),s=Et(n.effectDisplay),l=I(()=>a.lt(n.resource.value,"1e1000"));return(u,c)=>(b(),U(yl,null,{default:q(()=>{var f,d,_,y;return[m("div",{class:ye(["main-display-container",(f=e.classes)!=null?f:{}]),style:be([{height:`${((_=(d=i.value)==null?void 0:d.$el.clientHeight)!=null?_:0)+50}px`},(y=e.style)!=null?y:{}])},[m("div",_l,[r(l)?(b(),M("span",wl,"You have ")):P("",!0),o(bl,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),g(" "+z(e.resource.displayName),1),r(s)?(b(),M("span",kl,[Nl,(b(),U(Me(r(s)),{ref_key:"effectRef",ref:i},null,512))])):P("",!0)])],6)]}),_:1}))}});var Cl=L({props:{display:{type:E(String,Object,Function),required:!0},visibility:{type:E(Number),required:!0},style:E(String,Object,Array),classes:E(Object),resource:Object,cost:E(String,Object,Number),canPurchase:{type:E(Boolean),required:!0},bought:{type:E(Boolean),required:!0},mark:E(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:un,MarkNode:An},setup(e){const{display:t,cost:n}=Se(e),i=ze("");return xe(()=>{const s=_e(t);if(s==null){i.value="";return}if(wt(s)){i.value=X(s);return}const l=_e(n),u=X(s.title||"","h3"),c=X(s.description,"div"),f=X(s.effectDisplay||"");i.value=X(B(()=>{var d;return o("span",null,[s.title?o("div",null,[o(u,null,null)]):null,o(c,null,null),s.effectDisplay?o("div",null,[g("Currently: "),o(f,null,null)]):null,e.resource!=null&&s.showCost!==!1?o(D,null,[o("br",null,null),g("Cost: "),e.resource&&Pn(e.resource,l)," ",(d=e.resource)==null?void 0:d.displayName]):null])}))}),{component:i,unref:r,Visibility:ke}}});const Sl=["disabled"];function Ml(e,t,n,i,s,l){var f;const u=yt("MarkNode"),c=yt("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),M("button",{key:0,style:be([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(f=e.unref(e.style))!=null?f:{}]),onClick:t[0]||(t[0]=(...d)=>e.purchase&&e.purchase(...d)),class:ye({feature:!0,upgrade:!0,can:e.unref(e.canPurchase),locked:!e.unref(e.canPurchase),bought:e.unref(e.bought),...e.unref(e.classes)}),disabled:!e.unref(e.canPurchase)},[e.unref(e.component)?(b(),U(Me(e.unref(e.component)),{key:0})):P("",!0),o(u,{mark:e.unref(e.mark)},null,8,["mark"]),o(c,{id:e.id},null,8,["id"])],14,Sl)):P("",!0)}var Il=Y(Cl,[["render",Ml],["__scopeId","data-v-7f411ac8"]]);const Al=Symbol("Upgrade");function ge(e){const t=Fe(!1);return Le(()=>{const n=e();return n.id=Gt("upgrade-"),n.type=Al,n[bt]=Il,n.canAfford==null&&(n.resource==null||n.cost==null)&&console.warn("Error: can't create upgrade without a canAfford property or a resource and cost property",n),n.bought=t,n.canAfford==null?n.canAfford=I(()=>{const i=n;return i.resource!=null&&i.cost!=null&&a.gte(i.resource.value,r(i.cost))}):$(n,"canAfford"),n.canPurchase=I(()=>r(n.visibility)===ke.Visible&&r(n.canAfford)&&!r(n.bought)),n.purchase=function(){var s;const i=n;!r(i.canPurchase)||(i.resource!=null&&i.cost!=null&&(i.resource.value=a.sub(i.resource.value,r(i.cost))),t.value=!0,(s=i.onPurchase)==null||s.call(i))},$(n,"visibility"),Ce(n,"visibility",ke.Visible),$(n,"classes"),$(n,"style"),$(n,"display"),$(n,"mark"),$(n,"cost"),$(n,"resource"),n[_t]=function(){const{display:i,visibility:s,style:l,classes:u,resource:c,cost:f,canPurchase:d,bought:_,mark:y,id:v,purchase:p}=this;return{display:i,visibility:s,style:r(l),classes:u,resource:c,cost:f,canPurchase:d,bought:_,mark:y,id:v,purchase:p}},n})}function se(e){return Le(()=>{const{addend:t,description:n,enabled:i}=e(),s=Be(t),l=Be(n),u=i==null?void 0:Be(i);return{apply:c=>a.add(c,r(s)),revert:c=>a.sub(c,r(s)),enabled:u,description:n==null?void 0:B(()=>o("div",{class:"modifier-container"},[o("span",{class:"modifier-amount"},[a.gte(r(s),0)?"+":"",ee(r(s))]),r(l)?o("span",{class:"modifier-description"},[it(r(l))]):null]))}})}function W(e){return Le(()=>{const{multiplier:t,description:n,enabled:i}=e(),s=Be(t),l=Be(n),u=i==null?void 0:Be(i);return{apply:c=>a.times(c,r(s)),revert:c=>a.div(c,r(s)),enabled:u,description:n==null?void 0:B(()=>o("div",{class:"modifier-container"},[o("span",{class:"modifier-amount"},[g("x"),ee(r(s))]),r(l)?o("span",{class:"modifier-description"},[it(r(l))]):null]))}})}function Ri(e){return Le(()=>{const{exponent:t,description:n,enabled:i,supportLowNumbers:s}=e(),l=Be(t),u=Be(n),c=i==null?void 0:Be(i);return{apply:f=>{let d=f;return s&&(d=a.add(d,1)),d=a.pow(d,r(l)),s&&(d=a.sub(d,1)),d},revert:f=>{let d=f;return s&&(d=a.add(d,1)),d=a.root(d,r(l)),s&&(d=a.sub(d,1)),d},enabled:c,description:n==null?void 0:B(()=>o("div",{class:"modifier-container"},[o("span",{class:"modifier-amount"},[g("^"),ee(r(l))]),r(u)?o("span",{class:"modifier-description"},[it(r(u)),s?" (+1 effective)":null]):null]))}})}function fe(e){return Le(()=>{const t=e();return{apply:n=>t.filter(i=>r(i.enabled)!==!1).reduce((i,s)=>s.apply(i),n),revert:t.every(n=>n.revert!=null)?n=>t.filter(i=>r(i.enabled)!==!1).reduceRight((i,s)=>s.revert(i),n):void 0,enabled:I(()=>t.filter(n=>r(n.enabled)!==!1).length>0),description:B(()=>o(D,null,[t.filter(n=>r(n.enabled)!==!1).map(n=>r(n.description)).filter(n=>n).map(it)]))}})}const Pl={class:"field"},$l={key:0,class:"field-title"},Jn=L({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var u;const n=e,i=Et(lt(n,"title"),"span"),s=x((u=n.options.find(c=>c.value===n.modelValue))!=null?u:null);Je(lt(n,"modelValue"),c=>{var f;_e(s)!==c&&(s.value=(f=n.options.find(d=>d.value===c))!=null?f:null)});function l(c){t("update:modelValue",c.value)}return(c,f)=>(b(),M("div",Pl,[r(i)?(b(),M("span",$l,[(b(),U(Me(r(i))))])):P("",!0),o(r(cs),{options:e.options,modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=d=>s.value=d),l],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});var El=L({props:{visibility:{type:E(Number),required:!0},display:{type:E(String,Object,Function),required:!0},style:E(String,Object,Array),classes:E(Object),earned:{type:E(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:un},setup(e){const{display:t}=Se(e),n=ze("");return xe(()=>{const i=_e(t);if(i==null){n.value="";return}if(wt(i)){n.value=X(i);return}const s=X(i.requirement,"h3"),l=X(i.effectDisplay||"","b"),u=X(i.optionsDisplay||"","span");n.value=X(B(()=>o("span",null,[o(s,null,null),i.effectDisplay?o("div",null,[o(l,null,null)]):null,i.optionsDisplay?o("div",{class:"equal-spaced"},[o(u,null,null)]):null])))}),{comp:n,unref:r,Visibility:ke}}});function Tl(e,t,n,i,s,l){var c;const u=yt("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),M("div",{key:0,style:be([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:ye({feature:!0,milestone:!0,done:e.unref(e.earned),...e.unref(e.classes)})},[(b(),U(Me(e.unref(e.comp)))),o(u,{id:e.id},null,8,["id"])],6)):P("",!0)}var xl=Y(El,[["render",Tl],["__scopeId","data-v-f4e8794e"]]);oe.on("setupVue",e=>e.use(ds));const Bl=pi(),Fl=Symbol("Milestone");let vt;(function(e){e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none"})(vt||(vt={}));function Ve(e){const t=Fe(!1);return Le(()=>{var s;const n=(s=e==null?void 0:e())!=null?s:{};n.id=Gt("milestone-"),n.type=Fl,n[bt]=xl,n.earned=t,n.complete=function(){t.value=!0},$(n,"visibility"),Ce(n,"visibility",ke.Visible);const i=n.visibility;if(n.visibility=I(()=>{const l=r(n.display);switch(re.msDisplay){default:case vt.All:return r(i);case vt.Configurable:return r(n.earned)&&!(l!=null&&typeof l=="object"&&"optionsDisplay"in l)?ke.None:r(i);case vt.Incomplete:return r(n.earned)?ke.None:r(i);case vt.None:return ke.None}}),$(n,"style"),$(n,"classes"),$(n,"display"),n[_t]=function(){const{visibility:l,display:u,style:c,classes:f,earned:d,id:_}=this;return{visibility:l,display:u,style:r(c),classes:f,earned:d,id:_}},n.shouldEarn){const l=n;xe(()=>{var u,c;if(re.active===A.id&&!l.earned.value&&r(l.visibility)===ke.Visible&&((u=l.shouldEarn)==null?void 0:u.call(l))&&(l.earned.value=!0,(c=l.onComplete)==null||c.call(l),l.display)){const f=r(l.display),d=X(wt(f)?f:f.requirement);Bl(o(D,null,[o("h3",null,[g("Milestone earned!")]),o("div",null,[o(d,null,null)])]))}})}return n})}oe.on("loadSettings",e=>{Ce(e,"msDisplay",vt.All)});const Dl=Object.values(vt).map(e=>({label:wi(e),value:e}));ga(B(()=>o(Jn,{title:"Show Milestones",options:Dl,"onUpdate:modelValue":e=>re.msDisplay=e,modelValue:re.msDisplay},null)));const Ol=Symbol("Reset");function Rl(e){return Le(()=>{const t=e();return t.id=Gt("reset-"),t.type=Ol,t.reset=function(){var i;const n=s=>{s&&typeof s=="object"&&(an in s?s[an].value=s[ln]:!(s instanceof a)&&!Ne(s)&&Object.values(s).forEach(l=>n(l)))};r(t.thingsToReset).forEach(n),oe.emit("reset",t),(i=t.onReset)==null||i.call(t)},$(t,"thingsToReset"),t})}const hn={};oe.on("removeLayer",e=>{var t;(t=hn[e.id])==null||t.call(hn),hn[e.id]=void 0});function qi(e){return Le(()=>{const t=e();return t.currentGain==null&&(t.currentGain=I(()=>{let n=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return n=a.floor(n).max(0),r(t.buyMax)||(n=n.min(1)),n})),t.actualGain==null&&(t.actualGain=t.currentGain),t.currentAt==null&&(t.currentAt=I(()=>{let n=t.scaling.currentAt(t);return t.roundUpCost&&(n=a.ceil(n)),n})),t.nextAt==null&&(t.nextAt=I(()=>{let n=t.scaling.nextAt(t);return t.roundUpCost&&(n=a.ceil(n)),n})),t.convert==null&&(t.convert=function(){var s;const n=r(t.currentGain),i=r(t.currentAt);t.gainResource.value=a.add(t.gainResource.value,n),t.spend(n,i),(s=t.onConvert)==null||s.call(t,n)}),t.spend==null&&(t.spend=function(){t.baseResource.value=0}),$(t,"currentGain"),$(t,"actualGain"),$(t,"currentAt"),$(t,"nextAt"),$(t,"buyMax"),Ce(t,"buyMax",!0),$(t,"roundUpCost"),Ce(t,"roundUpCost",!0),t})}function Vi(e,t){const n=Be(e),i=Be(t);return{currentGain(s){let l=r(s.baseResource.value);if(s.costModifier&&(l=s.costModifier.apply(l)),a.lt(l,r(n)))return 0;const u=a.div(l,r(n)).pow(r(i));return u.isNan()?new a(0):u},currentAt(s){let l=r(s.currentGain);return s.gainModifier&&(l=s.gainModifier.revert(l)),l=a.max(0,l).root(r(i)).times(r(n)),s.costModifier&&(l=s.costModifier.revert(l)),l},nextAt(s){let l=a.add(r(s.currentGain),1).floor();return s.gainModifier&&(l=s.gainModifier.revert(l)),l=a.max(0,l).root(r(i)).times(r(n)).max(r(n)),s.costModifier&&(l=s.costModifier.revert(l)),l}}}function ql(e){return qi(e)}function Vl(e){return qi(()=>{const t=e();return Ce(t,"buyMax",!1),t.currentGain==null&&(t.currentGain=I(()=>{let n=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return n=a.floor(n).max(t.gainResource.value),r(t.buyMax)||(n=n.min(a.add(t.gainResource.value,1))),n})),t.actualGain==null&&(t.actualGain=I(()=>{let n=a.sub(a.floor(t.scaling.currentGain(t)),t.gainResource.value).max(0);return r(t.buyMax)||(n=n.min(1)),n})),Ce(t,"convert",function(){var s;const n=r(t.actualGain),i=r(t.currentAt);t.gainResource.value=t.gainModifier?t.gainModifier.apply(r(t.currentGain)):r(t.currentGain),t.spend(n,i),(s=t.onConvert)==null||s.call(t,n)}),t})}const Ll="paper",Qt=5,he=Tt(Ll,function(){const e="Paper",t="#E8DCB8",n="#E8DCB8",s=at(0,"paper"),l=Wn(s),u=at(I(()=>a.min(a.div(te.logs.value,1e9),a.div(le.ash.value,1e6))),"pulp"),c=ql(()=>({scaling:Vi(1,1.2),baseResource:u,gainResource:s,roundUpCost:!0,spend(C,N){te.logs.value=a.sub(te.logs.value,a.times(N,1e9)),le.ash.value=a.sub(le.ash.value,a.times(N,1e6))}})),f=Ae(()=>({display:B(()=>{const C=a.gte(c.actualGain.value,1)?c.currentAt.value:c.nextAt.value;return o(D,null,[o("span",{style:"font-size: large"},[g("Create "),R(c.currentGain.value),g(" "),s.displayName]),o("br",null,null),o("span",{style:"font-size: large"},[g("Cost: "),Pn(te.logs,C),g(" "),u.displayName,g(" ("),R(a.times(C,1e9)),g(" "),te.logs.displayName,g(";")," ",R(a.times(C,1e6)),g(" "),le.ash.displayName,g(")")])])}),canClick:()=>a.gte(c.actualGain.value,1),onClick(){!r(this.canClick)||c.convert()},style:"width: 600px; min-height: unset"}));function d(C){const N=tt(()=>({display:{title:C.name,description:`Print a copy of "${C.name}", which ${C.elfName} will use to improve their skills! Each copy printed will reduce the "${C.buyableName}" price scaling by 0.95x and make ${C.elfName} purchase +10% faster!`},resource:s,cost:()=>a.pow(5,N.amount.value).times(10),style:"width: 600px"}));return N}const _=d({name:"Now You're Logging!",elfName:"Holly",buyableName:"Generic Cutters"}),y=d({name:"The Man Who Planted Trees",elfName:"Ivy",buyableName:"Generic Planters"}),v=d({name:"Logjam",elfName:"Hope",buyableName:"Expand Forest"}),p=d({name:"Fahrenheit 451",elfName:"Jack",buyableName:"Heated Cutters"}),w=d({name:"Tillamook Burn Country",elfName:"Mary",buyableName:"Heated Planters"}),S=d({name:"The Garden Tree's Handbook",elfName:"Noel",buyableName:"Fertilized Soil"}),H={cuttersBook:_,plantersBook:y,expandersBook:v,heatedCuttersBook:p,heatedPlantersBook:w,fertilizerBook:S},ae=At(()=>({direction:J.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,textStyle:"color: var(--feature-foreground)",progress:()=>G.day.value===Qt?a.div(a.log10(a.add(l.value,1)),a.log10(5e3)):1,display:B(()=>G.day.value===Qt?o(D,null,[R(l.value),g("/"),R(5e3)]):"")}));return xe(()=>{G.day.value===Qt&&a.gte(l.value,5e3)&&G.completeDay()}),{name:e,day:Qt,color:t,paper:s,totalPaper:l,paperConversion:c,books:H,minWidth:700,display:B(()=>o(D,null,[o("div",null,[G.day.value===Qt?`Reach ${R(5e3)} total ${s.displayName} to complete the day`:`${e} Complete!`]),me(ae),o(Pe,null,null),o(Vt,{resource:s,color:t,style:"margin-bottom: 0"},null),o(Pe,null,null),me(f),o(Pe,null,null),Gn(...Object.values(H))]))}}),Gl="workshop",Kt=2,qe=Tt(Gl,function(){const e="Workshop",t="#D66B02",n="#D66B02",i=at(0,"foundation progress"),s=Vl(()=>({scaling:Vi(250,1.5),baseResource:te.logs,gainResource:i,roundUpCost:!0,buyMax:!1,spend(ae,C){te.logs.value=a.sub(te.logs.value,C)}})),l=Ae(()=>({display:B(()=>o(D,null,[o("b",{style:"font-size: x-large"},[g("Build part of the foundation")]),o("br",null,null),o("br",null,null),o("span",{style:"font-size: large"},[g("Cost:")," ",Pn(te.logs,a.gte(s.actualGain.value,1)?s.currentAt.value:s.nextAt.value)," ",te.logs.displayName])])),visibility:()=>Z(a.lt(i.value,100)),canClick:()=>a.gte(s.actualGain.value,1)&&a.lt(i.value,100),onClick(){!r(this.canClick)||s.convert()},style:"width: 600px; min-height: unset"})),u=qn(()=>({key:"w",description:"Build part of the foundation.",onPress:()=>{l.canClick.value&&l.onClick()}})),c=Ve(()=>({display:{requirement:"1% Foundation Completed",effectDisplay:"Trees give 5% more logs for each % of foundation completed"},shouldEarn:()=>a.gte(i.value,1)})),f=Ve(()=>({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:()=>Z(c.earned.value)})),d=Ve(()=>({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:()=>Z(f.earned.value)})),_=Ve(()=>({display:{requirement:"30% Foundation Completed",effectDisplay:"All automatic tree cutting is doubled"},shouldEarn:()=>a.gte(i.value,30),visibility:()=>Z(d.earned.value)})),y=Ve(()=>({display:{requirement:"40% Foundation Completed",effectDisplay:"All automatic tree planting is doubled"},shouldEarn:()=>a.gte(i.value,40),visibility:()=>Z(_.earned.value)})),v=Ve(()=>({display:{requirement:"50% Foundation Completed",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>a.gte(i.value,50),visibility:()=>Z(y.earned.value)})),p=Ve(()=>({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:()=>Z(v.earned.value)})),w=Ve(()=>({display:{requirement:"100% Foundation Completed",effectDisplay:"Trees' log gain is now raised to the 1.1th power"},shouldEarn:()=>a.gte(i.value,100),visibility:()=>Z(p.earned.value)})),S={logGainMilestone1:c,autoCutMilestone1:f,autoPlantMilestone1:d,autoCutMilestone2:_,autoPlantMilestone2:y,logGainMilestone2:v,morePlantsMilestone1:p,logGainMilestone3:w},H=At(()=>({direction:J.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,progress:()=>G.day.value===Kt?a.div(i.value,100):1,display:B(()=>G.day.value===Kt?o(D,null,[R(i.value),g("%")]):"")}));return xe(()=>{G.day.value===Kt&&a.gte(i.value,100)&&G.completeDay()}),{name:e,day:Kt,color:t,foundationProgress:i,foundationConversion:s,milestones:S,minWidth:700,buildFoundationHK:u,display:B(()=>o(D,null,[o("div",null,[G.day.value===Kt?"Complete the foundation to complete the day":`${e} Complete!`]),me(H),o(Pe,null,null),me(l),a.lt(i.value,100)?o("div",null,[g("You have "),R(i.value),g("% completed")]):null,o(Pe,null,null),Gn(...Object.values(S))]))}}),Hl="elves",Jt=4,ht=Tt(Hl,function(){const e="Elves",t="red",n="#911D21",s=At(()=>({direction:J.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,progress:()=>G.day.value===Jt?a.div(Ie.value,6).times(.8333333333333334).add(a.div(a.add(le.coal.value,1).log10(),a.log10(1e9)).clamp(0,1).div(6)):1,display:B(()=>G.day.value===Jt?a.lt(Ie.value,6)?o(D,null,[R(Ie.value),g("/6 elves")]):o(D,null,[R(le.coal.value),g("/"),R(1e9),g(" coal")]):"")})),l=Rl(()=>({thingsToReset:[te,qe,le],onReset(){setTimeout(()=>{Q.earned.value&&(te.row1Upgrades[4].bought.value=!0,te.row2Upgrades[4].bought.value=!0)})}})),u=fe(()=>[W(()=>({multiplier:2,description:"6 Elves Trained",enabled:ie.earned})),W(()=>({multiplier:()=>a.times(he.books.cuttersBook.amount.value,.1).add(1),description:"Now You're Logging!",enabled:()=>a.gt(he.books.cuttersBook.amount.value,0)}))]),c=fe(()=>[W(()=>({multiplier:2,description:"6 Elves Trained",enabled:ie.earned})),W(()=>({multiplier:()=>a.times(he.books.plantersBook.amount.value,.1).add(1),description:"The Man Who Planted Trees",enabled:()=>a.gt(he.books.plantersBook.amount.value,0)}))]),f=fe(()=>[W(()=>({multiplier:2,description:"6 Elves Trained",enabled:ie.earned})),W(()=>({multiplier:()=>a.times(he.books.expandersBook.amount.value,.1).add(1),description:"Logjam",enabled:()=>a.gt(he.books.expandersBook.amount.value,0)}))]),d=fe(()=>[W(()=>({multiplier:2,description:"6 Elves Trained",enabled:ie.earned})),W(()=>({multiplier:()=>a.times(he.books.heatedCuttersBook.amount.value,.1).add(1),description:"Fahrenheit 451",enabled:()=>a.gt(he.books.heatedCuttersBook.amount.value,0)}))]),_=fe(()=>[W(()=>({multiplier:2,description:"6 Elves Trained",enabled:ie.earned})),W(()=>({multiplier:()=>a.times(he.books.heatedPlantersBook.amount.value,.1).add(1),description:"Tillamook Burn Country",enabled:()=>a.gt(he.books.heatedPlantersBook.amount.value,0)}))]),y=fe(()=>[W(()=>({multiplier:2,description:"6 Elves Trained",enabled:ie.earned})),W(()=>({multiplier:()=>a.times(he.books.fertilizerBook.amount.value,.1).add(1),description:"The Garden Tree's Handbook",enabled:()=>a.gt(he.books.fertilizerBook.amount.value,0)}))]),[v,p]=Qn(()=>[{title:"Holly Auto-Buy Frequency",modifier:u,base:10,unit:"/s",visible:De.cuttersElf.bought},{title:"Ivy Auto-Buy Frequency",modifier:c,base:10,unit:"/s",visible:De.plantersElf.bought},{title:"Hope Auto-Buy Frequency",modifier:f,base:10,unit:"/s",visible:De.expandersElf.bought},{title:"Jack Auto-Buy Frequency",modifier:d,base:10,unit:"/s",visible:De.heatedCuttersElf.bought},{title:"Mary Auto-Buy Frequency",modifier:_,base:10,unit:"/s",visible:De.heatedPlantersElf.bought},{title:"Noel Auto-Buy Frequency",modifier:y,base:10,unit:"/s",visible:De.fertilizerElf.bought}]),w=x(!1),S=B(()=>o(Xe,{modelValue:w.value,"onUpdate:modelValue":pe=>w.value=pe},{header:()=>o("h2",null,[e,g(" Modifiers")]),body:v}));function H(pe){const ft=I(()=>a.pow(4,Ie.value).times(1e6)),Te=Fe(0),st=I(()=>pe.cooldownModifier.apply(10));function Ze(ce){if(Oe.bought.value){Te.value=a.add(Te.value,ce);const Ct=a.recip(st.value);for(;a.gte(Te.value,Ct);)if(r(pe.buyable.canPurchase))pe.buyable.amount.value=a.add(pe.buyable.amount.value,1),Te.value=Ct.sub(.1);else{Te.value=Ct;break}}}const Oe=ge(()=>({...pe,buyProgress:Te,update:Ze,resource:le.coal,cost:ft,computedAutoBuyCooldown:st,display:()=>({title:pe.name,description:B(()=>o(D,null,[pe.description,Oe.bought.value?null:o(D,null,[" ",g("Training this elf will require resetting all your progress from days 1-3.")])])),showCost:!Oe.bought.value}),style:"width: 190px",onPurchase:l.reset}));return Oe}const ae=H({name:"Holly",description:"Holly will automatically purchase cutters you can afford, without actually spending any logs.",buyable:te.row1Buyables[0],cooldownModifier:u}),C=H({name:"Ivy",description:"Ivy will automatically purchase planters you can afford, without actually spending any logs.",buyable:te.row1Buyables[1],cooldownModifier:c}),N=H({name:"Hope",description:"Hope will automatically purchase forest expanders you can afford, without actually spending any logs.",buyable:te.row1Buyables[2],cooldownModifier:f}),O=[ae,C,N],ue=H({name:"Jack",description:"Jack will automatically purchase heated cutters you can afford, without actually spending any coal.",buyable:le.heatedCutters,cooldownModifier:d}),we=H({name:"Mary",description:"Mary will automatically purchase heated planters you can afford, without actually spending any coal.",buyable:le.heatedPlanters,cooldownModifier:_}),Ee=H({name:"Noel",description:"Noel will automatically purchase fertilized soil you can afford, without actually spending any ash.",buyable:le.moreFertilizer,cooldownModifier:y}),xt=[ue,we,Ee],De={cuttersElf:ae,plantersElf:C,expandersElf:N,heatedCuttersElf:ue,heatedPlantersElf:we,fertilizerElf:Ee},Ie=I(()=>Object.values(De).filter(pe=>pe.bought.value).length),kt=Ve(()=>({display:{requirement:"1 Elf Trained",effectDisplay:"Manual cutting and planting can happen twice as often for each trained elf"},shouldEarn:()=>a.gte(Ie.value,1)})),Q=Ve(()=>({display:{requirement:"2 Elves Trained",effectDisplay:"Research I & II are't reset after training"},shouldEarn:()=>a.gte(Ie.value,2),visibility:()=>Z(kt.earned.value)})),ct=Ve(()=>({display:{requirement:"3 Elves Trained",effectDisplay:"Coal gain is raised to the 1.25"},shouldEarn:()=>a.gte(Ie.value,3),visibility:()=>Z(Q.earned.value)})),Ue=Ve(()=>({display:{requirement:"4 Elves Trained",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>a.gte(Ie.value,4),visibility:()=>Z(ct.earned.value)})),dt=Ve(()=>({display:{requirement:"5 Elves Trained",effectDisplay:"Forest is twice as large"},shouldEarn:()=>a.gte(Ie.value,5),visibility:()=>Z(Ue.earned.value)})),ie=Ve(()=>({display:{requirement:"6 Elves Trained",effectDisplay:"Elves work twice as fast"},shouldEarn:()=>a.gte(Ie.value,6),visibility:()=>Z(dt.earned.value)})),Nt=[kt,Q,ct,Ue,dt,ie];return oe.on("update",pe=>{a.lt(G.day.value,Jt)||Object.values(De).forEach(ft=>ft.update(pe))}),xe(()=>{G.day.value===Jt&&a.gte(Ie.value,6)&&a.gte(le.coal.value,1e9)&&G.completeDay()}),{name:e,color:t,elves:De,totalElves:Ie,milestones:Nt,generalTabCollapsed:p,minWidth:700,display:B(()=>o(D,null,[o("div",null,[G.day.value===Jt?`Reach ${R(6)} trained elves and ${R(1e9)} ${le.coal.displayName} to complete the day`:`${e} Complete!`," ",g("-")," ",o("button",{class:"button",style:"display: inline-block;",onClick:()=>w.value=!0},[g("Check Modifiers")])]),me(s),me(S),o(Pe,null,null),o("div",{style:"width: 600px"},[Ge(...O),Ge(...xt)]),Gn(...Nt)]))}}),Ul="coal",Xt=3,le=Tt(Ul,function(){const e="Coal",t="#151716",n="#B2BeB5",i="var(--foreground)",s=at(0,"coal"),l=Wn(s),u=at(0,"ash"),c=1e7,f=At(()=>({direction:J.Right,width:600,height:25,fillStyle:`backgroundColor: ${t}`,progress:()=>G.day.value===Xt?a.log10(a.add(l.value,1)).div(Math.log10(c)):1,display:B(()=>G.day.value===Xt?o(D,null,[R(l.value),g("/"),R(c)]):"")})),d=Fe(0),_=I(()=>a.times(d.value,1e3)),y=I(()=>a.times(d.value,.1)),v=I(()=>a.times(d.value,50)),p=tt(()=>({resource:te.logs,cost(){return a.times(Ee.amount.value,10).plus(this.amount.value).pow(1.5).times(1e4)},display:B(()=>o(D,null,[o("h3",null,[g("Small Fire")]),o("br",null,null),g("Burn 1000 logs for 0.1 coal and 50 ash"),o("br",null,null),o("br",null,null),g("Currently:"),o("br",null,null),g("-"),ee(_.value),g(" logs/sec"),o("br",null,null),g("+"),ee(y.value),g(" coal/sec"),o("br",null,null),g("+"),ee(v.value),g(" ash/sec"),o("br",null,null),o("br",null,null),g("Cost: "),R(r(p.cost)),g(" "),p.resource.displayName])),onPurchase(){d.value=a.add(d.value,1)},style:{color:i,width:"160px"}})),w=Ae(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(d.value,0)},onClick(){d.value=0}})),S=Ae(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(d.value,0)},onClick(){d.value=a.sub(d.value,1)}})),H=Ae(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(d.value,p.amount.value)},onClick(){d.value=a.add(d.value,1)}})),ae=Ae(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(d.value,p.amount.value)},onClick(){d.value=p.amount.value}})),C=at(p.amount,"small fires"),N=Fe(0),O=I(()=>a.times(N.value,1e4)),ue=I(()=>a.times(N.value,10)),we=I(()=>a.times(N.value,1e3)),Ee=tt(()=>({resource:C,cost:10,display:B(()=>o(D,null,[o("h3",null,[g("Bonfire")]),o("br",null,null),g("Burn 10,000 logs for 10 coal and 1000 ash"),o("br",null,null),o("br",null,null),g("Currently:"),o("br",null,null),g("-"),ee(O.value),g(" logs/sec"),o("br",null,null),g("+"),ee(ue.value),g(" coal/sec"),o("br",null,null),g("+"),ee(we.value),g(" ash/sec"),o("br",null,null),o("br",null,null),g("Cost: "),R(r(Ee.cost)),g(" "),Ee.resource.displayName])),onPurchase(F){d.value=a.sub(d.value,F).max(0),N.value=a.add(N.value,1)},style:{color:i,width:"160px"}})),xt=Ae(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(N.value,0)},onClick(){N.value=0}})),De=Ae(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(N.value,0)},onClick(){N.value=a.sub(N.value,1)}})),Ie=Ae(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(N.value,Ee.amount.value)},onClick(){N.value=a.add(N.value,1)}})),kt=Ae(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(N.value,Ee.amount.value)},onClick(){N.value=Ee.amount.value}})),Q=Fe(0),ct=I(()=>a.times(Q.value,1e6)),Ue=I(()=>a.times(Q.value,1e4)),dt=I(()=>a.times(Q.value,1e4)),ie=tt(()=>({resource:te.logs,cost(){return a.pow(1.1,this.amount.value).times(1e7)},display:B(()=>o(D,null,[o("h3",null,[g("Charcoal Kiln")]),o("br",null,null),g("Burn 1,000,000 logs for 10,000 coal and 10,000 ash"),o("br",null,null),o("br",null,null),g("Currently:"),o("br",null,null),g("-"),ee(ct.value),g(" logs/sec"),o("br",null,null),g("+"),ee(Ue.value),g(" coal/sec"),o("br",null,null),g("+"),ee(dt.value),g(" ash/sec"),o("br",null,null),o("br",null,null),g("Cost: "),R(r(ie.cost)),g(" "),ie.resource.displayName])),onPurchase(){Q.value=a.add(Q.value,1)},style:{color:i,width:"160px"}})),Nt=Ae(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(Q.value,0)},onClick(){Q.value=0}})),pe=Ae(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(Q.value,0)},onClick(){Q.value=a.sub(Q.value,1)}})),ft=Ae(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(Q.value,ie.amount.value)},onClick(){Q.value=a.add(Q.value,1)}})),Te=Ae(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(Q.value,ie.amount.value)},onClick(){Q.value=ie.amount.value}})),st=ge(()=>({resource:s,cost:5,display:{title:"Warmer Cutters",description:"Cut down twice as many trees/s"},style:{color:i}})),Ze=ge(()=>({resource:s,cost:5,display:{title:"Warmer Planters",description:"Plant twice as many trees/s"},style:{color:i}})),Oe=ge(()=>({resource:u,cost:5e3,display:{title:"Ashy Soil",description:"Trees give 25% more logs"},style:{color:i}})),ce=ge(()=>({resource:C,cost:10,display:{title:"Bigger Fires",description:"Put all those fires together into a larger blaze"},onPurchase(){C.value=a.add(C.value,this.cost)},style:{color:i}})),Ct=[st,Ze,Oe,ce],Ye=ge(()=>({resource:s,cost:250,display:{title:"Dedicated Cutter Heaters",description:"Double the bonus from Heated Cutters"},style:{color:i},visibility:()=>Z(ce.bought.value)})),Re=ge(()=>({resource:s,cost:250,display:{title:"Dedicated Planter Heaters",description:"Double the bonus from Heated Planters"},style:{color:i},visibility:()=>Z(ce.bought.value)})),Ht=ge(()=>({canAfford(){return a.gte(te.logs.value,1e5)&&a.gte(u.value,1e5)},onPurchase(){te.logs.value=a.sub(te.logs.value,1e5),u.value=a.sub(u.value,1e5)},display:B(()=>o(D,null,[o("h3",null,[g("Mulched Soil")]),o("br",null,null),g("Double the bonus from Fertilized Soil"),o("br",null,null),o("br",null,null),g("Cost: "),R(1e5),g(" "),te.logs.displayName,o("br",null,null),R(1e5),g(" "),u.displayName])),style:{color:i},visibility:()=>Z(ce.bought.value)})),et=ge(()=>({resource:te.logs,cost:1e7,display:{title:"Efficient Fires",description:"Move the fires underground to keep the coal from turning to ash"},style:{color:i},visibility:()=>Z(ce.bought.value)})),Tn=[Ye,Re,Ht,et],Bt=tt(()=>({resource:s,cost(){let F=this.amount.value;return a.gte(F,50)&&(F=a.pow(F,2).div(50)),a.gte(F,200)&&(F=a.pow(F,2).div(200)),a.gte(F,2e6)&&(F=a.pow(F,2).div(2e6)),F=a.pow(.95,he.books.heatedCuttersBook.amount.value).times(F),a.add(F,1).pow(2.5).times(10)},display:{title:"Heated Cutters",description:"Even warmer cutters cut down trees faster",effectDisplay:B(()=>o(D,null,[g("Cutters cut down trees "),ee(dn.value),g("x faster")]))},style:{color:i},visibility:()=>Z(st.bought.value)})),mt=tt(()=>({resource:s,cost(){let F=this.amount.value;return a.gte(F,50)&&(F=a.pow(F,2).div(50)),a.gte(F,200)&&(F=a.pow(F,2).div(200)),a.gte(F,2e6)&&(F=a.pow(F,2).div(2e6)),F=a.pow(.95,he.books.heatedPlantersBook.amount.value).times(F),a.add(F,1).pow(2.5).times(10)},display:{title:"Heated Planters",description:"Even warmer planters plant trees faster",effectDisplay:B(()=>o(D,null,[g("Planters plant trees "),ee(T.value),g("x faster")]))},style:{color:i},visibility:()=>Z(Ze.bought.value)})),Ft=tt(()=>({resource:u,cost(){let F=this.amount.value;return a.gte(F,50)&&(F=a.pow(F,2).div(50)),a.gte(F,200)&&(F=a.pow(F,2).div(200)),a.gte(F,2e6)&&(F=a.pow(F,2).div(2e6)),F=a.pow(.95,he.books.fertilizerBook.amount.value).times(F),a.add(F,1).pow(1.5).times(5e4)},display:{title:"Fertilized Soil",description:"More fertilizer helps trees grow bigger",effectDisplay:B(()=>o(D,null,[g("Trees give "),ee(zt.value),g("x more logs")]))},style:{color:i},visibility:()=>Z(Oe.bought.value)})),Ut=[Bt,mt,Ft],jt=fe(()=>[se(()=>({addend(){return a.times(Bt.amount.value,.25)},description:"Heated Cutters",enabled(){return a.gt(Bt.amount.value,0)}})),W(()=>({multiplier:2,description:"Dedicated Cutter Heaters",enabled:Ye.bought}))]),dn=I(()=>jt.apply(1)),xn=fe(()=>[se(()=>({addend(){return a.times(mt.amount.value,.25)},description:"Heated Planters",enabled(){return a.gt(mt.amount.value,0)}})),W(()=>({multiplier:2,description:"Dedicated Planter Heaters",enabled:Re.bought}))]),T=I(()=>xn.apply(1)),fn=fe(()=>[se(()=>({addend(){return a.times(Ft.amount.value,.25)},description:"Fertilized Soil",enabled(){return a.gt(Ft.amount.value,0)}})),W(()=>({multiplier:2,description:"Mulched Soil",enabled:Ht.bought}))]),zt=I(()=>fn.apply(1)),mn=fe(()=>[se(()=>({addend(){return y.value},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),se(()=>({addend(){return ue.value},description:"Bonfires",enabled(){return a.gt(N.value,0)}})),se(()=>({addend(){return Ue.value},description:"Charcoal Kilns",enabled(){return a.gt(Q.value,0)}})),Ri(()=>({exponent:1.25,description:"3 Elves Trained",enabled:ht.milestones[2].earned}))]),Wt=I(()=>mn.apply(0)),ei=fe(()=>[se(()=>({addend(){return v.value},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),se(()=>({addend(){return we.value},description:"Bonfires",enabled(){return a.gt(N.value,0)}})),se(()=>({addend(){return dt.value},description:"Charcoal Kilns",enabled(){return a.gt(Q.value,0)}}))]),Bn=I(()=>ei.apply(0)),ti=fe(()=>[se(()=>({addend(){return a.negate(_.value)},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),se(()=>({addend(){return a.negate(O.value)},description:"Bonfires",enabled(){return a.gt(N.value,0)}})),se(()=>({addend(){return a.negate(ct.value)},description:"Charcoal Kilns",enabled(){return a.gt(Q.value,0)}}))]),ni=I(()=>ti.apply(0)),[Zi,Yi]=Qn(()=>[{title:"Log Consumption",modifier:ti,base:0,visible(){return a.gt(d.value,0)||a.gt(N.value,0)||a.gt(Q.value,0)}},{title:"Coal Gain",modifier:mn,base:0,visible(){return a.gt(d.value,0)||a.gt(N.value,0)||a.gt(Q.value,0)}},{title:"Ash Gain",modifier:ei,base:0,visible(){return a.gt(d.value,0)||a.gt(N.value,0)||a.gt(Q.value,0)}}]),Fn=x(!1),es=B(()=>o(Xe,{modelValue:Fn.value,"onUpdate:modelValue":F=>Fn.value=F},{header:()=>o("h2",null,[e,g(" Modifiers")]),body:Zi}));return oe.on("update",F=>{a.lt(G.day.value,Xt)||a.times(F,ni.value).negate().gt(te.logs.value)||(te.logs.value=a.times(F,ni.value).plus(te.logs.value),s.value=a.times(F,Wt.value).plus(s.value),u.value=a.times(F,Bn.value).plus(u.value))}),xe(()=>{G.day.value===Xt&&a.gte(l.value,c)&&G.completeDay()}),{name:e,color:t,coal:s,totalCoal:l,ash:u,activeFires:d,buildFire:p,activeBonfires:N,buildBonfire:Ee,activeKilns:Q,buildKiln:ie,warmerCutters:st,warmerPlanters:Ze,basicFertilizer:Oe,unlockBonfire:ce,dedicatedCutters:Ye,dedicatedPlanters:Re,betterFertilizer:Ht,unlockKiln:et,heatedCutters:Bt,heatedPlanters:mt,moreFertilizer:Ft,computedHeatedCutterEffect:dn,computedHeatedPlanterEffect:T,computedFertilizerEffect:zt,generalTabCollapsed:Yi,minWidth:700,display:B(()=>o(D,null,[o("div",null,[G.day.value===Xt?`Reach ${R(c)} ${s.displayName} to complete the day`:`${e} Complete!`," ",g("-")," ",o("button",{class:"button",style:"display: inline-block;",onClick:()=>Fn.value=!0},[g("Check Modifiers")])]),me(f),me(es),o(Pe,null,null),o(Vt,{resource:s,color:t,style:"margin-bottom: 0",effectDisplay:a.gt(Wt.value,0)?`+${ee(Wt.value)}/s`:void 0},null),o(Pe,null,null),o(Vt,{resource:u,color:n,style:"margin-bottom: 0",effectDisplay:a.gt(Bn.value,0)?`+${ee(Bn.value)}/s`:void 0},null),o(Pe,null,null),o(Pi,null,{default:()=>[o(vn,null,{default:()=>[me(p),o("div",null,[R(d.value),g("/"),R(p.amount.value)]),Ge(w,S,H,ae)]}),ce.bought.value?o(D,null,[o(Pe,null,null),o(vn,null,{default:()=>[me(Ee),o("div",null,[R(N.value),g("/"),R(Ee.amount.value)]),Ge(xt,De,Ie,kt)]})]):void 0,et.bought.value?o(D,null,[o(Pe,null,null),o(vn,null,{default:()=>[me(ie),o("div",null,[R(Q.value),g("/"),R(ie.amount.value)]),Ge(Nt,pe,ft,Te)]})]):void 0]}),o(Pe,null,null),Ge(...Ct),Ge(...Tn),Ge(...Ut)]))}}),jl="trees",Zt=1,ci=.5,te=Tt(jl,function(){const e="Trees",t="#4BDC13",n="green",i=at(0,"logs"),s=Wn(i),l=at(0,"saplings"),u=1e4,c=x(0),f=fe(()=>[se(()=>({addend:()=>a.times(xt.amount.value,10),description:"Expand Forest",enabled:O.bought})),se(()=>({addend:()=>a.div(qe.foundationProgress.value,2),description:"75% Foundation Completed",enabled:qe.milestones.morePlantsMilestone1.earned})),W(()=>({multiplier:2,description:"5 Elves Trained",enabled:ht.milestones[4].earned}))]),d=at(I(()=>a.sub(f.apply(10),l.value)),"trees"),_=ge(()=>({resource:i,cost:10,display:{title:"Wooden Fingers",description:"Cut down an additional tree per click"}})),y=ge(()=>({resource:i,cost:10,display:{title:"Leafy Fingers",description:"Plant an additional tree per click"}})),v=ge(()=>({resource:i,cost:25,display:{title:"Automated Knives",description:"Cut down a tree every second"}})),p=ge(()=>({resource:i,cost:25,display:{title:"Automated Spade",description:"Plant a tree every second"}})),w=ge(()=>({resource:i,cost:40,display:{title:"Research I",description:"Trees give 25% more logs, and unlock more upgrades"}})),S=[_,y,v,p,w],H=ge(()=>({resource:i,cost:50,visibility:()=>Z(w.bought.value),display:{title:"Sharper Fingers",description:"Manually cut trees twice as often"}})),ae=ge(()=>({resource:i,cost:50,visibility:()=>Z(w.bought.value),display:{title:"Greener Fingers",description:"Manually Plant trees twice as often"}})),C=ge(()=>({resource:i,cost:150,visibility:()=>Z(w.bought.value),display:{title:"Smart Knives",description:"Each time you manually chop trees, gain 1s of automatic tree chopping production"}})),N=ge(()=>({resource:i,cost:150,visibility:()=>Z(w.bought.value),display:{title:"Smart Spades",description:"Each time you manually plant trees, gain 1s of automatic tree planting production"}})),O=ge(()=>({resource:i,cost:300,visibility:()=>Z(w.bought.value),display:{title:"Research II",description:"Trees give 25% more logs, and unlock repeatable purchases"}})),ue=[H,ae,C,N,O],we=tt(()=>({resource:i,cost(){let T=this.amount.value;return a.gte(T,50)&&(T=a.pow(T,2).div(50)),a.gte(T,200)&&(T=a.pow(T,2).div(200)),a.gte(T,2e6)&&(T=a.pow(T,2).div(2e6)),T=a.pow(.95,he.books.cuttersBook.amount.value).times(T),a.times(100,T).add(200)},display:{title:"Generic Cutters",description:"Each cutter cuts down 1 tree/s"},visibility:()=>Z(O.bought.value)})),Ee=tt(()=>({resource:i,cost(){let T=this.amount.value;return a.gte(T,50)&&(T=a.pow(T,2).div(50)),a.gte(T,200)&&(T=a.pow(T,2).div(200)),a.gte(T,2e6)&&(T=a.pow(T,2).div(2e6)),T=a.pow(.95,he.books.plantersBook.amount.value).times(T),a.times(100,T).add(200)},display:{title:"Generic Planters",description:"Each planter plants 0.5 trees/s"},visibility:()=>Z(O.bought.value)})),xt=tt(()=>({resource:i,cost(){let T=this.amount.value;return a.gte(T,100)&&(T=a.pow(T,2).div(100)),a.gte(T,1e5)&&(T=a.pow(T,2).div(1e5)),T=a.pow(.95,he.books.expandersBook.amount.value).times(T),a.pow(a.add(T,1),1.5).times(500)},display:{title:"Expand Forest",description:"Add 10 trees to the forest"},visibility:()=>Z(O.bought.value)})),De=[we,Ee,xt],Ie=At(()=>({direction:J.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,progress:()=>G.day.value===Zt?a.log10(a.add(s.value,1)).div(Math.log10(u)):1,display:B(()=>G.day.value===Zt?o(D,null,[R(s.value),g("/"),R(u)]):"")})),kt=fe(()=>[se(()=>({addend:1,description:"Wooden Fingers",enabled:_.bought})),se(()=>({addend:ie,description:"Smart Knives",enabled:C.bought}))]),Q=I(()=>kt.apply(1)),ct=fe(()=>[W(()=>({multiplier:.5,description:"Sharper Fingers",enabled:H.bought})),W(()=>({multiplier:()=>a.pow(.5,ht.totalElves.value),description:"1 Elf Trained",enabled:ht.milestones[0].earned}))]),Ue=I(()=>ct.apply(1)),dt=fe(()=>[se(()=>({addend:1,description:"Automated Knives",enabled:v.bought})),se(()=>({addend:we.amount,description:"Generic Cutters",enabled:O.bought})),se(()=>({addend:()=>a.div(qe.foundationProgress.value,5).floor(),description:"10% Foundation Completed",enabled:qe.milestones.autoCutMilestone1.earned})),W(()=>({multiplier:2,description:"30% Foundation Completed",enabled:qe.milestones.autoCutMilestone2.earned})),W(()=>({multiplier:2,description:"Warmer Cutters",enabled:le.warmerCutters.bought})),W(()=>({multiplier:le.computedHeatedCutterEffect,description:"Heated Cutters",enabled:()=>a.gt(le.heatedCutters.amount.value,0)}))]),ie=I(()=>dt.apply(0)),Nt=fe(()=>[se(()=>({addend:1,description:"Leafy Fingers",enabled:y.bought})),se(()=>({addend:Ze,description:"Smart Spades",enabled:N.bought}))]),pe=I(()=>Nt.apply(1)),ft=fe(()=>[W(()=>({multiplier:.5,description:"Greener Fingers",enabled:ae.bought})),W(()=>({multiplier:()=>a.pow(.5,ht.totalElves.value),description:"1 Elf Trained",enabled:ht.milestones[0].earned}))]),Te=I(()=>ft.apply(1)),st=fe(()=>[se(()=>({addend:1,description:"Automated Spade",enabled:p.bought})),se(()=>({addend:()=>a.div(Ee.amount.value,2),description:"Generic Planters",enabled:O.bought})),se(()=>({addend:()=>a.div(qe.foundationProgress.value,10).floor(),description:"20% Foundation Completed",enabled:qe.milestones.autoPlantMilestone1.earned})),W(()=>({multiplier:2,description:"40% Foundation Completed",enabled:qe.milestones.autoPlantMilestone2.earned})),W(()=>({multiplier:2,description:"Warmer Planters",enabled:le.warmerPlanters.bought})),W(()=>({multiplier:le.computedHeatedPlanterEffect,description:"Heated Planters",enabled:()=>a.gt(le.heatedPlanters.amount.value,0)}))]),Ze=I(()=>st.apply(0)),Oe=fe(()=>[W(()=>({multiplier:1.25,description:"Research I",enabled:w.bought})),W(()=>({multiplier:1.25,description:"Research II",enabled:O.bought})),W(()=>({multiplier:()=>a.div(qe.foundationProgress.value,20).add(1),description:"1% Foundation Completed",enabled:qe.milestones.logGainMilestone1.earned})),W(()=>({multiplier:2,description:"50% Foundation Completed",enabled:qe.milestones.logGainMilestone2.earned})),W(()=>({multiplier:1.25,description:"Ashy Soil",enabled:le.basicFertilizer.bought})),W(()=>({multiplier:le.computedFertilizerEffect,description:"Fertilized Soil",enabled:()=>a.gt(le.moreFertilizer.amount.value,0)})),W(()=>({multiplier:2,description:"4 Elves Trained",enabled:ht.milestones[3].earned})),Ri(()=>({exponent:1.1,description:"100% Foundation Completed",enabled:qe.milestones.logGainMilestone3.earned}))]),ce=Fe(0),Ct=At(()=>({direction:J.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>a.div(ce.value,Ue.value)})),Ye=Ae(()=>({display:{title:"Cut trees",description:B(()=>o(D,null,[g("Cut down up to "),R(a.floor(Q.value))," ",g("tree"),a.eq(Q.value,1)?"":"s",g(" at once!"),o("br",null,null),me(Ct)]))},style:{minHeight:"80px"},canClick:()=>a.gte(d.value,1)&&a.gte(ce.value,Ue.value),onClick(){if(a.lt(ce.value,Ue.value))return;const T=a.floor(a.min(d.value,a.times(Q.value,a.div(ce.value,Ue.value).floor())));i.value=a.add(i.value,Oe.apply(T)),l.value=a.add(l.value,T),ce.value=0}})),Re=Fe(0),Ht=At(()=>({direction:J.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>a.div(Re.value,Te.value)})),et=Ae(()=>({display:{title:"Plant trees",description:B(()=>o(D,null,[g("Plant up to "),R(a.floor(pe.value))," ",g("tree"),a.eq(pe.value,1)?"":"s",g(" at once!"),o("br",null,null),me(Ht)]))},style:{minHeight:"80px"},canClick:()=>a.gte(l.value,1)&&a.gte(Re.value,Te.value),onClick(){if(a.lt(Re.value,Te.value))return;const T=a.floor(a.min(l.value,a.times(pe.value,a.div(Re.value,Te.value).floor())));l.value=a.sub(l.value,T),Re.value=0}})),[Tn,Bt]=Qn(()=>[{title:"Logs per Tree",modifier:Oe,base:1,visible:w.bought},{title:"Manual Cutting Amount",modifier:kt,base:1,visible:_.bought,unit:"/click"},{title:"Manual Cutting Cooldown",modifier:ct,base:1,visible:_.bought,unit:"s"},{title:"Manual Planting Amount",modifier:Nt,base:1,visible:y.bought,unit:"/click"},{title:"Manual Planting Cooldown",modifier:ft,base:1,visible:y.bought,unit:"s"},{title:"Auto Cutting Amount",modifier:dt,base:0,visible:v.bought,unit:"/s"},{title:"Auto Planting Amount",modifier:st,base:0,visible:p.bought,unit:"/s"},{title:"Forest Size",modifier:f,base:10,visible:O.bought}]),mt=x(!1),Ft=B(()=>o(Xe,{modelValue:mt.value,"onUpdate:modelValue":T=>mt.value=T},{header:()=>o("h2",null,[e,g(" Modifiers")]),body:Tn}));oe.on("update",T=>{if(a.lt(G.day.value,Zt))return;a.gte(ce.value,Ue.value)?ce.value=Ue.value:(ce.value=a.add(ce.value,T),Ye.isHolding.value&&Ye.onClick()),a.gte(Re.value,Te.value)?Re.value=Te.value:(Re.value=a.add(Re.value,T),et.isHolding.value&&et.onClick());const fn=a.min(d.value,a.times(ie.value,T)),zt=Oe.apply(fn),mn=a.div(zt,T);c.value=a.mul(mn,ci).add(a.mul(c.value,a.dOne.sub(ci))),i.value=a.add(i.value,zt),l.value=a.add(l.value,fn);const Wt=a.min(l.value,a.times(Ze.value,T));l.value=a.sub(l.value,Wt)}),xe(()=>{G.day.value===Zt&&a.gte(s.value,u)&&G.completeDay()});const Ut=I(()=>a.sub(ie.value,Ze.value)),jt=I(()=>a.sub(Ze.value,ie.value)),dn=qn(()=>({key:"c",description:'Press the "Cut trees" button.',onPress:()=>{Ye.canClick.value&&Ye.onClick()}})),xn=qn(()=>({key:"p",description:'Press the "Plant trees" button.',onPress:()=>{et.canClick.value&&et.onClick()}}));return{name:e,color:t,logs:i,totalLogs:s,trees:d,saplings:l,cutTree:Ye,plantTree:et,cutTreeHK:dn,plantTreeHK:xn,row1Upgrades:S,row2Upgrades:ue,row1Buyables:De,manualCutProgress:ce,manualPlantProgress:Re,generalTabCollapsed:Bt,minWidth:700,display:B(()=>o(D,null,[o("div",null,[G.day.value===Zt?`Reach ${R(1e4)} ${i.displayName} to complete the day`:`${e} Complete!`," ",g("-")," ",o("button",{class:"button",style:"display: inline-block;",onClick:()=>mt.value=!0},[g("Check Modifiers")])]),me(Ie),me(Ft),o(Pe,null,null),o(Vt,{resource:i,color:t,style:"margin-bottom: 0",effectDisplay:a.gt(ie.value,0)?`expected: +${ee(Oe.apply(ie.value))}/s, average: +${ee(c.value)}/s (${ee(a.div(c.value,Oe.apply(ie.value)).mul(100))}% efficent)`:void 0},null),o(Vt,{resource:l,color:n,style:"margin-bottom: 0",effectDisplay:{[-1]:`${R(Ut.value)}/s`,0:void 0,1:`+${R(Ut.value)}/s`}[a.compare(Ut.value,0)]},null),o(Vt,{resource:d,color:n,style:"margin-bottom: 0",effectDisplay:{[-1]:`${R(jt.value)}/s`,0:void 0,1:`+${R(jt.value)}/s`}[a.compare(jt.value,0)]},null),o(Pe,null,null),Ge(Ye,et),o("div",null,[g("Tip: You can hold down on actions to perform them automatically")]),o("div",null,[g("Note: your average log gain will be equal to your expected log gain if you have enough trees to support your chopping")]),o(Pe,null,null),Ge(...S),Ge(...ue),Ge(...De)]))}});var Li="./assets/tree.35808197.png",Gi="./assets/sws.714ad454.png",Hi="data:image/png;base64,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",Ui="./assets/elf.9fbfa563.png",ji="./assets/paperStacks.4c96ec8c.png";const G=Tt("main",function(){const e=Fe(1),t=x(!1),n=x(-1),i=x(""),s=x();function l(f){const d=Fe(!1);return Le(()=>{const _=f(),y=Be(_.shouldNotify);return{..._,opened:d,shouldNotify:y,[bt]:Ya,[_t]:function(){const{day:v,layer:p,symbol:w,opened:S,shouldNotify:H,story:ae,completedStory:C}=this;return{day:v,symbol:w,opened:S,shouldNotify:H,onOpenLore(){var ue,we;const N=G.day.value>v;n.value=N?v-1:-1;const O=r((we=(ue=$e[p!=null?p:"trees"])==null?void 0:ue.name)!=null?we:"");i.value=N?`${O} - Completed!`:O,s.value=N?`${ae}