Skip to content

The only tool you need to know what is happening and how to fix it.

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