var Zt=t=>{throw TypeError(t)};var $e=(t,e,n)=>e.has(t)||Zt("Cannot "+n);var w=(t,e,n)=>($e(t,e,"read from private field"),n?n.call(t):e.get(t)),A=(t,e,n)=>e.has(t)?Zt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{b4 as Ut,b5 as Ce,b as T,g as I,d as P,a2 as gt,b6 as je}from"./C4An0dnW.js";import{o as te}from"./nIaoZoCo.js";const M=[];function qt(t,e=Ut){let n=null;const r=new Set;function a(s){if(Ce(t,s)&&(t=s,n)){const l=!M.length;for(const c of r)c[1](),M.push(c,t);if(l){for(let c=0;c{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:a,update:i,subscribe:o}}class Dt{constructor(e,n){this.status=e,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}}class Vt{constructor(e,n){this.status=e,this.location=n}}class Bt extends Error{constructor(e,n,r){super(r),this.status=e,this.text=n}}new URL("sveltekit-internal://");function Ne(t,e){return t==="/"||e==="ignore"?t:e==="never"?t.endsWith("/")?t.slice(0,-1):t:e==="always"&&!t.endsWith("/")?t+"/":t}function qe(t){return t.split("%25").map(decodeURI).join("%25")}function De(t){for(const e in t)t[e]=decodeURIComponent(t[e]);return t}function At({href:t}){return t.split("#")[0]}function Ve(...t){let e=5381;for(const n of t)if(typeof n=="string"){let r=n.length;for(;r;)e=e*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)e=e*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}new TextEncoder;new TextDecoder;function Be(t){const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r((t instanceof Request?t.method:(e==null?void 0:e.method)||"GET")!=="GET"&&Y.delete(Kt(t)),Ke(t,e));const Y=new Map;function Me(t,e){const n=Kt(t,e),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&Y.set(n,{body:a,init:i,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=Be(a)),Promise.resolve(new Response(a,i))}return window.fetch(t,e)}function ze(t,e,n){if(Y.size>0){const r=Kt(t,n),a=Y.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return e.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return e.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return Tt(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return Tt(String.fromCharCode(...l.slice(2).split("-").map(_=>parseInt(_,16))));const d=Fe.exec(l),[,u,v,f,h]=d;return e.push({name:f,matcher:h,optional:!!u,rest:!!v,chained:v?c===1&&o[0]==="":!1}),v?"([^]*?)":u?"([^/]*)?":"([^/]+?)"}return Tt(l)}).join("")}).join("")}/?$`),params:e}}function We(t){return t!==""&&!/^\([^)]+\)$/.test(t)}function Ye(t){return t.slice(1).split("/").filter(We)}function He(t,e,n){const r={},a=t.slice(1),i=a.filter(s=>s!==void 0);let o=0;for(let s=0;sd).join("/"),o=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=e[s+1],u=a[s+1];d&&!d.rest&&d.optional&&u&&l.chained&&(o=0),!d&&!u&&Object.keys(r).length===i.length&&(o=0);continue}if(l.optional&&l.chained){o++;continue}return}if(!o)return r}function Tt(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Je({nodes:t,server_loads:e,dictionary:n,matchers:r}){const a=new Set(e);return Object.entries(n).map(([s,[l,c,d]])=>{const{pattern:u,params:v}=Ge(s),f={id:s,exec:h=>{const _=u.exec(h);if(_)return He(_,v,r)},errors:[1,...d||[]].map(h=>t[h]),layouts:[0,...c||[]].map(o),leaf:i(l)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function i(s){const l=s<0;return l&&(s=~s),[l,t[s]]}function o(s){return s===void 0?s:[a.has(s),t[s]]}}function he(t,e=JSON.parse){try{return e(sessionStorage[t])}catch{}}function ee(t,e,n=JSON.stringify){const r=n(e);try{sessionStorage[t]=r}catch{}}var le;const U=((le=globalThis.__sveltekit_og1wdu)==null?void 0:le.base)??"";var ce;const Xe=((ce=globalThis.__sveltekit_og1wdu)==null?void 0:ce.assets)??U??"",Qe="1772334772507",pe="sveltekit:snapshot",ge="sveltekit:scroll",me="sveltekit:states",Ze="sveltekit:pageurl",F="sveltekit:history",J="sveltekit:navigation",q={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Et=location.origin;function Mt(t){if(t instanceof URL)return t;let e=document.baseURI;if(!e){const n=document.getElementsByTagName("base");e=n.length?n[0].href:document.URL}return new URL(t,e)}function V(){return{x:pageXOffset,y:pageYOffset}}function z(t,e){return t.getAttribute(`data-sveltekit-${e}`)}const ne={...q,"":q.hover};function _e(t){let e=t.assignedSlot??t.parentNode;return(e==null?void 0:e.nodeType)===11&&(e=e.host),e}function we(t,e){for(;t&&t!==e;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=_e(t)}}function Ot(t,e,n){let r;try{if(r=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const s=location.hash.split("#")[1]||"/";r.hash=`#${s}${r.hash}`}}catch{}const a=t instanceof SVGAElement?t.target.baseVal:t.target,i=!r||!!a||Rt(r,e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(r==null?void 0:r.origin)===Et&&t.hasAttribute("download");return{url:r,external:i,target:a,download:o}}function mt(t){let e=null,n=null,r=null,a=null,i=null,o=null,s=t;for(;s&&s!==document.documentElement;)r===null&&(r=z(s,"preload-code")),a===null&&(a=z(s,"preload-data")),e===null&&(e=z(s,"keepfocus")),n===null&&(n=z(s,"noscroll")),i===null&&(i=z(s,"reload")),o===null&&(o=z(s,"replacestate")),s=_e(s);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:ne[r??"off"],preload_data:ne[a??"off"],keepfocus:l(e),noscroll:l(n),reload:l(i),replace_state:l(o)}}function ae(t){const e=qt(t);let n=!0;function r(){n=!0,e.update(o=>o)}function a(o){n=!1,e.set(o)}function i(o){let s;return e.subscribe(l=>{(s===void 0||n&&l!==s)&&o(s=l)})}return{notify:r,set:a,subscribe:i}}const ve={v:()=>{}};function tn(){const{set:t,subscribe:e}=qt(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Xe}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==Qe;return o&&(t(!0),ve.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:e,check:r}}function Rt(t,e,n){return t.origin!==Et||!t.pathname.startsWith(e)?!0:n?t.pathname!==location.pathname:!1}function An(t){}const ye=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...ye];const en=new Set([...ye]);[...en];function nn(t){return t.filter(e=>e!=null)}function zt(t){return t instanceof Dt||t instanceof Bt?t.status:500}function an(t){return t instanceof Bt?t.text:"Internal Error"}let R,X,It;const rn=te.toString().includes("$$")||/function \w+\(\) \{\}/.test(te.toString());var nt,at,rt,ot,st,it,lt,ct,fe,ft,ue,ut,de;rn?(R={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},X={current:null},It={current:!1}):(R=new(fe=class{constructor(){A(this,nt,T({}));A(this,at,T(null));A(this,rt,T(null));A(this,ot,T({}));A(this,st,T({id:null}));A(this,it,T({}));A(this,lt,T(-1));A(this,ct,T(new URL("https://example.com")))}get data(){return I(w(this,nt))}set data(e){P(w(this,nt),e)}get form(){return I(w(this,at))}set form(e){P(w(this,at),e)}get error(){return I(w(this,rt))}set error(e){P(w(this,rt),e)}get params(){return I(w(this,ot))}set params(e){P(w(this,ot),e)}get route(){return I(w(this,st))}set route(e){P(w(this,st),e)}get state(){return I(w(this,it))}set state(e){P(w(this,it),e)}get status(){return I(w(this,lt))}set status(e){P(w(this,lt),e)}get url(){return I(w(this,ct))}set url(e){P(w(this,ct),e)}},nt=new WeakMap,at=new WeakMap,rt=new WeakMap,ot=new WeakMap,st=new WeakMap,it=new WeakMap,lt=new WeakMap,ct=new WeakMap,fe),X=new(ue=class{constructor(){A(this,ft,T(null))}get current(){return I(w(this,ft))}set current(e){P(w(this,ft),e)}},ft=new WeakMap,ue),It=new(de=class{constructor(){A(this,ut,T(!1))}get current(){return I(w(this,ut))}set current(e){P(w(this,ut),e)}},ut=new WeakMap,de),ve.v=()=>It.current=!0);function on(t){Object.assign(R,t)}const sn=new Set(["icon","shortcut icon","apple-touch-icon"]),j=he(ge)??{},Q=he(pe)??{},C={url:ae({}),page:ae({}),navigating:qt(null),updated:tn()};function Ft(t){j[t]=V()}function ln(t,e){let n=t+1;for(;j[n];)delete j[n],n+=1;for(n=e+1;Q[n];)delete Q[n],n+=1}function Z(t,e=!1){return e?location.replace(t.href):location.href=t.href,new Promise(()=>{})}async function be(){if("serviceWorker"in navigator){const t=await navigator.serviceWorker.getRegistration(U||"/");t&&await t.update()}}function re(){}let Gt,$t,_t,O,Ct,S;const wt=[],vt=[];let y=null;function jt(){var t;(t=y==null?void 0:y.fork)==null||t.then(e=>e==null?void 0:e.discard()),y=null}const pt=new Map,ke=new Set,cn=new Set,H=new Set;let m={branch:[],error:null,url:null},Se=!1,yt=!1,oe=!0,tt=!1,W=!1,Ee=!1,Wt=!1,Re,k,L,D;const bt=new Set,se=new Map;async function On(t,e,n){var i,o,s,l,c;(i=globalThis.__sveltekit_og1wdu)!=null&&i.data&&globalThis.__sveltekit_og1wdu.data,document.URL!==location.href&&(location.href=location.href),S=t,await((s=(o=t.hooks).init)==null?void 0:s.call(o)),Gt=Je(t),O=document.documentElement,Ct=e,$t=t.nodes[0],_t=t.nodes[1],$t(),_t(),k=(l=history.state)==null?void 0:l[F],L=(c=history.state)==null?void 0:c[J],k||(k=L=Date.now(),history.replaceState({...history.state,[F]:k,[J]:L},""));const r=j[k];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await kn(Ct,n)):(await G({type:"enter",url:Mt(S.hash?Rn(new URL(location.href)):location.href),replace_state:!0}),a()),bn()}function fn(){wt.length=0,Wt=!1}function xe(t){vt.some(e=>e==null?void 0:e.snapshot)&&(Q[t]=vt.map(e=>{var n;return(n=e==null?void 0:e.snapshot)==null?void 0:n.capture()}))}function Le(t){var e;(e=Q[t])==null||e.forEach((n,r)=>{var a,i;(i=(a=vt[r])==null?void 0:a.snapshot)==null||i.restore(n)})}function ie(){Ft(k),ee(ge,j),xe(L),ee(pe,Q)}async function Ue(t,e,n,r){let a;e.invalidateAll&&jt(),await G({type:"goto",url:Mt(t),keepfocus:e.keepFocus,noscroll:e.noScroll,replace_state:e.replaceState,state:e.state,redirect_count:n,nav_token:r,accept:()=>{e.invalidateAll&&(Wt=!0,a=[...se.keys()]),e.invalidate&&e.invalidate.forEach(yn)}}),e.invalidateAll&>().then(gt).then(()=>{se.forEach(({resource:i},o)=>{var s;a!=null&&a.includes(o)&&((s=i.refresh)==null||s.call(i))})})}async function un(t){if(t.id!==(y==null?void 0:y.id)){jt();const e={};bt.add(e),y={id:t.id,token:e,promise:Te({...t,preload:e}).then(n=>(bt.delete(e),n.type==="loaded"&&n.state.error&&jt(),n)),fork:null}}return y.promise}async function Pt(t){var n;const e=(n=await xt(t,!1))==null?void 0:n.route;e&&await Promise.all([...e.layouts,e.leaf].filter(Boolean).map(r=>r[1]()))}async function Ae(t,e,n){var a;m=t.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(R,t.props.page),Re=new S.root({target:e,props:{...t.props,stores:C,components:vt},hydrate:n,sync:!1}),await Promise.resolve(),Le(L),n){const i={from:null,to:{params:m.params,route:{id:((a=m.route)==null?void 0:a.id)??null},url:new URL(location.href),scroll:j[k]??V()},willUnload:!1,type:"enter",complete:Promise.resolve()};H.forEach(o=>o(i))}yt=!0}function kt({url:t,params:e,branch:n,status:r,error:a,route:i,form:o}){let s="never";if(U&&(t.pathname===U||t.pathname===U+"/"))s="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(s=f.slash);t.pathname=Ne(t.pathname,s),t.search=t.search;const l={type:"loaded",state:{url:t,params:e,branch:n,error:a,route:i},props:{constructors:nn(n).map(f=>f.node.component),page:Qt(R)}};o!==void 0&&(l.props.form=o);let c={},d=!R,u=0;for(let f=0;fs(new URL(o))))return!0;return!1}function Ht(t,e){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?e??null:null}function pn(t,e){if(!t)return new Set(e.searchParams.keys());const n=new Set([...t.searchParams.keys(),...e.searchParams.keys()]);for(const r of n){const a=t.searchParams.getAll(r),i=e.searchParams.getAll(r);a.every(o=>i.includes(o))&&i.every(o=>a.includes(o))&&n.delete(r)}return n}function gn({error:t,url:e,route:n,params:r}){return{type:"loaded",state:{error:t,url:e,route:n,params:r,branch:[]},props:{page:Qt(R),constructors:[]}}}async function Te({id:t,invalidating:e,url:n,params:r,route:a,preload:i}){if((y==null?void 0:y.id)===t)return bt.delete(y.token),y.promise;const{errors:o,layouts:s,leaf:l}=a,c=[...s,l];o.forEach(g=>g==null?void 0:g().catch(()=>{})),c.forEach(g=>g==null?void 0:g[1]().catch(()=>{}));const d=m.url?t!==St(m.url):!1,u=m.route?a.id!==m.route.id:!1,v=pn(m.url,n);let f=!1;const h=c.map(async(g,p)=>{var $;if(!g)return;const b=m.branch[p];return g[1]===(b==null?void 0:b.loader)&&!hn(f,u,d,v,($=b.universal)==null?void 0:$.uses,r)?b:(f=!0,Yt({loader:g[1],url:n,params:r,route:a,parent:async()=>{var dt;const N={};for(let B=0;B{});const _=[];for(let g=0;gPromise.resolve({}),server_data_node:Ht(i)}),s={node:await _t(),loader:_t,universal:null,server:null,data:null};return kt({url:n,params:a,branch:[o,s],status:t,error:e,route:null})}catch(o){if(o instanceof Vt)return Ue(new URL(o.location,location.href),{},0);throw o}}async function _n(t){const e=t.href;if(pt.has(e))return pt.get(e);let n;try{const r=(async()=>{let a=await S.hooks.reroute({url:new URL(t),fetch:async(i,o)=>dn(i,o,t).promise})??t;if(typeof a=="string"){const i=new URL(t);S.hash?i.hash=a:i.pathname=a,a=i}return a})();pt.set(e,r),n=await r}catch{pt.delete(e);return}return n}async function xt(t,e){if(t&&!Rt(t,U,S.hash)){const n=await _n(t);if(!n)return;const r=wn(n);for(const a of Gt){const i=a.exec(r);if(i)return{id:St(t),invalidating:e,route:a,params:De(i),url:t}}}}function wn(t){return qe(S.hash?t.hash.replace(/^#/,"").replace(/[?#].+/,""):t.pathname.slice(U.length))||"/"}function St(t){return(S.hash?t.hash.replace(/^#/,""):t.pathname)+t.search}function Ie({url:t,type:e,intent:n,delta:r,event:a,scroll:i}){let o=!1;const s=Xt(m,n,t,e,i??null);r!==void 0&&(s.navigation.delta=r),a!==void 0&&(s.navigation.event=a);const l={...s.navigation,cancel:()=>{o=!0,s.reject(new Error("navigation cancelled"))}};return tt||ke.forEach(c=>c(l)),o?null:s}async function G({type:t,url:e,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:o={},redirect_count:s=0,nav_token:l={},accept:c=re,block:d=re,event:u}){var B;const v=D;D=l;const f=await xt(e,!1),h=t==="enter"?Xt(m,f,e,t):Ie({url:e,type:t,delta:n==null?void 0:n.delta,intent:f,scroll:n==null?void 0:n.scroll,event:u});if(!h){d(),D===l&&(D=v);return}const _=k,g=L;c(),tt=!0,yt&&h.navigation.type!=="enter"&&C.navigating.set(X.current=h.navigation);let p=f&&await Te(f);if(!p){if(Rt(e,U,S.hash))return await Z(e,i);p=await Pe(e,{id:null},await et(new Bt(404,"Not Found",`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404,i)}if(e=(f==null?void 0:f.url)||e,D!==l)return h.reject(new Error("navigation aborted")),!1;if(p.type==="redirect"){if(s<20){await G({type:t,url:new URL(p.location,e),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:o,redirect_count:s+1,nav_token:l}),h.fulfil(void 0);return}p=await Jt({status:500,error:await et(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}})}else p.props.page.status>=400&&await C.updated.check()&&(await be(),await Z(e,i));if(fn(),Ft(_),xe(g),p.props.page.url.pathname!==e.pathname&&(e.pathname=p.props.page.url.pathname),o=n?n.state:o,!n){const E=i?0:1,ht={[F]:k+=E,[J]:L+=E,[me]:o};(i?history.replaceState:history.pushState).call(history,ht,"",e),i||ln(k,L)}const b=f&&(y==null?void 0:y.id)===f.id?y.fork:null;y=null,p.props.page.state=o;let x;if(yt){const E=(await Promise.all(Array.from(cn,K=>K(h.navigation)))).filter(K=>typeof K=="function");if(E.length>0){let K=function(){E.forEach(Lt=>{H.delete(Lt)})};E.push(K),E.forEach(Lt=>{H.add(Lt)})}m=p.state,p.props.page&&(p.props.page.url=e);const ht=b&&await b;ht?x=ht.commit():(Re.$set(p.props),on(p.props.page),x=(B=je)==null?void 0:B()),Ee=!0}else await Ae(p,Ct,!1);const{activeElement:$}=document;await x,await gt(),await gt();let N=null;if(oe){const E=n?n.scroll:a?V():null;E?scrollTo(E.x,E.y):(N=e.hash&&document.getElementById(Oe(e)))?N.scrollIntoView():scrollTo(0,0)}const dt=document.activeElement!==$&&document.activeElement!==document.body;!r&&!dt&&En(e,!N),oe=!0,p.props.page&&Object.assign(R,p.props.page),tt=!1,t==="popstate"&&Le(L),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=V()),H.forEach(E=>E(h.navigation)),C.navigating.set(X.current=null)}async function Pe(t,e,n,r,a){return t.origin===Et&&t.pathname===location.pathname&&!Se?await Jt({status:r,error:n,url:t,route:e}):await Z(t,a)}function vn(){let t,e={element:void 0,href:void 0},n;O.addEventListener("mousemove",s=>{const l=s.target;clearTimeout(t),t=setTimeout(()=>{i(l,q.hover)},20)});function r(s){s.defaultPrevented||i(s.composedPath()[0],q.tap)}O.addEventListener("mousedown",r),O.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(s=>{for(const l of s)l.isIntersecting&&(Pt(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(s,l){const c=we(s,O),d=c===e.element&&(c==null?void 0:c.href)===e.href&&l>=n;if(!c||d)return;const{url:u,external:v,download:f}=Ot(c,U,S.hash);if(v||f)return;const h=mt(c),_=u&&St(m.url)===St(u);if(!(h.reload||_))if(l<=h.preload_data){e={element:c,href:c.href},n=q.tap;const g=await xt(u,!1);if(!g)return;un(g)}else l<=h.preload_code&&(e={element:c,href:c.href},n=l,Pt(u))}function o(){a.disconnect();for(const s of O.querySelectorAll("a")){const{url:l,external:c,download:d}=Ot(s,U,S.hash);if(c||d)continue;const u=mt(s);u.reload||(u.preload_code===q.viewport&&a.observe(s),u.preload_code===q.eager&&Pt(l))}}H.add(o),o()}function et(t,e){if(t instanceof Dt)return t.body;const n=zt(t),r=an(t);return S.hooks.handleError({error:t,event:e,status:n,message:r})??{message:r}}function $n(t,e={}){return t=new URL(Mt(t)),t.origin!==Et?Promise.reject(new Error("goto: invalid URL")):Ue(t,e,0)}function yn(t){if(typeof t=="function")wt.push(t);else{const{href:e}=new URL(t,location.href);wt.push(n=>n.href===e)}}function bn(){var e;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(ie(),!tt){const a=Xt(m,void 0,null,"leave"),i={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};ke.forEach(o=>o(i))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ie()}),(e=navigator.connection)!=null&&e.saveData||vn(),O.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const r=we(n.composedPath()[0],O);if(!r)return;const{url:a,external:i,target:o,download:s}=Ot(r,U,S.hash);if(!a)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const l=mt(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||s)return;const[d,u]=(S.hash?a.hash.replace(/^#/,""):a.href).split("#"),v=d===At(location);if(i||l.reload&&(!v||!u)){Ie({url:a,type:"link",event:n})?tt=!0:n.preventDefault();return}if(u!==void 0&&v){const[,f]=m.url.href.split("#");if(f===u){if(n.preventDefault(),u===""||u==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const h=r.ownerDocument.getElementById(decodeURIComponent(u));h&&(h.scrollIntoView(),h.focus())}return}if(W=!0,Ft(k),t(a),!l.replace_state)return;W=!1}n.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await G({type:"link",url:a,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??a.href===location.href,event:n})}),O.addEventListener("submit",n=>{if(n.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const s=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(Rt(s,U,!1))return;const l=n.target,c=mt(l);if(c.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(l,a);s.search=new URLSearchParams(d).toString(),G({type:"form",url:s,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??s.href===location.href,event:n})}),addEventListener("popstate",async n=>{var r;if(!Nt){if((r=n.state)!=null&&r[F]){const a=n.state[F];if(D={},a===k)return;const i=j[a],o=n.state[me]??{},s=new URL(n.state[Ze]??location.href),l=n.state[J],c=m.url?At(location)===At(m.url):!1;if(l===L&&(Ee||c)){o!==R.state&&(R.state=o),t(s),j[k]=V(),i&&scrollTo(i.x,i.y),k=a;return}const u=a-k;await G({type:"popstate",url:s,popped:{state:o,scroll:i,delta:u},accept:()=>{k=a,L=l},block:()=>{history.go(-u)},nav_token:D,event:n})}else if(!W){const a=new URL(location.href);t(a),S.hash&&location.reload()}}}),addEventListener("hashchange",()=>{W&&(W=!1,history.replaceState({...history.state,[F]:++k,[J]:L},"",location.href))});for(const n of document.querySelectorAll("link"))sn.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&C.navigating.set(X.current=null)});function t(n){m.url=R.url=n,C.page.set(Qt(R)),C.page.notify()}}async function kn(t,{status:e=200,error:n,node_ids:r,params:a,route:i,server_route:o,data:s,form:l}){Se=!0;const c=new URL(location.href);let d;({params:a={},route:i={id:null}}=await xt(c,!1)||{}),d=Gt.find(({id:f})=>f===i.id);let u,v=!0;try{const f=r.map(async(_,g)=>{const p=s[g];return p!=null&&p.uses&&(p.uses=Sn(p.uses)),Yt({loader:S.nodes[_],url:c,params:a,route:i,parent:async()=>{const b={};for(let x=0;x{const s=history.state;Nt=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(s,"",t),e&&scrollTo(i,o),Nt=!1})}else{const i=document.body,o=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),o!==null?i.setAttribute("tabindex",o):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let o=0;o{if(a.rangeCount===i.length){for(let o=0;o{i=u,o=v});return s.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url,scroll:V()},to:n&&{params:(e==null?void 0:e.params)??null,route:{id:((d=e==null?void 0:e.route)==null?void 0:d.id)??null},url:n,scroll:a},willUnload:!e,type:r,complete:s},fulfil:i,reject:o}}function Qt(t){return{data:t.data,error:t.error,form:t.form,params:t.params,route:t.route,state:t.state,status:t.status,url:t.url}}function Rn(t){const e=new URL(t);return e.hash=decodeURIComponent(t.hash),e}function Oe(t){let e;if(S.hash){const[,,n]=t.hash.split("#",3);e=n??""}else e=t.hash.slice(1);return decodeURIComponent(e)}export{On as a,$n as g,An as l,R as p,C as s};