feat: integrate SvelteKit for seamless navigation and improved data loading
This commit is contained in:
77
frontend/.svelte-kit/output/server/chunks/api.js
Normal file
77
frontend/.svelte-kit/output/server/chunks/api.js
Normal file
@@ -0,0 +1,77 @@
|
||||
import { a as addToast } from "./toasts.js";
|
||||
const API_BASE_URL = "/api";
|
||||
async function fetchApi(endpoint) {
|
||||
try {
|
||||
console.log(`[api.fetchApi][Action] Fetching from context={{'endpoint': '${endpoint}'}}`);
|
||||
const response = await fetch(`${API_BASE_URL}${endpoint}`);
|
||||
if (!response.ok) {
|
||||
throw new Error(`API request failed with status ${response.status}`);
|
||||
}
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error(`[api.fetchApi][Coherence:Failed] Error fetching from ${endpoint}:`, error);
|
||||
addToast(error.message, "error");
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
async function postApi(endpoint, body) {
|
||||
try {
|
||||
console.log(`[api.postApi][Action] Posting to context={{'endpoint': '${endpoint}'}}`);
|
||||
const response = await fetch(`${API_BASE_URL}${endpoint}`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(body)
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error(`API request failed with status ${response.status}`);
|
||||
}
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error(`[api.postApi][Coherence:Failed] Error posting to ${endpoint}:`, error);
|
||||
addToast(error.message, "error");
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
async function requestApi(endpoint, method = "GET", body = null) {
|
||||
try {
|
||||
console.log(`[api.requestApi][Action] ${method} to context={{'endpoint': '${endpoint}'}}`);
|
||||
const options = {
|
||||
method,
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
};
|
||||
if (body) {
|
||||
options.body = JSON.stringify(body);
|
||||
}
|
||||
const response = await fetch(`${API_BASE_URL}${endpoint}`, options);
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => ({}));
|
||||
throw new Error(errorData.detail || `API request failed with status ${response.status}`);
|
||||
}
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error(`[api.requestApi][Coherence:Failed] Error ${method} to ${endpoint}:`, error);
|
||||
addToast(error.message, "error");
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
const api = {
|
||||
getPlugins: () => fetchApi("/plugins/"),
|
||||
getTasks: () => fetchApi("/tasks/"),
|
||||
getTask: (taskId) => fetchApi(`/tasks/${taskId}`),
|
||||
createTask: (pluginId, params) => postApi("/tasks/", { plugin_id: pluginId, params }),
|
||||
// Settings
|
||||
getSettings: () => fetchApi("/settings/"),
|
||||
updateGlobalSettings: (settings) => requestApi("/settings/global", "PATCH", settings),
|
||||
getEnvironments: () => fetchApi("/settings/environments"),
|
||||
addEnvironment: (env) => postApi("/settings/environments", env),
|
||||
updateEnvironment: (id, env) => requestApi(`/settings/environments/${id}`, "PUT", env),
|
||||
deleteEnvironment: (id) => requestApi(`/settings/environments/${id}`, "DELETE"),
|
||||
testEnvironmentConnection: (id) => postApi(`/settings/environments/${id}/test`, {})
|
||||
};
|
||||
export {
|
||||
api as a
|
||||
};
|
||||
34
frontend/.svelte-kit/output/server/chunks/environment.js
Normal file
34
frontend/.svelte-kit/output/server/chunks/environment.js
Normal file
@@ -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 {
|
||||
assets as a,
|
||||
base as b,
|
||||
app_dir as c,
|
||||
reset as d,
|
||||
set_building as e,
|
||||
set_prerendering as f,
|
||||
override as o,
|
||||
prerendering as p,
|
||||
relative as r,
|
||||
set_assets as s
|
||||
};
|
||||
51
frontend/.svelte-kit/output/server/chunks/equality.js
Normal file
51
frontend/.svelte-kit/output/server/chunks/equality.js
Normal file
@@ -0,0 +1,51 @@
|
||||
var is_array = Array.isArray;
|
||||
var index_of = Array.prototype.indexOf;
|
||||
var array_from = Array.from;
|
||||
var define_property = Object.defineProperty;
|
||||
var get_descriptor = Object.getOwnPropertyDescriptor;
|
||||
var object_prototype = Object.prototype;
|
||||
var array_prototype = Array.prototype;
|
||||
var get_prototype_of = Object.getPrototypeOf;
|
||||
var is_extensible = Object.isExtensible;
|
||||
const noop = () => {
|
||||
};
|
||||
function run_all(arr) {
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
arr[i]();
|
||||
}
|
||||
}
|
||||
function deferred() {
|
||||
var resolve;
|
||||
var reject;
|
||||
var promise = new Promise((res, rej) => {
|
||||
resolve = res;
|
||||
reject = rej;
|
||||
});
|
||||
return { promise, resolve, reject };
|
||||
}
|
||||
function equals(value) {
|
||||
return value === this.v;
|
||||
}
|
||||
function safe_not_equal(a, b) {
|
||||
return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function";
|
||||
}
|
||||
function safe_equals(value) {
|
||||
return !safe_not_equal(value, this.v);
|
||||
}
|
||||
export {
|
||||
array_from as a,
|
||||
deferred as b,
|
||||
array_prototype as c,
|
||||
define_property as d,
|
||||
equals as e,
|
||||
get_prototype_of as f,
|
||||
get_descriptor as g,
|
||||
is_extensible as h,
|
||||
is_array as i,
|
||||
index_of as j,
|
||||
safe_not_equal as k,
|
||||
noop as n,
|
||||
object_prototype as o,
|
||||
run_all as r,
|
||||
safe_equals as s
|
||||
};
|
||||
174
frontend/.svelte-kit/output/server/chunks/exports.js
Normal file
174
frontend/.svelte-kit/output/server/chunks/exports.js
Normal file
@@ -0,0 +1,174 @@
|
||||
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) => {
|
||||
search_params_callback(param);
|
||||
return obj[key](param);
|
||||
};
|
||||
}
|
||||
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[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => {
|
||||
return inspect(url, opts);
|
||||
};
|
||||
tracked.searchParams[/* @__PURE__ */ 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[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => {
|
||||
return inspect(new URL(url), opts);
|
||||
};
|
||||
}
|
||||
}
|
||||
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,
|
||||
decode_pathname as f,
|
||||
validate_server_exports as g,
|
||||
make_trackable as m,
|
||||
normalize_path as n,
|
||||
resolve as r,
|
||||
validate_layout_server_exports as v
|
||||
};
|
||||
4
frontend/.svelte-kit/output/server/chunks/false.js
Normal file
4
frontend/.svelte-kit/output/server/chunks/false.js
Normal file
@@ -0,0 +1,4 @@
|
||||
const BROWSER = false;
|
||||
export {
|
||||
BROWSER as B
|
||||
};
|
||||
59
frontend/.svelte-kit/output/server/chunks/index.js
Normal file
59
frontend/.svelte-kit/output/server/chunks/index.js
Normal file
@@ -0,0 +1,59 @@
|
||||
import { n as noop, k as safe_not_equal } from "./equality.js";
|
||||
import "clsx";
|
||||
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 };
|
||||
}
|
||||
export {
|
||||
readable as r,
|
||||
writable as w
|
||||
};
|
||||
2783
frontend/.svelte-kit/output/server/chunks/index2.js
Normal file
2783
frontend/.svelte-kit/output/server/chunks/index2.js
Normal file
File diff suppressed because it is too large
Load Diff
982
frontend/.svelte-kit/output/server/chunks/internal.js
Normal file
982
frontend/.svelte-kit/output/server/chunks/internal.js
Normal file
@@ -0,0 +1,982 @@
|
||||
import { H as HYDRATION_ERROR, C as COMMENT_NODE, a as HYDRATION_END, g as get_next_sibling, b as HYDRATION_START, c as HYDRATION_START_ELSE, e as effect_tracking, d as get, s as source, r as render_effect, u as untrack, i as increment, q as queue_micro_task, f as active_effect, h as block, j as branch, B as Batch, p as pause_effect, k as create_text, l as set_active_effect, m as set_active_reaction, n as set_component_context, o as handle_error, t as active_reaction, v as component_context, w as move_effect, x as internal_set, y as destroy_effect, z as invoke_error_boundary, A as svelte_boundary_reset_onerror, E as EFFECT_TRANSPARENT, D as EFFECT_PRESERVED, F as BOUNDARY_EFFECT, G as init_operations, I as get_first_child, J as hydration_failed, K as clear_text_content, L as component_root, M as is_passive_event, N as push, O as pop, P as set, Q as LEGACY_PROPS, R as flushSync, S as mutable_source, T as render, U as setContext } from "./index2.js";
|
||||
import { d as define_property, a as array_from } from "./equality.js";
|
||||
import "clsx";
|
||||
import "./environment.js";
|
||||
let public_env = {};
|
||||
function set_private_env(environment) {
|
||||
}
|
||||
function set_public_env(environment) {
|
||||
public_env = environment;
|
||||
}
|
||||
function hydration_mismatch(location) {
|
||||
{
|
||||
console.warn(`https://svelte.dev/e/hydration_mismatch`);
|
||||
}
|
||||
}
|
||||
function svelte_boundary_reset_noop() {
|
||||
{
|
||||
console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
|
||||
}
|
||||
}
|
||||
let hydrating = false;
|
||||
function set_hydrating(value) {
|
||||
hydrating = value;
|
||||
}
|
||||
let hydrate_node;
|
||||
function set_hydrate_node(node) {
|
||||
if (node === null) {
|
||||
hydration_mismatch();
|
||||
throw HYDRATION_ERROR;
|
||||
}
|
||||
return hydrate_node = node;
|
||||
}
|
||||
function hydrate_next() {
|
||||
return set_hydrate_node(get_next_sibling(hydrate_node));
|
||||
}
|
||||
function next(count = 1) {
|
||||
if (hydrating) {
|
||||
var i = count;
|
||||
var node = hydrate_node;
|
||||
while (i--) {
|
||||
node = /** @type {TemplateNode} */
|
||||
get_next_sibling(node);
|
||||
}
|
||||
hydrate_node = node;
|
||||
}
|
||||
}
|
||||
function skip_nodes(remove = true) {
|
||||
var depth = 0;
|
||||
var node = hydrate_node;
|
||||
while (true) {
|
||||
if (node.nodeType === COMMENT_NODE) {
|
||||
var data = (
|
||||
/** @type {Comment} */
|
||||
node.data
|
||||
);
|
||||
if (data === HYDRATION_END) {
|
||||
if (depth === 0) return node;
|
||||
depth -= 1;
|
||||
} else if (data === HYDRATION_START || data === HYDRATION_START_ELSE) {
|
||||
depth += 1;
|
||||
}
|
||||
}
|
||||
var next2 = (
|
||||
/** @type {TemplateNode} */
|
||||
get_next_sibling(node)
|
||||
);
|
||||
if (remove) node.remove();
|
||||
node = next2;
|
||||
}
|
||||
}
|
||||
function createSubscriber(start) {
|
||||
let subscribers = 0;
|
||||
let version = source(0);
|
||||
let stop;
|
||||
return () => {
|
||||
if (effect_tracking()) {
|
||||
get(version);
|
||||
render_effect(() => {
|
||||
if (subscribers === 0) {
|
||||
stop = untrack(() => start(() => increment(version)));
|
||||
}
|
||||
subscribers += 1;
|
||||
return () => {
|
||||
queue_micro_task(() => {
|
||||
subscribers -= 1;
|
||||
if (subscribers === 0) {
|
||||
stop?.();
|
||||
stop = void 0;
|
||||
increment(version);
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED | BOUNDARY_EFFECT;
|
||||
function boundary(node, props, children) {
|
||||
new Boundary(node, props, children);
|
||||
}
|
||||
class Boundary {
|
||||
/** @type {Boundary | null} */
|
||||
parent;
|
||||
#pending = false;
|
||||
/** @type {TemplateNode} */
|
||||
#anchor;
|
||||
/** @type {TemplateNode | null} */
|
||||
#hydrate_open = hydrating ? hydrate_node : null;
|
||||
/** @type {BoundaryProps} */
|
||||
#props;
|
||||
/** @type {((anchor: Node) => void)} */
|
||||
#children;
|
||||
/** @type {Effect} */
|
||||
#effect;
|
||||
/** @type {Effect | null} */
|
||||
#main_effect = null;
|
||||
/** @type {Effect | null} */
|
||||
#pending_effect = null;
|
||||
/** @type {Effect | null} */
|
||||
#failed_effect = null;
|
||||
/** @type {DocumentFragment | null} */
|
||||
#offscreen_fragment = null;
|
||||
/** @type {TemplateNode | null} */
|
||||
#pending_anchor = null;
|
||||
#local_pending_count = 0;
|
||||
#pending_count = 0;
|
||||
#is_creating_fallback = false;
|
||||
/**
|
||||
* A source containing the number of pending async deriveds/expressions.
|
||||
* Only created if `$effect.pending()` is used inside the boundary,
|
||||
* otherwise updating the source results in needless `Batch.ensure()`
|
||||
* calls followed by no-op flushes
|
||||
* @type {Source<number> | null}
|
||||
*/
|
||||
#effect_pending = null;
|
||||
#effect_pending_subscriber = createSubscriber(() => {
|
||||
this.#effect_pending = source(this.#local_pending_count);
|
||||
return () => {
|
||||
this.#effect_pending = null;
|
||||
};
|
||||
});
|
||||
/**
|
||||
* @param {TemplateNode} node
|
||||
* @param {BoundaryProps} props
|
||||
* @param {((anchor: Node) => void)} children
|
||||
*/
|
||||
constructor(node, props, children) {
|
||||
this.#anchor = node;
|
||||
this.#props = props;
|
||||
this.#children = children;
|
||||
this.parent = /** @type {Effect} */
|
||||
active_effect.b;
|
||||
this.#pending = !!this.#props.pending;
|
||||
this.#effect = block(() => {
|
||||
active_effect.b = this;
|
||||
if (hydrating) {
|
||||
const comment = this.#hydrate_open;
|
||||
hydrate_next();
|
||||
const server_rendered_pending = (
|
||||
/** @type {Comment} */
|
||||
comment.nodeType === COMMENT_NODE && /** @type {Comment} */
|
||||
comment.data === HYDRATION_START_ELSE
|
||||
);
|
||||
if (server_rendered_pending) {
|
||||
this.#hydrate_pending_content();
|
||||
} else {
|
||||
this.#hydrate_resolved_content();
|
||||
}
|
||||
} else {
|
||||
var anchor = this.#get_anchor();
|
||||
try {
|
||||
this.#main_effect = branch(() => children(anchor));
|
||||
} catch (error) {
|
||||
this.error(error);
|
||||
}
|
||||
if (this.#pending_count > 0) {
|
||||
this.#show_pending_snippet();
|
||||
} else {
|
||||
this.#pending = false;
|
||||
}
|
||||
}
|
||||
return () => {
|
||||
this.#pending_anchor?.remove();
|
||||
};
|
||||
}, flags);
|
||||
if (hydrating) {
|
||||
this.#anchor = hydrate_node;
|
||||
}
|
||||
}
|
||||
#hydrate_resolved_content() {
|
||||
try {
|
||||
this.#main_effect = branch(() => this.#children(this.#anchor));
|
||||
} catch (error) {
|
||||
this.error(error);
|
||||
}
|
||||
this.#pending = false;
|
||||
}
|
||||
#hydrate_pending_content() {
|
||||
const pending = this.#props.pending;
|
||||
if (!pending) {
|
||||
return;
|
||||
}
|
||||
this.#pending_effect = branch(() => pending(this.#anchor));
|
||||
Batch.enqueue(() => {
|
||||
var anchor = this.#get_anchor();
|
||||
this.#main_effect = this.#run(() => {
|
||||
Batch.ensure();
|
||||
return branch(() => this.#children(anchor));
|
||||
});
|
||||
if (this.#pending_count > 0) {
|
||||
this.#show_pending_snippet();
|
||||
} else {
|
||||
pause_effect(
|
||||
/** @type {Effect} */
|
||||
this.#pending_effect,
|
||||
() => {
|
||||
this.#pending_effect = null;
|
||||
}
|
||||
);
|
||||
this.#pending = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
#get_anchor() {
|
||||
var anchor = this.#anchor;
|
||||
if (this.#pending) {
|
||||
this.#pending_anchor = create_text();
|
||||
this.#anchor.before(this.#pending_anchor);
|
||||
anchor = this.#pending_anchor;
|
||||
}
|
||||
return anchor;
|
||||
}
|
||||
/**
|
||||
* Returns `true` if the effect exists inside a boundary whose pending snippet is shown
|
||||
* @returns {boolean}
|
||||
*/
|
||||
is_pending() {
|
||||
return this.#pending || !!this.parent && this.parent.is_pending();
|
||||
}
|
||||
has_pending_snippet() {
|
||||
return !!this.#props.pending;
|
||||
}
|
||||
/**
|
||||
* @param {() => Effect | null} fn
|
||||
*/
|
||||
#run(fn) {
|
||||
var previous_effect = active_effect;
|
||||
var previous_reaction = active_reaction;
|
||||
var previous_ctx = component_context;
|
||||
set_active_effect(this.#effect);
|
||||
set_active_reaction(this.#effect);
|
||||
set_component_context(this.#effect.ctx);
|
||||
try {
|
||||
return fn();
|
||||
} catch (e) {
|
||||
handle_error(e);
|
||||
return null;
|
||||
} finally {
|
||||
set_active_effect(previous_effect);
|
||||
set_active_reaction(previous_reaction);
|
||||
set_component_context(previous_ctx);
|
||||
}
|
||||
}
|
||||
#show_pending_snippet() {
|
||||
const pending = (
|
||||
/** @type {(anchor: Node) => void} */
|
||||
this.#props.pending
|
||||
);
|
||||
if (this.#main_effect !== null) {
|
||||
this.#offscreen_fragment = document.createDocumentFragment();
|
||||
this.#offscreen_fragment.append(
|
||||
/** @type {TemplateNode} */
|
||||
this.#pending_anchor
|
||||
);
|
||||
move_effect(this.#main_effect, this.#offscreen_fragment);
|
||||
}
|
||||
if (this.#pending_effect === null) {
|
||||
this.#pending_effect = branch(() => pending(this.#anchor));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Updates the pending count associated with the currently visible pending snippet,
|
||||
* if any, such that we can replace the snippet with content once work is done
|
||||
* @param {1 | -1} d
|
||||
*/
|
||||
#update_pending_count(d) {
|
||||
if (!this.has_pending_snippet()) {
|
||||
if (this.parent) {
|
||||
this.parent.#update_pending_count(d);
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.#pending_count += d;
|
||||
if (this.#pending_count === 0) {
|
||||
this.#pending = false;
|
||||
if (this.#pending_effect) {
|
||||
pause_effect(this.#pending_effect, () => {
|
||||
this.#pending_effect = null;
|
||||
});
|
||||
}
|
||||
if (this.#offscreen_fragment) {
|
||||
this.#anchor.before(this.#offscreen_fragment);
|
||||
this.#offscreen_fragment = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Update the source that powers `$effect.pending()` inside this boundary,
|
||||
* and controls when the current `pending` snippet (if any) is removed.
|
||||
* Do not call from inside the class
|
||||
* @param {1 | -1} d
|
||||
*/
|
||||
update_pending_count(d) {
|
||||
this.#update_pending_count(d);
|
||||
this.#local_pending_count += d;
|
||||
if (this.#effect_pending) {
|
||||
internal_set(this.#effect_pending, this.#local_pending_count);
|
||||
}
|
||||
}
|
||||
get_effect_pending() {
|
||||
this.#effect_pending_subscriber();
|
||||
return get(
|
||||
/** @type {Source<number>} */
|
||||
this.#effect_pending
|
||||
);
|
||||
}
|
||||
/** @param {unknown} error */
|
||||
error(error) {
|
||||
var onerror = this.#props.onerror;
|
||||
let failed = this.#props.failed;
|
||||
if (this.#is_creating_fallback || !onerror && !failed) {
|
||||
throw error;
|
||||
}
|
||||
if (this.#main_effect) {
|
||||
destroy_effect(this.#main_effect);
|
||||
this.#main_effect = null;
|
||||
}
|
||||
if (this.#pending_effect) {
|
||||
destroy_effect(this.#pending_effect);
|
||||
this.#pending_effect = null;
|
||||
}
|
||||
if (this.#failed_effect) {
|
||||
destroy_effect(this.#failed_effect);
|
||||
this.#failed_effect = null;
|
||||
}
|
||||
if (hydrating) {
|
||||
set_hydrate_node(
|
||||
/** @type {TemplateNode} */
|
||||
this.#hydrate_open
|
||||
);
|
||||
next();
|
||||
set_hydrate_node(skip_nodes());
|
||||
}
|
||||
var did_reset = false;
|
||||
var calling_on_error = false;
|
||||
const reset = () => {
|
||||
if (did_reset) {
|
||||
svelte_boundary_reset_noop();
|
||||
return;
|
||||
}
|
||||
did_reset = true;
|
||||
if (calling_on_error) {
|
||||
svelte_boundary_reset_onerror();
|
||||
}
|
||||
Batch.ensure();
|
||||
this.#local_pending_count = 0;
|
||||
if (this.#failed_effect !== null) {
|
||||
pause_effect(this.#failed_effect, () => {
|
||||
this.#failed_effect = null;
|
||||
});
|
||||
}
|
||||
this.#pending = this.has_pending_snippet();
|
||||
this.#main_effect = this.#run(() => {
|
||||
this.#is_creating_fallback = false;
|
||||
return branch(() => this.#children(this.#anchor));
|
||||
});
|
||||
if (this.#pending_count > 0) {
|
||||
this.#show_pending_snippet();
|
||||
} else {
|
||||
this.#pending = false;
|
||||
}
|
||||
};
|
||||
var previous_reaction = active_reaction;
|
||||
try {
|
||||
set_active_reaction(null);
|
||||
calling_on_error = true;
|
||||
onerror?.(error, reset);
|
||||
calling_on_error = false;
|
||||
} catch (error2) {
|
||||
invoke_error_boundary(error2, this.#effect && this.#effect.parent);
|
||||
} finally {
|
||||
set_active_reaction(previous_reaction);
|
||||
}
|
||||
if (failed) {
|
||||
queue_micro_task(() => {
|
||||
this.#failed_effect = this.#run(() => {
|
||||
Batch.ensure();
|
||||
this.#is_creating_fallback = true;
|
||||
try {
|
||||
return branch(() => {
|
||||
failed(
|
||||
this.#anchor,
|
||||
() => error,
|
||||
() => reset
|
||||
);
|
||||
});
|
||||
} catch (error2) {
|
||||
invoke_error_boundary(
|
||||
error2,
|
||||
/** @type {Effect} */
|
||||
this.#effect.parent
|
||||
);
|
||||
return null;
|
||||
} finally {
|
||||
this.#is_creating_fallback = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
const all_registered_events = /* @__PURE__ */ new Set();
|
||||
const root_event_handles = /* @__PURE__ */ new Set();
|
||||
let last_propagated_event = null;
|
||||
function handle_event_propagation(event) {
|
||||
var handler_element = this;
|
||||
var owner_document = (
|
||||
/** @type {Node} */
|
||||
handler_element.ownerDocument
|
||||
);
|
||||
var event_name = event.type;
|
||||
var path = event.composedPath?.() || [];
|
||||
var current_target = (
|
||||
/** @type {null | Element} */
|
||||
path[0] || event.target
|
||||
);
|
||||
last_propagated_event = event;
|
||||
var path_idx = 0;
|
||||
var handled_at = last_propagated_event === event && event.__root;
|
||||
if (handled_at) {
|
||||
var at_idx = path.indexOf(handled_at);
|
||||
if (at_idx !== -1 && (handler_element === document || handler_element === /** @type {any} */
|
||||
window)) {
|
||||
event.__root = handler_element;
|
||||
return;
|
||||
}
|
||||
var handler_idx = path.indexOf(handler_element);
|
||||
if (handler_idx === -1) {
|
||||
return;
|
||||
}
|
||||
if (at_idx <= handler_idx) {
|
||||
path_idx = at_idx;
|
||||
}
|
||||
}
|
||||
current_target = /** @type {Element} */
|
||||
path[path_idx] || event.target;
|
||||
if (current_target === handler_element) return;
|
||||
define_property(event, "currentTarget", {
|
||||
configurable: true,
|
||||
get() {
|
||||
return current_target || owner_document;
|
||||
}
|
||||
});
|
||||
var previous_reaction = active_reaction;
|
||||
var previous_effect = active_effect;
|
||||
set_active_reaction(null);
|
||||
set_active_effect(null);
|
||||
try {
|
||||
var throw_error;
|
||||
var other_errors = [];
|
||||
while (current_target !== null) {
|
||||
var parent_element = current_target.assignedSlot || current_target.parentNode || /** @type {any} */
|
||||
current_target.host || null;
|
||||
try {
|
||||
var delegated = current_target["__" + event_name];
|
||||
if (delegated != null && (!/** @type {any} */
|
||||
current_target.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
||||
// -> the target could not have been disabled because it emits the event in the first place
|
||||
event.target === current_target)) {
|
||||
delegated.call(current_target, event);
|
||||
}
|
||||
} catch (error) {
|
||||
if (throw_error) {
|
||||
other_errors.push(error);
|
||||
} else {
|
||||
throw_error = error;
|
||||
}
|
||||
}
|
||||
if (event.cancelBubble || parent_element === handler_element || parent_element === null) {
|
||||
break;
|
||||
}
|
||||
current_target = parent_element;
|
||||
}
|
||||
if (throw_error) {
|
||||
for (let error of other_errors) {
|
||||
queueMicrotask(() => {
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
throw throw_error;
|
||||
}
|
||||
} finally {
|
||||
event.__root = handler_element;
|
||||
delete event.currentTarget;
|
||||
set_active_reaction(previous_reaction);
|
||||
set_active_effect(previous_effect);
|
||||
}
|
||||
}
|
||||
function assign_nodes(start, end) {
|
||||
var effect = (
|
||||
/** @type {Effect} */
|
||||
active_effect
|
||||
);
|
||||
if (effect.nodes === null) {
|
||||
effect.nodes = { start, end, a: null, t: null };
|
||||
}
|
||||
}
|
||||
function mount(component, options2) {
|
||||
return _mount(component, options2);
|
||||
}
|
||||
function hydrate(component, options2) {
|
||||
init_operations();
|
||||
options2.intro = options2.intro ?? false;
|
||||
const target = options2.target;
|
||||
const was_hydrating = hydrating;
|
||||
const previous_hydrate_node = hydrate_node;
|
||||
try {
|
||||
var anchor = get_first_child(target);
|
||||
while (anchor && (anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */
|
||||
anchor.data !== HYDRATION_START)) {
|
||||
anchor = get_next_sibling(anchor);
|
||||
}
|
||||
if (!anchor) {
|
||||
throw HYDRATION_ERROR;
|
||||
}
|
||||
set_hydrating(true);
|
||||
set_hydrate_node(
|
||||
/** @type {Comment} */
|
||||
anchor
|
||||
);
|
||||
const instance = _mount(component, { ...options2, anchor });
|
||||
set_hydrating(false);
|
||||
return (
|
||||
/** @type {Exports} */
|
||||
instance
|
||||
);
|
||||
} catch (error) {
|
||||
if (error instanceof Error && error.message.split("\n").some((line) => line.startsWith("https://svelte.dev/e/"))) {
|
||||
throw error;
|
||||
}
|
||||
if (error !== HYDRATION_ERROR) {
|
||||
console.warn("Failed to hydrate: ", error);
|
||||
}
|
||||
if (options2.recover === false) {
|
||||
hydration_failed();
|
||||
}
|
||||
init_operations();
|
||||
clear_text_content(target);
|
||||
set_hydrating(false);
|
||||
return mount(component, options2);
|
||||
} finally {
|
||||
set_hydrating(was_hydrating);
|
||||
set_hydrate_node(previous_hydrate_node);
|
||||
}
|
||||
}
|
||||
const document_listeners = /* @__PURE__ */ new Map();
|
||||
function _mount(Component, { target, anchor, props = {}, events, context, intro = true }) {
|
||||
init_operations();
|
||||
var registered_events = /* @__PURE__ */ new Set();
|
||||
var event_handle = (events2) => {
|
||||
for (var i = 0; i < events2.length; i++) {
|
||||
var event_name = events2[i];
|
||||
if (registered_events.has(event_name)) continue;
|
||||
registered_events.add(event_name);
|
||||
var passive = is_passive_event(event_name);
|
||||
target.addEventListener(event_name, handle_event_propagation, { passive });
|
||||
var n = document_listeners.get(event_name);
|
||||
if (n === void 0) {
|
||||
document.addEventListener(event_name, handle_event_propagation, { passive });
|
||||
document_listeners.set(event_name, 1);
|
||||
} else {
|
||||
document_listeners.set(event_name, n + 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
event_handle(array_from(all_registered_events));
|
||||
root_event_handles.add(event_handle);
|
||||
var component = void 0;
|
||||
var unmount2 = component_root(() => {
|
||||
var anchor_node = anchor ?? target.appendChild(create_text());
|
||||
boundary(
|
||||
/** @type {TemplateNode} */
|
||||
anchor_node,
|
||||
{
|
||||
pending: () => {
|
||||
}
|
||||
},
|
||||
(anchor_node2) => {
|
||||
if (context) {
|
||||
push({});
|
||||
var ctx = (
|
||||
/** @type {ComponentContext} */
|
||||
component_context
|
||||
);
|
||||
ctx.c = context;
|
||||
}
|
||||
if (events) {
|
||||
props.$$events = events;
|
||||
}
|
||||
if (hydrating) {
|
||||
assign_nodes(
|
||||
/** @type {TemplateNode} */
|
||||
anchor_node2,
|
||||
null
|
||||
);
|
||||
}
|
||||
component = Component(anchor_node2, props) || {};
|
||||
if (hydrating) {
|
||||
active_effect.nodes.end = hydrate_node;
|
||||
if (hydrate_node === null || hydrate_node.nodeType !== COMMENT_NODE || /** @type {Comment} */
|
||||
hydrate_node.data !== HYDRATION_END) {
|
||||
hydration_mismatch();
|
||||
throw HYDRATION_ERROR;
|
||||
}
|
||||
}
|
||||
if (context) {
|
||||
pop();
|
||||
}
|
||||
}
|
||||
);
|
||||
return () => {
|
||||
for (var event_name of registered_events) {
|
||||
target.removeEventListener(event_name, handle_event_propagation);
|
||||
var n = (
|
||||
/** @type {number} */
|
||||
document_listeners.get(event_name)
|
||||
);
|
||||
if (--n === 0) {
|
||||
document.removeEventListener(event_name, handle_event_propagation);
|
||||
document_listeners.delete(event_name);
|
||||
} else {
|
||||
document_listeners.set(event_name, n);
|
||||
}
|
||||
}
|
||||
root_event_handles.delete(event_handle);
|
||||
if (anchor_node !== anchor) {
|
||||
anchor_node.parentNode?.removeChild(anchor_node);
|
||||
}
|
||||
};
|
||||
});
|
||||
mounted_components.set(component, unmount2);
|
||||
return component;
|
||||
}
|
||||
let mounted_components = /* @__PURE__ */ new WeakMap();
|
||||
function unmount(component, options2) {
|
||||
const fn = mounted_components.get(component);
|
||||
if (fn) {
|
||||
mounted_components.delete(component);
|
||||
return fn(options2);
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
function asClassComponent$1(component) {
|
||||
return class extends Svelte4Component {
|
||||
/** @param {any} options */
|
||||
constructor(options2) {
|
||||
super({
|
||||
component,
|
||||
...options2
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
class Svelte4Component {
|
||||
/** @type {any} */
|
||||
#events;
|
||||
/** @type {Record<string, any>} */
|
||||
#instance;
|
||||
/**
|
||||
* @param {ComponentConstructorOptions & {
|
||||
* component: any;
|
||||
* }} options
|
||||
*/
|
||||
constructor(options2) {
|
||||
var sources = /* @__PURE__ */ new Map();
|
||||
var add_source = (key, value) => {
|
||||
var s = mutable_source(value, false, false);
|
||||
sources.set(key, s);
|
||||
return s;
|
||||
};
|
||||
const props = new Proxy(
|
||||
{ ...options2.props || {}, $$events: {} },
|
||||
{
|
||||
get(target, prop) {
|
||||
return get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
|
||||
},
|
||||
has(target, prop) {
|
||||
if (prop === LEGACY_PROPS) return true;
|
||||
get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
|
||||
return Reflect.has(target, prop);
|
||||
},
|
||||
set(target, prop, value) {
|
||||
set(sources.get(prop) ?? add_source(prop, value), value);
|
||||
return Reflect.set(target, prop, value);
|
||||
}
|
||||
}
|
||||
);
|
||||
this.#instance = (options2.hydrate ? hydrate : mount)(options2.component, {
|
||||
target: options2.target,
|
||||
anchor: options2.anchor,
|
||||
props,
|
||||
context: options2.context,
|
||||
intro: options2.intro ?? false,
|
||||
recover: options2.recover
|
||||
});
|
||||
if (!options2?.props?.$$host || options2.sync === false) {
|
||||
flushSync();
|
||||
}
|
||||
this.#events = props.$$events;
|
||||
for (const key of Object.keys(this.#instance)) {
|
||||
if (key === "$set" || key === "$destroy" || key === "$on") continue;
|
||||
define_property(this, key, {
|
||||
get() {
|
||||
return this.#instance[key];
|
||||
},
|
||||
/** @param {any} value */
|
||||
set(value) {
|
||||
this.#instance[key] = value;
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
}
|
||||
this.#instance.$set = /** @param {Record<string, any>} next */
|
||||
(next2) => {
|
||||
Object.assign(props, next2);
|
||||
};
|
||||
this.#instance.$destroy = () => {
|
||||
unmount(this.#instance);
|
||||
};
|
||||
}
|
||||
/** @param {Record<string, any>} props */
|
||||
$set(props) {
|
||||
this.#instance.$set(props);
|
||||
}
|
||||
/**
|
||||
* @param {string} event
|
||||
* @param {(...args: any[]) => any} callback
|
||||
* @returns {any}
|
||||
*/
|
||||
$on(event, callback) {
|
||||
this.#events[event] = this.#events[event] || [];
|
||||
const cb = (...args) => callback.call(this, ...args);
|
||||
this.#events[event].push(cb);
|
||||
return () => {
|
||||
this.#events[event] = this.#events[event].filter(
|
||||
/** @param {any} fn */
|
||||
(fn) => fn !== cb
|
||||
);
|
||||
};
|
||||
}
|
||||
$destroy() {
|
||||
this.#instance.$destroy();
|
||||
}
|
||||
}
|
||||
let read_implementation = null;
|
||||
function set_read_implementation(fn) {
|
||||
read_implementation = fn;
|
||||
}
|
||||
function set_manifest(_) {
|
||||
}
|
||||
function asClassComponent(component) {
|
||||
const component_constructor = asClassComponent$1(component);
|
||||
const _render = (props, { context, csp } = {}) => {
|
||||
const result = render(component, { props, context, csp });
|
||||
const munged = Object.defineProperties(
|
||||
/** @type {LegacyRenderResult & PromiseLike<LegacyRenderResult>} */
|
||||
{},
|
||||
{
|
||||
css: {
|
||||
value: { code: "", map: null }
|
||||
},
|
||||
head: {
|
||||
get: () => result.head
|
||||
},
|
||||
html: {
|
||||
get: () => result.body
|
||||
},
|
||||
then: {
|
||||
/**
|
||||
* this is not type-safe, but honestly it's the best I can do right now, and it's a straightforward function.
|
||||
*
|
||||
* @template TResult1
|
||||
* @template [TResult2=never]
|
||||
* @param { (value: LegacyRenderResult) => TResult1 } onfulfilled
|
||||
* @param { (reason: unknown) => TResult2 } onrejected
|
||||
*/
|
||||
value: (onfulfilled, onrejected) => {
|
||||
{
|
||||
const user_result = onfulfilled({
|
||||
css: munged.css,
|
||||
head: munged.head,
|
||||
html: munged.html
|
||||
});
|
||||
return Promise.resolve(user_result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
return munged;
|
||||
};
|
||||
component_constructor.render = _render;
|
||||
return component_constructor;
|
||||
}
|
||||
function Root($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let {
|
||||
stores,
|
||||
page,
|
||||
constructors,
|
||||
components = [],
|
||||
form,
|
||||
data_0 = null,
|
||||
data_1 = null
|
||||
} = $$props;
|
||||
{
|
||||
setContext("__svelte__", stores);
|
||||
}
|
||||
{
|
||||
stores.page.set(page);
|
||||
}
|
||||
const Pyramid_1 = constructors[1];
|
||||
if (constructors[1]) {
|
||||
$$renderer2.push("<!--[-->");
|
||||
const Pyramid_0 = constructors[0];
|
||||
$$renderer2.push(`<!---->`);
|
||||
Pyramid_0($$renderer2, {
|
||||
data: data_0,
|
||||
form,
|
||||
params: page.params,
|
||||
children: ($$renderer3) => {
|
||||
$$renderer3.push(`<!---->`);
|
||||
Pyramid_1($$renderer3, { data: data_1, form, params: page.params });
|
||||
$$renderer3.push(`<!---->`);
|
||||
},
|
||||
$$slots: { default: true }
|
||||
});
|
||||
$$renderer2.push(`<!---->`);
|
||||
} else {
|
||||
$$renderer2.push("<!--[!-->");
|
||||
const Pyramid_0 = constructors[0];
|
||||
$$renderer2.push(`<!---->`);
|
||||
Pyramid_0($$renderer2, { data: data_0, form, params: page.params });
|
||||
$$renderer2.push(`<!---->`);
|
||||
}
|
||||
$$renderer2.push(`<!--]--> `);
|
||||
{
|
||||
$$renderer2.push("<!--[!-->");
|
||||
}
|
||||
$$renderer2.push(`<!--]-->`);
|
||||
});
|
||||
}
|
||||
const root = asClassComponent(Root);
|
||||
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: "1uq6ubj"
|
||||
};
|
||||
async function get_hooks() {
|
||||
let handle;
|
||||
let handleFetch;
|
||||
let handleError;
|
||||
let handleValidationError;
|
||||
let init;
|
||||
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
|
||||
};
|
||||
522
frontend/.svelte-kit/output/server/chunks/shared.js
Normal file
522
frontend/.svelte-kit/output/server/chunks/shared.js
Normal file
@@ -0,0 +1,522 @@
|
||||
import * as devalue from "devalue";
|
||||
import { t as text_decoder, b as base64_encode, c as base64_decode } from "./utils.js";
|
||||
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;
|
||||
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 new Error("Could not deserialize binary form: no body");
|
||||
}
|
||||
const reader = request.body.getReader();
|
||||
const chunks = [];
|
||||
async 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 buffer = new Uint8Array(length);
|
||||
buffer.set(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);
|
||||
}
|
||||
buffer.set(chunk, cursor);
|
||||
cursor += chunk.byteLength;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
const header = await get_buffer(0, 1 + 4 + 2);
|
||||
if (!header) throw new Error("Could not deserialize binary form: too short");
|
||||
if (header[0] !== BINARY_FORM_VERSION) {
|
||||
throw new Error(
|
||||
`Could not deserialize binary form: 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);
|
||||
const file_offsets_length = header_view.getUint16(5, true);
|
||||
const data_buffer = await get_buffer(1 + 4 + 2, data_length);
|
||||
if (!data_buffer) throw new Error("Could not deserialize binary form: data too short");
|
||||
let file_offsets;
|
||||
let files_start_offset;
|
||||
if (file_offsets_length > 0) {
|
||||
const file_offsets_buffer = await get_buffer(1 + 4 + 2 + data_length, file_offsets_length);
|
||||
if (!file_offsets_buffer)
|
||||
throw new Error("Could not deserialize binary form: file offset table too short");
|
||||
file_offsets = /** @type {Array<number>} */
|
||||
JSON.parse(text_decoder.decode(file_offsets_buffer));
|
||||
files_start_offset = 1 + 4 + 2 + data_length + file_offsets_length;
|
||||
}
|
||||
const [data, meta] = devalue.parse(text_decoder.decode(data_buffer), {
|
||||
File: ([name, type, size, last_modified, index]) => {
|
||||
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 };
|
||||
}
|
||||
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("Could not deserialize binary form: 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 = key in current;
|
||||
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;
|
||||
}
|
||||
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 {
|
||||
BINARY_FORM_CONTENT_TYPE as B,
|
||||
INVALIDATED_PARAM as I,
|
||||
TRAILING_SLASH_PARAM as T,
|
||||
stringify_remote_arg as a,
|
||||
create_field_proxy as b,
|
||||
create_remote_key as c,
|
||||
deserialize_binary_form as d,
|
||||
set_nested_value as e,
|
||||
flatten_issues as f,
|
||||
deep_set as g,
|
||||
normalize_issue as n,
|
||||
parse_remote_arg as p,
|
||||
stringify as s
|
||||
};
|
||||
44
frontend/.svelte-kit/output/server/chunks/stores.js
Normal file
44
frontend/.svelte-kit/output/server/chunks/stores.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import { a0 as getContext } from "./index2.js";
|
||||
import "clsx";
|
||||
import "@sveltejs/kit/internal";
|
||||
import "./exports.js";
|
||||
import "./utils.js";
|
||||
import "@sveltejs/kit/internal/server";
|
||||
import { n as noop } from "./equality.js";
|
||||
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 getStores = () => {
|
||||
const stores = getContext("__svelte__");
|
||||
return {
|
||||
/** @type {typeof page} */
|
||||
page: {
|
||||
subscribe: stores.page.subscribe
|
||||
},
|
||||
/** @type {typeof navigating} */
|
||||
navigating: {
|
||||
subscribe: stores.navigating.subscribe
|
||||
},
|
||||
/** @type {typeof updated} */
|
||||
updated: stores.updated
|
||||
};
|
||||
};
|
||||
const page = {
|
||||
subscribe(fn) {
|
||||
const store = getStores().page;
|
||||
return store.subscribe(fn);
|
||||
}
|
||||
};
|
||||
export {
|
||||
page as p
|
||||
};
|
||||
16
frontend/.svelte-kit/output/server/chunks/toasts.js
Normal file
16
frontend/.svelte-kit/output/server/chunks/toasts.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { w as writable } from "./index.js";
|
||||
const toasts = writable([]);
|
||||
function addToast(message, type = "info", duration = 3e3) {
|
||||
const id = Math.random().toString(36).substr(2, 9);
|
||||
console.log(`[toasts.addToast][Action] Adding toast context={{'id': '${id}', 'type': '${type}', 'message': '${message}'}}`);
|
||||
toasts.update((all) => [...all, { id, message, type }]);
|
||||
setTimeout(() => removeToast(id), duration);
|
||||
}
|
||||
function removeToast(id) {
|
||||
console.log(`[toasts.removeToast][Action] Removing toast context={{'id': '${id}'}}`);
|
||||
toasts.update((all) => all.filter((t) => t.id !== id));
|
||||
}
|
||||
export {
|
||||
addToast as a,
|
||||
toasts as t
|
||||
};
|
||||
43
frontend/.svelte-kit/output/server/chunks/utils.js
Normal file
43
frontend/.svelte-kit/output/server/chunks/utils.js
Normal file
@@ -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 {
|
||||
text_encoder as a,
|
||||
base64_encode as b,
|
||||
base64_decode as c,
|
||||
get_relative_path as g,
|
||||
text_decoder as t
|
||||
};
|
||||
Reference in New Issue
Block a user