const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-.bun-CIlawBoH.js","assets/vendor--Dwc_TRgJ.css","assets/renderMobileApp-CxEnmaQL.js","assets/index-DkRLSXEX.js","assets/index-Di3CDurc.css","assets/useAppFontEffects-DkrfZHQv.js","assets/NewWorktreeDialog-B2o615D_.js","assets/mobileLayoutPreference-Dio-WWkI.js","assets/main-gqEqIL1b.js","assets/SessionSwitcherDropdown-Bz03hrU9.js","assets/main-BV3KOtdA.css"])))=>i.map(i=>d[i]);
import{c as w}from"./index-DkRLSXEX.js";import{_ as a}from"./vendor-.bun-CIlawBoH.js";import{g as p}from"./mobileLayoutPreference-Dio-WWkI.js";function h(t={}){const{immediate:r=!1,onNeedRefresh:n,onOfflineReady:o,onRegistered:s,onRegisteredSW:c,onRegisterError:d}=t;let i,u;const f=async(e=!0)=>{await u};async function m(){if("serviceWorker"in navigator){if(i=await a(async()=>{const{Workbox:e}=await import("./vendor-.bun-CIlawBoH.js").then(_=>_.cm);return{Workbox:e}},__vite__mapDeps([0,1])).then(({Workbox:e})=>new e("/sw.js",{scope:"/",type:"classic"})).catch(e=>{d?.(e)}),!i)return;i.addEventListener("activated",e=>{(e.isUpdate||e.isExternal)&&window.location.reload()}),i.addEventListener("installed",e=>{e.isUpdate||o?.()}),i.register({immediate:r}).then(e=>{c?c("/sw.js",e):s?.(e)}).catch(e=>{d?.(e)})}}return u=m(),f}window.__OPENCHAMBER_RUNTIME_APIS__=w();const v=()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches,g=()=>{const r=new URLSearchParams(window.location.search).get("surface");if(r==="mobile")return"mobile";if(r==="desktop")return"desktop";const n=Math.min(window.innerWidth||0,window.screen?.width||window.innerWidth||0),o=navigator.maxTouchPoints||0;return n>0&&n<=760&&(o>0||v())&&p()==="new"?"mobile":"desktop"},l=g();window.__OPENCHAMBER_SURFACE__=l;const S=()=>!(!("serviceWorker"in navigator)||!window.isSecureContext||window.location.protocol!=="http:"&&window.location.protocol!=="https:"||document.prerendering||String(document.visibilityState)==="prerender"),E=t=>{let r=!1;const n=()=>{r||S()&&(r=!0,t())},o=()=>{setTimeout(n,0)};document.readyState==="complete"?o():window.addEventListener("load",o,{once:!0}),(document.prerendering||String(document.visibilityState)==="prerender")&&document.addEventListener("visibilitychange",n,{once:!0})},P=()=>{E(()=>{try{h({onRegisterError(t){console.warn("[PWA] service worker registration skipped:",t)}})}catch(t){console.warn("[PWA] service worker registration skipped:",t)}})};l==="mobile"?a(async()=>{const{renderMobileApp:t}=await import("./renderMobileApp-CxEnmaQL.js");return{renderMobileApp:t}},__vite__mapDeps([2,0,1,3,4,5,6,7])).then(({renderMobileApp:t})=>{t(window.__OPENCHAMBER_RUNTIME_APIS__??w())}):a(()=>import("./main-gqEqIL1b.js").then(t=>t.m),__vite__mapDeps([8,0,1,3,4,5,6,7,9,10]));P();
