poe-svelte-ui-lib 0.1.0 → 0.2.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.
@@ -1,1451 +0,0 @@
1
- import { onMount as Dt } from "svelte";
2
- const Mt = "5";
3
- typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(Mt);
4
- const Bt = 1, Ft = 4, Kt = 8, Lt = 16, jt = 2, y = Symbol(), Ut = "http://www.w3.org/1999/xhtml", Je = !1;
5
- var qt = Array.isArray, Yt = Array.prototype.indexOf, Qe = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, Ht = Object.getOwnPropertyDescriptors, Vt = Object.prototype, Gt = Array.prototype, lt = Object.getPrototypeOf;
6
- function se(e) {
7
- return typeof e == "function";
8
- }
9
- function Wt() {
10
- var e, t, n = new Promise((r, l) => {
11
- e = r, t = l;
12
- });
13
- return { promise: n, resolve: e, reject: t };
14
- }
15
- const C = 2, ft = 4, zt = 8, _e = 16, V = 32, de = 64, st = 128, O = 256, Ee = 512, g = 1024, A = 2048, Q = 4096, H = 8192, X = 16384, at = 32768, Ce = 65536, Xe = 1 << 17, Zt = 1 << 18, je = 1 << 19, ut = 1 << 20, Be = 1 << 21, Ue = 1 << 22, z = 1 << 23, oe = Symbol("$state"), ot = Symbol("legacy props"), Jt = Symbol(""), qe = new class extends Error {
16
- name = "StaleReactionError";
17
- message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
18
- }();
19
- function Qt() {
20
- throw new Error("https://svelte.dev/e/await_outside_boundary");
21
- }
22
- function Xt() {
23
- throw new Error("https://svelte.dev/e/async_derived_orphan");
24
- }
25
- function $t() {
26
- throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
27
- }
28
- function en(e) {
29
- throw new Error("https://svelte.dev/e/props_invalid_value");
30
- }
31
- function tn() {
32
- throw new Error("https://svelte.dev/e/state_descriptors_fixed");
33
- }
34
- function nn() {
35
- throw new Error("https://svelte.dev/e/state_prototype_fixed");
36
- }
37
- function rn() {
38
- throw new Error("https://svelte.dev/e/state_unsafe_mutation");
39
- }
40
- function ct(e) {
41
- return e === this.v;
42
- }
43
- function ln(e, t) {
44
- return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
45
- }
46
- function fn(e) {
47
- return !ln(e, this.v);
48
- }
49
- let sn = !1, K = null;
50
- function xe(e) {
51
- K = e;
52
- }
53
- function an(e, t = !1, n) {
54
- K = {
55
- p: K,
56
- c: null,
57
- e: null,
58
- s: e,
59
- x: null,
60
- l: null
61
- };
62
- }
63
- function un(e) {
64
- var t = (
65
- /** @type {ComponentContext} */
66
- K
67
- ), n = t.e;
68
- if (n !== null) {
69
- t.e = null;
70
- for (var r of n)
71
- Sn(r);
72
- }
73
- return K = t.p, /** @type {T} */
74
- {};
75
- }
76
- function vt() {
77
- return !0;
78
- }
79
- const on = /* @__PURE__ */ new WeakMap();
80
- function cn(e) {
81
- var t = h;
82
- if (t === null)
83
- return d.f |= z, e;
84
- if ((t.f & at) === 0) {
85
- if ((t.f & st) === 0)
86
- throw !t.parent && e instanceof Error && _t(e), e;
87
- t.b.error(e);
88
- } else
89
- Ye(e, t);
90
- }
91
- function Ye(e, t) {
92
- for (; t !== null; ) {
93
- if ((t.f & st) !== 0)
94
- try {
95
- t.b.error(e);
96
- return;
97
- } catch {
98
- }
99
- t = t.parent;
100
- }
101
- throw e instanceof Error && _t(e), e;
102
- }
103
- function _t(e) {
104
- const t = on.get(e);
105
- t && (Qe(e, "message", {
106
- value: t.message
107
- }), Qe(e, "stack", {
108
- value: t.stack
109
- }));
110
- }
111
- function vn() {
112
- for (var e = (
113
- /** @type {Effect} */
114
- h.b
115
- ); e !== null && !e.has_pending_snippet(); )
116
- e = e.parent;
117
- return e === null && Qt(), e;
118
- }
119
- // @__NO_SIDE_EFFECTS__
120
- function Ne(e) {
121
- var t = C | A, n = d !== null && (d.f & C) !== 0 ? (
122
- /** @type {Derived} */
123
- d
124
- ) : null;
125
- return h === null || n !== null && (n.f & O) !== 0 ? t |= O : h.f |= je, {
126
- ctx: K,
127
- deps: null,
128
- effects: null,
129
- equals: ct,
130
- f: t,
131
- fn: e,
132
- reactions: null,
133
- rv: 0,
134
- v: (
135
- /** @type {V} */
136
- y
137
- ),
138
- wv: 0,
139
- parent: n ?? h,
140
- ac: null
141
- };
142
- }
143
- // @__NO_SIDE_EFFECTS__
144
- function _n(e, t) {
145
- let n = (
146
- /** @type {Effect | null} */
147
- h
148
- );
149
- n === null && Xt();
150
- var r = (
151
- /** @type {Boundary} */
152
- n.b
153
- ), l = (
154
- /** @type {Promise<V>} */
155
- /** @type {unknown} */
156
- void 0
157
- ), i = wt(
158
- /** @type {V} */
159
- y
160
- ), s = null, u = !d;
161
- return Tn(() => {
162
- try {
163
- var f = e();
164
- } catch (v) {
165
- f = Promise.reject(v);
166
- }
167
- var a = () => f;
168
- l = s?.then(a, a) ?? Promise.resolve(f), s = l;
169
- var o = (
170
- /** @type {Batch} */
171
- T
172
- ), c = r.pending;
173
- u && (r.update_pending_count(1), c || o.increment());
174
- const _ = (v, p = void 0) => {
175
- s = null, c || o.activate(), p ? p !== qe && (i.f |= z, Ke(i, p)) : ((i.f & z) !== 0 && (i.f ^= z), Ke(i, v)), u && (r.update_pending_count(-1), c || o.decrement()), pt();
176
- };
177
- if (l.then(_, (v) => _(null, v || "unknown")), o)
178
- return () => {
179
- queueMicrotask(() => o.neuter());
180
- };
181
- }), new Promise((f) => {
182
- function a(o) {
183
- function c() {
184
- o === l ? f(i) : a(l);
185
- }
186
- o.then(c, c);
187
- }
188
- a(l);
189
- });
190
- }
191
- // @__NO_SIDE_EFFECTS__
192
- function dn(e) {
193
- const t = /* @__PURE__ */ Ne(e);
194
- return At(t), t;
195
- }
196
- // @__NO_SIDE_EFFECTS__
197
- function hn(e) {
198
- const t = /* @__PURE__ */ Ne(e);
199
- return t.equals = fn, t;
200
- }
201
- function dt(e) {
202
- var t = e.effects;
203
- if (t !== null) {
204
- e.effects = null;
205
- for (var n = 0; n < t.length; n += 1)
206
- pe(
207
- /** @type {Effect} */
208
- t[n]
209
- );
210
- }
211
- }
212
- function pn(e) {
213
- for (var t = e.parent; t !== null; ) {
214
- if ((t.f & C) === 0)
215
- return (
216
- /** @type {Effect} */
217
- t
218
- );
219
- t = t.parent;
220
- }
221
- return null;
222
- }
223
- function He(e) {
224
- var t, n = h;
225
- Se(pn(e));
226
- try {
227
- dt(e), t = Ot(e);
228
- } finally {
229
- Se(n);
230
- }
231
- return t;
232
- }
233
- function ht(e) {
234
- var t = He(e);
235
- if (e.equals(t) || (e.v = t, e.wv = Ct()), !ie)
236
- if (ne !== null)
237
- ne.set(e, e.v);
238
- else {
239
- var n = (q || (e.f & O) !== 0) && e.deps !== null ? Q : g;
240
- b(e, n);
241
- }
242
- }
243
- function wn(e, t, n) {
244
- const r = Ne;
245
- if (t.length === 0) {
246
- n(e.map(r));
247
- return;
248
- }
249
- var l = T, i = (
250
- /** @type {Effect} */
251
- h
252
- ), s = mn(), u = vn();
253
- Promise.all(t.map((f) => /* @__PURE__ */ _n(f))).then((f) => {
254
- l?.activate(), s();
255
- try {
256
- n([...e.map(r), ...f]);
257
- } catch (a) {
258
- (i.f & X) === 0 && Ye(a, i);
259
- }
260
- l?.deactivate(), pt();
261
- }).catch((f) => {
262
- u.error(f);
263
- });
264
- }
265
- function mn() {
266
- var e = h, t = d, n = K;
267
- return function() {
268
- Se(e), re(t), xe(n);
269
- };
270
- }
271
- function pt() {
272
- Se(null), re(null), xe(null);
273
- }
274
- const me = /* @__PURE__ */ new Set();
275
- let T = null, ne = null;
276
- let ue = [], ke = null, Fe = !1;
277
- class Ve {
278
- /**
279
- * The current values of any sources that are updated in this batch
280
- * They keys of this map are identical to `this.#previous`
281
- * @type {Map<Source, any>}
282
- */
283
- #a = /* @__PURE__ */ new Map();
284
- /**
285
- * The values of any sources that are updated in this batch _before_ those updates took place.
286
- * They keys of this map are identical to `this.#current`
287
- * @type {Map<Source, any>}
288
- */
289
- #l = /* @__PURE__ */ new Map();
290
- /**
291
- * When the batch is committed (and the DOM is updated), we need to remove old branches
292
- * and append new ones by calling the functions added inside (if/each/key/etc) blocks
293
- * @type {Set<() => void>}
294
- */
295
- #f = /* @__PURE__ */ new Set();
296
- /**
297
- * The number of async effects that are currently in flight
298
- */
299
- #t = 0;
300
- /**
301
- * A deferred that resolves when the batch is committed, used with `settled()`
302
- * TODO replace with Promise.withResolvers once supported widely enough
303
- * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
304
- */
305
- #u = null;
306
- /**
307
- * True if an async effect inside this batch resolved and
308
- * its parent branch was already deleted
309
- */
310
- #o = !1;
311
- /**
312
- * Async effects (created inside `async_derived`) encountered during processing.
313
- * These run after the rest of the batch has updated, since they should
314
- * always have the latest values
315
- * @type {Effect[]}
316
- */
317
- #r = [];
318
- /**
319
- * The same as `#async_effects`, but for effects inside a newly-created
320
- * `<svelte:boundary>` — these do not prevent the batch from committing
321
- * @type {Effect[]}
322
- */
323
- #s = [];
324
- /**
325
- * Template effects and `$effect.pre` effects, which run when
326
- * a batch is committed
327
- * @type {Effect[]}
328
- */
329
- #n = [];
330
- /**
331
- * The same as `#render_effects`, but for `$effect` (which runs after)
332
- * @type {Effect[]}
333
- */
334
- #e = [];
335
- /**
336
- * Block effects, which may need to re-run on subsequent flushes
337
- * in order to update internal sources (e.g. each block items)
338
- * @type {Effect[]}
339
- */
340
- #i = [];
341
- /**
342
- * A set of branches that still exist, but will be destroyed when this batch
343
- * is committed — we skip over these during `process`
344
- * @type {Set<Effect>}
345
- */
346
- skipped_effects = /* @__PURE__ */ new Set();
347
- /**
348
- *
349
- * @param {Effect[]} root_effects
350
- */
351
- #v(t) {
352
- ue = [];
353
- var n = null;
354
- if (me.size > 1) {
355
- n = /* @__PURE__ */ new Map(), ne = /* @__PURE__ */ new Map();
356
- for (const [i, s] of this.#a)
357
- n.set(i, { v: i.v, wv: i.wv }), i.v = s;
358
- for (const i of me)
359
- if (i !== this)
360
- for (const [s, u] of i.#l)
361
- n.has(s) || (n.set(s, { v: s.v, wv: s.wv }), s.v = u);
362
- }
363
- for (const i of t)
364
- this.#_(i);
365
- if (this.#r.length === 0 && this.#t === 0) {
366
- var r = this.#n, l = this.#e;
367
- this.#n = [], this.#e = [], this.#i = [], this.#c(), $e(r), $e(l), this.#u?.resolve();
368
- } else {
369
- for (const i of this.#n) b(i, g);
370
- for (const i of this.#e) b(i, g);
371
- for (const i of this.#i) b(i, g);
372
- }
373
- if (n) {
374
- for (const [i, { v: s, wv: u }] of n)
375
- i.wv <= u && (i.v = s);
376
- ne = null;
377
- }
378
- for (const i of this.#r)
379
- ce(i);
380
- for (const i of this.#s)
381
- ce(i);
382
- this.#r = [], this.#s = [];
383
- }
384
- /**
385
- * Traverse the effect tree, executing effects or stashing
386
- * them for later execution as appropriate
387
- * @param {Effect} root
388
- */
389
- #_(t) {
390
- t.f ^= g;
391
- for (var n = t.first; n !== null; ) {
392
- var r = n.f, l = (r & (V | de)) !== 0, i = l && (r & g) !== 0, s = i || (r & H) !== 0 || this.skipped_effects.has(n);
393
- if (!s && n.fn !== null) {
394
- if (l)
395
- n.f ^= g;
396
- else if ((r & ft) !== 0)
397
- this.#e.push(n);
398
- else if (Oe(n))
399
- if ((r & Ue) !== 0) {
400
- var u = n.b?.pending ? this.#s : this.#r;
401
- u.push(n);
402
- } else
403
- (n.f & _e) !== 0 && this.#i.push(n), ce(n);
404
- var f = n.first;
405
- if (f !== null) {
406
- n = f;
407
- continue;
408
- }
409
- }
410
- var a = n.parent;
411
- for (n = n.next; n === null && a !== null; )
412
- n = a.next, a = a.parent;
413
- }
414
- }
415
- /**
416
- * Associate a change to a given source with the current
417
- * batch, noting its previous and current values
418
- * @param {Source} source
419
- * @param {any} value
420
- */
421
- capture(t, n) {
422
- this.#l.has(t) || this.#l.set(t, n), this.#a.set(t, t.v);
423
- }
424
- activate() {
425
- T = this;
426
- }
427
- deactivate() {
428
- T = null;
429
- }
430
- neuter() {
431
- this.#o = !0;
432
- }
433
- flush() {
434
- ue.length > 0 ? this.flush_effects() : this.#c(), T === this && (this.#t === 0 && me.delete(this), T = null);
435
- }
436
- flush_effects() {
437
- var t = te;
438
- Fe = !0;
439
- try {
440
- var n = 0;
441
- for (et(!0); ue.length > 0; )
442
- n++ > 1e3 && yn(), this.#v(ue), Z.clear();
443
- } finally {
444
- Fe = !1, et(t), ke = null;
445
- }
446
- }
447
- /**
448
- * Append and remove branches to/from the DOM
449
- */
450
- #c() {
451
- if (!this.#o)
452
- for (const t of this.#f)
453
- t();
454
- this.#f.clear();
455
- }
456
- increment() {
457
- this.#t += 1;
458
- }
459
- decrement() {
460
- if (this.#t -= 1, this.#t === 0) {
461
- for (const t of this.#n)
462
- b(t, A), Y(t);
463
- for (const t of this.#e)
464
- b(t, A), Y(t);
465
- for (const t of this.#i)
466
- b(t, A), Y(t);
467
- this.#n = [], this.#e = [], this.flush();
468
- }
469
- }
470
- /** @param {() => void} fn */
471
- add_callback(t) {
472
- this.#f.add(t);
473
- }
474
- settled() {
475
- return (this.#u ??= Wt()).promise;
476
- }
477
- static ensure() {
478
- if (T === null) {
479
- const t = T = new Ve();
480
- me.add(T), queueMicrotask(() => {
481
- T === t && t.flush();
482
- });
483
- }
484
- return T;
485
- }
486
- }
487
- function yn() {
488
- try {
489
- $t();
490
- } catch (e) {
491
- if (ke !== null)
492
- Ye(e, ke);
493
- else
494
- throw e;
495
- }
496
- }
497
- function $e(e) {
498
- var t = e.length;
499
- if (t !== 0) {
500
- for (var n = 0; n < t; n++) {
501
- var r = e[n];
502
- if ((r.f & (X | H)) === 0 && Oe(r)) {
503
- var l = Te;
504
- if (ce(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? xt(r) : r.fn = null), Te > l && (r.f & ut) !== 0)
505
- break;
506
- }
507
- }
508
- for (; n < t; n += 1)
509
- Y(e[n]);
510
- }
511
- }
512
- function Y(e) {
513
- for (var t = ke = e; t.parent !== null; ) {
514
- t = t.parent;
515
- var n = t.f;
516
- if (Fe && t === h && (n & _e) !== 0)
517
- return;
518
- if ((n & (de | V)) !== 0) {
519
- if ((n & g) === 0) return;
520
- t.f ^= g;
521
- }
522
- }
523
- ue.push(t);
524
- }
525
- const Z = /* @__PURE__ */ new Map();
526
- function wt(e, t) {
527
- var n = {
528
- f: 0,
529
- // TODO ideally we could skip this altogether, but it causes type errors
530
- v: e,
531
- reactions: null,
532
- equals: ct,
533
- rv: 0,
534
- wv: 0
535
- };
536
- return n;
537
- }
538
- // @__NO_SIDE_EFFECTS__
539
- function j(e, t) {
540
- const n = wt(e);
541
- return At(n), n;
542
- }
543
- function M(e, t, n = !1) {
544
- d !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
545
- // to ensure we error if state is set inside an inspect effect
546
- (!I || (d.f & Xe) !== 0) && vt() && (d.f & (C | _e | Ue | Xe)) !== 0 && !F?.includes(e) && rn();
547
- let r = n ? $(t) : t;
548
- return Ke(e, r);
549
- }
550
- function Ke(e, t) {
551
- if (!e.equals(t)) {
552
- var n = e.v;
553
- ie ? Z.set(e, t) : Z.set(e, n), e.v = t, Ve.ensure().capture(e, n), (e.f & C) !== 0 && ((e.f & A) !== 0 && He(
554
- /** @type {Derived} */
555
- e
556
- ), b(e, (e.f & O) === 0 ? g : Q)), e.wv = Ct(), mt(e, A), h !== null && (h.f & g) !== 0 && (h.f & (V | de)) === 0 && (N === null ? Pn([e]) : N.push(e));
557
- }
558
- return t;
559
- }
560
- function Re(e) {
561
- M(e, e.v + 1);
562
- }
563
- function mt(e, t) {
564
- var n = e.reactions;
565
- if (n !== null)
566
- for (var r = n.length, l = 0; l < r; l++) {
567
- var i = n[l], s = i.f;
568
- (s & A) === 0 && (b(i, t), (s & (g | O)) !== 0 && ((s & C) !== 0 ? mt(
569
- /** @type {Derived} */
570
- i,
571
- Q
572
- ) : Y(
573
- /** @type {Effect} */
574
- i
575
- )));
576
- }
577
- }
578
- function $(e) {
579
- if (typeof e != "object" || e === null || oe in e)
580
- return e;
581
- const t = lt(e);
582
- if (t !== Vt && t !== Gt)
583
- return e;
584
- var n = /* @__PURE__ */ new Map(), r = qt(e), l = /* @__PURE__ */ j(0), i = J, s = (u) => {
585
- if (J === i)
586
- return u();
587
- var f = d, a = J;
588
- re(null), nt(i);
589
- var o = u();
590
- return re(f), nt(a), o;
591
- };
592
- return r && n.set("length", /* @__PURE__ */ j(
593
- /** @type {any[]} */
594
- e.length
595
- )), new Proxy(
596
- /** @type {any} */
597
- e,
598
- {
599
- defineProperty(u, f, a) {
600
- (!("value" in a) || a.configurable === !1 || a.enumerable === !1 || a.writable === !1) && tn();
601
- var o = n.get(f);
602
- return o === void 0 ? o = s(() => {
603
- var c = /* @__PURE__ */ j(a.value);
604
- return n.set(f, c), c;
605
- }) : M(o, a.value, !0), !0;
606
- },
607
- deleteProperty(u, f) {
608
- var a = n.get(f);
609
- if (a === void 0) {
610
- if (f in u) {
611
- const _ = s(() => /* @__PURE__ */ j(y));
612
- n.set(f, _), Re(l);
613
- }
614
- } else {
615
- if (r && typeof f == "string") {
616
- var o = (
617
- /** @type {Source<number>} */
618
- n.get("length")
619
- ), c = Number(f);
620
- Number.isInteger(c) && c < o.v && M(o, c);
621
- }
622
- M(a, y), Re(l);
623
- }
624
- return !0;
625
- },
626
- get(u, f, a) {
627
- if (f === oe)
628
- return e;
629
- var o = n.get(f), c = f in u;
630
- if (o === void 0 && (!c || ee(u, f)?.writable) && (o = s(() => {
631
- var v = $(c ? u[f] : y), p = /* @__PURE__ */ j(v);
632
- return p;
633
- }), n.set(f, o)), o !== void 0) {
634
- var _ = B(o);
635
- return _ === y ? void 0 : _;
636
- }
637
- return Reflect.get(u, f, a);
638
- },
639
- getOwnPropertyDescriptor(u, f) {
640
- var a = Reflect.getOwnPropertyDescriptor(u, f);
641
- if (a && "value" in a) {
642
- var o = n.get(f);
643
- o && (a.value = B(o));
644
- } else if (a === void 0) {
645
- var c = n.get(f), _ = c?.v;
646
- if (c !== void 0 && _ !== y)
647
- return {
648
- enumerable: !0,
649
- configurable: !0,
650
- value: _,
651
- writable: !0
652
- };
653
- }
654
- return a;
655
- },
656
- has(u, f) {
657
- if (f === oe)
658
- return !0;
659
- var a = n.get(f), o = a !== void 0 && a.v !== y || Reflect.has(u, f);
660
- if (a !== void 0 || h !== null && (!o || ee(u, f)?.writable)) {
661
- a === void 0 && (a = s(() => {
662
- var _ = o ? $(u[f]) : y, v = /* @__PURE__ */ j(_);
663
- return v;
664
- }), n.set(f, a));
665
- var c = B(a);
666
- if (c === y)
667
- return !1;
668
- }
669
- return o;
670
- },
671
- set(u, f, a, o) {
672
- var c = n.get(f), _ = f in u;
673
- if (r && f === "length")
674
- for (var v = a; v < /** @type {Source<number>} */
675
- c.v; v += 1) {
676
- var p = n.get(v + "");
677
- p !== void 0 ? M(p, y) : v in u && (p = s(() => /* @__PURE__ */ j(y)), n.set(v + "", p));
678
- }
679
- if (c === void 0)
680
- (!_ || ee(u, f)?.writable) && (c = s(() => /* @__PURE__ */ j(void 0)), M(c, $(a)), n.set(f, c));
681
- else {
682
- _ = c.v !== y;
683
- var E = s(() => $(a));
684
- M(c, E);
685
- }
686
- var k = Reflect.getOwnPropertyDescriptor(u, f);
687
- if (k?.set && k.set.call(o, a), !_) {
688
- if (r && typeof f == "string") {
689
- var P = (
690
- /** @type {Source<number>} */
691
- n.get("length")
692
- ), w = Number(f);
693
- Number.isInteger(w) && w >= P.v && M(P, w + 1);
694
- }
695
- Re(l);
696
- }
697
- return !0;
698
- },
699
- ownKeys(u) {
700
- B(l);
701
- var f = Reflect.ownKeys(u).filter((c) => {
702
- var _ = n.get(c);
703
- return _ === void 0 || _.v !== y;
704
- });
705
- for (var [a, o] of n)
706
- o.v !== y && !(a in u) && f.push(a);
707
- return f;
708
- },
709
- setPrototypeOf() {
710
- nn();
711
- }
712
- }
713
- );
714
- }
715
- var gn, bn, En;
716
- function Ge(e = "") {
717
- return document.createTextNode(e);
718
- }
719
- // @__NO_SIDE_EFFECTS__
720
- function We(e) {
721
- return bn.call(e);
722
- }
723
- // @__NO_SIDE_EFFECTS__
724
- function ze(e) {
725
- return En.call(e);
726
- }
727
- function W(e, t) {
728
- return /* @__PURE__ */ We(e);
729
- }
730
- function xn(e, t) {
731
- {
732
- var n = (
733
- /** @type {DocumentFragment} */
734
- /* @__PURE__ */ We(
735
- /** @type {Node} */
736
- e
737
- )
738
- );
739
- return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ze(n) : n;
740
- }
741
- }
742
- function Ie(e, t = 1, n = !1) {
743
- let r = e;
744
- for (; t--; )
745
- r = /** @type {TemplateNode} */
746
- /* @__PURE__ */ ze(r);
747
- return r;
748
- }
749
- function yt() {
750
- return !1;
751
- }
752
- function kn(e, t) {
753
- var n = t.last;
754
- n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
755
- }
756
- function he(e, t, n, r = !0) {
757
- var l = h;
758
- l !== null && (l.f & H) !== 0 && (e |= H);
759
- var i = {
760
- ctx: K,
761
- deps: null,
762
- nodes_start: null,
763
- nodes_end: null,
764
- f: e | A,
765
- first: null,
766
- fn: t,
767
- last: null,
768
- next: null,
769
- parent: l,
770
- b: l && l.b,
771
- prev: null,
772
- teardown: null,
773
- transitions: null,
774
- wv: 0,
775
- ac: null
776
- };
777
- if (n)
778
- try {
779
- ce(i), i.f |= at;
780
- } catch (f) {
781
- throw pe(i), f;
782
- }
783
- else t !== null && Y(i);
784
- var s = n && i.deps === null && i.first === null && i.nodes_start === null && i.teardown === null && (i.f & je) === 0;
785
- if (!s && r && (l !== null && kn(i, l), d !== null && (d.f & C) !== 0)) {
786
- var u = (
787
- /** @type {Derived} */
788
- d
789
- );
790
- (u.effects ??= []).push(i);
791
- }
792
- return i;
793
- }
794
- function Sn(e) {
795
- return he(ft | ut, e, !1);
796
- }
797
- function Tn(e) {
798
- return he(Ue | je, e, !0);
799
- }
800
- function ye(e, t = [], n = []) {
801
- wn(t, n, (r) => {
802
- he(zt, () => e(...r.map(B)), !0);
803
- });
804
- }
805
- function gt(e, t = 0) {
806
- var n = he(_e | t, e, !0);
807
- return n;
808
- }
809
- function Le(e, t = !0) {
810
- return he(V, e, !0, t);
811
- }
812
- function bt(e) {
813
- var t = e.teardown;
814
- if (t !== null) {
815
- const n = ie, r = d;
816
- tt(!0), re(null);
817
- try {
818
- t.call(null);
819
- } finally {
820
- tt(n), re(r);
821
- }
822
- }
823
- }
824
- function Et(e, t = !1) {
825
- var n = e.first;
826
- for (e.first = e.last = null; n !== null; ) {
827
- n.ac?.abort(qe);
828
- var r = n.next;
829
- (n.f & de) !== 0 ? n.parent = null : pe(n, t), n = r;
830
- }
831
- }
832
- function An(e) {
833
- for (var t = e.first; t !== null; ) {
834
- var n = t.next;
835
- (t.f & V) === 0 && pe(t), t = n;
836
- }
837
- }
838
- function pe(e, t = !0) {
839
- var n = !1;
840
- (t || (e.f & Zt) !== 0) && e.nodes_start !== null && e.nodes_end !== null && (Cn(
841
- e.nodes_start,
842
- /** @type {TemplateNode} */
843
- e.nodes_end
844
- ), n = !0), Et(e, t && !n), Ae(e, 0), b(e, X);
845
- var r = e.transitions;
846
- if (r !== null)
847
- for (const i of r)
848
- i.stop();
849
- bt(e);
850
- var l = e.parent;
851
- l !== null && l.first !== null && xt(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes_start = e.nodes_end = e.ac = null;
852
- }
853
- function Cn(e, t) {
854
- for (; e !== null; ) {
855
- var n = e === t ? null : (
856
- /** @type {TemplateNode} */
857
- /* @__PURE__ */ ze(e)
858
- );
859
- e.remove(), e = n;
860
- }
861
- }
862
- function xt(e) {
863
- var t = e.parent, n = e.prev, r = e.next;
864
- n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
865
- }
866
- function kt(e, t) {
867
- var n = [];
868
- St(e, n, !0), Nn(n, () => {
869
- pe(e), t && t();
870
- });
871
- }
872
- function Nn(e, t) {
873
- var n = e.length;
874
- if (n > 0) {
875
- var r = () => --n || t();
876
- for (var l of e)
877
- l.out(r);
878
- } else
879
- t();
880
- }
881
- function St(e, t, n) {
882
- if ((e.f & H) === 0) {
883
- if (e.f ^= H, e.transitions !== null)
884
- for (const s of e.transitions)
885
- (s.is_global || n) && t.push(s);
886
- for (var r = e.first; r !== null; ) {
887
- var l = r.next, i = (r.f & Ce) !== 0 || (r.f & V) !== 0;
888
- St(r, t, i ? n : !1), r = l;
889
- }
890
- }
891
- }
892
- function On(e) {
893
- Tt(e, !0);
894
- }
895
- function Tt(e, t) {
896
- if ((e.f & H) !== 0) {
897
- e.f ^= H, (e.f & g) === 0 && (b(e, A), Y(e));
898
- for (var n = e.first; n !== null; ) {
899
- var r = n.next, l = (n.f & Ce) !== 0 || (n.f & V) !== 0;
900
- Tt(n, l ? t : !1), n = r;
901
- }
902
- if (e.transitions !== null)
903
- for (const i of e.transitions)
904
- (i.is_global || t) && i.in();
905
- }
906
- }
907
- let te = !1;
908
- function et(e) {
909
- te = e;
910
- }
911
- let ie = !1;
912
- function tt(e) {
913
- ie = e;
914
- }
915
- let d = null, I = !1;
916
- function re(e) {
917
- d = e;
918
- }
919
- let h = null;
920
- function Se(e) {
921
- h = e;
922
- }
923
- let F = null;
924
- function At(e) {
925
- d !== null && (F === null ? F = [e] : F.push(e));
926
- }
927
- let x = null, S = 0, N = null;
928
- function Pn(e) {
929
- N = e;
930
- }
931
- let Te = 1, ve = 0, J = ve;
932
- function nt(e) {
933
- J = e;
934
- }
935
- let q = !1;
936
- function Ct() {
937
- return ++Te;
938
- }
939
- function Oe(e) {
940
- var t = e.f;
941
- if ((t & A) !== 0)
942
- return !0;
943
- if ((t & Q) !== 0) {
944
- var n = e.deps, r = (t & O) !== 0;
945
- if (n !== null) {
946
- var l, i, s = (t & Ee) !== 0, u = r && h !== null && !q, f = n.length;
947
- if ((s || u) && (h === null || (h.f & X) === 0)) {
948
- var a = (
949
- /** @type {Derived} */
950
- e
951
- ), o = a.parent;
952
- for (l = 0; l < f; l++)
953
- i = n[l], (s || !i?.reactions?.includes(a)) && (i.reactions ??= []).push(a);
954
- s && (a.f ^= Ee), u && o !== null && (o.f & O) === 0 && (a.f ^= O);
955
- }
956
- for (l = 0; l < f; l++)
957
- if (i = n[l], Oe(
958
- /** @type {Derived} */
959
- i
960
- ) && ht(
961
- /** @type {Derived} */
962
- i
963
- ), i.wv > e.wv)
964
- return !0;
965
- }
966
- (!r || h !== null && !q) && b(e, g);
967
- }
968
- return !1;
969
- }
970
- function Nt(e, t, n = !0) {
971
- var r = e.reactions;
972
- if (r !== null && !F?.includes(e))
973
- for (var l = 0; l < r.length; l++) {
974
- var i = r[l];
975
- (i.f & C) !== 0 ? Nt(
976
- /** @type {Derived} */
977
- i,
978
- t,
979
- !1
980
- ) : t === i && (n ? b(i, A) : (i.f & g) !== 0 && b(i, Q), Y(
981
- /** @type {Effect} */
982
- i
983
- ));
984
- }
985
- }
986
- function Ot(e) {
987
- var t = x, n = S, r = N, l = d, i = q, s = F, u = K, f = I, a = J, o = e.f;
988
- x = /** @type {null | Value[]} */
989
- null, S = 0, N = null, q = (o & O) !== 0 && (I || !te || d === null), d = (o & (V | de)) === 0 ? e : null, F = null, xe(e.ctx), I = !1, J = ++ve, e.ac !== null && (e.ac.abort(qe), e.ac = null);
990
- try {
991
- e.f |= Be;
992
- var c = (
993
- /** @type {Function} */
994
- (0, e.fn)()
995
- ), _ = e.deps;
996
- if (x !== null) {
997
- var v;
998
- if (Ae(e, S), _ !== null && S > 0)
999
- for (_.length = S + x.length, v = 0; v < x.length; v++)
1000
- _[S + v] = x[v];
1001
- else
1002
- e.deps = _ = x;
1003
- if (!q || // Deriveds that already have reactions can cleanup, so we still add them as reactions
1004
- (o & C) !== 0 && /** @type {import('#client').Derived} */
1005
- e.reactions !== null)
1006
- for (v = S; v < _.length; v++)
1007
- (_[v].reactions ??= []).push(e);
1008
- } else _ !== null && S < _.length && (Ae(e, S), _.length = S);
1009
- if (vt() && N !== null && !I && _ !== null && (e.f & (C | Q | A)) === 0)
1010
- for (v = 0; v < /** @type {Source[]} */
1011
- N.length; v++)
1012
- Nt(
1013
- N[v],
1014
- /** @type {Effect} */
1015
- e
1016
- );
1017
- return l !== null && l !== e && (ve++, N !== null && (r === null ? r = N : r.push(.../** @type {Source[]} */
1018
- N))), (e.f & z) !== 0 && (e.f ^= z), c;
1019
- } catch (p) {
1020
- return cn(p);
1021
- } finally {
1022
- e.f ^= Be, x = t, S = n, N = r, d = l, q = i, F = s, xe(u), I = f, J = a;
1023
- }
1024
- }
1025
- function Rn(e, t) {
1026
- let n = t.reactions;
1027
- if (n !== null) {
1028
- var r = Yt.call(n, e);
1029
- if (r !== -1) {
1030
- var l = n.length - 1;
1031
- l === 0 ? n = t.reactions = null : (n[r] = n[l], n.pop());
1032
- }
1033
- }
1034
- n === null && (t.f & C) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1035
- // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1036
- // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1037
- (x === null || !x.includes(t)) && (b(t, Q), (t.f & (O | Ee)) === 0 && (t.f ^= Ee), dt(
1038
- /** @type {Derived} **/
1039
- t
1040
- ), Ae(
1041
- /** @type {Derived} **/
1042
- t,
1043
- 0
1044
- ));
1045
- }
1046
- function Ae(e, t) {
1047
- var n = e.deps;
1048
- if (n !== null)
1049
- for (var r = t; r < n.length; r++)
1050
- Rn(e, n[r]);
1051
- }
1052
- function ce(e) {
1053
- var t = e.f;
1054
- if ((t & X) === 0) {
1055
- b(e, g);
1056
- var n = h, r = te;
1057
- h = e, te = !0;
1058
- try {
1059
- (t & _e) !== 0 ? An(e) : Et(e), bt(e);
1060
- var l = Ot(e);
1061
- e.teardown = typeof l == "function" ? l : null, e.wv = Te;
1062
- var i;
1063
- Je && sn && (e.f & A) !== 0 && e.deps;
1064
- } finally {
1065
- te = r, h = n;
1066
- }
1067
- }
1068
- }
1069
- function B(e) {
1070
- var t = e.f, n = (t & C) !== 0;
1071
- if (d !== null && !I) {
1072
- var r = h !== null && (h.f & X) !== 0;
1073
- if (!r && !F?.includes(e)) {
1074
- var l = d.deps;
1075
- if ((d.f & Be) !== 0)
1076
- e.rv < ve && (e.rv = ve, x === null && l !== null && l[S] === e ? S++ : x === null ? x = [e] : (!q || !x.includes(e)) && x.push(e));
1077
- else {
1078
- (d.deps ??= []).push(e);
1079
- var i = e.reactions;
1080
- i === null ? e.reactions = [d] : i.includes(d) || i.push(d);
1081
- }
1082
- }
1083
- } else if (n && /** @type {Derived} */
1084
- e.deps === null && /** @type {Derived} */
1085
- e.effects === null) {
1086
- var s = (
1087
- /** @type {Derived} */
1088
- e
1089
- ), u = s.parent;
1090
- u !== null && (u.f & O) === 0 && (s.f ^= O);
1091
- }
1092
- if (ie) {
1093
- if (Z.has(e))
1094
- return Z.get(e);
1095
- if (n) {
1096
- s = /** @type {Derived} */
1097
- e;
1098
- var f = s.v;
1099
- return ((s.f & g) !== 0 || Pt(s)) && (f = He(s)), Z.set(s, f), f;
1100
- }
1101
- } else if (n) {
1102
- if (s = /** @type {Derived} */
1103
- e, ne?.has(s))
1104
- return ne.get(s);
1105
- Oe(s) && ht(s);
1106
- }
1107
- if ((e.f & z) !== 0)
1108
- throw e.v;
1109
- return e.v;
1110
- }
1111
- function Pt(e) {
1112
- if (e.v === y) return !0;
1113
- if (e.deps === null) return !1;
1114
- for (const t of e.deps)
1115
- if (Z.has(t) || (t.f & C) !== 0 && Pt(
1116
- /** @type {Derived} */
1117
- t
1118
- ))
1119
- return !0;
1120
- return !1;
1121
- }
1122
- function In(e) {
1123
- var t = I;
1124
- try {
1125
- return I = !0, e();
1126
- } finally {
1127
- I = t;
1128
- }
1129
- }
1130
- const Dn = -7169;
1131
- function b(e, t) {
1132
- e.f = e.f & Dn | t;
1133
- }
1134
- const Mn = /* @__PURE__ */ new Set(), Bn = /* @__PURE__ */ new Set();
1135
- function Fn(e) {
1136
- for (var t = 0; t < e.length; t++)
1137
- Mn.add(e[t]);
1138
- for (var n of Bn)
1139
- n(e);
1140
- }
1141
- function Kn(e) {
1142
- var t = document.createElement("template");
1143
- return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
1144
- }
1145
- function Rt(e, t) {
1146
- var n = (
1147
- /** @type {Effect} */
1148
- h
1149
- );
1150
- n.nodes_start === null && (n.nodes_start = e, n.nodes_end = t);
1151
- }
1152
- // @__NO_SIDE_EFFECTS__
1153
- function Pe(e, t) {
1154
- var n = (t & jt) !== 0, r, l = !e.startsWith("<!>");
1155
- return () => {
1156
- r === void 0 && (r = Kn(l ? e : "<!>" + e), r = /** @type {Node} */
1157
- /* @__PURE__ */ We(r));
1158
- var i = (
1159
- /** @type {TemplateNode} */
1160
- n || gn ? document.importNode(r, !0) : r.cloneNode(!0)
1161
- );
1162
- return Rt(i, i), i;
1163
- };
1164
- }
1165
- function Ln() {
1166
- var e = document.createDocumentFragment(), t = document.createComment(""), n = Ge();
1167
- return e.append(t, n), Rt(t, n), e;
1168
- }
1169
- function ae(e, t) {
1170
- e !== null && e.before(
1171
- /** @type {Node} */
1172
- t
1173
- );
1174
- }
1175
- function De(e, t) {
1176
- var n = t == null ? "" : typeof t == "object" ? t + "" : t;
1177
- n !== (e.__t ??= e.nodeValue) && (e.__t = n, e.nodeValue = n + "");
1178
- }
1179
- function ge(e, t, n = !1) {
1180
- var r = e, l = null, i = null, s = y, u = n ? Ce : 0, f = !1;
1181
- const a = (v, p = !0) => {
1182
- f = !0, _(p, v);
1183
- };
1184
- var o = null;
1185
- function c() {
1186
- o !== null && (o.lastChild.remove(), r.before(o), o = null);
1187
- var v = s ? l : i, p = s ? i : l;
1188
- v && On(v), p && kt(p, () => {
1189
- s ? i = null : l = null;
1190
- });
1191
- }
1192
- const _ = (v, p) => {
1193
- if (s !== (s = v)) {
1194
- var E = yt(), k = r;
1195
- if (E && (o = document.createDocumentFragment(), o.append(k = Ge())), s ? l ??= p && Le(() => p(k)) : i ??= p && Le(() => p(k)), E) {
1196
- var P = (
1197
- /** @type {Batch} */
1198
- T
1199
- ), w = s ? l : i, D = s ? i : l;
1200
- w && P.skipped_effects.delete(w), D && P.skipped_effects.add(D), P.add_callback(c);
1201
- } else
1202
- c();
1203
- }
1204
- };
1205
- gt(() => {
1206
- f = !1, t(a), f || _(null, null);
1207
- }, u);
1208
- }
1209
- function jn(e, t, n) {
1210
- var r = e, l, i, s = null, u = null;
1211
- function f() {
1212
- i && (kt(i), i = null), s && (s.lastChild.remove(), r.before(s), s = null), i = u, u = null;
1213
- }
1214
- gt(() => {
1215
- if (l !== (l = t())) {
1216
- var a = yt();
1217
- if (l) {
1218
- var o = r;
1219
- a && (s = document.createDocumentFragment(), s.append(o = Ge())), u = Le(() => n(o, l));
1220
- }
1221
- a ? T.add_callback(f) : f();
1222
- }
1223
- }, Ce);
1224
- }
1225
- function Un(e, t, n) {
1226
- var r = e == null ? "" : "" + e;
1227
- return r === "" ? null : r;
1228
- }
1229
- function Me(e, t, n, r, l, i) {
1230
- var s = e.__className;
1231
- if (s !== n || s === void 0) {
1232
- var u = Un(n);
1233
- u == null ? e.removeAttribute("class") : e.className = u, e.__className = n;
1234
- }
1235
- return i;
1236
- }
1237
- const qn = Symbol("is custom element"), Yn = Symbol("is html");
1238
- function rt(e, t, n, r) {
1239
- var l = Hn(e);
1240
- l[t] !== (l[t] = n) && (t === "loading" && (e[Jt] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && Vn(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
1241
- }
1242
- function Hn(e) {
1243
- return (
1244
- /** @type {Record<string | symbol, unknown>} **/
1245
- // @ts-expect-error
1246
- e.__attributes ??= {
1247
- [qn]: e.nodeName.includes("-"),
1248
- [Yn]: e.namespaceURI === Ut
1249
- }
1250
- );
1251
- }
1252
- var it = /* @__PURE__ */ new Map();
1253
- function Vn(e) {
1254
- var t = it.get(e.nodeName);
1255
- if (t) return t;
1256
- it.set(e.nodeName, t = []);
1257
- for (var n, r = e, l = Element.prototype; l !== r; ) {
1258
- n = Ht(r);
1259
- for (var i in n)
1260
- n[i].set && t.push(i);
1261
- r = lt(r);
1262
- }
1263
- return t;
1264
- }
1265
- let be = !1;
1266
- function Gn(e) {
1267
- var t = be;
1268
- try {
1269
- return be = !1, [e(), be];
1270
- } finally {
1271
- be = t;
1272
- }
1273
- }
1274
- const Wn = {
1275
- get(e, t) {
1276
- let n = e.props.length;
1277
- for (; n--; ) {
1278
- let r = e.props[n];
1279
- if (se(r) && (r = r()), typeof r == "object" && r !== null && t in r) return r[t];
1280
- }
1281
- },
1282
- set(e, t, n) {
1283
- let r = e.props.length;
1284
- for (; r--; ) {
1285
- let l = e.props[r];
1286
- se(l) && (l = l());
1287
- const i = ee(l, t);
1288
- if (i && i.set)
1289
- return i.set(n), !0;
1290
- }
1291
- return !1;
1292
- },
1293
- getOwnPropertyDescriptor(e, t) {
1294
- let n = e.props.length;
1295
- for (; n--; ) {
1296
- let r = e.props[n];
1297
- if (se(r) && (r = r()), typeof r == "object" && r !== null && t in r) {
1298
- const l = ee(r, t);
1299
- return l && !l.configurable && (l.configurable = !0), l;
1300
- }
1301
- }
1302
- },
1303
- has(e, t) {
1304
- if (t === oe || t === ot) return !1;
1305
- for (let n of e.props)
1306
- if (se(n) && (n = n()), n != null && t in n) return !0;
1307
- return !1;
1308
- },
1309
- ownKeys(e) {
1310
- const t = [];
1311
- for (let n of e.props)
1312
- if (se(n) && (n = n()), !!n) {
1313
- for (const r in n)
1314
- t.includes(r) || t.push(r);
1315
- for (const r of Object.getOwnPropertySymbols(n))
1316
- t.includes(r) || t.push(r);
1317
- }
1318
- return t;
1319
- }
1320
- };
1321
- function zn(...e) {
1322
- return new Proxy({ props: e }, Wn);
1323
- }
1324
- function U(e, t, n, r) {
1325
- var l = (n & Kt) !== 0, i = (n & Lt) !== 0, s = (
1326
- /** @type {V} */
1327
- r
1328
- ), u = !0, f = () => (u && (u = !1, s = i ? In(
1329
- /** @type {() => V} */
1330
- r
1331
- ) : (
1332
- /** @type {V} */
1333
- r
1334
- )), s), a;
1335
- if (l) {
1336
- var o = oe in e || ot in e;
1337
- a = ee(e, t)?.set ?? (o && t in e ? (w) => e[t] = w : void 0);
1338
- }
1339
- var c, _ = !1;
1340
- l ? [c, _] = Gn(() => (
1341
- /** @type {V} */
1342
- e[t]
1343
- )) : c = /** @type {V} */
1344
- e[t], c === void 0 && r !== void 0 && (c = f(), a && (en(), a(c)));
1345
- var v;
1346
- if (v = () => {
1347
- var w = (
1348
- /** @type {V} */
1349
- e[t]
1350
- );
1351
- return w === void 0 ? f() : (u = !0, w);
1352
- }, (n & Ft) === 0)
1353
- return v;
1354
- if (a) {
1355
- var p = e.$$legacy;
1356
- return function(w, D) {
1357
- return arguments.length > 0 ? ((!D || p || _) && a(D ? v() : w), w) : v();
1358
- };
1359
- }
1360
- var E = !1, k = ((n & Bt) !== 0 ? Ne : hn)(() => (E = !1, v()));
1361
- l && B(k);
1362
- var P = (
1363
- /** @type {Effect} */
1364
- h
1365
- );
1366
- return function(w, D) {
1367
- if (arguments.length > 0) {
1368
- const we = D ? B(k) : l ? $(w) : w;
1369
- return M(k, we), E = !0, s !== void 0 && (s = we), w;
1370
- }
1371
- return ie && E || (P.f & X) !== 0 ? k.v : B(k);
1372
- };
1373
- }
1374
- const Zn = (e, t, n, r, l) => {
1375
- t() || !n.onClick || n.onClick(r().value ?? "", l());
1376
- };
1377
- var Jn = /* @__PURE__ */ Pe("<h5> </h5>"), Qn = /* @__PURE__ */ Pe('<div class="text-xs opacity-70"> </div>'), Xn = /* @__PURE__ */ Pe('<div class="flex-1"> <!></div>'), $n = /* @__PURE__ */ Pe('<div><!> <div class="relative flex w-full grow items-center"><button><span class="flex flex-row items-center justify-center gap-4"><!> <!></span></button></div></div>');
1378
- function nr(e, t) {
1379
- an(t, !0);
1380
- let n = U(t, "id", 19, () => ({ value: crypto.randomUUID(), name: "" })), r = U(t, "wrapperClass", 3, ""), l = U(t, "label", 19, () => ({ name: "", class: "" })), i = U(t, "name", 3, ""), s = U(t, "componentClass", 3, ""), u = U(t, "icon", 19, () => ({ component: null, properties: {} })), f = U(t, "disabled", 3, !1), a = U(t, "eventHandler", 19, () => ({ Action: "none" }));
1381
- const o = (m) => {
1382
- if (f() || !t.keyBind || !t.onKeyBind) return;
1383
- const R = m.key === t.keyBind.key, L = t.keyBind.ctrlKey === void 0 || m.ctrlKey === t.keyBind.ctrlKey, le = t.keyBind.shiftKey === void 0 || m.shiftKey === t.keyBind.shiftKey, fe = t.keyBind.altKey === void 0 || m.altKey === t.keyBind.altKey, G = t.keyBind.metaKey === void 0 || m.metaKey === t.keyBind.metaKey;
1384
- R && L && le && fe && G && (m.preventDefault(), t.onKeyBind(n().value ?? "", a()));
1385
- };
1386
- Dt(() => (t.keyBind && window.addEventListener("keydown", o), () => {
1387
- t.keyBind && window.removeEventListener("keydown", o);
1388
- }));
1389
- var c = $n(), _ = W(c);
1390
- {
1391
- var v = (m) => {
1392
- var R = Jn(), L = W(R);
1393
- ye(() => {
1394
- Me(R, 1, `w-full px-4 text-center ${l().class}`), De(L, l().name);
1395
- }), ae(m, R);
1396
- };
1397
- ge(_, (m) => {
1398
- l().name && m(v);
1399
- });
1400
- }
1401
- var p = Ie(_, 2), E = W(p);
1402
- E.__click = [Zn, f, t, n, a];
1403
- var k = W(E), P = W(k);
1404
- {
1405
- var w = (m) => {
1406
- var R = Ln();
1407
- const L = /* @__PURE__ */ dn(() => u()?.component);
1408
- var le = xn(R);
1409
- jn(le, () => B(L), (fe, G) => {
1410
- G(fe, zn(() => u()?.properties));
1411
- }), ae(m, R);
1412
- };
1413
- ge(P, (m) => {
1414
- u()?.component && m(w);
1415
- });
1416
- }
1417
- var D = Ie(P, 2);
1418
- {
1419
- var we = (m) => {
1420
- var R = Xn(), L = W(R), le = Ie(L);
1421
- {
1422
- var fe = (G) => {
1423
- var Ze = Qn(), It = W(Ze);
1424
- ye(() => De(It, `(${t.keyBind.ctrlKey ? "Ctrl+" : ""}
1425
- ${t.keyBind.shiftKey ? "Shift+" : ""}
1426
- ${t.keyBind.altKey ? "Alt+" : ""}
1427
- ${t.keyBind.key ?? ""})`)), ae(G, Ze);
1428
- };
1429
- ge(le, (G) => {
1430
- t.keyBind && G(fe);
1431
- });
1432
- }
1433
- ye(() => De(L, `${i() ?? ""} `)), ae(m, R);
1434
- };
1435
- ge(D, (m) => {
1436
- i() && m(we);
1437
- });
1438
- }
1439
- ye(() => {
1440
- Me(c, 1, `relative flex w-full flex-col items-center ${r()}`), rt(E, "id", n().value), Me(E, 1, `
1441
- relative m-0 inline-block w-full items-center rounded-2xl border border-[var(--border-color)] bg-[var(--bg-color)]
1442
- px-2 py-1 font-semibold transition duration-200 select-none
1443
- ${f() ? "cursor-not-allowed opacity-50" : "cursor-pointer hover:shadow-md active:scale-95"}
1444
- ${s()}
1445
- `), E.disabled = f(), rt(E, "aria-label", i() || l().name);
1446
- }), ae(e, c), un();
1447
- }
1448
- Fn(["click"]);
1449
- export {
1450
- nr as Button
1451
- };