From 38114cdd0c6be21080c9ba8bb922e8cc5df752a9 Mon Sep 17 00:00:00 2001 From: Yifan Sun Date: Wed, 14 Jun 2023 12:36:56 -0400 Subject: [PATCH] Use svelte --- .gitignore | 3 +- .svelte-kit/ambient.d.ts | 195 + .svelte-kit/generated/client-optimized/app.js | 19 + .../generated/client-optimized/matchers.js | 1 + .../generated/client-optimized/nodes/0.js | 1 + .../generated/client-optimized/nodes/1.js | 1 + .../generated/client-optimized/nodes/2.js | 1 + .svelte-kit/generated/client/app.js | 19 + .svelte-kit/generated/client/matchers.js | 1 + .svelte-kit/generated/client/nodes/0.js | 1 + .svelte-kit/generated/client/nodes/1.js | 1 + .svelte-kit/generated/client/nodes/2.js | 1 + .svelte-kit/generated/root.svelte | 54 + .svelte-kit/generated/server/internal.js | 29 + .../_app/immutable/chunks/index.6dba6488.js | 1 + .../immutable/chunks/singletons.fe037310.js | 1 + .../_app/immutable/entry/app.f1208d35.js | 1 + .../_app/immutable/entry/start.72f1829c.js | 3 + .../client/_app/immutable/nodes/0.6ca3df57.js | 1 + .../client/_app/immutable/nodes/1.0e42448f.js | 1 + .../client/_app/immutable/nodes/2.ad52e74a.js | 1 + .svelte-kit/output/client/_app/version.json | 1 + .svelte-kit/output/client/favicon.png | Bin 0 -> 1571 bytes .svelte-kit/output/server/chunks/index.js | 112 + .svelte-kit/output/server/chunks/internal.js | 189 + .../server/entries/fallbacks/error.svelte.js | 32 + .../server/entries/fallbacks/layout.svelte.js | 7 + .../server/entries/pages/_page.svelte.js | 8 + .svelte-kit/output/server/index.js | 2837 ++++++++++++++ .svelte-kit/output/server/internal.js | 9 + .svelte-kit/output/server/manifest-full.js | 27 + .svelte-kit/output/server/manifest.js | 27 + .svelte-kit/output/server/nodes/0.js | 7 + .svelte-kit/output/server/nodes/1.js | 7 + .svelte-kit/output/server/nodes/2.js | 7 + .svelte-kit/tsconfig.json | 39 + .svelte-kit/types/route_meta_data.json | 3 + .svelte-kit/types/src/routes/$types.d.ts | 20 + package-lock.json | 3325 +++++++++++++++++ package.json | 33 + sarchlab/.eslintignore | 13 + sarchlab/.eslintrc.cjs | 30 + sarchlab/.gitignore | 10 + sarchlab/.npmrc | 2 + sarchlab/.prettierignore | 13 + sarchlab/.prettierrc | 9 + src/app.d.ts | 12 + src/app.html | 12 + src/routes/+page.svelte | 2 + static/favicon.png | Bin 0 -> 1571 bytes svelte.config.js | 18 + tsconfig.json | 17 + vite.config.ts | 6 + 53 files changed, 7169 insertions(+), 1 deletion(-) create mode 100644 .svelte-kit/ambient.d.ts create mode 100644 .svelte-kit/generated/client-optimized/app.js create mode 100644 .svelte-kit/generated/client-optimized/matchers.js create mode 100644 .svelte-kit/generated/client-optimized/nodes/0.js create mode 100644 .svelte-kit/generated/client-optimized/nodes/1.js create mode 100644 .svelte-kit/generated/client-optimized/nodes/2.js create mode 100644 .svelte-kit/generated/client/app.js create mode 100644 .svelte-kit/generated/client/matchers.js create mode 100644 .svelte-kit/generated/client/nodes/0.js create mode 100644 .svelte-kit/generated/client/nodes/1.js create mode 100644 .svelte-kit/generated/client/nodes/2.js create mode 100644 .svelte-kit/generated/root.svelte create mode 100644 .svelte-kit/generated/server/internal.js create mode 100644 .svelte-kit/output/client/_app/immutable/chunks/index.6dba6488.js create mode 100644 .svelte-kit/output/client/_app/immutable/chunks/singletons.fe037310.js create mode 100644 .svelte-kit/output/client/_app/immutable/entry/app.f1208d35.js create mode 100644 .svelte-kit/output/client/_app/immutable/entry/start.72f1829c.js create mode 100644 .svelte-kit/output/client/_app/immutable/nodes/0.6ca3df57.js create mode 100644 .svelte-kit/output/client/_app/immutable/nodes/1.0e42448f.js create mode 100644 .svelte-kit/output/client/_app/immutable/nodes/2.ad52e74a.js create mode 100644 .svelte-kit/output/client/_app/version.json create mode 100644 .svelte-kit/output/client/favicon.png create mode 100644 .svelte-kit/output/server/chunks/index.js create mode 100644 .svelte-kit/output/server/chunks/internal.js create mode 100644 .svelte-kit/output/server/entries/fallbacks/error.svelte.js create mode 100644 .svelte-kit/output/server/entries/fallbacks/layout.svelte.js create mode 100644 .svelte-kit/output/server/entries/pages/_page.svelte.js create mode 100644 .svelte-kit/output/server/index.js create mode 100644 .svelte-kit/output/server/internal.js create mode 100644 .svelte-kit/output/server/manifest-full.js create mode 100644 .svelte-kit/output/server/manifest.js create mode 100644 .svelte-kit/output/server/nodes/0.js create mode 100644 .svelte-kit/output/server/nodes/1.js create mode 100644 .svelte-kit/output/server/nodes/2.js create mode 100644 .svelte-kit/tsconfig.json create mode 100644 .svelte-kit/types/route_meta_data.json create mode 100644 .svelte-kit/types/src/routes/$types.d.ts create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 sarchlab/.eslintignore create mode 100644 sarchlab/.eslintrc.cjs create mode 100644 sarchlab/.gitignore create mode 100644 sarchlab/.npmrc create mode 100644 sarchlab/.prettierignore create mode 100644 sarchlab/.prettierrc create mode 100644 src/app.d.ts create mode 100644 src/app.html create mode 100644 src/routes/+page.svelte create mode 100644 static/favicon.png create mode 100644 svelte.config.js create mode 100644 tsconfig.json create mode 100644 vite.config.ts diff --git a/.gitignore b/.gitignore index 496ee2c..91dfed8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.DS_Store \ No newline at end of file +.DS_Store +node_modules \ No newline at end of file diff --git a/.svelte-kit/ambient.d.ts b/.svelte-kit/ambient.d.ts new file mode 100644 index 0000000..70af184 --- /dev/null +++ b/.svelte-kit/ambient.d.ts @@ -0,0 +1,195 @@ + +// this file is generated — do not edit it + + +/// + +/** + * Environment variables [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env`. Like [`$env/dynamic/private`](https://kit.svelte.dev/docs/modules#$env-dynamic-private), this module cannot be imported into client-side code. This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://kit.svelte.dev/docs/configuration#env). + * + * _Unlike_ [`$env/dynamic/private`](https://kit.svelte.dev/docs/modules#$env-dynamic-private), the values exported from this module are statically injected into your bundle at build time, enabling optimisations like dead code elimination. + * + * ```ts + * import { API_KEY } from '$env/static/private'; + * ``` + * + * Note that all environment variables referenced in your code should be declared (for example in an `.env` file), even if they don't have a value until the app is deployed: + * + * ``` + * MY_FEATURE_FLAG="" + * ``` + * + * You can override `.env` values from the command line like so: + * + * ```bash + * MY_FEATURE_FLAG="enabled" npm run dev + * ``` + */ +declare module '$env/static/private' { + export const MANPATH: string; + export const TERM_PROGRAM: string; + export const NODE: string; + export const INIT_CWD: string; + export const TERM: string; + export const SHELL: string; + export const npm_config_metrics_registry: string; + export const HOMEBREW_REPOSITORY: string; + export const TMPDIR: string; + export const npm_config_global_prefix: string; + export const TERM_PROGRAM_VERSION: string; + export const ZDOTDIR: string; + export const ORIGINAL_XDG_CURRENT_DESKTOP: string; + export const MallocNanoZone: string; + export const COLOR: string; + export const npm_config_noproxy: string; + export const npm_config_local_prefix: string; + export const USER: string; + export const COMMAND_MODE: string; + export const npm_config_globalconfig: string; + export const SSH_AUTH_SOCK: string; + export const __CF_USER_TEXT_ENCODING: string; + export const npm_execpath: string; + export const PATH: string; + export const npm_package_json: string; + export const _: string; + export const npm_config_userconfig: string; + export const npm_config_init_module: string; + export const USER_ZDOTDIR: string; + export const __CFBundleIdentifier: string; + export const npm_command: string; + export const PWD: string; + export const npm_lifecycle_event: string; + export const EDITOR: string; + export const npm_package_name: string; + export const LANG: string; + export const VSCODE_GIT_ASKPASS_EXTRA_ARGS: string; + export const XPC_FLAGS: string; + export const npm_config_node_gyp: string; + export const npm_package_version: string; + export const XPC_SERVICE_NAME: string; + export const VSCODE_INJECTION: string; + export const SHLVL: string; + export const HOME: string; + export const VSCODE_GIT_ASKPASS_MAIN: string; + export const HOMEBREW_PREFIX: string; + export const npm_config_cache: string; + export const LOGNAME: string; + export const npm_lifecycle_script: string; + export const VSCODE_GIT_IPC_HANDLE: string; + export const npm_config_user_agent: string; + export const INFOPATH: string; + export const HOMEBREW_CELLAR: string; + export const VSCODE_GIT_ASKPASS_NODE: string; + export const GIT_ASKPASS: string; + export const npm_node_execpath: string; + export const npm_config_prefix: string; + export const COLORTERM: string; + export const NODE_ENV: string; +} + +/** + * Similar to [`$env/static/private`](https://kit.svelte.dev/docs/modules#$env-static-private), except that it only includes environment variables that begin with [`config.kit.env.publicPrefix`](https://kit.svelte.dev/docs/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code. + * + * Values are replaced statically at build time. + * + * ```ts + * import { PUBLIC_BASE_URL } from '$env/static/public'; + * ``` + */ +declare module '$env/static/public' { + +} + +/** + * This module provides access to runtime environment variables, as defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/master/packages/adapter-node) (or running [`vite preview`](https://kit.svelte.dev/docs/cli)), this is equivalent to `process.env`. This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://kit.svelte.dev/docs/configuration#env). + * + * This module cannot be imported into client-side code. + * + * ```ts + * import { env } from '$env/dynamic/private'; + * console.log(env.DEPLOYMENT_SPECIFIC_VARIABLE); + * ``` + * + * > In `dev`, `$env/dynamic` always includes environment variables from `.env`. In `prod`, this behavior will depend on your adapter. + */ +declare module '$env/dynamic/private' { + export const env: { + MANPATH: string; + TERM_PROGRAM: string; + NODE: string; + INIT_CWD: string; + TERM: string; + SHELL: string; + npm_config_metrics_registry: string; + HOMEBREW_REPOSITORY: string; + TMPDIR: string; + npm_config_global_prefix: string; + TERM_PROGRAM_VERSION: string; + ZDOTDIR: string; + ORIGINAL_XDG_CURRENT_DESKTOP: string; + MallocNanoZone: string; + COLOR: string; + npm_config_noproxy: string; + npm_config_local_prefix: string; + USER: string; + COMMAND_MODE: string; + npm_config_globalconfig: string; + SSH_AUTH_SOCK: string; + __CF_USER_TEXT_ENCODING: string; + npm_execpath: string; + PATH: string; + npm_package_json: string; + _: string; + npm_config_userconfig: string; + npm_config_init_module: string; + USER_ZDOTDIR: string; + __CFBundleIdentifier: string; + npm_command: string; + PWD: string; + npm_lifecycle_event: string; + EDITOR: string; + npm_package_name: string; + LANG: string; + VSCODE_GIT_ASKPASS_EXTRA_ARGS: string; + XPC_FLAGS: string; + npm_config_node_gyp: string; + npm_package_version: string; + XPC_SERVICE_NAME: string; + VSCODE_INJECTION: string; + SHLVL: string; + HOME: string; + VSCODE_GIT_ASKPASS_MAIN: string; + HOMEBREW_PREFIX: string; + npm_config_cache: string; + LOGNAME: string; + npm_lifecycle_script: string; + VSCODE_GIT_IPC_HANDLE: string; + npm_config_user_agent: string; + INFOPATH: string; + HOMEBREW_CELLAR: string; + VSCODE_GIT_ASKPASS_NODE: string; + GIT_ASKPASS: string; + npm_node_execpath: string; + npm_config_prefix: string; + COLORTERM: string; + NODE_ENV: string; + [key: `PUBLIC_${string}`]: undefined; + [key: string]: string | undefined; + } +} + +/** + * Similar to [`$env/dynamic/private`](https://kit.svelte.dev/docs/modules#$env-dynamic-private), but only includes variables that begin with [`config.kit.env.publicPrefix`](https://kit.svelte.dev/docs/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code. + * + * Note that public dynamic environment variables must all be sent from the server to the client, causing larger network requests — when possible, use `$env/static/public` instead. + * + * ```ts + * import { env } from '$env/dynamic/public'; + * console.log(env.PUBLIC_DEPLOYMENT_SPECIFIC_VARIABLE); + * ``` + */ +declare module '$env/dynamic/public' { + export const env: { + [key: `PUBLIC_${string}`]: string | undefined; + } +} diff --git a/.svelte-kit/generated/client-optimized/app.js b/.svelte-kit/generated/client-optimized/app.js new file mode 100644 index 0000000..ac5c9be --- /dev/null +++ b/.svelte-kit/generated/client-optimized/app.js @@ -0,0 +1,19 @@ +export { matchers } from './matchers.js'; + +export const nodes = [ + () => import('./nodes/0'), + () => import('./nodes/1'), + () => import('./nodes/2') +]; + +export const server_loads = []; + +export const dictionary = { + "/": [2] + }; + +export const hooks = { + handleError: (({ error }) => { console.error(error) }), +}; + +export { default as root } from '../root.svelte'; \ No newline at end of file diff --git a/.svelte-kit/generated/client-optimized/matchers.js b/.svelte-kit/generated/client-optimized/matchers.js new file mode 100644 index 0000000..f6bd30a --- /dev/null +++ b/.svelte-kit/generated/client-optimized/matchers.js @@ -0,0 +1 @@ +export const matchers = {}; \ No newline at end of file diff --git a/.svelte-kit/generated/client-optimized/nodes/0.js b/.svelte-kit/generated/client-optimized/nodes/0.js new file mode 100644 index 0000000..3a11335 --- /dev/null +++ b/.svelte-kit/generated/client-optimized/nodes/0.js @@ -0,0 +1 @@ +export { default as component } from "../../../../node_modules/@sveltejs/kit/src/runtime/components/layout.svelte"; \ No newline at end of file diff --git a/.svelte-kit/generated/client-optimized/nodes/1.js b/.svelte-kit/generated/client-optimized/nodes/1.js new file mode 100644 index 0000000..35bc24b --- /dev/null +++ b/.svelte-kit/generated/client-optimized/nodes/1.js @@ -0,0 +1 @@ +export { default as component } from "../../../../node_modules/@sveltejs/kit/src/runtime/components/error.svelte"; \ No newline at end of file diff --git a/.svelte-kit/generated/client-optimized/nodes/2.js b/.svelte-kit/generated/client-optimized/nodes/2.js new file mode 100644 index 0000000..1cb4f85 --- /dev/null +++ b/.svelte-kit/generated/client-optimized/nodes/2.js @@ -0,0 +1 @@ +export { default as component } from "../../../../src/routes/+page.svelte"; \ No newline at end of file diff --git a/.svelte-kit/generated/client/app.js b/.svelte-kit/generated/client/app.js new file mode 100644 index 0000000..ac5c9be --- /dev/null +++ b/.svelte-kit/generated/client/app.js @@ -0,0 +1,19 @@ +export { matchers } from './matchers.js'; + +export const nodes = [ + () => import('./nodes/0'), + () => import('./nodes/1'), + () => import('./nodes/2') +]; + +export const server_loads = []; + +export const dictionary = { + "/": [2] + }; + +export const hooks = { + handleError: (({ error }) => { console.error(error) }), +}; + +export { default as root } from '../root.svelte'; \ No newline at end of file diff --git a/.svelte-kit/generated/client/matchers.js b/.svelte-kit/generated/client/matchers.js new file mode 100644 index 0000000..f6bd30a --- /dev/null +++ b/.svelte-kit/generated/client/matchers.js @@ -0,0 +1 @@ +export const matchers = {}; \ No newline at end of file diff --git a/.svelte-kit/generated/client/nodes/0.js b/.svelte-kit/generated/client/nodes/0.js new file mode 100644 index 0000000..3a11335 --- /dev/null +++ b/.svelte-kit/generated/client/nodes/0.js @@ -0,0 +1 @@ +export { default as component } from "../../../../node_modules/@sveltejs/kit/src/runtime/components/layout.svelte"; \ No newline at end of file diff --git a/.svelte-kit/generated/client/nodes/1.js b/.svelte-kit/generated/client/nodes/1.js new file mode 100644 index 0000000..35bc24b --- /dev/null +++ b/.svelte-kit/generated/client/nodes/1.js @@ -0,0 +1 @@ +export { default as component } from "../../../../node_modules/@sveltejs/kit/src/runtime/components/error.svelte"; \ No newline at end of file diff --git a/.svelte-kit/generated/client/nodes/2.js b/.svelte-kit/generated/client/nodes/2.js new file mode 100644 index 0000000..1cb4f85 --- /dev/null +++ b/.svelte-kit/generated/client/nodes/2.js @@ -0,0 +1 @@ +export { default as component } from "../../../../src/routes/+page.svelte"; \ No newline at end of file diff --git a/.svelte-kit/generated/root.svelte b/.svelte-kit/generated/root.svelte new file mode 100644 index 0000000..e061565 --- /dev/null +++ b/.svelte-kit/generated/root.svelte @@ -0,0 +1,54 @@ + + + +{#if constructors[1]} + + + +{:else} + +{/if} + +{#if mounted} +
+ {#if navigated} + {title} + {/if} +
+{/if} \ No newline at end of file diff --git a/.svelte-kit/generated/server/internal.js b/.svelte-kit/generated/server/internal.js new file mode 100644 index 0000000..f3d19e9 --- /dev/null +++ b/.svelte-kit/generated/server/internal.js @@ -0,0 +1,29 @@ + +import root from '../root.svelte'; +import { set_building } from '__sveltekit/environment'; +import { set_assets } from '__sveltekit/paths'; +import { set_private_env, set_public_env } from '../../../node_modules/@sveltejs/kit/src/runtime/shared-server.js'; + +export const options = { + app_template_contains_nonce: false, + csp: {"mode":"auto","directives":{"upgrade-insecure-requests":false,"block-all-mixed-content":false},"reportOnly":{"upgrade-insecure-requests":false,"block-all-mixed-content":false}}, + csrf_check_origin: true, + track_server_fetches: false, + embedded: false, + env_public_prefix: 'PUBLIC_', + hooks: null, // added lazily, via `get_hooks` + preload_strategy: "modulepreload", + root, + service_worker: false, + templates: { + app: ({ head, body, assets, nonce, env }) => "\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t" + head + "\n\t\n\t\n\t\t
" + body + "
\n\t\n\n", + error: ({ status, message }) => "\n\n\t\n\t\t\n\t\t" + message + "\n\n\t\t\n\t\n\t\n\t\t
\n\t\t\t" + status + "\n\t\t\t
\n\t\t\t\t

" + message + "

\n\t\t\t
\n\t\t
\n\t\n\n" + }, + version_hash: "1rrmbx2" +}; + +export function get_hooks() { + return {}; +} + +export { set_assets, set_building, set_private_env, set_public_env }; diff --git a/.svelte-kit/output/client/_app/immutable/chunks/index.6dba6488.js b/.svelte-kit/output/client/_app/immutable/chunks/index.6dba6488.js new file mode 100644 index 0000000..fd82f9a --- /dev/null +++ b/.svelte-kit/output/client/_app/immutable/chunks/index.6dba6488.js @@ -0,0 +1 @@ +function $(){}function H(t,n){for(const e in n)t[e]=n[e];return t}function B(t){return t()}function C(){return Object.create(null)}function g(t){t.forEach(B)}function O(t){return typeof t=="function"}function lt(t,n){return t!=t?n==n:t!==n||t&&typeof t=="object"||typeof t=="function"}function I(t){return Object.keys(t).length===0}function G(t,...n){if(t==null)return $;const e=t.subscribe(...n);return e.unsubscribe?()=>e.unsubscribe():e}function ut(t,n,e){t.$$.on_destroy.push(G(n,e))}function ot(t,n,e,i){if(t){const r=P(t,n,e,i);return t[0](r)}}function P(t,n,e,i){return t[1]&&i?H(e.ctx.slice(),t[1](i(n))):e.ctx}function st(t,n,e,i){if(t[2]&&i){const r=t[2](i(e));if(n.dirty===void 0)return r;if(typeof r=="object"){const s=[],c=Math.max(n.dirty.length,r.length);for(let o=0;o32){const n=[],e=t.ctx.length/32;for(let i=0;i>1);e(r)<=i?t=r+1:n=r}return t}function K(t){if(t.hydrate_init)return;t.hydrate_init=!0;let n=t.childNodes;if(t.nodeName==="HEAD"){const l=[];for(let u=0;u0&&n[e[r]].claim_order<=u?r+1:J(1,r,x=>n[e[x]].claim_order,u))-1;i[l]=e[a]+1;const f=a+1;e[f]=l,r=Math.max(f,r)}const s=[],c=[];let o=n.length-1;for(let l=e[r]+1;l!=0;l=i[l-1]){for(s.push(n[l-1]);o>=l;o--)c.push(n[o]);o--}for(;o>=0;o--)c.push(n[o]);s.reverse(),c.sort((l,u)=>l.claim_order-u.claim_order);for(let l=0,u=0;l=s[u].claim_order;)u++;const a=u{for(let c=t.claim_info.last_index;c=0;c--){const o=t[c];if(n(o)){const l=e(o);return l===void 0?t.splice(c,1):t[c]=l,r?l===void 0&&t.claim_info.last_index--:t.claim_info.last_index=c,o}}return i()})();return s.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1,s}function Y(t,n,e,i){return T(t,r=>r.nodeName===n,r=>{const s=[];for(let c=0;cr.removeAttribute(c))},()=>i(n))}function pt(t,n,e){return Y(t,n,e,U)}function Z(t,n){return T(t,e=>e.nodeType===3,e=>{const i=""+n;if(e.data.startsWith(i)){if(e.data.length!==i.length)return e.splitText(i.length)}else e.data=i},()=>A(n),!0)}function yt(t){return Z(t," ")}function gt(t,n){n=""+n,t.data!==n&&(t.data=n)}function xt(t,n,e,i){e==null?t.style.removeProperty(n):t.style.setProperty(n,e,i?"important":"")}function bt(t,n){return new t(n)}let y;function p(t){y=t}function q(){if(!y)throw new Error("Function called outside component initialization");return y}function $t(t){q().$$.on_mount.push(t)}function wt(t){q().$$.after_update.push(t)}const h=[],k=[];let m=[];const M=[],z=Promise.resolve();let v=!1;function D(){v||(v=!0,z.then(F))}function Et(){return D(),z}function N(t){m.push(t)}const E=new Set;let _=0;function F(){if(_!==0)return;const t=y;do{try{for(;_t.indexOf(i)===-1?n.push(i):e.push(i)),e.forEach(i=>i()),m=n}const b=new Set;let d;function vt(){d={r:0,c:[],p:d}}function Nt(){d.r||g(d.c),d=d.p}function et(t,n){t&&t.i&&(b.delete(t),t.i(n))}function At(t,n,e,i){if(t&&t.o){if(b.has(t))return;b.add(t),d.c.push(()=>{b.delete(t),i&&(e&&t.d(1),i())}),t.o(n)}else i&&i()}function St(t){t&&t.c()}function jt(t,n){t&&t.l(n)}function it(t,n,e,i){const{fragment:r,after_update:s}=t.$$;r&&r.m(n,e),i||N(()=>{const c=t.$$.on_mount.map(B).filter(O);t.$$.on_destroy?t.$$.on_destroy.push(...c):g(c),t.$$.on_mount=[]}),s.forEach(N)}function rt(t,n){const e=t.$$;e.fragment!==null&&(nt(e.after_update),g(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function ct(t,n){t.$$.dirty[0]===-1&&(h.push(t),D(),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<{const j=S.length?S[0]:x;return u.ctx&&r(u.ctx[f],u.ctx[f]=j)&&(!u.skip_bound&&u.bound[f]&&u.bound[f](j),a&&ct(t,f)),x}):[],u.update(),a=!0,g(u.before_update),u.fragment=i?i(u.ctx):!1,n.target){if(n.hydrate){L();const f=V(n.target);u.fragment&&u.fragment.l(f),f.forEach(R)}else u.fragment&&u.fragment.c();n.intro&&et(t.$$.fragment),it(t,n.target,n.anchor,n.customElement),W(),F()}p(l)}class kt{$destroy(){rt(this,1),this.$destroy=$}$on(n,e){if(!O(e))return $;const i=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return i.push(e),()=>{const r=i.indexOf(e);r!==-1&&i.splice(r,1)}}$set(n){this.$$set&&!I(n)&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}}export{it as A,rt as B,ot as C,ft as D,at as E,st as F,Q as G,$ as H,ut as I,kt as S,_t as a,dt as b,yt as c,At as d,ht as e,Nt as f,et as g,R as h,Ct as i,wt as j,U as k,pt as l,V as m,mt as n,$t as o,xt as p,A as q,Z as r,lt as s,Et as t,gt as u,vt as v,k as w,bt as x,St as y,jt as z}; diff --git a/.svelte-kit/output/client/_app/immutable/chunks/singletons.fe037310.js b/.svelte-kit/output/client/_app/immutable/chunks/singletons.fe037310.js new file mode 100644 index 0000000..234ad3f --- /dev/null +++ b/.svelte-kit/output/client/_app/immutable/chunks/singletons.fe037310.js @@ -0,0 +1 @@ +import{H as d,s as v}from"./index.6dba6488.js";const u=[];function p(e,t=d){let n;const o=new Set;function r(s){if(v(e,s)&&(e=s,n)){const i=!u.length;for(const l of o)l[1](),u.push(l,e);if(i){for(let l=0;l{o.delete(l),o.size===0&&n&&(n(),n=null)}}return{set:r,update:c,subscribe:a}}var g;const E=((g=globalThis.__sveltekit_1rrmbx2)==null?void 0:g.base)??"";var k;const w=((k=globalThis.__sveltekit_1rrmbx2)==null?void 0:k.assets)??E,A="1686760532539",x="sveltekit:snapshot",y="sveltekit:scroll",I="sveltekit:index",_={tap:1,hover:2,viewport:3,eager:4,off:-1};function O(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function U(){return{x:pageXOffset,y:pageYOffset}}function f(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const b={..._,"":_.hover};function m(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function L(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=m(e)}}function N(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||S(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),c=(n==null?void 0:n.origin)===location.origin&&e.hasAttribute("download");return{url:n,external:r,target:o,download:c}}function P(e){let t=null,n=null,o=null,r=null,c=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=f(s,"preload-code")),r===null&&(r=f(s,"preload-data")),t===null&&(t=f(s,"keepfocus")),n===null&&(n=f(s,"noscroll")),c===null&&(c=f(s,"reload")),a===null&&(a=f(s,"replacestate")),s=m(s);function i(l){switch(l){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:b[o??"off"],preload_data:b[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(c),replace_state:i(a)}}function h(e){const t=p(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function c(a){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&a(s=i)})}return{notify:o,set:r,subscribe:c}}function R(){const{set:e,subscribe:t}=p(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${w}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==A;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function S(e,t){return e.origin!==location.origin||!e.pathname.startsWith(t)}function V(e){e.client}const Y={url:h({}),page:h({}),navigating:p(null),updated:R()};export{I,_ as P,y as S,x as a,N as b,P as c,U as d,E as e,L as f,O as g,V as h,S as i,Y as s}; diff --git a/.svelte-kit/output/client/_app/immutable/entry/app.f1208d35.js b/.svelte-kit/output/client/_app/immutable/entry/app.f1208d35.js new file mode 100644 index 0000000..11c2c84 --- /dev/null +++ b/.svelte-kit/output/client/_app/immutable/entry/app.f1208d35.js @@ -0,0 +1 @@ +import{S as V,i as q,s as U,a as j,e as h,c as z,b as w,d as p,f as y,g as d,h as g,j as W,o as F,k as G,l as H,m as J,n as N,p as m,q as K,r as M,u as Q,v as L,w as P,x as k,y as v,z as A,A as E,B as R}from"../chunks/index.6dba6488.js";const X="modulepreload",Y=function(a,e){return new URL(a,e).href},B={},S=function(e,n,i){if(!n||n.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(n.map(f=>{if(f=Y(f,i),f in B)return;B[f]=!0;const t=f.endsWith(".css"),r=t?'[rel="stylesheet"]':"";if(!!i)for(let l=s.length-1;l>=0;l--){const _=s[l];if(_.href===f&&(!t||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${r}`))return;const o=document.createElement("link");if(o.rel=t?"stylesheet":X,t||(o.as="script",o.crossOrigin=""),o.href=f,document.head.appendChild(o),t)return new Promise((l,_)=>{o.addEventListener("load",l),o.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})})).then(()=>e())},ie={};function Z(a){let e,n,i;var s=a[1][0];function f(t){return{props:{data:t[3],form:t[2]}}}return s&&(e=k(s,f(a)),a[12](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&A(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),w(t,n,r),i=!0},p(t,r){const u={};if(r&8&&(u.data=t[3]),r&4&&(u.form=t[2]),r&2&&s!==(s=t[1][0])){if(e){L();const o=e;p(o.$$.fragment,1,0,()=>{R(o,1)}),y()}s?(e=k(s,f(t)),t[12](e),v(e.$$.fragment),d(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else s&&e.$set(u)},i(t){i||(e&&d(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){a[12](null),t&&g(n),e&&R(e,t)}}}function $(a){let e,n,i;var s=a[1][0];function f(t){return{props:{data:t[3],$$slots:{default:[x]},$$scope:{ctx:t}}}}return s&&(e=k(s,f(a)),a[11](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&A(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),w(t,n,r),i=!0},p(t,r){const u={};if(r&8&&(u.data=t[3]),r&8215&&(u.$$scope={dirty:r,ctx:t}),r&2&&s!==(s=t[1][0])){if(e){L();const o=e;p(o.$$.fragment,1,0,()=>{R(o,1)}),y()}s?(e=k(s,f(t)),t[11](e),v(e.$$.fragment),d(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else s&&e.$set(u)},i(t){i||(e&&d(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){a[11](null),t&&g(n),e&&R(e,t)}}}function x(a){let e,n,i;var s=a[1][1];function f(t){return{props:{data:t[4],form:t[2]}}}return s&&(e=k(s,f(a)),a[10](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&A(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),w(t,n,r),i=!0},p(t,r){const u={};if(r&16&&(u.data=t[4]),r&4&&(u.form=t[2]),r&2&&s!==(s=t[1][1])){if(e){L();const o=e;p(o.$$.fragment,1,0,()=>{R(o,1)}),y()}s?(e=k(s,f(t)),t[10](e),v(e.$$.fragment),d(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else s&&e.$set(u)},i(t){i||(e&&d(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){a[10](null),t&&g(n),e&&R(e,t)}}}function C(a){let e,n=a[6]&&D(a);return{c(){e=G("div"),n&&n.c(),this.h()},l(i){e=H(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=J(e);n&&n.l(s),s.forEach(g),this.h()},h(){N(e,"id","svelte-announcer"),N(e,"aria-live","assertive"),N(e,"aria-atomic","true"),m(e,"position","absolute"),m(e,"left","0"),m(e,"top","0"),m(e,"clip","rect(0 0 0 0)"),m(e,"clip-path","inset(50%)"),m(e,"overflow","hidden"),m(e,"white-space","nowrap"),m(e,"width","1px"),m(e,"height","1px")},m(i,s){w(i,e,s),n&&n.m(e,null)},p(i,s){i[6]?n?n.p(i,s):(n=D(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&g(e),n&&n.d()}}}function D(a){let e;return{c(){e=K(a[7])},l(n){e=M(n,a[7])},m(n,i){w(n,e,i)},p(n,i){i&128&&Q(e,n[7])},d(n){n&&g(e)}}}function ee(a){let e,n,i,s,f;const t=[$,Z],r=[];function u(l,_){return l[1][1]?0:1}e=u(a),n=r[e]=t[e](a);let o=a[5]&&C(a);return{c(){n.c(),i=j(),o&&o.c(),s=h()},l(l){n.l(l),i=z(l),o&&o.l(l),s=h()},m(l,_){r[e].m(l,_),w(l,i,_),o&&o.m(l,_),w(l,s,_),f=!0},p(l,[_]){let b=e;e=u(l),e===b?r[e].p(l,_):(L(),p(r[b],1,1,()=>{r[b]=null}),y(),n=r[e],n?n.p(l,_):(n=r[e]=t[e](l),n.c()),d(n,1),n.m(i.parentNode,i)),l[5]?o?o.p(l,_):(o=C(l),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},i(l){f||(d(n),f=!0)},o(l){p(n),f=!1},d(l){r[e].d(l),l&&g(i),o&&o.d(l),l&&g(s)}}}function te(a,e,n){let{stores:i}=e,{page:s}=e,{constructors:f}=e,{components:t=[]}=e,{form:r}=e,{data_0:u=null}=e,{data_1:o=null}=e;W(i.page.notify);let l=!1,_=!1,b=null;F(()=>{const c=i.page.subscribe(()=>{l&&(n(6,_=!0),n(7,b=document.title||"untitled page"))});return n(5,l=!0),c});function I(c){P[c?"unshift":"push"](()=>{t[1]=c,n(0,t)})}function O(c){P[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}function T(c){P[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}return a.$$set=c=>{"stores"in c&&n(8,i=c.stores),"page"in c&&n(9,s=c.page),"constructors"in c&&n(1,f=c.constructors),"components"in c&&n(0,t=c.components),"form"in c&&n(2,r=c.form),"data_0"in c&&n(3,u=c.data_0),"data_1"in c&&n(4,o=c.data_1)},a.$$.update=()=>{a.$$.dirty&768&&i.page.set(s)},[t,f,r,u,o,l,_,b,i,s,I,O,T]}class se extends V{constructor(e){super(),q(this,e,te,ee,U,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const re=[()=>S(()=>import("../nodes/0.6ca3df57.js"),["../nodes/0.6ca3df57.js","../chunks/index.6dba6488.js"],import.meta.url),()=>S(()=>import("../nodes/1.0e42448f.js"),["../nodes/1.0e42448f.js","../chunks/index.6dba6488.js","../chunks/singletons.fe037310.js"],import.meta.url),()=>S(()=>import("../nodes/2.ad52e74a.js"),["../nodes/2.ad52e74a.js","../chunks/index.6dba6488.js"],import.meta.url)],oe=[],ae={"/":[2]},le={handleError:({error:a})=>{console.error(a)}};export{ae as dictionary,le as hooks,ie as matchers,re as nodes,se as root,oe as server_loads}; diff --git a/.svelte-kit/output/client/_app/immutable/entry/start.72f1829c.js b/.svelte-kit/output/client/_app/immutable/entry/start.72f1829c.js new file mode 100644 index 0000000..cc114eb --- /dev/null +++ b/.svelte-kit/output/client/_app/immutable/entry/start.72f1829c.js @@ -0,0 +1,3 @@ +import{o as De,t as ye}from"../chunks/index.6dba6488.js";import{S as He,a as Je,I as V,g as Ce,f as Ve,b as we,c as le,s as M,d as Q,i as _e,e as J,P as qe,h as We}from"../chunks/singletons.fe037310.js";function Xe(t,o){return t==="/"||o==="ignore"?t:o==="never"?t.endsWith("/")?t.slice(0,-1):t:o==="always"&&!t.endsWith("/")?t+"/":t}function Ze(t){return t.split("%25").map(decodeURI).join("%25")}function Qe(t){for(const o in t)t[o]=decodeURIComponent(t[o]);return t}const et=["href","pathname","search","searchParams","toString","toJSON"];function tt(t,o){const u=new URL(t);for(const i of et)Object.defineProperty(u,i,{get(){return o(),t[i]},enumerable:!0,configurable:!0});return nt(u),u}function nt(t){Object.defineProperty(t,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const at="/__data.json";function rt(t){return t.replace(/\/$/,"")+at}function Ke(t){try{return JSON.parse(sessionStorage[t])}catch{}}function Fe(t,o){const u=JSON.stringify(o);try{sessionStorage[t]=u}catch{}}function ot(...t){let o=5381;for(const u of t)if(typeof u=="string"){let i=u.length;for(;i;)o=o*33^u.charCodeAt(--i)}else if(ArrayBuffer.isView(u)){const i=new Uint8Array(u.buffer,u.byteOffset,u.byteLength);let d=i.length;for(;d;)o=o*33^i[--d]}else throw new TypeError("value must be a string or TypedArray");return(o>>>0).toString(36)}const fe=window.fetch;window.fetch=(t,o)=>((t instanceof Request?t.method:(o==null?void 0:o.method)||"GET")!=="GET"&&te.delete(Se(t)),fe(t,o));const te=new Map;function it(t,o){const u=Se(t,o),i=document.querySelector(u);if(i!=null&&i.textContent){const{body:d,...f}=JSON.parse(i.textContent),S=i.getAttribute("data-ttl");return S&&te.set(u,{body:d,init:f,ttl:1e3*Number(S)}),Promise.resolve(new Response(d,f))}return fe(t,o)}function st(t,o,u){if(te.size>0){const i=Se(t,u),d=te.get(i);if(d){if(performance.now(){const d=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(i);if(d)return o.push({name:d[1],matcher:d[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const f=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(i);if(f)return o.push({name:f[1],matcher:f[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!i)return;const S=i.split(/\[(.+?)\](?!\])/);return"/"+S.map((b,w)=>{if(w%2){if(b.startsWith("x+"))return be(String.fromCharCode(parseInt(b.slice(2),16)));if(b.startsWith("u+"))return be(String.fromCharCode(...b.slice(2).split("-").map(P=>parseInt(P,16))));const p=ct.exec(b);if(!p)throw new Error(`Invalid param: ${b}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,D,x,k,N]=p;return o.push({name:k,matcher:N,optional:!!D,rest:!!x,chained:x?w===1&&S[0]==="":!1}),x?"(.*?)":D?"([^/]*)?":"([^/]+?)"}return be(b)}).join("")}).join("")}/?$`),params:o}}function ft(t){return!/^\([^)]+\)$/.test(t)}function ut(t){return t.slice(1).split("/").filter(ft)}function dt(t,o,u){const i={},d=t.slice(1);let f=0;for(let S=0;Sw).join("/"),f=0;continue}if(b===void 0){l.rest&&(i[l.name]="");continue}if(!l.matcher||u[l.matcher](b)){i[l.name]=b;const w=o[S+1],p=d[S+1];w&&!w.rest&&w.optional&&p&&l.chained&&(f=0);continue}if(l.optional&&l.chained){f++;continue}return}if(!f)return i}function be(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function pt({nodes:t,server_loads:o,dictionary:u,matchers:i}){const d=new Set(o);return Object.entries(u).map(([l,[b,w,p]])=>{const{pattern:D,params:x}=lt(l),k={id:l,exec:N=>{const P=D.exec(N);if(P)return dt(P,x,i)},errors:[1,...p||[]].map(N=>t[N]),layouts:[0,...w||[]].map(S),leaf:f(b)};return k.errors.length=k.layouts.length=Math.max(k.errors.length,k.layouts.length),k});function f(l){const b=l<0;return b&&(l=~l),[b,t[l]]}function S(l){return l===void 0?l:[d.has(l),t[l]]}}class ee{constructor(o,u){this.status=o,typeof u=="string"?this.body={message:u}:u?this.body=u:this.body={message:`Error: ${o}`}}toString(){return JSON.stringify(this.body)}}class Me{constructor(o,u){this.status=o,this.location=u}}async function ht(t){var o;for(const u in t)if(typeof((o=t[u])==null?void 0:o.then)=="function")return Object.fromEntries(await Promise.all(Object.entries(t).map(async([i,d])=>[i,await d])));return t}const gt=-1,mt=-2,yt=-3,wt=-4,_t=-5,bt=-6;function vt(t,o){if(typeof t=="number")return d(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const u=t,i=Array(u.length);function d(f,S=!1){if(f===gt)return;if(f===yt)return NaN;if(f===wt)return 1/0;if(f===_t)return-1/0;if(f===bt)return-0;if(S)throw new Error("Invalid input");if(f in i)return i[f];const l=u[f];if(!l||typeof l!="object")i[f]=l;else if(Array.isArray(l))if(typeof l[0]=="string"){const b=l[0],w=o==null?void 0:o[b];if(w)return i[f]=w(d(l[1]));switch(b){case"Date":i[f]=new Date(l[1]);break;case"Set":const p=new Set;i[f]=p;for(let k=1;ko!=null)}const kt="x-sveltekit-invalidated",K=Ke(He)??{},Z=Ke(Je)??{};function ve(t){K[t]=Q()}function Rt(t,o){var $e;const u=pt(t),i=t.nodes[0],d=t.nodes[1];i(),d();const f=document.documentElement,S=[],l=[];let b=null;const w={before_navigate:[],after_navigate:[]};let p={branch:[],error:null,url:null},D=!1,x=!1,k=!0,N=!1,P=!1,z=!1,B=!1,q,j=($e=history.state)==null?void 0:$e[V];j||(j=Date.now(),history.replaceState({...history.state,[V]:j},"",location.href));const ue=K[j];ue&&(history.scrollRestoration="manual",scrollTo(ue.x,ue.y));let F,ne,ae;async function ke(){ae=ae||Promise.resolve(),await ae,ae=null;const e=new URL(location.href),n=W(e,!0);b=null;const r=ne={},a=n&&await he(n);if(r===ne&&a){if(a.type==="redirect")return re(new URL(a.location,e).href,{},[e.pathname],r);a.props.page!==void 0&&(F=a.props.page),q.$set(a.props)}}function Re(e){l.some(n=>n==null?void 0:n.snapshot)&&(Z[e]=l.map(n=>{var r;return(r=n==null?void 0:n.snapshot)==null?void 0:r.capture()}))}function Ae(e){var n;(n=Z[e])==null||n.forEach((r,a)=>{var s,c;(c=(s=l[a])==null?void 0:s.snapshot)==null||c.restore(r)})}function Ie(){ve(j),Fe(He,K),Re(j),Fe(Je,Z)}async function re(e,{noScroll:n=!1,replaceState:r=!1,keepFocus:a=!1,state:s={},invalidateAll:c=!1},g,m){return typeof e=="string"&&(e=new URL(e,Ce(document))),ce({url:e,scroll:n?Q():null,keepfocus:a,redirect_chain:g,details:{state:s,replaceState:r},nav_token:m,accepted:()=>{c&&(B=!0)},blocked:()=>{},type:"goto"})}async function Le(e){return b={id:e.id,promise:he(e).then(n=>(n.type==="loaded"&&n.state.error&&(b=null),n))},b.promise}async function oe(...e){const r=u.filter(a=>e.some(s=>a.exec(s))).map(a=>Promise.all([...a.layouts,a.leaf].map(s=>s==null?void 0:s[1]())));await Promise.all(r)}function Oe(e){var a;p=e.state;const n=document.querySelector("style[data-sveltekit]");n&&n.remove(),F=e.props.page,q=new t.root({target:o,props:{...e.props,stores:M,components:l},hydrate:!0}),Ae(j);const r={from:null,to:{params:p.params,route:{id:((a=p.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter"};w.after_navigate.forEach(s=>s(r)),x=!0}async function Y({url:e,params:n,branch:r,status:a,error:s,route:c,form:g}){let m="never";for(const _ of r)(_==null?void 0:_.slash)!==void 0&&(m=_.slash);e.pathname=Xe(e.pathname,m),e.search=e.search;const v={type:"loaded",state:{url:e,params:n,branch:r,error:s,route:c},props:{constructors:St(r).map(_=>_.node.component)}};g!==void 0&&(v.props.form=g);let y={},R=!F,A=0;for(let _=0;_(m.params.add(U),h[U])}),data:(c==null?void 0:c.data)??null,url:tt(r,()=>{m.url=!0}),async fetch(h,U){let $;h instanceof Request?($=h.url,U={body:h.method==="GET"||h.method==="HEAD"?void 0:await h.blob(),cache:h.cache,credentials:h.credentials,headers:h.headers,integrity:h.integrity,keepalive:h.keepalive,method:h.method,mode:h.mode,redirect:h.redirect,referrer:h.referrer,referrerPolicy:h.referrerPolicy,signal:h.signal,...U}):$=h;const C=new URL($,r);return O(C.href),C.origin===r.origin&&($=C.href.slice(r.origin.length)),x?st($,C.href,U):it($,U)},setHeaders:()=>{},depends:O,parent(){return m.parent=!0,n()}};g=await v.universal.load.call(null,_)??null,g=g?await ht(g):null}return{node:v,loader:e,server:c,universal:(R=v.universal)!=null&&R.load?{type:"data",data:g,uses:m}:null,data:g??(c==null?void 0:c.data)??null,slash:((A=v.universal)==null?void 0:A.trailingSlash)??(c==null?void 0:c.slash)}}function Pe(e,n,r,a,s){if(B)return!0;if(!a)return!1;if(a.parent&&e||a.route&&n||a.url&&r)return!0;for(const c of a.params)if(s[c]!==p.params[c])return!0;for(const c of a.dependencies)if(S.some(g=>g(new URL(c))))return!0;return!1}function pe(e,n){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?n??null:null}async function he({id:e,invalidating:n,url:r,params:a,route:s}){if((b==null?void 0:b.id)===e)return b.promise;const{errors:c,layouts:g,leaf:m}=s,v=[...g,m];c.forEach(E=>E==null?void 0:E().catch(()=>{})),v.forEach(E=>E==null?void 0:E[1]().catch(()=>{}));let y=null;const R=p.url?e!==p.url.pathname+p.url.search:!1,A=p.route?s.id!==p.route.id:!1;let O=!1;const _=v.map((E,L)=>{var H;const I=p.branch[L],T=!!(E!=null&&E[0])&&((I==null?void 0:I.loader)!==E[1]||Pe(O,A,R,(H=I.server)==null?void 0:H.uses,a));return T&&(O=!0),T});if(_.some(Boolean)){try{y=await Be(r,_)}catch(E){return ie({status:E instanceof ee?E.status:500,error:await X(E,{url:r,params:a,route:{id:s.id}}),url:r,route:s})}if(y.type==="redirect")return y}const h=y==null?void 0:y.nodes;let U=!1;const $=v.map(async(E,L)=>{var ge;if(!E)return;const I=p.branch[L],T=h==null?void 0:h[L];if((!T||T.type==="skip")&&E[1]===(I==null?void 0:I.loader)&&!Pe(U,A,R,(ge=I.universal)==null?void 0:ge.uses,a))return I;if(U=!0,(T==null?void 0:T.type)==="error")throw T;return de({loader:E[1],url:r,params:a,route:s,parent:async()=>{var Te;const je={};for(let me=0;me{});const C=[];for(let E=0;EPromise.resolve({}),server_data_node:pe(c)}),v={node:await d(),loader:d,universal:null,server:null,data:null};return await Y({url:r,params:s,branch:[m,v],status:e,error:n,route:null})}function W(e,n){if(_e(e,J))return;const r=se(e);for(const a of u){const s=a.exec(r);if(s)return{id:e.pathname+e.search,invalidating:n,route:a,params:Qe(s),url:e}}}function se(e){return Ze(e.pathname.slice(J.length)||"/")}function xe({url:e,type:n,intent:r,delta:a}){var m,v;let s=!1;const c={from:{params:p.params,route:{id:((m=p.route)==null?void 0:m.id)??null},url:p.url},to:{params:(r==null?void 0:r.params)??null,route:{id:((v=r==null?void 0:r.route)==null?void 0:v.id)??null},url:e},willUnload:!r,type:n};a!==void 0&&(c.delta=a);const g={...c,cancel:()=>{s=!0}};return P||w.before_navigate.forEach(y=>y(g)),s?null:c}async function ce({url:e,scroll:n,keepfocus:r,redirect_chain:a,details:s,type:c,delta:g,nav_token:m={},accepted:v,blocked:y}){var $,C,E;const R=W(e,!1),A=xe({url:e,type:c,delta:g,intent:R});if(!A){y();return}const O=j;v(),P=!0,x&&M.navigating.set(A),ne=m;let _=R&&await he(R);if(!_){if(_e(e,J))return await G(e);_=await Ne(e,{id:null},await X(new Error(`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404)}if(e=(R==null?void 0:R.url)||e,ne!==m)return!1;if(_.type==="redirect")if(a.length>10||a.includes(e.pathname))_=await ie({status:500,error:await X(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}});else return re(new URL(_.location,e).href,{},[...a,e.pathname],m),!1;else(($=_.props.page)==null?void 0:$.status)>=400&&await M.updated.check()&&await G(e);if(S.length=0,B=!1,N=!0,ve(O),Re(O),(C=_.props.page)!=null&&C.url&&_.props.page.url.pathname!==e.pathname&&(e.pathname=(E=_.props.page)==null?void 0:E.url.pathname),s){const L=s.replaceState?0:1;if(s.state[V]=j+=L,history[s.replaceState?"replaceState":"pushState"](s.state,"",e),!s.replaceState){let I=j+1;for(;Z[I]||K[I];)delete Z[I],delete K[I],I+=1}}b=null,x?(p=_.state,_.props.page&&(_.props.page.url=e),q.$set(_.props)):Oe(_);const{activeElement:h}=document;if(await ye(),k){const L=e.hash&&document.getElementById(decodeURIComponent(e.hash.slice(1)));n?scrollTo(n.x,n.y):L?L.scrollIntoView():scrollTo(0,0)}const U=document.activeElement!==h&&document.activeElement!==document.body;!r&&!U&&Ee(),k=!0,_.props.page&&(F=_.props.page),P=!1,c==="popstate"&&Ae(j),w.after_navigate.forEach(L=>L(A)),M.navigating.set(null),N=!1}async function Ne(e,n,r,a){return e.origin===location.origin&&e.pathname===location.pathname&&!D?await ie({status:a,error:r,url:e,route:n}):await G(e)}function G(e){return location.href=e.href,new Promise(()=>{})}function Ye(){let e;f.addEventListener("mousemove",c=>{const g=c.target;clearTimeout(e),e=setTimeout(()=>{a(g,2)},20)});function n(c){a(c.composedPath()[0],1)}f.addEventListener("mousedown",n),f.addEventListener("touchstart",n,{passive:!0});const r=new IntersectionObserver(c=>{for(const g of c)g.isIntersecting&&(oe(se(new URL(g.target.href))),r.unobserve(g.target))},{threshold:0});function a(c,g){const m=Ve(c,f);if(!m)return;const{url:v,external:y,download:R}=we(m,J);if(y||R)return;const A=le(m);if(!A.reload)if(g<=A.preload_data){const O=W(v,!1);O&&Le(O)}else g<=A.preload_code&&oe(se(v))}function s(){r.disconnect();for(const c of f.querySelectorAll("a")){const{url:g,external:m,download:v}=we(c,J);if(m||v)continue;const y=le(c);y.reload||(y.preload_code===qe.viewport&&r.observe(c),y.preload_code===qe.eager&&oe(se(g)))}}w.after_navigate.push(s),s()}function X(e,n){return e instanceof ee?e.body:t.hooks.handleError({error:e,event:n})??{message:n.route.id!=null?"Internal Error":"Not Found"}}return{after_navigate:e=>{De(()=>(w.after_navigate.push(e),()=>{const n=w.after_navigate.indexOf(e);w.after_navigate.splice(n,1)}))},before_navigate:e=>{De(()=>(w.before_navigate.push(e),()=>{const n=w.before_navigate.indexOf(e);w.before_navigate.splice(n,1)}))},disable_scroll_handling:()=>{(N||!x)&&(k=!1)},goto:(e,n={})=>re(e,n,[]),invalidate:e=>{if(typeof e=="function")S.push(e);else{const{href:n}=new URL(e,location.href);S.push(r=>r.href===n)}return ke()},invalidate_all:()=>(B=!0,ke()),preload_data:async e=>{const n=new URL(e,Ce(document)),r=W(n,!1);if(!r)throw new Error(`Attempted to preload a URL that does not belong to this app: ${n}`);await Le(r)},preload_code:oe,apply_action:async e=>{if(e.type==="error"){const n=new URL(location.href),{branch:r,route:a}=p;if(!a)return;const s=await Ue(p.branch.length,r,a.errors);if(s){const c=await Y({url:n,params:p.params,branch:r.slice(0,s.idx).concat(s.node),status:e.status??500,error:e.error,route:a});p=c.state,q.$set(c.props),ye().then(Ee)}}else e.type==="redirect"?re(e.location,{invalidateAll:!0},[]):(q.$set({form:null,page:{...F,form:e.data,status:e.status}}),await ye(),q.$set({form:e.data}),e.type==="success"&&Ee())},_start_router:()=>{var e;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{var a;let r=!1;if(Ie(),!P){const s={from:{params:p.params,route:{id:((a=p.route)==null?void 0:a.id)??null},url:p.url},to:null,willUnload:!0,type:"leave",cancel:()=>r=!0};w.before_navigate.forEach(c=>c(s))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ie()}),(e=navigator.connection)!=null&&e.saveData||Ye(),f.addEventListener("click",n=>{var A;if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const r=Ve(n.composedPath()[0],f);if(!r)return;const{url:a,external:s,target:c,download:g}=we(r,J);if(!a)return;if(c==="_parent"||c==="_top"){if(window.parent!==window)return}else if(c&&c!=="_self")return;const m=le(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||g)return;if(s||m.reload){xe({url:a,type:"link"})?P=!0:n.preventDefault();return}const[y,R]=a.href.split("#");if(R!==void 0&&y===location.href.split("#")[0]){if(p.url.hash===a.hash){n.preventDefault(),(A=r.ownerDocument.getElementById(R))==null||A.scrollIntoView();return}if(z=!0,ve(j),p.url=a,M.page.set({...F,url:a}),M.page.notify(),!m.replace_state)return;z=!1,n.preventDefault()}ce({url:a,scroll:m.noscroll?Q():null,keepfocus:m.keep_focus??!1,redirect_chain:[],details:{state:{},replaceState:m.replace_state??a.href===location.href},accepted:()=>n.preventDefault(),blocked:()=>n.preventDefault(),type:"link"})}),f.addEventListener("submit",n=>{if(n.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formMethod)||r.method)!=="get")return;const c=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(_e(c,J))return;const g=n.target,{keep_focus:m,noscroll:v,reload:y,replace_state:R}=le(g);if(y)return;n.preventDefault(),n.stopPropagation();const A=new FormData(g),O=a==null?void 0:a.getAttribute("name");O&&A.append(O,(a==null?void 0:a.getAttribute("value"))??""),c.search=new URLSearchParams(A).toString(),ce({url:c,scroll:v?Q():null,keepfocus:m??!1,redirect_chain:[],details:{state:{},replaceState:R??c.href===location.href},nav_token:{},accepted:()=>{},blocked:()=>{},type:"form"})}),addEventListener("popstate",async n=>{var r;if((r=n.state)!=null&&r[V]){if(n.state[V]===j)return;const a=K[n.state[V]];if(p.url.href.split("#")[0]===location.href.split("#")[0]){K[j]=Q(),j=n.state[V],scrollTo(a.x,a.y);return}const s=n.state[V]-j;await ce({url:new URL(location.href),scroll:a,keepfocus:!1,redirect_chain:[],details:null,accepted:()=>{j=n.state[V]},blocked:()=>{history.go(-s)},type:"popstate",delta:s})}}),addEventListener("hashchange",()=>{z&&(z=!1,history.replaceState({...history.state,[V]:++j},"",location.href))});for(const n of document.querySelectorAll("link"))n.rel==="icon"&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&M.navigating.set(null)})},_hydrate:async({status:e=200,error:n,node_ids:r,params:a,route:s,data:c,form:g})=>{D=!0;const m=new URL(location.href);({params:a={},route:s={id:null}}=W(m,!1)||{});let v;try{const y=r.map(async(O,_)=>{const h=c[_];return h!=null&&h.uses&&(h.uses=Ge(h.uses)),de({loader:t.nodes[O],url:m,params:a,route:s,parent:async()=>{const U={};for(let $=0;$<_;$+=1)Object.assign(U,(await y[$]).data);return U},server_data_node:pe(h)})}),R=await Promise.all(y),A=u.find(({id:O})=>O===s.id);if(A){const O=A.layouts;for(let _=0;_d?"1":"0").join(""));const i=await fe(u.href);if(!i.ok)throw new ee(i.status,await i.json());return new Promise(async d=>{var p;const f=new Map,S=i.body.getReader(),l=new TextDecoder;function b(D){return vt(D,{Promise:x=>new Promise((k,N)=>{f.set(x,{fulfil:k,reject:N})})})}let w="";for(;;){const{done:D,value:x}=await S.read();if(D&&!w)break;for(w+=!x&&w?` +`:l.decode(x);;){const k=w.indexOf(` +`);if(k===-1)break;const N=JSON.parse(w.slice(0,k));if(w=w.slice(k+1),N.type==="redirect")return d(N);if(N.type==="data")(p=N.nodes)==null||p.forEach(P=>{(P==null?void 0:P.type)==="data"&&(P.uses=Ge(P.uses),P.data=b(P.data))}),d(N);else if(N.type==="chunk"){const{id:P,data:z,error:B}=N,q=f.get(P);f.delete(P),B?q.reject(b(B)):q.fulfil(b(z))}}}})}function Ge(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url)}}function Ee(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const o=document.body,u=o.getAttribute("tabindex");o.tabIndex=-1,o.focus({preventScroll:!0,focusVisible:!1}),u!==null?o.setAttribute("tabindex",u):o.removeAttribute("tabindex");const i=getSelection();if(i&&i.type!=="None"){const d=[];for(let f=0;f{if(i.rangeCount===d.length){for(let f=0;f{"$$scope"in n&&a(0,t=n.$$scope)},[t,e]}class h extends l{constructor(s){super(),i(this,s,$,d,r,{})}}export{h as component}; diff --git a/.svelte-kit/output/client/_app/immutable/nodes/1.0e42448f.js b/.svelte-kit/output/client/_app/immutable/nodes/1.0e42448f.js new file mode 100644 index 0000000..d837d5d --- /dev/null +++ b/.svelte-kit/output/client/_app/immutable/nodes/1.0e42448f.js @@ -0,0 +1 @@ +import{S,i as q,s as x,k as _,q as f,a as H,l as d,m as g,r as h,h as u,c as k,b as m,G as v,u as $,H as E,I as y}from"../chunks/index.6dba6488.js";import{s as C}from"../chunks/singletons.fe037310.js";const G=()=>{const s=C;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},I={subscribe(s){return G().page.subscribe(s)}};function P(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=_("h1"),o=f(r),n=H(),i=_("p"),l=f(c)},l(e){t=d(e,"H1",{});var a=g(t);o=h(a,r),a.forEach(u),n=k(e),i=d(e,"P",{});var p=g(i);l=h(p,c),p.forEach(u)},m(e,a){m(e,t,a),v(t,o),m(e,n,a),m(e,i,a),v(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&$(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&$(l,c)},i:E,o:E,d(e){e&&u(t),e&&u(n),e&&u(i)}}}function j(s,t,r){let o;return y(s,I,n=>r(0,o=n)),[o]}let A=class extends S{constructor(t){super(),q(this,t,j,P,x,{})}};export{A as component}; diff --git a/.svelte-kit/output/client/_app/immutable/nodes/2.ad52e74a.js b/.svelte-kit/output/client/_app/immutable/nodes/2.ad52e74a.js new file mode 100644 index 0000000..4e3bc81 --- /dev/null +++ b/.svelte-kit/output/client/_app/immutable/nodes/2.ad52e74a.js @@ -0,0 +1 @@ +import{S as q,i as y,s as H,k as v,q as c,a as K,l as _,m as u,r as h,h as l,c as P,n as V,b as x,G as o,H as k}from"../chunks/index.6dba6488.js";function W(E){let e,m,n,a,p,s,d,f;return{c(){e=v("h1"),m=c("Welcome to SvelteKit"),n=K(),a=v("p"),p=c("Visit "),s=v("a"),d=c("kit.svelte.dev"),f=c(" to read the documentation"),this.h()},l(t){e=_(t,"H1",{});var i=u(e);m=h(i,"Welcome to SvelteKit"),i.forEach(l),n=P(t),a=_(t,"P",{});var r=u(a);p=h(r,"Visit "),s=_(r,"A",{href:!0});var S=u(s);d=h(S,"kit.svelte.dev"),S.forEach(l),f=h(r," to read the documentation"),r.forEach(l),this.h()},h(){V(s,"href","https://kit.svelte.dev")},m(t,i){x(t,e,i),o(e,m),x(t,n,i),x(t,a,i),o(a,p),o(a,s),o(s,d),o(a,f)},p:k,i:k,o:k,d(t){t&&l(e),t&&l(n),t&&l(a)}}}class A extends q{constructor(e){super(),y(this,e,null,W,H,{})}}export{A as component}; diff --git a/.svelte-kit/output/client/_app/version.json b/.svelte-kit/output/client/_app/version.json new file mode 100644 index 0000000..9237588 --- /dev/null +++ b/.svelte-kit/output/client/_app/version.json @@ -0,0 +1 @@ +{"version":"1686760532539"} \ No newline at end of file diff --git a/.svelte-kit/output/client/favicon.png b/.svelte-kit/output/client/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..825b9e65af7c104cfb07089bb28659393b4f2097 GIT binary patch literal 1571 zcmV+;2Hg3HP)Px)-AP12RCwC$UE6KzI1p6{F2N z1VK2vi|pOpn{~#djwYcWXTI_im_u^TJgMZ4JMOsSj!0ma>B?-(Hr@X&W@|R-$}W@Z zgj#$x=!~7LGqHW?IO8+*oE1MyDp!G=L0#^lUx?;!fXv@l^6SvTnf^ac{5OurzC#ZMYc20lI%HhX816AYVs1T3heS1*WaWH z%;x>)-J}YB5#CLzU@GBR6sXYrD>Vw(Fmt#|JP;+}<#6b63Ike{Fuo!?M{yEffez;| zp!PfsuaC)>h>-AdbnwN13g*1LowNjT5?+lFVd#9$!8Z9HA|$*6dQ8EHLu}U|obW6f z2%uGv?vr=KNq7YYa2Roj;|zooo<)lf=&2yxM@e`kM$CmCR#x>gI>I|*Ubr({5Y^rb zghxQU22N}F51}^yfDSt786oMTc!W&V;d?76)9KXX1 z+6Okem(d}YXmmOiZq$!IPk5t8nnS{%?+vDFz3BevmFNgpIod~R{>@#@5x9zJKEHLHv!gHeK~n)Ld!M8DB|Kfe%~123&Hz1Z(86nU7*G5chmyDe ziV7$pB7pJ=96hpxHv9rCR29%bLOXlKU<_13_M8x)6;P8E1Kz6G<&P?$P^%c!M5`2` zfY2zg;VK5~^>TJGQzc+33-n~gKt{{of8GzUkWmU110IgI0DLxRIM>0US|TsM=L|@F z0Bun8U!cRB7-2apz=y-7*UxOxz@Z0)@QM)9wSGki1AZ38ceG7Q72z5`i;i=J`ILzL z@iUO?SBBG-0cQuo+an4TsLy-g-x;8P4UVwk|D8{W@U1Zi z!M)+jqy@nQ$p?5tsHp-6J304Q={v-B>66$P0IDx&YT(`IcZ~bZfmn11#rXd7<5s}y zBi9eim&zQc0Dk|2>$bs0PnLmDfMP5lcXRY&cvJ=zKxI^f0%-d$tD!`LBf9^jMSYUA zI8U?CWdY@}cRq6{5~y+)#h1!*-HcGW@+gZ4B};0OnC~`xQOyH19z*TA!!BJ%9s0V3F?CAJ{hTd#*tf+ur-W9MOURF-@B77_-OshsY}6 zOXRY=5%C^*26z?l)1=$bz30!so5tfABdSYzO+H=CpV~aaUefmjvfZ3Ttu9W&W3Iu6 zROlh0MFA5h;my}8lB0tAV-Rvc2Zs_CCSJnx@d`**$idgy-iMob4dJWWw|21b4NB=LfsYp0Aeh{Ov)yztQi;eL4y5 zMi>8^SzKqk8~k?UiQK^^-5d8c%bV?$F8%X~czyiaKCI2=UH unsub.unsubscribe() : unsub; +} +let current_component; +function set_current_component(component) { + current_component = component; +} +function get_current_component() { + if (!current_component) + throw new Error("Function called outside component initialization"); + return current_component; +} +function setContext(key, context) { + get_current_component().$$.context.set(key, context); + return context; +} +function getContext(key) { + return get_current_component().$$.context.get(key); +} +const ATTR_REGEX = /[&"]/g; +const CONTENT_REGEX = /[&<]/g; +function escape(value, is_attr = false) { + const str = String(value); + const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX; + pattern.lastIndex = 0; + let escaped = ""; + let last = 0; + while (pattern.test(str)) { + const i = pattern.lastIndex - 1; + const ch = str[i]; + escaped += str.substring(last, i) + (ch === "&" ? "&" : ch === '"' ? """ : "<"); + last = i + 1; + } + return escaped + str.substring(last); +} +const missing_component = { + $$render: () => "" +}; +function validate_component(component, name) { + if (!component || !component.$$render) { + if (name === "svelte:component") + name += " this={...}"; + throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.`); + } + return component; +} +let on_destroy; +function create_ssr_component(fn) { + function $$render(result, props, bindings, slots, context) { + const parent_component = current_component; + const $$ = { + on_destroy, + context: new Map(context || (parent_component ? parent_component.$$.context : [])), + // these will be immediately discarded + on_mount: [], + before_update: [], + after_update: [], + callbacks: blank_object() + }; + set_current_component({ $$ }); + const html = fn(result, props, bindings, slots); + set_current_component(parent_component); + return html; + } + return { + render: (props = {}, { $$slots = {}, context = /* @__PURE__ */ new Map() } = {}) => { + on_destroy = []; + const result = { title: "", head: "", css: /* @__PURE__ */ new Set() }; + const html = $$render(result, props, {}, $$slots, context); + run_all(on_destroy); + return { + html, + css: { + code: Array.from(result.css).map((css) => css.code).join("\n"), + map: null + // TODO + }, + head: result.title + result.head + }; + }, + $$render + }; +} +export { + setContext as a, + subscribe as b, + create_ssr_component as c, + escape as e, + getContext as g, + missing_component as m, + noop as n, + safe_not_equal as s, + validate_component as v +}; diff --git a/.svelte-kit/output/server/chunks/internal.js b/.svelte-kit/output/server/chunks/internal.js new file mode 100644 index 0000000..0375d72 --- /dev/null +++ b/.svelte-kit/output/server/chunks/internal.js @@ -0,0 +1,189 @@ +import { c as create_ssr_component, a as setContext, v as validate_component, m as missing_component } from "./index.js"; +let base = ""; +let assets = base; +const initial = { base, assets }; +function reset() { + base = initial.base; + assets = initial.assets; +} +function set_assets(path) { + assets = initial.assets = path; +} +let public_env = {}; +function set_private_env(environment) { +} +function set_public_env(environment) { + public_env = environment; +} +function afterUpdate() { +} +function set_building() { +} +const Root = create_ssr_component(($$result, $$props, $$bindings, slots) => { + let { stores } = $$props; + let { page } = $$props; + let { constructors } = $$props; + let { components = [] } = $$props; + let { form } = $$props; + let { data_0 = null } = $$props; + let { data_1 = null } = $$props; + { + setContext("__svelte__", stores); + } + afterUpdate(stores.page.notify); + if ($$props.stores === void 0 && $$bindings.stores && stores !== void 0) + $$bindings.stores(stores); + if ($$props.page === void 0 && $$bindings.page && page !== void 0) + $$bindings.page(page); + if ($$props.constructors === void 0 && $$bindings.constructors && constructors !== void 0) + $$bindings.constructors(constructors); + if ($$props.components === void 0 && $$bindings.components && components !== void 0) + $$bindings.components(components); + if ($$props.form === void 0 && $$bindings.form && form !== void 0) + $$bindings.form(form); + if ($$props.data_0 === void 0 && $$bindings.data_0 && data_0 !== void 0) + $$bindings.data_0(data_0); + if ($$props.data_1 === void 0 && $$bindings.data_1 && data_1 !== void 0) + $$bindings.data_1(data_1); + let $$settled; + let $$rendered; + do { + $$settled = true; + { + stores.page.set(page); + } + $$rendered = ` + + +${constructors[1] ? `${validate_component(constructors[0] || missing_component, "svelte:component").$$render( + $$result, + { data: data_0, this: components[0] }, + { + this: ($$value) => { + components[0] = $$value; + $$settled = false; + } + }, + { + default: () => { + return `${validate_component(constructors[1] || missing_component, "svelte:component").$$render( + $$result, + { data: data_1, form, this: components[1] }, + { + this: ($$value) => { + components[1] = $$value; + $$settled = false; + } + }, + {} + )}`; + } + } + )}` : `${validate_component(constructors[0] || missing_component, "svelte:component").$$render( + $$result, + { data: data_0, form, this: components[0] }, + { + this: ($$value) => { + components[0] = $$value; + $$settled = false; + } + }, + {} + )}`} + +${``}`; + } while (!$$settled); + return $$rendered; +}); +const options = { + app_template_contains_nonce: false, + csp: { "mode": "auto", "directives": { "upgrade-insecure-requests": false, "block-all-mixed-content": false }, "reportOnly": { "upgrade-insecure-requests": false, "block-all-mixed-content": false } }, + csrf_check_origin: true, + track_server_fetches: false, + embedded: false, + env_public_prefix: "PUBLIC_", + hooks: null, + // added lazily, via `get_hooks` + preload_strategy: "modulepreload", + root: Root, + service_worker: false, + templates: { + app: ({ head, body, assets: assets2, nonce, env }) => '\n\n \n \n \n \n ' + head + '\n \n \n
' + body + "
\n \n\n", + error: ({ status, message }) => '\n\n \n \n ' + message + ` + + + + +
+ ` + status + '\n
\n

' + message + "

\n
\n
\n \n\n" + }, + version_hash: "1rrmbx2" +}; +function get_hooks() { + return {}; +} +export { + assets as a, + base as b, + set_assets as c, + set_building as d, + set_private_env as e, + get_hooks as g, + options as o, + public_env as p, + reset as r, + set_public_env as s +}; diff --git a/.svelte-kit/output/server/entries/fallbacks/error.svelte.js b/.svelte-kit/output/server/entries/fallbacks/error.svelte.js new file mode 100644 index 0000000..05e2574 --- /dev/null +++ b/.svelte-kit/output/server/entries/fallbacks/error.svelte.js @@ -0,0 +1,32 @@ +import { g as getContext, c as create_ssr_component, b as subscribe, e as escape } from "../../chunks/index.js"; +const getStores = () => { + const stores = getContext("__svelte__"); + return { + /** @type {typeof page} */ + page: { + subscribe: stores.page.subscribe + }, + /** @type {typeof navigating} */ + navigating: { + subscribe: stores.navigating.subscribe + }, + /** @type {typeof updated} */ + updated: stores.updated + }; +}; +const page = { + subscribe(fn) { + const store = getStores().page; + return store.subscribe(fn); + } +}; +const Error$1 = create_ssr_component(($$result, $$props, $$bindings, slots) => { + let $page, $$unsubscribe_page; + $$unsubscribe_page = subscribe(page, (value) => $page = value); + $$unsubscribe_page(); + return `

${escape($page.status)}

+

${escape($page.error?.message)}

`; +}); +export { + Error$1 as default +}; diff --git a/.svelte-kit/output/server/entries/fallbacks/layout.svelte.js b/.svelte-kit/output/server/entries/fallbacks/layout.svelte.js new file mode 100644 index 0000000..e0fb389 --- /dev/null +++ b/.svelte-kit/output/server/entries/fallbacks/layout.svelte.js @@ -0,0 +1,7 @@ +import { c as create_ssr_component } from "../../chunks/index.js"; +const Layout = create_ssr_component(($$result, $$props, $$bindings, slots) => { + return `${slots.default ? slots.default({}) : ``}`; +}); +export { + Layout as default +}; diff --git a/.svelte-kit/output/server/entries/pages/_page.svelte.js b/.svelte-kit/output/server/entries/pages/_page.svelte.js new file mode 100644 index 0000000..10d6e31 --- /dev/null +++ b/.svelte-kit/output/server/entries/pages/_page.svelte.js @@ -0,0 +1,8 @@ +import { c as create_ssr_component } from "../../chunks/index.js"; +const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => { + return `

Welcome to SvelteKit

+

Visit kit.svelte.dev to read the documentation

`; +}); +export { + Page as default +}; diff --git a/.svelte-kit/output/server/index.js b/.svelte-kit/output/server/index.js new file mode 100644 index 0000000..ad1ad17 --- /dev/null +++ b/.svelte-kit/output/server/index.js @@ -0,0 +1,2837 @@ +import { b as base, a as assets, r as reset, p as public_env, o as options, g as get_hooks, s as set_public_env } from "./chunks/internal.js"; +import * as devalue from "devalue"; +import { n as noop, s as safe_not_equal } from "./chunks/index.js"; +import { parse, serialize } from "cookie"; +import * as set_cookie_parser from "set-cookie-parser"; +const DEV = false; +function negotiate(accept, types) { + const parts = []; + accept.split(",").forEach((str, i) => { + const match = /([^/]+)\/([^;]+)(?:;q=([0-9.]+))?/.exec(str); + if (match) { + const [, type, subtype, q = "1"] = match; + parts.push({ type, subtype, q: +q, i }); + } + }); + parts.sort((a, b) => { + if (a.q !== b.q) { + return b.q - a.q; + } + if (a.subtype === "*" !== (b.subtype === "*")) { + return a.subtype === "*" ? 1 : -1; + } + if (a.type === "*" !== (b.type === "*")) { + return a.type === "*" ? 1 : -1; + } + return a.i - b.i; + }); + let accepted; + let min_priority = Infinity; + for (const mimetype of types) { + const [type, subtype] = mimetype.split("/"); + const priority = parts.findIndex( + (part) => (part.type === type || part.type === "*") && (part.subtype === subtype || part.subtype === "*") + ); + if (priority !== -1 && priority < min_priority) { + accepted = mimetype; + min_priority = priority; + } + } + return accepted; +} +function is_content_type(request, ...types) { + const type = request.headers.get("content-type")?.split(";", 1)[0].trim() ?? ""; + return types.includes(type.toLowerCase()); +} +function is_form_content_type(request) { + return is_content_type( + request, + "application/x-www-form-urlencoded", + "multipart/form-data", + "text/plain" + ); +} +class HttpError { + /** + * @param {number} status + * @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body + */ + constructor(status, body) { + this.status = status; + if (typeof body === "string") { + this.body = { message: body }; + } else if (body) { + this.body = body; + } else { + this.body = { message: `Error: ${status}` }; + } + } + toString() { + return JSON.stringify(this.body); + } +} +class Redirect { + /** + * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status + * @param {string} location + */ + constructor(status, location) { + this.status = status; + this.location = location; + } +} +class ActionFailure { + /** + * @param {number} status + * @param {T} [data] + */ + constructor(status, data) { + this.status = status; + this.data = data; + } +} +function exec(match, params, matchers) { + const result = {}; + const values = match.slice(1); + let buffered = 0; + for (let i = 0; i < params.length; i += 1) { + const param = params[i]; + const value = values[i - buffered]; + if (param.chained && param.rest && buffered) { + result[param.name] = values.slice(i - buffered, i + 1).filter((s2) => s2).join("/"); + buffered = 0; + continue; + } + if (value === void 0) { + if (param.rest) + result[param.name] = ""; + continue; + } + if (!param.matcher || matchers[param.matcher](value)) { + result[param.name] = value; + const next_param = params[i + 1]; + const next_value = values[i + 1]; + if (next_param && !next_param.rest && next_param.optional && next_value && param.chained) { + buffered = 0; + } + continue; + } + if (param.optional && param.chained) { + buffered++; + continue; + } + return; + } + if (buffered) + return; + return result; +} +function error(status, body) { + if (isNaN(status) || status < 400 || status > 599) { + throw new Error(`HTTP error status codes must be between 400 and 599 — ${status} is invalid`); + } + return new HttpError(status, body); +} +function json(data, init2) { + const body = JSON.stringify(data); + const headers = new Headers(init2?.headers); + if (!headers.has("content-length")) { + headers.set("content-length", encoder$3.encode(body).byteLength.toString()); + } + if (!headers.has("content-type")) { + headers.set("content-type", "application/json"); + } + return new Response(body, { + ...init2, + headers + }); +} +const encoder$3 = new TextEncoder(); +function text(body, init2) { + const headers = new Headers(init2?.headers); + if (!headers.has("content-length")) { + headers.set("content-length", encoder$3.encode(body).byteLength.toString()); + } + return new Response(body, { + ...init2, + headers + }); +} +function coalesce_to_error(err) { + return err instanceof Error || err && /** @type {any} */ + err.name && /** @type {any} */ + err.message ? ( + /** @type {Error} */ + err + ) : new Error(JSON.stringify(err)); +} +function normalize_error(error2) { + return ( + /** @type {import('../runtime/control.js').Redirect | import('../runtime/control.js').HttpError | Error} */ + error2 + ); +} +function method_not_allowed(mod, method) { + return text(`${method} method not allowed`, { + status: 405, + headers: { + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405 + // "The server must generate an Allow header field in a 405 status code response" + allow: allowed_methods(mod).join(", ") + } + }); +} +function allowed_methods(mod) { + const allowed = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"].filter( + (method) => method in mod + ); + if ("GET" in mod || "HEAD" in mod) + allowed.push("HEAD"); + return allowed; +} +function static_error_page(options2, status, message) { + let page = options2.templates.error({ status, message }); + return text(page, { + headers: { "content-type": "text/html; charset=utf-8" }, + status + }); +} +async function handle_fatal_error(event, options2, error2) { + error2 = error2 instanceof HttpError ? error2 : coalesce_to_error(error2); + const status = error2 instanceof HttpError ? error2.status : 500; + const body = await handle_error_and_jsonify(event, options2, error2); + const type = negotiate(event.request.headers.get("accept") || "text/html", [ + "application/json", + "text/html" + ]); + if (event.isDataRequest || type === "application/json") { + return json(body, { + status + }); + } + return static_error_page(options2, status, body.message); +} +async function handle_error_and_jsonify(event, options2, error2) { + if (error2 instanceof HttpError) { + return error2.body; + } else { + return await options2.hooks.handleError({ error: error2, event }) ?? { + message: event.route.id != null ? "Internal Error" : "Not Found" + }; + } +} +function redirect_response(status, location) { + const response = new Response(void 0, { + status, + headers: { location } + }); + return response; +} +function clarify_devalue_error(event, error2) { + if (error2.path) { + return `Data returned from \`load\` while rendering ${event.route.id} is not serializable: ${error2.message} (data${error2.path})`; + } + if (error2.path === "") { + return `Data returned from \`load\` while rendering ${event.route.id} is not a plain object`; + } + return error2.message; +} +function stringify_uses(node) { + const uses = []; + if (node.uses && node.uses.dependencies.size > 0) { + uses.push(`"dependencies":${JSON.stringify(Array.from(node.uses.dependencies))}`); + } + if (node.uses && node.uses.params.size > 0) { + uses.push(`"params":${JSON.stringify(Array.from(node.uses.params))}`); + } + if (node.uses?.parent) + uses.push('"parent":1'); + if (node.uses?.route) + uses.push('"route":1'); + if (node.uses?.url) + uses.push('"url":1'); + return `"uses":{${uses.join(",")}}`; +} +async function render_endpoint(event, mod, state) { + const method = ( + /** @type {import('types').HttpMethod} */ + event.request.method + ); + let handler = mod[method]; + if (!handler && method === "HEAD") { + handler = mod.GET; + } + if (!handler) { + return method_not_allowed(mod, method); + } + const prerender = mod.prerender ?? state.prerender_default; + if (prerender && (mod.POST || mod.PATCH || mod.PUT || mod.DELETE)) { + throw new Error("Cannot prerender endpoints that have mutative methods"); + } + if (state.prerendering && !prerender) { + if (state.depth > 0) { + throw new Error(`${event.route.id} is not prerenderable`); + } else { + return new Response(void 0, { status: 204 }); + } + } + try { + let response = await handler( + /** @type {import('@sveltejs/kit').RequestEvent>} */ + event + ); + if (!(response instanceof Response)) { + throw new Error( + `Invalid response from route ${event.url.pathname}: handler should return a Response object` + ); + } + if (state.prerendering) { + response = new Response(response.body, { + status: response.status, + statusText: response.statusText, + headers: new Headers(response.headers) + }); + response.headers.set("x-sveltekit-prerender", String(prerender)); + } + return response; + } catch (e) { + if (e instanceof Redirect) { + return new Response(void 0, { + status: e.status, + headers: { location: e.location } + }); + } + throw e; + } +} +function is_endpoint_request(event) { + const { method, headers } = event.request; + if (method === "PUT" || method === "PATCH" || method === "DELETE" || method === "OPTIONS") { + return true; + } + if (method === "POST" && headers.get("x-sveltekit-action") === "true") + return false; + const accept = event.request.headers.get("accept") ?? "*/*"; + return negotiate(accept, ["*", "text/html"]) !== "text/html"; +} +function compact(arr) { + return arr.filter( + /** @returns {val is NonNullable} */ + (val) => val != null + ); +} +function normalize_path(path, trailing_slash) { + if (path === "/" || trailing_slash === "ignore") + return path; + if (trailing_slash === "never") { + return path.endsWith("/") ? path.slice(0, -1) : path; + } else if (trailing_slash === "always" && !path.endsWith("/")) { + return path + "/"; + } + return path; +} +function decode_pathname(pathname) { + return pathname.split("%25").map(decodeURI).join("%25"); +} +function decode_params(params) { + for (const key2 in params) { + params[key2] = decodeURIComponent(params[key2]); + } + return params; +} +const tracked_url_properties = ( + /** @type {const} */ + [ + "href", + "pathname", + "search", + "searchParams", + "toString", + "toJSON" + ] +); +function make_trackable(url, callback) { + const tracked = new URL(url); + for (const property of tracked_url_properties) { + Object.defineProperty(tracked, property, { + get() { + callback(); + return url[property]; + }, + enumerable: true, + configurable: true + }); + } + { + tracked[Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => { + return inspect(url, opts); + }; + } + disable_hash(tracked); + return tracked; +} +function disable_hash(url) { + Object.defineProperty(url, "hash", { + get() { + throw new Error( + "Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead" + ); + } + }); +} +function disable_search(url) { + for (const property of ["search", "searchParams"]) { + Object.defineProperty(url, property, { + get() { + throw new Error(`Cannot access url.${property} on a page with prerendering enabled`); + } + }); + } +} +const DATA_SUFFIX = "/__data.json"; +function has_data_suffix(pathname) { + return pathname.endsWith(DATA_SUFFIX); +} +function add_data_suffix(pathname) { + return pathname.replace(/\/$/, "") + DATA_SUFFIX; +} +function strip_data_suffix(pathname) { + return pathname.slice(0, -DATA_SUFFIX.length); +} +function is_action_json_request(event) { + const accept = negotiate(event.request.headers.get("accept") ?? "*/*", [ + "application/json", + "text/html" + ]); + return accept === "application/json" && event.request.method === "POST"; +} +async function handle_action_json_request(event, options2, server) { + const actions = server?.actions; + if (!actions) { + const no_actions_error = error(405, "POST method not allowed. No actions exist for this page"); + return action_json( + { + type: "error", + error: await handle_error_and_jsonify(event, options2, no_actions_error) + }, + { + status: no_actions_error.status, + headers: { + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405 + // "The server must generate an Allow header field in a 405 status code response" + allow: "GET" + } + } + ); + } + check_named_default_separate(actions); + try { + const data = await call_action(event, actions); + if (false) + ; + if (data instanceof ActionFailure) { + return action_json({ + type: "failure", + status: data.status, + // @ts-expect-error we assign a string to what is supposed to be an object. That's ok + // because we don't use the object outside, and this way we have better code navigation + // through knowing where the related interface is used. + data: stringify_action_response( + data.data, + /** @type {string} */ + event.route.id + ) + }); + } else { + return action_json({ + type: "success", + status: data ? 200 : 204, + // @ts-expect-error see comment above + data: stringify_action_response( + data, + /** @type {string} */ + event.route.id + ) + }); + } + } catch (e) { + const err = normalize_error(e); + if (err instanceof Redirect) { + return action_json_redirect(err); + } + return action_json( + { + type: "error", + error: await handle_error_and_jsonify(event, options2, check_incorrect_fail_use(err)) + }, + { + status: err instanceof HttpError ? err.status : 500 + } + ); + } +} +function check_incorrect_fail_use(error2) { + return error2 instanceof ActionFailure ? new Error('Cannot "throw fail()". Use "return fail()"') : error2; +} +function action_json_redirect(redirect) { + return action_json({ + type: "redirect", + status: redirect.status, + location: redirect.location + }); +} +function action_json(data, init2) { + return json(data, init2); +} +function is_action_request(event) { + return event.request.method === "POST"; +} +async function handle_action_request(event, server) { + const actions = server?.actions; + if (!actions) { + event.setHeaders({ + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405 + // "The server must generate an Allow header field in a 405 status code response" + allow: "GET" + }); + return { + type: "error", + error: error(405, "POST method not allowed. No actions exist for this page") + }; + } + check_named_default_separate(actions); + try { + const data = await call_action(event, actions); + if (false) + ; + if (data instanceof ActionFailure) { + return { + type: "failure", + status: data.status, + data: data.data + }; + } else { + return { + type: "success", + status: 200, + // @ts-expect-error this will be removed upon serialization, so `undefined` is the same as omission + data + }; + } + } catch (e) { + const err = normalize_error(e); + if (err instanceof Redirect) { + return { + type: "redirect", + status: err.status, + location: err.location + }; + } + return { + type: "error", + error: check_incorrect_fail_use(err) + }; + } +} +function check_named_default_separate(actions) { + if (actions.default && Object.keys(actions).length > 1) { + throw new Error( + "When using named actions, the default action cannot be used. See the docs for more info: https://kit.svelte.dev/docs/form-actions#named-actions" + ); + } +} +async function call_action(event, actions) { + const url = new URL(event.request.url); + let name = "default"; + for (const param of url.searchParams) { + if (param[0].startsWith("/")) { + name = param[0].slice(1); + if (name === "default") { + throw new Error('Cannot use reserved action name "default"'); + } + break; + } + } + const action = actions[name]; + if (!action) { + throw new Error(`No action with name '${name}' found`); + } + if (!is_form_content_type(event.request)) { + throw new Error( + `Actions expect form-encoded data (received ${event.request.headers.get("content-type")})` + ); + } + return action(event); +} +function validate_action_return(data) { + if (data instanceof Redirect) { + throw new Error("Cannot `return redirect(...)` — use `throw redirect(...)` instead"); + } + if (data instanceof HttpError) { + throw new Error( + "Cannot `return error(...)` — use `throw error(...)` or `return fail(...)` instead" + ); + } +} +function uneval_action_response(data, route_id) { + return try_deserialize(data, devalue.uneval, route_id); +} +function stringify_action_response(data, route_id) { + return try_deserialize(data, devalue.stringify, route_id); +} +function try_deserialize(data, fn, route_id) { + try { + return fn(data); + } catch (e) { + const error2 = ( + /** @type {any} */ + e + ); + if ("path" in error2) { + let message = `Data returned from action inside ${route_id} is not serializable: ${error2.message}`; + if (error2.path !== "") + message += ` (data.${error2.path})`; + throw new Error(message); + } + throw error2; + } +} +async function unwrap_promises(object) { + for (const key2 in object) { + if (typeof object[key2]?.then === "function") { + return Object.fromEntries( + await Promise.all(Object.entries(object).map(async ([key3, value]) => [key3, await value])) + ); + } + } + return object; +} +const INVALIDATED_PARAM = "x-sveltekit-invalidated"; +async function load_server_data({ + event, + state, + node, + parent, + // TODO 2.0: Remove this + track_server_fetches +}) { + if (!node?.server) + return null; + const uses = { + dependencies: /* @__PURE__ */ new Set(), + params: /* @__PURE__ */ new Set(), + parent: false, + route: false, + url: false + }; + const url = make_trackable(event.url, () => { + uses.url = true; + }); + if (state.prerendering) { + disable_search(url); + } + const result = await node.server.load?.call(null, { + ...event, + fetch: (info, init2) => { + const url2 = new URL(info instanceof Request ? info.url : info, event.url); + if (track_server_fetches) { + uses.dependencies.add(url2.href); + } + return event.fetch(info, init2); + }, + /** @param {string[]} deps */ + depends: (...deps) => { + for (const dep of deps) { + const { href } = new URL(dep, event.url); + uses.dependencies.add(href); + } + }, + params: new Proxy(event.params, { + get: (target, key2) => { + uses.params.add(key2); + return target[ + /** @type {string} */ + key2 + ]; + } + }), + parent: async () => { + uses.parent = true; + return parent(); + }, + route: new Proxy(event.route, { + get: (target, key2) => { + uses.route = true; + return target[ + /** @type {'id'} */ + key2 + ]; + } + }), + url + }); + const data = result ? await unwrap_promises(result) : null; + return { + type: "data", + data, + uses, + slash: node.server.trailingSlash + }; +} +async function load_data({ + event, + fetched, + node, + parent, + server_data_promise, + state, + resolve_opts, + csr +}) { + const server_data_node = await server_data_promise; + if (!node?.universal?.load) { + return server_data_node?.data ?? null; + } + const result = await node.universal.load.call(null, { + url: event.url, + params: event.params, + data: server_data_node?.data ?? null, + route: event.route, + fetch: create_universal_fetch(event, state, fetched, csr, resolve_opts), + setHeaders: event.setHeaders, + depends: () => { + }, + parent + }); + const data = result ? await unwrap_promises(result) : null; + return data; +} +function create_universal_fetch(event, state, fetched, csr, resolve_opts) { + return async (input, init2) => { + const cloned_body = input instanceof Request && input.body ? input.clone().body : null; + let response = await event.fetch(input, init2); + const url = new URL(input instanceof Request ? input.url : input, event.url); + const same_origin = url.origin === event.url.origin; + let dependency; + if (same_origin) { + if (state.prerendering) { + dependency = { response, body: null }; + state.prerendering.dependencies.set(url.pathname, dependency); + } + } else { + const mode = input instanceof Request ? input.mode : init2?.mode ?? "cors"; + if (mode === "no-cors") { + response = new Response("", { + status: response.status, + statusText: response.statusText, + headers: response.headers + }); + } else { + const acao = response.headers.get("access-control-allow-origin"); + if (!acao || acao !== event.url.origin && acao !== "*") { + throw new Error( + `CORS error: ${acao ? "Incorrect" : "No"} 'Access-Control-Allow-Origin' header is present on the requested resource` + ); + } + } + } + const proxy = new Proxy(response, { + get(response2, key2, _receiver) { + async function text2() { + const body = await response2.text(); + if (!body || typeof body === "string") { + const status_number = Number(response2.status); + if (isNaN(status_number)) { + throw new Error( + `response.status is not a number. value: "${response2.status}" type: ${typeof response2.status}` + ); + } + fetched.push({ + url: same_origin ? url.href.slice(event.url.origin.length) : url.href, + method: event.request.method, + request_body: ( + /** @type {string | ArrayBufferView | undefined} */ + input instanceof Request && cloned_body ? await stream_to_string(cloned_body) : init2?.body + ), + request_headers: init2?.headers, + response_body: body, + response: response2 + }); + } + if (dependency) { + dependency.body = body; + } + return body; + } + if (key2 === "arrayBuffer") { + return async () => { + const buffer = await response2.arrayBuffer(); + if (dependency) { + dependency.body = new Uint8Array(buffer); + } + return buffer; + }; + } + if (key2 === "text") { + return text2; + } + if (key2 === "json") { + return async () => { + return JSON.parse(await text2()); + }; + } + return Reflect.get(response2, key2, response2); + } + }); + if (csr) { + const get = response.headers.get; + response.headers.get = (key2) => { + const lower = key2.toLowerCase(); + const value = get.call(response.headers, lower); + if (value && !lower.startsWith("x-sveltekit-")) { + const included = resolve_opts.filterSerializedResponseHeaders(lower, value); + if (!included) { + throw new Error( + `Failed to get response header "${lower}" — it must be included by the \`filterSerializedResponseHeaders\` option: https://kit.svelte.dev/docs/hooks#server-hooks-handle (at ${event.route.id})` + ); + } + } + return value; + }; + } + return proxy; + }; +} +async function stream_to_string(stream) { + let result = ""; + const reader = stream.getReader(); + const decoder = new TextDecoder(); + while (true) { + const { done, value } = await reader.read(); + if (done) { + break; + } + result += decoder.decode(value); + } + return result; +} +const subscriber_queue = []; +function readable(value, start) { + return { + subscribe: writable(value, start).subscribe + }; +} +function writable(value, start = noop) { + let stop; + const subscribers = /* @__PURE__ */ new Set(); + function set(new_value) { + if (safe_not_equal(value, new_value)) { + value = new_value; + if (stop) { + const run_queue = !subscriber_queue.length; + for (const subscriber of subscribers) { + subscriber[1](); + subscriber_queue.push(subscriber, value); + } + if (run_queue) { + for (let i = 0; i < subscriber_queue.length; i += 2) { + subscriber_queue[i][0](subscriber_queue[i + 1]); + } + subscriber_queue.length = 0; + } + } + } + } + function update(fn) { + set(fn(value)); + } + function subscribe(run, invalidate = noop) { + const subscriber = [run, invalidate]; + subscribers.add(subscriber); + if (subscribers.size === 1) { + stop = start(set) || noop; + } + run(value); + return () => { + subscribers.delete(subscriber); + if (subscribers.size === 0 && stop) { + stop(); + stop = null; + } + }; + } + return { set, update, subscribe }; +} +function hash(...values) { + let hash2 = 5381; + for (const value of values) { + if (typeof value === "string") { + let i = value.length; + while (i) + hash2 = hash2 * 33 ^ value.charCodeAt(--i); + } else if (ArrayBuffer.isView(value)) { + const buffer = new Uint8Array(value.buffer, value.byteOffset, value.byteLength); + let i = buffer.length; + while (i) + hash2 = hash2 * 33 ^ buffer[--i]; + } else { + throw new TypeError("value must be a string or TypedArray"); + } + } + return (hash2 >>> 0).toString(36); +} +const escape_html_attr_dict = { + "&": "&", + '"': """ +}; +const escape_html_attr_regex = new RegExp( + // special characters + `[${Object.keys(escape_html_attr_dict).join("")}]|[\\ud800-\\udbff](?![\\udc00-\\udfff])|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\udc00-\\udfff]`, + "g" +); +function escape_html_attr(str) { + const escaped_str = str.replace(escape_html_attr_regex, (match) => { + if (match.length === 2) { + return match; + } + return escape_html_attr_dict[match] ?? `&#${match.charCodeAt(0)};`; + }); + return `"${escaped_str}"`; +} +const replacements = { + "<": "\\u003C", + "\u2028": "\\u2028", + "\u2029": "\\u2029" +}; +const pattern = new RegExp(`[${Object.keys(replacements).join("")}]`, "g"); +function serialize_data(fetched, filter, prerendering = false) { + const headers = {}; + let cache_control = null; + let age = null; + let vary = false; + for (const [key2, value] of fetched.response.headers) { + if (filter(key2, value)) { + headers[key2] = value; + } + if (key2 === "cache-control") + cache_control = value; + if (key2 === "age") + age = value; + if (key2 === "vary") + vary = true; + } + const payload = { + status: fetched.response.status, + statusText: fetched.response.statusText, + headers, + body: fetched.response_body + }; + const safe_payload = JSON.stringify(payload).replace(pattern, (match) => replacements[match]); + const attrs = [ + 'type="application/json"', + "data-sveltekit-fetched", + `data-url=${escape_html_attr(fetched.url)}` + ]; + if (fetched.request_headers || fetched.request_body) { + const values = []; + if (fetched.request_headers) { + values.push([...new Headers(fetched.request_headers)].join(",")); + } + if (fetched.request_body) { + values.push(fetched.request_body); + } + attrs.push(`data-hash="${hash(...values)}"`); + } + if (!prerendering && fetched.method === "GET" && cache_control && !vary) { + const match = /s-maxage=(\d+)/g.exec(cache_control) ?? /max-age=(\d+)/g.exec(cache_control); + if (match) { + const ttl = +match[1] - +(age ?? "0"); + attrs.push(`data-ttl="${ttl}"`); + } + } + return `