@michalzard/svelte-forms 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/.github/workflows/main.yml +28 -0
- package/.github/workflows/publish.yml +42 -0
- package/CHANGELOG.md +7 -0
- package/README.md +15 -0
- package/bun.lock +276 -0
- package/dist/index.js +3605 -0
- package/dist/index.mjs +3573 -0
- package/index.ts +93 -0
- package/package.json +25 -0
- package/tsconfig.json +21 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,3605 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
6
|
+
var __toCommonJS = (from) => {
|
|
7
|
+
var entry = __moduleCache.get(from), desc;
|
|
8
|
+
if (entry)
|
|
9
|
+
return entry;
|
|
10
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
12
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
}));
|
|
16
|
+
__moduleCache.set(from, entry);
|
|
17
|
+
return entry;
|
|
18
|
+
};
|
|
19
|
+
var __export = (target, all) => {
|
|
20
|
+
for (var name in all)
|
|
21
|
+
__defProp(target, name, {
|
|
22
|
+
get: all[name],
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
set: (newValue) => all[name] = () => newValue
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// index.ts
|
|
30
|
+
var exports_svelte_forms = {};
|
|
31
|
+
__export(exports_svelte_forms, {
|
|
32
|
+
useForm: () => useForm
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(exports_svelte_forms);
|
|
35
|
+
|
|
36
|
+
// node_modules/esm-env/true.js
|
|
37
|
+
var true_default = true;
|
|
38
|
+
// node_modules/svelte/src/internal/shared/utils.js
|
|
39
|
+
var is_array = Array.isArray;
|
|
40
|
+
var index_of = Array.prototype.indexOf;
|
|
41
|
+
var includes = Array.prototype.includes;
|
|
42
|
+
var array_from = Array.from;
|
|
43
|
+
var object_keys = Object.keys;
|
|
44
|
+
var define_property = Object.defineProperty;
|
|
45
|
+
var get_descriptor = Object.getOwnPropertyDescriptor;
|
|
46
|
+
var object_prototype = Object.prototype;
|
|
47
|
+
var array_prototype = Array.prototype;
|
|
48
|
+
var get_prototype_of = Object.getPrototypeOf;
|
|
49
|
+
var is_extensible = Object.isExtensible;
|
|
50
|
+
var noop = () => {};
|
|
51
|
+
function run_all(arr) {
|
|
52
|
+
for (var i = 0;i < arr.length; i++) {
|
|
53
|
+
arr[i]();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function deferred() {
|
|
57
|
+
var resolve;
|
|
58
|
+
var reject;
|
|
59
|
+
var promise = new Promise((res, rej) => {
|
|
60
|
+
resolve = res;
|
|
61
|
+
reject = rej;
|
|
62
|
+
});
|
|
63
|
+
return { promise, resolve, reject };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// node_modules/svelte/src/internal/client/constants.js
|
|
67
|
+
var DERIVED = 1 << 1;
|
|
68
|
+
var EFFECT = 1 << 2;
|
|
69
|
+
var RENDER_EFFECT = 1 << 3;
|
|
70
|
+
var MANAGED_EFFECT = 1 << 24;
|
|
71
|
+
var BLOCK_EFFECT = 1 << 4;
|
|
72
|
+
var BRANCH_EFFECT = 1 << 5;
|
|
73
|
+
var ROOT_EFFECT = 1 << 6;
|
|
74
|
+
var BOUNDARY_EFFECT = 1 << 7;
|
|
75
|
+
var CONNECTED = 1 << 9;
|
|
76
|
+
var CLEAN = 1 << 10;
|
|
77
|
+
var DIRTY = 1 << 11;
|
|
78
|
+
var MAYBE_DIRTY = 1 << 12;
|
|
79
|
+
var INERT = 1 << 13;
|
|
80
|
+
var DESTROYED = 1 << 14;
|
|
81
|
+
var REACTION_RAN = 1 << 15;
|
|
82
|
+
var EFFECT_TRANSPARENT = 1 << 16;
|
|
83
|
+
var EAGER_EFFECT = 1 << 17;
|
|
84
|
+
var HEAD_EFFECT = 1 << 18;
|
|
85
|
+
var EFFECT_PRESERVED = 1 << 19;
|
|
86
|
+
var USER_EFFECT = 1 << 20;
|
|
87
|
+
var EFFECT_OFFSCREEN = 1 << 25;
|
|
88
|
+
var WAS_MARKED = 1 << 16;
|
|
89
|
+
var REACTION_IS_UPDATING = 1 << 21;
|
|
90
|
+
var ASYNC = 1 << 22;
|
|
91
|
+
var ERROR_VALUE = 1 << 23;
|
|
92
|
+
var STATE_SYMBOL = Symbol("$state");
|
|
93
|
+
var LEGACY_PROPS = Symbol("legacy props");
|
|
94
|
+
var LOADING_ATTR_SYMBOL = Symbol("");
|
|
95
|
+
var PROXY_PATH_SYMBOL = Symbol("proxy path");
|
|
96
|
+
var STALE_REACTION = new class StaleReactionError extends Error {
|
|
97
|
+
name = "StaleReactionError";
|
|
98
|
+
message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
|
|
99
|
+
};
|
|
100
|
+
var IS_XHTML = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
|
|
101
|
+
var COMMENT_NODE = 8;
|
|
102
|
+
|
|
103
|
+
// node_modules/svelte/src/internal/client/reactivity/equality.js
|
|
104
|
+
function equals(value) {
|
|
105
|
+
return value === this.v;
|
|
106
|
+
}
|
|
107
|
+
function safe_not_equal(a, b) {
|
|
108
|
+
return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function";
|
|
109
|
+
}
|
|
110
|
+
function safe_equals(value) {
|
|
111
|
+
return !safe_not_equal(value, this.v);
|
|
112
|
+
}
|
|
113
|
+
// node_modules/svelte/src/internal/client/errors.js
|
|
114
|
+
function derived_references_self() {
|
|
115
|
+
if (true_default) {
|
|
116
|
+
const error = new Error(`derived_references_self
|
|
117
|
+
A derived value cannot reference itself recursively
|
|
118
|
+
https://svelte.dev/e/derived_references_self`);
|
|
119
|
+
error.name = "Svelte error";
|
|
120
|
+
throw error;
|
|
121
|
+
} else {
|
|
122
|
+
throw new Error(`https://svelte.dev/e/derived_references_self`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function effect_update_depth_exceeded() {
|
|
126
|
+
if (true_default) {
|
|
127
|
+
const error = new Error(`effect_update_depth_exceeded
|
|
128
|
+
Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
|
|
129
|
+
https://svelte.dev/e/effect_update_depth_exceeded`);
|
|
130
|
+
error.name = "Svelte error";
|
|
131
|
+
throw error;
|
|
132
|
+
} else {
|
|
133
|
+
throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function hydration_failed() {
|
|
137
|
+
if (true_default) {
|
|
138
|
+
const error = new Error(`hydration_failed
|
|
139
|
+
Failed to hydrate the application
|
|
140
|
+
https://svelte.dev/e/hydration_failed`);
|
|
141
|
+
error.name = "Svelte error";
|
|
142
|
+
throw error;
|
|
143
|
+
} else {
|
|
144
|
+
throw new Error(`https://svelte.dev/e/hydration_failed`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function rune_outside_svelte(rune) {
|
|
148
|
+
if (true_default) {
|
|
149
|
+
const error = new Error(`rune_outside_svelte
|
|
150
|
+
The \`${rune}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
|
|
151
|
+
https://svelte.dev/e/rune_outside_svelte`);
|
|
152
|
+
error.name = "Svelte error";
|
|
153
|
+
throw error;
|
|
154
|
+
} else {
|
|
155
|
+
throw new Error(`https://svelte.dev/e/rune_outside_svelte`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function state_descriptors_fixed() {
|
|
159
|
+
if (true_default) {
|
|
160
|
+
const error = new Error(`state_descriptors_fixed
|
|
161
|
+
Property descriptors defined on \`$state\` objects must contain \`value\` and always be \`enumerable\`, \`configurable\` and \`writable\`.
|
|
162
|
+
https://svelte.dev/e/state_descriptors_fixed`);
|
|
163
|
+
error.name = "Svelte error";
|
|
164
|
+
throw error;
|
|
165
|
+
} else {
|
|
166
|
+
throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function state_prototype_fixed() {
|
|
170
|
+
if (true_default) {
|
|
171
|
+
const error = new Error(`state_prototype_fixed
|
|
172
|
+
Cannot set prototype of \`$state\` object
|
|
173
|
+
https://svelte.dev/e/state_prototype_fixed`);
|
|
174
|
+
error.name = "Svelte error";
|
|
175
|
+
throw error;
|
|
176
|
+
} else {
|
|
177
|
+
throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function state_unsafe_mutation() {
|
|
181
|
+
if (true_default) {
|
|
182
|
+
const error = new Error(`state_unsafe_mutation
|
|
183
|
+
Updating state inside \`$derived(...)\`, \`$inspect(...)\` or a template expression is forbidden. If the value should not be reactive, declare it without \`$state\`
|
|
184
|
+
https://svelte.dev/e/state_unsafe_mutation`);
|
|
185
|
+
error.name = "Svelte error";
|
|
186
|
+
throw error;
|
|
187
|
+
} else {
|
|
188
|
+
throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
function svelte_boundary_reset_onerror() {
|
|
192
|
+
if (true_default) {
|
|
193
|
+
const error = new Error(`svelte_boundary_reset_onerror
|
|
194
|
+
A \`<svelte:boundary>\` \`reset\` function cannot be called while an error is still being handled
|
|
195
|
+
https://svelte.dev/e/svelte_boundary_reset_onerror`);
|
|
196
|
+
error.name = "Svelte error";
|
|
197
|
+
throw error;
|
|
198
|
+
} else {
|
|
199
|
+
throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// node_modules/svelte/src/internal/flags/index.js
|
|
204
|
+
var async_mode_flag = false;
|
|
205
|
+
var legacy_mode_flag = false;
|
|
206
|
+
var tracing_mode_flag = false;
|
|
207
|
+
|
|
208
|
+
// node_modules/svelte/src/constants.js
|
|
209
|
+
var EACH_INDEX_REACTIVE = 1 << 1;
|
|
210
|
+
var EACH_IS_CONTROLLED = 1 << 2;
|
|
211
|
+
var EACH_IS_ANIMATED = 1 << 3;
|
|
212
|
+
var EACH_ITEM_IMMUTABLE = 1 << 4;
|
|
213
|
+
var PROPS_IS_RUNES = 1 << 1;
|
|
214
|
+
var PROPS_IS_UPDATED = 1 << 2;
|
|
215
|
+
var PROPS_IS_BINDABLE = 1 << 3;
|
|
216
|
+
var PROPS_IS_LAZY_INITIAL = 1 << 4;
|
|
217
|
+
var TRANSITION_OUT = 1 << 1;
|
|
218
|
+
var TRANSITION_GLOBAL = 1 << 2;
|
|
219
|
+
var TEMPLATE_USE_IMPORT_NODE = 1 << 1;
|
|
220
|
+
var TEMPLATE_USE_SVG = 1 << 2;
|
|
221
|
+
var TEMPLATE_USE_MATHML = 1 << 3;
|
|
222
|
+
var HYDRATION_START = "[";
|
|
223
|
+
var HYDRATION_START_ELSE = "[!";
|
|
224
|
+
var HYDRATION_START_FAILED = "[?";
|
|
225
|
+
var HYDRATION_END = "]";
|
|
226
|
+
var HYDRATION_ERROR = {};
|
|
227
|
+
var ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;
|
|
228
|
+
var ELEMENT_IS_INPUT = 1 << 2;
|
|
229
|
+
var UNINITIALIZED = Symbol();
|
|
230
|
+
var FILENAME = Symbol("filename");
|
|
231
|
+
var HMR = Symbol("hmr");
|
|
232
|
+
var NAMESPACE_HTML = "http://www.w3.org/1999/xhtml";
|
|
233
|
+
|
|
234
|
+
// node_modules/svelte/src/internal/client/dev/tracing.js
|
|
235
|
+
var tracing_expressions = null;
|
|
236
|
+
function tag(source, label) {
|
|
237
|
+
source.label = label;
|
|
238
|
+
tag_proxy(source.v, label);
|
|
239
|
+
return source;
|
|
240
|
+
}
|
|
241
|
+
function tag_proxy(value, label) {
|
|
242
|
+
value?.[PROXY_PATH_SYMBOL]?.(label);
|
|
243
|
+
return value;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// node_modules/svelte/src/internal/shared/dev.js
|
|
247
|
+
function get_error(label) {
|
|
248
|
+
const error = new Error;
|
|
249
|
+
const stack = get_stack();
|
|
250
|
+
if (stack.length === 0) {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
stack.unshift(`
|
|
254
|
+
`);
|
|
255
|
+
define_property(error, "stack", {
|
|
256
|
+
value: stack.join(`
|
|
257
|
+
`)
|
|
258
|
+
});
|
|
259
|
+
define_property(error, "name", {
|
|
260
|
+
value: label
|
|
261
|
+
});
|
|
262
|
+
return error;
|
|
263
|
+
}
|
|
264
|
+
function get_stack() {
|
|
265
|
+
const limit = Error.stackTraceLimit;
|
|
266
|
+
Error.stackTraceLimit = Infinity;
|
|
267
|
+
const stack = new Error().stack;
|
|
268
|
+
Error.stackTraceLimit = limit;
|
|
269
|
+
if (!stack)
|
|
270
|
+
return [];
|
|
271
|
+
const lines = stack.split(`
|
|
272
|
+
`);
|
|
273
|
+
const new_lines = [];
|
|
274
|
+
for (let i = 0;i < lines.length; i++) {
|
|
275
|
+
const line = lines[i];
|
|
276
|
+
const posixified = line.replaceAll("\\", "/");
|
|
277
|
+
if (line.trim() === "Error") {
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
if (line.includes("validate_each_keys")) {
|
|
281
|
+
return [];
|
|
282
|
+
}
|
|
283
|
+
if (posixified.includes("svelte/src/internal") || posixified.includes("node_modules/.vite")) {
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
new_lines.push(line);
|
|
287
|
+
}
|
|
288
|
+
return new_lines;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// node_modules/svelte/src/internal/client/context.js
|
|
292
|
+
var component_context = null;
|
|
293
|
+
function set_component_context(context) {
|
|
294
|
+
component_context = context;
|
|
295
|
+
}
|
|
296
|
+
var dev_stack = null;
|
|
297
|
+
function set_dev_stack(stack) {
|
|
298
|
+
dev_stack = stack;
|
|
299
|
+
}
|
|
300
|
+
var dev_current_component_function = null;
|
|
301
|
+
function set_dev_current_component_function(fn) {
|
|
302
|
+
dev_current_component_function = fn;
|
|
303
|
+
}
|
|
304
|
+
function push(props, runes = false, fn) {
|
|
305
|
+
component_context = {
|
|
306
|
+
p: component_context,
|
|
307
|
+
i: false,
|
|
308
|
+
c: null,
|
|
309
|
+
e: null,
|
|
310
|
+
s: props,
|
|
311
|
+
x: null,
|
|
312
|
+
l: legacy_mode_flag && !runes ? { s: null, u: null, $: [] } : null
|
|
313
|
+
};
|
|
314
|
+
if (true_default) {
|
|
315
|
+
component_context.function = fn;
|
|
316
|
+
dev_current_component_function = fn;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
function pop(component) {
|
|
320
|
+
var context = component_context;
|
|
321
|
+
var effects = context.e;
|
|
322
|
+
if (effects !== null) {
|
|
323
|
+
context.e = null;
|
|
324
|
+
for (var fn of effects) {
|
|
325
|
+
create_user_effect(fn);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
if (component !== undefined) {
|
|
329
|
+
context.x = component;
|
|
330
|
+
}
|
|
331
|
+
context.i = true;
|
|
332
|
+
component_context = context.p;
|
|
333
|
+
if (true_default) {
|
|
334
|
+
dev_current_component_function = component_context?.function ?? null;
|
|
335
|
+
}
|
|
336
|
+
return component ?? {};
|
|
337
|
+
}
|
|
338
|
+
function is_runes() {
|
|
339
|
+
return !legacy_mode_flag || component_context !== null && component_context.l === null;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// node_modules/svelte/src/internal/client/dom/task.js
|
|
343
|
+
var micro_tasks = [];
|
|
344
|
+
function run_micro_tasks() {
|
|
345
|
+
var tasks = micro_tasks;
|
|
346
|
+
micro_tasks = [];
|
|
347
|
+
run_all(tasks);
|
|
348
|
+
}
|
|
349
|
+
function queue_micro_task(fn) {
|
|
350
|
+
if (micro_tasks.length === 0 && !is_flushing_sync) {
|
|
351
|
+
var tasks = micro_tasks;
|
|
352
|
+
queueMicrotask(() => {
|
|
353
|
+
if (tasks === micro_tasks)
|
|
354
|
+
run_micro_tasks();
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
micro_tasks.push(fn);
|
|
358
|
+
}
|
|
359
|
+
function flush_tasks() {
|
|
360
|
+
while (micro_tasks.length > 0) {
|
|
361
|
+
run_micro_tasks();
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// node_modules/svelte/src/internal/client/warnings.js
|
|
366
|
+
var bold = "font-weight: bold";
|
|
367
|
+
var normal = "font-weight: normal";
|
|
368
|
+
function hydration_mismatch(location) {
|
|
369
|
+
if (true_default) {
|
|
370
|
+
console.warn(`%c[svelte] hydration_mismatch
|
|
371
|
+
%c${location ? `Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}` : "Hydration failed because the initial UI does not match what was rendered on the server"}
|
|
372
|
+
https://svelte.dev/e/hydration_mismatch`, bold, normal);
|
|
373
|
+
} else {
|
|
374
|
+
console.warn(`https://svelte.dev/e/hydration_mismatch`);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
function lifecycle_double_unmount() {
|
|
378
|
+
if (true_default) {
|
|
379
|
+
console.warn(`%c[svelte] lifecycle_double_unmount
|
|
380
|
+
%cTried to unmount a component that was not mounted
|
|
381
|
+
https://svelte.dev/e/lifecycle_double_unmount`, bold, normal);
|
|
382
|
+
} else {
|
|
383
|
+
console.warn(`https://svelte.dev/e/lifecycle_double_unmount`);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
function state_proxy_equality_mismatch(operator) {
|
|
387
|
+
if (true_default) {
|
|
388
|
+
console.warn(`%c[svelte] state_proxy_equality_mismatch
|
|
389
|
+
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${operator}\` will produce unexpected results
|
|
390
|
+
https://svelte.dev/e/state_proxy_equality_mismatch`, bold, normal);
|
|
391
|
+
} else {
|
|
392
|
+
console.warn(`https://svelte.dev/e/state_proxy_equality_mismatch`);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
function state_proxy_unmount() {
|
|
396
|
+
if (true_default) {
|
|
397
|
+
console.warn(`%c[svelte] state_proxy_unmount
|
|
398
|
+
%cTried to unmount a state proxy, rather than a component
|
|
399
|
+
https://svelte.dev/e/state_proxy_unmount`, bold, normal);
|
|
400
|
+
} else {
|
|
401
|
+
console.warn(`https://svelte.dev/e/state_proxy_unmount`);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
function svelte_boundary_reset_noop() {
|
|
405
|
+
if (true_default) {
|
|
406
|
+
console.warn(`%c[svelte] svelte_boundary_reset_noop
|
|
407
|
+
%cA \`<svelte:boundary>\` \`reset\` function only resets the boundary the first time it is called
|
|
408
|
+
https://svelte.dev/e/svelte_boundary_reset_noop`, bold, normal);
|
|
409
|
+
} else {
|
|
410
|
+
console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// node_modules/svelte/src/internal/client/dom/hydration.js
|
|
415
|
+
var hydrating = false;
|
|
416
|
+
function set_hydrating(value) {
|
|
417
|
+
hydrating = value;
|
|
418
|
+
}
|
|
419
|
+
var hydrate_node;
|
|
420
|
+
function set_hydrate_node(node) {
|
|
421
|
+
if (node === null) {
|
|
422
|
+
hydration_mismatch();
|
|
423
|
+
throw HYDRATION_ERROR;
|
|
424
|
+
}
|
|
425
|
+
return hydrate_node = node;
|
|
426
|
+
}
|
|
427
|
+
function hydrate_next() {
|
|
428
|
+
return set_hydrate_node(get_next_sibling(hydrate_node));
|
|
429
|
+
}
|
|
430
|
+
function next(count = 1) {
|
|
431
|
+
if (hydrating) {
|
|
432
|
+
var i = count;
|
|
433
|
+
var node = hydrate_node;
|
|
434
|
+
while (i--) {
|
|
435
|
+
node = get_next_sibling(node);
|
|
436
|
+
}
|
|
437
|
+
hydrate_node = node;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
function skip_nodes(remove = true) {
|
|
441
|
+
var depth = 0;
|
|
442
|
+
var node = hydrate_node;
|
|
443
|
+
while (true) {
|
|
444
|
+
if (node.nodeType === COMMENT_NODE) {
|
|
445
|
+
var data = node.data;
|
|
446
|
+
if (data === HYDRATION_END) {
|
|
447
|
+
if (depth === 0)
|
|
448
|
+
return node;
|
|
449
|
+
depth -= 1;
|
|
450
|
+
} else if (data === HYDRATION_START || data === HYDRATION_START_ELSE || data[0] === "[" && !isNaN(Number(data.slice(1)))) {
|
|
451
|
+
depth += 1;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
var next2 = get_next_sibling(node);
|
|
455
|
+
if (remove)
|
|
456
|
+
node.remove();
|
|
457
|
+
node = next2;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
// node_modules/svelte/src/internal/client/proxy.js
|
|
462
|
+
var regex_is_valid_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
|
|
463
|
+
function proxy(value) {
|
|
464
|
+
if (typeof value !== "object" || value === null || STATE_SYMBOL in value) {
|
|
465
|
+
return value;
|
|
466
|
+
}
|
|
467
|
+
const prototype = get_prototype_of(value);
|
|
468
|
+
if (prototype !== object_prototype && prototype !== array_prototype) {
|
|
469
|
+
return value;
|
|
470
|
+
}
|
|
471
|
+
var sources = new Map;
|
|
472
|
+
var is_proxied_array = is_array(value);
|
|
473
|
+
var version = state(0);
|
|
474
|
+
var stack = true_default && tracing_mode_flag ? get_error("created at") : null;
|
|
475
|
+
var parent_version = update_version;
|
|
476
|
+
var with_parent = (fn) => {
|
|
477
|
+
if (update_version === parent_version) {
|
|
478
|
+
return fn();
|
|
479
|
+
}
|
|
480
|
+
var reaction = active_reaction;
|
|
481
|
+
var version2 = update_version;
|
|
482
|
+
set_active_reaction(null);
|
|
483
|
+
set_update_version(parent_version);
|
|
484
|
+
var result = fn();
|
|
485
|
+
set_active_reaction(reaction);
|
|
486
|
+
set_update_version(version2);
|
|
487
|
+
return result;
|
|
488
|
+
};
|
|
489
|
+
if (is_proxied_array) {
|
|
490
|
+
sources.set("length", state(value.length, stack));
|
|
491
|
+
if (true_default) {
|
|
492
|
+
value = inspectable_array(value);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
var path = "";
|
|
496
|
+
let updating = false;
|
|
497
|
+
function update_path(new_path) {
|
|
498
|
+
if (updating)
|
|
499
|
+
return;
|
|
500
|
+
updating = true;
|
|
501
|
+
path = new_path;
|
|
502
|
+
tag(version, `${path} version`);
|
|
503
|
+
for (const [prop, source] of sources) {
|
|
504
|
+
tag(source, get_label(path, prop));
|
|
505
|
+
}
|
|
506
|
+
updating = false;
|
|
507
|
+
}
|
|
508
|
+
return new Proxy(value, {
|
|
509
|
+
defineProperty(_, prop, descriptor) {
|
|
510
|
+
if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) {
|
|
511
|
+
state_descriptors_fixed();
|
|
512
|
+
}
|
|
513
|
+
var s = sources.get(prop);
|
|
514
|
+
if (s === undefined) {
|
|
515
|
+
with_parent(() => {
|
|
516
|
+
var s2 = state(descriptor.value, stack);
|
|
517
|
+
sources.set(prop, s2);
|
|
518
|
+
if (true_default && typeof prop === "string") {
|
|
519
|
+
tag(s2, get_label(path, prop));
|
|
520
|
+
}
|
|
521
|
+
return s2;
|
|
522
|
+
});
|
|
523
|
+
} else {
|
|
524
|
+
set(s, descriptor.value, true);
|
|
525
|
+
}
|
|
526
|
+
return true;
|
|
527
|
+
},
|
|
528
|
+
deleteProperty(target, prop) {
|
|
529
|
+
var s = sources.get(prop);
|
|
530
|
+
if (s === undefined) {
|
|
531
|
+
if (prop in target) {
|
|
532
|
+
const s2 = with_parent(() => state(UNINITIALIZED, stack));
|
|
533
|
+
sources.set(prop, s2);
|
|
534
|
+
increment(version);
|
|
535
|
+
if (true_default) {
|
|
536
|
+
tag(s2, get_label(path, prop));
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
} else {
|
|
540
|
+
set(s, UNINITIALIZED);
|
|
541
|
+
increment(version);
|
|
542
|
+
}
|
|
543
|
+
return true;
|
|
544
|
+
},
|
|
545
|
+
get(target, prop, receiver) {
|
|
546
|
+
if (prop === STATE_SYMBOL) {
|
|
547
|
+
return value;
|
|
548
|
+
}
|
|
549
|
+
if (true_default && prop === PROXY_PATH_SYMBOL) {
|
|
550
|
+
return update_path;
|
|
551
|
+
}
|
|
552
|
+
var s = sources.get(prop);
|
|
553
|
+
var exists = prop in target;
|
|
554
|
+
if (s === undefined && (!exists || get_descriptor(target, prop)?.writable)) {
|
|
555
|
+
s = with_parent(() => {
|
|
556
|
+
var p = proxy(exists ? target[prop] : UNINITIALIZED);
|
|
557
|
+
var s2 = state(p, stack);
|
|
558
|
+
if (true_default) {
|
|
559
|
+
tag(s2, get_label(path, prop));
|
|
560
|
+
}
|
|
561
|
+
return s2;
|
|
562
|
+
});
|
|
563
|
+
sources.set(prop, s);
|
|
564
|
+
}
|
|
565
|
+
if (s !== undefined) {
|
|
566
|
+
var v = get(s);
|
|
567
|
+
return v === UNINITIALIZED ? undefined : v;
|
|
568
|
+
}
|
|
569
|
+
return Reflect.get(target, prop, receiver);
|
|
570
|
+
},
|
|
571
|
+
getOwnPropertyDescriptor(target, prop) {
|
|
572
|
+
var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
|
|
573
|
+
if (descriptor && "value" in descriptor) {
|
|
574
|
+
var s = sources.get(prop);
|
|
575
|
+
if (s)
|
|
576
|
+
descriptor.value = get(s);
|
|
577
|
+
} else if (descriptor === undefined) {
|
|
578
|
+
var source = sources.get(prop);
|
|
579
|
+
var value2 = source?.v;
|
|
580
|
+
if (source !== undefined && value2 !== UNINITIALIZED) {
|
|
581
|
+
return {
|
|
582
|
+
enumerable: true,
|
|
583
|
+
configurable: true,
|
|
584
|
+
value: value2,
|
|
585
|
+
writable: true
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
return descriptor;
|
|
590
|
+
},
|
|
591
|
+
has(target, prop) {
|
|
592
|
+
if (prop === STATE_SYMBOL) {
|
|
593
|
+
return true;
|
|
594
|
+
}
|
|
595
|
+
var s = sources.get(prop);
|
|
596
|
+
var has = s !== undefined && s.v !== UNINITIALIZED || Reflect.has(target, prop);
|
|
597
|
+
if (s !== undefined || active_effect !== null && (!has || get_descriptor(target, prop)?.writable)) {
|
|
598
|
+
if (s === undefined) {
|
|
599
|
+
s = with_parent(() => {
|
|
600
|
+
var p = has ? proxy(target[prop]) : UNINITIALIZED;
|
|
601
|
+
var s2 = state(p, stack);
|
|
602
|
+
if (true_default) {
|
|
603
|
+
tag(s2, get_label(path, prop));
|
|
604
|
+
}
|
|
605
|
+
return s2;
|
|
606
|
+
});
|
|
607
|
+
sources.set(prop, s);
|
|
608
|
+
}
|
|
609
|
+
var value2 = get(s);
|
|
610
|
+
if (value2 === UNINITIALIZED) {
|
|
611
|
+
return false;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return has;
|
|
615
|
+
},
|
|
616
|
+
set(target, prop, value2, receiver) {
|
|
617
|
+
var s = sources.get(prop);
|
|
618
|
+
var has = prop in target;
|
|
619
|
+
if (is_proxied_array && prop === "length") {
|
|
620
|
+
for (var i = value2;i < s.v; i += 1) {
|
|
621
|
+
var other_s = sources.get(i + "");
|
|
622
|
+
if (other_s !== undefined) {
|
|
623
|
+
set(other_s, UNINITIALIZED);
|
|
624
|
+
} else if (i in target) {
|
|
625
|
+
other_s = with_parent(() => state(UNINITIALIZED, stack));
|
|
626
|
+
sources.set(i + "", other_s);
|
|
627
|
+
if (true_default) {
|
|
628
|
+
tag(other_s, get_label(path, i));
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
if (s === undefined) {
|
|
634
|
+
if (!has || get_descriptor(target, prop)?.writable) {
|
|
635
|
+
s = with_parent(() => state(undefined, stack));
|
|
636
|
+
if (true_default) {
|
|
637
|
+
tag(s, get_label(path, prop));
|
|
638
|
+
}
|
|
639
|
+
set(s, proxy(value2));
|
|
640
|
+
sources.set(prop, s);
|
|
641
|
+
}
|
|
642
|
+
} else {
|
|
643
|
+
has = s.v !== UNINITIALIZED;
|
|
644
|
+
var p = with_parent(() => proxy(value2));
|
|
645
|
+
set(s, p);
|
|
646
|
+
}
|
|
647
|
+
var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
|
|
648
|
+
if (descriptor?.set) {
|
|
649
|
+
descriptor.set.call(receiver, value2);
|
|
650
|
+
}
|
|
651
|
+
if (!has) {
|
|
652
|
+
if (is_proxied_array && typeof prop === "string") {
|
|
653
|
+
var ls = sources.get("length");
|
|
654
|
+
var n = Number(prop);
|
|
655
|
+
if (Number.isInteger(n) && n >= ls.v) {
|
|
656
|
+
set(ls, n + 1);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
increment(version);
|
|
660
|
+
}
|
|
661
|
+
return true;
|
|
662
|
+
},
|
|
663
|
+
ownKeys(target) {
|
|
664
|
+
get(version);
|
|
665
|
+
var own_keys = Reflect.ownKeys(target).filter((key2) => {
|
|
666
|
+
var source2 = sources.get(key2);
|
|
667
|
+
return source2 === undefined || source2.v !== UNINITIALIZED;
|
|
668
|
+
});
|
|
669
|
+
for (var [key, source] of sources) {
|
|
670
|
+
if (source.v !== UNINITIALIZED && !(key in target)) {
|
|
671
|
+
own_keys.push(key);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
return own_keys;
|
|
675
|
+
},
|
|
676
|
+
setPrototypeOf() {
|
|
677
|
+
state_prototype_fixed();
|
|
678
|
+
}
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
function get_label(path, prop) {
|
|
682
|
+
if (typeof prop === "symbol")
|
|
683
|
+
return `${path}[Symbol(${prop.description ?? ""})]`;
|
|
684
|
+
if (regex_is_valid_identifier.test(prop))
|
|
685
|
+
return `${path}.${prop}`;
|
|
686
|
+
return /^\d+$/.test(prop) ? `${path}[${prop}]` : `${path}['${prop}']`;
|
|
687
|
+
}
|
|
688
|
+
function get_proxied_value(value) {
|
|
689
|
+
try {
|
|
690
|
+
if (value !== null && typeof value === "object" && STATE_SYMBOL in value) {
|
|
691
|
+
return value[STATE_SYMBOL];
|
|
692
|
+
}
|
|
693
|
+
} catch {}
|
|
694
|
+
return value;
|
|
695
|
+
}
|
|
696
|
+
var ARRAY_MUTATING_METHODS = new Set([
|
|
697
|
+
"copyWithin",
|
|
698
|
+
"fill",
|
|
699
|
+
"pop",
|
|
700
|
+
"push",
|
|
701
|
+
"reverse",
|
|
702
|
+
"shift",
|
|
703
|
+
"sort",
|
|
704
|
+
"splice",
|
|
705
|
+
"unshift"
|
|
706
|
+
]);
|
|
707
|
+
function inspectable_array(array) {
|
|
708
|
+
return new Proxy(array, {
|
|
709
|
+
get(target, prop, receiver) {
|
|
710
|
+
var value = Reflect.get(target, prop, receiver);
|
|
711
|
+
if (!ARRAY_MUTATING_METHODS.has(prop)) {
|
|
712
|
+
return value;
|
|
713
|
+
}
|
|
714
|
+
return function(...args) {
|
|
715
|
+
set_eager_effects_deferred();
|
|
716
|
+
var result = value.apply(this, args);
|
|
717
|
+
flush_eager_effects();
|
|
718
|
+
return result;
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
// node_modules/svelte/src/internal/client/dev/equality.js
|
|
725
|
+
function init_array_prototype_warnings() {
|
|
726
|
+
const array_prototype2 = Array.prototype;
|
|
727
|
+
const cleanup = Array.__svelte_cleanup;
|
|
728
|
+
if (cleanup) {
|
|
729
|
+
cleanup();
|
|
730
|
+
}
|
|
731
|
+
const { indexOf, lastIndexOf, includes: includes2 } = array_prototype2;
|
|
732
|
+
array_prototype2.indexOf = function(item, from_index) {
|
|
733
|
+
const index = indexOf.call(this, item, from_index);
|
|
734
|
+
if (index === -1) {
|
|
735
|
+
for (let i = from_index ?? 0;i < this.length; i += 1) {
|
|
736
|
+
if (get_proxied_value(this[i]) === item) {
|
|
737
|
+
state_proxy_equality_mismatch("array.indexOf(...)");
|
|
738
|
+
break;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
return index;
|
|
743
|
+
};
|
|
744
|
+
array_prototype2.lastIndexOf = function(item, from_index) {
|
|
745
|
+
const index = lastIndexOf.call(this, item, from_index ?? this.length - 1);
|
|
746
|
+
if (index === -1) {
|
|
747
|
+
for (let i = 0;i <= (from_index ?? this.length - 1); i += 1) {
|
|
748
|
+
if (get_proxied_value(this[i]) === item) {
|
|
749
|
+
state_proxy_equality_mismatch("array.lastIndexOf(...)");
|
|
750
|
+
break;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
return index;
|
|
755
|
+
};
|
|
756
|
+
array_prototype2.includes = function(item, from_index) {
|
|
757
|
+
const has = includes2.call(this, item, from_index);
|
|
758
|
+
if (!has) {
|
|
759
|
+
for (let i = 0;i < this.length; i += 1) {
|
|
760
|
+
if (get_proxied_value(this[i]) === item) {
|
|
761
|
+
state_proxy_equality_mismatch("array.includes(...)");
|
|
762
|
+
break;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
return has;
|
|
767
|
+
};
|
|
768
|
+
Array.__svelte_cleanup = () => {
|
|
769
|
+
array_prototype2.indexOf = indexOf;
|
|
770
|
+
array_prototype2.lastIndexOf = lastIndexOf;
|
|
771
|
+
array_prototype2.includes = includes2;
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
// node_modules/svelte/src/internal/client/dom/operations.js
|
|
776
|
+
var $window;
|
|
777
|
+
var $document;
|
|
778
|
+
var is_firefox;
|
|
779
|
+
var first_child_getter;
|
|
780
|
+
var next_sibling_getter;
|
|
781
|
+
function init_operations() {
|
|
782
|
+
if ($window !== undefined) {
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
$window = window;
|
|
786
|
+
$document = document;
|
|
787
|
+
is_firefox = /Firefox/.test(navigator.userAgent);
|
|
788
|
+
var element_prototype = Element.prototype;
|
|
789
|
+
var node_prototype = Node.prototype;
|
|
790
|
+
var text_prototype = Text.prototype;
|
|
791
|
+
first_child_getter = get_descriptor(node_prototype, "firstChild").get;
|
|
792
|
+
next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get;
|
|
793
|
+
if (is_extensible(element_prototype)) {
|
|
794
|
+
element_prototype.__click = undefined;
|
|
795
|
+
element_prototype.__className = undefined;
|
|
796
|
+
element_prototype.__attributes = null;
|
|
797
|
+
element_prototype.__style = undefined;
|
|
798
|
+
element_prototype.__e = undefined;
|
|
799
|
+
}
|
|
800
|
+
if (is_extensible(text_prototype)) {
|
|
801
|
+
text_prototype.__t = undefined;
|
|
802
|
+
}
|
|
803
|
+
if (true_default) {
|
|
804
|
+
element_prototype.__svelte_meta = null;
|
|
805
|
+
init_array_prototype_warnings();
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
function create_text(value = "") {
|
|
809
|
+
return document.createTextNode(value);
|
|
810
|
+
}
|
|
811
|
+
function get_first_child(node) {
|
|
812
|
+
return first_child_getter.call(node);
|
|
813
|
+
}
|
|
814
|
+
function get_next_sibling(node) {
|
|
815
|
+
return next_sibling_getter.call(node);
|
|
816
|
+
}
|
|
817
|
+
function clear_text_content(node) {
|
|
818
|
+
node.textContent = "";
|
|
819
|
+
}
|
|
820
|
+
function should_defer_append() {
|
|
821
|
+
if (!async_mode_flag)
|
|
822
|
+
return false;
|
|
823
|
+
if (eager_block_effects !== null)
|
|
824
|
+
return false;
|
|
825
|
+
var flags = active_effect.f;
|
|
826
|
+
return (flags & REACTION_RAN) !== 0;
|
|
827
|
+
}
|
|
828
|
+
function create_element(tag2, namespace, is) {
|
|
829
|
+
let options = is ? { is } : undefined;
|
|
830
|
+
return document.createElementNS(namespace ?? NAMESPACE_HTML, tag2, options);
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
// node_modules/svelte/src/internal/client/error-handling.js
|
|
834
|
+
var adjustments = new WeakMap;
|
|
835
|
+
function handle_error(error) {
|
|
836
|
+
var effect = active_effect;
|
|
837
|
+
if (effect === null) {
|
|
838
|
+
active_reaction.f |= ERROR_VALUE;
|
|
839
|
+
return error;
|
|
840
|
+
}
|
|
841
|
+
if (true_default && error instanceof Error && !adjustments.has(error)) {
|
|
842
|
+
adjustments.set(error, get_adjustments(error, effect));
|
|
843
|
+
}
|
|
844
|
+
if ((effect.f & REACTION_RAN) === 0 && (effect.f & EFFECT) === 0) {
|
|
845
|
+
if (true_default && !effect.parent && error instanceof Error) {
|
|
846
|
+
apply_adjustments(error);
|
|
847
|
+
}
|
|
848
|
+
throw error;
|
|
849
|
+
}
|
|
850
|
+
invoke_error_boundary(error, effect);
|
|
851
|
+
}
|
|
852
|
+
function invoke_error_boundary(error, effect) {
|
|
853
|
+
while (effect !== null) {
|
|
854
|
+
if ((effect.f & BOUNDARY_EFFECT) !== 0) {
|
|
855
|
+
if ((effect.f & REACTION_RAN) === 0) {
|
|
856
|
+
throw error;
|
|
857
|
+
}
|
|
858
|
+
try {
|
|
859
|
+
effect.b.error(error);
|
|
860
|
+
return;
|
|
861
|
+
} catch (e) {
|
|
862
|
+
error = e;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
effect = effect.parent;
|
|
866
|
+
}
|
|
867
|
+
if (true_default && error instanceof Error) {
|
|
868
|
+
apply_adjustments(error);
|
|
869
|
+
}
|
|
870
|
+
throw error;
|
|
871
|
+
}
|
|
872
|
+
function get_adjustments(error, effect) {
|
|
873
|
+
const message_descriptor = get_descriptor(error, "message");
|
|
874
|
+
if (message_descriptor && !message_descriptor.configurable)
|
|
875
|
+
return;
|
|
876
|
+
var indent = is_firefox ? " " : "\t";
|
|
877
|
+
var component_stack = `
|
|
878
|
+
${indent}in ${effect.fn?.name || "<unknown>"}`;
|
|
879
|
+
var context = effect.ctx;
|
|
880
|
+
while (context !== null) {
|
|
881
|
+
component_stack += `
|
|
882
|
+
${indent}in ${context.function?.[FILENAME].split("/").pop()}`;
|
|
883
|
+
context = context.p;
|
|
884
|
+
}
|
|
885
|
+
return {
|
|
886
|
+
message: error.message + `
|
|
887
|
+
${component_stack}
|
|
888
|
+
`,
|
|
889
|
+
stack: error.stack?.split(`
|
|
890
|
+
`).filter((line) => !line.includes("svelte/src/internal")).join(`
|
|
891
|
+
`)
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
function apply_adjustments(error) {
|
|
895
|
+
const adjusted = adjustments.get(error);
|
|
896
|
+
if (adjusted) {
|
|
897
|
+
define_property(error, "message", {
|
|
898
|
+
value: adjusted.message
|
|
899
|
+
});
|
|
900
|
+
define_property(error, "stack", {
|
|
901
|
+
value: adjusted.stack
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
// node_modules/svelte/src/internal/client/reactivity/status.js
|
|
907
|
+
var STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);
|
|
908
|
+
function set_signal_status(signal, status) {
|
|
909
|
+
signal.f = signal.f & STATUS_MASK | status;
|
|
910
|
+
}
|
|
911
|
+
function update_derived_status(derived) {
|
|
912
|
+
if ((derived.f & CONNECTED) !== 0 || derived.deps === null) {
|
|
913
|
+
set_signal_status(derived, CLEAN);
|
|
914
|
+
} else {
|
|
915
|
+
set_signal_status(derived, MAYBE_DIRTY);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
// node_modules/svelte/src/internal/client/reactivity/utils.js
|
|
920
|
+
function clear_marked(deps) {
|
|
921
|
+
if (deps === null)
|
|
922
|
+
return;
|
|
923
|
+
for (const dep of deps) {
|
|
924
|
+
if ((dep.f & DERIVED) === 0 || (dep.f & WAS_MARKED) === 0) {
|
|
925
|
+
continue;
|
|
926
|
+
}
|
|
927
|
+
dep.f ^= WAS_MARKED;
|
|
928
|
+
clear_marked(dep.deps);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
|
|
932
|
+
if ((effect.f & DIRTY) !== 0) {
|
|
933
|
+
dirty_effects.add(effect);
|
|
934
|
+
} else if ((effect.f & MAYBE_DIRTY) !== 0) {
|
|
935
|
+
maybe_dirty_effects.add(effect);
|
|
936
|
+
}
|
|
937
|
+
clear_marked(effect.deps);
|
|
938
|
+
set_signal_status(effect, CLEAN);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
// node_modules/svelte/src/internal/client/reactivity/batch.js
|
|
942
|
+
var batches = new Set;
|
|
943
|
+
var current_batch = null;
|
|
944
|
+
var previous_batch = null;
|
|
945
|
+
var batch_values = null;
|
|
946
|
+
var queued_root_effects = [];
|
|
947
|
+
var last_scheduled_effect = null;
|
|
948
|
+
var is_flushing_sync = false;
|
|
949
|
+
var collected_effects = null;
|
|
950
|
+
|
|
951
|
+
class Batch {
|
|
952
|
+
current = new Map;
|
|
953
|
+
previous = new Map;
|
|
954
|
+
#commit_callbacks = new Set;
|
|
955
|
+
#discard_callbacks = new Set;
|
|
956
|
+
#pending = 0;
|
|
957
|
+
#blocking_pending = 0;
|
|
958
|
+
#deferred = null;
|
|
959
|
+
#dirty_effects = new Set;
|
|
960
|
+
#maybe_dirty_effects = new Set;
|
|
961
|
+
#skipped_branches = new Map;
|
|
962
|
+
is_fork = false;
|
|
963
|
+
#decrement_queued = false;
|
|
964
|
+
#is_deferred() {
|
|
965
|
+
return this.is_fork || this.#blocking_pending > 0;
|
|
966
|
+
}
|
|
967
|
+
skip_effect(effect) {
|
|
968
|
+
if (!this.#skipped_branches.has(effect)) {
|
|
969
|
+
this.#skipped_branches.set(effect, { d: [], m: [] });
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
unskip_effect(effect) {
|
|
973
|
+
var tracked = this.#skipped_branches.get(effect);
|
|
974
|
+
if (tracked) {
|
|
975
|
+
this.#skipped_branches.delete(effect);
|
|
976
|
+
for (var e of tracked.d) {
|
|
977
|
+
set_signal_status(e, DIRTY);
|
|
978
|
+
schedule_effect(e);
|
|
979
|
+
}
|
|
980
|
+
for (e of tracked.m) {
|
|
981
|
+
set_signal_status(e, MAYBE_DIRTY);
|
|
982
|
+
schedule_effect(e);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
process(root_effects) {
|
|
987
|
+
queued_root_effects = [];
|
|
988
|
+
this.apply();
|
|
989
|
+
var effects = collected_effects = [];
|
|
990
|
+
var render_effects = [];
|
|
991
|
+
for (const root of root_effects) {
|
|
992
|
+
this.#traverse_effect_tree(root, effects, render_effects);
|
|
993
|
+
}
|
|
994
|
+
collected_effects = null;
|
|
995
|
+
if (this.#is_deferred()) {
|
|
996
|
+
this.#defer_effects(render_effects);
|
|
997
|
+
this.#defer_effects(effects);
|
|
998
|
+
for (const [e, t] of this.#skipped_branches) {
|
|
999
|
+
reset_branch(e, t);
|
|
1000
|
+
}
|
|
1001
|
+
} else {
|
|
1002
|
+
previous_batch = this;
|
|
1003
|
+
current_batch = null;
|
|
1004
|
+
for (const fn of this.#commit_callbacks)
|
|
1005
|
+
fn(this);
|
|
1006
|
+
this.#commit_callbacks.clear();
|
|
1007
|
+
if (this.#pending === 0) {
|
|
1008
|
+
this.#commit();
|
|
1009
|
+
}
|
|
1010
|
+
flush_queued_effects(render_effects);
|
|
1011
|
+
flush_queued_effects(effects);
|
|
1012
|
+
this.#dirty_effects.clear();
|
|
1013
|
+
this.#maybe_dirty_effects.clear();
|
|
1014
|
+
previous_batch = null;
|
|
1015
|
+
this.#deferred?.resolve();
|
|
1016
|
+
}
|
|
1017
|
+
batch_values = null;
|
|
1018
|
+
}
|
|
1019
|
+
#traverse_effect_tree(root, effects, render_effects) {
|
|
1020
|
+
root.f ^= CLEAN;
|
|
1021
|
+
var effect = root.first;
|
|
1022
|
+
while (effect !== null) {
|
|
1023
|
+
var flags = effect.f;
|
|
1024
|
+
var is_branch = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;
|
|
1025
|
+
var is_skippable_branch = is_branch && (flags & CLEAN) !== 0;
|
|
1026
|
+
var skip = is_skippable_branch || (flags & INERT) !== 0 || this.#skipped_branches.has(effect);
|
|
1027
|
+
if (!skip && effect.fn !== null) {
|
|
1028
|
+
if (is_branch) {
|
|
1029
|
+
effect.f ^= CLEAN;
|
|
1030
|
+
} else if ((flags & EFFECT) !== 0) {
|
|
1031
|
+
effects.push(effect);
|
|
1032
|
+
} else if (async_mode_flag && (flags & (RENDER_EFFECT | MANAGED_EFFECT)) !== 0) {
|
|
1033
|
+
render_effects.push(effect);
|
|
1034
|
+
} else if (is_dirty(effect)) {
|
|
1035
|
+
if ((flags & BLOCK_EFFECT) !== 0)
|
|
1036
|
+
this.#maybe_dirty_effects.add(effect);
|
|
1037
|
+
update_effect(effect);
|
|
1038
|
+
}
|
|
1039
|
+
var child = effect.first;
|
|
1040
|
+
if (child !== null) {
|
|
1041
|
+
effect = child;
|
|
1042
|
+
continue;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
while (effect !== null) {
|
|
1046
|
+
var next2 = effect.next;
|
|
1047
|
+
if (next2 !== null) {
|
|
1048
|
+
effect = next2;
|
|
1049
|
+
break;
|
|
1050
|
+
}
|
|
1051
|
+
effect = effect.parent;
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
#defer_effects(effects) {
|
|
1056
|
+
for (var i = 0;i < effects.length; i += 1) {
|
|
1057
|
+
defer_effect(effects[i], this.#dirty_effects, this.#maybe_dirty_effects);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
capture(source2, value) {
|
|
1061
|
+
if (value !== UNINITIALIZED && !this.previous.has(source2)) {
|
|
1062
|
+
this.previous.set(source2, value);
|
|
1063
|
+
}
|
|
1064
|
+
if ((source2.f & ERROR_VALUE) === 0) {
|
|
1065
|
+
this.current.set(source2, source2.v);
|
|
1066
|
+
batch_values?.set(source2, source2.v);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
activate() {
|
|
1070
|
+
current_batch = this;
|
|
1071
|
+
this.apply();
|
|
1072
|
+
}
|
|
1073
|
+
deactivate() {
|
|
1074
|
+
if (current_batch !== this)
|
|
1075
|
+
return;
|
|
1076
|
+
current_batch = null;
|
|
1077
|
+
batch_values = null;
|
|
1078
|
+
}
|
|
1079
|
+
flush() {
|
|
1080
|
+
if (queued_root_effects.length > 0) {
|
|
1081
|
+
current_batch = this;
|
|
1082
|
+
flush_effects();
|
|
1083
|
+
} else if (this.#pending === 0 && !this.is_fork) {
|
|
1084
|
+
for (const fn of this.#commit_callbacks)
|
|
1085
|
+
fn(this);
|
|
1086
|
+
this.#commit_callbacks.clear();
|
|
1087
|
+
this.#commit();
|
|
1088
|
+
this.#deferred?.resolve();
|
|
1089
|
+
}
|
|
1090
|
+
this.deactivate();
|
|
1091
|
+
}
|
|
1092
|
+
discard() {
|
|
1093
|
+
for (const fn of this.#discard_callbacks)
|
|
1094
|
+
fn(this);
|
|
1095
|
+
this.#discard_callbacks.clear();
|
|
1096
|
+
}
|
|
1097
|
+
#commit() {
|
|
1098
|
+
if (batches.size > 1) {
|
|
1099
|
+
this.previous.clear();
|
|
1100
|
+
var previous_batch2 = current_batch;
|
|
1101
|
+
var previous_batch_values = batch_values;
|
|
1102
|
+
var is_earlier = true;
|
|
1103
|
+
for (const batch of batches) {
|
|
1104
|
+
if (batch === this) {
|
|
1105
|
+
is_earlier = false;
|
|
1106
|
+
continue;
|
|
1107
|
+
}
|
|
1108
|
+
const sources = [];
|
|
1109
|
+
for (const [source2, value] of this.current) {
|
|
1110
|
+
if (batch.current.has(source2)) {
|
|
1111
|
+
if (is_earlier && value !== batch.current.get(source2)) {
|
|
1112
|
+
batch.current.set(source2, value);
|
|
1113
|
+
} else {
|
|
1114
|
+
continue;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
sources.push(source2);
|
|
1118
|
+
}
|
|
1119
|
+
if (sources.length === 0) {
|
|
1120
|
+
continue;
|
|
1121
|
+
}
|
|
1122
|
+
const others = [...batch.current.keys()].filter((s) => !this.current.has(s));
|
|
1123
|
+
if (others.length > 0) {
|
|
1124
|
+
var prev_queued_root_effects = queued_root_effects;
|
|
1125
|
+
queued_root_effects = [];
|
|
1126
|
+
const marked = new Set;
|
|
1127
|
+
const checked = new Map;
|
|
1128
|
+
for (const source2 of sources) {
|
|
1129
|
+
mark_effects(source2, others, marked, checked);
|
|
1130
|
+
}
|
|
1131
|
+
if (queued_root_effects.length > 0) {
|
|
1132
|
+
current_batch = batch;
|
|
1133
|
+
batch.apply();
|
|
1134
|
+
for (const root of queued_root_effects) {
|
|
1135
|
+
batch.#traverse_effect_tree(root, [], []);
|
|
1136
|
+
}
|
|
1137
|
+
batch.deactivate();
|
|
1138
|
+
}
|
|
1139
|
+
queued_root_effects = prev_queued_root_effects;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
current_batch = previous_batch2;
|
|
1143
|
+
batch_values = previous_batch_values;
|
|
1144
|
+
}
|
|
1145
|
+
this.#skipped_branches.clear();
|
|
1146
|
+
batches.delete(this);
|
|
1147
|
+
}
|
|
1148
|
+
increment(blocking) {
|
|
1149
|
+
this.#pending += 1;
|
|
1150
|
+
if (blocking)
|
|
1151
|
+
this.#blocking_pending += 1;
|
|
1152
|
+
}
|
|
1153
|
+
decrement(blocking) {
|
|
1154
|
+
this.#pending -= 1;
|
|
1155
|
+
if (blocking)
|
|
1156
|
+
this.#blocking_pending -= 1;
|
|
1157
|
+
if (this.#decrement_queued)
|
|
1158
|
+
return;
|
|
1159
|
+
this.#decrement_queued = true;
|
|
1160
|
+
queue_micro_task(() => {
|
|
1161
|
+
this.#decrement_queued = false;
|
|
1162
|
+
if (!this.#is_deferred()) {
|
|
1163
|
+
this.revive();
|
|
1164
|
+
} else if (queued_root_effects.length > 0) {
|
|
1165
|
+
this.flush();
|
|
1166
|
+
}
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
revive() {
|
|
1170
|
+
for (const e of this.#dirty_effects) {
|
|
1171
|
+
this.#maybe_dirty_effects.delete(e);
|
|
1172
|
+
set_signal_status(e, DIRTY);
|
|
1173
|
+
schedule_effect(e);
|
|
1174
|
+
}
|
|
1175
|
+
for (const e of this.#maybe_dirty_effects) {
|
|
1176
|
+
set_signal_status(e, MAYBE_DIRTY);
|
|
1177
|
+
schedule_effect(e);
|
|
1178
|
+
}
|
|
1179
|
+
this.flush();
|
|
1180
|
+
}
|
|
1181
|
+
oncommit(fn) {
|
|
1182
|
+
this.#commit_callbacks.add(fn);
|
|
1183
|
+
}
|
|
1184
|
+
ondiscard(fn) {
|
|
1185
|
+
this.#discard_callbacks.add(fn);
|
|
1186
|
+
}
|
|
1187
|
+
settled() {
|
|
1188
|
+
return (this.#deferred ??= deferred()).promise;
|
|
1189
|
+
}
|
|
1190
|
+
static ensure() {
|
|
1191
|
+
if (current_batch === null) {
|
|
1192
|
+
const batch = current_batch = new Batch;
|
|
1193
|
+
batches.add(current_batch);
|
|
1194
|
+
if (!is_flushing_sync) {
|
|
1195
|
+
queue_micro_task(() => {
|
|
1196
|
+
if (current_batch !== batch) {
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
batch.flush();
|
|
1200
|
+
});
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
return current_batch;
|
|
1204
|
+
}
|
|
1205
|
+
apply() {
|
|
1206
|
+
if (!async_mode_flag || !this.is_fork && batches.size === 1)
|
|
1207
|
+
return;
|
|
1208
|
+
batch_values = new Map(this.current);
|
|
1209
|
+
for (const batch of batches) {
|
|
1210
|
+
if (batch === this)
|
|
1211
|
+
continue;
|
|
1212
|
+
for (const [source2, previous] of batch.previous) {
|
|
1213
|
+
if (!batch_values.has(source2)) {
|
|
1214
|
+
batch_values.set(source2, previous);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
function flushSync(fn) {
|
|
1221
|
+
var was_flushing_sync = is_flushing_sync;
|
|
1222
|
+
is_flushing_sync = true;
|
|
1223
|
+
try {
|
|
1224
|
+
var result;
|
|
1225
|
+
if (fn) {
|
|
1226
|
+
if (current_batch !== null) {
|
|
1227
|
+
flush_effects();
|
|
1228
|
+
}
|
|
1229
|
+
result = fn();
|
|
1230
|
+
}
|
|
1231
|
+
while (true) {
|
|
1232
|
+
flush_tasks();
|
|
1233
|
+
if (queued_root_effects.length === 0) {
|
|
1234
|
+
current_batch?.flush();
|
|
1235
|
+
if (queued_root_effects.length === 0) {
|
|
1236
|
+
last_scheduled_effect = null;
|
|
1237
|
+
return result;
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
flush_effects();
|
|
1241
|
+
}
|
|
1242
|
+
} finally {
|
|
1243
|
+
is_flushing_sync = was_flushing_sync;
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
function flush_effects() {
|
|
1247
|
+
var source_stacks = true_default ? new Set : null;
|
|
1248
|
+
try {
|
|
1249
|
+
var flush_count = 0;
|
|
1250
|
+
while (queued_root_effects.length > 0) {
|
|
1251
|
+
var batch = Batch.ensure();
|
|
1252
|
+
if (flush_count++ > 1000) {
|
|
1253
|
+
if (true_default) {
|
|
1254
|
+
var updates = new Map;
|
|
1255
|
+
for (const source2 of batch.current.keys()) {
|
|
1256
|
+
for (const [stack, update2] of source2.updated ?? []) {
|
|
1257
|
+
var entry = updates.get(stack);
|
|
1258
|
+
if (!entry) {
|
|
1259
|
+
entry = { error: update2.error, count: 0 };
|
|
1260
|
+
updates.set(stack, entry);
|
|
1261
|
+
}
|
|
1262
|
+
entry.count += update2.count;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
for (const update2 of updates.values()) {
|
|
1266
|
+
if (update2.error) {
|
|
1267
|
+
console.error(update2.error);
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
infinite_loop_guard();
|
|
1272
|
+
}
|
|
1273
|
+
batch.process(queued_root_effects);
|
|
1274
|
+
old_values.clear();
|
|
1275
|
+
if (true_default) {
|
|
1276
|
+
for (const source2 of batch.current.keys()) {
|
|
1277
|
+
source_stacks.add(source2);
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
} finally {
|
|
1282
|
+
queued_root_effects = [];
|
|
1283
|
+
last_scheduled_effect = null;
|
|
1284
|
+
collected_effects = null;
|
|
1285
|
+
if (true_default) {
|
|
1286
|
+
for (const source2 of source_stacks) {
|
|
1287
|
+
source2.updated = null;
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
function infinite_loop_guard() {
|
|
1293
|
+
try {
|
|
1294
|
+
effect_update_depth_exceeded();
|
|
1295
|
+
} catch (error) {
|
|
1296
|
+
if (true_default) {
|
|
1297
|
+
define_property(error, "stack", { value: "" });
|
|
1298
|
+
}
|
|
1299
|
+
invoke_error_boundary(error, last_scheduled_effect);
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
var eager_block_effects = null;
|
|
1303
|
+
function flush_queued_effects(effects) {
|
|
1304
|
+
var length = effects.length;
|
|
1305
|
+
if (length === 0)
|
|
1306
|
+
return;
|
|
1307
|
+
var i = 0;
|
|
1308
|
+
while (i < length) {
|
|
1309
|
+
var effect = effects[i++];
|
|
1310
|
+
if ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) {
|
|
1311
|
+
eager_block_effects = new Set;
|
|
1312
|
+
update_effect(effect);
|
|
1313
|
+
if (effect.deps === null && effect.first === null && effect.nodes === null && effect.teardown === null && effect.ac === null) {
|
|
1314
|
+
unlink_effect(effect);
|
|
1315
|
+
}
|
|
1316
|
+
if (eager_block_effects?.size > 0) {
|
|
1317
|
+
old_values.clear();
|
|
1318
|
+
for (const e of eager_block_effects) {
|
|
1319
|
+
if ((e.f & (DESTROYED | INERT)) !== 0)
|
|
1320
|
+
continue;
|
|
1321
|
+
const ordered_effects = [e];
|
|
1322
|
+
let ancestor = e.parent;
|
|
1323
|
+
while (ancestor !== null) {
|
|
1324
|
+
if (eager_block_effects.has(ancestor)) {
|
|
1325
|
+
eager_block_effects.delete(ancestor);
|
|
1326
|
+
ordered_effects.push(ancestor);
|
|
1327
|
+
}
|
|
1328
|
+
ancestor = ancestor.parent;
|
|
1329
|
+
}
|
|
1330
|
+
for (let j = ordered_effects.length - 1;j >= 0; j--) {
|
|
1331
|
+
const e2 = ordered_effects[j];
|
|
1332
|
+
if ((e2.f & (DESTROYED | INERT)) !== 0)
|
|
1333
|
+
continue;
|
|
1334
|
+
update_effect(e2);
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
eager_block_effects.clear();
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
eager_block_effects = null;
|
|
1342
|
+
}
|
|
1343
|
+
function mark_effects(value, sources, marked, checked) {
|
|
1344
|
+
if (marked.has(value))
|
|
1345
|
+
return;
|
|
1346
|
+
marked.add(value);
|
|
1347
|
+
if (value.reactions !== null) {
|
|
1348
|
+
for (const reaction of value.reactions) {
|
|
1349
|
+
const flags = reaction.f;
|
|
1350
|
+
if ((flags & DERIVED) !== 0) {
|
|
1351
|
+
mark_effects(reaction, sources, marked, checked);
|
|
1352
|
+
} else if ((flags & (ASYNC | BLOCK_EFFECT)) !== 0 && (flags & DIRTY) === 0 && depends_on(reaction, sources, checked)) {
|
|
1353
|
+
set_signal_status(reaction, DIRTY);
|
|
1354
|
+
schedule_effect(reaction);
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
function depends_on(reaction, sources, checked) {
|
|
1360
|
+
const depends = checked.get(reaction);
|
|
1361
|
+
if (depends !== undefined)
|
|
1362
|
+
return depends;
|
|
1363
|
+
if (reaction.deps !== null) {
|
|
1364
|
+
for (const dep of reaction.deps) {
|
|
1365
|
+
if (includes.call(sources, dep)) {
|
|
1366
|
+
return true;
|
|
1367
|
+
}
|
|
1368
|
+
if ((dep.f & DERIVED) !== 0 && depends_on(dep, sources, checked)) {
|
|
1369
|
+
checked.set(dep, true);
|
|
1370
|
+
return true;
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
checked.set(reaction, false);
|
|
1375
|
+
return false;
|
|
1376
|
+
}
|
|
1377
|
+
function schedule_effect(signal) {
|
|
1378
|
+
var effect = last_scheduled_effect = signal;
|
|
1379
|
+
var boundary = effect.b;
|
|
1380
|
+
if (boundary?.is_pending && (signal.f & (EFFECT | RENDER_EFFECT | MANAGED_EFFECT)) !== 0 && (signal.f & REACTION_RAN) === 0) {
|
|
1381
|
+
boundary.defer_effect(signal);
|
|
1382
|
+
return;
|
|
1383
|
+
}
|
|
1384
|
+
while (effect.parent !== null) {
|
|
1385
|
+
effect = effect.parent;
|
|
1386
|
+
var flags = effect.f;
|
|
1387
|
+
if (collected_effects !== null && effect === active_effect) {
|
|
1388
|
+
if (async_mode_flag || (signal.f & RENDER_EFFECT) === 0) {
|
|
1389
|
+
return;
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
if ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {
|
|
1393
|
+
if ((flags & CLEAN) === 0) {
|
|
1394
|
+
return;
|
|
1395
|
+
}
|
|
1396
|
+
effect.f ^= CLEAN;
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
queued_root_effects.push(effect);
|
|
1400
|
+
}
|
|
1401
|
+
function reset_branch(effect, tracked) {
|
|
1402
|
+
if ((effect.f & BRANCH_EFFECT) !== 0 && (effect.f & CLEAN) !== 0) {
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1405
|
+
if ((effect.f & DIRTY) !== 0) {
|
|
1406
|
+
tracked.d.push(effect);
|
|
1407
|
+
} else if ((effect.f & MAYBE_DIRTY) !== 0) {
|
|
1408
|
+
tracked.m.push(effect);
|
|
1409
|
+
}
|
|
1410
|
+
set_signal_status(effect, CLEAN);
|
|
1411
|
+
var e = effect.first;
|
|
1412
|
+
while (e !== null) {
|
|
1413
|
+
reset_branch(e, tracked);
|
|
1414
|
+
e = e.next;
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
// node_modules/svelte/src/reactivity/create-subscriber.js
|
|
1419
|
+
function createSubscriber(start) {
|
|
1420
|
+
let subscribers = 0;
|
|
1421
|
+
let version = source(0);
|
|
1422
|
+
let stop;
|
|
1423
|
+
if (true_default) {
|
|
1424
|
+
tag(version, "createSubscriber version");
|
|
1425
|
+
}
|
|
1426
|
+
return () => {
|
|
1427
|
+
if (effect_tracking()) {
|
|
1428
|
+
get(version);
|
|
1429
|
+
render_effect(() => {
|
|
1430
|
+
if (subscribers === 0) {
|
|
1431
|
+
stop = untrack(() => start(() => increment(version)));
|
|
1432
|
+
}
|
|
1433
|
+
subscribers += 1;
|
|
1434
|
+
return () => {
|
|
1435
|
+
queue_micro_task(() => {
|
|
1436
|
+
subscribers -= 1;
|
|
1437
|
+
if (subscribers === 0) {
|
|
1438
|
+
stop?.();
|
|
1439
|
+
stop = undefined;
|
|
1440
|
+
increment(version);
|
|
1441
|
+
}
|
|
1442
|
+
});
|
|
1443
|
+
};
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
};
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
// node_modules/svelte/src/internal/client/dom/blocks/boundary.js
|
|
1450
|
+
var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED;
|
|
1451
|
+
function boundary(node, props, children, transform_error) {
|
|
1452
|
+
new Boundary(node, props, children, transform_error);
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
class Boundary {
|
|
1456
|
+
parent;
|
|
1457
|
+
is_pending = false;
|
|
1458
|
+
transform_error;
|
|
1459
|
+
#anchor;
|
|
1460
|
+
#hydrate_open = hydrating ? hydrate_node : null;
|
|
1461
|
+
#props;
|
|
1462
|
+
#children;
|
|
1463
|
+
#effect;
|
|
1464
|
+
#main_effect = null;
|
|
1465
|
+
#pending_effect = null;
|
|
1466
|
+
#failed_effect = null;
|
|
1467
|
+
#offscreen_fragment = null;
|
|
1468
|
+
#local_pending_count = 0;
|
|
1469
|
+
#pending_count = 0;
|
|
1470
|
+
#pending_count_update_queued = false;
|
|
1471
|
+
#dirty_effects = new Set;
|
|
1472
|
+
#maybe_dirty_effects = new Set;
|
|
1473
|
+
#effect_pending = null;
|
|
1474
|
+
#effect_pending_subscriber = createSubscriber(() => {
|
|
1475
|
+
this.#effect_pending = source(this.#local_pending_count);
|
|
1476
|
+
if (true_default) {
|
|
1477
|
+
tag(this.#effect_pending, "$effect.pending()");
|
|
1478
|
+
}
|
|
1479
|
+
return () => {
|
|
1480
|
+
this.#effect_pending = null;
|
|
1481
|
+
};
|
|
1482
|
+
});
|
|
1483
|
+
constructor(node, props, children, transform_error) {
|
|
1484
|
+
this.#anchor = node;
|
|
1485
|
+
this.#props = props;
|
|
1486
|
+
this.#children = (anchor) => {
|
|
1487
|
+
var effect = active_effect;
|
|
1488
|
+
effect.b = this;
|
|
1489
|
+
effect.f |= BOUNDARY_EFFECT;
|
|
1490
|
+
children(anchor);
|
|
1491
|
+
};
|
|
1492
|
+
this.parent = active_effect.b;
|
|
1493
|
+
this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);
|
|
1494
|
+
this.#effect = block(() => {
|
|
1495
|
+
if (hydrating) {
|
|
1496
|
+
const comment = this.#hydrate_open;
|
|
1497
|
+
hydrate_next();
|
|
1498
|
+
const server_rendered_pending = comment.data === HYDRATION_START_ELSE;
|
|
1499
|
+
const server_rendered_failed = comment.data.startsWith(HYDRATION_START_FAILED);
|
|
1500
|
+
if (server_rendered_failed) {
|
|
1501
|
+
const serialized_error = JSON.parse(comment.data.slice(HYDRATION_START_FAILED.length));
|
|
1502
|
+
this.#hydrate_failed_content(serialized_error);
|
|
1503
|
+
} else if (server_rendered_pending) {
|
|
1504
|
+
this.#hydrate_pending_content();
|
|
1505
|
+
} else {
|
|
1506
|
+
this.#hydrate_resolved_content();
|
|
1507
|
+
}
|
|
1508
|
+
} else {
|
|
1509
|
+
this.#render();
|
|
1510
|
+
}
|
|
1511
|
+
}, flags);
|
|
1512
|
+
if (hydrating) {
|
|
1513
|
+
this.#anchor = hydrate_node;
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
#hydrate_resolved_content() {
|
|
1517
|
+
try {
|
|
1518
|
+
this.#main_effect = branch(() => this.#children(this.#anchor));
|
|
1519
|
+
} catch (error) {
|
|
1520
|
+
this.error(error);
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
#hydrate_failed_content(error) {
|
|
1524
|
+
const failed = this.#props.failed;
|
|
1525
|
+
if (!failed)
|
|
1526
|
+
return;
|
|
1527
|
+
this.#failed_effect = branch(() => {
|
|
1528
|
+
failed(this.#anchor, () => error, () => () => {});
|
|
1529
|
+
});
|
|
1530
|
+
}
|
|
1531
|
+
#hydrate_pending_content() {
|
|
1532
|
+
const pending = this.#props.pending;
|
|
1533
|
+
if (!pending)
|
|
1534
|
+
return;
|
|
1535
|
+
this.is_pending = true;
|
|
1536
|
+
this.#pending_effect = branch(() => pending(this.#anchor));
|
|
1537
|
+
queue_micro_task(() => {
|
|
1538
|
+
var fragment = this.#offscreen_fragment = document.createDocumentFragment();
|
|
1539
|
+
var anchor = create_text();
|
|
1540
|
+
fragment.append(anchor);
|
|
1541
|
+
this.#main_effect = this.#run(() => {
|
|
1542
|
+
Batch.ensure();
|
|
1543
|
+
return branch(() => this.#children(anchor));
|
|
1544
|
+
});
|
|
1545
|
+
if (this.#pending_count === 0) {
|
|
1546
|
+
this.#anchor.before(fragment);
|
|
1547
|
+
this.#offscreen_fragment = null;
|
|
1548
|
+
pause_effect(this.#pending_effect, () => {
|
|
1549
|
+
this.#pending_effect = null;
|
|
1550
|
+
});
|
|
1551
|
+
this.#resolve();
|
|
1552
|
+
}
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
#render() {
|
|
1556
|
+
try {
|
|
1557
|
+
this.is_pending = this.has_pending_snippet();
|
|
1558
|
+
this.#pending_count = 0;
|
|
1559
|
+
this.#local_pending_count = 0;
|
|
1560
|
+
this.#main_effect = branch(() => {
|
|
1561
|
+
this.#children(this.#anchor);
|
|
1562
|
+
});
|
|
1563
|
+
if (this.#pending_count > 0) {
|
|
1564
|
+
var fragment = this.#offscreen_fragment = document.createDocumentFragment();
|
|
1565
|
+
move_effect(this.#main_effect, fragment);
|
|
1566
|
+
const pending = this.#props.pending;
|
|
1567
|
+
this.#pending_effect = branch(() => pending(this.#anchor));
|
|
1568
|
+
} else {
|
|
1569
|
+
this.#resolve();
|
|
1570
|
+
}
|
|
1571
|
+
} catch (error) {
|
|
1572
|
+
this.error(error);
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
#resolve() {
|
|
1576
|
+
this.is_pending = false;
|
|
1577
|
+
for (const e of this.#dirty_effects) {
|
|
1578
|
+
set_signal_status(e, DIRTY);
|
|
1579
|
+
schedule_effect(e);
|
|
1580
|
+
}
|
|
1581
|
+
for (const e of this.#maybe_dirty_effects) {
|
|
1582
|
+
set_signal_status(e, MAYBE_DIRTY);
|
|
1583
|
+
schedule_effect(e);
|
|
1584
|
+
}
|
|
1585
|
+
this.#dirty_effects.clear();
|
|
1586
|
+
this.#maybe_dirty_effects.clear();
|
|
1587
|
+
}
|
|
1588
|
+
defer_effect(effect) {
|
|
1589
|
+
defer_effect(effect, this.#dirty_effects, this.#maybe_dirty_effects);
|
|
1590
|
+
}
|
|
1591
|
+
is_rendered() {
|
|
1592
|
+
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
1593
|
+
}
|
|
1594
|
+
has_pending_snippet() {
|
|
1595
|
+
return !!this.#props.pending;
|
|
1596
|
+
}
|
|
1597
|
+
#run(fn) {
|
|
1598
|
+
var previous_effect = active_effect;
|
|
1599
|
+
var previous_reaction = active_reaction;
|
|
1600
|
+
var previous_ctx = component_context;
|
|
1601
|
+
set_active_effect(this.#effect);
|
|
1602
|
+
set_active_reaction(this.#effect);
|
|
1603
|
+
set_component_context(this.#effect.ctx);
|
|
1604
|
+
try {
|
|
1605
|
+
return fn();
|
|
1606
|
+
} catch (e) {
|
|
1607
|
+
handle_error(e);
|
|
1608
|
+
return null;
|
|
1609
|
+
} finally {
|
|
1610
|
+
set_active_effect(previous_effect);
|
|
1611
|
+
set_active_reaction(previous_reaction);
|
|
1612
|
+
set_component_context(previous_ctx);
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
#update_pending_count(d) {
|
|
1616
|
+
if (!this.has_pending_snippet()) {
|
|
1617
|
+
if (this.parent) {
|
|
1618
|
+
this.parent.#update_pending_count(d);
|
|
1619
|
+
}
|
|
1620
|
+
return;
|
|
1621
|
+
}
|
|
1622
|
+
this.#pending_count += d;
|
|
1623
|
+
if (this.#pending_count === 0) {
|
|
1624
|
+
this.#resolve();
|
|
1625
|
+
if (this.#pending_effect) {
|
|
1626
|
+
pause_effect(this.#pending_effect, () => {
|
|
1627
|
+
this.#pending_effect = null;
|
|
1628
|
+
});
|
|
1629
|
+
}
|
|
1630
|
+
if (this.#offscreen_fragment) {
|
|
1631
|
+
this.#anchor.before(this.#offscreen_fragment);
|
|
1632
|
+
this.#offscreen_fragment = null;
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
update_pending_count(d) {
|
|
1637
|
+
this.#update_pending_count(d);
|
|
1638
|
+
this.#local_pending_count += d;
|
|
1639
|
+
if (!this.#effect_pending || this.#pending_count_update_queued)
|
|
1640
|
+
return;
|
|
1641
|
+
this.#pending_count_update_queued = true;
|
|
1642
|
+
queue_micro_task(() => {
|
|
1643
|
+
this.#pending_count_update_queued = false;
|
|
1644
|
+
if (this.#effect_pending) {
|
|
1645
|
+
internal_set(this.#effect_pending, this.#local_pending_count);
|
|
1646
|
+
}
|
|
1647
|
+
});
|
|
1648
|
+
}
|
|
1649
|
+
get_effect_pending() {
|
|
1650
|
+
this.#effect_pending_subscriber();
|
|
1651
|
+
return get(this.#effect_pending);
|
|
1652
|
+
}
|
|
1653
|
+
error(error) {
|
|
1654
|
+
var onerror = this.#props.onerror;
|
|
1655
|
+
let failed = this.#props.failed;
|
|
1656
|
+
if (!onerror && !failed) {
|
|
1657
|
+
throw error;
|
|
1658
|
+
}
|
|
1659
|
+
if (this.#main_effect) {
|
|
1660
|
+
destroy_effect(this.#main_effect);
|
|
1661
|
+
this.#main_effect = null;
|
|
1662
|
+
}
|
|
1663
|
+
if (this.#pending_effect) {
|
|
1664
|
+
destroy_effect(this.#pending_effect);
|
|
1665
|
+
this.#pending_effect = null;
|
|
1666
|
+
}
|
|
1667
|
+
if (this.#failed_effect) {
|
|
1668
|
+
destroy_effect(this.#failed_effect);
|
|
1669
|
+
this.#failed_effect = null;
|
|
1670
|
+
}
|
|
1671
|
+
if (hydrating) {
|
|
1672
|
+
set_hydrate_node(this.#hydrate_open);
|
|
1673
|
+
next();
|
|
1674
|
+
set_hydrate_node(skip_nodes());
|
|
1675
|
+
}
|
|
1676
|
+
var did_reset = false;
|
|
1677
|
+
var calling_on_error = false;
|
|
1678
|
+
const reset = () => {
|
|
1679
|
+
if (did_reset) {
|
|
1680
|
+
svelte_boundary_reset_noop();
|
|
1681
|
+
return;
|
|
1682
|
+
}
|
|
1683
|
+
did_reset = true;
|
|
1684
|
+
if (calling_on_error) {
|
|
1685
|
+
svelte_boundary_reset_onerror();
|
|
1686
|
+
}
|
|
1687
|
+
if (this.#failed_effect !== null) {
|
|
1688
|
+
pause_effect(this.#failed_effect, () => {
|
|
1689
|
+
this.#failed_effect = null;
|
|
1690
|
+
});
|
|
1691
|
+
}
|
|
1692
|
+
this.#run(() => {
|
|
1693
|
+
Batch.ensure();
|
|
1694
|
+
this.#render();
|
|
1695
|
+
});
|
|
1696
|
+
};
|
|
1697
|
+
const handle_error_result = (transformed_error) => {
|
|
1698
|
+
try {
|
|
1699
|
+
calling_on_error = true;
|
|
1700
|
+
onerror?.(transformed_error, reset);
|
|
1701
|
+
calling_on_error = false;
|
|
1702
|
+
} catch (error2) {
|
|
1703
|
+
invoke_error_boundary(error2, this.#effect && this.#effect.parent);
|
|
1704
|
+
}
|
|
1705
|
+
if (failed) {
|
|
1706
|
+
this.#failed_effect = this.#run(() => {
|
|
1707
|
+
Batch.ensure();
|
|
1708
|
+
try {
|
|
1709
|
+
return branch(() => {
|
|
1710
|
+
var effect = active_effect;
|
|
1711
|
+
effect.b = this;
|
|
1712
|
+
effect.f |= BOUNDARY_EFFECT;
|
|
1713
|
+
failed(this.#anchor, () => transformed_error, () => reset);
|
|
1714
|
+
});
|
|
1715
|
+
} catch (error2) {
|
|
1716
|
+
invoke_error_boundary(error2, this.#effect.parent);
|
|
1717
|
+
return null;
|
|
1718
|
+
}
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
};
|
|
1722
|
+
queue_micro_task(() => {
|
|
1723
|
+
var result;
|
|
1724
|
+
try {
|
|
1725
|
+
result = this.transform_error(error);
|
|
1726
|
+
} catch (e) {
|
|
1727
|
+
invoke_error_boundary(e, this.#effect && this.#effect.parent);
|
|
1728
|
+
return;
|
|
1729
|
+
}
|
|
1730
|
+
if (result !== null && typeof result === "object" && typeof result.then === "function") {
|
|
1731
|
+
result.then(handle_error_result, (e) => invoke_error_boundary(e, this.#effect && this.#effect.parent));
|
|
1732
|
+
} else {
|
|
1733
|
+
handle_error_result(result);
|
|
1734
|
+
}
|
|
1735
|
+
});
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
// node_modules/svelte/src/internal/client/reactivity/deriveds.js
|
|
1740
|
+
var recent_async_deriveds = new Set;
|
|
1741
|
+
function destroy_derived_effects(derived2) {
|
|
1742
|
+
var effects = derived2.effects;
|
|
1743
|
+
if (effects !== null) {
|
|
1744
|
+
derived2.effects = null;
|
|
1745
|
+
for (var i = 0;i < effects.length; i += 1) {
|
|
1746
|
+
destroy_effect(effects[i]);
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
var stack = [];
|
|
1751
|
+
function get_derived_parent_effect(derived2) {
|
|
1752
|
+
var parent = derived2.parent;
|
|
1753
|
+
while (parent !== null) {
|
|
1754
|
+
if ((parent.f & DERIVED) === 0) {
|
|
1755
|
+
return (parent.f & DESTROYED) === 0 ? parent : null;
|
|
1756
|
+
}
|
|
1757
|
+
parent = parent.parent;
|
|
1758
|
+
}
|
|
1759
|
+
return null;
|
|
1760
|
+
}
|
|
1761
|
+
function execute_derived(derived2) {
|
|
1762
|
+
var value;
|
|
1763
|
+
var prev_active_effect = active_effect;
|
|
1764
|
+
set_active_effect(get_derived_parent_effect(derived2));
|
|
1765
|
+
if (true_default) {
|
|
1766
|
+
let prev_eager_effects = eager_effects;
|
|
1767
|
+
set_eager_effects(new Set);
|
|
1768
|
+
try {
|
|
1769
|
+
if (includes.call(stack, derived2)) {
|
|
1770
|
+
derived_references_self();
|
|
1771
|
+
}
|
|
1772
|
+
stack.push(derived2);
|
|
1773
|
+
derived2.f &= ~WAS_MARKED;
|
|
1774
|
+
destroy_derived_effects(derived2);
|
|
1775
|
+
value = update_reaction(derived2);
|
|
1776
|
+
} finally {
|
|
1777
|
+
set_active_effect(prev_active_effect);
|
|
1778
|
+
set_eager_effects(prev_eager_effects);
|
|
1779
|
+
stack.pop();
|
|
1780
|
+
}
|
|
1781
|
+
} else {
|
|
1782
|
+
try {
|
|
1783
|
+
derived2.f &= ~WAS_MARKED;
|
|
1784
|
+
destroy_derived_effects(derived2);
|
|
1785
|
+
value = update_reaction(derived2);
|
|
1786
|
+
} finally {
|
|
1787
|
+
set_active_effect(prev_active_effect);
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
return value;
|
|
1791
|
+
}
|
|
1792
|
+
function update_derived(derived2) {
|
|
1793
|
+
var value = execute_derived(derived2);
|
|
1794
|
+
if (!derived2.equals(value)) {
|
|
1795
|
+
derived2.wv = increment_write_version();
|
|
1796
|
+
if (!current_batch?.is_fork || derived2.deps === null) {
|
|
1797
|
+
derived2.v = value;
|
|
1798
|
+
if (derived2.deps === null) {
|
|
1799
|
+
set_signal_status(derived2, CLEAN);
|
|
1800
|
+
return;
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
if (is_destroying_effect) {
|
|
1805
|
+
return;
|
|
1806
|
+
}
|
|
1807
|
+
if (batch_values !== null) {
|
|
1808
|
+
if (effect_tracking() || current_batch?.is_fork) {
|
|
1809
|
+
batch_values.set(derived2, value);
|
|
1810
|
+
}
|
|
1811
|
+
} else {
|
|
1812
|
+
update_derived_status(derived2);
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
function freeze_derived_effects(derived2) {
|
|
1816
|
+
if (derived2.effects === null)
|
|
1817
|
+
return;
|
|
1818
|
+
for (const e of derived2.effects) {
|
|
1819
|
+
if (e.teardown || e.ac) {
|
|
1820
|
+
e.teardown?.();
|
|
1821
|
+
e.ac?.abort(STALE_REACTION);
|
|
1822
|
+
e.teardown = noop;
|
|
1823
|
+
e.ac = null;
|
|
1824
|
+
remove_reactions(e, 0);
|
|
1825
|
+
destroy_effect_children(e);
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
function unfreeze_derived_effects(derived2) {
|
|
1830
|
+
if (derived2.effects === null)
|
|
1831
|
+
return;
|
|
1832
|
+
for (const e of derived2.effects) {
|
|
1833
|
+
if (e.teardown) {
|
|
1834
|
+
update_effect(e);
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
// node_modules/svelte/src/internal/client/reactivity/sources.js
|
|
1840
|
+
var eager_effects = new Set;
|
|
1841
|
+
var old_values = new Map;
|
|
1842
|
+
function set_eager_effects(v) {
|
|
1843
|
+
eager_effects = v;
|
|
1844
|
+
}
|
|
1845
|
+
var eager_effects_deferred = false;
|
|
1846
|
+
function set_eager_effects_deferred() {
|
|
1847
|
+
eager_effects_deferred = true;
|
|
1848
|
+
}
|
|
1849
|
+
function source(v, stack2) {
|
|
1850
|
+
var signal = {
|
|
1851
|
+
f: 0,
|
|
1852
|
+
v,
|
|
1853
|
+
reactions: null,
|
|
1854
|
+
equals,
|
|
1855
|
+
rv: 0,
|
|
1856
|
+
wv: 0
|
|
1857
|
+
};
|
|
1858
|
+
if (true_default && tracing_mode_flag) {
|
|
1859
|
+
signal.created = stack2 ?? get_error("created at");
|
|
1860
|
+
signal.updated = null;
|
|
1861
|
+
signal.set_during_effect = false;
|
|
1862
|
+
signal.trace = null;
|
|
1863
|
+
}
|
|
1864
|
+
return signal;
|
|
1865
|
+
}
|
|
1866
|
+
function state(v, stack2) {
|
|
1867
|
+
const s = source(v, stack2);
|
|
1868
|
+
push_reaction_value(s);
|
|
1869
|
+
return s;
|
|
1870
|
+
}
|
|
1871
|
+
function mutable_source(initial_value, immutable = false, trackable = true) {
|
|
1872
|
+
const s = source(initial_value);
|
|
1873
|
+
if (!immutable) {
|
|
1874
|
+
s.equals = safe_equals;
|
|
1875
|
+
}
|
|
1876
|
+
if (legacy_mode_flag && trackable && component_context !== null && component_context.l !== null) {
|
|
1877
|
+
(component_context.l.s ??= []).push(s);
|
|
1878
|
+
}
|
|
1879
|
+
return s;
|
|
1880
|
+
}
|
|
1881
|
+
function set(source2, value, should_proxy = false) {
|
|
1882
|
+
if (active_reaction !== null && (!untracking || (active_reaction.f & EAGER_EFFECT) !== 0) && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | EAGER_EFFECT)) !== 0 && (current_sources === null || !includes.call(current_sources, source2))) {
|
|
1883
|
+
state_unsafe_mutation();
|
|
1884
|
+
}
|
|
1885
|
+
let new_value = should_proxy ? proxy(value) : value;
|
|
1886
|
+
if (true_default) {
|
|
1887
|
+
tag_proxy(new_value, source2.label);
|
|
1888
|
+
}
|
|
1889
|
+
return internal_set(source2, new_value);
|
|
1890
|
+
}
|
|
1891
|
+
function internal_set(source2, value) {
|
|
1892
|
+
if (!source2.equals(value)) {
|
|
1893
|
+
var old_value = source2.v;
|
|
1894
|
+
if (is_destroying_effect) {
|
|
1895
|
+
old_values.set(source2, value);
|
|
1896
|
+
} else {
|
|
1897
|
+
old_values.set(source2, old_value);
|
|
1898
|
+
}
|
|
1899
|
+
source2.v = value;
|
|
1900
|
+
var batch = Batch.ensure();
|
|
1901
|
+
batch.capture(source2, old_value);
|
|
1902
|
+
if (true_default) {
|
|
1903
|
+
if (tracing_mode_flag || active_effect !== null) {
|
|
1904
|
+
source2.updated ??= new Map;
|
|
1905
|
+
const count = (source2.updated.get("")?.count ?? 0) + 1;
|
|
1906
|
+
source2.updated.set("", { error: null, count });
|
|
1907
|
+
if (tracing_mode_flag || count > 5) {
|
|
1908
|
+
const error = get_error("updated at");
|
|
1909
|
+
if (error !== null) {
|
|
1910
|
+
let entry = source2.updated.get(error.stack);
|
|
1911
|
+
if (!entry) {
|
|
1912
|
+
entry = { error, count: 0 };
|
|
1913
|
+
source2.updated.set(error.stack, entry);
|
|
1914
|
+
}
|
|
1915
|
+
entry.count++;
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
if (active_effect !== null) {
|
|
1920
|
+
source2.set_during_effect = true;
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
if ((source2.f & DERIVED) !== 0) {
|
|
1924
|
+
const derived2 = source2;
|
|
1925
|
+
if ((source2.f & DIRTY) !== 0) {
|
|
1926
|
+
execute_derived(derived2);
|
|
1927
|
+
}
|
|
1928
|
+
update_derived_status(derived2);
|
|
1929
|
+
}
|
|
1930
|
+
source2.wv = increment_write_version();
|
|
1931
|
+
mark_reactions(source2, DIRTY);
|
|
1932
|
+
if (is_runes() && active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) {
|
|
1933
|
+
if (untracked_writes === null) {
|
|
1934
|
+
set_untracked_writes([source2]);
|
|
1935
|
+
} else {
|
|
1936
|
+
untracked_writes.push(source2);
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) {
|
|
1940
|
+
flush_eager_effects();
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
return value;
|
|
1944
|
+
}
|
|
1945
|
+
function flush_eager_effects() {
|
|
1946
|
+
eager_effects_deferred = false;
|
|
1947
|
+
for (const effect of eager_effects) {
|
|
1948
|
+
if ((effect.f & CLEAN) !== 0) {
|
|
1949
|
+
set_signal_status(effect, MAYBE_DIRTY);
|
|
1950
|
+
}
|
|
1951
|
+
if (is_dirty(effect)) {
|
|
1952
|
+
update_effect(effect);
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
eager_effects.clear();
|
|
1956
|
+
}
|
|
1957
|
+
function increment(source2) {
|
|
1958
|
+
set(source2, source2.v + 1);
|
|
1959
|
+
}
|
|
1960
|
+
function mark_reactions(signal, status) {
|
|
1961
|
+
var reactions = signal.reactions;
|
|
1962
|
+
if (reactions === null)
|
|
1963
|
+
return;
|
|
1964
|
+
var runes = is_runes();
|
|
1965
|
+
var length = reactions.length;
|
|
1966
|
+
for (var i = 0;i < length; i++) {
|
|
1967
|
+
var reaction = reactions[i];
|
|
1968
|
+
var flags2 = reaction.f;
|
|
1969
|
+
if (!runes && reaction === active_effect)
|
|
1970
|
+
continue;
|
|
1971
|
+
if (true_default && (flags2 & EAGER_EFFECT) !== 0) {
|
|
1972
|
+
eager_effects.add(reaction);
|
|
1973
|
+
continue;
|
|
1974
|
+
}
|
|
1975
|
+
var not_dirty = (flags2 & DIRTY) === 0;
|
|
1976
|
+
if (not_dirty) {
|
|
1977
|
+
set_signal_status(reaction, status);
|
|
1978
|
+
}
|
|
1979
|
+
if ((flags2 & DERIVED) !== 0) {
|
|
1980
|
+
var derived2 = reaction;
|
|
1981
|
+
batch_values?.delete(derived2);
|
|
1982
|
+
if ((flags2 & WAS_MARKED) === 0) {
|
|
1983
|
+
if (flags2 & CONNECTED) {
|
|
1984
|
+
reaction.f |= WAS_MARKED;
|
|
1985
|
+
}
|
|
1986
|
+
mark_reactions(derived2, MAYBE_DIRTY);
|
|
1987
|
+
}
|
|
1988
|
+
} else if (not_dirty) {
|
|
1989
|
+
if ((flags2 & BLOCK_EFFECT) !== 0 && eager_block_effects !== null) {
|
|
1990
|
+
eager_block_effects.add(reaction);
|
|
1991
|
+
}
|
|
1992
|
+
schedule_effect(reaction);
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
// node_modules/svelte/src/internal/client/legacy.js
|
|
1998
|
+
var captured_signals = null;
|
|
1999
|
+
|
|
2000
|
+
// node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
|
|
2001
|
+
function without_reactive_context(fn) {
|
|
2002
|
+
var previous_reaction = active_reaction;
|
|
2003
|
+
var previous_effect = active_effect;
|
|
2004
|
+
set_active_reaction(null);
|
|
2005
|
+
set_active_effect(null);
|
|
2006
|
+
try {
|
|
2007
|
+
return fn();
|
|
2008
|
+
} finally {
|
|
2009
|
+
set_active_reaction(previous_reaction);
|
|
2010
|
+
set_active_effect(previous_effect);
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
|
|
2014
|
+
// node_modules/svelte/src/internal/client/runtime.js
|
|
2015
|
+
var is_updating_effect = false;
|
|
2016
|
+
var is_destroying_effect = false;
|
|
2017
|
+
function set_is_destroying_effect(value) {
|
|
2018
|
+
is_destroying_effect = value;
|
|
2019
|
+
}
|
|
2020
|
+
var active_reaction = null;
|
|
2021
|
+
var untracking = false;
|
|
2022
|
+
function set_active_reaction(reaction) {
|
|
2023
|
+
active_reaction = reaction;
|
|
2024
|
+
}
|
|
2025
|
+
var active_effect = null;
|
|
2026
|
+
function set_active_effect(effect) {
|
|
2027
|
+
active_effect = effect;
|
|
2028
|
+
}
|
|
2029
|
+
var current_sources = null;
|
|
2030
|
+
function push_reaction_value(value) {
|
|
2031
|
+
if (active_reaction !== null && (!async_mode_flag || (active_reaction.f & DERIVED) !== 0)) {
|
|
2032
|
+
if (current_sources === null) {
|
|
2033
|
+
current_sources = [value];
|
|
2034
|
+
} else {
|
|
2035
|
+
current_sources.push(value);
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
var new_deps = null;
|
|
2040
|
+
var skipped_deps = 0;
|
|
2041
|
+
var untracked_writes = null;
|
|
2042
|
+
function set_untracked_writes(value) {
|
|
2043
|
+
untracked_writes = value;
|
|
2044
|
+
}
|
|
2045
|
+
var write_version = 1;
|
|
2046
|
+
var read_version = 0;
|
|
2047
|
+
var update_version = read_version;
|
|
2048
|
+
function set_update_version(value) {
|
|
2049
|
+
update_version = value;
|
|
2050
|
+
}
|
|
2051
|
+
function increment_write_version() {
|
|
2052
|
+
return ++write_version;
|
|
2053
|
+
}
|
|
2054
|
+
function is_dirty(reaction) {
|
|
2055
|
+
var flags2 = reaction.f;
|
|
2056
|
+
if ((flags2 & DIRTY) !== 0) {
|
|
2057
|
+
return true;
|
|
2058
|
+
}
|
|
2059
|
+
if (flags2 & DERIVED) {
|
|
2060
|
+
reaction.f &= ~WAS_MARKED;
|
|
2061
|
+
}
|
|
2062
|
+
if ((flags2 & MAYBE_DIRTY) !== 0) {
|
|
2063
|
+
var dependencies = reaction.deps;
|
|
2064
|
+
var length = dependencies.length;
|
|
2065
|
+
for (var i = 0;i < length; i++) {
|
|
2066
|
+
var dependency = dependencies[i];
|
|
2067
|
+
if (is_dirty(dependency)) {
|
|
2068
|
+
update_derived(dependency);
|
|
2069
|
+
}
|
|
2070
|
+
if (dependency.wv > reaction.wv) {
|
|
2071
|
+
return true;
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
if ((flags2 & CONNECTED) !== 0 && batch_values === null) {
|
|
2075
|
+
set_signal_status(reaction, CLEAN);
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
return false;
|
|
2079
|
+
}
|
|
2080
|
+
function schedule_possible_effect_self_invalidation(signal, effect, root = true) {
|
|
2081
|
+
var reactions = signal.reactions;
|
|
2082
|
+
if (reactions === null)
|
|
2083
|
+
return;
|
|
2084
|
+
if (!async_mode_flag && current_sources !== null && includes.call(current_sources, signal)) {
|
|
2085
|
+
return;
|
|
2086
|
+
}
|
|
2087
|
+
for (var i = 0;i < reactions.length; i++) {
|
|
2088
|
+
var reaction = reactions[i];
|
|
2089
|
+
if ((reaction.f & DERIVED) !== 0) {
|
|
2090
|
+
schedule_possible_effect_self_invalidation(reaction, effect, false);
|
|
2091
|
+
} else if (effect === reaction) {
|
|
2092
|
+
if (root) {
|
|
2093
|
+
set_signal_status(reaction, DIRTY);
|
|
2094
|
+
} else if ((reaction.f & CLEAN) !== 0) {
|
|
2095
|
+
set_signal_status(reaction, MAYBE_DIRTY);
|
|
2096
|
+
}
|
|
2097
|
+
schedule_effect(reaction);
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
function update_reaction(reaction) {
|
|
2102
|
+
var previous_deps = new_deps;
|
|
2103
|
+
var previous_skipped_deps = skipped_deps;
|
|
2104
|
+
var previous_untracked_writes = untracked_writes;
|
|
2105
|
+
var previous_reaction = active_reaction;
|
|
2106
|
+
var previous_sources = current_sources;
|
|
2107
|
+
var previous_component_context = component_context;
|
|
2108
|
+
var previous_untracking = untracking;
|
|
2109
|
+
var previous_update_version = update_version;
|
|
2110
|
+
var flags2 = reaction.f;
|
|
2111
|
+
new_deps = null;
|
|
2112
|
+
skipped_deps = 0;
|
|
2113
|
+
untracked_writes = null;
|
|
2114
|
+
active_reaction = (flags2 & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;
|
|
2115
|
+
current_sources = null;
|
|
2116
|
+
set_component_context(reaction.ctx);
|
|
2117
|
+
untracking = false;
|
|
2118
|
+
update_version = ++read_version;
|
|
2119
|
+
if (reaction.ac !== null) {
|
|
2120
|
+
without_reactive_context(() => {
|
|
2121
|
+
reaction.ac.abort(STALE_REACTION);
|
|
2122
|
+
});
|
|
2123
|
+
reaction.ac = null;
|
|
2124
|
+
}
|
|
2125
|
+
try {
|
|
2126
|
+
reaction.f |= REACTION_IS_UPDATING;
|
|
2127
|
+
var fn = reaction.fn;
|
|
2128
|
+
var result = fn();
|
|
2129
|
+
reaction.f |= REACTION_RAN;
|
|
2130
|
+
var deps = reaction.deps;
|
|
2131
|
+
var is_fork = current_batch?.is_fork;
|
|
2132
|
+
if (new_deps !== null) {
|
|
2133
|
+
var i;
|
|
2134
|
+
if (!is_fork) {
|
|
2135
|
+
remove_reactions(reaction, skipped_deps);
|
|
2136
|
+
}
|
|
2137
|
+
if (deps !== null && skipped_deps > 0) {
|
|
2138
|
+
deps.length = skipped_deps + new_deps.length;
|
|
2139
|
+
for (i = 0;i < new_deps.length; i++) {
|
|
2140
|
+
deps[skipped_deps + i] = new_deps[i];
|
|
2141
|
+
}
|
|
2142
|
+
} else {
|
|
2143
|
+
reaction.deps = deps = new_deps;
|
|
2144
|
+
}
|
|
2145
|
+
if (effect_tracking() && (reaction.f & CONNECTED) !== 0) {
|
|
2146
|
+
for (i = skipped_deps;i < deps.length; i++) {
|
|
2147
|
+
(deps[i].reactions ??= []).push(reaction);
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
} else if (!is_fork && deps !== null && skipped_deps < deps.length) {
|
|
2151
|
+
remove_reactions(reaction, skipped_deps);
|
|
2152
|
+
deps.length = skipped_deps;
|
|
2153
|
+
}
|
|
2154
|
+
if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0) {
|
|
2155
|
+
for (i = 0;i < untracked_writes.length; i++) {
|
|
2156
|
+
schedule_possible_effect_self_invalidation(untracked_writes[i], reaction);
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
if (previous_reaction !== null && previous_reaction !== reaction) {
|
|
2160
|
+
read_version++;
|
|
2161
|
+
if (previous_reaction.deps !== null) {
|
|
2162
|
+
for (let i2 = 0;i2 < previous_skipped_deps; i2 += 1) {
|
|
2163
|
+
previous_reaction.deps[i2].rv = read_version;
|
|
2164
|
+
}
|
|
2165
|
+
}
|
|
2166
|
+
if (previous_deps !== null) {
|
|
2167
|
+
for (const dep of previous_deps) {
|
|
2168
|
+
dep.rv = read_version;
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
if (untracked_writes !== null) {
|
|
2172
|
+
if (previous_untracked_writes === null) {
|
|
2173
|
+
previous_untracked_writes = untracked_writes;
|
|
2174
|
+
} else {
|
|
2175
|
+
previous_untracked_writes.push(...untracked_writes);
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
if ((reaction.f & ERROR_VALUE) !== 0) {
|
|
2180
|
+
reaction.f ^= ERROR_VALUE;
|
|
2181
|
+
}
|
|
2182
|
+
return result;
|
|
2183
|
+
} catch (error) {
|
|
2184
|
+
return handle_error(error);
|
|
2185
|
+
} finally {
|
|
2186
|
+
reaction.f ^= REACTION_IS_UPDATING;
|
|
2187
|
+
new_deps = previous_deps;
|
|
2188
|
+
skipped_deps = previous_skipped_deps;
|
|
2189
|
+
untracked_writes = previous_untracked_writes;
|
|
2190
|
+
active_reaction = previous_reaction;
|
|
2191
|
+
current_sources = previous_sources;
|
|
2192
|
+
set_component_context(previous_component_context);
|
|
2193
|
+
untracking = previous_untracking;
|
|
2194
|
+
update_version = previous_update_version;
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
function remove_reaction(signal, dependency) {
|
|
2198
|
+
let reactions = dependency.reactions;
|
|
2199
|
+
if (reactions !== null) {
|
|
2200
|
+
var index = index_of.call(reactions, signal);
|
|
2201
|
+
if (index !== -1) {
|
|
2202
|
+
var new_length = reactions.length - 1;
|
|
2203
|
+
if (new_length === 0) {
|
|
2204
|
+
reactions = dependency.reactions = null;
|
|
2205
|
+
} else {
|
|
2206
|
+
reactions[index] = reactions[new_length];
|
|
2207
|
+
reactions.pop();
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
if (reactions === null && (dependency.f & DERIVED) !== 0 && (new_deps === null || !includes.call(new_deps, dependency))) {
|
|
2212
|
+
var derived2 = dependency;
|
|
2213
|
+
if ((derived2.f & CONNECTED) !== 0) {
|
|
2214
|
+
derived2.f ^= CONNECTED;
|
|
2215
|
+
derived2.f &= ~WAS_MARKED;
|
|
2216
|
+
}
|
|
2217
|
+
update_derived_status(derived2);
|
|
2218
|
+
freeze_derived_effects(derived2);
|
|
2219
|
+
remove_reactions(derived2, 0);
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
function remove_reactions(signal, start_index) {
|
|
2223
|
+
var dependencies = signal.deps;
|
|
2224
|
+
if (dependencies === null)
|
|
2225
|
+
return;
|
|
2226
|
+
for (var i = start_index;i < dependencies.length; i++) {
|
|
2227
|
+
remove_reaction(signal, dependencies[i]);
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
function update_effect(effect) {
|
|
2231
|
+
var flags2 = effect.f;
|
|
2232
|
+
if ((flags2 & DESTROYED) !== 0) {
|
|
2233
|
+
return;
|
|
2234
|
+
}
|
|
2235
|
+
set_signal_status(effect, CLEAN);
|
|
2236
|
+
var previous_effect = active_effect;
|
|
2237
|
+
var was_updating_effect = is_updating_effect;
|
|
2238
|
+
active_effect = effect;
|
|
2239
|
+
is_updating_effect = true;
|
|
2240
|
+
if (true_default) {
|
|
2241
|
+
var previous_component_fn = dev_current_component_function;
|
|
2242
|
+
set_dev_current_component_function(effect.component_function);
|
|
2243
|
+
var previous_stack = dev_stack;
|
|
2244
|
+
set_dev_stack(effect.dev_stack ?? dev_stack);
|
|
2245
|
+
}
|
|
2246
|
+
try {
|
|
2247
|
+
if ((flags2 & (BLOCK_EFFECT | MANAGED_EFFECT)) !== 0) {
|
|
2248
|
+
destroy_block_effect_children(effect);
|
|
2249
|
+
} else {
|
|
2250
|
+
destroy_effect_children(effect);
|
|
2251
|
+
}
|
|
2252
|
+
execute_effect_teardown(effect);
|
|
2253
|
+
var teardown2 = update_reaction(effect);
|
|
2254
|
+
effect.teardown = typeof teardown2 === "function" ? teardown2 : null;
|
|
2255
|
+
effect.wv = write_version;
|
|
2256
|
+
if (true_default && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) {
|
|
2257
|
+
for (var dep of effect.deps) {
|
|
2258
|
+
if (dep.set_during_effect) {
|
|
2259
|
+
dep.wv = increment_write_version();
|
|
2260
|
+
dep.set_during_effect = false;
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
} finally {
|
|
2265
|
+
is_updating_effect = was_updating_effect;
|
|
2266
|
+
active_effect = previous_effect;
|
|
2267
|
+
if (true_default) {
|
|
2268
|
+
set_dev_current_component_function(previous_component_fn);
|
|
2269
|
+
set_dev_stack(previous_stack);
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
function get(signal) {
|
|
2274
|
+
var flags2 = signal.f;
|
|
2275
|
+
var is_derived = (flags2 & DERIVED) !== 0;
|
|
2276
|
+
captured_signals?.add(signal);
|
|
2277
|
+
if (active_reaction !== null && !untracking) {
|
|
2278
|
+
var destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;
|
|
2279
|
+
if (!destroyed && (current_sources === null || !includes.call(current_sources, signal))) {
|
|
2280
|
+
var deps = active_reaction.deps;
|
|
2281
|
+
if ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {
|
|
2282
|
+
if (signal.rv < read_version) {
|
|
2283
|
+
signal.rv = read_version;
|
|
2284
|
+
if (new_deps === null && deps !== null && deps[skipped_deps] === signal) {
|
|
2285
|
+
skipped_deps++;
|
|
2286
|
+
} else if (new_deps === null) {
|
|
2287
|
+
new_deps = [signal];
|
|
2288
|
+
} else {
|
|
2289
|
+
new_deps.push(signal);
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
} else {
|
|
2293
|
+
(active_reaction.deps ??= []).push(signal);
|
|
2294
|
+
var reactions = signal.reactions;
|
|
2295
|
+
if (reactions === null) {
|
|
2296
|
+
signal.reactions = [active_reaction];
|
|
2297
|
+
} else if (!includes.call(reactions, active_reaction)) {
|
|
2298
|
+
reactions.push(active_reaction);
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
if (true_default) {
|
|
2304
|
+
recent_async_deriveds.delete(signal);
|
|
2305
|
+
if (tracing_mode_flag && !untracking && tracing_expressions !== null && active_reaction !== null && tracing_expressions.reaction === active_reaction) {
|
|
2306
|
+
if (signal.trace) {
|
|
2307
|
+
signal.trace();
|
|
2308
|
+
} else {
|
|
2309
|
+
var trace = get_error("traced at");
|
|
2310
|
+
if (trace) {
|
|
2311
|
+
var entry = tracing_expressions.entries.get(signal);
|
|
2312
|
+
if (entry === undefined) {
|
|
2313
|
+
entry = { traces: [] };
|
|
2314
|
+
tracing_expressions.entries.set(signal, entry);
|
|
2315
|
+
}
|
|
2316
|
+
var last = entry.traces[entry.traces.length - 1];
|
|
2317
|
+
if (trace.stack !== last?.stack) {
|
|
2318
|
+
entry.traces.push(trace);
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
if (is_destroying_effect && old_values.has(signal)) {
|
|
2325
|
+
return old_values.get(signal);
|
|
2326
|
+
}
|
|
2327
|
+
if (is_derived) {
|
|
2328
|
+
var derived2 = signal;
|
|
2329
|
+
if (is_destroying_effect) {
|
|
2330
|
+
var value = derived2.v;
|
|
2331
|
+
if ((derived2.f & CLEAN) === 0 && derived2.reactions !== null || depends_on_old_values(derived2)) {
|
|
2332
|
+
value = execute_derived(derived2);
|
|
2333
|
+
}
|
|
2334
|
+
old_values.set(derived2, value);
|
|
2335
|
+
return value;
|
|
2336
|
+
}
|
|
2337
|
+
var should_connect = (derived2.f & CONNECTED) === 0 && !untracking && active_reaction !== null && (is_updating_effect || (active_reaction.f & CONNECTED) !== 0);
|
|
2338
|
+
var is_new = (derived2.f & REACTION_RAN) === 0;
|
|
2339
|
+
if (is_dirty(derived2)) {
|
|
2340
|
+
if (should_connect) {
|
|
2341
|
+
derived2.f |= CONNECTED;
|
|
2342
|
+
}
|
|
2343
|
+
update_derived(derived2);
|
|
2344
|
+
}
|
|
2345
|
+
if (should_connect && !is_new) {
|
|
2346
|
+
unfreeze_derived_effects(derived2);
|
|
2347
|
+
reconnect(derived2);
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
if (batch_values?.has(signal)) {
|
|
2351
|
+
return batch_values.get(signal);
|
|
2352
|
+
}
|
|
2353
|
+
if ((signal.f & ERROR_VALUE) !== 0) {
|
|
2354
|
+
throw signal.v;
|
|
2355
|
+
}
|
|
2356
|
+
return signal.v;
|
|
2357
|
+
}
|
|
2358
|
+
function reconnect(derived2) {
|
|
2359
|
+
derived2.f |= CONNECTED;
|
|
2360
|
+
if (derived2.deps === null)
|
|
2361
|
+
return;
|
|
2362
|
+
for (const dep of derived2.deps) {
|
|
2363
|
+
(dep.reactions ??= []).push(derived2);
|
|
2364
|
+
if ((dep.f & DERIVED) !== 0 && (dep.f & CONNECTED) === 0) {
|
|
2365
|
+
unfreeze_derived_effects(dep);
|
|
2366
|
+
reconnect(dep);
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
function depends_on_old_values(derived2) {
|
|
2371
|
+
if (derived2.v === UNINITIALIZED)
|
|
2372
|
+
return true;
|
|
2373
|
+
if (derived2.deps === null)
|
|
2374
|
+
return false;
|
|
2375
|
+
for (const dep of derived2.deps) {
|
|
2376
|
+
if (old_values.has(dep)) {
|
|
2377
|
+
return true;
|
|
2378
|
+
}
|
|
2379
|
+
if ((dep.f & DERIVED) !== 0 && depends_on_old_values(dep)) {
|
|
2380
|
+
return true;
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
return false;
|
|
2384
|
+
}
|
|
2385
|
+
function untrack(fn) {
|
|
2386
|
+
var previous_untracking = untracking;
|
|
2387
|
+
try {
|
|
2388
|
+
untracking = true;
|
|
2389
|
+
return fn();
|
|
2390
|
+
} finally {
|
|
2391
|
+
untracking = previous_untracking;
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
// node_modules/svelte/src/internal/client/reactivity/effects.js
|
|
2396
|
+
function push_effect(effect, parent_effect) {
|
|
2397
|
+
var parent_last = parent_effect.last;
|
|
2398
|
+
if (parent_last === null) {
|
|
2399
|
+
parent_effect.last = parent_effect.first = effect;
|
|
2400
|
+
} else {
|
|
2401
|
+
parent_last.next = effect;
|
|
2402
|
+
effect.prev = parent_last;
|
|
2403
|
+
parent_effect.last = effect;
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2406
|
+
function create_effect(type, fn) {
|
|
2407
|
+
var parent = active_effect;
|
|
2408
|
+
if (true_default) {
|
|
2409
|
+
while (parent !== null && (parent.f & EAGER_EFFECT) !== 0) {
|
|
2410
|
+
parent = parent.parent;
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
if (parent !== null && (parent.f & INERT) !== 0) {
|
|
2414
|
+
type |= INERT;
|
|
2415
|
+
}
|
|
2416
|
+
var effect = {
|
|
2417
|
+
ctx: component_context,
|
|
2418
|
+
deps: null,
|
|
2419
|
+
nodes: null,
|
|
2420
|
+
f: type | DIRTY | CONNECTED,
|
|
2421
|
+
first: null,
|
|
2422
|
+
fn,
|
|
2423
|
+
last: null,
|
|
2424
|
+
next: null,
|
|
2425
|
+
parent,
|
|
2426
|
+
b: parent && parent.b,
|
|
2427
|
+
prev: null,
|
|
2428
|
+
teardown: null,
|
|
2429
|
+
wv: 0,
|
|
2430
|
+
ac: null
|
|
2431
|
+
};
|
|
2432
|
+
if (true_default) {
|
|
2433
|
+
effect.component_function = dev_current_component_function;
|
|
2434
|
+
}
|
|
2435
|
+
var e = effect;
|
|
2436
|
+
if ((type & EFFECT) !== 0) {
|
|
2437
|
+
if (collected_effects !== null) {
|
|
2438
|
+
collected_effects.push(effect);
|
|
2439
|
+
} else {
|
|
2440
|
+
schedule_effect(effect);
|
|
2441
|
+
}
|
|
2442
|
+
} else if (fn !== null) {
|
|
2443
|
+
try {
|
|
2444
|
+
update_effect(effect);
|
|
2445
|
+
} catch (e2) {
|
|
2446
|
+
destroy_effect(effect);
|
|
2447
|
+
throw e2;
|
|
2448
|
+
}
|
|
2449
|
+
if (e.deps === null && e.teardown === null && e.nodes === null && e.first === e.last && (e.f & EFFECT_PRESERVED) === 0) {
|
|
2450
|
+
e = e.first;
|
|
2451
|
+
if ((type & BLOCK_EFFECT) !== 0 && (type & EFFECT_TRANSPARENT) !== 0 && e !== null) {
|
|
2452
|
+
e.f |= EFFECT_TRANSPARENT;
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
if (e !== null) {
|
|
2457
|
+
e.parent = parent;
|
|
2458
|
+
if (parent !== null) {
|
|
2459
|
+
push_effect(e, parent);
|
|
2460
|
+
}
|
|
2461
|
+
if (active_reaction !== null && (active_reaction.f & DERIVED) !== 0 && (type & ROOT_EFFECT) === 0) {
|
|
2462
|
+
var derived2 = active_reaction;
|
|
2463
|
+
(derived2.effects ??= []).push(e);
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
return effect;
|
|
2467
|
+
}
|
|
2468
|
+
function effect_tracking() {
|
|
2469
|
+
return active_reaction !== null && !untracking;
|
|
2470
|
+
}
|
|
2471
|
+
function create_user_effect(fn) {
|
|
2472
|
+
return create_effect(EFFECT | USER_EFFECT, fn);
|
|
2473
|
+
}
|
|
2474
|
+
function effect_root(fn) {
|
|
2475
|
+
Batch.ensure();
|
|
2476
|
+
const effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn);
|
|
2477
|
+
return () => {
|
|
2478
|
+
destroy_effect(effect);
|
|
2479
|
+
};
|
|
2480
|
+
}
|
|
2481
|
+
function component_root(fn) {
|
|
2482
|
+
Batch.ensure();
|
|
2483
|
+
const effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn);
|
|
2484
|
+
return (options = {}) => {
|
|
2485
|
+
return new Promise((fulfil) => {
|
|
2486
|
+
if (options.outro) {
|
|
2487
|
+
pause_effect(effect, () => {
|
|
2488
|
+
destroy_effect(effect);
|
|
2489
|
+
fulfil(undefined);
|
|
2490
|
+
});
|
|
2491
|
+
} else {
|
|
2492
|
+
destroy_effect(effect);
|
|
2493
|
+
fulfil(undefined);
|
|
2494
|
+
}
|
|
2495
|
+
});
|
|
2496
|
+
};
|
|
2497
|
+
}
|
|
2498
|
+
function render_effect(fn, flags2 = 0) {
|
|
2499
|
+
return create_effect(RENDER_EFFECT | flags2, fn);
|
|
2500
|
+
}
|
|
2501
|
+
function block(fn, flags2 = 0) {
|
|
2502
|
+
var effect = create_effect(BLOCK_EFFECT | flags2, fn);
|
|
2503
|
+
if (true_default) {
|
|
2504
|
+
effect.dev_stack = dev_stack;
|
|
2505
|
+
}
|
|
2506
|
+
return effect;
|
|
2507
|
+
}
|
|
2508
|
+
function branch(fn) {
|
|
2509
|
+
return create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn);
|
|
2510
|
+
}
|
|
2511
|
+
function execute_effect_teardown(effect) {
|
|
2512
|
+
var teardown2 = effect.teardown;
|
|
2513
|
+
if (teardown2 !== null) {
|
|
2514
|
+
const previously_destroying_effect = is_destroying_effect;
|
|
2515
|
+
const previous_reaction = active_reaction;
|
|
2516
|
+
set_is_destroying_effect(true);
|
|
2517
|
+
set_active_reaction(null);
|
|
2518
|
+
try {
|
|
2519
|
+
teardown2.call(null);
|
|
2520
|
+
} finally {
|
|
2521
|
+
set_is_destroying_effect(previously_destroying_effect);
|
|
2522
|
+
set_active_reaction(previous_reaction);
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
function destroy_effect_children(signal, remove_dom = false) {
|
|
2527
|
+
var effect = signal.first;
|
|
2528
|
+
signal.first = signal.last = null;
|
|
2529
|
+
while (effect !== null) {
|
|
2530
|
+
const controller = effect.ac;
|
|
2531
|
+
if (controller !== null) {
|
|
2532
|
+
without_reactive_context(() => {
|
|
2533
|
+
controller.abort(STALE_REACTION);
|
|
2534
|
+
});
|
|
2535
|
+
}
|
|
2536
|
+
var next2 = effect.next;
|
|
2537
|
+
if ((effect.f & ROOT_EFFECT) !== 0) {
|
|
2538
|
+
effect.parent = null;
|
|
2539
|
+
} else {
|
|
2540
|
+
destroy_effect(effect, remove_dom);
|
|
2541
|
+
}
|
|
2542
|
+
effect = next2;
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
function destroy_block_effect_children(signal) {
|
|
2546
|
+
var effect = signal.first;
|
|
2547
|
+
while (effect !== null) {
|
|
2548
|
+
var next2 = effect.next;
|
|
2549
|
+
if ((effect.f & BRANCH_EFFECT) === 0) {
|
|
2550
|
+
destroy_effect(effect);
|
|
2551
|
+
}
|
|
2552
|
+
effect = next2;
|
|
2553
|
+
}
|
|
2554
|
+
}
|
|
2555
|
+
function destroy_effect(effect, remove_dom = true) {
|
|
2556
|
+
var removed = false;
|
|
2557
|
+
if ((remove_dom || (effect.f & HEAD_EFFECT) !== 0) && effect.nodes !== null && effect.nodes.end !== null) {
|
|
2558
|
+
remove_effect_dom(effect.nodes.start, effect.nodes.end);
|
|
2559
|
+
removed = true;
|
|
2560
|
+
}
|
|
2561
|
+
destroy_effect_children(effect, remove_dom && !removed);
|
|
2562
|
+
remove_reactions(effect, 0);
|
|
2563
|
+
set_signal_status(effect, DESTROYED);
|
|
2564
|
+
var transitions = effect.nodes && effect.nodes.t;
|
|
2565
|
+
if (transitions !== null) {
|
|
2566
|
+
for (const transition of transitions) {
|
|
2567
|
+
transition.stop();
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
execute_effect_teardown(effect);
|
|
2571
|
+
var parent = effect.parent;
|
|
2572
|
+
if (parent !== null && parent.first !== null) {
|
|
2573
|
+
unlink_effect(effect);
|
|
2574
|
+
}
|
|
2575
|
+
if (true_default) {
|
|
2576
|
+
effect.component_function = null;
|
|
2577
|
+
}
|
|
2578
|
+
effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = null;
|
|
2579
|
+
}
|
|
2580
|
+
function remove_effect_dom(node, end) {
|
|
2581
|
+
while (node !== null) {
|
|
2582
|
+
var next2 = node === end ? null : get_next_sibling(node);
|
|
2583
|
+
node.remove();
|
|
2584
|
+
node = next2;
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
function unlink_effect(effect) {
|
|
2588
|
+
var parent = effect.parent;
|
|
2589
|
+
var prev = effect.prev;
|
|
2590
|
+
var next2 = effect.next;
|
|
2591
|
+
if (prev !== null)
|
|
2592
|
+
prev.next = next2;
|
|
2593
|
+
if (next2 !== null)
|
|
2594
|
+
next2.prev = prev;
|
|
2595
|
+
if (parent !== null) {
|
|
2596
|
+
if (parent.first === effect)
|
|
2597
|
+
parent.first = next2;
|
|
2598
|
+
if (parent.last === effect)
|
|
2599
|
+
parent.last = prev;
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
function pause_effect(effect, callback, destroy = true) {
|
|
2603
|
+
var transitions = [];
|
|
2604
|
+
pause_children(effect, transitions, true);
|
|
2605
|
+
var fn = () => {
|
|
2606
|
+
if (destroy)
|
|
2607
|
+
destroy_effect(effect);
|
|
2608
|
+
if (callback)
|
|
2609
|
+
callback();
|
|
2610
|
+
};
|
|
2611
|
+
var remaining = transitions.length;
|
|
2612
|
+
if (remaining > 0) {
|
|
2613
|
+
var check = () => --remaining || fn();
|
|
2614
|
+
for (var transition of transitions) {
|
|
2615
|
+
transition.out(check);
|
|
2616
|
+
}
|
|
2617
|
+
} else {
|
|
2618
|
+
fn();
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
function pause_children(effect, transitions, local) {
|
|
2622
|
+
if ((effect.f & INERT) !== 0)
|
|
2623
|
+
return;
|
|
2624
|
+
effect.f ^= INERT;
|
|
2625
|
+
var t = effect.nodes && effect.nodes.t;
|
|
2626
|
+
if (t !== null) {
|
|
2627
|
+
for (const transition of t) {
|
|
2628
|
+
if (transition.is_global || local) {
|
|
2629
|
+
transitions.push(transition);
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
var child = effect.first;
|
|
2634
|
+
while (child !== null) {
|
|
2635
|
+
var sibling = child.next;
|
|
2636
|
+
var transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0 && (effect.f & BLOCK_EFFECT) !== 0;
|
|
2637
|
+
pause_children(child, transitions, transparent ? local : false);
|
|
2638
|
+
child = sibling;
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2641
|
+
function resume_effect(effect) {
|
|
2642
|
+
resume_children(effect, true);
|
|
2643
|
+
}
|
|
2644
|
+
function resume_children(effect, local) {
|
|
2645
|
+
if ((effect.f & INERT) === 0)
|
|
2646
|
+
return;
|
|
2647
|
+
effect.f ^= INERT;
|
|
2648
|
+
if ((effect.f & CLEAN) === 0) {
|
|
2649
|
+
set_signal_status(effect, DIRTY);
|
|
2650
|
+
schedule_effect(effect);
|
|
2651
|
+
}
|
|
2652
|
+
var child = effect.first;
|
|
2653
|
+
while (child !== null) {
|
|
2654
|
+
var sibling = child.next;
|
|
2655
|
+
var transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;
|
|
2656
|
+
resume_children(child, transparent ? local : false);
|
|
2657
|
+
child = sibling;
|
|
2658
|
+
}
|
|
2659
|
+
var t = effect.nodes && effect.nodes.t;
|
|
2660
|
+
if (t !== null) {
|
|
2661
|
+
for (const transition of t) {
|
|
2662
|
+
if (transition.is_global || local) {
|
|
2663
|
+
transition.in();
|
|
2664
|
+
}
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
function move_effect(effect, fragment) {
|
|
2669
|
+
if (!effect.nodes)
|
|
2670
|
+
return;
|
|
2671
|
+
var node = effect.nodes.start;
|
|
2672
|
+
var end = effect.nodes.end;
|
|
2673
|
+
while (node !== null) {
|
|
2674
|
+
var next2 = node === end ? null : get_next_sibling(node);
|
|
2675
|
+
fragment.append(node);
|
|
2676
|
+
node = next2;
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
// node_modules/svelte/src/utils.js
|
|
2680
|
+
var DOM_BOOLEAN_ATTRIBUTES = [
|
|
2681
|
+
"allowfullscreen",
|
|
2682
|
+
"async",
|
|
2683
|
+
"autofocus",
|
|
2684
|
+
"autoplay",
|
|
2685
|
+
"checked",
|
|
2686
|
+
"controls",
|
|
2687
|
+
"default",
|
|
2688
|
+
"disabled",
|
|
2689
|
+
"formnovalidate",
|
|
2690
|
+
"indeterminate",
|
|
2691
|
+
"inert",
|
|
2692
|
+
"ismap",
|
|
2693
|
+
"loop",
|
|
2694
|
+
"multiple",
|
|
2695
|
+
"muted",
|
|
2696
|
+
"nomodule",
|
|
2697
|
+
"novalidate",
|
|
2698
|
+
"open",
|
|
2699
|
+
"playsinline",
|
|
2700
|
+
"readonly",
|
|
2701
|
+
"required",
|
|
2702
|
+
"reversed",
|
|
2703
|
+
"seamless",
|
|
2704
|
+
"selected",
|
|
2705
|
+
"webkitdirectory",
|
|
2706
|
+
"defer",
|
|
2707
|
+
"disablepictureinpicture",
|
|
2708
|
+
"disableremoteplayback"
|
|
2709
|
+
];
|
|
2710
|
+
var DOM_PROPERTIES = [
|
|
2711
|
+
...DOM_BOOLEAN_ATTRIBUTES,
|
|
2712
|
+
"formNoValidate",
|
|
2713
|
+
"isMap",
|
|
2714
|
+
"noModule",
|
|
2715
|
+
"playsInline",
|
|
2716
|
+
"readOnly",
|
|
2717
|
+
"value",
|
|
2718
|
+
"volume",
|
|
2719
|
+
"defaultValue",
|
|
2720
|
+
"defaultChecked",
|
|
2721
|
+
"srcObject",
|
|
2722
|
+
"noValidate",
|
|
2723
|
+
"allowFullscreen",
|
|
2724
|
+
"disablePictureInPicture",
|
|
2725
|
+
"disableRemotePlayback"
|
|
2726
|
+
];
|
|
2727
|
+
var PASSIVE_EVENTS = ["touchstart", "touchmove"];
|
|
2728
|
+
function is_passive_event(name) {
|
|
2729
|
+
return PASSIVE_EVENTS.includes(name);
|
|
2730
|
+
}
|
|
2731
|
+
var STATE_CREATION_RUNES = [
|
|
2732
|
+
"$state",
|
|
2733
|
+
"$state.raw",
|
|
2734
|
+
"$derived",
|
|
2735
|
+
"$derived.by"
|
|
2736
|
+
];
|
|
2737
|
+
var RUNES = [
|
|
2738
|
+
...STATE_CREATION_RUNES,
|
|
2739
|
+
"$state.eager",
|
|
2740
|
+
"$state.snapshot",
|
|
2741
|
+
"$props",
|
|
2742
|
+
"$props.id",
|
|
2743
|
+
"$bindable",
|
|
2744
|
+
"$effect",
|
|
2745
|
+
"$effect.pre",
|
|
2746
|
+
"$effect.tracking",
|
|
2747
|
+
"$effect.root",
|
|
2748
|
+
"$effect.pending",
|
|
2749
|
+
"$inspect",
|
|
2750
|
+
"$inspect().with",
|
|
2751
|
+
"$inspect.trace",
|
|
2752
|
+
"$host"
|
|
2753
|
+
];
|
|
2754
|
+
// node_modules/svelte/src/internal/client/dev/css.js
|
|
2755
|
+
var all_styles = new Map;
|
|
2756
|
+
// node_modules/svelte/src/internal/client/dom/elements/events.js
|
|
2757
|
+
var event_symbol = Symbol("events");
|
|
2758
|
+
var all_registered_events = new Set;
|
|
2759
|
+
var root_event_handles = new Set;
|
|
2760
|
+
var last_propagated_event = null;
|
|
2761
|
+
function handle_event_propagation(event) {
|
|
2762
|
+
var handler_element = this;
|
|
2763
|
+
var owner_document = handler_element.ownerDocument;
|
|
2764
|
+
var event_name = event.type;
|
|
2765
|
+
var path = event.composedPath?.() || [];
|
|
2766
|
+
var current_target = path[0] || event.target;
|
|
2767
|
+
last_propagated_event = event;
|
|
2768
|
+
var path_idx = 0;
|
|
2769
|
+
var handled_at = last_propagated_event === event && event[event_symbol];
|
|
2770
|
+
if (handled_at) {
|
|
2771
|
+
var at_idx = path.indexOf(handled_at);
|
|
2772
|
+
if (at_idx !== -1 && (handler_element === document || handler_element === window)) {
|
|
2773
|
+
event[event_symbol] = handler_element;
|
|
2774
|
+
return;
|
|
2775
|
+
}
|
|
2776
|
+
var handler_idx = path.indexOf(handler_element);
|
|
2777
|
+
if (handler_idx === -1) {
|
|
2778
|
+
return;
|
|
2779
|
+
}
|
|
2780
|
+
if (at_idx <= handler_idx) {
|
|
2781
|
+
path_idx = at_idx;
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
current_target = path[path_idx] || event.target;
|
|
2785
|
+
if (current_target === handler_element)
|
|
2786
|
+
return;
|
|
2787
|
+
define_property(event, "currentTarget", {
|
|
2788
|
+
configurable: true,
|
|
2789
|
+
get() {
|
|
2790
|
+
return current_target || owner_document;
|
|
2791
|
+
}
|
|
2792
|
+
});
|
|
2793
|
+
var previous_reaction = active_reaction;
|
|
2794
|
+
var previous_effect = active_effect;
|
|
2795
|
+
set_active_reaction(null);
|
|
2796
|
+
set_active_effect(null);
|
|
2797
|
+
try {
|
|
2798
|
+
var throw_error;
|
|
2799
|
+
var other_errors = [];
|
|
2800
|
+
while (current_target !== null) {
|
|
2801
|
+
var parent_element = current_target.assignedSlot || current_target.parentNode || current_target.host || null;
|
|
2802
|
+
try {
|
|
2803
|
+
var delegated = current_target[event_symbol]?.[event_name];
|
|
2804
|
+
if (delegated != null && (!current_target.disabled || event.target === current_target)) {
|
|
2805
|
+
delegated.call(current_target, event);
|
|
2806
|
+
}
|
|
2807
|
+
} catch (error) {
|
|
2808
|
+
if (throw_error) {
|
|
2809
|
+
other_errors.push(error);
|
|
2810
|
+
} else {
|
|
2811
|
+
throw_error = error;
|
|
2812
|
+
}
|
|
2813
|
+
}
|
|
2814
|
+
if (event.cancelBubble || parent_element === handler_element || parent_element === null) {
|
|
2815
|
+
break;
|
|
2816
|
+
}
|
|
2817
|
+
current_target = parent_element;
|
|
2818
|
+
}
|
|
2819
|
+
if (throw_error) {
|
|
2820
|
+
for (let error of other_errors) {
|
|
2821
|
+
queueMicrotask(() => {
|
|
2822
|
+
throw error;
|
|
2823
|
+
});
|
|
2824
|
+
}
|
|
2825
|
+
throw throw_error;
|
|
2826
|
+
}
|
|
2827
|
+
} finally {
|
|
2828
|
+
event[event_symbol] = handler_element;
|
|
2829
|
+
delete event.currentTarget;
|
|
2830
|
+
set_active_reaction(previous_reaction);
|
|
2831
|
+
set_active_effect(previous_effect);
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
|
|
2835
|
+
// node_modules/svelte/src/internal/client/dom/reconciler.js
|
|
2836
|
+
var policy = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
|
|
2837
|
+
createHTML: (html) => {
|
|
2838
|
+
return html;
|
|
2839
|
+
}
|
|
2840
|
+
});
|
|
2841
|
+
|
|
2842
|
+
// node_modules/svelte/src/internal/client/dom/template.js
|
|
2843
|
+
function assign_nodes(start, end) {
|
|
2844
|
+
var effect = active_effect;
|
|
2845
|
+
if (effect.nodes === null) {
|
|
2846
|
+
effect.nodes = { start, end, a: null, t: null };
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
function append(anchor, dom) {
|
|
2850
|
+
if (hydrating) {
|
|
2851
|
+
var effect = active_effect;
|
|
2852
|
+
if ((effect.f & REACTION_RAN) === 0 || effect.nodes.end === null) {
|
|
2853
|
+
effect.nodes.end = hydrate_node;
|
|
2854
|
+
}
|
|
2855
|
+
hydrate_next();
|
|
2856
|
+
return;
|
|
2857
|
+
}
|
|
2858
|
+
if (anchor === null) {
|
|
2859
|
+
return;
|
|
2860
|
+
}
|
|
2861
|
+
anchor.before(dom);
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
// node_modules/svelte/src/internal/client/render.js
|
|
2865
|
+
var should_intro = true;
|
|
2866
|
+
function mount(component, options) {
|
|
2867
|
+
return _mount(component, options);
|
|
2868
|
+
}
|
|
2869
|
+
function hydrate(component, options) {
|
|
2870
|
+
init_operations();
|
|
2871
|
+
options.intro = options.intro ?? false;
|
|
2872
|
+
const target = options.target;
|
|
2873
|
+
const was_hydrating = hydrating;
|
|
2874
|
+
const previous_hydrate_node = hydrate_node;
|
|
2875
|
+
try {
|
|
2876
|
+
var anchor = get_first_child(target);
|
|
2877
|
+
while (anchor && (anchor.nodeType !== COMMENT_NODE || anchor.data !== HYDRATION_START)) {
|
|
2878
|
+
anchor = get_next_sibling(anchor);
|
|
2879
|
+
}
|
|
2880
|
+
if (!anchor) {
|
|
2881
|
+
throw HYDRATION_ERROR;
|
|
2882
|
+
}
|
|
2883
|
+
set_hydrating(true);
|
|
2884
|
+
set_hydrate_node(anchor);
|
|
2885
|
+
const instance = _mount(component, { ...options, anchor });
|
|
2886
|
+
set_hydrating(false);
|
|
2887
|
+
return instance;
|
|
2888
|
+
} catch (error) {
|
|
2889
|
+
if (error instanceof Error && error.message.split(`
|
|
2890
|
+
`).some((line) => line.startsWith("https://svelte.dev/e/"))) {
|
|
2891
|
+
throw error;
|
|
2892
|
+
}
|
|
2893
|
+
if (error !== HYDRATION_ERROR) {
|
|
2894
|
+
console.warn("Failed to hydrate: ", error);
|
|
2895
|
+
}
|
|
2896
|
+
if (options.recover === false) {
|
|
2897
|
+
hydration_failed();
|
|
2898
|
+
}
|
|
2899
|
+
init_operations();
|
|
2900
|
+
clear_text_content(target);
|
|
2901
|
+
set_hydrating(false);
|
|
2902
|
+
return mount(component, options);
|
|
2903
|
+
} finally {
|
|
2904
|
+
set_hydrating(was_hydrating);
|
|
2905
|
+
set_hydrate_node(previous_hydrate_node);
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
var listeners = new Map;
|
|
2909
|
+
function _mount(Component, { target, anchor, props = {}, events, context, intro = true, transformError }) {
|
|
2910
|
+
init_operations();
|
|
2911
|
+
var component = undefined;
|
|
2912
|
+
var unmount = component_root(() => {
|
|
2913
|
+
var anchor_node = anchor ?? target.appendChild(create_text());
|
|
2914
|
+
boundary(anchor_node, {
|
|
2915
|
+
pending: () => {}
|
|
2916
|
+
}, (anchor_node2) => {
|
|
2917
|
+
push({});
|
|
2918
|
+
var ctx = component_context;
|
|
2919
|
+
if (context)
|
|
2920
|
+
ctx.c = context;
|
|
2921
|
+
if (events) {
|
|
2922
|
+
props.$$events = events;
|
|
2923
|
+
}
|
|
2924
|
+
if (hydrating) {
|
|
2925
|
+
assign_nodes(anchor_node2, null);
|
|
2926
|
+
}
|
|
2927
|
+
should_intro = intro;
|
|
2928
|
+
component = Component(anchor_node2, props) || {};
|
|
2929
|
+
should_intro = true;
|
|
2930
|
+
if (hydrating) {
|
|
2931
|
+
active_effect.nodes.end = hydrate_node;
|
|
2932
|
+
if (hydrate_node === null || hydrate_node.nodeType !== COMMENT_NODE || hydrate_node.data !== HYDRATION_END) {
|
|
2933
|
+
hydration_mismatch();
|
|
2934
|
+
throw HYDRATION_ERROR;
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
pop();
|
|
2938
|
+
}, transformError);
|
|
2939
|
+
var registered_events = new Set;
|
|
2940
|
+
var event_handle = (events2) => {
|
|
2941
|
+
for (var i = 0;i < events2.length; i++) {
|
|
2942
|
+
var event_name = events2[i];
|
|
2943
|
+
if (registered_events.has(event_name))
|
|
2944
|
+
continue;
|
|
2945
|
+
registered_events.add(event_name);
|
|
2946
|
+
var passive = is_passive_event(event_name);
|
|
2947
|
+
for (const node of [target, document]) {
|
|
2948
|
+
var counts = listeners.get(node);
|
|
2949
|
+
if (counts === undefined) {
|
|
2950
|
+
counts = new Map;
|
|
2951
|
+
listeners.set(node, counts);
|
|
2952
|
+
}
|
|
2953
|
+
var count = counts.get(event_name);
|
|
2954
|
+
if (count === undefined) {
|
|
2955
|
+
node.addEventListener(event_name, handle_event_propagation, { passive });
|
|
2956
|
+
counts.set(event_name, 1);
|
|
2957
|
+
} else {
|
|
2958
|
+
counts.set(event_name, count + 1);
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
};
|
|
2963
|
+
event_handle(array_from(all_registered_events));
|
|
2964
|
+
root_event_handles.add(event_handle);
|
|
2965
|
+
return () => {
|
|
2966
|
+
for (var event_name of registered_events) {
|
|
2967
|
+
for (const node of [target, document]) {
|
|
2968
|
+
var counts = listeners.get(node);
|
|
2969
|
+
var count = counts.get(event_name);
|
|
2970
|
+
if (--count == 0) {
|
|
2971
|
+
node.removeEventListener(event_name, handle_event_propagation);
|
|
2972
|
+
counts.delete(event_name);
|
|
2973
|
+
if (counts.size === 0) {
|
|
2974
|
+
listeners.delete(node);
|
|
2975
|
+
}
|
|
2976
|
+
} else {
|
|
2977
|
+
counts.set(event_name, count);
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
}
|
|
2981
|
+
root_event_handles.delete(event_handle);
|
|
2982
|
+
if (anchor_node !== anchor) {
|
|
2983
|
+
anchor_node.parentNode?.removeChild(anchor_node);
|
|
2984
|
+
}
|
|
2985
|
+
};
|
|
2986
|
+
});
|
|
2987
|
+
mounted_components.set(component, unmount);
|
|
2988
|
+
return component;
|
|
2989
|
+
}
|
|
2990
|
+
var mounted_components = new WeakMap;
|
|
2991
|
+
function unmount(component, options) {
|
|
2992
|
+
const fn = mounted_components.get(component);
|
|
2993
|
+
if (fn) {
|
|
2994
|
+
mounted_components.delete(component);
|
|
2995
|
+
return fn(options);
|
|
2996
|
+
}
|
|
2997
|
+
if (true_default) {
|
|
2998
|
+
if (STATE_SYMBOL in component) {
|
|
2999
|
+
state_proxy_unmount();
|
|
3000
|
+
} else {
|
|
3001
|
+
lifecycle_double_unmount();
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
3004
|
+
return Promise.resolve();
|
|
3005
|
+
}
|
|
3006
|
+
// node_modules/svelte/src/internal/client/dom/blocks/branches.js
|
|
3007
|
+
class BranchManager {
|
|
3008
|
+
anchor;
|
|
3009
|
+
#batches = new Map;
|
|
3010
|
+
#onscreen = new Map;
|
|
3011
|
+
#offscreen = new Map;
|
|
3012
|
+
#outroing = new Set;
|
|
3013
|
+
#transition = true;
|
|
3014
|
+
constructor(anchor, transition = true) {
|
|
3015
|
+
this.anchor = anchor;
|
|
3016
|
+
this.#transition = transition;
|
|
3017
|
+
}
|
|
3018
|
+
#commit = (batch) => {
|
|
3019
|
+
if (!this.#batches.has(batch))
|
|
3020
|
+
return;
|
|
3021
|
+
var key = this.#batches.get(batch);
|
|
3022
|
+
var onscreen = this.#onscreen.get(key);
|
|
3023
|
+
if (onscreen) {
|
|
3024
|
+
resume_effect(onscreen);
|
|
3025
|
+
this.#outroing.delete(key);
|
|
3026
|
+
} else {
|
|
3027
|
+
var offscreen = this.#offscreen.get(key);
|
|
3028
|
+
if (offscreen) {
|
|
3029
|
+
this.#onscreen.set(key, offscreen.effect);
|
|
3030
|
+
this.#offscreen.delete(key);
|
|
3031
|
+
offscreen.fragment.lastChild.remove();
|
|
3032
|
+
this.anchor.before(offscreen.fragment);
|
|
3033
|
+
onscreen = offscreen.effect;
|
|
3034
|
+
}
|
|
3035
|
+
}
|
|
3036
|
+
for (const [b, k] of this.#batches) {
|
|
3037
|
+
this.#batches.delete(b);
|
|
3038
|
+
if (b === batch) {
|
|
3039
|
+
break;
|
|
3040
|
+
}
|
|
3041
|
+
const offscreen2 = this.#offscreen.get(k);
|
|
3042
|
+
if (offscreen2) {
|
|
3043
|
+
destroy_effect(offscreen2.effect);
|
|
3044
|
+
this.#offscreen.delete(k);
|
|
3045
|
+
}
|
|
3046
|
+
}
|
|
3047
|
+
for (const [k, effect] of this.#onscreen) {
|
|
3048
|
+
if (k === key || this.#outroing.has(k))
|
|
3049
|
+
continue;
|
|
3050
|
+
const on_destroy = () => {
|
|
3051
|
+
const keys = Array.from(this.#batches.values());
|
|
3052
|
+
if (keys.includes(k)) {
|
|
3053
|
+
var fragment = document.createDocumentFragment();
|
|
3054
|
+
move_effect(effect, fragment);
|
|
3055
|
+
fragment.append(create_text());
|
|
3056
|
+
this.#offscreen.set(k, { effect, fragment });
|
|
3057
|
+
} else {
|
|
3058
|
+
destroy_effect(effect);
|
|
3059
|
+
}
|
|
3060
|
+
this.#outroing.delete(k);
|
|
3061
|
+
this.#onscreen.delete(k);
|
|
3062
|
+
};
|
|
3063
|
+
if (this.#transition || !onscreen) {
|
|
3064
|
+
this.#outroing.add(k);
|
|
3065
|
+
pause_effect(effect, on_destroy, false);
|
|
3066
|
+
} else {
|
|
3067
|
+
on_destroy();
|
|
3068
|
+
}
|
|
3069
|
+
}
|
|
3070
|
+
};
|
|
3071
|
+
#discard = (batch) => {
|
|
3072
|
+
this.#batches.delete(batch);
|
|
3073
|
+
const keys = Array.from(this.#batches.values());
|
|
3074
|
+
for (const [k, branch2] of this.#offscreen) {
|
|
3075
|
+
if (!keys.includes(k)) {
|
|
3076
|
+
destroy_effect(branch2.effect);
|
|
3077
|
+
this.#offscreen.delete(k);
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
};
|
|
3081
|
+
ensure(key, fn) {
|
|
3082
|
+
var batch = current_batch;
|
|
3083
|
+
var defer = should_defer_append();
|
|
3084
|
+
if (fn && !this.#onscreen.has(key) && !this.#offscreen.has(key)) {
|
|
3085
|
+
if (defer) {
|
|
3086
|
+
var fragment = document.createDocumentFragment();
|
|
3087
|
+
var target = create_text();
|
|
3088
|
+
fragment.append(target);
|
|
3089
|
+
this.#offscreen.set(key, {
|
|
3090
|
+
effect: branch(() => fn(target)),
|
|
3091
|
+
fragment
|
|
3092
|
+
});
|
|
3093
|
+
} else {
|
|
3094
|
+
this.#onscreen.set(key, branch(() => fn(this.anchor)));
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
this.#batches.set(batch, key);
|
|
3098
|
+
if (defer) {
|
|
3099
|
+
for (const [k, effect] of this.#onscreen) {
|
|
3100
|
+
if (k === key) {
|
|
3101
|
+
batch.unskip_effect(effect);
|
|
3102
|
+
} else {
|
|
3103
|
+
batch.skip_effect(effect);
|
|
3104
|
+
}
|
|
3105
|
+
}
|
|
3106
|
+
for (const [k, branch2] of this.#offscreen) {
|
|
3107
|
+
if (k === key) {
|
|
3108
|
+
batch.unskip_effect(branch2.effect);
|
|
3109
|
+
} else {
|
|
3110
|
+
batch.skip_effect(branch2.effect);
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
3113
|
+
batch.oncommit(this.#commit);
|
|
3114
|
+
batch.ondiscard(this.#discard);
|
|
3115
|
+
} else {
|
|
3116
|
+
if (hydrating) {
|
|
3117
|
+
this.anchor = hydrate_node;
|
|
3118
|
+
}
|
|
3119
|
+
this.#commit(batch);
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
}
|
|
3123
|
+
// node_modules/svelte/src/internal/client/dom/blocks/key.js
|
|
3124
|
+
var NAN = Symbol("NaN");
|
|
3125
|
+
// node_modules/svelte/src/internal/client/timing.js
|
|
3126
|
+
var now = true_default ? () => performance.now() : () => Date.now();
|
|
3127
|
+
var raf = {
|
|
3128
|
+
tick: (_) => (true_default ? requestAnimationFrame : noop)(_),
|
|
3129
|
+
now: () => now(),
|
|
3130
|
+
tasks: new Set
|
|
3131
|
+
};
|
|
3132
|
+
// node_modules/svelte/src/internal/shared/attributes.js
|
|
3133
|
+
var replacements = {
|
|
3134
|
+
translate: new Map([
|
|
3135
|
+
[true, "yes"],
|
|
3136
|
+
[false, "no"]
|
|
3137
|
+
])
|
|
3138
|
+
};
|
|
3139
|
+
var whitespace = [...`
|
|
3140
|
+
\r\f \v\uFEFF`];
|
|
3141
|
+
|
|
3142
|
+
// node_modules/svelte/src/internal/client/dom/elements/attributes.js
|
|
3143
|
+
var CLASS = Symbol("class");
|
|
3144
|
+
var STYLE = Symbol("style");
|
|
3145
|
+
var IS_CUSTOM_ELEMENT = Symbol("is custom element");
|
|
3146
|
+
var IS_HTML = Symbol("is html");
|
|
3147
|
+
var setters_cache = new Map;
|
|
3148
|
+
// node_modules/svelte/src/internal/client/dom/elements/bindings/input.js
|
|
3149
|
+
var pending = new Set;
|
|
3150
|
+
// node_modules/svelte/src/internal/client/dom/elements/bindings/size.js
|
|
3151
|
+
class ResizeObserverSingleton {
|
|
3152
|
+
#listeners = new WeakMap;
|
|
3153
|
+
#observer;
|
|
3154
|
+
#options;
|
|
3155
|
+
static entries = new WeakMap;
|
|
3156
|
+
constructor(options) {
|
|
3157
|
+
this.#options = options;
|
|
3158
|
+
}
|
|
3159
|
+
observe(element, listener) {
|
|
3160
|
+
var listeners2 = this.#listeners.get(element) || new Set;
|
|
3161
|
+
listeners2.add(listener);
|
|
3162
|
+
this.#listeners.set(element, listeners2);
|
|
3163
|
+
this.#getObserver().observe(element, this.#options);
|
|
3164
|
+
return () => {
|
|
3165
|
+
var listeners3 = this.#listeners.get(element);
|
|
3166
|
+
listeners3.delete(listener);
|
|
3167
|
+
if (listeners3.size === 0) {
|
|
3168
|
+
this.#listeners.delete(element);
|
|
3169
|
+
this.#observer.unobserve(element);
|
|
3170
|
+
}
|
|
3171
|
+
};
|
|
3172
|
+
}
|
|
3173
|
+
#getObserver() {
|
|
3174
|
+
return this.#observer ?? (this.#observer = new ResizeObserver((entries) => {
|
|
3175
|
+
for (var entry of entries) {
|
|
3176
|
+
ResizeObserverSingleton.entries.set(entry.target, entry);
|
|
3177
|
+
for (var listener of this.#listeners.get(entry.target) || []) {
|
|
3178
|
+
listener(entry);
|
|
3179
|
+
}
|
|
3180
|
+
}
|
|
3181
|
+
}));
|
|
3182
|
+
}
|
|
3183
|
+
}
|
|
3184
|
+
// node_modules/svelte/src/internal/client/reactivity/store.js
|
|
3185
|
+
var IS_UNMOUNTED = Symbol();
|
|
3186
|
+
// node_modules/svelte/src/legacy/legacy-client.js
|
|
3187
|
+
function createClassComponent(options) {
|
|
3188
|
+
return new Svelte4Component(options);
|
|
3189
|
+
}
|
|
3190
|
+
class Svelte4Component {
|
|
3191
|
+
#events;
|
|
3192
|
+
#instance;
|
|
3193
|
+
constructor(options) {
|
|
3194
|
+
var sources = new Map;
|
|
3195
|
+
var add_source = (key, value) => {
|
|
3196
|
+
var s = mutable_source(value, false, false);
|
|
3197
|
+
sources.set(key, s);
|
|
3198
|
+
return s;
|
|
3199
|
+
};
|
|
3200
|
+
const props = new Proxy({ ...options.props || {}, $$events: {} }, {
|
|
3201
|
+
get(target, prop) {
|
|
3202
|
+
return get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
|
|
3203
|
+
},
|
|
3204
|
+
has(target, prop) {
|
|
3205
|
+
if (prop === LEGACY_PROPS)
|
|
3206
|
+
return true;
|
|
3207
|
+
get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
|
|
3208
|
+
return Reflect.has(target, prop);
|
|
3209
|
+
},
|
|
3210
|
+
set(target, prop, value) {
|
|
3211
|
+
set(sources.get(prop) ?? add_source(prop, value), value);
|
|
3212
|
+
return Reflect.set(target, prop, value);
|
|
3213
|
+
}
|
|
3214
|
+
});
|
|
3215
|
+
this.#instance = (options.hydrate ? hydrate : mount)(options.component, {
|
|
3216
|
+
target: options.target,
|
|
3217
|
+
anchor: options.anchor,
|
|
3218
|
+
props,
|
|
3219
|
+
context: options.context,
|
|
3220
|
+
intro: options.intro ?? false,
|
|
3221
|
+
recover: options.recover,
|
|
3222
|
+
transformError: options.transformError
|
|
3223
|
+
});
|
|
3224
|
+
if (!async_mode_flag && (!options?.props?.$$host || options.sync === false)) {
|
|
3225
|
+
flushSync();
|
|
3226
|
+
}
|
|
3227
|
+
this.#events = props.$$events;
|
|
3228
|
+
for (const key of Object.keys(this.#instance)) {
|
|
3229
|
+
if (key === "$set" || key === "$destroy" || key === "$on")
|
|
3230
|
+
continue;
|
|
3231
|
+
define_property(this, key, {
|
|
3232
|
+
get() {
|
|
3233
|
+
return this.#instance[key];
|
|
3234
|
+
},
|
|
3235
|
+
set(value) {
|
|
3236
|
+
this.#instance[key] = value;
|
|
3237
|
+
},
|
|
3238
|
+
enumerable: true
|
|
3239
|
+
});
|
|
3240
|
+
}
|
|
3241
|
+
this.#instance.$set = (next2) => {
|
|
3242
|
+
Object.assign(props, next2);
|
|
3243
|
+
};
|
|
3244
|
+
this.#instance.$destroy = () => {
|
|
3245
|
+
unmount(this.#instance);
|
|
3246
|
+
};
|
|
3247
|
+
}
|
|
3248
|
+
$set(props) {
|
|
3249
|
+
this.#instance.$set(props);
|
|
3250
|
+
}
|
|
3251
|
+
$on(event2, callback) {
|
|
3252
|
+
this.#events[event2] = this.#events[event2] || [];
|
|
3253
|
+
const cb = (...args) => callback.call(this, ...args);
|
|
3254
|
+
this.#events[event2].push(cb);
|
|
3255
|
+
return () => {
|
|
3256
|
+
this.#events[event2] = this.#events[event2].filter((fn) => fn !== cb);
|
|
3257
|
+
};
|
|
3258
|
+
}
|
|
3259
|
+
$destroy() {
|
|
3260
|
+
this.#instance.$destroy();
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3264
|
+
// node_modules/svelte/src/internal/client/dom/elements/custom-element.js
|
|
3265
|
+
var SvelteElement;
|
|
3266
|
+
if (typeof HTMLElement === "function") {
|
|
3267
|
+
SvelteElement = class extends HTMLElement {
|
|
3268
|
+
$$ctor;
|
|
3269
|
+
$$s;
|
|
3270
|
+
$$c;
|
|
3271
|
+
$$cn = false;
|
|
3272
|
+
$$d = {};
|
|
3273
|
+
$$r = false;
|
|
3274
|
+
$$p_d = {};
|
|
3275
|
+
$$l = {};
|
|
3276
|
+
$$l_u = new Map;
|
|
3277
|
+
$$me;
|
|
3278
|
+
$$shadowRoot = null;
|
|
3279
|
+
constructor($$componentCtor, $$slots, shadow_root_init) {
|
|
3280
|
+
super();
|
|
3281
|
+
this.$$ctor = $$componentCtor;
|
|
3282
|
+
this.$$s = $$slots;
|
|
3283
|
+
if (shadow_root_init) {
|
|
3284
|
+
this.$$shadowRoot = this.attachShadow(shadow_root_init);
|
|
3285
|
+
}
|
|
3286
|
+
}
|
|
3287
|
+
addEventListener(type, listener, options) {
|
|
3288
|
+
this.$$l[type] = this.$$l[type] || [];
|
|
3289
|
+
this.$$l[type].push(listener);
|
|
3290
|
+
if (this.$$c) {
|
|
3291
|
+
const unsub = this.$$c.$on(type, listener);
|
|
3292
|
+
this.$$l_u.set(listener, unsub);
|
|
3293
|
+
}
|
|
3294
|
+
super.addEventListener(type, listener, options);
|
|
3295
|
+
}
|
|
3296
|
+
removeEventListener(type, listener, options) {
|
|
3297
|
+
super.removeEventListener(type, listener, options);
|
|
3298
|
+
if (this.$$c) {
|
|
3299
|
+
const unsub = this.$$l_u.get(listener);
|
|
3300
|
+
if (unsub) {
|
|
3301
|
+
unsub();
|
|
3302
|
+
this.$$l_u.delete(listener);
|
|
3303
|
+
}
|
|
3304
|
+
}
|
|
3305
|
+
}
|
|
3306
|
+
async connectedCallback() {
|
|
3307
|
+
this.$$cn = true;
|
|
3308
|
+
if (!this.$$c) {
|
|
3309
|
+
let create_slot = function(name) {
|
|
3310
|
+
return (anchor) => {
|
|
3311
|
+
const slot = create_element("slot");
|
|
3312
|
+
if (name !== "default")
|
|
3313
|
+
slot.name = name;
|
|
3314
|
+
append(anchor, slot);
|
|
3315
|
+
};
|
|
3316
|
+
};
|
|
3317
|
+
await Promise.resolve();
|
|
3318
|
+
if (!this.$$cn || this.$$c) {
|
|
3319
|
+
return;
|
|
3320
|
+
}
|
|
3321
|
+
const $$slots = {};
|
|
3322
|
+
const existing_slots = get_custom_elements_slots(this);
|
|
3323
|
+
for (const name of this.$$s) {
|
|
3324
|
+
if (name in existing_slots) {
|
|
3325
|
+
if (name === "default" && !this.$$d.children) {
|
|
3326
|
+
this.$$d.children = create_slot(name);
|
|
3327
|
+
$$slots.default = true;
|
|
3328
|
+
} else {
|
|
3329
|
+
$$slots[name] = create_slot(name);
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
}
|
|
3333
|
+
for (const attribute of this.attributes) {
|
|
3334
|
+
const name = this.$$g_p(attribute.name);
|
|
3335
|
+
if (!(name in this.$$d)) {
|
|
3336
|
+
this.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, "toProp");
|
|
3337
|
+
}
|
|
3338
|
+
}
|
|
3339
|
+
for (const key in this.$$p_d) {
|
|
3340
|
+
if (!(key in this.$$d) && this[key] !== undefined) {
|
|
3341
|
+
this.$$d[key] = this[key];
|
|
3342
|
+
delete this[key];
|
|
3343
|
+
}
|
|
3344
|
+
}
|
|
3345
|
+
this.$$c = createClassComponent({
|
|
3346
|
+
component: this.$$ctor,
|
|
3347
|
+
target: this.$$shadowRoot || this,
|
|
3348
|
+
props: {
|
|
3349
|
+
...this.$$d,
|
|
3350
|
+
$$slots,
|
|
3351
|
+
$$host: this
|
|
3352
|
+
}
|
|
3353
|
+
});
|
|
3354
|
+
this.$$me = effect_root(() => {
|
|
3355
|
+
render_effect(() => {
|
|
3356
|
+
this.$$r = true;
|
|
3357
|
+
for (const key of object_keys(this.$$c)) {
|
|
3358
|
+
if (!this.$$p_d[key]?.reflect)
|
|
3359
|
+
continue;
|
|
3360
|
+
this.$$d[key] = this.$$c[key];
|
|
3361
|
+
const attribute_value = get_custom_element_value(key, this.$$d[key], this.$$p_d, "toAttribute");
|
|
3362
|
+
if (attribute_value == null) {
|
|
3363
|
+
this.removeAttribute(this.$$p_d[key].attribute || key);
|
|
3364
|
+
} else {
|
|
3365
|
+
this.setAttribute(this.$$p_d[key].attribute || key, attribute_value);
|
|
3366
|
+
}
|
|
3367
|
+
}
|
|
3368
|
+
this.$$r = false;
|
|
3369
|
+
});
|
|
3370
|
+
});
|
|
3371
|
+
for (const type in this.$$l) {
|
|
3372
|
+
for (const listener of this.$$l[type]) {
|
|
3373
|
+
const unsub = this.$$c.$on(type, listener);
|
|
3374
|
+
this.$$l_u.set(listener, unsub);
|
|
3375
|
+
}
|
|
3376
|
+
}
|
|
3377
|
+
this.$$l = {};
|
|
3378
|
+
}
|
|
3379
|
+
}
|
|
3380
|
+
attributeChangedCallback(attr, _oldValue, newValue) {
|
|
3381
|
+
if (this.$$r)
|
|
3382
|
+
return;
|
|
3383
|
+
attr = this.$$g_p(attr);
|
|
3384
|
+
this.$$d[attr] = get_custom_element_value(attr, newValue, this.$$p_d, "toProp");
|
|
3385
|
+
this.$$c?.$set({ [attr]: this.$$d[attr] });
|
|
3386
|
+
}
|
|
3387
|
+
disconnectedCallback() {
|
|
3388
|
+
this.$$cn = false;
|
|
3389
|
+
Promise.resolve().then(() => {
|
|
3390
|
+
if (!this.$$cn && this.$$c) {
|
|
3391
|
+
this.$$c.$destroy();
|
|
3392
|
+
this.$$me();
|
|
3393
|
+
this.$$c = undefined;
|
|
3394
|
+
}
|
|
3395
|
+
});
|
|
3396
|
+
}
|
|
3397
|
+
$$g_p(attribute_name) {
|
|
3398
|
+
return object_keys(this.$$p_d).find((key) => this.$$p_d[key].attribute === attribute_name || !this.$$p_d[key].attribute && key.toLowerCase() === attribute_name) || attribute_name;
|
|
3399
|
+
}
|
|
3400
|
+
};
|
|
3401
|
+
}
|
|
3402
|
+
function get_custom_element_value(prop, value, props_definition, transform) {
|
|
3403
|
+
const type = props_definition[prop]?.type;
|
|
3404
|
+
value = type === "Boolean" && typeof value !== "boolean" ? value != null : value;
|
|
3405
|
+
if (!transform || !props_definition[prop]) {
|
|
3406
|
+
return value;
|
|
3407
|
+
} else if (transform === "toAttribute") {
|
|
3408
|
+
switch (type) {
|
|
3409
|
+
case "Object":
|
|
3410
|
+
case "Array":
|
|
3411
|
+
return value == null ? null : JSON.stringify(value);
|
|
3412
|
+
case "Boolean":
|
|
3413
|
+
return value ? "" : null;
|
|
3414
|
+
case "Number":
|
|
3415
|
+
return value == null ? null : value;
|
|
3416
|
+
default:
|
|
3417
|
+
return value;
|
|
3418
|
+
}
|
|
3419
|
+
} else {
|
|
3420
|
+
switch (type) {
|
|
3421
|
+
case "Object":
|
|
3422
|
+
case "Array":
|
|
3423
|
+
return value && JSON.parse(value);
|
|
3424
|
+
case "Boolean":
|
|
3425
|
+
return value;
|
|
3426
|
+
case "Number":
|
|
3427
|
+
return value != null ? +value : value;
|
|
3428
|
+
default:
|
|
3429
|
+
return value;
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
}
|
|
3433
|
+
function get_custom_elements_slots(element) {
|
|
3434
|
+
const result = {};
|
|
3435
|
+
element.childNodes.forEach((node) => {
|
|
3436
|
+
result[node.slot || "default"] = true;
|
|
3437
|
+
});
|
|
3438
|
+
return result;
|
|
3439
|
+
}
|
|
3440
|
+
// node_modules/svelte/src/index-client.js
|
|
3441
|
+
if (true_default) {
|
|
3442
|
+
let throw_rune_error = function(rune) {
|
|
3443
|
+
if (!(rune in globalThis)) {
|
|
3444
|
+
let value;
|
|
3445
|
+
Object.defineProperty(globalThis, rune, {
|
|
3446
|
+
configurable: true,
|
|
3447
|
+
get: () => {
|
|
3448
|
+
if (value !== undefined) {
|
|
3449
|
+
return value;
|
|
3450
|
+
}
|
|
3451
|
+
rune_outside_svelte(rune);
|
|
3452
|
+
},
|
|
3453
|
+
set: (v) => {
|
|
3454
|
+
value = v;
|
|
3455
|
+
}
|
|
3456
|
+
});
|
|
3457
|
+
}
|
|
3458
|
+
};
|
|
3459
|
+
throw_rune_error("$state");
|
|
3460
|
+
throw_rune_error("$effect");
|
|
3461
|
+
throw_rune_error("$derived");
|
|
3462
|
+
throw_rune_error("$inspect");
|
|
3463
|
+
throw_rune_error("$props");
|
|
3464
|
+
throw_rune_error("$bindable");
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3467
|
+
// node_modules/svelte/src/store/utils.js
|
|
3468
|
+
function subscribe_to_store(store, run3, invalidate) {
|
|
3469
|
+
if (store == null) {
|
|
3470
|
+
run3(undefined);
|
|
3471
|
+
if (invalidate)
|
|
3472
|
+
invalidate(undefined);
|
|
3473
|
+
return noop;
|
|
3474
|
+
}
|
|
3475
|
+
const unsub = untrack(() => store.subscribe(run3, invalidate));
|
|
3476
|
+
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
|
3477
|
+
}
|
|
3478
|
+
|
|
3479
|
+
// node_modules/svelte/src/store/shared/index.js
|
|
3480
|
+
var subscriber_queue = [];
|
|
3481
|
+
function writable(value, start = noop) {
|
|
3482
|
+
let stop = null;
|
|
3483
|
+
const subscribers = new Set;
|
|
3484
|
+
function set2(new_value) {
|
|
3485
|
+
if (safe_not_equal(value, new_value)) {
|
|
3486
|
+
value = new_value;
|
|
3487
|
+
if (stop) {
|
|
3488
|
+
const run_queue = !subscriber_queue.length;
|
|
3489
|
+
for (const subscriber of subscribers) {
|
|
3490
|
+
subscriber[1]();
|
|
3491
|
+
subscriber_queue.push(subscriber, value);
|
|
3492
|
+
}
|
|
3493
|
+
if (run_queue) {
|
|
3494
|
+
for (let i = 0;i < subscriber_queue.length; i += 2) {
|
|
3495
|
+
subscriber_queue[i][0](subscriber_queue[i + 1]);
|
|
3496
|
+
}
|
|
3497
|
+
subscriber_queue.length = 0;
|
|
3498
|
+
}
|
|
3499
|
+
}
|
|
3500
|
+
}
|
|
3501
|
+
}
|
|
3502
|
+
function update2(fn) {
|
|
3503
|
+
set2(fn(value));
|
|
3504
|
+
}
|
|
3505
|
+
function subscribe(run3, invalidate = noop) {
|
|
3506
|
+
const subscriber = [run3, invalidate];
|
|
3507
|
+
subscribers.add(subscriber);
|
|
3508
|
+
if (subscribers.size === 1) {
|
|
3509
|
+
stop = start(set2, update2) || noop;
|
|
3510
|
+
}
|
|
3511
|
+
run3(value);
|
|
3512
|
+
return () => {
|
|
3513
|
+
subscribers.delete(subscriber);
|
|
3514
|
+
if (subscribers.size === 0 && stop) {
|
|
3515
|
+
stop();
|
|
3516
|
+
stop = null;
|
|
3517
|
+
}
|
|
3518
|
+
};
|
|
3519
|
+
}
|
|
3520
|
+
return { set: set2, update: update2, subscribe };
|
|
3521
|
+
}
|
|
3522
|
+
function get2(store) {
|
|
3523
|
+
let value;
|
|
3524
|
+
subscribe_to_store(store, (_) => value = _)();
|
|
3525
|
+
return value;
|
|
3526
|
+
}
|
|
3527
|
+
// node_modules/valibot/dist/index.mjs
|
|
3528
|
+
var store$4;
|
|
3529
|
+
function getGlobalConfig(config$1) {
|
|
3530
|
+
return {
|
|
3531
|
+
lang: config$1?.lang ?? store$4?.lang,
|
|
3532
|
+
message: config$1?.message,
|
|
3533
|
+
abortEarly: config$1?.abortEarly ?? store$4?.abortEarly,
|
|
3534
|
+
abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly
|
|
3535
|
+
};
|
|
3536
|
+
}
|
|
3537
|
+
function safeParse(schema, input, config$1) {
|
|
3538
|
+
const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));
|
|
3539
|
+
return {
|
|
3540
|
+
typed: dataset.typed,
|
|
3541
|
+
success: !dataset.issues,
|
|
3542
|
+
output: dataset.value,
|
|
3543
|
+
issues: dataset.issues
|
|
3544
|
+
};
|
|
3545
|
+
}
|
|
3546
|
+
|
|
3547
|
+
// index.ts
|
|
3548
|
+
function useForm(params) {
|
|
3549
|
+
const { initialValues, schema, onSubmit, debounceInterval = 50 } = params;
|
|
3550
|
+
const values = writable({ ...initialValues });
|
|
3551
|
+
const errors2 = writable({});
|
|
3552
|
+
const touched = writable(Object.keys(initialValues).reduce((acc, key2) => {
|
|
3553
|
+
acc[key2] = false;
|
|
3554
|
+
return acc;
|
|
3555
|
+
}, {}));
|
|
3556
|
+
function markTouched(field) {
|
|
3557
|
+
touched.update((t) => ({ ...t, [field]: true }));
|
|
3558
|
+
}
|
|
3559
|
+
function mapIssues(issues) {
|
|
3560
|
+
const newErrors = {};
|
|
3561
|
+
for (const issue of issues ?? []) {
|
|
3562
|
+
const field = issue.path?.[0]?.key;
|
|
3563
|
+
if (field)
|
|
3564
|
+
newErrors[field] = issue.message;
|
|
3565
|
+
}
|
|
3566
|
+
return newErrors;
|
|
3567
|
+
}
|
|
3568
|
+
let validationTimer = null;
|
|
3569
|
+
values.subscribe(($values) => {
|
|
3570
|
+
if (validationTimer)
|
|
3571
|
+
clearTimeout(validationTimer);
|
|
3572
|
+
validationTimer = setTimeout(() => {
|
|
3573
|
+
const result = safeParse(schema, $values);
|
|
3574
|
+
errors2.set(result.success ? {} : mapIssues(result.issues));
|
|
3575
|
+
}, debounceInterval);
|
|
3576
|
+
});
|
|
3577
|
+
async function handleSubmit(event2) {
|
|
3578
|
+
event2.preventDefault();
|
|
3579
|
+
const currentValues = get2(values);
|
|
3580
|
+
errors2.set({});
|
|
3581
|
+
const result = safeParse(schema, currentValues);
|
|
3582
|
+
if (!result.success) {
|
|
3583
|
+
errors2.set(mapIssues(result.issues));
|
|
3584
|
+
touched.update((t) => {
|
|
3585
|
+
for (const issue of result.issues ?? []) {
|
|
3586
|
+
const field = issue.path?.[0]?.key;
|
|
3587
|
+
if (field)
|
|
3588
|
+
t[field] = true;
|
|
3589
|
+
}
|
|
3590
|
+
return t;
|
|
3591
|
+
});
|
|
3592
|
+
return;
|
|
3593
|
+
}
|
|
3594
|
+
await onSubmit(currentValues);
|
|
3595
|
+
}
|
|
3596
|
+
function resetForm() {
|
|
3597
|
+
values.set({ ...initialValues });
|
|
3598
|
+
errors2.set({});
|
|
3599
|
+
touched.set(Object.keys(initialValues).reduce((acc, key2) => {
|
|
3600
|
+
acc[key2] = false;
|
|
3601
|
+
return acc;
|
|
3602
|
+
}, {}));
|
|
3603
|
+
}
|
|
3604
|
+
return { values, errors: errors2, touched, markTouched, handleSubmit, resetForm };
|
|
3605
|
+
}
|