Refactor environment variable declarations, update client entry points, and optimize asset handling in SvelteKit project for improved performance and maintainability.
This commit is contained in:
@@ -117,7 +117,7 @@
|
||||
"_index.js"
|
||||
],
|
||||
"css": [
|
||||
"_app/immutable/assets/_layout.BQZUYDmN.css"
|
||||
"_app/immutable/assets/_layout.xzg7NZgL.css"
|
||||
]
|
||||
},
|
||||
"src/routes/+layout.ts": {
|
||||
@@ -126,6 +126,12 @@
|
||||
"src": "src/routes/+layout.ts",
|
||||
"isEntry": true
|
||||
},
|
||||
"src/routes/+page.server.ts": {
|
||||
"file": "entries/pages/_page.server.ts.js",
|
||||
"name": "entries/pages/_page.server.ts",
|
||||
"src": "src/routes/+page.server.ts",
|
||||
"isEntry": true
|
||||
},
|
||||
"src/routes/+page.svelte": {
|
||||
"file": "entries/pages/_page.svelte.js",
|
||||
"name": "entries/pages/_page.svelte",
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -101,7 +101,7 @@ const options = {
|
||||
<div class="error">
|
||||
<span class="status">` + status + '</span>\n <div class="message">\n <h1>' + message + "</h1>\n </div>\n </div>\n </body>\n</html>\n"
|
||||
},
|
||||
version_hash: "1clozn7"
|
||||
version_hash: "1cw4viz"
|
||||
};
|
||||
async function get_hooks() {
|
||||
let handle;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
const COLLECTION = "Stackq_Items";
|
||||
const load = async ({ locals }) => {
|
||||
const list = await locals.pb.collection(COLLECTION).getFullList({ sort: "-created", expand: "Parent" }).catch(() => []);
|
||||
const itemsForParent = list.map((i) => ({ id: i.id, Item: i.Item, SKU: i.SKU }));
|
||||
return { itemsForParent };
|
||||
};
|
||||
export {
|
||||
load
|
||||
};
|
||||
@@ -69,22 +69,37 @@ function Button($$renderer, $$props) {
|
||||
});
|
||||
}
|
||||
function _page($$renderer) {
|
||||
$$renderer.push(`<main class="flex min-h-screen flex-col items-center justify-center gap-4 p-8"><h1 class="text-2xl font-semibold">Stackq</h1> <p class="text-muted-foreground">Svelte 5 + shadcn-svelte + PocketBase</p> <div class="flex gap-2"><a href="/items">`);
|
||||
Button($$renderer, {
|
||||
children: ($$renderer2) => {
|
||||
$$renderer2.push(`<!---->Items table`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer.push(`<!----></a> <a href="/logout">`);
|
||||
Button($$renderer, {
|
||||
variant: "outline",
|
||||
children: ($$renderer2) => {
|
||||
$$renderer2.push(`<!---->Log out`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer.push(`<!----></a></div></main>`);
|
||||
{
|
||||
$$renderer.push("<!--[!-->");
|
||||
$$renderer.push(`<main class="flex min-h-screen flex-col items-center justify-center gap-6 p-8"><h1 class="text-2xl font-semibold">Stackq</h1> <p class="text-muted-foreground">Svelte 5 + shadcn-svelte + PocketBase</p> <div class="flex w-full max-w-xs flex-col gap-2"><a href="/items" class="block">`);
|
||||
Button($$renderer, {
|
||||
class: "w-full",
|
||||
children: ($$renderer2) => {
|
||||
$$renderer2.push(`<!---->Items table`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer.push(`<!----></a> <a href="/items" class="block">`);
|
||||
Button($$renderer, {
|
||||
class: "w-full",
|
||||
variant: "outline",
|
||||
children: ($$renderer2) => {
|
||||
$$renderer2.push(`<!---->New item`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer.push(`<!----></a> <a href="/logout" class="block">`);
|
||||
Button($$renderer, {
|
||||
class: "w-full",
|
||||
variant: "outline",
|
||||
children: ($$renderer2) => {
|
||||
$$renderer2.push(`<!---->Log out`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer.push(`<!----></a></div></main>`);
|
||||
}
|
||||
$$renderer.push(`<!--]-->`);
|
||||
}
|
||||
export {
|
||||
_page as default
|
||||
|
||||
@@ -10,7 +10,7 @@ return {
|
||||
assets: new Set([]),
|
||||
mimeTypes: {},
|
||||
_: {
|
||||
client: {start:"_app/immutable/entry/start.lYj2oyFl.js",app:"_app/immutable/entry/app.xKzg9ha8.js",imports:["_app/immutable/entry/start.lYj2oyFl.js","_app/immutable/chunks/BU_acMKx.js","_app/immutable/chunks/BMmwim-G.js","_app/immutable/chunks/MIlO0V30.js","_app/immutable/chunks/Dt2zEVER.js","_app/immutable/entry/app.xKzg9ha8.js","_app/immutable/chunks/DPCugUAM.js","_app/immutable/chunks/MIlO0V30.js","_app/immutable/chunks/D6Mj8HfB.js","_app/immutable/chunks/BMmwim-G.js","_app/immutable/chunks/Dt2zEVER.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/znVx7SEM.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
||||
client: {start:"_app/immutable/entry/start.BXvCRdku.js",app:"_app/immutable/entry/app.c69iw9ai.js",imports:["_app/immutable/entry/start.BXvCRdku.js","_app/immutable/chunks/BapE3c1q.js","_app/immutable/chunks/DZmckTjd.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/agKGoZF1.js","_app/immutable/entry/app.c69iw9ai.js","_app/immutable/chunks/CRDN6Mh7.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/DZmckTjd.js","_app/immutable/chunks/agKGoZF1.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/25AjRaeI.js","_app/immutable/chunks/jOLfEXYH.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
||||
nodes: [
|
||||
__memo(() => import('./nodes/0.js')),
|
||||
__memo(() => import('./nodes/1.js')),
|
||||
|
||||
@@ -10,7 +10,7 @@ return {
|
||||
assets: new Set([]),
|
||||
mimeTypes: {},
|
||||
_: {
|
||||
client: {start:"_app/immutable/entry/start.lYj2oyFl.js",app:"_app/immutable/entry/app.xKzg9ha8.js",imports:["_app/immutable/entry/start.lYj2oyFl.js","_app/immutable/chunks/BU_acMKx.js","_app/immutable/chunks/BMmwim-G.js","_app/immutable/chunks/MIlO0V30.js","_app/immutable/chunks/Dt2zEVER.js","_app/immutable/entry/app.xKzg9ha8.js","_app/immutable/chunks/DPCugUAM.js","_app/immutable/chunks/MIlO0V30.js","_app/immutable/chunks/D6Mj8HfB.js","_app/immutable/chunks/BMmwim-G.js","_app/immutable/chunks/Dt2zEVER.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/znVx7SEM.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
||||
client: {start:"_app/immutable/entry/start.BXvCRdku.js",app:"_app/immutable/entry/app.c69iw9ai.js",imports:["_app/immutable/entry/start.BXvCRdku.js","_app/immutable/chunks/BapE3c1q.js","_app/immutable/chunks/DZmckTjd.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/agKGoZF1.js","_app/immutable/entry/app.c69iw9ai.js","_app/immutable/chunks/CRDN6Mh7.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/DZmckTjd.js","_app/immutable/chunks/agKGoZF1.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/25AjRaeI.js","_app/immutable/chunks/jOLfEXYH.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
||||
nodes: [
|
||||
__memo(() => import('./nodes/0.js')),
|
||||
__memo(() => import('./nodes/1.js')),
|
||||
|
||||
@@ -5,6 +5,6 @@ let component_cache;
|
||||
export const component = async () => component_cache ??= (await import('../entries/pages/_layout.svelte.js')).default;
|
||||
export { universal };
|
||||
export const universal_id = "src/routes/+layout.ts";
|
||||
export const imports = ["_app/immutable/nodes/0.BbNusdVr.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/DAt58MA1.js","_app/immutable/chunks/MIlO0V30.js"];
|
||||
export const stylesheets = ["_app/immutable/assets/0.EFPCDS6k.css"];
|
||||
export const imports = ["_app/immutable/nodes/0.BXv9ZfXj.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/hqfhVoHF.js","_app/immutable/chunks/Dexp9pM5.js"];
|
||||
export const stylesheets = ["_app/immutable/assets/0.DbRKE6YE.css"];
|
||||
export const fonts = [];
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
export const index = 1;
|
||||
let component_cache;
|
||||
export const component = async () => component_cache ??= (await import('../entries/fallbacks/error.svelte.js')).default;
|
||||
export const imports = ["_app/immutable/nodes/1.BSDMq5ii.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/DAt58MA1.js","_app/immutable/chunks/MIlO0V30.js","_app/immutable/chunks/BMmwim-G.js","_app/immutable/chunks/Dt2zEVER.js","_app/immutable/chunks/BU_acMKx.js"];
|
||||
export const imports = ["_app/immutable/nodes/1.BT8sl3NL.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/hqfhVoHF.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/DZmckTjd.js","_app/immutable/chunks/agKGoZF1.js","_app/immutable/chunks/BapE3c1q.js"];
|
||||
export const stylesheets = [];
|
||||
export const fonts = [];
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
|
||||
import * as server from '../entries/pages/_page.server.ts.js';
|
||||
|
||||
export const index = 2;
|
||||
let component_cache;
|
||||
export const component = async () => component_cache ??= (await import('../entries/pages/_page.svelte.js')).default;
|
||||
export const imports = ["_app/immutable/nodes/2.B-LkGsse.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/DAt58MA1.js","_app/immutable/chunks/MIlO0V30.js","_app/immutable/chunks/CINS0kDe.js","_app/immutable/chunks/De4R2cbq.js","_app/immutable/chunks/D6Mj8HfB.js","_app/immutable/chunks/Dt2zEVER.js","_app/immutable/chunks/znVx7SEM.js"];
|
||||
export { server };
|
||||
export const server_id = "src/routes/+page.server.ts";
|
||||
export const imports = ["_app/immutable/nodes/2.OkkHA0lV.js","_app/immutable/chunks/CRDN6Mh7.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/hqfhVoHF.js","_app/immutable/chunks/DcVg5zjO.js","_app/immutable/chunks/B12dZE2q.js","_app/immutable/chunks/BKSreT2u.js","_app/immutable/chunks/agKGoZF1.js","_app/immutable/chunks/jOLfEXYH.js"];
|
||||
export const stylesheets = [];
|
||||
export const fonts = [];
|
||||
|
||||
@@ -5,6 +5,6 @@ let component_cache;
|
||||
export const component = async () => component_cache ??= (await import('../entries/pages/items/_page.svelte.js')).default;
|
||||
export { server };
|
||||
export const server_id = "src/routes/items/+page.server.ts";
|
||||
export const imports = ["_app/immutable/nodes/4.CiQuz_-G.js","_app/immutable/chunks/D1I5yNUo.js","_app/immutable/chunks/DPCugUAM.js","_app/immutable/chunks/MIlO0V30.js","_app/immutable/chunks/D6Mj8HfB.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/DBvDeCtH.js","_app/immutable/chunks/De4R2cbq.js","_app/immutable/chunks/Dt2zEVER.js","_app/immutable/chunks/znVx7SEM.js"];
|
||||
export const imports = ["_app/immutable/nodes/4.Bn1qLW0B.js","_app/immutable/chunks/BxPgF2w2.js","_app/immutable/chunks/CRDN6Mh7.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/DcVg5zjO.js","_app/immutable/chunks/25AjRaeI.js","_app/immutable/chunks/BKSreT2u.js","_app/immutable/chunks/agKGoZF1.js","_app/immutable/chunks/BC20z61P.js","_app/immutable/chunks/jOLfEXYH.js"];
|
||||
export const stylesheets = [];
|
||||
export const fonts = [];
|
||||
|
||||
@@ -5,6 +5,6 @@ let component_cache;
|
||||
export const component = async () => component_cache ??= (await import('../entries/pages/login/_page.svelte.js')).default;
|
||||
export { server };
|
||||
export const server_id = "src/routes/login/+page.server.ts";
|
||||
export const imports = ["_app/immutable/nodes/5.CncCf1V5.js","_app/immutable/chunks/DPCugUAM.js","_app/immutable/chunks/MIlO0V30.js","_app/immutable/chunks/D6Mj8HfB.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/DBvDeCtH.js"];
|
||||
export const imports = ["_app/immutable/nodes/5.u4tkKrg-.js","_app/immutable/chunks/CRDN6Mh7.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/DcVg5zjO.js","_app/immutable/chunks/25AjRaeI.js"];
|
||||
export const stylesheets = [];
|
||||
export const fonts = [];
|
||||
|
||||
Vendored
+34
-30
@@ -26,54 +26,56 @@
|
||||
* ```
|
||||
*/
|
||||
declare module '$env/static/private' {
|
||||
export const VSCODE_GIT_IPC_AUTH_TOKEN: string;
|
||||
export const TERM_PROGRAM: string;
|
||||
export const _ZO_DOCTOR: string;
|
||||
export const VSCODE_CRASH_REPORTER_PROCESS_TYPE: string;
|
||||
export const NODE: string;
|
||||
export const TERM: string;
|
||||
export const SHELL: string;
|
||||
export const HOMEBREW_REPOSITORY: string;
|
||||
export const VSCODE_PROCESS_TITLE: string;
|
||||
export const TMPDIR: string;
|
||||
export const TERM_PROGRAM_VERSION: string;
|
||||
export const ZDOTDIR: string;
|
||||
export const CURSOR_TRACE_ID: string;
|
||||
export const HOMEBREW_REPOSITORY: string;
|
||||
export const MallocNanoZone: string;
|
||||
export const CURSOR_TRACE_ID: string;
|
||||
export const NO_COLOR: string;
|
||||
export const npm_config_local_prefix: string;
|
||||
export const USER: string;
|
||||
export const COMMAND_MODE: string;
|
||||
export const SSH_AUTH_SOCK: string;
|
||||
export const VSCODE_PROFILE_INITIALIZED: 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 USER_ZDOTDIR: string;
|
||||
export const __CFBundleIdentifier: string;
|
||||
export const npm_command: string;
|
||||
export const PWD: string;
|
||||
export const VSCODE_HANDLES_UNCAUGHT_ERRORS: string;
|
||||
export const npm_lifecycle_event: string;
|
||||
export const VSCODE_ESM_ENTRYPOINT: string;
|
||||
export const npm_package_name: string;
|
||||
export const CURSOR_AGENT: string;
|
||||
export const LANG: string;
|
||||
export const VSCODE_GIT_ASKPASS_EXTRA_ARGS: string;
|
||||
export const XPC_FLAGS: string;
|
||||
export const FORCE_COLOR: 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 VSCODE_NLS_CONFIG: string;
|
||||
export const CI: string;
|
||||
export const HOMEBREW_PREFIX: string;
|
||||
export const LOGNAME: string;
|
||||
export const npm_lifecycle_script: string;
|
||||
export const VSCODE_GIT_IPC_HANDLE: string;
|
||||
export const VSCODE_IPC_HOOK: string;
|
||||
export const VSCODE_CODE_CACHE_PATH: string;
|
||||
export const npm_config_user_agent: string;
|
||||
export const VSCODE_GIT_ASKPASS_NODE: string;
|
||||
export const GIT_ASKPASS: string;
|
||||
export const VSCODE_PID: string;
|
||||
export const INFOPATH: string;
|
||||
export const HOMEBREW_CELLAR: string;
|
||||
export const OSLogRateLimit: string;
|
||||
export const VSCODE_L10N_BUNDLE_LOCATION: string;
|
||||
export const VSCODE_CWD: string;
|
||||
export const npm_node_execpath: string;
|
||||
export const COLORTERM: string;
|
||||
export const NODE_ENV: string;
|
||||
}
|
||||
|
||||
@@ -104,54 +106,56 @@ declare module '$env/static/public' {
|
||||
*/
|
||||
declare module '$env/dynamic/private' {
|
||||
export const env: {
|
||||
VSCODE_GIT_IPC_AUTH_TOKEN: string;
|
||||
TERM_PROGRAM: string;
|
||||
_ZO_DOCTOR: string;
|
||||
VSCODE_CRASH_REPORTER_PROCESS_TYPE: string;
|
||||
NODE: string;
|
||||
TERM: string;
|
||||
SHELL: string;
|
||||
HOMEBREW_REPOSITORY: string;
|
||||
VSCODE_PROCESS_TITLE: string;
|
||||
TMPDIR: string;
|
||||
TERM_PROGRAM_VERSION: string;
|
||||
ZDOTDIR: string;
|
||||
CURSOR_TRACE_ID: string;
|
||||
HOMEBREW_REPOSITORY: string;
|
||||
MallocNanoZone: string;
|
||||
CURSOR_TRACE_ID: string;
|
||||
NO_COLOR: string;
|
||||
npm_config_local_prefix: string;
|
||||
USER: string;
|
||||
COMMAND_MODE: string;
|
||||
SSH_AUTH_SOCK: string;
|
||||
VSCODE_PROFILE_INITIALIZED: string;
|
||||
__CF_USER_TEXT_ENCODING: string;
|
||||
npm_execpath: string;
|
||||
PATH: string;
|
||||
npm_package_json: string;
|
||||
_: string;
|
||||
USER_ZDOTDIR: string;
|
||||
__CFBundleIdentifier: string;
|
||||
npm_command: string;
|
||||
PWD: string;
|
||||
VSCODE_HANDLES_UNCAUGHT_ERRORS: string;
|
||||
npm_lifecycle_event: string;
|
||||
VSCODE_ESM_ENTRYPOINT: string;
|
||||
npm_package_name: string;
|
||||
CURSOR_AGENT: string;
|
||||
LANG: string;
|
||||
VSCODE_GIT_ASKPASS_EXTRA_ARGS: string;
|
||||
XPC_FLAGS: string;
|
||||
FORCE_COLOR: string;
|
||||
npm_package_version: string;
|
||||
XPC_SERVICE_NAME: string;
|
||||
VSCODE_INJECTION: string;
|
||||
SHLVL: string;
|
||||
HOME: string;
|
||||
VSCODE_GIT_ASKPASS_MAIN: string;
|
||||
VSCODE_NLS_CONFIG: string;
|
||||
CI: string;
|
||||
HOMEBREW_PREFIX: string;
|
||||
LOGNAME: string;
|
||||
npm_lifecycle_script: string;
|
||||
VSCODE_GIT_IPC_HANDLE: string;
|
||||
VSCODE_IPC_HOOK: string;
|
||||
VSCODE_CODE_CACHE_PATH: string;
|
||||
npm_config_user_agent: string;
|
||||
VSCODE_GIT_ASKPASS_NODE: string;
|
||||
GIT_ASKPASS: string;
|
||||
VSCODE_PID: string;
|
||||
INFOPATH: string;
|
||||
HOMEBREW_CELLAR: string;
|
||||
OSLogRateLimit: string;
|
||||
VSCODE_L10N_BUNDLE_LOCATION: string;
|
||||
VSCODE_CWD: string;
|
||||
npm_node_execpath: string;
|
||||
COLORTERM: string;
|
||||
NODE_ENV: string;
|
||||
[key: `PUBLIC_${string}`]: undefined;
|
||||
[key: `${string}`]: string | undefined;
|
||||
|
||||
@@ -12,7 +12,7 @@ export const nodes = [
|
||||
export const server_loads = [];
|
||||
|
||||
export const dictionary = {
|
||||
"/": [2],
|
||||
"/": [~2],
|
||||
"/items": [~4],
|
||||
"/login": [~5],
|
||||
"/logout": [~3]
|
||||
|
||||
@@ -12,7 +12,7 @@ export const nodes = [
|
||||
export const server_loads = [];
|
||||
|
||||
export const dictionary = {
|
||||
"/": [2],
|
||||
"/": [~2],
|
||||
"/items": [~4],
|
||||
"/login": [~5],
|
||||
"/logout": [~3]
|
||||
|
||||
@@ -24,7 +24,7 @@ export const options = {
|
||||
app: ({ head, body, assets, nonce, env }) => "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <link rel=\"icon\" href=\"" + assets + "/favicon.png\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n " + head + "\n </head>\n <body data-sveltekit-preload-data=\"hover\">\n <div style=\"display: contents\">" + body + "</div>\n </body>\n</html>\n",
|
||||
error: ({ status, message }) => "<!doctype html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<title>" + message + "</title>\n\n\t\t<style>\n\t\t\tbody {\n\t\t\t\t--bg: white;\n\t\t\t\t--fg: #222;\n\t\t\t\t--divider: #ccc;\n\t\t\t\tbackground: var(--bg);\n\t\t\t\tcolor: var(--fg);\n\t\t\t\tfont-family:\n\t\t\t\t\tsystem-ui,\n\t\t\t\t\t-apple-system,\n\t\t\t\t\tBlinkMacSystemFont,\n\t\t\t\t\t'Segoe UI',\n\t\t\t\t\tRoboto,\n\t\t\t\t\tOxygen,\n\t\t\t\t\tUbuntu,\n\t\t\t\t\tCantarell,\n\t\t\t\t\t'Open Sans',\n\t\t\t\t\t'Helvetica Neue',\n\t\t\t\t\tsans-serif;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.error {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tmax-width: 32rem;\n\t\t\t\tmargin: 0 1rem;\n\t\t\t}\n\n\t\t\t.status {\n\t\t\t\tfont-weight: 200;\n\t\t\t\tfont-size: 3rem;\n\t\t\t\tline-height: 1;\n\t\t\t\tposition: relative;\n\t\t\t\ttop: -0.05rem;\n\t\t\t}\n\n\t\t\t.message {\n\t\t\t\tborder-left: 1px solid var(--divider);\n\t\t\t\tpadding: 0 0 0 1rem;\n\t\t\t\tmargin: 0 0 0 1rem;\n\t\t\t\tmin-height: 2.5rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t.message h1 {\n\t\t\t\tfont-weight: 400;\n\t\t\t\tfont-size: 1em;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t@media (prefers-color-scheme: dark) {\n\t\t\t\tbody {\n\t\t\t\t\t--bg: #222;\n\t\t\t\t\t--fg: #ddd;\n\t\t\t\t\t--divider: #666;\n\t\t\t\t}\n\t\t\t}\n\t\t</style>\n\t</head>\n\t<body>\n\t\t<div class=\"error\">\n\t\t\t<span class=\"status\">" + status + "</span>\n\t\t\t<div class=\"message\">\n\t\t\t\t<h1>" + message + "</h1>\n\t\t\t</div>\n\t\t</div>\n\t</body>\n</html>\n"
|
||||
},
|
||||
version_hash: "ajbkuw"
|
||||
version_hash: "1cw4viz"
|
||||
};
|
||||
|
||||
export async function get_hooks() {
|
||||
|
||||
@@ -0,0 +1,323 @@
|
||||
{
|
||||
".svelte-kit/generated/client-optimized/app.js": {
|
||||
"file": "_app/immutable/entry/app.c69iw9ai.js",
|
||||
"name": "entry/app",
|
||||
"src": ".svelte-kit/generated/client-optimized/app.js",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_CRDN6Mh7.js",
|
||||
"_Dexp9pM5.js",
|
||||
"_DZmckTjd.js",
|
||||
"_Bzak7iHL.js",
|
||||
"_25AjRaeI.js",
|
||||
"_jOLfEXYH.js"
|
||||
],
|
||||
"dynamicImports": [
|
||||
".svelte-kit/generated/client-optimized/nodes/0.js",
|
||||
".svelte-kit/generated/client-optimized/nodes/1.js",
|
||||
".svelte-kit/generated/client-optimized/nodes/2.js",
|
||||
"_25AjRaeI.js",
|
||||
".svelte-kit/generated/client-optimized/nodes/4.js",
|
||||
".svelte-kit/generated/client-optimized/nodes/5.js"
|
||||
]
|
||||
},
|
||||
".svelte-kit/generated/client-optimized/nodes/0.js": {
|
||||
"file": "_app/immutable/nodes/0.BXv9ZfXj.js",
|
||||
"name": "nodes/0",
|
||||
"src": ".svelte-kit/generated/client-optimized/nodes/0.js",
|
||||
"isEntry": true,
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"_Bzak7iHL.js",
|
||||
"_hqfhVoHF.js",
|
||||
"_Dexp9pM5.js"
|
||||
],
|
||||
"css": [
|
||||
"_app/immutable/assets/0.DbRKE6YE.css"
|
||||
]
|
||||
},
|
||||
".svelte-kit/generated/client-optimized/nodes/1.js": {
|
||||
"file": "_app/immutable/nodes/1.BT8sl3NL.js",
|
||||
"name": "nodes/1",
|
||||
"src": ".svelte-kit/generated/client-optimized/nodes/1.js",
|
||||
"isEntry": true,
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"_Bzak7iHL.js",
|
||||
"_hqfhVoHF.js",
|
||||
"_Dexp9pM5.js",
|
||||
"_DZmckTjd.js",
|
||||
"_BapE3c1q.js"
|
||||
]
|
||||
},
|
||||
".svelte-kit/generated/client-optimized/nodes/2.js": {
|
||||
"file": "_app/immutable/nodes/2.OkkHA0lV.js",
|
||||
"name": "nodes/2",
|
||||
"src": ".svelte-kit/generated/client-optimized/nodes/2.js",
|
||||
"isEntry": true,
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"_CRDN6Mh7.js",
|
||||
"_Bzak7iHL.js",
|
||||
"_hqfhVoHF.js",
|
||||
"_Dexp9pM5.js",
|
||||
"_DcVg5zjO.js",
|
||||
"_B12dZE2q.js"
|
||||
],
|
||||
"dynamicImports": [
|
||||
"src/routes/HomeWithDialog.svelte"
|
||||
]
|
||||
},
|
||||
".svelte-kit/generated/client-optimized/nodes/4.js": {
|
||||
"file": "_app/immutable/nodes/4.Bn1qLW0B.js",
|
||||
"name": "nodes/4",
|
||||
"src": ".svelte-kit/generated/client-optimized/nodes/4.js",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_BxPgF2w2.js"
|
||||
]
|
||||
},
|
||||
".svelte-kit/generated/client-optimized/nodes/5.js": {
|
||||
"file": "_app/immutable/nodes/5.u4tkKrg-.js",
|
||||
"name": "nodes/5",
|
||||
"src": ".svelte-kit/generated/client-optimized/nodes/5.js",
|
||||
"isEntry": true,
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"_CRDN6Mh7.js",
|
||||
"_Bzak7iHL.js",
|
||||
"_Dexp9pM5.js",
|
||||
"_DcVg5zjO.js",
|
||||
"_25AjRaeI.js"
|
||||
],
|
||||
"dynamicImports": [
|
||||
"src/routes/login/LoginForm.svelte"
|
||||
]
|
||||
},
|
||||
"_25AjRaeI.js": {
|
||||
"file": "_app/immutable/chunks/25AjRaeI.js",
|
||||
"name": "3",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"_Dexp9pM5.js",
|
||||
"_CRDN6Mh7.js"
|
||||
]
|
||||
},
|
||||
"_61AlszRR.js": {
|
||||
"file": "_app/immutable/chunks/61AlszRR.js",
|
||||
"name": "forms",
|
||||
"imports": [
|
||||
"_Dexp9pM5.js",
|
||||
"_Bzak7iHL.js",
|
||||
"_CRDN6Mh7.js",
|
||||
"_BKSreT2u.js",
|
||||
"_jOLfEXYH.js",
|
||||
"_25AjRaeI.js",
|
||||
"_BapE3c1q.js"
|
||||
]
|
||||
},
|
||||
"_B12dZE2q.js": {
|
||||
"file": "_app/immutable/chunks/B12dZE2q.js",
|
||||
"name": "button",
|
||||
"imports": [
|
||||
"_Bzak7iHL.js",
|
||||
"_BKSreT2u.js",
|
||||
"_Dexp9pM5.js",
|
||||
"_CRDN6Mh7.js",
|
||||
"_jOLfEXYH.js"
|
||||
]
|
||||
},
|
||||
"_BC20z61P.js": {
|
||||
"file": "_app/immutable/chunks/BC20z61P.js",
|
||||
"name": "svelte-element",
|
||||
"imports": [
|
||||
"_Dexp9pM5.js",
|
||||
"_agKGoZF1.js",
|
||||
"_CRDN6Mh7.js"
|
||||
]
|
||||
},
|
||||
"_BKSreT2u.js": {
|
||||
"file": "_app/immutable/chunks/BKSreT2u.js",
|
||||
"name": "index",
|
||||
"imports": [
|
||||
"_Dexp9pM5.js",
|
||||
"_CRDN6Mh7.js",
|
||||
"_agKGoZF1.js"
|
||||
]
|
||||
},
|
||||
"_BapE3c1q.js": {
|
||||
"file": "_app/immutable/chunks/BapE3c1q.js",
|
||||
"name": "entry",
|
||||
"imports": [
|
||||
"_DZmckTjd.js",
|
||||
"_Dexp9pM5.js"
|
||||
]
|
||||
},
|
||||
"_BxPgF2w2.js": {
|
||||
"file": "_app/immutable/chunks/BxPgF2w2.js",
|
||||
"name": "4",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"_CRDN6Mh7.js",
|
||||
"_Bzak7iHL.js",
|
||||
"_Dexp9pM5.js",
|
||||
"_DcVg5zjO.js",
|
||||
"_25AjRaeI.js",
|
||||
"_BKSreT2u.js",
|
||||
"_BC20z61P.js",
|
||||
"_jOLfEXYH.js"
|
||||
],
|
||||
"dynamicImports": [
|
||||
"src/routes/items/ItemsCrud.svelte"
|
||||
]
|
||||
},
|
||||
"_Bzak7iHL.js": {
|
||||
"file": "_app/immutable/chunks/Bzak7iHL.js",
|
||||
"name": "disclose-version"
|
||||
},
|
||||
"_CRDN6Mh7.js": {
|
||||
"file": "_app/immutable/chunks/CRDN6Mh7.js",
|
||||
"name": "preload-helper",
|
||||
"imports": [
|
||||
"_Dexp9pM5.js"
|
||||
]
|
||||
},
|
||||
"_CsnJU1X_.js": {
|
||||
"file": "_app/immutable/chunks/CsnJU1X_.js",
|
||||
"name": "card-content",
|
||||
"imports": [
|
||||
"_Bzak7iHL.js",
|
||||
"_Dexp9pM5.js",
|
||||
"_BKSreT2u.js",
|
||||
"_jOLfEXYH.js"
|
||||
]
|
||||
},
|
||||
"_DZmckTjd.js": {
|
||||
"file": "_app/immutable/chunks/DZmckTjd.js",
|
||||
"name": "index-client",
|
||||
"imports": [
|
||||
"_Dexp9pM5.js",
|
||||
"_agKGoZF1.js"
|
||||
]
|
||||
},
|
||||
"_DcVg5zjO.js": {
|
||||
"file": "_app/immutable/chunks/DcVg5zjO.js",
|
||||
"name": "await",
|
||||
"imports": [
|
||||
"_Dexp9pM5.js",
|
||||
"_CRDN6Mh7.js"
|
||||
]
|
||||
},
|
||||
"_Dexp9pM5.js": {
|
||||
"file": "_app/immutable/chunks/Dexp9pM5.js",
|
||||
"name": "template"
|
||||
},
|
||||
"_agKGoZF1.js": {
|
||||
"file": "_app/immutable/chunks/agKGoZF1.js",
|
||||
"name": "events",
|
||||
"imports": [
|
||||
"_Dexp9pM5.js"
|
||||
]
|
||||
},
|
||||
"_hqfhVoHF.js": {
|
||||
"file": "_app/immutable/chunks/hqfhVoHF.js",
|
||||
"name": "legacy",
|
||||
"imports": [
|
||||
"_Dexp9pM5.js"
|
||||
]
|
||||
},
|
||||
"_iABcLwh6.js": {
|
||||
"file": "_app/immutable/chunks/iABcLwh6.js",
|
||||
"name": "ItemForm",
|
||||
"imports": [
|
||||
"_Bzak7iHL.js",
|
||||
"_Dexp9pM5.js",
|
||||
"_25AjRaeI.js",
|
||||
"_jOLfEXYH.js",
|
||||
"_BKSreT2u.js",
|
||||
"_61AlszRR.js",
|
||||
"_CRDN6Mh7.js",
|
||||
"_DZmckTjd.js",
|
||||
"_agKGoZF1.js",
|
||||
"_B12dZE2q.js",
|
||||
"_BC20z61P.js"
|
||||
],
|
||||
"dynamicImports": [
|
||||
"node_modules/barcode-detector-api-polyfill/esm/index.js"
|
||||
]
|
||||
},
|
||||
"_jOLfEXYH.js": {
|
||||
"file": "_app/immutable/chunks/jOLfEXYH.js",
|
||||
"name": "props",
|
||||
"imports": [
|
||||
"_Dexp9pM5.js"
|
||||
]
|
||||
},
|
||||
"node_modules/@sveltejs/kit/src/runtime/client/entry.js": {
|
||||
"file": "_app/immutable/entry/start.BXvCRdku.js",
|
||||
"name": "entry/start",
|
||||
"src": "node_modules/@sveltejs/kit/src/runtime/client/entry.js",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_BapE3c1q.js"
|
||||
]
|
||||
},
|
||||
"node_modules/barcode-detector-api-polyfill/esm/index.js": {
|
||||
"file": "_app/immutable/chunks/Bd99md_0.js",
|
||||
"name": "index",
|
||||
"src": "node_modules/barcode-detector-api-polyfill/esm/index.js",
|
||||
"isDynamicEntry": true
|
||||
},
|
||||
"src/routes/HomeWithDialog.svelte": {
|
||||
"file": "_app/immutable/chunks/DXZbZvqb.js",
|
||||
"name": "HomeWithDialog",
|
||||
"src": "src/routes/HomeWithDialog.svelte",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"_Bzak7iHL.js",
|
||||
"_Dexp9pM5.js",
|
||||
"_25AjRaeI.js",
|
||||
"_B12dZE2q.js",
|
||||
"_iABcLwh6.js",
|
||||
"_BapE3c1q.js"
|
||||
]
|
||||
},
|
||||
"src/routes/items/ItemsCrud.svelte": {
|
||||
"file": "_app/immutable/chunks/DRlIEfz1.js",
|
||||
"name": "ItemsCrud",
|
||||
"src": "src/routes/items/ItemsCrud.svelte",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"_Bzak7iHL.js",
|
||||
"_Dexp9pM5.js",
|
||||
"_DZmckTjd.js",
|
||||
"_CRDN6Mh7.js",
|
||||
"_iABcLwh6.js",
|
||||
"_25AjRaeI.js",
|
||||
"_BxPgF2w2.js",
|
||||
"_61AlszRR.js",
|
||||
"_BKSreT2u.js",
|
||||
"_jOLfEXYH.js",
|
||||
"_B12dZE2q.js",
|
||||
"_CsnJU1X_.js"
|
||||
]
|
||||
},
|
||||
"src/routes/login/LoginForm.svelte": {
|
||||
"file": "_app/immutable/chunks/BDMwQRor.js",
|
||||
"name": "LoginForm",
|
||||
"src": "src/routes/login/LoginForm.svelte",
|
||||
"isDynamicEntry": true,
|
||||
"imports": [
|
||||
"_Bzak7iHL.js",
|
||||
"_Dexp9pM5.js",
|
||||
"_DZmckTjd.js",
|
||||
"_CRDN6Mh7.js",
|
||||
"_25AjRaeI.js",
|
||||
"_61AlszRR.js",
|
||||
"_CsnJU1X_.js",
|
||||
"_BKSreT2u.js",
|
||||
"_jOLfEXYH.js",
|
||||
"_B12dZE2q.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{i as c,j as s,l,L as i}from"./Dexp9pM5.js";import{B as _}from"./CRDN6Mh7.js";function f(n,o,r){c&&s();var a=new _(n);l(()=>{var e=o()??null;a.ensure(e,e&&(t=>r(t,e)))},i)}const u=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{u as _,f as c};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import"./Bzak7iHL.js";import{t as j,a as b,s as f,c as g}from"./BKSreT2u.js";import{A,c as G,f as P,a as d,G as T,h,r as m,b as k,T as x}from"./Dexp9pM5.js";import{i as q}from"./CRDN6Mh7.js";import{p as r,b as p,r as C}from"./jOLfEXYH.js";const y=j({base:"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs",destructive:"bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs",outline:"bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-xs",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});var D=k("<a><!></a>"),E=k("<button><!></button>");function L(_,e){A(e,!0);let o=r(e,"variant",3,"default"),l=r(e,"size",3,"default"),s=r(e,"ref",15,null),c=r(e,"href",3,void 0),z=r(e,"type",3,"button"),v=C(e,["$$slots","$$events","$$legacy","class","variant","size","ref","href","type","disabled","children"]);var u=G(),w=P(u);{var B=i=>{var a=D();b(a,t=>({"data-slot":"button",class:t,href:e.disabled?void 0:c(),"aria-disabled":e.disabled,role:e.disabled?"link":void 0,tabindex:e.disabled?-1:void 0,...v}),[()=>g(y({variant:o(),size:l()}),e.class)]);var n=h(a);f(n,()=>e.children??x),m(a),p(a,t=>s(t),()=>s()),d(i,a)},V=i=>{var a=E();b(a,t=>({"data-slot":"button",class:t,type:z(),disabled:e.disabled,...v}),[()=>g(y({variant:o(),size:l()}),e.class)]);var n=h(a);f(n,()=>e.children??x),m(a),p(a,t=>s(t),()=>s()),d(i,a)};q(w,i=>{c()?i(B):i(V,!1)})}d(_,u),T()}export{L as B};
|
||||
@@ -0,0 +1 @@
|
||||
import{i as a,j as d,J as s,K as E,l as v,L as y,M as h,N,O as x,P as T,Q as w,o as _,s as r,R as A,S as C}from"./Dexp9pM5.js";import{i as M}from"./agKGoZF1.js";import{B as S}from"./CRDN6Mh7.js";function L(m,u,c,i,b,P){let p=a;a&&d();var e=null;a&&s.nodeType===E&&(e=s,d());var l=a?s:m,f=new S(l,!1);v(()=>{const t=u()||null;var g=c||t==="svg"?N:void 0;if(t===null){f.ensure(null,null);return}return f.ensure(t,o=>{if(t){if(e=a?e:h(t,g),x(e,e),i){a&&M(t)&&e.append(document.createComment(""));var n=a?T(e):e.appendChild(w());a&&(n===null?_(!1):r(n)),i(e,n)}A.nodes.end=e,o.before(e)}a&&r(o)}),()=>{}},y),C(()=>{}),p&&(_(!0),r(l))}export{L as e};
|
||||
@@ -0,0 +1 @@
|
||||
import"./Bzak7iHL.js";import{A as C,h as i,T,r as n,a as o,G as L,b as h,c as U,f as I,D as $,E as y,C as p,g as V,u as W,az as X}from"./Dexp9pM5.js";import{s as Y}from"./DZmckTjd.js";import{i as Z}from"./CRDN6Mh7.js";import{c as b}from"./25AjRaeI.js";import{L as J,I as K,a as ee,e as re}from"./61AlszRR.js";import{C as ae,a as te}from"./CsnJU1X_.js";import{a as j,c as k,s as z}from"./BKSreT2u.js";import{p as A,b as D,r as G}from"./jOLfEXYH.js";import{B as se}from"./B12dZE2q.js";var oe=h("<p><!></p>");function de(c,e){C(e,!0);let d=A(e,"ref",15,null),u=G(e,["$$slots","$$events","$$legacy","ref","class","children"]);var r=oe();j(r,s=>({"data-slot":"card-description",class:s,...u}),[()=>k("text-muted-foreground text-sm",e.class)]);var v=i(r);z(v,()=>e.children??T),n(r),D(r,s=>d(s),()=>d()),o(c,r),L()}var le=h("<div><!></div>");function ie(c,e){C(e,!0);let d=A(e,"ref",15,null),u=G(e,["$$slots","$$events","$$legacy","ref","class","children"]);var r=le();j(r,s=>({"data-slot":"card-header",class:s,...u}),[()=>k("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e.class)]);var v=i(r);z(v,()=>e.children??T),n(r),D(r,s=>d(s),()=>d()),o(c,r),L()}var ne=h("<div><!></div>");function ce(c,e){C(e,!0);let d=A(e,"ref",15,null),u=G(e,["$$slots","$$events","$$legacy","ref","class","children"]);var r=ne();j(r,s=>({"data-slot":"card-title",class:s,...u}),[()=>k("leading-none font-semibold",e.class)]);var v=i(r);z(v,()=>e.children??T),n(r),D(r,s=>d(s),()=>d()),o(c,r),L()}var ue=h("<!> <!>",1),ve=h('<p class="text-destructive text-sm"> </p>'),fe=h('<form method="POST" action="?/login" class="space-y-4"><div class="space-y-2"><!> <!></div> <div class="space-y-2"><div class="flex items-center justify-between"><!> <a href="/forgot-password" class="text-muted-foreground text-sm underline hover:text-foreground">Forgot your password?</a></div> <!></div> <!> <!></form>'),me=h("<!> <!>",1);function Le(c,e){C(e,!0);var d=U(),u=I(d);b(u,()=>te,(r,v)=>{v(r,{class:"w-full max-w-sm",children:(s,_e)=>{var O=me(),S=I(O);b(S,()=>ie,(E,q)=>{q(E,{children:(B,N)=>{var f=ue(),g=I(f);b(g,()=>ce,(x,m)=>{m(x,{children:(_,F)=>{$();var w=y("Login");o(_,w)},$$slots:{default:!0}})});var P=p(g,2);b(P,()=>de,(x,m)=>{m(x,{children:(_,F)=>{$();var w=y("Enter your email and password to sign in.");o(_,w)},$$slots:{default:!0}})}),o(B,f)},$$slots:{default:!0}})});var M=p(S,2);b(M,()=>ae,(E,q)=>{q(E,{children:(B,N)=>{var f=fe(),g=i(f),P=i(g);J(P,{for:"email",children:(a,t)=>{$();var l=y("Email");o(a,l)},$$slots:{default:!0}});var x=p(P,2);{let a=W(()=>{var t;return((t=e.data)==null?void 0:t.email)??""});K(x,{id:"email",name:"email",type:"email",placeholder:"you@example.com",autocomplete:"email",get value(){return V(a)},required:!0})}n(g);var m=p(g,2),_=i(m),F=i(_);J(F,{for:"password",children:(a,t)=>{$();var l=y("Password");o(a,l)},$$slots:{default:!0}}),$(2),n(_);var w=p(_,2);K(w,{id:"password",name:"password",type:"password",autocomplete:"current-password",required:!0}),n(m);var H=p(m,2);{var Q=a=>{var t=ve(),l=i(t,!0);n(t),X(()=>Y(l,e.data.error)),o(a,t)};Z(H,a=>{var t;(t=e.data)!=null&&t.error&&a(Q)})}var R=p(H,2);se(R,{type:"submit",class:"w-full",children:(a,t)=>{$();var l=y("Login");o(a,l)},$$slots:{default:!0}}),n(f),ee(f,(a,t)=>{var l;return(l=re)==null?void 0:l(a,t)},()=>()=>async({update:a})=>{await a()}),o(B,f)},$$slots:{default:!0}})}),o(s,O)},$$slots:{default:!0}})}),o(c,d),L()}export{Le as default};
|
||||
+2
-2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DRlIEfz1.js","./Bzak7iHL.js","./Dexp9pM5.js","./DZmckTjd.js","./agKGoZF1.js","./CRDN6Mh7.js","./iABcLwh6.js","./25AjRaeI.js","./jOLfEXYH.js","./BKSreT2u.js","./61AlszRR.js","./BapE3c1q.js","./B12dZE2q.js","./BC20z61P.js","./CsnJU1X_.js"])))=>i.map(i=>d[i]);
|
||||
import{i as P,_ as A}from"./CRDN6Mh7.js";import"./Bzak7iHL.js";import{Q as D,l as O,_ as V,i as p,$ as B,a0 as h,o as y,s as x,J as F,P as L,A as E,c as v,f as u,T as M,a as n,G as C,a1 as N,a2 as j,g as _,u as k,b as q}from"./Dexp9pM5.js";import{a as z}from"./DcVg5zjO.js";import{c as G}from"./25AjRaeI.js";import{t as H,a as J,c as Q,s as R}from"./BKSreT2u.js";import{e as S}from"./BC20z61P.js";import{p as w,b as K,r as U}from"./jOLfEXYH.js";function W(o,a){let r=null,d=p;var t;if(p){r=F;for(var e=L(document.head);e!==null&&(e.nodeType!==B||e.data!==o);)e=h(e);if(e===null)y(!1);else{var i=h(e);e.remove(),x(i)}}p||(t=document.head.appendChild(D()));try{O(()=>a(t),V)}finally{d&&(y(!0),x(r))}}const X=H({base:"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3",variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90 border-transparent",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent",destructive:"bg-destructive [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/70 border-transparent text-white",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function ne(o,a){E(a,!0);let r=w(a,"ref",15,null),d=w(a,"variant",3,"default"),t=U(a,["$$slots","$$events","$$legacy","ref","href","class","variant","children"]);var e=v(),i=u(e);S(i,()=>a.href?"a":"span",!1,(c,l)=>{K(c,f=>r(f),()=>r()),J(c,f=>({"data-slot":"badge",href:a.href,class:f,...t}),[()=>Q(X({variant:d()}),a.class)]);var s=v(),m=u(s);R(m,()=>a.children??M),n(l,s)}),n(o,e),C()}var Y=q('<main class="container mx-auto flex flex-col gap-6 py-8"><p class="text-muted-foreground">Loading…</p></main>');function oe(o,a){E(a,!0);var r=v();W("rk8na7",e=>{N(()=>{j.title="Items – Stackq"})});var d=u(r);{var t=e=>{var i=v(),c=u(i);z(c,()=>A(()=>import("./DRlIEfz1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url),l=>{var s=Y();n(l,s)},(l,s)=>{var m=k(()=>{var{default:g}=_(s);return{ItemsCrud:g}}),f=k(()=>_(m).ItemsCrud),b=v(),I=u(b);G(I,()=>_(f),(g,T)=>{T(g,{get data(){return a.data}})}),n(l,b)}),n(e,i)};P(d,e=>{e(t)})}n(o,r),C()}export{ne as B,oe as _,W as h};
|
||||
@@ -0,0 +1 @@
|
||||
var e;typeof window<"u"&&((e=window.__svelte??(window.__svelte={})).v??(e.v=new Set)).add("5");
|
||||
@@ -0,0 +1 @@
|
||||
var H=Object.defineProperty;var y=r=>{throw TypeError(r)};var I=(r,e,t)=>e in r?H(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var P=(r,e,t)=>I(r,typeof e!="symbol"?e+"":e,t),L=(r,e,t)=>e.has(r)||y("Cannot "+t);var s=(r,e,t)=>(L(r,e,"read from private field"),t?t.call(r):e.get(r)),v=(r,e,t)=>e.has(r)?y("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),C=(r,e,t,n)=>(L(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t);import{a3 as D,a4 as N,a5 as T,a6 as O,Q as F,a7 as j,i as R,J as $,a8 as q,a9 as U,l as Y,j as J,L as M,aa as Q,ab as W,H as z,n as G,s as K,o as x}from"./Dexp9pM5.js";var u,d,h,b,k,w,A;class V{constructor(e,t=!0){P(this,"anchor");v(this,u,new Map);v(this,d,new Map);v(this,h,new Map);v(this,b,new Set);v(this,k,!0);v(this,w,()=>{var e=D;if(s(this,u).has(e)){var t=s(this,u).get(e),n=s(this,d).get(t);if(n)N(n),s(this,b).delete(t);else{var f=s(this,h).get(t);f&&(s(this,d).set(t,f.effect),s(this,h).delete(t),f.fragment.lastChild.remove(),this.anchor.before(f.fragment),n=f.effect)}for(const[c,a]of s(this,u)){if(s(this,u).delete(c),c===e)break;const i=s(this,h).get(a);i&&(T(i.effect),s(this,h).delete(a))}for(const[c,a]of s(this,d)){if(c===t||s(this,b).has(c))continue;const i=()=>{if(Array.from(s(this,u).values()).includes(c)){var m=document.createDocumentFragment();q(a,m),m.append(F()),s(this,h).set(c,{effect:a,fragment:m})}else T(a);s(this,b).delete(c),s(this,d).delete(c)};s(this,k)||!n?(s(this,b).add(c),O(a,i,!1)):i()}}});v(this,A,e=>{s(this,u).delete(e);const t=Array.from(s(this,u).values());for(const[n,f]of s(this,h))t.includes(n)||(T(f.effect),s(this,h).delete(n))});this.anchor=e,C(this,k,t)}ensure(e,t){var n=D,f=U();if(t&&!s(this,d).has(e)&&!s(this,h).has(e))if(f){var c=document.createDocumentFragment(),a=F();c.append(a),s(this,h).set(e,{effect:j(()=>t(a)),fragment:c})}else s(this,d).set(e,j(()=>t(this.anchor)));if(s(this,u).set(n,e),f){for(const[i,o]of s(this,d))i===e?n.unskip_effect(o):n.skip_effect(o);for(const[i,o]of s(this,h))i===e?n.unskip_effect(o.effect):n.skip_effect(o.effect);n.oncommit(s(this,w)),n.ondiscard(s(this,A))}else R&&(this.anchor=$),s(this,w).call(this)}}u=new WeakMap,d=new WeakMap,h=new WeakMap,b=new WeakMap,k=new WeakMap,w=new WeakMap,A=new WeakMap;function se(r,e,t=!1){R&&J();var n=new V(r),f=t?M:0;function c(a,i){if(R){const l=Q(r);var o;if(l===W?o=0:l===z?o=!1:o=parseInt(l.substring(1)),a!==o){var m=G();K(m),n.anchor=m,x(!1),n.ensure(a,i),x(!0);return}}n.ensure(a,i)}Y(()=>{var a=!1;e((i,o=0)=>{a=!0,c(o,i)}),a||c(!1,null)},f)}const X="modulepreload",Z=function(r,e){return new URL(r,e).href},B={},re=function(e,t,n){let f=Promise.resolve();if(t&&t.length>0){let a=function(l){return Promise.all(l.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};const i=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),m=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));f=a(t.map(l=>{if(l=Z(l,n),l in B)return;B[l]=!0;const p=l.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(n)for(let E=i.length-1;E>=0;E--){const S=i[E];if(S.href===l&&(!p||S.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${g}`))return;const _=document.createElement("link");if(_.rel=p?"stylesheet":X,p||(_.as="script"),_.crossOrigin="",_.href=l,m&&_.setAttribute("nonce",m),document.head.appendChild(_),p)return new Promise((E,S)=>{_.addEventListener("load",E),_.addEventListener("error",()=>S(Error(`Unable to preload CSS for ${l}`)))})}))}function c(a){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=a,window.dispatchEvent(i),!i.defaultPrevented)throw a}return f.then(a=>{for(const i of a||[])i.status==="rejected"&&c(i.reason);return e().catch(c)})};export{V as B,re as _,se as i};
|
||||
@@ -0,0 +1 @@
|
||||
import"./Bzak7iHL.js";import{A as o,h as c,r as n,a as i,G as f,T as v,b as h}from"./Dexp9pM5.js";import{a as m,s as u,c as p}from"./BKSreT2u.js";import{p as b,b as x,r as g}from"./jOLfEXYH.js";var _=h("<div><!></div>");function G(t,a){o(a,!0);let s=b(a,"ref",15,null),d=g(a,["$$slots","$$events","$$legacy","ref","class","children"]);var r=_();m(r,e=>({"data-slot":"card",class:e,...d}),[()=>p("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",a.class)]);var l=c(r);u(l,()=>a.children??v),n(r),x(r,e=>s(e),()=>s()),i(t,r),f()}var y=h("<div><!></div>");function T(t,a){o(a,!0);let s=b(a,"ref",15,null),d=g(a,["$$slots","$$events","$$legacy","ref","class","children"]);var r=y();m(r,e=>({"data-slot":"card-content",class:e,...d}),[()=>p("px-6",a.class)]);var l=c(r);u(l,()=>a.children??v),n(r),x(r,e=>s(e),()=>s()),i(t,r),f()}export{T as C,G as a};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import"./Bzak7iHL.js";import{A as T,f as c,C as s,h as d,D as r,E as o,a,r as m,F as g,c as U,g as y,G as V,I as X,u as Y,b as x}from"./Dexp9pM5.js";import{c as l}from"./25AjRaeI.js";import{B as h}from"./B12dZE2q.js";import{D as Z,a as tt,b as et,c as at,I as st,d as rt}from"./iABcLwh6.js";import{g as ot}from"./BapE3c1q.js";var lt=x("<!> <!>",1),nt=x("<!> <!>",1),it=x('<main class="flex min-h-screen flex-col items-center justify-center gap-6 p-8"><h1 class="text-2xl font-semibold">Stackq</h1> <p class="text-muted-foreground">Svelte 5 + shadcn-svelte + PocketBase</p> <div class="flex w-full max-w-xs flex-col gap-2"><a href="/items" class="block"><!></a> <!> <a href="/logout" class="block"><!></a></div></main> <!>',1);function gt(A,P){T(P,!0);let n=X(!1);const C=Y(()=>{var t;return((t=P.data)==null?void 0:t.itemsForParent)??[]});function L(){g(n,!1),ot("/items")}var w=it(),u=c(w),b=s(d(u),4),f=d(b),N=d(f);h(N,{class:"w-full",children:(t,i)=>{r();var e=o("Items table");a(t,e)},$$slots:{default:!0}}),m(f);var D=s(f,2);h(D,{class:"w-full",variant:"outline",onclick:()=>g(n,!0),children:(t,i)=>{r();var e=o("New item");a(t,e)},$$slots:{default:!0}});var k=s(D,2),j=d(k);h(j,{class:"w-full",variant:"outline",children:(t,i)=>{r();var e=o("Log out");a(t,e)},$$slots:{default:!0}}),m(k),m(b),m(u);var E=s(u,2);l(E,()=>rt,(t,i)=>{i(t,{get open(){return y(n)},set open(e){g(n,e,!0)},children:(e,ct)=>{var F=U(),G=c(F);l(G,()=>Z,(H,O)=>{O(H,{class:"max-h-[90vh] overflow-y-auto sm:max-w-[500px]",children:(W,dt)=>{var I=nt(),S=c(I);l(S,()=>tt,(J,K)=>{K(J,{children:(M,mt)=>{var B=lt(),q=c(B);l(q,()=>et,(v,$)=>{$(v,{children:(p,R)=>{r();var _=o("New item");a(p,_)},$$slots:{default:!0}})});var Q=s(q,2);l(Q,()=>at,(v,$)=>{$(v,{children:(p,R)=>{r();var _=o("Add a new Stackq item.");a(p,_)},$$slots:{default:!0}})}),a(M,B)},$$slots:{default:!0}})});var z=s(S,2);st(z,{get itemsForParent(){return y(C)},action:"/items?/create",submitLabel:"Create",onSuccess:L}),a(W,I)},$$slots:{default:!0}})}),a(e,F)},$$slots:{default:!0}})}),a(A,w),V()}export{gt as default};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{i as n,j as x,k as B,l as g,m as N,H as A,s as D,n as H,o as c,q as S,p as v,B as q,t as L,v as R,w as U,x as k,U as j,y as E,z}from"./Dexp9pM5.js";import{B as G}from"./CRDN6Mh7.js";const T=0,_=1;function P(m,b,y,r,l){n&&x();var h=B(),t=j,i=h?k(t):E(t,!1,!1),o=h?k(t):E(t,!1,!1),s=new G(m);g(()=>{var u=b(),p=!1;let d=n&&N(u)===(m.data===A);if(d&&(D(H()),c(!1)),N(u)){var w=z(),I=!1;const a=e=>{if(!p){I=!0,w(!1),q.ensure(),n&&c(!1);try{e()}finally{L(),R||U()}}};u.then(e=>{a(()=>{v(i,e),s.ensure(_,r&&(f=>r(f,i)))})},e=>{a(()=>{if(v(o,e),s.ensure(_,l&&(f=>l(f,o))),!l)throw o.v})}),n?s.ensure(T,y):S(()=>{I||a(()=>{s.ensure(T,y)})})}else v(i,u),s.ensure(_,r&&(a=>r(a,i)));return d&&c(!0),()=>{p=!0}})}export{P as a};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{T as k,V as b,W as E,X as S,Y as m,q as L,Z as V}from"./MIlO0V30.js";function B(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const A=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function D(t){return A.includes(t)}const x={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function R(t){return t=t.toLowerCase(),x[t]??t}const I=["touchstart","touchmove"];function j(t){return I.includes(t)}const N=["textarea","script","style","title"];function C(t){return N.includes(t)}const i=Symbol("events"),P=new Set,W=new Set;function M(t,e,r,u={}){function o(a){if(u.capture||O.call(e,a),!a.cancelBubble)return V(()=>r==null?void 0:r.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?L(()=>{e.addEventListener(t,o,u)}):e.addEventListener(t,o,u),o}function X(t,e,r,u={}){var o=M(e,t,r,u);return()=>{t.removeEventListener(e,o,u)}}function z(t,e,r){(e[i]??(e[i]={}))[t]=r}function F(t){for(var e=0;e<t.length;e++)P.add(t[e]);for(var r of W)r(t)}let w=null;function O(t){var v,g;var e=this,r=e.ownerDocument,u=t.type,o=((v=t.composedPath)==null?void 0:v.call(t))||[],a=o[0]||t.target;w=t;var f=0,d=w===t&&t[i];if(d){var s=o.indexOf(d);if(s!==-1&&(e===document||e===window)){t[i]=e;return}var p=o.indexOf(e);if(p===-1)return;s<=p&&(f=s)}if(a=o[f]||t.target,a!==e){k(t,"currentTarget",{configurable:!0,get(){return a||r}});var y=S,T=m;b(null),E(null);try{for(var c,_=[];a!==null;){var l=a.assignedSlot||a.parentNode||a.host||null;try{var h=(g=a[i])==null?void 0:g[u];h!=null&&(!a.disabled||t.target===a)&&h.call(a,t)}catch(n){c?_.push(n):c=n}if(t.cancelBubble||l===e||l===null)break;a=l}if(c){for(let n of _)queueMicrotask(()=>{throw n});throw c}}finally{t[i]=e,delete t.currentTarget,b(y),E(T)}}}export{P as a,j as b,B as c,z as d,F as e,M as f,D as g,O as h,C as i,R as n,X as o,W as r};
|
||||
import{V as S,W as b,X as E,Y as T,R as m,q as L,Z as V}from"./Dexp9pM5.js";function q(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const A=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function B(t){return A.includes(t)}const x={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function D(t){return t=t.toLowerCase(),x[t]??t}const I=["touchstart","touchmove"];function j(t){return I.includes(t)}const N=["textarea","script","style","title"];function C(t){return N.includes(t)}const i=Symbol("events"),P=new Set,W=new Set;function M(t,e,r,u={}){function o(a){if(u.capture||O.call(e,a),!a.cancelBubble)return V(()=>r==null?void 0:r.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?L(()=>{e.addEventListener(t,o,u)}):e.addEventListener(t,o,u),o}function X(t,e,r,u={}){var o=M(e,t,r,u);return()=>{t.removeEventListener(e,o,u)}}function z(t,e,r){(e[i]??(e[i]={}))[t]=r}function F(t){for(var e=0;e<t.length;e++)P.add(t[e]);for(var r of W)r(t)}let w=null;function O(t){var v,g;var e=this,r=e.ownerDocument,u=t.type,o=((v=t.composedPath)==null?void 0:v.call(t))||[],a=o[0]||t.target;w=t;var f=0,d=w===t&&t[i];if(d){var s=o.indexOf(d);if(s!==-1&&(e===document||e===window)){t[i]=e;return}var p=o.indexOf(e);if(p===-1)return;s<=p&&(f=s)}if(a=o[f]||t.target,a!==e){S(t,"currentTarget",{configurable:!0,get(){return a||r}});var y=T,k=m;b(null),E(null);try{for(var c,_=[];a!==null;){var l=a.assignedSlot||a.parentNode||a.host||null;try{var h=(g=a[i])==null?void 0:g[u];h!=null&&(!a.disabled||t.target===a)&&h.call(a,t)}catch(n){c?_.push(n):c=n}if(t.cancelBubble||l===e||l===null)break;a=l}if(c){for(let n of _)queueMicrotask(()=>{throw n});throw c}}finally{t[i]=e,delete t.currentTarget,b(y),E(k)}}}export{P as a,j as b,q as c,z as d,F as e,M as f,B as g,O as h,C as i,D as n,X as o,W as r};
|
||||
@@ -0,0 +1 @@
|
||||
import{e}from"./Dexp9pM5.js";e();
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{a1 as T,ac as j,ad as y,q,ae as S,af as g,ag as B,ah as Y,g as h,ai as K,F as M,aj as N,R as U,ak as $,al as z,am as C,an as F,ao as G,ap as Z,d as H,aq as J,ar as x,as as d}from"./Dexp9pM5.js";function R(r,e){return r===e||(r==null?void 0:r[S])===e}function m(r={},e,n,i){return T(()=>{var s,t;return j(()=>{s=t,t=[],y(()=>{r!==n(...t)&&(e(r,...t),s&&R(n(...s),r)&&e(null,...s))})}),()=>{q(()=>{t&&R(n(...t),r)&&e(null,...t)})}}),r}let _=!1;function Q(r){var e=_;try{return _=!1,[r(),_]}finally{_=e}}const V={get(r,e){if(!r.exclude.includes(e))return r.props[e]},set(r,e){return!1},getOwnPropertyDescriptor(r,e){if(!r.exclude.includes(e)&&e in r.props)return{enumerable:!0,configurable:!0,value:r.props[e]}},has(r,e){return r.exclude.includes(e)?!1:e in r.props},ownKeys(r){return Reflect.ownKeys(r.props).filter(e=>!r.exclude.includes(e))}};function k(r,e,n){return new Proxy({props:r,exclude:e},V)}const W={get(r,e){let n=r.props.length;for(;n--;){let i=r.props[n];if(d(i)&&(i=i()),typeof i=="object"&&i!==null&&e in i)return i[e]}},set(r,e,n){let i=r.props.length;for(;i--;){let s=r.props[i];d(s)&&(s=s());const t=g(s,e);if(t&&t.set)return t.set(n),!0}return!1},getOwnPropertyDescriptor(r,e){let n=r.props.length;for(;n--;){let i=r.props[n];if(d(i)&&(i=i()),typeof i=="object"&&i!==null&&e in i){const s=g(i,e);return s&&!s.configurable&&(s.configurable=!0),s}}},has(r,e){if(e===S||e===x)return!1;for(let n of r.props)if(d(n)&&(n=n()),n!=null&&e in n)return!0;return!1},ownKeys(r){const e=[];for(let n of r.props)if(d(n)&&(n=n()),!!n){for(const i in n)e.includes(i)||e.push(i);for(const i of Object.getOwnPropertySymbols(n))e.includes(i)||e.push(i)}return e}};function rr(...r){return new Proxy({props:r},W)}function er(r,e,n,i){var O;var s=!C||(n&F)!==0,t=(n&z)!==0,E=(n&J)!==0,a=i,v=!0,b=()=>(v&&(v=!1,a=E?y(i):i),a),l;if(t){var A=S in r||x in r;l=((O=g(r,e))==null?void 0:O.set)??(A&&e in r?f=>r[e]=f:void 0)}var o,w=!1;t?[o,w]=Q(()=>r[e]):o=r[e],o===void 0&&i!==void 0&&(o=b(),l&&(s&&B(),l(o)));var u;if(s?u=()=>{var f=r[e];return f===void 0?b():(v=!0,f)}:u=()=>{var f=r[e];return f!==void 0&&(a=void 0),f===void 0?a:f},s&&(n&Y)===0)return u;if(l){var D=r.$$legacy;return(function(f,p){return arguments.length>0?((!s||!p||D||w)&&l(p?u():f),f):u()})}var P=!1,c=((n&G)!==0?Z:H)(()=>(P=!1,u()));t&&h(c);var L=U;return(function(f,p){if(arguments.length>0){const I=p?h(c):s&&t?K(f):f;return M(c,I),P=!0,a!==void 0&&(a=I),f}return N&&P||(L.f&$)!==0?c.v:h(c)})}export{m as b,er as p,k as r,rr as s};
|
||||
@@ -0,0 +1,2 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BXv9ZfXj.js","../chunks/Bzak7iHL.js","../chunks/hqfhVoHF.js","../chunks/Dexp9pM5.js","../assets/0.DbRKE6YE.css","../nodes/1.BT8sl3NL.js","../chunks/DZmckTjd.js","../chunks/agKGoZF1.js","../chunks/BapE3c1q.js","../nodes/2.OkkHA0lV.js","../chunks/CRDN6Mh7.js","../chunks/DcVg5zjO.js","../chunks/B12dZE2q.js","../chunks/BKSreT2u.js","../chunks/jOLfEXYH.js","../chunks/25AjRaeI.js","../nodes/4.Bn1qLW0B.js","../chunks/BxPgF2w2.js","../chunks/BC20z61P.js","../nodes/5.u4tkKrg-.js"])))=>i.map(i=>d[i]);
|
||||
var G=e=>{throw TypeError(e)};var M=(e,t,r)=>t.has(e)||G("Cannot "+r);var o=(e,t,r)=>(M(e,t,"read from private field"),r?r.call(e):t.get(e)),A=(e,t,r)=>t.has(e)?G("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),w=(e,t,r,n)=>(M(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);import{i as I,_ as y}from"../chunks/CRDN6Mh7.js";import{F as x,ar as N,g as _,w as Q,V as U,y as W,A as Z,au as $,av as tt,aX as et,f as R,C as rt,a as E,G as at,I as L,c as V,h as st,r as ot,b as z,E as nt,az as it,u as j}from"../chunks/Dexp9pM5.js";import{h as ct,m as ut,u as mt,o as _t,s as lt}from"../chunks/DZmckTjd.js";import"../chunks/Bzak7iHL.js";import{c as D}from"../chunks/25AjRaeI.js";import{p as T,b as k}from"../chunks/jOLfEXYH.js";function dt(e){return class extends ft{constructor(t){super({component:e,...t})}}}var l,c;class ft{constructor(t){A(this,l);A(this,c);var g;var r=new Map,n=(a,s)=>{var d=W(s,!1,!1);return r.set(a,d),d};const m=new Proxy({...t.props||{},$$events:{}},{get(a,s){return _(r.get(s)??n(s,Reflect.get(a,s)))},has(a,s){return s===N?!0:(_(r.get(s)??n(s,Reflect.get(a,s))),Reflect.has(a,s))},set(a,s,d){return x(r.get(s)??n(s,d),d),Reflect.set(a,s,d)}});w(this,c,(t.hydrate?ct:ut)(t.component,{target:t.target,anchor:t.anchor,props:m,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((g=t==null?void 0:t.props)!=null&&g.$$host)||t.sync===!1)&&Q(),w(this,l,m.$$events);for(const a of Object.keys(o(this,c)))a==="$set"||a==="$destroy"||a==="$on"||U(this,a,{get(){return o(this,c)[a]},set(s){o(this,c)[a]=s},enumerable:!0});o(this,c).$set=a=>{Object.assign(m,a)},o(this,c).$destroy=()=>{mt(o(this,c))}}$set(t){o(this,c).$set(t)}$on(t,r){o(this,l)[t]=o(this,l)[t]||[];const n=(...m)=>r.call(this,...m);return o(this,l)[t].push(n),()=>{o(this,l)[t]=o(this,l)[t].filter(m=>m!==n)}}$destroy(){o(this,c).$destroy()}}l=new WeakMap,c=new WeakMap;const It={};var ht=z('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),vt=z("<!> <!>",1);function gt(e,t){Z(t,!0);let r=T(t,"components",23,()=>[]),n=T(t,"data_0",3,null),m=T(t,"data_1",3,null);$(()=>t.stores.page.set(t.page)),tt(()=>{t.stores,t.page,t.constructors,r(),t.form,n(),m(),t.stores.page.notify()});let g=L(!1),a=L(!1),s=L(null);_t(()=>{const i=t.stores.page.subscribe(()=>{_(g)&&(x(a,!0),et().then(()=>{x(s,document.title||"untitled page",!0)}))});return x(g,!0),i});const d=j(()=>t.constructors[1]);var p=vt(),C=R(p);{var X=i=>{const f=j(()=>t.constructors[0]);var h=V(),P=R(h);D(P,()=>_(f),(v,b)=>{k(b(v,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(u,yt)=>{var S=V(),H=R(S);D(H,()=>_(d),(J,K)=>{k(K(J,{get data(){return m()},get form(){return t.form},get params(){return t.page.params}}),O=>r()[1]=O,()=>{var O;return(O=r())==null?void 0:O[1]})}),E(u,S)},$$slots:{default:!0}}),u=>r()[0]=u,()=>{var u;return(u=r())==null?void 0:u[0]})}),E(i,h)},Y=i=>{const f=j(()=>t.constructors[0]);var h=V(),P=R(h);D(P,()=>_(f),(v,b)=>{k(b(v,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),u=>r()[0]=u,()=>{var u;return(u=r())==null?void 0:u[0]})}),E(i,h)};I(C,i=>{t.constructors[1]?i(X):i(Y,!1)})}var q=rt(C,2);{var B=i=>{var f=ht(),h=st(f);{var P=v=>{var b=nt();it(()=>lt(b,_(s))),E(v,b)};I(h,v=>{_(a)&&v(P)})}ot(f),E(i,f)};I(q,i=>{_(g)&&i(B)})}E(e,p),at()}const Lt=dt(gt),Vt=[()=>y(()=>import("../nodes/0.BXv9ZfXj.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url),()=>y(()=>import("../nodes/1.BT8sl3NL.js"),__vite__mapDeps([5,1,2,3,6,7,8]),import.meta.url),()=>y(()=>import("../nodes/2.OkkHA0lV.js"),__vite__mapDeps([9,10,3,1,2,11,12,13,7,14]),import.meta.url),()=>y(()=>import("../chunks/25AjRaeI.js").then(e=>e._),__vite__mapDeps([15,3,10]),import.meta.url),()=>y(()=>import("../nodes/4.Bn1qLW0B.js"),__vite__mapDeps([16,17,10,3,1,11,15,13,7,18,14]),import.meta.url),()=>y(()=>import("../nodes/5.u4tkKrg-.js"),__vite__mapDeps([19,10,3,1,11,15]),import.meta.url)],jt=[],Dt={"/":[-3],"/items":[-5],"/login":[-6],"/logout":[-4]},F={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},bt=Object.fromEntries(Object.entries(F.transport).map(([e,t])=>[e,t.decode])),Tt=Object.fromEntries(Object.entries(F.transport).map(([e,t])=>[e,t.encode])),kt=!1,pt=(e,t)=>bt[e](t);export{pt as decode,bt as decoders,Dt as dictionary,Tt as encoders,kt as hash,F as hooks,It as matchers,Vt as nodes,Lt as root,jt as server_loads};
|
||||
@@ -0,0 +1 @@
|
||||
import{l as o,d as r}from"../chunks/BapE3c1q.js";export{o as load_css,r as start};
|
||||
@@ -0,0 +1 @@
|
||||
import"../chunks/Bzak7iHL.js";import"../chunks/hqfhVoHF.js";import{i as f,j as l,c as s,f as u,a as c}from"../chunks/Dexp9pM5.js";function d(o,e,t,a,_){var i;f&&l();var n=(i=e.$$slots)==null?void 0:i[t],r=!1;n===!0&&(n=e.children,r=!0),n===void 0||n(o,r?()=>a:a)}const y=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function b(o,e){var t=s(),a=u(t);d(a,e,"default",{}),c(o,t)}export{b as component,y as universal};
|
||||
@@ -0,0 +1 @@
|
||||
import"../chunks/Bzak7iHL.js";import"../chunks/hqfhVoHF.js";import{at as b,au as x,av as i,ad as k,aw as l,ax as y,g as v,ay as $,ap as w,A as z,f as A,az as C,a as E,G,b as j,h as u,r as m,C as q}from"../chunks/Dexp9pM5.js";import{s as g}from"../chunks/DZmckTjd.js";import{s as B,p as h}from"../chunks/BapE3c1q.js";function D(r=!1){const e=b,t=e.l.u;if(!t)return;let a=()=>$(e.s);if(r){let o=0,s={};const p=w(()=>{let n=!1;const c=e.s;for(const f in c)c[f]!==s[f]&&(s[f]=c[f],n=!0);return n&&o++,o});a=()=>v(p)}t.b.length&&x(()=>{_(e,a),l(t.b)}),i(()=>{const o=k(()=>t.m.map(y));return()=>{for(const s of o)typeof s=="function"&&s()}}),t.a.length&&i(()=>{_(e,a),l(t.a)})}function _(r,e){if(r.l.s)for(const t of r.l.s)v(t);e()}const F={get error(){return h.error},get status(){return h.status}};B.updated.check;const d=F;var H=j("<h1> </h1> <p> </p>",1);function N(r,e){z(e,!1),D();var t=H(),a=A(t),o=u(a,!0);m(a);var s=q(a,2),p=u(s,!0);m(s),C(()=>{var n;g(o,d.status),g(p,(n=d.error)==null?void 0:n.message)}),E(r,t),G()}export{N as component};
|
||||
@@ -0,0 +1,2 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/DXZbZvqb.js","../chunks/Bzak7iHL.js","../chunks/Dexp9pM5.js","../chunks/25AjRaeI.js","../chunks/CRDN6Mh7.js","../chunks/B12dZE2q.js","../chunks/BKSreT2u.js","../chunks/agKGoZF1.js","../chunks/jOLfEXYH.js","../chunks/iABcLwh6.js","../chunks/61AlszRR.js","../chunks/BapE3c1q.js","../chunks/DZmckTjd.js","../chunks/BC20z61P.js"])))=>i.map(i=>d[i]);
|
||||
import{i as u,_ as h}from"../chunks/CRDN6Mh7.js";import"../chunks/Bzak7iHL.js";import"../chunks/hqfhVoHF.js";import{c as n,f as s,a as o,g as t,d as _,b as x}from"../chunks/Dexp9pM5.js";import{a as D}from"../chunks/DcVg5zjO.js";import"../chunks/B12dZE2q.js";var b=x('<main class="flex min-h-screen flex-col items-center justify-center gap-6 p-8"><p class="text-muted-foreground">Loading…</p></main>');function $(l){var i=n(),p=s(i);{var f=a=>{var m=n(),d=s(m);D(d,()=>h(()=>import("../chunks/DXZbZvqb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url),r=>{var e=b();o(r,e)},(r,e)=>{var v=_(()=>{var{default:g}=t(e);return{HomeWithDialog:g}}),c=_(()=>t(v).HomeWithDialog);t(c)(r,{data})}),o(a,m)};u(p,a=>{a(f)})}o(l,i)}export{$ as component};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as m}from"../chunks/BxPgF2w2.js";export{m as component};
|
||||
@@ -0,0 +1,2 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BDMwQRor.js","../chunks/Bzak7iHL.js","../chunks/Dexp9pM5.js","../chunks/DZmckTjd.js","../chunks/agKGoZF1.js","../chunks/CRDN6Mh7.js","../chunks/25AjRaeI.js","../chunks/61AlszRR.js","../chunks/BKSreT2u.js","../chunks/jOLfEXYH.js","../chunks/BapE3c1q.js","../chunks/CsnJU1X_.js","../chunks/B12dZE2q.js"])))=>i.map(i=>d[i]);
|
||||
import{i as F,_ as k}from"../chunks/CRDN6Mh7.js";import"../chunks/Bzak7iHL.js";import{a as r,b as c,h as E,r as P,c as _,f as p,g as i,u as v}from"../chunks/Dexp9pM5.js";import{a as $}from"../chunks/DcVg5zjO.js";import{c as j}from"../chunks/25AjRaeI.js";var w=c('<p class="text-muted-foreground">Loading…</p>'),y=c('<main class="flex min-h-screen flex-col items-center justify-center p-4"><!></main>');function T(d,f){var a=y(),l=E(a);{var u=o=>{var n=_(),g=p(n);$(g,()=>k(()=>import("../chunks/BDMwQRor.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url),e=>{var t=w();r(e,t)},(e,t)=>{var h=v(()=>{var{default:m}=i(t);return{LoginForm:m}}),L=v(()=>i(h).LoginForm),s=_(),x=p(s);j(x,()=>i(L),(m,b)=>{b(m,{get data(){return f.data}})}),r(e,s)}),r(o,n)};F(l,o=>{o(u)})}P(a),r(d,a)}export{T as component};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":"1771363037851"}
|
||||
@@ -0,0 +1,179 @@
|
||||
{
|
||||
".svelte-kit/generated/server/internal.js": {
|
||||
"file": "internal.js",
|
||||
"name": "internal",
|
||||
"src": ".svelte-kit/generated/server/internal.js",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_root.js",
|
||||
"_environment.js",
|
||||
"_internal.js"
|
||||
]
|
||||
},
|
||||
"_environment.js": {
|
||||
"file": "chunks/environment.js",
|
||||
"name": "environment"
|
||||
},
|
||||
"_exports.js": {
|
||||
"file": "chunks/exports.js",
|
||||
"name": "exports",
|
||||
"imports": [
|
||||
"_index.js",
|
||||
"_root.js"
|
||||
]
|
||||
},
|
||||
"_false.js": {
|
||||
"file": "chunks/false.js",
|
||||
"name": "false"
|
||||
},
|
||||
"_index.js": {
|
||||
"file": "chunks/index.js",
|
||||
"name": "index"
|
||||
},
|
||||
"_internal.js": {
|
||||
"file": "chunks/internal.js",
|
||||
"name": "internal",
|
||||
"imports": [
|
||||
"_root.js",
|
||||
"_environment.js"
|
||||
],
|
||||
"dynamicImports": [
|
||||
"src/hooks.server.ts"
|
||||
]
|
||||
},
|
||||
"_root.js": {
|
||||
"file": "chunks/root.js",
|
||||
"name": "root",
|
||||
"imports": [
|
||||
"_index.js",
|
||||
"_false.js"
|
||||
]
|
||||
},
|
||||
"_shared.js": {
|
||||
"file": "chunks/shared.js",
|
||||
"name": "shared",
|
||||
"imports": [
|
||||
"_utils.js"
|
||||
]
|
||||
},
|
||||
"_utils.js": {
|
||||
"file": "chunks/utils.js",
|
||||
"name": "utils"
|
||||
},
|
||||
"_utils2.js": {
|
||||
"file": "chunks/utils2.js",
|
||||
"name": "utils"
|
||||
},
|
||||
"node_modules/@sveltejs/kit/src/runtime/app/server/remote/index.js": {
|
||||
"file": "remote-entry.js",
|
||||
"name": "remote-entry",
|
||||
"src": "node_modules/@sveltejs/kit/src/runtime/app/server/remote/index.js",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_shared.js",
|
||||
"_false.js",
|
||||
"_environment.js"
|
||||
]
|
||||
},
|
||||
"node_modules/@sveltejs/kit/src/runtime/components/svelte-5/error.svelte": {
|
||||
"file": "entries/fallbacks/error.svelte.js",
|
||||
"name": "entries/fallbacks/error.svelte",
|
||||
"src": "node_modules/@sveltejs/kit/src/runtime/components/svelte-5/error.svelte",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_index.js",
|
||||
"_exports.js",
|
||||
"_root.js",
|
||||
"_utils.js"
|
||||
]
|
||||
},
|
||||
"node_modules/@sveltejs/kit/src/runtime/server/index.js": {
|
||||
"file": "index.js",
|
||||
"name": "index",
|
||||
"src": "node_modules/@sveltejs/kit/src/runtime/server/index.js",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_false.js",
|
||||
"_environment.js",
|
||||
"_shared.js",
|
||||
"_exports.js",
|
||||
"_utils.js",
|
||||
"_internal.js"
|
||||
]
|
||||
},
|
||||
"src/hooks.server.ts": {
|
||||
"file": "entries/hooks.server.js",
|
||||
"name": "entries/hooks.server",
|
||||
"src": "src/hooks.server.ts",
|
||||
"isEntry": true,
|
||||
"isDynamicEntry": true
|
||||
},
|
||||
"src/routes/+layout.svelte": {
|
||||
"file": "entries/pages/_layout.svelte.js",
|
||||
"name": "entries/pages/_layout.svelte",
|
||||
"src": "src/routes/+layout.svelte",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_index.js"
|
||||
],
|
||||
"css": [
|
||||
"_app/immutable/assets/_layout.xzg7NZgL.css"
|
||||
]
|
||||
},
|
||||
"src/routes/+layout.ts": {
|
||||
"file": "entries/pages/_layout.ts.js",
|
||||
"name": "entries/pages/_layout.ts",
|
||||
"src": "src/routes/+layout.ts",
|
||||
"isEntry": true
|
||||
},
|
||||
"src/routes/+page.server.ts": {
|
||||
"file": "entries/pages/_page.server.ts.js",
|
||||
"name": "entries/pages/_page.server.ts",
|
||||
"src": "src/routes/+page.server.ts",
|
||||
"isEntry": true
|
||||
},
|
||||
"src/routes/+page.svelte": {
|
||||
"file": "entries/pages/_page.svelte.js",
|
||||
"name": "entries/pages/_page.svelte",
|
||||
"src": "src/routes/+page.svelte",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_index.js",
|
||||
"_utils2.js"
|
||||
]
|
||||
},
|
||||
"src/routes/items/+page.server.ts": {
|
||||
"file": "entries/pages/items/_page.server.ts.js",
|
||||
"name": "entries/pages/items/_page.server.ts",
|
||||
"src": "src/routes/items/+page.server.ts",
|
||||
"isEntry": true
|
||||
},
|
||||
"src/routes/items/+page.svelte": {
|
||||
"file": "entries/pages/items/_page.svelte.js",
|
||||
"name": "entries/pages/items/_page.svelte",
|
||||
"src": "src/routes/items/+page.svelte",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_index.js",
|
||||
"_utils2.js"
|
||||
]
|
||||
},
|
||||
"src/routes/login/+page.server.ts": {
|
||||
"file": "entries/pages/login/_page.server.ts.js",
|
||||
"name": "entries/pages/login/_page.server.ts",
|
||||
"src": "src/routes/login/+page.server.ts",
|
||||
"isEntry": true
|
||||
},
|
||||
"src/routes/login/+page.svelte": {
|
||||
"file": "entries/pages/login/_page.svelte.js",
|
||||
"name": "entries/pages/login/_page.svelte",
|
||||
"src": "src/routes/login/+page.svelte",
|
||||
"isEntry": true
|
||||
},
|
||||
"src/routes/logout/+page.server.ts": {
|
||||
"file": "entries/pages/logout/_page.server.ts.js",
|
||||
"name": "entries/pages/logout/_page.server.ts",
|
||||
"src": "src/routes/logout/+page.server.ts",
|
||||
"isEntry": true
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,34 @@
|
||||
let base = "";
|
||||
let assets = base;
|
||||
const app_dir = "_app";
|
||||
const relative = true;
|
||||
const initial = { base, assets };
|
||||
function override(paths) {
|
||||
base = paths.base;
|
||||
assets = paths.assets;
|
||||
}
|
||||
function reset() {
|
||||
base = initial.base;
|
||||
assets = initial.assets;
|
||||
}
|
||||
function set_assets(path) {
|
||||
assets = initial.assets = path;
|
||||
}
|
||||
let prerendering = false;
|
||||
function set_building() {
|
||||
}
|
||||
function set_prerendering() {
|
||||
prerendering = true;
|
||||
}
|
||||
export {
|
||||
set_building as a,
|
||||
set_prerendering as b,
|
||||
base as c,
|
||||
app_dir as d,
|
||||
assets as e,
|
||||
reset as f,
|
||||
override as o,
|
||||
prerendering as p,
|
||||
relative as r,
|
||||
set_assets as s
|
||||
};
|
||||
@@ -0,0 +1,232 @@
|
||||
import { n as noop } from "./index.js";
|
||||
import { s as safe_not_equal } from "./root.js";
|
||||
import "clsx";
|
||||
const SCHEME = /^[a-z][a-z\d+\-.]+:/i;
|
||||
const internal = new URL("sveltekit-internal://");
|
||||
function resolve(base, path) {
|
||||
if (path[0] === "/" && path[1] === "/") return path;
|
||||
let url = new URL(base, internal);
|
||||
url = new URL(path, url);
|
||||
return url.protocol === internal.protocol ? url.pathname + url.search + url.hash : url.href;
|
||||
}
|
||||
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 key in params) {
|
||||
params[key] = decodeURIComponent(params[key]);
|
||||
}
|
||||
return params;
|
||||
}
|
||||
function make_trackable(url, callback, search_params_callback, allow_hash = false) {
|
||||
const tracked = new URL(url);
|
||||
Object.defineProperty(tracked, "searchParams", {
|
||||
value: new Proxy(tracked.searchParams, {
|
||||
get(obj, key) {
|
||||
if (key === "get" || key === "getAll" || key === "has") {
|
||||
return (param, ...rest) => {
|
||||
search_params_callback(param);
|
||||
return obj[key](param, ...rest);
|
||||
};
|
||||
}
|
||||
callback();
|
||||
const value = Reflect.get(obj, key);
|
||||
return typeof value === "function" ? value.bind(obj) : value;
|
||||
}
|
||||
}),
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
const tracked_url_properties = ["href", "pathname", "search", "toString", "toJSON"];
|
||||
if (allow_hash) tracked_url_properties.push("hash");
|
||||
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);
|
||||
};
|
||||
tracked.searchParams[Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => {
|
||||
return inspect(url.searchParams, opts);
|
||||
};
|
||||
}
|
||||
if (!allow_hash) {
|
||||
disable_hash(tracked);
|
||||
}
|
||||
return tracked;
|
||||
}
|
||||
function disable_hash(url) {
|
||||
allow_nodejs_console_log(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) {
|
||||
allow_nodejs_console_log(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`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function allow_nodejs_console_log(url) {
|
||||
{
|
||||
url[Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => {
|
||||
return inspect(new URL(url), opts);
|
||||
};
|
||||
}
|
||||
}
|
||||
const subscriber_queue = [];
|
||||
function readable(value, start) {
|
||||
return {
|
||||
subscribe: writable(value, start).subscribe
|
||||
};
|
||||
}
|
||||
function writable(value, start = noop) {
|
||||
let stop = null;
|
||||
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(
|
||||
/** @type {T} */
|
||||
value
|
||||
));
|
||||
}
|
||||
function subscribe(run, invalidate = noop) {
|
||||
const subscriber = [run, invalidate];
|
||||
subscribers.add(subscriber);
|
||||
if (subscribers.size === 1) {
|
||||
stop = start(set, update) || noop;
|
||||
}
|
||||
run(
|
||||
/** @type {T} */
|
||||
value
|
||||
);
|
||||
return () => {
|
||||
subscribers.delete(subscriber);
|
||||
if (subscribers.size === 0 && stop) {
|
||||
stop();
|
||||
stop = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
return { set, update, subscribe };
|
||||
}
|
||||
function validator(expected) {
|
||||
function validate(module, file) {
|
||||
if (!module) return;
|
||||
for (const key in module) {
|
||||
if (key[0] === "_" || expected.has(key)) continue;
|
||||
const values = [...expected.values()];
|
||||
const hint = hint_for_supported_files(key, file?.slice(file.lastIndexOf("."))) ?? `valid exports are ${values.join(", ")}, or anything with a '_' prefix`;
|
||||
throw new Error(`Invalid export '${key}'${file ? ` in ${file}` : ""} (${hint})`);
|
||||
}
|
||||
}
|
||||
return validate;
|
||||
}
|
||||
function hint_for_supported_files(key, ext = ".js") {
|
||||
const supported_files = [];
|
||||
if (valid_layout_exports.has(key)) {
|
||||
supported_files.push(`+layout${ext}`);
|
||||
}
|
||||
if (valid_page_exports.has(key)) {
|
||||
supported_files.push(`+page${ext}`);
|
||||
}
|
||||
if (valid_layout_server_exports.has(key)) {
|
||||
supported_files.push(`+layout.server${ext}`);
|
||||
}
|
||||
if (valid_page_server_exports.has(key)) {
|
||||
supported_files.push(`+page.server${ext}`);
|
||||
}
|
||||
if (valid_server_exports.has(key)) {
|
||||
supported_files.push(`+server${ext}`);
|
||||
}
|
||||
if (supported_files.length > 0) {
|
||||
return `'${key}' is a valid export in ${supported_files.slice(0, -1).join(", ")}${supported_files.length > 1 ? " or " : ""}${supported_files.at(-1)}`;
|
||||
}
|
||||
}
|
||||
const valid_layout_exports = /* @__PURE__ */ new Set([
|
||||
"load",
|
||||
"prerender",
|
||||
"csr",
|
||||
"ssr",
|
||||
"trailingSlash",
|
||||
"config"
|
||||
]);
|
||||
const valid_page_exports = /* @__PURE__ */ new Set([...valid_layout_exports, "entries"]);
|
||||
const valid_layout_server_exports = /* @__PURE__ */ new Set([...valid_layout_exports]);
|
||||
const valid_page_server_exports = /* @__PURE__ */ new Set([...valid_layout_server_exports, "actions", "entries"]);
|
||||
const valid_server_exports = /* @__PURE__ */ new Set([
|
||||
"GET",
|
||||
"POST",
|
||||
"PATCH",
|
||||
"PUT",
|
||||
"DELETE",
|
||||
"OPTIONS",
|
||||
"HEAD",
|
||||
"fallback",
|
||||
"prerender",
|
||||
"trailingSlash",
|
||||
"config",
|
||||
"entries"
|
||||
]);
|
||||
const validate_layout_exports = validator(valid_layout_exports);
|
||||
const validate_page_exports = validator(valid_page_exports);
|
||||
const validate_layout_server_exports = validator(valid_layout_server_exports);
|
||||
const validate_page_server_exports = validator(valid_page_server_exports);
|
||||
const validate_server_exports = validator(valid_server_exports);
|
||||
export {
|
||||
SCHEME as S,
|
||||
decode_params as a,
|
||||
validate_layout_exports as b,
|
||||
validate_page_server_exports as c,
|
||||
disable_search as d,
|
||||
validate_page_exports as e,
|
||||
resolve as f,
|
||||
decode_pathname as g,
|
||||
validate_server_exports as h,
|
||||
make_trackable as m,
|
||||
normalize_path as n,
|
||||
readable as r,
|
||||
validate_layout_server_exports as v,
|
||||
writable as w
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
const DEV = false;
|
||||
export {
|
||||
DEV as D
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,134 @@
|
||||
import { r as root } from "./root.js";
|
||||
import "./environment.js";
|
||||
let public_env = {};
|
||||
function set_private_env(environment) {
|
||||
}
|
||||
function set_public_env(environment) {
|
||||
public_env = environment;
|
||||
}
|
||||
let read_implementation = null;
|
||||
function set_read_implementation(fn) {
|
||||
read_implementation = fn;
|
||||
}
|
||||
function set_manifest(_) {
|
||||
}
|
||||
const options = {
|
||||
app_template_contains_nonce: false,
|
||||
async: 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,
|
||||
csrf_trusted_origins: [],
|
||||
embedded: false,
|
||||
env_public_prefix: "PUBLIC_",
|
||||
env_private_prefix: "",
|
||||
hash_routing: false,
|
||||
hooks: null,
|
||||
// added lazily, via `get_hooks`
|
||||
preload_strategy: "modulepreload",
|
||||
root,
|
||||
service_worker: false,
|
||||
service_worker_options: void 0,
|
||||
templates: {
|
||||
app: ({ head, body, assets, nonce, env }) => '<!doctype html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <link rel="icon" href="' + assets + '/favicon.png" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n ' + head + '\n </head>\n <body data-sveltekit-preload-data="hover">\n <div style="display: contents">' + body + "</div>\n </body>\n</html>\n",
|
||||
error: ({ status, message }) => '<!doctype html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <title>' + message + `</title>
|
||||
|
||||
<style>
|
||||
body {
|
||||
--bg: white;
|
||||
--fg: #222;
|
||||
--divider: #ccc;
|
||||
background: var(--bg);
|
||||
color: var(--fg);
|
||||
font-family:
|
||||
system-ui,
|
||||
-apple-system,
|
||||
BlinkMacSystemFont,
|
||||
'Segoe UI',
|
||||
Roboto,
|
||||
Oxygen,
|
||||
Ubuntu,
|
||||
Cantarell,
|
||||
'Open Sans',
|
||||
'Helvetica Neue',
|
||||
sans-serif;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.error {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
max-width: 32rem;
|
||||
margin: 0 1rem;
|
||||
}
|
||||
|
||||
.status {
|
||||
font-weight: 200;
|
||||
font-size: 3rem;
|
||||
line-height: 1;
|
||||
position: relative;
|
||||
top: -0.05rem;
|
||||
}
|
||||
|
||||
.message {
|
||||
border-left: 1px solid var(--divider);
|
||||
padding: 0 0 0 1rem;
|
||||
margin: 0 0 0 1rem;
|
||||
min-height: 2.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.message h1 {
|
||||
font-weight: 400;
|
||||
font-size: 1em;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
--bg: #222;
|
||||
--fg: #ddd;
|
||||
--divider: #666;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="error">
|
||||
<span class="status">` + status + '</span>\n <div class="message">\n <h1>' + message + "</h1>\n </div>\n </div>\n </body>\n</html>\n"
|
||||
},
|
||||
version_hash: "1cw4viz"
|
||||
};
|
||||
async function get_hooks() {
|
||||
let handle;
|
||||
let handleFetch;
|
||||
let handleError;
|
||||
let handleValidationError;
|
||||
let init;
|
||||
({ handle, handleFetch, handleError, handleValidationError, init } = await import("../entries/hooks.server.js"));
|
||||
let reroute;
|
||||
let transport;
|
||||
return {
|
||||
handle,
|
||||
handleFetch,
|
||||
handleError,
|
||||
handleValidationError,
|
||||
init,
|
||||
reroute,
|
||||
transport
|
||||
};
|
||||
}
|
||||
export {
|
||||
set_public_env as a,
|
||||
set_read_implementation as b,
|
||||
set_manifest as c,
|
||||
get_hooks as g,
|
||||
options as o,
|
||||
public_env as p,
|
||||
read_implementation as r,
|
||||
set_private_env as s
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,770 @@
|
||||
import { json, text } from "@sveltejs/kit";
|
||||
import { SvelteKitError, HttpError } from "@sveltejs/kit/internal";
|
||||
import { with_request_store } from "@sveltejs/kit/internal/server";
|
||||
import * as devalue from "devalue";
|
||||
import { t as text_decoder, b as base64_encode, a as base64_decode } from "./utils.js";
|
||||
const SVELTE_KIT_ASSETS = "/_svelte_kit_assets";
|
||||
const ENDPOINT_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"];
|
||||
const PAGE_METHODS = ["GET", "POST", "HEAD"];
|
||||
function set_nested_value(object, path_string, value) {
|
||||
if (path_string.startsWith("n:")) {
|
||||
path_string = path_string.slice(2);
|
||||
value = value === "" ? void 0 : parseFloat(value);
|
||||
} else if (path_string.startsWith("b:")) {
|
||||
path_string = path_string.slice(2);
|
||||
value = value === "on";
|
||||
}
|
||||
deep_set(object, split_path(path_string), value);
|
||||
}
|
||||
function convert_formdata(data) {
|
||||
const result = {};
|
||||
for (let key of data.keys()) {
|
||||
const is_array = key.endsWith("[]");
|
||||
let values = data.getAll(key);
|
||||
if (is_array) key = key.slice(0, -2);
|
||||
if (values.length > 1 && !is_array) {
|
||||
throw new Error(`Form cannot contain duplicated keys — "${key}" has ${values.length} values`);
|
||||
}
|
||||
values = values.filter(
|
||||
(entry) => typeof entry === "string" || entry.name !== "" || entry.size > 0
|
||||
);
|
||||
if (key.startsWith("n:")) {
|
||||
key = key.slice(2);
|
||||
values = values.map((v) => v === "" ? void 0 : parseFloat(
|
||||
/** @type {string} */
|
||||
v
|
||||
));
|
||||
} else if (key.startsWith("b:")) {
|
||||
key = key.slice(2);
|
||||
values = values.map((v) => v === "on");
|
||||
}
|
||||
set_nested_value(result, key, is_array ? values : values[0]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
const BINARY_FORM_CONTENT_TYPE = "application/x-sveltekit-formdata";
|
||||
const BINARY_FORM_VERSION = 0;
|
||||
const HEADER_BYTES = 1 + 4 + 2;
|
||||
async function deserialize_binary_form(request) {
|
||||
if (request.headers.get("content-type") !== BINARY_FORM_CONTENT_TYPE) {
|
||||
const form_data = await request.formData();
|
||||
return { data: convert_formdata(form_data), meta: {}, form_data };
|
||||
}
|
||||
if (!request.body) {
|
||||
throw deserialize_error("no body");
|
||||
}
|
||||
const content_length = parseInt(request.headers.get("content-length") ?? "");
|
||||
if (Number.isNaN(content_length)) {
|
||||
throw deserialize_error("invalid Content-Length header");
|
||||
}
|
||||
const reader = request.body.getReader();
|
||||
const chunks = [];
|
||||
function get_chunk(index) {
|
||||
if (index in chunks) return chunks[index];
|
||||
let i = chunks.length;
|
||||
while (i <= index) {
|
||||
chunks[i] = reader.read().then((chunk) => chunk.value);
|
||||
i++;
|
||||
}
|
||||
return chunks[index];
|
||||
}
|
||||
async function get_buffer(offset, length) {
|
||||
let start_chunk;
|
||||
let chunk_start = 0;
|
||||
let chunk_index;
|
||||
for (chunk_index = 0; ; chunk_index++) {
|
||||
const chunk = await get_chunk(chunk_index);
|
||||
if (!chunk) return null;
|
||||
const chunk_end = chunk_start + chunk.byteLength;
|
||||
if (offset >= chunk_start && offset < chunk_end) {
|
||||
start_chunk = chunk;
|
||||
break;
|
||||
}
|
||||
chunk_start = chunk_end;
|
||||
}
|
||||
if (offset + length <= chunk_start + start_chunk.byteLength) {
|
||||
return start_chunk.subarray(offset - chunk_start, offset + length - chunk_start);
|
||||
}
|
||||
const chunks2 = [start_chunk.subarray(offset - chunk_start)];
|
||||
let cursor = start_chunk.byteLength - offset + chunk_start;
|
||||
while (cursor < length) {
|
||||
chunk_index++;
|
||||
let chunk = await get_chunk(chunk_index);
|
||||
if (!chunk) return null;
|
||||
if (chunk.byteLength > length - cursor) {
|
||||
chunk = chunk.subarray(0, length - cursor);
|
||||
}
|
||||
chunks2.push(chunk);
|
||||
cursor += chunk.byteLength;
|
||||
}
|
||||
const buffer = new Uint8Array(length);
|
||||
cursor = 0;
|
||||
for (const chunk of chunks2) {
|
||||
buffer.set(chunk, cursor);
|
||||
cursor += chunk.byteLength;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
const header = await get_buffer(0, HEADER_BYTES);
|
||||
if (!header) throw deserialize_error("too short");
|
||||
if (header[0] !== BINARY_FORM_VERSION) {
|
||||
throw deserialize_error(`got version ${header[0]}, expected version ${BINARY_FORM_VERSION}`);
|
||||
}
|
||||
const header_view = new DataView(header.buffer, header.byteOffset, header.byteLength);
|
||||
const data_length = header_view.getUint32(1, true);
|
||||
if (HEADER_BYTES + data_length > content_length) {
|
||||
throw deserialize_error("data overflow");
|
||||
}
|
||||
const file_offsets_length = header_view.getUint16(5, true);
|
||||
if (HEADER_BYTES + data_length + file_offsets_length > content_length) {
|
||||
throw deserialize_error("file offset table overflow");
|
||||
}
|
||||
const data_buffer = await get_buffer(HEADER_BYTES, data_length);
|
||||
if (!data_buffer) throw deserialize_error("data too short");
|
||||
let file_offsets;
|
||||
let files_start_offset;
|
||||
if (file_offsets_length > 0) {
|
||||
const file_offsets_buffer = await get_buffer(HEADER_BYTES + data_length, file_offsets_length);
|
||||
if (!file_offsets_buffer) throw deserialize_error("file offset table too short");
|
||||
file_offsets = /** @type {Array<number>} */
|
||||
JSON.parse(text_decoder.decode(file_offsets_buffer));
|
||||
files_start_offset = HEADER_BYTES + data_length + file_offsets_length;
|
||||
}
|
||||
const [data, meta] = devalue.parse(text_decoder.decode(data_buffer), {
|
||||
File: ([name, type, size, last_modified, index]) => {
|
||||
if (files_start_offset + file_offsets[index] + size > content_length) {
|
||||
throw deserialize_error("file data overflow");
|
||||
}
|
||||
return new Proxy(
|
||||
new LazyFile(
|
||||
name,
|
||||
type,
|
||||
size,
|
||||
last_modified,
|
||||
get_chunk,
|
||||
files_start_offset + file_offsets[index]
|
||||
),
|
||||
{
|
||||
getPrototypeOf() {
|
||||
return File.prototype;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
void (async () => {
|
||||
let has_more = true;
|
||||
while (has_more) {
|
||||
const chunk = await get_chunk(chunks.length);
|
||||
has_more = !!chunk;
|
||||
}
|
||||
})();
|
||||
return { data, meta, form_data: null };
|
||||
}
|
||||
function deserialize_error(message) {
|
||||
return new SvelteKitError(400, "Bad Request", `Could not deserialize binary form: ${message}`);
|
||||
}
|
||||
class LazyFile {
|
||||
/** @type {(index: number) => Promise<Uint8Array<ArrayBuffer> | undefined>} */
|
||||
#get_chunk;
|
||||
/** @type {number} */
|
||||
#offset;
|
||||
/**
|
||||
* @param {string} name
|
||||
* @param {string} type
|
||||
* @param {number} size
|
||||
* @param {number} last_modified
|
||||
* @param {(index: number) => Promise<Uint8Array<ArrayBuffer> | undefined>} get_chunk
|
||||
* @param {number} offset
|
||||
*/
|
||||
constructor(name, type, size, last_modified, get_chunk, offset) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.size = size;
|
||||
this.lastModified = last_modified;
|
||||
this.webkitRelativePath = "";
|
||||
this.#get_chunk = get_chunk;
|
||||
this.#offset = offset;
|
||||
this.arrayBuffer = this.arrayBuffer.bind(this);
|
||||
this.bytes = this.bytes.bind(this);
|
||||
this.slice = this.slice.bind(this);
|
||||
this.stream = this.stream.bind(this);
|
||||
this.text = this.text.bind(this);
|
||||
}
|
||||
/** @type {ArrayBuffer | undefined} */
|
||||
#buffer;
|
||||
async arrayBuffer() {
|
||||
this.#buffer ??= await new Response(this.stream()).arrayBuffer();
|
||||
return this.#buffer;
|
||||
}
|
||||
async bytes() {
|
||||
return new Uint8Array(await this.arrayBuffer());
|
||||
}
|
||||
/**
|
||||
* @param {number=} start
|
||||
* @param {number=} end
|
||||
* @param {string=} contentType
|
||||
*/
|
||||
slice(start = 0, end = this.size, contentType = this.type) {
|
||||
if (start < 0) {
|
||||
start = Math.max(this.size + start, 0);
|
||||
} else {
|
||||
start = Math.min(start, this.size);
|
||||
}
|
||||
if (end < 0) {
|
||||
end = Math.max(this.size + end, 0);
|
||||
} else {
|
||||
end = Math.min(end, this.size);
|
||||
}
|
||||
const size = Math.max(end - start, 0);
|
||||
const file = new LazyFile(
|
||||
this.name,
|
||||
contentType,
|
||||
size,
|
||||
this.lastModified,
|
||||
this.#get_chunk,
|
||||
this.#offset + start
|
||||
);
|
||||
return file;
|
||||
}
|
||||
stream() {
|
||||
let cursor = 0;
|
||||
let chunk_index = 0;
|
||||
return new ReadableStream({
|
||||
start: async (controller) => {
|
||||
let chunk_start = 0;
|
||||
let start_chunk = null;
|
||||
for (chunk_index = 0; ; chunk_index++) {
|
||||
const chunk = await this.#get_chunk(chunk_index);
|
||||
if (!chunk) return null;
|
||||
const chunk_end = chunk_start + chunk.byteLength;
|
||||
if (this.#offset >= chunk_start && this.#offset < chunk_end) {
|
||||
start_chunk = chunk;
|
||||
break;
|
||||
}
|
||||
chunk_start = chunk_end;
|
||||
}
|
||||
if (this.#offset + this.size <= chunk_start + start_chunk.byteLength) {
|
||||
controller.enqueue(
|
||||
start_chunk.subarray(this.#offset - chunk_start, this.#offset + this.size - chunk_start)
|
||||
);
|
||||
controller.close();
|
||||
} else {
|
||||
controller.enqueue(start_chunk.subarray(this.#offset - chunk_start));
|
||||
cursor = start_chunk.byteLength - this.#offset + chunk_start;
|
||||
}
|
||||
},
|
||||
pull: async (controller) => {
|
||||
chunk_index++;
|
||||
let chunk = await this.#get_chunk(chunk_index);
|
||||
if (!chunk) {
|
||||
controller.error("incomplete file data");
|
||||
controller.close();
|
||||
return;
|
||||
}
|
||||
if (chunk.byteLength > this.size - cursor) {
|
||||
chunk = chunk.subarray(0, this.size - cursor);
|
||||
}
|
||||
controller.enqueue(chunk);
|
||||
cursor += chunk.byteLength;
|
||||
if (cursor >= this.size) {
|
||||
controller.close();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
async text() {
|
||||
return text_decoder.decode(await this.arrayBuffer());
|
||||
}
|
||||
}
|
||||
const path_regex = /^[a-zA-Z_$]\w*(\.[a-zA-Z_$]\w*|\[\d+\])*$/;
|
||||
function split_path(path) {
|
||||
if (!path_regex.test(path)) {
|
||||
throw new Error(`Invalid path ${path}`);
|
||||
}
|
||||
return path.split(/\.|\[|\]/).filter(Boolean);
|
||||
}
|
||||
function check_prototype_pollution(key) {
|
||||
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
||||
throw new Error(
|
||||
`Invalid key "${key}"`
|
||||
);
|
||||
}
|
||||
}
|
||||
function deep_set(object, keys, value) {
|
||||
let current = object;
|
||||
for (let i = 0; i < keys.length - 1; i += 1) {
|
||||
const key = keys[i];
|
||||
check_prototype_pollution(key);
|
||||
const is_array = /^\d+$/.test(keys[i + 1]);
|
||||
const exists = Object.hasOwn(current, key);
|
||||
const inner = current[key];
|
||||
if (exists && is_array !== Array.isArray(inner)) {
|
||||
throw new Error(`Invalid array key ${keys[i + 1]}`);
|
||||
}
|
||||
if (!exists) {
|
||||
current[key] = is_array ? [] : {};
|
||||
}
|
||||
current = current[key];
|
||||
}
|
||||
const final_key = keys[keys.length - 1];
|
||||
check_prototype_pollution(final_key);
|
||||
current[final_key] = value;
|
||||
}
|
||||
function normalize_issue(issue, server = false) {
|
||||
const normalized = { name: "", path: [], message: issue.message, server };
|
||||
if (issue.path !== void 0) {
|
||||
let name = "";
|
||||
for (const segment of issue.path) {
|
||||
const key = (
|
||||
/** @type {string | number} */
|
||||
typeof segment === "object" ? segment.key : segment
|
||||
);
|
||||
normalized.path.push(key);
|
||||
if (typeof key === "number") {
|
||||
name += `[${key}]`;
|
||||
} else if (typeof key === "string") {
|
||||
name += name === "" ? key : "." + key;
|
||||
}
|
||||
}
|
||||
normalized.name = name;
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
function flatten_issues(issues) {
|
||||
const result = {};
|
||||
for (const issue of issues) {
|
||||
(result.$ ??= []).push(issue);
|
||||
let name = "";
|
||||
if (issue.path !== void 0) {
|
||||
for (const key of issue.path) {
|
||||
if (typeof key === "number") {
|
||||
name += `[${key}]`;
|
||||
} else if (typeof key === "string") {
|
||||
name += name === "" ? key : "." + key;
|
||||
}
|
||||
(result[name] ??= []).push(issue);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function deep_get(object, path) {
|
||||
let current = object;
|
||||
for (const key of path) {
|
||||
if (current == null || typeof current !== "object") {
|
||||
return current;
|
||||
}
|
||||
current = current[key];
|
||||
}
|
||||
return current;
|
||||
}
|
||||
function create_field_proxy(target, get_input, set_input, get_issues, path = []) {
|
||||
const get_value = () => {
|
||||
return deep_get(get_input(), path);
|
||||
};
|
||||
return new Proxy(target, {
|
||||
get(target2, prop) {
|
||||
if (typeof prop === "symbol") return target2[prop];
|
||||
if (/^\d+$/.test(prop)) {
|
||||
return create_field_proxy({}, get_input, set_input, get_issues, [
|
||||
...path,
|
||||
parseInt(prop, 10)
|
||||
]);
|
||||
}
|
||||
const key = build_path_string(path);
|
||||
if (prop === "set") {
|
||||
const set_func = function(newValue) {
|
||||
set_input(path, newValue);
|
||||
return newValue;
|
||||
};
|
||||
return create_field_proxy(set_func, get_input, set_input, get_issues, [...path, prop]);
|
||||
}
|
||||
if (prop === "value") {
|
||||
return create_field_proxy(get_value, get_input, set_input, get_issues, [...path, prop]);
|
||||
}
|
||||
if (prop === "issues" || prop === "allIssues") {
|
||||
const issues_func = () => {
|
||||
const all_issues = get_issues()[key === "" ? "$" : key];
|
||||
if (prop === "allIssues") {
|
||||
return all_issues?.map((issue) => ({
|
||||
path: issue.path,
|
||||
message: issue.message
|
||||
}));
|
||||
}
|
||||
return all_issues?.filter((issue) => issue.name === key)?.map((issue) => ({
|
||||
path: issue.path,
|
||||
message: issue.message
|
||||
}));
|
||||
};
|
||||
return create_field_proxy(issues_func, get_input, set_input, get_issues, [...path, prop]);
|
||||
}
|
||||
if (prop === "as") {
|
||||
const as_func = (type, input_value) => {
|
||||
const is_array = type === "file multiple" || type === "select multiple" || type === "checkbox" && typeof input_value === "string";
|
||||
const prefix = type === "number" || type === "range" ? "n:" : type === "checkbox" && !is_array ? "b:" : "";
|
||||
const base_props = {
|
||||
name: prefix + key + (is_array ? "[]" : ""),
|
||||
get "aria-invalid"() {
|
||||
const issues = get_issues();
|
||||
return key in issues ? "true" : void 0;
|
||||
}
|
||||
};
|
||||
if (type !== "text" && type !== "select" && type !== "select multiple") {
|
||||
base_props.type = type === "file multiple" ? "file" : type;
|
||||
}
|
||||
if (type === "submit" || type === "hidden") {
|
||||
return Object.defineProperties(base_props, {
|
||||
value: { value: input_value, enumerable: true }
|
||||
});
|
||||
}
|
||||
if (type === "select" || type === "select multiple") {
|
||||
return Object.defineProperties(base_props, {
|
||||
multiple: { value: is_array, enumerable: true },
|
||||
value: {
|
||||
enumerable: true,
|
||||
get() {
|
||||
return get_value();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (type === "checkbox" || type === "radio") {
|
||||
return Object.defineProperties(base_props, {
|
||||
value: { value: input_value ?? "on", enumerable: true },
|
||||
checked: {
|
||||
enumerable: true,
|
||||
get() {
|
||||
const value = get_value();
|
||||
if (type === "radio") {
|
||||
return value === input_value;
|
||||
}
|
||||
if (is_array) {
|
||||
return (value ?? []).includes(input_value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (type === "file" || type === "file multiple") {
|
||||
return Object.defineProperties(base_props, {
|
||||
multiple: { value: is_array, enumerable: true },
|
||||
files: {
|
||||
enumerable: true,
|
||||
get() {
|
||||
const value = get_value();
|
||||
if (value instanceof File) {
|
||||
if (typeof DataTransfer !== "undefined") {
|
||||
const fileList = new DataTransfer();
|
||||
fileList.items.add(value);
|
||||
return fileList.files;
|
||||
}
|
||||
return { 0: value, length: 1 };
|
||||
}
|
||||
if (Array.isArray(value) && value.every((f) => f instanceof File)) {
|
||||
if (typeof DataTransfer !== "undefined") {
|
||||
const fileList = new DataTransfer();
|
||||
value.forEach((file) => fileList.items.add(file));
|
||||
return fileList.files;
|
||||
}
|
||||
const fileListLike = { length: value.length };
|
||||
value.forEach((file, index) => {
|
||||
fileListLike[index] = file;
|
||||
});
|
||||
return fileListLike;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return Object.defineProperties(base_props, {
|
||||
value: {
|
||||
enumerable: true,
|
||||
get() {
|
||||
const value = get_value();
|
||||
return value != null ? String(value) : "";
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
return create_field_proxy(as_func, get_input, set_input, get_issues, [...path, "as"]);
|
||||
}
|
||||
return create_field_proxy({}, get_input, set_input, get_issues, [...path, prop]);
|
||||
}
|
||||
});
|
||||
}
|
||||
function build_path_string(path) {
|
||||
let result = "";
|
||||
for (const segment of path) {
|
||||
if (typeof segment === "number") {
|
||||
result += `[${segment}]`;
|
||||
} else {
|
||||
result += result === "" ? segment : "." + segment;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function negotiate(accept, types) {
|
||||
const parts = [];
|
||||
accept.split(",").forEach((str, i) => {
|
||||
const match = /([^/ \t]+)\/([^; \t]+)[ \t]*(?:;[ \t]*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",
|
||||
BINARY_FORM_CONTENT_TYPE
|
||||
);
|
||||
}
|
||||
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(error) {
|
||||
return (
|
||||
/** @type {import('../exports/internal/index.js').Redirect | HttpError | SvelteKitError | Error} */
|
||||
error
|
||||
);
|
||||
}
|
||||
function get_status(error) {
|
||||
return error instanceof HttpError || error instanceof SvelteKitError ? error.status : 500;
|
||||
}
|
||||
function get_message(error) {
|
||||
return error instanceof SvelteKitError ? error.text : "Internal Error";
|
||||
}
|
||||
const escape_html_attr_dict = {
|
||||
"&": "&",
|
||||
'"': """
|
||||
// Svelte also escapes < because the escape function could be called inside a `noscript` there
|
||||
// https://github.com/sveltejs/svelte/security/advisories/GHSA-8266-84wp-wv5c
|
||||
// However, that doesn't apply in SvelteKit
|
||||
};
|
||||
const escape_html_dict = {
|
||||
"&": "&",
|
||||
"<": "<"
|
||||
};
|
||||
const surrogates = (
|
||||
// high surrogate without paired low surrogate
|
||||
"[\\ud800-\\udbff](?![\\udc00-\\udfff])|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\udc00-\\udfff]"
|
||||
);
|
||||
const escape_html_attr_regex = new RegExp(
|
||||
`[${Object.keys(escape_html_attr_dict).join("")}]|` + surrogates,
|
||||
"g"
|
||||
);
|
||||
const escape_html_regex = new RegExp(
|
||||
`[${Object.keys(escape_html_dict).join("")}]|` + surrogates,
|
||||
"g"
|
||||
);
|
||||
function escape_html(str, is_attr) {
|
||||
const dict = is_attr ? escape_html_attr_dict : escape_html_dict;
|
||||
const escaped_str = str.replace(is_attr ? escape_html_attr_regex : escape_html_regex, (match) => {
|
||||
if (match.length === 2) {
|
||||
return match;
|
||||
}
|
||||
return dict[match] ?? `&#${match.charCodeAt(0)};`;
|
||||
});
|
||||
return escaped_str;
|
||||
}
|
||||
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 = ENDPOINT_METHODS.filter((method) => method in mod);
|
||||
if ("GET" in mod && !("HEAD" in mod)) {
|
||||
allowed.push("HEAD");
|
||||
}
|
||||
return allowed;
|
||||
}
|
||||
function get_global_name(options) {
|
||||
return `__sveltekit_${options.version_hash}`;
|
||||
}
|
||||
function static_error_page(options, status, message) {
|
||||
let page = options.templates.error({ status, message: escape_html(message) });
|
||||
return text(page, {
|
||||
headers: { "content-type": "text/html; charset=utf-8" },
|
||||
status
|
||||
});
|
||||
}
|
||||
async function handle_fatal_error(event, state, options, error) {
|
||||
error = error instanceof HttpError ? error : coalesce_to_error(error);
|
||||
const status = get_status(error);
|
||||
const body = await handle_error_and_jsonify(event, state, options, error);
|
||||
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(options, status, body.message);
|
||||
}
|
||||
async function handle_error_and_jsonify(event, state, options, error) {
|
||||
if (error instanceof HttpError) {
|
||||
return { message: "Unknown Error", ...error.body };
|
||||
}
|
||||
const status = get_status(error);
|
||||
const message = get_message(error);
|
||||
return await with_request_store(
|
||||
{ event, state },
|
||||
() => options.hooks.handleError({ error, event, status, message })
|
||||
) ?? { message };
|
||||
}
|
||||
function redirect_response(status, location) {
|
||||
const response = new Response(void 0, {
|
||||
status,
|
||||
headers: { location }
|
||||
});
|
||||
return response;
|
||||
}
|
||||
function clarify_devalue_error(event, error) {
|
||||
if (error.path) {
|
||||
return `Data returned from \`load\` while rendering ${event.route.id} is not serializable: ${error.message} (${error.path}). If you need to serialize/deserialize custom types, use transport hooks: https://svelte.dev/docs/kit/hooks#Universal-hooks-transport.`;
|
||||
}
|
||||
if (error.path === "") {
|
||||
return `Data returned from \`load\` while rendering ${event.route.id} is not a plain object`;
|
||||
}
|
||||
return error.message;
|
||||
}
|
||||
function serialize_uses(node) {
|
||||
const uses = {};
|
||||
if (node.uses && node.uses.dependencies.size > 0) {
|
||||
uses.dependencies = Array.from(node.uses.dependencies);
|
||||
}
|
||||
if (node.uses && node.uses.search_params.size > 0) {
|
||||
uses.search_params = Array.from(node.uses.search_params);
|
||||
}
|
||||
if (node.uses && node.uses.params.size > 0) {
|
||||
uses.params = Array.from(node.uses.params);
|
||||
}
|
||||
if (node.uses?.parent) uses.parent = 1;
|
||||
if (node.uses?.route) uses.route = 1;
|
||||
if (node.uses?.url) uses.url = 1;
|
||||
return uses;
|
||||
}
|
||||
function has_prerendered_path(manifest, pathname) {
|
||||
return manifest._.prerendered_routes.has(pathname) || pathname.at(-1) === "/" && manifest._.prerendered_routes.has(pathname.slice(0, -1));
|
||||
}
|
||||
function format_server_error(status, error, event) {
|
||||
const formatted_text = `
|
||||
\x1B[1;31m[${status}] ${event.request.method} ${event.url.pathname}\x1B[0m`;
|
||||
if (status === 404) {
|
||||
return formatted_text;
|
||||
}
|
||||
return `${formatted_text}
|
||||
${error.stack}`;
|
||||
}
|
||||
function get_node_type(node_id) {
|
||||
const parts = node_id?.split("/");
|
||||
const filename = parts?.at(-1);
|
||||
if (!filename) return "unknown";
|
||||
const dot_parts = filename.split(".");
|
||||
return dot_parts.slice(0, -1).join(".");
|
||||
}
|
||||
const INVALIDATED_PARAM = "x-sveltekit-invalidated";
|
||||
const TRAILING_SLASH_PARAM = "x-sveltekit-trailing-slash";
|
||||
function stringify(data, transport) {
|
||||
const encoders = Object.fromEntries(Object.entries(transport).map(([k, v]) => [k, v.encode]));
|
||||
return devalue.stringify(data, encoders);
|
||||
}
|
||||
function stringify_remote_arg(value, transport) {
|
||||
if (value === void 0) return "";
|
||||
const json_string = stringify(value, transport);
|
||||
const bytes = new TextEncoder().encode(json_string);
|
||||
return base64_encode(bytes).replaceAll("=", "").replaceAll("+", "-").replaceAll("/", "_");
|
||||
}
|
||||
function parse_remote_arg(string, transport) {
|
||||
if (!string) return void 0;
|
||||
const json_string = text_decoder.decode(
|
||||
// no need to add back `=` characters, atob can handle it
|
||||
base64_decode(string.replaceAll("-", "+").replaceAll("_", "/"))
|
||||
);
|
||||
const decoders = Object.fromEntries(Object.entries(transport).map(([k, v]) => [k, v.decode]));
|
||||
return devalue.parse(json_string, decoders);
|
||||
}
|
||||
function create_remote_key(id, payload) {
|
||||
return id + "/" + payload;
|
||||
}
|
||||
export {
|
||||
ENDPOINT_METHODS as E,
|
||||
INVALIDATED_PARAM as I,
|
||||
PAGE_METHODS as P,
|
||||
SVELTE_KIT_ASSETS as S,
|
||||
TRAILING_SLASH_PARAM as T,
|
||||
set_nested_value as a,
|
||||
stringify as b,
|
||||
create_field_proxy as c,
|
||||
deep_set as d,
|
||||
create_remote_key as e,
|
||||
flatten_issues as f,
|
||||
negotiate as g,
|
||||
handle_error_and_jsonify as h,
|
||||
get_status as i,
|
||||
is_form_content_type as j,
|
||||
normalize_error as k,
|
||||
get_global_name as l,
|
||||
method_not_allowed as m,
|
||||
normalize_issue as n,
|
||||
serialize_uses as o,
|
||||
clarify_devalue_error as p,
|
||||
get_node_type as q,
|
||||
escape_html as r,
|
||||
stringify_remote_arg as s,
|
||||
static_error_page as t,
|
||||
redirect_response as u,
|
||||
parse_remote_arg as v,
|
||||
deserialize_binary_form as w,
|
||||
has_prerendered_path as x,
|
||||
handle_fatal_error as y,
|
||||
format_server_error as z
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
const text_encoder = new TextEncoder();
|
||||
const text_decoder = new TextDecoder();
|
||||
function get_relative_path(from, to) {
|
||||
const from_parts = from.split(/[/\\]/);
|
||||
const to_parts = to.split(/[/\\]/);
|
||||
from_parts.pop();
|
||||
while (from_parts[0] === to_parts[0]) {
|
||||
from_parts.shift();
|
||||
to_parts.shift();
|
||||
}
|
||||
let i = from_parts.length;
|
||||
while (i--) from_parts[i] = "..";
|
||||
return from_parts.concat(to_parts).join("/");
|
||||
}
|
||||
function base64_encode(bytes) {
|
||||
if (globalThis.Buffer) {
|
||||
return globalThis.Buffer.from(bytes).toString("base64");
|
||||
}
|
||||
let binary = "";
|
||||
for (let i = 0; i < bytes.length; i++) {
|
||||
binary += String.fromCharCode(bytes[i]);
|
||||
}
|
||||
return btoa(binary);
|
||||
}
|
||||
function base64_decode(encoded) {
|
||||
if (globalThis.Buffer) {
|
||||
const buffer = globalThis.Buffer.from(encoded, "base64");
|
||||
return new Uint8Array(buffer);
|
||||
}
|
||||
const binary = atob(encoded);
|
||||
const bytes = new Uint8Array(binary.length);
|
||||
for (let i = 0; i < binary.length; i++) {
|
||||
bytes[i] = binary.charCodeAt(i);
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
export {
|
||||
base64_decode as a,
|
||||
base64_encode as b,
|
||||
text_encoder as c,
|
||||
get_relative_path as g,
|
||||
text_decoder as t
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import { clsx } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
function cn(...inputs) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
export {
|
||||
cn as c
|
||||
};
|
||||
@@ -0,0 +1,56 @@
|
||||
import { n as noop, g as getContext, e as escape_html } from "../../chunks/index.js";
|
||||
import "clsx";
|
||||
import { w as writable } from "../../chunks/exports.js";
|
||||
import "@sveltejs/kit/internal/server";
|
||||
import "../../chunks/root.js";
|
||||
import "@sveltejs/kit/internal";
|
||||
import "../../chunks/utils.js";
|
||||
function create_updated_store() {
|
||||
const { set, subscribe } = writable(false);
|
||||
{
|
||||
return {
|
||||
subscribe,
|
||||
// eslint-disable-next-line @typescript-eslint/require-await
|
||||
check: async () => false
|
||||
};
|
||||
}
|
||||
}
|
||||
const is_legacy = noop.toString().includes("$$") || /function \w+\(\) \{\}/.test(noop.toString());
|
||||
if (is_legacy) {
|
||||
({
|
||||
data: {},
|
||||
form: null,
|
||||
error: null,
|
||||
params: {},
|
||||
route: { id: null },
|
||||
state: {},
|
||||
status: -1,
|
||||
url: new URL("https://example.com")
|
||||
});
|
||||
}
|
||||
const stores = {
|
||||
updated: /* @__PURE__ */ create_updated_store()
|
||||
};
|
||||
({
|
||||
check: stores.updated.check
|
||||
});
|
||||
function context() {
|
||||
return getContext("__request__");
|
||||
}
|
||||
const page$1 = {
|
||||
get error() {
|
||||
return context().page.error;
|
||||
},
|
||||
get status() {
|
||||
return context().page.status;
|
||||
}
|
||||
};
|
||||
const page = page$1;
|
||||
function Error$1($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
$$renderer2.push(`<h1>${escape_html(page.status)}</h1> <p>${escape_html(page.error?.message)}</p>`);
|
||||
});
|
||||
}
|
||||
export {
|
||||
Error$1 as default
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
import { redirect } from "@sveltejs/kit";
|
||||
import PocketBase from "pocketbase";
|
||||
const POCKETBASE_URL = "https://pocketbase.ccllc.pro";
|
||||
const LOGIN_PATH = "/login";
|
||||
const LOGOUT_PATH = "/logout";
|
||||
function isPublicRoute(pathname) {
|
||||
return pathname === LOGIN_PATH || pathname.startsWith(LOGIN_PATH + "/") || pathname === LOGOUT_PATH;
|
||||
}
|
||||
const handle = async ({ event, resolve }) => {
|
||||
event.locals.pb = new PocketBase(POCKETBASE_URL);
|
||||
event.locals.pb.authStore.loadFromCookie(event.request.headers.get("cookie") || "");
|
||||
try {
|
||||
if (event.locals.pb.authStore.isValid) {
|
||||
await event.locals.pb.collection("users").authRefresh();
|
||||
}
|
||||
} catch {
|
||||
event.locals.pb.authStore.clear();
|
||||
}
|
||||
event.locals.user = event.locals.pb.authStore.record ?? null;
|
||||
if (!event.locals.user && !isPublicRoute(event.url.pathname)) {
|
||||
const redirectTo = event.url.pathname + event.url.search;
|
||||
const loginUrl = redirectTo && redirectTo !== "/" ? `${LOGIN_PATH}?redirectTo=${encodeURIComponent(redirectTo)}` : LOGIN_PATH;
|
||||
throw redirect(303, loginUrl);
|
||||
}
|
||||
const response = await resolve(event);
|
||||
response.headers.append(
|
||||
"set-cookie",
|
||||
event.locals.pb.authStore.exportToCookie({ httpOnly: false, sameSite: "Lax" })
|
||||
);
|
||||
return response;
|
||||
};
|
||||
export {
|
||||
handle
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import { s as slot } from "../../chunks/index.js";
|
||||
function _layout($$renderer, $$props) {
|
||||
$$renderer.push(`<!--[-->`);
|
||||
slot($$renderer, $$props, "default", {});
|
||||
$$renderer.push(`<!--]-->`);
|
||||
}
|
||||
export {
|
||||
_layout as default
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
const COLLECTION = "Stackq_Items";
|
||||
const load = async ({ locals }) => {
|
||||
const list = await locals.pb.collection(COLLECTION).getFullList({ sort: "-created", expand: "Parent" }).catch(() => []);
|
||||
const itemsForParent = list.map((i) => ({ id: i.id, Item: i.Item, SKU: i.SKU }));
|
||||
return { itemsForParent };
|
||||
};
|
||||
export {
|
||||
load
|
||||
};
|
||||
@@ -0,0 +1,106 @@
|
||||
import "clsx";
|
||||
import { a as attributes, c as clsx, b as bind_props } from "../../chunks/index.js";
|
||||
import { c as cn } from "../../chunks/utils2.js";
|
||||
import { tv } from "tailwind-variants";
|
||||
const buttonVariants = tv({
|
||||
base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
||||
variants: {
|
||||
variant: {
|
||||
default: "bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs",
|
||||
destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs",
|
||||
outline: "bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",
|
||||
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-xs",
|
||||
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
||||
link: "text-primary underline-offset-4 hover:underline"
|
||||
},
|
||||
size: {
|
||||
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
||||
sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
|
||||
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
||||
icon: "size-9",
|
||||
"icon-sm": "size-8",
|
||||
"icon-lg": "size-10"
|
||||
}
|
||||
},
|
||||
defaultVariants: { variant: "default", size: "default" }
|
||||
});
|
||||
function Button($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
class: className,
|
||||
variant = "default",
|
||||
size = "default",
|
||||
ref = null,
|
||||
href = void 0,
|
||||
type = "button",
|
||||
disabled,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
if (href) {
|
||||
$$renderer2.push("<!--[-->");
|
||||
$$renderer2.push(`<a${attributes({
|
||||
"data-slot": "button",
|
||||
class: clsx(cn(buttonVariants({ variant, size }), className)),
|
||||
href: disabled ? void 0 : href,
|
||||
"aria-disabled": disabled,
|
||||
role: disabled ? "link" : void 0,
|
||||
tabindex: disabled ? -1 : void 0,
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></a>`);
|
||||
} else {
|
||||
$$renderer2.push("<!--[!-->");
|
||||
$$renderer2.push(`<button${attributes({
|
||||
"data-slot": "button",
|
||||
class: clsx(cn(buttonVariants({ variant, size }), className)),
|
||||
type,
|
||||
disabled,
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></button>`);
|
||||
}
|
||||
$$renderer2.push(`<!--]-->`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function _page($$renderer) {
|
||||
{
|
||||
$$renderer.push("<!--[!-->");
|
||||
$$renderer.push(`<main class="flex min-h-screen flex-col items-center justify-center gap-6 p-8"><h1 class="text-2xl font-semibold">Stackq</h1> <p class="text-muted-foreground">Svelte 5 + shadcn-svelte + PocketBase</p> <div class="flex w-full max-w-xs flex-col gap-2"><a href="/items" class="block">`);
|
||||
Button($$renderer, {
|
||||
class: "w-full",
|
||||
children: ($$renderer2) => {
|
||||
$$renderer2.push(`<!---->Items table`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer.push(`<!----></a> <a href="/items" class="block">`);
|
||||
Button($$renderer, {
|
||||
class: "w-full",
|
||||
variant: "outline",
|
||||
children: ($$renderer2) => {
|
||||
$$renderer2.push(`<!---->New item`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer.push(`<!----></a> <a href="/logout" class="block">`);
|
||||
Button($$renderer, {
|
||||
class: "w-full",
|
||||
variant: "outline",
|
||||
children: ($$renderer2) => {
|
||||
$$renderer2.push(`<!---->Log out`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer.push(`<!----></a></div></main>`);
|
||||
}
|
||||
$$renderer.push(`<!--]-->`);
|
||||
}
|
||||
export {
|
||||
_page as default
|
||||
};
|
||||
@@ -0,0 +1,117 @@
|
||||
import { fail } from "@sveltejs/kit";
|
||||
const COLLECTION = "Stackq_Items";
|
||||
function parseNum(val) {
|
||||
if (val === "" || val === null || val === void 0) return void 0;
|
||||
const n = Number(val);
|
||||
return Number.isFinite(n) ? n : void 0;
|
||||
}
|
||||
function parseBool(val) {
|
||||
return val === "on" || val === "true" || val === true;
|
||||
}
|
||||
const load = async ({ locals }) => {
|
||||
const list = await locals.pb.collection(COLLECTION).getFullList({
|
||||
sort: "-created",
|
||||
expand: "Parent"
|
||||
}).catch((err) => {
|
||||
console.error(COLLECTION, err);
|
||||
return [];
|
||||
});
|
||||
const itemsForParent = list.map((i) => ({ id: i.id, Item: i.Item, SKU: i.SKU }));
|
||||
return { items: list, itemsForParent };
|
||||
};
|
||||
const actions = {
|
||||
create: async ({ request, locals }) => {
|
||||
const form = await request.formData();
|
||||
const Item = form.get("Item")?.trim() ?? "";
|
||||
const SKU = form.get("SKU")?.trim() ?? "";
|
||||
const Description = form.get("Description")?.trim() ?? "";
|
||||
const UOM = form.get("UOM")?.trim() ?? "";
|
||||
const Cost = parseNum(form.get("Cost"));
|
||||
const Vendor = form.get("Vendor")?.trim() ?? "";
|
||||
const Catagory = form.get("Catagory")?.trim() ?? "";
|
||||
const Sub_Catagory = form.get("Sub_Catagory")?.trim() ?? "";
|
||||
const Has_Parent = parseBool(form.get("Has_Parent"));
|
||||
const Parent = form.get("Parent")?.trim() ?? "";
|
||||
const Stock = parseBool(form.get("Stock"));
|
||||
const imageFileCreate = form.get("Image");
|
||||
const hasImage = imageFileCreate && imageFileCreate.size > 0;
|
||||
if (!Item) return fail(400, { error: "Item name is required", form: "create" });
|
||||
try {
|
||||
const body = {
|
||||
Item,
|
||||
SKU,
|
||||
Description,
|
||||
UOM: UOM || void 0,
|
||||
Cost: Cost ?? 0,
|
||||
Vendor,
|
||||
Catagory: Catagory || void 0,
|
||||
Sub_Catagory: Sub_Catagory || void 0,
|
||||
Has_Parent: !!Has_Parent,
|
||||
Parent: Parent || null,
|
||||
Stock: !!Stock
|
||||
};
|
||||
if (hasImage) body.Image = imageFileCreate;
|
||||
await locals.pb.collection(COLLECTION).create(body);
|
||||
} catch (e) {
|
||||
const message = e && typeof e === "object" && "message" in e ? String(e.message) : "Create failed";
|
||||
return fail(500, { error: message, form: "create" });
|
||||
}
|
||||
return { success: true };
|
||||
},
|
||||
update: async ({ request, locals }) => {
|
||||
const form = await request.formData();
|
||||
const id = form.get("id")?.trim();
|
||||
if (!id) return fail(400, { error: "Missing id", form: "update" });
|
||||
const Item = form.get("Item")?.trim() ?? "";
|
||||
const SKU = form.get("SKU")?.trim() ?? "";
|
||||
const Description = form.get("Description")?.trim() ?? "";
|
||||
const UOM = form.get("UOM")?.trim() ?? "";
|
||||
const Cost = parseNum(form.get("Cost"));
|
||||
const Vendor = form.get("Vendor")?.trim() ?? "";
|
||||
const Catagory = form.get("Catagory")?.trim() ?? "";
|
||||
const Sub_Catagory = form.get("Sub_Catagory")?.trim() ?? "";
|
||||
const Has_Parent = parseBool(form.get("Has_Parent"));
|
||||
const Parent = form.get("Parent")?.trim() ?? "";
|
||||
const Stock = parseBool(form.get("Stock"));
|
||||
const Image = form.get("Image");
|
||||
const imageFile = Image && Image.size > 0 ? Image : void 0;
|
||||
if (!Item) return fail(400, { error: "Item name is required", form: "update" });
|
||||
try {
|
||||
const body = {
|
||||
Item,
|
||||
SKU,
|
||||
Description,
|
||||
UOM: UOM || void 0,
|
||||
Cost: Cost ?? 0,
|
||||
Vendor,
|
||||
Catagory: Catagory || void 0,
|
||||
Sub_Catagory: Sub_Catagory || void 0,
|
||||
Has_Parent: !!Has_Parent,
|
||||
Parent: Parent || null,
|
||||
Stock: !!Stock
|
||||
};
|
||||
if (imageFile) body.Image = imageFile;
|
||||
await locals.pb.collection(COLLECTION).update(id, body);
|
||||
} catch (e) {
|
||||
const message = e && typeof e === "object" && "message" in e ? String(e.message) : "Update failed";
|
||||
return fail(500, { error: message, form: "update" });
|
||||
}
|
||||
return { success: true };
|
||||
},
|
||||
delete: async ({ request, locals }) => {
|
||||
const form = await request.formData();
|
||||
const id = form.get("id")?.trim();
|
||||
if (!id) return fail(400, { error: "Missing id", form: "delete" });
|
||||
try {
|
||||
await locals.pb.collection(COLLECTION).delete(id);
|
||||
} catch (e) {
|
||||
const message = e && typeof e === "object" && "message" in e ? String(e.message) : "Delete failed";
|
||||
return fail(500, { error: message, form: "delete" });
|
||||
}
|
||||
return { success: true };
|
||||
}
|
||||
};
|
||||
export {
|
||||
actions,
|
||||
load
|
||||
};
|
||||
@@ -0,0 +1,646 @@
|
||||
import { a as attributes, c as clsx, b as bind_props, d as element, h as head, e as escape_html, f as ensure_array_like, i as attr } from "../../../chunks/index.js";
|
||||
import { c as cn } from "../../../chunks/utils2.js";
|
||||
import "clsx";
|
||||
import { tv } from "tailwind-variants";
|
||||
function Table($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<div data-slot="table-container" class="relative w-full overflow-x-auto"><table${attributes({
|
||||
"data-slot": "table",
|
||||
class: clsx(cn("w-full caption-bottom text-sm", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></table></div>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Table_body($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<tbody${attributes({
|
||||
"data-slot": "table-body",
|
||||
class: clsx(cn("[&_tr:last-child]:border-0", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></tbody>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Table_cell($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<td${attributes({
|
||||
"data-slot": "table-cell",
|
||||
class: clsx(cn("bg-clip-padding p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></td>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Table_head($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<th${attributes({
|
||||
"data-slot": "table-head",
|
||||
class: clsx(cn("text-foreground h-10 bg-clip-padding px-2 text-start align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pe-0", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></th>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Table_header($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<thead${attributes({
|
||||
"data-slot": "table-header",
|
||||
class: clsx(cn("[&_tr]:border-b", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></thead>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Table_row($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<tr${attributes({
|
||||
"data-slot": "table-row",
|
||||
class: clsx(cn("hover:[&,&>svelte-css-wrapper]:[&>th,td]:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></tr>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
const badgeVariants = tv({
|
||||
base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3",
|
||||
variants: {
|
||||
variant: {
|
||||
default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90 border-transparent",
|
||||
secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent",
|
||||
destructive: "bg-destructive [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/70 border-transparent text-white",
|
||||
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
||||
}
|
||||
},
|
||||
defaultVariants: { variant: "default" }
|
||||
});
|
||||
function Badge($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
href,
|
||||
class: className,
|
||||
variant = "default",
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
element(
|
||||
$$renderer2,
|
||||
href ? "a" : "span",
|
||||
() => {
|
||||
$$renderer2.push(`${attributes({
|
||||
"data-slot": "badge",
|
||||
href,
|
||||
class: clsx(cn(badgeVariants({ variant }), className)),
|
||||
...restProps
|
||||
})}`);
|
||||
},
|
||||
() => {
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!---->`);
|
||||
}
|
||||
);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Card($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<div${attributes({
|
||||
"data-slot": "card",
|
||||
class: clsx(cn("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></div>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function Card_content($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
ref = null,
|
||||
class: className,
|
||||
children,
|
||||
$$slots,
|
||||
$$events,
|
||||
...restProps
|
||||
} = $$props;
|
||||
$$renderer2.push(`<div${attributes({
|
||||
"data-slot": "card-content",
|
||||
class: clsx(cn("px-6", className)),
|
||||
...restProps
|
||||
})}>`);
|
||||
children?.($$renderer2);
|
||||
$$renderer2.push(`<!----></div>`);
|
||||
bind_props($$props, { ref });
|
||||
});
|
||||
}
|
||||
function _page($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let { data } = $$props;
|
||||
function asList(val) {
|
||||
if (val == null) return [];
|
||||
return Array.isArray(val) ? val : [val];
|
||||
}
|
||||
function formatDate(iso) {
|
||||
if (!iso) return "—";
|
||||
try {
|
||||
return new Date(iso).toLocaleDateString(void 0, { dateStyle: "short", timeStyle: "short" });
|
||||
} catch {
|
||||
return iso;
|
||||
}
|
||||
}
|
||||
const items = data?.items ?? [];
|
||||
const PB_BASE = "https://pocketbase.ccllc.pro";
|
||||
const COLLECTION = "Stackq_Items";
|
||||
function imageUrl(item) {
|
||||
if (!item.Image) return null;
|
||||
return `${PB_BASE}/api/files/${COLLECTION}/${item.id}/${item.Image}`;
|
||||
}
|
||||
head("rk8na7", $$renderer2, ($$renderer3) => {
|
||||
$$renderer3.title(($$renderer4) => {
|
||||
$$renderer4.push(`<title>Items – Stackq</title>`);
|
||||
});
|
||||
});
|
||||
{
|
||||
$$renderer2.push("<!--[!-->");
|
||||
$$renderer2.push(`<main class="container mx-auto flex flex-col gap-6 py-8"><div class="flex items-center justify-between"><h1 class="text-2xl font-semibold">Stackq Items</h1> <span class="text-muted-foreground text-sm">${escape_html(items.length)} items</span></div> `);
|
||||
Card($$renderer2, {
|
||||
children: ($$renderer3) => {
|
||||
Card_content($$renderer3, {
|
||||
class: "p-0",
|
||||
children: ($$renderer4) => {
|
||||
$$renderer4.push("<!---->");
|
||||
Table?.($$renderer4, {
|
||||
children: ($$renderer5) => {
|
||||
$$renderer5.push("<!---->");
|
||||
Table_header?.($$renderer5, {
|
||||
children: ($$renderer6) => {
|
||||
$$renderer6.push("<!---->");
|
||||
Table_row?.($$renderer6, {
|
||||
children: ($$renderer7) => {
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Image`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Item`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->SKU`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
class: "max-w-[200px]",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Description`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->UOM`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
class: "text-right",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Cost`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Vendor`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Catagory`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Sub_Catagory`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Has Parent`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Parent`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->Stock`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
class: "text-muted-foreground",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->created`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_head?.($$renderer7, {
|
||||
class: "text-muted-foreground",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->updated`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!---->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer6.push(`<!---->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer5.push(`<!----> `);
|
||||
$$renderer5.push("<!---->");
|
||||
Table_body?.($$renderer5, {
|
||||
children: ($$renderer6) => {
|
||||
if (items.length === 0) {
|
||||
$$renderer6.push("<!--[-->");
|
||||
$$renderer6.push("<!---->");
|
||||
Table_row?.($$renderer6, {
|
||||
children: ($$renderer7) => {
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
colspan: "14",
|
||||
class: "h-24 text-center text-muted-foreground",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->No items.`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!---->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer6.push(`<!---->`);
|
||||
} else {
|
||||
$$renderer6.push("<!--[!-->");
|
||||
$$renderer6.push(`<!--[-->`);
|
||||
const each_array = ensure_array_like(items);
|
||||
for (let $$index_2 = 0, $$length = each_array.length; $$index_2 < $$length; $$index_2++) {
|
||||
let item = each_array[$$index_2];
|
||||
$$renderer6.push("<!---->");
|
||||
Table_row?.($$renderer6, {
|
||||
children: ($$renderer7) => {
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "w-16",
|
||||
children: ($$renderer8) => {
|
||||
if (imageUrl(item)) {
|
||||
$$renderer8.push("<!--[-->");
|
||||
$$renderer8.push(`<img${attr("src", imageUrl(item))} alt="" class="size-14 rounded border object-cover" loading="lazy"/>`);
|
||||
} else {
|
||||
$$renderer8.push("<!--[!-->");
|
||||
$$renderer8.push(`<span class="text-muted-foreground text-xs">—</span>`);
|
||||
}
|
||||
$$renderer8.push(`<!--]-->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "font-medium",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->${escape_html(item.Item ?? "—")}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "font-mono text-xs",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->${escape_html(item.SKU ?? "—")}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "max-w-[200px] truncate",
|
||||
title: item.Description ?? "",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->${escape_html(item.Description ?? "—")}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
Badge($$renderer8, {
|
||||
variant: "outline",
|
||||
children: ($$renderer9) => {
|
||||
$$renderer9.push(`<!---->${escape_html(item.UOM ?? "—")}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "text-right tabular-nums",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->${escape_html(item.Cost != null ? Number(item.Cost).toLocaleString() : "—")}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "text-muted-foreground",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->${escape_html(item.Vendor ?? "—")}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!--[-->`);
|
||||
const each_array_1 = ensure_array_like(asList(item.Catagory));
|
||||
for (let $$index = 0, $$length2 = each_array_1.length; $$index < $$length2; $$index++) {
|
||||
let cat = each_array_1[$$index];
|
||||
Badge($$renderer8, {
|
||||
variant: "secondary",
|
||||
class: "mr-1 text-xs",
|
||||
children: ($$renderer9) => {
|
||||
$$renderer9.push(`<!---->${escape_html(cat)}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
}
|
||||
$$renderer8.push(`<!--]--> `);
|
||||
if (asList(item.Catagory).length === 0) {
|
||||
$$renderer8.push("<!--[-->");
|
||||
$$renderer8.push(`<span class="text-muted-foreground">—</span>`);
|
||||
} else {
|
||||
$$renderer8.push("<!--[!-->");
|
||||
}
|
||||
$$renderer8.push(`<!--]-->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!--[-->`);
|
||||
const each_array_2 = ensure_array_like(asList(item.Sub_Catagory));
|
||||
for (let $$index_1 = 0, $$length2 = each_array_2.length; $$index_1 < $$length2; $$index_1++) {
|
||||
let sub = each_array_2[$$index_1];
|
||||
Badge($$renderer8, {
|
||||
variant: "outline",
|
||||
class: "mr-1 text-xs",
|
||||
children: ($$renderer9) => {
|
||||
$$renderer9.push(`<!---->${escape_html(sub)}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
}
|
||||
$$renderer8.push(`<!--]--> `);
|
||||
if (asList(item.Sub_Catagory).length === 0) {
|
||||
$$renderer8.push("<!--[-->");
|
||||
$$renderer8.push(`<span class="text-muted-foreground">—</span>`);
|
||||
} else {
|
||||
$$renderer8.push("<!--[!-->");
|
||||
}
|
||||
$$renderer8.push(`<!--]-->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
if (item.Has_Parent) {
|
||||
$$renderer8.push("<!--[-->");
|
||||
Badge($$renderer8, {
|
||||
children: ($$renderer9) => {
|
||||
$$renderer9.push(`<!---->Yes`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
} else {
|
||||
$$renderer8.push("<!--[!-->");
|
||||
$$renderer8.push(`<span class="text-muted-foreground">No</span>`);
|
||||
}
|
||||
$$renderer8.push(`<!--]-->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "text-muted-foreground",
|
||||
children: ($$renderer8) => {
|
||||
if (item.expand?.Parent) {
|
||||
$$renderer8.push("<!--[-->");
|
||||
$$renderer8.push(`${escape_html(item.expand.Parent.Item ?? item.expand.Parent.SKU ?? item.Parent)}`);
|
||||
} else if (item.Parent) {
|
||||
$$renderer8.push("<!--[1-->");
|
||||
$$renderer8.push(`<span class="font-mono text-xs">${escape_html(item.Parent)}</span>`);
|
||||
} else {
|
||||
$$renderer8.push("<!--[!-->");
|
||||
$$renderer8.push(`—`);
|
||||
}
|
||||
$$renderer8.push(`<!--]-->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
children: ($$renderer8) => {
|
||||
if (item.Stock) {
|
||||
$$renderer8.push("<!--[-->");
|
||||
Badge($$renderer8, {
|
||||
variant: "default",
|
||||
children: ($$renderer9) => {
|
||||
$$renderer9.push(`<!---->Stock`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
} else {
|
||||
$$renderer8.push("<!--[!-->");
|
||||
$$renderer8.push(`<span class="text-muted-foreground">—</span>`);
|
||||
}
|
||||
$$renderer8.push(`<!--]-->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "text-muted-foreground text-xs",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->${escape_html(formatDate(item.created))}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!----> `);
|
||||
$$renderer7.push("<!---->");
|
||||
Table_cell?.($$renderer7, {
|
||||
class: "text-muted-foreground text-xs",
|
||||
children: ($$renderer8) => {
|
||||
$$renderer8.push(`<!---->${escape_html(formatDate(item.updated))}`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer7.push(`<!---->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer6.push(`<!---->`);
|
||||
}
|
||||
$$renderer6.push(`<!--]-->`);
|
||||
}
|
||||
$$renderer6.push(`<!--]-->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer5.push(`<!---->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer4.push(`<!---->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer2.push(`<!----></main>`);
|
||||
}
|
||||
$$renderer2.push(`<!--]-->`);
|
||||
});
|
||||
}
|
||||
export {
|
||||
_page as default
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
import { fail, redirect } from "@sveltejs/kit";
|
||||
function safeRedirectTo(searchParams) {
|
||||
const to = searchParams.get("redirectTo");
|
||||
if (!to || typeof to !== "string") return "/items";
|
||||
if (!to.startsWith("/") || to.startsWith("//")) return "/items";
|
||||
return to;
|
||||
}
|
||||
const load = ({ url, locals }) => {
|
||||
if (locals.user) {
|
||||
throw redirect(303, safeRedirectTo(url.searchParams));
|
||||
}
|
||||
};
|
||||
const actions = {
|
||||
login: async ({ request, locals, url }) => {
|
||||
const data = await request.formData();
|
||||
const email = data.get("email")?.trim() ?? "";
|
||||
const password = data.get("password") ?? "";
|
||||
if (!email || !password) {
|
||||
return fail(400, { error: "Email and password are required.", email });
|
||||
}
|
||||
try {
|
||||
await locals.pb.collection("users").authWithPassword(email, password);
|
||||
} catch (err) {
|
||||
const message = err && typeof err === "object" && "message" in err ? String(err.message) : "Invalid email or password.";
|
||||
return fail(401, { error: message, email });
|
||||
}
|
||||
const redirectTo = safeRedirectTo(url.searchParams);
|
||||
throw redirect(303, redirectTo);
|
||||
}
|
||||
};
|
||||
export {
|
||||
actions,
|
||||
load
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
import "clsx";
|
||||
function _page($$renderer, $$props) {
|
||||
let { data } = $$props;
|
||||
$$renderer.push(`<main class="flex min-h-screen flex-col items-center justify-center p-4">`);
|
||||
{
|
||||
$$renderer.push("<!--[!-->");
|
||||
$$renderer.push(`<div class="w-full max-w-sm space-y-4 rounded-xl border bg-card p-6 shadow-sm"><div class="space-y-1"><h1 class="text-lg font-semibold">Login</h1> <p class="text-muted-foreground text-sm">Enter your email and password to sign in.</p></div> <p class="text-muted-foreground text-sm">Loading form…</p></div>`);
|
||||
}
|
||||
$$renderer.push(`<!--]--></main>`);
|
||||
}
|
||||
export {
|
||||
_page as default
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import { redirect } from "@sveltejs/kit";
|
||||
const load = ({ locals }) => {
|
||||
locals.pb.authStore.clear();
|
||||
throw redirect(303, "/login");
|
||||
};
|
||||
export {
|
||||
load
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
import "./chunks/root.js";
|
||||
import { s, a, b } from "./chunks/environment.js";
|
||||
import { g, o, c, s as s2, a as a2, b as b2 } from "./chunks/internal.js";
|
||||
export {
|
||||
g as get_hooks,
|
||||
o as options,
|
||||
s as set_assets,
|
||||
a as set_building,
|
||||
c as set_manifest,
|
||||
b as set_prerendering,
|
||||
s2 as set_private_env,
|
||||
a2 as set_public_env,
|
||||
b2 as set_read_implementation
|
||||
};
|
||||
@@ -0,0 +1,63 @@
|
||||
export const manifest = (() => {
|
||||
function __memo(fn) {
|
||||
let value;
|
||||
return () => value ??= (value = fn());
|
||||
}
|
||||
|
||||
return {
|
||||
appDir: "_app",
|
||||
appPath: "_app",
|
||||
assets: new Set([]),
|
||||
mimeTypes: {},
|
||||
_: {
|
||||
client: {start:"_app/immutable/entry/start.BXvCRdku.js",app:"_app/immutable/entry/app.c69iw9ai.js",imports:["_app/immutable/entry/start.BXvCRdku.js","_app/immutable/chunks/BapE3c1q.js","_app/immutable/chunks/DZmckTjd.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/agKGoZF1.js","_app/immutable/entry/app.c69iw9ai.js","_app/immutable/chunks/CRDN6Mh7.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/DZmckTjd.js","_app/immutable/chunks/agKGoZF1.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/25AjRaeI.js","_app/immutable/chunks/jOLfEXYH.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
||||
nodes: [
|
||||
__memo(() => import('./nodes/0.js')),
|
||||
__memo(() => import('./nodes/1.js')),
|
||||
__memo(() => import('./nodes/2.js')),
|
||||
__memo(() => import('./nodes/3.js')),
|
||||
__memo(() => import('./nodes/4.js')),
|
||||
__memo(() => import('./nodes/5.js'))
|
||||
],
|
||||
remotes: {
|
||||
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
id: "/",
|
||||
pattern: /^\/$/,
|
||||
params: [],
|
||||
page: { layouts: [0,], errors: [1,], leaf: 2 },
|
||||
endpoint: null
|
||||
},
|
||||
{
|
||||
id: "/items",
|
||||
pattern: /^\/items\/?$/,
|
||||
params: [],
|
||||
page: { layouts: [0,], errors: [1,], leaf: 4 },
|
||||
endpoint: null
|
||||
},
|
||||
{
|
||||
id: "/login",
|
||||
pattern: /^\/login\/?$/,
|
||||
params: [],
|
||||
page: { layouts: [0,], errors: [1,], leaf: 5 },
|
||||
endpoint: null
|
||||
},
|
||||
{
|
||||
id: "/logout",
|
||||
pattern: /^\/logout\/?$/,
|
||||
params: [],
|
||||
page: { layouts: [0,], errors: [1,], leaf: 3 },
|
||||
endpoint: null
|
||||
}
|
||||
],
|
||||
prerendered_routes: new Set([]),
|
||||
matchers: async () => {
|
||||
|
||||
return { };
|
||||
},
|
||||
server_assets: {}
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,63 @@
|
||||
export const manifest = (() => {
|
||||
function __memo(fn) {
|
||||
let value;
|
||||
return () => value ??= (value = fn());
|
||||
}
|
||||
|
||||
return {
|
||||
appDir: "_app",
|
||||
appPath: "_app",
|
||||
assets: new Set([]),
|
||||
mimeTypes: {},
|
||||
_: {
|
||||
client: {start:"_app/immutable/entry/start.BXvCRdku.js",app:"_app/immutable/entry/app.c69iw9ai.js",imports:["_app/immutable/entry/start.BXvCRdku.js","_app/immutable/chunks/BapE3c1q.js","_app/immutable/chunks/DZmckTjd.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/agKGoZF1.js","_app/immutable/entry/app.c69iw9ai.js","_app/immutable/chunks/CRDN6Mh7.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/DZmckTjd.js","_app/immutable/chunks/agKGoZF1.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/25AjRaeI.js","_app/immutable/chunks/jOLfEXYH.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
||||
nodes: [
|
||||
__memo(() => import('./nodes/0.js')),
|
||||
__memo(() => import('./nodes/1.js')),
|
||||
__memo(() => import('./nodes/2.js')),
|
||||
__memo(() => import('./nodes/3.js')),
|
||||
__memo(() => import('./nodes/4.js')),
|
||||
__memo(() => import('./nodes/5.js'))
|
||||
],
|
||||
remotes: {
|
||||
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
id: "/",
|
||||
pattern: /^\/$/,
|
||||
params: [],
|
||||
page: { layouts: [0,], errors: [1,], leaf: 2 },
|
||||
endpoint: null
|
||||
},
|
||||
{
|
||||
id: "/items",
|
||||
pattern: /^\/items\/?$/,
|
||||
params: [],
|
||||
page: { layouts: [0,], errors: [1,], leaf: 4 },
|
||||
endpoint: null
|
||||
},
|
||||
{
|
||||
id: "/login",
|
||||
pattern: /^\/login\/?$/,
|
||||
params: [],
|
||||
page: { layouts: [0,], errors: [1,], leaf: 5 },
|
||||
endpoint: null
|
||||
},
|
||||
{
|
||||
id: "/logout",
|
||||
pattern: /^\/logout\/?$/,
|
||||
params: [],
|
||||
page: { layouts: [0,], errors: [1,], leaf: 3 },
|
||||
endpoint: null
|
||||
}
|
||||
],
|
||||
prerendered_routes: new Set([]),
|
||||
matchers: async () => {
|
||||
|
||||
return { };
|
||||
},
|
||||
server_assets: {}
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,10 @@
|
||||
import * as universal from '../entries/pages/_layout.ts.js';
|
||||
|
||||
export const index = 0;
|
||||
let component_cache;
|
||||
export const component = async () => component_cache ??= (await import('../entries/pages/_layout.svelte.js')).default;
|
||||
export { universal };
|
||||
export const universal_id = "src/routes/+layout.ts";
|
||||
export const imports = ["_app/immutable/nodes/0.BXv9ZfXj.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/hqfhVoHF.js","_app/immutable/chunks/Dexp9pM5.js"];
|
||||
export const stylesheets = ["_app/immutable/assets/0.DbRKE6YE.css"];
|
||||
export const fonts = [];
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
|
||||
export const index = 1;
|
||||
let component_cache;
|
||||
export const component = async () => component_cache ??= (await import('../entries/fallbacks/error.svelte.js')).default;
|
||||
export const imports = ["_app/immutable/nodes/1.BT8sl3NL.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/hqfhVoHF.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/DZmckTjd.js","_app/immutable/chunks/agKGoZF1.js","_app/immutable/chunks/BapE3c1q.js"];
|
||||
export const stylesheets = [];
|
||||
export const fonts = [];
|
||||
@@ -0,0 +1,10 @@
|
||||
import * as server from '../entries/pages/_page.server.ts.js';
|
||||
|
||||
export const index = 2;
|
||||
let component_cache;
|
||||
export const component = async () => component_cache ??= (await import('../entries/pages/_page.svelte.js')).default;
|
||||
export { server };
|
||||
export const server_id = "src/routes/+page.server.ts";
|
||||
export const imports = ["_app/immutable/nodes/2.OkkHA0lV.js","_app/immutable/chunks/CRDN6Mh7.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/hqfhVoHF.js","_app/immutable/chunks/DcVg5zjO.js","_app/immutable/chunks/B12dZE2q.js","_app/immutable/chunks/BKSreT2u.js","_app/immutable/chunks/agKGoZF1.js","_app/immutable/chunks/jOLfEXYH.js"];
|
||||
export const stylesheets = [];
|
||||
export const fonts = [];
|
||||
@@ -0,0 +1,8 @@
|
||||
import * as server from '../entries/pages/logout/_page.server.ts.js';
|
||||
|
||||
export const index = 3;
|
||||
export { server };
|
||||
export const server_id = "src/routes/logout/+page.server.ts";
|
||||
export const imports = [];
|
||||
export const stylesheets = [];
|
||||
export const fonts = [];
|
||||
@@ -0,0 +1,10 @@
|
||||
import * as server from '../entries/pages/items/_page.server.ts.js';
|
||||
|
||||
export const index = 4;
|
||||
let component_cache;
|
||||
export const component = async () => component_cache ??= (await import('../entries/pages/items/_page.svelte.js')).default;
|
||||
export { server };
|
||||
export const server_id = "src/routes/items/+page.server.ts";
|
||||
export const imports = ["_app/immutable/nodes/4.Bn1qLW0B.js","_app/immutable/chunks/BxPgF2w2.js","_app/immutable/chunks/CRDN6Mh7.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/DcVg5zjO.js","_app/immutable/chunks/25AjRaeI.js","_app/immutable/chunks/BKSreT2u.js","_app/immutable/chunks/agKGoZF1.js","_app/immutable/chunks/BC20z61P.js","_app/immutable/chunks/jOLfEXYH.js"];
|
||||
export const stylesheets = [];
|
||||
export const fonts = [];
|
||||
@@ -0,0 +1,10 @@
|
||||
import * as server from '../entries/pages/login/_page.server.ts.js';
|
||||
|
||||
export const index = 5;
|
||||
let component_cache;
|
||||
export const component = async () => component_cache ??= (await import('../entries/pages/login/_page.svelte.js')).default;
|
||||
export { server };
|
||||
export const server_id = "src/routes/login/+page.server.ts";
|
||||
export const imports = ["_app/immutable/nodes/5.u4tkKrg-.js","_app/immutable/chunks/CRDN6Mh7.js","_app/immutable/chunks/Dexp9pM5.js","_app/immutable/chunks/Bzak7iHL.js","_app/immutable/chunks/DcVg5zjO.js","_app/immutable/chunks/25AjRaeI.js"];
|
||||
export const stylesheets = [];
|
||||
export const fonts = [];
|
||||
@@ -0,0 +1,557 @@
|
||||
import { get_request_store, with_request_store } from "@sveltejs/kit/internal/server";
|
||||
import { parse } from "devalue";
|
||||
import { error, json } from "@sveltejs/kit";
|
||||
import { s as stringify_remote_arg, f as flatten_issues, c as create_field_proxy, n as normalize_issue, a as set_nested_value, d as deep_set, b as stringify, e as create_remote_key, h as handle_error_and_jsonify } from "./chunks/shared.js";
|
||||
import { ValidationError, HttpError, SvelteKitError } from "@sveltejs/kit/internal";
|
||||
import { D as DEV } from "./chunks/false.js";
|
||||
import { c as base, d as app_dir, p as prerendering } from "./chunks/environment.js";
|
||||
function create_validator(validate_or_fn, maybe_fn) {
|
||||
if (!maybe_fn) {
|
||||
return (arg) => {
|
||||
if (arg !== void 0) {
|
||||
error(400, "Bad Request");
|
||||
}
|
||||
};
|
||||
}
|
||||
if (validate_or_fn === "unchecked") {
|
||||
return (arg) => arg;
|
||||
}
|
||||
if ("~standard" in validate_or_fn) {
|
||||
return async (arg) => {
|
||||
const { event, state } = get_request_store();
|
||||
const result = await validate_or_fn["~standard"].validate(arg);
|
||||
if (result.issues) {
|
||||
error(
|
||||
400,
|
||||
await state.handleValidationError({
|
||||
issues: result.issues,
|
||||
event
|
||||
})
|
||||
);
|
||||
}
|
||||
return result.value;
|
||||
};
|
||||
}
|
||||
throw new Error(
|
||||
'Invalid validator passed to remote function. Expected "unchecked" or a Standard Schema (https://standardschema.dev)'
|
||||
);
|
||||
}
|
||||
async function get_response(info, arg, state, get_result) {
|
||||
await 0;
|
||||
const cache = get_cache(info, state);
|
||||
return cache[stringify_remote_arg(arg, state.transport)] ??= get_result();
|
||||
}
|
||||
function parse_remote_response(data, transport) {
|
||||
const revivers = {};
|
||||
for (const key in transport) {
|
||||
revivers[key] = transport[key].decode;
|
||||
}
|
||||
return parse(data, revivers);
|
||||
}
|
||||
async function run_remote_function(event, state, allow_cookies, get_input, fn) {
|
||||
const store = {
|
||||
event: {
|
||||
...event,
|
||||
setHeaders: () => {
|
||||
throw new Error("setHeaders is not allowed in remote functions");
|
||||
},
|
||||
cookies: {
|
||||
...event.cookies,
|
||||
set: (name, value, opts) => {
|
||||
if (!allow_cookies) {
|
||||
throw new Error("Cannot set cookies in `query` or `prerender` functions");
|
||||
}
|
||||
if (opts.path && !opts.path.startsWith("/")) {
|
||||
throw new Error("Cookies set in remote functions must have an absolute path");
|
||||
}
|
||||
return event.cookies.set(name, value, opts);
|
||||
},
|
||||
delete: (name, opts) => {
|
||||
if (!allow_cookies) {
|
||||
throw new Error("Cannot delete cookies in `query` or `prerender` functions");
|
||||
}
|
||||
if (opts.path && !opts.path.startsWith("/")) {
|
||||
throw new Error("Cookies deleted in remote functions must have an absolute path");
|
||||
}
|
||||
return event.cookies.delete(name, opts);
|
||||
}
|
||||
}
|
||||
},
|
||||
state: {
|
||||
...state,
|
||||
is_in_remote_function: true
|
||||
}
|
||||
};
|
||||
const input = await with_request_store(store, get_input);
|
||||
return with_request_store(store, () => fn(input));
|
||||
}
|
||||
function get_cache(info, state = get_request_store().state) {
|
||||
let cache = state.remote_data?.get(info);
|
||||
if (cache === void 0) {
|
||||
cache = {};
|
||||
(state.remote_data ??= /* @__PURE__ */ new Map()).set(info, cache);
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function command(validate_or_fn, maybe_fn) {
|
||||
const fn = maybe_fn ?? validate_or_fn;
|
||||
const validate = create_validator(validate_or_fn, maybe_fn);
|
||||
const __ = { type: "command", id: "", name: "" };
|
||||
const wrapper = (arg) => {
|
||||
const { event, state } = get_request_store();
|
||||
if (state.is_endpoint_request) {
|
||||
if (!["POST", "PUT", "PATCH", "DELETE"].includes(event.request.method)) {
|
||||
throw new Error(
|
||||
`Cannot call a command (\`${__.name}(${maybe_fn ? "..." : ""})\`) from a ${event.request.method} handler`
|
||||
);
|
||||
}
|
||||
} else if (!event.isRemoteRequest) {
|
||||
throw new Error(
|
||||
`Cannot call a command (\`${__.name}(${maybe_fn ? "..." : ""})\`) during server-side rendering`
|
||||
);
|
||||
}
|
||||
state.refreshes ??= {};
|
||||
const promise = Promise.resolve(
|
||||
run_remote_function(event, state, true, () => validate(arg), fn)
|
||||
);
|
||||
promise.updates = () => {
|
||||
throw new Error(`Cannot call '${__.name}(...).updates(...)' on the server`);
|
||||
};
|
||||
return (
|
||||
/** @type {ReturnType<RemoteCommand<Input, Output>>} */
|
||||
promise
|
||||
);
|
||||
};
|
||||
Object.defineProperty(wrapper, "__", { value: __ });
|
||||
Object.defineProperty(wrapper, "pending", {
|
||||
get: () => 0
|
||||
});
|
||||
return wrapper;
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function form(validate_or_fn, maybe_fn) {
|
||||
const fn = maybe_fn ?? validate_or_fn;
|
||||
const schema = !maybe_fn || validate_or_fn === "unchecked" ? null : (
|
||||
/** @type {any} */
|
||||
validate_or_fn
|
||||
);
|
||||
function create_instance(key) {
|
||||
const instance = {};
|
||||
instance.method = "POST";
|
||||
Object.defineProperty(instance, "enhance", {
|
||||
value: () => {
|
||||
return { action: instance.action, method: instance.method };
|
||||
}
|
||||
});
|
||||
const __ = {
|
||||
type: "form",
|
||||
name: "",
|
||||
id: "",
|
||||
fn: async (data, meta, form_data) => {
|
||||
const output = {};
|
||||
output.submission = true;
|
||||
const { event, state } = get_request_store();
|
||||
const validated = await schema?.["~standard"].validate(data);
|
||||
if (meta.validate_only) {
|
||||
return validated?.issues?.map((issue) => normalize_issue(issue, true)) ?? [];
|
||||
}
|
||||
if (validated?.issues !== void 0) {
|
||||
handle_issues(output, validated.issues, form_data);
|
||||
} else {
|
||||
if (validated !== void 0) {
|
||||
data = validated.value;
|
||||
}
|
||||
state.refreshes ??= {};
|
||||
const issue = create_issues();
|
||||
try {
|
||||
output.result = await run_remote_function(
|
||||
event,
|
||||
state,
|
||||
true,
|
||||
() => data,
|
||||
(data2) => !maybe_fn ? fn() : fn(data2, issue)
|
||||
);
|
||||
} catch (e) {
|
||||
if (e instanceof ValidationError) {
|
||||
handle_issues(output, e.issues, form_data);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!event.isRemoteRequest) {
|
||||
get_cache(__, state)[""] ??= output;
|
||||
}
|
||||
return output;
|
||||
}
|
||||
};
|
||||
Object.defineProperty(instance, "__", { value: __ });
|
||||
Object.defineProperty(instance, "action", {
|
||||
get: () => `?/remote=${__.id}`,
|
||||
enumerable: true
|
||||
});
|
||||
Object.defineProperty(instance, "fields", {
|
||||
get() {
|
||||
const data = get_cache(__)?.[""];
|
||||
const issues = flatten_issues(data?.issues ?? []);
|
||||
return create_field_proxy(
|
||||
{},
|
||||
() => data?.input ?? {},
|
||||
(path, value) => {
|
||||
if (data?.submission) {
|
||||
return;
|
||||
}
|
||||
const input = path.length === 0 ? value : deep_set(data?.input ?? {}, path.map(String), value);
|
||||
(get_cache(__)[""] ??= {}).input = input;
|
||||
},
|
||||
() => issues
|
||||
);
|
||||
}
|
||||
});
|
||||
Object.defineProperty(instance, "result", {
|
||||
get() {
|
||||
try {
|
||||
return get_cache(__)?.[""]?.result;
|
||||
} catch {
|
||||
return void 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
Object.defineProperty(instance, "pending", {
|
||||
get: () => 0
|
||||
});
|
||||
Object.defineProperty(instance, "preflight", {
|
||||
// preflight is a noop on the server
|
||||
value: () => instance
|
||||
});
|
||||
Object.defineProperty(instance, "validate", {
|
||||
value: () => {
|
||||
throw new Error("Cannot call validate() on the server");
|
||||
}
|
||||
});
|
||||
if (key == void 0) {
|
||||
Object.defineProperty(instance, "for", {
|
||||
/** @type {RemoteForm<any, any>['for']} */
|
||||
value: (key2) => {
|
||||
const { state } = get_request_store();
|
||||
const cache_key = __.id + "|" + JSON.stringify(key2);
|
||||
let instance2 = (state.form_instances ??= /* @__PURE__ */ new Map()).get(cache_key);
|
||||
if (!instance2) {
|
||||
instance2 = create_instance(key2);
|
||||
instance2.__.id = `${__.id}/${encodeURIComponent(JSON.stringify(key2))}`;
|
||||
instance2.__.name = __.name;
|
||||
state.form_instances.set(cache_key, instance2);
|
||||
}
|
||||
return instance2;
|
||||
}
|
||||
});
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
return create_instance();
|
||||
}
|
||||
function handle_issues(output, issues, form_data) {
|
||||
output.issues = issues.map((issue) => normalize_issue(issue, true));
|
||||
if (form_data) {
|
||||
output.input = {};
|
||||
for (let key of form_data.keys()) {
|
||||
if (/^[.\]]?_/.test(key)) continue;
|
||||
const is_array = key.endsWith("[]");
|
||||
const values = form_data.getAll(key).filter((value) => typeof value === "string");
|
||||
if (is_array) key = key.slice(0, -2);
|
||||
set_nested_value(
|
||||
/** @type {Record<string, any>} */
|
||||
output.input,
|
||||
key,
|
||||
is_array ? values : values[0]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
function create_issues() {
|
||||
return (
|
||||
/** @type {InvalidField<any>} */
|
||||
new Proxy(
|
||||
/** @param {string} message */
|
||||
(message) => {
|
||||
if (typeof message !== "string") {
|
||||
throw new Error(
|
||||
"`invalid` should now be imported from `@sveltejs/kit` to throw validation issues. The second parameter provided to the form function (renamed to `issue`) is still used to construct issues, e.g. `invalid(issue.field('message'))`. For more info see https://github.com/sveltejs/kit/pulls/14768"
|
||||
);
|
||||
}
|
||||
return create_issue(message);
|
||||
},
|
||||
{
|
||||
get(target, prop) {
|
||||
if (typeof prop === "symbol") return (
|
||||
/** @type {any} */
|
||||
target[prop]
|
||||
);
|
||||
return create_issue_proxy(prop, []);
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
function create_issue(message, path = []) {
|
||||
return {
|
||||
message,
|
||||
path
|
||||
};
|
||||
}
|
||||
function create_issue_proxy(key, path) {
|
||||
const new_path = [...path, key];
|
||||
const issue_func = (message) => create_issue(message, new_path);
|
||||
return new Proxy(issue_func, {
|
||||
get(target, prop) {
|
||||
if (typeof prop === "symbol") return (
|
||||
/** @type {any} */
|
||||
target[prop]
|
||||
);
|
||||
if (/^\d+$/.test(prop)) {
|
||||
return create_issue_proxy(parseInt(prop, 10), new_path);
|
||||
}
|
||||
return create_issue_proxy(prop, new_path);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function prerender(validate_or_fn, fn_or_options, maybe_options) {
|
||||
const maybe_fn = typeof fn_or_options === "function" ? fn_or_options : void 0;
|
||||
const options = maybe_options ?? (maybe_fn ? void 0 : fn_or_options);
|
||||
const fn = maybe_fn ?? validate_or_fn;
|
||||
const validate = create_validator(validate_or_fn, maybe_fn);
|
||||
const __ = {
|
||||
type: "prerender",
|
||||
id: "",
|
||||
name: "",
|
||||
has_arg: !!maybe_fn,
|
||||
inputs: options?.inputs,
|
||||
dynamic: options?.dynamic
|
||||
};
|
||||
const wrapper = (arg) => {
|
||||
const promise = (async () => {
|
||||
const { event, state } = get_request_store();
|
||||
const payload = stringify_remote_arg(arg, state.transport);
|
||||
const id = __.id;
|
||||
const url = `${base}/${app_dir}/remote/${id}${payload ? `/${payload}` : ""}`;
|
||||
if (!state.prerendering && !DEV && !event.isRemoteRequest) {
|
||||
try {
|
||||
return await get_response(__, arg, state, async () => {
|
||||
const key = stringify_remote_arg(arg, state.transport);
|
||||
const cache = get_cache(__, state);
|
||||
const promise3 = cache[key] ??= fetch(new URL(url, event.url.origin).href).then(
|
||||
async (response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error("Prerendered response not found");
|
||||
}
|
||||
const prerendered = await response.json();
|
||||
if (prerendered.type === "error") {
|
||||
error(prerendered.status, prerendered.error);
|
||||
}
|
||||
return prerendered.result;
|
||||
}
|
||||
);
|
||||
return parse_remote_response(await promise3, state.transport);
|
||||
});
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
if (state.prerendering?.remote_responses.has(url)) {
|
||||
return (
|
||||
/** @type {Promise<any>} */
|
||||
state.prerendering.remote_responses.get(url)
|
||||
);
|
||||
}
|
||||
const promise2 = get_response(
|
||||
__,
|
||||
arg,
|
||||
state,
|
||||
() => run_remote_function(event, state, false, () => validate(arg), fn)
|
||||
);
|
||||
if (state.prerendering) {
|
||||
state.prerendering.remote_responses.set(url, promise2);
|
||||
}
|
||||
const result = await promise2;
|
||||
if (state.prerendering) {
|
||||
const body = { type: "result", result: stringify(result, state.transport) };
|
||||
state.prerendering.dependencies.set(url, {
|
||||
body: JSON.stringify(body),
|
||||
response: json(body)
|
||||
});
|
||||
}
|
||||
return result;
|
||||
})();
|
||||
promise.catch(() => {
|
||||
});
|
||||
return (
|
||||
/** @type {RemoteResource<Output>} */
|
||||
promise
|
||||
);
|
||||
};
|
||||
Object.defineProperty(wrapper, "__", { value: __ });
|
||||
return wrapper;
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function query(validate_or_fn, maybe_fn) {
|
||||
const fn = maybe_fn ?? validate_or_fn;
|
||||
const validate = create_validator(validate_or_fn, maybe_fn);
|
||||
const __ = { type: "query", id: "", name: "" };
|
||||
const wrapper = (arg) => {
|
||||
if (prerendering) {
|
||||
throw new Error(
|
||||
`Cannot call query '${__.name}' while prerendering, as prerendered pages need static data. Use 'prerender' from $app/server instead`
|
||||
);
|
||||
}
|
||||
const { event, state } = get_request_store();
|
||||
const get_remote_function_result = () => run_remote_function(event, state, false, () => validate(arg), fn);
|
||||
const promise = get_response(__, arg, state, get_remote_function_result);
|
||||
promise.catch(() => {
|
||||
});
|
||||
promise.set = (value) => update_refresh_value(get_refresh_context(__, "set", arg), value);
|
||||
promise.refresh = () => {
|
||||
const refresh_context = get_refresh_context(__, "refresh", arg);
|
||||
const is_immediate_refresh = !refresh_context.cache[refresh_context.cache_key];
|
||||
const value = is_immediate_refresh ? promise : get_remote_function_result();
|
||||
return update_refresh_value(refresh_context, value, is_immediate_refresh);
|
||||
};
|
||||
promise.withOverride = () => {
|
||||
throw new Error(`Cannot call '${__.name}.withOverride()' on the server`);
|
||||
};
|
||||
return (
|
||||
/** @type {RemoteQuery<Output>} */
|
||||
promise
|
||||
);
|
||||
};
|
||||
Object.defineProperty(wrapper, "__", { value: __ });
|
||||
return wrapper;
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function batch(validate_or_fn, maybe_fn) {
|
||||
const fn = maybe_fn ?? validate_or_fn;
|
||||
const validate = create_validator(validate_or_fn, maybe_fn);
|
||||
const __ = {
|
||||
type: "query_batch",
|
||||
id: "",
|
||||
name: "",
|
||||
run: async (args, options) => {
|
||||
const { event, state } = get_request_store();
|
||||
return run_remote_function(
|
||||
event,
|
||||
state,
|
||||
false,
|
||||
async () => Promise.all(args.map(validate)),
|
||||
async (input) => {
|
||||
const get_result = await fn(input);
|
||||
return Promise.all(
|
||||
input.map(async (arg, i) => {
|
||||
try {
|
||||
return { type: "result", data: get_result(arg, i) };
|
||||
} catch (error2) {
|
||||
return {
|
||||
type: "error",
|
||||
error: await handle_error_and_jsonify(event, state, options, error2),
|
||||
status: error2 instanceof HttpError || error2 instanceof SvelteKitError ? error2.status : 500
|
||||
};
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
let batching = { args: [], resolvers: [] };
|
||||
const wrapper = (arg) => {
|
||||
if (prerendering) {
|
||||
throw new Error(
|
||||
`Cannot call query.batch '${__.name}' while prerendering, as prerendered pages need static data. Use 'prerender' from $app/server instead`
|
||||
);
|
||||
}
|
||||
const { event, state } = get_request_store();
|
||||
const get_remote_function_result = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
batching.args.push(arg);
|
||||
batching.resolvers.push({ resolve, reject });
|
||||
if (batching.args.length > 1) return;
|
||||
setTimeout(async () => {
|
||||
const batched = batching;
|
||||
batching = { args: [], resolvers: [] };
|
||||
try {
|
||||
return await run_remote_function(
|
||||
event,
|
||||
state,
|
||||
false,
|
||||
async () => Promise.all(batched.args.map(validate)),
|
||||
async (input) => {
|
||||
const get_result = await fn(input);
|
||||
for (let i = 0; i < batched.resolvers.length; i++) {
|
||||
try {
|
||||
batched.resolvers[i].resolve(get_result(input[i], i));
|
||||
} catch (error2) {
|
||||
batched.resolvers[i].reject(error2);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
} catch (error2) {
|
||||
for (const resolver of batched.resolvers) {
|
||||
resolver.reject(error2);
|
||||
}
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
};
|
||||
const promise = get_response(__, arg, state, get_remote_function_result);
|
||||
promise.catch(() => {
|
||||
});
|
||||
promise.set = (value) => update_refresh_value(get_refresh_context(__, "set", arg), value);
|
||||
promise.refresh = () => {
|
||||
const refresh_context = get_refresh_context(__, "refresh", arg);
|
||||
const is_immediate_refresh = !refresh_context.cache[refresh_context.cache_key];
|
||||
const value = is_immediate_refresh ? promise : get_remote_function_result();
|
||||
return update_refresh_value(refresh_context, value, is_immediate_refresh);
|
||||
};
|
||||
promise.withOverride = () => {
|
||||
throw new Error(`Cannot call '${__.name}.withOverride()' on the server`);
|
||||
};
|
||||
return (
|
||||
/** @type {RemoteQuery<Output>} */
|
||||
promise
|
||||
);
|
||||
};
|
||||
Object.defineProperty(wrapper, "__", { value: __ });
|
||||
return wrapper;
|
||||
}
|
||||
Object.defineProperty(query, "batch", { value: batch, enumerable: true });
|
||||
function get_refresh_context(__, action, arg) {
|
||||
const { state } = get_request_store();
|
||||
const { refreshes } = state;
|
||||
if (!refreshes) {
|
||||
const name = __.type === "query_batch" ? `query.batch '${__.name}'` : `query '${__.name}'`;
|
||||
throw new Error(
|
||||
`Cannot call ${action} on ${name} because it is not executed in the context of a command/form remote function`
|
||||
);
|
||||
}
|
||||
const cache = get_cache(__, state);
|
||||
const cache_key = stringify_remote_arg(arg, state.transport);
|
||||
const refreshes_key = create_remote_key(__.id, cache_key);
|
||||
return { __, state, refreshes, refreshes_key, cache, cache_key };
|
||||
}
|
||||
function update_refresh_value({ __, refreshes, refreshes_key, cache, cache_key }, value, is_immediate_refresh = false) {
|
||||
const promise = Promise.resolve(value);
|
||||
if (!is_immediate_refresh) {
|
||||
cache[cache_key] = promise;
|
||||
}
|
||||
if (__.id) {
|
||||
refreshes[refreshes_key] = promise;
|
||||
}
|
||||
return promise.then(() => {
|
||||
});
|
||||
}
|
||||
export {
|
||||
command,
|
||||
form,
|
||||
prerender,
|
||||
query
|
||||
};
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"/": [
|
||||
"src/routes/+page.server.ts",
|
||||
"src/routes/+layout.ts",
|
||||
"src/routes/+layout.ts"
|
||||
],
|
||||
|
||||
+11
-4
@@ -11,16 +11,23 @@ type OutputDataShape<T> = MaybeWithVoid<Omit<App.PageData, RequiredKeys<T>> & Pa
|
||||
type EnsureDefined<T> = T extends null | undefined ? {} : T;
|
||||
type OptionalUnion<U extends Record<string, any>, A extends keyof U = U extends U ? keyof U : never> = U extends unknown ? { [P in Exclude<A, keyof U>]?: never } & U : never;
|
||||
export type Snapshot<T = any> = Kit.Snapshot<T>;
|
||||
type PageServerParentData = EnsureDefined<LayoutServerData>;
|
||||
type PageParentData = EnsureDefined<LayoutData>;
|
||||
type LayoutRouteId = RouteId | "/" | "/logout" | "/items" | "/login" | null
|
||||
type LayoutParams = RouteParams & { }
|
||||
type LayoutParentData = EnsureDefined<{}>;
|
||||
|
||||
export type PageServerData = null;
|
||||
export type PageData = Expand<PageParentData>;
|
||||
export type PageProps = { params: RouteParams; data: PageData }
|
||||
export type PageServerLoad<OutputData extends OutputDataShape<PageServerParentData> = OutputDataShape<PageServerParentData>> = Kit.ServerLoad<RouteParams, PageServerParentData, OutputData, RouteId>;
|
||||
export type PageServerLoadEvent = Parameters<PageServerLoad>[0];
|
||||
export type ActionData = unknown;
|
||||
export type PageServerData = Expand<OptionalUnion<EnsureDefined<Kit.LoadProperties<Awaited<ReturnType<typeof import('./proxy+page.server.js').load>>>>>>;
|
||||
export type PageData = Expand<Omit<PageParentData, keyof PageServerData> & EnsureDefined<PageServerData>>;
|
||||
export type Action<OutputData extends Record<string, any> | void = Record<string, any> | void> = Kit.Action<RouteParams, OutputData, RouteId>
|
||||
export type Actions<OutputData extends Record<string, any> | void = Record<string, any> | void> = Kit.Actions<RouteParams, OutputData, RouteId>
|
||||
export type PageProps = { params: RouteParams; data: PageData; form: ActionData }
|
||||
export type LayoutServerData = null;
|
||||
export type LayoutLoad<OutputData extends OutputDataShape<LayoutParentData> = OutputDataShape<LayoutParentData>> = Kit.Load<LayoutParams, LayoutServerData, LayoutParentData, OutputData, LayoutRouteId>;
|
||||
export type LayoutLoad<OutputData extends Partial<App.PageData> & Record<string, any> | void = Partial<App.PageData> & Record<string, any> | void> = Kit.Load<LayoutParams, LayoutServerData, LayoutParentData, OutputData, LayoutRouteId>;
|
||||
export type LayoutLoadEvent = Parameters<LayoutLoad>[0];
|
||||
export type LayoutData = Expand<Omit<LayoutParentData, keyof LayoutParentData & EnsureDefined<LayoutServerData>> & OptionalUnion<EnsureDefined<LayoutParentData & EnsureDefined<LayoutServerData>>>>;
|
||||
export type LayoutProps = { params: LayoutParams; data: LayoutData; children: import("svelte").Snippet }
|
||||
export type RequestEvent = Kit.RequestEvent<RouteParams, RouteId>;
|
||||
@@ -0,0 +1,15 @@
|
||||
// @ts-nocheck
|
||||
import type { PageServerLoad } from "./$types";
|
||||
import type { StackqItem } from "$lib/types/items";
|
||||
|
||||
const COLLECTION = "Stackq_Items";
|
||||
|
||||
export const load = async ({ locals }: Parameters<PageServerLoad>[0]) => {
|
||||
const list = await locals.pb
|
||||
.collection(COLLECTION)
|
||||
.getFullList<StackqItem>({ sort: "-created", expand: "Parent" })
|
||||
.catch(() => [] as StackqItem[]);
|
||||
|
||||
const itemsForParent = list.map((i) => ({ id: i.id, Item: i.Item, SKU: i.SKU }));
|
||||
return { itemsForParent };
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{i as c,j as s,l,L as i}from"./Dexp9pM5.js";import{B as _}from"./CRDN6Mh7.js";function f(n,o,r){c&&s();var a=new _(n);l(()=>{var e=o()??null;a.ensure(e,e&&(t=>r(t,e)))},i)}const u=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{u as _,f as c};
|
||||
@@ -0,0 +1,2 @@
|
||||
+ dm.?£öÜ&ͽB’€¾O Ë[ÿ�Q¯¿· —~c�b4!dŠÑmž"ÞZ†kwGL0Ü+CþDò�LoÙt²d4½®m1<*¹?óÏ#aFíÅ&ÚG^äÇËø¬Oü™\ò(Äê×ïGÀ ‡ÏÊU2™ÁÅ…
€«uU˜••¸Ù°‹�–4F…”~âø!&2°ùynËÉ
|
||||
” F*¥ ¹ý¹Z1?†nÌóîhH“yJ÷þúhTÁ‚y[(Kƒ¸Pò)9ɤÂcÍB
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import"./Bzak7iHL.js";import{t as j,a as b,s as f,c as g}from"./BKSreT2u.js";import{A,c as G,f as P,a as d,G as T,h,r as m,b as k,T as x}from"./Dexp9pM5.js";import{i as q}from"./CRDN6Mh7.js";import{p as r,b as p,r as C}from"./jOLfEXYH.js";const y=j({base:"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs",destructive:"bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs",outline:"bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-xs",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});var D=k("<a><!></a>"),E=k("<button><!></button>");function L(_,e){A(e,!0);let o=r(e,"variant",3,"default"),l=r(e,"size",3,"default"),s=r(e,"ref",15,null),c=r(e,"href",3,void 0),z=r(e,"type",3,"button"),v=C(e,["$$slots","$$events","$$legacy","class","variant","size","ref","href","type","disabled","children"]);var u=G(),w=P(u);{var B=i=>{var a=D();b(a,t=>({"data-slot":"button",class:t,href:e.disabled?void 0:c(),"aria-disabled":e.disabled,role:e.disabled?"link":void 0,tabindex:e.disabled?-1:void 0,...v}),[()=>g(y({variant:o(),size:l()}),e.class)]);var n=h(a);f(n,()=>e.children??x),m(a),p(a,t=>s(t),()=>s()),d(i,a)},V=i=>{var a=E();b(a,t=>({"data-slot":"button",class:t,type:z(),disabled:e.disabled,...v}),[()=>g(y({variant:o(),size:l()}),e.class)]);var n=h(a);f(n,()=>e.children??x),m(a),p(a,t=>s(t),()=>s()),d(i,a)};q(w,i=>{c()?i(B):i(V,!1)})}d(_,u),T()}export{L as B};
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{i as a,j as d,J as s,K as E,l as v,L as y,M as h,N,O as x,P as T,Q as w,o as _,s as r,R as A,S as C}from"./Dexp9pM5.js";import{i as M}from"./agKGoZF1.js";import{B as S}from"./CRDN6Mh7.js";function L(m,u,c,i,b,P){let p=a;a&&d();var e=null;a&&s.nodeType===E&&(e=s,d());var l=a?s:m,f=new S(l,!1);v(()=>{const t=u()||null;var g=c||t==="svg"?N:void 0;if(t===null){f.ensure(null,null);return}return f.ensure(t,o=>{if(t){if(e=a?e:h(t,g),x(e,e),i){a&&M(t)&&e.append(document.createComment(""));var n=a?T(e):e.appendChild(w());a&&(n===null?_(!1):r(n)),i(e,n)}A.nodes.end=e,o.before(e)}a&&r(o)}),()=>{}},y),C(()=>{}),p&&(_(!0),r(l))}export{L as e};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user