Profectus-Demo/assets/index.2e12b347.js

18 lines
181 KiB
JavaScript
Raw Normal View History

/* empty css */import"./vue.d185782d.js";import{a2 as M,H as a,n as be,u as At,x as O,b3 as Be,ae as D,o as h,a4 as S,a5 as g,r as je,K as te,aG as di,A as Ne,b4 as Pe,ac as d,U,as as Cn,aC as Bt,av as Ze,aJ as Wt,F as le,c as q,w as x,b9 as an,bs as or,au as ze,bu as Pt,T as ln,Y as ar,ab as C,y as un,l as lr,bv as Je,aN as he,a3 as V,aP as re,O as X,M as ee,aK as Ge,aI as We,D as st,bn as ur,br as fi,aM as Ft,ap as en,L as cr,ay as dr,C as Zn,be as fr}from"./@vue.7184beb0.js";import{c as pi}from"./nanoevents.1080beb7.js";import{L as it}from"./lz-string.f2f3b7cf.js";import{_ as z,C as pr}from"./@ivanv.3bc3ebc4.js";import{Y as mr}from"./vue-next-select.f0e584b6.js";import{D as gr}from"./vuedraggable.4713c6fe.js";import{p as hr}from"./vue-textarea-autosize.35804eaf.js";import{s as vr,u as kn}from"./vue-toastification.768059b7.js";import{A as mi,T as br,R as yr,B as _r,u as wr,E as Jn}from"./@pixi.13a16b18.js";import{v as Nr,n as Cr}from"./workbox-window.8d14e8b7.js";import"./earcut.b6f90e68.js";import"./sortablejs.4c7e7419.js";import"./ismobilejs.5c6954b9.js";import"./eventemitter3.dc5195d7.js";import"./url.6dd57c6c.js";import"./querystring.776b9ab3.js";const kr=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerpolicy&&(s.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?s.credentials="include":r.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}};kr();const Sr="modulepreload",Xn={},$r="./",tn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${$r}${i}`,i in Xn)return;Xn[i]=!0;const r=i.endsWith(".css"),s=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${s}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":Sr,r||(o.as="script",o.crossOrigin=""),o.href=i,document.head.appendChild(o),r)return new Promise((u,c)=>{o.addEventListener("load",u),o.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},Mr="./projInfo-schema.json",Ir="Profectus Demo",Er="A demo project made in Profectus",Tr="profectus-demo",Pr="",Fr="",Vr="",Or="0.0",qr="Initial Commit",Dr=!0,Rr=!1,xr=2,Ar=!0,Br=null,Lr="Logo.png",jr=["main","c"],Ur=3600,zr=1,Hr=!0,Gr="base64";var ie={$schema:Mr,title:Ir,description:Er,id:Tr,author:Pr,discordName:Fr,discordLink:Vr,versionNumber:Or,versionTitle:qr,allowGoBack:Dr,defaultShowSmall:Rr,defaultDecimalsShown:xr,useHeader:Ar,banner:Br,logo:Lr,initialTabs:jr,maxTickLength:Ur,offlineLimit:zr,enablePausing:Hr,exportEncoding:Gr};class Wr{constructor(t){this.map=new Map,this.first=void 0,this.last=void 0,this.maxSize=t}get size(){return this.map.size}get(t){const n=this.map.get(t);if(n!==void 0)return n!==this.first&&(n===this.last?(this.last=n.prev,this.last.next=void 0):(n.prev.next=n.next,n.next.prev=n.prev),n.next=this.first,this.first.prev=n,this.first=n),n.value}set(t,n){if(this.maxSize<1)return;if(this.map.has(t))throw new Error("Cannot update existing keys in the cache");const i=new Yr(t,n);for(this.first===void 0?(this.first=i,this.last=i):(i.next=this.first,this.first.prev=i,this.first=i),this.map.set(t,i);this.map.size>this.maxSize;){const r=this.last;this.map.delete(r.key),this.last=r.prev,this.last.next=void 0}}}class Yr{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const mn=17,Kr=9e15,Zr=Math.log10(9e15),Jr=1/9e15,Xr=308,Qr=-324,Qn=5,es=(1<<10)-1,ts=function(){const e=[];for(let n=Qr+1;n<=Xr;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),ut=[2,Math.E,3,4,5,6,7,8,9,10],ns=[[1,1.0891180521811203,1.1789767925673957,1.27014554317
`,e),await pt(_t())}}function _t(){const e=Jt(),t=ki({id:e});return Fe(t),J.saves.push(e),t}function Jt(){let e,t=0;do e=`${ie.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const $n=O(!1);async function pt(e){console.info("Loading save",e),$n.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await tn(()=>Promise.resolve().then(function(){return Gs}),void 0),{fixOldSave:r,getInitialLayers:s}=await tn(()=>Promise.resolve().then(function(){return jd}),void 0);for(const o in t){const u=t[o];u&&n(u)}s(e).forEach(o=>i(o,e)),e=ki(e),e.offlineProd&&e.time!=null&&e.time&&e.devSpeed!==0&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=Math.min(e.offlineTime+(Date.now()-e.time)/1e3,ie.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ie.versionNumber&&(r(e.modVersion,e),e.modVersion=ie.versionNumber),Object.assign(R,e),J.active=R.id,ve.emit("onLoad")}setInterval(()=>{R.autosave&&Fe()},1e3);window.onbeforeunload=()=>{R.autosave&&Fe()};window.save=Fe;const ks=window.hardReset=async()=>{await pt(_t())};window.deleteLowerSaves=()=>{const e=Object.values(J.saves).indexOf(R.id)+1;Object.values(J.saves).slice(e).forEach(t=>localStorage.removeItem(t)),J.saves=J.saves.slice(0,e)};const qt=At({active:"",saves:[],showTPS:!0,theme:Sn.Nordic,unthrottled:!1,alignUnits:!1});Be(qt,e=>{const t=it.compressToUTF16(JSON.stringify(e));localStorage.setItem(ie.id,t)},{deep:!0});var J=window.settings=qt;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Sn.Nordic,alignUnits:!1};ve.emit("loadSettings",e),Object.assign(qt,e),ks()};function Ss(){try{let e=localStorage.getItem(ie.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=it.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(qt,t)}ve.emit("loadSettings",qt)}catch{}}const Si=At([]);function $i(e){Si.push(e)}const Mi=At([]);function $s(e){Mi.push(e)}const Ms=At([]),Is={class:"table"},Xt=D({__name:"Column",setup(e){const t=M(()=>Xe[J.theme].mergeAdjacent);return(n,i)=>(h(),S("div",Is,[g("div",{class:te(["col",{mergeAdjacent:a(t)}])},[je(n.$slots,"default")],2)]))}}),Es={class:"table"},Et=D({__name:"Row",setup(e){const t=M(()=>Xe[J.theme].mergeAdjacent);return(n,i)=>(h(),S("div",Es,[g("div",{class:te(["row",{mergeAdjacent:a(t)}])},[je(n.$slots,"default")],2)]))}});function Ii(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Cn(e)}function j(e,t="span"){return typeof e=="function"?D({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),D({template:e})):D({render:()=>({})}):e}function de(e){if(Ve(e))return typeof e=="function"?e():j(e);const t=e[ge];return d(t,e[ye](),null)}function xe(...e){let t;return d(Et,null,Ii(t=e.map(de))?t:{default:()=>[t]})}function Ts(...e){let t;return d(Xt,null,Ii(t=e.map(de))?t:{default:()=>[t]})}function Ke(e){if(Ve(e))return typeof e=="function"?e():typeof e=="string"?d(U,null,[e]):d(e,null,null);const t=e[ge];return d(t,e[ye](),null)}function ii(e,t){return e.reduce((n,i)=>d(U,null,[n,t,i]))}function Ve(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Ot]===!0}function Mn(e,t){const n=O(null),i=O(void 0);function r(u){n.value||(n.value=setInterval(o,250)),i.value=u}function s(){n.value&&(clearInterval(n.value),n.value=null)}function o(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return di(s),{start:r,stop:s,handleHolding:o}}function Nt(e,t="div"){const n=Ne();return Pe(()=>{n.value=j(ue(e),t)}),n}function Qe(e,t="div"){const n=Ne(null);return Pe(()=>{const i=ue(e);n.value=i==""||i==null?null:j(i,t)}),n}function ue(e){return a(a(e))}function N(...e){return e.includes(Object)||e.push(Object),e}const Ps=D({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var p;const n=O({}),i=new ResizeObserver(u),r=O(null);Bt(()=>{const v=r.value;v!=null&&i.observe(v)});let s=!0,o=O((p=r.value)==null?void 0:p.getBoundingClientR
`).slice(3,5).map(n=>n.trim()).join(`
`))!=null?t:""}function ri(e,t){var n;if(l.isNaN(t))throw _e.hasNaN||(R.autosave=!1,_e.hasNaN=!0,_e.NaNPath=e[mt],_e.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[mt])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[wt].value=t}function me(e,t=!0){const n=be(e)?e:O(e);be(e)&&(e=e.value);const i=M({get(){return n.value},set(s){t?ri(r,s):r[wt].value=s}});i[ot]=e;const r={get value(){return n.value},set value(s){t?ri(r,s):r[wt].value=s},__v_isRef:!0,[wt]:n,[ot]:e,[rn]:Ls(),[sn]:!1,[Dt]:i,[mt]:void 0};return Ee.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,`
Created at:
`+r[rn]):gt[Ee[Ee.length-1]].add(r),r}function js(e){return e!=null&&typeof e=="object"&&wt in e}function Mt(e){return e[Dt]}function Us(e){Ee.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):gt[Ee[Ee.length-1]].delete(e),e[sn]=!0}ve.on("addLayer",(e,t)=>{const n=[],i=(r,s=[])=>{let o=!1;return Object.keys(r).forEach(u=>{let c=r[u];if(c!=null&&typeof c=="object")if(dt in c&&(c=c[dt]),js(c)){if(o=!0,c[sn]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,`
Created at:
`+c[rn]);return}gt[e.id].delete(c);const f=[e.id,...s,u];c[mt]!=null&&JSON.stringify(f)!==JSON.stringify(c[mt])&&console.error(`Persistent ref is being saved to \`${f.join(".")}\` when it's already present at \`${c[mt].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[mt]=f;const p=s.reduce((w,k)=>(k in w||(w[k]={}),w[k]),t),v=p[u];p[u]=c[wt],lr(p)?v!=null?p[u]=v:p[u]=c[ot]:v!=null?p[u].value=v:p[u].value=c[ot]}else!(c instanceof l)&&!be(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...s,u])&&(Je(c)&&!Je(r)?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.",dt in r?r[dt]:r,u):o=!0))}),o};i(e[dt]),gt[e.id].forEach(r=>{r[sn]||console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,r,`
Created at:
`+r[rn])}),gt[e.id].clear()});const In=Symbol("RegisterNode"),En=Symbol("UnregisterNode"),Tn=Symbol("Nodes"),Pn=Symbol("Bounds"),$e=un({});window.layers=$e;const gt={},Ee=[];function Lt(e,t){return ce(()=>{const n={},i=n.emitter=pi();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=O({}),n.id=e,Ee.push(e),gt[e]=new Set,n.minimized=me(!1,!1),Object.assign(n,t.call(n)),Ee[Ee.length-1]==null||Ee[Ee.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
Stack: ${Ee}
Trying to pop ${n.id}`;Ee.pop(),_(n,"color"),_(n,"display"),_(n,"classes"),_(n,"style"),_(n,"name"),H(n,"name",n.id),_(n,"minWidth"),H(n,"minWidth",600),_(n,"minimizable"),H(n,"minimizable",!0),_(n,"minimizedDisplay");const r=n.style;return n.style=M(()=>{var o,u;let s=a(n.minWidth);return(typeof s=="number"||!Number.isNaN(parseInt(s)))&&(s=s+"px"),[(o=a(r))!=null?o:"",(u=n.minimized)!=null&&u.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:s,flexBasis:s,margin:""}]}),n})}function Ti(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}H(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),$e[e.id]=e,ve.emit("addLayer",e,t.layers[e.id])}function zs(e){return $e[e]}function Pi(e){console.info("Removing layer",e.id),ve.emit("removeLayer",e),$e[e.id]=void 0}function Hs(e){Pi(e),Ti(e,R)}function Fi(e){const t=O(!1);return{openModal:()=>t.value=!0,modal:L(()=>d(at,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>d("h2",null,[a(e.name)]),body:a(e.display)}))}}ve.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 Gs=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:In,UnregisterNodeInjectionKey:En,NodesInjectionKey:Tn,BoundsInjectionKey:Pn,layers:$e,persistentRefs:gt,addingLayers:Ee,createLayer:Lt,addLayer:Ti,getLayer:zs,removeLayer:Pi,reloadLayer:Hs,setupLayerModal:Fi},Symbol.toStringTag,{value:"Module"}));const Ws=D({components:{Context:Ei},props:{index:{type:Number,required:!0},display:{type:N(Object,String,Function),required:!0},minimizedDisplay:N(Object,String,Function),minimized:{type:Object,required:!0},name:{type:N(String),required:!0},color:N(String),minimizable:N(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=le(e),s=Nt(t),o=Qe(r),u=M(()=>ie.allowGoBack&&n.value>0&&!ue(i));function c(){R.tabs.splice(a(e.index),1/0)}function f(p){e.nodes.value=p}return{component:s,minimizedComponent:o,showGoBack:u,updateNodes:f,unref:a,goBack:c}}}),Ys={key:1};function Ks(e,t,n,i,r,s){const o=he("Context");return h(),S("div",{class:"layer-container",style:ee({"--layer-color":e.unref(e.color)})},[e.showGoBack?(h(),S("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...u)=>e.goBack&&e.goBack(...u))},"\u274C")):V("",!0),e.unref(e.minimized)?(h(),S("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=u=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(h(),q(re(e.minimizedComponent),{key:0})):(h(),S("div",Ys,X(e.unref(e.name)),1))])):(h(),S("div",{key:2,class:te(["layer-tab",{showGoBack:e.showGoBack}])},[d(o,{onUpdateNodes:e.updateNodes},{default:x(()=>[(h(),q(re(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(h(),S("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=u=>e.$emit("setMinimized",!0))}," \u25BC ")):V("",!0)],4)}var Zs=z(Ws,[["render",Ks],["__scopeId","data-v-a592996e"]]);const Vi=e=>(Ge("data-v-4b4bda40"),e=e(),We(),e),Js=Vi(()=>g("h2",null,"Changelog",-1)),Xs=Vi(()=>g("details",{open:""},[g("summary",null,[C("v0.0 Initial Commit - "),g("time",null,"2021-09-04")]),C(" This is the first release :D "),g("ul",null,[g("li",{class:"feature"},"Did everything"),g("li",{class:"fix"},"Had some fun"),g("li",{class:"breaking"},"Removed everything"),g("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Qs=D({__name:"Changelog",setup(e,{expose:t}){const n=O(!1);return t({open(){n.value=!0}}),(i,r)=>(h(),q(at,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=s=>n.value=s)},{header:x(()=>[Js]),body:x(()=>[Xs]),_:1},8,["modelValue"]))}});var eo=z(Qs,[["__scopeId","data-v-4b4bda40"]]),to=D({props:{element:Object,display:{type:N(Object,String,Function),required:!0},style:N(Object,String,Array),classes:N(Object),direction:N(
${K}
${F}`)}}return f[P]}Be(n,P=>{P&&Object.keys(f).forEach(F=>delete f[F])});const v=M(()=>J.saves.reduce((P,F)=>(P[F]=p(F),P),{}));function w(P){let F;switch(R.id===P?F=Ci(R):F=JSON.stringify(v.value[P]),ie.exportEncoding){default:console.warn(`Unknown save encoding: ${ie.exportEncoding}. Defaulting to lz`);case"lz":F=it.compressToUTF16(F);break;case"base64":F=btoa(unescape(encodeURIComponent(F)));break;case"plain":break}const K=document.createElement("textarea");K.value=F,document.body.appendChild(K),K.select(),K.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(K)}function k(P){R.id===P&&Fe();const F={...v.value[P],id:Jt()};Fe(F),J.saves.push(F.id)}function T(P){J.saves=J.saves.filter(F=>F!==P),localStorage.removeItem(P),f[P]=void 0}function E(P){v.value[R.id].time=R.time,Fe(),f[R.id]=void 0,pt(v.value[P]),f[P]=void 0}function Y(P){if(o.value=P,Ze(()=>{o.value=null}),P[0]!=="{")if(P[0]==="e")P=decodeURIComponent(escape(atob(P)));else if(P[0]==="\u1BE1")P=it.decompressFromUTF16(P);else{console.warn("Unable to determine preset encoding",P);return}const F=JSON.parse(P);F.id=Jt(),Fe(F),J.saves.push(F.id),E(F.id)}function se(P,F){const K=v.value[P];K!=null&&(K.name=F,R.id===P?(R.name=F,Fe()):(Fe(K),f[P]=void 0))}return(P,F)=>(h(),q(at,{modelValue:n.value,"onUpdate:modelValue":F[4]||(F[4]=K=>n.value=K),ref_key:"modal",ref:i},{header:x(()=>[ua]),body:x(({shown:K})=>[K?(h(),q(a(gr),{key:0,list:a(J).saves,handle:".handle",itemKey:ke=>ke},{item:x(({element:ke})=>[d(la,{save:a(v)[ke],onOpen:pe=>E(ke),onExport:pe=>w(ke),onEditName:pe=>se(ke,pe),onDuplicate:pe=>k(ke),onDelete:pe=>T(ke)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):V("",!0)]),footer:x(()=>[g("div",ca,[d(Vn,{modelValue:s.value,"onUpdate:modelValue":F[0]||(F[0]=K=>s.value=K),title:"Import Save",placeholder:"Paste your save here!",class:te({importingFailed:r.value})},null,8,["modelValue","class"]),g("div",da,[fa,g("div",pa,[g("button",{class:"button",onClick:F[1]||(F[1]=K=>E(a(_t)().id))},"New Game"),Object.keys(a(c)).length>0?(h(),q(Fn,{key:0,options:a(c),modelValue:o.value,"onUpdate:modelValue":F[2]||(F[2]=K=>Y(K)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):V("",!0)])]),g("div",ma,[ga,g("button",{class:"button modal-default-button",onClick:F[3]||(F[3]=K=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var qi=z(ha,[["__scopeId","data-v-5b5b1604"]]);const Oe=e=>(Ge("data-v-b0896196"),e=e(),We(),e),va=["src","alt"],ba={key:1,class:"title"},ya=Oe(()=>g("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),_a={class:"discord"},wa={class:"discord-links"},Na={key:0},Ca=["href"],ka=Oe(()=>g("li",null,[g("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Sa=Oe(()=>g("li",null,[g("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),$a={href:"https://forums.moddingtree.com/",target:"_blank"},Ma=Oe(()=>g("span",{class:"material-icons"},"forum",-1)),Ia=Oe(()=>g("span",{class:"material-icons"},"info",-1)),Ea=Oe(()=>g("span",{class:"material-icons"},"library_books",-1)),Ta=Oe(()=>g("span",{class:"material-icons"},"settings",-1)),Pa=Oe(()=>g("span",{class:"material-icons"},"library_books",-1)),Fa=Oe(()=>g("span",{class:"material-icons"},"settings",-1)),Va=Oe(()=>g("span",{class:"material-icons"},"info",-1)),Oa={href:"https://forums.moddingtree.com/",target:"_blank"},qa=Oe(()=>g("span",{class:"material-icons"},"forum",-1)),Da={class:"discord"},Ra={class:"discord-links"},xa={key:0},Aa=["href"],Ba=Oe(()=>g("li",null,[g("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),La=Oe(()=>g("li",null,[g("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),ja=D({__name:"Nav",setup(e){const t=O(null),n=O(null),i=O(null),r=O(null),{useHeader:s,banner:o,title:u,discordName:c,discordLink:f,versionNumber:p}=ie;function v(){window.open(f,"mywindow")}return(w,k)=>(h(),S(U,null,[a(s)?(h(),S("div",ze({key:0,class:"nav
Reward: The dinosaur is now your friend (you can max Farm Points).`,shouldEarn:function(){return l.gte(Le.points.value,1)},onComplete(){console.log("Bork bork bork!")}})),u=[r,s,o],c=Nl(()=>({rows:2,cols:2,getStartState(p){return p},getStyle(p,v){return{backgroundColor:`#${Number(v)*1234%999999}`}},getTitle(p){let v="";return p==="101"?v="top":p==="102"?v="bottom":p==="201"?v="left":p==="202"&&(v="right"),L(()=>d(ae,ze({display:JSON.stringify(this.cells[p].style)},{[v]:!0}),{default:()=>[d("h3",null,[C("Gridable #"),p])]}))},getDisplay(p,v){return String(v)},getCanClick(){return l.eq(ne.points.value,10)},onClick(p,v){this.cells[p].state=Number(v)+1}})),f=L(()=>{let p,v,w;return d(U,null,[d(Et,null,{default:()=>[d(ae,{display:r.tooltip,bottom:!0},_n(p=de(r))?p:{default:()=>[p]}),d(ae,{display:s.tooltip,bottom:!0},_n(v=de(s))?v:{default:()=>[v]}),d(ae,{display:o.tooltip,bottom:!0},_n(w=de(o))?w:{default:()=>[w]})]}),xe(c)])});return{id:ci,color:e,name:t,points:n,achievements:u,grid:c,treeNode:i,display:f}}),ne=Lt("main",function(){const e=Rt(10),t=Ri(e),n=Ja(e),i=M(()=>{if(!Ae.generatorUpgrade.bought.value)return new l(0);let c=new l(3.19);return Ae.lollipopMultiplierUpgrade.bought.value&&(c=c.times(Ae.lollipopMultiplierEffect.value)),c});ve.on("update",c=>{e.value=l.add(e.value,l.times(i.value,c))});const r=el(e,i),{openModal:s,modal:o}=Fi(Nn),u=Ai(()=>({nodes:[[Ae.treeNode],[Le.treeNode,Ae.spook]],leftSideNodes:[Nn.treeNode,Ae.h],branches:[{startNode:Le.treeNode,endNode:Ae.treeNode,stroke:"blue","stroke-width":"25px",style:{filter:"blur(5px)"}}],onReset(){e.value=Zn(this.resettingNode.value)===Zn(Ae.treeNode)?0:10,t.value=e.value,n.value=e.value},resetPropagation:Ol}));return{name:"Tree",display:L(()=>d(U,null,[R.devSpeed===0?d("div",null,[C("Game Paused")]):null,R.devSpeed!=null&&R.devSpeed!=0&&R.devSpeed!==1?d("div",null,[C("Dev Speed: "),Ce(R.devSpeed),C("x")]):null,R.offlineTime!=null&&R.offlineTime!=0?d("div",null,[C("Offline Time: "),cn(R.offlineTime)]):null,d("div",null,[l.lt(e.value,"1e1000")?d("span",null,[C("You have ")]):null,d("h2",null,[Ce(e.value)]),l.lt(e.value,"1e1e6")?d("span",null,[C(" points")]):null]),l.gt(i.value,0)?d("div",null,[C("("),r.value,C(")")]):null,d(Ie,null,null),d("button",{onClick:s},[C("open achievements")]),de(o),de(u),d(Za,{height:"200px",style:"margin: 10px auto; display: block"},null)])),points:e,best:t,total:n,oomps:r,tree:u,showAchievements:s}}),Bd=e=>[ne,Le,Ae,Nn],An=M(()=>l.gt(ne.points.value,25));function Ld(e,t){}var jd=Object.freeze(Object.defineProperty({__proto__:null,main:ne,getInitialLayers:Bd,hasWon:An,fixOldSave:Ld},Symbol.toStringTag,{value:"Module"}));const jt=e=>(Ge("data-v-4a50ce42"),e=e(),We(),e),Ud={class:"game-over-modal-header"},zd=["src","alt"],Hd={class:"game-over-modal-title"},Gd=jt(()=>g("h2",null,"Congratulations!",-1)),Wd={key:0},Yd=jt(()=>g("br",null,null,-1)),Kd=jt(()=>g("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Zd=jt(()=>g("br",null,null,-1)),Jd=["href"],Xd=jt(()=>g("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Qd=D({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:s,versionTitle:o}=ie,u=M(()=>cn(R.timePlayed)),c=M(()=>An.value&&!R.keepGoing),f=st(R,"autosave");function p(){R.keepGoing=!0}function v(){pt(_t())}return(w,k)=>(h(),q(at,{"model-value":a(c)},{header:x(()=>[g("div",Ud,[a(n)?(h(),S("img",{key:0,class:"game-over-modal-logo",src:a(n),alt:a(t)},null,8,zd)):V("",!0),g("div",Hd,[Gd,g("h4",null,"You've beaten "+X(a(t))+" v"+X(a(s))+": "+X(a(o)),1)])])]),body:x(({shown:T})=>[T?(h(),S("div",Wd,[g("div",null,"It took you "+X(a(u))+" to beat the game.",1),Yd,Kd,Zd,g("div",null,[g("a",{href:a(r),class:"game-over-modal-discord-link"},[Xd,C(" "+X(a(i)),1)],8,Jd)]),d(Te,{title:"Autosave",modelValue:a(f),"onUpdate:modelValue":k[0]||(k[0]=E=>be(f)?f.value=E:null)},null,8,["modelValue"])])):V("",!0)]),footer:x(()=>[g("div",{class:"game-over-footer"},[g("button",{onClick:p,class:"button"},"Keep Going"),g("button",{onClick:v,class:
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 Cs();const{globalBus:e}=await tn(()=>Promise.resolve().then(function(){return ws}),void 0),{startGameLoop:t}=await tn(()=>import("./gameLoop.98fb07e1.js"),["assets/gameLoop.98fb07e1.js","assets/@fontsource.f66d05e7.css","assets/vue.d185782d.js","assets/earcut.b6f90e68.js","assets/@vue.7184beb0.js","assets/nanoevents.1080beb7.js","assets/lz-string.f2f3b7cf.js","assets/@ivanv.3bc3ebc4.js","assets/vue-next-select.f0e584b6.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.4713c6fe.js","assets/sortablejs.4c7e7419.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-toastification.768059b7.js","assets/vue-toastification.4b5f8ac8.css","assets/@pixi.13a16b18.js","assets/ismobilejs.5c6954b9.js","assets/eventemitter3.dc5195d7.js","assets/url.6dd57c6c.js","assets/querystring.776b9ab3.js","assets/workbox-window.8d14e8b7.js"]),n=window.vue=fr(hf);e.emit("setupVue",n),n.mount("#app"),Ze(()=>{const i=kn(),{updateServiceWorker:r}=bf({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(){r()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(s){s&&setInterval(()=>s.update(),60*60*1e3)}})}),t()});export{l as D,tn as _,_e as a,ie as b,jd as c,ve as g,$n as l,R as p,J as s};