import{_ as d,s as p,p as e,a as o,l as T,D as l,b as m,g as u}from"./index.2e12b347.js";import"./vue.d185782d.js";import{b3 as c}from"./@vue.7184beb0.js";/* empty css */import"./nanoevents.1080beb7.js";import"./lz-string.f2f3b7cf.js";import"./@ivanv.3bc3ebc4.js";import"./vue-next-select.f0e584b6.js";import"./vuedraggable.4713c6fe.js";import"./earcut.b6f90e68.js";import"./sortablejs.4c7e7419.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-toastification.768059b7.js";import"./@pixi.13a16b18.js";import"./ismobilejs.5c6954b9.js";import"./eventemitter3.dc5195d7.js";import"./url.6dd57c6c.js";import"./querystring.776b9ab3.js";import"./workbox-window.8d14e8b7.js";let n=null,f=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(o.lastTenTicks.push(r),o.lastTenTicks.length>10&&(o.lastTenTicks=o.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!o.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(l.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),l.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||l.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!l.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),u.emit("update",i,r),p.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function E(){f=(await d(()=>import("./index.2e12b347.js").then(function(t){return t.c}),["assets/index.2e12b347.js","assets/index.dac769fe.css","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"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{E as startGameLoop};