1import{n as e}from"./ui-telemetry-6dBr7SrR.js";import{r as t}from"./boot-reload-guard-C9OyvBhB.js";var n=`chunk_recovery_version`,r=`version_reload_version`,i=`__app_reload`,a=`runtime_recovery_attempts`,o=`runtime_recovery_last_reason`,s=`runtime_recovery_last_at`,c=`runtime_recovery_hard_reset`,l=3,u=6e5;function d(){var e;let t=document.querySelector(`script[type="module"][src*="/assets/"]`),n=t==null?void 0:t.src;if(!n)return null;let r=n.match(/\/assets\/[^/]+-([a-zA-Z0-9_-]{6,})\.(?:js|mjs)$/);return(e=r==null?void 0:r[1])==null?null:e}function f(e){try{return sessionStorage.getItem(e)}catch{return null}}function p(e,t){try{sessionStorage.setItem(e,t)}catch{}}function m(e){let t=new URL(window.location.href);return t.searchParams.set(i,e),t.searchParams.set(`_cb`,`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`),`${t.pathname}${t.search}${t.hash}`}function h(){return`build-${d()||`dev`}`}function g(){let e=new URL(window.location.href),t=e.searchParams.has(i),n=e.searchParams.has(`_cb`);!t&&!n||(e.searchParams.delete(i),e.searchParams.delete(`_cb`),window.history.replaceState(null,``,`${e.pathname}${e.search}${e.hash}`))}function _(e){let t=e.toLowerCase();return[`loading chunk`,`failed to fetch dynamically imported module`,`error loading dynamically imported module`,`dynamically imported module`,`importing a module script failed`,`unable to preload css`,`load failed`,`failed to fetch`,`networkerror when attempting to fetch resource`,`the operation was aborted`,`expected a javascript module script`,`mime type`,`asset 404`,`asset 410`,`asset html-mime`,`asset html-sniff`,`cannot read properties of undefined (reading 'default')`,`cannot read property 'default' of undefined`,`cannot read properties of undefined (reading 'createelement')`,`cannot read properties of undefined (reading 'forwardref')`,`unexpected token '<'`,`unexpected token <`].some(e=>t.includes(e))}async function v({preservePushCaches:e=!0,preservePushWorker:t=!0}={}){let n=[];`caches`in window&&n.push(caches.keys().then(t=>Promise.all(t.filter(t=>!e||!t.includes(`push`)).map(e=>caches.delete(e))))),`serviceWorker`in navigator&&n.push(navigator.serviceWorker.getRegistrations().then(e=>Promise.all(e.filter(e=>!t||![e.active,e.waiting,e.installing].some(e=>{var t;return e==null||(t=e.scriptURL)==null?void 0:t.includes(`push-sw`)})).map(e=>e.unregister())))),await Promise.all(n)}async function y(r,{appVersion:d=h(),preservePushCaches:g=!0,preservePushWorker:y=!0}={}){if(!_(r))return!1;e({event_type:`recovery_attempt`,severity:`warn`,source:`runtime-recovery`,message:r.slice(0,300),payload:{app_version:d,stage:`detected`}});let b=parseInt(f(s)||`0`,10),x=Date.now()-b;b>0&&x>u&&(p(a,`0`),p(n,``),p(c,``));let S=f(n),C=parseInt(f(s)||`0`,10);if(S===d&&Date.now()-C<4e3)return!1;let w=parseInt(f(a)||`0`,10),T=f(c)===d;if(w>=1&&!T){console.warn(`[Runtime Recovery] Soft reload did not heal â performing hard reset`,r),p(c,d),p(n,d),p(a,String(w+1)),p(o,r.slice(0,500)),p(s,String(Date.now()));try{localStorage.removeItem(`app_version`)}catch{}try{await v({preservePushCaches:!1,preservePushWorker:!1})}finally{t(),window.location.href=`${window.location.pathname}?${i}=hardreset-${Date.now()}${window.location.hash}`}return!0}if(w>=l){if(x<3e4)return!1;p(a,`0`)}p(n,d),p(a,String(w+1)),p(o,r.slice(0,500)),p(s,String(Date.now())),console.warn(`[Runtime Recovery] Detected stale asset/chunk issue. Reloading appâ¦`,r);try{await v({preservePushCaches:g,preservePushWorker:y})}finally{t(),window.location.replace(m(d))}return!0}function b(){if(typeof window>`u`||!window.fetch||window.fetch.__assetRecoveryWrapped)return;let e=window.fetch.bind(window),t=async(t,n)=>{let r=await e(t,n);try{let e=typeof t==`string`?t:t instanceof URL?t.toString():t.url||``,n=/\/assets\/[^?#]+\.(?:js|mjs)(?:$|[?#])/i.test(e),i=/\/assets\/[^?#]+\.css(?:$|[?#])/i.test(e),a=n||i,o=r.status===404||r.status===410;if(a&&o)y(`asset ${r.status} ${e}`);else if(a&&r.ok){let t=(r.headers.get(`content-type`)||``).toLowerCase();if(t.includes(`text/html`)||t.includes(`application/xhtml`))y(`asset html-mime ${r.status} ${e}`);else if(n&&(!t||t===`application/octet-stream`))try{let t=(await r.clone().text()).slice(0,256).trimStart().toLowerCase();(t.startsWith(`<!doctype`)||t.startsWith(`<html`))&&y(`asset html-sniff ${r.status} ${e}`)}catch{}}}catch{}return r};t.__assetRecoveryWrapped=!0,window.fetch=t}async function x(e,{preservePushCaches:n=!0,preservePushWorker:i=!0}={}){if(f(r)===e)return!1;p(r,e);try{await v({preservePushCaches:n,preservePushWorker:i})}finally{t(),window.location.replace(m(e))}return!0}export{_ as a,b as i,v as n,y as o,h as r,x as s,g as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.