@triiiceratops/plugin-image-export 1.0.0-rc.4 → 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/dist/catalog.d.ts +5 -6
- package/dist/exportImage.d.ts +29 -7
- package/dist/identity.d.ts +10 -0
- package/dist/iife.js +1 -200
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -3579
- package/dist/plugin.d.ts +2 -2
- package/dist/reportError.d.ts +1 -1
- package/dist/styles.d.ts +3 -11
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -1,3579 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const fr = !1;
|
|
4
|
-
var
|
|
5
|
-
const tn = () => {
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
for (var t = 0; t < e.length; t++)
|
|
9
|
-
e[t]();
|
|
10
|
-
}
|
|
11
|
-
function rn() {
|
|
12
|
-
var e, t, r = new Promise((n, i) => {
|
|
13
|
-
e = n, t = i;
|
|
14
|
-
});
|
|
15
|
-
return { promise: r, resolve: e, reject: t };
|
|
16
|
-
}
|
|
17
|
-
const Q = 2, Er = 4, xr = 8, nn = 1 << 24, Ne = 16, Re = 32, tt = 64, Jt = 128, be = 512, te = 1024, ce = 2048, ze = 4096, pe = 8192, Pe = 16384, Sr = 32768, Xe = 65536, Or = 1 << 17, an = 1 << 18, ht = 1 << 19, Ai = 1 << 20, Le = 1 << 25, Je = 32768, cr = 1 << 21, Cr = 1 << 22, He = 1 << 23, Ye = Symbol("$state"), Ii = Symbol("legacy props"), ki = Symbol(""), ut = new class extends Error {
|
|
18
|
-
name = "StaleReactionError";
|
|
19
|
-
message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
|
|
20
|
-
}();
|
|
21
|
-
function Ti(e) {
|
|
22
|
-
throw new Error("https://svelte.dev/e/lifecycle_outside_component");
|
|
23
|
-
}
|
|
24
|
-
function Mi() {
|
|
25
|
-
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
26
|
-
}
|
|
27
|
-
function Di(e) {
|
|
28
|
-
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
29
|
-
}
|
|
30
|
-
function Li() {
|
|
31
|
-
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
32
|
-
}
|
|
33
|
-
function Pi(e) {
|
|
34
|
-
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
35
|
-
}
|
|
36
|
-
function Oi() {
|
|
37
|
-
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
38
|
-
}
|
|
39
|
-
function Ni(e) {
|
|
40
|
-
throw new Error("https://svelte.dev/e/props_invalid_value");
|
|
41
|
-
}
|
|
42
|
-
function Ri() {
|
|
43
|
-
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
44
|
-
}
|
|
45
|
-
function zi() {
|
|
46
|
-
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
47
|
-
}
|
|
48
|
-
function $i() {
|
|
49
|
-
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
50
|
-
}
|
|
51
|
-
function Fi() {
|
|
52
|
-
throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
|
|
53
|
-
}
|
|
54
|
-
const Bi = 1, Wi = 2, on = 4, Hi = 8, Vi = 16, qi = 1, Ui = 4, ji = 8, Yi = 16, Ki = 1, Gi = 2, X = Symbol(), Zi = "http://www.w3.org/1999/xhtml", Xi = "@attach";
|
|
55
|
-
function Ji() {
|
|
56
|
-
console.warn("https://svelte.dev/e/select_multiple_invalid_value");
|
|
57
|
-
}
|
|
58
|
-
function Qi() {
|
|
59
|
-
console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
|
|
60
|
-
}
|
|
61
|
-
function ln(e) {
|
|
62
|
-
return e === this.v;
|
|
63
|
-
}
|
|
64
|
-
function ea(e, t) {
|
|
65
|
-
return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
|
|
66
|
-
}
|
|
67
|
-
function sn(e) {
|
|
68
|
-
return !ea(e, this.v);
|
|
69
|
-
}
|
|
70
|
-
let ta = !1, ae = null;
|
|
71
|
-
function dt(e) {
|
|
72
|
-
ae = e;
|
|
73
|
-
}
|
|
74
|
-
function ra(e) {
|
|
75
|
-
return (
|
|
76
|
-
/** @type {T} */
|
|
77
|
-
na().get(e)
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
function Ar(e, t = !1, r) {
|
|
81
|
-
ae = {
|
|
82
|
-
p: ae,
|
|
83
|
-
i: !1,
|
|
84
|
-
c: null,
|
|
85
|
-
e: null,
|
|
86
|
-
s: e,
|
|
87
|
-
x: null,
|
|
88
|
-
l: null
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
function Ir(e) {
|
|
92
|
-
var t = (
|
|
93
|
-
/** @type {ComponentContext} */
|
|
94
|
-
ae
|
|
95
|
-
), r = t.e;
|
|
96
|
-
if (r !== null) {
|
|
97
|
-
t.e = null;
|
|
98
|
-
for (var n of r)
|
|
99
|
-
Sn(n);
|
|
100
|
-
}
|
|
101
|
-
return t.i = !0, ae = t.p, /** @type {T} */
|
|
102
|
-
{};
|
|
103
|
-
}
|
|
104
|
-
function un() {
|
|
105
|
-
return !0;
|
|
106
|
-
}
|
|
107
|
-
function na(e) {
|
|
108
|
-
return ae === null && Ti(), ae.c ??= new Map(ia(ae) || void 0);
|
|
109
|
-
}
|
|
110
|
-
function ia(e) {
|
|
111
|
-
let t = e.p;
|
|
112
|
-
for (; t !== null; ) {
|
|
113
|
-
const r = t.c;
|
|
114
|
-
if (r !== null)
|
|
115
|
-
return r;
|
|
116
|
-
t = t.p;
|
|
117
|
-
}
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
|
-
let ft = [];
|
|
121
|
-
function aa() {
|
|
122
|
-
var e = ft;
|
|
123
|
-
ft = [], Ci(e);
|
|
124
|
-
}
|
|
125
|
-
function rt(e) {
|
|
126
|
-
if (ft.length === 0) {
|
|
127
|
-
var t = ft;
|
|
128
|
-
queueMicrotask(() => {
|
|
129
|
-
t === ft && aa();
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
ft.push(e);
|
|
133
|
-
}
|
|
134
|
-
function fn(e) {
|
|
135
|
-
var t = M;
|
|
136
|
-
if (t === null)
|
|
137
|
-
return k.f |= He, e;
|
|
138
|
-
if ((t.f & Sr) === 0) {
|
|
139
|
-
if ((t.f & Jt) === 0)
|
|
140
|
-
throw e;
|
|
141
|
-
t.b.error(e);
|
|
142
|
-
} else
|
|
143
|
-
vt(e, t);
|
|
144
|
-
}
|
|
145
|
-
function vt(e, t) {
|
|
146
|
-
for (; t !== null; ) {
|
|
147
|
-
if ((t.f & Jt) !== 0)
|
|
148
|
-
try {
|
|
149
|
-
t.b.error(e);
|
|
150
|
-
return;
|
|
151
|
-
} catch (r) {
|
|
152
|
-
e = r;
|
|
153
|
-
}
|
|
154
|
-
t = t.parent;
|
|
155
|
-
}
|
|
156
|
-
throw e;
|
|
157
|
-
}
|
|
158
|
-
const Ft = /* @__PURE__ */ new Set();
|
|
159
|
-
let P = null, Ht = null, me = null, Ee = [], kr = null, dr = !1;
|
|
160
|
-
class xe {
|
|
161
|
-
committed = !1;
|
|
162
|
-
/**
|
|
163
|
-
* The current values of any sources that are updated in this batch
|
|
164
|
-
* They keys of this map are identical to `this.#previous`
|
|
165
|
-
* @type {Map<Source, any>}
|
|
166
|
-
*/
|
|
167
|
-
current = /* @__PURE__ */ new Map();
|
|
168
|
-
/**
|
|
169
|
-
* The values of any sources that are updated in this batch _before_ those updates took place.
|
|
170
|
-
* They keys of this map are identical to `this.#current`
|
|
171
|
-
* @type {Map<Source, any>}
|
|
172
|
-
*/
|
|
173
|
-
previous = /* @__PURE__ */ new Map();
|
|
174
|
-
/**
|
|
175
|
-
* When the batch is committed (and the DOM is updated), we need to remove old branches
|
|
176
|
-
* and append new ones by calling the functions added inside (if/each/key/etc) blocks
|
|
177
|
-
* @type {Set<() => void>}
|
|
178
|
-
*/
|
|
179
|
-
#e = /* @__PURE__ */ new Set();
|
|
180
|
-
/**
|
|
181
|
-
* If a fork is discarded, we need to destroy any effects that are no longer needed
|
|
182
|
-
* @type {Set<(batch: Batch) => void>}
|
|
183
|
-
*/
|
|
184
|
-
#t = /* @__PURE__ */ new Set();
|
|
185
|
-
/**
|
|
186
|
-
* The number of async effects that are currently in flight
|
|
187
|
-
*/
|
|
188
|
-
#n = 0;
|
|
189
|
-
/**
|
|
190
|
-
* The number of async effects that are currently in flight, _not_ inside a pending boundary
|
|
191
|
-
*/
|
|
192
|
-
#r = 0;
|
|
193
|
-
/**
|
|
194
|
-
* A deferred that resolves when the batch is committed, used with `settled()`
|
|
195
|
-
* TODO replace with Promise.withResolvers once supported widely enough
|
|
196
|
-
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
197
|
-
*/
|
|
198
|
-
#s = null;
|
|
199
|
-
/**
|
|
200
|
-
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
201
|
-
* @type {Effect[]}
|
|
202
|
-
*/
|
|
203
|
-
#a = [];
|
|
204
|
-
/**
|
|
205
|
-
* Deferred effects that are MAYBE_DIRTY
|
|
206
|
-
* @type {Effect[]}
|
|
207
|
-
*/
|
|
208
|
-
#i = [];
|
|
209
|
-
/**
|
|
210
|
-
* A set of branches that still exist, but will be destroyed when this batch
|
|
211
|
-
* is committed — we skip over these during `process`
|
|
212
|
-
* @type {Set<Effect>}
|
|
213
|
-
*/
|
|
214
|
-
skipped_effects = /* @__PURE__ */ new Set();
|
|
215
|
-
is_fork = !1;
|
|
216
|
-
is_deferred() {
|
|
217
|
-
return this.is_fork || this.#r > 0;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
*
|
|
221
|
-
* @param {Effect[]} root_effects
|
|
222
|
-
*/
|
|
223
|
-
process(t) {
|
|
224
|
-
Ee = [], Ht = null, this.apply();
|
|
225
|
-
var r = {
|
|
226
|
-
parent: null,
|
|
227
|
-
effect: null,
|
|
228
|
-
effects: [],
|
|
229
|
-
render_effects: [],
|
|
230
|
-
block_effects: []
|
|
231
|
-
};
|
|
232
|
-
for (const n of t)
|
|
233
|
-
this.#o(n, r);
|
|
234
|
-
this.is_fork || this.#f(), this.is_deferred() ? (this.#l(r.effects), this.#l(r.render_effects), this.#l(r.block_effects)) : (Ht = this, P = null, Nr(r.render_effects), Nr(r.effects), Ht = null, this.#s?.resolve()), me = null;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Traverse the effect tree, executing effects or stashing
|
|
238
|
-
* them for later execution as appropriate
|
|
239
|
-
* @param {Effect} root
|
|
240
|
-
* @param {EffectTarget} target
|
|
241
|
-
*/
|
|
242
|
-
#o(t, r) {
|
|
243
|
-
t.f ^= te;
|
|
244
|
-
for (var n = t.first; n !== null; ) {
|
|
245
|
-
var i = n.f, a = (i & (Re | tt)) !== 0, l = a && (i & te) !== 0, f = l || (i & pe) !== 0 || this.skipped_effects.has(n);
|
|
246
|
-
if ((n.f & Jt) !== 0 && n.b?.is_pending() && (r = {
|
|
247
|
-
parent: r,
|
|
248
|
-
effect: n,
|
|
249
|
-
effects: [],
|
|
250
|
-
render_effects: [],
|
|
251
|
-
block_effects: []
|
|
252
|
-
}), !f && n.fn !== null) {
|
|
253
|
-
a ? n.f ^= te : (i & Er) !== 0 ? r.effects.push(n) : Ot(n) && ((n.f & Ne) !== 0 && r.block_effects.push(n), Dt(n));
|
|
254
|
-
var s = n.first;
|
|
255
|
-
if (s !== null) {
|
|
256
|
-
n = s;
|
|
257
|
-
continue;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
var u = n.parent;
|
|
261
|
-
for (n = n.next; n === null && u !== null; )
|
|
262
|
-
u === r.effect && (this.#l(r.effects), this.#l(r.render_effects), this.#l(r.block_effects), r = /** @type {EffectTarget} */
|
|
263
|
-
r.parent), n = u.next, u = u.parent;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* @param {Effect[]} effects
|
|
268
|
-
*/
|
|
269
|
-
#l(t) {
|
|
270
|
-
for (const r of t)
|
|
271
|
-
((r.f & ce) !== 0 ? this.#a : this.#i).push(r), this.#u(r.deps), re(r, te);
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* @param {Value[] | null} deps
|
|
275
|
-
*/
|
|
276
|
-
#u(t) {
|
|
277
|
-
if (t !== null)
|
|
278
|
-
for (const r of t)
|
|
279
|
-
(r.f & Q) === 0 || (r.f & Je) === 0 || (r.f ^= Je, this.#u(
|
|
280
|
-
/** @type {Derived} */
|
|
281
|
-
r.deps
|
|
282
|
-
));
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Associate a change to a given source with the current
|
|
286
|
-
* batch, noting its previous and current values
|
|
287
|
-
* @param {Source} source
|
|
288
|
-
* @param {any} value
|
|
289
|
-
*/
|
|
290
|
-
capture(t, r) {
|
|
291
|
-
this.previous.has(t) || this.previous.set(t, r), (t.f & He) === 0 && (this.current.set(t, t.v), me?.set(t, t.v));
|
|
292
|
-
}
|
|
293
|
-
activate() {
|
|
294
|
-
P = this, this.apply();
|
|
295
|
-
}
|
|
296
|
-
deactivate() {
|
|
297
|
-
P === this && (P = null, me = null);
|
|
298
|
-
}
|
|
299
|
-
flush() {
|
|
300
|
-
if (this.activate(), Ee.length > 0) {
|
|
301
|
-
if (oa(), P !== null && P !== this)
|
|
302
|
-
return;
|
|
303
|
-
} else this.#n === 0 && this.process([]);
|
|
304
|
-
this.deactivate();
|
|
305
|
-
}
|
|
306
|
-
discard() {
|
|
307
|
-
for (const t of this.#t) t(this);
|
|
308
|
-
this.#t.clear();
|
|
309
|
-
}
|
|
310
|
-
#f() {
|
|
311
|
-
if (this.#r === 0) {
|
|
312
|
-
for (const t of this.#e) t();
|
|
313
|
-
this.#e.clear();
|
|
314
|
-
}
|
|
315
|
-
this.#n === 0 && this.#c();
|
|
316
|
-
}
|
|
317
|
-
#c() {
|
|
318
|
-
if (Ft.size > 1) {
|
|
319
|
-
this.previous.clear();
|
|
320
|
-
var t = me, r = !0, n = {
|
|
321
|
-
parent: null,
|
|
322
|
-
effect: null,
|
|
323
|
-
effects: [],
|
|
324
|
-
render_effects: [],
|
|
325
|
-
block_effects: []
|
|
326
|
-
};
|
|
327
|
-
for (const a of Ft) {
|
|
328
|
-
if (a === this) {
|
|
329
|
-
r = !1;
|
|
330
|
-
continue;
|
|
331
|
-
}
|
|
332
|
-
const l = [];
|
|
333
|
-
for (const [s, u] of this.current) {
|
|
334
|
-
if (a.current.has(s))
|
|
335
|
-
if (r && u !== a.current.get(s))
|
|
336
|
-
a.current.set(s, u);
|
|
337
|
-
else
|
|
338
|
-
continue;
|
|
339
|
-
l.push(s);
|
|
340
|
-
}
|
|
341
|
-
if (l.length === 0)
|
|
342
|
-
continue;
|
|
343
|
-
const f = [...a.current.keys()].filter((s) => !this.current.has(s));
|
|
344
|
-
if (f.length > 0) {
|
|
345
|
-
var i = Ee;
|
|
346
|
-
Ee = [];
|
|
347
|
-
const s = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map();
|
|
348
|
-
for (const c of l)
|
|
349
|
-
cn(c, f, s, u);
|
|
350
|
-
if (Ee.length > 0) {
|
|
351
|
-
P = a, a.apply();
|
|
352
|
-
for (const c of Ee)
|
|
353
|
-
a.#o(c, n);
|
|
354
|
-
a.deactivate();
|
|
355
|
-
}
|
|
356
|
-
Ee = i;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
P = null, me = t;
|
|
360
|
-
}
|
|
361
|
-
this.committed = !0, Ft.delete(this);
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
*
|
|
365
|
-
* @param {boolean} blocking
|
|
366
|
-
*/
|
|
367
|
-
increment(t) {
|
|
368
|
-
this.#n += 1, t && (this.#r += 1);
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
*
|
|
372
|
-
* @param {boolean} blocking
|
|
373
|
-
*/
|
|
374
|
-
decrement(t) {
|
|
375
|
-
this.#n -= 1, t && (this.#r -= 1), this.revive();
|
|
376
|
-
}
|
|
377
|
-
revive() {
|
|
378
|
-
for (const t of this.#a)
|
|
379
|
-
re(t, ce), Qe(t);
|
|
380
|
-
for (const t of this.#i)
|
|
381
|
-
re(t, ze), Qe(t);
|
|
382
|
-
this.#a = [], this.#i = [], this.flush();
|
|
383
|
-
}
|
|
384
|
-
/** @param {() => void} fn */
|
|
385
|
-
oncommit(t) {
|
|
386
|
-
this.#e.add(t);
|
|
387
|
-
}
|
|
388
|
-
/** @param {(batch: Batch) => void} fn */
|
|
389
|
-
ondiscard(t) {
|
|
390
|
-
this.#t.add(t);
|
|
391
|
-
}
|
|
392
|
-
settled() {
|
|
393
|
-
return (this.#s ??= rn()).promise;
|
|
394
|
-
}
|
|
395
|
-
static ensure() {
|
|
396
|
-
if (P === null) {
|
|
397
|
-
const t = P = new xe();
|
|
398
|
-
Ft.add(P), xe.enqueue(() => {
|
|
399
|
-
P === t && t.flush();
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
return P;
|
|
403
|
-
}
|
|
404
|
-
/** @param {() => void} task */
|
|
405
|
-
static enqueue(t) {
|
|
406
|
-
rt(t);
|
|
407
|
-
}
|
|
408
|
-
apply() {
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
function oa() {
|
|
412
|
-
var e = Ge;
|
|
413
|
-
dr = !0;
|
|
414
|
-
var t = null;
|
|
415
|
-
try {
|
|
416
|
-
var r = 0;
|
|
417
|
-
for (Yt(!0); Ee.length > 0; ) {
|
|
418
|
-
var n = xe.ensure();
|
|
419
|
-
if (r++ > 1e3) {
|
|
420
|
-
var i, a;
|
|
421
|
-
la();
|
|
422
|
-
}
|
|
423
|
-
n.process(Ee), Ve.clear();
|
|
424
|
-
}
|
|
425
|
-
} finally {
|
|
426
|
-
dr = !1, Yt(e), kr = null;
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
function la() {
|
|
430
|
-
try {
|
|
431
|
-
Oi();
|
|
432
|
-
} catch (e) {
|
|
433
|
-
vt(e, kr);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
let De = null;
|
|
437
|
-
function Nr(e) {
|
|
438
|
-
var t = e.length;
|
|
439
|
-
if (t !== 0) {
|
|
440
|
-
for (var r = 0; r < t; ) {
|
|
441
|
-
var n = e[r++];
|
|
442
|
-
if ((n.f & (Pe | pe)) === 0 && Ot(n) && (De = /* @__PURE__ */ new Set(), Dt(n), n.deps === null && n.first === null && n.nodes === null && (n.teardown === null && n.ac === null ? Tn(n) : n.fn = null), De?.size > 0)) {
|
|
443
|
-
Ve.clear();
|
|
444
|
-
for (const i of De) {
|
|
445
|
-
if ((i.f & (Pe | pe)) !== 0) continue;
|
|
446
|
-
const a = [i];
|
|
447
|
-
let l = i.parent;
|
|
448
|
-
for (; l !== null; )
|
|
449
|
-
De.has(l) && (De.delete(l), a.push(l)), l = l.parent;
|
|
450
|
-
for (let f = a.length - 1; f >= 0; f--) {
|
|
451
|
-
const s = a[f];
|
|
452
|
-
(s.f & (Pe | pe)) === 0 && Dt(s);
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
De.clear();
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
De = null;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
function cn(e, t, r, n) {
|
|
462
|
-
if (!r.has(e) && (r.add(e), e.reactions !== null))
|
|
463
|
-
for (const i of e.reactions) {
|
|
464
|
-
const a = i.f;
|
|
465
|
-
(a & Q) !== 0 ? cn(
|
|
466
|
-
/** @type {Derived} */
|
|
467
|
-
i,
|
|
468
|
-
t,
|
|
469
|
-
r,
|
|
470
|
-
n
|
|
471
|
-
) : (a & (Cr | Ne)) !== 0 && (a & ce) === 0 && dn(i, t, n) && (re(i, ce), Qe(
|
|
472
|
-
/** @type {Effect} */
|
|
473
|
-
i
|
|
474
|
-
));
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
function dn(e, t, r) {
|
|
478
|
-
const n = r.get(e);
|
|
479
|
-
if (n !== void 0) return n;
|
|
480
|
-
if (e.deps !== null)
|
|
481
|
-
for (const i of e.deps) {
|
|
482
|
-
if (t.includes(i))
|
|
483
|
-
return !0;
|
|
484
|
-
if ((i.f & Q) !== 0 && dn(
|
|
485
|
-
/** @type {Derived} */
|
|
486
|
-
i,
|
|
487
|
-
t,
|
|
488
|
-
r
|
|
489
|
-
))
|
|
490
|
-
return r.set(
|
|
491
|
-
/** @type {Derived} */
|
|
492
|
-
i,
|
|
493
|
-
!0
|
|
494
|
-
), !0;
|
|
495
|
-
}
|
|
496
|
-
return r.set(e, !1), !1;
|
|
497
|
-
}
|
|
498
|
-
function Qe(e) {
|
|
499
|
-
for (var t = kr = e; t.parent !== null; ) {
|
|
500
|
-
t = t.parent;
|
|
501
|
-
var r = t.f;
|
|
502
|
-
if (dr && t === M && (r & Ne) !== 0 && (r & an) === 0)
|
|
503
|
-
return;
|
|
504
|
-
if ((r & (tt | Re)) !== 0) {
|
|
505
|
-
if ((r & te) === 0) return;
|
|
506
|
-
t.f ^= te;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
Ee.push(t);
|
|
510
|
-
}
|
|
511
|
-
function sa(e) {
|
|
512
|
-
let t = 0, r = et(0), n;
|
|
513
|
-
return () => {
|
|
514
|
-
Tt() && (o(r), Cn(() => (t === 0 && (n = rr(() => e(() => It(r)))), t += 1, () => {
|
|
515
|
-
rt(() => {
|
|
516
|
-
t -= 1, t === 0 && (n?.(), n = void 0, It(r));
|
|
517
|
-
});
|
|
518
|
-
})));
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
var ua = Xe | ht | Jt;
|
|
522
|
-
function fa(e, t, r) {
|
|
523
|
-
new ca(e, t, r);
|
|
524
|
-
}
|
|
525
|
-
class ca {
|
|
526
|
-
/** @type {Boundary | null} */
|
|
527
|
-
parent;
|
|
528
|
-
#e = !1;
|
|
529
|
-
/** @type {TemplateNode} */
|
|
530
|
-
#t;
|
|
531
|
-
/** @type {TemplateNode | null} */
|
|
532
|
-
#n = null;
|
|
533
|
-
/** @type {BoundaryProps} */
|
|
534
|
-
#r;
|
|
535
|
-
/** @type {((anchor: Node) => void)} */
|
|
536
|
-
#s;
|
|
537
|
-
/** @type {Effect} */
|
|
538
|
-
#a;
|
|
539
|
-
/** @type {Effect | null} */
|
|
540
|
-
#i = null;
|
|
541
|
-
/** @type {Effect | null} */
|
|
542
|
-
#o = null;
|
|
543
|
-
/** @type {Effect | null} */
|
|
544
|
-
#l = null;
|
|
545
|
-
/** @type {DocumentFragment | null} */
|
|
546
|
-
#u = null;
|
|
547
|
-
/** @type {TemplateNode | null} */
|
|
548
|
-
#f = null;
|
|
549
|
-
#c = 0;
|
|
550
|
-
#d = 0;
|
|
551
|
-
#_ = !1;
|
|
552
|
-
/**
|
|
553
|
-
* A source containing the number of pending async deriveds/expressions.
|
|
554
|
-
* Only created if `$effect.pending()` is used inside the boundary,
|
|
555
|
-
* otherwise updating the source results in needless `Batch.ensure()`
|
|
556
|
-
* calls followed by no-op flushes
|
|
557
|
-
* @type {Source<number> | null}
|
|
558
|
-
*/
|
|
559
|
-
#v = null;
|
|
560
|
-
#w = sa(() => (this.#v = et(this.#c), () => {
|
|
561
|
-
this.#v = null;
|
|
562
|
-
}));
|
|
563
|
-
/**
|
|
564
|
-
* @param {TemplateNode} node
|
|
565
|
-
* @param {BoundaryProps} props
|
|
566
|
-
* @param {((anchor: Node) => void)} children
|
|
567
|
-
*/
|
|
568
|
-
constructor(t, r, n) {
|
|
569
|
-
this.#t = t, this.#r = r, this.#s = n, this.parent = /** @type {Effect} */
|
|
570
|
-
M.b, this.#e = !!this.#r.pending, this.#a = tr(() => {
|
|
571
|
-
M.b = this;
|
|
572
|
-
{
|
|
573
|
-
var i = this.#g();
|
|
574
|
-
try {
|
|
575
|
-
this.#i = ue(() => n(i));
|
|
576
|
-
} catch (a) {
|
|
577
|
-
this.error(a);
|
|
578
|
-
}
|
|
579
|
-
this.#d > 0 ? this.#p() : this.#e = !1;
|
|
580
|
-
}
|
|
581
|
-
return () => {
|
|
582
|
-
this.#f?.remove();
|
|
583
|
-
};
|
|
584
|
-
}, ua);
|
|
585
|
-
}
|
|
586
|
-
#b() {
|
|
587
|
-
try {
|
|
588
|
-
this.#i = ue(() => this.#s(this.#t));
|
|
589
|
-
} catch (t) {
|
|
590
|
-
this.error(t);
|
|
591
|
-
}
|
|
592
|
-
this.#e = !1;
|
|
593
|
-
}
|
|
594
|
-
#y() {
|
|
595
|
-
const t = this.#r.pending;
|
|
596
|
-
t && (this.#o = ue(() => t(this.#t)), xe.enqueue(() => {
|
|
597
|
-
var r = this.#g();
|
|
598
|
-
this.#i = this.#h(() => (xe.ensure(), ue(() => this.#s(r)))), this.#d > 0 ? this.#p() : (Ke(
|
|
599
|
-
/** @type {Effect} */
|
|
600
|
-
this.#o,
|
|
601
|
-
() => {
|
|
602
|
-
this.#o = null;
|
|
603
|
-
}
|
|
604
|
-
), this.#e = !1);
|
|
605
|
-
}));
|
|
606
|
-
}
|
|
607
|
-
#g() {
|
|
608
|
-
var t = this.#t;
|
|
609
|
-
return this.#e && (this.#f = qe(), this.#t.before(this.#f), t = this.#f), t;
|
|
610
|
-
}
|
|
611
|
-
/**
|
|
612
|
-
* Returns `true` if the effect exists inside a boundary whose pending snippet is shown
|
|
613
|
-
* @returns {boolean}
|
|
614
|
-
*/
|
|
615
|
-
is_pending() {
|
|
616
|
-
return this.#e || !!this.parent && this.parent.is_pending();
|
|
617
|
-
}
|
|
618
|
-
has_pending_snippet() {
|
|
619
|
-
return !!this.#r.pending;
|
|
620
|
-
}
|
|
621
|
-
/**
|
|
622
|
-
* @param {() => Effect | null} fn
|
|
623
|
-
*/
|
|
624
|
-
#h(t) {
|
|
625
|
-
var r = M, n = k, i = ae;
|
|
626
|
-
Ce(this.#a), fe(this.#a), dt(this.#a.ctx);
|
|
627
|
-
try {
|
|
628
|
-
return t();
|
|
629
|
-
} catch (a) {
|
|
630
|
-
return fn(a), null;
|
|
631
|
-
} finally {
|
|
632
|
-
Ce(r), fe(n), dt(i);
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
#p() {
|
|
636
|
-
const t = (
|
|
637
|
-
/** @type {(anchor: Node) => void} */
|
|
638
|
-
this.#r.pending
|
|
639
|
-
);
|
|
640
|
-
this.#i !== null && (this.#u = document.createDocumentFragment(), this.#u.append(
|
|
641
|
-
/** @type {TemplateNode} */
|
|
642
|
-
this.#f
|
|
643
|
-
), Ln(this.#i, this.#u)), this.#o === null && (this.#o = ue(() => t(this.#t)));
|
|
644
|
-
}
|
|
645
|
-
/**
|
|
646
|
-
* Updates the pending count associated with the currently visible pending snippet,
|
|
647
|
-
* if any, such that we can replace the snippet with content once work is done
|
|
648
|
-
* @param {1 | -1} d
|
|
649
|
-
*/
|
|
650
|
-
#m(t) {
|
|
651
|
-
if (!this.has_pending_snippet()) {
|
|
652
|
-
this.parent && this.parent.#m(t);
|
|
653
|
-
return;
|
|
654
|
-
}
|
|
655
|
-
this.#d += t, this.#d === 0 && (this.#e = !1, this.#o && Ke(this.#o, () => {
|
|
656
|
-
this.#o = null;
|
|
657
|
-
}), this.#u && (this.#t.before(this.#u), this.#u = null));
|
|
658
|
-
}
|
|
659
|
-
/**
|
|
660
|
-
* Update the source that powers `$effect.pending()` inside this boundary,
|
|
661
|
-
* and controls when the current `pending` snippet (if any) is removed.
|
|
662
|
-
* Do not call from inside the class
|
|
663
|
-
* @param {1 | -1} d
|
|
664
|
-
*/
|
|
665
|
-
update_pending_count(t) {
|
|
666
|
-
this.#m(t), this.#c += t, this.#v && _t(this.#v, this.#c);
|
|
667
|
-
}
|
|
668
|
-
get_effect_pending() {
|
|
669
|
-
return this.#w(), o(
|
|
670
|
-
/** @type {Source<number>} */
|
|
671
|
-
this.#v
|
|
672
|
-
);
|
|
673
|
-
}
|
|
674
|
-
/** @param {unknown} error */
|
|
675
|
-
error(t) {
|
|
676
|
-
var r = this.#r.onerror;
|
|
677
|
-
let n = this.#r.failed;
|
|
678
|
-
if (this.#_ || !r && !n)
|
|
679
|
-
throw t;
|
|
680
|
-
this.#i && (J(this.#i), this.#i = null), this.#o && (J(this.#o), this.#o = null), this.#l && (J(this.#l), this.#l = null);
|
|
681
|
-
var i = !1, a = !1;
|
|
682
|
-
const l = () => {
|
|
683
|
-
if (i) {
|
|
684
|
-
Qi();
|
|
685
|
-
return;
|
|
686
|
-
}
|
|
687
|
-
i = !0, a && Fi(), xe.ensure(), this.#c = 0, this.#l !== null && Ke(this.#l, () => {
|
|
688
|
-
this.#l = null;
|
|
689
|
-
}), this.#e = this.has_pending_snippet(), this.#i = this.#h(() => (this.#_ = !1, ue(() => this.#s(this.#t)))), this.#d > 0 ? this.#p() : this.#e = !1;
|
|
690
|
-
};
|
|
691
|
-
var f = k;
|
|
692
|
-
try {
|
|
693
|
-
fe(null), a = !0, r?.(t, l), a = !1;
|
|
694
|
-
} catch (s) {
|
|
695
|
-
vt(s, this.#a && this.#a.parent);
|
|
696
|
-
} finally {
|
|
697
|
-
fe(f);
|
|
698
|
-
}
|
|
699
|
-
n && rt(() => {
|
|
700
|
-
this.#l = this.#h(() => {
|
|
701
|
-
xe.ensure(), this.#_ = !0;
|
|
702
|
-
try {
|
|
703
|
-
return ue(() => {
|
|
704
|
-
n(
|
|
705
|
-
this.#t,
|
|
706
|
-
() => t,
|
|
707
|
-
() => l
|
|
708
|
-
);
|
|
709
|
-
});
|
|
710
|
-
} catch (s) {
|
|
711
|
-
return vt(
|
|
712
|
-
s,
|
|
713
|
-
/** @type {Effect} */
|
|
714
|
-
this.#a.parent
|
|
715
|
-
), null;
|
|
716
|
-
} finally {
|
|
717
|
-
this.#_ = !1;
|
|
718
|
-
}
|
|
719
|
-
});
|
|
720
|
-
});
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
function vn(e, t, r, n) {
|
|
724
|
-
const i = Qt;
|
|
725
|
-
if (r.length === 0 && e.length === 0) {
|
|
726
|
-
n(t.map(i));
|
|
727
|
-
return;
|
|
728
|
-
}
|
|
729
|
-
var a = P, l = (
|
|
730
|
-
/** @type {Effect} */
|
|
731
|
-
M
|
|
732
|
-
), f = da();
|
|
733
|
-
function s() {
|
|
734
|
-
Promise.all(r.map((u) => /* @__PURE__ */ va(u))).then((u) => {
|
|
735
|
-
f();
|
|
736
|
-
try {
|
|
737
|
-
n([...t.map(i), ...u]);
|
|
738
|
-
} catch (c) {
|
|
739
|
-
(l.f & Pe) === 0 && vt(c, l);
|
|
740
|
-
}
|
|
741
|
-
a?.deactivate(), Ut();
|
|
742
|
-
}).catch((u) => {
|
|
743
|
-
vt(u, l);
|
|
744
|
-
});
|
|
745
|
-
}
|
|
746
|
-
e.length > 0 ? Promise.all(e).then(() => {
|
|
747
|
-
f();
|
|
748
|
-
try {
|
|
749
|
-
return s();
|
|
750
|
-
} finally {
|
|
751
|
-
a?.deactivate(), Ut();
|
|
752
|
-
}
|
|
753
|
-
}) : s();
|
|
754
|
-
}
|
|
755
|
-
function da() {
|
|
756
|
-
var e = M, t = k, r = ae, n = P;
|
|
757
|
-
return function(a = !0) {
|
|
758
|
-
Ce(e), fe(t), dt(r), a && n?.activate();
|
|
759
|
-
};
|
|
760
|
-
}
|
|
761
|
-
function Ut() {
|
|
762
|
-
Ce(null), fe(null), dt(null);
|
|
763
|
-
}
|
|
764
|
-
// @__NO_SIDE_EFFECTS__
|
|
765
|
-
function Qt(e) {
|
|
766
|
-
var t = Q | ce, r = k !== null && (k.f & Q) !== 0 ? (
|
|
767
|
-
/** @type {Derived} */
|
|
768
|
-
k
|
|
769
|
-
) : null;
|
|
770
|
-
return M !== null && (M.f |= ht), {
|
|
771
|
-
ctx: ae,
|
|
772
|
-
deps: null,
|
|
773
|
-
effects: null,
|
|
774
|
-
equals: ln,
|
|
775
|
-
f: t,
|
|
776
|
-
fn: e,
|
|
777
|
-
reactions: null,
|
|
778
|
-
rv: 0,
|
|
779
|
-
v: (
|
|
780
|
-
/** @type {V} */
|
|
781
|
-
X
|
|
782
|
-
),
|
|
783
|
-
wv: 0,
|
|
784
|
-
parent: r ?? M,
|
|
785
|
-
ac: null
|
|
786
|
-
};
|
|
787
|
-
}
|
|
788
|
-
// @__NO_SIDE_EFFECTS__
|
|
789
|
-
function va(e, t) {
|
|
790
|
-
let r = (
|
|
791
|
-
/** @type {Effect | null} */
|
|
792
|
-
M
|
|
793
|
-
);
|
|
794
|
-
r === null && Mi();
|
|
795
|
-
var n = (
|
|
796
|
-
/** @type {Boundary} */
|
|
797
|
-
r.b
|
|
798
|
-
), i = (
|
|
799
|
-
/** @type {Promise<V>} */
|
|
800
|
-
/** @type {unknown} */
|
|
801
|
-
void 0
|
|
802
|
-
), a = et(
|
|
803
|
-
/** @type {V} */
|
|
804
|
-
X
|
|
805
|
-
), l = !k, f = /* @__PURE__ */ new Map();
|
|
806
|
-
return Aa(() => {
|
|
807
|
-
var s = rn();
|
|
808
|
-
i = s.promise;
|
|
809
|
-
try {
|
|
810
|
-
Promise.resolve(e()).then(s.resolve, s.reject).then(() => {
|
|
811
|
-
u === P && u.committed && u.deactivate(), Ut();
|
|
812
|
-
});
|
|
813
|
-
} catch (v) {
|
|
814
|
-
s.reject(v), Ut();
|
|
815
|
-
}
|
|
816
|
-
var u = (
|
|
817
|
-
/** @type {Batch} */
|
|
818
|
-
P
|
|
819
|
-
);
|
|
820
|
-
if (l) {
|
|
821
|
-
var c = !n.is_pending();
|
|
822
|
-
n.update_pending_count(1), u.increment(c), f.get(u)?.reject(ut), f.delete(u), f.set(u, s);
|
|
823
|
-
}
|
|
824
|
-
const d = (v, _ = void 0) => {
|
|
825
|
-
if (u.activate(), _)
|
|
826
|
-
_ !== ut && (a.f |= He, _t(a, _));
|
|
827
|
-
else {
|
|
828
|
-
(a.f & He) !== 0 && (a.f ^= He), _t(a, v);
|
|
829
|
-
for (const [p, w] of f) {
|
|
830
|
-
if (f.delete(p), p === u) break;
|
|
831
|
-
w.reject(ut);
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
l && (n.update_pending_count(-1), u.decrement(c));
|
|
835
|
-
};
|
|
836
|
-
s.promise.then(d, (v) => d(null, v || "unknown"));
|
|
837
|
-
}), xn(() => {
|
|
838
|
-
for (const s of f.values())
|
|
839
|
-
s.reject(ut);
|
|
840
|
-
}), new Promise((s) => {
|
|
841
|
-
function u(c) {
|
|
842
|
-
function d() {
|
|
843
|
-
c === i ? s(a) : u(i);
|
|
844
|
-
}
|
|
845
|
-
c.then(d, d);
|
|
846
|
-
}
|
|
847
|
-
u(i);
|
|
848
|
-
});
|
|
849
|
-
}
|
|
850
|
-
// @__NO_SIDE_EFFECTS__
|
|
851
|
-
function L(e) {
|
|
852
|
-
const t = /* @__PURE__ */ Qt(e);
|
|
853
|
-
return Pn(t), t;
|
|
854
|
-
}
|
|
855
|
-
// @__NO_SIDE_EFFECTS__
|
|
856
|
-
function _n(e) {
|
|
857
|
-
const t = /* @__PURE__ */ Qt(e);
|
|
858
|
-
return t.equals = sn, t;
|
|
859
|
-
}
|
|
860
|
-
function hn(e) {
|
|
861
|
-
var t = e.effects;
|
|
862
|
-
if (t !== null) {
|
|
863
|
-
e.effects = null;
|
|
864
|
-
for (var r = 0; r < t.length; r += 1)
|
|
865
|
-
J(
|
|
866
|
-
/** @type {Effect} */
|
|
867
|
-
t[r]
|
|
868
|
-
);
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
function _a(e) {
|
|
872
|
-
for (var t = e.parent; t !== null; ) {
|
|
873
|
-
if ((t.f & Q) === 0)
|
|
874
|
-
return (t.f & Pe) === 0 ? (
|
|
875
|
-
/** @type {Effect} */
|
|
876
|
-
t
|
|
877
|
-
) : null;
|
|
878
|
-
t = t.parent;
|
|
879
|
-
}
|
|
880
|
-
return null;
|
|
881
|
-
}
|
|
882
|
-
function Tr(e) {
|
|
883
|
-
var t, r = M;
|
|
884
|
-
Ce(_a(e));
|
|
885
|
-
try {
|
|
886
|
-
e.f &= ~Je, hn(e), t = zn(e);
|
|
887
|
-
} finally {
|
|
888
|
-
Ce(r);
|
|
889
|
-
}
|
|
890
|
-
return t;
|
|
891
|
-
}
|
|
892
|
-
function pn(e) {
|
|
893
|
-
var t = Tr(e);
|
|
894
|
-
if (e.equals(t) || (P?.is_fork || (e.v = t), e.wv = Nn()), !nt)
|
|
895
|
-
if (me !== null)
|
|
896
|
-
(Tt() || P?.is_fork) && me.set(e, t);
|
|
897
|
-
else {
|
|
898
|
-
var r = (e.f & be) === 0 ? ze : te;
|
|
899
|
-
re(e, r);
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
let vr = /* @__PURE__ */ new Set();
|
|
903
|
-
const Ve = /* @__PURE__ */ new Map();
|
|
904
|
-
let gn = !1;
|
|
905
|
-
function et(e, t) {
|
|
906
|
-
var r = {
|
|
907
|
-
f: 0,
|
|
908
|
-
// TODO ideally we could skip this altogether, but it causes type errors
|
|
909
|
-
v: e,
|
|
910
|
-
reactions: null,
|
|
911
|
-
equals: ln,
|
|
912
|
-
rv: 0,
|
|
913
|
-
wv: 0
|
|
914
|
-
};
|
|
915
|
-
return r;
|
|
916
|
-
}
|
|
917
|
-
// @__NO_SIDE_EFFECTS__
|
|
918
|
-
function O(e, t) {
|
|
919
|
-
const r = et(e);
|
|
920
|
-
return Pn(r), r;
|
|
921
|
-
}
|
|
922
|
-
// @__NO_SIDE_EFFECTS__
|
|
923
|
-
function ha(e, t = !1, r = !0) {
|
|
924
|
-
const n = et(e);
|
|
925
|
-
return t || (n.equals = sn), n;
|
|
926
|
-
}
|
|
927
|
-
function x(e, t, r = !1) {
|
|
928
|
-
k !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
929
|
-
// to ensure we error if state is set inside an inspect effect
|
|
930
|
-
(!Se || (k.f & Or) !== 0) && un() && (k.f & (Q | Ne | Cr | Or)) !== 0 && !Oe?.includes(e) && $i();
|
|
931
|
-
let n = r ? We(t) : t;
|
|
932
|
-
return _t(e, n);
|
|
933
|
-
}
|
|
934
|
-
function _t(e, t) {
|
|
935
|
-
if (!e.equals(t)) {
|
|
936
|
-
var r = e.v;
|
|
937
|
-
nt ? Ve.set(e, t) : Ve.set(e, r), e.v = t;
|
|
938
|
-
var n = xe.ensure();
|
|
939
|
-
n.capture(e, r), (e.f & Q) !== 0 && ((e.f & ce) !== 0 && Tr(
|
|
940
|
-
/** @type {Derived} */
|
|
941
|
-
e
|
|
942
|
-
), re(e, (e.f & be) !== 0 ? te : ze)), e.wv = Nn(), mn(e, ce), M !== null && (M.f & te) !== 0 && (M.f & (Re | tt)) === 0 && (ge === null ? Ta([e]) : ge.push(e)), !n.is_fork && vr.size > 0 && !gn && pa();
|
|
943
|
-
}
|
|
944
|
-
return t;
|
|
945
|
-
}
|
|
946
|
-
function pa() {
|
|
947
|
-
gn = !1;
|
|
948
|
-
var e = Ge;
|
|
949
|
-
Yt(!0);
|
|
950
|
-
const t = Array.from(vr);
|
|
951
|
-
try {
|
|
952
|
-
for (const r of t)
|
|
953
|
-
(r.f & te) !== 0 && re(r, ze), Ot(r) && Dt(r);
|
|
954
|
-
} finally {
|
|
955
|
-
Yt(e);
|
|
956
|
-
}
|
|
957
|
-
vr.clear();
|
|
958
|
-
}
|
|
959
|
-
function Rr(e, t = 1) {
|
|
960
|
-
var r = o(e), n = t === 1 ? r++ : r--;
|
|
961
|
-
return x(e, r), n;
|
|
962
|
-
}
|
|
963
|
-
function It(e) {
|
|
964
|
-
x(e, e.v + 1);
|
|
965
|
-
}
|
|
966
|
-
function mn(e, t) {
|
|
967
|
-
var r = e.reactions;
|
|
968
|
-
if (r !== null)
|
|
969
|
-
for (var n = r.length, i = 0; i < n; i++) {
|
|
970
|
-
var a = r[i], l = a.f, f = (l & ce) === 0;
|
|
971
|
-
if (f && re(a, t), (l & Q) !== 0) {
|
|
972
|
-
var s = (
|
|
973
|
-
/** @type {Derived} */
|
|
974
|
-
a
|
|
975
|
-
);
|
|
976
|
-
me?.delete(s), (l & Je) === 0 && (l & be && (a.f |= Je), mn(s, ze));
|
|
977
|
-
} else f && ((l & Ne) !== 0 && De !== null && De.add(
|
|
978
|
-
/** @type {Effect} */
|
|
979
|
-
a
|
|
980
|
-
), Qe(
|
|
981
|
-
/** @type {Effect} */
|
|
982
|
-
a
|
|
983
|
-
));
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
function We(e) {
|
|
987
|
-
if (typeof e != "object" || e === null || Ye in e)
|
|
988
|
-
return e;
|
|
989
|
-
const t = en(e);
|
|
990
|
-
if (t !== xi && t !== Si)
|
|
991
|
-
return e;
|
|
992
|
-
var r = /* @__PURE__ */ new Map(), n = yr(e), i = /* @__PURE__ */ O(0), a = Ze, l = (f) => {
|
|
993
|
-
if (Ze === a)
|
|
994
|
-
return f();
|
|
995
|
-
var s = k, u = Ze;
|
|
996
|
-
fe(null), Wr(a);
|
|
997
|
-
var c = f();
|
|
998
|
-
return fe(s), Wr(u), c;
|
|
999
|
-
};
|
|
1000
|
-
return n && r.set("length", /* @__PURE__ */ O(
|
|
1001
|
-
/** @type {any[]} */
|
|
1002
|
-
e.length
|
|
1003
|
-
)), new Proxy(
|
|
1004
|
-
/** @type {any} */
|
|
1005
|
-
e,
|
|
1006
|
-
{
|
|
1007
|
-
defineProperty(f, s, u) {
|
|
1008
|
-
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Ri();
|
|
1009
|
-
var c = r.get(s);
|
|
1010
|
-
return c === void 0 ? c = l(() => {
|
|
1011
|
-
var d = /* @__PURE__ */ O(u.value);
|
|
1012
|
-
return r.set(s, d), d;
|
|
1013
|
-
}) : x(c, u.value, !0), !0;
|
|
1014
|
-
},
|
|
1015
|
-
deleteProperty(f, s) {
|
|
1016
|
-
var u = r.get(s);
|
|
1017
|
-
if (u === void 0) {
|
|
1018
|
-
if (s in f) {
|
|
1019
|
-
const c = l(() => /* @__PURE__ */ O(X));
|
|
1020
|
-
r.set(s, c), It(i);
|
|
1021
|
-
}
|
|
1022
|
-
} else
|
|
1023
|
-
x(u, X), It(i);
|
|
1024
|
-
return !0;
|
|
1025
|
-
},
|
|
1026
|
-
get(f, s, u) {
|
|
1027
|
-
if (s === Ye)
|
|
1028
|
-
return e;
|
|
1029
|
-
var c = r.get(s), d = s in f;
|
|
1030
|
-
if (c === void 0 && (!d || ct(f, s)?.writable) && (c = l(() => {
|
|
1031
|
-
var _ = We(d ? f[s] : X), p = /* @__PURE__ */ O(_);
|
|
1032
|
-
return p;
|
|
1033
|
-
}), r.set(s, c)), c !== void 0) {
|
|
1034
|
-
var v = o(c);
|
|
1035
|
-
return v === X ? void 0 : v;
|
|
1036
|
-
}
|
|
1037
|
-
return Reflect.get(f, s, u);
|
|
1038
|
-
},
|
|
1039
|
-
getOwnPropertyDescriptor(f, s) {
|
|
1040
|
-
var u = Reflect.getOwnPropertyDescriptor(f, s);
|
|
1041
|
-
if (u && "value" in u) {
|
|
1042
|
-
var c = r.get(s);
|
|
1043
|
-
c && (u.value = o(c));
|
|
1044
|
-
} else if (u === void 0) {
|
|
1045
|
-
var d = r.get(s), v = d?.v;
|
|
1046
|
-
if (d !== void 0 && v !== X)
|
|
1047
|
-
return {
|
|
1048
|
-
enumerable: !0,
|
|
1049
|
-
configurable: !0,
|
|
1050
|
-
value: v,
|
|
1051
|
-
writable: !0
|
|
1052
|
-
};
|
|
1053
|
-
}
|
|
1054
|
-
return u;
|
|
1055
|
-
},
|
|
1056
|
-
has(f, s) {
|
|
1057
|
-
if (s === Ye)
|
|
1058
|
-
return !0;
|
|
1059
|
-
var u = r.get(s), c = u !== void 0 && u.v !== X || Reflect.has(f, s);
|
|
1060
|
-
if (u !== void 0 || M !== null && (!c || ct(f, s)?.writable)) {
|
|
1061
|
-
u === void 0 && (u = l(() => {
|
|
1062
|
-
var v = c ? We(f[s]) : X, _ = /* @__PURE__ */ O(v);
|
|
1063
|
-
return _;
|
|
1064
|
-
}), r.set(s, u));
|
|
1065
|
-
var d = o(u);
|
|
1066
|
-
if (d === X)
|
|
1067
|
-
return !1;
|
|
1068
|
-
}
|
|
1069
|
-
return c;
|
|
1070
|
-
},
|
|
1071
|
-
set(f, s, u, c) {
|
|
1072
|
-
var d = r.get(s), v = s in f;
|
|
1073
|
-
if (n && s === "length")
|
|
1074
|
-
for (var _ = u; _ < /** @type {Source<number>} */
|
|
1075
|
-
d.v; _ += 1) {
|
|
1076
|
-
var p = r.get(_ + "");
|
|
1077
|
-
p !== void 0 ? x(p, X) : _ in f && (p = l(() => /* @__PURE__ */ O(X)), r.set(_ + "", p));
|
|
1078
|
-
}
|
|
1079
|
-
if (d === void 0)
|
|
1080
|
-
(!v || ct(f, s)?.writable) && (d = l(() => /* @__PURE__ */ O(void 0)), x(d, We(u)), r.set(s, d));
|
|
1081
|
-
else {
|
|
1082
|
-
v = d.v !== X;
|
|
1083
|
-
var w = l(() => We(u));
|
|
1084
|
-
x(d, w);
|
|
1085
|
-
}
|
|
1086
|
-
var h = Reflect.getOwnPropertyDescriptor(f, s);
|
|
1087
|
-
if (h?.set && h.set.call(c, u), !v) {
|
|
1088
|
-
if (n && typeof s == "string") {
|
|
1089
|
-
var g = (
|
|
1090
|
-
/** @type {Source<number>} */
|
|
1091
|
-
r.get("length")
|
|
1092
|
-
), A = Number(s);
|
|
1093
|
-
Number.isInteger(A) && A >= g.v && x(g, A + 1);
|
|
1094
|
-
}
|
|
1095
|
-
It(i);
|
|
1096
|
-
}
|
|
1097
|
-
return !0;
|
|
1098
|
-
},
|
|
1099
|
-
ownKeys(f) {
|
|
1100
|
-
o(i);
|
|
1101
|
-
var s = Reflect.ownKeys(f).filter((d) => {
|
|
1102
|
-
var v = r.get(d);
|
|
1103
|
-
return v === void 0 || v.v !== X;
|
|
1104
|
-
});
|
|
1105
|
-
for (var [u, c] of r)
|
|
1106
|
-
c.v !== X && !(u in f) && s.push(u);
|
|
1107
|
-
return s;
|
|
1108
|
-
},
|
|
1109
|
-
setPrototypeOf() {
|
|
1110
|
-
zi();
|
|
1111
|
-
}
|
|
1112
|
-
}
|
|
1113
|
-
);
|
|
1114
|
-
}
|
|
1115
|
-
function zr(e) {
|
|
1116
|
-
try {
|
|
1117
|
-
if (e !== null && typeof e == "object" && Ye in e)
|
|
1118
|
-
return e[Ye];
|
|
1119
|
-
} catch {
|
|
1120
|
-
}
|
|
1121
|
-
return e;
|
|
1122
|
-
}
|
|
1123
|
-
function ga(e, t) {
|
|
1124
|
-
return Object.is(zr(e), zr(t));
|
|
1125
|
-
}
|
|
1126
|
-
var $r, wn, bn, yn;
|
|
1127
|
-
function ma() {
|
|
1128
|
-
if ($r === void 0) {
|
|
1129
|
-
$r = window, wn = /Firefox/.test(navigator.userAgent);
|
|
1130
|
-
var e = Element.prototype, t = Node.prototype, r = Text.prototype;
|
|
1131
|
-
bn = ct(t, "firstChild").get, yn = ct(t, "nextSibling").get, Pr(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), Pr(r) && (r.__t = void 0);
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
function qe(e = "") {
|
|
1135
|
-
return document.createTextNode(e);
|
|
1136
|
-
}
|
|
1137
|
-
// @__NO_SIDE_EFFECTS__
|
|
1138
|
-
function jt(e) {
|
|
1139
|
-
return (
|
|
1140
|
-
/** @type {TemplateNode | null} */
|
|
1141
|
-
bn.call(e)
|
|
1142
|
-
);
|
|
1143
|
-
}
|
|
1144
|
-
// @__NO_SIDE_EFFECTS__
|
|
1145
|
-
function Lt(e) {
|
|
1146
|
-
return (
|
|
1147
|
-
/** @type {TemplateNode | null} */
|
|
1148
|
-
yn.call(e)
|
|
1149
|
-
);
|
|
1150
|
-
}
|
|
1151
|
-
function S(e, t) {
|
|
1152
|
-
return /* @__PURE__ */ jt(e);
|
|
1153
|
-
}
|
|
1154
|
-
function yt(e, t = !1) {
|
|
1155
|
-
{
|
|
1156
|
-
var r = /* @__PURE__ */ jt(e);
|
|
1157
|
-
return r instanceof Comment && r.data === "" ? /* @__PURE__ */ Lt(r) : r;
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
function Y(e, t = 1, r = !1) {
|
|
1161
|
-
let n = e;
|
|
1162
|
-
for (; t--; )
|
|
1163
|
-
n = /** @type {TemplateNode} */
|
|
1164
|
-
/* @__PURE__ */ Lt(n);
|
|
1165
|
-
return n;
|
|
1166
|
-
}
|
|
1167
|
-
function wa(e) {
|
|
1168
|
-
e.textContent = "";
|
|
1169
|
-
}
|
|
1170
|
-
function En() {
|
|
1171
|
-
return !1;
|
|
1172
|
-
}
|
|
1173
|
-
function ba(e, t) {
|
|
1174
|
-
if (t) {
|
|
1175
|
-
const r = document.body;
|
|
1176
|
-
e.autofocus = !0, rt(() => {
|
|
1177
|
-
document.activeElement === r && e.focus();
|
|
1178
|
-
});
|
|
1179
|
-
}
|
|
1180
|
-
}
|
|
1181
|
-
let Fr = !1;
|
|
1182
|
-
function ya() {
|
|
1183
|
-
Fr || (Fr = !0, document.addEventListener(
|
|
1184
|
-
"reset",
|
|
1185
|
-
(e) => {
|
|
1186
|
-
Promise.resolve().then(() => {
|
|
1187
|
-
if (!e.defaultPrevented)
|
|
1188
|
-
for (
|
|
1189
|
-
const t of
|
|
1190
|
-
/**@type {HTMLFormElement} */
|
|
1191
|
-
e.target.elements
|
|
1192
|
-
)
|
|
1193
|
-
t.__on_r?.();
|
|
1194
|
-
});
|
|
1195
|
-
},
|
|
1196
|
-
// In the capture phase to guarantee we get noticed of it (no possibility of stopPropagation)
|
|
1197
|
-
{ capture: !0 }
|
|
1198
|
-
));
|
|
1199
|
-
}
|
|
1200
|
-
function er(e) {
|
|
1201
|
-
var t = k, r = M;
|
|
1202
|
-
fe(null), Ce(null);
|
|
1203
|
-
try {
|
|
1204
|
-
return e();
|
|
1205
|
-
} finally {
|
|
1206
|
-
fe(t), Ce(r);
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
function Ea(e, t, r, n = r) {
|
|
1210
|
-
e.addEventListener(t, () => er(r));
|
|
1211
|
-
const i = e.__on_r;
|
|
1212
|
-
i ? e.__on_r = () => {
|
|
1213
|
-
i(), n(!0);
|
|
1214
|
-
} : e.__on_r = () => n(!0), ya();
|
|
1215
|
-
}
|
|
1216
|
-
function xa(e) {
|
|
1217
|
-
M === null && (k === null && Pi(), Li()), nt && Di();
|
|
1218
|
-
}
|
|
1219
|
-
function Sa(e, t) {
|
|
1220
|
-
var r = t.last;
|
|
1221
|
-
r === null ? t.last = t.first = e : (r.next = e, e.prev = r, t.last = e);
|
|
1222
|
-
}
|
|
1223
|
-
function Ae(e, t, r) {
|
|
1224
|
-
var n = M;
|
|
1225
|
-
n !== null && (n.f & pe) !== 0 && (e |= pe);
|
|
1226
|
-
var i = {
|
|
1227
|
-
ctx: ae,
|
|
1228
|
-
deps: null,
|
|
1229
|
-
nodes: null,
|
|
1230
|
-
f: e | ce | be,
|
|
1231
|
-
first: null,
|
|
1232
|
-
fn: t,
|
|
1233
|
-
last: null,
|
|
1234
|
-
next: null,
|
|
1235
|
-
parent: n,
|
|
1236
|
-
b: n && n.b,
|
|
1237
|
-
prev: null,
|
|
1238
|
-
teardown: null,
|
|
1239
|
-
wv: 0,
|
|
1240
|
-
ac: null
|
|
1241
|
-
};
|
|
1242
|
-
if (r)
|
|
1243
|
-
try {
|
|
1244
|
-
Dt(i), i.f |= Sr;
|
|
1245
|
-
} catch (f) {
|
|
1246
|
-
throw J(i), f;
|
|
1247
|
-
}
|
|
1248
|
-
else t !== null && Qe(i);
|
|
1249
|
-
var a = i;
|
|
1250
|
-
if (r && a.deps === null && a.teardown === null && a.nodes === null && a.first === a.last && // either `null`, or a singular child
|
|
1251
|
-
(a.f & ht) === 0 && (a = a.first, (e & Ne) !== 0 && (e & Xe) !== 0 && a !== null && (a.f |= Xe)), a !== null && (a.parent = n, n !== null && Sa(a, n), k !== null && (k.f & Q) !== 0 && (e & tt) === 0)) {
|
|
1252
|
-
var l = (
|
|
1253
|
-
/** @type {Derived} */
|
|
1254
|
-
k
|
|
1255
|
-
);
|
|
1256
|
-
(l.effects ??= []).push(a);
|
|
1257
|
-
}
|
|
1258
|
-
return i;
|
|
1259
|
-
}
|
|
1260
|
-
function Tt() {
|
|
1261
|
-
return k !== null && !Se;
|
|
1262
|
-
}
|
|
1263
|
-
function xn(e) {
|
|
1264
|
-
const t = Ae(xr, null, !1);
|
|
1265
|
-
return re(t, te), t.teardown = e, t;
|
|
1266
|
-
}
|
|
1267
|
-
function xt(e) {
|
|
1268
|
-
xa();
|
|
1269
|
-
var t = (
|
|
1270
|
-
/** @type {Effect} */
|
|
1271
|
-
M.f
|
|
1272
|
-
), r = !k && (t & Re) !== 0 && (t & Sr) === 0;
|
|
1273
|
-
if (r) {
|
|
1274
|
-
var n = (
|
|
1275
|
-
/** @type {ComponentContext} */
|
|
1276
|
-
ae
|
|
1277
|
-
);
|
|
1278
|
-
(n.e ??= []).push(e);
|
|
1279
|
-
} else
|
|
1280
|
-
return Sn(e);
|
|
1281
|
-
}
|
|
1282
|
-
function Sn(e) {
|
|
1283
|
-
return Ae(Er | Ai, e, !1);
|
|
1284
|
-
}
|
|
1285
|
-
function Ca(e) {
|
|
1286
|
-
xe.ensure();
|
|
1287
|
-
const t = Ae(tt | ht, e, !0);
|
|
1288
|
-
return (r = {}) => new Promise((n) => {
|
|
1289
|
-
r.outro ? Ke(t, () => {
|
|
1290
|
-
J(t), n(void 0);
|
|
1291
|
-
}) : (J(t), n(void 0));
|
|
1292
|
-
});
|
|
1293
|
-
}
|
|
1294
|
-
function Pt(e) {
|
|
1295
|
-
return Ae(Er, e, !1);
|
|
1296
|
-
}
|
|
1297
|
-
function Aa(e) {
|
|
1298
|
-
return Ae(Cr | ht, e, !0);
|
|
1299
|
-
}
|
|
1300
|
-
function Cn(e, t = 0) {
|
|
1301
|
-
return Ae(xr | t, e, !0);
|
|
1302
|
-
}
|
|
1303
|
-
function Z(e, t = [], r = [], n = []) {
|
|
1304
|
-
vn(n, t, r, (i) => {
|
|
1305
|
-
Ae(xr, () => e(...i.map(o)), !0);
|
|
1306
|
-
});
|
|
1307
|
-
}
|
|
1308
|
-
function tr(e, t = 0) {
|
|
1309
|
-
var r = Ae(Ne | t, e, !0);
|
|
1310
|
-
return r;
|
|
1311
|
-
}
|
|
1312
|
-
function An(e, t = 0) {
|
|
1313
|
-
var r = Ae(nn | t, e, !0);
|
|
1314
|
-
return r;
|
|
1315
|
-
}
|
|
1316
|
-
function ue(e) {
|
|
1317
|
-
return Ae(Re | ht, e, !0);
|
|
1318
|
-
}
|
|
1319
|
-
function In(e) {
|
|
1320
|
-
var t = e.teardown;
|
|
1321
|
-
if (t !== null) {
|
|
1322
|
-
const r = nt, n = k;
|
|
1323
|
-
Br(!0), fe(null);
|
|
1324
|
-
try {
|
|
1325
|
-
t.call(null);
|
|
1326
|
-
} finally {
|
|
1327
|
-
Br(r), fe(n);
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
function kn(e, t = !1) {
|
|
1332
|
-
var r = e.first;
|
|
1333
|
-
for (e.first = e.last = null; r !== null; ) {
|
|
1334
|
-
const i = r.ac;
|
|
1335
|
-
i !== null && er(() => {
|
|
1336
|
-
i.abort(ut);
|
|
1337
|
-
});
|
|
1338
|
-
var n = r.next;
|
|
1339
|
-
(r.f & tt) !== 0 ? r.parent = null : J(r, t), r = n;
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
function Ia(e) {
|
|
1343
|
-
for (var t = e.first; t !== null; ) {
|
|
1344
|
-
var r = t.next;
|
|
1345
|
-
(t.f & Re) === 0 && J(t), t = r;
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
function J(e, t = !0) {
|
|
1349
|
-
var r = !1;
|
|
1350
|
-
(t || (e.f & an) !== 0) && e.nodes !== null && e.nodes.end !== null && (ka(
|
|
1351
|
-
e.nodes.start,
|
|
1352
|
-
/** @type {TemplateNode} */
|
|
1353
|
-
e.nodes.end
|
|
1354
|
-
), r = !0), kn(e, t && !r), Kt(e, 0), re(e, Pe);
|
|
1355
|
-
var n = e.nodes && e.nodes.t;
|
|
1356
|
-
if (n !== null)
|
|
1357
|
-
for (const a of n)
|
|
1358
|
-
a.stop();
|
|
1359
|
-
In(e);
|
|
1360
|
-
var i = e.parent;
|
|
1361
|
-
i !== null && i.first !== null && Tn(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
|
|
1362
|
-
}
|
|
1363
|
-
function ka(e, t) {
|
|
1364
|
-
for (; e !== null; ) {
|
|
1365
|
-
var r = e === t ? null : /* @__PURE__ */ Lt(e);
|
|
1366
|
-
e.remove(), e = r;
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
|
-
function Tn(e) {
|
|
1370
|
-
var t = e.parent, r = e.prev, n = e.next;
|
|
1371
|
-
r !== null && (r.next = n), n !== null && (n.prev = r), t !== null && (t.first === e && (t.first = n), t.last === e && (t.last = r));
|
|
1372
|
-
}
|
|
1373
|
-
function Ke(e, t, r = !0) {
|
|
1374
|
-
var n = [];
|
|
1375
|
-
Mn(e, n, !0);
|
|
1376
|
-
var i = () => {
|
|
1377
|
-
r && J(e), t && t();
|
|
1378
|
-
}, a = n.length;
|
|
1379
|
-
if (a > 0) {
|
|
1380
|
-
var l = () => --a || i();
|
|
1381
|
-
for (var f of n)
|
|
1382
|
-
f.out(l);
|
|
1383
|
-
} else
|
|
1384
|
-
i();
|
|
1385
|
-
}
|
|
1386
|
-
function Mn(e, t, r) {
|
|
1387
|
-
if ((e.f & pe) === 0) {
|
|
1388
|
-
e.f ^= pe;
|
|
1389
|
-
var n = e.nodes && e.nodes.t;
|
|
1390
|
-
if (n !== null)
|
|
1391
|
-
for (const f of n)
|
|
1392
|
-
(f.is_global || r) && t.push(f);
|
|
1393
|
-
for (var i = e.first; i !== null; ) {
|
|
1394
|
-
var a = i.next, l = (i.f & Xe) !== 0 || // If this is a branch effect without a block effect parent,
|
|
1395
|
-
// it means the parent block effect was pruned. In that case,
|
|
1396
|
-
// transparency information was transferred to the branch effect.
|
|
1397
|
-
(i.f & Re) !== 0 && (e.f & Ne) !== 0;
|
|
1398
|
-
Mn(i, t, l ? r : !1), i = a;
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
}
|
|
1402
|
-
function Mr(e) {
|
|
1403
|
-
Dn(e, !0);
|
|
1404
|
-
}
|
|
1405
|
-
function Dn(e, t) {
|
|
1406
|
-
if ((e.f & pe) !== 0) {
|
|
1407
|
-
e.f ^= pe, (e.f & te) === 0 && (re(e, ce), Qe(e));
|
|
1408
|
-
for (var r = e.first; r !== null; ) {
|
|
1409
|
-
var n = r.next, i = (r.f & Xe) !== 0 || (r.f & Re) !== 0;
|
|
1410
|
-
Dn(r, i ? t : !1), r = n;
|
|
1411
|
-
}
|
|
1412
|
-
var a = e.nodes && e.nodes.t;
|
|
1413
|
-
if (a !== null)
|
|
1414
|
-
for (const l of a)
|
|
1415
|
-
(l.is_global || t) && l.in();
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
function Ln(e, t) {
|
|
1419
|
-
if (e.nodes)
|
|
1420
|
-
for (var r = e.nodes.start, n = e.nodes.end; r !== null; ) {
|
|
1421
|
-
var i = r === n ? null : /* @__PURE__ */ Lt(r);
|
|
1422
|
-
t.append(r), r = i;
|
|
1423
|
-
}
|
|
1424
|
-
}
|
|
1425
|
-
let Ge = !1;
|
|
1426
|
-
function Yt(e) {
|
|
1427
|
-
Ge = e;
|
|
1428
|
-
}
|
|
1429
|
-
let nt = !1;
|
|
1430
|
-
function Br(e) {
|
|
1431
|
-
nt = e;
|
|
1432
|
-
}
|
|
1433
|
-
let k = null, Se = !1;
|
|
1434
|
-
function fe(e) {
|
|
1435
|
-
k = e;
|
|
1436
|
-
}
|
|
1437
|
-
let M = null;
|
|
1438
|
-
function Ce(e) {
|
|
1439
|
-
M = e;
|
|
1440
|
-
}
|
|
1441
|
-
let Oe = null;
|
|
1442
|
-
function Pn(e) {
|
|
1443
|
-
k !== null && (Oe === null ? Oe = [e] : Oe.push(e));
|
|
1444
|
-
}
|
|
1445
|
-
let ie = null, he = 0, ge = null;
|
|
1446
|
-
function Ta(e) {
|
|
1447
|
-
ge = e;
|
|
1448
|
-
}
|
|
1449
|
-
let On = 1, Mt = 0, Ze = Mt;
|
|
1450
|
-
function Wr(e) {
|
|
1451
|
-
Ze = e;
|
|
1452
|
-
}
|
|
1453
|
-
function Nn() {
|
|
1454
|
-
return ++On;
|
|
1455
|
-
}
|
|
1456
|
-
function Ot(e) {
|
|
1457
|
-
var t = e.f;
|
|
1458
|
-
if ((t & ce) !== 0)
|
|
1459
|
-
return !0;
|
|
1460
|
-
if (t & Q && (e.f &= ~Je), (t & ze) !== 0) {
|
|
1461
|
-
var r = e.deps;
|
|
1462
|
-
if (r !== null)
|
|
1463
|
-
for (var n = r.length, i = 0; i < n; i++) {
|
|
1464
|
-
var a = r[i];
|
|
1465
|
-
if (Ot(
|
|
1466
|
-
/** @type {Derived} */
|
|
1467
|
-
a
|
|
1468
|
-
) && pn(
|
|
1469
|
-
/** @type {Derived} */
|
|
1470
|
-
a
|
|
1471
|
-
), a.wv > e.wv)
|
|
1472
|
-
return !0;
|
|
1473
|
-
}
|
|
1474
|
-
(t & be) !== 0 && // During time traveling we don't want to reset the status so that
|
|
1475
|
-
// traversal of the graph in the other batches still happens
|
|
1476
|
-
me === null && re(e, te);
|
|
1477
|
-
}
|
|
1478
|
-
return !1;
|
|
1479
|
-
}
|
|
1480
|
-
function Rn(e, t, r = !0) {
|
|
1481
|
-
var n = e.reactions;
|
|
1482
|
-
if (n !== null && !Oe?.includes(e))
|
|
1483
|
-
for (var i = 0; i < n.length; i++) {
|
|
1484
|
-
var a = n[i];
|
|
1485
|
-
(a.f & Q) !== 0 ? Rn(
|
|
1486
|
-
/** @type {Derived} */
|
|
1487
|
-
a,
|
|
1488
|
-
t,
|
|
1489
|
-
!1
|
|
1490
|
-
) : t === a && (r ? re(a, ce) : (a.f & te) !== 0 && re(a, ze), Qe(
|
|
1491
|
-
/** @type {Effect} */
|
|
1492
|
-
a
|
|
1493
|
-
));
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
function zn(e) {
|
|
1497
|
-
var t = ie, r = he, n = ge, i = k, a = Oe, l = ae, f = Se, s = Ze, u = e.f;
|
|
1498
|
-
ie = /** @type {null | Value[]} */
|
|
1499
|
-
null, he = 0, ge = null, k = (u & (Re | tt)) === 0 ? e : null, Oe = null, dt(e.ctx), Se = !1, Ze = ++Mt, e.ac !== null && (er(() => {
|
|
1500
|
-
e.ac.abort(ut);
|
|
1501
|
-
}), e.ac = null);
|
|
1502
|
-
try {
|
|
1503
|
-
e.f |= cr;
|
|
1504
|
-
var c = (
|
|
1505
|
-
/** @type {Function} */
|
|
1506
|
-
e.fn
|
|
1507
|
-
), d = c(), v = e.deps;
|
|
1508
|
-
if (ie !== null) {
|
|
1509
|
-
var _;
|
|
1510
|
-
if (Kt(e, he), v !== null && he > 0)
|
|
1511
|
-
for (v.length = he + ie.length, _ = 0; _ < ie.length; _++)
|
|
1512
|
-
v[he + _] = ie[_];
|
|
1513
|
-
else
|
|
1514
|
-
e.deps = v = ie;
|
|
1515
|
-
if (Tt() && (e.f & be) !== 0)
|
|
1516
|
-
for (_ = he; _ < v.length; _++)
|
|
1517
|
-
(v[_].reactions ??= []).push(e);
|
|
1518
|
-
} else v !== null && he < v.length && (Kt(e, he), v.length = he);
|
|
1519
|
-
if (un() && ge !== null && !Se && v !== null && (e.f & (Q | ze | ce)) === 0)
|
|
1520
|
-
for (_ = 0; _ < /** @type {Source[]} */
|
|
1521
|
-
ge.length; _++)
|
|
1522
|
-
Rn(
|
|
1523
|
-
ge[_],
|
|
1524
|
-
/** @type {Effect} */
|
|
1525
|
-
e
|
|
1526
|
-
);
|
|
1527
|
-
return i !== null && i !== e && (Mt++, ge !== null && (n === null ? n = ge : n.push(.../** @type {Source[]} */
|
|
1528
|
-
ge))), (e.f & He) !== 0 && (e.f ^= He), d;
|
|
1529
|
-
} catch (p) {
|
|
1530
|
-
return fn(p);
|
|
1531
|
-
} finally {
|
|
1532
|
-
e.f ^= cr, ie = t, he = r, ge = n, k = i, Oe = a, dt(l), Se = f, Ze = s;
|
|
1533
|
-
}
|
|
1534
|
-
}
|
|
1535
|
-
function Ma(e, t) {
|
|
1536
|
-
let r = t.reactions;
|
|
1537
|
-
if (r !== null) {
|
|
1538
|
-
var n = bi.call(r, e);
|
|
1539
|
-
if (n !== -1) {
|
|
1540
|
-
var i = r.length - 1;
|
|
1541
|
-
i === 0 ? r = t.reactions = null : (r[n] = r[i], r.pop());
|
|
1542
|
-
}
|
|
1543
|
-
}
|
|
1544
|
-
r === null && (t.f & Q) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
1545
|
-
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
1546
|
-
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
1547
|
-
(ie === null || !ie.includes(t)) && (re(t, ze), (t.f & be) !== 0 && (t.f ^= be, t.f &= ~Je), hn(
|
|
1548
|
-
/** @type {Derived} **/
|
|
1549
|
-
t
|
|
1550
|
-
), Kt(
|
|
1551
|
-
/** @type {Derived} **/
|
|
1552
|
-
t,
|
|
1553
|
-
0
|
|
1554
|
-
));
|
|
1555
|
-
}
|
|
1556
|
-
function Kt(e, t) {
|
|
1557
|
-
var r = e.deps;
|
|
1558
|
-
if (r !== null)
|
|
1559
|
-
for (var n = t; n < r.length; n++)
|
|
1560
|
-
Ma(e, r[n]);
|
|
1561
|
-
}
|
|
1562
|
-
function Dt(e) {
|
|
1563
|
-
var t = e.f;
|
|
1564
|
-
if ((t & Pe) === 0) {
|
|
1565
|
-
re(e, te);
|
|
1566
|
-
var r = M, n = Ge;
|
|
1567
|
-
M = e, Ge = !0;
|
|
1568
|
-
try {
|
|
1569
|
-
(t & (Ne | nn)) !== 0 ? Ia(e) : kn(e), In(e);
|
|
1570
|
-
var i = zn(e);
|
|
1571
|
-
e.teardown = typeof i == "function" ? i : null, e.wv = On;
|
|
1572
|
-
var a;
|
|
1573
|
-
fr && ta && (e.f & ce) !== 0 && e.deps;
|
|
1574
|
-
} finally {
|
|
1575
|
-
Ge = n, M = r;
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
}
|
|
1579
|
-
function o(e) {
|
|
1580
|
-
var t = e.f, r = (t & Q) !== 0;
|
|
1581
|
-
if (k !== null && !Se) {
|
|
1582
|
-
var n = M !== null && (M.f & Pe) !== 0;
|
|
1583
|
-
if (!n && !Oe?.includes(e)) {
|
|
1584
|
-
var i = k.deps;
|
|
1585
|
-
if ((k.f & cr) !== 0)
|
|
1586
|
-
e.rv < Mt && (e.rv = Mt, ie === null && i !== null && i[he] === e ? he++ : ie === null ? ie = [e] : ie.includes(e) || ie.push(e));
|
|
1587
|
-
else {
|
|
1588
|
-
(k.deps ??= []).push(e);
|
|
1589
|
-
var a = e.reactions;
|
|
1590
|
-
a === null ? e.reactions = [k] : a.includes(k) || a.push(k);
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
|
-
}
|
|
1594
|
-
if (nt) {
|
|
1595
|
-
if (Ve.has(e))
|
|
1596
|
-
return Ve.get(e);
|
|
1597
|
-
if (r) {
|
|
1598
|
-
var l = (
|
|
1599
|
-
/** @type {Derived} */
|
|
1600
|
-
e
|
|
1601
|
-
), f = l.v;
|
|
1602
|
-
return ((l.f & te) === 0 && l.reactions !== null || Fn(l)) && (f = Tr(l)), Ve.set(l, f), f;
|
|
1603
|
-
}
|
|
1604
|
-
} else r && (!me?.has(e) || P?.is_fork && !Tt()) && (l = /** @type {Derived} */
|
|
1605
|
-
e, Ot(l) && pn(l), Ge && Tt() && (l.f & be) === 0 && $n(l));
|
|
1606
|
-
if (me?.has(e))
|
|
1607
|
-
return me.get(e);
|
|
1608
|
-
if ((e.f & He) !== 0)
|
|
1609
|
-
throw e.v;
|
|
1610
|
-
return e.v;
|
|
1611
|
-
}
|
|
1612
|
-
function $n(e) {
|
|
1613
|
-
if (e.deps !== null) {
|
|
1614
|
-
e.f ^= be;
|
|
1615
|
-
for (const t of e.deps)
|
|
1616
|
-
(t.reactions ??= []).push(e), (t.f & Q) !== 0 && (t.f & be) === 0 && $n(
|
|
1617
|
-
/** @type {Derived} */
|
|
1618
|
-
t
|
|
1619
|
-
);
|
|
1620
|
-
}
|
|
1621
|
-
}
|
|
1622
|
-
function Fn(e) {
|
|
1623
|
-
if (e.v === X) return !0;
|
|
1624
|
-
if (e.deps === null) return !1;
|
|
1625
|
-
for (const t of e.deps)
|
|
1626
|
-
if (Ve.has(t) || (t.f & Q) !== 0 && Fn(
|
|
1627
|
-
/** @type {Derived} */
|
|
1628
|
-
t
|
|
1629
|
-
))
|
|
1630
|
-
return !0;
|
|
1631
|
-
return !1;
|
|
1632
|
-
}
|
|
1633
|
-
function rr(e) {
|
|
1634
|
-
var t = Se;
|
|
1635
|
-
try {
|
|
1636
|
-
return Se = !0, e();
|
|
1637
|
-
} finally {
|
|
1638
|
-
Se = t;
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1641
|
-
const Da = -7169;
|
|
1642
|
-
function re(e, t) {
|
|
1643
|
-
e.f = e.f & Da | t;
|
|
1644
|
-
}
|
|
1645
|
-
function La(e) {
|
|
1646
|
-
return e.endsWith("capture") && e !== "gotpointercapture" && e !== "lostpointercapture";
|
|
1647
|
-
}
|
|
1648
|
-
const Pa = [
|
|
1649
|
-
"beforeinput",
|
|
1650
|
-
"click",
|
|
1651
|
-
"change",
|
|
1652
|
-
"dblclick",
|
|
1653
|
-
"contextmenu",
|
|
1654
|
-
"focusin",
|
|
1655
|
-
"focusout",
|
|
1656
|
-
"input",
|
|
1657
|
-
"keydown",
|
|
1658
|
-
"keyup",
|
|
1659
|
-
"mousedown",
|
|
1660
|
-
"mousemove",
|
|
1661
|
-
"mouseout",
|
|
1662
|
-
"mouseover",
|
|
1663
|
-
"mouseup",
|
|
1664
|
-
"pointerdown",
|
|
1665
|
-
"pointermove",
|
|
1666
|
-
"pointerout",
|
|
1667
|
-
"pointerover",
|
|
1668
|
-
"pointerup",
|
|
1669
|
-
"touchend",
|
|
1670
|
-
"touchmove",
|
|
1671
|
-
"touchstart"
|
|
1672
|
-
];
|
|
1673
|
-
function Oa(e) {
|
|
1674
|
-
return Pa.includes(e);
|
|
1675
|
-
}
|
|
1676
|
-
const Na = {
|
|
1677
|
-
// no `class: 'className'` because we handle that separately
|
|
1678
|
-
formnovalidate: "formNoValidate",
|
|
1679
|
-
ismap: "isMap",
|
|
1680
|
-
nomodule: "noModule",
|
|
1681
|
-
playsinline: "playsInline",
|
|
1682
|
-
readonly: "readOnly",
|
|
1683
|
-
defaultvalue: "defaultValue",
|
|
1684
|
-
defaultchecked: "defaultChecked",
|
|
1685
|
-
srcobject: "srcObject",
|
|
1686
|
-
novalidate: "noValidate",
|
|
1687
|
-
allowfullscreen: "allowFullscreen",
|
|
1688
|
-
disablepictureinpicture: "disablePictureInPicture",
|
|
1689
|
-
disableremoteplayback: "disableRemotePlayback"
|
|
1690
|
-
};
|
|
1691
|
-
function Ra(e) {
|
|
1692
|
-
return e = e.toLowerCase(), Na[e] ?? e;
|
|
1693
|
-
}
|
|
1694
|
-
const za = ["touchstart", "touchmove"];
|
|
1695
|
-
function $a(e) {
|
|
1696
|
-
return za.includes(e);
|
|
1697
|
-
}
|
|
1698
|
-
const Bn = /* @__PURE__ */ new Set(), _r = /* @__PURE__ */ new Set();
|
|
1699
|
-
function Fa(e, t, r, n = {}) {
|
|
1700
|
-
function i(a) {
|
|
1701
|
-
if (n.capture || St.call(t, a), !a.cancelBubble)
|
|
1702
|
-
return er(() => r?.call(this, a));
|
|
1703
|
-
}
|
|
1704
|
-
return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? rt(() => {
|
|
1705
|
-
t.addEventListener(e, i, n);
|
|
1706
|
-
}) : t.addEventListener(e, i, n), i;
|
|
1707
|
-
}
|
|
1708
|
-
function Wn(e) {
|
|
1709
|
-
for (var t = 0; t < e.length; t++)
|
|
1710
|
-
Bn.add(e[t]);
|
|
1711
|
-
for (var r of _r)
|
|
1712
|
-
r(e);
|
|
1713
|
-
}
|
|
1714
|
-
let Hr = null;
|
|
1715
|
-
function St(e) {
|
|
1716
|
-
var t = this, r = (
|
|
1717
|
-
/** @type {Node} */
|
|
1718
|
-
t.ownerDocument
|
|
1719
|
-
), n = e.type, i = e.composedPath?.() || [], a = (
|
|
1720
|
-
/** @type {null | Element} */
|
|
1721
|
-
i[0] || e.target
|
|
1722
|
-
);
|
|
1723
|
-
Hr = e;
|
|
1724
|
-
var l = 0, f = Hr === e && e.__root;
|
|
1725
|
-
if (f) {
|
|
1726
|
-
var s = i.indexOf(f);
|
|
1727
|
-
if (s !== -1 && (t === document || t === /** @type {any} */
|
|
1728
|
-
window)) {
|
|
1729
|
-
e.__root = t;
|
|
1730
|
-
return;
|
|
1731
|
-
}
|
|
1732
|
-
var u = i.indexOf(t);
|
|
1733
|
-
if (u === -1)
|
|
1734
|
-
return;
|
|
1735
|
-
s <= u && (l = s);
|
|
1736
|
-
}
|
|
1737
|
-
if (a = /** @type {Element} */
|
|
1738
|
-
i[l] || e.target, a !== t) {
|
|
1739
|
-
yi(e, "currentTarget", {
|
|
1740
|
-
configurable: !0,
|
|
1741
|
-
get() {
|
|
1742
|
-
return a || r;
|
|
1743
|
-
}
|
|
1744
|
-
});
|
|
1745
|
-
var c = k, d = M;
|
|
1746
|
-
fe(null), Ce(null);
|
|
1747
|
-
try {
|
|
1748
|
-
for (var v, _ = []; a !== null; ) {
|
|
1749
|
-
var p = a.assignedSlot || a.parentNode || /** @type {any} */
|
|
1750
|
-
a.host || null;
|
|
1751
|
-
try {
|
|
1752
|
-
var w = a["__" + n];
|
|
1753
|
-
w != null && (!/** @type {any} */
|
|
1754
|
-
a.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1755
|
-
// -> the target could not have been disabled because it emits the event in the first place
|
|
1756
|
-
e.target === a) && w.call(a, e);
|
|
1757
|
-
} catch (h) {
|
|
1758
|
-
v ? _.push(h) : v = h;
|
|
1759
|
-
}
|
|
1760
|
-
if (e.cancelBubble || p === t || p === null)
|
|
1761
|
-
break;
|
|
1762
|
-
a = p;
|
|
1763
|
-
}
|
|
1764
|
-
if (v) {
|
|
1765
|
-
for (let h of _)
|
|
1766
|
-
queueMicrotask(() => {
|
|
1767
|
-
throw h;
|
|
1768
|
-
});
|
|
1769
|
-
throw v;
|
|
1770
|
-
}
|
|
1771
|
-
} finally {
|
|
1772
|
-
e.__root = t, delete e.currentTarget, fe(c), Ce(d);
|
|
1773
|
-
}
|
|
1774
|
-
}
|
|
1775
|
-
}
|
|
1776
|
-
function Ba(e) {
|
|
1777
|
-
var t = document.createElement("template");
|
|
1778
|
-
return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
|
|
1779
|
-
}
|
|
1780
|
-
function hr(e, t) {
|
|
1781
|
-
var r = (
|
|
1782
|
-
/** @type {Effect} */
|
|
1783
|
-
M
|
|
1784
|
-
);
|
|
1785
|
-
r.nodes === null && (r.nodes = { start: e, end: t, a: null, t: null });
|
|
1786
|
-
}
|
|
1787
|
-
// @__NO_SIDE_EFFECTS__
|
|
1788
|
-
function U(e, t) {
|
|
1789
|
-
var r = (t & Ki) !== 0, n = (t & Gi) !== 0, i, a = !e.startsWith("<!>");
|
|
1790
|
-
return () => {
|
|
1791
|
-
i === void 0 && (i = Ba(a ? e : "<!>" + e), r || (i = /** @type {TemplateNode} */
|
|
1792
|
-
/* @__PURE__ */ jt(i)));
|
|
1793
|
-
var l = (
|
|
1794
|
-
/** @type {TemplateNode} */
|
|
1795
|
-
n || wn ? document.importNode(i, !0) : i.cloneNode(!0)
|
|
1796
|
-
);
|
|
1797
|
-
if (r) {
|
|
1798
|
-
var f = (
|
|
1799
|
-
/** @type {TemplateNode} */
|
|
1800
|
-
/* @__PURE__ */ jt(l)
|
|
1801
|
-
), s = (
|
|
1802
|
-
/** @type {TemplateNode} */
|
|
1803
|
-
l.lastChild
|
|
1804
|
-
);
|
|
1805
|
-
hr(f, s);
|
|
1806
|
-
} else
|
|
1807
|
-
hr(l, l);
|
|
1808
|
-
return l;
|
|
1809
|
-
};
|
|
1810
|
-
}
|
|
1811
|
-
function Vr() {
|
|
1812
|
-
var e = document.createDocumentFragment(), t = document.createComment(""), r = qe();
|
|
1813
|
-
return e.append(t, r), hr(t, r), e;
|
|
1814
|
-
}
|
|
1815
|
-
function W(e, t) {
|
|
1816
|
-
e !== null && e.before(
|
|
1817
|
-
/** @type {Node} */
|
|
1818
|
-
t
|
|
1819
|
-
);
|
|
1820
|
-
}
|
|
1821
|
-
function K(e, t) {
|
|
1822
|
-
var r = t == null ? "" : typeof t == "object" ? t + "" : t;
|
|
1823
|
-
r !== (e.__t ??= e.nodeValue) && (e.__t = r, e.nodeValue = r + "");
|
|
1824
|
-
}
|
|
1825
|
-
function Wa(e, t) {
|
|
1826
|
-
return Ha(e, t);
|
|
1827
|
-
}
|
|
1828
|
-
const lt = /* @__PURE__ */ new Map();
|
|
1829
|
-
function Ha(e, { target: t, anchor: r, props: n = {}, events: i, context: a, intro: l = !0 }) {
|
|
1830
|
-
ma();
|
|
1831
|
-
var f = /* @__PURE__ */ new Set(), s = (d) => {
|
|
1832
|
-
for (var v = 0; v < d.length; v++) {
|
|
1833
|
-
var _ = d[v];
|
|
1834
|
-
if (!f.has(_)) {
|
|
1835
|
-
f.add(_);
|
|
1836
|
-
var p = $a(_);
|
|
1837
|
-
t.addEventListener(_, St, { passive: p });
|
|
1838
|
-
var w = lt.get(_);
|
|
1839
|
-
w === void 0 ? (document.addEventListener(_, St, { passive: p }), lt.set(_, 1)) : lt.set(_, w + 1);
|
|
1840
|
-
}
|
|
1841
|
-
}
|
|
1842
|
-
};
|
|
1843
|
-
s(Xt(Bn)), _r.add(s);
|
|
1844
|
-
var u = void 0, c = Ca(() => {
|
|
1845
|
-
var d = r ?? t.appendChild(qe());
|
|
1846
|
-
return fa(
|
|
1847
|
-
/** @type {TemplateNode} */
|
|
1848
|
-
d,
|
|
1849
|
-
{
|
|
1850
|
-
pending: () => {
|
|
1851
|
-
}
|
|
1852
|
-
},
|
|
1853
|
-
(v) => {
|
|
1854
|
-
if (a) {
|
|
1855
|
-
Ar({});
|
|
1856
|
-
var _ = (
|
|
1857
|
-
/** @type {ComponentContext} */
|
|
1858
|
-
ae
|
|
1859
|
-
);
|
|
1860
|
-
_.c = a;
|
|
1861
|
-
}
|
|
1862
|
-
i && (n.$$events = i), u = e(v, n) || {}, a && Ir();
|
|
1863
|
-
}
|
|
1864
|
-
), () => {
|
|
1865
|
-
for (var v of f) {
|
|
1866
|
-
t.removeEventListener(v, St);
|
|
1867
|
-
var _ = (
|
|
1868
|
-
/** @type {number} */
|
|
1869
|
-
lt.get(v)
|
|
1870
|
-
);
|
|
1871
|
-
--_ === 0 ? (document.removeEventListener(v, St), lt.delete(v)) : lt.set(v, _);
|
|
1872
|
-
}
|
|
1873
|
-
_r.delete(s), d !== r && d.parentNode?.removeChild(d);
|
|
1874
|
-
};
|
|
1875
|
-
});
|
|
1876
|
-
return pr.set(u, c), u;
|
|
1877
|
-
}
|
|
1878
|
-
let pr = /* @__PURE__ */ new WeakMap();
|
|
1879
|
-
function Va(e, t) {
|
|
1880
|
-
const r = pr.get(e);
|
|
1881
|
-
return r ? (pr.delete(e), r(t)) : Promise.resolve();
|
|
1882
|
-
}
|
|
1883
|
-
class Hn {
|
|
1884
|
-
/** @type {TemplateNode} */
|
|
1885
|
-
anchor;
|
|
1886
|
-
/** @type {Map<Batch, Key>} */
|
|
1887
|
-
#e = /* @__PURE__ */ new Map();
|
|
1888
|
-
/**
|
|
1889
|
-
* Map of keys to effects that are currently rendered in the DOM.
|
|
1890
|
-
* These effects are visible and actively part of the document tree.
|
|
1891
|
-
* Example:
|
|
1892
|
-
* ```
|
|
1893
|
-
* {#if condition}
|
|
1894
|
-
* foo
|
|
1895
|
-
* {:else}
|
|
1896
|
-
* bar
|
|
1897
|
-
* {/if}
|
|
1898
|
-
* ```
|
|
1899
|
-
* Can result in the entries `true->Effect` and `false->Effect`
|
|
1900
|
-
* @type {Map<Key, Effect>}
|
|
1901
|
-
*/
|
|
1902
|
-
#t = /* @__PURE__ */ new Map();
|
|
1903
|
-
/**
|
|
1904
|
-
* Similar to #onscreen with respect to the keys, but contains branches that are not yet
|
|
1905
|
-
* in the DOM, because their insertion is deferred.
|
|
1906
|
-
* @type {Map<Key, Branch>}
|
|
1907
|
-
*/
|
|
1908
|
-
#n = /* @__PURE__ */ new Map();
|
|
1909
|
-
/**
|
|
1910
|
-
* Keys of effects that are currently outroing
|
|
1911
|
-
* @type {Set<Key>}
|
|
1912
|
-
*/
|
|
1913
|
-
#r = /* @__PURE__ */ new Set();
|
|
1914
|
-
/**
|
|
1915
|
-
* Whether to pause (i.e. outro) on change, or destroy immediately.
|
|
1916
|
-
* This is necessary for `<svelte:element>`
|
|
1917
|
-
*/
|
|
1918
|
-
#s = !0;
|
|
1919
|
-
/**
|
|
1920
|
-
* @param {TemplateNode} anchor
|
|
1921
|
-
* @param {boolean} transition
|
|
1922
|
-
*/
|
|
1923
|
-
constructor(t, r = !0) {
|
|
1924
|
-
this.anchor = t, this.#s = r;
|
|
1925
|
-
}
|
|
1926
|
-
#a = () => {
|
|
1927
|
-
var t = (
|
|
1928
|
-
/** @type {Batch} */
|
|
1929
|
-
P
|
|
1930
|
-
);
|
|
1931
|
-
if (this.#e.has(t)) {
|
|
1932
|
-
var r = (
|
|
1933
|
-
/** @type {Key} */
|
|
1934
|
-
this.#e.get(t)
|
|
1935
|
-
), n = this.#t.get(r);
|
|
1936
|
-
if (n)
|
|
1937
|
-
Mr(n), this.#r.delete(r);
|
|
1938
|
-
else {
|
|
1939
|
-
var i = this.#n.get(r);
|
|
1940
|
-
i && (this.#t.set(r, i.effect), this.#n.delete(r), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), n = i.effect);
|
|
1941
|
-
}
|
|
1942
|
-
for (const [a, l] of this.#e) {
|
|
1943
|
-
if (this.#e.delete(a), a === t)
|
|
1944
|
-
break;
|
|
1945
|
-
const f = this.#n.get(l);
|
|
1946
|
-
f && (J(f.effect), this.#n.delete(l));
|
|
1947
|
-
}
|
|
1948
|
-
for (const [a, l] of this.#t) {
|
|
1949
|
-
if (a === r || this.#r.has(a)) continue;
|
|
1950
|
-
const f = () => {
|
|
1951
|
-
if (Array.from(this.#e.values()).includes(a)) {
|
|
1952
|
-
var u = document.createDocumentFragment();
|
|
1953
|
-
Ln(l, u), u.append(qe()), this.#n.set(a, { effect: l, fragment: u });
|
|
1954
|
-
} else
|
|
1955
|
-
J(l);
|
|
1956
|
-
this.#r.delete(a), this.#t.delete(a);
|
|
1957
|
-
};
|
|
1958
|
-
this.#s || !n ? (this.#r.add(a), Ke(l, f, !1)) : f();
|
|
1959
|
-
}
|
|
1960
|
-
}
|
|
1961
|
-
};
|
|
1962
|
-
/**
|
|
1963
|
-
* @param {Batch} batch
|
|
1964
|
-
*/
|
|
1965
|
-
#i = (t) => {
|
|
1966
|
-
this.#e.delete(t);
|
|
1967
|
-
const r = Array.from(this.#e.values());
|
|
1968
|
-
for (const [n, i] of this.#n)
|
|
1969
|
-
r.includes(n) || (J(i.effect), this.#n.delete(n));
|
|
1970
|
-
};
|
|
1971
|
-
/**
|
|
1972
|
-
*
|
|
1973
|
-
* @param {any} key
|
|
1974
|
-
* @param {null | ((target: TemplateNode) => void)} fn
|
|
1975
|
-
*/
|
|
1976
|
-
ensure(t, r) {
|
|
1977
|
-
var n = (
|
|
1978
|
-
/** @type {Batch} */
|
|
1979
|
-
P
|
|
1980
|
-
), i = En();
|
|
1981
|
-
if (r && !this.#t.has(t) && !this.#n.has(t))
|
|
1982
|
-
if (i) {
|
|
1983
|
-
var a = document.createDocumentFragment(), l = qe();
|
|
1984
|
-
a.append(l), this.#n.set(t, {
|
|
1985
|
-
effect: ue(() => r(l)),
|
|
1986
|
-
fragment: a
|
|
1987
|
-
});
|
|
1988
|
-
} else
|
|
1989
|
-
this.#t.set(
|
|
1990
|
-
t,
|
|
1991
|
-
ue(() => r(this.anchor))
|
|
1992
|
-
);
|
|
1993
|
-
if (this.#e.set(n, t), i) {
|
|
1994
|
-
for (const [f, s] of this.#t)
|
|
1995
|
-
f === t ? n.skipped_effects.delete(s) : n.skipped_effects.add(s);
|
|
1996
|
-
for (const [f, s] of this.#n)
|
|
1997
|
-
f === t ? n.skipped_effects.delete(s.effect) : n.skipped_effects.add(s.effect);
|
|
1998
|
-
n.oncommit(this.#a), n.ondiscard(this.#i);
|
|
1999
|
-
} else
|
|
2000
|
-
this.#a();
|
|
2001
|
-
}
|
|
2002
|
-
}
|
|
2003
|
-
function Me(e, t, r = !1) {
|
|
2004
|
-
var n = new Hn(e), i = r ? Xe : 0;
|
|
2005
|
-
function a(l, f) {
|
|
2006
|
-
n.ensure(l, f);
|
|
2007
|
-
}
|
|
2008
|
-
tr(() => {
|
|
2009
|
-
var l = !1;
|
|
2010
|
-
t((f, s = !0) => {
|
|
2011
|
-
l = !0, a(s, f);
|
|
2012
|
-
}), l || a(!1, null);
|
|
2013
|
-
}, i);
|
|
2014
|
-
}
|
|
2015
|
-
function lr(e, t) {
|
|
2016
|
-
return t;
|
|
2017
|
-
}
|
|
2018
|
-
function qa(e, t, r) {
|
|
2019
|
-
for (var n = [], i = t.length, a, l = t.length, f = 0; f < i; f++) {
|
|
2020
|
-
let d = t[f];
|
|
2021
|
-
Ke(
|
|
2022
|
-
d,
|
|
2023
|
-
() => {
|
|
2024
|
-
if (a) {
|
|
2025
|
-
if (a.pending.delete(d), a.done.add(d), a.pending.size === 0) {
|
|
2026
|
-
var v = (
|
|
2027
|
-
/** @type {Set<EachOutroGroup>} */
|
|
2028
|
-
e.outrogroups
|
|
2029
|
-
);
|
|
2030
|
-
gr(Xt(a.done)), v.delete(a), v.size === 0 && (e.outrogroups = null);
|
|
2031
|
-
}
|
|
2032
|
-
} else
|
|
2033
|
-
l -= 1;
|
|
2034
|
-
},
|
|
2035
|
-
!1
|
|
2036
|
-
);
|
|
2037
|
-
}
|
|
2038
|
-
if (l === 0) {
|
|
2039
|
-
var s = n.length === 0 && r !== null;
|
|
2040
|
-
if (s) {
|
|
2041
|
-
var u = (
|
|
2042
|
-
/** @type {Element} */
|
|
2043
|
-
r
|
|
2044
|
-
), c = (
|
|
2045
|
-
/** @type {Element} */
|
|
2046
|
-
u.parentNode
|
|
2047
|
-
);
|
|
2048
|
-
wa(c), c.append(u), e.items.clear();
|
|
2049
|
-
}
|
|
2050
|
-
gr(t, !s);
|
|
2051
|
-
} else
|
|
2052
|
-
a = {
|
|
2053
|
-
pending: new Set(t),
|
|
2054
|
-
done: /* @__PURE__ */ new Set()
|
|
2055
|
-
}, (e.outrogroups ??= /* @__PURE__ */ new Set()).add(a);
|
|
2056
|
-
}
|
|
2057
|
-
function gr(e, t = !0) {
|
|
2058
|
-
for (var r = 0; r < e.length; r++)
|
|
2059
|
-
J(e[r], t);
|
|
2060
|
-
}
|
|
2061
|
-
var qr;
|
|
2062
|
-
function Vt(e, t, r, n, i, a = null) {
|
|
2063
|
-
var l = e, f = /* @__PURE__ */ new Map(), s = (t & on) !== 0;
|
|
2064
|
-
if (s) {
|
|
2065
|
-
var u = (
|
|
2066
|
-
/** @type {Element} */
|
|
2067
|
-
e
|
|
2068
|
-
);
|
|
2069
|
-
l = u.appendChild(qe());
|
|
2070
|
-
}
|
|
2071
|
-
var c = null, d = /* @__PURE__ */ _n(() => {
|
|
2072
|
-
var g = r();
|
|
2073
|
-
return yr(g) ? g : g == null ? [] : Xt(g);
|
|
2074
|
-
}), v, _ = !0;
|
|
2075
|
-
function p() {
|
|
2076
|
-
h.fallback = c, Ua(h, v, l, t, n), c !== null && (v.length === 0 ? (c.f & Le) === 0 ? Mr(c) : (c.f ^= Le, Ct(c, null, l)) : Ke(c, () => {
|
|
2077
|
-
c = null;
|
|
2078
|
-
}));
|
|
2079
|
-
}
|
|
2080
|
-
var w = tr(() => {
|
|
2081
|
-
v = /** @type {V[]} */
|
|
2082
|
-
o(d);
|
|
2083
|
-
for (var g = v.length, A = /* @__PURE__ */ new Set(), y = (
|
|
2084
|
-
/** @type {Batch} */
|
|
2085
|
-
P
|
|
2086
|
-
), E = En(), C = 0; C < g; C += 1) {
|
|
2087
|
-
var R = v[C], I = n(R, C), z = _ ? null : f.get(I);
|
|
2088
|
-
z ? (z.v && _t(z.v, R), z.i && _t(z.i, C), E && y.skipped_effects.delete(z.e)) : (z = ja(
|
|
2089
|
-
f,
|
|
2090
|
-
_ ? l : qr ??= qe(),
|
|
2091
|
-
R,
|
|
2092
|
-
I,
|
|
2093
|
-
C,
|
|
2094
|
-
i,
|
|
2095
|
-
t,
|
|
2096
|
-
r
|
|
2097
|
-
), _ || (z.e.f |= Le), f.set(I, z)), A.add(I);
|
|
2098
|
-
}
|
|
2099
|
-
if (g === 0 && a && !c && (_ ? c = ue(() => a(l)) : (c = ue(() => a(qr ??= qe())), c.f |= Le)), !_)
|
|
2100
|
-
if (E) {
|
|
2101
|
-
for (const [de, j] of f)
|
|
2102
|
-
A.has(de) || y.skipped_effects.add(j.e);
|
|
2103
|
-
y.oncommit(p), y.ondiscard(() => {
|
|
2104
|
-
});
|
|
2105
|
-
} else
|
|
2106
|
-
p();
|
|
2107
|
-
o(d);
|
|
2108
|
-
}), h = { effect: w, items: f, outrogroups: null, fallback: c };
|
|
2109
|
-
_ = !1;
|
|
2110
|
-
}
|
|
2111
|
-
function Ua(e, t, r, n, i) {
|
|
2112
|
-
var a = (n & Hi) !== 0, l = t.length, f = e.items, s = e.effect.first, u, c = null, d, v = [], _ = [], p, w, h, g;
|
|
2113
|
-
if (a)
|
|
2114
|
-
for (g = 0; g < l; g += 1)
|
|
2115
|
-
p = t[g], w = i(p, g), h = /** @type {EachItem} */
|
|
2116
|
-
f.get(w).e, (h.f & Le) === 0 && (h.nodes?.a?.measure(), (d ??= /* @__PURE__ */ new Set()).add(h));
|
|
2117
|
-
for (g = 0; g < l; g += 1) {
|
|
2118
|
-
if (p = t[g], w = i(p, g), h = /** @type {EachItem} */
|
|
2119
|
-
f.get(w).e, e.outrogroups !== null)
|
|
2120
|
-
for (const j of e.outrogroups)
|
|
2121
|
-
j.pending.delete(h), j.done.delete(h);
|
|
2122
|
-
if ((h.f & Le) !== 0)
|
|
2123
|
-
if (h.f ^= Le, h === s)
|
|
2124
|
-
Ct(h, null, r);
|
|
2125
|
-
else {
|
|
2126
|
-
var A = c ? c.next : s;
|
|
2127
|
-
h === e.effect.last && (e.effect.last = h.prev), h.prev && (h.prev.next = h.next), h.next && (h.next.prev = h.prev), Be(e, c, h), Be(e, h, A), Ct(h, A, r), c = h, v = [], _ = [], s = c.next;
|
|
2128
|
-
continue;
|
|
2129
|
-
}
|
|
2130
|
-
if ((h.f & pe) !== 0 && (Mr(h), a && (h.nodes?.a?.unfix(), (d ??= /* @__PURE__ */ new Set()).delete(h))), h !== s) {
|
|
2131
|
-
if (u !== void 0 && u.has(h)) {
|
|
2132
|
-
if (v.length < _.length) {
|
|
2133
|
-
var y = _[0], E;
|
|
2134
|
-
c = y.prev;
|
|
2135
|
-
var C = v[0], R = v[v.length - 1];
|
|
2136
|
-
for (E = 0; E < v.length; E += 1)
|
|
2137
|
-
Ct(v[E], y, r);
|
|
2138
|
-
for (E = 0; E < _.length; E += 1)
|
|
2139
|
-
u.delete(_[E]);
|
|
2140
|
-
Be(e, C.prev, R.next), Be(e, c, C), Be(e, R, y), s = y, c = R, g -= 1, v = [], _ = [];
|
|
2141
|
-
} else
|
|
2142
|
-
u.delete(h), Ct(h, s, r), Be(e, h.prev, h.next), Be(e, h, c === null ? e.effect.first : c.next), Be(e, c, h), c = h;
|
|
2143
|
-
continue;
|
|
2144
|
-
}
|
|
2145
|
-
for (v = [], _ = []; s !== null && s !== h; )
|
|
2146
|
-
(u ??= /* @__PURE__ */ new Set()).add(s), _.push(s), s = s.next;
|
|
2147
|
-
if (s === null)
|
|
2148
|
-
continue;
|
|
2149
|
-
}
|
|
2150
|
-
(h.f & Le) === 0 && v.push(h), c = h, s = h.next;
|
|
2151
|
-
}
|
|
2152
|
-
if (e.outrogroups !== null) {
|
|
2153
|
-
for (const j of e.outrogroups)
|
|
2154
|
-
j.pending.size === 0 && (gr(Xt(j.done)), e.outrogroups?.delete(j));
|
|
2155
|
-
e.outrogroups.size === 0 && (e.outrogroups = null);
|
|
2156
|
-
}
|
|
2157
|
-
if (s !== null || u !== void 0) {
|
|
2158
|
-
var I = [];
|
|
2159
|
-
if (u !== void 0)
|
|
2160
|
-
for (h of u)
|
|
2161
|
-
(h.f & pe) === 0 && I.push(h);
|
|
2162
|
-
for (; s !== null; )
|
|
2163
|
-
(s.f & pe) === 0 && s !== e.fallback && I.push(s), s = s.next;
|
|
2164
|
-
var z = I.length;
|
|
2165
|
-
if (z > 0) {
|
|
2166
|
-
var de = (n & on) !== 0 && l === 0 ? r : null;
|
|
2167
|
-
if (a) {
|
|
2168
|
-
for (g = 0; g < z; g += 1)
|
|
2169
|
-
I[g].nodes?.a?.measure();
|
|
2170
|
-
for (g = 0; g < z; g += 1)
|
|
2171
|
-
I[g].nodes?.a?.fix();
|
|
2172
|
-
}
|
|
2173
|
-
qa(e, I, de);
|
|
2174
|
-
}
|
|
2175
|
-
}
|
|
2176
|
-
a && rt(() => {
|
|
2177
|
-
if (d !== void 0)
|
|
2178
|
-
for (h of d)
|
|
2179
|
-
h.nodes?.a?.apply();
|
|
2180
|
-
});
|
|
2181
|
-
}
|
|
2182
|
-
function ja(e, t, r, n, i, a, l, f) {
|
|
2183
|
-
var s = (l & Bi) !== 0 ? (l & Vi) === 0 ? /* @__PURE__ */ ha(r, !1, !1) : et(r) : null, u = (l & Wi) !== 0 ? et(i) : null;
|
|
2184
|
-
return {
|
|
2185
|
-
v: s,
|
|
2186
|
-
i: u,
|
|
2187
|
-
e: ue(() => (a(t, s ?? r, u ?? i, f), () => {
|
|
2188
|
-
e.delete(n);
|
|
2189
|
-
}))
|
|
2190
|
-
};
|
|
2191
|
-
}
|
|
2192
|
-
function Ct(e, t, r) {
|
|
2193
|
-
if (e.nodes)
|
|
2194
|
-
for (var n = e.nodes.start, i = e.nodes.end, a = t && (t.f & Le) === 0 ? (
|
|
2195
|
-
/** @type {EffectNodes} */
|
|
2196
|
-
t.nodes.start
|
|
2197
|
-
) : r; n !== null; ) {
|
|
2198
|
-
var l = (
|
|
2199
|
-
/** @type {TemplateNode} */
|
|
2200
|
-
/* @__PURE__ */ Lt(n)
|
|
2201
|
-
);
|
|
2202
|
-
if (a.before(n), n === i)
|
|
2203
|
-
return;
|
|
2204
|
-
n = l;
|
|
2205
|
-
}
|
|
2206
|
-
}
|
|
2207
|
-
function Be(e, t, r) {
|
|
2208
|
-
t === null ? e.effect.first = r : t.next = r, r === null ? e.effect.last = t : r.prev = t;
|
|
2209
|
-
}
|
|
2210
|
-
function Vn(e, t, ...r) {
|
|
2211
|
-
var n = new Hn(e);
|
|
2212
|
-
tr(() => {
|
|
2213
|
-
const i = t() ?? null;
|
|
2214
|
-
n.ensure(i, i && ((a) => i(a, ...r)));
|
|
2215
|
-
}, Xe);
|
|
2216
|
-
}
|
|
2217
|
-
function Ya(e, t, r) {
|
|
2218
|
-
Pt(() => {
|
|
2219
|
-
var n = rr(() => t(e, r?.()) || {});
|
|
2220
|
-
if (n?.destroy)
|
|
2221
|
-
return () => (
|
|
2222
|
-
/** @type {Function} */
|
|
2223
|
-
n.destroy()
|
|
2224
|
-
);
|
|
2225
|
-
});
|
|
2226
|
-
}
|
|
2227
|
-
function Ka(e, t) {
|
|
2228
|
-
var r = void 0, n;
|
|
2229
|
-
An(() => {
|
|
2230
|
-
r !== (r = t()) && (n && (J(n), n = null), r && (n = ue(() => {
|
|
2231
|
-
Pt(() => (
|
|
2232
|
-
/** @type {(node: Element) => void} */
|
|
2233
|
-
r(e)
|
|
2234
|
-
));
|
|
2235
|
-
})));
|
|
2236
|
-
});
|
|
2237
|
-
}
|
|
2238
|
-
function qn(e) {
|
|
2239
|
-
var t, r, n = "";
|
|
2240
|
-
if (typeof e == "string" || typeof e == "number") n += e;
|
|
2241
|
-
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
2242
|
-
var i = e.length;
|
|
2243
|
-
for (t = 0; t < i; t++) e[t] && (r = qn(e[t])) && (n && (n += " "), n += r);
|
|
2244
|
-
} else for (r in e) e[r] && (n && (n += " "), n += r);
|
|
2245
|
-
return n;
|
|
2246
|
-
}
|
|
2247
|
-
function Ga() {
|
|
2248
|
-
for (var e, t, r = 0, n = "", i = arguments.length; r < i; r++) (e = arguments[r]) && (t = qn(e)) && (n && (n += " "), n += t);
|
|
2249
|
-
return n;
|
|
2250
|
-
}
|
|
2251
|
-
function Za(e) {
|
|
2252
|
-
return typeof e == "object" ? Ga(e) : e ?? "";
|
|
2253
|
-
}
|
|
2254
|
-
const Ur = [...`
|
|
2255
|
-
\r\f \v\uFEFF`];
|
|
2256
|
-
function Xa(e, t, r) {
|
|
2257
|
-
var n = e == null ? "" : "" + e;
|
|
2258
|
-
if (t && (n = n ? n + " " + t : t), r) {
|
|
2259
|
-
for (var i in r)
|
|
2260
|
-
if (r[i])
|
|
2261
|
-
n = n ? n + " " + i : i;
|
|
2262
|
-
else if (n.length)
|
|
2263
|
-
for (var a = i.length, l = 0; (l = n.indexOf(i, l)) >= 0; ) {
|
|
2264
|
-
var f = l + a;
|
|
2265
|
-
(l === 0 || Ur.includes(n[l - 1])) && (f === n.length || Ur.includes(n[f])) ? n = (l === 0 ? "" : n.substring(0, l)) + n.substring(f + 1) : l = f;
|
|
2266
|
-
}
|
|
2267
|
-
}
|
|
2268
|
-
return n === "" ? null : n;
|
|
2269
|
-
}
|
|
2270
|
-
function jr(e, t = !1) {
|
|
2271
|
-
var r = t ? " !important;" : ";", n = "";
|
|
2272
|
-
for (var i in e) {
|
|
2273
|
-
var a = e[i];
|
|
2274
|
-
a != null && a !== "" && (n += " " + i + ": " + a + r);
|
|
2275
|
-
}
|
|
2276
|
-
return n;
|
|
2277
|
-
}
|
|
2278
|
-
function sr(e) {
|
|
2279
|
-
return e[0] !== "-" || e[1] !== "-" ? e.toLowerCase() : e;
|
|
2280
|
-
}
|
|
2281
|
-
function Ja(e, t) {
|
|
2282
|
-
if (t) {
|
|
2283
|
-
var r = "", n, i;
|
|
2284
|
-
if (Array.isArray(t) ? (n = t[0], i = t[1]) : n = t, e) {
|
|
2285
|
-
e = String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
|
|
2286
|
-
var a = !1, l = 0, f = !1, s = [];
|
|
2287
|
-
n && s.push(...Object.keys(n).map(sr)), i && s.push(...Object.keys(i).map(sr));
|
|
2288
|
-
var u = 0, c = -1;
|
|
2289
|
-
const w = e.length;
|
|
2290
|
-
for (var d = 0; d < w; d++) {
|
|
2291
|
-
var v = e[d];
|
|
2292
|
-
if (f ? v === "/" && e[d - 1] === "*" && (f = !1) : a ? a === v && (a = !1) : v === "/" && e[d + 1] === "*" ? f = !0 : v === '"' || v === "'" ? a = v : v === "(" ? l++ : v === ")" && l--, !f && a === !1 && l === 0) {
|
|
2293
|
-
if (v === ":" && c === -1)
|
|
2294
|
-
c = d;
|
|
2295
|
-
else if (v === ";" || d === w - 1) {
|
|
2296
|
-
if (c !== -1) {
|
|
2297
|
-
var _ = sr(e.substring(u, c).trim());
|
|
2298
|
-
if (!s.includes(_)) {
|
|
2299
|
-
v !== ";" && d++;
|
|
2300
|
-
var p = e.substring(u, d).trim();
|
|
2301
|
-
r += " " + p + ";";
|
|
2302
|
-
}
|
|
2303
|
-
}
|
|
2304
|
-
u = d + 1, c = -1;
|
|
2305
|
-
}
|
|
2306
|
-
}
|
|
2307
|
-
}
|
|
2308
|
-
}
|
|
2309
|
-
return n && (r += jr(n)), i && (r += jr(i, !0)), r = r.trim(), r === "" ? null : r;
|
|
2310
|
-
}
|
|
2311
|
-
return e == null ? null : String(e);
|
|
2312
|
-
}
|
|
2313
|
-
function At(e, t, r, n, i, a) {
|
|
2314
|
-
var l = e.__className;
|
|
2315
|
-
if (l !== r || l === void 0) {
|
|
2316
|
-
var f = Xa(r, n, a);
|
|
2317
|
-
f == null ? e.removeAttribute("class") : t ? e.className = f : e.setAttribute("class", f), e.__className = r;
|
|
2318
|
-
} else if (a && i !== a)
|
|
2319
|
-
for (var s in a) {
|
|
2320
|
-
var u = !!a[s];
|
|
2321
|
-
(i == null || u !== !!i[s]) && e.classList.toggle(s, u);
|
|
2322
|
-
}
|
|
2323
|
-
return a;
|
|
2324
|
-
}
|
|
2325
|
-
function ur(e, t = {}, r, n) {
|
|
2326
|
-
for (var i in r) {
|
|
2327
|
-
var a = r[i];
|
|
2328
|
-
t[i] !== a && (r[i] == null ? e.style.removeProperty(i) : e.style.setProperty(i, a, n));
|
|
2329
|
-
}
|
|
2330
|
-
}
|
|
2331
|
-
function mr(e, t, r, n) {
|
|
2332
|
-
var i = e.__style;
|
|
2333
|
-
if (i !== t) {
|
|
2334
|
-
var a = Ja(t, n);
|
|
2335
|
-
a == null ? e.removeAttribute("style") : e.style.cssText = a, e.__style = t;
|
|
2336
|
-
} else n && (Array.isArray(n) ? (ur(e, r?.[0], n[0]), ur(e, r?.[1], n[1], "important")) : ur(e, r, n));
|
|
2337
|
-
return n;
|
|
2338
|
-
}
|
|
2339
|
-
function Gt(e, t, r = !1) {
|
|
2340
|
-
if (e.multiple) {
|
|
2341
|
-
if (t == null)
|
|
2342
|
-
return;
|
|
2343
|
-
if (!yr(t))
|
|
2344
|
-
return Ji();
|
|
2345
|
-
for (var n of e.options)
|
|
2346
|
-
n.selected = t.includes(kt(n));
|
|
2347
|
-
return;
|
|
2348
|
-
}
|
|
2349
|
-
for (n of e.options) {
|
|
2350
|
-
var i = kt(n);
|
|
2351
|
-
if (ga(i, t)) {
|
|
2352
|
-
n.selected = !0;
|
|
2353
|
-
return;
|
|
2354
|
-
}
|
|
2355
|
-
}
|
|
2356
|
-
(!r || t !== void 0) && (e.selectedIndex = -1);
|
|
2357
|
-
}
|
|
2358
|
-
function Un(e) {
|
|
2359
|
-
var t = new MutationObserver(() => {
|
|
2360
|
-
Gt(e, e.__value);
|
|
2361
|
-
});
|
|
2362
|
-
t.observe(e, {
|
|
2363
|
-
// Listen to option element changes
|
|
2364
|
-
childList: !0,
|
|
2365
|
-
subtree: !0,
|
|
2366
|
-
// because of <optgroup>
|
|
2367
|
-
// Listen to option element value attribute changes
|
|
2368
|
-
// (doesn't get notified of select value changes,
|
|
2369
|
-
// because that property is not reflected as an attribute)
|
|
2370
|
-
attributes: !0,
|
|
2371
|
-
attributeFilter: ["value"]
|
|
2372
|
-
}), xn(() => {
|
|
2373
|
-
t.disconnect();
|
|
2374
|
-
});
|
|
2375
|
-
}
|
|
2376
|
-
function Qa(e, t, r = t) {
|
|
2377
|
-
var n = /* @__PURE__ */ new WeakSet(), i = !0;
|
|
2378
|
-
Ea(e, "change", (a) => {
|
|
2379
|
-
var l = a ? "[selected]" : ":checked", f;
|
|
2380
|
-
if (e.multiple)
|
|
2381
|
-
f = [].map.call(e.querySelectorAll(l), kt);
|
|
2382
|
-
else {
|
|
2383
|
-
var s = e.querySelector(l) ?? // will fall back to first non-disabled option if no option is selected
|
|
2384
|
-
e.querySelector("option:not([disabled])");
|
|
2385
|
-
f = s && kt(s);
|
|
2386
|
-
}
|
|
2387
|
-
r(f), P !== null && n.add(P);
|
|
2388
|
-
}), Pt(() => {
|
|
2389
|
-
var a = t();
|
|
2390
|
-
if (e === document.activeElement) {
|
|
2391
|
-
var l = (
|
|
2392
|
-
/** @type {Batch} */
|
|
2393
|
-
Ht ?? P
|
|
2394
|
-
);
|
|
2395
|
-
if (n.has(l))
|
|
2396
|
-
return;
|
|
2397
|
-
}
|
|
2398
|
-
if (Gt(e, a, i), i && a === void 0) {
|
|
2399
|
-
var f = e.querySelector(":checked");
|
|
2400
|
-
f !== null && (a = kt(f), r(a));
|
|
2401
|
-
}
|
|
2402
|
-
e.__value = a, i = !1;
|
|
2403
|
-
}), Un(e);
|
|
2404
|
-
}
|
|
2405
|
-
function kt(e) {
|
|
2406
|
-
return "__value" in e ? e.__value : e.value;
|
|
2407
|
-
}
|
|
2408
|
-
const st = Symbol("class"), Et = Symbol("style"), jn = Symbol("is custom element"), Yn = Symbol("is html");
|
|
2409
|
-
function eo(e, t) {
|
|
2410
|
-
t ? e.hasAttribute("selected") || e.setAttribute("selected", "") : e.removeAttribute("selected");
|
|
2411
|
-
}
|
|
2412
|
-
function ye(e, t, r, n) {
|
|
2413
|
-
var i = Gn(e);
|
|
2414
|
-
i[t] !== (i[t] = r) && (t === "loading" && (e[ki] = r), r == null ? e.removeAttribute(t) : typeof r != "string" && Zn(e).includes(t) ? e[t] = r : e.setAttribute(t, r));
|
|
2415
|
-
}
|
|
2416
|
-
function to(e, t, r, n, i = !1, a = !1) {
|
|
2417
|
-
var l = Gn(e), f = l[jn], s = !l[Yn], u = t || {}, c = e.tagName === "OPTION";
|
|
2418
|
-
for (var d in t)
|
|
2419
|
-
d in r || (r[d] = null);
|
|
2420
|
-
r.class ? r.class = Za(r.class) : (n || r[st]) && (r.class = null), r[Et] && (r.style ??= null);
|
|
2421
|
-
var v = Zn(e);
|
|
2422
|
-
for (const y in r) {
|
|
2423
|
-
let E = r[y];
|
|
2424
|
-
if (c && y === "value" && E == null) {
|
|
2425
|
-
e.value = e.__value = "", u[y] = E;
|
|
2426
|
-
continue;
|
|
2427
|
-
}
|
|
2428
|
-
if (y === "class") {
|
|
2429
|
-
var _ = e.namespaceURI === "http://www.w3.org/1999/xhtml";
|
|
2430
|
-
At(e, _, E, n, t?.[st], r[st]), u[y] = E, u[st] = r[st];
|
|
2431
|
-
continue;
|
|
2432
|
-
}
|
|
2433
|
-
if (y === "style") {
|
|
2434
|
-
mr(e, E, t?.[Et], r[Et]), u[y] = E, u[Et] = r[Et];
|
|
2435
|
-
continue;
|
|
2436
|
-
}
|
|
2437
|
-
var p = u[y];
|
|
2438
|
-
if (!(E === p && !(E === void 0 && e.hasAttribute(y)))) {
|
|
2439
|
-
u[y] = E;
|
|
2440
|
-
var w = y[0] + y[1];
|
|
2441
|
-
if (w !== "$$")
|
|
2442
|
-
if (w === "on") {
|
|
2443
|
-
const C = {}, R = "$$" + y;
|
|
2444
|
-
let I = y.slice(2);
|
|
2445
|
-
var h = Oa(I);
|
|
2446
|
-
if (La(I) && (I = I.slice(0, -7), C.capture = !0), !h && p) {
|
|
2447
|
-
if (E != null) continue;
|
|
2448
|
-
e.removeEventListener(I, u[R], C), u[R] = null;
|
|
2449
|
-
}
|
|
2450
|
-
if (E != null)
|
|
2451
|
-
if (h)
|
|
2452
|
-
e[`__${I}`] = E, Wn([I]);
|
|
2453
|
-
else {
|
|
2454
|
-
let z = function(de) {
|
|
2455
|
-
u[y].call(this, de);
|
|
2456
|
-
};
|
|
2457
|
-
u[R] = Fa(I, e, z, C);
|
|
2458
|
-
}
|
|
2459
|
-
else h && (e[`__${I}`] = void 0);
|
|
2460
|
-
} else if (y === "style")
|
|
2461
|
-
ye(e, y, E);
|
|
2462
|
-
else if (y === "autofocus")
|
|
2463
|
-
ba(
|
|
2464
|
-
/** @type {HTMLElement} */
|
|
2465
|
-
e,
|
|
2466
|
-
!!E
|
|
2467
|
-
);
|
|
2468
|
-
else if (!f && (y === "__value" || y === "value" && E != null))
|
|
2469
|
-
e.value = e.__value = E;
|
|
2470
|
-
else if (y === "selected" && c)
|
|
2471
|
-
eo(
|
|
2472
|
-
/** @type {HTMLOptionElement} */
|
|
2473
|
-
e,
|
|
2474
|
-
E
|
|
2475
|
-
);
|
|
2476
|
-
else {
|
|
2477
|
-
var g = y;
|
|
2478
|
-
s || (g = Ra(g));
|
|
2479
|
-
var A = g === "defaultValue" || g === "defaultChecked";
|
|
2480
|
-
if (E == null && !f && !A)
|
|
2481
|
-
if (l[y] = null, g === "value" || g === "checked") {
|
|
2482
|
-
let C = (
|
|
2483
|
-
/** @type {HTMLInputElement} */
|
|
2484
|
-
e
|
|
2485
|
-
);
|
|
2486
|
-
const R = t === void 0;
|
|
2487
|
-
if (g === "value") {
|
|
2488
|
-
let I = C.defaultValue;
|
|
2489
|
-
C.removeAttribute(g), C.defaultValue = I, C.value = C.__value = R ? I : null;
|
|
2490
|
-
} else {
|
|
2491
|
-
let I = C.defaultChecked;
|
|
2492
|
-
C.removeAttribute(g), C.defaultChecked = I, C.checked = R ? I : !1;
|
|
2493
|
-
}
|
|
2494
|
-
} else
|
|
2495
|
-
e.removeAttribute(y);
|
|
2496
|
-
else A || v.includes(g) && (f || typeof E != "string") ? (e[g] = E, g in l && (l[g] = X)) : typeof E != "function" && ye(e, g, E);
|
|
2497
|
-
}
|
|
2498
|
-
}
|
|
2499
|
-
}
|
|
2500
|
-
return u;
|
|
2501
|
-
}
|
|
2502
|
-
function Kn(e, t, r = [], n = [], i = [], a, l = !1, f = !1) {
|
|
2503
|
-
vn(i, r, n, (s) => {
|
|
2504
|
-
var u = void 0, c = {}, d = e.nodeName === "SELECT", v = !1;
|
|
2505
|
-
if (An(() => {
|
|
2506
|
-
var p = t(...s.map(o)), w = to(
|
|
2507
|
-
e,
|
|
2508
|
-
u,
|
|
2509
|
-
p,
|
|
2510
|
-
a,
|
|
2511
|
-
l,
|
|
2512
|
-
f
|
|
2513
|
-
);
|
|
2514
|
-
v && d && "value" in p && Gt(
|
|
2515
|
-
/** @type {HTMLSelectElement} */
|
|
2516
|
-
e,
|
|
2517
|
-
p.value
|
|
2518
|
-
);
|
|
2519
|
-
for (let g of Object.getOwnPropertySymbols(c))
|
|
2520
|
-
p[g] || J(c[g]);
|
|
2521
|
-
for (let g of Object.getOwnPropertySymbols(p)) {
|
|
2522
|
-
var h = p[g];
|
|
2523
|
-
g.description === Xi && (!u || h !== u[g]) && (c[g] && J(c[g]), c[g] = ue(() => Ka(e, () => h))), w[g] = h;
|
|
2524
|
-
}
|
|
2525
|
-
u = w;
|
|
2526
|
-
}), d) {
|
|
2527
|
-
var _ = (
|
|
2528
|
-
/** @type {HTMLSelectElement} */
|
|
2529
|
-
e
|
|
2530
|
-
);
|
|
2531
|
-
Pt(() => {
|
|
2532
|
-
Gt(
|
|
2533
|
-
_,
|
|
2534
|
-
/** @type {Record<string | symbol, any>} */
|
|
2535
|
-
u.value,
|
|
2536
|
-
!0
|
|
2537
|
-
), Un(_);
|
|
2538
|
-
});
|
|
2539
|
-
}
|
|
2540
|
-
v = !0;
|
|
2541
|
-
});
|
|
2542
|
-
}
|
|
2543
|
-
function Gn(e) {
|
|
2544
|
-
return (
|
|
2545
|
-
/** @type {Record<string | symbol, unknown>} **/
|
|
2546
|
-
// @ts-expect-error
|
|
2547
|
-
e.__attributes ??= {
|
|
2548
|
-
[jn]: e.nodeName.includes("-"),
|
|
2549
|
-
[Yn]: e.namespaceURI === Zi
|
|
2550
|
-
}
|
|
2551
|
-
);
|
|
2552
|
-
}
|
|
2553
|
-
var Yr = /* @__PURE__ */ new Map();
|
|
2554
|
-
function Zn(e) {
|
|
2555
|
-
var t = e.getAttribute("is") || e.nodeName, r = Yr.get(t);
|
|
2556
|
-
if (r) return r;
|
|
2557
|
-
Yr.set(t, r = []);
|
|
2558
|
-
for (var n, i = e, a = Element.prototype; a !== i; ) {
|
|
2559
|
-
n = Ei(i);
|
|
2560
|
-
for (var l in n)
|
|
2561
|
-
n[l].set && r.push(l);
|
|
2562
|
-
i = en(i);
|
|
2563
|
-
}
|
|
2564
|
-
return r;
|
|
2565
|
-
}
|
|
2566
|
-
function Kr(e, t) {
|
|
2567
|
-
return e === t || e?.[Ye] === t;
|
|
2568
|
-
}
|
|
2569
|
-
function qt(e = {}, t, r, n) {
|
|
2570
|
-
return Pt(() => {
|
|
2571
|
-
var i, a;
|
|
2572
|
-
return Cn(() => {
|
|
2573
|
-
i = a, a = [], rr(() => {
|
|
2574
|
-
e !== r(...a) && (t(e, ...a), i && Kr(r(...i), e) && t(null, ...i));
|
|
2575
|
-
});
|
|
2576
|
-
}), () => {
|
|
2577
|
-
rt(() => {
|
|
2578
|
-
a && Kr(r(...a), e) && t(null, ...a);
|
|
2579
|
-
});
|
|
2580
|
-
};
|
|
2581
|
-
}), e;
|
|
2582
|
-
}
|
|
2583
|
-
let Bt = !1;
|
|
2584
|
-
function ro(e) {
|
|
2585
|
-
var t = Bt;
|
|
2586
|
-
try {
|
|
2587
|
-
return Bt = !1, [e(), Bt];
|
|
2588
|
-
} finally {
|
|
2589
|
-
Bt = t;
|
|
2590
|
-
}
|
|
2591
|
-
}
|
|
2592
|
-
const no = {
|
|
2593
|
-
get(e, t) {
|
|
2594
|
-
if (!e.exclude.includes(t))
|
|
2595
|
-
return e.props[t];
|
|
2596
|
-
},
|
|
2597
|
-
set(e, t) {
|
|
2598
|
-
return !1;
|
|
2599
|
-
},
|
|
2600
|
-
getOwnPropertyDescriptor(e, t) {
|
|
2601
|
-
if (!e.exclude.includes(t) && t in e.props)
|
|
2602
|
-
return {
|
|
2603
|
-
enumerable: !0,
|
|
2604
|
-
configurable: !0,
|
|
2605
|
-
value: e.props[t]
|
|
2606
|
-
};
|
|
2607
|
-
},
|
|
2608
|
-
has(e, t) {
|
|
2609
|
-
return e.exclude.includes(t) ? !1 : t in e.props;
|
|
2610
|
-
},
|
|
2611
|
-
ownKeys(e) {
|
|
2612
|
-
return Reflect.ownKeys(e.props).filter((t) => !e.exclude.includes(t));
|
|
2613
|
-
}
|
|
2614
|
-
};
|
|
2615
|
-
// @__NO_SIDE_EFFECTS__
|
|
2616
|
-
function Xn(e, t, r) {
|
|
2617
|
-
return new Proxy(
|
|
2618
|
-
{ props: e, exclude: t },
|
|
2619
|
-
no
|
|
2620
|
-
);
|
|
2621
|
-
}
|
|
2622
|
-
function se(e, t, r, n) {
|
|
2623
|
-
var i = (r & ji) !== 0, a = (r & Yi) !== 0, l = (
|
|
2624
|
-
/** @type {V} */
|
|
2625
|
-
n
|
|
2626
|
-
), f = !0, s = () => (f && (f = !1, l = a ? rr(
|
|
2627
|
-
/** @type {() => V} */
|
|
2628
|
-
n
|
|
2629
|
-
) : (
|
|
2630
|
-
/** @type {V} */
|
|
2631
|
-
n
|
|
2632
|
-
)), l), u;
|
|
2633
|
-
if (i) {
|
|
2634
|
-
var c = Ye in e || Ii in e;
|
|
2635
|
-
u = ct(e, t)?.set ?? (c && t in e ? (A) => e[t] = A : void 0);
|
|
2636
|
-
}
|
|
2637
|
-
var d, v = !1;
|
|
2638
|
-
i ? [d, v] = ro(() => (
|
|
2639
|
-
/** @type {V} */
|
|
2640
|
-
e[t]
|
|
2641
|
-
)) : d = /** @type {V} */
|
|
2642
|
-
e[t], d === void 0 && n !== void 0 && (d = s(), u && (Ni(), u(d)));
|
|
2643
|
-
var _;
|
|
2644
|
-
if (_ = () => {
|
|
2645
|
-
var A = (
|
|
2646
|
-
/** @type {V} */
|
|
2647
|
-
e[t]
|
|
2648
|
-
);
|
|
2649
|
-
return A === void 0 ? s() : (f = !0, A);
|
|
2650
|
-
}, (r & Ui) === 0)
|
|
2651
|
-
return _;
|
|
2652
|
-
if (u) {
|
|
2653
|
-
var p = e.$$legacy;
|
|
2654
|
-
return (
|
|
2655
|
-
/** @type {() => V} */
|
|
2656
|
-
(function(A, y) {
|
|
2657
|
-
return arguments.length > 0 ? ((!y || p || v) && u(y ? _() : A), A) : _();
|
|
2658
|
-
})
|
|
2659
|
-
);
|
|
2660
|
-
}
|
|
2661
|
-
var w = !1, h = ((r & qi) !== 0 ? Qt : _n)(() => (w = !1, _()));
|
|
2662
|
-
i && o(h);
|
|
2663
|
-
var g = (
|
|
2664
|
-
/** @type {Effect} */
|
|
2665
|
-
M
|
|
2666
|
-
);
|
|
2667
|
-
return (
|
|
2668
|
-
/** @type {() => V} */
|
|
2669
|
-
(function(A, y) {
|
|
2670
|
-
if (arguments.length > 0) {
|
|
2671
|
-
const E = y ? o(h) : i ? We(A) : A;
|
|
2672
|
-
return x(h, E), w = !0, l !== void 0 && (l = E), A;
|
|
2673
|
-
}
|
|
2674
|
-
return nt && w || (g.f & Pe) !== 0 ? h.v : o(h);
|
|
2675
|
-
})
|
|
2676
|
-
);
|
|
2677
|
-
}
|
|
2678
|
-
const io = ".btn.svelte-sgoebi{display:inline-flex;flex-wrap:nowrap;flex-shrink:0;justify-content:center;align-items:center;gap:.375rem;cursor:pointer;text-align:center;vertical-align:middle;user-select:none;-webkit-user-select:none;touch-action:manipulation;font-weight:600;height:var(--size);padding-inline:var(--btn-p);font-size:var(--fontsize, .875rem);color:var(--btn-fg);background-color:var(--btn-bg);border-width:var(--tri-border);border-style:solid;border-color:var(--btn-border);border-start-start-radius:var(--join-ss, var(--tri-radius-buttons));border-start-end-radius:var(--join-se, var(--tri-radius-buttons));border-end-end-radius:var(--join-ee, var(--tri-radius-buttons));border-end-start-radius:var(--join-es, var(--tri-radius-buttons));outline-offset:2px;outline-color:var(--btn-color, var(--tri-content));text-shadow:0 .5px oklch(100% 0 0 / calc(var(--tri-depth) * .15));box-shadow:0 .5px 0 .5px oklch(100% 0 0 / calc(var(--tri-depth) * 6%)) inset,var(--btn-shadow);transition-property:color,background-color,border-color,box-shadow;transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);--size: calc(var(--tri-size-field, .25rem) * 10);--btn-bg: var(--btn-color, var(--tri-toolbar-bg));--btn-fg: var(--tri-content);--btn-p: 1rem;--btn-border: color-mix( in oklab, var(--btn-bg), #000 calc(var(--tri-depth) * 5%) );--btn-shadow: 0 3px 2px -2px color-mix( in oklab, var(--btn-bg) calc(var(--tri-depth) * 30%), #0000 ), 0 4px 3px -2px color-mix( in oklab, var(--btn-bg) calc(var(--tri-depth) * 30%), #0000 )}@media(hover:hover){.btn.svelte-sgoebi:hover{--btn-bg: color-mix( in oklab, var(--btn-color, var(--tri-toolbar-bg)), #000 7% )}}.btn.svelte-sgoebi:focus-visible{isolation:isolate;outline-width:2px;outline-style:solid}.btn.svelte-sgoebi:active:not(.active){--btn-bg: color-mix( in oklab, var(--btn-color, var(--tri-toolbar-bg)), #000 5% );--btn-border: color-mix( in oklab, var(--btn-color, var(--tri-toolbar-bg)), #000 7% );--btn-shadow: 0 0 0 0 oklch(0% 0 0 / 0), 0 0 0 0 oklch(0% 0 0 / 0);translate:0 .5px}.btn.active.svelte-sgoebi{--btn-bg: color-mix( in oklab, var(--btn-color, var(--tri-toolbar-bg)), #000 7% )}.btn.svelte-sgoebi:disabled,.btn[disabled].svelte-sgoebi{pointer-events:none;--btn-border: #0000;--btn-fg: color-mix(in oklch, var(--tri-content) 20%, #0000)}.btn.svelte-sgoebi:disabled:not(.ghost):not(.outline),.btn[disabled].svelte-sgoebi:not(.ghost):not(.outline){background-color:color-mix(in oklab,var(--tri-content) 10%,transparent);box-shadow:none}.circle.svelte-sgoebi{width:var(--size);height:var(--size);border-radius:3.40282e38px;padding-inline:0}.square.svelte-sgoebi{width:var(--size);height:var(--size);padding-inline:0}.ghost.svelte-sgoebi{--btn-bg: transparent;--btn-border: transparent;--btn-fg: var(--btn-color-text, var(--btn-color, var(--tri-content)));box-shadow:none;text-shadow:none}@media(hover:hover){.ghost.svelte-sgoebi:hover{--btn-bg: color-mix(in oklab, var(--tri-content) 10%, transparent)}}.ghost.svelte-sgoebi:active:not(.active),.ghost.active.svelte-sgoebi{--btn-bg: color-mix(in oklab, var(--tri-content) 10%, transparent);--btn-border: transparent}.outline.svelte-sgoebi:not(:hover):not(:active):not(:focus-visible):not(.active):not(:disabled):not([disabled]){--btn-bg: transparent;--btn-fg: var(--btn-color-text, var(--btn-color, var(--tri-content)));--btn-border: var(--btn-color, var(--tri-content));box-shadow:none;text-shadow:none}.select-wrapper.svelte-1hwvamm{display:inline-flex;width:clamp(3rem,20rem,100%);max-width:100%}.native-select.svelte-1hwvamm{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;pointer-events:none}.select.svelte-1hwvamm{border:var(--tri-border) solid var(--input-color);appearance:none;background-color:var(--tri-input-bg);vertical-align:middle;width:100%;height:var(--size);touch-action:manipulation;white-space:nowrap;box-shadow:0 1px color-mix(in oklab,var(--input-color) calc(var(--tri-depth) * 10%),#0000) inset,0 -1px oklch(100% 0 0 / calc(var(--tri-depth) * .1)) inset;--input-color: color-mix(in oklab, var(--tri-content) 20%, #0000);--size: calc(var(--tri-size-field, .25rem) * 10);background-image:linear-gradient(45deg,#0000 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,#0000 50%);background-position:calc(100% - 20px) calc(1px + 50%),calc(100% - 16.1px) calc(1px + 50%);background-repeat:no-repeat;background-size:4px 4px,4px 4px;border-start-start-radius:var(--join-ss, var(--tri-radius-buttons));border-start-end-radius:var(--join-se, var(--tri-radius-buttons));border-end-end-radius:var(--join-ee, var(--tri-radius-buttons));border-end-start-radius:var(--join-es, var(--tri-radius-buttons));align-items:center;gap:.375rem;padding-inline:.75rem 1.75rem;font-size:.875rem;display:inline-flex;position:relative;cursor:pointer;color:inherit;text-align:start}.select-label.svelte-1hwvamm{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-label.placeholder.svelte-1hwvamm{color:color-mix(in oklab,var(--tri-content) 55%,transparent)}.select.svelte-1hwvamm:hover:not(:disabled){--input-color: color-mix(in oklab, var(--tri-content) 40%, #0000)}.select.svelte-1hwvamm:focus-visible,.select.open.svelte-1hwvamm{--input-color: var(--tri-content);box-shadow:0 1px color-mix(in oklab,var(--input-color) calc(var(--tri-depth) * 10%),#0000);outline:2px solid var(--input-color);outline-offset:2px;isolation:isolate;z-index:1}.select.svelte-1hwvamm:is(:where(.svelte-1hwvamm):disabled,[disabled]:where(.svelte-1hwvamm)){cursor:not-allowed;border-color:var(--tri-panel-bg);background-color:var(--tri-panel-bg);color:color-mix(in oklab,var(--tri-content) 40%,transparent)}.ghost.svelte-1hwvamm{box-shadow:none;background-color:#0000;border-color:#0000;transition:background-color .2s}.ghost.svelte-1hwvamm:hover:not(:disabled){background-color:color-mix(in oklab,var(--tri-content) 8%,transparent)}.ghost.svelte-1hwvamm:focus-visible,.ghost.open.svelte-1hwvamm{background-color:var(--tri-input-bg);color:var(--tri-content)}.listbox.svelte-1hwvamm{position:fixed;inset:auto;margin:0;padding:.1875rem;border:var(--tri-border) solid color-mix(in oklab,var(--tri-content) 20%,#0000);background-color:var(--tri-input-bg);color:var(--tri-content);border-radius:var(--tri-radius-buttons);box-shadow:0 8px 24px oklch(0 0 0 / calc(.12 + var(--tri-depth) * .06));max-height:16rem;overflow-y:auto;min-width:8rem;z-index:1}.listbox.svelte-1hwvamm:not(:popover-open){display:none}.option.svelte-1hwvamm{padding:.25rem .5rem;border-radius:calc(var(--tri-radius-buttons) * .6);cursor:pointer;font-size:.8125rem;line-height:1.3;white-space:nowrap;color:inherit}.option.active.svelte-1hwvamm{background-color:color-mix(in oklab,var(--tri-content) 12%,#0000)}.option.selected.svelte-1hwvamm{background-color:color-mix(in oklab,var(--tri-color-primary) 90%,#0000);color:var(--tri-color-primary-content)}.option.selected.active.svelte-1hwvamm{background-color:var(--tri-color-primary)}.option[aria-disabled=true].svelte-1hwvamm{opacity:.5;cursor:not-allowed;color:color-mix(in oklab,var(--tri-content) 55%,transparent)}\n", ao = {
|
|
2679
|
-
en: {
|
|
2680
|
-
image_download_title: "Download Image",
|
|
2681
|
-
image_download_close: "Close Download Image",
|
|
2682
|
-
image_download_description: "Download the current canvas as an image.",
|
|
2683
|
-
image_download_mode: "What to download",
|
|
2684
|
-
image_download_mode_composite: "Composite canvas",
|
|
2685
|
-
image_download_mode_composite_hint: "Every image on the current canvas, composited together.",
|
|
2686
|
-
image_download_mode_single: "Single image",
|
|
2687
|
-
image_download_mode_single_hint: "One image from the current canvas.",
|
|
2688
|
-
image_download_mode_world: "Current view",
|
|
2689
|
-
image_download_mode_world_hint: "Everything currently laid out together in the viewer.",
|
|
2690
|
-
image_download_canvas: "Canvas",
|
|
2691
|
-
image_download_image: "Image",
|
|
2692
|
-
image_download_resolution: "Resolution",
|
|
2693
|
-
image_download_resolution_placeholder: "Select a resolution",
|
|
2694
|
-
image_download_downloading: "Downloading...",
|
|
2695
|
-
image_download_download: "Download",
|
|
2696
|
-
image_download_disabled_no_canvas: "Load a manifest to download an image.",
|
|
2697
|
-
image_download_disabled_no_resolution: "Select a resolution to download.",
|
|
2698
|
-
image_download_result_downloaded: "Downloaded {filename}.",
|
|
2699
|
-
image_download_error_failed: "Unable to download image. Check the browser console for details."
|
|
2700
|
-
},
|
|
2701
|
-
de: {
|
|
2702
|
-
image_download_title: "Bild herunterladen",
|
|
2703
|
-
image_download_close: "Bild-Download schließen",
|
|
2704
|
-
image_download_description: "Die aktuelle Leinwand als Bild herunterladen.",
|
|
2705
|
-
image_download_mode: "Was heruntergeladen werden soll",
|
|
2706
|
-
image_download_mode_composite: "Zusammengesetzte Leinwand",
|
|
2707
|
-
image_download_mode_composite_hint: "Alle Bilder der aktuellen Leinwand, zusammengesetzt.",
|
|
2708
|
-
image_download_mode_single: "Einzelbild",
|
|
2709
|
-
image_download_mode_single_hint: "Ein Bild von der aktuellen Leinwand.",
|
|
2710
|
-
image_download_mode_world: "Aktuelle Ansicht",
|
|
2711
|
-
image_download_mode_world_hint: "Alles, was aktuell zusammen im Viewer angezeigt wird.",
|
|
2712
|
-
image_download_canvas: "Leinwand",
|
|
2713
|
-
image_download_image: "Bild",
|
|
2714
|
-
image_download_resolution: "Auflösung",
|
|
2715
|
-
image_download_resolution_placeholder: "Auflösung auswählen",
|
|
2716
|
-
image_download_downloading: "Wird heruntergeladen...",
|
|
2717
|
-
image_download_download: "Herunterladen",
|
|
2718
|
-
image_download_disabled_no_canvas: "Laden Sie ein Manifest, um ein Bild herunterzuladen.",
|
|
2719
|
-
image_download_disabled_no_resolution: "Wählen Sie eine Auflösung zum Herunterladen aus.",
|
|
2720
|
-
image_download_result_downloaded: "{filename} heruntergeladen.",
|
|
2721
|
-
image_download_error_failed: "Bild kann nicht heruntergeladen werden. Details in der Browserkonsole."
|
|
2722
|
-
}
|
|
2723
|
-
}, Jn = Symbol("triiiceratops:plugin-image-download"), oo = "0 0 256 256", lo = '<path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"/>', Qn = fi(
|
|
2724
|
-
`<svg viewBox="${oo}">${lo}</svg>`
|
|
2725
|
-
), so = "5";
|
|
2726
|
-
typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(so);
|
|
2727
|
-
var uo = /* @__PURE__ */ U("<button><!></button>");
|
|
2728
|
-
function fo(e, t) {
|
|
2729
|
-
let r = se(t, "variant", 3, "default"), n = se(t, "size", 3, "md"), i = se(t, "circle", 3, !1), a = se(t, "square", 3, !1), l = se(t, "ghost", 3, !1), f = se(t, "outline", 3, !1), s = se(t, "active", 3, !1), u = se(t, "class", 3, ""), c = se(t, "style", 3, ""), d = /* @__PURE__ */ Xn(t, [
|
|
2730
|
-
"$$slots",
|
|
2731
|
-
"$$events",
|
|
2732
|
-
"$$legacy",
|
|
2733
|
-
"variant",
|
|
2734
|
-
"size",
|
|
2735
|
-
"circle",
|
|
2736
|
-
"square",
|
|
2737
|
-
"ghost",
|
|
2738
|
-
"outline",
|
|
2739
|
-
"active",
|
|
2740
|
-
"class",
|
|
2741
|
-
"style",
|
|
2742
|
-
"children"
|
|
2743
|
-
]);
|
|
2744
|
-
const v = {
|
|
2745
|
-
default: "",
|
|
2746
|
-
primary: "--btn-color:var(--tri-color-primary);--btn-color-text:var(--tri-color-primary-text);--btn-fg:var(--tri-color-primary-content);",
|
|
2747
|
-
neutral: "--btn-color:var(--tri-color-neutral);--btn-fg:var(--tri-color-neutral-content);",
|
|
2748
|
-
success: "--btn-color:var(--tri-color-success);--btn-fg:var(--tri-color-success-content);",
|
|
2749
|
-
warning: "--btn-color:var(--tri-color-warning);--btn-fg:var(--tri-color-warning-content);",
|
|
2750
|
-
error: "--btn-color:var(--tri-color-error);--btn-fg:var(--tri-color-error-content);"
|
|
2751
|
-
}, _ = {
|
|
2752
|
-
xs: "--fontsize:0.6875rem;--btn-p:0.5rem;--size:calc(var(--tri-size-field,0.25rem)*6);",
|
|
2753
|
-
sm: "--fontsize:0.75rem;--btn-p:0.75rem;--size:calc(var(--tri-size-field,0.25rem)*8);",
|
|
2754
|
-
md: "--fontsize:0.875rem;--btn-p:1rem;--size:calc(var(--tri-size-field,0.25rem)*10);",
|
|
2755
|
-
lg: "--fontsize:1.125rem;--btn-p:1.25rem;--size:calc(var(--tri-size-field,0.25rem)*12);"
|
|
2756
|
-
};
|
|
2757
|
-
let p = /* @__PURE__ */ L(() => `${_[n()]}${v[r()]}${c()}`);
|
|
2758
|
-
var w = uo();
|
|
2759
|
-
Kn(
|
|
2760
|
-
w,
|
|
2761
|
-
() => ({
|
|
2762
|
-
class: `btn ${u() ?? ""}`,
|
|
2763
|
-
style: o(p),
|
|
2764
|
-
...d,
|
|
2765
|
-
[st]: {
|
|
2766
|
-
circle: i(),
|
|
2767
|
-
square: a(),
|
|
2768
|
-
ghost: l(),
|
|
2769
|
-
outline: f(),
|
|
2770
|
-
active: s()
|
|
2771
|
-
}
|
|
2772
|
-
}),
|
|
2773
|
-
void 0,
|
|
2774
|
-
void 0,
|
|
2775
|
-
void 0,
|
|
2776
|
-
"svelte-sgoebi"
|
|
2777
|
-
);
|
|
2778
|
-
var h = S(w);
|
|
2779
|
-
Vn(h, () => t.children ?? tn), W(e, w);
|
|
2780
|
-
}
|
|
2781
|
-
let co = 0;
|
|
2782
|
-
var vo = /* @__PURE__ */ U('<div role="option"> </div>'), _o = /* @__PURE__ */ U('<div><select><!></select> <button type="button" role="combobox" aria-haspopup="listbox"><span> </span></button> <div role="listbox" class="listbox svelte-1hwvamm" popover="manual" tabindex="-1"></div></div>');
|
|
2783
|
-
function Wt(e, t) {
|
|
2784
|
-
Ar(t, !0);
|
|
2785
|
-
let r = se(t, "value", 15), n = se(t, "size", 3, "md"), i = se(t, "ghost", 3, !1), a = se(t, "class", 3, ""), l = se(t, "style", 3, ""), f = /* @__PURE__ */ Xn(t, [
|
|
2786
|
-
"$$slots",
|
|
2787
|
-
"$$events",
|
|
2788
|
-
"$$legacy",
|
|
2789
|
-
"value",
|
|
2790
|
-
"size",
|
|
2791
|
-
"ghost",
|
|
2792
|
-
"class",
|
|
2793
|
-
"style",
|
|
2794
|
-
"children"
|
|
2795
|
-
]);
|
|
2796
|
-
const s = {
|
|
2797
|
-
xs: "calc(var(--tri-size-field,0.25rem)*6)",
|
|
2798
|
-
sm: "calc(var(--tri-size-field,0.25rem)*8)",
|
|
2799
|
-
md: "calc(var(--tri-size-field,0.25rem)*10)",
|
|
2800
|
-
lg: "calc(var(--tri-size-field,0.25rem)*12)"
|
|
2801
|
-
};
|
|
2802
|
-
let u = /* @__PURE__ */ L(() => `--size:${s[n()]};${l()}`);
|
|
2803
|
-
const c = `tri-listbox-${co++}`;
|
|
2804
|
-
let d = /* @__PURE__ */ O(null), v = /* @__PURE__ */ O(null), _ = /* @__PURE__ */ O(null), p = /* @__PURE__ */ O(We([])), w = /* @__PURE__ */ O(!1), h = /* @__PURE__ */ O(-1), g = /* @__PURE__ */ L(() => !!t.disabled), A = /* @__PURE__ */ L(() => r() == null ? "" : String(r())), y = /* @__PURE__ */ L(() => o(p).find((m) => m.value === o(A)) ?? o(p)[0]);
|
|
2805
|
-
function E() {
|
|
2806
|
-
o(d) && x(
|
|
2807
|
-
p,
|
|
2808
|
-
Array.from(o(d).querySelectorAll("option")).map((m) => ({
|
|
2809
|
-
value: m.value,
|
|
2810
|
-
label: (m.textContent ?? "").trim(),
|
|
2811
|
-
disabled: m.disabled
|
|
2812
|
-
})),
|
|
2813
|
-
!0
|
|
2814
|
-
);
|
|
2815
|
-
}
|
|
2816
|
-
xt(() => {
|
|
2817
|
-
if (!o(d)) return;
|
|
2818
|
-
E();
|
|
2819
|
-
const m = new MutationObserver(() => E());
|
|
2820
|
-
return m.observe(o(d), {
|
|
2821
|
-
childList: !0,
|
|
2822
|
-
subtree: !0,
|
|
2823
|
-
characterData: !0,
|
|
2824
|
-
attributes: !0
|
|
2825
|
-
}), () => m.disconnect();
|
|
2826
|
-
});
|
|
2827
|
-
function C(m) {
|
|
2828
|
-
const D = o(p)[m];
|
|
2829
|
-
!o(d) || !D || D.disabled || (o(d).value = D.value, o(d).dispatchEvent(new Event("input", { bubbles: !0 })), o(d).dispatchEvent(new Event("change", { bubbles: !0 })), j());
|
|
2830
|
-
}
|
|
2831
|
-
function R() {
|
|
2832
|
-
if (!o(v) || !o(_)) return;
|
|
2833
|
-
const m = o(v).getBoundingClientRect();
|
|
2834
|
-
o(_).style.minWidth = `${m.width}px`, o(_).style.left = `${m.left}px`;
|
|
2835
|
-
const D = o(_).offsetHeight, B = window.innerHeight - m.bottom;
|
|
2836
|
-
B < D && m.top > B ? o(_).style.top = `${Math.max(4, m.top - D - 4)}px` : o(_).style.top = `${m.bottom + 4}px`;
|
|
2837
|
-
}
|
|
2838
|
-
function I() {
|
|
2839
|
-
o(_)?.children[o(h)]?.scrollIntoView({ block: "nearest" });
|
|
2840
|
-
}
|
|
2841
|
-
function z(m) {
|
|
2842
|
-
const D = m.composedPath();
|
|
2843
|
-
o(v) && D.includes(o(v)) || o(_) && D.includes(o(_)) || j();
|
|
2844
|
-
}
|
|
2845
|
-
function de() {
|
|
2846
|
-
o(g) || o(w) || !o(_) || (x(w, !0), o(_).showPopover(), R(), x(h, o(p).findIndex((m) => m.value === o(A)), !0), o(h) < 0 && x(h, o(p).findIndex((m) => !m.disabled), !0), I(), window.addEventListener("scroll", R, !0), window.addEventListener("resize", R), document.addEventListener("pointerdown", z, !0));
|
|
2847
|
-
}
|
|
2848
|
-
function j() {
|
|
2849
|
-
o(w) && (x(w, !1), o(_)?.hidePopover(), window.removeEventListener("scroll", R, !0), window.removeEventListener("resize", R), document.removeEventListener("pointerdown", z, !0), o(v)?.focus());
|
|
2850
|
-
}
|
|
2851
|
-
function pt() {
|
|
2852
|
-
o(w) ? j() : de();
|
|
2853
|
-
}
|
|
2854
|
-
function Nt(m) {
|
|
2855
|
-
if (!o(p).length) return;
|
|
2856
|
-
let D = o(h);
|
|
2857
|
-
for (let B = 0; B < o(p).length; B++)
|
|
2858
|
-
if (D = (D + m + o(p).length) % o(p).length, !o(p)[D]?.disabled) {
|
|
2859
|
-
x(h, D, !0), I();
|
|
2860
|
-
return;
|
|
2861
|
-
}
|
|
2862
|
-
}
|
|
2863
|
-
function Ue(m) {
|
|
2864
|
-
const D = m === "start" ? o(p).map((B, le) => le) : o(p).map((B, le) => o(p).length - 1 - le);
|
|
2865
|
-
for (const B of D)
|
|
2866
|
-
if (!o(p)[B]?.disabled) {
|
|
2867
|
-
x(h, B, !0), I();
|
|
2868
|
-
return;
|
|
2869
|
-
}
|
|
2870
|
-
}
|
|
2871
|
-
let $e = "", Rt;
|
|
2872
|
-
function je(m) {
|
|
2873
|
-
$e += m.toLowerCase(), clearTimeout(Rt), Rt = setTimeout(() => $e = "", 600);
|
|
2874
|
-
const D = o(p).findIndex((B) => !B.disabled && B.label.toLowerCase().startsWith($e));
|
|
2875
|
-
D >= 0 && (x(h, D, !0), I());
|
|
2876
|
-
}
|
|
2877
|
-
function zt(m) {
|
|
2878
|
-
if (!o(g)) {
|
|
2879
|
-
if (!o(w)) {
|
|
2880
|
-
["ArrowDown", "ArrowUp", "Enter", " "].includes(m.key) && (m.preventDefault(), de());
|
|
2881
|
-
return;
|
|
2882
|
-
}
|
|
2883
|
-
switch (m.key) {
|
|
2884
|
-
case "ArrowDown":
|
|
2885
|
-
m.preventDefault(), Nt(1);
|
|
2886
|
-
break;
|
|
2887
|
-
case "ArrowUp":
|
|
2888
|
-
m.preventDefault(), Nt(-1);
|
|
2889
|
-
break;
|
|
2890
|
-
case "Home":
|
|
2891
|
-
m.preventDefault(), Ue("start");
|
|
2892
|
-
break;
|
|
2893
|
-
case "End":
|
|
2894
|
-
m.preventDefault(), Ue("end");
|
|
2895
|
-
break;
|
|
2896
|
-
case "Enter":
|
|
2897
|
-
case " ":
|
|
2898
|
-
m.preventDefault(), o(h) >= 0 && C(o(h));
|
|
2899
|
-
break;
|
|
2900
|
-
case "Escape":
|
|
2901
|
-
m.preventDefault(), j();
|
|
2902
|
-
break;
|
|
2903
|
-
case "Tab":
|
|
2904
|
-
j();
|
|
2905
|
-
break;
|
|
2906
|
-
default:
|
|
2907
|
-
m.key.length === 1 && !m.metaKey && !m.ctrlKey && je(m.key);
|
|
2908
|
-
}
|
|
2909
|
-
}
|
|
2910
|
-
}
|
|
2911
|
-
var Fe = _o(), Ie = S(Fe);
|
|
2912
|
-
Kn(
|
|
2913
|
-
Ie,
|
|
2914
|
-
() => ({
|
|
2915
|
-
class: "native-select",
|
|
2916
|
-
tabindex: "-1",
|
|
2917
|
-
"aria-hidden": "true",
|
|
2918
|
-
...f
|
|
2919
|
-
}),
|
|
2920
|
-
void 0,
|
|
2921
|
-
void 0,
|
|
2922
|
-
void 0,
|
|
2923
|
-
"svelte-1hwvamm"
|
|
2924
|
-
);
|
|
2925
|
-
var $t = S(Ie);
|
|
2926
|
-
Vn($t, () => t.children ?? tn), qt(Ie, (m) => x(d, m), () => o(d));
|
|
2927
|
-
var oe = Y(Ie, 2);
|
|
2928
|
-
let it;
|
|
2929
|
-
oe.__click = pt, oe.__keydown = zt;
|
|
2930
|
-
var gt = S(oe);
|
|
2931
|
-
let mt;
|
|
2932
|
-
var nr = S(gt);
|
|
2933
|
-
qt(oe, (m) => x(v, m), () => o(v));
|
|
2934
|
-
var at = Y(oe, 2);
|
|
2935
|
-
Vt(at, 23, () => o(p), (m, D) => m.value + "\0" + D, (m, D, B) => {
|
|
2936
|
-
var le = vo();
|
|
2937
|
-
let wt;
|
|
2938
|
-
le.__click = () => C(o(B)), le.__pointermove = () => x(h, o(B), !0);
|
|
2939
|
-
var ir = S(le);
|
|
2940
|
-
Z(() => {
|
|
2941
|
-
ye(le, "id", `${c}-opt-${o(B) ?? ""}`), wt = At(le, 1, "option svelte-1hwvamm", null, wt, {
|
|
2942
|
-
active: o(B) === o(h),
|
|
2943
|
-
selected: o(D).value === o(A)
|
|
2944
|
-
}), ye(le, "aria-selected", o(D).value === o(A)), ye(le, "aria-disabled", o(D).disabled), K(ir, o(D).label);
|
|
2945
|
-
}), W(m, le);
|
|
2946
|
-
}), qt(at, (m) => x(_, m), () => o(_)), Z(() => {
|
|
2947
|
-
At(Fe, 1, `select-wrapper ${a() ?? ""}`, "svelte-1hwvamm"), mr(Fe, l()), it = At(oe, 1, "select svelte-1hwvamm", null, it, { ghost: i(), open: o(w) }), mr(oe, o(u)), oe.disabled = o(g), ye(oe, "aria-expanded", o(w)), ye(oe, "aria-controls", c), ye(oe, "aria-activedescendant", o(w) && o(h) >= 0 ? `${c}-opt-${o(h)}` : void 0), ye(oe, "aria-label", f["aria-label"]), mt = At(gt, 1, "select-label svelte-1hwvamm", null, mt, { placeholder: o(y)?.disabled }), K(nr, o(y)?.label ?? ""), ye(at, "id", c);
|
|
2948
|
-
}), Qa(Ie, r), W(e, Fe), Ir();
|
|
2949
|
-
}
|
|
2950
|
-
Wn(["click", "keydown", "pointermove"]);
|
|
2951
|
-
function ho(e, t, r) {
|
|
2952
|
-
ci(
|
|
2953
|
-
e,
|
|
2954
|
-
"@triiiceratops/plugin-image-export",
|
|
2955
|
-
"1.0.0-rc.0",
|
|
2956
|
-
t,
|
|
2957
|
-
r
|
|
2958
|
-
);
|
|
2959
|
-
}
|
|
2960
|
-
function po(e) {
|
|
2961
|
-
return e.replace(/[^a-z0-9-_]+/gi, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
2962
|
-
}
|
|
2963
|
-
function go(e, t, r) {
|
|
2964
|
-
const n = r === "image/jpeg" ? "jpg" : "png", i = po(e) || "image", a = t === "single" ? "" : `-${t}`;
|
|
2965
|
-
return `${i}${a}.${n}`;
|
|
2966
|
-
}
|
|
2967
|
-
function Gr(e, t) {
|
|
2968
|
-
return Zt(e, { getSelectedChoice: t });
|
|
2969
|
-
}
|
|
2970
|
-
function mo(e) {
|
|
2971
|
-
return hi(e);
|
|
2972
|
-
}
|
|
2973
|
-
function wo(e, t) {
|
|
2974
|
-
const n = Zt(e, {
|
|
2975
|
-
getSelectedChoice: t
|
|
2976
|
-
})[0];
|
|
2977
|
-
return !n?.canvasWidth || !n?.canvasHeight ? [] : Jr(n.canvasWidth, n.canvasHeight);
|
|
2978
|
-
}
|
|
2979
|
-
async function bo(e, t) {
|
|
2980
|
-
const r = t.url ?? wr(e, {
|
|
2981
|
-
width: t.width,
|
|
2982
|
-
height: t.height
|
|
2983
|
-
});
|
|
2984
|
-
if (!r)
|
|
2985
|
-
throw new Error("No exportable image found for this canvas.");
|
|
2986
|
-
return br(r);
|
|
2987
|
-
}
|
|
2988
|
-
async function yo(e, t, r = {}) {
|
|
2989
|
-
const n = Zt(e, {
|
|
2990
|
-
getSelectedChoice: r.getSelectedChoice
|
|
2991
|
-
}), i = n[0];
|
|
2992
|
-
if (!i)
|
|
2993
|
-
throw new Error("No exportable image found for this canvas.");
|
|
2994
|
-
const { canvasWidth: a, canvasHeight: l } = i;
|
|
2995
|
-
if (!a || !l)
|
|
2996
|
-
throw new Error("Unable to determine canvas dimensions for export.");
|
|
2997
|
-
const { width: f, height: s } = Zr(
|
|
2998
|
-
t.width,
|
|
2999
|
-
t.height
|
|
3000
|
-
), u = f / a, c = await Promise.all(
|
|
3001
|
-
n.map(
|
|
3002
|
-
async (d) => Eo(d, a, l, u)
|
|
3003
|
-
)
|
|
3004
|
-
);
|
|
3005
|
-
return Xr(
|
|
3006
|
-
c,
|
|
3007
|
-
f,
|
|
3008
|
-
s,
|
|
3009
|
-
r.format ?? "image/png"
|
|
3010
|
-
);
|
|
3011
|
-
}
|
|
3012
|
-
async function Eo(e, t, r, n) {
|
|
3013
|
-
const i = pi(
|
|
3014
|
-
e,
|
|
3015
|
-
t,
|
|
3016
|
-
r,
|
|
3017
|
-
n
|
|
3018
|
-
), a = wr(e, { width: i.width });
|
|
3019
|
-
if (!a)
|
|
3020
|
-
throw new Error("No exportable image found for this canvas.");
|
|
3021
|
-
return {
|
|
3022
|
-
blob: await br(a),
|
|
3023
|
-
...i
|
|
3024
|
-
};
|
|
3025
|
-
}
|
|
3026
|
-
function ei(e) {
|
|
3027
|
-
return _i({
|
|
3028
|
-
canvases: e.canvases,
|
|
3029
|
-
currentCanvasId: e.canvasId,
|
|
3030
|
-
currentCanvasIndex: e.currentCanvasIndex,
|
|
3031
|
-
viewingMode: e.viewingMode,
|
|
3032
|
-
pagedOffset: e.pagedOffset
|
|
3033
|
-
}).map((t) => t.canvas);
|
|
3034
|
-
}
|
|
3035
|
-
function ti(e, t) {
|
|
3036
|
-
const r = ei(e);
|
|
3037
|
-
if (!r.length) return null;
|
|
3038
|
-
const n = r.flatMap((d, v) => {
|
|
3039
|
-
const _ = Qr(d) ?? `canvas-${v}`;
|
|
3040
|
-
return Zt(d, { getSelectedChoice: t }).map(
|
|
3041
|
-
(p) => ({
|
|
3042
|
-
canvasId: _,
|
|
3043
|
-
x: p.x,
|
|
3044
|
-
y: p.y,
|
|
3045
|
-
width: p.width,
|
|
3046
|
-
tileSource: {
|
|
3047
|
-
width: p.resourceWidth || p.canvasWidth,
|
|
3048
|
-
height: p.resourceHeight || p.canvasHeight,
|
|
3049
|
-
resolved: p
|
|
3050
|
-
}
|
|
3051
|
-
})
|
|
3052
|
-
);
|
|
3053
|
-
});
|
|
3054
|
-
if (!n.length) return null;
|
|
3055
|
-
const { layouts: i, sources: a } = gi(n, {
|
|
3056
|
-
mode: e.viewingMode,
|
|
3057
|
-
direction: e.viewingDirection,
|
|
3058
|
-
preserveCanvasScale: e.preserveCanvasScale,
|
|
3059
|
-
gap: mi
|
|
3060
|
-
});
|
|
3061
|
-
if (!i.length) return null;
|
|
3062
|
-
const l = Math.min(...i.map((d) => d.x)), f = Math.min(...i.map((d) => d.y)), s = Math.max(...i.map((d) => d.x + d.width)), u = Math.max(...i.map((d) => d.y + d.height));
|
|
3063
|
-
return { entries: a.map((d) => ({
|
|
3064
|
-
resolved: d.tileSource.resolved,
|
|
3065
|
-
x: d.x - l,
|
|
3066
|
-
y: d.y - f,
|
|
3067
|
-
width: d.width
|
|
3068
|
-
})), worldWidth: s - l, worldHeight: u - f };
|
|
3069
|
-
}
|
|
3070
|
-
function xo(e, t) {
|
|
3071
|
-
const r = ti(e, t);
|
|
3072
|
-
if (!r) return [];
|
|
3073
|
-
const n = r.entries[0], i = n?.resolved.resourceWidth && n.width > 0 ? n.resolved.resourceWidth / n.width : 1600, a = Math.round(r.worldWidth * i), l = Math.round(r.worldHeight * i);
|
|
3074
|
-
return !a || !l ? [] : Jr(a, l);
|
|
3075
|
-
}
|
|
3076
|
-
async function So(e, t, r = {}) {
|
|
3077
|
-
const n = ti(e, r.getSelectedChoice);
|
|
3078
|
-
if (!n)
|
|
3079
|
-
throw new Error("Nothing is currently displayed in the viewer.");
|
|
3080
|
-
const { width: i, height: a } = Zr(
|
|
3081
|
-
t.width,
|
|
3082
|
-
t.height
|
|
3083
|
-
), l = i / n.worldWidth, f = await Promise.all(
|
|
3084
|
-
n.entries.map(async ({ resolved: s, x: u, y: c, width: d }) => {
|
|
3085
|
-
const v = Math.max(1, Math.round(d * l)), _ = s.resourceWidth && s.resourceHeight ? s.resourceHeight / s.resourceWidth : 1, p = Math.max(1, Math.round(v * _)), w = wr(s, {
|
|
3086
|
-
width: v
|
|
3087
|
-
});
|
|
3088
|
-
if (!w)
|
|
3089
|
-
throw new Error(
|
|
3090
|
-
"No exportable image found for the current view."
|
|
3091
|
-
);
|
|
3092
|
-
return {
|
|
3093
|
-
blob: await br(w),
|
|
3094
|
-
x: Math.round(u * l),
|
|
3095
|
-
y: Math.round(c * l),
|
|
3096
|
-
width: v,
|
|
3097
|
-
height: p
|
|
3098
|
-
};
|
|
3099
|
-
})
|
|
3100
|
-
);
|
|
3101
|
-
return Xr(
|
|
3102
|
-
f,
|
|
3103
|
-
i,
|
|
3104
|
-
a,
|
|
3105
|
-
r.format ?? "image/png"
|
|
3106
|
-
);
|
|
3107
|
-
}
|
|
3108
|
-
var Co = /* @__PURE__ */ U("<option> </option>"), Ao = /* @__PURE__ */ U("<option> </option>"), Io = /* @__PURE__ */ U("<!> <option> </option> <!>", 1), ko = /* @__PURE__ */ U('<div class="tri-id-field"><label class="tri-id-label" for="tri-id-mode"><span> </span></label> <!></div>'), To = /* @__PURE__ */ U("<option> </option>"), Mo = /* @__PURE__ */ U('<div class="tri-id-field"><label class="tri-id-label" for="tri-id-canvas"><span> </span></label> <!></div>'), Do = /* @__PURE__ */ U("<option> </option>"), Lo = /* @__PURE__ */ U('<div class="tri-id-field"><label class="tri-id-label" for="tri-id-image"><span> </span></label> <!></div>'), Po = /* @__PURE__ */ U("<option> </option>"), Oo = /* @__PURE__ */ U("<option disabled> </option> <!>", 1), No = /* @__PURE__ */ U('<div class="tri-id-alert is-success" data-tri-id-result=""><span> </span></div>'), Ro = /* @__PURE__ */ U('<div class="tri-id-alert is-error" data-tri-id-error=""><span> </span></div>'), zo = /* @__PURE__ */ U('<div class="tri-id-alert"><span> </span></div>'), $o = /* @__PURE__ */ U('<div class="tri-id-card"><div class="tri-id-card-body"><!> <!> <!></div></div>'), Fo = /* @__PURE__ */ U('<span aria-hidden="true"></span> ', 1), Bo = /* @__PURE__ */ U('<div class="tri-id" data-tri-id="" data-panel-id="image-download"><div class="tri-id-body"><p class="tri-id-desc"> </p> <div class="tri-id-fields"><!> <!> <!> <div class="tri-id-field"><label class="tri-id-label" for="tri-id-resolution"><span> </span></label> <!></div></div> <!></div> <div class="tri-id-footer"><!></div></div>');
|
|
3109
|
-
function Wo(e, t) {
|
|
3110
|
-
Ar(t, !0);
|
|
3111
|
-
const { context: r } = ra(Jn), { viewerState: n, selectors: i, locale: a, ui: l } = r;
|
|
3112
|
-
let f = /* @__PURE__ */ O(0), s = /* @__PURE__ */ O(0);
|
|
3113
|
-
i.select((b) => [
|
|
3114
|
-
b.canvasId,
|
|
3115
|
-
b.currentCanvasIndex,
|
|
3116
|
-
b.canvases,
|
|
3117
|
-
b.viewingMode,
|
|
3118
|
-
b.viewingDirection,
|
|
3119
|
-
b.pagedOffset,
|
|
3120
|
-
b.preserveCanvasScale
|
|
3121
|
-
]).subscribe(() => {
|
|
3122
|
-
Rr(f);
|
|
3123
|
-
}), a.subscribe(() => {
|
|
3124
|
-
Rr(s);
|
|
3125
|
-
});
|
|
3126
|
-
const u = (b, T) => (o(s), a.t(b, T));
|
|
3127
|
-
let c = /* @__PURE__ */ O("single"), d = /* @__PURE__ */ O(0), v = /* @__PURE__ */ O(0), _ = /* @__PURE__ */ O(We([])), p = /* @__PURE__ */ O(null), w = /* @__PURE__ */ O(!1), h = /* @__PURE__ */ O(!1), g = /* @__PURE__ */ O(""), A = /* @__PURE__ */ O(""), y = /* @__PURE__ */ O(null);
|
|
3128
|
-
const E = (b) => n.getSelectedChoice(b), C = /* @__PURE__ */ L(() => (o(f), n.currentCanvasIndex >= 0 ? n.canvases[n.currentCanvasIndex] ?? null : null)), R = /* @__PURE__ */ L(() => (o(f), o(C) ? Gr(o(C), E) : [])), I = /* @__PURE__ */ L(() => o(R).length > 1), z = /* @__PURE__ */ L(() => o(I)), de = /* @__PURE__ */ L(() => (o(f), ei(n))), j = /* @__PURE__ */ L(() => o(de).length > 1), pt = /* @__PURE__ */ L(() => o(j)), Nt = /* @__PURE__ */ L(() => o(z) || o(pt)), Ue = /* @__PURE__ */ L(() => (o(f), o(c) === "single" && o(j) ? o(de)[o(d)] ?? o(C) : o(C))), $e = /* @__PURE__ */ L(() => (o(f), o(Ue) ? Gr(o(Ue), E) : [])), Rt = /* @__PURE__ */ L(() => o($e).length > 1), je = /* @__PURE__ */ L(() => o(p) !== null ? o(_)[o(p)] ?? null : null), zt = /* @__PURE__ */ L(() => !o(h) && !o(w) && !!o(C) && !!o(je)), Fe = /* @__PURE__ */ L(() => (o(s), o(C) ? !o(w) && !o(_).length ? u("image_download_disabled_no_resolution") : null : u("image_download_disabled_no_canvas")));
|
|
3129
|
-
xt(() => {
|
|
3130
|
-
(o(c) === "composite" && !o(z) || o(c) === "world" && !o(pt)) && x(c, "single");
|
|
3131
|
-
}), xt(() => {
|
|
3132
|
-
o(f);
|
|
3133
|
-
const b = n.canvasId, T = o(de).findIndex((H) => Qr(H) === b);
|
|
3134
|
-
x(d, T >= 0 ? T : 0, !0);
|
|
3135
|
-
}), xt(() => {
|
|
3136
|
-
o(Ue), x(v, 0);
|
|
3137
|
-
}), xt(() => {
|
|
3138
|
-
const b = o(C), T = o(c), H = o(v);
|
|
3139
|
-
let $ = !1;
|
|
3140
|
-
if (x(_, [], !0), x(p, null), !!b) {
|
|
3141
|
-
if (T === "single") {
|
|
3142
|
-
const V = o($e)[H];
|
|
3143
|
-
if (!V) return;
|
|
3144
|
-
x(w, !0), mo(V).then((ee) => {
|
|
3145
|
-
$ || (x(_, ee, !0), x(p, ee.length ? 0 : null, !0));
|
|
3146
|
-
}).finally(() => {
|
|
3147
|
-
$ || x(w, !1);
|
|
3148
|
-
});
|
|
3149
|
-
} else if (T === "composite") {
|
|
3150
|
-
const V = wo(b, E);
|
|
3151
|
-
x(_, V, !0), x(p, V.length ? 0 : null, !0);
|
|
3152
|
-
} else {
|
|
3153
|
-
const V = xo(n, E);
|
|
3154
|
-
x(_, V, !0), x(p, V.length ? 0 : null, !0);
|
|
3155
|
-
}
|
|
3156
|
-
return () => {
|
|
3157
|
-
$ = !0;
|
|
3158
|
-
};
|
|
3159
|
-
}
|
|
3160
|
-
});
|
|
3161
|
-
function Ie(b) {
|
|
3162
|
-
const T = Number(b);
|
|
3163
|
-
return Number.isInteger(T) ? T : 0;
|
|
3164
|
-
}
|
|
3165
|
-
async function $t() {
|
|
3166
|
-
if (!(!o(C) || !o(je) || !o(zt))) {
|
|
3167
|
-
x(h, !0), x(g, ""), x(A, "");
|
|
3168
|
-
try {
|
|
3169
|
-
let b, T = o(C);
|
|
3170
|
-
if (o(c) === "single") {
|
|
3171
|
-
T = o(Ue);
|
|
3172
|
-
const $ = o($e)[o(v)];
|
|
3173
|
-
if (!$) return;
|
|
3174
|
-
b = await bo($, o(je));
|
|
3175
|
-
} else o(c) === "composite" ? b = await yo(o(C), o(je), { getSelectedChoice: E }) : b = await So(n, o(je), { getSelectedChoice: E });
|
|
3176
|
-
const H = go(Lr(T, n.currentCanvasIndex), o(c), "image/png");
|
|
3177
|
-
wi(b, H), x(A, u("image_download_result_downloaded", { filename: H }), !0);
|
|
3178
|
-
} catch (b) {
|
|
3179
|
-
x(g, u("image_download_error_failed"), !0), o(y) && ho(o(y), b, () => void $t());
|
|
3180
|
-
} finally {
|
|
3181
|
-
x(h, !1);
|
|
3182
|
-
}
|
|
3183
|
-
}
|
|
3184
|
-
}
|
|
3185
|
-
function oe(b) {
|
|
3186
|
-
return { destroy: l.renderIcon(Qn, b) };
|
|
3187
|
-
}
|
|
3188
|
-
var it = Bo(), gt = S(it), mt = S(gt), nr = S(mt), at = Y(mt, 2), m = S(at);
|
|
3189
|
-
{
|
|
3190
|
-
var D = (b) => {
|
|
3191
|
-
var T = ko(), H = S(T), $ = S(H), V = S($), ee = Y(H, 2);
|
|
3192
|
-
{
|
|
3193
|
-
let F = /* @__PURE__ */ L(() => u("image_download_mode"));
|
|
3194
|
-
Wt(ee, {
|
|
3195
|
-
id: "tri-id-mode",
|
|
3196
|
-
class: "tri-id-field-select",
|
|
3197
|
-
"data-tri-id-mode": !0,
|
|
3198
|
-
get "aria-label"() {
|
|
3199
|
-
return o(F);
|
|
3200
|
-
},
|
|
3201
|
-
get disabled() {
|
|
3202
|
-
return o(h);
|
|
3203
|
-
},
|
|
3204
|
-
get value() {
|
|
3205
|
-
return o(c);
|
|
3206
|
-
},
|
|
3207
|
-
onchange: (ne) => {
|
|
3208
|
-
x(c, ne.currentTarget.value, !0);
|
|
3209
|
-
},
|
|
3210
|
-
children: (ne, ot) => {
|
|
3211
|
-
var N = Io(), G = yt(N);
|
|
3212
|
-
{
|
|
3213
|
-
var ve = (_e) => {
|
|
3214
|
-
var Te = Co(), ar = S(Te);
|
|
3215
|
-
Te.value = Te.__value = "composite", Z((or) => K(ar, or), [() => u("image_download_mode_composite")]), W(_e, Te);
|
|
3216
|
-
};
|
|
3217
|
-
Me(G, (_e) => {
|
|
3218
|
-
o(z) && _e(ve);
|
|
3219
|
-
});
|
|
3220
|
-
}
|
|
3221
|
-
var q = Y(G, 2), ke = S(q);
|
|
3222
|
-
q.value = q.__value = "single";
|
|
3223
|
-
var we = Y(q, 2);
|
|
3224
|
-
{
|
|
3225
|
-
var bt = (_e) => {
|
|
3226
|
-
var Te = Ao(), ar = S(Te);
|
|
3227
|
-
Te.value = Te.__value = "world", Z((or) => K(ar, or), [() => u("image_download_mode_world")]), W(_e, Te);
|
|
3228
|
-
};
|
|
3229
|
-
Me(we, (_e) => {
|
|
3230
|
-
o(pt) && _e(bt);
|
|
3231
|
-
});
|
|
3232
|
-
}
|
|
3233
|
-
Z((_e) => K(ke, _e), [() => u("image_download_mode_single")]), W(ne, N);
|
|
3234
|
-
},
|
|
3235
|
-
$$slots: { default: !0 }
|
|
3236
|
-
});
|
|
3237
|
-
}
|
|
3238
|
-
Z((F) => K(V, F), [() => u("image_download_mode")]), W(b, T);
|
|
3239
|
-
};
|
|
3240
|
-
Me(m, (b) => {
|
|
3241
|
-
o(Nt) && b(D);
|
|
3242
|
-
});
|
|
3243
|
-
}
|
|
3244
|
-
var B = Y(m, 2);
|
|
3245
|
-
{
|
|
3246
|
-
var le = (b) => {
|
|
3247
|
-
var T = Mo(), H = S(T), $ = S(H), V = S($), ee = Y(H, 2);
|
|
3248
|
-
{
|
|
3249
|
-
let F = /* @__PURE__ */ L(() => u("image_download_canvas"));
|
|
3250
|
-
Wt(ee, {
|
|
3251
|
-
id: "tri-id-canvas",
|
|
3252
|
-
class: "tri-id-field-select",
|
|
3253
|
-
get "aria-label"() {
|
|
3254
|
-
return o(F);
|
|
3255
|
-
},
|
|
3256
|
-
get disabled() {
|
|
3257
|
-
return o(h);
|
|
3258
|
-
},
|
|
3259
|
-
get value() {
|
|
3260
|
-
return o(d);
|
|
3261
|
-
},
|
|
3262
|
-
onchange: (ne) => {
|
|
3263
|
-
x(d, Ie(ne.currentTarget.value), !0);
|
|
3264
|
-
},
|
|
3265
|
-
children: (ne, ot) => {
|
|
3266
|
-
var N = Vr(), G = yt(N);
|
|
3267
|
-
Vt(G, 17, () => o(de), lr, (ve, q, ke) => {
|
|
3268
|
-
var we = To(), bt = S(we);
|
|
3269
|
-
we.value = we.__value = ke, Z((_e) => K(bt, _e), [() => Lr(o(q), ke)]), W(ve, we);
|
|
3270
|
-
}), W(ne, N);
|
|
3271
|
-
},
|
|
3272
|
-
$$slots: { default: !0 }
|
|
3273
|
-
});
|
|
3274
|
-
}
|
|
3275
|
-
Z((F) => K(V, F), [() => u("image_download_canvas")]), W(b, T);
|
|
3276
|
-
};
|
|
3277
|
-
Me(B, (b) => {
|
|
3278
|
-
o(c) === "single" && o(j) && b(le);
|
|
3279
|
-
});
|
|
3280
|
-
}
|
|
3281
|
-
var wt = Y(B, 2);
|
|
3282
|
-
{
|
|
3283
|
-
var ir = (b) => {
|
|
3284
|
-
var T = Lo(), H = S(T), $ = S(H), V = S($), ee = Y(H, 2);
|
|
3285
|
-
{
|
|
3286
|
-
let F = /* @__PURE__ */ L(() => u("image_download_image"));
|
|
3287
|
-
Wt(ee, {
|
|
3288
|
-
id: "tri-id-image",
|
|
3289
|
-
class: "tri-id-field-select",
|
|
3290
|
-
get "aria-label"() {
|
|
3291
|
-
return o(F);
|
|
3292
|
-
},
|
|
3293
|
-
get disabled() {
|
|
3294
|
-
return o(h);
|
|
3295
|
-
},
|
|
3296
|
-
get value() {
|
|
3297
|
-
return o(v);
|
|
3298
|
-
},
|
|
3299
|
-
onchange: (ne) => {
|
|
3300
|
-
x(v, Ie(ne.currentTarget.value), !0);
|
|
3301
|
-
},
|
|
3302
|
-
children: (ne, ot) => {
|
|
3303
|
-
var N = Vr(), G = yt(N);
|
|
3304
|
-
Vt(G, 17, () => o($e), lr, (ve, q, ke) => {
|
|
3305
|
-
var we = Do(), bt = S(we);
|
|
3306
|
-
we.value = we.__value = ke, Z((_e) => K(bt, _e), [
|
|
3307
|
-
() => o(q).label ?? `${u("image_download_image")} ${ke + 1}`
|
|
3308
|
-
]), W(ve, we);
|
|
3309
|
-
}), W(ne, N);
|
|
3310
|
-
},
|
|
3311
|
-
$$slots: { default: !0 }
|
|
3312
|
-
});
|
|
3313
|
-
}
|
|
3314
|
-
Z((F) => K(V, F), [() => u("image_download_image")]), W(b, T);
|
|
3315
|
-
};
|
|
3316
|
-
Me(wt, (b) => {
|
|
3317
|
-
o(c) === "single" && o(Rt) && b(ir);
|
|
3318
|
-
});
|
|
3319
|
-
}
|
|
3320
|
-
var ri = Y(wt, 2), Dr = S(ri), ni = S(Dr), ii = S(ni), ai = Y(Dr, 2);
|
|
3321
|
-
{
|
|
3322
|
-
let b = /* @__PURE__ */ L(() => u("image_download_resolution")), T = /* @__PURE__ */ L(() => o(h) || o(w) || !o(_).length), H = /* @__PURE__ */ L(() => o(p) ?? "");
|
|
3323
|
-
Wt(ai, {
|
|
3324
|
-
id: "tri-id-resolution",
|
|
3325
|
-
class: "tri-id-field-select",
|
|
3326
|
-
"data-tri-id-resolution": !0,
|
|
3327
|
-
get "aria-label"() {
|
|
3328
|
-
return o(b);
|
|
3329
|
-
},
|
|
3330
|
-
get disabled() {
|
|
3331
|
-
return o(T);
|
|
3332
|
-
},
|
|
3333
|
-
get value() {
|
|
3334
|
-
return o(H);
|
|
3335
|
-
},
|
|
3336
|
-
onchange: ($) => {
|
|
3337
|
-
x(p, Ie($.currentTarget.value), !0);
|
|
3338
|
-
},
|
|
3339
|
-
children: ($, V) => {
|
|
3340
|
-
var ee = Oo(), F = yt(ee), ne = S(F);
|
|
3341
|
-
F.value = F.__value = "";
|
|
3342
|
-
var ot = Y(F, 2);
|
|
3343
|
-
Vt(ot, 17, () => o(_), lr, (N, G, ve) => {
|
|
3344
|
-
var q = Po(), ke = S(q);
|
|
3345
|
-
q.value = q.__value = ve, Z(() => K(ke, o(G).label)), W(N, q);
|
|
3346
|
-
}), Z((N) => K(ne, N), [() => u("image_download_resolution_placeholder")]), W($, ee);
|
|
3347
|
-
},
|
|
3348
|
-
$$slots: { default: !0 }
|
|
3349
|
-
});
|
|
3350
|
-
}
|
|
3351
|
-
var oi = Y(at, 2);
|
|
3352
|
-
{
|
|
3353
|
-
var li = (b) => {
|
|
3354
|
-
var T = $o(), H = S(T), $ = S(H);
|
|
3355
|
-
{
|
|
3356
|
-
var V = (N) => {
|
|
3357
|
-
var G = No(), ve = S(G), q = S(ve);
|
|
3358
|
-
Z(() => K(q, o(A))), W(N, G);
|
|
3359
|
-
};
|
|
3360
|
-
Me($, (N) => {
|
|
3361
|
-
o(A) && N(V);
|
|
3362
|
-
});
|
|
3363
|
-
}
|
|
3364
|
-
var ee = Y($, 2);
|
|
3365
|
-
{
|
|
3366
|
-
var F = (N) => {
|
|
3367
|
-
var G = Ro(), ve = S(G), q = S(ve);
|
|
3368
|
-
Z(() => K(q, o(g))), W(N, G);
|
|
3369
|
-
};
|
|
3370
|
-
Me(ee, (N) => {
|
|
3371
|
-
o(g) && N(F);
|
|
3372
|
-
});
|
|
3373
|
-
}
|
|
3374
|
-
var ne = Y(ee, 2);
|
|
3375
|
-
{
|
|
3376
|
-
var ot = (N) => {
|
|
3377
|
-
var G = zo(), ve = S(G), q = S(ve);
|
|
3378
|
-
Z(() => K(q, o(Fe))), W(N, G);
|
|
3379
|
-
};
|
|
3380
|
-
Me(ne, (N) => {
|
|
3381
|
-
o(Fe) && N(ot);
|
|
3382
|
-
});
|
|
3383
|
-
}
|
|
3384
|
-
W(b, T);
|
|
3385
|
-
};
|
|
3386
|
-
Me(oi, (b) => {
|
|
3387
|
-
(o(A) || o(g) || o(Fe)) && b(li);
|
|
3388
|
-
});
|
|
3389
|
-
}
|
|
3390
|
-
var si = Y(gt, 2), ui = S(si);
|
|
3391
|
-
{
|
|
3392
|
-
let b = /* @__PURE__ */ L(() => !o(zt));
|
|
3393
|
-
fo(ui, {
|
|
3394
|
-
variant: "primary",
|
|
3395
|
-
class: "tri-id-download",
|
|
3396
|
-
"data-tri-id-download": !0,
|
|
3397
|
-
style: "width:100%",
|
|
3398
|
-
get disabled() {
|
|
3399
|
-
return o(b);
|
|
3400
|
-
},
|
|
3401
|
-
onclick: $t,
|
|
3402
|
-
children: (T, H) => {
|
|
3403
|
-
var $ = Fo(), V = yt($);
|
|
3404
|
-
Ya(V, (F) => oe?.(F));
|
|
3405
|
-
var ee = Y(V);
|
|
3406
|
-
Z((F) => K(ee, ` ${F ?? ""}`), [
|
|
3407
|
-
() => o(h) ? u("image_download_downloading") : u("image_download_download")
|
|
3408
|
-
]), W(T, $);
|
|
3409
|
-
},
|
|
3410
|
-
$$slots: { default: !0 }
|
|
3411
|
-
});
|
|
3412
|
-
}
|
|
3413
|
-
qt(it, (b) => x(y, b), () => o(y)), Z(
|
|
3414
|
-
(b, T) => {
|
|
3415
|
-
K(nr, b), K(ii, T);
|
|
3416
|
-
},
|
|
3417
|
-
[
|
|
3418
|
-
() => u("image_download_description"),
|
|
3419
|
-
() => u("image_download_resolution")
|
|
3420
|
-
]
|
|
3421
|
-
), W(e, it), Ir();
|
|
3422
|
-
}
|
|
3423
|
-
const { STYLES: Ho, STYLE_ID: Vo } = di(
|
|
3424
|
-
`
|
|
3425
|
-
.tri-id {
|
|
3426
|
-
display: flex;
|
|
3427
|
-
flex-direction: column;
|
|
3428
|
-
min-height: 0;
|
|
3429
|
-
width: 100%;
|
|
3430
|
-
color: var(--panel-fg, var(--tri-panel-content, currentColor));
|
|
3431
|
-
}
|
|
3432
|
-
|
|
3433
|
-
.tri-id-body {
|
|
3434
|
-
width: 100%;
|
|
3435
|
-
padding: 1rem;
|
|
3436
|
-
display: flex;
|
|
3437
|
-
flex-direction: column;
|
|
3438
|
-
gap: 1rem;
|
|
3439
|
-
}
|
|
3440
|
-
|
|
3441
|
-
.tri-id-desc {
|
|
3442
|
-
font-size: 0.875rem;
|
|
3443
|
-
line-height: 1.25rem;
|
|
3444
|
-
margin: 0;
|
|
3445
|
-
color: color-mix(in oklab, var(--panel-fg, currentColor) 70%, transparent);
|
|
3446
|
-
}
|
|
3447
|
-
|
|
3448
|
-
.tri-id-fields {
|
|
3449
|
-
display: grid;
|
|
3450
|
-
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
3451
|
-
gap: 0.75rem;
|
|
3452
|
-
}
|
|
3453
|
-
|
|
3454
|
-
.tri-id-field {
|
|
3455
|
-
width: 100%;
|
|
3456
|
-
}
|
|
3457
|
-
|
|
3458
|
-
.tri-id-label {
|
|
3459
|
-
display: inline-flex;
|
|
3460
|
-
align-items: center;
|
|
3461
|
-
gap: 0.375rem;
|
|
3462
|
-
margin-bottom: 0.25rem;
|
|
3463
|
-
white-space: nowrap;
|
|
3464
|
-
font-size: 0.75rem;
|
|
3465
|
-
color: color-mix(in oklab, currentColor 60%, transparent);
|
|
3466
|
-
}
|
|
3467
|
-
|
|
3468
|
-
/* The themed Select renders its wrapper with this class; stretch it to fill. */
|
|
3469
|
-
.tri-id-field-select {
|
|
3470
|
-
width: 100%;
|
|
3471
|
-
}
|
|
3472
|
-
|
|
3473
|
-
.tri-id-card {
|
|
3474
|
-
display: flex;
|
|
3475
|
-
flex-direction: column;
|
|
3476
|
-
position: relative;
|
|
3477
|
-
border-radius: var(--tri-radius-panels, 0.75rem);
|
|
3478
|
-
border: 1px solid var(--tri-surface-border, rgb(0 0 0 / 0.15));
|
|
3479
|
-
background-color: var(--tri-input-bg, #fff);
|
|
3480
|
-
}
|
|
3481
|
-
|
|
3482
|
-
.tri-id-card-body {
|
|
3483
|
-
display: flex;
|
|
3484
|
-
flex-direction: column;
|
|
3485
|
-
flex: auto;
|
|
3486
|
-
gap: 0.5rem;
|
|
3487
|
-
padding: 1rem;
|
|
3488
|
-
font-size: 0.875rem;
|
|
3489
|
-
}
|
|
3490
|
-
|
|
3491
|
-
/*
|
|
3492
|
-
* Soft alert: tinted background/border derived from --alert-color, no shadow.
|
|
3493
|
-
* The color variant sets --alert-color (drives bg/border) and overrides the
|
|
3494
|
-
* text color to the variant's *-content token.
|
|
3495
|
-
*/
|
|
3496
|
-
.tri-id-alert {
|
|
3497
|
-
--alert-color: var(--panel-fg, currentColor);
|
|
3498
|
-
display: grid;
|
|
3499
|
-
grid-auto-flow: column;
|
|
3500
|
-
grid-template-columns: auto;
|
|
3501
|
-
justify-content: start;
|
|
3502
|
-
place-items: center start;
|
|
3503
|
-
gap: 1rem;
|
|
3504
|
-
text-align: start;
|
|
3505
|
-
padding-block: 0.5rem;
|
|
3506
|
-
padding-inline: 1rem;
|
|
3507
|
-
font-size: 0.875rem;
|
|
3508
|
-
line-height: 1.25rem;
|
|
3509
|
-
border: 1px solid
|
|
3510
|
-
color-mix(in oklab, var(--alert-color) 10%, var(--tri-input-bg, #fff));
|
|
3511
|
-
border-radius: var(--tri-radius-panels, 0.75rem);
|
|
3512
|
-
color: var(--panel-fg, currentColor);
|
|
3513
|
-
background: color-mix(
|
|
3514
|
-
in oklab,
|
|
3515
|
-
var(--alert-color) 8%,
|
|
3516
|
-
var(--tri-input-bg, #fff)
|
|
3517
|
-
);
|
|
3518
|
-
box-shadow: none;
|
|
3519
|
-
}
|
|
3520
|
-
.tri-id-alert.is-success {
|
|
3521
|
-
--alert-color: var(--tri-color-success, #16a34a);
|
|
3522
|
-
color: var(--tri-color-success-content, currentColor);
|
|
3523
|
-
}
|
|
3524
|
-
.tri-id-alert.is-error {
|
|
3525
|
-
--alert-color: var(--tri-color-error, #dc2626);
|
|
3526
|
-
color: var(--tri-color-error-content, currentColor);
|
|
3527
|
-
}
|
|
3528
|
-
|
|
3529
|
-
.tri-id-footer {
|
|
3530
|
-
width: 100%;
|
|
3531
|
-
padding: 1rem;
|
|
3532
|
-
border-top: 1px solid var(--tri-surface-border, rgb(0 0 0 / 0.15));
|
|
3533
|
-
}
|
|
3534
|
-
|
|
3535
|
-
/* The themed Button renders with this class; size its download glyph. */
|
|
3536
|
-
.tri-id-download svg {
|
|
3537
|
-
width: 1.125rem;
|
|
3538
|
-
height: 1.125rem;
|
|
3539
|
-
fill: currentColor;
|
|
3540
|
-
}
|
|
3541
|
-
`,
|
|
3542
|
-
"panel"
|
|
3543
|
-
), qo = {
|
|
3544
|
-
mount(e, t) {
|
|
3545
|
-
const r = t.styles.install(Ho, Vo), n = t.styles.install(io, "bundled"), i = Wa(Wo, {
|
|
3546
|
-
target: e,
|
|
3547
|
-
context: /* @__PURE__ */ new Map([
|
|
3548
|
-
[Jn, { context: t }]
|
|
3549
|
-
])
|
|
3550
|
-
});
|
|
3551
|
-
return () => {
|
|
3552
|
-
Va(i), n(), r();
|
|
3553
|
-
};
|
|
3554
|
-
}
|
|
3555
|
-
}, Ko = vi({
|
|
3556
|
-
name: "@triiiceratops/plugin-image-export",
|
|
3557
|
-
title: "image_download_title",
|
|
3558
|
-
uiId: "image-download",
|
|
3559
|
-
version: "1.0.0-rc.0",
|
|
3560
|
-
coreRange: ">=1.0.0-rc.0",
|
|
3561
|
-
pluginApiRange: "^1.0.0",
|
|
3562
|
-
requiredCapabilities: ["osd@5"],
|
|
3563
|
-
icon: Qn,
|
|
3564
|
-
target: "panel",
|
|
3565
|
-
catalog: ao,
|
|
3566
|
-
view: qo
|
|
3567
|
-
});
|
|
3568
|
-
export {
|
|
3569
|
-
Ko as ImageDownloadPlugin,
|
|
3570
|
-
go as buildImageDownloadFilename,
|
|
3571
|
-
yo as exportCompositeCanvas,
|
|
3572
|
-
So as exportCurrentWorld,
|
|
3573
|
-
bo as exportSingleImage,
|
|
3574
|
-
Gr as getCanvasImageChoices,
|
|
3575
|
-
ei as getVisibleCanvasesForDownload,
|
|
3576
|
-
wo as resolveCompositeCanvasSizeOptions,
|
|
3577
|
-
mo as resolveSingleImageSizeOptions,
|
|
3578
|
-
xo as resolveWorldSizeOptions
|
|
3579
|
-
};
|
|
1
|
+
import{svgIcon as e,createCommandErrorReporter as t,definePluginStyles as n,definePlugin as r}from"@triiiceratops/plugin-sdk";import{sanitizeFilenamePart as i,resolveAllCanvasImages as l,clampCompositeSize as o,composeImages as a,fetchExportImageBlob as s,getVisibleCanvasEntries as u,isUnsupportedCanvasFor as d,buildRelativeSizeOptions as c,resolveExportSizeOptions as f,getCompositeImagePlacement as v,getCanvasId as h,getCanvasDisplayLayouts as p,getCanvasLabel as g,downloadBlob as m,resolveLanguageValue as w,isCrossOriginImageFailure as _}from"triiiceratops/image-export";import{isCrossOriginImageFailure as b}from"triiiceratops/image-export";var y=Array.isArray,x=Array.prototype.indexOf,k=Array.prototype.includes,S=Array.from,C=Object.defineProperty,E=Object.getOwnPropertyDescriptor,A=Object.getOwnPropertyDescriptors,$=Object.prototype,z=Array.prototype,I=Object.getPrototypeOf,T=Object.isExtensible;const M=()=>{};function O(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}const D=1<<24,L=16,P=32,j=512,N=1024,W=2048,B=4096,R=8192,H=16384,V=32768,q=1<<25,F=65536,U=1<<17,K=1<<19,Z=1<<25,Y=65536,J=1<<21,G=1<<22,Q=1<<23,X=Symbol("$state"),ee=Symbol("legacy props"),te=Symbol(""),ne=Symbol("attributes"),re=Symbol("class"),ie=Symbol("style"),le=Symbol("text"),oe=Symbol("form reset"),ae=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},se=!!globalThis.document?.contentType&&/* @__PURE__ */globalThis.document.contentType.includes("xml"),ue="[!",de={},ce=Symbol("uninitialized");function fe(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let ve,he=!1;function pe(e){he=e}function ge(e){if(null===e)throw fe(),de;return ve=e}function me(){return ge(/* @__PURE__ */Nt(ve))}function we(e){if(he){if(/* @__PURE__ */null!==Nt(ve))throw fe(),de;ve=e}}function _e(e=!0){for(var t=0,n=ve;;){if(8===n.nodeType){var r=n.data;if("]"===r){if(0===t)return n;t-=1}else("["===r||r===ue||"["===r[0]&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=
|
|
2
|
+
/* @__PURE__ */Nt(n);e&&n.remove(),n=i}}function be(e){if(!e||8!==e.nodeType)throw fe(),de;return e.data}function ye(e){return e===this.v}function xe(e){return!function(e,t){return e!=e?t==t:e!==t||null!==e&&"object"==typeof e||"function"==typeof e}(e,this.v)}let ke=null;function Se(e){ke=e}function Ce(e,t=!1,n){ke={p:ke,i:!1,c:null,e:null,s:e,x:null,r:mn,l:null}}function Ee(e){var t=ke,n=t.e;if(null!==n)for(var r of(t.e=null,n))Zt(r);return t.i=!0,ke=t.p,{}}let Ae=[];function $e(e){if(0===Ae.length){var t=Ae;queueMicrotask(()=>{t===Ae&&function(){var e=Ae;Ae=[],function(e){for(var t=0;t<e.length;t++)e[t]()}(e)}()})}Ae.push(e)}function ze(e){var t=mn;if(null===t)return hn.f|=Q,e;if(0===(t.f&V)&&!(4&t.f))throw e;Ie(e,t)}function Ie(e,t){if(null===t||0===(t.f&H)){for(;null!==t;){if(128&t.f){if(0===(t.f&V))throw e;try{return void t.b.error(e)}catch(t){e=t}}t=t.parent}throw e}}const Te=-7169;function Me(e,t){e.f=e.f&Te|t}function Oe(e){0!==(e.f&j)||null===e.deps?Me(e,N):Me(e,B)}function De(e){if(null!==e)for(const t of e)!(2&t.f)||0===(t.f&Y)||(t.f^=Y,De(t.deps))}function Le(e,t,n){0!==(e.f&W)?t.add(e):0!==(e.f&B)&&n.add(e),De(e.deps),Me(e,N)}let Pe=!1;function je(e,t){if(t){const t=document.body;e.autofocus=!0,$e(()=>{document.activeElement===t&&e.focus()})}}let Ne=!1;function We(){Ne||(Ne=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t[oe]?.()})},{capture:!0}))}function Be(e){var t=hn,n=mn;gn(null),wn(null);try{return e()}finally{gn(t),wn(n)}}class Re{parent;is_pending=!1;transform_error;#e;#t=he?ve:null;#n;#r;#i;#l=null;#o=null;#a=null;#s=null;#u=0;#d=0;#c=!1;#f=/* @__PURE__ */new Set;#v=/* @__PURE__ */new Set;#h=null;#p=function(e){let t,n=0,r=yt(0);return()=>{Ft()&&(Ln(r),Jt(()=>(0===n&&(t=Nn(()=>e())),n+=1,()=>{$e(()=>{n-=1,0===n&&(t?.(),t=void 0,At(r))})})))}}(()=>(this.#h=yt(this.#u),()=>{this.#h=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=mn;t.b=this,t.f|=128,n(e)},this.parent=mn.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=Qt(()=>{if(he){const e=this.#t;me();const t=e.data===ue;if(e.data.startsWith("[?")){const t=JSON.parse(e.data.slice(2));this.#g(t)}else t?this.#m():this.#w()}else this.#_()},589824),he&&(this.#e=ve)}#w(){try{this.#l=en(()=>this.#r(this.#e))}catch(e){this.error(e)}}#g(e){const t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#b(e);$e(r),t&&(this.#a=en(()=>{t(this.#e,()=>e,()=>n)}))}#b(e){var t=!1,n=!1;const r=()=>{t?console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"):(t=!0,n&&function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}(),null!==this.#a&&on(this.#a,()=>{this.#a=null}),this.#y(()=>{this.#_()}))};return{reset:r,invoke_onerror:()=>{try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){Ie(e,this.#i&&this.#i.parent)}}}}#m(){const e=this.#n.pending;e&&(this.is_pending=!0,this.#o=en(()=>e(this.#e)),$e(()=>{var e=this.#s=document.createDocumentFragment(),t=Pt();e.append(t),this.#l=this.#y(()=>en(()=>this.#r(t))),0===this.#d&&(this.#e.before(e),this.#s=null,on(this.#o,()=>{this.#o=null}),this.#x(tt))}))}#_(){try{if(this.is_pending=this.has_pending_snippet(),this.#d=0,this.#u=0,this.#l=en(()=>{this.#r(this.#e)}),this.#d>0){var e=this.#s=document.createDocumentFragment();dn(this.#l,e);const t=this.#n.pending;this.#o=en(()=>t(this.#e))}else this.#x(tt)}catch(e){this.error(e)}}#x(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#v)}defer_effect(e){Le(e,this.#f,this.#v)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#y(e){var t=mn,n=hn,r=ke;wn(this.#i),gn(this.#i),Se(this.#i.ctx);try{return dt.ensure(),e()}catch(e){return ze(e),null}finally{wn(t),gn(n),Se(r)}}#k(e,t){this.has_pending_snippet()?(this.#d+=e,0===this.#d&&(this.#x(t),this.#o&&on(this.#o,()=>{this.#o=null}),this.#s&&(this.#e.before(this.#s),this.#s=null))):this.parent&&this.parent.#k(e,t)}update_pending_count(e,t){this.#k(e,t),this.#u+=e,this.#h&&!this.#c&&(this.#c=!0,$e(()=>{this.#c=!1,this.#h&&Ct(this.#h,this.#u)}))}get_effect_pending(){return this.#p(),Ln(this.#h)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;tt?.is_fork?(this.#l&&tt.skip_effect(this.#l),this.#o&&tt.skip_effect(this.#o),this.#a&&tt.skip_effect(this.#a),tt.oncommit(()=>{this.#S(e)})):this.#S(e)}#S(e){this.#l&&(rn(this.#l),this.#l=null),this.#o&&(rn(this.#o),this.#o=null),this.#a&&(rn(this.#a),this.#a=null),he&&(ge(this.#t),function(e=1){if(he){for(var t=e,n=ve;t--;)n=
|
|
3
|
+
/* @__PURE__ */Nt(n);ve=n}}(),ge(_e()));let t=this.#n.failed;const n=e=>{const{reset:n,invoke_onerror:r}=this.#b(e);r(),t&&(this.#a=this.#y(()=>{try{return en(()=>{var r=mn;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return Ie(e,this.#i.parent),null}}))};$e(()=>{var t;try{t=this.transform_error(e)}catch(e){return void Ie(e,this.#i&&this.#i.parent)}null!==t&&"object"==typeof t&&"function"==typeof t.then?t.then(n,e=>Ie(e,this.#i&&this.#i.parent)):n(t)})}}function He(e,t,n,r){const i=Fe;var l=e.filter(e=>!e.settled),o=t.map(i);if(0!==n.length||0!==l.length){var a=mn,s=function(){var e=mn,t=hn,n=ke,r=tt;return function(i=!0){wn(e),gn(t),Se(n),i&&0===(e.f&H)&&(r?.activate(),r?.apply())}}(),u=1===l.length?l[0].promise:l.length>1?Promise.all(l.map(e=>e.promise)):null,d=qe();0!==n.length?u?u.then(()=>{s(),f(),Ve()}):f():u.then(()=>c([])).finally(d)}else r(o);function c(e){if(0===(a.f&H)){s();try{r([...o,...e])}catch(e){Ie(e,a)}Ve()}}function f(){Promise.all(n.map(e=>/* @__PURE__ */Ke(e))).then(c).catch(e=>Ie(e,a)).finally(d)}}function Ve(e=!0){wn(null),gn(null),Se(null),e&&tt?.deactivate()}function qe(){var e=mn,t=e.b,n=tt,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function Fe(e){return null!==mn&&(mn.f|=K),{ctx:ke,deps:null,effects:null,equals:ye,f:2050,fn:e,reactions:null,rv:0,v:ce,wv:0,parent:mn,ac:null}}const Ue=Symbol("obsolete");function Ke(e,t,n){let r=mn;null===r&&function(){throw new Error("https://svelte.dev/e/async_derived_orphan")}();var i=void 0,l=yt(ce),o=!hn,a=/* @__PURE__ */new Set;return function(e){qt(G|K,e)}(()=>{var t=mn,n=O();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==ae&&n.reject(e)}).finally(Ve)}catch(e){n.reject(e),Ve()}var s=tt;if(o){if(0!==(t.f&V))var u=qe();if(r.b?.is_rendered())s.async_deriveds.get(t)?.reject(Ue);else for(const e of a.values())e.reject(Ue);a.add(n),s.async_deriveds.set(t,n)}const d=(e,t=void 0)=>{u?.(),a.delete(n),t!==Ue&&(s.activate(),t?(l.f|=Q,Ct(l,t)):(0!==(l.f&Q)&&(l.f^=Q),Ct(l,e)),s.deactivate())};n.promise.then(d,e=>d(null,e||"unknown"))}),Ut(()=>{for(const e of a)e.reject(Ue)}),new Promise(e=>{!function t(n){function r(){n===i?e(l):t(i)}n.then(r,r)}(i)})}function Ze(e){const t=/* @__PURE__ */Fe(e);return bn(t),t}function Ye(e){const t=/* @__PURE__ */Fe(e);return t.equals=xe,t}function Je(e){var t,n=mn,r=e.parent;if(!fn&&null!==r&&e.v!==ce&&24576&r.f)return console.warn("https://svelte.dev/e/derived_inert"),e.v;wn(r);try{e.f&=~Y,function(e){var t=e.effects;if(null!==t){e.effects=null;for(var n=0;n<t.length;n+=1)rn(t[n])}}(e),t=Tn(e)}finally{wn(n)}return t}function Ge(e){var t=Je(e);e.equals(t)||(e.wv=$n(),tt?.is_fork&&null!==e.deps||(null!==tt?(tt.capture(e,t,!0),nt?.capture(e,t,!0)):e.v=t,null!==e.deps))?fn||(null!==rt?(Ft()||tt?.is_fork)&&rt.set(e,t):Oe(e)):Me(e,N)}function Qe(e){if(null!==e.effects)for(const t of e.effects)t.teardown&&null!==t.fn&&Dn(t)}let Xe=null,et=null,tt=null,nt=null,rt=null,it=null,lt=!1,ot=null,at=null;var st=0;let ut=1;class dt{id=ut++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=/* @__PURE__ */new Map;current=/* @__PURE__ */new Map;previous=/* @__PURE__ */new Map;#r=/* @__PURE__ */new Set;#i=/* @__PURE__ */new Set;#l=0;#o=/* @__PURE__ */new Map;#a=null;#s=[];#u=[];#d=/* @__PURE__ */new Set;#c=/* @__PURE__ */new Set;#f=/* @__PURE__ */new Map;#v=/* @__PURE__ */new Set;is_fork=!1;#h=!1;constructor(){null===et?Xe=et=this:(et.#n=this,this.#t=et),et=this}#p(){if(this.is_fork)return!0;for(const n of this.#o.keys()){for(var e=n,t=!1;null!==e.parent;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#v.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){for(var r of(this.#f.delete(e),n.d))Me(r,W),t(r);for(r of n.m)Me(r,B),t(r)}this.#v.add(e)}#w(){this.#e=!0,st++>1e3&&(this.#y(),function(){try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(e){Ie(e,it)}}());for(const e of this.#d)this.#c.delete(e),Me(e,W),this.schedule(e);for(const e of this.#c)Me(e,B),this.schedule(e);const e=this.#s;this.#s=[],this.apply();var t=ot=[],n=[],r=at=[];for(const r of e)try{this.#g(r,t,n)}catch(e){throw mt(r),this.#p()||this.discard(),e}if(tt=null,r.length>0){var i=dt.ensure();for(const e of r)i.schedule(e)}if(ot=null,at=null,this.#p()){this.#_(n),this.#_(t);for(const[e,t]of this.#f)gt(e,t);return void(r.length>0&&tt.#w())}const l=this.#b();if(l)return this.#_(n),this.#_(t),void l.#m(this);this.#d.clear(),this.#c.clear();for(const e of this.#r)e(this);this.#r.clear(),nt=this,ft(n),ft(t),nt=null,this.#a?.resolve();var o=tt;if(0===this.#l&&(0===this.#s.length||null!==o)&&this.#y(),this.#s.length>0)if(null!==o){const e=o;e.#s.push(...this.#s.filter(t=>!e.#s.includes(t)))}else o=this;null!==o&&(_t.clear(),o.#w())}#g(e,t,n){e.f^=N;for(var r=e.first;null!==r;){var i=r.f,l=!!(96&i);if(!(l&&0!==(i&N)||0!==(i&R)||this.#f.has(r))&&null!==r.fn){l?r.f^=N:4&i?t.push(r):zn(r)&&(0!==(i&L)&&this.#c.add(r),Dn(r));var o=r.first;if(null!==o){r=o;continue}}for(;null!==r;){var a=r.next;if(null!==a){r=a;break}r=r.parent}}}#b(){for(var e=this.#t;null!==e;){if(!e.is_fork)for(const[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e;e=e.#t}return null}#m(e){for(const[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(const[t,n]of e.async_deriveds){const e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#d,e.#c);const t=e=>{var n=e.reactions;if(null!==n&&(!(2&e.f)||6144&e.f))for(const e of n){var r=e.f;if(2&r)t(e);else{var i=e;r&(G|L)&&!this.async_deriveds.has(i)&&(this.#c.delete(i),Me(i,W),this.schedule(i))}}};for(const e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#y(),tt=this,this.#w()}#_(e){for(var t=0;t<e.length;t+=1)Le(e[t],this.#d,this.#c)}capture(e,t,n=!1){e.v!==ce&&!this.previous.has(e)&&this.previous.set(e,e.v),0===(e.f&Q)&&(this.current.set(e,[t,n]),rt?.set(e,t)),this.is_fork||(e.v=t)}activate(){tt=this}deactivate(){tt=null,rt=null}flush(){try{lt=!0,tt=this,this.#w()}finally{st=0,it=null,ot=null,at=null,lt=!1,tt=null,rt=null,_t.clear()}}discard(){for(const e of this.#i)e(this);this.#i.clear();for(const e of this.async_deriveds.values())e.reject(Ue);this.#y(),this.#a?.resolve()}register_created_effect(e){this.#u.push(e)}#x(){for(let d=Xe;null!==d;d=d.#n){var e=d.id<this.id,t=[];for(const[r,[i,l]]of this.current){if(d.current.has(r)){var n=d.current.get(r)[0];if(!e||i===n)continue;d.current.set(r,[i,l])}t.push(r)}if(e)for(const[e,t]of this.async_deriveds){const n=d.async_deriveds.get(e);n&&t.promise.then(n.resolve).catch(n.reject)}var r=[...d.current.keys()].filter(e=>!d.current.get(e)[1]);if(d.#e&&0!==r.length){var i=r.filter(e=>!this.current.has(e));if(0===i.length)e&&d.discard();else if(t.length>0){if(e)for(const e of this.#v)d.unskip_effect(e,e=>{0!==(e.f&(L|G))?d.schedule(e):d.#_([e])});d.activate();var l=/* @__PURE__ */new Set,o=/* @__PURE__ */new Map;for(var a of t)vt(a,i,l,o);o=/* @__PURE__ */new Map;var s=[...d.current].filter(([e,t])=>{const n=this.current.get(e);return!n||n[0]!==t[0]||n[1]!==t[1]}).map(([e])=>e);if(s.length>0)for(const e of this.#u)!(155648&e.f)&&ht(e,s,o)&&(0!==(e.f&(G|L))?(Me(e,W),d.schedule(e)):d.#d.add(e));if(d.#s.length>0&&!d.#h){for(var u of(d.apply(),d.#s))d.#g(u,[],[]);d.#s=[]}d.deactivate()}}}}increment(e,t){if(this.#l+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(this.#l-=1,e){let e=this.#o.get(t)??0;1===e?this.#o.delete(t):this.#o.set(t,e-1)}this.#h||(this.#h=!0,$e(()=>{this.#h=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(const t of e)this.#d.add(t);for(const e of t)this.#c.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#a??=O()).promise}static ensure(){if(null===tt){const e=tt=new dt;lt||$e(()=>{e.#e||e.flush()})}return tt}apply(){rt=null}schedule(e){if(it=e,e.b?.is_pending&&e.f&(12|D)&&0===(e.f&V))e.b.defer_effect(e);else{for(var t=e;null!==t.parent;){var n=(t=t.parent).f;if(!(null===ot||t!==mn||null!==hn&&2&hn.f))return;if(96&n){if(0===(n&N))return;t.f^=N}}this.#s.push(t)}}#y(){if(this.linked){var e=this.#t,t=this.#n;null===e?Xe=t:e.#n=t,null===t?et=e:t.#t=e,this.linked=!1}}}let ct=null;function ft(e){var t=e.length;if(0!==t){for(var n=0;n<t;){var r=e[n++];if(!(24576&r.f)&&zn(r)&&(ct=/* @__PURE__ */new Set,Dn(r),null===r.deps&&null===r.first&&null===r.nodes&&null===r.teardown&&null===r.ac&&ln(r),ct?.size>0)){_t.clear();for(const e of ct){if(24576&e.f)continue;const t=[e];let n=e.parent;for(;null!==n;)ct.has(n)&&(ct.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){const n=t[e];!(24576&n.f)&&Dn(n)}}ct.clear()}}ct=null}}function vt(e,t,n,r){if(!n.has(e)&&(n.add(e),null!==e.reactions))for(const i of e.reactions){const e=i.f;2&e?vt(i,t,n,r):0!==(e&(G|L))&&0===(e&W)&&ht(i,t,r)&&(Me(i,W),pt(i))}}function ht(e,t,n){const r=n.get(e);if(void 0!==r)return r;if(null!==e.deps)for(const r of e.deps){if(k.call(t,r))return!0;if(2&r.f&&ht(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function pt(e){tt.schedule(e)}function gt(e,t){if(0===(e.f&P)||0===(e.f&N)){0!==(e.f&W)?t.d.push(e):0!==(e.f&B)&&t.m.push(e),Me(e,N);for(var n=e.first;null!==n;)gt(n,t),n=n.next}}function mt(e){Me(e,N);for(var t=e.first;null!==t;)mt(t),t=t.next}let wt=/* @__PURE__ */new Set;const _t=/* @__PURE__ */new Map;let bt=!1;function yt(e,t){return{f:0,v:e,reactions:null,equals:ye,rv:0,wv:0}}function xt(e,t){const n=yt(e);return bn(n),n}function kt(e,t=!1,n=!0){const r=yt(e);return t||(r.equals=xe),r}function St(e,t,n=!1){return null!==hn&&(!pn||0!==(hn.f&U))&&4325394&hn.f&&(null===_n||!_n.has(e))&&function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}(),Ct(e,n?zt(t):t,at)}function Ct(e,t,n=null){if(!e.equals(t)){fn?_t.set(e,t):_t.has(e)||_t.set(e,e.v);var r=dt.ensure();if(r.capture(e,t),2&e.f){const t=e;0!==(e.f&W)&&Je(t),null===rt&&Oe(t)}e.wv=$n(),$t(e,W,n),null!==mn&&0!==(mn.f&N)&&!(96&mn.f)&&(null===kn?function(e){kn=e}([e]):kn.push(e)),!r.is_fork&&wt.size>0&&!bt&&function(){bt=!1;for(const e of wt){let t;0!==(e.f&N)&&Me(e,B);try{t=zn(e)}catch{t=!0}t&&Dn(e)}wt.clear()}()}return t}function Et(e,t=1){var n=Ln(e),r=1===t?n++:n--;return St(e,n),r}function At(e){St(e,e.v+1)}function $t(e,t,n){var r=e.reactions;if(null!==r)for(var i=r.length,l=0;l<i;l++){var o=r[l],a=o.f,s=0===(a&W);if(s&&Me(o,t),0!==(a&U))wt.add(o);else if(2&a){var u=o;rt?.delete(u),0===(a&Y)&&(a&j&&(null===mn||0===(mn.f&J))&&(o.f|=Y),$t(u,B,n))}else if(s){var d=o;0!==(a&L)&&null!==ct&&ct.add(d),null!==n?n.push(d):pt(d)}}}function zt(e){if("object"!=typeof e||null===e||X in e)return e;const t=I(e);if(t!==$&&t!==z)return e;var n=/* @__PURE__ */new Map,r=y(e),i=/* @__PURE__ */xt(0),l=En,o=e=>{if(En===l)return e();var t=hn,n=En;gn(null),An(l);var r=e();return gn(t),An(n),r};return r&&n.set("length",/* @__PURE__ */xt(e.length)),new Proxy(e,{defineProperty(e,t,r){(!("value"in r)||!1===r.configurable||!1===r.enumerable||!1===r.writable)&&function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var i=n.get(t);return void 0===i?o(()=>{var e=/* @__PURE__ */xt(r.value);return n.set(t,e),e}):St(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(void 0===r){if(t in e){const e=o(()=>/* @__PURE__ */xt(ce));n.set(t,e),At(i)}}else St(r,ce),At(i);return!0},get(t,r,i){if(r===X)return e;var l=n.get(r),a=r in t;if(void 0===l&&(!a||E(t,r)?.writable)&&(l=o(()=>/* @__PURE__ */xt(zt(a?t[r]:ce))),n.set(r,l)),void 0!==l){var s=Ln(l);return s===ce?void 0:s}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&"value"in r){var i=n.get(t);i&&(r.value=Ln(i))}else if(void 0===r){var l=n.get(t),o=l?.v;if(void 0!==l&&o!==ce)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){if(t===X)return!0;var r=n.get(t),i=void 0!==r&&r.v!==ce||Reflect.has(e,t);return!((void 0!==r||null!==mn&&(!i||E(e,t)?.writable))&&(void 0===r&&(r=o(()=>/* @__PURE__ */xt(i?zt(e[t]):ce)),n.set(t,r)),Ln(r)===ce))&&i},set(e,t,l,a){var s=n.get(t),u=t in e;if(r&&"length"===t)for(var d=l;d<s.v;d+=1){var c=n.get(d+"");void 0!==c?St(c,ce):d in e&&(c=o(()=>/* @__PURE__ */xt(ce)),n.set(d+"",c))}void 0===s?(!u||E(e,t)?.writable)&&(St(s=o(()=>/* @__PURE__ */xt(void 0)),zt(l)),n.set(t,s)):(u=s.v!==ce,St(s,o(()=>zt(l))));var f=Reflect.getOwnPropertyDescriptor(e,t);if(f?.set&&f.set.call(a,l),!u){if(r&&"string"==typeof t){var v=n.get("length"),h=Number(t);Number.isInteger(h)&&h>=v.v&&St(v,h+1)}At(i)}return!0},ownKeys(e){Ln(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return void 0===t||t.v!==ce});for(var[r,l]of n)l.v!==ce&&!(r in e)&&t.push(r);return t},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}function It(e){try{if(null!==e&&"object"==typeof e&&X in e)return e[X]}catch{}return e}function Tt(e,t){return Object.is(It(e),It(t))}var Mt,Ot,Dt,Lt;function Pt(e=""){return document.createTextNode(e)}function jt(e){return Dt.call(e)}function Nt(e){return Lt.call(e)}function Wt(e,t){if(!he)/* @__PURE__ */
|
|
4
|
+
return jt(e);var n=/* @__PURE__ */jt(ve);if(null===n)n=ve.appendChild(Pt());else if(t&&3!==n.nodeType){var r=Pt();return n?.before(r),ge(r),r}return t&&Vt(n),ge(n),n}function Bt(e,t=!1){if(!he){var n=/* @__PURE__ */jt(e);return n instanceof Comment&&""===n.data?/* @__PURE__ */Nt(n):n}if(t){if(3!==ve?.nodeType){var r=Pt();return ve?.before(r),ge(r),r}Vt(ve)}return ve}function Rt(e,t=1,n=!1){let r=he?ve:e;for(var i;t--;)i=r,r=
|
|
5
|
+
/* @__PURE__ */Nt(r);if(!he)return r;if(n){if(3!==r?.nodeType){var l=Pt();return null===r?i?.after(l):r.before(l),ge(l),l}Vt(r)}return ge(r),r}function Ht(e,t,n){return n?document.createElement(e,{is:n}):document.createElement(e)}function Vt(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;null!==t&&3===t.nodeType;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function qt(e,t){var n=mn;null!==n&&0!==(n.f&R)&&(e|=R);var r={ctx:ke,deps:null,nodes:null,f:e|W|j,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};tt?.register_created_effect(r);var i=r;if(4&e)null!==ot?ot.push(r):dt.ensure().schedule(r);else if(null!==t){try{Dn(r)}catch(e){throw rn(r),e}null===i.deps&&null===i.teardown&&null===i.nodes&&i.first===i.last&&0===(i.f&K)&&(i=i.first,0!==(e&L)&&0!==(e&F)&&null!==i&&(i.f|=F))}if(null!==i&&(i.parent=n,null!==n&&function(e,t){var n=t.last;null===n?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}(i,n),null!==hn&&2&hn.f&&!(64&e))){var l=hn;(l.effects??=[]).push(i)}return r}function Ft(){return null!==hn&&!pn}function Ut(e){const t=qt(8,null);return Me(t,N),t.teardown=e,t}function Kt(e){null===mn&&(null===hn&&function(){throw new Error("https://svelte.dev/e/effect_orphan")}(),function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}()),fn&&function(){throw new Error("https://svelte.dev/e/effect_in_teardown")}();var t=mn.f;if(hn||0===(t&P)||null===ke||ke.i)return Zt(e);var n=ke;(n.e??=[]).push(e)}function Zt(e){return qt(1048580,e)}function Yt(e){return qt(4,e)}function Jt(e,t=0){return qt(8|t,e)}function Gt(e,t=[],n=[],r=[]){He(r,t,n,t=>{qt(8,()=>{e(...t.map(Ln))})})}function Qt(e,t=0){return qt(L|t,e)}function Xt(e,t=0){return qt(D|t,e)}function en(e){return qt(P|K,e)}function tn(e){var t=e.teardown;if(null!==t){const e=fn,n=hn;vn(!0),gn(null);try{t.call(null)}finally{vn(e),gn(n)}}}function nn(e,t=!1){var n=e.first;for(e.first=e.last=null;null!==n;){const e=n.ac;null!==e&&Be(()=>{e.abort(ae)});var r=n.next;64&n.f?n.parent=null:rn(n,t),n=r}}function rn(e,t=!0){var n=!1;(t||!!(262144&e.f))&&null!==e.nodes&&null!==e.nodes.end&&(function(e,t){for(;null!==e;){var n=e===t?null:/* @__PURE__ */Nt(e);e.remove(),e=n}}(e.nodes.start,e.nodes.end),n=!0),e.f|=q,nn(e,t&&!n),On(e,0);var r=e.nodes&&e.nodes.t;if(null!==r)for(const e of r)e.stop();tn(e),e.f^=q,e.f|=H;var i=e.parent;null!==i&&null!==i.first&&ln(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function ln(e){var t=e.parent,n=e.prev,r=e.next;null!==n&&(n.next=r),null!==r&&(r.prev=n),null!==t&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function on(e,t,n=!0){var r=[];an(e,r,!0);var i=()=>{n&&rn(e),t&&t()},l=r.length;if(l>0){var o=()=>--l||i();for(var a of r)a.out(o)}else i()}function an(e,t,n){if(0===(e.f&R)){e.f^=R;var r=e.nodes&&e.nodes.t;if(null!==r)for(const e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;null!==i;){var l=i.next;64&i.f||an(i,t,!(0===(i.f&F)&&(0===(i.f&P)||0===(e.f&L)))&&n),i=l}}}function sn(e){un(e,!0)}function un(e,t){if(0!==(e.f&R)){e.f^=R,0===(e.f&N)&&(Me(e,W),dt.ensure().schedule(e));for(var n=e.first;null!==n;){var r=n.next;un(n,!(0===(n.f&F)&&0===(n.f&P))&&t),n=r}var i=e.nodes&&e.nodes.t;if(null!==i)for(const e of i)(e.is_global||t)&&e.in()}}function dn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;null!==n;){var i=n===r?null:/* @__PURE__ */Nt(n);t.append(n),n=i}}let cn=!1,fn=!1;function vn(e){fn=e}let hn=null,pn=!1;function gn(e){hn=e}let mn=null;function wn(e){mn=e}let _n=null;function bn(e){null!==hn&&(_n??=/* @__PURE__ */new Set).add(e)}let yn=null,xn=0,kn=null,Sn=1,Cn=0,En=Cn;function An(e){En=e}function $n(){return++Sn}function zn(e){var t=e.f;if(0!==(t&W))return!0;if(2&t&&(e.f&=~Y),0!==(t&B)){for(var n=e.deps,r=n.length,i=0;i<r;i++){var l=n[i];if(zn(l)&&Ge(l),l.wv>e.wv)return!0}0!==(t&j)&&null===rt&&Me(e,N)}return!1}function In(e,t,n=!0){var r=e.reactions;if(null!==r&&(null===_n||!_n.has(e)))for(var i=0;i<r.length;i++){var l=r[i];2&l.f?In(l,t,!1):t===l&&(n?Me(l,W):0!==(l.f&N)&&Me(l,B),pt(l))}}function Tn(e){var t=yn,n=xn,r=kn,i=hn,l=_n,o=ke,a=pn,s=En,u=e.f;yn=null,xn=0,kn=null,hn=96&u?null:e,_n=null,Se(e.ctx),pn=!1,En=++Cn,null!==e.ac&&(Be(()=>{e.ac.abort(ae)}),e.ac=null);try{e.f|=J;var d=(0,e.fn)();e.f|=V;var c=e.deps,f=tt?.is_fork;if(null!==yn){var v;if(f||On(e,xn),null!==c&&xn>0)for(c.length=xn+yn.length,v=0;v<yn.length;v++)c[xn+v]=yn[v];else e.deps=c=yn;if(Ft()&&0!==(e.f&j))for(v=xn;v<c.length;v++)(c[v].reactions??=[]).push(e)}else!f&&null!==c&&xn<c.length&&(On(e,xn),c.length=xn);if(!(null===kn||pn||null===c||6146&e.f))for(v=0;v<kn.length;v++)In(kn[v],e);if(null!==i&&i!==e){if(Cn++,null!==i.deps)for(let e=0;e<n;e+=1)i.deps[e].rv=Cn;if(null!==t)for(const e of t)e.rv=Cn;null!==kn&&(null===r?r=kn:r.push(...kn))}return 0!==(e.f&Q)&&(e.f^=Q),d}catch(e){return ze(e)}finally{e.f^=J,yn=t,xn=n,kn=r,hn=i,_n=l,Se(o),pn=a,En=s}}function Mn(e,t){let n=t.reactions;if(null!==n){var r=x.call(n,e);if(-1!==r){var i=n.length-1;0===i?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(null===n&&2&t.f&&(null===yn||!k.call(yn,t))){var l=t;0!==(l.f&j)&&(l.f^=j,l.f&=~Y),l.v!==ce&&Oe(l),null!==l.ac&&Be(()=>{l.ac.abort(ae),l.ac=null,Me(l,W)}),function(e){if(null!==e.effects)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),null!==t.ac&&Be(()=>{t.ac.abort(ae),t.ac=null}),null!==t.fn&&(t.teardown=M),On(t,0),nn(t))}(l),On(l,0)}}function On(e,t){var n=e.deps;if(null!==n)for(var r=t;r<n.length;r++)Mn(e,n[r])}function Dn(e){var t=e.f;if(0===(t&H)){Me(e,N);var n=mn,r=cn;mn=e,cn=!(96&t);try{0!==(t&(L|D))?function(e){for(var t=e.first;null!==t;){var n=t.next;0===(t.f&P)&&rn(t),t=n}}(e):nn(e),tn(e);var i=Tn(e);e.teardown="function"==typeof i?i:null,e.wv=Sn}finally{cn=r,mn=n}}}function Ln(e){var t=!!(2&e.f);if(null!==hn&&!pn&&!(null!==mn&&0!==(mn.f&H)||null!==_n&&_n.has(e))){var n=hn.deps;if(0!==(hn.f&J))e.rv<Cn&&(e.rv=Cn,null===yn&&null!==n&&n[xn]===e?xn++:null===yn?yn=[e]:yn.push(e));else{hn.deps??=[],k.call(hn.deps,e)||hn.deps.push(e);var r=e.reactions;null===r?e.reactions=[hn]:k.call(r,hn)||r.push(hn)}}if(fn&&_t.has(e))return _t.get(e);if(t){var i=e;if(fn){var l=i.v;return(0===(i.f&N)&&null!==i.reactions||jn(i))&&(l=Je(i)),_t.set(i,l),l}var o=0===(i.f&j)&&!pn&&null!==hn&&(cn||0!==(hn.f&j)),a=0===(i.f&V);zn(i)&&(o&&(i.f|=j),Ge(i)),o&&!a&&(Qe(i),Pn(i))}if(rt?.has(e))return rt.get(e);if(0!==(e.f&Q))throw e.v;return e.v}function Pn(e){if(e.f|=j,null!==e.deps)for(const t of e.deps)(t.reactions??=[]).push(e),2&t.f&&0===(t.f&j)&&(Qe(t),Pn(t))}function jn(e){if(e.v===ce)return!0;if(null===e.deps)return!1;for(const t of e.deps)if(_t.has(t)||2&t.f&&jn(t))return!0;return!1}function Nn(e){var t=pn;try{return pn=!0,e()}finally{pn=t}}function Wn(e){return e.endsWith("capture")&&"gotpointercapture"!==e&&"lostpointercapture"!==e}const Bn=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Rn(e){return Bn.includes(e)}const Hn={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Vn(e){return e=e.toLowerCase(),Hn[e]??e}const qn=["touchstart","touchmove"];function Fn(e){return qn.includes(e)}const Un=Symbol("events"),Kn=/* @__PURE__ */new Set,Zn=/* @__PURE__ */new Set;function Yn(e,t,n,r={}){function i(e){if(r.capture||er.call(t,e),!e.cancelBubble)return Be(()=>n?.call(this,e))}return e.startsWith("pointer")||e.startsWith("touch")||"wheel"===e?$e(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Jn(e,t,n){(t[Un]??={})[e]=n}function Gn(e){for(var t=0;t<e.length;t++)Kn.add(e[t]);for(var n of Zn)n(e)}let Qn=null,Xn=!1;function er(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],l=i[0]||e.target;Qn=e,Xn||(Xn=!0,setTimeout(()=>{Xn=!1,Qn=null}));var o=0,a=Qn===e&&e[Un];if(a){var s=i.indexOf(a);if(-1!==s&&(t===document||t===window))return void(e[Un]=t);var u=i.indexOf(t);if(-1===u)return;s<=u&&(o=s)}if((l=i[o]||e.target)!==t){C(e,"currentTarget",{configurable:!0,get:()=>l||n});var d=hn,c=mn;gn(null),wn(null);try{for(var f,v=[];null!==l&&l!==t;){try{var h=l[Un]?.[r];null!=h&&(!l.disabled||e.target===l)&&h.call(l,e)}catch(e){f?v.push(e):f=e}if(e.cancelBubble)break;o++,l=o<i.length?i[o]:null}if(f){for(let e of v)queueMicrotask(()=>{throw e});throw f}}finally{e[Un]=t,delete e.currentTarget,gn(d),wn(c)}}}const tr=globalThis?.window?.trustedTypes&&/* @__PURE__ */globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function nr(e){return tr?.createHTML(e)??e}function rr(e,t){var n=mn;null===n.nodes&&(n.nodes={start:e,end:t,a:null,t:null})}function ir(e,t){var n,r=!!(1&t),i=!!(2&t),l=!e.startsWith("<!>");return()=>{if(he)return rr(ve,null),ve;void 0===n&&(n=function(e){var t=Ht("template");return t.innerHTML=nr(e.replaceAll("<!>","\x3c!----\x3e")),t.content}(l?e:"<!>"+e),r||(n=
|
|
6
|
+
/* @__PURE__ */jt(n)));var t=i||Ot?document.importNode(n,!0):n.cloneNode(!0);return r?rr(
|
|
7
|
+
/* @__PURE__ */jt(t),t.lastChild):rr(t,t),t}}function lr(){if(he)return rr(ve,null),ve;var e=document.createDocumentFragment(),t=document.createComment(""),n=Pt();return e.append(t,n),rr(t,n),e}function or(e,t){if(he){var n=mn;return(0===(n.f&V)||null===n.nodes.end)&&(n.nodes.end=ve),void me()}null!==e&&e.before(t)}function ar(e,t){var n=null==t?"":"object"==typeof t?`${t}`:t;n!==(e[le]??=e.nodeValue)&&(e[le]=n,e.nodeValue=`${n}`)}const sr=/* @__PURE__ */new Map;let ur=/* @__PURE__ */new WeakMap;class dr{anchor;#e=/* @__PURE__ */new Map;#t=/* @__PURE__ */new Map;#n=/* @__PURE__ */new Map;#r=/* @__PURE__ */new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#l=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)sn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(sn(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(const[t,n]of this.#e){if(this.#e.delete(t),t===e)break;const r=this.#n.get(n);r&&(rn(r.effect),this.#n.delete(n))}for(const[e,r]of this.#t){if(e===t||this.#r.has(e))continue;const i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();dn(r,t),t.append(Pt()),this.#n.set(e,{effect:r,fragment:t})}else rn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),on(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);const t=Array.from(this.#e.values());for(const[e,n]of this.#n)t.includes(e)||(rn(n.effect),this.#n.delete(e))};ensure(e,t){var n=tt;!t||this.#t.has(e)||this.#n.has(e)||this.#t.set(e,en(()=>t(this.anchor))),this.#e.set(n,e),he&&(this.anchor=ve),this.#l(n)}}function cr(e,t,n=!1){var r;he&&(r=ve,me());var i=new dr(e);function l(e,t){if(he){var n=be(r);if(e!==parseInt(n.substring(1))){var l=_e();return ge(l),i.anchor=l,pe(!1),i.ensure(e,t),void pe(!0)}}i.ensure(e,t)}Qt(()=>{var e=!1;t((t,n=0)=>{e=!0,l(n,t)}),e||l(-1,null)},n?F:0)}function fr(e,t){return t}function vr(e,t,n=!0){var r;if(e.pending.size>0){r=/* @__PURE__ */new Set;for(const t of e.pending.values())for(const n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var l=t[i];r?.has(l)?(l.f|=Z,dn(l,document.createDocumentFragment())):rn(t[i],n)}}var hr;function pr(e,t,n,r,i,l=null){var o=e,a=/* @__PURE__ */new Map;if(4&t){var s=e;o=he?ge(/* @__PURE__ */jt(s)):s.appendChild(Pt())}he&&me();var u,d=null,c=/* @__PURE__ */Ye(()=>{var e=n();return y(e)?e:null==e?[]:S(e)}),f=/* @__PURE__ */new Map,v=!0,h={effect:Qt(()=>{var e=(u=Ln(c)).length;let s=!1;he&&be(o)===ue!=(0===e)&&(ge(o=_e()),pe(!1),s=!0);for(var p=/* @__PURE__ */new Set,g=tt,m=0;m<e;m+=1){he&&8===ve.nodeType&&"]"===ve.data&&(o=ve,s=!0,pe(!1));var w=u[m],_=r(w,m),b=v?null:a.get(_);b?(b.v&&Ct(b.v,w),b.i&&Ct(b.i,m)):(b=mr(a,v?o:hr??=Pt(),w,_,m,i,t,n),v||(b.e.f|=Z),a.set(_,b)),p.add(_)}0===e&&l&&!d&&(v?d=en(()=>l(o)):(d=en(()=>l(hr??=Pt()))).f|=Z),e>p.size&&function(){throw new Error("https://svelte.dev/e/each_key_duplicate")}(),he&&e>0&&ge(_e()),v||(f.set(g,p),function(e){0===(h.effect.f&H)&&(h.pending.delete(e),h.fallback=d,function(e,t,n,r,i){var l,o,a,s,u,d=!!(8&r),c=t.length,f=e.items,v=gr(e.effect.first),h=null,p=[],g=[];if(d)for(u=0;u<c;u+=1)a=i(t[u],u),0===((s=f.get(a).e).f&Z)&&(s.nodes?.a?.measure(),(o??=/* @__PURE__ */new Set).add(s));for(u=0;u<c;u+=1){if(a=i(t[u],u),s=f.get(a).e,null!==e.outrogroups)for(const t of e.outrogroups)t.pending.delete(s),t.done.delete(s);if(0!==(s.f&R)&&(sn(s),d&&(s.nodes?.a?.unfix(),(o??=/* @__PURE__ */new Set).delete(s))),0!==(s.f&Z)){if(s.f^=Z,s!==v){var m=h?h.next:v;s===e.effect.last&&(e.effect.last=s.prev),s.prev&&(s.prev.next=s.next),s.next&&(s.next.prev=s.prev),_r(e,h,s),_r(e,s,m),wr(s,m,n),p=[],g=[],v=gr((h=s).next);continue}wr(s,null,n)}if(s!==v){if(void 0!==l&&l.has(s)){if(p.length<g.length){var w,_=g[0];h=_.prev;var b=p[0],y=p[p.length-1];for(w=0;w<p.length;w+=1)wr(p[w],_,n);for(w=0;w<g.length;w+=1)l.delete(g[w]);_r(e,b.prev,y.next),_r(e,h,b),_r(e,y,_),v=_,h=y,u-=1,p=[],g=[]}else l.delete(s),wr(s,v,n),_r(e,s.prev,s.next),_r(e,s,null===h?e.effect.first:h.next),_r(e,h,s),h=s;continue}for(p=[],g=[];null!==v&&v!==s;)(l??=/* @__PURE__ */new Set).add(v),g.push(v),v=gr(v.next);if(null===v)continue}0===(s.f&Z)&&p.push(s),h=s,v=gr(s.next)}if(null!==e.outrogroups){for(const t of e.outrogroups)0===t.pending.size&&(vr(e,S(t.done)),e.outrogroups?.delete(t));0===e.outrogroups.size&&(e.outrogroups=null)}if(null!==v||void 0!==l){var x=[];if(void 0!==l)for(s of l)0===(s.f&R)&&x.push(s);for(;null!==v;)0===(v.f&R)&&v!==e.fallback&&x.push(v),v=gr(v.next);var k=x.length;if(k>0){var C=4&r&&0===c?n:null;if(d){for(u=0;u<k;u+=1)x[u].nodes?.a?.measure();for(u=0;u<k;u+=1)x[u].nodes?.a?.fix()}!function(e,t,n){for(var r,i=t.length,l=t.length,o=0;o<i;o++){let n=t[o];on(n,()=>{if(r){if(r.pending.delete(n),r.done.add(n),0===r.pending.size){var t=e.outrogroups;vr(e,S(r.done)),t.delete(r),0===t.size&&(e.outrogroups=null)}}else l-=1},!1)}if(0===l){var a=null!==n&&0===e.pending.size;if(a){var s=n,u=s.parentNode;(function(e){e.textContent=""})(u),u.append(s),e.items.clear()}vr(e,t,!a)}else r={pending:new Set(t),done:/* @__PURE__ */new Set},(e.outrogroups??=/* @__PURE__ */new Set).add(r)}(e,x,C)}}d&&$e(()=>{if(void 0!==o)for(s of o)s.nodes?.a?.apply()})}(h,u,o,t,r),null!==d&&(0===u.length?0===(d.f&Z)?sn(d):(d.f^=Z,wr(d,null,o)):on(d,()=>{d=null})))}(g)),s&&pe(!0),Ln(c)}),items:a,pending:f,outrogroups:null,fallback:d};v=!1,he&&(o=ve)}function gr(e){for(;null!==e&&0===(e.f&P);)e=e.next;return e}function mr(e,t,n,r,i,l,o,a){var s=1&o?16&o?yt(n):/* @__PURE__ */kt(n,!1,!1):null,u=2&o?yt(i):null;return{v:s,i:u,e:en(()=>(l(t,s??n,u??i,a),()=>{e.delete(r)}))}}function wr(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,l=t&&0===(t.f&Z)?t.nodes.start:n;null!==r;){var o=
|
|
8
|
+
/* @__PURE__ */Nt(r);if(l.before(r),r===i)return;r=o}}function _r(e,t,n){null===t?e.effect.first=n:t.next=n,null===n?e.effect.last=t:n.prev=t}function br(e,t,...n){var r=new dr(e);Qt(()=>{const e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},F)}function yr(e,t){var n,r=void 0;Xt(()=>{r!==(r=t())&&(n&&(rn(n),n=null),r&&(n=en(()=>{Yt(()=>r(e))})))})}function xr(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xr(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}const kr=[..." \t\n\r\f \v\ufeff"];function Sr(e,t=!1){var n=t?" !important;":";",r="";for(var i of Object.keys(e)){var l=e[i];null!=l&&""!==l&&(r+=" "+i+": "+l+n)}return r}function Cr(e){return"-"!==e[0]||"-"!==e[1]?e.toLowerCase():e}function Er(e,t,n,r,i,l){var o=e[re];if(he||o!==n||void 0===o){var a=function(e,t,n){var r=null==e?"":""+e;if(t&&(r=r?r+" "+t:t),n)for(var i of Object.keys(n))if(n[i])r=r?r+" "+i:i;else if(r.length)for(var l=i.length,o=0;(o=r.indexOf(i,o))>=0;){var a=o+l;0!==o&&!kr.includes(r[o-1])||a!==r.length&&!kr.includes(r[a])?o=a:r=(0===o?"":r.substring(0,o))+r.substring(a+1)}return""===r?null:r}(n,r,l);(!he||a!==e.getAttribute("class"))&&(null==a?e.removeAttribute("class"):t?e.className=a:e.setAttribute("class",a)),e[re]=n}else if(l&&i!==l)for(var s in l){var u=!!l[s];(null==i||u!==!!i[s])&&e.classList.toggle(s,u)}return l}function Ar(e,t={},n,r){for(var i in n){var l=n[i];t[i]!==l&&(null==n[i]?e.style.removeProperty(i):e.style.setProperty(i,l,r))}}function $r(e,t,n,r){var i=e[ie];if(he||i!==t){var l=function(e,t){if(t){var n,r,i="";if(Array.isArray(t)?(n=t[0],r=t[1]):n=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,"").trim();var l=!1,o=0,a=!1,s=[];n&&s.push(...Object.keys(n).map(Cr)),r&&s.push(...Object.keys(r).map(Cr));var u=0,d=-1;const t=e.length;for(var c=0;c<t;c++){var f=e[c];if(a?"/"===f&&"*"===e[c-1]&&(a=!1):l?l===f&&(l=!1):"/"===f&&"*"===e[c+1]?a=!0:'"'===f||"'"===f?l=f:"("===f?o++:")"===f&&o--,!a&&!1===l&&0===o)if(":"===f&&-1===d)d=c;else if(";"===f||c===t-1){if(-1!==d){var v=Cr(e.substring(u,d).trim());s.includes(v)||(";"!==f&&c++,i+=" "+e.substring(u,c).trim()+";")}u=c+1,d=-1}}}return n&&(i+=Sr(n)),r&&(i+=Sr(r,!0)),""===(i=i.trim())?null:i}return null==e?null:String(e)}(t,r);(!he||l!==e.getAttribute("style"))&&(null==l?e.removeAttribute("style"):e.style.cssText=l),e[ie]=t}else r&&(Array.isArray(r)?(Ar(e,n?.[0],r[0]),Ar(e,n?.[1],r[1],"important")):Ar(e,n,r));return r}function zr(e,t,n=!1){if(e.multiple){if(null==t)return;if(!y(t))return void console.warn("https://svelte.dev/e/select_multiple_invalid_value");for(var r of e.options)r.selected=t.includes(Tr(r))}else{for(r of e.options)if(Tt(Tr(r),t))return void(r.selected=!0);(!n||void 0!==t)&&(e.selectedIndex=-1)}}function Ir(e){var t=new MutationObserver(()=>{"__value"in e&&zr(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Ut(()=>{t.disconnect()})}function Tr(e){return"__value"in e?e.__value:e.value}const Mr=Symbol("class"),Or=Symbol("style"),Dr=Symbol("is custom element"),Lr=Symbol("is html"),Pr=se?"link":"LINK",jr=se?"input":"INPUT",Nr=se?"option":"OPTION",Wr=se?"select":"SELECT";function Br(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function Rr(e,t,n,r){var i=Vr(e);he&&(i[t]=e.getAttribute(t),"src"===t||"srcset"===t||"href"===t&&e.nodeName===Pr)||i[t]!==(i[t]=n)&&("loading"===t&&(e[te]=n),null==n?e.removeAttribute(t):"string"!=typeof n&&Fr(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Hr(e,t,n=[],r=[],i=[],l,o=!1,a=!1){He(i,n,r,n=>{var r=void 0,i={},s=e.nodeName===Wr,u=!1;if(Xt(()=>{var d=t(...n.map(Ln)),c=function(e,t,n,r,i=!1){if(he&&i&&e.nodeName===jr){var l=e;("checkbox"===l.type?"defaultChecked":"defaultValue")in n||function(e){if(he){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var n=e.value;Rr(e,"value",null),e.value=n}if(e.hasAttribute("checked")){var r=e.checked;Rr(e,"checked",null),e.checked=r}}};e[oe]=n,$e(n),We()}}(l)}var o=Vr(e),a=o[Dr],s=!o[Lr];let u=he&&a;u&&pe(!1);var d=t||{},c=e.nodeName===Nr;for(var f in t)!(f in n)&&f[0]+f[1]!=="$$"&&(n[f]=null);n.class?n.class=function(e){return"object"==typeof e?function(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xr(e))&&(r&&(r+=" "),r+=t);return r}(e):e??""}(n.class):(r||n[Mr])&&(n.class=null),n[Or]&&(n.style??=null);var v=Fr(e);if(e.nodeName===jr&&"type"in n&&("value"in n||"__value"in n)){var h=n.type;(h!==d.type||void 0===h&&e.hasAttribute("type"))&&(d.type=h,Rr(e,"type",h))}for(const i in n){let l=n[i];if(c&&"value"===i&&null==l)e.value=e.__value="",d[i]=l;else if("class"!==i)if("style"!==i){var p=d[i];if(l!==p||void 0===l&&e.hasAttribute(i)){d[i]=l;var g=i[0]+i[1];if("$$"!==g)if("on"===g){const t={},n="$$"+i;let r=i.slice(2);var m=Rn(r);if(Wn(r)&&(r=r.slice(0,-7),t.capture=!0),!m&&p){if(null!=l)continue;e.removeEventListener(r,d[n],t),d[n]=null}if(m)Jn(r,e,l),Gn([r]);else if(null!=l){let l=function(e){d[i].call(this,e)};d[n]=Yn(r,e,l,t)}}else if("style"===i)Rr(e,i,l);else if("autofocus"===i)je(e,!!l);else if(a||"__value"!==i&&("value"!==i||null==l))if("selected"===i&&c)Br(e,l);else{var w=i;s||(w=Vn(w));var _="defaultValue"===w||"defaultChecked"===w;if(null!=l||a||_)_||v.includes(w)&&(a||"string"!=typeof l)?(e[w]=l,w in o&&(o[w]=ce)):"function"!=typeof l&&Rr(e,w,l);else if(o[i]=null,"value"===w||"checked"===w){let n=e;const r=void 0===t;if("value"===w){let e=n.defaultValue;n.removeAttribute(w),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(w),n.defaultChecked=e,n.checked=!!r&&e}}else e.removeAttribute(i)}else e.value=e.__value=l}}else $r(e,l,t?.[Or],n[Or]),d[i]=l,d[Or]=n[Or];else Er(e,"http://www.w3.org/1999/xhtml"===e.namespaceURI,l,r,t?.[Mr],n[Mr]),d[i]=l,d[Mr]=n[Mr]}return u&&pe(!0),d}(e,r,d,l,o,a);u&&s&&"value"in d&&zr(e,d.value);for(let e of Object.getOwnPropertySymbols(i))d[e]||rn(i[e]);for(let t of Object.getOwnPropertySymbols(d)){var f=d[t];"@attach"===t.description&&(!r||f!==r[t])&&(i[t]&&rn(i[t]),i[t]=en(()=>yr(e,()=>f))),c[t]=f}r=c}),s){var d=e;Yt(()=>{zr(d,r.value,!0),Ir(d)})}u=!0})}function Vr(e){return e[ne]??={[Dr]:e.nodeName.includes("-"),[Lr]:"http://www.w3.org/1999/xhtml"===e.namespaceURI}}var qr=/* @__PURE__ */new Map;function Fr(e){var t=e.getAttribute("is")||e.nodeName,n=qr.get(t);if(n)return n;qr.set(t,n=[]);for(var r,i=e,l=Element.prototype;l!==i;){for(var o in r=A(i))r[o].set&&"innerHTML"!==o&&"textContent"!==o&&"innerText"!==o&&n.push(o);i=I(i)}return n}let Ur=null;function Kr(e,t){return e===t||e?.[X]===t}function Zr(e={},t,n,r){var i=ke.r,l=mn;return Yt(()=>{var r,o;return Jt(()=>{r=o,o=[],Nn(()=>{Kr(n(...o),e)||(t(e,...o),r&&Kr(n(...r),e)&&t(null,...r))})}),()=>{let r=l;for(;r!==i&&null!==r.parent&&r.parent.f&q;)r=r.parent;const a=r.teardown;r.teardown=()=>{o&&Kr(n(...o),e)&&t(null,...o),a?.()}}}),e}const Yr={get(e,t){if(!e.exclude.has(t))return e.props[t]},set:(e,t)=>!1,getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has:(e,t)=>!e.exclude.has(t)&&t in e.props,ownKeys:e=>Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))};function Jr(e,t,n){return new Proxy({props:e,exclude:t},Yr)}function Gr(e,t,n,r){var i=!!(8&n),l=!!(16&n),o=r,a=!0,s=void 0,u=()=>l?(s??=/* @__PURE__ */Fe(r),Ln(s)):(a&&(a=!1,o=l?Nn(r):r),o);let d;if(i){var c=X in e||ee in e;d=E(e,t)?.set??(c&&t in e?n=>e[t]=n:void 0)}var f,v,h=!1;if(i?[f,h]=function(e){var t=Pe;try{return Pe=!1,[e(),Pe]}finally{Pe=t}}(()=>e[t]):f=e[t],void 0===f&&void 0!==r&&(f=u(),d&&(function(){throw new Error("https://svelte.dev/e/props_invalid_value")}(),d(f))),v=()=>{var n=e[t];return void 0===n?u():(a=!0,n)},!(4&n))return v;if(d){var p=e.$$legacy;return function(e,t){return arguments.length>0?((!t||p||h)&&d(t?v():e),e):v()}}var g=!1,m=(1&n?Fe:Ye)(()=>(g=!1,v()));i&&Ln(m);var w=mn;return function(e,t){if(arguments.length>0){const n=t?Ln(m):i?zt(e):e;return St(m,n),g=!0,void 0!==o&&(o=n),e}return fn&&g||0!==(w.f&H)?m.v:Ln(m)}}const Qr=Symbol("triiiceratops:plugin-image-download"),Xr=e('<svg viewBox="0 0 256 256"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"/></svg>');typeof window<"u"&&((window.__svelte??={}).v??=/* @__PURE__ */new Set).add("5");var ei=/* @__PURE__ */new Set(["$$slots","$$events","$$legacy","variant","size","circle","square","ghost","outline","active","class","style","children","element"]),ti=/* @__PURE__ */ir("<button><!></button>");let ni=0;var ri=/* @__PURE__ */new Set(["$$slots","$$events","$$legacy","value","size","ghost","class","style","children"]),ii=/* @__PURE__ */ir("<!>",1),li=/* @__PURE__ */ir('<div role="option"> </div>'),oi=/* @__PURE__ */ir('<div><select><!></select> <button type="button" role="combobox" aria-haspopup="listbox"><span> </span></button> <div role="listbox" class="listbox svelte-1hwvamm" popover="manual" tabindex="-1"></div></div>');function ai(e,t){Ce(t,!0);let n=Gr(t,"value",15),r=Gr(t,"size",3,"md"),i=Gr(t,"ghost",3,!1),l=Gr(t,"class",3,""),o=Gr(t,"style",3,""),a=/* @__PURE__ */Jr(t,ri);const s={xs:"calc(var(--tri-size-field,0.25rem)*6)",sm:"calc(var(--tri-size-field,0.25rem)*8)",md:"calc(var(--tri-size-field,0.25rem)*10)",lg:"calc(var(--tri-size-field,0.25rem)*12)"};let u=/* @__PURE__ */Ze(()=>`--size:${s[r()]};${o()}`);const d="tri-listbox-"+ni++;let c=/* @__PURE__ */xt(null),f=/* @__PURE__ */xt(null),v=/* @__PURE__ */xt(null),h=/* @__PURE__ */xt(zt([])),p=/* @__PURE__ */xt(!1),g=/* @__PURE__ */xt(-1),m=/* @__PURE__ */Ze(()=>!!t.disabled),w=/* @__PURE__ */Ze(()=>null==n()?"":String(n())),_=/* @__PURE__ */Ze(()=>Ln(h).find(e=>e.value===Ln(w))??Ln(h)[0]);function b(){Ln(c)&&St(h,Array.from(Ln(c).querySelectorAll("option")).map(e=>({value:e.value,label:(e.textContent??"").trim(),disabled:e.disabled})),!0)}function y(e){const t=Ln(h)[e];!Ln(c)||!t||t.disabled||(Ln(c).value=t.value,Ln(c).dispatchEvent(new Event("input",{bubbles:!0})),Ln(c).dispatchEvent(new Event("change",{bubbles:!0})),E())}function x(){if(!Ln(f)||!Ln(v))return;const e=Ln(f).getBoundingClientRect();Ln(v).style.minWidth=`${e.width}px`,Ln(v).style.left=`${e.left}px`;const t=Ln(v).offsetHeight,n=window.innerHeight-e.bottom;n<t&&e.top>n?Ln(v).style.top=`${Math.max(4,e.top-t-4)}px`:Ln(v).style.top=`${e.bottom+4}px`}function k(){Ln(v)?.children[Ln(g)]?.scrollIntoView({block:"nearest"})}function S(e){const t=e.composedPath();Ln(f)&&t.includes(Ln(f))||Ln(v)&&t.includes(Ln(v))||E()}function C(){Ln(m)||Ln(p)||!Ln(v)||(St(p,!0),Ln(v).showPopover(),x(),St(g,Ln(h).findIndex(e=>e.value===Ln(w)),!0),Ln(g)<0&&St(g,Ln(h).findIndex(e=>!e.disabled),!0),k(),window.addEventListener("scroll",x,!0),window.addEventListener("resize",x),document.addEventListener("pointerdown",S,!0))}function E(){Ln(p)&&(St(p,!1),Ln(v)?.hidePopover(),window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x),document.removeEventListener("pointerdown",S,!0),Ln(f)?.focus())}function A(e){if(!Ln(h).length)return;let t=Ln(g);for(let n=0;n<Ln(h).length;n++)if(t=(t+e+Ln(h).length)%Ln(h).length,!Ln(h)[t]?.disabled)return St(g,t,!0),void k()}function $(e){const t="start"===e?Ln(h).map((e,t)=>t):Ln(h).map((e,t)=>Ln(h).length-1-t);for(const e of t)if(!Ln(h)[e]?.disabled)return St(g,e,!0),void k()}Kt(()=>{if(!Ln(c))return;b();const e=new MutationObserver(()=>b());return e.observe(Ln(c),{childList:!0,subtree:!0,characterData:!0,attributes:!0}),()=>e.disconnect()});let z,I="";var T=oi(),O=Wt(T);Hr(O,()=>({class:"native-select",tabindex:"-1","aria-hidden":"true",...a}),void 0,void 0,void 0,"svelte-1hwvamm"),function(e,t){var n=he;(function(){if(null===Ur){var e=Ht("select");e.innerHTML=nr("<option><span>t</span></option>"),Ur=1===e.firstChild?.firstChild?.nodeType}return Ur})()||(pe(!1),e.textContent="",e.append(function(e=""){return document.createComment(e)}("")));try{t()}finally{n&&(he?we(e):(pe(!0),ge(e)))}}(O,()=>{var e=Wt(O),n=ii();br(Bt(n),()=>t.children??M),or(e,n)}),Zr(O,e=>St(c,e),()=>Ln(c));var D=Rt(O,2);let L;var P=Wt(D);let j;var N=Wt(P,!0);we(P),we(D),Zr(D,e=>St(f,e),()=>Ln(f));var W=Rt(D,2);pr(W,23,()=>Ln(h),(e,t)=>e.value+"\0"+t,(e,t,n)=>{var r=li();let i;var l=Wt(r,!0);we(r),Gt(()=>{Rr(r,"id",`${d}-opt-${Ln(n)??""}`),i=Er(r,1,"option svelte-1hwvamm",null,i,{active:Ln(n)===Ln(g),selected:Ln(t).value===Ln(w)}),Rr(r,"aria-selected",Ln(t).value===Ln(w)),Rr(r,"aria-disabled",Ln(t).disabled),ar(l,Ln(t).label)}),Jn("click",r,()=>y(Ln(n))),Jn("pointermove",r,()=>St(g,Ln(n),!0)),or(e,r)}),we(W),Zr(W,e=>St(v,e),()=>Ln(v)),we(T),Gt(()=>{Er(T,1,`select-wrapper ${l()??""}`,"svelte-1hwvamm"),$r(T,o()),L=Er(D,1,"select svelte-1hwvamm",null,L,{ghost:i(),open:Ln(p)}),$r(D,Ln(u)),D.disabled=Ln(m),Rr(D,"aria-expanded",Ln(p)),Rr(D,"aria-controls",d),Rr(D,"aria-activedescendant",Ln(p)&&Ln(g)>=0?`${d}-opt-${Ln(g)}`:void 0),Rr(D,"aria-label",a["aria-label"]),j=Er(P,1,"select-label svelte-1hwvamm",null,j,{placeholder:Ln(_)?.disabled}),ar(N,Ln(_)?.label??""),Rr(W,"id",d)}),function(e,t,n=t){var r=/* @__PURE__ */new WeakSet,i=!0;(function(e,t,n,r=n){e.addEventListener(t,()=>Be(n));const i=e[oe];e[oe]=i?()=>{i(),r(!0)}:()=>r(!0),We()})(e,"change",t=>{var i,l=t?"[selected]":":checked";if(e.multiple)i=[].map.call(e.querySelectorAll(l),Tr);else{var o=e.querySelector(l)??e.querySelector("option:not([disabled])");i=o&&Tr(o)}n(i),e.__value=i,null!==tt&&r.add(tt)}),Yt(()=>{var l=t();if(e===document.activeElement){var o=tt;if(r.has(o))return}if(zr(e,l,i),i&&void 0===l){var a=e.querySelector(":checked");null!==a&&(l=Tr(a),n(l))}e.__value=l,i=!1}),Ir(e)}(O,n),Jn("click",D,function(){Ln(p)?E():C()}),Jn("keydown",D,function(e){if(!Ln(m)){if(!Ln(p))return void(["ArrowDown","ArrowUp","Enter"," "].includes(e.key)&&(e.preventDefault(),C()));switch(e.key){case"ArrowDown":e.preventDefault(),A(1);break;case"ArrowUp":e.preventDefault(),A(-1);break;case"Home":e.preventDefault(),$("start");break;case"End":e.preventDefault(),$("end");break;case"Enter":case" ":e.preventDefault(),Ln(g)>=0&&y(Ln(g));break;case"Escape":e.preventDefault(),E();break;case"Tab":E();break;default:1===e.key.length&&!e.metaKey&&!e.ctrlKey&&function(e){I+=e.toLowerCase(),clearTimeout(z),z=setTimeout(()=>I="",600);const t=Ln(h).findIndex(e=>!e.disabled&&e.label.toLowerCase().startsWith(I));t>=0&&(St(g,t,!0),k())}(e.key)}}}),or(e,T),Ee()}Gn(["click","keydown","pointermove"]);const si={name:"@triiiceratops/plugin-image-export",version:"1.0.0"},ui=t(si);function di(e,t,n,r){const l="image/jpeg"===n?"jpg":"png";return`${[r,e].map(e=>i(e??"")).filter(Boolean).join("-")||"image"}${"single"===t?"":`-${t}`}.${l}`}function ci(e){const t=e.serviceId??e.resourceId;if(!t)return null;try{return new URL(t).host||null}catch{return null}}function fi(e,t){return l(e,{getSelectedChoice:t})}function vi(e){return f(e)}function hi(e,t){const n=l(e,{getSelectedChoice:t})[0];return n?.canvasWidth&&n?.canvasHeight?c(n.canvasWidth,n.canvasHeight):[]}async function pi(e,t){return s(e,t)}async function gi(e,t,n={}){const r=l(e,{getSelectedChoice:n.getSelectedChoice}),i=r[0];if(!i)throw new Error("No exportable image found for this canvas.");const{canvasWidth:u,canvasHeight:d}=i;if(!u||!d)throw new Error("Unable to determine canvas dimensions for export.");const{width:c,height:f}=o(t.width,t.height),h=c/u,p=await Promise.all(r.map(async e=>async function(e,t,n,r){const i=v(e,t,n,r);return{blob:await s(e,{width:i.width}),...i}}(e,u,d,h)));return a(p,c,f,n.format??"image/png")}function mi(e){return u({canvases:e.canvases,currentCanvasId:e.canvasId,currentCanvasIndex:e.currentCanvasIndex,viewingMode:e.viewingMode,pagedOffset:e.pagedOffset}).map(e=>e.canvas).filter(t=>!d(e,t))}function wi(e,t){const n=mi(e);if(!n.length)return null;const r=n.flatMap((e,n)=>{const r=h(e)??`canvas-${n}`;return l(e,{getSelectedChoice:t}).map(e=>({canvasId:r,x:e.x,y:e.y,width:e.width,sourceWidth:e.width,sourceHeight:e.height,tileSource:{resolved:e}}))});if(!r.length)return null;const{layouts:i,sources:o}=p(r,{mode:e.viewingMode,direction:e.viewingDirection,preserveCanvasScale:e.preserveCanvasScale});if(!i.length)return null;const a=Math.min(...i.map(e=>e.x)),s=Math.min(...i.map(e=>e.y)),u=Math.max(...i.map(e=>e.x+e.width)),d=Math.max(...i.map(e=>e.y+e.height));return{entries:o.map(e=>({resolved:e.tileSource.resolved,x:e.x-a,y:e.y-s,width:e.width})),worldWidth:u-a,worldHeight:d-s}}function _i(e,t){const n=wi(e,t);if(!n)return[];const r=n.entries[0],i=r?.resolved.resourceWidth&&r.width>0?r.resolved.resourceWidth/r.width:1600,l=Math.round(n.worldWidth*i),o=Math.round(n.worldHeight*i);return l&&o?c(l,o):[]}async function bi(e,t,n={}){const r=wi(e,n.getSelectedChoice);if(!r)throw new Error("Nothing is currently displayed in the viewer.");const{width:i,height:l}=o(t.width,t.height),u=i/r.worldWidth,d=await Promise.all(r.entries.map(async({resolved:e,x:t,y:n,width:r})=>{const i=Math.max(1,Math.round(r*u)),l=e.width>0&&e.height>0?e.height/e.width:1,o=Math.max(1,Math.round(i*l));return{blob:await s(e,{width:i}),x:Math.round(t*u),y:Math.round(n*u),width:i,height:o}}));return a(d,i,l,n.format??"image/png")}var yi=/* @__PURE__ */ir("<option> </option>"),xi=/* @__PURE__ */ir("<!> <option> </option> <!>",1),ki=/* @__PURE__ */ir('<div class="tri-id-field"><label class="tri-id-label" for="tri-id-mode"><span> </span></label> <!></div>'),Si=/* @__PURE__ */ir('<div class="tri-id-field"><label class="tri-id-label" for="tri-id-canvas"><span> </span></label> <!></div>'),Ci=/* @__PURE__ */ir('<div class="tri-id-field"><label class="tri-id-label" for="tri-id-image"><span> </span></label> <!></div>'),Ei=/* @__PURE__ */ir('<option disabled=""> </option> <!>',1),Ai=/* @__PURE__ */ir('<div class="tri-id-alert is-success" data-tri-id-result=""><span> </span></div>'),$i=/* @__PURE__ */ir('<div class="tri-id-alert is-error" data-tri-id-error=""><span> </span></div>'),zi=/* @__PURE__ */ir('<div class="tri-id-alert"><span> </span></div>'),Ii=/* @__PURE__ */ir('<div class="tri-id-card"><div class="tri-id-card-body"><!> <!> <!></div></div>'),Ti=/* @__PURE__ */ir('<span aria-hidden="true"></span> ',1),Mi=/* @__PURE__ */ir('<div class="tri-id" data-tri-id="" data-panel-id="image-download"><div class="tri-id-body"><p class="tri-id-desc"> </p> <div class="tri-id-fields"><!> <!> <!> <div class="tri-id-field"><label class="tri-id-label" for="tri-id-resolution"><span> </span></label> <!></div></div> <!></div> <div class="tri-id-footer"><!></div></div>');function Oi(e,t){Ce(t,!0);const{context:n}=function(e){return function(e){return null===e&&function(){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}(),e.c??=new Map(function(e){let t=e.p;for(;null!==t&&null===t.c;)t=t.p;return t?.c??null}(e)||void 0)}(ke).get(e)}(Qr),{viewerState:r,selectors:i,locale:l,ui:o}=n;let a=/* @__PURE__ */xt(0),s=/* @__PURE__ */xt(0);i.select(e=>[e.canvasId,e.currentCanvasIndex,e.canvases,e.manifestId,e.viewingMode,e.viewingDirection,e.pagedOffset,e.preserveCanvasScale]).subscribe(()=>{Et(a)}),l.subscribe(()=>{Et(s)});const u=(e,t)=>(Ln(s),l.t(e,t));let d=/* @__PURE__ */xt("single"),c=/* @__PURE__ */xt(0),f=/* @__PURE__ */xt(0),v=/* @__PURE__ */xt(zt([])),p=/* @__PURE__ */xt(null),b=/* @__PURE__ */xt(!1),y=/* @__PURE__ */xt(!1),x=/* @__PURE__ */xt(""),k=/* @__PURE__ */xt(""),S=/* @__PURE__ */xt(null);const C=e=>r.getSelectedChoice(e),E=/* @__PURE__ */Ze(()=>(Ln(a),Ln(s),w(r.manifestEntry?.json?.label,l.current)||null)),A=/* @__PURE__ */Ze(()=>(Ln(a),r.currentCanvasIndex>=0?r.canvases[r.currentCanvasIndex]??null:null)),$=/* @__PURE__ */Ze(()=>(Ln(a),Ln(A)?fi(Ln(A),C):[])),z=/* @__PURE__ */Ze(()=>Ln($).length>1),I=/* @__PURE__ */Ze(()=>Ln(z)),T=/* @__PURE__ */Ze(()=>(Ln(a),mi(r))),O=/* @__PURE__ */Ze(()=>Ln(T).length>1),D=/* @__PURE__ */Ze(()=>Ln(O)),L=/* @__PURE__ */Ze(()=>Ln(I)||Ln(D)),P=/* @__PURE__ */Ze(()=>(Ln(a),"single"===Ln(d)&&Ln(O)?Ln(T)[Ln(c)]??Ln(A):Ln(A))),j=/* @__PURE__ */Ze(()=>(Ln(a),Ln(P)?fi(Ln(P),C):[])),N=/* @__PURE__ */Ze(()=>Ln(j).length>1),W=/* @__PURE__ */Ze(()=>null!==Ln(p)?Ln(v)[Ln(p)]??null:null),B=/* @__PURE__ */Ze(()=>!(Ln(y)||Ln(b)||!Ln(A)||!Ln(W))),R=/* @__PURE__ */Ze(()=>(Ln(s),Ln(A)?Ln(b)||Ln(v).length?null:u("image_download_disabled_no_resolution"):u("image_download_disabled_no_canvas")));function H(e){const t=Number(e);return Number.isInteger(t)?t:0}Kt(()=>{("composite"===Ln(d)&&!Ln(I)||"world"===Ln(d)&&!Ln(D))&&St(d,"single")}),Kt(()=>{Ln(a);const e=r.canvasId,t=Ln(T).findIndex(t=>h(t)===e);St(c,t>=0?t:0,!0)}),Kt(()=>{Ln(P),St(f,0)}),Kt(()=>{const e=Ln(A),t=Ln(d),n=Ln(f);let i=!1;if(St(v,[],!0),St(p,null),e){if("single"===t){const e=Ln(j)[n];if(!e)return;St(b,!0),vi(e).then(e=>{i||(St(v,e,!0),St(p,e.length?0:null,!0))}).finally(()=>{i||St(b,!1)})}else if("composite"===t){const t=hi(e,C);St(v,t,!0),St(p,t.length?0:null,!0)}else{const e=_i(r,C);St(v,e,!0),St(p,e.length?0:null,!0)}return()=>{i=!0}}});var V=Mi(),q=Wt(V),F=Wt(q),U=Wt(F,!0);we(F);var K=Rt(F,2),Z=Wt(K),Y=e=>{var t=ki(),n=Wt(t),r=Wt(n),i=Wt(r,!0);we(r),we(n);var l=Rt(n,2);{let e=/* @__PURE__ */Ze(()=>u("image_download_mode"));ai(l,{id:"tri-id-mode",class:"tri-id-field-select","data-tri-id-mode":!0,get"aria-label"(){return Ln(e)},get disabled(){return Ln(y)},get value(){return Ln(d)},onchange:e=>{St(d,e.currentTarget.value,!0)},children:(e,t)=>{var n=xi(),r=Bt(n),i=e=>{var t=yi(),n=Wt(t,!0);we(t),t.value=t.__value="composite",Gt(e=>ar(n,e),[()=>u("image_download_mode_composite")]),or(e,t)};cr(r,e=>{Ln(I)&&e(i)});var l=Rt(r,2),o=Wt(l,!0);we(l),l.value=l.__value="single";var a=Rt(l,2),s=e=>{var t=yi(),n=Wt(t,!0);we(t),t.value=t.__value="world",Gt(e=>ar(n,e),[()=>u("image_download_mode_world")]),or(e,t)};cr(a,e=>{Ln(D)&&e(s)}),Gt(e=>ar(o,e),[()=>u("image_download_mode_single")]),or(e,n)},$$slots:{default:!0}})}we(t),Gt(e=>ar(i,e),[()=>u("image_download_mode")]),or(e,t)};cr(Z,e=>{Ln(L)&&e(Y)});var J=Rt(Z,2),G=e=>{var t=Si(),n=Wt(t),r=Wt(n),i=Wt(r,!0);we(r),we(n);var l=Rt(n,2);{let e=/* @__PURE__ */Ze(()=>u("image_download_canvas"));ai(l,{id:"tri-id-canvas",class:"tri-id-field-select",get"aria-label"(){return Ln(e)},get disabled(){return Ln(y)},get value(){return Ln(c)},onchange:e=>{St(c,H(e.currentTarget.value),!0)},children:(e,t)=>{var n=lr();pr(Bt(n),17,()=>Ln(T),fr,(e,t,n)=>{var r=yi(),i=Wt(r,!0);we(r),r.value=r.__value=n,Gt(e=>ar(i,e),[()=>g(Ln(t),n)]),or(e,r)}),or(e,n)},$$slots:{default:!0}})}we(t),Gt(e=>ar(i,e),[()=>u("image_download_canvas")]),or(e,t)};cr(J,e=>{"single"===Ln(d)&&Ln(O)&&e(G)});var Q=Rt(J,2),X=e=>{var t=Ci(),n=Wt(t),r=Wt(n),i=Wt(r,!0);we(r),we(n);var l=Rt(n,2);{let e=/* @__PURE__ */Ze(()=>u("image_download_image"));ai(l,{id:"tri-id-image",class:"tri-id-field-select",get"aria-label"(){return Ln(e)},get disabled(){return Ln(y)},get value(){return Ln(f)},onchange:e=>{St(f,H(e.currentTarget.value),!0)},children:(e,t)=>{var n=lr();pr(Bt(n),17,()=>Ln(j),fr,(e,t,n)=>{var r=yi(),i=Wt(r,!0);we(r),r.value=r.__value=n,Gt(e=>ar(i,e),[()=>Ln(t).label??`${u("image_download_image")} ${n+1}`]),or(e,r)}),or(e,n)},$$slots:{default:!0}})}we(t),Gt(e=>ar(i,e),[()=>u("image_download_image")]),or(e,t)};cr(Q,e=>{"single"===Ln(d)&&Ln(N)&&e(X)});var ee=Rt(Q,2),te=Wt(ee),ne=Wt(te),re=Wt(ne,!0);we(ne),we(te);var ie=Rt(te,2);{let e=/* @__PURE__ */Ze(()=>u("image_download_resolution")),t=/* @__PURE__ */Ze(()=>Ln(y)||Ln(b)||!Ln(v).length),n=/* @__PURE__ */Ze(()=>Ln(p)??"");ai(ie,{id:"tri-id-resolution",class:"tri-id-field-select","data-tri-id-resolution":!0,get"aria-label"(){return Ln(e)},get disabled(){return Ln(t)},get value(){return Ln(n)},onchange:e=>{St(p,H(e.currentTarget.value),!0)},children:(e,t)=>{var n=Ei(),r=Bt(n),i=Wt(r,!0);we(r),r.value=r.__value="",pr(Rt(r,2),17,()=>Ln(v),fr,(e,t,n)=>{var r=yi(),i=Wt(r,!0);we(r),r.value=r.__value=n,Gt(()=>ar(i,Ln(t).label)),or(e,r)}),Gt(e=>ar(i,e),[()=>u("image_download_resolution_placeholder")]),or(e,n)},$$slots:{default:!0}})}we(ee),we(K);var le=Rt(K,2),oe=e=>{var t=Ii(),n=Wt(t),r=Wt(n),i=e=>{var t=Ai(),n=Wt(t),r=Wt(n,!0);we(n),we(t),Gt(()=>ar(r,Ln(k))),or(e,t)};cr(r,e=>{Ln(k)&&e(i)});var l=Rt(r,2),o=e=>{var t=$i(),n=Wt(t),r=Wt(n,!0);we(n),we(t),Gt(()=>ar(r,Ln(x))),or(e,t)};cr(l,e=>{Ln(x)&&e(o)});var a=Rt(l,2),s=e=>{var t=zi(),n=Wt(t),r=Wt(n,!0);we(n),we(t),Gt(()=>ar(r,Ln(R))),or(e,t)};cr(a,e=>{Ln(R)&&e(s)}),we(n),we(t),or(e,t)};cr(le,e=>{(Ln(k)||Ln(x)||Ln(R))&&e(oe)}),we(q);var ae=Rt(q,2),se=Wt(ae);{let e=/* @__PURE__ */Ze(()=>!Ln(B));!function(e,t){Ce(t,!0);let n=Gr(t,"variant",3,"default"),r=Gr(t,"size",3,"md"),i=Gr(t,"circle",3,!1),l=Gr(t,"square",3,!1),o=Gr(t,"ghost",3,!1),a=Gr(t,"outline",3,!1),s=Gr(t,"active",3,!1),u=Gr(t,"class",3,""),d=Gr(t,"style",3,""),c=Gr(t,"element",15,null),f=/* @__PURE__ */Jr(t,ei);const v={default:"",primary:"--btn-color:var(--tri-color-primary);--btn-color-text:var(--tri-color-primary-text);--btn-fg:var(--tri-color-primary-content);",neutral:"--btn-color:var(--tri-color-neutral);--btn-fg:var(--tri-color-neutral-content);",success:"--btn-color:var(--tri-color-success);--btn-fg:var(--tri-color-success-content);",warning:"--btn-color:var(--tri-color-warning);--btn-fg:var(--tri-color-warning-content);",error:"--btn-color:var(--tri-color-error);--btn-fg:var(--tri-color-error-content);"},h={xs:"--fontsize:0.6875rem;--btn-p:0.5rem;--size:calc(var(--tri-size-field,0.25rem)*6);",sm:"--fontsize:0.75rem;--btn-p:0.75rem;--size:calc(var(--tri-size-field,0.25rem)*8);",md:"--fontsize:0.875rem;--btn-p:1rem;--size:calc(var(--tri-size-field,0.25rem)*10);",lg:"--fontsize:1.125rem;--btn-p:1.25rem;--size:calc(var(--tri-size-field,0.25rem)*12);"};let p=/* @__PURE__ */Ze(()=>`${h[r()]}${v[n()]}${d()}`);var g=ti();Hr(g,()=>({class:`btn ${u()??""}`,style:Ln(p),...f,[Mr]:{circle:i(),square:l(),ghost:o(),outline:a(),active:s()}}),void 0,void 0,void 0,"svelte-sgoebi"),br(Wt(g),()=>t.children??M),we(g),Zr(g,e=>c(e),()=>c()),or(e,g),Ee()}(se,{variant:"primary",class:"tri-id-download","data-tri-id-download":!0,style:"width:100%",get disabled(){return Ln(e)},onclick:async function e(){if(Ln(A)&&Ln(W)&&Ln(B)){St(y,!0),St(x,""),St(k,"");try{let e,t=Ln(A);if("single"===Ln(d)){t=Ln(P);const n=Ln(j)[Ln(f)];if(!n)return;e=await pi(n,Ln(W))}else e="composite"===Ln(d)?await gi(Ln(A),Ln(W),{getSelectedChoice:C}):await bi(r,Ln(W),{getSelectedChoice:C});const n=di(g(t,r.currentCanvasIndex,l.current),Ln(d),"image/jpeg"===e.type?"image/jpeg":"image/png",Ln(E));m(e,n),St(k,u("image_download_result_downloaded",{filename:n}),!0)}catch(t){St(x,function(e){if(!_(e))return u("image_download_error_failed");const t="single"===Ln(d)?Ln(j)[Ln(f)]:Ln($)[0],n=t?ci(t):null;return console.warn("[ImageDownload] The image server refused to let this page read the image, so it cannot be downloaded or composited here. That is the image server's cross-origin policy — no 'Access-Control-Allow-Origin' header on the image response — not a viewer error, and not something the viewer can change. The images still display because painting an image needs no such permission; reading its pixels back does.",{host:n,mode:Ln(d),resolution:Ln(W)?.label,error:e}),n?u("image_download_error_not_allowed",{host:n}):u("image_download_error_not_allowed_unknown_host")}(t),!0),Ln(S)&&ui(Ln(S),t,()=>{e()})}finally{St(y,!1)}}},children:(e,t)=>{var n=Ti(),r=Bt(n);!function(e){Yt(()=>{var t=Nn(()=>{return t=e,function(e){return{destroy:o.renderIcon(Xr,e)}}?.(t)||{};var t});if(t?.destroy)return()=>t.destroy()})}(r);var i=Rt(r);Gt(e=>ar(i,` ${e??""}`),[()=>Ln(y)?u("image_download_downloading"):u("image_download_download")]),or(e,n)},$$slots:{default:!0}})}we(ae),we(V),Zr(V,e=>St(S,e),()=>Ln(S)),Gt((e,t)=>{ar(U,e),ar(re,t)},[()=>u("image_download_description"),()=>u("image_download_resolution")]),or(e,V),Ee()}const{STYLES:Di,STYLE_ID:Li}=n(".tri-id{display: flex;flex-direction: column;min-height: 0;width: 100%;color: var(--panel-fg, var(--tri-panel-content, currentColor));}.tri-id-body{width: 100%;padding: 1rem;display: flex;flex-direction: column;gap: 1rem;}.tri-id-desc{font-size: 0.875rem;line-height: 1.25rem;margin: 0;color: color-mix(in oklab, var(--panel-fg, currentColor) 70%, transparent);}.tri-id-fields{display: grid;grid-template-columns: repeat(1, minmax(0, 1fr));gap: 0.75rem;}.tri-id-field{width: 100%;}.tri-id-label{display: inline-flex;align-items: center;gap: 0.375rem;margin-bottom: 0.25rem;white-space: nowrap;font-size: 0.75rem;color: color-mix(in oklab, currentColor 60%, transparent);}.tri-id-field-select{width: 100%;}.tri-id-card{display: flex;flex-direction: column;position: relative;border-radius: var(--tri-radius-panels, 0.75rem);border: 1px solid var(--tri-surface-border, rgb(0 0 0 / 0.15));background-color: var(--tri-input-bg, #fff);}.tri-id-card-body{display: flex;flex-direction: column;flex: auto;gap: 0.5rem;padding: 1rem;font-size: 0.875rem;}.tri-id-alert{--alert-color: var(--panel-fg, currentColor);display: grid;grid-auto-flow: column;grid-template-columns: auto;justify-content: start;place-items: center start;gap: 1rem;text-align: start;padding-block: 0.5rem;padding-inline: 1rem;font-size: 0.875rem;line-height: 1.25rem;border: 1px solid color-mix( in oklab, var(--alert-color) 10%, var(--tri-input-bg, transparent) );border-radius: var(--tri-radius-panels, 0.75rem);color: color-mix( in oklab, var(--alert-color) 45%, var(--panel-fg, currentColor) );background: color-mix( in oklab, var(--alert-color) 8%, var(--tri-input-bg, transparent) );box-shadow: none;}.tri-id-alert.is-success{--alert-color: var(--tri-color-success, #16a34a);}.tri-id-alert.is-error{--alert-color: var(--tri-color-error, #dc2626);}.tri-id-footer{width: 100%;padding: 1rem;border-top: 1px solid var(--tri-surface-border, rgb(0 0 0 / 0.15));}.tri-id-download svg{width: 1.125rem;height: 1.125rem;fill: currentColor;}","panel"),Pi=r({name:si.name,title:"image_download_title",uiId:"image-download",version:si.version,coreRange:">=1.0.0-rc.0",pluginApiRange:"^1.0.0",requiredCapabilities:[],icon:Xr,target:"panel",catalog:{en:{image_download_title:"Download Image",image_download_close:"Close Download Image",image_download_description:"Download the current canvas as an image.",image_download_mode:"What to download",image_download_mode_composite:"Composite canvas",image_download_mode_composite_hint:"Every image on the current canvas, composited together.",image_download_mode_single:"Single image",image_download_mode_single_hint:"One image from the current canvas.",image_download_mode_world:"Current view",image_download_mode_world_hint:"Everything currently laid out together in the viewer.",image_download_canvas:"Canvas",image_download_image:"Image",image_download_resolution:"Resolution",image_download_resolution_placeholder:"Select a resolution",image_download_downloading:"Downloading...",image_download_download:"Download",image_download_disabled_no_canvas:"Load a manifest to download an image.",image_download_disabled_no_resolution:"Select a resolution to download.",image_download_result_downloaded:"Downloaded {filename}.",image_download_error_failed:"Unable to download image. Check the browser console for details.",image_download_error_not_allowed:"This image cannot be downloaded here: {host} does not permit downloads from other websites. Try viewing the image on its own site.",image_download_error_not_allowed_unknown_host:"This image cannot be downloaded here: the image server does not permit downloads from other websites. Try viewing the image on its own site."},de:{image_download_title:"Bild herunterladen",image_download_close:"Bild-Download schließen",image_download_description:"Die aktuelle Leinwand als Bild herunterladen.",image_download_mode:"Was heruntergeladen werden soll",image_download_mode_composite:"Zusammengesetzte Leinwand",image_download_mode_composite_hint:"Alle Bilder der aktuellen Leinwand, zusammengesetzt.",image_download_mode_single:"Einzelbild",image_download_mode_single_hint:"Ein Bild von der aktuellen Leinwand.",image_download_mode_world:"Aktuelle Ansicht",image_download_mode_world_hint:"Alles, was aktuell zusammen im Viewer angezeigt wird.",image_download_canvas:"Leinwand",image_download_image:"Bild",image_download_resolution:"Auflösung",image_download_resolution_placeholder:"Auflösung auswählen",image_download_downloading:"Wird heruntergeladen...",image_download_download:"Herunterladen",image_download_disabled_no_canvas:"Laden Sie ein Manifest, um ein Bild herunterzuladen.",image_download_disabled_no_resolution:"Wählen Sie eine Auflösung zum Herunterladen aus.",image_download_result_downloaded:"{filename} heruntergeladen.",image_download_error_failed:"Bild kann nicht heruntergeladen werden. Details in der Browserkonsole.",image_download_error_not_allowed:"Dieses Bild kann hier nicht heruntergeladen werden: {host} erlaubt keine Downloads von anderen Websites. Rufen Sie das Bild auf der Website des Anbieters auf.",image_download_error_not_allowed_unknown_host:"Dieses Bild kann hier nicht heruntergeladen werden: Der Bildserver erlaubt keine Downloads von anderen Websites. Rufen Sie das Bild auf der Website des Anbieters auf."}},view:{mount(e,t){const n=t.styles.install(Di,Li),r=t.styles.install(".btn.svelte-sgoebi{display:inline-flex;flex-wrap:nowrap;flex-shrink:0;justify-content:center;align-items:center;gap:.375rem;cursor:pointer;text-align:center;vertical-align:middle;user-select:none;-webkit-user-select:none;touch-action:manipulation;font-weight:600;height:var(--size);padding-inline:var(--btn-p);font-size:var(--fontsize, .875rem);color:var(--btn-fg);background-color:var(--btn-bg);border-width:var(--tri-border);border-style:solid;border-color:var(--btn-border);border-start-start-radius:var(--join-ss, var(--tri-radius-buttons));border-start-end-radius:var(--join-se, var(--tri-radius-buttons));border-end-end-radius:var(--join-ee, var(--tri-radius-buttons));border-end-start-radius:var(--join-es, var(--tri-radius-buttons));outline-offset:2px;outline-color:var(--btn-color, var(--tri-content));text-shadow:0 .5px oklch(100% 0 0 / calc(var(--tri-depth) * .15));box-shadow:0 .5px 0 .5px oklch(100% 0 0 / calc(var(--tri-depth) * 6%)) inset,var(--btn-shadow);transition-property:color,background-color,border-color,box-shadow;transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);--size: calc(var(--tri-size-field, .25rem) * 10);--btn-bg: var(--btn-color, var(--tri-toolbar-bg));--btn-fg: var(--tri-content);--btn-p: 1rem;--btn-border: color-mix( in oklab, var(--btn-bg), #000 calc(var(--tri-depth) * 5%) );--btn-shadow: 0 3px 2px -2px color-mix( in oklab, var(--btn-bg) calc(var(--tri-depth) * 30%), #0000 ), 0 4px 3px -2px color-mix( in oklab, var(--btn-bg) calc(var(--tri-depth) * 30%), #0000 )}@media(hover:hover){.btn.svelte-sgoebi:hover{--btn-bg: color-mix( in oklab, var(--btn-color, var(--tri-toolbar-bg)), #000 7% )}}.btn.svelte-sgoebi:focus-visible{isolation:isolate;outline-width:2px;outline-style:solid}.btn.svelte-sgoebi:active:not(.active){--btn-bg: color-mix( in oklab, var(--btn-color, var(--tri-toolbar-bg)), #000 5% );--btn-border: color-mix( in oklab, var(--btn-color, var(--tri-toolbar-bg)), #000 7% );--btn-shadow: 0 0 0 0 oklch(0% 0 0 / 0), 0 0 0 0 oklch(0% 0 0 / 0);translate:0 .5px}.btn.active.svelte-sgoebi{--btn-bg: color-mix( in oklab, var(--btn-color, var(--tri-toolbar-bg)), #000 7% )}.btn.svelte-sgoebi:disabled,.btn[disabled].svelte-sgoebi{pointer-events:none;--btn-border: #0000;--btn-fg: color-mix(in oklch, var(--tri-content) 20%, #0000)}.btn.svelte-sgoebi:disabled:not(.ghost):not(.outline),.btn[disabled].svelte-sgoebi:not(.ghost):not(.outline){background-color:color-mix(in oklab,var(--tri-content) 10%,transparent);box-shadow:none}.circle.svelte-sgoebi{width:var(--size);height:var(--size);border-radius:3.40282e38px;padding-inline:0}.square.svelte-sgoebi{width:var(--size);height:var(--size);padding-inline:0}.ghost.svelte-sgoebi{--btn-bg: transparent;--btn-border: transparent;--btn-fg: var(--btn-color-text, var(--btn-color, var(--tri-content)));box-shadow:none;text-shadow:none}@media(hover:hover){.ghost.svelte-sgoebi:hover{--btn-bg: color-mix(in oklab, var(--tri-content) 10%, transparent)}}.ghost.svelte-sgoebi:active:not(.active),.ghost.active.svelte-sgoebi{--btn-bg: color-mix(in oklab, var(--tri-content) 10%, transparent);--btn-border: transparent}.outline.svelte-sgoebi:not(:hover):not(:active):not(:focus-visible):not(.active):not(:disabled):not([disabled]){--btn-bg: transparent;--btn-fg: var(--btn-color-text, var(--btn-color, var(--tri-content)));--btn-border: var(--btn-color, var(--tri-content));box-shadow:none;text-shadow:none}.select-wrapper.svelte-1hwvamm{display:inline-flex;width:clamp(3rem,20rem,100%);max-width:100%}.native-select.svelte-1hwvamm{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;pointer-events:none}.select.svelte-1hwvamm{border:var(--tri-border) solid var(--input-color);appearance:none;background-color:var(--tri-input-bg);vertical-align:middle;width:100%;height:var(--size);touch-action:manipulation;white-space:nowrap;box-shadow:0 1px color-mix(in oklab,var(--input-color) calc(var(--tri-depth) * 10%),#0000) inset,0 -1px oklch(100% 0 0 / calc(var(--tri-depth) * .1)) inset;--input-color: color-mix(in oklab, var(--tri-content) 20%, #0000);--size: calc(var(--tri-size-field, .25rem) * 10);background-image:linear-gradient(45deg,#0000 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,#0000 50%);background-position:calc(100% - 20px) calc(1px + 50%),calc(100% - 16.1px) calc(1px + 50%);background-repeat:no-repeat;background-size:4px 4px,4px 4px;border-start-start-radius:var(--join-ss, var(--tri-radius-buttons));border-start-end-radius:var(--join-se, var(--tri-radius-buttons));border-end-end-radius:var(--join-ee, var(--tri-radius-buttons));border-end-start-radius:var(--join-es, var(--tri-radius-buttons));align-items:center;gap:.375rem;padding-inline:.75rem 1.75rem;font-size:.875rem;display:inline-flex;position:relative;cursor:pointer;color:inherit;text-align:start}.select-label.svelte-1hwvamm{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-label.placeholder.svelte-1hwvamm{color:color-mix(in oklab,var(--tri-content) 55%,transparent)}.select.svelte-1hwvamm:hover:not(:disabled){--input-color: color-mix(in oklab, var(--tri-content) 40%, #0000)}.select.svelte-1hwvamm:focus-visible,.select.open.svelte-1hwvamm{--input-color: var(--tri-content);box-shadow:0 1px color-mix(in oklab,var(--input-color) calc(var(--tri-depth) * 10%),#0000);outline:2px solid var(--input-color);outline-offset:2px;isolation:isolate;z-index:1}.select.svelte-1hwvamm:is(:where(.svelte-1hwvamm):disabled,[disabled]:where(.svelte-1hwvamm)){cursor:not-allowed;border-color:var(--tri-panel-bg);background-color:var(--tri-panel-bg);color:color-mix(in oklab,var(--tri-content) 40%,transparent)}.ghost.svelte-1hwvamm{box-shadow:none;background-color:#0000;border-color:#0000;transition:background-color .2s}.ghost.svelte-1hwvamm:hover:not(:disabled){background-color:color-mix(in oklab,var(--tri-content) 8%,transparent)}.ghost.svelte-1hwvamm:focus-visible,.ghost.open.svelte-1hwvamm{background-color:var(--tri-input-bg);color:var(--tri-content)}.listbox.svelte-1hwvamm{position:fixed;inset:auto;margin:0;padding:.1875rem;border:var(--tri-border) solid color-mix(in oklab,var(--tri-content) 20%,#0000);background-color:var(--tri-input-bg);color:var(--tri-content);border-radius:var(--tri-radius-buttons);box-shadow:0 8px 24px oklch(0 0 0 / calc(.12 + var(--tri-depth) * .06));max-height:16rem;overflow-y:auto;min-width:8rem;z-index:1}.listbox.svelte-1hwvamm:not(:popover-open){display:none}.option.svelte-1hwvamm{padding:.25rem .5rem;border-radius:calc(var(--tri-radius-buttons) * .6);cursor:pointer;font-size:.8125rem;line-height:1.3;white-space:nowrap;color:inherit}.option.active.svelte-1hwvamm{background-color:color-mix(in oklab,var(--tri-content) 12%,#0000)}.option.selected.svelte-1hwvamm{background-color:color-mix(in oklab,var(--tri-color-primary) 90%,#0000);color:var(--tri-color-primary-content)}.option.selected.active.svelte-1hwvamm{background-color:var(--tri-color-primary)}.option[aria-disabled=true].svelte-1hwvamm{opacity:.5;cursor:not-allowed;color:color-mix(in oklab,var(--tri-content) 55%,transparent)}\n","bundled"),i=function(e,t){return function(e,{target:t,anchor:n,props:r={},events:i,context:l,intro:o=!0,transformError:a}){!function(){if(void 0===Mt){Mt=window,Ot=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Dt=E(t,"firstChild").get,Lt=E(t,"nextSibling").get,T(e)&&(e[re]=void 0,e[ne]=null,e[ie]=void 0,e.__e=void 0),T(n)&&(n[le]=void 0)}}();var s=void 0,u=function(e){dt.ensure();const t=qt(64|K,e);return(e={})=>new Promise(n=>{e.outro?on(t,()=>{rn(t),n(void 0)}):(rn(t),n(void 0))})}(()=>{var o=n??t.appendChild(Pt());!function(e,t,n,r){new Re(e,{pending:()=>{}},n,r)}(o,0,t=>{if(Ce({}),l&&(ke.c=l),i&&(r.$$events=i),he&&rr(t,null),s=e(t,r)||{},he&&(mn.nodes.end=ve,null===ve||8!==ve.nodeType||"]"!==ve.data))throw fe(),de;Ee()},a);var u=/* @__PURE__ */new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=Fn(r);for(const e of[t,document]){var l=sr.get(e);void 0===l&&(l=/* @__PURE__ */new Map,sr.set(e,l));var o=l.get(r);void 0===o?(e.addEventListener(r,er,{passive:i}),l.set(r,1)):l.set(r,o+1)}}}};return d(S(Kn)),Zn.add(d),()=>{for(var e of u)for(const n of[t,document]){var r=sr.get(n),i=r.get(e);0==--i?(n.removeEventListener(e,er),r.delete(e),0===r.size&&sr.delete(n)):r.set(e,i)}Zn.delete(d),o!==n&&o.parentNode?.removeChild(o)}});return ur.set(s,u),s}(e,t)}(Oi,{target:e,context:/* @__PURE__ */new Map([[Qr,{context:t}]])});return()=>{(function(e){const t=ur.get(e);t?(ur.delete(e),t(void 0)):Promise.resolve()})(i),r(),n()}}}});export{Pi as ImageDownloadPlugin,di as buildImageDownloadFilename,gi as exportCompositeCanvas,bi as exportCurrentWorld,pi as exportSingleImage,fi as getCanvasImageChoices,ci as getImageHost,mi as getVisibleCanvasesForDownload,b as isCrossOriginImageFailure,hi as resolveCompositeCanvasSizeOptions,vi as resolveSingleImageSizeOptions,_i as resolveWorldSizeOptions};
|