triiiceratops 0.10.4 → 0.11.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.
Files changed (40) hide show
  1. package/dist/{ArrowCounterClockwise-Bqd8M_aJ.js → ArrowCounterClockwise-CN8KGaI0.js} +1 -1
  2. package/dist/{X-DuHUJc5I.js → X-i_EmjXwW.js} +231 -206
  3. package/dist/actions/tooltip.d.ts +10 -0
  4. package/dist/actions/tooltip.js +107 -0
  5. package/dist/{annotation_tool_point-r6erVcAH.js → annotation_tool_point-BpZXtX5D.js} +1 -1
  6. package/dist/components/CanvasNavigation.svelte +57 -21
  7. package/dist/components/DemoHeader.svelte +81 -40
  8. package/dist/components/OSDViewer.svelte +2 -1
  9. package/dist/components/Toolbar.svelte +294 -0
  10. package/dist/components/Toolbar.svelte.d.ts +3 -0
  11. package/dist/components/TriiiceratopsViewer.svelte +8 -13
  12. package/dist/{image_filters_reset-GRY5dmGP.js → image_filters_reset-CyWg622b.js} +1 -1
  13. package/dist/paraglide/messages/_index.d.ts +6 -3
  14. package/dist/paraglide/messages/_index.js +6 -3
  15. package/dist/paraglide/messages/{settings_toggle_right_menu.d.ts → open_menu.d.ts} +1 -1
  16. package/dist/paraglide/messages/open_menu.js +33 -0
  17. package/dist/paraglide/messages/{settings_submenu_right_menu_items.d.ts → settings_submenu_toolbar.d.ts} +1 -1
  18. package/dist/paraglide/messages/{settings_toggle_right_menu.js → settings_submenu_toolbar.js} +9 -9
  19. package/dist/paraglide/messages/settings_toggle_show_toggle.d.ts +4 -0
  20. package/dist/paraglide/messages/{settings_submenu_right_menu_items.js → settings_toggle_show_toggle.js} +9 -9
  21. package/dist/paraglide/messages/settings_toggle_zoom_controls.d.ts +4 -0
  22. package/dist/paraglide/messages/settings_toggle_zoom_controls.js +34 -0
  23. package/dist/paraglide/messages/settings_toolbar_open.d.ts +4 -0
  24. package/dist/paraglide/messages/settings_toolbar_open.js +34 -0
  25. package/dist/paraglide/messages/{settings_toggle_left_menu.d.ts → settings_toolbar_position.d.ts} +1 -1
  26. package/dist/paraglide/messages/{settings_toggle_left_menu.js → settings_toolbar_position.js} +9 -9
  27. package/dist/plugins/annotation-editor.js +3 -3
  28. package/dist/plugins/image-manipulation.js +3 -3
  29. package/dist/state/viewer.svelte.d.ts +13 -2
  30. package/dist/state/viewer.svelte.js +40 -6
  31. package/dist/triiiceratops-bundle.js +2780 -2546
  32. package/dist/triiiceratops-element.iife.js +17 -17
  33. package/dist/triiiceratops.css +1 -1
  34. package/dist/types/config.d.ts +24 -18
  35. package/dist/utils/annotationAdapter.test.js +32 -29
  36. package/package.json +1 -1
  37. package/dist/components/FloatingMenu.svelte +0 -208
  38. package/dist/components/FloatingMenu.svelte.d.ts +0 -3
  39. package/dist/components/LeftFab.svelte +0 -81
  40. package/dist/components/LeftFab.svelte.d.ts +0 -3
@@ -1,19 +1,19 @@
1
- var Dt = Object.defineProperty;
2
- var pt = (a) => {
1
+ var Vt = Object.defineProperty;
2
+ var vt = (a) => {
3
3
  throw TypeError(a);
4
4
  };
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)), h = (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);
5
+ var Tt = (a, t, s) => t in a ? Vt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[t] = s;
6
+ var ct = (a, t, s) => Tt(a, typeof t != "symbol" ? t + "" : t, s), Bt = (a, t, s) => t.has(a) || vt("Cannot " + s);
7
+ var n = (a, t, s) => (Bt(a, t, "read from private field"), s ? s.call(a) : t.get(a)), h = (a, t, s) => t.has(a) ? vt("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 Bt from "manifesto.js";
9
+ import * as Dt from "manifesto.js";
10
10
  import "svelte/internal/disclose-version";
11
- import { hasContext as Tt, getContext as jt } from "svelte";
12
- var E, D;
13
- class Vt {
11
+ import { hasContext as Gt, getContext as Rt } from "svelte";
12
+ var E, O;
13
+ class jt {
14
14
  constructor() {
15
15
  h(this, E, e.state(e.proxy({})));
16
- h(this, D, e.state(e.proxy(/* @__PURE__ */ new Map())));
16
+ h(this, O, e.state(e.proxy(/* @__PURE__ */ new Map())));
17
17
  }
18
18
  get manifests() {
19
19
  return e.get(n(this, E));
@@ -22,10 +22,10 @@ class Vt {
22
22
  e.set(n(this, E), t, !0);
23
23
  }
24
24
  get userAnnotations() {
25
- return e.get(n(this, D));
25
+ return e.get(n(this, O));
26
26
  }
27
27
  set userAnnotations(t) {
28
- e.set(n(this, D), t, !0);
28
+ e.set(n(this, O), t, !0);
29
29
  }
30
30
  // === User Annotations API ===
31
31
  userAnnotationKey(t, s) {
@@ -54,7 +54,7 @@ class Vt {
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 = Bt.parseManifest(i);
57
+ const i = await s.json(), r = Dt.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 };
@@ -107,8 +107,8 @@ class Vt {
107
107
  const w = this.manifests[v];
108
108
  if (w) {
109
109
  if (w.json) {
110
- const A = I(w.json);
111
- m.push(...A);
110
+ const b = I(w.json);
111
+ m.push(...b);
112
112
  }
113
113
  } else
114
114
  this.fetchAnnotationList(v);
@@ -119,8 +119,8 @@ class Vt {
119
119
  const w = this.manifests[v];
120
120
  if (w) {
121
121
  if (w.json) {
122
- const A = I(w.json);
123
- m.push(...A);
122
+ const b = I(w.json);
123
+ m.push(...b);
124
124
  }
125
125
  } else
126
126
  this.fetchAnnotationList(v);
@@ -128,65 +128,71 @@ class Vt {
128
128
  }), m;
129
129
  }
130
130
  }
131
- E = new WeakMap(), D = new WeakMap();
132
- const P = 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 {
131
+ E = new WeakMap(), O = new WeakMap();
132
+ const P = new jt();
133
+ var V, T, B, D, G, R, j, F, Q, z, Z, H, N, U, q, K, $, W, J, X, Y, tt, et, st, nt, at, it;
134
+ class ie {
135
135
  constructor(t = null, s = null, i = []) {
136
- h(this, R, e.state(null));
137
- h(this, G, e.state(null));
136
+ h(this, V, e.state(null));
137
+ h(this, T, e.state(null));
138
138
  h(this, B, e.state(!1));
139
- h(this, T, e.state(!1));
139
+ h(this, D, e.state(!1));
140
+ h(this, G, e.state(!1));
141
+ h(this, R, e.state(!1));
140
142
  h(this, j, e.state(!1));
141
- h(this, V, e.state(!1));
142
- h(this, O, e.state(!1));
143
143
  h(this, F, e.state(!1));
144
- h(this, Q, e.state("bottom"));
144
+ h(this, Q, e.state(!1));
145
+ h(this, z, e.state("bottom"));
145
146
  h(this, Z, e.state(e.proxy(/* @__PURE__ */ new Set())));
146
- h(this, z, e.state(e.proxy({})));
147
+ h(this, H, e.state(e.proxy({})));
147
148
  h(
148
149
  this,
149
- H,
150
+ N,
150
151
  // Gallery State (Lifted for persistence during re-docking)
151
152
  e.state(e.proxy({ x: 20, y: 100 }))
152
153
  );
153
- h(this, N, e.state(e.proxy({ width: 300, height: 400 })));
154
- h(this, U, e.state(!1));
155
- h(this, q, e.state(e.proxy({ x: 0, y: 0 })));
156
- h(this, K, e.state(null));
154
+ h(this, U, e.state(e.proxy({ width: 300, height: 400 })));
155
+ h(this, q, e.state(!1));
156
+ h(this, K, e.state(e.proxy({ x: 0, y: 0 })));
157
157
  h(this, $, e.state(null));
158
- ft(this, "eventTarget", null);
159
- h(this, W, e.state(""));
160
- h(this, J, e.state(null));
161
- h(this, X, e.state(e.proxy([])));
162
- h(this, Y, e.state(!1));
158
+ h(this, W, e.state(null));
159
+ ct(this, "eventTarget", null);
160
+ /**
161
+ * Reference to the main viewer DOM element.
162
+ * Used for fullscreen toggling.
163
+ */
164
+ ct(this, "viewerElement", null);
165
+ h(this, J, e.state(""));
166
+ h(this, X, e.state(null));
167
+ h(this, Y, e.state(e.proxy([])));
163
168
  h(this, tt, e.state(!1));
164
- h(this, et, e.state(e.proxy([])));
169
+ h(this, et, e.state(!1));
170
+ h(this, st, e.state(e.proxy([])));
165
171
  h(
166
172
  this,
167
- st,
173
+ nt,
168
174
  // ==================== PLUGIN STATE ====================
169
175
  /** Plugin-registered menu buttons */
170
176
  e.state(e.proxy([]))
171
177
  );
172
- h(this, nt, e.state(e.proxy([])));
173
- h(this, at, e.state(null));
174
- ft(this, "pluginEventHandlers", /* @__PURE__ */ new Map());
178
+ h(this, at, e.state(e.proxy([])));
179
+ h(this, it, e.state(null));
180
+ ct(this, "pluginEventHandlers", /* @__PURE__ */ new Map());
175
181
  this.manifestId = t || null, this.canvasId = s || null, this.manifestId && P.fetchManifest(this.manifestId);
176
182
  for (const r of i)
177
183
  this.registerPlugin(r);
178
184
  }
179
185
  get manifestId() {
180
- return e.get(n(this, R));
186
+ return e.get(n(this, V));
181
187
  }
182
188
  set manifestId(t) {
183
- e.set(n(this, R), t, !0);
189
+ e.set(n(this, V), t, !0);
184
190
  }
185
191
  get canvasId() {
186
- return e.get(n(this, G));
192
+ return e.get(n(this, T));
187
193
  }
188
194
  set canvasId(t) {
189
- e.set(n(this, G), t, !0);
195
+ e.set(n(this, T), t, !0);
190
196
  }
191
197
  get showAnnotations() {
192
198
  return e.get(n(this, B));
@@ -195,40 +201,46 @@ class ae {
195
201
  e.set(n(this, B), t, !0);
196
202
  }
197
203
  get showThumbnailGallery() {
198
- return e.get(n(this, T));
204
+ return e.get(n(this, D));
199
205
  }
200
206
  set showThumbnailGallery(t) {
201
- e.set(n(this, T), t, !0);
207
+ e.set(n(this, D), t, !0);
208
+ }
209
+ get toolbarOpen() {
210
+ return e.get(n(this, G));
211
+ }
212
+ set toolbarOpen(t) {
213
+ e.set(n(this, G), t, !0);
202
214
  }
203
215
  get isGalleryDockedBottom() {
204
- return e.get(n(this, j));
216
+ return e.get(n(this, R));
205
217
  }
206
218
  set isGalleryDockedBottom(t) {
207
- e.set(n(this, j), t, !0);
219
+ e.set(n(this, R), t, !0);
208
220
  }
209
221
  get isGalleryDockedRight() {
210
- return e.get(n(this, V));
222
+ return e.get(n(this, j));
211
223
  }
212
224
  set isGalleryDockedRight(t) {
213
- e.set(n(this, V), t, !0);
225
+ e.set(n(this, j), t, !0);
214
226
  }
215
227
  get isFullScreen() {
216
- return e.get(n(this, O));
228
+ return e.get(n(this, F));
217
229
  }
218
230
  set isFullScreen(t) {
219
- e.set(n(this, O), t, !0);
231
+ e.set(n(this, F), t, !0);
220
232
  }
221
233
  get showMetadataDialog() {
222
- return e.get(n(this, F));
234
+ return e.get(n(this, Q));
223
235
  }
224
236
  set showMetadataDialog(t) {
225
- e.set(n(this, F), t, !0);
237
+ e.set(n(this, Q), t, !0);
226
238
  }
227
239
  get dockSide() {
228
- return e.get(n(this, Q));
240
+ return e.get(n(this, z));
229
241
  }
230
242
  set dockSide(t) {
231
- e.set(n(this, Q), t, !0);
243
+ e.set(n(this, z), t, !0);
232
244
  }
233
245
  get visibleAnnotationIds() {
234
246
  return e.get(n(this, Z));
@@ -237,55 +249,55 @@ class ae {
237
249
  e.set(n(this, Z), t, !0);
238
250
  }
239
251
  get config() {
240
- return e.get(n(this, z));
252
+ return e.get(n(this, H));
241
253
  }
242
254
  set config(t) {
243
- e.set(n(this, z), t, !0);
244
- }
245
- get showRightMenu() {
246
- return this.config.showRightMenu ?? !0;
255
+ e.set(n(this, H), t, !0);
247
256
  }
248
- get showLeftMenu() {
249
- return this.config.showLeftMenu ?? !0;
257
+ get showToggle() {
258
+ return this.config.showToggle ?? !0;
250
259
  }
251
260
  get showCanvasNav() {
252
261
  return this.config.showCanvasNav ?? !0;
253
262
  }
263
+ get showZoomControls() {
264
+ return this.config.showZoomControls ?? !0;
265
+ }
254
266
  get galleryPosition() {
255
- return e.get(n(this, H));
267
+ return e.get(n(this, N));
256
268
  }
257
269
  set galleryPosition(t) {
258
- e.set(n(this, H), t, !0);
270
+ e.set(n(this, N), t, !0);
259
271
  }
260
272
  get gallerySize() {
261
- return e.get(n(this, N));
273
+ return e.get(n(this, U));
262
274
  }
263
275
  set gallerySize(t) {
264
- e.set(n(this, N), t, !0);
276
+ e.set(n(this, U), t, !0);
265
277
  }
266
278
  get isGalleryDragging() {
267
- return e.get(n(this, U));
279
+ return e.get(n(this, q));
268
280
  }
269
281
  set isGalleryDragging(t) {
270
- e.set(n(this, U), t, !0);
282
+ e.set(n(this, q), t, !0);
271
283
  }
272
284
  get galleryDragOffset() {
273
- return e.get(n(this, q));
285
+ return e.get(n(this, K));
274
286
  }
275
287
  set galleryDragOffset(t) {
276
- e.set(n(this, q), t, !0);
288
+ e.set(n(this, K), t, !0);
277
289
  }
278
290
  get dragOverSide() {
279
- return e.get(n(this, K));
291
+ return e.get(n(this, $));
280
292
  }
281
293
  set dragOverSide(t) {
282
- e.set(n(this, K), t, !0);
294
+ e.set(n(this, $), t, !0);
283
295
  }
284
296
  get galleryCenterPanelRect() {
285
- return e.get(n(this, $));
297
+ return e.get(n(this, W));
286
298
  }
287
299
  set galleryCenterPanelRect(t) {
288
- e.set(n(this, $), t, !0);
300
+ e.set(n(this, W), t, !0);
289
301
  }
290
302
  setEventTarget(t) {
291
303
  this.eventTarget = t;
@@ -305,6 +317,7 @@ class ae {
305
317
  showAnnotations: this.showAnnotations,
306
318
  showThumbnailGallery: this.showThumbnailGallery,
307
319
  showSearchPanel: this.showSearchPanel,
320
+ toolbarOpen: this.toolbarOpen,
308
321
  searchQuery: this.searchQuery,
309
322
  isFullScreen: this.isFullScreen,
310
323
  dockSide: this.dockSide
@@ -353,6 +366,12 @@ class ae {
353
366
  this.setCanvas(s.id);
354
367
  }
355
368
  }
369
+ zoomIn() {
370
+ this.osdViewer && this.osdViewer.viewport && (this.osdViewer.viewport.zoomBy(1.2), this.osdViewer.viewport.applyConstraints());
371
+ }
372
+ zoomOut() {
373
+ this.osdViewer && this.osdViewer.viewport && (this.osdViewer.viewport.zoomBy(0.8), this.osdViewer.viewport.applyConstraints());
374
+ }
356
375
  setManifest(t) {
357
376
  this.manifestId = t, this.canvasId = null, P.fetchManifest(t), this.dispatchStateChange("manifestchange");
358
377
  }
@@ -362,7 +381,7 @@ class ae {
362
381
  updateConfig(t) {
363
382
  var i;
364
383
  const s = this.config;
365
- if (this.config = t, t.gallery && (t.gallery.open !== void 0 && (this.showThumbnailGallery = t.gallery.open), t.gallery.dockPosition !== void 0 && (this.dockSide = t.gallery.dockPosition)), t.search) {
384
+ if (this.config = t, t.toolbarOpen !== void 0 && (this.toolbarOpen = t.toolbarOpen), t.gallery && (t.gallery.open !== void 0 && (this.showThumbnailGallery = t.gallery.open), t.gallery.dockPosition !== void 0 && (this.dockSide = t.gallery.dockPosition)), t.search) {
366
385
  t.search.open !== void 0 && (this.showSearchPanel = t.search.open);
367
386
  const r = t.search.query, d = (i = s.search) == null ? void 0 : i.query;
368
387
  r !== void 0 && r !== d && r !== this.searchQuery && this._performSearch(r);
@@ -372,60 +391,66 @@ class ae {
372
391
  toggleAnnotations() {
373
392
  this.showAnnotations = !this.showAnnotations, this.dispatchStateChange();
374
393
  }
394
+ toggleToolbar() {
395
+ this.toolbarOpen = !this.toolbarOpen, this.dispatchStateChange();
396
+ }
375
397
  toggleThumbnailGallery() {
376
398
  this.showThumbnailGallery = !this.showThumbnailGallery, this.dispatchStateChange();
377
399
  }
400
+ setViewerElement(t) {
401
+ this.viewerElement = t;
402
+ }
378
403
  toggleFullScreen() {
379
404
  if (document.fullscreenElement)
380
405
  document.exitFullscreen();
381
406
  else {
382
- const t = document.getElementById("triiiceratops-viewer");
383
- t && t.requestFullscreen().catch((s) => {
407
+ const t = this.viewerElement || document.getElementById("triiiceratops-viewer");
408
+ t ? t.requestFullscreen().catch((s) => {
384
409
  console.warn("Fullscreen request failed", s);
385
- });
410
+ }) : console.warn("Cannot toggle fullscreen: Viewer element not found");
386
411
  }
387
412
  }
388
413
  toggleMetadataDialog() {
389
414
  this.showMetadataDialog = !this.showMetadataDialog;
390
415
  }
391
416
  get searchQuery() {
392
- return e.get(n(this, W));
417
+ return e.get(n(this, J));
393
418
  }
394
419
  set searchQuery(t) {
395
- e.set(n(this, W), t, !0);
420
+ e.set(n(this, J), t, !0);
396
421
  }
397
422
  get pendingSearchQuery() {
398
- return e.get(n(this, J));
423
+ return e.get(n(this, X));
399
424
  }
400
425
  set pendingSearchQuery(t) {
401
- e.set(n(this, J), t, !0);
426
+ e.set(n(this, X), t, !0);
402
427
  }
403
428
  get searchResults() {
404
- return e.get(n(this, X));
429
+ return e.get(n(this, Y));
405
430
  }
406
431
  set searchResults(t) {
407
- e.set(n(this, X), t, !0);
432
+ e.set(n(this, Y), t, !0);
408
433
  }
409
434
  get isSearching() {
410
- return e.get(n(this, Y));
435
+ return e.get(n(this, tt));
411
436
  }
412
437
  set isSearching(t) {
413
- e.set(n(this, Y), t, !0);
438
+ e.set(n(this, tt), t, !0);
414
439
  }
415
440
  get showSearchPanel() {
416
- return e.get(n(this, tt));
441
+ return e.get(n(this, et));
417
442
  }
418
443
  set showSearchPanel(t) {
419
- e.set(n(this, tt), t, !0);
444
+ e.set(n(this, et), t, !0);
420
445
  }
421
446
  toggleSearchPanel() {
422
447
  this.showSearchPanel = !this.showSearchPanel, this.showSearchPanel || (this.searchAnnotations = []), this.dispatchStateChange();
423
448
  }
424
449
  get searchAnnotations() {
425
- return e.get(n(this, et));
450
+ return e.get(n(this, st));
426
451
  }
427
452
  set searchAnnotations(t) {
428
- e.set(n(this, et), t, !0);
453
+ e.set(n(this, st), t, !0);
429
454
  }
430
455
  get currentCanvasSearchAnnotations() {
431
456
  return this.canvasId ? this.searchAnnotations.filter((t) => t.canvasId === this.canvasId) : [];
@@ -450,7 +475,7 @@ class ae {
450
475
  }
451
476
  const I = `${d.id || d["@id"]}?q=${encodeURIComponent(t)}`, g = await fetch(I);
452
477
  if (!g.ok) throw new Error("Search request failed");
453
- const v = await g.json(), w = v.resources || [], A = /* @__PURE__ */ new Map(), it = (o) => {
478
+ const v = await g.json(), w = v.resources || [], b = /* @__PURE__ */ new Map(), rt = (o) => {
454
479
  const c = typeof o == "string" ? o : o["@id"] || o.id;
455
480
  if (!c) return null;
456
481
  const u = c.split("#xywh=");
@@ -465,12 +490,12 @@ class ae {
465
490
  for (const l of c) {
466
491
  const f = w.find((p) => p["@id"] === l || p.id === l);
467
492
  if (f && f.on) {
468
- const p = typeof f.on == "string" ? f.on : f.on["@id"] || f.on.id, gt = p.split("#")[0], k = it(p), b = this.canvases.findIndex((x) => x.id === gt);
469
- b >= 0 && (u === -1 && (u = b), k && (y.push(k), S || (S = k)));
493
+ const p = typeof f.on == "string" ? f.on : f.on["@id"] || f.on.id, dt = p.split("#")[0], k = rt(p), A = this.canvases.findIndex((x) => x.id === dt);
494
+ A >= 0 && (u === -1 && (u = A), k && (y.push(k), S || (S = k)));
470
495
  }
471
496
  }
472
497
  if (u >= 0) {
473
- if (!A.has(u)) {
498
+ if (!b.has(u)) {
474
499
  const l = this.canvases[u];
475
500
  let f = "Canvas " + (u + 1);
476
501
  try {
@@ -480,9 +505,9 @@ class ae {
480
505
  } else l.label && (typeof l.label == "string" ? f = l.label : Array.isArray(l.label) && (f = (s = l.label[0]) == null ? void 0 : s.value));
481
506
  } catch {
482
507
  }
483
- A.set(u, { canvasIndex: u, canvasLabel: String(f), hits: [] });
508
+ b.set(u, { canvasIndex: u, canvasLabel: String(f), hits: [] });
484
509
  }
485
- A.get(u).hits.push({
510
+ b.get(u).hits.push({
486
511
  type: "hit",
487
512
  before: _(o.before),
488
513
  match: _(o.match),
@@ -494,7 +519,7 @@ class ae {
494
519
  }
495
520
  else if (w.length > 0)
496
521
  for (const o of w) {
497
- const c = typeof o.on == "string" ? o.on : o.on["@id"] || o.on.id, u = c.split("#")[0], S = it(c), y = this.canvases.findIndex((l) => l.id === u);
522
+ const c = typeof o.on == "string" ? o.on : o.on["@id"] || o.on.id, u = c.split("#")[0], S = rt(c), y = this.canvases.findIndex((l) => l.id === u);
498
523
  if (y >= 0) {
499
524
  const l = this.canvases[y];
500
525
  let f = "Canvas " + (y + 1);
@@ -505,7 +530,7 @@ class ae {
505
530
  } else l.label && (typeof l.label == "string" ? f = l.label : Array.isArray(l.label) && (f = (i = l.label[0]) == null ? void 0 : i.value));
506
531
  } catch {
507
532
  }
508
- A.has(y) || A.set(y, { canvasIndex: y, canvasLabel: String(f), hits: [] }), A.get(y).hits.push({
533
+ b.has(y) || b.set(y, { canvasIndex: y, canvasLabel: String(f), hits: [] }), b.get(y).hits.push({
509
534
  type: "resource",
510
535
  match: _(o.resource && o.resource.chars ? o.resource.chars : o.chars || ""),
511
536
  bounds: S,
@@ -513,14 +538,14 @@ class ae {
513
538
  });
514
539
  }
515
540
  }
516
- this.searchResults = Array.from(A.values()).sort((o, c) => o.canvasIndex - c.canvasIndex);
517
- let ut = 0;
541
+ this.searchResults = Array.from(b.values()).sort((o, c) => o.canvasIndex - c.canvasIndex);
542
+ let ft = 0;
518
543
  this.searchAnnotations = this.searchResults.flatMap((o) => {
519
544
  const c = this.canvases[o.canvasIndex];
520
545
  return o.hits.flatMap((u) => (u.allBounds && u.allBounds.length > 0 ? u.allBounds : u.bounds ? [u.bounds] : []).map((y) => {
521
546
  const l = `${c.id}#xywh=${y.join(",")}`;
522
547
  return {
523
- "@id": `urn:search-hit:${ut++}`,
548
+ "@id": `urn:search-hit:${ft++}`,
524
549
  "@type": "oa:Annotation",
525
550
  motivation: "sc:painting",
526
551
  on: l,
@@ -540,22 +565,22 @@ class ae {
540
565
  }
541
566
  }
542
567
  get pluginMenuButtons() {
543
- return e.get(n(this, st));
568
+ return e.get(n(this, nt));
544
569
  }
545
570
  set pluginMenuButtons(t) {
546
- e.set(n(this, st), t, !0);
571
+ e.set(n(this, nt), t, !0);
547
572
  }
548
573
  get pluginPanels() {
549
- return e.get(n(this, nt));
574
+ return e.get(n(this, at));
550
575
  }
551
576
  set pluginPanels(t) {
552
- e.set(n(this, nt), t, !0);
577
+ e.set(n(this, at), t, !0);
553
578
  }
554
579
  get osdViewer() {
555
- return e.get(n(this, at));
580
+ return e.get(n(this, it));
556
581
  }
557
582
  set osdViewer(t) {
558
- e.set(n(this, at), t);
583
+ e.set(n(this, it), t);
559
584
  }
560
585
  registerPlugin(t) {
561
586
  const s = t.id || `plugin-${Math.random().toString(36).substr(2, 9)}`;
@@ -611,32 +636,32 @@ class ae {
611
636
  this.pluginMenuButtons = [], this.pluginPanels = [], this.pluginEventHandlers.clear();
612
637
  }
613
638
  }
614
- 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();
615
- const ie = "triiiceratops:viewerState";
616
- let vt = Symbol("phosphor-svelte");
617
- function Ot() {
618
- return Tt(vt) ? jt(vt) : {};
639
+ V = new WeakMap(), T = new WeakMap(), B = new WeakMap(), D = new WeakMap(), G = new WeakMap(), R = new WeakMap(), j = 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(), it = new WeakMap();
640
+ const re = "triiiceratops:viewerState";
641
+ let mt = Symbol("phosphor-svelte");
642
+ function Ft() {
643
+ return Gt(mt) ? Rt(mt) : {};
619
644
  }
620
- const Ft = "en", dt = (
645
+ const Qt = "en", pt = (
621
646
  /** @type {const} */
622
647
  ["en", "de"]
623
- ), yt = "PARAGLIDE_LOCALE", Qt = 3456e4, wt = [
648
+ ), wt = "PARAGLIDE_LOCALE", zt = 3456e4, St = [
624
649
  "cookie",
625
650
  "globalVariable",
626
651
  "baseLocale"
627
652
  ];
628
653
  globalThis.__paraglide = {};
629
- let ht, mt = !1, St = () => {
654
+ let ut, yt = !1, bt = () => {
630
655
  let a;
631
- for (const t of wt) {
656
+ for (const t of St) {
632
657
  if (t === "cookie")
633
- a = Nt();
658
+ a = Ut();
634
659
  else if (t === "baseLocale")
635
- a = Ft;
636
- else if (t === "globalVariable" && ht !== void 0)
637
- a = ht;
638
- else if (It(t) && ct.has(t)) {
639
- const s = ct.get(t);
660
+ a = Qt;
661
+ else if (t === "globalVariable" && ut !== void 0)
662
+ a = ut;
663
+ else if (At(t) && gt.has(t)) {
664
+ const s = gt.get(t);
640
665
  if (s) {
641
666
  const i = s.getLocale();
642
667
  if (i instanceof Promise)
@@ -645,8 +670,8 @@ let ht, mt = !1, St = () => {
645
670
  }
646
671
  }
647
672
  if (a !== void 0) {
648
- const s = Ht(a);
649
- return mt || (ht = s, mt = !0, At(s, { reload: !1 })), s;
673
+ const s = Nt(a);
674
+ return yt || (ut = s, yt = !0, It(s, { reload: !1 })), s;
650
675
  }
651
676
  }
652
677
  throw new Error("No locale found. Read the docs https://inlang.com/m/gerre34r/library-inlang-paraglideJs/errors#no-locale-found");
@@ -654,30 +679,30 @@ let ht, mt = !1, St = () => {
654
679
  const Zt = (a) => {
655
680
  window.location.reload();
656
681
  };
657
- let At = (a, t) => {
682
+ let It = (a, t) => {
658
683
  const s = {
659
684
  reload: !0,
660
685
  ...t
661
686
  };
662
687
  let i;
663
688
  try {
664
- i = St();
689
+ i = bt();
665
690
  } catch {
666
691
  }
667
692
  const r = [];
668
- for (const m of wt)
693
+ for (const m of St)
669
694
  if (m === "globalVariable")
670
- ht = a;
695
+ ut = a;
671
696
  else if (m === "cookie") {
672
697
  if (typeof document > "u" || typeof window > "u")
673
698
  continue;
674
- const I = `${yt}=${a}; path=/; max-age=${Qt}`;
699
+ const I = `${wt}=${a}; path=/; max-age=${zt}`;
675
700
  document.cookie = I;
676
701
  } else {
677
702
  if (m === "baseLocale")
678
703
  continue;
679
- if (It(m) && ct.has(m)) {
680
- const I = ct.get(m);
704
+ if (At(m) && gt.has(m)) {
705
+ const I = gt.get(m);
681
706
  if (I) {
682
707
  let g = I.setLocale(a);
683
708
  g instanceof Promise && (g = g.catch((v) => {
@@ -697,55 +722,55 @@ let At = (a, t) => {
697
722
  });
698
723
  d();
699
724
  };
700
- const re = (a) => {
701
- At = /** @type {SetLocaleFn} */
725
+ const oe = (a) => {
726
+ It = /** @type {SetLocaleFn} */
702
727
  a;
703
728
  };
704
- function zt(a) {
705
- return typeof a != "string" ? !1 : a ? dt.some((t) => t.toLowerCase() === a.toLowerCase()) : !1;
706
- }
707
729
  function Ht(a) {
730
+ return typeof a != "string" ? !1 : a ? pt.some((t) => t.toLowerCase() === a.toLowerCase()) : !1;
731
+ }
732
+ function Nt(a) {
708
733
  if (typeof a != "string")
709
734
  throw new Error(`Invalid locale: ${a}. Expected a string.`);
710
- const t = a.toLowerCase(), s = dt.find((i) => i.toLowerCase() === t);
735
+ const t = a.toLowerCase(), s = pt.find((i) => i.toLowerCase() === t);
711
736
  if (!s)
712
- throw new Error(`Invalid locale: ${a}. Expected one of: ${dt.join(", ")}`);
737
+ throw new Error(`Invalid locale: ${a}. Expected one of: ${pt.join(", ")}`);
713
738
  return s;
714
739
  }
715
- function Nt() {
740
+ function Ut() {
716
741
  if (typeof document > "u" || !document.cookie)
717
742
  return;
718
- const a = document.cookie.match(new RegExp(`(^| )${yt}=([^;]+)`)), t = a == null ? void 0 : a[2];
719
- if (zt(t))
743
+ const a = document.cookie.match(new RegExp(`(^| )${wt}=([^;]+)`)), t = a == null ? void 0 : a[2];
744
+ if (Ht(t))
720
745
  return t;
721
746
  }
722
- const ct = /* @__PURE__ */ new Map();
723
- function It(a) {
747
+ const gt = /* @__PURE__ */ new Map();
748
+ function At(a) {
724
749
  return typeof a == "string" && /^custom-[A-Za-z0-9_-]+$/.test(a);
725
750
  }
726
- const Ut = (
751
+ const qt = (
727
752
  /** @type {(inputs: {}) => LocalizedString} */
728
753
  () => (
729
754
  /** @type {LocalizedString} */
730
755
  "Close"
731
756
  )
732
- ), qt = (
757
+ ), Kt = (
733
758
  /** @type {(inputs: {}) => LocalizedString} */
734
759
  () => (
735
760
  /** @type {LocalizedString} */
736
761
  "Schließen"
737
762
  )
738
- ), oe = /* @__NO_SIDE_EFFECTS__ */ (a = {}, t = {}) => (t.locale ?? St()) === "en" ? Ut() : qt();
739
- 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>');
740
- function le(a, t) {
763
+ ), le = /* @__NO_SIDE_EFFECTS__ */ (a = {}, t = {}) => (t.locale ?? bt()) === "en" ? qt() : Kt();
764
+ var $t = 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>'), Wt = 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), Jt = 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>'), Xt = 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>'), Yt = 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>'), te = 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>'), ee = e.from_svg('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');
765
+ function he(a, t) {
741
766
  e.push(t, !0);
742
- const s = Ot();
767
+ const s = Ft();
743
768
  let i = e.rest_props(t, ["$$slots", "$$events", "$$legacy", "children"]), r = e.derived(() => t.weight ?? s.weight ?? "regular"), d = e.derived(() => t.color ?? s.color ?? "currentColor"), m = e.derived(() => t.size ?? s.size ?? "1em"), I = e.derived(() => t.mirrored ?? s.mirrored ?? !1);
744
769
  function g(o) {
745
770
  let { weight: c, color: u, size: S, mirrored: y, ...l } = o;
746
771
  return l;
747
772
  }
748
- var v = te();
773
+ var v = ee();
749
774
  e.attribute_effect(
750
775
  v,
751
776
  (o, c) => ({
@@ -763,87 +788,87 @@ function le(a, t) {
763
788
  );
764
789
  var w = e.child(v);
765
790
  {
766
- var A = (o) => {
791
+ var b = (o) => {
767
792
  var c = e.comment(), u = e.first_child(c);
768
793
  e.snippet(u, () => t.children), e.append(o, c);
769
794
  };
770
795
  e.if(w, (o) => {
771
- t.children && o(A);
796
+ t.children && o(b);
772
797
  });
773
798
  }
774
- var it = e.sibling(w, 2);
799
+ var rt = e.sibling(w, 2);
775
800
  {
776
801
  var _ = (o) => {
777
- var c = Kt();
802
+ var c = $t();
778
803
  e.append(o, c);
779
- }, ut = (o) => {
804
+ }, ft = (o) => {
780
805
  var c = e.comment(), u = e.first_child(c);
781
806
  {
782
807
  var S = (l) => {
783
- var f = $t();
808
+ var f = Wt();
784
809
  e.next(), e.append(l, f);
785
810
  }, y = (l) => {
786
811
  var f = e.comment(), p = e.first_child(f);
787
812
  {
788
- var gt = (b) => {
789
- var x = Wt();
790
- e.append(b, x);
791
- }, k = (b) => {
792
- var x = e.comment(), bt = e.first_child(x);
813
+ var dt = (A) => {
814
+ var x = Jt();
815
+ e.append(A, x);
816
+ }, k = (A) => {
817
+ var x = e.comment(), _t = e.first_child(x);
793
818
  {
794
- var _t = (L) => {
795
- var rt = Jt();
796
- e.append(L, rt);
797
- }, xt = (L) => {
798
- var rt = e.comment(), Lt = e.first_child(rt);
819
+ var xt = (L) => {
820
+ var ot = Xt();
821
+ e.append(L, ot);
822
+ }, Lt = (L) => {
823
+ var ot = e.comment(), Ct = e.first_child(ot);
799
824
  {
800
- var Mt = (M) => {
801
- var ot = Xt();
802
- e.append(M, ot);
803
- }, Ct = (M) => {
804
- var ot = e.comment(), Pt = e.first_child(ot);
825
+ var Mt = (C) => {
826
+ var lt = Yt();
827
+ e.append(C, lt);
828
+ }, Pt = (C) => {
829
+ var lt = e.comment(), kt = e.first_child(lt);
805
830
  {
806
- var kt = (C) => {
807
- var lt = Yt();
808
- e.append(C, lt);
809
- }, Et = (C) => {
810
- var lt = e.text();
811
- lt.nodeValue = (console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'), ""), e.append(C, lt);
831
+ var Et = (M) => {
832
+ var ht = te();
833
+ e.append(M, ht);
834
+ }, Ot = (M) => {
835
+ var ht = e.text();
836
+ ht.nodeValue = (console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'), ""), e.append(M, ht);
812
837
  };
813
838
  e.if(
814
- Pt,
815
- (C) => {
816
- e.get(r) === "thin" ? C(kt) : C(Et, !1);
839
+ kt,
840
+ (M) => {
841
+ e.get(r) === "thin" ? M(Et) : M(Ot, !1);
817
842
  },
818
843
  !0
819
844
  );
820
845
  }
821
- e.append(M, ot);
846
+ e.append(C, lt);
822
847
  };
823
848
  e.if(
824
- Lt,
825
- (M) => {
826
- e.get(r) === "regular" ? M(Mt) : M(Ct, !1);
849
+ Ct,
850
+ (C) => {
851
+ e.get(r) === "regular" ? C(Mt) : C(Pt, !1);
827
852
  },
828
853
  !0
829
854
  );
830
855
  }
831
- e.append(L, rt);
856
+ e.append(L, ot);
832
857
  };
833
858
  e.if(
834
- bt,
859
+ _t,
835
860
  (L) => {
836
- e.get(r) === "light" ? L(_t) : L(xt, !1);
861
+ e.get(r) === "light" ? L(xt) : L(Lt, !1);
837
862
  },
838
863
  !0
839
864
  );
840
865
  }
841
- e.append(b, x);
866
+ e.append(A, x);
842
867
  };
843
868
  e.if(
844
869
  p,
845
- (b) => {
846
- e.get(r) === "fill" ? b(gt) : b(k, !1);
870
+ (A) => {
871
+ e.get(r) === "fill" ? A(dt) : A(k, !1);
847
872
  },
848
873
  !0
849
874
  );
@@ -860,22 +885,22 @@ function le(a, t) {
860
885
  }
861
886
  e.append(o, c);
862
887
  };
863
- e.if(it, (o) => {
864
- e.get(r) === "bold" ? o(_) : o(ut, !1);
888
+ e.if(rt, (o) => {
889
+ e.get(r) === "bold" ? o(_) : o(ft, !1);
865
890
  });
866
891
  }
867
892
  e.reset(v), e.append(a, v), e.pop();
868
893
  }
869
894
  export {
870
- Vt as M,
871
- ie as V,
872
- le as X,
873
- St as a,
874
- ae as b,
875
- oe as c,
876
- Ot as g,
877
- dt as l,
895
+ jt as M,
896
+ re as V,
897
+ he as X,
898
+ bt as a,
899
+ ie as b,
900
+ le as c,
901
+ Ft as g,
902
+ pt as l,
878
903
  P as m,
879
- re as o,
880
- At as s
904
+ oe as o,
905
+ It as s
881
906
  };