triiiceratops 0.12.6 → 0.12.8

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,42 +1,42 @@
1
- var Te = Object.defineProperty;
2
- var me = (i) => {
1
+ var Be = Object.defineProperty;
2
+ var ye = (i) => {
3
3
  throw TypeError(i);
4
4
  };
5
- var Be = (i, e, s) => e in i ? Te(i, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[e] = s;
6
- var O = (i, e, s) => Be(i, typeof e != "symbol" ? e + "" : e, s), De = (i, e, s) => e.has(i) || me("Cannot " + s);
7
- var a = (i, e, s) => (De(i, e, "read from private field"), s ? s.call(i) : e.get(i)), h = (i, e, s) => e.has(i) ? me("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, s);
5
+ var De = (i, e, s) => e in i ? Be(i, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[e] = s;
6
+ var O = (i, e, s) => De(i, typeof e != "symbol" ? e + "" : e, s), Ge = (i, e, s) => e.has(i) || ye("Cannot " + s);
7
+ var n = (i, e, s) => (Ge(i, e, "read from private field"), s ? s.call(i) : e.get(i)), h = (i, e, s) => e.has(i) ? ye("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, s);
8
8
  import * as t from "svelte/internal/client";
9
- import { SvelteMap as ve, SvelteSet as Ge } from "svelte/reactivity";
10
- import * as Re from "manifesto.js";
9
+ import { SvelteMap as pe, SvelteSet as Re } from "svelte/reactivity";
10
+ import * as je from "manifesto.js";
11
11
  import "svelte/internal/disclose-version";
12
- import { hasContext as je, getContext as ze } from "svelte";
12
+ import { hasContext as ze, getContext as Fe } from "svelte";
13
13
  var T;
14
- class Fe {
14
+ class Qe {
15
15
  constructor() {
16
16
  h(this, T, t.state(t.proxy({})));
17
- O(this, "userAnnotations", new ve());
17
+ O(this, "userAnnotations", new pe());
18
18
  }
19
19
  get manifests() {
20
- return t.get(a(this, T));
20
+ return t.get(n(this, T));
21
21
  }
22
22
  set manifests(e) {
23
- t.set(a(this, T), e, !0);
23
+ t.set(n(this, T), e, !0);
24
24
  }
25
25
  // === User Annotations API ===
26
26
  userAnnotationKey(e, s) {
27
27
  return `${e}::${s}`;
28
28
  }
29
- setUserAnnotations(e, s, n) {
29
+ setUserAnnotations(e, s, a) {
30
30
  const r = this.userAnnotationKey(e, s);
31
- this.userAnnotations.set(r, n);
31
+ this.userAnnotations.set(r, a);
32
32
  }
33
33
  clearUserAnnotations(e, s) {
34
- const n = this.userAnnotationKey(e, s);
35
- this.userAnnotations.has(n) && this.userAnnotations.delete(n);
34
+ const a = this.userAnnotationKey(e, s);
35
+ this.userAnnotations.has(a) && this.userAnnotations.delete(a);
36
36
  }
37
37
  getUserAnnotations(e, s) {
38
- const n = this.userAnnotationKey(e, s);
39
- return this.userAnnotations.get(n) ?? [];
38
+ const a = this.userAnnotationKey(e, s);
39
+ return this.userAnnotations.get(a) ?? [];
40
40
  }
41
41
  // === Manifest Fetching ===
42
42
  async fetchManifest(e) {
@@ -46,8 +46,8 @@ class Fe {
46
46
  const s = await fetch(e);
47
47
  if (!s.ok)
48
48
  throw new Error(`HTTP error! status: ${s.status}`);
49
- const n = await s.json(), r = Re.parseManifest(n);
50
- this.manifests[e] = { json: n, manifesto: r, isFetching: !1 };
49
+ const a = await s.json(), r = je.parseManifest(a);
50
+ this.manifests[e] = { json: a, manifesto: r, isFetching: !1 };
51
51
  } catch (s) {
52
52
  this.manifests[e] = { error: s.message, isFetching: !1 };
53
53
  }
@@ -65,8 +65,8 @@ class Fe {
65
65
  try {
66
66
  const s = await fetch(e);
67
67
  if (s.ok) {
68
- const n = await s.json();
69
- this.manifests[e] = { json: n };
68
+ const a = await s.json();
69
+ this.manifests[e] = { json: a };
70
70
  } else
71
71
  console.error(`Failed to fetch annotation list: ${e}`);
72
72
  } catch (s) {
@@ -77,18 +77,18 @@ class Fe {
77
77
  const s = this.getManifest(e);
78
78
  if (!s)
79
79
  return [];
80
- const n = s.getSequences();
81
- return !n || !n.length ? [] : n[0].getCanvases();
80
+ const a = s.getSequences();
81
+ return !a || !a.length ? [] : a[0].getCanvases();
82
82
  }
83
83
  getAnnotations(e, s) {
84
- const n = this.manualGetAnnotations(e, s), r = this.getUserAnnotations(e, s);
85
- return [...n, ...r];
84
+ const a = this.manualGetAnnotations(e, s), r = this.getUserAnnotations(e, s);
85
+ return [...a, ...r];
86
86
  }
87
87
  // We can refactor this to use Manifesto's resource handling later if needed.
88
88
  manualGetAnnotations(e, s) {
89
- const n = this.getManifest(e);
90
- if (!n) return [];
91
- const r = n.getSequences()[0].getCanvasById(s);
89
+ const a = this.getManifest(e);
90
+ if (!a) return [];
91
+ const r = a.getSequences()[0].getCanvasById(s);
92
92
  if (!r) return [];
93
93
  const u = r.__jsonld, p = [], S = (c) => c.resources || c.items || [];
94
94
  return u.otherContent && u.otherContent.forEach((c) => {
@@ -119,10 +119,10 @@ class Fe {
119
119
  }
120
120
  }
121
121
  T = new WeakMap();
122
- const k = new Fe();
123
- var B, D, G, R, j, z, F, Q, Z, $, H, N, U, q, K, W, J, X, Y, ee, te, se, ne, ae, ie, re, oe, le;
124
- class lt {
125
- constructor(e = null, s = null, n = []) {
122
+ const k = new Qe();
123
+ var B, D, G, R, j, z, F, Q, Z, $, H, N, U, q, K, W, J, X, Y, ee, te, se, ne, ae, ie, re, oe, le, he;
124
+ class ht {
125
+ constructor(e = null, s = null, a = []) {
126
126
  h(this, B, t.state(null));
127
127
  h(this, D, t.state(null));
128
128
  h(this, G, t.state(!1));
@@ -133,118 +133,125 @@ class lt {
133
133
  h(this, Q, t.state(!1));
134
134
  h(this, Z, t.state(!1));
135
135
  h(this, $, t.state("bottom"));
136
- O(this, "visibleAnnotationIds", new Ge());
137
- h(this, H, t.state(t.proxy({})));
136
+ O(this, "visibleAnnotationIds", new Re());
137
+ h(this, H, t.state(null));
138
+ h(this, N, t.state(t.proxy({})));
138
139
  h(
139
140
  this,
140
- N,
141
+ U,
141
142
  // Dedicated reactive state for viewingMode to ensure proper reactivity
142
143
  // when accessed in $derived expressions (tileSources computation)
143
144
  t.state("individuals")
144
145
  );
145
146
  h(
146
147
  this,
147
- U,
148
+ q,
148
149
  // Pairing offset for paged mode: 0 = default (pairs start at 1+2), 1 = shifted (page 1 alone, pairs start at 2+3)
149
150
  t.state(1)
150
151
  );
151
- h(this, q, t.state(t.proxy({ x: 20, y: 100 })));
152
- h(this, K, t.state(t.proxy({ width: 300, height: 400 })));
153
- h(this, W, t.state(!1));
154
- h(this, J, t.state(t.proxy({ x: 0, y: 0 })));
155
- h(this, X, t.state(null));
152
+ h(this, K, t.state(t.proxy({ x: 20, y: 100 })));
153
+ h(this, W, t.state(t.proxy({ width: 300, height: 400 })));
154
+ h(this, J, t.state(!1));
155
+ h(this, X, t.state(t.proxy({ x: 0, y: 0 })));
156
156
  h(this, Y, t.state(null));
157
+ h(this, ee, t.state(null));
157
158
  O(this, "eventTarget", null);
158
159
  /**
159
160
  * Reference to the main viewer DOM element.
160
161
  * Used for fullscreen toggling.
161
162
  */
162
163
  O(this, "viewerElement", null);
163
- h(this, ee, t.state(""));
164
- h(this, te, t.state(null));
165
- h(this, se, t.state(t.proxy([])));
166
- h(this, ne, t.state(!1));
164
+ h(this, te, t.state(""));
165
+ h(this, se, t.state(null));
166
+ h(this, ne, t.state(t.proxy([])));
167
167
  h(this, ae, t.state(!1));
168
- h(this, ie, t.state(t.proxy([])));
168
+ h(this, ie, t.state(!1));
169
+ h(this, re, t.state(t.proxy([])));
169
170
  h(
170
171
  this,
171
- re,
172
+ oe,
172
173
  // ==================== PLUGIN STATE ====================
173
174
  /** Plugin-registered menu buttons */
174
175
  t.state(t.proxy([]))
175
176
  );
176
- h(this, oe, t.state(t.proxy([])));
177
- h(this, le, t.state(null));
178
- O(this, "pluginEventHandlers", new ve());
177
+ h(this, le, t.state(t.proxy([])));
178
+ h(this, he, t.state(null));
179
+ O(this, "pluginEventHandlers", new pe());
179
180
  this.manifestId = e || null, this.canvasId = s || null, this.manifestId && k.fetchManifest(this.manifestId);
180
- for (const r of n)
181
+ for (const r of a)
181
182
  this.registerPlugin(r);
182
183
  }
183
184
  get manifestId() {
184
- return t.get(a(this, B));
185
+ return t.get(n(this, B));
185
186
  }
186
187
  set manifestId(e) {
187
- t.set(a(this, B), e, !0);
188
+ t.set(n(this, B), e, !0);
188
189
  }
189
190
  get canvasId() {
190
- return t.get(a(this, D));
191
+ return t.get(n(this, D));
191
192
  }
192
193
  set canvasId(e) {
193
- t.set(a(this, D), e, !0);
194
+ t.set(n(this, D), e, !0);
194
195
  }
195
196
  get showAnnotations() {
196
- return t.get(a(this, G));
197
+ return t.get(n(this, G));
197
198
  }
198
199
  set showAnnotations(e) {
199
- t.set(a(this, G), e, !0);
200
+ t.set(n(this, G), e, !0);
200
201
  }
201
202
  get showThumbnailGallery() {
202
- return t.get(a(this, R));
203
+ return t.get(n(this, R));
203
204
  }
204
205
  set showThumbnailGallery(e) {
205
- t.set(a(this, R), e, !0);
206
+ t.set(n(this, R), e, !0);
206
207
  }
207
208
  get toolbarOpen() {
208
- return t.get(a(this, j));
209
+ return t.get(n(this, j));
209
210
  }
210
211
  set toolbarOpen(e) {
211
- t.set(a(this, j), e, !0);
212
+ t.set(n(this, j), e, !0);
212
213
  }
213
214
  get isGalleryDockedBottom() {
214
- return t.get(a(this, z));
215
+ return t.get(n(this, z));
215
216
  }
216
217
  set isGalleryDockedBottom(e) {
217
- t.set(a(this, z), e, !0);
218
+ t.set(n(this, z), e, !0);
218
219
  }
219
220
  get isGalleryDockedRight() {
220
- return t.get(a(this, F));
221
+ return t.get(n(this, F));
221
222
  }
222
223
  set isGalleryDockedRight(e) {
223
- t.set(a(this, F), e, !0);
224
+ t.set(n(this, F), e, !0);
224
225
  }
225
226
  get isFullScreen() {
226
- return t.get(a(this, Q));
227
+ return t.get(n(this, Q));
227
228
  }
228
229
  set isFullScreen(e) {
229
- t.set(a(this, Q), e, !0);
230
+ t.set(n(this, Q), e, !0);
230
231
  }
231
232
  get showMetadataDialog() {
232
- return t.get(a(this, Z));
233
+ return t.get(n(this, Z));
233
234
  }
234
235
  set showMetadataDialog(e) {
235
- t.set(a(this, Z), e, !0);
236
+ t.set(n(this, Z), e, !0);
236
237
  }
237
238
  get dockSide() {
238
- return t.get(a(this, $));
239
+ return t.get(n(this, $));
239
240
  }
240
241
  set dockSide(e) {
241
- t.set(a(this, $), e, !0);
242
+ t.set(n(this, $), e, !0);
243
+ }
244
+ get hoveredAnnotationId() {
245
+ return t.get(n(this, H));
246
+ }
247
+ set hoveredAnnotationId(e) {
248
+ t.set(n(this, H), e, !0);
242
249
  }
243
250
  get config() {
244
- return t.get(a(this, H));
251
+ return t.get(n(this, N));
245
252
  }
246
253
  set config(e) {
247
- t.set(a(this, H), e, !0);
254
+ t.set(n(this, N), e, !0);
248
255
  }
249
256
  get showToggle() {
250
257
  return this.config.showToggle ?? !0;
@@ -260,10 +267,10 @@ class lt {
260
267
  return ((e = this.config.gallery) == null ? void 0 : e.fixedHeight) ?? 120;
261
268
  }
262
269
  get _viewingMode() {
263
- return t.get(a(this, N));
270
+ return t.get(n(this, U));
264
271
  }
265
272
  set _viewingMode(e) {
266
- t.set(a(this, N), e, !0);
273
+ t.set(n(this, U), e, !0);
267
274
  }
268
275
  get viewingMode() {
269
276
  return this._viewingMode;
@@ -272,46 +279,46 @@ class lt {
272
279
  this._viewingMode = e, this.config.viewingMode = e;
273
280
  }
274
281
  get pagedOffset() {
275
- return t.get(a(this, U));
282
+ return t.get(n(this, q));
276
283
  }
277
284
  set pagedOffset(e) {
278
- t.set(a(this, U), e, !0);
285
+ t.set(n(this, q), e, !0);
279
286
  }
280
287
  get galleryPosition() {
281
- return t.get(a(this, q));
288
+ return t.get(n(this, K));
282
289
  }
283
290
  set galleryPosition(e) {
284
- t.set(a(this, q), e, !0);
291
+ t.set(n(this, K), e, !0);
285
292
  }
286
293
  get gallerySize() {
287
- return t.get(a(this, K));
294
+ return t.get(n(this, W));
288
295
  }
289
296
  set gallerySize(e) {
290
- t.set(a(this, K), e, !0);
297
+ t.set(n(this, W), e, !0);
291
298
  }
292
299
  get isGalleryDragging() {
293
- return t.get(a(this, W));
300
+ return t.get(n(this, J));
294
301
  }
295
302
  set isGalleryDragging(e) {
296
- t.set(a(this, W), e, !0);
303
+ t.set(n(this, J), e, !0);
297
304
  }
298
305
  get galleryDragOffset() {
299
- return t.get(a(this, J));
306
+ return t.get(n(this, X));
300
307
  }
301
308
  set galleryDragOffset(e) {
302
- t.set(a(this, J), e, !0);
309
+ t.set(n(this, X), e, !0);
303
310
  }
304
311
  get dragOverSide() {
305
- return t.get(a(this, X));
312
+ return t.get(n(this, Y));
306
313
  }
307
314
  set dragOverSide(e) {
308
- t.set(a(this, X), e, !0);
315
+ t.set(n(this, Y), e, !0);
309
316
  }
310
317
  get galleryCenterPanelRect() {
311
- return t.get(a(this, Y));
318
+ return t.get(n(this, ee));
312
319
  }
313
320
  set galleryCenterPanelRect(e) {
314
- t.set(a(this, Y), e, !0);
321
+ t.set(n(this, ee), e, !0);
315
322
  }
316
323
  setEventTarget(e) {
317
324
  this.eventTarget = e;
@@ -324,7 +331,7 @@ class lt {
324
331
  */
325
332
  getSnapshot() {
326
333
  let e = -1;
327
- return this.manifestId && this.canvasId && (e = k.getCanvases(this.manifestId).findIndex((n) => (n.id || n["@id"] || (n.getCanvasId ? n.getCanvasId() : null) || (n.getId ? n.getId() : null)) === this.canvasId)), {
334
+ return this.manifestId && this.canvasId && (e = k.getCanvases(this.manifestId).findIndex((a) => (a.id || a["@id"] || (a.getCanvasId ? a.getCanvasId() : null) || (a.getId ? a.getId() : null)) === this.canvasId)), {
328
335
  manifestId: this.manifestId,
329
336
  canvasId: this.canvasId,
330
337
  currentCanvasIndex: e,
@@ -378,8 +385,8 @@ class lt {
378
385
  nextCanvas() {
379
386
  if (this.hasNext)
380
387
  if (this.viewingMode === "paged") {
381
- const e = this.pagedOffset, s = this.currentCanvasIndex < e ? this.currentCanvasIndex + 1 : this.currentCanvasIndex + 2, n = this.canvases[s];
382
- this.setCanvas(n.id);
388
+ const e = this.pagedOffset, s = this.currentCanvasIndex < e ? this.currentCanvasIndex + 1 : this.currentCanvasIndex + 2, a = this.canvases[s];
389
+ this.setCanvas(a.id);
383
390
  } else {
384
391
  const e = this.currentCanvasIndex + 1, s = this.canvases[e];
385
392
  this.setCanvas(s.id);
@@ -391,8 +398,8 @@ class lt {
391
398
  const e = this.pagedOffset;
392
399
  let s;
393
400
  this.currentCanvasIndex <= e ? s = this.currentCanvasIndex - 1 : s = Math.max(this.currentCanvasIndex - 2, e);
394
- const n = this.canvases[s];
395
- this.setCanvas(n.id);
401
+ const a = this.canvases[s];
402
+ this.setCanvas(a.id);
396
403
  } else {
397
404
  const e = this.currentCanvasIndex - 1, s = this.canvases[e];
398
405
  this.setCanvas(s.id);
@@ -411,11 +418,11 @@ class lt {
411
418
  this.canvasId = e, this.dispatchStateChange("canvaschange");
412
419
  }
413
420
  updateConfig(e) {
414
- var n;
421
+ var a;
415
422
  const s = this.config;
416
423
  if (this.config = e, e.toolbarOpen !== void 0 && (this.toolbarOpen = e.toolbarOpen), e.viewingMode && (this.viewingMode = e.viewingMode), e.pagedViewOffset !== void 0 && (this.pagedOffset = e.pagedViewOffset ? 1 : 0), e.gallery && (e.gallery.open !== void 0 && (this.showThumbnailGallery = e.gallery.open), e.gallery.dockPosition !== void 0 && (this.dockSide = e.gallery.dockPosition), e.gallery.width !== void 0 && (this.gallerySize.width = e.gallery.width), e.gallery.height !== void 0 && (this.gallerySize.height = e.gallery.height), e.gallery.x !== void 0 && (this.galleryPosition.x = e.gallery.x), e.gallery.y !== void 0 && (this.galleryPosition.y = e.gallery.y)), e.search) {
417
424
  e.search.open !== void 0 && (this.showSearchPanel = e.search.open);
418
- const r = e.search.query, u = (n = s.search) == null ? void 0 : n.query;
425
+ const r = e.search.query, u = (a = s.search) == null ? void 0 : a.query;
419
426
  r !== void 0 && r !== u && r !== this.searchQuery && this._performSearch(r);
420
427
  }
421
428
  e.annotations && e.annotations.open !== void 0 && (this.showAnnotations = e.annotations.open);
@@ -459,56 +466,56 @@ class lt {
459
466
  this.pagedOffset = this.pagedOffset === 0 ? 1 : 0, this.config.pagedViewOffset = this.pagedOffset === 1;
460
467
  const e = this.pagedOffset;
461
468
  if (this.currentCanvasIndex >= e && (this.currentCanvasIndex - e) % 2 === 1) {
462
- const n = this.currentCanvasIndex - 1, r = this.canvases[n];
469
+ const a = this.currentCanvasIndex - 1, r = this.canvases[a];
463
470
  this.setCanvas(r.id);
464
471
  }
465
472
  this.dispatchStateChange();
466
473
  }
467
474
  get searchQuery() {
468
- return t.get(a(this, ee));
475
+ return t.get(n(this, te));
469
476
  }
470
477
  set searchQuery(e) {
471
- t.set(a(this, ee), e, !0);
478
+ t.set(n(this, te), e, !0);
472
479
  }
473
480
  get pendingSearchQuery() {
474
- return t.get(a(this, te));
481
+ return t.get(n(this, se));
475
482
  }
476
483
  set pendingSearchQuery(e) {
477
- t.set(a(this, te), e, !0);
484
+ t.set(n(this, se), e, !0);
478
485
  }
479
486
  get searchResults() {
480
- return t.get(a(this, se));
487
+ return t.get(n(this, ne));
481
488
  }
482
489
  set searchResults(e) {
483
- t.set(a(this, se), e, !0);
490
+ t.set(n(this, ne), e, !0);
484
491
  }
485
492
  get isSearching() {
486
- return t.get(a(this, ne));
493
+ return t.get(n(this, ae));
487
494
  }
488
495
  set isSearching(e) {
489
- t.set(a(this, ne), e, !0);
496
+ t.set(n(this, ae), e, !0);
490
497
  }
491
498
  get showSearchPanel() {
492
- return t.get(a(this, ae));
499
+ return t.get(n(this, ie));
493
500
  }
494
501
  set showSearchPanel(e) {
495
- t.set(a(this, ae), e, !0);
502
+ t.set(n(this, ie), e, !0);
496
503
  }
497
504
  toggleSearchPanel() {
498
505
  this.showSearchPanel = !this.showSearchPanel, this.showSearchPanel || (this.searchAnnotations = []), this.dispatchStateChange();
499
506
  }
500
507
  get searchAnnotations() {
501
- return t.get(a(this, ie));
508
+ return t.get(n(this, re));
502
509
  }
503
510
  set searchAnnotations(e) {
504
- t.set(a(this, ie), e, !0);
511
+ t.set(n(this, re), e, !0);
505
512
  }
506
513
  get currentCanvasSearchAnnotations() {
507
514
  if (!this.canvasId) return [];
508
515
  if (this.viewingMode === "paged") {
509
516
  let e = this.searchAnnotations.filter((r) => r.canvasId === this.canvasId);
510
- const s = this.currentCanvasIndex, n = this.pagedOffset;
511
- if (s >= n) {
517
+ const s = this.currentCanvasIndex, a = this.pagedOffset;
518
+ if (s >= a) {
512
519
  const r = s + 1;
513
520
  if (r < this.canvases.length) {
514
521
  const u = this.canvases[r], p = u.id || u["@id"], c = this.canvases[s].getWidth() * 1.025, w = this.searchAnnotations.filter((y) => y.canvasId === p).map((y) => {
@@ -529,7 +536,7 @@ class lt {
529
536
  this.dispatchStateChange(), await this._performSearch(e), this.dispatchStateChange();
530
537
  }
531
538
  async _performSearch(e) {
532
- var s, n;
539
+ var s, a;
533
540
  if (e.trim()) {
534
541
  this.isSearching = !0, this.searchQuery = e, this.searchResults = [];
535
542
  try {
@@ -545,7 +552,7 @@ class lt {
545
552
  }
546
553
  const S = `${u.id || u["@id"]}?q=${encodeURIComponent(e)}`, c = await fetch(S);
547
554
  if (!c.ok) throw new Error("Search request failed");
548
- const m = await c.json(), w = m.resources || [], y = new ve(), _ = (o) => {
555
+ const m = await c.json(), w = m.resources || [], y = new pe(), _ = (o) => {
549
556
  const g = typeof o == "string" ? o : o["@id"] || o.id;
550
557
  if (!g) return null;
551
558
  const d = g.split("#xywh=");
@@ -561,7 +568,7 @@ class lt {
561
568
  for (const l of g) {
562
569
  const f = w.find((v) => v["@id"] === l || v.id === l);
563
570
  if (f && f.on) {
564
- const v = typeof f.on == "string" ? f.on : f.on["@id"] || f.on.id, fe = v.split("#")[0], V = _(v), A = this.canvases.findIndex((C) => C.id === fe);
571
+ const v = typeof f.on == "string" ? f.on : f.on["@id"] || f.on.id, ve = v.split("#")[0], V = _(v), A = this.canvases.findIndex((C) => C.id === ve);
565
572
  A >= 0 && (d === -1 && (d = A), V && (I.push(V), x || (x = V)));
566
573
  }
567
574
  }
@@ -598,7 +605,7 @@ class lt {
598
605
  if (l.getLabel) {
599
606
  const v = l.getLabel();
600
607
  Array.isArray(v) && v.length > 0 ? f = v[0].value : typeof v == "string" && (f = v);
601
- } else l.label && (typeof l.label == "string" ? f = l.label : Array.isArray(l.label) && (f = (n = l.label[0]) == null ? void 0 : n.value));
608
+ } else l.label && (typeof l.label == "string" ? f = l.label : Array.isArray(l.label) && (f = (a = l.label[0]) == null ? void 0 : a.value));
602
609
  } catch {
603
610
  }
604
611
  y.has(I) || y.set(I, { canvasIndex: I, canvasLabel: String(f), hits: [] }), y.get(I).hits.push({
@@ -636,46 +643,46 @@ class lt {
636
643
  }
637
644
  }
638
645
  get pluginMenuButtons() {
639
- return t.get(a(this, re));
646
+ return t.get(n(this, oe));
640
647
  }
641
648
  set pluginMenuButtons(e) {
642
- t.set(a(this, re), e, !0);
649
+ t.set(n(this, oe), e, !0);
643
650
  }
644
651
  get pluginPanels() {
645
- return t.get(a(this, oe));
652
+ return t.get(n(this, le));
646
653
  }
647
654
  set pluginPanels(e) {
648
- t.set(a(this, oe), e, !0);
655
+ t.set(n(this, le), e, !0);
649
656
  }
650
657
  get osdViewer() {
651
- return t.get(a(this, le));
658
+ return t.get(n(this, he));
652
659
  }
653
660
  set osdViewer(e) {
654
- t.set(a(this, le), e);
661
+ t.set(n(this, he), e);
655
662
  }
656
663
  registerPlugin(e) {
657
664
  const s = e.id || `plugin-${Math.random().toString(36).substr(2, 9)}`;
658
- let n = t.state(!1);
665
+ let a = t.state(!1);
659
666
  const r = {
660
667
  id: `${s}:toggle`,
661
668
  icon: e.icon,
662
669
  tooltip: e.name,
663
670
  onClick: () => {
664
- t.set(n, !t.get(n));
671
+ t.set(a, !t.get(a));
665
672
  },
666
- isActive: () => t.get(n),
673
+ isActive: () => t.get(a),
667
674
  order: 200
668
675
  // Default order for simple plugins
669
676
  }, u = {
670
677
  id: `${s}:panel`,
671
678
  component: e.panel,
672
679
  position: e.position || "left",
673
- isVisible: () => t.get(n),
680
+ isVisible: () => t.get(a),
674
681
  props: {
675
682
  ...e.props,
676
683
  // Pass closer to component
677
684
  close: () => {
678
- t.set(n, !1);
685
+ t.set(a, !1);
679
686
  }
680
687
  }
681
688
  };
@@ -706,73 +713,73 @@ class lt {
706
713
  this.pluginMenuButtons = [], this.pluginPanels = [], this.pluginEventHandlers.clear();
707
714
  }
708
715
  }
709
- B = new WeakMap(), D = new WeakMap(), G = new WeakMap(), R = new WeakMap(), j = new WeakMap(), z = new WeakMap(), F = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), $ = new WeakMap(), H = new WeakMap(), N = new WeakMap(), U = new WeakMap(), q = new WeakMap(), K = new WeakMap(), W = new WeakMap(), J = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), ee = new WeakMap(), te = new WeakMap(), se = new WeakMap(), ne = new WeakMap(), ae = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap();
710
- const ht = "triiiceratops:viewerState";
711
- let ye = Symbol("phosphor-svelte");
712
- function Qe() {
713
- return je(ye) ? ze(ye) : {};
716
+ B = new WeakMap(), D = new WeakMap(), G = new WeakMap(), R = new WeakMap(), j = new WeakMap(), z = new WeakMap(), F = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), $ = new WeakMap(), H = new WeakMap(), N = new WeakMap(), U = new WeakMap(), q = new WeakMap(), K = new WeakMap(), W = new WeakMap(), J = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), ee = new WeakMap(), te = new WeakMap(), se = new WeakMap(), ne = new WeakMap(), ae = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), he = new WeakMap();
717
+ const ct = "triiiceratops:viewerState";
718
+ let we = Symbol("phosphor-svelte");
719
+ function Ze() {
720
+ return ze(we) ? Fe(we) : {};
714
721
  }
715
- const Ze = "en", pe = (
722
+ const $e = "en", me = (
716
723
  /** @type {const} */
717
724
  ["en", "de"]
718
- ), Ie = "PARAGLIDE_LOCALE", $e = 3456e4, xe = [
725
+ ), xe = "PARAGLIDE_LOCALE", He = 3456e4, Se = [
719
726
  "cookie",
720
727
  "globalVariable",
721
728
  "baseLocale"
722
729
  ];
723
730
  globalThis.__paraglide = {};
724
- let de, we = !1, Se = () => {
731
+ let ue, Ie = !1, be = () => {
725
732
  let i;
726
- for (const e of xe) {
733
+ for (const e of Se) {
727
734
  if (e === "cookie")
728
- i = qe();
735
+ i = Ke();
729
736
  else if (e === "baseLocale")
730
- i = Ze;
731
- else if (e === "globalVariable" && de !== void 0)
732
- i = de;
733
- else if (Ae(e) && ue.has(e)) {
734
- const s = ue.get(e);
737
+ i = $e;
738
+ else if (e === "globalVariable" && ue !== void 0)
739
+ i = ue;
740
+ else if (_e(e) && fe.has(e)) {
741
+ const s = fe.get(e);
735
742
  if (s) {
736
- const n = s.getLocale();
737
- if (n instanceof Promise)
743
+ const a = s.getLocale();
744
+ if (a instanceof Promise)
738
745
  continue;
739
- i = n;
746
+ i = a;
740
747
  }
741
748
  }
742
749
  if (i !== void 0) {
743
- const s = Ue(i);
744
- return we || (de = s, we = !0, be(s, { reload: !1 })), s;
750
+ const s = qe(i);
751
+ return Ie || (ue = s, Ie = !0, Ae(s, { reload: !1 })), s;
745
752
  }
746
753
  }
747
754
  throw new Error("No locale found. Read the docs https://inlang.com/m/gerre34r/library-inlang-paraglideJs/errors#no-locale-found");
748
755
  };
749
- const He = (i) => {
756
+ const Ne = (i) => {
750
757
  window.location.reload();
751
758
  };
752
- let be = (i, e) => {
759
+ let Ae = (i, e) => {
753
760
  const s = {
754
761
  reload: !0,
755
762
  ...e
756
763
  };
757
- let n;
764
+ let a;
758
765
  try {
759
- n = Se();
766
+ a = be();
760
767
  } catch {
761
768
  }
762
769
  const r = [];
763
- for (const p of xe)
770
+ for (const p of Se)
764
771
  if (p === "globalVariable")
765
- de = i;
772
+ ue = i;
766
773
  else if (p === "cookie") {
767
774
  if (typeof document > "u" || typeof window > "u")
768
775
  continue;
769
- const S = `${Ie}=${i}; path=/; max-age=${$e}`;
776
+ const S = `${xe}=${i}; path=/; max-age=${He}`;
770
777
  document.cookie = S;
771
778
  } else {
772
779
  if (p === "baseLocale")
773
780
  continue;
774
- if (Ae(p) && ue.has(p)) {
775
- const S = ue.get(p);
781
+ if (_e(p) && fe.has(p)) {
782
+ const S = fe.get(p);
776
783
  if (S) {
777
784
  let c = S.setLocale(i);
778
785
  c instanceof Promise && (c = c.catch((m) => {
@@ -784,7 +791,7 @@ let be = (i, e) => {
784
791
  }
785
792
  }
786
793
  const u = () => {
787
- s.reload && window.location && i !== n && He();
794
+ s.reload && window.location && i !== a && Ne();
788
795
  };
789
796
  if (r.length)
790
797
  return Promise.all(r).then(() => {
@@ -792,55 +799,55 @@ let be = (i, e) => {
792
799
  });
793
800
  u();
794
801
  };
795
- const ct = (i) => {
796
- be = /** @type {SetLocaleFn} */
802
+ const gt = (i) => {
803
+ Ae = /** @type {SetLocaleFn} */
797
804
  i;
798
805
  };
799
- function Ne(i) {
800
- return typeof i != "string" ? !1 : i ? pe.some((e) => e.toLowerCase() === i.toLowerCase()) : !1;
801
- }
802
806
  function Ue(i) {
807
+ return typeof i != "string" ? !1 : i ? me.some((e) => e.toLowerCase() === i.toLowerCase()) : !1;
808
+ }
809
+ function qe(i) {
803
810
  if (typeof i != "string")
804
811
  throw new Error(`Invalid locale: ${i}. Expected a string.`);
805
- const e = i.toLowerCase(), s = pe.find((n) => n.toLowerCase() === e);
812
+ const e = i.toLowerCase(), s = me.find((a) => a.toLowerCase() === e);
806
813
  if (!s)
807
- throw new Error(`Invalid locale: ${i}. Expected one of: ${pe.join(", ")}`);
814
+ throw new Error(`Invalid locale: ${i}. Expected one of: ${me.join(", ")}`);
808
815
  return s;
809
816
  }
810
- function qe() {
817
+ function Ke() {
811
818
  if (typeof document > "u" || !document.cookie)
812
819
  return;
813
- const i = document.cookie.match(new RegExp(`(^| )${Ie}=([^;]+)`)), e = i == null ? void 0 : i[2];
814
- if (Ne(e))
820
+ const i = document.cookie.match(new RegExp(`(^| )${xe}=([^;]+)`)), e = i == null ? void 0 : i[2];
821
+ if (Ue(e))
815
822
  return e;
816
823
  }
817
- const ue = /* @__PURE__ */ new Map();
818
- function Ae(i) {
824
+ const fe = /* @__PURE__ */ new Map();
825
+ function _e(i) {
819
826
  return typeof i == "string" && /^custom-[A-Za-z0-9_-]+$/.test(i);
820
827
  }
821
- const Ke = (
828
+ const We = (
822
829
  /** @type {(inputs: {}) => LocalizedString} */
823
830
  () => (
824
831
  /** @type {LocalizedString} */
825
832
  "Close"
826
833
  )
827
- ), We = (
834
+ ), Je = (
828
835
  /** @type {(inputs: {}) => LocalizedString} */
829
836
  () => (
830
837
  /** @type {LocalizedString} */
831
838
  "Schließen"
832
839
  )
833
- ), gt = /* @__NO_SIDE_EFFECTS__ */ (i = {}, e = {}) => (e.locale ?? Se()) === "en" ? Ke() : We();
834
- var Je = t.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>'), Xe = t.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), Ye = t.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>'), et = t.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>'), tt = t.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>'), st = t.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>'), nt = t.from_svg('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');
835
- function dt(i, e) {
840
+ ), dt = /* @__NO_SIDE_EFFECTS__ */ (i = {}, e = {}) => (e.locale ?? be()) === "en" ? We() : Je();
841
+ var Xe = t.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>'), Ye = t.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), et = t.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>'), tt = t.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>'), st = t.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>'), nt = t.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>'), at = t.from_svg('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');
842
+ function ut(i, e) {
836
843
  t.push(e, !0);
837
- const s = Qe();
838
- let n = t.rest_props(e, ["$$slots", "$$events", "$$legacy", "children"]), r = t.derived(() => e.weight ?? s.weight ?? "regular"), u = t.derived(() => e.color ?? s.color ?? "currentColor"), p = t.derived(() => e.size ?? s.size ?? "1em"), S = t.derived(() => e.mirrored ?? s.mirrored ?? !1);
844
+ const s = Ze();
845
+ let a = t.rest_props(e, ["$$slots", "$$events", "$$legacy", "children"]), r = t.derived(() => e.weight ?? s.weight ?? "regular"), u = t.derived(() => e.color ?? s.color ?? "currentColor"), p = t.derived(() => e.size ?? s.size ?? "1em"), S = t.derived(() => e.mirrored ?? s.mirrored ?? !1);
839
846
  function c(o) {
840
847
  let { weight: g, color: d, size: x, mirrored: I, ...l } = o;
841
848
  return l;
842
849
  }
843
- var m = nt();
850
+ var m = at();
844
851
  t.attribute_effect(
845
852
  m,
846
853
  (o, g) => ({
@@ -854,7 +861,7 @@ function dt(i, e) {
854
861
  ...o,
855
862
  ...g
856
863
  }),
857
- [() => c(s), () => c(n)]
864
+ [() => c(s), () => c(a)]
858
865
  );
859
866
  var w = t.child(m);
860
867
  {
@@ -869,66 +876,66 @@ function dt(i, e) {
869
876
  var _ = t.sibling(w, 2);
870
877
  {
871
878
  var b = (o) => {
872
- var g = Je();
879
+ var g = Xe();
873
880
  t.append(o, g);
874
881
  }, E = (o) => {
875
882
  var g = t.comment(), d = t.first_child(g);
876
883
  {
877
884
  var x = (l) => {
878
- var f = Xe();
885
+ var f = Ye();
879
886
  t.next(), t.append(l, f);
880
887
  }, I = (l) => {
881
888
  var f = t.comment(), v = t.first_child(f);
882
889
  {
883
- var fe = (A) => {
884
- var C = Ye();
890
+ var ve = (A) => {
891
+ var C = et();
885
892
  t.append(A, C);
886
893
  }, V = (A) => {
887
- var C = t.comment(), _e = t.first_child(C);
894
+ var C = t.comment(), Ce = t.first_child(C);
888
895
  {
889
- var Ce = (M) => {
890
- var he = et();
891
- t.append(M, he);
892
- }, Me = (M) => {
893
- var he = t.comment(), Le = t.first_child(he);
896
+ var Me = (M) => {
897
+ var ce = tt();
898
+ t.append(M, ce);
899
+ }, Le = (M) => {
900
+ var ce = t.comment(), Pe = t.first_child(ce);
894
901
  {
895
- var Pe = (L) => {
896
- var ce = tt();
897
- t.append(L, ce);
898
- }, Oe = (L) => {
899
- var ce = t.comment(), ke = t.first_child(ce);
902
+ var Oe = (L) => {
903
+ var ge = st();
904
+ t.append(L, ge);
905
+ }, ke = (L) => {
906
+ var ge = t.comment(), Ee = t.first_child(ge);
900
907
  {
901
- var Ee = (P) => {
902
- var ge = st();
903
- t.append(P, ge);
904
- }, Ve = (P) => {
905
- var ge = t.text();
906
- ge.nodeValue = (console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'), ""), t.append(P, ge);
908
+ var Ve = (P) => {
909
+ var de = nt();
910
+ t.append(P, de);
911
+ }, Te = (P) => {
912
+ var de = t.text();
913
+ de.nodeValue = (console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'), ""), t.append(P, de);
907
914
  };
908
915
  t.if(
909
- ke,
916
+ Ee,
910
917
  (P) => {
911
- t.get(r) === "thin" ? P(Ee) : P(Ve, !1);
918
+ t.get(r) === "thin" ? P(Ve) : P(Te, !1);
912
919
  },
913
920
  !0
914
921
  );
915
922
  }
916
- t.append(L, ce);
923
+ t.append(L, ge);
917
924
  };
918
925
  t.if(
919
- Le,
926
+ Pe,
920
927
  (L) => {
921
- t.get(r) === "regular" ? L(Pe) : L(Oe, !1);
928
+ t.get(r) === "regular" ? L(Oe) : L(ke, !1);
922
929
  },
923
930
  !0
924
931
  );
925
932
  }
926
- t.append(M, he);
933
+ t.append(M, ce);
927
934
  };
928
935
  t.if(
929
- _e,
936
+ Ce,
930
937
  (M) => {
931
- t.get(r) === "light" ? M(Ce) : M(Me, !1);
938
+ t.get(r) === "light" ? M(Me) : M(Le, !1);
932
939
  },
933
940
  !0
934
941
  );
@@ -938,7 +945,7 @@ function dt(i, e) {
938
945
  t.if(
939
946
  v,
940
947
  (A) => {
941
- t.get(r) === "fill" ? A(fe) : A(V, !1);
948
+ t.get(r) === "fill" ? A(ve) : A(V, !1);
942
949
  },
943
950
  !0
944
951
  );
@@ -962,15 +969,15 @@ function dt(i, e) {
962
969
  t.reset(m), t.append(i, m), t.pop();
963
970
  }
964
971
  export {
965
- Fe as M,
966
- ht as V,
967
- dt as X,
968
- Se as a,
969
- lt as b,
970
- gt as c,
971
- Qe as g,
972
- pe as l,
972
+ Qe as M,
973
+ ct as V,
974
+ ut as X,
975
+ be as a,
976
+ ht as b,
977
+ dt as c,
978
+ Ze as g,
979
+ me as l,
973
980
  k as m,
974
- ct as o,
975
- be as s
981
+ gt as o,
982
+ Ae as s
976
983
  };