/* empty css */import"./vue.92681fcb.js";import{ZasS,laswe,aaasL,tasO,ayasSn,arasHt,aEasy,a0asM,aKasft,a1asf,Oasx,aGasvn,AasDe,_asG,a8asu,b6asU,b8asMn,bsasfs,Caso,aqasQt,buassn,bbasAn,Tasoi,a7ash,uasIn,jasri,bvases,qasdn,b1asht,Gaske,aCasps,wasnt,b2asXe,aoasui,IasIe,J,$asE,aHaswt,aFaskt,zasot,aNasye,alas_n,aLasxt,Hasci,aJashs,bnasdi,brasmi,beasfi}from"./@vue.4ce677c2.js";import{casgs}from"./nanoevents.1080beb7.js";import{LasEt}from"./lz-string.731cedc5.js";import{iaspi}from"./is-plain-object.906d88e8.js";import{Yashi}from"./vue-next-select.a2bfab1d.js";import{sasgi,uasvs}from"./vue-toastification.6f567382.js";import{Dasvi}from"./vuedraggable.7949458c.js";import{pasyi}from"./vue-textarea-autosize.35804eaf.js";import{vasbi,nas_i}from"./workbox-window.8d14e8b7.js";import"./sortablejs.29100d8a.js";constwi=function(){constt=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(constiofdocument.querySelectorAll('link[rel="modulepreload"]'))s(i);newMutationObserver(i=>{for(constlofi)if(l.type==="childList")for(constrofl.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});functionn(i){constl={};returni.integrity&&(l.integrity=i.integrity),i.referrerpolicy&&(l.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?l.credentials="include":i.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}functions(i){if(i.ep)return;i.ep=!0;constl=n(i);fetch(i.href,l)}};wi();constki="modulepreload",ts={},Ci="./",wn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(s=>{if(s=`${Ci}${s}`,sints)return;ts[s]=!0;consti=s.endsWith(".css"),l=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${l}`))return;constr=document.createElement("link");if(r.rel=i?"stylesheet":ki,i||(r.as="script",r.crossOrigin=""),r.href=s,document.head.appendChild(r),i)returnnewPromise((c,d)=>{r.addEventListener("load",c),r.addEventListener("error",()=>d(newError(`Unable to preload CSS for ${s}`)))})})).then(()=>t())},Ni="./projInfo-schema.json",Si="Advent Incremental",Mi="An incremental game you play a day at a time, leading up to Christmas!",Ai="advent-incremental",Ii="thepaperpilot and friends",Ei="",Bi="",Pi="0.3",xi="Initial Commit",Fi=!0,Ti=!1,Ri=2,$i=!0,Di=null,Oi="",qi=["main"],Ui=3600,Vi=0,Li=!0,Gi="base64";varae={$schema:Ni,title:Si,description:Mi,id:Ai,author:Ii,discordName:Ei,discordLink:Bi,versionNumber:Pi,versionTitle:xi,allowGoBack:Fi,defaultShowSmall:Ti,defaultDecimalsShown:Ri,useHeader:$i,banner:Di,logo:Oi,initialTabs:qi,maxTickLength:Ui,offlineLimit:Vi,enablePausing:Li,exportEncoding:Gi};const$n=17,Hi=9e15,Qi=Math.log10(9e15),zi=1/9e15,ji=308,Ki=-324,ns=5,Wi=function(){conste=[];for(letn=Ki+1;n<=ji;n++)e.push(Number("1e"+n));constt=323;returnfunction(n){returne[n+t]}}(),Ut=[2,Math.E,3,4,5,6,7,8,9,10],Ji=[[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
Stack:${it}
Tryingtopop${n.id}`;return it.pop(),F(n,"color"),F(n,"display"),F(n,"name"),$e(n,"name",n.id),F(n,"minWidth"),$e(n,"minWidth",600),F(n,"minimizable"),$e(n,"minimizable",!0),n})}function Is(e,t){if(console.info("Adding layer",e.id),Ue[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,Ue[e.id]);return}$e(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),Ue[e.id]=e,Ce.emit("addLayer",e,t.layers[e.id])}function Ia(e){return Ue[e]}function Es(e){console.info("Removing layer",e.id),Ce.emit("removeLayer",e),Ue[e.id]=void 0}function Ea(e){Es(e),Is(e,q)}function Ba(e){const t=O(!1);return{openModal:()=>t.value=!0,modal:T(()=>u(rt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>u("h2",null,[o(e.name)]),body:o(e.display)}))}}Ce.on("update",function(t){Object.values(Ue).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(Ue).forEach(n=>{n==null||n.emit("update",t)}),Object.values(Ue).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Pa=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Vn,UnregisterNodeInjectionKey:Ln,NodesInjectionKey:Gn,BoundsInjectionKey:Hn,layers:Ue,persistentRefs:Kt,addingLayers:it,createLayer:$t,addLayer:Is,getLayer:Ia,removeLayer:Es,reloadLayer:Ea,setupLayerModal:Ba},Symbol.toStringTag,{value:"Module"}));const ln=Symbol("PersistentState"),on=Symbol("DefaultValue"),Cn=Symbol("StackTrace"),Bs=Symbol("Deleted"),rn=Symbol("NonPersistent"),nn=Symbol("SaveDataPath");function xa(){var e;return((e=new Error().stack)==null?void 0:e.split(`
`).slice(3,5).map(t=>t.trim()).join(`
`))||""}function Pe(e){const t=we(e)?e:O(e);return t[ln]=t,t[on]=we(e)?e.value:e,t[Cn]=xa(),t[Bs]=!1,t[rn]=S({get(){return t.value},set(n){t.value=n}}),t[nn]=void 0,it.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",t,`
Createdat:
`+t[Cn]):Kt[it[it.length-1]].add(t),t}function Fa(e){return e&&typeof e=="object"&&ln in e}function Z(e){return e[rn]}Ce.on("addLayer",(e,t)=>{const n=[],s=(i,l=[])=>{let r=!1;return Object.keys(i).forEach(c=>{let d=i[c];if(d&&typeof d=="object")if(fe in d&&(d=d[fe]),Fa(d)){if(r=!0,d[Bs]){console.warn("Deleted persistent ref present in returned object. Ignoring...",d,`
Createdat:
`+d[Cn]);return}Kt[e.id].delete(d);const m=[e.id,...l,c];d[nn]!=null&&JSON.stringify(m)!==JSON.stringify(d[nn])&&console.error(`Persistentrefisbeingsavedto\`${m.join(".")}\` when it's already present at \`${d[nn].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,d),d[nn]=m;constv=l.reduce((b,g)=>(ginb||(b[g]={}),b[g]),t),_=v[c];v[c]=d[ln],ri(v)?_!=null?v[c]=_:v[c]=d[on]:_!=null?v[c].value=_:v[c].value=d[on]}else!(dinstanceofa)&&!we(d)&&!n.includes(d)&&(typeofd.type=="symbol"&&n.push(d),s(d,[...l,c])&&(es(d)&&!es(i)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",feini?i[fe]:i,c):r=!0))}),r};s(e[fe]),Kt[e.id].forEach(i=>{console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,i,`
Createdat:
`+i[Cn])}),Kt[e.id].clear()});const fe=Symbol("ProxyState"),jt=Symbol("ProxyPath");function ze(e,t={}){const n=t;let s=!1;function i(){return s||(Object.assign(n,e(n)),s=!0),n}return new Proxy(n,{get(l,r){if(r===fe)return i();const c=i()[r];return c&&typeof c=="object"&&rn in c?c[rn]:c},set(l,r,c){return i()[r]=c,!0},has(l,r){return r===fe?!0:Reflect.has(i(),r)},ownKeys(){return Reflect.ownKeys(i())},getOwnPropertyDescriptor(l,r){return s||(Object.assign(n,e(n)),s=!0),Object.getOwnPropertyDescriptor(l,r)}})}var ge=window.state=In({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Ps=dn({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{},usingLog:!1});function xs(e){return JSON.stringify(e,(t,n)=>o(n))}const Fs={get(e,t){var s;if(t===fe||t===jt)return e[t];const n=e[fe][t];if(t!=="value"&&(pi(n)||Array.isArray(n))){if(n!==((s=e[t])==null?void 0:s[fe])){const i=[...e[jt],t];e[t]=new Proxy({[fe]:n,[jt]:i},Fs)}return e[t]}return n},set(e,t,n,s){if(!ge.hasNaN&&(typeof n=="number"&&isNaN(n)||n instanceof a&&(isNaN(n.sign)||isNaN(n.layer)||isNaN(n.mag)))){const i=e[fe][t];if(!(typeof i=="number"&&isNaN(i)||i instanceof a&&(isNaN(i.sign)||isNaN(i.layer)||isNaN(i.mag))))throw Ps.autosave=!1,ge.hasNaN=!0,ge.NaNPath=[...e[jt],t],ge.NaNReceiver=s,console.error("Attempted to set NaN value",[...e[jt],t],e[fe]),"Attempted to set NaN value. See above for details"}return e[fe][t]=n,!0},ownKeys(e){return Reflect.ownKeys(e[fe])},has(e,t){return Reflect.has(e[fe],t)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e[fe],t)}};var q=window.player=new Proxy({[fe]:Ps,[jt]:["player"]},Fs);function Ts(e={}){return Object.assign({id:`${ae.id}-0`,name:"Default Save",tabs:ae.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:ae.id,modVersion:ae.versionNumber,layers:{}},e)}function at(e){const t=Et.compressToUTF16(xs(e!=null?e:q[fe]));return localStorage.setItem((e!=null?e:q[fe]).id,t),t}async function Ta(){$a();try{let e=localStorage.getItem(pe.active);if(e==null){await Lt(Wt());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Et.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==ae.id){await Lt(Wt());return}t.id=pe.active,await Lt(t)}catch(e){console.error(`Failedtoloadsave.Fallingbacktonewsave.
margin:10px0;"/>${R}`:N,t.value=!0},onOpenLayer(){if(me.value=!1,window.matchMedia("(min-width:1468px)").matches)if(q.tabs.includes(k!=null?k:"trees")){const ue=q.tabs.lastIndexOf(k!=null?k:"trees");q.tabs.splice(ue,1)}else q.tabs.push(k!=null?k:"trees"),z.minimized.value=!0;else q.tabs.splice(1,1/0,k!=null?k:"trees")},onUnlockLayer(){le.value=!0,setTimeout(()=>{var ue,et;n.value=-1,s.value=o((et=(ue=Ue[k!=null?k:"trees"])==null?void 0:ue.name)!=null?et:""),i.value=N,q.devSpeed=null,t.value=!0},1e3)}}}}})}const r=[l(()=>({day:1,shouldNotify:!1,layer:"trees",symbol:Qs,story:"Ohno!SantaforgotaboutChristmasandit's only 25 days away! He'saskedforyourhelpduetoyourhistorygettinglargequantitiesofthingsinshortamountsoftime.Unfortunatelyyou're really starting from scratch here - let'sstartwithgettingwood,whichyou'll need for everything from building workshops to wrapping paper to many of the toys themselves!",completedStory:"Santa looks at all the wood you'vegatheredandtellsyouyou've done well! He says you should take the rest of the day off so you'rerefreshedfortomorrow's work. Good Job!"})),l(()=>({day:2,shouldNotify:!1,layer:"workshop",symbol:zs,story:"Santa looked over your tree farm and was impressed with how much you could accomplish in just one day. Today'sgoalistogetaworkshopbuiltupfortheelvestoworkin-andapparently,theyneedquitealotofspacetowork!",completedStory:"Theworkshopcomplete,Santaonceagaindismissesyoufortheday.Withastrongfoundation,thisworkshopshouldsufficeforsupportingfutureworktowardthisimpossiblemission.GoodJob!"})),l(()=>({day:3,shouldNotify:!1,layer:"coal",symbol:js,story:"Santatellsyouthatunfortunatelytherearequiteafewnaughtychildrenouttherethisyear,andhe'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'vegatheredandtellsyouyou've done well! He says you should take the rest of the day off so you'rerefreshedfortomorrow's work. Good Job!"})),l(()=>({day:4,shouldNotify:!1,layer:"elves",symbol:Ks,story:"Alright, it seems you finally have enough things set up to start bringing in the elves! Unfortunately, it seems they'llneedtoberetrainedonhowtohelp,sincethey'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!"})),l(()=>({day:5,shouldNotify:!1,layer:"paper",symbol:Ws,story:"With the elves trained, we'realmostreadytostartworkingonthesepresents!Justacouplemorepre-reqsfirst,startingwithturningallthiswoodintowoodpulpandfinallyintopaper,whichwillberequiredforwrappingpaperlateronbutinthemeantimecanbeusedtohelpwriteguideswhichwillhelptheseelvescontinuetheireducation!",completedStory:"Youlookuponyourriversofbookpulpasyouhandoutstacksofpaperstoelvestoreadthrough.You've continued getting closer and closer to preparing for Christmas, and can go to bed satisfied with your progress. Good Job!"})),l(()=>({day:6,shouldNotify:!1,layer:"boxes",symbol:Js,story:"You watch all these elves carrying incredibly large loads just in their open elf-sized hands, and realize there'sprobablyabetterway.Youneedtoputthetoysinboxesanyways,sowhydon'twegetstartedworkingonthosesotheworkerscantakeadvantageaswell?",completedStory:"Wow,thoseboxesarereallyconvenient!Theworkshopfeelsmoreandmoreproperwitheveryday.Youtickanotherrequirementonyourlistandstartlookingtowardstomorrow.GoodJob!"})),l(()=>({day:7,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:8,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:9,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:10,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:11,shouldNotify:!1,
${R}
${N}`)}}return m[A]}ht(n,A=>{A&&Object.keys(m).forEach(N=>delete m[N])});const _=S(()=>pe.saves.reduce((A,N)=>(A[N]=v(N),A),{}));function b(A){let N;switch(q.id===A?N=xs(q[fe]):N=JSON.stringify(_.value[A]),ae.exportEncoding){default:console.warn(`Unknownsaveencoding:${ae.exportEncoding}.Defaultingtolz`);case"lz":N=Et.compressToUTF16(N);break;case"base64":N=btoa(unescape(encodeURIComponent(N)));break;case"plain":break}const R=document.createElement("textarea");R.value=N,document.body.appendChild(R),R.select(),R.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(R)}function g(A){q.id===A&&at();const N={..._.value[A],id:bn()};at(N),pe.saves.push(N.id)}function w(A){pe.saves=pe.saves.filter(N=>N!==A),localStorage.removeItem(A),m[A]=void 0}function k(A){_.value[q.id].time=q.time,at(),m[q.id]=void 0,Lt(_.value[A]),m[A]=void 0}function P(A){if(r.value=A,Ht(()=>{r.value=null}),A[0]!=="{")if(A[0]==="e")A=decodeURIComponent(escape(atob(A)));else if(A[0]==="\u1BE1")A=Et.decompressFromUTF16(A);else{console.warn("Unable to determine preset encoding",A);return}const N=JSON.parse(A);N.id=bn(),at(N),pe.saves.push(N.id),k(N.id)}function le(A,N){const R=_.value[A];R&&(R.name=N,q.id===A?(q.name=N,at()):(at(R),m[A]=void 0))}return(A,N)=>(y(),G(rt,{modelValue:n.value,"onUpdate:modelValue":N[4]||(N[4]=R=>n.value=R),ref_key:"modal",ref:s},{header:U(()=>[Ir]),body:U(({shown:R})=>[R?(y(),G(o(vi),{key:0,list:o(pe).saves,handle:".handle",itemKey:me=>me},{item:U(({element:me})=>[u(Ar,{save:o(_)[me],onOpen:ue=>k(me),onExport:ue=>b(me),onEditName:ue=>le(me,ue),onDuplicate:ue=>g(me),onDelete:ue=>w(me)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):E("",!0)]),footer:U(()=>[f("div",Er,[u(Zs,{modelValue:l.value,"onUpdate:modelValue":N[0]||(N[0]=R=>l.value=R),title:"Import Save",placeholder:"Paste your save here!",class:ke({importingFailed:i.value})},null,8,["modelValue","class"]),f("div",Br,[Pr,f("div",xr,[f("button",{class:"button",onClick:N[1]||(N[1]=R=>k(o(Wt)().id))},"New Game"),Object.keys(o(d)).length>0?(y(),G(Wn,{key:0,options:o(d),modelValue:r.value,"onUpdate:modelValue":N[2]||(N[2]=R=>P(R)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):E("",!0)])]),f("div",Fr,[Tr,f("button",{class:"button modal-default-button",onClick:N[3]||(N[3]=R=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var ei=ne(Rr,[["__scopeId","data-v-3b9991aa"]]);const Ze=e=>(wt("data-v-4a3f8425"),e=e(),kt(),e),$r=["src","alt"],Dr={key:1,class:"title"},Or=Ze(()=>f("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),qr={class:"discord"},Ur={class:"discord-links"},Vr={key:0},Lr=["href"],Gr=Ze(()=>f("li",null,[f("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Hr=Ze(()=>f("li",null,[f("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Qr={href:"https://forums.moddingtree.com/",target:"_blank"},zr=Ze(()=>f("span",{class:"material-icons"},"forum",-1)),jr=Ze(()=>f("span",{class:"material-icons"},"info",-1)),Kr=Ze(()=>f("span",{class:"material-icons"},"library_books",-1)),Wr=Ze(()=>f("span",{class:"material-icons"},"settings",-1)),Jr=Ze(()=>f("span",{class:"material-icons"},"library_books",-1)),Xr=Ze(()=>f("span",{class:"material-icons"},"settings",-1)),Yr=Ze(()=>f("span",{class:"material-icons"},"info",-1)),Zr={href:"https://forums.moddingtree.com/",target:"_blank"},eu=Ze(()=>f("span",{class:"material-icons"},"forum",-1)),tu={class:"discord"},nu={class:"discord-links"},su={key:0},iu=["href"],au=Ze(()=>f("li",null,[f("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),lu=Ze(()=>f("li",null,[f("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),ou=L({__name:"Nav",setup(e){const t=O(null),n=O(null),s=O(null),i=O(null),{useHeader:l,banner:r,title:c,discordName:d,discordLink:m,versionNumber:v}=ae;function _(){window.open(m,"mywindow")}return(b,g)=>(y(),M(x,null,[o(l)?(y(),M("div",Qt({key:0,class
Learnmoreatwww.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await Ta();const{globalBus:e}=await wn(()=>Promise.resolve().then(function(){return va}),void 0),{startGameLoop:t}=await wn(()=>import("./gameLoop.bd89404d.js"),["assets/gameLoop.bd89404d.js","assets/@fontsource.f66d05e7.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"]),n=window.vue=fi(Gu);e.emit("setupVue",n),n.mount("#app"),Ht(()=>{const s=vs(),{updateServiceWorker:i}=Qu({onNeedRefresh(){s.info("New content available, click or reload to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){i()}})},onOfflineReady(){s.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(l){l&&setInterval(l.update,60*60*1e3)}})}),t()});export{a as D,wn as _,ge as a,ae as b,ro as c,Ce as g,q as p,pe as s};