@agent-profile/web 0.1.2

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.
Files changed (150) hide show
  1. package/README.md +110 -0
  2. package/build/client/_app/immutable/assets/0.BG6jUcBX.css +1 -0
  3. package/build/client/_app/immutable/assets/0.BG6jUcBX.css.br +0 -0
  4. package/build/client/_app/immutable/assets/0.BG6jUcBX.css.gz +0 -0
  5. package/build/client/_app/immutable/chunks/B-io8J2C.js +1 -0
  6. package/build/client/_app/immutable/chunks/B-io8J2C.js.br +2 -0
  7. package/build/client/_app/immutable/chunks/B-io8J2C.js.gz +0 -0
  8. package/build/client/_app/immutable/chunks/BFYQcBYR.js +1 -0
  9. package/build/client/_app/immutable/chunks/BFYQcBYR.js.br +0 -0
  10. package/build/client/_app/immutable/chunks/BFYQcBYR.js.gz +0 -0
  11. package/build/client/_app/immutable/chunks/D5BQ10GJ.js +3 -0
  12. package/build/client/_app/immutable/chunks/D5BQ10GJ.js.br +0 -0
  13. package/build/client/_app/immutable/chunks/D5BQ10GJ.js.gz +0 -0
  14. package/build/client/_app/immutable/chunks/DAWBIq3g.js +2 -0
  15. package/build/client/_app/immutable/chunks/DAWBIq3g.js.br +0 -0
  16. package/build/client/_app/immutable/chunks/DAWBIq3g.js.gz +0 -0
  17. package/build/client/_app/immutable/chunks/DCJP-V9E.js +3 -0
  18. package/build/client/_app/immutable/chunks/DCJP-V9E.js.br +0 -0
  19. package/build/client/_app/immutable/chunks/DCJP-V9E.js.gz +0 -0
  20. package/build/client/_app/immutable/chunks/I8rQr1kY.js +1 -0
  21. package/build/client/_app/immutable/chunks/I8rQr1kY.js.br +1 -0
  22. package/build/client/_app/immutable/chunks/I8rQr1kY.js.gz +0 -0
  23. package/build/client/_app/immutable/chunks/SOrpfga1.js +1 -0
  24. package/build/client/_app/immutable/chunks/SOrpfga1.js.br +0 -0
  25. package/build/client/_app/immutable/chunks/SOrpfga1.js.gz +0 -0
  26. package/build/client/_app/immutable/chunks/rbd2FHQ6.js +1 -0
  27. package/build/client/_app/immutable/chunks/rbd2FHQ6.js.br +2 -0
  28. package/build/client/_app/immutable/chunks/rbd2FHQ6.js.gz +0 -0
  29. package/build/client/_app/immutable/entry/app.wvdb3njx.js +2 -0
  30. package/build/client/_app/immutable/entry/app.wvdb3njx.js.br +0 -0
  31. package/build/client/_app/immutable/entry/app.wvdb3njx.js.gz +0 -0
  32. package/build/client/_app/immutable/entry/start.CYyClicm.js +1 -0
  33. package/build/client/_app/immutable/entry/start.CYyClicm.js.br +1 -0
  34. package/build/client/_app/immutable/entry/start.CYyClicm.js.gz +0 -0
  35. package/build/client/_app/immutable/nodes/0.DI161f18.js +1 -0
  36. package/build/client/_app/immutable/nodes/0.DI161f18.js.br +0 -0
  37. package/build/client/_app/immutable/nodes/0.DI161f18.js.gz +0 -0
  38. package/build/client/_app/immutable/nodes/1.CZb1wh8q.js +1 -0
  39. package/build/client/_app/immutable/nodes/1.CZb1wh8q.js.br +3 -0
  40. package/build/client/_app/immutable/nodes/1.CZb1wh8q.js.gz +0 -0
  41. package/build/client/_app/immutable/nodes/10.BOQgahuX.js +2 -0
  42. package/build/client/_app/immutable/nodes/10.BOQgahuX.js.br +0 -0
  43. package/build/client/_app/immutable/nodes/10.BOQgahuX.js.gz +0 -0
  44. package/build/client/_app/immutable/nodes/11.BjwWla8T.js +1 -0
  45. package/build/client/_app/immutable/nodes/11.BjwWla8T.js.br +0 -0
  46. package/build/client/_app/immutable/nodes/11.BjwWla8T.js.gz +0 -0
  47. package/build/client/_app/immutable/nodes/2.BmqkJNGt.js +9 -0
  48. package/build/client/_app/immutable/nodes/2.BmqkJNGt.js.br +0 -0
  49. package/build/client/_app/immutable/nodes/2.BmqkJNGt.js.gz +0 -0
  50. package/build/client/_app/immutable/nodes/3.NnDkXnSG.js +2 -0
  51. package/build/client/_app/immutable/nodes/3.NnDkXnSG.js.br +0 -0
  52. package/build/client/_app/immutable/nodes/3.NnDkXnSG.js.gz +0 -0
  53. package/build/client/_app/immutable/nodes/4.8sZ5zCiS.js +4 -0
  54. package/build/client/_app/immutable/nodes/4.8sZ5zCiS.js.br +0 -0
  55. package/build/client/_app/immutable/nodes/4.8sZ5zCiS.js.gz +0 -0
  56. package/build/client/_app/immutable/nodes/5.CSOalQ9R.js +2 -0
  57. package/build/client/_app/immutable/nodes/5.CSOalQ9R.js.br +0 -0
  58. package/build/client/_app/immutable/nodes/5.CSOalQ9R.js.gz +0 -0
  59. package/build/client/_app/immutable/nodes/6.BMBuGW7y.js +5 -0
  60. package/build/client/_app/immutable/nodes/6.BMBuGW7y.js.br +0 -0
  61. package/build/client/_app/immutable/nodes/6.BMBuGW7y.js.gz +0 -0
  62. package/build/client/_app/immutable/nodes/7.CG2RK2bH.js +4 -0
  63. package/build/client/_app/immutable/nodes/7.CG2RK2bH.js.br +0 -0
  64. package/build/client/_app/immutable/nodes/7.CG2RK2bH.js.gz +0 -0
  65. package/build/client/_app/immutable/nodes/8.Dzq0LDIw.js +1 -0
  66. package/build/client/_app/immutable/nodes/8.Dzq0LDIw.js.br +0 -0
  67. package/build/client/_app/immutable/nodes/8.Dzq0LDIw.js.gz +0 -0
  68. package/build/client/_app/immutable/nodes/9.CnkwRoxn.js +5 -0
  69. package/build/client/_app/immutable/nodes/9.CnkwRoxn.js.br +0 -0
  70. package/build/client/_app/immutable/nodes/9.CnkwRoxn.js.gz +0 -0
  71. package/build/client/_app/version.json +1 -0
  72. package/build/client/_app/version.json.br +0 -0
  73. package/build/client/_app/version.json.gz +0 -0
  74. package/build/env.js +94 -0
  75. package/build/handler.js +1494 -0
  76. package/build/index.js +345 -0
  77. package/build/server/chunks/0-u7mEipCH.js +110 -0
  78. package/build/server/chunks/0-u7mEipCH.js.map +1 -0
  79. package/build/server/chunks/1-BBGjCHyQ.js +9 -0
  80. package/build/server/chunks/1-BBGjCHyQ.js.map +1 -0
  81. package/build/server/chunks/10-B1aX7ZZ8.js +9 -0
  82. package/build/server/chunks/10-B1aX7ZZ8.js.map +1 -0
  83. package/build/server/chunks/11-4z6b2WB8.js +83 -0
  84. package/build/server/chunks/11-4z6b2WB8.js.map +1 -0
  85. package/build/server/chunks/2-CZ6isW8Z.js +9 -0
  86. package/build/server/chunks/2-CZ6isW8Z.js.map +1 -0
  87. package/build/server/chunks/3-CLWhM7Et.js +9 -0
  88. package/build/server/chunks/3-CLWhM7Et.js.map +1 -0
  89. package/build/server/chunks/4-BehBrXcu.js +146 -0
  90. package/build/server/chunks/4-BehBrXcu.js.map +1 -0
  91. package/build/server/chunks/5-C1YtO2Ru.js +9 -0
  92. package/build/server/chunks/5-C1YtO2Ru.js.map +1 -0
  93. package/build/server/chunks/6-DJ03bQJy.js +9 -0
  94. package/build/server/chunks/6-DJ03bQJy.js.map +1 -0
  95. package/build/server/chunks/7-CI__yhaj.js +73 -0
  96. package/build/server/chunks/7-CI__yhaj.js.map +1 -0
  97. package/build/server/chunks/8-BGx10Z6s.js +9 -0
  98. package/build/server/chunks/8-BGx10Z6s.js.map +1 -0
  99. package/build/server/chunks/9-LeS-ldcl.js +57 -0
  100. package/build/server/chunks/9-LeS-ldcl.js.map +1 -0
  101. package/build/server/chunks/Badge-BrV_lIru.js +24 -0
  102. package/build/server/chunks/Badge-BrV_lIru.js.map +1 -0
  103. package/build/server/chunks/SafetyBadge-BSDbVVMY.js +13 -0
  104. package/build/server/chunks/SafetyBadge-BSDbVVMY.js.map +1 -0
  105. package/build/server/chunks/_layout.svelte-Cg7oqdVB.js +214 -0
  106. package/build/server/chunks/_layout.svelte-Cg7oqdVB.js.map +1 -0
  107. package/build/server/chunks/_page.svelte-B0_5f_5-.js +86 -0
  108. package/build/server/chunks/_page.svelte-B0_5f_5-.js.map +1 -0
  109. package/build/server/chunks/_page.svelte-BS9xpx67.js +204 -0
  110. package/build/server/chunks/_page.svelte-BS9xpx67.js.map +1 -0
  111. package/build/server/chunks/_page.svelte-Bv-w7cKm.js +106 -0
  112. package/build/server/chunks/_page.svelte-Bv-w7cKm.js.map +1 -0
  113. package/build/server/chunks/_page.svelte-C8HqSRYY.js +55 -0
  114. package/build/server/chunks/_page.svelte-C8HqSRYY.js.map +1 -0
  115. package/build/server/chunks/_page.svelte-DRj4L7XZ.js +104 -0
  116. package/build/server/chunks/_page.svelte-DRj4L7XZ.js.map +1 -0
  117. package/build/server/chunks/_page.svelte-DXeUSVlF.js +14 -0
  118. package/build/server/chunks/_page.svelte-DXeUSVlF.js.map +1 -0
  119. package/build/server/chunks/_page.svelte-DbsvERRq.js +424 -0
  120. package/build/server/chunks/_page.svelte-DbsvERRq.js.map +1 -0
  121. package/build/server/chunks/_page.svelte-DuJcNgye.js +172 -0
  122. package/build/server/chunks/_page.svelte-DuJcNgye.js.map +1 -0
  123. package/build/server/chunks/_page.svelte-DyYKrY-D.js +92 -0
  124. package/build/server/chunks/_page.svelte-DyYKrY-D.js.map +1 -0
  125. package/build/server/chunks/_page.svelte-r2AHAn4f.js +134 -0
  126. package/build/server/chunks/_page.svelte-r2AHAn4f.js.map +1 -0
  127. package/build/server/chunks/client-DRY1rofW.js +23 -0
  128. package/build/server/chunks/client-DRY1rofW.js.map +1 -0
  129. package/build/server/chunks/dev-CrqJ3ZR3.js +4558 -0
  130. package/build/server/chunks/dev-CrqJ3ZR3.js.map +1 -0
  131. package/build/server/chunks/dist--t-UlYlZ.js +532 -0
  132. package/build/server/chunks/dist--t-UlYlZ.js.map +1 -0
  133. package/build/server/chunks/doctorSummary-CGjSiyKU.js +85 -0
  134. package/build/server/chunks/doctorSummary-CGjSiyKU.js.map +1 -0
  135. package/build/server/chunks/error.svelte-CvT76GCP.js +66 -0
  136. package/build/server/chunks/error.svelte-CvT76GCP.js.map +1 -0
  137. package/build/server/chunks/hooks.server-BGib69tn.js +38 -0
  138. package/build/server/chunks/hooks.server-BGib69tn.js.map +1 -0
  139. package/build/server/chunks/index-XyMIhwom.js +4727 -0
  140. package/build/server/chunks/index-XyMIhwom.js.map +1 -0
  141. package/build/server/chunks/internal-DDD35M_S.js +2068 -0
  142. package/build/server/chunks/internal-DDD35M_S.js.map +1 -0
  143. package/build/server/chunks/projectContext-C4-xYqFg.js +17311 -0
  144. package/build/server/chunks/projectContext-C4-xYqFg.js.map +1 -0
  145. package/build/server/index.js +5 -0
  146. package/build/server/index.js.map +1 -0
  147. package/build/server/manifest.js +118 -0
  148. package/build/server/manifest.js.map +1 -0
  149. package/build/shims.js +32 -0
  150. package/package.json +34 -0
@@ -0,0 +1,2068 @@
1
+ import { D as DevalueError, m as is_primitive, o as get_type, p as is_plain_object, q as enumerable_symbols, t as stringify_key, v as stringify_string, x as valid_array_indices, y as run$1, z as setContext, n as noop$1, A as hasContext, i as getContext, B as getAllContexts, C as getAbortSignal, E as createContext, F as ssr_context, G as lifecycle_function_unavailable, H as experimental_async_required, I as get_render_context, u as uneval, J as hydratable_serialization_failed, K as render, L as set, M as LEGACY_PROPS, N as get, O as flushSync, P as define_property, Q as mutable_source, R as init_operations, S as get_first_child, T as get_next_sibling, U as HYDRATION_ERROR, V as set_hydrating, W as set_hydrate_node, X as hydration_failed, Y as clear_text_content, Z as component_root, _ as hydrate_node, $ as create_text, a0 as boundary, a1 as array_from, a2 as is_passive_event, a3 as set_active_reaction, a4 as set_active_effect, a5 as active_reaction, a6 as active_effect, f as derived, a7 as hydrating, a8 as push, a9 as component_context, aa as hydration_mismatch, ab as pop } from './dev-CrqJ3ZR3.js';
2
+ import 'node:module';
3
+
4
+ /* Baseline 2025 runtimes */
5
+
6
+ /** @type {(array_buffer: ArrayBuffer) => string} */
7
+ function encode_native(array_buffer) {
8
+ return new Uint8Array(array_buffer).toBase64();
9
+ }
10
+
11
+ /** @type {(base64: string) => ArrayBuffer} */
12
+ function decode_native(base64) {
13
+ return Uint8Array.fromBase64(base64).buffer;
14
+ }
15
+
16
+ /* Node-compatible runtimes */
17
+
18
+ /** @type {(array_buffer: ArrayBuffer) => string} */
19
+ function encode_buffer(array_buffer) {
20
+ return Buffer.from(array_buffer).toString('base64');
21
+ }
22
+
23
+ /** @type {(base64: string) => ArrayBuffer} */
24
+ function decode_buffer(base64) {
25
+ return Uint8Array.from(Buffer.from(base64, 'base64')).buffer;
26
+ }
27
+
28
+ /* Legacy runtimes */
29
+
30
+ /** @type {(array_buffer: ArrayBuffer) => string} */
31
+ function encode_legacy(array_buffer) {
32
+ const array = new Uint8Array(array_buffer);
33
+ let binary = '';
34
+
35
+ // the maximum number of arguments to String.fromCharCode.apply
36
+ // should be around 0xFFFF in modern engines
37
+ const chunk_size = 0x8000;
38
+ for (let i = 0; i < array.length; i += chunk_size) {
39
+ const chunk = array.subarray(i, i + chunk_size);
40
+ binary += String.fromCharCode.apply(null, chunk);
41
+ }
42
+
43
+ return btoa(binary);
44
+ }
45
+
46
+ /** @type {(base64: string) => ArrayBuffer} */
47
+ function decode_legacy(base64) {
48
+ const binary_string = atob(base64);
49
+ const len = binary_string.length;
50
+ const array = new Uint8Array(len);
51
+
52
+ for (let i = 0; i < len; i++) {
53
+ array[i] = binary_string.charCodeAt(i);
54
+ }
55
+
56
+ return array.buffer;
57
+ }
58
+
59
+ const native = typeof Uint8Array.fromBase64 === 'function';
60
+ const buffer = typeof process === 'object' && process.versions?.node !== undefined;
61
+
62
+ const encode64 = native ? encode_native : buffer ? encode_buffer : encode_legacy;
63
+ const decode64 = native ? decode_native : buffer ? decode_buffer : decode_legacy;
64
+
65
+ const UNDEFINED = -1;
66
+ const HOLE = -2;
67
+ const NAN = -3;
68
+ const POSITIVE_INFINITY = -4;
69
+ const NEGATIVE_INFINITY = -5;
70
+ const NEGATIVE_ZERO = -6;
71
+ const SPARSE = -7;
72
+
73
+ /**
74
+ * Revive a value serialized with `devalue.stringify`
75
+ * @param {string} serialized
76
+ * @param {Record<string, (value: any) => any>} [revivers]
77
+ */
78
+ function parse(serialized, revivers) {
79
+ return unflatten(JSON.parse(serialized), revivers);
80
+ }
81
+
82
+ /**
83
+ * Revive a value flattened with `devalue.stringify`
84
+ * @param {number | any[]} parsed
85
+ * @param {Record<string, (value: any) => any>} [revivers]
86
+ */
87
+ function unflatten(parsed, revivers) {
88
+ if (typeof parsed === 'number') return hydrate(parsed, true);
89
+
90
+ if (!Array.isArray(parsed) || parsed.length === 0) {
91
+ throw new Error('Invalid input');
92
+ }
93
+
94
+ const values = /** @type {any[]} */ (parsed);
95
+
96
+ const hydrated = Array(values.length);
97
+
98
+ /**
99
+ * A set of values currently being hydrated with custom revivers,
100
+ * used to detect invalid cyclical dependencies
101
+ * @type {Set<number> | null}
102
+ */
103
+ let hydrating = null;
104
+
105
+ /**
106
+ * @param {number} index
107
+ * @returns {any}
108
+ */
109
+ function hydrate(index, standalone = false) {
110
+ if (index === UNDEFINED) return undefined;
111
+ if (index === NAN) return NaN;
112
+ if (index === POSITIVE_INFINITY) return Infinity;
113
+ if (index === NEGATIVE_INFINITY) return -Infinity;
114
+ if (index === NEGATIVE_ZERO) return -0;
115
+
116
+ if (standalone || typeof index !== 'number') {
117
+ throw new Error(`Invalid input`);
118
+ }
119
+
120
+ if (index in hydrated) return hydrated[index];
121
+
122
+ const value = values[index];
123
+
124
+ if (!value || typeof value !== 'object') {
125
+ hydrated[index] = value;
126
+ } else if (Array.isArray(value)) {
127
+ if (typeof value[0] === 'string') {
128
+ const type = value[0];
129
+
130
+ const reviver = revivers && Object.hasOwn(revivers, type) ? revivers[type] : undefined;
131
+
132
+ if (reviver) {
133
+ let i = value[1];
134
+ if (typeof i !== 'number') {
135
+ // if it's not a number, it was serialized by a builtin reviver
136
+ // so we need to munge it into the format expected by a custom reviver
137
+ i = values.push(value[1]) - 1;
138
+ }
139
+
140
+ hydrating ??= new Set();
141
+
142
+ if (hydrating.has(i)) {
143
+ throw new Error('Invalid circular reference');
144
+ }
145
+
146
+ hydrating.add(i);
147
+ hydrated[index] = reviver(hydrate(i));
148
+ hydrating.delete(i);
149
+
150
+ return hydrated[index];
151
+ }
152
+
153
+ switch (type) {
154
+ case 'Date':
155
+ hydrated[index] = new Date(value[1]);
156
+ break;
157
+
158
+ case 'Set':
159
+ const set = new Set();
160
+ hydrated[index] = set;
161
+ for (let i = 1; i < value.length; i += 1) {
162
+ set.add(hydrate(value[i]));
163
+ }
164
+ break;
165
+
166
+ case 'Map':
167
+ const map = new Map();
168
+ hydrated[index] = map;
169
+ for (let i = 1; i < value.length; i += 2) {
170
+ map.set(hydrate(value[i]), hydrate(value[i + 1]));
171
+ }
172
+ break;
173
+
174
+ case 'RegExp':
175
+ hydrated[index] = new RegExp(value[1], value[2]);
176
+ break;
177
+
178
+ case 'Object': {
179
+ const wrapped_index = value[1];
180
+
181
+ if (
182
+ typeof values[wrapped_index] === 'object' &&
183
+ values[wrapped_index][0] !== 'BigInt'
184
+ ) {
185
+ // avoid infinite recusion in case of malformed input
186
+ throw new Error('Invalid input');
187
+ }
188
+
189
+ hydrated[index] = Object(hydrate(wrapped_index));
190
+ break;
191
+ }
192
+
193
+ case 'BigInt':
194
+ hydrated[index] = BigInt(value[1]);
195
+ break;
196
+
197
+ case 'null':
198
+ const obj = Object.create(null);
199
+ hydrated[index] = obj;
200
+ for (let i = 1; i < value.length; i += 2) {
201
+ if (value[i] === '__proto__') {
202
+ throw new Error('Cannot parse an object with a `__proto__` property');
203
+ }
204
+
205
+ obj[value[i]] = hydrate(value[i + 1]);
206
+ }
207
+ break;
208
+
209
+ case 'Int8Array':
210
+ case 'Uint8Array':
211
+ case 'Uint8ClampedArray':
212
+ case 'Int16Array':
213
+ case 'Uint16Array':
214
+ case 'Float16Array':
215
+ case 'Int32Array':
216
+ case 'Uint32Array':
217
+ case 'Float32Array':
218
+ case 'Float64Array':
219
+ case 'BigInt64Array':
220
+ case 'BigUint64Array':
221
+ case 'DataView': {
222
+ if (values[value[1]][0] !== 'ArrayBuffer') {
223
+ // without this, if we receive malformed input we could
224
+ // end up trying to hydrate in a circle or allocate
225
+ // huge amounts of memory when we call `new TypedArrayConstructor(buffer)`
226
+ throw new Error('Invalid data');
227
+ }
228
+
229
+ const TypedArrayConstructor = globalThis[type];
230
+ const buffer = hydrate(value[1]);
231
+
232
+ hydrated[index] =
233
+ value[2] !== undefined
234
+ ? new TypedArrayConstructor(buffer, value[2], value[3])
235
+ : new TypedArrayConstructor(buffer);
236
+
237
+ break;
238
+ }
239
+
240
+ case 'ArrayBuffer': {
241
+ const base64 = value[1];
242
+ if (typeof base64 !== 'string') {
243
+ throw new Error('Invalid ArrayBuffer encoding');
244
+ }
245
+ const arraybuffer = decode64(base64);
246
+ hydrated[index] = arraybuffer;
247
+ break;
248
+ }
249
+
250
+ case 'Temporal.Duration':
251
+ case 'Temporal.Instant':
252
+ case 'Temporal.PlainDate':
253
+ case 'Temporal.PlainTime':
254
+ case 'Temporal.PlainDateTime':
255
+ case 'Temporal.PlainMonthDay':
256
+ case 'Temporal.PlainYearMonth':
257
+ case 'Temporal.ZonedDateTime': {
258
+ const temporalName = type.slice(9);
259
+ // @ts-expect-error TS doesn't know about Temporal yet
260
+ hydrated[index] = Temporal[temporalName].from(value[1]);
261
+ break;
262
+ }
263
+
264
+ case 'URL': {
265
+ const url = new URL(value[1]);
266
+ hydrated[index] = url;
267
+ break;
268
+ }
269
+
270
+ case 'URLSearchParams': {
271
+ const url = new URLSearchParams(value[1]);
272
+ hydrated[index] = url;
273
+ break;
274
+ }
275
+
276
+ default:
277
+ throw new Error(`Unknown type ${type}`);
278
+ }
279
+ } else if (value[0] === SPARSE) {
280
+ // Sparse array encoding: [SPARSE, length, idx, val, idx, val, ...]
281
+ const len = value[1];
282
+
283
+ if (!Number.isInteger(len) || len < 0) {
284
+ throw new Error('Invalid input');
285
+ }
286
+
287
+ const array = new Array(len);
288
+ hydrated[index] = array;
289
+
290
+ for (let i = 2; i < value.length; i += 2) {
291
+ const idx = value[i];
292
+
293
+ if (!Number.isInteger(idx) || idx < 0 || idx >= len) {
294
+ throw new Error('Invalid input');
295
+ }
296
+
297
+ array[idx] = hydrate(value[i + 1]);
298
+ }
299
+ } else {
300
+ const array = new Array(value.length);
301
+ hydrated[index] = array;
302
+
303
+ for (let i = 0; i < value.length; i += 1) {
304
+ const n = value[i];
305
+ if (n === HOLE) continue;
306
+
307
+ array[i] = hydrate(n);
308
+ }
309
+ }
310
+ } else {
311
+ /** @type {Record<string, any>} */
312
+ const object = {};
313
+ hydrated[index] = object;
314
+
315
+ for (const key of Object.keys(value)) {
316
+ if (key === '__proto__') {
317
+ throw new Error('Cannot parse an object with a `__proto__` property');
318
+ }
319
+
320
+ const n = value[key];
321
+ object[key] = hydrate(n);
322
+ }
323
+ }
324
+
325
+ return hydrated[index];
326
+ }
327
+
328
+ return hydrate(0);
329
+ }
330
+
331
+ /**
332
+ * Turn a value into a JSON string that can be parsed with `devalue.parse`
333
+ * @param {any} value
334
+ * @param {Record<string, (value: any) => any>} [reducers]
335
+ */
336
+ function stringify$1(value, reducers) {
337
+ const stringified = run(false, value, reducers);
338
+ return typeof stringified === 'string' ? stringified : `[${stringified.join(',')}]`;
339
+ }
340
+
341
+ /**
342
+ * @param {boolean} async
343
+ * @param {any} value
344
+ * @param {Record<string, (value: any) => any>} [reducers]
345
+ */
346
+ function run(async, value, reducers) {
347
+ /** @type {any[]} */
348
+ const stringified = [];
349
+
350
+ /** @type {Map<any, number>} */
351
+ const indexes = new Map();
352
+
353
+ /** @type {Array<{ key: string, fn: (value: any) => any }>} */
354
+ const custom = [];
355
+ if (reducers) {
356
+ for (const key of Object.getOwnPropertyNames(reducers)) {
357
+ custom.push({ key, fn: reducers[key] });
358
+ }
359
+ }
360
+
361
+ /** @type {string[]} */
362
+ const keys = [];
363
+
364
+ let p = 0;
365
+
366
+ /**
367
+ * @param {any} thing
368
+ * @param {number} [index]
369
+ */
370
+ function flatten(thing, index) {
371
+ if (thing === undefined) return UNDEFINED;
372
+ if (Number.isNaN(thing)) return NAN;
373
+ if (thing === Infinity) return POSITIVE_INFINITY;
374
+ if (thing === -Infinity) return NEGATIVE_INFINITY;
375
+ if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO;
376
+
377
+ if (indexes.has(thing)) return /** @type {number} */ (indexes.get(thing));
378
+
379
+ index ??= p++;
380
+ indexes.set(thing, index);
381
+
382
+ for (const { key, fn } of custom) {
383
+ const value = fn(thing);
384
+ if (value) {
385
+ stringified[index] = `["${key}",${flatten(value)}]`;
386
+ return index;
387
+ }
388
+ }
389
+
390
+ if (typeof thing === 'function') {
391
+ throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
392
+ } else if (typeof thing === 'symbol') {
393
+ throw new DevalueError(`Cannot stringify a Symbol primitive`, keys, thing, value);
394
+ }
395
+
396
+ /** @type {string | Promise<any>} */
397
+ let str = '';
398
+
399
+ if (is_primitive(thing)) {
400
+ str = stringify_primitive(thing);
401
+ } else if (typeof thing.then === 'function') {
402
+ {
403
+ throw new DevalueError(
404
+ `Cannot stringify a Promise or thenable — use stringifyAsync instead`,
405
+ keys,
406
+ thing,
407
+ value
408
+ );
409
+ }
410
+ } else {
411
+ const type = get_type(thing);
412
+
413
+ switch (type) {
414
+ case 'Number':
415
+ case 'String':
416
+ case 'Boolean':
417
+ case 'BigInt':
418
+ str = `["Object",${flatten(thing.valueOf())}]`;
419
+ break;
420
+
421
+ case 'Date':
422
+ const valid = !isNaN(thing.getDate());
423
+ str = `["Date","${valid ? thing.toISOString() : ''}"]`;
424
+ break;
425
+
426
+ case 'URL':
427
+ str = `["URL",${stringify_string(thing.toString())}]`;
428
+ break;
429
+
430
+ case 'URLSearchParams':
431
+ str = `["URLSearchParams",${stringify_string(thing.toString())}]`;
432
+ break;
433
+
434
+ case 'RegExp':
435
+ const { source, flags } = thing;
436
+ str = flags
437
+ ? `["RegExp",${stringify_string(source)},"${flags}"]`
438
+ : `["RegExp",${stringify_string(source)}]`;
439
+ break;
440
+
441
+ case 'Array': {
442
+ // For dense arrays (no holes), we iterate normally.
443
+ // When we encounter the first hole, we call Object.keys
444
+ // to determine the sparseness, then decide between:
445
+ // - HOLE encoding: [-2, val, -2, ...] (default)
446
+ // - Sparse encoding: [-7, length, idx, val, ...] (for very sparse arrays)
447
+ // Only the sparse path avoids iterating every slot, which
448
+ // is what protects against the DoS of e.g. `arr[1000000] = 1`.
449
+ let mostly_dense = false;
450
+
451
+ str = '[';
452
+
453
+ for (let i = 0; i < thing.length; i += 1) {
454
+ if (i > 0) str += ',';
455
+
456
+ if (Object.hasOwn(thing, i)) {
457
+ keys.push(`[${i}]`);
458
+ str += flatten(thing[i]);
459
+ keys.pop();
460
+ } else if (mostly_dense) {
461
+ // Use dense encoding. The heuristic guarantees the
462
+ // array is only mildly sparse, so iterating over every
463
+ // slot is fine.
464
+ str += HOLE;
465
+ } else {
466
+ // Decide between HOLE encoding and sparse encoding.
467
+ //
468
+ // HOLE encoding: each hole is serialized as the HOLE
469
+ // sentinel (-2). For example, [, "a", ,] becomes
470
+ // [-2, 0, -2]. Each hole costs 3 chars ("-2" + comma).
471
+ //
472
+ // Sparse encoding: lists only populated indices.
473
+ // For example, [, "a", ,] becomes [-7, 3, 1, 0] — the
474
+ // -7 sentinel, the array length (3), then index-value
475
+ // pairs. This avoids paying per-hole, but each element
476
+ // costs extra chars to write its index.
477
+ //
478
+ // The values are the same size either way, so the
479
+ // choice comes down to structural overhead:
480
+ //
481
+ // HOLE overhead:
482
+ // 3 chars per hole ("-2" + comma)
483
+ // = (L - P) * 3
484
+ //
485
+ // Sparse overhead:
486
+ // "-7," — 3 chars (sparse sentinel + comma)
487
+ // + length + "," — (d + 1) chars (array length + comma)
488
+ // + per element: index + "," — (d + 1) chars
489
+ // = (4 + d) + P * (d + 1)
490
+ //
491
+ // where L is the array length, P is the number of
492
+ // populated elements, and d is the number of digits
493
+ // in L (an upper bound on the digits in any index).
494
+ //
495
+ // Sparse encoding is cheaper when:
496
+ // (4 + d) + P * (d + 1) < (L - P) * 3
497
+ const populated_keys = valid_array_indices(/** @type {any[]} */ (thing));
498
+ const population = populated_keys.length;
499
+ const d = String(thing.length).length;
500
+
501
+ const hole_cost = (thing.length - population) * 3;
502
+ const sparse_cost = 4 + d + population * (d + 1);
503
+
504
+ if (hole_cost > sparse_cost) {
505
+ str = '[' + SPARSE + ',' + thing.length;
506
+ for (let j = 0; j < populated_keys.length; j++) {
507
+ const key = populated_keys[j];
508
+ keys.push(`[${key}]`);
509
+ str += ',' + key + ',' + flatten(thing[key]);
510
+ keys.pop();
511
+ }
512
+ break;
513
+ } else {
514
+ mostly_dense = true;
515
+ str += HOLE;
516
+ }
517
+ }
518
+ }
519
+
520
+ str += ']';
521
+
522
+ break;
523
+ }
524
+
525
+ case 'Set':
526
+ str = '["Set"';
527
+
528
+ for (const value of thing) {
529
+ str += `,${flatten(value)}`;
530
+ }
531
+
532
+ str += ']';
533
+ break;
534
+
535
+ case 'Map':
536
+ str = '["Map"';
537
+
538
+ for (const [key, value] of thing) {
539
+ keys.push(`.get(${is_primitive(key) ? stringify_primitive(key) : '...'})`);
540
+ str += `,${flatten(key)},${flatten(value)}`;
541
+ keys.pop();
542
+ }
543
+
544
+ str += ']';
545
+ break;
546
+
547
+ case 'Int8Array':
548
+ case 'Uint8Array':
549
+ case 'Uint8ClampedArray':
550
+ case 'Int16Array':
551
+ case 'Uint16Array':
552
+ case 'Float16Array':
553
+ case 'Int32Array':
554
+ case 'Uint32Array':
555
+ case 'Float32Array':
556
+ case 'Float64Array':
557
+ case 'BigInt64Array':
558
+ case 'BigUint64Array':
559
+ case 'DataView': {
560
+ /** @type {import("./types.js").TypedArray} */
561
+ const typedArray = thing;
562
+ str = '["' + type + '",' + flatten(typedArray.buffer);
563
+
564
+ // handle subarrays
565
+ if (typedArray.byteLength !== typedArray.buffer.byteLength) {
566
+ // to be used with `new TypedArray(buffer, byteOffset, length)`
567
+ str += `,${typedArray.byteOffset},${typedArray.length}`;
568
+ }
569
+
570
+ str += ']';
571
+ break;
572
+ }
573
+
574
+ case 'ArrayBuffer': {
575
+ /** @type {ArrayBuffer} */
576
+ const arraybuffer = thing;
577
+ const base64 = encode64(arraybuffer);
578
+
579
+ str = `["ArrayBuffer","${base64}"]`;
580
+ break;
581
+ }
582
+
583
+ case 'Temporal.Duration':
584
+ case 'Temporal.Instant':
585
+ case 'Temporal.PlainDate':
586
+ case 'Temporal.PlainTime':
587
+ case 'Temporal.PlainDateTime':
588
+ case 'Temporal.PlainMonthDay':
589
+ case 'Temporal.PlainYearMonth':
590
+ case 'Temporal.ZonedDateTime':
591
+ str = `["${type}",${stringify_string(thing.toString())}]`;
592
+ break;
593
+
594
+ default:
595
+ if (!is_plain_object(thing)) {
596
+ throw new DevalueError(`Cannot stringify arbitrary non-POJOs`, keys, thing, value);
597
+ }
598
+
599
+ if (enumerable_symbols(thing).length > 0) {
600
+ throw new DevalueError(`Cannot stringify POJOs with symbolic keys`, keys, thing, value);
601
+ }
602
+
603
+ if (Object.getPrototypeOf(thing) === null) {
604
+ str = '["null"';
605
+ for (const key of Object.keys(thing)) {
606
+ if (key === '__proto__') {
607
+ throw new DevalueError(
608
+ `Cannot stringify objects with __proto__ keys`,
609
+ keys,
610
+ thing,
611
+ value
612
+ );
613
+ }
614
+
615
+ keys.push(stringify_key(key));
616
+ str += `,${stringify_string(key)},${flatten(thing[key])}`;
617
+ keys.pop();
618
+ }
619
+ str += ']';
620
+ } else {
621
+ str = '{';
622
+ let started = false;
623
+ for (const key of Object.keys(thing)) {
624
+ if (key === '__proto__') {
625
+ throw new DevalueError(
626
+ `Cannot stringify objects with __proto__ keys`,
627
+ keys,
628
+ thing,
629
+ value
630
+ );
631
+ }
632
+
633
+ if (started) str += ',';
634
+ started = true;
635
+ keys.push(stringify_key(key));
636
+ str += `${stringify_string(key)}:${flatten(thing[key])}`;
637
+ keys.pop();
638
+ }
639
+ str += '}';
640
+ }
641
+ }
642
+ }
643
+
644
+ stringified[index] = str;
645
+ return index;
646
+ }
647
+
648
+ const index = flatten(value);
649
+
650
+ // special case — value is represented as a negative index
651
+ if (index < 0) return `${index}`;
652
+
653
+ return stringified;
654
+ }
655
+
656
+ /**
657
+ * @param {any} thing
658
+ * @returns {string}
659
+ */
660
+ function stringify_primitive(thing) {
661
+ const type = typeof thing;
662
+ if (type === 'string') return stringify_string(thing);
663
+ if (thing === void 0) return UNDEFINED.toString();
664
+ if (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO.toString();
665
+ if (type === 'bigint') return `["BigInt","${thing}"]`;
666
+ return String(thing);
667
+ }
668
+
669
+ //#region \0rolldown/runtime.js
670
+ var __defProp = Object.defineProperty;
671
+ var __exportAll = (all, no_symbols) => {
672
+ let target = {};
673
+ for (var name in all) __defProp(target, name, {
674
+ get: all[name],
675
+ enumerable: true
676
+ });
677
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
678
+ return target;
679
+ };
680
+ //#endregion
681
+ //#region ../../node_modules/@sveltejs/kit/src/runtime/app/paths/internal/server.js
682
+ var base = "";
683
+ var assets = base;
684
+ var app_dir = "_app";
685
+ var initial = {
686
+ base,
687
+ assets
688
+ };
689
+ /**
690
+ * @param {{ base: string, assets: string }} paths
691
+ */
692
+ function override(paths) {
693
+ base = paths.base;
694
+ assets = paths.assets;
695
+ }
696
+ function reset() {
697
+ base = initial.base;
698
+ assets = initial.assets;
699
+ }
700
+ /**
701
+ * `$env/dynamic/public`
702
+ * @type {Record<string, string>}
703
+ */
704
+ var public_env = {};
705
+ /** @type {(environment: Record<string, string>) => void} */
706
+ function set_private_env(environment) {}
707
+ /** @type {(environment: Record<string, string>) => void} */
708
+ function set_public_env(environment) {
709
+ public_env = environment;
710
+ }
711
+ //#endregion
712
+ //#region ../../node_modules/svelte/src/internal/server/hydratable.js
713
+ /** @import { HydratableLookupEntry } from '#server' */
714
+ /**
715
+ * @template T
716
+ * @param {string} key
717
+ * @param {() => T} fn
718
+ * @returns {T}
719
+ */
720
+ function hydratable(key, fn) {
721
+ experimental_async_required();
722
+ const { hydratable } = get_render_context();
723
+ let entry = hydratable.lookup.get(key);
724
+ if (entry !== void 0) return entry.value;
725
+ const value = fn();
726
+ entry = encode(key, value, hydratable.unresolved_promises);
727
+ hydratable.lookup.set(key, entry);
728
+ return value;
729
+ }
730
+ /**
731
+ * @param {string} key
732
+ * @param {any} value
733
+ * @param {Map<Promise<any>, string>} [unresolved]
734
+ */
735
+ function encode(key, value, unresolved) {
736
+ /** @type {HydratableLookupEntry} */
737
+ const entry = {
738
+ value,
739
+ serialized: ""
740
+ };
741
+ let uid = 1;
742
+ entry.serialized = uneval(entry.value, (value, uneval) => {
743
+ if (is_promise(value)) {
744
+ const placeholder = `"${uid++}"`;
745
+ const p = value.then((v) => {
746
+ entry.serialized = entry.serialized.replace(placeholder, `r(${uneval(v)})`);
747
+ }).catch((devalue_error) => hydratable_serialization_failed(key, serialization_stack(entry.stack, devalue_error?.stack)));
748
+ p.catch(() => {}).finally(() => unresolved?.delete(p));
749
+ (entry.promises ??= []).push(p);
750
+ return placeholder;
751
+ }
752
+ });
753
+ return entry;
754
+ }
755
+ /**
756
+ * @param {any} value
757
+ * @returns {value is Promise<any>}
758
+ */
759
+ function is_promise(value) {
760
+ return Object.prototype.toString.call(value) === "[object Promise]";
761
+ }
762
+ /**
763
+ * @param {string | undefined} root_stack
764
+ * @param {string | undefined} uneval_stack
765
+ */
766
+ function serialization_stack(root_stack, uneval_stack) {
767
+ let out = "";
768
+ if (root_stack) out += root_stack + "\n";
769
+ if (uneval_stack) out += "Caused by:\n" + uneval_stack + "\n";
770
+ return out || "<missing stack trace>";
771
+ }
772
+ //#endregion
773
+ //#region ../../node_modules/svelte/src/internal/server/blocks/snippet.js
774
+ /** @import { Snippet } from 'svelte' */
775
+ /** @import { Renderer } from '../renderer' */
776
+ /** @import { Getters } from '#shared' */
777
+ /**
778
+ * Create a snippet programmatically
779
+ * @template {unknown[]} Params
780
+ * @param {(...params: Getters<Params>) => {
781
+ * render: () => string
782
+ * setup?: (element: Element) => void | (() => void)
783
+ * }} fn
784
+ * @returns {Snippet<Params>}
785
+ */
786
+ function createRawSnippet(fn) {
787
+ return (renderer, ...args) => {
788
+ var getters = args.map((value) => () => value);
789
+ renderer.push(fn(...getters).render().trim());
790
+ };
791
+ }
792
+ //#endregion
793
+ //#region ../../node_modules/svelte/src/index-server.js
794
+ /** @import { SSRContext } from '#server' */
795
+ /** @import { Renderer } from './internal/server/renderer.js' */
796
+ var index_server_exports = /* @__PURE__ */ __exportAll({
797
+ afterUpdate: () => noop$1,
798
+ beforeUpdate: () => noop$1,
799
+ createContext: () => createContext,
800
+ createEventDispatcher: () => createEventDispatcher,
801
+ createRawSnippet: () => createRawSnippet,
802
+ flushSync: () => noop$1,
803
+ fork: () => fork,
804
+ getAbortSignal: () => getAbortSignal,
805
+ getAllContexts: () => getAllContexts,
806
+ getContext: () => getContext,
807
+ hasContext: () => hasContext,
808
+ hydratable: () => hydratable,
809
+ hydrate: () => hydrate$1,
810
+ mount: () => mount$1,
811
+ onDestroy: () => onDestroy,
812
+ onMount: () => noop$1,
813
+ setContext: () => setContext,
814
+ settled: () => settled,
815
+ tick: () => tick,
816
+ unmount: () => unmount$1,
817
+ untrack: () => run$1
818
+ });
819
+ /** @param {() => void} fn */
820
+ function onDestroy(fn) {
821
+ /** @type {Renderer} */ ssr_context.r.on_destroy(fn);
822
+ }
823
+ function createEventDispatcher() {
824
+ return noop$1;
825
+ }
826
+ function mount$1() {
827
+ lifecycle_function_unavailable("mount");
828
+ }
829
+ function hydrate$1() {
830
+ lifecycle_function_unavailable("hydrate");
831
+ }
832
+ function unmount$1() {
833
+ lifecycle_function_unavailable("unmount");
834
+ }
835
+ function fork() {
836
+ lifecycle_function_unavailable("fork");
837
+ }
838
+ async function tick() {}
839
+ async function settled() {}
840
+
841
+ /** @import { StandardSchemaV1 } from '@standard-schema/spec' */
842
+
843
+ class HttpError {
844
+ /**
845
+ * @param {number} status
846
+ * @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body
847
+ */
848
+ constructor(status, body) {
849
+ this.status = status;
850
+ if (typeof body === 'string') {
851
+ this.body = { message: body };
852
+ } else if (body) {
853
+ this.body = body;
854
+ } else {
855
+ this.body = { message: `Error: ${status}` };
856
+ }
857
+ }
858
+
859
+ toString() {
860
+ return JSON.stringify(this.body);
861
+ }
862
+ }
863
+
864
+ class Redirect {
865
+ /**
866
+ * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status
867
+ * @param {string} location
868
+ */
869
+ constructor(status, location) {
870
+ try {
871
+ new Headers({ location });
872
+ } catch {
873
+ throw new Error(
874
+ `Invalid redirect location ${JSON.stringify(location)}: ` +
875
+ 'this string contains characters that cannot be used in HTTP headers'
876
+ );
877
+ }
878
+
879
+ this.status = status;
880
+ this.location = location;
881
+ }
882
+ }
883
+
884
+ /**
885
+ * An error that was thrown from within the SvelteKit runtime that is not fatal and doesn't result in a 500, such as a 404.
886
+ * `SvelteKitError` goes through `handleError`.
887
+ * @extends Error
888
+ */
889
+ class SvelteKitError extends Error {
890
+ /**
891
+ * @param {number} status
892
+ * @param {string} text
893
+ * @param {string} message
894
+ */
895
+ constructor(status, text, message) {
896
+ super(message);
897
+ this.status = status;
898
+ this.text = text;
899
+ }
900
+ }
901
+
902
+ /**
903
+ * @template [T=undefined]
904
+ */
905
+ class ActionFailure {
906
+ /**
907
+ * @param {number} status
908
+ * @param {T} data
909
+ */
910
+ constructor(status, data) {
911
+ this.status = status;
912
+ this.data = data;
913
+ }
914
+ }
915
+
916
+ //#region ../../node_modules/@sveltejs/kit/src/utils/functions.js
917
+ function noop() {}
918
+ /**
919
+ * @template T
920
+ * @param {() => T} fn
921
+ */
922
+ function once(fn) {
923
+ let done = false;
924
+ /** @type T */
925
+ let result;
926
+ return () => {
927
+ if (done) return result;
928
+ done = true;
929
+ return result = fn();
930
+ };
931
+ }
932
+ //#endregion
933
+ //#region ../../node_modules/@sveltejs/kit/src/runtime/utils.js
934
+ var text_encoder = new TextEncoder();
935
+ /**
936
+ * Like node's path.relative, but without using node
937
+ * @param {string} from
938
+ * @param {string} to
939
+ */
940
+ function get_relative_path(from, to) {
941
+ const from_parts = from.split(/[/\\]/);
942
+ const to_parts = to.split(/[/\\]/);
943
+ from_parts.pop();
944
+ while (from_parts[0] === to_parts[0]) {
945
+ from_parts.shift();
946
+ to_parts.shift();
947
+ }
948
+ let i = from_parts.length;
949
+ while (i--) from_parts[i] = "..";
950
+ return from_parts.concat(to_parts).join("/");
951
+ }
952
+ /**
953
+ * @param {Uint8Array} bytes
954
+ * @returns {string}
955
+ */
956
+ function base64_encode(bytes) {
957
+ if (globalThis.Buffer) return globalThis.Buffer.from(bytes).toString("base64");
958
+ let binary = "";
959
+ for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);
960
+ return btoa(binary);
961
+ }
962
+ /**
963
+ * @param {string} encoded
964
+ * @returns {Uint8Array}
965
+ */
966
+ function base64_decode(encoded) {
967
+ if (globalThis.Buffer) {
968
+ const buffer = globalThis.Buffer.from(encoded, "base64");
969
+ return new Uint8Array(buffer);
970
+ }
971
+ const binary = atob(encoded);
972
+ const bytes = new Uint8Array(binary.length);
973
+ for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
974
+ return bytes;
975
+ }
976
+ //#endregion
977
+ //#region ../../node_modules/@sveltejs/kit/src/utils/error.js
978
+ /**
979
+ * @param {unknown} err
980
+ * @return {Error}
981
+ */
982
+ function coalesce_to_error(err) {
983
+ return err instanceof Error || err && err.name && err.message ? err : new Error(JSON.stringify(err));
984
+ }
985
+ /**
986
+ * This is an identity function that exists to make TypeScript less
987
+ * paranoid about people throwing things that aren't errors, which
988
+ * frankly is not something we should care about
989
+ * @param {unknown} error
990
+ */
991
+ function normalize_error(error) {
992
+ return error;
993
+ }
994
+ /**
995
+ * @param {unknown} error
996
+ */
997
+ function get_status(error) {
998
+ return error instanceof HttpError || error instanceof SvelteKitError ? error.status : 500;
999
+ }
1000
+ /**
1001
+ * @param {unknown} error
1002
+ */
1003
+ function get_message(error) {
1004
+ return error instanceof SvelteKitError ? error.text : "Internal Error";
1005
+ }
1006
+ var INVALIDATED_PARAM = "x-sveltekit-invalidated";
1007
+ var TRAILING_SLASH_PARAM = "x-sveltekit-trailing-slash";
1008
+ /**
1009
+ * Try to `devalue.stringify` the data object using the provided transport encoders.
1010
+ * @param {any} data
1011
+ * @param {Transport} transport
1012
+ */
1013
+ function stringify(data, transport) {
1014
+ const encoders = Object.fromEntries(Object.entries(transport).map(([k, v]) => [k, v.encode]));
1015
+ return stringify$1(data, encoders);
1016
+ }
1017
+ var remote_object = "__skrao";
1018
+ var remote_map = "__skram";
1019
+ var remote_set = "__skras";
1020
+ /** @param {Transport} transport */
1021
+ function create_remote_arg_revivers(transport) {
1022
+ const remote_fns_revivers = {
1023
+ /** @type {(value: unknown) => unknown} */
1024
+ [remote_object]: (value) => value,
1025
+ /** @type {(value: unknown) => Map<unknown, unknown>} */
1026
+ [remote_map]: (value) => {
1027
+ if (!Array.isArray(value)) throw new Error("Invalid data for Map reviver");
1028
+ const map = /* @__PURE__ */ new Map();
1029
+ for (const item of value) {
1030
+ if (!Array.isArray(item) || item.length !== 2 || typeof item[0] !== "string" || typeof item[1] !== "string") throw new Error("Invalid data for Map reviver");
1031
+ const [key, val] = item;
1032
+ map.set(parse$1(key), parse$1(val));
1033
+ }
1034
+ return map;
1035
+ },
1036
+ /** @type {(value: unknown) => Set<unknown>} */
1037
+ [remote_set]: (value) => {
1038
+ if (!Array.isArray(value)) throw new Error("Invalid data for Set reviver");
1039
+ const set = /* @__PURE__ */ new Set();
1040
+ for (const item of value) {
1041
+ if (typeof item !== "string") throw new Error("Invalid data for Set reviver");
1042
+ set.add(parse$1(item));
1043
+ }
1044
+ return set;
1045
+ }
1046
+ };
1047
+ const all_revivers = {
1048
+ ...Object.fromEntries(Object.entries(transport).map(([k, v]) => [k, v.decode])),
1049
+ ...remote_fns_revivers
1050
+ };
1051
+ /** @type {(data: string) => unknown} */
1052
+ const parse$1 = (data) => parse(data, all_revivers);
1053
+ return all_revivers;
1054
+ }
1055
+ /**
1056
+ * Parses the argument (if any) for a remote function
1057
+ * @param {string} string
1058
+ * @param {Transport} transport
1059
+ */
1060
+ function parse_remote_arg(string, transport) {
1061
+ if (!string) return void 0;
1062
+ const json_string = new TextDecoder().decode(base64_decode(string.replaceAll("-", "+").replaceAll("_", "/")));
1063
+ return parse(json_string, create_remote_arg_revivers(transport));
1064
+ }
1065
+ /**
1066
+ * @param {string} id
1067
+ * @param {string} payload
1068
+ */
1069
+ function create_remote_key(id, payload) {
1070
+ return id + "/" + payload;
1071
+ }
1072
+ /**
1073
+ * @param {string} key
1074
+ * @returns {{ id: string; payload: string }}
1075
+ */
1076
+ function split_remote_key(key) {
1077
+ const i = key.lastIndexOf("/");
1078
+ if (i === -1) throw new Error(`Invalid remote key: ${key}`);
1079
+ return {
1080
+ id: key.slice(0, i),
1081
+ payload: key.slice(i + 1)
1082
+ };
1083
+ }
1084
+
1085
+ // eslint-disable-next-line n/prefer-global/process
1086
+ const IN_WEBCONTAINER = !!globalThis.process?.versions?.webcontainer;
1087
+
1088
+ /** @import { RequestEvent } from '@sveltejs/kit' */
1089
+ /** @import { RequestStore } from 'types' */
1090
+ /** @import { AsyncLocalStorage } from 'node:async_hooks' */
1091
+
1092
+
1093
+ /** @type {RequestStore | null} */
1094
+ let sync_store = null;
1095
+
1096
+ /** @type {AsyncLocalStorage<RequestStore | null> | null} */
1097
+ let als;
1098
+
1099
+ import('node:async_hooks')
1100
+ .then((hooks) => (als = new hooks.AsyncLocalStorage()))
1101
+ .catch(() => {
1102
+ // can't use AsyncLocalStorage, but can still call getRequestEvent synchronously.
1103
+ // this isn't behind `supports` because it's basically just StackBlitz (i.e.
1104
+ // in-browser usage) that doesn't support it AFAICT
1105
+ });
1106
+
1107
+ /**
1108
+ * @template T
1109
+ * @param {RequestStore | null} store
1110
+ * @param {() => T} fn
1111
+ */
1112
+ function with_request_store(store, fn) {
1113
+ try {
1114
+ sync_store = store;
1115
+ return als ? als.run(store, fn) : fn();
1116
+ } finally {
1117
+ // Since AsyncLocalStorage is not working in webcontainers, we don't reset `sync_store`
1118
+ // and handle only one request at a time in `src/runtime/server/index.js`.
1119
+ if (!IN_WEBCONTAINER) {
1120
+ sync_store = null;
1121
+ }
1122
+ }
1123
+ }
1124
+
1125
+ //#region ../../node_modules/@sveltejs/kit/src/utils/array.js
1126
+ /**
1127
+ * Removes nullish values from an array.
1128
+ *
1129
+ * @template T
1130
+ * @param {Array<T>} arr
1131
+ */
1132
+ function compact(arr) {
1133
+ return arr.filter(
1134
+ /** @returns {val is NonNullable<T>} */
1135
+ (val) => val != null
1136
+ );
1137
+ }
1138
+ //#endregion
1139
+ //#region ../../node_modules/@sveltejs/kit/src/runtime/pathname.js
1140
+ var DATA_SUFFIX = "/__data.json";
1141
+ var HTML_DATA_SUFFIX = ".html__data.json";
1142
+ /** @param {string} pathname */
1143
+ function has_data_suffix(pathname) {
1144
+ return pathname.endsWith(DATA_SUFFIX) || pathname.endsWith(HTML_DATA_SUFFIX);
1145
+ }
1146
+ /** @param {string} pathname */
1147
+ function add_data_suffix(pathname) {
1148
+ if (pathname.endsWith(".html")) return pathname.replace(/\.html$/, HTML_DATA_SUFFIX);
1149
+ return pathname.replace(/\/$/, "") + DATA_SUFFIX;
1150
+ }
1151
+ /** @param {string} pathname */
1152
+ function strip_data_suffix(pathname) {
1153
+ if (pathname.endsWith(HTML_DATA_SUFFIX)) return pathname.slice(0, -16) + ".html";
1154
+ return pathname.slice(0, -12);
1155
+ }
1156
+ var ROUTE_SUFFIX = "/__route.js";
1157
+ /**
1158
+ * @param {string} pathname
1159
+ * @returns {boolean}
1160
+ */
1161
+ function has_resolution_suffix(pathname) {
1162
+ return pathname.endsWith(ROUTE_SUFFIX);
1163
+ }
1164
+ /**
1165
+ * Convert a regular URL to a route to send to SvelteKit's server-side route resolution endpoint
1166
+ * @param {string} pathname
1167
+ * @returns {string}
1168
+ */
1169
+ function add_resolution_suffix(pathname) {
1170
+ return pathname.replace(/\/$/, "") + ROUTE_SUFFIX;
1171
+ }
1172
+ /**
1173
+ * @param {string} pathname
1174
+ * @returns {string}
1175
+ */
1176
+ function strip_resolution_suffix(pathname) {
1177
+ return pathname.slice(0, -11);
1178
+ }
1179
+ //#endregion
1180
+ //#region ../../node_modules/@sveltejs/kit/src/runtime/telemetry/noop.js
1181
+ /**
1182
+ * @type {Span}
1183
+ */
1184
+ var noop_span = {
1185
+ spanContext() {
1186
+ return noop_span_context;
1187
+ },
1188
+ setAttribute() {
1189
+ return this;
1190
+ },
1191
+ setAttributes() {
1192
+ return this;
1193
+ },
1194
+ addEvent() {
1195
+ return this;
1196
+ },
1197
+ setStatus() {
1198
+ return this;
1199
+ },
1200
+ updateName() {
1201
+ return this;
1202
+ },
1203
+ end() {
1204
+ return this;
1205
+ },
1206
+ isRecording() {
1207
+ return false;
1208
+ },
1209
+ recordException() {
1210
+ return this;
1211
+ },
1212
+ addLink() {
1213
+ return this;
1214
+ },
1215
+ addLinks() {
1216
+ return this;
1217
+ }
1218
+ };
1219
+ /**
1220
+ * @type {SpanContext}
1221
+ */
1222
+ var noop_span_context = {
1223
+ traceId: "",
1224
+ spanId: "",
1225
+ traceFlags: 0
1226
+ };
1227
+ var internal = new URL("sveltekit-internal://");
1228
+ /**
1229
+ * @param {string} base
1230
+ * @param {string} path
1231
+ */
1232
+ function resolve(base, path) {
1233
+ if (path[0] === "/" && path[1] === "/") return path;
1234
+ let url = new URL(base, internal);
1235
+ url = new URL(path, url);
1236
+ return url.protocol === internal.protocol ? url.pathname + url.search + url.hash : url.href;
1237
+ }
1238
+ /**
1239
+ * @param {string} path
1240
+ * @param {import('types').TrailingSlash} trailing_slash
1241
+ */
1242
+ function normalize_path(path, trailing_slash) {
1243
+ if (path === "/" || trailing_slash === "ignore") return path;
1244
+ if (trailing_slash === "never") return path.endsWith("/") ? path.slice(0, -1) : path;
1245
+ else if (trailing_slash === "always" && !path.endsWith("/")) return path + "/";
1246
+ return path;
1247
+ }
1248
+ /**
1249
+ * Decode pathname excluding %25 to prevent further double decoding of params
1250
+ * @param {string} pathname
1251
+ */
1252
+ function decode_pathname(pathname) {
1253
+ return pathname.split("%25").map(decodeURI).join("%25");
1254
+ }
1255
+ /** @param {Record<string, string>} params */
1256
+ function decode_params(params) {
1257
+ for (const key in params) params[key] = decodeURIComponent(params[key]);
1258
+ return params;
1259
+ }
1260
+ /**
1261
+ * @param {URL} url
1262
+ * @param {() => void} callback
1263
+ * @param {(search_param: string) => void} search_params_callback
1264
+ * @param {boolean} [allow_hash]
1265
+ */
1266
+ function make_trackable(url, callback, search_params_callback, allow_hash = false) {
1267
+ const tracked = new URL(url);
1268
+ Object.defineProperty(tracked, "searchParams", {
1269
+ value: new Proxy(tracked.searchParams, { get(obj, key) {
1270
+ if (key === "get" || key === "getAll" || key === "has") return (param, ...rest) => {
1271
+ search_params_callback(param);
1272
+ return obj[key](param, ...rest);
1273
+ };
1274
+ callback();
1275
+ const value = Reflect.get(obj, key);
1276
+ return typeof value === "function" ? value.bind(obj) : value;
1277
+ } }),
1278
+ enumerable: true,
1279
+ configurable: true
1280
+ });
1281
+ /**
1282
+ * URL properties that could change during the lifetime of the page,
1283
+ * which excludes things like `origin`
1284
+ */
1285
+ const tracked_url_properties = [
1286
+ "href",
1287
+ "pathname",
1288
+ "search",
1289
+ "toString",
1290
+ "toJSON"
1291
+ ];
1292
+ if (allow_hash) tracked_url_properties.push("hash");
1293
+ for (const property of tracked_url_properties) Object.defineProperty(tracked, property, {
1294
+ get() {
1295
+ callback();
1296
+ return url[property];
1297
+ },
1298
+ enumerable: true,
1299
+ configurable: true
1300
+ });
1301
+ tracked[Symbol.for("nodejs.util.inspect.custom")] = (_depth, opts, inspect) => {
1302
+ return inspect(url, opts);
1303
+ };
1304
+ tracked.searchParams[Symbol.for("nodejs.util.inspect.custom")] = (_depth, opts, inspect) => {
1305
+ return inspect(url.searchParams, opts);
1306
+ };
1307
+ if (!allow_hash) disable_hash(tracked);
1308
+ return tracked;
1309
+ }
1310
+ /**
1311
+ * Disallow access to `url.hash` on the server and in `load`
1312
+ * @param {URL} url
1313
+ */
1314
+ function disable_hash(url) {
1315
+ allow_nodejs_console_log(url);
1316
+ Object.defineProperty(url, "hash", { get() {
1317
+ throw new Error("Cannot access event.url.hash. Consider using `page.url.hash` inside a component instead");
1318
+ } });
1319
+ }
1320
+ /**
1321
+ * Disallow access to `url.search` and `url.searchParams` during prerendering
1322
+ * @param {URL} url
1323
+ */
1324
+ function disable_search(url) {
1325
+ allow_nodejs_console_log(url);
1326
+ for (const property of ["search", "searchParams"]) Object.defineProperty(url, property, { get() {
1327
+ throw new Error(`Cannot access url.${property} on a page with prerendering enabled`);
1328
+ } });
1329
+ }
1330
+ /**
1331
+ * Allow URL to be console logged, bypassing disabled properties.
1332
+ * @param {URL} url
1333
+ */
1334
+ function allow_nodejs_console_log(url) {
1335
+ url[Symbol.for("nodejs.util.inspect.custom")] = (_depth, opts, inspect) => {
1336
+ return inspect(new URL(url), opts);
1337
+ };
1338
+ }
1339
+ //#endregion
1340
+ //#region ../../node_modules/@sveltejs/kit/src/utils/hash.js
1341
+ /**
1342
+ * Hash using djb2
1343
+ * @param {import('types').StrictBody[]} values
1344
+ */
1345
+ function hash(...values) {
1346
+ let hash = 5381;
1347
+ for (const value of values) if (typeof value === "string") {
1348
+ let i = value.length;
1349
+ while (i) hash = hash * 33 ^ value.charCodeAt(--i);
1350
+ } else if (ArrayBuffer.isView(value)) {
1351
+ const buffer = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
1352
+ let i = buffer.length;
1353
+ while (i) hash = hash * 33 ^ buffer[--i];
1354
+ } else throw new TypeError("value must be a string or TypedArray");
1355
+ return (hash >>> 0).toString(36);
1356
+ }
1357
+ //#endregion
1358
+ //#region ../../node_modules/@sveltejs/kit/src/utils/routing.js
1359
+ /**
1360
+ * @param {RegExpMatchArray} match
1361
+ * @param {import('types').RouteParam[]} params
1362
+ * @param {Record<string, import('@sveltejs/kit').ParamMatcher>} matchers
1363
+ */
1364
+ function exec(match, params, matchers) {
1365
+ /** @type {Record<string, string>} */
1366
+ const result = {};
1367
+ const values = match.slice(1);
1368
+ const values_needing_match = values.filter((value) => value !== void 0);
1369
+ let buffered = 0;
1370
+ for (let i = 0; i < params.length; i += 1) {
1371
+ const param = params[i];
1372
+ let value = values[i - buffered];
1373
+ if (param.chained && param.rest && buffered) {
1374
+ value = values.slice(i - buffered, i + 1).filter((s) => s).join("/");
1375
+ buffered = 0;
1376
+ }
1377
+ if (value === void 0) if (param.rest) value = "";
1378
+ else continue;
1379
+ if (!param.matcher || matchers[param.matcher](value)) {
1380
+ result[param.name] = value;
1381
+ const next_param = params[i + 1];
1382
+ const next_value = values[i + 1];
1383
+ if (next_param && !next_param.rest && next_param.optional && next_value && param.chained) buffered = 0;
1384
+ if (!next_param && !next_value && Object.keys(result).length === values_needing_match.length) buffered = 0;
1385
+ continue;
1386
+ }
1387
+ if (param.optional && param.chained) {
1388
+ buffered++;
1389
+ continue;
1390
+ }
1391
+ return;
1392
+ }
1393
+ if (buffered) return;
1394
+ return result;
1395
+ }
1396
+ /**
1397
+ * Find the first route that matches the given path
1398
+ * @template {{pattern: RegExp, params: import('types').RouteParam[]}} Route
1399
+ * @param {string} path - The decoded pathname to match
1400
+ * @param {Route[]} routes
1401
+ * @param {Record<string, import('@sveltejs/kit').ParamMatcher>} matchers
1402
+ * @returns {{ route: Route, params: Record<string, string> } | null}
1403
+ */
1404
+ function find_route(path, routes, matchers) {
1405
+ for (const route of routes) {
1406
+ const match = route.pattern.exec(path);
1407
+ if (!match) continue;
1408
+ const matched = exec(match, route.params, matchers);
1409
+ if (matched) return {
1410
+ route,
1411
+ params: decode_params(matched)
1412
+ };
1413
+ }
1414
+ return null;
1415
+ }
1416
+ //#endregion
1417
+ //#region ../../node_modules/@sveltejs/kit/src/utils/exports.js
1418
+ /**
1419
+ * @param {Set<string>} expected
1420
+ */
1421
+ function validator(expected) {
1422
+ /**
1423
+ * @param {any} module
1424
+ * @param {string} [file]
1425
+ */
1426
+ function validate(module, file) {
1427
+ if (!module) return;
1428
+ for (const key in module) {
1429
+ if (key[0] === "_" || expected.has(key)) continue;
1430
+ const values = [...expected.values()];
1431
+ const hint = hint_for_supported_files(key, file?.slice(file.lastIndexOf("."))) ?? `valid exports are ${values.join(", ")}, or anything with a '_' prefix`;
1432
+ throw new Error(`Invalid export '${key}'${file ? ` in ${file}` : ""} (${hint})`);
1433
+ }
1434
+ }
1435
+ return validate;
1436
+ }
1437
+ /**
1438
+ * @param {string} key
1439
+ * @param {string} ext
1440
+ * @returns {string | void}
1441
+ */
1442
+ function hint_for_supported_files(key, ext = ".js") {
1443
+ const supported_files = [];
1444
+ if (valid_layout_exports.has(key)) supported_files.push(`+layout${ext}`);
1445
+ if (valid_page_exports.has(key)) supported_files.push(`+page${ext}`);
1446
+ if (valid_layout_server_exports.has(key)) supported_files.push(`+layout.server${ext}`);
1447
+ if (valid_page_server_exports.has(key)) supported_files.push(`+page.server${ext}`);
1448
+ if (valid_server_exports.has(key)) supported_files.push(`+server${ext}`);
1449
+ if (supported_files.length > 0) return `'${key}' is a valid export in ${supported_files.slice(0, -1).join(", ")}${supported_files.length > 1 ? " or " : ""}${supported_files.at(-1)}`;
1450
+ }
1451
+ var valid_layout_exports = new Set([
1452
+ "load",
1453
+ "prerender",
1454
+ "csr",
1455
+ "ssr",
1456
+ "trailingSlash",
1457
+ "config"
1458
+ ]);
1459
+ var valid_page_exports = new Set([...valid_layout_exports, "entries"]);
1460
+ var valid_layout_server_exports = new Set([...valid_layout_exports]);
1461
+ var valid_page_server_exports = new Set([
1462
+ ...valid_layout_server_exports,
1463
+ "actions",
1464
+ "entries"
1465
+ ]);
1466
+ var valid_server_exports = new Set([
1467
+ "GET",
1468
+ "POST",
1469
+ "PATCH",
1470
+ "PUT",
1471
+ "DELETE",
1472
+ "OPTIONS",
1473
+ "HEAD",
1474
+ "fallback",
1475
+ "prerender",
1476
+ "trailingSlash",
1477
+ "config",
1478
+ "entries"
1479
+ ]);
1480
+ var validate_layout_exports = validator(valid_layout_exports);
1481
+ var validate_page_exports = validator(valid_page_exports);
1482
+ var validate_layout_server_exports = validator(valid_layout_server_exports);
1483
+ var validate_page_server_exports = validator(valid_page_server_exports);
1484
+
1485
+ //#region \0virtual:__sveltekit/server
1486
+ var read_implementation = null;
1487
+ function set_read_implementation(fn) {
1488
+ read_implementation = fn;
1489
+ }
1490
+ //#endregion
1491
+ //#region ../../node_modules/svelte/src/internal/client/dom/elements/events.js
1492
+ /**
1493
+ * Used on elements, as a map of event type -> event handler,
1494
+ * and on events themselves to track which element handled an event
1495
+ */
1496
+ var event_symbol = Symbol("events");
1497
+ /** @type {Set<string>} */
1498
+ var all_registered_events = /* @__PURE__ */ new Set();
1499
+ /** @type {Set<(events: Array<string>) => void>} */
1500
+ var root_event_handles = /* @__PURE__ */ new Set();
1501
+ var last_propagated_event = null;
1502
+ /**
1503
+ * @this {EventTarget}
1504
+ * @param {Event} event
1505
+ * @returns {void}
1506
+ */
1507
+ function handle_event_propagation(event) {
1508
+ var handler_element = this;
1509
+ var owner_document = handler_element.ownerDocument;
1510
+ var event_name = event.type;
1511
+ var path = event.composedPath?.() || [];
1512
+ var current_target = path[0] || event.target;
1513
+ last_propagated_event = event;
1514
+ var path_idx = 0;
1515
+ var handled_at = last_propagated_event === event && event[event_symbol];
1516
+ if (handled_at) {
1517
+ var at_idx = path.indexOf(handled_at);
1518
+ if (at_idx !== -1 && (handler_element === document || handler_element === window)) {
1519
+ event[event_symbol] = handler_element;
1520
+ return;
1521
+ }
1522
+ var handler_idx = path.indexOf(handler_element);
1523
+ if (handler_idx === -1) return;
1524
+ if (at_idx <= handler_idx) path_idx = at_idx;
1525
+ }
1526
+ current_target = path[path_idx] || event.target;
1527
+ if (current_target === handler_element) return;
1528
+ define_property(event, "currentTarget", {
1529
+ configurable: true,
1530
+ get() {
1531
+ return current_target || owner_document;
1532
+ }
1533
+ });
1534
+ var previous_reaction = active_reaction;
1535
+ var previous_effect = active_effect;
1536
+ set_active_reaction(null);
1537
+ set_active_effect(null);
1538
+ try {
1539
+ /**
1540
+ * @type {unknown}
1541
+ */
1542
+ var throw_error;
1543
+ /**
1544
+ * @type {unknown[]}
1545
+ */
1546
+ var other_errors = [];
1547
+ while (current_target !== null) {
1548
+ /** @type {null | Element} */
1549
+ var parent_element = current_target.assignedSlot || current_target.parentNode || current_target.host || null;
1550
+ try {
1551
+ var delegated = current_target[event_symbol]?.[event_name];
1552
+ if (delegated != null && (!current_target.disabled || event.target === current_target)) delegated.call(current_target, event);
1553
+ } catch (error) {
1554
+ if (throw_error) other_errors.push(error);
1555
+ else throw_error = error;
1556
+ }
1557
+ if (event.cancelBubble || parent_element === handler_element || parent_element === null) break;
1558
+ current_target = parent_element;
1559
+ }
1560
+ if (throw_error) {
1561
+ for (let error of other_errors) queueMicrotask(() => {
1562
+ throw error;
1563
+ });
1564
+ throw throw_error;
1565
+ }
1566
+ } finally {
1567
+ event[event_symbol] = handler_element;
1568
+ delete event.currentTarget;
1569
+ set_active_reaction(previous_reaction);
1570
+ set_active_effect(previous_effect);
1571
+ }
1572
+ }
1573
+ //#endregion
1574
+ //#region ../../node_modules/svelte/src/internal/client/dom/template.js
1575
+ /**
1576
+ * @param {TemplateNode} start
1577
+ * @param {TemplateNode | null} end
1578
+ */
1579
+ function assign_nodes(start, end) {
1580
+ var effect = active_effect;
1581
+ if (effect.nodes === null) effect.nodes = {
1582
+ start,
1583
+ end,
1584
+ a: null,
1585
+ t: null
1586
+ };
1587
+ }
1588
+ /**
1589
+ * Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.
1590
+ * Transitions will play during the initial render unless the `intro` option is set to `false`.
1591
+ *
1592
+ * @template {Record<string, any>} Props
1593
+ * @template {Record<string, any>} Exports
1594
+ * @param {ComponentType<SvelteComponent<Props>> | Component<Props, Exports, any>} component
1595
+ * @param {MountOptions<Props>} options
1596
+ * @returns {Exports}
1597
+ */
1598
+ function mount(component, options) {
1599
+ return _mount(component, options);
1600
+ }
1601
+ /**
1602
+ * Hydrates a component on the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component
1603
+ *
1604
+ * @template {Record<string, any>} Props
1605
+ * @template {Record<string, any>} Exports
1606
+ * @param {ComponentType<SvelteComponent<Props>> | Component<Props, Exports, any>} component
1607
+ * @param {{} extends Props ? {
1608
+ * target: Document | Element | ShadowRoot;
1609
+ * props?: Props;
1610
+ * events?: Record<string, (e: any) => any>;
1611
+ * context?: Map<any, any>;
1612
+ * intro?: boolean;
1613
+ * recover?: boolean;
1614
+ * transformError?: (error: unknown) => unknown;
1615
+ * } : {
1616
+ * target: Document | Element | ShadowRoot;
1617
+ * props: Props;
1618
+ * events?: Record<string, (e: any) => any>;
1619
+ * context?: Map<any, any>;
1620
+ * intro?: boolean;
1621
+ * recover?: boolean;
1622
+ * transformError?: (error: unknown) => unknown;
1623
+ * }} options
1624
+ * @returns {Exports}
1625
+ */
1626
+ function hydrate(component, options) {
1627
+ init_operations();
1628
+ options.intro = options.intro ?? false;
1629
+ const target = options.target;
1630
+ const was_hydrating = hydrating;
1631
+ const previous_hydrate_node = hydrate_node;
1632
+ try {
1633
+ var anchor = /* @__PURE__ */ get_first_child(target);
1634
+ while (anchor && (anchor.nodeType !== 8 || anchor.data !== "[")) anchor = /* @__PURE__ */ get_next_sibling(anchor);
1635
+ if (!anchor) throw HYDRATION_ERROR;
1636
+ set_hydrating(true);
1637
+ set_hydrate_node(anchor);
1638
+ const instance = _mount(component, {
1639
+ ...options,
1640
+ anchor
1641
+ });
1642
+ set_hydrating(false);
1643
+ return instance;
1644
+ } catch (error) {
1645
+ if (error instanceof Error && error.message.split("\n").some((line) => line.startsWith("https://svelte.dev/e/"))) throw error;
1646
+ if (error !== HYDRATION_ERROR) console.warn("Failed to hydrate: ", error);
1647
+ if (options.recover === false) hydration_failed();
1648
+ init_operations();
1649
+ clear_text_content(target);
1650
+ set_hydrating(false);
1651
+ return mount(component, options);
1652
+ } finally {
1653
+ set_hydrating(was_hydrating);
1654
+ set_hydrate_node(previous_hydrate_node);
1655
+ }
1656
+ }
1657
+ /** @type {Map<EventTarget, Map<string, number>>} */
1658
+ var listeners = /* @__PURE__ */ new Map();
1659
+ /**
1660
+ * @template {Record<string, any>} Exports
1661
+ * @param {ComponentType<SvelteComponent<any>> | Component<any>} Component
1662
+ * @param {MountOptions} options
1663
+ * @returns {Exports}
1664
+ */
1665
+ function _mount(Component, { target, anchor, props = {}, events, context, intro = true, transformError }) {
1666
+ init_operations();
1667
+ /** @type {Exports} */
1668
+ var component = void 0;
1669
+ var unmount = component_root(() => {
1670
+ var anchor_node = anchor ?? target.appendChild(create_text());
1671
+ boundary(anchor_node, { pending: () => {} }, (anchor_node) => {
1672
+ push({});
1673
+ var ctx = component_context;
1674
+ if (context) ctx.c = context;
1675
+ if (events)
1676
+ /** @type {any} */ props.$$events = events;
1677
+ if (hydrating) assign_nodes(anchor_node, null);
1678
+ component = Component(anchor_node, props) || {};
1679
+ if (hydrating) {
1680
+ /** @type {Effect & { nodes: EffectNodes }} */ active_effect.nodes.end = hydrate_node;
1681
+ if (hydrate_node === null || hydrate_node.nodeType !== 8 || hydrate_node.data !== "]") {
1682
+ hydration_mismatch();
1683
+ throw HYDRATION_ERROR;
1684
+ }
1685
+ }
1686
+ pop();
1687
+ }, transformError);
1688
+ /** @type {Set<string>} */
1689
+ var registered_events = /* @__PURE__ */ new Set();
1690
+ /** @param {Array<string>} events */
1691
+ var event_handle = (events) => {
1692
+ for (var i = 0; i < events.length; i++) {
1693
+ var event_name = events[i];
1694
+ if (registered_events.has(event_name)) continue;
1695
+ registered_events.add(event_name);
1696
+ var passive = is_passive_event(event_name);
1697
+ for (const node of [target, document]) {
1698
+ var counts = listeners.get(node);
1699
+ if (counts === void 0) {
1700
+ counts = /* @__PURE__ */ new Map();
1701
+ listeners.set(node, counts);
1702
+ }
1703
+ var count = counts.get(event_name);
1704
+ if (count === void 0) {
1705
+ node.addEventListener(event_name, handle_event_propagation, { passive });
1706
+ counts.set(event_name, 1);
1707
+ } else counts.set(event_name, count + 1);
1708
+ }
1709
+ }
1710
+ };
1711
+ event_handle(array_from(all_registered_events));
1712
+ root_event_handles.add(event_handle);
1713
+ return () => {
1714
+ for (var event_name of registered_events) for (const node of [target, document]) {
1715
+ var counts = listeners.get(node);
1716
+ var count = counts.get(event_name);
1717
+ if (--count == 0) {
1718
+ node.removeEventListener(event_name, handle_event_propagation);
1719
+ counts.delete(event_name);
1720
+ if (counts.size === 0) listeners.delete(node);
1721
+ } else counts.set(event_name, count);
1722
+ }
1723
+ root_event_handles.delete(event_handle);
1724
+ if (anchor_node !== anchor) anchor_node.parentNode?.removeChild(anchor_node);
1725
+ };
1726
+ });
1727
+ mounted_components.set(component, unmount);
1728
+ return component;
1729
+ }
1730
+ /**
1731
+ * References of the components that were mounted or hydrated.
1732
+ * Uses a `WeakMap` to avoid memory leaks.
1733
+ */
1734
+ var mounted_components = /* @__PURE__ */ new WeakMap();
1735
+ /**
1736
+ * Unmounts a component that was previously mounted using `mount` or `hydrate`.
1737
+ *
1738
+ * Since 5.13.0, if `options.outro` is `true`, [transitions](https://svelte.dev/docs/svelte/transition) will play before the component is removed from the DOM.
1739
+ *
1740
+ * Returns a `Promise` that resolves after transitions have completed if `options.outro` is true, or immediately otherwise (prior to 5.13.0, returns `void`).
1741
+ *
1742
+ * ```js
1743
+ * import { mount, unmount } from 'svelte';
1744
+ * import App from './App.svelte';
1745
+ *
1746
+ * const app = mount(App, { target: document.body });
1747
+ *
1748
+ * // later...
1749
+ * unmount(app, { outro: true });
1750
+ * ```
1751
+ * @param {Record<string, any>} component
1752
+ * @param {{ outro?: boolean }} [options]
1753
+ * @returns {Promise<void>}
1754
+ */
1755
+ function unmount(component, options) {
1756
+ const fn = mounted_components.get(component);
1757
+ if (fn) {
1758
+ mounted_components.delete(component);
1759
+ return fn(options);
1760
+ }
1761
+ return Promise.resolve();
1762
+ }
1763
+ //#endregion
1764
+ //#region ../../node_modules/svelte/src/legacy/legacy-client.js
1765
+ /** @import { ComponentConstructorOptions, ComponentType, SvelteComponent, Component } from 'svelte' */
1766
+ /**
1767
+ * Takes the component function and returns a Svelte 4 compatible component constructor.
1768
+ *
1769
+ * @deprecated Use this only as a temporary solution to migrate your imperative component code to Svelte 5.
1770
+ *
1771
+ * @template {Record<string, any>} Props
1772
+ * @template {Record<string, any>} Exports
1773
+ * @template {Record<string, any>} Events
1774
+ * @template {Record<string, any>} Slots
1775
+ *
1776
+ * @param {SvelteComponent<Props, Events, Slots> | Component<Props>} component
1777
+ * @returns {ComponentType<SvelteComponent<Props, Events, Slots> & Exports>}
1778
+ */
1779
+ function asClassComponent$1(component) {
1780
+ return class extends Svelte4Component {
1781
+ /** @param {any} options */
1782
+ constructor(options) {
1783
+ super({
1784
+ component,
1785
+ ...options
1786
+ });
1787
+ }
1788
+ };
1789
+ }
1790
+ /**
1791
+ * Support using the component as both a class and function during the transition period
1792
+ * @typedef {{new (o: ComponentConstructorOptions): SvelteComponent;(...args: Parameters<Component<Record<string, any>>>): ReturnType<Component<Record<string, any>, Record<string, any>>>;}} LegacyComponentType
1793
+ */
1794
+ var Svelte4Component = class {
1795
+ /** @type {any} */
1796
+ #events;
1797
+ /** @type {Record<string, any>} */
1798
+ #instance;
1799
+ /**
1800
+ * @param {ComponentConstructorOptions & {
1801
+ * component: any;
1802
+ * }} options
1803
+ */
1804
+ constructor(options) {
1805
+ var sources = /* @__PURE__ */ new Map();
1806
+ /**
1807
+ * @param {string | symbol} key
1808
+ * @param {unknown} value
1809
+ */
1810
+ var add_source = (key, value) => {
1811
+ var s = /* @__PURE__ */ mutable_source(value, false, false);
1812
+ sources.set(key, s);
1813
+ return s;
1814
+ };
1815
+ const props = new Proxy({
1816
+ ...options.props || {},
1817
+ $$events: {}
1818
+ }, {
1819
+ get(target, prop) {
1820
+ return get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
1821
+ },
1822
+ has(target, prop) {
1823
+ if (prop === LEGACY_PROPS) return true;
1824
+ get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
1825
+ return Reflect.has(target, prop);
1826
+ },
1827
+ set(target, prop, value) {
1828
+ set(sources.get(prop) ?? add_source(prop, value), value);
1829
+ return Reflect.set(target, prop, value);
1830
+ }
1831
+ });
1832
+ this.#instance = (options.hydrate ? hydrate : mount)(options.component, {
1833
+ target: options.target,
1834
+ anchor: options.anchor,
1835
+ props,
1836
+ context: options.context,
1837
+ intro: options.intro ?? false,
1838
+ recover: options.recover,
1839
+ transformError: options.transformError
1840
+ });
1841
+ if ((!options?.props?.$$host || options.sync === false)) flushSync();
1842
+ this.#events = props.$$events;
1843
+ for (const key of Object.keys(this.#instance)) {
1844
+ if (key === "$set" || key === "$destroy" || key === "$on") continue;
1845
+ define_property(this, key, {
1846
+ get() {
1847
+ return this.#instance[key];
1848
+ },
1849
+ /** @param {any} value */
1850
+ set(value) {
1851
+ this.#instance[key] = value;
1852
+ },
1853
+ enumerable: true
1854
+ });
1855
+ }
1856
+ this.#instance.$set = (next) => {
1857
+ Object.assign(props, next);
1858
+ };
1859
+ this.#instance.$destroy = () => {
1860
+ unmount(this.#instance);
1861
+ };
1862
+ }
1863
+ /** @param {Record<string, any>} props */
1864
+ $set(props) {
1865
+ this.#instance.$set(props);
1866
+ }
1867
+ /**
1868
+ * @param {string} event
1869
+ * @param {(...args: any[]) => any} callback
1870
+ * @returns {any}
1871
+ */
1872
+ $on(event, callback) {
1873
+ this.#events[event] = this.#events[event] || [];
1874
+ /** @param {any[]} args */
1875
+ const cb = (...args) => callback.call(this, ...args);
1876
+ this.#events[event].push(cb);
1877
+ return () => {
1878
+ this.#events[event] = this.#events[event].filter(
1879
+ /** @param {any} fn */
1880
+ (fn) => fn !== cb
1881
+ );
1882
+ };
1883
+ }
1884
+ $destroy() {
1885
+ this.#instance.$destroy();
1886
+ }
1887
+ };
1888
+ //#endregion
1889
+ //#region ../../node_modules/svelte/src/legacy/legacy-server.js
1890
+ /** @import { SvelteComponent } from '../index.js' */
1891
+ /** @import { Csp } from '#server' */
1892
+ /** @typedef {{ head: string, html: string, css: { code: string, map: null }; hashes?: { script: `sha256-${string}`[] } }} LegacyRenderResult */
1893
+ /**
1894
+ * Takes a Svelte 5 component and returns a Svelte 4 compatible component constructor.
1895
+ *
1896
+ * @deprecated Use this only as a temporary solution to migrate your imperative component code to Svelte 5.
1897
+ *
1898
+ * @template {Record<string, any>} Props
1899
+ * @template {Record<string, any>} Exports
1900
+ * @template {Record<string, any>} Events
1901
+ * @template {Record<string, any>} Slots
1902
+ *
1903
+ * @param {SvelteComponent<Props, Events, Slots>} component
1904
+ * @returns {typeof SvelteComponent<Props, Events, Slots> & Exports}
1905
+ */
1906
+ function asClassComponent(component) {
1907
+ const component_constructor = asClassComponent$1(component);
1908
+ /** @type {(props?: {}, opts?: { $$slots?: {}; context?: Map<any, any>; csp?: Csp; transformError?: (error: unknown) => unknown }) => LegacyRenderResult & PromiseLike<LegacyRenderResult> } */
1909
+ const _render = (props, { context, csp, transformError } = {}) => {
1910
+ const result = render(component, {
1911
+ props,
1912
+ context,
1913
+ csp,
1914
+ transformError
1915
+ });
1916
+ const munged = Object.defineProperties({}, {
1917
+ css: { value: {
1918
+ code: "",
1919
+ map: null
1920
+ } },
1921
+ head: { get: () => result.head },
1922
+ html: { get: () => result.body },
1923
+ then: {
1924
+ /**
1925
+ * this is not type-safe, but honestly it's the best I can do right now, and it's a straightforward function.
1926
+ *
1927
+ * @template TResult1
1928
+ * @template [TResult2=never]
1929
+ * @param { (value: LegacyRenderResult) => TResult1 } onfulfilled
1930
+ * @param { (reason: unknown) => TResult2 } onrejected
1931
+ */
1932
+ value: (onfulfilled, onrejected) => {
1933
+ {
1934
+ const user_result = onfulfilled({
1935
+ css: munged.css,
1936
+ head: munged.head,
1937
+ html: munged.html
1938
+ });
1939
+ return Promise.resolve(user_result);
1940
+ }
1941
+ } }
1942
+ });
1943
+ return munged;
1944
+ };
1945
+ component_constructor.render = _render;
1946
+ return component_constructor;
1947
+ }
1948
+ //#endregion
1949
+ //#region .svelte-kit/generated/root.svelte
1950
+ function Root($$renderer, $$props) {
1951
+ $$renderer.component(($$renderer) => {
1952
+ let { stores, page, constructors, components = [], form, data_0 = null, data_1 = null } = $$props;
1953
+ setContext("__svelte__", stores);
1954
+ stores.page.set(page);
1955
+ const Pyramid_1 = derived(() => constructors[1]);
1956
+ if (constructors[1]) {
1957
+ $$renderer.push("<!--[0-->");
1958
+ const Pyramid_0 = constructors[0];
1959
+ if (Pyramid_0) {
1960
+ $$renderer.push("<!--[-->");
1961
+ Pyramid_0($$renderer, {
1962
+ data: data_0,
1963
+ form,
1964
+ params: page.params,
1965
+ children: ($$renderer) => {
1966
+ if (Pyramid_1()) {
1967
+ $$renderer.push("<!--[-->");
1968
+ Pyramid_1()($$renderer, {
1969
+ data: data_1,
1970
+ form,
1971
+ params: page.params
1972
+ });
1973
+ $$renderer.push("<!--]-->");
1974
+ } else {
1975
+ $$renderer.push("<!--[!-->");
1976
+ $$renderer.push("<!--]-->");
1977
+ }
1978
+ },
1979
+ $$slots: { default: true }
1980
+ });
1981
+ $$renderer.push("<!--]-->");
1982
+ } else {
1983
+ $$renderer.push("<!--[!-->");
1984
+ $$renderer.push("<!--]-->");
1985
+ }
1986
+ } else {
1987
+ $$renderer.push("<!--[-1-->");
1988
+ const Pyramid_0 = constructors[0];
1989
+ if (Pyramid_0) {
1990
+ $$renderer.push("<!--[-->");
1991
+ Pyramid_0($$renderer, {
1992
+ data: data_0,
1993
+ form,
1994
+ params: page.params
1995
+ });
1996
+ $$renderer.push("<!--]-->");
1997
+ } else {
1998
+ $$renderer.push("<!--[!-->");
1999
+ $$renderer.push("<!--]-->");
2000
+ }
2001
+ }
2002
+ $$renderer.push(`<!--]--> `);
2003
+ $$renderer.push("<!--[-1-->");
2004
+ $$renderer.push(`<!--]-->`);
2005
+ });
2006
+ }
2007
+ //#endregion
2008
+ //#region .svelte-kit/generated/server/internal.js
2009
+ var options = {
2010
+ app_template_contains_nonce: false,
2011
+ async: false,
2012
+ csp: {
2013
+ "mode": "auto",
2014
+ "directives": {
2015
+ "default-src": ["self"],
2016
+ "connect-src": ["self"],
2017
+ "font-src": ["self", "data:"],
2018
+ "img-src": ["self", "data:"],
2019
+ "script-src": ["self"],
2020
+ "style-src": ["self", "unsafe-inline"],
2021
+ "upgrade-insecure-requests": false,
2022
+ "block-all-mixed-content": false
2023
+ },
2024
+ "reportOnly": {
2025
+ "upgrade-insecure-requests": false,
2026
+ "block-all-mixed-content": false
2027
+ }
2028
+ },
2029
+ csrf_check_origin: true,
2030
+ csrf_trusted_origins: [],
2031
+ embedded: false,
2032
+ env_public_prefix: "PUBLIC_",
2033
+ env_private_prefix: "",
2034
+ hash_routing: false,
2035
+ hooks: null,
2036
+ preload_strategy: "modulepreload",
2037
+ root: asClassComponent(Root),
2038
+ service_worker: false,
2039
+ service_worker_options: void 0,
2040
+ server_error_boundaries: false,
2041
+ templates: {
2042
+ app: ({ head, body, assets, nonce, env }) => "<!DOCTYPE html>\n<html lang=\"en\" data-theme=\"dark\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <meta name=\"referrer\" content=\"no-referrer\" />\n <meta name=\"color-scheme\" content=\"dark\" />\n <link rel=\"icon\" href=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='6' fill='%234b8bf5'/%3E%3Crect x='9' y='9' width='14' height='14' fill='none' stroke='%23111' stroke-width='2'/%3E%3C/svg%3E\" />\n <title>agent-profile</title>\n " + head + "\n </head>\n <body>\n <div id=\"app\">" + body + "</div>\n </body>\n</html>\n",
2043
+ error: ({ status, message }) => "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>" + message + "</title>\n\n <style>\n body {\n --bg: white;\n --fg: #222;\n --divider: #ccc;\n background: var(--bg);\n color: var(--fg);\n font-family:\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Oxygen,\n Ubuntu,\n Cantarell,\n 'Open Sans',\n 'Helvetica Neue',\n sans-serif;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n margin: 0;\n }\n\n .error {\n display: flex;\n align-items: center;\n max-width: 32rem;\n margin: 0 1rem;\n }\n\n .status {\n font-weight: 200;\n font-size: 3rem;\n line-height: 1;\n position: relative;\n top: -0.05rem;\n }\n\n .message {\n border-left: 1px solid var(--divider);\n padding: 0 0 0 1rem;\n margin: 0 0 0 1rem;\n min-height: 2.5rem;\n display: flex;\n align-items: center;\n }\n\n .message h1 {\n font-weight: 400;\n font-size: 1em;\n margin: 0;\n }\n\n @media (prefers-color-scheme: dark) {\n body {\n --bg: #222;\n --fg: #ddd;\n --divider: #666;\n }\n }\n </style>\n </head>\n <body>\n <div class=\"error\">\n <span class=\"status\">" + status + "</span>\n <div class=\"message\">\n <h1>" + message + "</h1>\n </div>\n </div>\n </body>\n</html>\n"
2044
+ },
2045
+ version_hash: "1chlyyj"
2046
+ };
2047
+ async function get_hooks() {
2048
+ let handle;
2049
+ let handleFetch;
2050
+ let handleError;
2051
+ let handleValidationError;
2052
+ let init;
2053
+ ({handle, handleFetch, handleError, handleValidationError, init} = await import('./hooks.server-BGib69tn.js'));
2054
+ let reroute;
2055
+ let transport;
2056
+ return {
2057
+ handle,
2058
+ handleFetch,
2059
+ handleError,
2060
+ handleValidationError,
2061
+ init,
2062
+ reroute,
2063
+ transport
2064
+ };
2065
+ }
2066
+
2067
+ export { index_server_exports as $, noop_span as A, assets as B, app_dir as C, create_remote_key as D, hash as E, text_encoder as F, compact as G, HttpError as H, INVALIDATED_PARAM as I, once as J, normalize_error as K, resolve as L, parse_remote_arg as M, stringify as N, make_trackable as O, stringify$1 as P, ActionFailure as Q, Redirect as R, SvelteKitError as S, TRAILING_SLASH_PARAM as T, read_implementation as U, split_remote_key as V, get_relative_path as W, base64_encode as X, override as Y, reset as Z, set_read_implementation as _, get_message as a, set_public_env as b, coalesce_to_error as c, get_hooks as d, has_data_suffix as e, base as f, get_status as g, has_resolution_suffix as h, strip_resolution_suffix as i, strip_data_suffix as j, decode_pathname as k, add_data_suffix as l, add_resolution_suffix as m, noop as n, options as o, parse as p, find_route as q, normalize_path as r, set_private_env as s, disable_search as t, public_env as u, validate_layout_server_exports as v, with_request_store as w, validate_layout_exports as x, validate_page_server_exports as y, validate_page_exports as z };
2068
+ //# sourceMappingURL=internal-DDD35M_S.js.map