triiiceratops 0.10.0 → 0.10.1

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,19 +1,19 @@
1
- var Et = Object.defineProperty;
2
- var dt = (a) => {
1
+ var Dt = Object.defineProperty;
2
+ var pt = (a) => {
3
3
  throw TypeError(a);
4
4
  };
5
- var Dt = (a, t, s) => t in a ? Et(a, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[t] = s;
6
- var gt = (a, t, s) => Dt(a, typeof t != "symbol" ? t + "" : t, s), Rt = (a, t, s) => t.has(a) || dt("Cannot " + s);
7
- var n = (a, t, s) => (Rt(a, t, "read from private field"), s ? s.call(a) : t.get(a)), h = (a, t, s) => t.has(a) ? dt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(a) : t.set(a, s);
5
+ var Rt = (a, t, s) => t in a ? Dt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[t] = s;
6
+ var ft = (a, t, s) => Rt(a, typeof t != "symbol" ? t + "" : t, s), Gt = (a, t, s) => t.has(a) || pt("Cannot " + s);
7
+ var n = (a, t, s) => (Gt(a, t, "read from private field"), s ? s.call(a) : t.get(a)), l = (a, t, s) => t.has(a) ? pt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(a) : t.set(a, s);
8
8
  import * as e from "svelte/internal/client";
9
- import * as Gt from "manifesto.js";
9
+ import * as Bt from "manifesto.js";
10
10
  import "svelte/internal/disclose-version";
11
- import { hasContext as Tt, getContext as Bt } from "svelte";
11
+ import { hasContext as Tt, getContext as jt } from "svelte";
12
12
  var E, D;
13
- class jt {
13
+ class Vt {
14
14
  constructor() {
15
- h(this, E, e.state(e.proxy({})));
16
- h(this, D, e.state(e.proxy(/* @__PURE__ */ new Map())));
15
+ l(this, E, e.state(e.proxy({})));
16
+ l(this, D, e.state(e.proxy(/* @__PURE__ */ new Map())));
17
17
  }
18
18
  get manifests() {
19
19
  return e.get(n(this, E));
@@ -54,7 +54,7 @@ class jt {
54
54
  const s = await fetch(t);
55
55
  if (!s.ok)
56
56
  throw new Error(`HTTP error! status: ${s.status}`);
57
- const i = await s.json(), r = Gt.parseManifest(i);
57
+ const i = await s.json(), r = Bt.parseManifest(i);
58
58
  this.manifests[t] = { json: i, manifesto: r, isFetching: !1 };
59
59
  } catch (s) {
60
60
  this.manifests[t] = { error: s.message, isFetching: !1 };
@@ -65,6 +65,9 @@ class jt {
65
65
  const s = this.manifests[t];
66
66
  return s == null ? void 0 : s.manifesto;
67
67
  }
68
+ getManifestEntry(t) {
69
+ return this.manifests[t];
70
+ }
68
71
  async fetchAnnotationList(t) {
69
72
  if (!this.manifests[t])
70
73
  try {
@@ -126,48 +129,49 @@ class jt {
126
129
  }
127
130
  }
128
131
  E = new WeakMap(), D = new WeakMap();
129
- const k = new jt();
130
- var R, G, T, B, j, O, V, F, N, Q, Z, q, z, H, U, K, $, W, J, X, Y, tt, et, st, nt;
131
- class ne {
132
+ const k = new Vt();
133
+ var R, G, B, T, j, V, O, F, Q, Z, z, H, N, U, q, K, $, W, J, X, Y, tt, et, st, nt, at;
134
+ class ae {
132
135
  constructor(t = null, s = null, i = []) {
133
- h(this, R, e.state(null));
134
- h(this, G, e.state(null));
135
- h(this, T, e.state(!1));
136
- h(this, B, e.state(!1));
137
- h(this, j, e.state(!1));
138
- h(this, O, e.state(!1));
139
- h(this, V, e.state(!1));
140
- h(this, F, e.state(!1));
141
- h(this, N, e.state("bottom"));
142
- h(this, Q, e.state(e.proxy(/* @__PURE__ */ new Set())));
143
- h(this, Z, e.state(e.proxy({})));
144
- h(
136
+ l(this, R, e.state(null));
137
+ l(this, G, e.state(null));
138
+ l(this, B, e.state(!1));
139
+ l(this, T, e.state(!1));
140
+ l(this, j, e.state(!1));
141
+ l(this, V, e.state(!1));
142
+ l(this, O, e.state(!1));
143
+ l(this, F, e.state(!1));
144
+ l(this, Q, e.state("bottom"));
145
+ l(this, Z, e.state(e.proxy(/* @__PURE__ */ new Set())));
146
+ l(this, z, e.state(e.proxy({})));
147
+ l(
145
148
  this,
146
- q,
149
+ H,
147
150
  // Gallery State (Lifted for persistence during re-docking)
148
151
  e.state(e.proxy({ x: 20, y: 100 }))
149
152
  );
150
- h(this, z, e.state(e.proxy({ width: 300, height: 400 })));
151
- h(this, H, e.state(!1));
152
- h(this, U, e.state(e.proxy({ x: 0, y: 0 })));
153
- h(this, K, e.state(null));
154
- h(this, $, e.state(null));
155
- gt(this, "eventTarget", null);
156
- h(this, W, e.state(""));
157
- h(this, J, e.state(e.proxy([])));
158
- h(this, X, e.state(!1));
159
- h(this, Y, e.state(!1));
160
- h(this, tt, e.state(e.proxy([])));
161
- h(
153
+ l(this, N, e.state(e.proxy({ width: 300, height: 400 })));
154
+ l(this, U, e.state(!1));
155
+ l(this, q, e.state(e.proxy({ x: 0, y: 0 })));
156
+ l(this, K, e.state(null));
157
+ l(this, $, e.state(null));
158
+ ft(this, "eventTarget", null);
159
+ l(this, W, e.state(""));
160
+ l(this, J, e.state(null));
161
+ l(this, X, e.state(e.proxy([])));
162
+ l(this, Y, e.state(!1));
163
+ l(this, tt, e.state(!1));
164
+ l(this, et, e.state(e.proxy([])));
165
+ l(
162
166
  this,
163
- et,
167
+ st,
164
168
  // ==================== PLUGIN STATE ====================
165
169
  /** Plugin-registered menu buttons */
166
170
  e.state(e.proxy([]))
167
171
  );
168
- h(this, st, e.state(e.proxy([])));
169
- h(this, nt, e.state(null));
170
- gt(this, "pluginEventHandlers", /* @__PURE__ */ new Map());
172
+ l(this, nt, e.state(e.proxy([])));
173
+ l(this, at, e.state(null));
174
+ ft(this, "pluginEventHandlers", /* @__PURE__ */ new Map());
171
175
  this.manifestId = t || null, this.canvasId = s || null, this.manifestId && k.fetchManifest(this.manifestId);
172
176
  for (const r of i)
173
177
  this.registerPlugin(r);
@@ -185,16 +189,16 @@ class ne {
185
189
  e.set(n(this, G), t, !0);
186
190
  }
187
191
  get showAnnotations() {
188
- return e.get(n(this, T));
192
+ return e.get(n(this, B));
189
193
  }
190
194
  set showAnnotations(t) {
191
- e.set(n(this, T), t, !0);
195
+ e.set(n(this, B), t, !0);
192
196
  }
193
197
  get showThumbnailGallery() {
194
- return e.get(n(this, B));
198
+ return e.get(n(this, T));
195
199
  }
196
200
  set showThumbnailGallery(t) {
197
- e.set(n(this, B), t, !0);
201
+ e.set(n(this, T), t, !0);
198
202
  }
199
203
  get isGalleryDockedBottom() {
200
204
  return e.get(n(this, j));
@@ -203,16 +207,16 @@ class ne {
203
207
  e.set(n(this, j), t, !0);
204
208
  }
205
209
  get isGalleryDockedRight() {
206
- return e.get(n(this, O));
210
+ return e.get(n(this, V));
207
211
  }
208
212
  set isGalleryDockedRight(t) {
209
- e.set(n(this, O), t, !0);
213
+ e.set(n(this, V), t, !0);
210
214
  }
211
215
  get isFullScreen() {
212
- return e.get(n(this, V));
216
+ return e.get(n(this, O));
213
217
  }
214
218
  set isFullScreen(t) {
215
- e.set(n(this, V), t, !0);
219
+ e.set(n(this, O), t, !0);
216
220
  }
217
221
  get showMetadataDialog() {
218
222
  return e.get(n(this, F));
@@ -221,22 +225,22 @@ class ne {
221
225
  e.set(n(this, F), t, !0);
222
226
  }
223
227
  get dockSide() {
224
- return e.get(n(this, N));
228
+ return e.get(n(this, Q));
225
229
  }
226
230
  set dockSide(t) {
227
- e.set(n(this, N), t, !0);
231
+ e.set(n(this, Q), t, !0);
228
232
  }
229
233
  get visibleAnnotationIds() {
230
- return e.get(n(this, Q));
234
+ return e.get(n(this, Z));
231
235
  }
232
236
  set visibleAnnotationIds(t) {
233
- e.set(n(this, Q), t, !0);
237
+ e.set(n(this, Z), t, !0);
234
238
  }
235
239
  get config() {
236
- return e.get(n(this, Z));
240
+ return e.get(n(this, z));
237
241
  }
238
242
  set config(t) {
239
- e.set(n(this, Z), t, !0);
243
+ e.set(n(this, z), t, !0);
240
244
  }
241
245
  get showRightMenu() {
242
246
  return this.config.showRightMenu ?? !0;
@@ -248,28 +252,28 @@ class ne {
248
252
  return this.config.showCanvasNav ?? !0;
249
253
  }
250
254
  get galleryPosition() {
251
- return e.get(n(this, q));
255
+ return e.get(n(this, H));
252
256
  }
253
257
  set galleryPosition(t) {
254
- e.set(n(this, q), t, !0);
258
+ e.set(n(this, H), t, !0);
255
259
  }
256
260
  get gallerySize() {
257
- return e.get(n(this, z));
261
+ return e.get(n(this, N));
258
262
  }
259
263
  set gallerySize(t) {
260
- e.set(n(this, z), t, !0);
264
+ e.set(n(this, N), t, !0);
261
265
  }
262
266
  get isGalleryDragging() {
263
- return e.get(n(this, H));
267
+ return e.get(n(this, U));
264
268
  }
265
269
  set isGalleryDragging(t) {
266
- e.set(n(this, H), t, !0);
270
+ e.set(n(this, U), t, !0);
267
271
  }
268
272
  get galleryDragOffset() {
269
- return e.get(n(this, U));
273
+ return e.get(n(this, q));
270
274
  }
271
275
  set galleryDragOffset(t) {
272
- e.set(n(this, U), t, !0);
276
+ e.set(n(this, q), t, !0);
273
277
  }
274
278
  get dragOverSide() {
275
279
  return e.get(n(this, K));
@@ -322,15 +326,11 @@ class ne {
322
326
  get manifest() {
323
327
  return this.manifestId ? k.getManifest(this.manifestId) : null;
324
328
  }
329
+ get manifestEntry() {
330
+ return this.manifestId ? k.getManifestEntry(this.manifestId) : null;
331
+ }
325
332
  get canvases() {
326
- if (!this.manifestId) return [];
327
- const t = k.getCanvases(this.manifestId);
328
- return t.length > 0 && !this.canvasId && setTimeout(
329
- () => {
330
- !this.canvasId && t.length > 0 && (this.canvasId = t[0].id);
331
- },
332
- 0
333
- ), t;
333
+ return this.manifestId ? k.getCanvases(this.manifestId) : [];
334
334
  }
335
335
  get currentCanvasIndex() {
336
336
  return this.canvasId ? this.canvases.findIndex((t) => (t.id || t["@id"] || (t.getCanvasId ? t.getCanvasId() : null) || (t.getId ? t.getId() : null)) === this.canvasId) : this.canvases.length > 0 ? 0 : -1;
@@ -394,32 +394,38 @@ class ne {
394
394
  set searchQuery(t) {
395
395
  e.set(n(this, W), t, !0);
396
396
  }
397
- get searchResults() {
397
+ get pendingSearchQuery() {
398
398
  return e.get(n(this, J));
399
399
  }
400
- set searchResults(t) {
400
+ set pendingSearchQuery(t) {
401
401
  e.set(n(this, J), t, !0);
402
402
  }
403
- get isSearching() {
403
+ get searchResults() {
404
404
  return e.get(n(this, X));
405
405
  }
406
- set isSearching(t) {
406
+ set searchResults(t) {
407
407
  e.set(n(this, X), t, !0);
408
408
  }
409
- get showSearchPanel() {
409
+ get isSearching() {
410
410
  return e.get(n(this, Y));
411
411
  }
412
- set showSearchPanel(t) {
412
+ set isSearching(t) {
413
413
  e.set(n(this, Y), t, !0);
414
414
  }
415
+ get showSearchPanel() {
416
+ return e.get(n(this, tt));
417
+ }
418
+ set showSearchPanel(t) {
419
+ e.set(n(this, tt), t, !0);
420
+ }
415
421
  toggleSearchPanel() {
416
422
  this.showSearchPanel = !this.showSearchPanel, this.showSearchPanel || (this.searchAnnotations = []), this.dispatchStateChange();
417
423
  }
418
424
  get searchAnnotations() {
419
- return e.get(n(this, tt));
425
+ return e.get(n(this, et));
420
426
  }
421
427
  set searchAnnotations(t) {
422
- e.set(n(this, tt), t, !0);
428
+ e.set(n(this, et), t, !0);
423
429
  }
424
430
  get currentCanvasSearchAnnotations() {
425
431
  return this.canvasId ? this.searchAnnotations.filter((t) => t.canvasId === this.canvasId) : [];
@@ -433,29 +439,32 @@ class ne {
433
439
  this.isSearching = !0, this.searchQuery = t, this.searchResults = [];
434
440
  try {
435
441
  const r = this.manifest;
436
- if (!r) throw new Error("No manifest loaded");
442
+ if (!r) {
443
+ console.log("[ViewerState] Manifest not loaded, deferring search:", t), this.pendingSearchQuery = t;
444
+ return;
445
+ }
437
446
  let u = r.getService("http://iiif.io/api/search/1/search") || r.getService("http://iiif.io/api/search/0/search");
438
- if (u || r.__jsonld && r.__jsonld.service && (u = (Array.isArray(r.__jsonld.service) ? r.__jsonld.service : [r.__jsonld.service]).find((l) => l.profile === "http://iiif.io/api/search/1/search" || l.profile === "http://iiif.io/api/search/0/search")), !u) {
447
+ if (u || r.__jsonld && r.__jsonld.service && (u = (Array.isArray(r.__jsonld.service) ? r.__jsonld.service : [r.__jsonld.service]).find((h) => h.profile === "http://iiif.io/api/search/1/search" || h.profile === "http://iiif.io/api/search/0/search")), !u) {
439
448
  console.warn("No IIIF search service found in manifest"), this.isSearching = !1;
440
449
  return;
441
450
  }
442
451
  const A = `${u.id || u["@id"]}?q=${encodeURIComponent(t)}`, c = await fetch(A);
443
452
  if (!c.ok) throw new Error("Search request failed");
444
- const d = await c.json(), w = d.resources || [], _ = [], at = (o) => {
445
- const l = typeof o == "string" ? o : o["@id"] || o.id;
446
- if (!l) return null;
447
- const g = l.split("#xywh=");
453
+ const d = await c.json(), w = d.resources || [], _ = [], it = (o) => {
454
+ const h = typeof o == "string" ? o : o["@id"] || o.id;
455
+ if (!h) return null;
456
+ const g = h.split("#xywh=");
448
457
  if (g.length < 2) return null;
449
458
  const m = g[1].split(",").map(Number);
450
459
  return m.length === 4 ? m : null;
451
460
  };
452
461
  if (d.hits)
453
462
  for (const o of d.hits) {
454
- const l = o.annotations || [], g = /* @__PURE__ */ new Map();
455
- for (const m of l) {
463
+ const h = o.annotations || [], g = /* @__PURE__ */ new Map();
464
+ for (const m of h) {
456
465
  const f = w.find((p) => p["@id"] === m || p.id === m);
457
466
  if (f && f.on) {
458
- const p = typeof f.on == "string" ? f.on : f.on["@id"] || f.on.id, y = p.split("#")[0], S = at(p), L = this.canvases.findIndex((I) => I.id === y);
467
+ const p = typeof f.on == "string" ? f.on : f.on["@id"] || f.on.id, y = p.split("#")[0], S = it(p), L = this.canvases.findIndex((I) => I.id === y);
459
468
  if (L >= 0) {
460
469
  if (!g.has(L)) {
461
470
  const I = this.canvases[L];
@@ -489,7 +498,7 @@ class ne {
489
498
  }
490
499
  else if (w.length > 0)
491
500
  for (const o of w) {
492
- const l = typeof o.on == "string" ? o.on : o.on["@id"] || o.on.id, g = l.split("#")[0], m = at(l), f = this.canvases.findIndex((p) => p.id === g);
501
+ const h = typeof o.on == "string" ? o.on : o.on["@id"] || o.on.id, g = h.split("#")[0], m = it(h), f = this.canvases.findIndex((p) => p.id === g);
493
502
  if (f >= 0) {
494
503
  const p = this.canvases[f];
495
504
  let y = "Canvas " + (f + 1);
@@ -510,17 +519,17 @@ class ne {
510
519
  }
511
520
  }
512
521
  this.searchResults = _;
513
- let ut = 0;
522
+ let gt = 0;
514
523
  this.searchAnnotations = _.flatMap((o) => {
515
- const l = this.canvases[o.canvasIndex];
524
+ const h = this.canvases[o.canvasIndex];
516
525
  return (o.allBounds && o.allBounds.length > 0 ? o.allBounds : o.bounds ? [o.bounds] : []).map((m) => {
517
- const f = `${l.id}#xywh=${m.join(",")}`;
526
+ const f = `${h.id}#xywh=${m.join(",")}`;
518
527
  return {
519
- "@id": `urn:search-hit:${ut++}`,
528
+ "@id": `urn:search-hit:${gt++}`,
520
529
  "@type": "oa:Annotation",
521
530
  motivation: "sc:painting",
522
531
  on: f,
523
- canvasId: l.id,
532
+ canvasId: h.id,
524
533
  resource: { "@type": "cnt:ContentAsText", chars: o.match },
525
534
  // Flag to identify styling in Overlay?
526
535
  // Or just standard rendering.
@@ -536,22 +545,22 @@ class ne {
536
545
  }
537
546
  }
538
547
  get pluginMenuButtons() {
539
- return e.get(n(this, et));
548
+ return e.get(n(this, st));
540
549
  }
541
550
  set pluginMenuButtons(t) {
542
- e.set(n(this, et), t, !0);
551
+ e.set(n(this, st), t, !0);
543
552
  }
544
553
  get pluginPanels() {
545
- return e.get(n(this, st));
554
+ return e.get(n(this, nt));
546
555
  }
547
556
  set pluginPanels(t) {
548
- e.set(n(this, st), t, !0);
557
+ e.set(n(this, nt), t, !0);
549
558
  }
550
559
  get osdViewer() {
551
- return e.get(n(this, nt));
560
+ return e.get(n(this, at));
552
561
  }
553
562
  set osdViewer(t) {
554
- e.set(n(this, nt), t);
563
+ e.set(n(this, at), t);
555
564
  }
556
565
  registerPlugin(t) {
557
566
  const s = t.id || `plugin-${Math.random().toString(36).substr(2, 9)}`;
@@ -607,32 +616,32 @@ class ne {
607
616
  this.pluginMenuButtons = [], this.pluginPanels = [], this.pluginEventHandlers.clear();
608
617
  }
609
618
  }
610
- R = new WeakMap(), G = new WeakMap(), T = new WeakMap(), B = new WeakMap(), j = new WeakMap(), O = new WeakMap(), V = new WeakMap(), F = new WeakMap(), N = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), q = new WeakMap(), z = new WeakMap(), H = new WeakMap(), U = new WeakMap(), K = new WeakMap(), $ = new WeakMap(), W = new WeakMap(), J = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), st = new WeakMap(), nt = new WeakMap();
611
- const ae = "triiiceratops:viewerState";
612
- let pt = Symbol("phosphor-svelte");
619
+ R = new WeakMap(), G = new WeakMap(), B = new WeakMap(), T = new WeakMap(), j = new WeakMap(), V = new WeakMap(), O = new WeakMap(), F = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), z = new WeakMap(), H = new WeakMap(), N = new WeakMap(), U = new WeakMap(), q = new WeakMap(), K = new WeakMap(), $ = new WeakMap(), W = new WeakMap(), J = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), st = new WeakMap(), nt = new WeakMap(), at = new WeakMap();
620
+ const ie = "triiiceratops:viewerState";
621
+ let vt = Symbol("phosphor-svelte");
613
622
  function Ot() {
614
- return Tt(pt) ? Bt(pt) : {};
623
+ return Tt(vt) ? jt(vt) : {};
615
624
  }
616
- const Vt = "en", ft = (
625
+ const Ft = "en", dt = (
617
626
  /** @type {const} */
618
627
  ["en", "de"]
619
- ), mt = "PARAGLIDE_LOCALE", Ft = 3456e4, yt = [
628
+ ), yt = "PARAGLIDE_LOCALE", Qt = 3456e4, wt = [
620
629
  "cookie",
621
630
  "globalVariable",
622
631
  "baseLocale"
623
632
  ];
624
633
  globalThis.__paraglide = {};
625
- let ht, vt = !1, wt = () => {
634
+ let ct, mt = !1, St = () => {
626
635
  let a;
627
- for (const t of yt) {
636
+ for (const t of wt) {
628
637
  if (t === "cookie")
629
- a = qt();
638
+ a = Nt();
630
639
  else if (t === "baseLocale")
631
- a = Vt;
632
- else if (t === "globalVariable" && ht !== void 0)
633
- a = ht;
634
- else if (bt(t) && ct.has(t)) {
635
- const s = ct.get(t);
640
+ a = Ft;
641
+ else if (t === "globalVariable" && ct !== void 0)
642
+ a = ct;
643
+ else if (At(t) && ut.has(t)) {
644
+ const s = ut.get(t);
636
645
  if (s) {
637
646
  const i = s.getLocale();
638
647
  if (i instanceof Promise)
@@ -641,39 +650,39 @@ let ht, vt = !1, wt = () => {
641
650
  }
642
651
  }
643
652
  if (a !== void 0) {
644
- const s = Zt(a);
645
- return vt || (ht = s, vt = !0, St(s, { reload: !1 })), s;
653
+ const s = Ht(a);
654
+ return mt || (ct = s, mt = !0, bt(s, { reload: !1 })), s;
646
655
  }
647
656
  }
648
657
  throw new Error("No locale found. Read the docs https://inlang.com/m/gerre34r/library-inlang-paraglideJs/errors#no-locale-found");
649
658
  };
650
- const Nt = (a) => {
659
+ const Zt = (a) => {
651
660
  window.location.reload();
652
661
  };
653
- let St = (a, t) => {
662
+ let bt = (a, t) => {
654
663
  const s = {
655
664
  reload: !0,
656
665
  ...t
657
666
  };
658
667
  let i;
659
668
  try {
660
- i = wt();
669
+ i = St();
661
670
  } catch {
662
671
  }
663
672
  const r = [];
664
- for (const v of yt)
673
+ for (const v of wt)
665
674
  if (v === "globalVariable")
666
- ht = a;
675
+ ct = a;
667
676
  else if (v === "cookie") {
668
677
  if (typeof document > "u" || typeof window > "u")
669
678
  continue;
670
- const A = `${mt}=${a}; path=/; max-age=${Ft}`;
679
+ const A = `${yt}=${a}; path=/; max-age=${Qt}`;
671
680
  document.cookie = A;
672
681
  } else {
673
682
  if (v === "baseLocale")
674
683
  continue;
675
- if (bt(v) && ct.has(v)) {
676
- const A = ct.get(v);
684
+ if (At(v) && ut.has(v)) {
685
+ const A = ut.get(v);
677
686
  if (A) {
678
687
  let c = A.setLocale(a);
679
688
  c instanceof Promise && (c = c.catch((d) => {
@@ -685,7 +694,7 @@ let St = (a, t) => {
685
694
  }
686
695
  }
687
696
  const u = () => {
688
- s.reload && window.location && a !== i && Nt();
697
+ s.reload && window.location && a !== i && Zt();
689
698
  };
690
699
  if (r.length)
691
700
  return Promise.all(r).then(() => {
@@ -693,58 +702,58 @@ let St = (a, t) => {
693
702
  });
694
703
  u();
695
704
  };
696
- const ie = (a) => {
697
- St = /** @type {SetLocaleFn} */
705
+ const re = (a) => {
706
+ bt = /** @type {SetLocaleFn} */
698
707
  a;
699
708
  };
700
- function Qt(a) {
701
- return typeof a != "string" ? !1 : a ? ft.some((t) => t.toLowerCase() === a.toLowerCase()) : !1;
709
+ function zt(a) {
710
+ return typeof a != "string" ? !1 : a ? dt.some((t) => t.toLowerCase() === a.toLowerCase()) : !1;
702
711
  }
703
- function Zt(a) {
712
+ function Ht(a) {
704
713
  if (typeof a != "string")
705
714
  throw new Error(`Invalid locale: ${a}. Expected a string.`);
706
- const t = a.toLowerCase(), s = ft.find((i) => i.toLowerCase() === t);
715
+ const t = a.toLowerCase(), s = dt.find((i) => i.toLowerCase() === t);
707
716
  if (!s)
708
- throw new Error(`Invalid locale: ${a}. Expected one of: ${ft.join(", ")}`);
717
+ throw new Error(`Invalid locale: ${a}. Expected one of: ${dt.join(", ")}`);
709
718
  return s;
710
719
  }
711
- function qt() {
720
+ function Nt() {
712
721
  if (typeof document > "u" || !document.cookie)
713
722
  return;
714
- const a = document.cookie.match(new RegExp(`(^| )${mt}=([^;]+)`)), t = a == null ? void 0 : a[2];
715
- if (Qt(t))
723
+ const a = document.cookie.match(new RegExp(`(^| )${yt}=([^;]+)`)), t = a == null ? void 0 : a[2];
724
+ if (zt(t))
716
725
  return t;
717
726
  }
718
- const ct = /* @__PURE__ */ new Map();
719
- function bt(a) {
727
+ const ut = /* @__PURE__ */ new Map();
728
+ function At(a) {
720
729
  return typeof a == "string" && /^custom-[A-Za-z0-9_-]+$/.test(a);
721
730
  }
722
- const zt = (
731
+ const Ut = (
723
732
  /** @type {(inputs: {}) => LocalizedString} */
724
733
  () => (
725
734
  /** @type {LocalizedString} */
726
735
  "Close"
727
736
  )
728
- ), Ht = (
737
+ ), qt = (
729
738
  /** @type {(inputs: {}) => LocalizedString} */
730
739
  () => (
731
740
  /** @type {LocalizedString} */
732
741
  "Schließen"
733
742
  )
734
- ), re = /* @__NO_SIDE_EFFECTS__ */ (a = {}, t = {}) => (t.locale ?? wt()) === "en" ? zt() : Ht();
735
- var Ut = e.from_svg('<path d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"></path>'), Kt = e.from_svg('<path d="M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z" opacity="0.2"></path><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>', 1), $t = e.from_svg('<path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>'), Wt = e.from_svg('<path d="M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"></path>'), Jt = e.from_svg('<path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>'), Xt = e.from_svg('<path d="M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"></path>'), Yt = e.from_svg('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');
736
- function oe(a, t) {
743
+ ), oe = /* @__NO_SIDE_EFFECTS__ */ (a = {}, t = {}) => (t.locale ?? St()) === "en" ? Ut() : qt();
744
+ var Kt = e.from_svg('<path d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"></path>'), $t = e.from_svg('<path d="M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z" opacity="0.2"></path><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>', 1), Wt = e.from_svg('<path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>'), Jt = e.from_svg('<path d="M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"></path>'), Xt = e.from_svg('<path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>'), Yt = e.from_svg('<path d="M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"></path>'), te = e.from_svg('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');
745
+ function le(a, t) {
737
746
  e.push(t, !0);
738
747
  const s = Ot();
739
748
  let i = e.rest_props(t, ["$$slots", "$$events", "$$legacy", "children"]), r = e.derived(() => t.weight ?? s.weight ?? "regular"), u = e.derived(() => t.color ?? s.color ?? "currentColor"), v = e.derived(() => t.size ?? s.size ?? "1em"), A = e.derived(() => t.mirrored ?? s.mirrored ?? !1);
740
- function c(l) {
741
- let { weight: g, color: m, size: f, mirrored: p, ...y } = l;
749
+ function c(h) {
750
+ let { weight: g, color: m, size: f, mirrored: p, ...y } = h;
742
751
  return y;
743
752
  }
744
- var d = Yt();
753
+ var d = te();
745
754
  e.attribute_effect(
746
755
  d,
747
- (l, g) => ({
756
+ (h, g) => ({
748
757
  xmlns: "http://www.w3.org/2000/svg",
749
758
  role: "img",
750
759
  width: e.get(v),
@@ -752,89 +761,89 @@ function oe(a, t) {
752
761
  fill: e.get(u),
753
762
  transform: e.get(A) ? "scale(-1, 1)" : void 0,
754
763
  viewBox: "0 0 256 256",
755
- ...l,
764
+ ...h,
756
765
  ...g
757
766
  }),
758
767
  [() => c(s), () => c(i)]
759
768
  );
760
769
  var w = e.child(d);
761
770
  {
762
- var _ = (l) => {
771
+ var _ = (h) => {
763
772
  var g = e.comment(), m = e.first_child(g);
764
- e.snippet(m, () => t.children), e.append(l, g);
773
+ e.snippet(m, () => t.children), e.append(h, g);
765
774
  };
766
- e.if(w, (l) => {
767
- t.children && l(_);
775
+ e.if(w, (h) => {
776
+ t.children && h(_);
768
777
  });
769
778
  }
770
- var at = e.sibling(w, 2);
779
+ var it = e.sibling(w, 2);
771
780
  {
772
- var ut = (l) => {
773
- var g = Ut();
774
- e.append(l, g);
775
- }, o = (l) => {
781
+ var gt = (h) => {
782
+ var g = Kt();
783
+ e.append(h, g);
784
+ }, o = (h) => {
776
785
  var g = e.comment(), m = e.first_child(g);
777
786
  {
778
787
  var f = (y) => {
779
- var S = Kt();
788
+ var S = $t();
780
789
  e.next(), e.append(y, S);
781
790
  }, p = (y) => {
782
791
  var S = e.comment(), L = e.first_child(S);
783
792
  {
784
793
  var I = (b) => {
785
- var it = $t();
786
- e.append(b, it);
794
+ var rt = Wt();
795
+ e.append(b, rt);
787
796
  }, x = (b) => {
788
- var it = e.comment(), At = e.first_child(it);
797
+ var rt = e.comment(), It = e.first_child(rt);
789
798
  {
790
- var It = (M) => {
791
- var rt = Wt();
792
- e.append(M, rt);
793
- }, _t = (M) => {
794
- var rt = e.comment(), Lt = e.first_child(rt);
799
+ var _t = (M) => {
800
+ var ot = Jt();
801
+ e.append(M, ot);
802
+ }, Lt = (M) => {
803
+ var ot = e.comment(), xt = e.first_child(ot);
795
804
  {
796
- var xt = (C) => {
797
- var ot = Jt();
798
- e.append(C, ot);
799
- }, Mt = (C) => {
800
- var ot = e.comment(), Ct = e.first_child(ot);
805
+ var Mt = (C) => {
806
+ var lt = Xt();
807
+ e.append(C, lt);
808
+ }, Ct = (C) => {
809
+ var lt = e.comment(), Pt = e.first_child(lt);
801
810
  {
802
- var Pt = (P) => {
803
- var lt = Xt();
804
- e.append(P, lt);
805
- }, kt = (P) => {
806
- var lt = e.text();
807
- lt.nodeValue = (console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'), ""), e.append(P, lt);
811
+ var kt = (P) => {
812
+ var ht = Yt();
813
+ e.append(P, ht);
814
+ }, Et = (P) => {
815
+ var ht = e.text();
816
+ ht.nodeValue = (console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'), ""), e.append(P, ht);
808
817
  };
809
818
  e.if(
810
- Ct,
819
+ Pt,
811
820
  (P) => {
812
- e.get(r) === "thin" ? P(Pt) : P(kt, !1);
821
+ e.get(r) === "thin" ? P(kt) : P(Et, !1);
813
822
  },
814
823
  !0
815
824
  );
816
825
  }
817
- e.append(C, ot);
826
+ e.append(C, lt);
818
827
  };
819
828
  e.if(
820
- Lt,
829
+ xt,
821
830
  (C) => {
822
- e.get(r) === "regular" ? C(xt) : C(Mt, !1);
831
+ e.get(r) === "regular" ? C(Mt) : C(Ct, !1);
823
832
  },
824
833
  !0
825
834
  );
826
835
  }
827
- e.append(M, rt);
836
+ e.append(M, ot);
828
837
  };
829
838
  e.if(
830
- At,
839
+ It,
831
840
  (M) => {
832
- e.get(r) === "light" ? M(It) : M(_t, !1);
841
+ e.get(r) === "light" ? M(_t) : M(Lt, !1);
833
842
  },
834
843
  !0
835
844
  );
836
845
  }
837
- e.append(b, it);
846
+ e.append(b, rt);
838
847
  };
839
848
  e.if(
840
849
  L,
@@ -854,24 +863,24 @@ function oe(a, t) {
854
863
  !0
855
864
  );
856
865
  }
857
- e.append(l, g);
866
+ e.append(h, g);
858
867
  };
859
- e.if(at, (l) => {
860
- e.get(r) === "bold" ? l(ut) : l(o, !1);
868
+ e.if(it, (h) => {
869
+ e.get(r) === "bold" ? h(gt) : h(o, !1);
861
870
  });
862
871
  }
863
872
  e.reset(d), e.append(a, d), e.pop();
864
873
  }
865
874
  export {
866
- jt as M,
867
- ae as V,
868
- oe as X,
869
- wt as a,
870
- ne as b,
871
- re as c,
875
+ Vt as M,
876
+ ie as V,
877
+ le as X,
878
+ St as a,
879
+ ae as b,
880
+ oe as c,
872
881
  Ot as g,
873
- ft as l,
882
+ dt as l,
874
883
  k as m,
875
- ie as o,
876
- St as s
884
+ re as o,
885
+ bt as s
877
886
  };