22 lines
242 KiB
JavaScript
22 lines
242 KiB
JavaScript
|
/* empty css */import"./vue.c16a309b.js";import{q as ln,C as s,ab as X,t as G,aF as S,a1 as T,aL as qt,bv as Pn,G as Ne,as as Xt,_ as w,az as Qn,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 cn,aG as dn,l as Ve,u as Lr,b2 as wt,aD as Mi,w as _t,b3 as Pt,ap as ua,aH as sr,A as Ae,$ as re,b9 as jr,ar as Vt,bt as ca,bc as Wn,T as da,j as pa,bw as Bt,ay as fa,aM as Ct,aO as Ke,z as Jt,bo as ga,bs as ma,bd as ui,am as dr,H as va,bx as ha,bf as ba}from"./@vue.6b211d3c.js";import{L as Yt}from"./lz-string.dccec454.js";import{c as Ii}from"./nanoevents.1080beb7.js";import{Y as ya}from"./vue-next-select.ded54c4a.js";import{D as wa}from"./vuedraggable.1879de79.js";import{p as _a}from"./vue-textarea-autosize.35804eaf.js";import{P as Na}from"./vue-panzoom.8ce6f9b1.js";import{s as Ca,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 ka=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)}};ka();const Sa="modulepreload",ci={},Ma="./",Hn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(r=>{if(r=`${Ma}${r}`,r in ci)return;ci[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":Sa,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())},Ia="./projInfo-schema.json",xa="Planar Pioneers",$a="A game about controlling and exploiting planes!",Da="planar-pioneers",Ta="thepaperpilot",Pa="",Aa="",Ra="0.0",Ea="Initial Commit",Fa=!1,Oa=!1,qa=2,Va=!0,Ba=null,La="",ja=["main"],za=3600,Ga=0,Ua=!0,Wa="base64";var ve={$schema:Ia,title:xa,description:$a,id:Da,author:Ta,discordName:Pa,discordLink:Aa,versionNumber:Ra,versionTitle:Ea,allowGoBack:Fa,defaultShowSmall:Oa,defaultDecimalsShown:qa,useHeader:Va,banner:Ba,logo:La,initialTabs:ja,maxTickLength:za,offlineLimit:Ga,enablePausing:Ua,exportEncoding:Wa};const Ha=ln({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var Y=window.player=Ha;function zr(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 Ya=["onClick"],Za=X({__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,Xt(()=>{n.value=!0,r.value=setTimeout(()=>n.value=!1,500)})}return(a,u)=>(S(),T("button",{onClick:Pn(i,["stop"]),class:Ne(["feedback",{activated:n.value,left:e.left}])},[qt(a.$slots,"default",{},void 0,!0)],10,Ya))}});var Gr=be(Za,[["__scopeId","data-v-01a1b95c"]]);const br=e=>(cn("data-v-ac351c02"),e=e(),dn(),e),Xa={class:"error"},Ja={class:"error-title"},Ka={class:"error-details",style:{"margin-top":"-10px"}},Qa={key:0},es={class:"instructions"},ts=["href"],ns=br(()=>N("span",{class:"material-icons",style:{"font-size":"16px"}},"content_paste",-1)),rs=br(()=>N("span",{style:{"margin-left":"8px","font-size":"medium"}},"Copy Save",-1)),is=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=zr(Y);switch(ve.exportEncoding){default:console.warn(`Unknown save encoding: ${ve.exportEncoding}. Defaulting to lz`);case"lz":u=Yt.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 Qn(()=>{Y.autosave=!1,Y.devSpeed=0}),(u,l)=>(S(),T("div",Xa,[N("h1",Ja,ee(s(n).name)+": "+ee(s(n).message),1),N("div",Ka,[s(n).cause?(S(),T("div",Qa,[(S(!0),T(ne,null,Dt(s(i)[0],c=>(S(),T("div",{key:c},ee(c),1))),128))])):B("",!0),s(n).stack?(S(),T("div",{key:1,style:Le(s(n).cause?"margin-top: 10px":"")},[(S(!0),T(ne,null,Dt(s(r)[0],c=>(S(),T("div",{key:c},ee(c),1))),128))],4)):B("",!0)]),N("div",es,[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,ts),y("! "),d(Gr,{onClick:a,class:"button",style:{display:"inline-flex"}},{default:H(()=>[ns,rs]),_:1}),is,e.errors.length>1?(S(),T("div",as,os)):B("",!0),(S(!0),T(ne,null,Dt(e.errors.slice(1),(c,p)=>(S(),T("div",{key:p,style:{"margin-top":"20px"}},[N("details",ls,[N("summary",null,ee(c.name)+": "+ee(c.message),1),c.cause?(S(),T("div",us,[(S(!0),T(ne,null,Dt(s(i)[p+1],h=>(S(),T("div",{key:h},ee(h),1))),128))])):B("",!0),c.stack?(S(),T("div",cs,[(S(!0),T(ne,null,Dt(s(r)[p+1],h=>(S(),T("div",{key:h},ee(h),1))),128))])):B("",!0)])]))),128))])]))}});var xi=be(ds,[["__scopeId","data-v-ac351c02"]]);class ps{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 fs(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 fs{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Pr=17,gs=9e15,ms=Math.log10(9e15),vs=1/9e15,hs=308,bs=-324,di=5,ys=(1<<10)-1,ws=function(){const e=[];for(let n=bs+1;n<=hs;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),gn=[2,Math.E,3,4,5,6,7,8,9,10],_s=[[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 bn(Tn())}}function Tn(){const e=cr(),t=Ei({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 Ls=G(!1);async function bn(e){console.info("Loading save",e),Ls.value=!0;const{layers:t,removeLayer:n,addLayer:r}=await Hn(()=>Promise.resolve().then(function(){return ql}),void 0),{fixOldSave:i,getInitialLayers:a}=await Hn(()=>Promise.resolve().then(function(){return Yp}),void 0);for(const u in t){const l=t[u];l&&n(l)}a(e).forEach(u=>r(u,e)),e=Ei(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,Qe.emit("onLoad")}setInterval(()=>{Y.autosave&&bt()},1e3);window.onbeforeunload=()=>{Y.autosave&&bt()};window.save=bt;const js=window.hardReset=async()=>{await bn(Tn())};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 Jn=ln({active:"",saves:[],showTPS:!0,theme:Wr.Nordic,unthrottled:!1,alignUnits:!1});wt(Jn,e=>{const t=Yt.compressToUTF16(JSON.stringify(e));localStorage.setItem(ve.id,t)},{deep:!0});var ie=window.settings=Jn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Wr.Nordic,alignUnits:!1};Qe.emit("loadSettings",e),Object.assign(Jn,e),js()};function zs(){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=Yt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Jn,t)}Qe.emit("loadSettings",Jn)}catch{}}const Fi=ln([]);function Oi(e){Fi.push(e)}const Gs=ln([]),Us=ln([]),Ws={class:"table"},Hs=X({__name:"Column",setup(e){const t=w(()=>It[ie.theme].mergeAdjacent);return(n,r)=>(S(),T("div",Ws,[N("div",{class:Ne(["col",{mergeAdjacent:s(t)}])},[qt(n.$slots,"default")],2)]))}}),Ys={class:"table"},Zs=X({__name:"Row",setup(e){const t=w(()=>It[ie.theme].mergeAdjacent);return(n,r)=>(S(),T("div",Ys,[N("div",{class:Ne(["row",{mergeAdjacent:s(t)}])},[qt(n.$slots,"default")],2)]))}});function qi(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!ua(e)}function fe(e,t="span"){return typeof e=="function"?X({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),X({template:e})):X({render:()=>({})}):e}function ot(e){if(At(e))return typeof e=="function"?e():fe(e);const t=e[gt];return d(t,e[dt](),null)}function Rr(...e){let t;return d(Zs,null,qi(t=e.map(ot))?t:{default:()=>[t]})}function Xs(...e){let t;return d(Hs,null,qi(t=e.map(ot))?t:{default:()=>[t]})}function mt(e){if(At(e))return typeof e=="function"?e():typeof e=="string"?d(ne,null,[e]):d(e,null,null);const t=e[gt];return d(t,e[dt](),null)}function mi(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[Zn]===!0}function Vi(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 Mi(a),{start:i,stop:a,handleHolding:u}}function Hr(e,t="div"){const n=_t();return Pt(()=>{n.value=fe(Pe(e),t)}),n}function Rn(e,t="div"){const n=_t(null);return Pt(()=>{const r=Pe(e);n.value=r==""||r==null?null:fe(r,t)}),n}function Pe(e){return s(s(e))}function q(...e){return e.includes(Object)||e.push(Object),e}function vi(e){const t=G(!1),n=e[dt].bind(e);return e[dt]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}const Js=X({__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 hi(e,t){var n;o.isNaN(t)&&(Fe.hasNaN||(Y.autosave=!1,Fe.hasNaN=!0,Fe.NaNPath=e[yn],Fe.NaNPersistent=e),console.error(`Attempted to save NaN value to ${(n=e[yn])==null?void 0:n.join(".")}`)),e[on].value=t}function ct(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?hi(i,a):i[on].value=a}});r[Kt]=e;const i={get value(){return n.value},set value(a){t?hi(i,a):i[on].value=a},__v_isRef:!0,[on]:n,[Kt]:e,[fr]:Al(),[gr]:!1,[Ot]:r,[yn]:void 0};return ft.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",i,`
|
||
|
Created at:
|
||
|
`+i[fr]):wn[ft[ft.length-1]].add(i),i}function Rl(e){return e!=null&&typeof e=="object"&&on in e}function In(e){return!(an in e)&&Ot in e?e[Ot]:new Proxy(e,{get(t,n){if(n!==on)return n===Kn?!0:t[n]},set(t,n,r){return t[n]=r,!0},has(t,n){return n===on?!1:n==Kn?!0:Reflect.has(t,n)}})}function zi(e){ft.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):wn[ft[ft.length-1]].delete(e),e[gr]=!0}Qe.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[Kn]===!0)return;if(an in c&&(c=c[an]),Rl(c)){if(u=!0,c[gr]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,`
|
||
|
Created at:
|
||
|
`+c[fr]);return}wn[e.id].delete(c);const p=[e.id,...a,l];c[yn]!=null&&JSON.stringify(p)!==JSON.stringify(c[yn])&&console.error(`Persistent ref is being saved to \`${p.join(".")}\` when it's already present at \`${c[yn].join(".")}\`.`,"This can cause unexpected behavior when loading saves between updates."),c[yn]=p;const h=a.reduce((b,v)=>(v in b||(b[v]={}),b[v]),t),g=h[l];h[l]=c[on],pa(h)?g!=null?h[l]=g:h[l]=c[Kt]:g!=null?h[l].value=g:h[l].value=c[Kt]}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.",an in i?i[an]:i,l):u=!0))}}),u};r(e[an]),wn[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])}),wn[e.id].clear()});const Yr=Symbol("RegisterNode"),Zr=Symbol("UnregisterNode"),Xr=Symbol("Nodes"),Jr=Symbol("Bounds"),ge=Lr({});window.layers=ge;const wn={},ft=[];function Kr(e,t){return et(()=>{const n={},r=n.emitter=Ii();if(n.on=r.on.bind(r),n.emit=r.emit.bind(r),n.nodes=G({}),n.id=e,ft.push(e),wn[e]=new Set,n.minimized=ct(!1,!1),Object.assign(n,t.call(n,n)),ft[ft.length-1]==null||ft[ft.length-1]!==e)throw new Error(`Adding layers stack in invalid state. This should not happen
|
||
|
Stack: ${ft}
|
||
|
Trying to pop ${n.id}`);ft.pop(),A(n,"color"),A(n,"display"),A(n,"classes"),A(n,"style"),A(n,"name"),oe(n,"name",n.id),A(n,"minWidth"),oe(n,"minWidth",600),A(n,"minimizable"),oe(n,"minimizable",!0),A(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 Qr(e,t){if(console.info("Adding layer",e.id),ge[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ge[e.id]);return}oe(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ge[e.id]=e,Qe.emit("addLayer",e,t.layers[e.id])}function El(e){return ge[e]}function ei(e){console.info("Removing layer",e.id),Qe.emit("removeLayer",e),ge[e.id]=void 0}function Fl(e){ei(e),Qr(e,Y)}function Ol(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)}))}}Qe.on("update",function(t){Object.values(ge).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(ge).forEach(n=>{n==null||n.emit("update",t)}),Object.values(ge).forEach(n=>{n==null||n.emit("postUpdate",t)})});var ql=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Yr,UnregisterNodeInjectionKey:Zr,NodesInjectionKey:Xr,BoundsInjectionKey:Jr,layers:ge,persistentRefs:wn,addingLayers:ft,createLayer:Kr,addLayer:Qr,getLayer:El,removeLayer:ei,reloadLayer:Fl,setupLayerModal:Ol},Symbol.toStringTag,{value:"Module"}));const Vl=X({components:{Context:Bi,ErrorVue:xi},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}=Ae(e),a=Hr(t),u=Rn(i),l=w(()=>ve.allowGoBack&&n.value>0&&!Pe(r));function c(){Y.tabs.splice(s(e.index),1/0)}function p(g){e.nodes.value=g}const h=G([]);return fa((g,b,v)=>(console.warn(`Error caught in "${e.name}" layer`,g,b,v),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}}}),Bl={key:1};function Ll(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(),T("div",Vt({key:1,class:"layer-container",style:{"--layer-color":e.unref(e.color)}},e.$attrs),[e.showGoBack?(S(),T("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):B("",!0),e.unref(e.minimized)?(S(),T("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(S(),re(Ke(e.minimizedComponent),{key:0})):(S(),T("div",Bl,ee(e.unref(e.name)),1))])):(S(),T("div",{key:2,class:Ne(["layer-tab",{showGoBack:e.showGoBack}])},[d(l,{onUpdateNodes:e.updateNodes},{default:H(()=>[(S(),re(Ke(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(S(),T("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.$emit("setMinimized",!0))}," \u25BC ")):B("",!0)],16))}var jl=be(Vl,[["render",Ll],["__scopeId","data-v-a9f5b1da"]]);const Gi=e=>(cn("data-v-4b4bda40"),e=e(),dn(),e),zl=Gi(()=>N("h2",null,"Changelog",-1)),Gl=Gi(()=>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)),Ul=X({__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}
|
||
|
${R}`)}}return p[I]}wt(n,I=>{I&&Object.keys(p).forEach(R=>delete p[R])});const g=w(()=>ie.saves.reduce((I,R)=>(I[R]=h(R),I),{}));function b(I){let R;switch(Y.id===I?R=zr(Y):R=JSON.stringify(g.value[I]),ve.exportEncoding){default:console.warn(`Unknown save encoding: ${ve.exportEncoding}. Defaulting to lz`);case"lz":R=Yt.compressToUTF16(R);break;case"base64":R=btoa(unescape(encodeURIComponent(R)));break;case"plain":break}const L=document.createElement("textarea");L.value=R,document.body.appendChild(L),L.select(),L.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(L)}function v(I){Y.id===I&&bt();const R={...g.value[I],id:cr()};bt(R),ie.saves.push(R.id)}function k(I){ie.saves=ie.saves.filter(R=>R!==I),localStorage.removeItem(I),p[I]=void 0}function C(I){g.value[Y.id].time=Y.time,bt(),p[Y.id]=void 0,bn(g.value[I]),p[I]=void 0}function $(I){if(u.value=I,Xt(()=>{u.value=null}),I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=Yt.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I);return}const R=JSON.parse(I);R.id=cr(),bt(R),ie.saves.push(R.id),C(R.id)}function x(I,R){const L=g.value[I];L!=null&&(L.name=R,Y.id===I?(Y.name=R,bt()):(bt(L),p[I]=void 0))}return(I,R)=>(S(),re(Lt,{modelValue:n.value,"onUpdate:modelValue":R[4]||(R[4]=L=>n.value=L),ref_key:"modal",ref:r},{header:H(()=>[Ju]),body:H(({shown:L})=>[L?(S(),re(s(wa),{key:0,list:s(ie).saves,handle:".handle",itemKey:ce=>ce},{item:H(({element:ce})=>[d(Xu,{save:s(g)[ce],onOpen:le=>C(ce),onExport:le=>b(ce),onEditName:le=>x(ce,le),onDuplicate:le=>v(ce),onDelete:le=>k(ce)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):B("",!0)]),footer:H(()=>[N("div",Ku,[d(Ui,{modelValue:a.value,"onUpdate:modelValue":R[0]||(R[0]=L=>a.value=L),title:"Import Save",placeholder:"Paste your save here!",class:Ne({importingFailed:i.value})},null,8,["modelValue","class"]),N("div",Qu,[ec,N("div",tc,[N("button",{class:"button",onClick:R[1]||(R[1]=L=>C(s(Tn)().id))},"New Game"),Object.keys(s(c)).length>0?(S(),re(ti,{key:0,options:s(c),modelValue:u.value,"onUpdate:modelValue":R[2]||(R[2]=L=>$(L)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):B("",!0)])]),N("div",nc,[rc,N("button",{class:"button modal-default-button",onClick:R[3]||(R[3]=L=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Wi=be(ic,[["__scopeId","data-v-2a4275be"]]);const kt=e=>(cn("data-v-318a1c31"),e=e(),dn(),e),ac=["src","alt"],sc={key:1,class:"title"},oc=kt(()=>N("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),lc={class:"discord"},uc={class:"discord-links"},cc={key:0},dc=["href"],pc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),fc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),gc={href:"https://forums.moddingtree.com/",target:"_blank"},mc=kt(()=>N("span",{class:"material-icons"},"forum",-1)),vc=kt(()=>N("span",{class:"material-icons"},"info",-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"},"library_books",-1)),wc=kt(()=>N("span",{class:"material-icons"},"settings",-1)),_c=kt(()=>N("span",{class:"material-icons"},"info",-1)),Nc={href:"https://forums.moddingtree.com/",target:"_blank"},Cc=kt(()=>N("span",{class:"material-icons"},"forum",-1)),kc={class:"discord"},Sc={class:"discord-links"},Mc={key:0},Ic=["href"],xc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),$c=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Dc=X({__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,v)=>(S(),T(ne,null,[s(a)?(S(),T("div",Vt({k
|
||
|
${(-s(i)-30)*Math.sin(((e.actions.length-1)/2-v)*s(l))},
|
||
|
${(s(i)+30)*Math.cos(((e.actions.length-1)/2-v)*s(l))}
|
||
|
)`,onMousedown:$=>c($,b),onTouchstart:$=>c($,b),onMouseup:$=>p($,b),onTouchend:Pn($=>p($,b),["stop"])},[N("circle",{fill:s(pe)(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,Bc),N("text",{fill:s(u),class:"material-icons"},ee(s(pe)(b.icon,e.node)),9,Lc)],42,Vc)}),128))])):B("",!0)]),_:1}))}});var zc=be(jc,[["__scopeId","data-v-9efb2a56"]]);const Gc=["transform"],Uc={key:0},Wc=["r","fill","stroke"],Hc=["r","fill","stroke"],Yc=["r","fill"],Zc=["r","stroke-dasharray","stroke-dashoffset","stroke"],Xc=["fill","transform"],Jc={key:1,transform:"rotate(45, 0, 0)"},Kc=["width","height","transform","fill","stroke"],Qc=["width","height","transform","fill","stroke"],ed=["width","height","transform","fill"],td=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],nd=["fill","y"],rd=["fill"],id=["fill","y"],ad={key:0},sd=["fill","y"],od=["fill","y"],ld=X({__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=Ae(n),a=w(()=>pe(i.nodeType.value.draggable,s(i.node)));wt(a,K=>{const $e=s(i.node);s(i.dragging)===$e&&!K&&t("endDragging",$e)});const u=w(()=>{var $e;const K=s(i.node);return($e=pe(i.nodeType.value.actions,K))==null?void 0:$e.filter(nt=>Ze(pe(nt.visibility,K)))}),l=w(()=>{var $e;const K=s(i.node);if(pe(i.nodeType.value.draggable,K)&&(($e=s(i.dragging))==null?void 0:$e.id)===K.id&&s(i.dragged)!=null){const{x:nt,y:ht}=s(i.dragged);return{x:K.position.x+Math.round(nt/25)*25,y:K.position.y+Math.round(ht/25)*25}}return K.position}),c=w(()=>pe(i.nodeType.value.shape,s(i.node))),p=w(()=>pe(i.nodeType.value.title,s(i.node))),h=w(()=>pe(i.nodeType.value.otherSubtitle,s(i.node))),g=w(()=>{var K;return(K=i.isSelected.value?s(i.selectedAction)&&pe(s(i.selectedAction).tooltip,s(i.node)):null)!=null?K:pe(i.nodeType.value.label,s(i.node))}),b=w(()=>{var K,$e;return pe(($e=(K=s(i.selectedAction))==null?void 0:K.confirmationLabel)!=null?$e:{text:"Tap again to confirm"},s(i.node))}),v=w(()=>pe(i.nodeType.value.size,s(i.node))),k=w(()=>{var K;return(K=pe(i.nodeType.value.progress,s(i.node)))!=null?K:0}),C=w(()=>It[ie.theme].variables["--background"]),$=w(()=>{var K;return(K=pe(i.nodeType.value.outlineColor,s(i.node)))!=null?K:It[ie.theme].variables["--outline"]}),x=w(()=>{var K;return(K=pe(i.nodeType.value.fillColor,s(i.node)))!=null?K:It[ie.theme].variables["--raised-background"]}),I=w(()=>pe(i.nodeType.value.progressColor,s(i.node))),R=w(()=>{var K;return(K=pe(i.nodeType.value.titleColor,s(i.node)))!=null?K:It[ie.theme].variables["--foreground"]}),L=w(()=>pe(i.nodeType.value.progressDisplay,s(i.node))),ce=w(()=>i.dragging.value!=null&&s(i.hasDragged)&&pe(i.nodeType.value.canAccept,s(i.node),i.dragging.value)),le=w(()=>pe(i.nodeType.value.style,s(i.node))),ae=w(()=>pe(i.nodeType.value.classes,s(i.node)));function J(K){t("mouseDown",K,i.node.value,a.value)}function Ie(K){var $e,nt,ht;($e=i.hasDragged)!=null&&$e.value||(t("endDragging",i.node.value),(ht=(nt=i.nodeType.value).onClick)==null||ht.call(nt,i.node.value),K.stopPropagation())}const he=w(()=>pe(i.nodeType.value.subtitle,s(i.node))),Ue=w(()=>pe(i.nodeType.value.showStar,s(i.node))),vt=w(()=>pe(i.nodeType.value.fillStar,s(i.node)));return(K,$e)=>{var nt,ht,pt;return S(),T("g",{class:Ne(["boardnode",{[e.node.type]:!0,isSelected:e.isSelected,isDraggable:s(a),...s(ae)}]),style:Le([{opacity:((nt=e.dragging)==null?void 0:nt.id)===e.node.id&&e.hasDragged?.5:1},(ht=s(le))!=null?ht:[]]),transform:`translate(${s(l).x},${s(l).y})${e.isSelected?" scale(1.2)":""}`},[d(zc,{actions:(pt=s(u))!=null?pt:[],"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:J,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 Bs();const{globalBus:e}=await Hn(()=>Promise.resolve().then(function(){return Vs}),void 0),{startGameLoop:t}=await Hn(()=>import("./gameLoop.a8abe3ac.js"),["assets/gameLoop.a8abe3ac.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=ba(_f);n.config.errorHandler=function(r,i,a){console.error(r,a,i)},e.emit("setupVue",n),n.mount("#app"),Xt(()=>{const r=hr(),{updateServiceWorker:i}=Cf({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,Hn as _,Fe as a,ve as b,Yp as c,Qe as g,Ls as l,Y as p,ie as s};
|