/* Partytown 0.7.5 - MIT builder.io */ const e = new Map(), t = (e, t) => ({ F: e.F, p: t }), r = (e, t) => new Response(e, { headers: { "content-type": t || "text/html", "Cache-Control": "no-store", }, }); (self.oninstall = () => self.skipWaiting()), (self.onactivate = () => self.clients.claim()), (self.onmessage = (t) => { const r = t.data, n = e.get(r.F); n && (e.delete(r.F), clearTimeout(n[1]), n[0](r)); }), (self.onfetch = (n) => { const s = n.request, i = new URL(s.url).pathname; i.endsWith("sw.html") ? n.respondWith( r( '' ) ) : i.endsWith("proxytown") && n.respondWith( ((n) => new Promise(async (s) => { const i = await n.clone().json(), o = await ((r) => new Promise(async (n) => { const s = [...(await self.clients.matchAll())].sort( (e, t) => (e.url > t.url ? -1 : e.url < t.url ? 1 : 0) )[0]; if (s) { const i = [ n, setTimeout(() => { e.delete(r.F), n(t(r, "Timeout")); }, 1e4), ]; e.set(r.F, i), s.postMessage(r); } else n(t(r, "NoParty")); }))(i); s(r(JSON.stringify(o), "application/json")); }))(s) ); });