22 lines
242 KiB
JavaScript
22 lines
242 KiB
JavaScript
|
/* empty css */import"./vue.c16a309b.js";import{q as on,C as s,ab as Z,t as G,aF as S,a1 as P,aL as qt,bv as Dn,G as Ne,as as Yt,_ as w,az as Kn,a2 as N,J as ee,O as ne,aK as Dt,a0 as B,I as Le,a8 as y,a9 as d,b7 as H,aI as un,aG as cn,l as Ve,u as Br,b2 as wt,aD as ki,w as _t,b3 as Pt,ap as oa,aH as sr,A as Pe,$ as re,b9 as Lr,ar as Vt,bt as la,bc as Un,T as ua,j as ca,bw as Bt,ay as da,aM as Ct,aO as Je,z as Zt,bo as pa,bs as fa,bd as li,am as dr,H as ga,bx as ma,bf as va}from"./@vue.6b211d3c.js";import{L as Wt}from"./lz-string.dccec454.js";import{c as Si}from"./nanoevents.1080beb7.js";import{Y as ha}from"./vue-next-select.ded54c4a.js";import{D as ba}from"./vuedraggable.1879de79.js";import{p as ya}from"./vue-textarea-autosize.35804eaf.js";import{P as wa}from"./vue-panzoom.8ce6f9b1.js";import{s as _a,u as hr}from"./vue-toastification.9c2dad53.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";const Na=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerpolicy&&(a.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?a.credentials="include":i.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}};Na();const Ca="modulepreload",ui={},ka="./",Wn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(r=>{if(r=`${ka}${r}`,r in ui)return;ui[r]=!0;const i=r.endsWith(".css"),a=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${a}`))return;const u=document.createElement("link");if(u.rel=i?"stylesheet":Ca,i||(u.as="script",u.crossOrigin=""),u.href=r,document.head.appendChild(u),i)return new Promise((l,c)=>{u.addEventListener("load",l),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t())},Sa="./projInfo-schema.json",Ma="Planar Pioneers",Ia="A game about controlling and exploiting planes!",xa="planar-pioneers",$a="thepaperpilot",Da="",Ta="",Pa="0.0",Aa="Initial Commit",Ra=!1,Ea=!1,Fa=2,Oa=!0,qa=null,Va="",Ba=["main"],La=3600,ja=0,za=!0,Ga="base64";var ve={$schema:Sa,title:Ma,description:Ia,id:xa,author:$a,discordName:Da,discordLink:Ta,versionNumber:Pa,versionTitle:Aa,allowGoBack:Ra,defaultShowSmall:Ea,defaultDecimalsShown:Fa,useHeader:Oa,banner:qa,logo:Va,initialTabs:Ba,maxTickLength:La,offlineLimit:ja,enablePausing:za,exportEncoding:Ga};const Ua=on({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var Y=window.player=Ua;function jr(e){return JSON.stringify(e,(t,n)=>s(n))}var be=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n};const Wa=["onClick"],Ha=Z({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=G(!1),r=G(null);function i(){t("click"),r.value&&clearTimeout(r.value),n.value=!1,Yt(()=>{n.value=!0,r.value=setTimeout(()=>n.value=!1,500)})}return(a,u)=>(S(),P("button",{onClick:Dn(i,["stop"]),class:Ne(["feedback",{activated:n.value,left:e.left}])},[qt(a.$slots,"default",{},void 0,!0)],10,Wa))}});var zr=be(Ha,[["__scopeId","data-v-01a1b95c"]]);const br=e=>(un("data-v-ac351c02"),e=e(),cn(),e),Ya={class:"error"},Za={class:"error-title"},Xa={class:"error-details",style:{"margin-top":"-10px"}},Ja={key:0},Ka={class:"instructions"},Qa=["href"],es=br(()=>N("span",{class:"material-icons",style:{"font-size":"16px"}},"content_paste",-1)),ts=br(()=>N("span",{style:{"margin-left":"8px","font-size":"medium"}},"Copy Save",-1)),ns=br(()=>N("br",null,null,-1)),
|
||
|
`))),i=w(()=>t.errors.map(u=>u.cause==null?[]:(typeof u.cause=="string"?u.cause:JSON.stringify(u.cause)).split(`
|
||
|
`)));function a(){let u=jr(Y);switch(ve.exportEncoding){default:console.warn(`Unknown save encoding: ${ve.exportEncoding}. Defaulting to lz`);case"lz":u=Wt.compressToUTF16(u);break;case"base64":u=btoa(unescape(encodeURIComponent(u)));break;case"plain":break}console.log(u);const l=document.createElement("textarea");l.value=u,document.body.appendChild(l),l.select(),l.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(l)}return Kn(()=>{Y.autosave=!1,Y.devSpeed=0}),(u,l)=>(S(),P("div",Ya,[N("h1",Za,ee(s(n).name)+": "+ee(s(n).message),1),N("div",Xa,[s(n).cause?(S(),P("div",Ja,[(S(!0),P(ne,null,Dt(s(i)[0],c=>(S(),P("div",{key:c},ee(c),1))),128))])):B("",!0),s(n).stack?(S(),P("div",{key:1,style:Le(s(n).cause?"margin-top: 10px":"")},[(S(!0),P(ne,null,Dt(s(r)[0],c=>(S(),P("div",{key:c},ee(c),1))),128))],4)):B("",!0)]),N("div",Ka,[y(" Check the console for more details, and consider sharing it with the developers on "),N("a",{href:s(ve).discordLink||"https://discord.gg/yJ4fjnjU54",class:"discord-link"},"discord",8,Qa),y("! "),d(zr,{onClick:a,class:"button",style:{display:"inline-flex"}},{default:H(()=>[es,ts]),_:1}),ns,e.errors.length>1?(S(),P("div",rs,as)):B("",!0),(S(!0),P(ne,null,Dt(e.errors.slice(1),(c,p)=>(S(),P("div",{key:p,style:{"margin-top":"20px"}},[N("details",ss,[N("summary",null,ee(c.name)+": "+ee(c.message),1),c.cause?(S(),P("div",os,[(S(!0),P(ne,null,Dt(s(i)[p+1],h=>(S(),P("div",{key:h},ee(h),1))),128))])):B("",!0),c.stack?(S(),P("div",ls,[(S(!0),P(ne,null,Dt(s(r)[p+1],h=>(S(),P("div",{key:h},ee(h),1))),128))])):B("",!0)])]))),128))])]))}});var Mi=be(us,[["__scopeId","data-v-ac351c02"]]);class cs{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 r=new ds(t,n);for(this.first===void 0?(this.first=r,this.last=r):(r.next=this.first,this.first.prev=r,this.first=r),this.map.set(t,r);this.map.size>this.maxSize;){const i=this.last;this.map.delete(i.key),this.last=i.prev,this.last.next=void 0}}}class ds{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Tr=17,ps=9e15,fs=Math.log10(9e15),gs=1/9e15,ms=308,vs=-324,ci=5,hs=(1<<10)-1,bs=function(){const e=[];for(let n=vs+1;n<=ms;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),fn=[2,Math.E,3,4,5,6,7,8,9,10],ys=[[1,1.0891180521811203,1.1789767925673957,1.2701455431742086,1.3632090180450092,1.4587818160364217,1.5575237916251419,1.6601571006859253,1.767485818836978,1.8804192098842727,2],[1,1.1121114330934079,1.231038924931609,1.3583836963111375,1.4960519303993531,1.6463542337511945,1.8121385357018724,1.996971324618307,2.2053895545527546,2.4432574483385254,Math.E],[1,1.1187738849693603,1.2464963939368214,1.38527004705667,1.5376664685821402,1.7068895236551784,1.897001227148399,2.1132403089001035,2.362480153784171,2.6539010333870774,3],[1,1.1367350847096405,1.2889510672956703,1.4606478703324786,1.6570295196661111,1.8850062585672889,2.1539465047453485,2.476829779693097,2.872061932789197,3.3664204535587183,4],[1,1.1494592900767588,1.319708228183931,1.5166291280087583,1.748171114438024,2.0253263297298045,2.3636668498288547,2.7858359149579424,3.3257226212448145,4.035730287722532,5],[1,1.159225940787673,1.343712473580932,1.5611293155111927,1.8221199554561318,2.14183924486326,2.542468319282638,3.0574682501653316,3.7390572020926873,4.6719550537360774,6],[1,1.1670905356972596,1.3632807444991446,1.5979222279405536,1.8842640123816674,2.2416069644878687,2.69893426559423,3.3012632110403577,4.121250340630164,5.281493033448316,7],[1,1.1736630594087796,1.379783782386201,1.6292821855668218,1.9378971836180754,2.3289975651071977,2.8384347394720835,3.5232708454565906,4.478242031114584,5.868592169644505,8],[1,1.17930175
|
||
|
`,e),await hn($n())}}function $n(){const e=cr(),t=Ai({id:e});return bt(t),ie.saves.push(e),t}function cr(){let e,t=0;do e=`${ve.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const Vs=G(!1);async function hn(e){console.info("Loading save",e),Vs.value=!0;const{layers:t,removeLayer:n,addLayer:r}=await Wn(()=>Promise.resolve().then(function(){return Fl}),void 0),{fixOldSave:i,getInitialLayers:a}=await Wn(()=>Promise.resolve().then(function(){return Hp}),void 0);for(const u in t){const l=t[u];l&&n(l)}a(e).forEach(u=>r(u,e)),e=Ai(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,ve.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ve.versionNumber&&(i(e.modVersion,e),e.modVersion=ve.versionNumber),Object.assign(Y,e),ie.active=Y.id,Ke.emit("onLoad")}setInterval(()=>{Y.autosave&&bt()},1e3);window.onbeforeunload=()=>{Y.autosave&&bt()};window.save=bt;const Bs=window.hardReset=async()=>{await hn($n())};window.deleteLowerSaves=()=>{const e=Object.values(ie.saves).indexOf(Y.id)+1;Object.values(ie.saves).slice(e).forEach(t=>localStorage.removeItem(t)),ie.saves=ie.saves.slice(0,e)};const Xn=on({active:"",saves:[],showTPS:!0,theme:Ur.Nordic,unthrottled:!1,alignUnits:!1});wt(Xn,e=>{const t=Wt.compressToUTF16(JSON.stringify(e));localStorage.setItem(ve.id,t)},{deep:!0});var ie=window.settings=Xn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Ur.Nordic,alignUnits:!1};Ke.emit("loadSettings",e),Object.assign(Xn,e),Bs()};function Ls(){try{let e=localStorage.getItem(ve.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Wt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Xn,t)}Ke.emit("loadSettings",Xn)}catch{}}const Ri=on([]);function Ei(e){Ri.push(e)}const js=on([]),zs=on([]),Gs={class:"table"},Us=Z({__name:"Column",setup(e){const t=w(()=>It[ie.theme].mergeAdjacent);return(n,r)=>(S(),P("div",Gs,[N("div",{class:Ne(["col",{mergeAdjacent:s(t)}])},[qt(n.$slots,"default")],2)]))}}),Ws={class:"table"},Hs=Z({__name:"Row",setup(e){const t=w(()=>It[ie.theme].mergeAdjacent);return(n,r)=>(S(),P("div",Ws,[N("div",{class:Ne(["row",{mergeAdjacent:s(t)}])},[qt(n.$slots,"default")],2)]))}});function Fi(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!oa(e)}function ge(e,t="span"){return typeof e=="function"?Z({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),Z({template:e})):Z({render:()=>({})}):e}function ot(e){if(At(e))return typeof e=="function"?e():ge(e);const t=e[ft];return d(t,e[ut](),null)}function Ar(...e){let t;return d(Hs,null,Fi(t=e.map(ot))?t:{default:()=>[t]})}function Ys(...e){let t;return d(Us,null,Fi(t=e.map(ot))?t:{default:()=>[t]})}function gt(e){if(At(e))return typeof e=="function"?e():typeof e=="string"?d(ne,null,[e]):d(e,null,null);const t=e[ft];return d(t,e[ut](),null)}function gi(e,t){return e.reduce((n,r)=>d(ne,null,[n,t,r]))}function At(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Yn]===!0}function Oi(e,t){const n=G(null),r=G(void 0);function i(l){n.value||(n.value=setInterval(u,250)),r.value=l}function a(){n.value&&(clearInterval(n.value),n.value=null)}function u(){t&&t.value?t.value():e&&e.value&&e.value(r.value)}return ki(a),{start:i,stop:a,handleHolding:u}}function Wr(e,t="div"){const n=_t();return Pt(()=>{n.value=ge(Te(e),t)}),n}function Pn(e,t="div"){const n=_t(null);return Pt(()=>{const r=Te(e);n.value=r==""||r==null?null:ge(r,t)}),n}function Te(e){return s(s(e))}function q(...e){return e.includes(Object)||e.push(Object),e}function mi(e){const t=G(!1),n=e[ut].bind(e);return e[ut]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}const Zs=Z({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var h;const n=G({}),r=new ResizeObserver(l
|
||
|
`).slice(3,5).map(n=>n.trim()).join(`
|
||
|
`))!=null?t:""}function vi(e,t){var n;o.isNaN(t)&&(Ee.hasNaN||(Y.autosave=!1,Ee.hasNaN=!0,Ee.NaNPath=e[bn],Ee.NaNPersistent=e),console.error(`Attempted to save NaN value to ${(n=e[bn])==null?void 0:n.join(".")}`)),e[sn].value=t}function lt(e,t=!0){const n=Ve(e)?e:G(e);Ve(e)&&(e=e.value);const r=w({get(){return n.value},set(a){t?vi(i,a):i[sn].value=a}});r[Xt]=e;const i={get value(){return n.value},set value(a){t?vi(i,a):i[sn].value=a},__v_isRef:!0,[sn]:n,[Xt]:e,[fr]:Tl(),[gr]:!1,[Ot]:r,[bn]:void 0};return pt.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",i,`
|
||
|
Created at:
|
||
|
`+i[fr]):yn[pt[pt.length-1]].add(i),i}function Pl(e){return e!=null&&typeof e=="object"&&sn in e}function Sn(e){return!(rn in e)&&Ot in e?e[Ot]:new Proxy(e,{get(t,n){if(n!==sn)return n===Jn?!0:t[n]},set(t,n,r){return t[n]=r,!0},has(t,n){return n===sn?!1:n==Jn?!0:Reflect.has(t,n)}})}function Li(e){pt.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):yn[pt[pt.length-1]].delete(e),e[gr]=!0}Ke.on("addLayer",(e,t)=>{const n=[],r=(i,a=[])=>{let u=!1;return Object.keys(i).forEach(l=>{let c=i[l];if(c!=null&&typeof c=="object"){if(c[Jn]===!0)return;if(rn in c&&(c=c[rn]),Pl(c)){if(u=!0,c[gr]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,`
|
||
|
Created at:
|
||
|
`+c[fr]);return}yn[e.id].delete(c);const p=[e.id,...a,l];c[bn]!=null&&JSON.stringify(p)!==JSON.stringify(c[bn])&&console.error(`Persistent ref is being saved to \`${p.join(".")}\` when it's already present at \`${c[bn].join(".")}\`.`,"This can cause unexpected behavior when loading saves between updates."),c[bn]=p;const h=a.reduce((b,m)=>(m in b||(b[m]={}),b[m]),t),g=h[l];h[l]=c[sn],ca(h)?g!=null?h[l]=g:h[l]=c[Xt]:g!=null?h[l].value=g:h[l].value=c[Xt]}else!(c instanceof o)&&!(c instanceof f)&&!Ve(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),r(c,[...a,l])&&(Bt(c)&&!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.",rn in i?i[rn]:i,l):u=!0))}}),u};r(e[rn]),yn[e.id].forEach(i=>{i[gr]||console.error(`Created persistent ref in ${e.id} without registering it to the layer!`,`Make sure to include everything persistent in the returned object.
|
||
|
|
||
|
Created at:
|
||
|
`+i[fr])}),yn[e.id].clear()});const Hr=Symbol("RegisterNode"),Yr=Symbol("UnregisterNode"),Zr=Symbol("Nodes"),Xr=Symbol("Bounds"),me=Br({});window.layers=me;const yn={},pt=[];function Jr(e,t){return Qe(()=>{const n={},r=n.emitter=Si();if(n.on=r.on.bind(r),n.emit=r.emit.bind(r),n.nodes=G({}),n.id=e,pt.push(e),yn[e]=new Set,n.minimized=lt(!1,!1),Object.assign(n,t.call(n,n)),pt[pt.length-1]==null||pt[pt.length-1]!==e)throw new Error(`Adding layers stack in invalid state. This should not happen
|
||
|
Stack: ${pt}
|
||
|
Trying to pop ${n.id}`);pt.pop(),R(n,"color"),R(n,"display"),R(n,"classes"),R(n,"style"),R(n,"name"),le(n,"name",n.id),R(n,"minWidth"),le(n,"minWidth",600),R(n,"minimizable"),le(n,"minimizable",!0),R(n,"minimizedDisplay");const i=n.style;return n.style=w(()=>{var u,l;let a=s(n.minWidth);return(typeof a=="number"||!Number.isNaN(parseInt(a)))&&(a=a+"px"),[(u=s(i))!=null?u:"",(l=n.minimized)!=null&&l.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:a,flexBasis:a,margin:""}]}),n})}function Kr(e,t){if(console.info("Adding layer",e.id),me[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,me[e.id]);return}le(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),me[e.id]=e,Ke.emit("addLayer",e,t.layers[e.id])}function Al(e){return me[e]}function Qr(e){console.info("Removing layer",e.id),Ke.emit("removeLayer",e),me[e.id]=void 0}function Rl(e){Qr(e),Kr(e,Y)}function El(e){const t=G(!1);return{openModal:()=>t.value=!0,modal:j(()=>d(Lt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>d("h2",null,[s(e.name)]),body:s(e.display)}))}}Ke.on("update",function(t){Object.values(me).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(me).forEach(n=>{n==null||n.emit("update",t)}),Object.values(me).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Fl=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Hr,UnregisterNodeInjectionKey:Yr,NodesInjectionKey:Zr,BoundsInjectionKey:Xr,layers:me,persistentRefs:yn,addingLayers:pt,createLayer:Jr,addLayer:Kr,getLayer:Al,removeLayer:Qr,reloadLayer:Rl,setupLayerModal:El},Symbol.toStringTag,{value:"Module"}));const Ol=Z({components:{Context:qi,ErrorVue:Mi},props:{index:{type:Number,required:!0},display:{type:q(Object,String,Function),required:!0},minimizedDisplay:q(Object,String,Function),minimized:{type:Object,required:!0},name:{type:q(String),required:!0},color:q(String),minimizable:q(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:r,minimizedDisplay:i}=Pe(e),a=Wr(t),u=Pn(i),l=w(()=>ve.allowGoBack&&n.value>0&&!Te(r));function c(){Y.tabs.splice(s(e.index),1/0)}function p(g){e.nodes.value=g}const h=G([]);return da((g,b,m)=>(console.warn(`Error caught in "${e.name}" layer`,g,b,m),h.value.push(g instanceof Error?g:new Error(JSON.stringify(g))),!1)),{component:a,minimizedComponent:u,showGoBack:l,updateNodes:p,unref:s,goBack:c,errors:h}}}),ql={key:1};function Vl(e,t,n,r,i,a){const u=Ct("ErrorVue"),l=Ct("Context");return e.errors.length>0?(S(),re(u,{key:0,errors:e.errors},null,8,["errors"])):(S(),P("div",Vt({key:1,class:"layer-container",style:{"--layer-color":e.unref(e.color)}},e.$attrs),[e.showGoBack?(S(),P("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):B("",!0),e.unref(e.minimized)?(S(),P("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(S(),re(Je(e.minimizedComponent),{key:0})):(S(),P("div",ql,ee(e.unref(e.name)),1))])):(S(),P("div",{key:2,class:Ne(["layer-tab",{showGoBack:e.showGoBack}])},[d(l,{onUpdateNodes:e.updateNodes},{default:H(()=>[(S(),re(Je(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(S(),P("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.$emit("setMinimized",!0))}," \u25BC ")):B("",!0)],16))}var Bl=be(Ol,[["render",Vl],["__scopeId","data-v-a9f5b1da"]]);const ji=e=>(un("data-v-4b4bda40"),e=e(),cn(),e),Ll=ji(()=>N("h2",null,"Changelog",-1)),jl=ji(()=>N("details",{open:""},[N("summary",null,[y("v0.0 Initial Commit - "),N("time",null,"2021-09-04")]),y(" This is the first release :D "),N("ul",null,[N("li",{class:"feature"},"Did everything"),N("li",{class:"fix"},"Had some fun"),N("li",{class:"breaking"},"Removed everything"),N("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),zl=Z({__name:"Changelog",setup(e,{expose:t}){const n=G(!1);return t({open(){n.value=!0}}),(r,i)=>(S(),re(Lt,{modelValue:n.value,"onUpdate
|
||
|
${L}
|
||
|
${E}`)}}return p[I]}wt(n,I=>{I&&Object.keys(p).forEach(E=>delete p[E])});const g=w(()=>ie.saves.reduce((I,E)=>(I[E]=h(E),I),{}));function b(I){let E;switch(Y.id===I?E=jr(Y):E=JSON.stringify(g.value[I]),ve.exportEncoding){default:console.warn(`Unknown save encoding: ${ve.exportEncoding}. Defaulting to lz`);case"lz":E=Wt.compressToUTF16(E);break;case"base64":E=btoa(unescape(encodeURIComponent(E)));break;case"plain":break}const L=document.createElement("textarea");L.value=E,document.body.appendChild(L),L.select(),L.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(L)}function m(I){Y.id===I&&bt();const E={...g.value[I],id:cr()};bt(E),ie.saves.push(E.id)}function k(I){ie.saves=ie.saves.filter(E=>E!==I),localStorage.removeItem(I),p[I]=void 0}function C(I){g.value[Y.id].time=Y.time,bt(),p[Y.id]=void 0,hn(g.value[I]),p[I]=void 0}function T(I){if(u.value=I,Yt(()=>{u.value=null}),I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=Wt.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I);return}const E=JSON.parse(I);E.id=cr(),bt(E),ie.saves.push(E.id),C(E.id)}function $(I,E){const L=g.value[I];L!=null&&(L.name=E,Y.id===I?(Y.name=E,bt()):(bt(L),p[I]=void 0))}return(I,E)=>(S(),re(Lt,{modelValue:n.value,"onUpdate:modelValue":E[4]||(E[4]=L=>n.value=L),ref_key:"modal",ref:r},{header:H(()=>[Zu]),body:H(({shown:L})=>[L?(S(),re(s(ba),{key:0,list:s(ie).saves,handle:".handle",itemKey:de=>de},{item:H(({element:de})=>[d(Yu,{save:s(g)[de],onOpen:ue=>C(de),onExport:ue=>b(de),onEditName:ue=>$(de,ue),onDuplicate:ue=>m(de),onDelete:ue=>k(de)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):B("",!0)]),footer:H(()=>[N("div",Xu,[d(zi,{modelValue:a.value,"onUpdate:modelValue":E[0]||(E[0]=L=>a.value=L),title:"Import Save",placeholder:"Paste your save here!",class:Ne({importingFailed:i.value})},null,8,["modelValue","class"]),N("div",Ju,[Ku,N("div",Qu,[N("button",{class:"button",onClick:E[1]||(E[1]=L=>C(s($n)().id))},"New Game"),Object.keys(s(c)).length>0?(S(),re(ei,{key:0,options:s(c),modelValue:u.value,"onUpdate:modelValue":E[2]||(E[2]=L=>T(L)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):B("",!0)])]),N("div",ec,[tc,N("button",{class:"button modal-default-button",onClick:E[3]||(E[3]=L=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Gi=be(nc,[["__scopeId","data-v-2a4275be"]]);const kt=e=>(un("data-v-318a1c31"),e=e(),cn(),e),rc=["src","alt"],ic={key:1,class:"title"},ac=kt(()=>N("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),sc={class:"discord"},oc={class:"discord-links"},lc={key:0},uc=["href"],cc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),dc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),pc={href:"https://forums.moddingtree.com/",target:"_blank"},fc=kt(()=>N("span",{class:"material-icons"},"forum",-1)),gc=kt(()=>N("span",{class:"material-icons"},"info",-1)),mc=kt(()=>N("span",{class:"material-icons"},"library_books",-1)),vc=kt(()=>N("span",{class:"material-icons"},"settings",-1)),hc=kt(()=>N("span",{class:"material-icons"},"library_books",-1)),bc=kt(()=>N("span",{class:"material-icons"},"settings",-1)),yc=kt(()=>N("span",{class:"material-icons"},"info",-1)),wc={href:"https://forums.moddingtree.com/",target:"_blank"},_c=kt(()=>N("span",{class:"material-icons"},"forum",-1)),Nc={class:"discord"},Cc={class:"discord-links"},kc={key:0},Sc=["href"],Mc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Ic=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),xc=Z({__name:"Nav",setup(e){const t=G(null),n=G(null),r=G(null),i=G(null),{useHeader:a,banner:u,title:l,discordName:c,discordLink:p,versionNumber:h}=ve;function g(){window.open(p,"mywindow")}return(b,m)=>(S(),P(ne,null,[s(a)?(S(),P("div",Vt({k
|
||
|
${(-s(i)-30)*Math.sin(((e.actions.length-1)/2-m)*s(l))},
|
||
|
${(s(i)+30)*Math.cos(((e.actions.length-1)/2-m)*s(l))}
|
||
|
)`,onMousedown:T=>c(T,b),onTouchstart:T=>c(T,b),onMouseup:T=>p(T,b),onTouchend:Dn(T=>p(T,b),["stop"])},[N("circle",{fill:s(fe)(b.fillColor,e.node),r:"20","stroke-width":((C=e.selectedAction)==null?void 0:C.id)===b.id?4:0,stroke:s(a)},null,8,qc),N("text",{fill:s(u),class:"material-icons"},ee(s(fe)(b.icon,e.node)),9,Vc)],42,Oc)}),128))])):B("",!0)]),_:1}))}});var Lc=be(Bc,[["__scopeId","data-v-9efb2a56"]]);const jc=["transform"],zc={key:0},Gc=["r","fill","stroke"],Uc=["r","fill","stroke"],Wc=["r","fill"],Hc=["r","stroke-dasharray","stroke-dashoffset","stroke"],Yc=["fill","transform"],Zc={key:1,transform:"rotate(45, 0, 0)"},Xc=["width","height","transform","fill","stroke"],Jc=["width","height","transform","fill","stroke"],Kc=["width","height","transform","fill"],Qc=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],ed=["fill","y"],td=["fill"],nd=["fill","y"],rd={key:0},id=["fill","y"],ad=["fill","y"],sd=Z({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},isSelected:{type:Boolean},selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,r=Math.sqrt(2),i=Pe(n),a=w(()=>fe(i.nodeType.value.draggable,s(i.node)));wt(a,J=>{const $e=s(i.node);s(i.dragging)===$e&&!J&&t("endDragging",$e)});const u=w(()=>{var $e;const J=s(i.node);return($e=fe(i.nodeType.value.actions,J))==null?void 0:$e.filter(tt=>Ye(fe(tt.visibility,J)))}),l=w(()=>{var $e;const J=s(i.node);if(fe(i.nodeType.value.draggable,J)&&(($e=s(i.dragging))==null?void 0:$e.id)===J.id&&s(i.dragged)!=null){const{x:tt,y:vt}=s(i.dragged);return{x:J.position.x+Math.round(tt/25)*25,y:J.position.y+Math.round(vt/25)*25}}return J.position}),c=w(()=>fe(i.nodeType.value.shape,s(i.node))),p=w(()=>fe(i.nodeType.value.title,s(i.node))),h=w(()=>fe(i.nodeType.value.otherSubtitle,s(i.node))),g=w(()=>{var J;return(J=i.isSelected.value?s(i.selectedAction)&&fe(s(i.selectedAction).tooltip,s(i.node)):null)!=null?J:fe(i.nodeType.value.label,s(i.node))}),b=w(()=>{var J,$e;return fe(($e=(J=s(i.selectedAction))==null?void 0:J.confirmationLabel)!=null?$e:{text:"Tap again to confirm"},s(i.node))}),m=w(()=>fe(i.nodeType.value.size,s(i.node))),k=w(()=>{var J;return(J=fe(i.nodeType.value.progress,s(i.node)))!=null?J:0}),C=w(()=>It[ie.theme].variables["--background"]),T=w(()=>{var J;return(J=fe(i.nodeType.value.outlineColor,s(i.node)))!=null?J:It[ie.theme].variables["--outline"]}),$=w(()=>{var J;return(J=fe(i.nodeType.value.fillColor,s(i.node)))!=null?J:It[ie.theme].variables["--raised-background"]}),I=w(()=>fe(i.nodeType.value.progressColor,s(i.node))),E=w(()=>{var J;return(J=fe(i.nodeType.value.titleColor,s(i.node)))!=null?J:It[ie.theme].variables["--foreground"]}),L=w(()=>fe(i.nodeType.value.progressDisplay,s(i.node))),de=w(()=>i.dragging.value!=null&&s(i.hasDragged)&&fe(i.nodeType.value.canAccept,s(i.node),i.dragging.value)),ue=w(()=>fe(i.nodeType.value.style,s(i.node))),ae=w(()=>fe(i.nodeType.value.classes,s(i.node)));function X(J){t("mouseDown",J,i.node.value,a.value)}function Ie(J){var $e,tt,vt;($e=i.hasDragged)!=null&&$e.value||(t("endDragging",i.node.value),(vt=(tt=i.nodeType.value).onClick)==null||vt.call(tt,i.node.value),J.stopPropagation())}const he=w(()=>fe(i.nodeType.value.subtitle,s(i.node))),Ge=w(()=>fe(i.nodeType.value.showStar,s(i.node))),mt=w(()=>fe(i.nodeType.value.fillStar,s(i.node)));return(J,$e)=>{var tt,vt,ct;return S(),P("g",{class:Ne(["boardnode",{[e.node.type]:!0,isSelected:e.isSelected,isDraggable:s(a),...s(ae)}]),style:Le([{opacity:((tt=e.dragging)==null?void 0:tt.id)===e.node.id&&e.hasDragged?.5:1},(vt=s(ue))!=null?vt:[]]),transform:`translate(${s(l).x},${s(l).y})${e.isSelected?" scale(1.2)":""}`},[d(Lc,{actions:(ct=s(u))!=null?ct:[],"is-selected":e.isSelected,node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:$e[0]||($e[0]=St=>t("clickAction",St))},null,8,["actions","is-selected","node","node-type","selected-action"]),N("g",{class:"node-container",onMousedown:X,onTouchstartPassi
|
||
|
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 qs();const{globalBus:e}=await Wn(()=>Promise.resolve().then(function(){return Os}),void 0),{startGameLoop:t}=await Wn(()=>import("./gameLoop.48d12127.js"),["assets/gameLoop.48d12127.js","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/lz-string.dccec454.js","assets/nanoevents.1080beb7.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=va(wf);n.config.errorHandler=function(r,i,a){console.error(r,a,i)},e.emit("setupVue",n),n.mount("#app"),Yt(()=>{const r=hr(),{updateServiceWorker:i}=Nf({onNeedRefresh(){r.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(){r.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{o as D,Wn as _,Ee as a,ve as b,Hp as c,Ke as g,Vs as l,Y as p,ie as s};
|