/* empty css */import"./vue.f6263579.js";import{Zasx,qasst,Casu,tasw,b1asfe,aaasU,aEash,a0asB,a1asc,aKas_e,Gasae,wasye,b2asSt,a8aso,OasY,ayasMt,arasqe,aGasot,Aasbe,_asO,b6asR,b8askt,bsas_a,aqastt,buasat,bbasta,TasQa,a7asv,uasTt,jasSa,lasCe,bvasBt,aLasMa,$asM,aNasce,JasF,IasXe,aHasQe,aFasSe,zasze,braska,aJasTa,alasUt,aCasDa,auasRa,bcaslt,aoasVa,bnasPa,beasxa}from"./@vue.4ce677c2.js";import{casaa}from"./nanoevents.1080beb7.js";import{LasIe}from"./lz-string.f2f3b7cf.js";import{Dasqa}from"./vuedraggable.c3acdf62.js";import{Yasza}from"./vue-next-select.0dc4e443.js";import{pasFa}from"./vue-textarea-autosize.35804eaf.js";import{sasGa}from"./semver.83ff78cf.js";import{lasOa}from"./socket.io-client.79ce0df5.js";import{uasna,sasUa}from"./vue-toastification.b7cd620e.js";import{Aasia,TasLa,RasJa,BasYa,uasWa,EasLt}from"./@pixi.1eac1889.js";import{vasXa,nasKa}from"./workbox-window.8d14e8b7.js";import"./earcut.b6f90e68.js";import"./sortablejs.cbae5b2d.js";import"./lru-cache.9a21e90b.js";import"./yallist.fd762fe7.js";import"./engine.io-client.58517560.js";import"./engine.io-parser.3f360695.js";import"./@socket.io.aec831e2.js";import"./socket.io-parser.544e37d1.js";import"./ismobilejs.5c6954b9.js";import"./eventemitter3.dc5195d7.js";import"./url.e51cb87b.js";import"./querystring.23ae9a54.js";constja=function(){constt=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(constiofdocument.querySelectorAll('link[rel="modulepreload"]'))n(i);newMutationObserver(i=>{for(constsofi)if(s.type==="childList")for(constrofs.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});functiona(i){consts={};returni.integrity&&(s.integrity=i.integrity),i.referrerpolicy&&(s.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?s.credentials="include":i.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}functionn(i){if(i.ep)return;i.ep=!0;consts=a(i);fetch(i.href,s)}};ja();constHa="modulepreload",Jt={},Za="./",gt=function(t,a){return!a||a.length===0?t():Promise.all(a.map(n=>{if(n=`${Za}${n}`,ninJt)return;Jt[n]=!0;consti=n.endsWith(".css"),s=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${s}`))return;constr=document.createElement("link");if(r.rel=i?"stylesheet":Ha,i||(r.as="script",r.crossOrigin=""),r.href=n,document.head.appendChild(r),i)returnnewPromise((l,g)=>{r.addEventListener("load",l),r.addEventListener("error",()=>g(newError(`Unable to preload CSS for ${n}`)))})})).then(()=>t())},$a="./projInfo-schema.json",en="Super Auto Coots",tn="A project made in Profectus",an="superautocoots",nn="thepaperpilot and crea",sn="",rn="",on="0.0.0",ln="Initial Commit",An=!1,un=!1,cn=2,dn=!0,gn=null,mn="",fn=["main"],hn=3600,vn=1,pn=!0,yn="base64";varG={$schema:$a,title:en,description:tn,id:an,author:nn,discordName:sn,discordLink:rn,versionNumber:on,versionTitle:ln,allowGoBack:An,defaultShowSmall:un,defaultDecimalsShown:cn,useHeader:dn,banner:gn,logo:mn,initialTabs:fn,maxTickLength:hn,offlineLimit:vn,enablePausing:pn,exportEncoding:yn};classbn{constructor(t){this.map=newMap,this.first=void0,this.last=void0,this.maxSize=t}getsize(){returnthis.map.size}get(t){consta=this.map.get(t);if(a!==void0)returna!==this.first&&(a===this.last?(this.last=a.prev,this.last.next=void0):(a.prev.next=a.next,a.next.prev=a.prev),a.next=this.first,this.first.prev=a,this.first=a),a.value}set(t,a){if(this.maxSize<1)return;if(this.map.has(t))thrownewError("Cannot update existing keys in the cache");constn=newCn(t,a);for(this.first===void0?(this.first=n,this.last=n):(n.next=this.first,this.first.prev=n,this.first=n),this.map.set(t,n);this.map.size>this.maxSize;){consti=this.last;this.map.delete(i.key),this.last=i.prev,this.last.next=void0}}}classCn{constructor(t,a){this.next=void0,this.prev=void0,this.key=t,this.value=a}}constCt=17,Nn=9e15,Bn=Math.l
`))!=null?t:""}function Ht(e,t){var a;if(E.isNaN(t))throw Z.hasNaN||(V.autosave=!1,Z.hasNaN=!0,Z.NaNPath=e[Pe],Z.NaNPersistent=e),console.error("Attempted to save NaN value to",(a=e[Pe])==null?void 0:a.join("."),e),"Attempted to set NaN value. See above for details";e[yt].value=t}function yi(e){const t=Ce(e)?e:w(e);Ce(e)&&(e=e.value);const a=x({get(){return t.value},set(i){Ht(n,i)}});a[Ke]=e;const n={get value(){return t.value},set value(i){Ht(n,i)},__v_isRef:!0,[yt]:t,[Ke]:e,[ht]:pi(),[wt]:!1,[It]:a,[Pe]:void 0};return ue.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",n,`
Createdat:
`+n[ht]):Ye[ue[ue.length-1]].add(n),n}function bi(e){return e!=null&&typeof e=="object"&&yt in e}$.on("addLayer",(e,t)=>{const a=[],n=(i,s=[])=>{let r=!1;return Object.keys(i).forEach(l=>{let g=i[l];if(g!=null&&typeof g=="object")if(Re in g&&(g=g[Re]),bi(g)){if(r=!0,g[wt]){console.warn("Deleted persistent ref present in returned object. Ignoring...",g,`
Createdat:
`+g[ht]);return}Ye[e.id].delete(g);const f=[e.id,...s,l];g[Pe]!=null&&JSON.stringify(f)!==JSON.stringify(g[Pe])&&console.error(`Persistentrefisbeingsavedto\`${f.join(".")}\` when it's already present at \`${g[Pe].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,g),g[Pe]=f;consty=s.reduce((C,N)=>(NinC||(C[N]={}),C[N]),t),p=y[l];y[l]=g[yt],Sa(y)?p!=null?y[l]=p:y[l]=g[Ke]:p!=null?y[l].value=p:y[l].value=g[Ke]}else!(ginstanceofE)&&!Ce(g)&&!a.includes(g)&&(typeofg.type=="symbol"&&a.push(g),n(g,[...s,l])&&(Bt(g)&&!Bt(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.",Reini?i[Re]:i,l):r=!0))}),r};n(e[Re]),Ye[e.id].forEach(i=>{i[wt]||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,`
Tryingtopop${a.id}`;ue.pop(),pe(a,"color"),pe(a,"display"),pe(a,"classes"),pe(a,"style"),pe(a,"name"),et(a,"name",a.id),pe(a,"minWidth"),et(a,"minWidth",600),pe(a,"minimizable"),et(a,"minimizable",!0),pe(a,"minimizedDisplay");const i=a.style;return a.style=x(()=>{var r,l;let s=u(a.minWidth);return(typeof s=="number"||!Number.isNaN(parseInt(s)))&&(s=s+"px"),[(r=u(i))!=null?r:"",(l=a.minimized)!=null&&l.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:s,flexBasis:s,margin:""}]}),a})}function Ca(e,t){if(console.info("Adding layer",e.id),ee[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ee[e.id]);return}et(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ee[e.id]=e,$.emit("addLayer",e,t.layers[e.id])}function Ci(e){return ee[e]}function Na(e){console.info("Removing layer",e.id),$.emit("removeLayer",e),ee[e.id]=void 0}function Ni(e){Na(e),Ca(e,V)}function Bi(e){const t=w(!1);return{openModal:()=>t.value=!0,modal:J(()=>o(Fe,{modelValue:t.value,"onUpdate:modelValue":a=>t.value=a},{header:()=>o("h2",null,[u(e.name)]),body:u(e.display)}))}}$.on("update",function(t){Object.values(ee).forEach(a=>{a==null||a.emit("preUpdate",t)}),Object.values(ee).forEach(a=>{a==null||a.emit("update",t)}),Object.values(ee).forEach(a=>{a==null||a.emit("postUpdate",t)})});var Ei=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:qt,UnregisterNodeInjectionKey:zt,NodesInjectionKey:pa,BoundsInjectionKey:ya,layers:ee,persistentRefs:Ye,addingLayers:ue,createLayer:ba,addLayer:Ca,getLayer:Ci,removeLayer:Na,reloadLayer:Ni,setupLayerModal:Bi},Symbol.toStringTag,{value:"Module"}));const wi=U({components:{Context:va},props:{index:{type:Number,required:!0},display:{type:ne(Object,String,Function),required:!0},minimizedDisplay:ne(Object,String,Function),minimized:{type:Object,required:!0},name:{type:ne(String),required:!0},color:ne(String),minimizable:ne(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:a,minimized:n,minimizedDisplay:i}=be(e),s=oi(t),r=pt(i),l=x(()=>G.allowGoBack&&a.value>0&&!xe(n));function g(){V.tabs.splice(u(e.index),1/0)}function f(y){e.nodes.value=y}return{component:s,minimizedComponent:r,showGoBack:l,updateNodes:f,unref:u,goBack:g}}}),Ii={key:1};function _i(e,t,a,n,i,s){const r=Ma("Context");return h(),B("div",{class:"layer-container",style:Xe({"--layer-color":e.unref(e.color)})},[e.showGoBack?(h(),B("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...l)=>e.goBack&&e.goBack(...l))},"\u274C")):M("",!0),e.unref(e.minimized)?(h(),B("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=l=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(h(),O(ce(e.minimizedComponent),{key:0})):(h(),B("div",Ii,F(e.unref(e.name)),1))])):(h(),B("div",{key:2,class:ae(["layer-tab",{showGoBack:e.showGoBack}])},[o(r,{onUpdateNodes:e.updateNodes},{default:R(()=>[(h(),O(ce(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(h(),B("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=l=>e.$emit("setMinimized",!0))}," \u25BC ")):M("",!0)],4)}var Qi=K(wi,[["render",_i],["__scopeId","data-v-a592996e"]]);const Ba=e=>(Qe("data-v-4b4bda40"),e=e(),Se(),e),Si=Ba(()=>c("h2",null,"Changelog",-1)),Mi=Ba(()=>c("details",{open:""},[c("summary",null,[v("v0.0 Initial Commit - "),c("time",null,"2021-09-04")]),v(" This is the first release :D "),c("ul",null,[c("li",{class:"feature"},"Did everything"),c("li",{class:"fix"},"Had some fun"),c("li",{class:"breaking"},"Removed everything"),c("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),ki=U({__name:"Changelog",setup(e,{expose:t}){const a=w(!1);return t({open(){a.value=!0}}),(n,i)=>(h(),O(Fe,{modelValue:a.value,"onUpdate:modelValue":i[0]||(i[0]=s=>a.value=s)},{header:R(()=>[Si]),body:R(()=>[Mi]),_:1},8,["modelValue"]))}});var Ti=K(ki,[["__scopeId","data-v-4b4bda40"]]),Di=U({props:{element:Object,display:{type:ne(Object,String,Function),required:!0},style:ne(Object,String,Array),classes:ne(Obje
${I}`)}}return f[b]}fe(a,b=>{b&&Object.keys(f).forEach(I=>delete f[I])});const p=x(()=>z.saves.reduce((b,I)=>(b[I]=y(I),b),{}));function C(b){let I;switch(V.id===b?I=ga(V):I=JSON.stringify(p.value[b]),G.exportEncoding){default:console.warn(`Unknownsaveencoding:${G.exportEncoding}.Defaultingtolz`);case"lz":I=Ie.compressToUTF16(I);break;case"base64":I=btoa(unescape(encodeURIComponent(I)));break;case"plain":break}const P=document.createElement("textarea");P.value=I,document.body.appendChild(P),P.select(),P.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(P)}function N(b){V.id===b&&re();const I={...p.value[b],id:ct()};re(I),z.saves.push(I.id)}function _(b){z.saves=z.saves.filter(I=>I!==b),localStorage.removeItem(b),f[b]=void 0}function Q(b){p.value[V.id].time=V.time,re(),f[V.id]=void 0,Ve(p.value[b]),f[b]=void 0}function S(b){if(r.value=b,qe(()=>{r.value=null}),b[0]!=="{")if(b[0]==="e")b=decodeURIComponent(escape(atob(b)));else if(b[0]==="\u1BE1")b=Ie.decompressFromUTF16(b);else{console.warn("Unable to determine preset encoding",b);return}const I=JSON.parse(b);I.id=ct(),re(I),z.saves.push(I.id),Q(I.id)}function H(b,I){const P=p.value[b];P!=null&&(P.name=I,V.id===b?(V.name=I,re()):(re(P),f[b]=void 0))}return(b,I)=>(h(),O(Fe,{modelValue:a.value,"onUpdate:modelValue":I[4]||(I[4]=P=>a.value=P),ref_key:"modal",ref:n},{header:R(()=>[Vs]),body:R(({shown:P})=>[P?(h(),O(u(qa),{key:0,list:u(z).saves,handle:".handle",itemKey:te=>te},{item:R(({element:te})=>[o(Rs,{save:u(p)[te],onOpen:ge=>Q(te),onExport:ge=>C(te),onEditName:ge=>H(te,ge),onDuplicate:ge=>N(te),onDelete:ge=>_(te)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):M("",!0)]),footer:R(()=>[c("div",Ps,[o(Ft,{modelValue:s.value,"onUpdate:modelValue":I[0]||(I[0]=P=>s.value=P),title:"Import Save",placeholder:"Paste your save here!",class:ae({importingFailed:i.value})},null,8,["modelValue","class"]),c("div",xs,[qs,c("div",zs,[c("button",{class:"button",onClick:I[1]||(I[1]=P=>Q(u(Le)().id))},"New Game"),Object.keys(u(g)).length>0?(h(),O(as,{key:0,options:u(g),modelValue:r.value,"onUpdate:modelValue":I[2]||(I[2]=P=>S(P)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):M("",!0)])]),c("div",Fs,[Gs,c("button",{class:"button modal-default-button",onClick:I[3]||(I[3]=P=>a.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Ea=K(Os,[["__scopeId","data-v-5b5b1604"]]);const de=e=>(Qe("data-v-269f7a94"),e=e(),Se(),e),Us=["src","alt"],Ls={key:1,class:"title"},Js=de(()=>c("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Ys={class:"discord"},Ws={class:"discord-links"},Xs={key:0},Ks=["href"],js=de(()=>c("li",null,[c("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Hs=de(()=>c("li",null,[c("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Zs={href:"https://forums.moddingtree.com/",target:"_blank"},$s=de(()=>c("span",{class:"material-icons"},"forum",-1)),er=de(()=>c("span",{class:"material-icons"},"info",-1)),tr=de(()=>c("span",{class:"material-icons"},"settings",-1)),ar=de(()=>c("span",{class:"material-icons"},"settings",-1)),nr=de(()=>c("span",{class:"material-icons"},"info",-1)),ir={href:"https://forums.moddingtree.com/",target:"_blank"},sr=de(()=>c("span",{class:"material-icons"},"forum",-1)),rr={class:"discord"},or={class:"discord-links"},lr={key:0},Ar=["href"],ur=de(()=>c("li",null,[c("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),cr=de(()=>c("li",null,[c("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),dr=U({__name:"Nav",setup(e){const t=w(null),a=w(null),n=w(null),i=w(null),{useHeader:s,banner:r,title:l,discordName:g,discordLink:f,versionNumber:y}=G;function p(){window.open(f,"mywindow")}return(C,N)=>(h(),B(Y,null,[u(s)?(h(),B("div",tt({key:0,class:"nav"},C.$attrs),[u(r)?(h(),B("img",{key:0,src:u(r),class:"banner",alt:u(l)},null,8,Us)):(h(),B("div",Ls,F(u(l)),1)),c("div",{onClick:N[0]|
Learnmoreatwww.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await Zn();const{globalBus:e}=await gt(()=>Promise.resolve().then(function(){return jn}),void 0),{startGameLoop:t}=await gt(()=>import("./gameLoop.c8b27b43.js"),["assets/gameLoop.c8b27b43.js","assets/@fontsource.f66d05e7.css","assets/vue.f6263579.js","assets/earcut.b6f90e68.js","assets/@vue.4ce677c2.js","assets/nanoevents.1080beb7.js","assets/lz-string.f2f3b7cf.js","assets/vuedraggable.c3acdf62.js","assets/sortablejs.cbae5b2d.js","assets/vue-next-select.0dc4e443.js","assets/vue-next-select.9e6f4164.css","assets/vue-textarea-autosize.35804eaf.js","assets/semver.83ff78cf.js","assets/lru-cache.9a21e90b.js","assets/yallist.fd762fe7.js","assets/socket.io-client.79ce0df5.js","assets/engine.io-client.58517560.js","assets/engine.io-parser.3f360695.js","assets/@socket.io.aec831e2.js","assets/socket.io-parser.544e37d1.js","assets/vue-toastification.b7cd620e.js","assets/vue-toastification.4b5f8ac8.css","assets/@pixi.1eac1889.js","assets/ismobilejs.5c6954b9.js","assets/eventemitter3.dc5195d7.js","assets/url.e51cb87b.js","assets/querystring.23ae9a54.js","assets/workbox-window.8d14e8b7.js"]),a=window.vue=xa(sl);e.emit("setupVue",a),a.mount("#app"),qe(()=>{const n=na(),{updateServiceWorker:i}=ol({onNeedRefresh(){n.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(){i()}})},onOfflineReady(){n.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(s){s&&setInterval(()=>s.update(),60*60*1e3)}})}),t()});export{E as D,gt as _,Z as a,G as b,Ro as c,$ as g,$n as l,V as p,z as s};