Files
mermaid-live-editor/_app/immutable/start-bd131b60.js
T
2022-08-12 06:21:14 +00:00

2 lines
24 KiB
JavaScript

import{S as Me,i as We,s as Ye,a as Ge,e as x,c as Xe,b as z,g as W,t as T,d as Y,f as I,h as C,j as He,k as Ze,o as ke,l as Qe,m as et,n as tt,p as ye,q as K,r as nt,u as rt,v as st,w as q,x as se,y as B,z as ae,A as ie,B as J,C as oe,D as Ie}from"./chunks/index-1530a265.js";import{_ as ne,w as ue}from"./chunks/preload-helper-23bf4dac.js";import{s as at,a as it}from"./chunks/paths-b9644fda.js";import{i as ot}from"./chunks/singletons-eca981c1.js";function ct(r){let e,t,o;const f=[r[1]||{}];var c=r[0][0];function d(n){let s={};for(let a=0;a<f.length;a+=1)s=oe(s,f[a]);return{props:s}}return c&&(e=new c(d())),{c(){e&&q(e.$$.fragment),t=x()},l(n){e&&se(e.$$.fragment,n),t=x()},m(n,s){e&&B(e,n,s),z(n,t,s),o=!0},p(n,s){const a=s&2?ae(f,[ie(n[1]||{})]):{};if(c!==(c=n[0][0])){if(e){W();const u=e;T(u.$$.fragment,1,0,()=>{J(u,1)}),Y()}c?(e=new c(d()),q(e.$$.fragment),I(e.$$.fragment,1),B(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(n){o||(e&&I(e.$$.fragment,n),o=!0)},o(n){e&&T(e.$$.fragment,n),o=!1},d(n){n&&C(t),e&&J(e,n)}}}function lt(r){let e,t,o;const f=[r[1]||{}];var c=r[0][0];function d(n){let s={$$slots:{default:[pt]},$$scope:{ctx:n}};for(let a=0;a<f.length;a+=1)s=oe(s,f[a]);return{props:s}}return c&&(e=new c(d(r))),{c(){e&&q(e.$$.fragment),t=x()},l(n){e&&se(e.$$.fragment,n),t=x()},m(n,s){e&&B(e,n,s),z(n,t,s),o=!0},p(n,s){const a=s&2?ae(f,[ie(n[1]||{})]):{};if(s&525&&(a.$$scope={dirty:s,ctx:n}),c!==(c=n[0][0])){if(e){W();const u=e;T(u.$$.fragment,1,0,()=>{J(u,1)}),Y()}c?(e=new c(d(n)),q(e.$$.fragment),I(e.$$.fragment,1),B(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(n){o||(e&&I(e.$$.fragment,n),o=!0)},o(n){e&&T(e.$$.fragment,n),o=!1},d(n){n&&C(t),e&&J(e,n)}}}function ft(r){let e,t,o;const f=[r[2]||{}];var c=r[0][1];function d(n){let s={};for(let a=0;a<f.length;a+=1)s=oe(s,f[a]);return{props:s}}return c&&(e=new c(d())),{c(){e&&q(e.$$.fragment),t=x()},l(n){e&&se(e.$$.fragment,n),t=x()},m(n,s){e&&B(e,n,s),z(n,t,s),o=!0},p(n,s){const a=s&4?ae(f,[ie(n[2]||{})]):{};if(c!==(c=n[0][1])){if(e){W();const u=e;T(u.$$.fragment,1,0,()=>{J(u,1)}),Y()}c?(e=new c(d()),q(e.$$.fragment),I(e.$$.fragment,1),B(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(n){o||(e&&I(e.$$.fragment,n),o=!0)},o(n){e&&T(e.$$.fragment,n),o=!1},d(n){n&&C(t),e&&J(e,n)}}}function ut(r){let e,t,o;const f=[r[2]||{}];var c=r[0][1];function d(n){let s={$$slots:{default:[dt]},$$scope:{ctx:n}};for(let a=0;a<f.length;a+=1)s=oe(s,f[a]);return{props:s}}return c&&(e=new c(d(r))),{c(){e&&q(e.$$.fragment),t=x()},l(n){e&&se(e.$$.fragment,n),t=x()},m(n,s){e&&B(e,n,s),z(n,t,s),o=!0},p(n,s){const a=s&4?ae(f,[ie(n[2]||{})]):{};if(s&521&&(a.$$scope={dirty:s,ctx:n}),c!==(c=n[0][1])){if(e){W();const u=e;T(u.$$.fragment,1,0,()=>{J(u,1)}),Y()}c?(e=new c(d(n)),q(e.$$.fragment),I(e.$$.fragment,1),B(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(n){o||(e&&I(e.$$.fragment,n),o=!0)},o(n){e&&T(e.$$.fragment,n),o=!1},d(n){n&&C(t),e&&J(e,n)}}}function dt(r){let e,t,o;const f=[r[3]||{}];var c=r[0][2];function d(n){let s={};for(let a=0;a<f.length;a+=1)s=oe(s,f[a]);return{props:s}}return c&&(e=new c(d())),{c(){e&&q(e.$$.fragment),t=x()},l(n){e&&se(e.$$.fragment,n),t=x()},m(n,s){e&&B(e,n,s),z(n,t,s),o=!0},p(n,s){const a=s&8?ae(f,[ie(n[3]||{})]):{};if(c!==(c=n[0][2])){if(e){W();const u=e;T(u.$$.fragment,1,0,()=>{J(u,1)}),Y()}c?(e=new c(d()),q(e.$$.fragment),I(e.$$.fragment,1),B(e,t.parentNode,t)):e=null}else c&&e.$set(a)},i(n){o||(e&&I(e.$$.fragment,n),o=!0)},o(n){e&&T(e.$$.fragment,n),o=!1},d(n){n&&C(t),e&&J(e,n)}}}function pt(r){let e,t,o,f;const c=[ut,ft],d=[];function n(s,a){return s[0][2]?0:1}return e=n(r),t=d[e]=c[e](r),{c(){t.c(),o=x()},l(s){t.l(s),o=x()},m(s,a){d[e].m(s,a),z(s,o,a),f=!0},p(s,a){let u=e;e=n(s),e===u?d[e].p(s,a):(W(),T(d[u],1,1,()=>{d[u]=null}),Y(),t=d[e],t?t.p(s,a):(t=d[e]=c[e](s),t.c()),I(t,1),t.m(o.parentNode,o))},i(s){f||(I(t),f=!0)},o(s){T(t),f=!1},d(s){d[e].d(s),s&&C(o)}}}function je(r){let e,t=r[5]&&De(r);return{c(){e=Qe("div"),t&&t.c(),this.h()},l(o){e=et(o,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var f=tt(e);t&&t.l(f),f.forEach(C),this.h()},h(){ye(e,"id","svelte-announcer"),ye(e,"aria-live","assertive"),ye(e,"aria-atomic","true"),K(e,"position","absolute"),K(e,"left","0"),K(e,"top","0"),K(e,"clip","rect(0 0 0 0)"),K(e,"clip-path","inset(50%)"),K(e,"overflow","hidden"),K(e,"white-space","nowrap"),K(e,"width","1px"),K(e,"height","1px")},m(o,f){z(o,e,f),t&&t.m(e,null)},p(o,f){o[5]?t?t.p(o,f):(t=De(o),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(o){o&&C(e),t&&t.d()}}}function De(r){let e;return{c(){e=nt(r[6])},l(t){e=rt(t,r[6])},m(t,o){z(t,e,o)},p(t,o){o&64&&st(e,t[6])},d(t){t&&C(e)}}}function ht(r){let e,t,o,f,c;const d=[lt,ct],n=[];function s(u,L){return u[0][1]?0:1}e=s(r),t=n[e]=d[e](r);let a=r[4]&&je(r);return{c(){t.c(),o=Ge(),a&&a.c(),f=x()},l(u){t.l(u),o=Xe(u),a&&a.l(u),f=x()},m(u,L){n[e].m(u,L),z(u,o,L),a&&a.m(u,L),z(u,f,L),c=!0},p(u,[L]){let k=e;e=s(u),e===k?n[e].p(u,L):(W(),T(n[k],1,1,()=>{n[k]=null}),Y(),t=n[e],t?t.p(u,L):(t=n[e]=d[e](u),t.c()),I(t,1),t.m(o.parentNode,o)),u[4]?a?a.p(u,L):(a=je(u),a.c(),a.m(f.parentNode,f)):a&&(a.d(1),a=null)},i(u){c||(I(t),c=!0)},o(u){T(t),c=!1},d(u){n[e].d(u),u&&C(o),a&&a.d(u),u&&C(f)}}}function _t(r,e,t){let{stores:o}=e,{page:f}=e,{components:c}=e,{props_0:d=null}=e,{props_1:n=null}=e,{props_2:s=null}=e;He("__svelte__",o),Ze(o.page.notify);let a=!1,u=!1,L=null;return ke(()=>{const k=o.page.subscribe(()=>{a&&(t(5,u=!0),t(6,L=document.title||"untitled page"))});return t(4,a=!0),k}),r.$$set=k=>{"stores"in k&&t(7,o=k.stores),"page"in k&&t(8,f=k.page),"components"in k&&t(0,c=k.components),"props_0"in k&&t(1,d=k.props_0),"props_1"in k&&t(2,n=k.props_1),"props_2"in k&&t(3,s=k.props_2)},r.$$.update=()=>{r.$$.dirty&384&&o.page.set(f)},[c,d,n,s,a,u,L,o,f]}class mt extends Me{constructor(e){super(),We(this,e,_t,ht,Ye,{stores:7,page:8,components:0,props_0:1,props_1:2,props_2:3})}}const gt={},de=[()=>ne(()=>import("./pages/__layout.svelte-611259e7.js"),["_app/immutable/pages/__layout.svelte-611259e7.js","_app/immutable/assets/__layout-7c002a88.css","_app/immutable/chunks/index-1530a265.js","_app/immutable/chunks/paths-b9644fda.js","_app/immutable/chunks/state-f33e1ee7.js","_app/immutable/chunks/preload-helper-23bf4dac.js","_app/immutable/chunks/theme-54fdbaea.js"]),()=>ne(()=>import("./error.svelte-521a283e.js"),["_app/immutable/error.svelte-521a283e.js","_app/immutable/chunks/index-1530a265.js"]),()=>ne(()=>import("./pages/edit.svelte-3dd31e72.js"),["_app/immutable/pages/edit.svelte-3dd31e72.js","_app/immutable/assets/edit-826332b8.css","_app/immutable/chunks/index-1530a265.js","_app/immutable/chunks/state-f33e1ee7.js","_app/immutable/chunks/preload-helper-23bf4dac.js","_app/immutable/chunks/theme-54fdbaea.js","_app/immutable/chunks/util-1c26cd9f.js","_app/immutable/assets/util-5eb0c13e.css","_app/immutable/chunks/paths-b9644fda.js"]),()=>ne(()=>import("./pages/index.svelte-94449298.js"),["_app/immutable/pages/index.svelte-94449298.js","_app/immutable/chunks/index-1530a265.js","_app/immutable/chunks/singletons-eca981c1.js","_app/immutable/chunks/paths-b9644fda.js"]),()=>ne(()=>import("./pages/view.svelte-0bce86d9.js"),["_app/immutable/pages/view.svelte-0bce86d9.js","_app/immutable/chunks/index-1530a265.js","_app/immutable/chunks/util-1c26cd9f.js","_app/immutable/assets/util-5eb0c13e.css","_app/immutable/chunks/state-f33e1ee7.js","_app/immutable/chunks/preload-helper-23bf4dac.js"])],wt={"":[[0,3],[1]],edit:[[0,2],[1]],view:[[0,4],[1]]};function jt(r){}function Ce(r){return r instanceof Error||r&&r.name&&r.message?r:new Error(JSON.stringify(r))}function Ve(r){if(!r)return{};if(r.fallthrough)throw new Error("fallthrough is no longer supported. Use matchers instead: https://kit.svelte.dev/docs/routing#advanced-routing-matching");if("maxage"in r)throw new Error("maxage should be replaced with cache: { maxage }");const e=r.status&&r.status>=400&&r.status<=599&&!r.redirect;if(r.error||e){const t=r.status;if(!r.error&&e)return{status:t||500,error:new Error(`${t}`)};const o=typeof r.error=="string"?new Error(r.error):r.error;return o instanceof Error?!t||t<400||t>599?(console.warn('"error" returned from load() without a valid status code \u2014 defaulting to 500'),{status:500,error:o}):{status:t,error:o}:{status:500,error:new Error(`"error" property returned from load() must be a string or instance of Error, received type "${typeof o}"`)}}if(r.redirect){if(!r.status||Math.floor(r.status/100)!==3)throw new Error('"redirect" property returned from load() must be accompanied by a 3xx status code');if(typeof r.redirect!="string")throw new Error('"redirect" property returned from load() must be a string')}if(r.dependencies&&(!Array.isArray(r.dependencies)||r.dependencies.some(t=>typeof t!="string")))throw new Error('"dependencies" property returned from load() must be of type string[]');if(r.context)throw new Error('You are returning "context" from a load function. "context" was renamed to "stuff", please adjust your code accordingly.');return r}function bt(r,e){return r==="/"||e==="ignore"?r:e==="never"?r.endsWith("/")?r.slice(0,-1):r:e==="always"&&!r.endsWith("/")?r+"/":r}function yt(r){for(const e in r)r[e]=r[e].replace(/%23/g,"#").replace(/%3[Bb]/g,";").replace(/%2[Cc]/g,",").replace(/%2[Ff]/g,"/").replace(/%3[Ff]/g,"?").replace(/%3[Aa]/g,":").replace(/%40/g,"@").replace(/%26/g,"&").replace(/%3[Dd]/g,"=").replace(/%2[Bb]/g,"+").replace(/%24/g,"$");return r}class vt extends URL{get hash(){throw new Error("url.hash is inaccessible from load. Consider accessing hash from the page store within the script tag of your component.")}}function ze(r){let e=r.baseURI;if(!e){const t=r.getElementsByTagName("base");e=t.length?t[0].href:r.URL}return e}function Ee(){return{x:pageXOffset,y:pageYOffset}}function qe(r){return r.composedPath().find(t=>t instanceof Node&&t.nodeName.toUpperCase()==="A")}function Be(r){return r instanceof SVGAElement?new URL(r.href.baseVal,document.baseURI):new URL(r.href)}function Je(r){const e=ue(r);let t=!0;function o(){t=!0,e.update(d=>d)}function f(d){t=!1,e.set(d)}function c(d){let n;return e.subscribe(s=>{(n===void 0||t&&s!==n)&&d(n=s)})}return{notify:o,set:f,subscribe:c}}function $t(){const{set:r,subscribe:e}=ue(!1);let t;async function o(){clearTimeout(t);const f=await fetch(`${it}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(f.ok){const{version:c}=await f.json(),d=c!=="1660285253753";return d&&(r(!0),clearTimeout(t)),d}else throw new Error(`Version check failed: ${f.status}`)}return{subscribe:e,check:o}}function kt(r){let e=5381,t=r.length;if(typeof r=="string")for(;t;)e=e*33^r.charCodeAt(--t);else for(;t;)e=e*33^r[--t];return(e>>>0).toString(36)}const Re=window.fetch;function Et(r,e){let o=`script[sveltekit\\:data-type="data"][sveltekit\\:data-url=${JSON.stringify(typeof r=="string"?r:r.url)}]`;e&&typeof e.body=="string"&&(o+=`[sveltekit\\:data-body="${kt(e.body)}"]`);const f=document.querySelector(o);if(f&&f.textContent){const{body:c,...d}=JSON.parse(f.textContent);return Promise.resolve(new Response(c,d))}return Re(r,e)}const Rt=/^(\.\.\.)?(\w+)(?:=(\w+))?$/;function Lt(r){const e=[],t=[];let o=!0;return{pattern:r===""?/^\/$/:new RegExp(`^${decodeURIComponent(r).split(/(?:@[a-zA-Z0-9_-]+)?(?:\/|$)/).map((c,d,n)=>{const s=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(c);if(s)return e.push(s[1]),t.push(s[2]),"(?:/(.*))?";const a=d===n.length-1;return c&&"/"+c.split(/\[(.+?)\]/).map((u,L)=>{if(L%2){const k=Rt.exec(u);if(!k)throw new Error(`Invalid param: ${u}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,Z,G,ce]=k;return e.push(G),t.push(ce),Z?"(.*?)":"([^/]+?)"}return a&&u.includes(".")&&(o=!1),u.normalize().replace(/%5[Bb]/g,"[").replace(/%5[Dd]/g,"]").replace(/#/g,"%23").replace(/\?/g,"%3F").replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("")}).join("")}${o?"/?":""}$`),names:e,types:t}}function St(r,e,t,o){const f={};for(let c=0;c<e.length;c+=1){const d=e[c],n=t[c],s=r[c+1]||"";if(n){const a=o[n];if(!a)throw new Error(`Missing "${n}" param matcher`);if(!a(s))return}f[d]=s}return f}function Ut(r,e,t){return Object.entries(e).map(([f,[c,d,n]])=>{const{pattern:s,names:a,types:u}=Lt(f);return{id:f,exec:L=>{const k=s.exec(L);if(k)return St(k,a,u,t)},a:c.map(L=>r[L]),b:d.map(L=>r[L]),has_shadow:!!n}})}const Fe="sveltekit:scroll",F="sveltekit:index",ve=Ut(de,wt,gt),At=de[0](),Ot=de[1](),Ke={};let re={};try{re=JSON.parse(sessionStorage[Fe])}catch{}function $e(r){re[r]=Ee()}function Nt({target:r,session:e,base:t,trailing_slash:o}){var Te;const f=new Map,c=[],d={url:Je({}),page:Je({}),navigating:ue(null),session:ue(e),updated:$t()},n={id:null,promise:null},s={before_navigate:[],after_navigate:[]};let a={branch:[],error:null,session_id:0,stuff:Ke,url:null},u=!1,L=!0,k=!1,Z=1,G=null,ce,Le,Se=!1;d.session.subscribe(async i=>{Le=i,!(!Se||(Z+=1,!a.branch.some(_=>_==null?void 0:_.uses.session)))&&me(new URL(location.href),[],!0)}),Se=!0;let X=!0,j=(Te=history.state)==null?void 0:Te[F];j||(j=Date.now(),history.replaceState({...history.state,[F]:j},"",location.href));const pe=re[j];pe&&(history.scrollRestoration="manual",scrollTo(pe.x,pe.y));let he=!1,_e,Ue;async function Ae(i,{noscroll:p=!1,replaceState:_=!1,keepfocus:l=!1,state:h={}},m){if(typeof i=="string"&&(i=new URL(i,ze(document))),X)return we({url:i,scroll:p?Ee():null,keepfocus:l,redirect_chain:m,details:{state:h,replaceState:_},accepted:()=>{},blocked:()=>{}});await te(i)}async function Oe(i){const p=xe(i);if(!p)throw new Error("Attempted to prefetch a URL that does not belong to this app");return n.promise=Pe(p,!1),n.id=p.id,n.promise}async function me(i,p,_,l,h){var R,U;const m=xe(i),v=Ue={};let g=m&&await Pe(m,_);if(!g&&i.origin===location.origin&&i.pathname===location.pathname&&(g=await ee({status:404,error:new Error(`Not found: ${i.pathname}`),url:i,routeId:null})),!g)return await te(i),!1;if(i=(m==null?void 0:m.url)||i,Ue!==v)return!1;if(c.length=0,g.redirect)if(p.length>10||p.includes(i.pathname))g=await ee({status:500,error:new Error("Redirect loop"),url:i,routeId:null});else return X?Ae(new URL(g.redirect,i).href,{},[...p,i.pathname]):await te(new URL(g.redirect,location.href)),!1;else((U=(R=g.props)==null?void 0:R.page)==null?void 0:U.status)>=400&&await d.updated.check()&&await te(i);if(k=!0,l&&l.details){const{details:E}=l,O=E.replaceState?0:1;E.state[F]=j+=O,history[E.replaceState?"replaceState":"pushState"](E.state,"",i)}if(u?(a=g.state,g.props.page&&(g.props.page.url=i),ce.$set(g.props)):Ne(g),l){const{scroll:E,keepfocus:O}=l;if(!O){const y=document.body,b=y.getAttribute("tabindex");y.tabIndex=-1,y.focus({preventScroll:!0}),setTimeout(()=>{var $;($=getSelection())==null||$.removeAllRanges()}),b!==null?y.setAttribute("tabindex",b):y.removeAttribute("tabindex")}if(await Ie(),L){const y=i.hash&&document.getElementById(i.hash.slice(1));E?scrollTo(E.x,E.y):y?y.scrollIntoView():scrollTo(0,0)}}else await Ie();n.promise=null,n.id=null,L=!0,g.props.page&&(_e=g.props.page);const w=g.state.branch[g.state.branch.length-1];X=(w==null?void 0:w.module.router)!==!1,h&&h(),k=!1}function Ne(i){a=i.state;const p=document.querySelector("style[data-sveltekit]");if(p&&p.remove(),_e=i.props.page,ce=new mt({target:r,props:{...i.props,stores:d},hydrate:!0}),X){const _={from:null,to:new URL(location.href)};s.after_navigate.forEach(l=>l(_))}u=!0}async function ge({url:i,params:p,stuff:_,branch:l,status:h,error:m,routeId:v}){var y,b;const g=l.filter(Boolean),w=g.find($=>{var S;return(S=$.loaded)==null?void 0:S.redirect}),R={redirect:(y=w==null?void 0:w.loaded)==null?void 0:y.redirect,state:{url:i,params:p,branch:l,error:m,stuff:_,session_id:Z},props:{components:g.map($=>$.module.default)}};for(let $=0;$<g.length;$+=1)if(!a.branch.some(S=>S===g[$])){const S=g[$].loaded;R.props[`props_${$}`]=S?await S.props:null}if(!a.url||i.href!==a.url.href||a.error!==m||a.stuff!==_){R.props.page={error:m,params:p,routeId:v,status:h,stuff:_,url:i};const $=(S,V)=>{Object.defineProperty(R.props.page,S,{get:()=>{throw new Error(`$page.${S} has been replaced by $page.url.${V}`)}})};$("origin","origin"),$("path","pathname"),$("query","searchParams")}const E=g[g.length-1],O=(b=E==null?void 0:E.loaded)==null?void 0:b.cache;if(O){const $=i.pathname+i.search;let S=!1;const V=()=>{f.get($)===R&&f.delete($),N(),clearTimeout(A)},A=setTimeout(V,O.maxage*1e3),N=d.session.subscribe(()=>{S&&V()});S=!0,f.set($,R)}return R}async function Q({status:i,error:p,module:_,url:l,params:h,stuff:m,props:v,routeId:g}){const w={module:_,uses:{params:new Set,url:!1,session:!1,stuff:!1,dependencies:new Set},loaded:null,stuff:m};function R(y){const{href:b}=new URL(y,l);w.uses.dependencies.add(b)}v&&w.uses.dependencies.add(l.href);const U={};for(const y in h)Object.defineProperty(U,y,{get(){return w.uses.params.add(y),h[y]},enumerable:!0});const E=Le,O=new vt(l);if(_.load){const y={routeId:g,params:U,props:v||{},get url(){return w.uses.url=!0,O},get session(){return w.uses.session=!0,E},get stuff(){return w.uses.stuff=!0,{...m}},async fetch(b,$){let S;typeof b=="string"?S=b:(S=b.url,$={body:b.method==="GET"||b.method==="HEAD"?void 0:await b.blob(),cache:b.cache,credentials:b.credentials,headers:b.headers,integrity:b.integrity,keepalive:b.keepalive,method:b.method,mode:b.mode,redirect:b.redirect,referrer:b.referrer,referrerPolicy:b.referrerPolicy,signal:b.signal,...$});const V=new URL(S,l).href;return R(V),u?Re(V,$):Et(S,$)},status:i!=null?i:null,error:p!=null?p:null};w.loaded=Ve(await _.load.call(null,y)),w.loaded.stuff&&(w.stuff=w.loaded.stuff),w.loaded.dependencies&&w.loaded.dependencies.forEach(R)}else v&&(w.loaded=Ve({props:v}));return w}async function Pe({id:i,url:p,params:_,route:l},h){var b,$,S,V;if(n.id===i&&n.promise)return n.promise;if(!h){const A=f.get(i);if(A)return A}const{a:m,b:v,has_shadow:g}=l,w=a.url&&{url:i!==a.url.pathname+a.url.search,params:Object.keys(_).filter(A=>a.params[A]!==_[A]),session:Z!==a.session_id};let R=[],U=Ke,E=!1,O=200,y=null;m.forEach(A=>A().catch(()=>{}));e:for(let A=0;A<m.length;A+=1){let N;try{if(!m[A])continue;const P=await m[A](),D=a.branch[A];if(!D||P!==D.module||w.url&&D.uses.url||w.params.some(M=>D.uses.params.has(M))||w.session&&D.uses.session||Array.from(D.uses.dependencies).some(M=>c.some(fe=>fe(M)))||E&&D.uses.stuff){let M={};const fe=g&&A===m.length-1;if(fe){const H=await Re(`${p.pathname}${p.pathname.endsWith("/")?"":"/"}__data.json${p.search}`,{headers:{"x-sveltekit-load":"true"}});if(H.ok){const be=H.headers.get("x-sveltekit-location");if(be)return{redirect:be,props:{},state:a};M=H.status===204?{}:await H.json()}else{O=H.status;try{y=await H.json()}catch{y=new Error("Failed to load data")}}}if(y||(N=await Q({module:P,url:p,params:_,props:M,stuff:U,routeId:l.id})),N&&(fe&&(N.uses.url=!0),N.loaded)){if(N.loaded.error&&(O=(b=N.loaded.status)!=null?b:500,y=N.loaded.error),N.loaded.redirect)return{redirect:N.loaded.redirect,props:{},state:a};N.loaded.stuff&&(E=!0)}}else N=D}catch(P){O=500,y=Ce(P)}if(y){for(;A--;)if(v[A]){let P,D,le=A;for(;!(D=R[le]);)le-=1;try{if(P=await Q({status:O,error:y,module:await v[A](),url:p,params:_,stuff:D.stuff,routeId:l.id}),($=P==null?void 0:P.loaded)!=null&&$.error)continue;(S=P==null?void 0:P.loaded)!=null&&S.stuff&&(U={...U,...P.loaded.stuff}),R=R.slice(0,le+1).concat(P);break e}catch{continue}}return await ee({status:O,error:y,url:p,routeId:l.id})}else(V=N==null?void 0:N.loaded)!=null&&V.stuff&&(U={...U,...N.loaded.stuff}),R.push(N)}return await ge({url:p,params:_,stuff:U,branch:R,status:O,error:y,routeId:l.id})}async function ee({status:i,error:p,url:_,routeId:l}){var g,w;const h={},m=await Q({module:await At,url:_,params:h,stuff:{},routeId:l}),v=await Q({status:i,error:p,module:await Ot,url:_,params:h,stuff:m&&m.loaded&&m.loaded.stuff||{},routeId:l});return await ge({url:_,params:h,stuff:{...(g=m==null?void 0:m.loaded)==null?void 0:g.stuff,...(w=v==null?void 0:v.loaded)==null?void 0:w.stuff},branch:[m,v],status:i,error:p,routeId:l})}function xe(i){if(i.origin!==location.origin||!i.pathname.startsWith(t))return;const p=decodeURI(i.pathname.slice(t.length)||"/");for(const _ of ve){const l=_.exec(p);if(l){const h=new URL(i.origin+bt(i.pathname,o)+i.search+i.hash);return{id:h.pathname+h.search,route:_,params:yt(l),url:h}}}}async function we({url:i,scroll:p,keepfocus:_,redirect_chain:l,details:h,accepted:m,blocked:v}){const g=a.url;let w=!1;const R={from:g,to:i,cancel:()=>w=!0};if(s.before_navigate.forEach(U=>U(R)),w){v();return}$e(j),m(),u&&d.navigating.set({from:a.url,to:i}),await me(i,l,!1,{scroll:p,keepfocus:_,details:h},()=>{const U={from:g,to:i};s.after_navigate.forEach(E=>E(U)),d.navigating.set(null)})}function te(i){return location.href=i.href,new Promise(()=>{})}return{after_navigate:i=>{ke(()=>(s.after_navigate.push(i),()=>{const p=s.after_navigate.indexOf(i);s.after_navigate.splice(p,1)}))},before_navigate:i=>{ke(()=>(s.before_navigate.push(i),()=>{const p=s.before_navigate.indexOf(i);s.before_navigate.splice(p,1)}))},disable_scroll_handling:()=>{(k||!u)&&(L=!1)},goto:(i,p={})=>Ae(i,p,[]),invalidate:i=>{if(typeof i=="function")c.push(i);else{const{href:p}=new URL(i,location.href);c.push(_=>_===p)}return G||(G=Promise.resolve().then(async()=>{await me(new URL(location.href),[],!0),G=null})),G},prefetch:async i=>{const p=new URL(i,ze(document));await Oe(p)},prefetch_routes:async i=>{const _=(i?ve.filter(l=>i.some(h=>l.exec(h))):ve).map(l=>Promise.all(l.a.map(h=>h())));await Promise.all(_)},_start_router:()=>{history.scrollRestoration="manual",addEventListener("beforeunload",l=>{let h=!1;const m={from:a.url,to:null,cancel:()=>h=!0};s.before_navigate.forEach(v=>v(m)),h?(l.preventDefault(),l.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){$e(j);try{sessionStorage[Fe]=JSON.stringify(re)}catch{}}});const i=l=>{const h=qe(l);h&&h.href&&h.hasAttribute("sveltekit:prefetch")&&Oe(Be(h))};let p;const _=l=>{clearTimeout(p),p=setTimeout(()=>{var h;(h=l.target)==null||h.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",i),addEventListener("mousemove",_),addEventListener("sveltekit:trigger_prefetch",i),addEventListener("click",l=>{if(!X||l.button||l.which!==1||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||l.defaultPrevented)return;const h=qe(l);if(!h||!h.href)return;const m=h instanceof SVGAElement,v=Be(h);if(!m&&!(v.protocol==="https:"||v.protocol==="http:"))return;const g=(h.getAttribute("rel")||"").split(/\s+/);if(h.hasAttribute("download")||g.includes("external")||h.hasAttribute("sveltekit:reload")||(m?h.target.baseVal:h.target))return;const[w,R]=v.href.split("#");if(R!==void 0&&w===location.href.split("#")[0]){he=!0,$e(j),d.page.set({..._e,url:v}),d.page.notify();return}we({url:v,scroll:h.hasAttribute("sveltekit:noscroll")?Ee():null,keepfocus:!1,redirect_chain:[],details:{state:{},replaceState:v.href===location.href},accepted:()=>l.preventDefault(),blocked:()=>l.preventDefault()})}),addEventListener("popstate",l=>{if(l.state&&X){if(l.state[F]===j)return;we({url:new URL(location.href),scroll:re[l.state[F]],keepfocus:!1,redirect_chain:[],details:null,accepted:()=>{j=l.state[F]},blocked:()=>{const h=j-l.state[F];history.go(h)}})}}),addEventListener("hashchange",()=>{he&&(he=!1,history.replaceState({...history.state,[F]:++j},"",location.href))});for(const l of document.querySelectorAll("link"))l.rel==="icon"&&(l.href=l.href);addEventListener("pageshow",l=>{l.persisted&&d.navigating.set(null)})},_hydrate:async({status:i,error:p,nodes:_,params:l,routeId:h})=>{var U;const m=new URL(location.href),v=[];let g={},w,R;try{for(let E=0;E<_.length;E+=1){const O=E===_.length-1;let y;if(O){const $=document.querySelector('script[sveltekit\\:data-type="props"]');$&&(y=JSON.parse($.textContent))}const b=await Q({module:await de[_[E]](),url:m,params:l,stuff:g,status:O?i:void 0,error:O?p:void 0,props:y,routeId:h});if(y&&(b.uses.dependencies.add(m.href),b.uses.url=!0),v.push(b),b&&b.loaded)if(b.loaded.error){if(p)throw b.loaded.error;R={status:(U=b.loaded.status)!=null?U:500,error:b.loaded.error,url:m,routeId:h}}else b.loaded.stuff&&(g={...g,...b.loaded.stuff})}w=R?await ee(R):await ge({url:m,params:l,stuff:g,branch:v,status:i,error:p,routeId:h})}catch(E){if(p)throw E;w=await ee({status:500,error:Ce(E),url:m,routeId:h})}w.redirect&&await te(new URL(w.redirect,location.href)),Ne(w)}}}async function Dt({paths:r,target:e,session:t,route:o,spa:f,trailing_slash:c,hydrate:d}){const n=Nt({target:e,session:t,base:r.base,trailing_slash:c});ot({client:n}),at(r),d&&await n._hydrate(d),o&&(f&&n.goto(location.href,{replaceState:!0}),n._start_router()),dispatchEvent(new CustomEvent("sveltekit:start"))}export{jt as set_public_env,Dt as start};