triiiceratops 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,183 +1,184 @@
1
- var at = Object.defineProperty;
2
- var Re = (r) => {
3
- throw TypeError(r);
1
+ var ot = Object.defineProperty;
2
+ var Ve = (i) => {
3
+ throw TypeError(i);
4
4
  };
5
- var it = (r, t, s) => t in r ? at(r, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[t] = s;
6
- var Oe = (r, t, s) => it(r, typeof t != "symbol" ? t + "" : t, s), ot = (r, t, s) => t.has(r) || Re("Cannot " + s);
7
- var A = (r, t, s) => (ot(r, t, "read from private field"), s ? s.call(r) : t.get(r)), J = (r, t, s) => t.has(r) ? Re("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, s);
5
+ var lt = (i, t, r) => t in i ? ot(i, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : i[t] = r;
6
+ var $e = (i, t, r) => lt(i, typeof t != "symbol" ? t + "" : t, r), ct = (i, t, r) => t.has(i) || Ve("Cannot " + r);
7
+ var A = (i, t, r) => (ct(i, t, "read from private field"), r ? r.call(i) : t.get(i)), K = (i, t, r) => t.has(i) ? Ve("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, r);
8
8
  import "svelte/internal/disclose-version";
9
9
  import * as e from "svelte/internal/client";
10
- import { onMount as lt, getContext as le, setContext as ct, onDestroy as dt } from "svelte";
10
+ import { onMount as dt, getContext as oe, setContext as ft, onDestroy as ut } from "svelte";
11
11
  import * as gt from "manifesto.js";
12
- import He from "openseadragon";
13
- import ut from "phosphor-svelte/lib/CaretLeft";
14
- import ft from "phosphor-svelte/lib/CaretRight";
15
- import ht from "phosphor-svelte/lib/CaretDown";
16
- import Fe from "phosphor-svelte/lib/Eye";
17
- import Ve from "phosphor-svelte/lib/EyeSlash";
18
- import Ye from "phosphor-svelte/lib/X";
12
+ import Be from "openseadragon";
13
+ import vt from "phosphor-svelte/lib/CaretLeft";
14
+ import ht from "phosphor-svelte/lib/CaretRight";
15
+ import { m as B, l as pt } from "./plugin-COh2S4OT.js";
16
+ import { B as mi } from "./plugin-COh2S4OT.js";
17
+ import mt from "phosphor-svelte/lib/CaretDown";
18
+ import He from "phosphor-svelte/lib/Eye";
19
+ import Ne from "phosphor-svelte/lib/EyeSlash";
20
+ import qe from "phosphor-svelte/lib/X";
19
21
  import "svelte/internal/flags/legacy";
20
- import vt from "phosphor-svelte/lib/ChatCenteredText";
21
- import pt from "phosphor-svelte/lib/CornersIn";
22
- import mt from "phosphor-svelte/lib/CornersOut";
23
- import _t from "phosphor-svelte/lib/Info";
24
- import Xe from "phosphor-svelte/lib/MagnifyingGlass";
25
- import bt from "phosphor-svelte/lib/List";
26
- import yt from "phosphor-svelte/lib/Slideshow";
27
- import xt from "phosphor-svelte/lib/PuzzlePiece";
28
- import { B as Zn } from "./plugin-DqOSV8lm.js";
29
- var ce;
30
- class wt {
22
+ import bt from "phosphor-svelte/lib/ChatCenteredText";
23
+ import _t from "phosphor-svelte/lib/CornersIn";
24
+ import yt from "phosphor-svelte/lib/CornersOut";
25
+ import wt from "phosphor-svelte/lib/Info";
26
+ import Qe from "phosphor-svelte/lib/MagnifyingGlass";
27
+ import xt from "phosphor-svelte/lib/List";
28
+ import St from "phosphor-svelte/lib/Slideshow";
29
+ import At from "phosphor-svelte/lib/PuzzlePiece";
30
+ var de;
31
+ class It {
31
32
  constructor() {
32
- J(this, ce, e.state(e.proxy({})));
33
+ K(this, de, e.state(e.proxy({})));
33
34
  }
34
35
  get manifests() {
35
- return e.get(A(this, ce));
36
+ return e.get(A(this, de));
36
37
  }
37
38
  set manifests(t) {
38
- e.set(A(this, ce), t, !0);
39
+ e.set(A(this, de), t, !0);
39
40
  }
40
41
  async fetchManifest(t) {
41
42
  if (!this.manifests[t]) {
42
43
  this.manifests[t] = { isFetching: !0 };
43
44
  try {
44
- const s = await fetch(t);
45
- if (!s.ok)
46
- throw new Error(`HTTP error! status: ${s.status}`);
47
- const n = await s.json(), a = gt.parseManifest(n);
48
- this.manifests[t] = { json: n, manifesto: a, isFetching: !1 };
49
- } catch (s) {
50
- this.manifests[t] = { error: s.message, isFetching: !1 };
45
+ const r = await fetch(t);
46
+ if (!r.ok)
47
+ throw new Error(`HTTP error! status: ${r.status}`);
48
+ const s = await r.json(), n = gt.parseManifest(s);
49
+ this.manifests[t] = { json: s, manifesto: n, isFetching: !1 };
50
+ } catch (r) {
51
+ this.manifests[t] = { error: r.message, isFetching: !1 };
51
52
  }
52
53
  }
53
54
  }
54
55
  getManifest(t) {
55
- const s = this.manifests[t];
56
- return s == null ? void 0 : s.manifesto;
56
+ const r = this.manifests[t];
57
+ return r == null ? void 0 : r.manifesto;
57
58
  }
58
59
  async fetchAnnotationList(t) {
59
60
  if (!this.manifests[t])
60
61
  try {
61
- const s = await fetch(t);
62
- if (s.ok) {
63
- const n = await s.json();
64
- this.manifests[t] = { json: n };
62
+ const r = await fetch(t);
63
+ if (r.ok) {
64
+ const s = await r.json();
65
+ this.manifests[t] = { json: s };
65
66
  } else
66
67
  console.error(`Failed to fetch annotation list: ${t}`);
67
- } catch (s) {
68
- console.error(`Error fetching annotation list: ${t}`, s);
68
+ } catch (r) {
69
+ console.error(`Error fetching annotation list: ${t}`, r);
69
70
  }
70
71
  }
71
72
  getCanvases(t) {
72
- const s = this.getManifest(t);
73
- if (!s)
73
+ const r = this.getManifest(t);
74
+ if (!r)
74
75
  return [];
75
- const n = s.getSequences();
76
- return !n || !n.length ? [] : n[0].getCanvases();
76
+ const s = r.getSequences();
77
+ return !s || !s.length ? [] : s[0].getCanvases();
77
78
  }
78
- getAnnotations(t, s) {
79
- const n = this.getManifest(t);
80
- return n ? n.getSequences()[0].getCanvasById(s) ? this.manualGetAnnotations(t, s) : [] : [];
79
+ getAnnotations(t, r) {
80
+ const s = this.getManifest(t);
81
+ return s ? s.getSequences()[0].getCanvasById(r) ? this.manualGetAnnotations(t, r) : [] : [];
81
82
  }
82
83
  // We can refactor this to use Manifesto's resource handling later if needed.
83
- manualGetAnnotations(t, s) {
84
- const n = this.getManifest(t);
84
+ manualGetAnnotations(t, r) {
85
+ const s = this.getManifest(t);
86
+ if (!s) return [];
87
+ const n = s.getSequences()[0].getCanvasById(r);
85
88
  if (!n) return [];
86
- const a = n.getSequences()[0].getCanvasById(s);
87
- if (!a) return [];
88
- const i = a.__jsonld;
89
- let I = [];
90
- const C = (x) => x.resources || x.items || [];
91
- return i.otherContent && i.otherContent.forEach((x) => {
92
- const w = x["@id"] || x.id;
93
- if (w && !x.resources) {
94
- const $ = this.manifests[w];
95
- if ($) {
96
- if ($.json) {
97
- const j = C($.json);
98
- I.push(...j);
89
+ const a = n.__jsonld;
90
+ let y = [];
91
+ const I = (c) => c.resources || c.items || [];
92
+ return a.otherContent && a.otherContent.forEach((c) => {
93
+ const w = c["@id"] || c.id;
94
+ if (w && !c.resources) {
95
+ const k = this.manifests[w];
96
+ if (k) {
97
+ if (k.json) {
98
+ const z = I(k.json);
99
+ y.push(...z);
99
100
  }
100
101
  } else
101
102
  this.fetchAnnotationList(w);
102
- } else x.resources && I.push(...x.resources);
103
- }), i.annotations && i.annotations.forEach((x) => {
104
- const w = x.id || x["@id"];
105
- if (w && !x.items) {
106
- const $ = this.manifests[w];
107
- if ($) {
108
- if ($.json) {
109
- const j = C($.json);
110
- I.push(...j);
103
+ } else c.resources && y.push(...c.resources);
104
+ }), a.annotations && a.annotations.forEach((c) => {
105
+ const w = c.id || c["@id"];
106
+ if (w && !c.items) {
107
+ const k = this.manifests[w];
108
+ if (k) {
109
+ if (k.json) {
110
+ const z = I(k.json);
111
+ y.push(...z);
111
112
  }
112
113
  } else
113
114
  this.fetchAnnotationList(w);
114
- } else x.items && I.push(...x.items);
115
- }), I;
115
+ } else c.items && y.push(...c.items);
116
+ }), y;
116
117
  }
117
118
  }
118
- ce = new WeakMap();
119
- const oe = new wt();
120
- var de, ge, ue, fe, he, ve, pe, me, _e, be, ye, xe, we, Se, Ae, $e, Ie, Te, ke, Pe, Me, Ce, je, ze;
121
- class St {
122
- constructor(t = null, s = []) {
123
- J(this, de, e.state(null));
124
- J(this, ge, e.state(null));
125
- J(this, ue, e.state(!1));
126
- J(this, fe, e.state(!1));
127
- J(this, he, e.state(!1));
128
- J(this, ve, e.state(!1));
129
- J(this, pe, e.state(!1));
130
- J(this, me, e.state(!1));
131
- J(this, _e, e.state("bottom"));
132
- J(this, be, e.state(e.proxy(/* @__PURE__ */ new Set())));
133
- J(this, ye, e.state(e.proxy({ x: 20, y: 100 })));
134
- J(this, xe, e.state(e.proxy({ width: 300, height: 400 })));
135
- J(this, we, e.state(!1));
136
- J(this, Se, e.state(e.proxy({ x: 0, y: 0 })));
137
- J(this, Ae, e.state(null));
138
- J(this, $e, e.state(""));
139
- J(this, Ie, e.state(e.proxy([])));
140
- J(this, Te, e.state(!1));
141
- J(this, ke, e.state(!1));
142
- J(this, Pe, e.state(e.proxy([])));
143
- J(
119
+ de = new WeakMap();
120
+ const ae = new It();
121
+ var fe, ue, ge, ve, he, pe, me, be, _e, ye, we, xe, Se, Ae, Ie, ke, Ce, Pe, Me, ze, Te, je, Le, Oe;
122
+ class kt {
123
+ constructor(t = null, r = null, s = []) {
124
+ K(this, fe, e.state(null));
125
+ K(this, ue, e.state(null));
126
+ K(this, ge, e.state(!1));
127
+ K(this, ve, e.state(!1));
128
+ K(this, he, e.state(!1));
129
+ K(this, pe, e.state(!1));
130
+ K(this, me, e.state(!1));
131
+ K(this, be, e.state(!1));
132
+ K(this, _e, e.state("bottom"));
133
+ K(this, ye, e.state(e.proxy(/* @__PURE__ */ new Set())));
134
+ K(this, we, e.state(e.proxy({ x: 20, y: 100 })));
135
+ K(this, xe, e.state(e.proxy({ width: 300, height: 400 })));
136
+ K(this, Se, e.state(!1));
137
+ K(this, Ae, e.state(e.proxy({ x: 0, y: 0 })));
138
+ K(this, Ie, e.state(null));
139
+ K(this, ke, e.state(""));
140
+ K(this, Ce, e.state(e.proxy([])));
141
+ K(this, Pe, e.state(!1));
142
+ K(this, Me, e.state(!1));
143
+ K(this, ze, e.state(e.proxy([])));
144
+ K(
144
145
  this,
145
- Me,
146
+ Te,
146
147
  // ==================== PLUGIN STATE ====================
147
148
  /** Registered plugins */
148
149
  e.state(e.proxy([]))
149
150
  );
150
- J(this, Ce, e.state(e.proxy([])));
151
- J(this, je, e.state(e.proxy([])));
152
- J(this, ze, e.state(null));
153
- Oe(this, "pluginEventHandlers", /* @__PURE__ */ new Map());
154
- this.manifestId = t || null, this.manifestId && oe.fetchManifest(this.manifestId);
151
+ K(this, je, e.state(e.proxy([])));
152
+ K(this, Le, e.state(e.proxy([])));
153
+ K(this, Oe, e.state(null));
154
+ $e(this, "pluginEventHandlers", /* @__PURE__ */ new Map());
155
+ this.manifestId = t || null, this.canvasId = r || null, this.manifestId && ae.fetchManifest(this.manifestId);
155
156
  for (const n of s)
156
157
  this.registerPlugin(n);
157
158
  }
158
159
  get manifestId() {
159
- return e.get(A(this, de));
160
+ return e.get(A(this, fe));
160
161
  }
161
162
  set manifestId(t) {
162
- e.set(A(this, de), t, !0);
163
+ e.set(A(this, fe), t, !0);
163
164
  }
164
165
  get canvasId() {
165
- return e.get(A(this, ge));
166
+ return e.get(A(this, ue));
166
167
  }
167
168
  set canvasId(t) {
168
- e.set(A(this, ge), t, !0);
169
+ e.set(A(this, ue), t, !0);
169
170
  }
170
171
  get showAnnotations() {
171
- return e.get(A(this, ue));
172
+ return e.get(A(this, ge));
172
173
  }
173
174
  set showAnnotations(t) {
174
- e.set(A(this, ue), t, !0);
175
+ e.set(A(this, ge), t, !0);
175
176
  }
176
177
  get showThumbnailGallery() {
177
- return e.get(A(this, fe));
178
+ return e.get(A(this, ve));
178
179
  }
179
180
  set showThumbnailGallery(t) {
180
- e.set(A(this, fe), t, !0);
181
+ e.set(A(this, ve), t, !0);
181
182
  }
182
183
  get isGalleryDockedBottom() {
183
184
  return e.get(A(this, he));
@@ -186,22 +187,22 @@ class St {
186
187
  e.set(A(this, he), t, !0);
187
188
  }
188
189
  get isGalleryDockedRight() {
189
- return e.get(A(this, ve));
190
+ return e.get(A(this, pe));
190
191
  }
191
192
  set isGalleryDockedRight(t) {
192
- e.set(A(this, ve), t, !0);
193
+ e.set(A(this, pe), t, !0);
193
194
  }
194
195
  get isFullScreen() {
195
- return e.get(A(this, pe));
196
+ return e.get(A(this, me));
196
197
  }
197
198
  set isFullScreen(t) {
198
- e.set(A(this, pe), t, !0);
199
+ e.set(A(this, me), t, !0);
199
200
  }
200
201
  get showMetadataDialog() {
201
- return e.get(A(this, me));
202
+ return e.get(A(this, be));
202
203
  }
203
204
  set showMetadataDialog(t) {
204
- e.set(A(this, me), t, !0);
205
+ e.set(A(this, be), t, !0);
205
206
  }
206
207
  get dockSide() {
207
208
  return e.get(A(this, _e));
@@ -210,16 +211,16 @@ class St {
210
211
  e.set(A(this, _e), t, !0);
211
212
  }
212
213
  get visibleAnnotationIds() {
213
- return e.get(A(this, be));
214
+ return e.get(A(this, ye));
214
215
  }
215
216
  set visibleAnnotationIds(t) {
216
- e.set(A(this, be), t, !0);
217
+ e.set(A(this, ye), t, !0);
217
218
  }
218
219
  get galleryPosition() {
219
- return e.get(A(this, ye));
220
+ return e.get(A(this, we));
220
221
  }
221
222
  set galleryPosition(t) {
222
- e.set(A(this, ye), t, !0);
223
+ e.set(A(this, we), t, !0);
223
224
  }
224
225
  get gallerySize() {
225
226
  return e.get(A(this, xe));
@@ -228,29 +229,29 @@ class St {
228
229
  e.set(A(this, xe), t, !0);
229
230
  }
230
231
  get isGalleryDragging() {
231
- return e.get(A(this, we));
232
+ return e.get(A(this, Se));
232
233
  }
233
234
  set isGalleryDragging(t) {
234
- e.set(A(this, we), t, !0);
235
+ e.set(A(this, Se), t, !0);
235
236
  }
236
237
  get galleryDragOffset() {
237
- return e.get(A(this, Se));
238
+ return e.get(A(this, Ae));
238
239
  }
239
240
  set galleryDragOffset(t) {
240
- e.set(A(this, Se), t, !0);
241
+ e.set(A(this, Ae), t, !0);
241
242
  }
242
243
  get dragOverSide() {
243
- return e.get(A(this, Ae));
244
+ return e.get(A(this, Ie));
244
245
  }
245
246
  set dragOverSide(t) {
246
- e.set(A(this, Ae), t, !0);
247
+ e.set(A(this, Ie), t, !0);
247
248
  }
248
249
  get manifest() {
249
- return this.manifestId ? oe.getManifest(this.manifestId) : null;
250
+ return this.manifestId ? ae.getManifest(this.manifestId) : null;
250
251
  }
251
252
  get canvases() {
252
253
  if (!this.manifestId) return [];
253
- const t = oe.getCanvases(this.manifestId);
254
+ const t = ae.getCanvases(this.manifestId);
254
255
  return t.length > 0 && !this.canvasId && setTimeout(
255
256
  () => {
256
257
  !this.canvasId && t.length > 0 && (this.canvasId = t[0].id);
@@ -269,18 +270,18 @@ class St {
269
270
  }
270
271
  nextCanvas() {
271
272
  if (this.hasNext) {
272
- const t = this.currentCanvasIndex + 1, s = this.canvases[t];
273
- this.canvasId = s.id;
273
+ const t = this.currentCanvasIndex + 1, r = this.canvases[t];
274
+ this.canvasId = r.id;
274
275
  }
275
276
  }
276
277
  previousCanvas() {
277
278
  if (this.hasPrevious) {
278
- const t = this.currentCanvasIndex - 1, s = this.canvases[t];
279
- this.canvasId = s.id;
279
+ const t = this.currentCanvasIndex - 1, r = this.canvases[t];
280
+ this.canvasId = r.id;
280
281
  }
281
282
  }
282
283
  setManifest(t) {
283
- this.manifestId = t, this.canvasId = null, oe.fetchManifest(t);
284
+ this.manifestId = t, this.canvasId = null, ae.fetchManifest(t);
284
285
  }
285
286
  setCanvas(t) {
286
287
  this.canvasId = t;
@@ -296,8 +297,8 @@ class St {
296
297
  document.exitFullscreen();
297
298
  else {
298
299
  const t = document.getElementById("triiiceratops-viewer");
299
- t && t.requestFullscreen().catch((s) => {
300
- console.warn("Fullscreen request failed", s);
300
+ t && t.requestFullscreen().catch((r) => {
301
+ console.warn("Fullscreen request failed", r);
301
302
  });
302
303
  }
303
304
  }
@@ -305,185 +306,185 @@ class St {
305
306
  this.showMetadataDialog = !this.showMetadataDialog;
306
307
  }
307
308
  get searchQuery() {
308
- return e.get(A(this, $e));
309
+ return e.get(A(this, ke));
309
310
  }
310
311
  set searchQuery(t) {
311
- e.set(A(this, $e), t, !0);
312
+ e.set(A(this, ke), t, !0);
312
313
  }
313
314
  get searchResults() {
314
- return e.get(A(this, Ie));
315
+ return e.get(A(this, Ce));
315
316
  }
316
317
  set searchResults(t) {
317
- e.set(A(this, Ie), t, !0);
318
+ e.set(A(this, Ce), t, !0);
318
319
  }
319
320
  get isSearching() {
320
- return e.get(A(this, Te));
321
+ return e.get(A(this, Pe));
321
322
  }
322
323
  set isSearching(t) {
323
- e.set(A(this, Te), t, !0);
324
+ e.set(A(this, Pe), t, !0);
324
325
  }
325
326
  get showSearchPanel() {
326
- return e.get(A(this, ke));
327
+ return e.get(A(this, Me));
327
328
  }
328
329
  set showSearchPanel(t) {
329
- e.set(A(this, ke), t, !0);
330
+ e.set(A(this, Me), t, !0);
330
331
  }
331
332
  toggleSearchPanel() {
332
333
  this.showSearchPanel = !this.showSearchPanel, this.showSearchPanel || (this.searchAnnotations = []);
333
334
  }
334
335
  get searchAnnotations() {
335
- return e.get(A(this, Pe));
336
+ return e.get(A(this, ze));
336
337
  }
337
338
  set searchAnnotations(t) {
338
- e.set(A(this, Pe), t, !0);
339
+ e.set(A(this, ze), t, !0);
339
340
  }
340
341
  get currentCanvasSearchAnnotations() {
341
342
  return this.canvasId ? this.searchAnnotations.filter((t) => t.canvasId === this.canvasId) : [];
342
343
  }
343
344
  async search(t) {
344
- var s, n;
345
+ var r, s;
345
346
  if (t.trim()) {
346
347
  this.isSearching = !0, this.searchQuery = t, this.searchResults = [];
347
348
  try {
348
- const a = this.manifest;
349
- if (!a) throw new Error("No manifest loaded");
350
- let i = a.getService("http://iiif.io/api/search/1/search") || a.getService("http://iiif.io/api/search/0/search");
351
- if (i || a.__jsonld && a.__jsonld.service && (i = (Array.isArray(a.__jsonld.service) ? a.__jsonld.service : [a.__jsonld.service]).find((p) => p.profile === "http://iiif.io/api/search/1/search" || p.profile === "http://iiif.io/api/search/0/search")), !i) {
349
+ const n = this.manifest;
350
+ if (!n) throw new Error("No manifest loaded");
351
+ let a = n.getService("http://iiif.io/api/search/1/search") || n.getService("http://iiif.io/api/search/0/search");
352
+ if (a || n.__jsonld && n.__jsonld.service && (a = (Array.isArray(n.__jsonld.service) ? n.__jsonld.service : [n.__jsonld.service]).find((p) => p.profile === "http://iiif.io/api/search/1/search" || p.profile === "http://iiif.io/api/search/0/search")), !a) {
352
353
  console.warn("No IIIF search service found in manifest"), this.isSearching = !1;
353
354
  return;
354
355
  }
355
- const C = `${i.id || i["@id"]}?q=${encodeURIComponent(t)}`, x = await fetch(C);
356
- if (!x.ok) throw new Error("Search request failed");
357
- const w = await x.json(), $ = w.resources || [], j = [], d = (u) => {
358
- const p = typeof u == "string" ? u : u["@id"] || u.id;
356
+ const I = `${a.id || a["@id"]}?q=${encodeURIComponent(t)}`, c = await fetch(I);
357
+ if (!c.ok) throw new Error("Search request failed");
358
+ const w = await c.json(), k = w.resources || [], z = [], d = (g) => {
359
+ const p = typeof g == "string" ? g : g["@id"] || g.id;
359
360
  if (!p) return null;
360
- const c = p.split("#xywh=");
361
- if (c.length < 2) return null;
362
- const f = c[1].split(",").map(Number);
363
- return f.length === 4 ? f : null;
361
+ const f = p.split("#xywh=");
362
+ if (f.length < 2) return null;
363
+ const v = f[1].split(",").map(Number);
364
+ return v.length === 4 ? v : null;
364
365
  };
365
366
  if (w.hits)
366
- for (const u of w.hits) {
367
- const p = u.annotations || [];
368
- for (const c of p) {
369
- const f = $.find((l) => l["@id"] === c || l.id === c);
370
- if (f && f.on) {
371
- const l = typeof f.on == "string" ? f.on : f.on["@id"] || f.on.id, S = l.split("#")[0], H = d(l), z = this.canvases.findIndex((o) => o.id === S);
372
- if (z >= 0) {
373
- const o = this.canvases[z];
374
- let T = "Canvas " + (z + 1);
367
+ for (const g of w.hits) {
368
+ const p = g.annotations || [];
369
+ for (const f of p) {
370
+ const v = k.find((o) => o["@id"] === f || o.id === f);
371
+ if (v && v.on) {
372
+ const o = typeof v.on == "string" ? v.on : v.on["@id"] || v.on.id, S = o.split("#")[0], G = d(o), L = this.canvases.findIndex((l) => l.id === S);
373
+ if (L >= 0) {
374
+ const l = this.canvases[L];
375
+ let C = "Canvas " + (L + 1);
375
376
  try {
376
- if (o.getLabel) {
377
- const b = o.getLabel();
378
- Array.isArray(b) && b.length > 0 ? T = b[0].value : typeof b == "string" && (T = b);
379
- } else o.label && (typeof o.label == "string" ? T = o.label : Array.isArray(o.label) && (T = (s = o.label[0]) == null ? void 0 : s.value));
377
+ if (l.getLabel) {
378
+ const _ = l.getLabel();
379
+ Array.isArray(_) && _.length > 0 ? C = _[0].value : typeof _ == "string" && (C = _);
380
+ } else l.label && (typeof l.label == "string" ? C = l.label : Array.isArray(l.label) && (C = (r = l.label[0]) == null ? void 0 : r.value));
380
381
  } catch {
381
382
  }
382
- j.push({
383
+ z.push({
383
384
  type: "hit",
384
- before: u.before,
385
- match: u.match,
386
- after: u.after,
387
- canvasIndex: z,
388
- canvasLabel: String(T),
389
- bounds: H
385
+ before: g.before,
386
+ match: g.match,
387
+ after: g.after,
388
+ canvasIndex: L,
389
+ canvasLabel: String(C),
390
+ bounds: G
390
391
  });
391
392
  }
392
393
  }
393
394
  }
394
395
  }
395
- else if ($.length > 0)
396
- for (const u of $) {
397
- const p = typeof u.on == "string" ? u.on : u.on["@id"] || u.on.id, c = p.split("#")[0], f = d(p), l = this.canvases.findIndex((S) => S.id === c);
398
- if (l >= 0) {
399
- const S = this.canvases[l];
400
- let H = "Canvas " + (l + 1);
396
+ else if (k.length > 0)
397
+ for (const g of k) {
398
+ const p = typeof g.on == "string" ? g.on : g.on["@id"] || g.on.id, f = p.split("#")[0], v = d(p), o = this.canvases.findIndex((S) => S.id === f);
399
+ if (o >= 0) {
400
+ const S = this.canvases[o];
401
+ let G = "Canvas " + (o + 1);
401
402
  try {
402
403
  if (S.getLabel) {
403
- const z = S.getLabel();
404
- Array.isArray(z) && z.length > 0 ? H = z[0].value : typeof z == "string" && (H = z);
405
- } else S.label && (typeof S.label == "string" ? H = S.label : Array.isArray(S.label) && (H = (n = S.label[0]) == null ? void 0 : n.value));
404
+ const L = S.getLabel();
405
+ Array.isArray(L) && L.length > 0 ? G = L[0].value : typeof L == "string" && (G = L);
406
+ } else S.label && (typeof S.label == "string" ? G = S.label : Array.isArray(S.label) && (G = (s = S.label[0]) == null ? void 0 : s.value));
406
407
  } catch {
407
408
  }
408
- j.push({
409
+ z.push({
409
410
  type: "resource",
410
- match: u.resource && u.resource.chars ? u.resource.chars : u.chars || "",
411
- canvasIndex: l,
412
- canvasLabel: String(H),
413
- bounds: f
411
+ match: g.resource && g.resource.chars ? g.resource.chars : g.chars || "",
412
+ canvasIndex: o,
413
+ canvasLabel: String(G),
414
+ bounds: v
414
415
  });
415
416
  }
416
417
  }
417
- this.searchResults = j, this.searchAnnotations = j.filter((u) => u.bounds).map((u, p) => {
418
- const c = this.canvases[u.canvasIndex], f = `${c.id}#xywh=${u.bounds.join(",")}`;
418
+ this.searchResults = z, this.searchAnnotations = z.filter((g) => g.bounds).map((g, p) => {
419
+ const f = this.canvases[g.canvasIndex], v = `${f.id}#xywh=${g.bounds.join(",")}`;
419
420
  return {
420
421
  "@id": `urn:search-hit:${p}`,
421
422
  "@type": "oa:Annotation",
422
423
  motivation: "sc:painting",
423
- on: f,
424
- canvasId: c.id,
425
- resource: { "@type": "cnt:ContentAsText", chars: u.match },
424
+ on: v,
425
+ canvasId: f.id,
426
+ resource: { "@type": "cnt:ContentAsText", chars: g.match },
426
427
  // Flag to identify styling in Overlay?
427
428
  // Or just standard rendering.
428
429
  isSearchHit: !0
429
430
  };
430
431
  });
431
- } catch (a) {
432
- console.error("Search error:", a);
432
+ } catch (n) {
433
+ console.error("Search error:", n);
433
434
  } finally {
434
435
  this.isSearching = !1;
435
436
  }
436
437
  }
437
438
  }
438
439
  get plugins() {
439
- return e.get(A(this, Me));
440
+ return e.get(A(this, Te));
440
441
  }
441
442
  set plugins(t) {
442
- e.set(A(this, Me), t, !0);
443
+ e.set(A(this, Te), t, !0);
443
444
  }
444
445
  get pluginMenuButtons() {
445
- return e.get(A(this, Ce));
446
+ return e.get(A(this, je));
446
447
  }
447
448
  set pluginMenuButtons(t) {
448
- e.set(A(this, Ce), t, !0);
449
+ e.set(A(this, je), t, !0);
449
450
  }
450
451
  get pluginPanels() {
451
- return e.get(A(this, je));
452
+ return e.get(A(this, Le));
452
453
  }
453
454
  set pluginPanels(t) {
454
- e.set(A(this, je), t, !0);
455
+ e.set(A(this, Le), t, !0);
455
456
  }
456
457
  get osdViewer() {
457
- return e.get(A(this, ze));
458
+ return e.get(A(this, Oe));
458
459
  }
459
460
  set osdViewer(t) {
460
- e.set(A(this, ze), t, !0);
461
+ e.set(A(this, Oe), t, !0);
461
462
  }
462
463
  createPluginContext() {
463
464
  const t = this;
464
465
  return {
465
466
  viewerState: t,
466
467
  getOSDViewer: () => t.osdViewer,
467
- registerMenuButton(s) {
468
- t.pluginMenuButtons.find((n) => n.id === s.id) || (t.pluginMenuButtons = [...t.pluginMenuButtons, s]);
468
+ registerMenuButton(r) {
469
+ t.pluginMenuButtons.find((s) => s.id === r.id) || (t.pluginMenuButtons = [...t.pluginMenuButtons, r]);
469
470
  },
470
- unregisterMenuButton(s) {
471
- t.pluginMenuButtons = t.pluginMenuButtons.filter((n) => n.id !== s);
471
+ unregisterMenuButton(r) {
472
+ t.pluginMenuButtons = t.pluginMenuButtons.filter((s) => s.id !== r);
472
473
  },
473
- registerPanel(s) {
474
- t.pluginPanels.find((n) => n.id === s.id) || (t.pluginPanels = [...t.pluginPanels, s]);
474
+ registerPanel(r) {
475
+ t.pluginPanels.find((s) => s.id === r.id) || (t.pluginPanels = [...t.pluginPanels, r]);
475
476
  },
476
- unregisterPanel(s) {
477
- t.pluginPanels = t.pluginPanels.filter((n) => n.id !== s);
477
+ unregisterPanel(r) {
478
+ t.pluginPanels = t.pluginPanels.filter((s) => s.id !== r);
478
479
  },
479
- emit(s, n) {
480
- const a = t.pluginEventHandlers.get(s);
481
- a == null || a.forEach((i) => i(n));
480
+ emit(r, s) {
481
+ const n = t.pluginEventHandlers.get(r);
482
+ n == null || n.forEach((a) => a(s));
482
483
  },
483
- on(s, n) {
484
- return t.pluginEventHandlers.has(s) || t.pluginEventHandlers.set(s, /* @__PURE__ */ new Set()), t.pluginEventHandlers.get(s).add(n), () => {
485
- var a;
486
- (a = t.pluginEventHandlers.get(s)) == null || a.delete(n);
484
+ on(r, s) {
485
+ return t.pluginEventHandlers.has(r) || t.pluginEventHandlers.set(r, /* @__PURE__ */ new Set()), t.pluginEventHandlers.get(r).add(s), () => {
486
+ var n;
487
+ (n = t.pluginEventHandlers.get(r)) == null || n.delete(s);
487
488
  };
488
489
  }
489
490
  };
@@ -492,7 +493,7 @@ class St {
492
493
  * Register a plugin with this viewer instance.
493
494
  */
494
495
  registerPlugin(t) {
495
- if (this.plugins.find((s) => s.id === t.id)) {
496
+ if (this.plugins.find((r) => r.id === t.id)) {
496
497
  console.warn(`[Triiiceratops] Plugin "${t.id}" already registered`);
497
498
  return;
498
499
  }
@@ -502,37 +503,248 @@ class St {
502
503
  * Unregister a plugin by ID.
503
504
  */
504
505
  unregisterPlugin(t) {
505
- var n;
506
- const s = this.plugins.find((a) => a.id === t);
507
- s && ((n = s.onDestroy) == null || n.call(s), this.plugins = this.plugins.filter((a) => a.id !== t), this.pluginMenuButtons = this.pluginMenuButtons.filter((a) => !a.id.startsWith(`${t}:`)), this.pluginPanels = this.pluginPanels.filter((a) => !a.id.startsWith(`${t}:`)));
506
+ var s;
507
+ const r = this.plugins.find((n) => n.id === t);
508
+ r && ((s = r.onDestroy) == null || s.call(r), this.plugins = this.plugins.filter((n) => n.id !== t), this.pluginMenuButtons = this.pluginMenuButtons.filter((n) => !n.id.startsWith(`${t}:`)), this.pluginPanels = this.pluginPanels.filter((n) => !n.id.startsWith(`${t}:`)));
508
509
  }
509
510
  /**
510
511
  * Called by OSDViewer when OpenSeadragon is ready.
511
512
  */
512
513
  notifyOSDReady(t) {
513
- var s;
514
+ var r;
514
515
  this.osdViewer = t;
515
- for (const n of this.plugins)
516
- (s = n.onViewerReady) == null || s.call(n, t);
516
+ for (const s of this.plugins)
517
+ (r = s.onViewerReady) == null || r.call(s, t);
517
518
  }
518
519
  /**
519
520
  * Destroy all plugins (called on viewer unmount).
520
521
  */
521
522
  destroyAllPlugins() {
522
523
  var t;
523
- for (const s of this.plugins)
524
- (t = s.onDestroy) == null || t.call(s);
524
+ for (const r of this.plugins)
525
+ (t = r.onDestroy) == null || t.call(r);
525
526
  this.plugins = [], this.pluginMenuButtons = [], this.pluginPanels = [], this.pluginEventHandlers.clear();
526
527
  }
527
528
  }
528
- de = new WeakMap(), ge = new WeakMap(), ue = new WeakMap(), fe = new WeakMap(), he = new WeakMap(), ve = new WeakMap(), pe = new WeakMap(), me = new WeakMap(), _e = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), xe = new WeakMap(), we = new WeakMap(), Se = new WeakMap(), Ae = new WeakMap(), $e = new WeakMap(), Ie = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Pe = new WeakMap(), Me = new WeakMap(), Ce = new WeakMap(), je = new WeakMap(), ze = new WeakMap();
529
- const ae = "triiiceratops:viewerState";
530
- function qe(r) {
531
- return r.id || r["@id"] || (typeof r.getId == "function" ? r.getId() : "");
529
+ fe = new WeakMap(), ue = new WeakMap(), ge = new WeakMap(), ve = new WeakMap(), he = new WeakMap(), pe = new WeakMap(), me = new WeakMap(), be = new WeakMap(), _e = new WeakMap(), ye = new WeakMap(), we = new WeakMap(), xe = new WeakMap(), Se = new WeakMap(), Ae = new WeakMap(), Ie = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), Pe = new WeakMap(), Me = new WeakMap(), ze = new WeakMap(), Te = new WeakMap(), je = new WeakMap(), Le = new WeakMap(), Oe = new WeakMap();
530
+ const se = "triiiceratops:viewerState", Ct = [
531
+ "light",
532
+ "dark",
533
+ "cupcake",
534
+ "bumblebee",
535
+ "emerald",
536
+ "corporate",
537
+ "synthwave",
538
+ "retro",
539
+ "cyberpunk",
540
+ "valentine",
541
+ "halloween",
542
+ "garden",
543
+ "forest",
544
+ "aqua",
545
+ "lofi",
546
+ "pastel",
547
+ "fantasy",
548
+ "wireframe",
549
+ "black",
550
+ "luxury",
551
+ "dracula",
552
+ "cmyk",
553
+ "autumn",
554
+ "business",
555
+ "acid",
556
+ "lemonade",
557
+ "night",
558
+ "coffee",
559
+ "winter",
560
+ "dim",
561
+ "nord",
562
+ "sunset",
563
+ "caramellatte",
564
+ "abyss",
565
+ "silk"
566
+ ];
567
+ function Pt(i) {
568
+ i = i.replace(/^#/, "");
569
+ let t, r, s;
570
+ if (i.length === 3)
571
+ t = parseInt(i[0] + i[0], 16), r = parseInt(i[1] + i[1], 16), s = parseInt(i[2] + i[2], 16);
572
+ else if (i.length === 6 || i.length === 8)
573
+ t = parseInt(i.slice(0, 2), 16), r = parseInt(i.slice(2, 4), 16), s = parseInt(i.slice(4, 6), 16);
574
+ else
575
+ return null;
576
+ return isNaN(t) || isNaN(r) || isNaN(s) ? null : { r: t, g: r, b: s };
577
+ }
578
+ function Mt(i) {
579
+ const t = i.match(
580
+ /rgba?\(\s*(\d+(?:\.\d+)?%?)\s*[,\s]\s*(\d+(?:\.\d+)?%?)\s*[,\s]\s*(\d+(?:\.\d+)?%?)(?:\s*[,/]\s*(\d*\.?\d+%?))?\s*\)/i
581
+ );
582
+ if (!t) return null;
583
+ const r = (y) => y.endsWith("%") ? parseFloat(y) / 100 * 255 : parseFloat(y), s = r(t[1]), n = r(t[2]), a = r(t[3]);
584
+ return isNaN(s) || isNaN(n) || isNaN(a) ? null : { r: s, g: n, b: a };
585
+ }
586
+ function Ee(i) {
587
+ const t = i / 255;
588
+ return t <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
532
589
  }
533
- function De(r) {
534
- if (!r) return null;
535
- const t = r.match(/xywh=(\d+),(\d+),(\d+),(\d+)/);
590
+ function zt(i, t, r) {
591
+ return {
592
+ x: 0.4124564 * i + 0.3575761 * t + 0.1804375 * r,
593
+ y: 0.2126729 * i + 0.7151522 * t + 0.072175 * r,
594
+ z: 0.0193339 * i + 0.119192 * t + 0.9503041 * r
595
+ };
596
+ }
597
+ function Tt(i, t, r) {
598
+ const s = 0.8189330101 * i + 0.3618667424 * t - 0.1288597137 * r, n = 0.0329845436 * i + 0.9293118715 * t + 0.0361456387 * r, a = 0.0482003018 * i + 0.2643662691 * t + 0.633851707 * r, y = Math.cbrt(s), I = Math.cbrt(n), c = Math.cbrt(a);
599
+ return {
600
+ L: 0.2104542553 * y + 0.793617785 * I - 0.0040720468 * c,
601
+ a: 1.9779984951 * y - 2.428592205 * I + 0.4505937099 * c,
602
+ b: 0.0259040371 * y + 0.7827717662 * I - 0.808675766 * c
603
+ };
604
+ }
605
+ function jt(i, t, r) {
606
+ const s = Math.sqrt(t * t + r * r);
607
+ let n = Math.atan2(r, t) * 180 / Math.PI;
608
+ return n < 0 && (n += 360), { L: i, C: s, h: n };
609
+ }
610
+ function We(i, t, r) {
611
+ const s = Ee(i), n = Ee(t), a = Ee(r), { x: y, y: I, z: c } = zt(s, n, a), { L: w, a: k, b: z } = Tt(y, I, c);
612
+ return jt(w, k, z);
613
+ }
614
+ function Ue(i, t, r) {
615
+ const s = (i * 100).toFixed(2), n = t.toFixed(4), a = t < 1e-4 ? 0 : r.toFixed(2);
616
+ return `oklch(${s}% ${n} ${a})`;
617
+ }
618
+ function Lt(i) {
619
+ return i.trim().toLowerCase().startsWith("oklch(");
620
+ }
621
+ function Ot(i) {
622
+ return /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(
623
+ i.trim()
624
+ );
625
+ }
626
+ function Dt(i) {
627
+ return /^rgba?\s*\(/i.test(i.trim());
628
+ }
629
+ function Et(i) {
630
+ const t = Pt(i);
631
+ if (!t)
632
+ return console.warn(`Invalid hex color: ${i}, returning as-is`), i;
633
+ const { L: r, C: s, h: n } = We(t.r, t.g, t.b);
634
+ return Ue(r, s, n);
635
+ }
636
+ function Rt(i) {
637
+ const t = Mt(i);
638
+ if (!t)
639
+ return console.warn(`Invalid rgb color: ${i}, returning as-is`), i;
640
+ const { L: r, C: s, h: n } = We(t.r, t.g, t.b);
641
+ return Ue(r, s, n);
642
+ }
643
+ function Gt(i) {
644
+ const t = i.trim();
645
+ return Lt(t) ? t : Ot(t) ? Et(t) : Dt(t) ? Rt(t) : (console.warn(`Unrecognized color format: ${i}, passing through as-is`), i);
646
+ }
647
+ const Je = {
648
+ // Semantic colors
649
+ primary: "--color-primary",
650
+ primaryContent: "--color-primary-content",
651
+ secondary: "--color-secondary",
652
+ secondaryContent: "--color-secondary-content",
653
+ accent: "--color-accent",
654
+ accentContent: "--color-accent-content",
655
+ neutral: "--color-neutral",
656
+ neutralContent: "--color-neutral-content",
657
+ // Base colors
658
+ base100: "--color-base-100",
659
+ base200: "--color-base-200",
660
+ base300: "--color-base-300",
661
+ baseContent: "--color-base-content",
662
+ // State colors
663
+ info: "--color-info",
664
+ infoContent: "--color-info-content",
665
+ success: "--color-success",
666
+ successContent: "--color-success-content",
667
+ warning: "--color-warning",
668
+ warningContent: "--color-warning-content",
669
+ error: "--color-error",
670
+ errorContent: "--color-error-content",
671
+ // Border radius
672
+ radiusBox: "--radius-box",
673
+ radiusField: "--radius-field",
674
+ radiusSelector: "--radius-selector",
675
+ // Sizing
676
+ sizeSelector: "--size-selector",
677
+ sizeField: "--size-field",
678
+ // Border
679
+ border: "--border",
680
+ // Effects
681
+ depth: "--depth",
682
+ noise: "--noise",
683
+ // Color scheme (handled specially, not a CSS variable)
684
+ colorScheme: "color-scheme"
685
+ }, Ft = /* @__PURE__ */ new Set([
686
+ "primary",
687
+ "primaryContent",
688
+ "secondary",
689
+ "secondaryContent",
690
+ "accent",
691
+ "accentContent",
692
+ "neutral",
693
+ "neutralContent",
694
+ "base100",
695
+ "base200",
696
+ "base300",
697
+ "baseContent",
698
+ "info",
699
+ "infoContent",
700
+ "success",
701
+ "successContent",
702
+ "warning",
703
+ "warningContent",
704
+ "error",
705
+ "errorContent"
706
+ ]);
707
+ function gi(i) {
708
+ return Ct.includes(i);
709
+ }
710
+ function Vt(i, t) {
711
+ i.setAttribute("data-theme", t);
712
+ }
713
+ function $t(i, t) {
714
+ for (const [r, s] of Object.entries(t)) {
715
+ if (s == null) continue;
716
+ const n = r;
717
+ if (n === "colorScheme") {
718
+ i.style.colorScheme = s;
719
+ continue;
720
+ }
721
+ const a = Je[n];
722
+ if (!a) continue;
723
+ let y = String(s);
724
+ Ft.has(n) && (y = Gt(y)), i.style.setProperty(a, y);
725
+ }
726
+ }
727
+ function Bt(i) {
728
+ for (const [t, r] of Object.entries(Je))
729
+ t === "colorScheme" ? i.style.colorScheme = "" : i.style.removeProperty(r);
730
+ }
731
+ function vi(i) {
732
+ try {
733
+ const t = JSON.parse(i);
734
+ return typeof t == "object" && t !== null ? t : null;
735
+ } catch {
736
+ return null;
737
+ }
738
+ }
739
+ function Ht(i, t, r) {
740
+ t ? Vt(i, t) : i.removeAttribute("data-theme"), r ? $t(i, r) : Bt(i);
741
+ }
742
+ function Ke(i) {
743
+ return i.id || i["@id"] || (typeof i.getId == "function" ? i.getId() : "");
744
+ }
745
+ function Re(i) {
746
+ if (!i) return null;
747
+ const t = i.match(/xywh=(\d+),(\d+),(\d+),(\d+)/);
536
748
  return t ? {
537
749
  x: parseInt(t[1], 10),
538
750
  y: parseInt(t[2], 10),
@@ -540,249 +752,249 @@ function De(r) {
540
752
  h: parseInt(t[4], 10)
541
753
  } : null;
542
754
  }
543
- function At(r) {
544
- const t = $t(r);
755
+ function Nt(i) {
756
+ const t = Yt(i);
545
757
  if (t)
546
- return It(t);
547
- const s = Mt(r);
548
- return s ? {
758
+ return Xt(t);
759
+ const r = Ut(i);
760
+ return r ? {
549
761
  type: "RECTANGLE",
550
- x: s.x,
551
- y: s.y,
552
- w: s.w,
553
- h: s.h
762
+ x: r.x,
763
+ y: r.y,
764
+ w: r.w,
765
+ h: r.h
554
766
  } : null;
555
767
  }
556
- function $t(r) {
557
- var s, n;
558
- if (typeof r.getTarget == "function") {
559
- const a = ((s = r.__jsonld) == null ? void 0 : s.on) || ((n = r.__jsonld) == null ? void 0 : n.target);
560
- if (a)
561
- return Be(a);
562
- }
563
- const t = r.target || r.on;
564
- return t ? Be(t) : null;
768
+ function Yt(i) {
769
+ var r, s;
770
+ if (typeof i.getTarget == "function") {
771
+ const n = ((r = i.__jsonld) == null ? void 0 : r.on) || ((s = i.__jsonld) == null ? void 0 : s.target);
772
+ if (n)
773
+ return Ye(n);
774
+ }
775
+ const t = i.target || i.on;
776
+ return t ? Ye(t) : null;
565
777
  }
566
- function Be(r) {
567
- if (!r) return null;
568
- if (Array.isArray(r))
569
- for (const t of r) {
570
- const s = Ne(t);
571
- if (s) return s;
778
+ function Ye(i) {
779
+ if (!i) return null;
780
+ if (Array.isArray(i))
781
+ for (const t of i) {
782
+ const r = Xe(t);
783
+ if (r) return r;
572
784
  }
573
785
  else
574
- return Ne(r);
786
+ return Xe(i);
575
787
  return null;
576
788
  }
577
- function Ne(r) {
578
- var s;
579
- if (!r) return null;
580
- const t = r.selector || r;
581
- return (t == null ? void 0 : t.type) === "SvgSelector" && t.value ? t.value : ((s = t == null ? void 0 : t.item) == null ? void 0 : s.type) === "SvgSelector" && t.item.value ? t.item.value : null;
789
+ function Xe(i) {
790
+ var r;
791
+ if (!i) return null;
792
+ const t = i.selector || i;
793
+ return (t == null ? void 0 : t.type) === "SvgSelector" && t.value ? t.value : ((r = t == null ? void 0 : t.item) == null ? void 0 : r.type) === "SvgSelector" && t.item.value ? t.item.value : null;
582
794
  }
583
- function It(r) {
795
+ function Xt(i) {
584
796
  try {
585
- const s = new DOMParser().parseFromString(r, "image/svg+xml");
586
- if (s.documentElement.nodeName === "parsererror")
587
- return console.warn("Failed to parse SVG selector:", r), null;
588
- const n = [], a = s.querySelectorAll("polygon");
589
- for (const C of a) {
590
- const x = C.getAttribute("points");
591
- if (x) {
592
- const w = Tt(x);
593
- n.push(...w);
797
+ const r = new DOMParser().parseFromString(i, "image/svg+xml");
798
+ if (r.documentElement.nodeName === "parsererror")
799
+ return console.warn("Failed to parse SVG selector:", i), null;
800
+ const s = [], n = r.querySelectorAll("polygon");
801
+ for (const I of n) {
802
+ const c = I.getAttribute("points");
803
+ if (c) {
804
+ const w = qt(c);
805
+ s.push(...w);
594
806
  }
595
807
  }
596
- const i = s.querySelectorAll("path");
597
- for (const C of i) {
598
- const x = C.getAttribute("d");
599
- if (x) {
600
- const w = kt(x);
601
- n.push(...w);
808
+ const a = r.querySelectorAll("path");
809
+ for (const I of a) {
810
+ const c = I.getAttribute("d");
811
+ if (c) {
812
+ const w = Qt(c);
813
+ s.push(...w);
602
814
  }
603
815
  }
604
- const I = s.querySelectorAll("circle");
605
- for (const C of I) {
606
- const x = parseFloat(C.getAttribute("cx") || "0"), w = parseFloat(C.getAttribute("cy") || "0"), $ = parseFloat(C.getAttribute("r") || "0"), j = Pt(x, w, $);
607
- n.push(...j);
816
+ const y = r.querySelectorAll("circle");
817
+ for (const I of y) {
818
+ const c = parseFloat(I.getAttribute("cx") || "0"), w = parseFloat(I.getAttribute("cy") || "0"), k = parseFloat(I.getAttribute("r") || "0"), z = Wt(c, w, k);
819
+ s.push(...z);
608
820
  }
609
- return n.length === 0 ? null : {
821
+ return s.length === 0 ? null : {
610
822
  type: "POLYGON",
611
- points: n
823
+ points: s
612
824
  };
613
825
  } catch (t) {
614
826
  return console.warn("Failed to convert SVG to polygon:", t), null;
615
827
  }
616
828
  }
617
- function Tt(r) {
618
- const t = [], s = r.trim().split(/\s+/);
619
- for (const n of s) {
620
- const [a, i] = n.split(",").map((I) => parseFloat(I));
621
- !isNaN(a) && !isNaN(i) && t.push([a, i]);
829
+ function qt(i) {
830
+ const t = [], r = i.trim().split(/\s+/);
831
+ for (const s of r) {
832
+ const [n, a] = s.split(",").map((y) => parseFloat(y));
833
+ !isNaN(n) && !isNaN(a) && t.push([n, a]);
622
834
  }
623
835
  return t;
624
836
  }
625
- function kt(r) {
626
- const t = [], s = /[ML]\s*([\d.]+)[,\s]+([\d.]+)/g;
627
- let n;
628
- for (; (n = s.exec(r)) !== null; ) {
629
- const a = parseFloat(n[1]), i = parseFloat(n[2]);
630
- !isNaN(a) && !isNaN(i) && t.push([a, i]);
837
+ function Qt(i) {
838
+ const t = [], r = /[ML]\s*([\d.]+)[,\s]+([\d.]+)/g;
839
+ let s;
840
+ for (; (s = r.exec(i)) !== null; ) {
841
+ const n = parseFloat(s[1]), a = parseFloat(s[2]);
842
+ !isNaN(n) && !isNaN(a) && t.push([n, a]);
631
843
  }
632
844
  return t;
633
845
  }
634
- function Pt(r, t, s, n = 8) {
635
- const a = [];
636
- for (let i = 0; i < n; i++) {
637
- const I = i / n * Math.PI * 2, C = r + s * Math.cos(I), x = t + s * Math.sin(I);
638
- a.push([C, x]);
846
+ function Wt(i, t, r, s = 8) {
847
+ const n = [];
848
+ for (let a = 0; a < s; a++) {
849
+ const y = a / s * Math.PI * 2, I = i + r * Math.cos(y), c = t + r * Math.sin(y);
850
+ n.push([I, c]);
639
851
  }
640
- return a;
852
+ return n;
641
853
  }
642
- function Mt(r) {
643
- var s;
644
- if (typeof r.getTarget == "function") {
645
- const n = r.getTarget();
646
- if (typeof n == "string" && n.includes("xywh="))
647
- return De(n);
648
- const a = (s = r.__jsonld) == null ? void 0 : s.on;
649
- if (a) {
650
- const i = Ee(a);
651
- if (i) return i;
854
+ function Ut(i) {
855
+ var r;
856
+ if (typeof i.getTarget == "function") {
857
+ const s = i.getTarget();
858
+ if (typeof s == "string" && s.includes("xywh="))
859
+ return Re(s);
860
+ const n = (r = i.__jsonld) == null ? void 0 : r.on;
861
+ if (n) {
862
+ const a = Ge(n);
863
+ if (a) return a;
652
864
  }
653
865
  }
654
- const t = r.target || r.on;
655
- return t ? Ee(t) : null;
866
+ const t = i.target || i.on;
867
+ return t ? Ge(t) : null;
656
868
  }
657
- function Ee(r) {
658
- if (!r) return null;
659
- if (Array.isArray(r))
660
- for (const t of r) {
661
- const s = Ee(t);
662
- if (s) return s;
869
+ function Ge(i) {
870
+ if (!i) return null;
871
+ if (Array.isArray(i))
872
+ for (const t of i) {
873
+ const r = Ge(t);
874
+ if (r) return r;
663
875
  }
664
- if (typeof r == "string" && r.includes("xywh="))
665
- return De(r);
666
- if (r.selector) {
667
- const t = r.selector, s = t.item || t;
668
- if (s.value && typeof s.value == "string" && s.value.includes("xywh="))
669
- return De(s.value);
876
+ if (typeof i == "string" && i.includes("xywh="))
877
+ return Re(i);
878
+ if (i.selector) {
879
+ const t = i.selector, r = t.item || t;
880
+ if (r.value && typeof r.value == "string" && r.value.includes("xywh="))
881
+ return Re(r.value);
670
882
  }
671
883
  return null;
672
884
  }
673
- function Ct(r) {
674
- let t = "", s = !1;
675
- if (typeof r.getBody == "function") {
676
- const n = r.getBody();
677
- if (n && Array.isArray(n)) {
678
- const a = [];
679
- for (const i of n) {
680
- const I = i.getValue ? i.getValue() : "";
681
- if (I) {
682
- a.push(I);
683
- const C = i.getFormat ? i.getFormat() : "";
684
- (C === "text/html" || C === "application/html") && (s = !0);
885
+ function Jt(i) {
886
+ let t = "", r = !1;
887
+ if (typeof i.getBody == "function") {
888
+ const s = i.getBody();
889
+ if (s && Array.isArray(s)) {
890
+ const n = [];
891
+ for (const a of s) {
892
+ const y = a.getValue ? a.getValue() : "";
893
+ if (y) {
894
+ n.push(y);
895
+ const I = a.getFormat ? a.getFormat() : "";
896
+ (I === "text/html" || I === "application/html") && (r = !0);
685
897
  }
686
898
  }
687
- t = a.join(" ");
899
+ t = n.join(" ");
688
900
  }
689
901
  } else {
690
- const n = (i) => i && (i.chars || i.value || i["cnt:chars"]) || "", a = (i) => i ? i.format === "text/html" || i.type === "TextualBody" : !1;
691
- if (r.resource) {
692
- const i = Array.isArray(r.resource) ? r.resource : [r.resource];
693
- t = i.map(n).filter(Boolean).join(" "), s = i.some(a);
694
- } else if (r.body) {
695
- const i = Array.isArray(r.body) ? r.body : [r.body];
696
- t = i.map(n).filter(Boolean).join(" "), s = i.some(a);
902
+ const s = (a) => a && (a.chars || a.value || a["cnt:chars"]) || "", n = (a) => a ? a.format === "text/html" || a.type === "TextualBody" : !1;
903
+ if (i.resource) {
904
+ const a = Array.isArray(i.resource) ? i.resource : [i.resource];
905
+ t = a.map(s).filter(Boolean).join(" "), r = a.some(n);
906
+ } else if (i.body) {
907
+ const a = Array.isArray(i.body) ? i.body : [i.body];
908
+ t = a.map(s).filter(Boolean).join(" "), r = a.some(n);
697
909
  }
698
910
  }
699
- return t || (typeof r.getLabel == "function" ? t = r.getLabel() || "" : r.label && (t = Array.isArray(r.label) ? r.label.join(" ") : r.label)), { value: t || "Annotation", isHtml: s };
911
+ return t || (typeof i.getLabel == "function" ? t = i.getLabel() || "" : i.label && (t = Array.isArray(i.label) ? i.label.join(" ") : i.label)), { value: t || "Annotation", isHtml: r };
700
912
  }
701
- function jt(r, t, s = !1) {
702
- const n = qe(r) || `anno-${t}`, a = At(r);
703
- if (!a)
913
+ function Kt(i, t, r = !1) {
914
+ const s = Ke(i) || `anno-${t}`, n = Nt(i);
915
+ if (!n)
704
916
  return null;
705
- const i = Ct(r);
917
+ const a = Jt(i);
706
918
  return {
707
- id: n,
708
- geometry: a,
709
- body: i,
710
- isSearchHit: s
919
+ id: s,
920
+ geometry: n,
921
+ body: a,
922
+ isSearchHit: r
711
923
  };
712
924
  }
713
- function zt(r, t = /* @__PURE__ */ new Set()) {
714
- return r.map((s, n) => {
715
- const a = t.has(qe(s));
716
- return jt(s, n, a);
717
- }).filter((s) => s !== null);
925
+ function Zt(i, t = /* @__PURE__ */ new Set()) {
926
+ return i.map((r, s) => {
927
+ const n = t.has(Ke(r));
928
+ return Kt(r, s, n);
929
+ }).filter((r) => r !== null);
718
930
  }
719
- var Lt = e.from_html("<div></div>"), Dt = e.from_svg('<svg class="absolute pointer-events-auto"><title> </title><polygon stroke-width="2"></polygon></svg>'), Et = e.from_html('<div class="w-full h-full relative"><div class="w-full h-full osd-background bg-base-100"></div> <!></div>');
720
- function Qe(r, t) {
931
+ var er = e.from_html("<div></div>"), tr = e.from_svg('<svg class="absolute pointer-events-auto"><title> </title><polygon stroke-width="2"></polygon></svg>'), rr = e.from_html('<div class="w-full h-full relative"><div class="w-full h-full osd-background bg-base-100"></div> <!></div>');
932
+ function Ze(i, t) {
721
933
  e.push(t, !0);
722
- let s = e.prop(t, "tileSources", 7), n = e.prop(t, "viewerState", 7), a = e.state(void 0), i = e.state(void 0), I = e.state(0), C = e.derived(() => {
723
- if (!n().manifestId || !n().canvasId)
934
+ let r = e.prop(t, "tileSources", 7), s = e.prop(t, "viewerState", 7), n = e.state(void 0), a = e.state(void 0), y = e.state(0), I = e.derived(() => {
935
+ if (!s().manifestId || !s().canvasId)
724
936
  return [];
725
- const c = oe.getAnnotations(n().manifestId, n().canvasId), f = n().currentCanvasSearchAnnotations;
726
- return [...c, ...f];
727
- }), x = e.derived(() => {
728
- const c = /* @__PURE__ */ new Set();
729
- return n().currentCanvasSearchAnnotations.forEach((f) => {
730
- const l = f.id || f["@id"];
731
- l && c.add(l);
732
- }), c;
733
- }), w = e.derived(() => zt(e.get(C), e.get(x))), $ = e.derived(() => {
734
- if (e.get(I), !e.get(i) || !e.get(w).length)
937
+ const f = ae.getAnnotations(s().manifestId, s().canvasId), v = s().currentCanvasSearchAnnotations;
938
+ return [...f, ...v];
939
+ }), c = e.derived(() => {
940
+ const f = /* @__PURE__ */ new Set();
941
+ return s().currentCanvasSearchAnnotations.forEach((v) => {
942
+ const o = v.id || v["@id"];
943
+ o && f.add(o);
944
+ }), f;
945
+ }), w = e.derived(() => Zt(e.get(I), e.get(c))), k = e.derived(() => {
946
+ if (e.get(y), !e.get(a) || !e.get(w).length)
735
947
  return [];
736
- const c = e.get(i).world.getItemAt(0);
737
- if (!c)
948
+ const f = e.get(a).world.getItemAt(0);
949
+ if (!f)
738
950
  return [];
739
- const f = [];
740
- for (const l of e.get(w)) {
741
- if (!l.isSearchHit) if (n().showAnnotations) {
742
- if (!n().visibleAnnotationIds.has(l.id))
951
+ const v = [];
952
+ for (const o of e.get(w)) {
953
+ if (!o.isSearchHit) if (s().showAnnotations) {
954
+ if (!s().visibleAnnotationIds.has(o.id))
743
955
  continue;
744
956
  } else continue;
745
- if (l.geometry.type === "RECTANGLE") {
746
- const S = c.imageToViewportRectangle(l.geometry.x, l.geometry.y, l.geometry.w, l.geometry.h), H = e.get(i).viewport.viewportToViewerElementRectangle(S);
747
- f.push({
748
- id: l.id,
957
+ if (o.geometry.type === "RECTANGLE") {
958
+ const S = f.imageToViewportRectangle(o.geometry.x, o.geometry.y, o.geometry.w, o.geometry.h), G = e.get(a).viewport.viewportToViewerElementRectangle(S);
959
+ v.push({
960
+ id: o.id,
749
961
  type: "RECTANGLE",
750
962
  rect: {
751
- x: H.x,
752
- y: H.y,
753
- width: H.width,
754
- height: H.height
963
+ x: G.x,
964
+ y: G.y,
965
+ width: G.width,
966
+ height: G.height
755
967
  },
756
- isSearchHit: l.isSearchHit,
757
- tooltip: l.body.value
968
+ isSearchHit: o.isSearchHit,
969
+ tooltip: o.body.value
758
970
  });
759
- } else if (l.geometry.type === "POLYGON") {
760
- const S = l.geometry.points.map((y) => {
761
- const L = c.imageToViewportCoordinates(new He.Point(y[0], y[1])), m = e.get(i).viewport.viewportToViewerElementCoordinates(L);
762
- return [m.x, m.y];
971
+ } else if (o.geometry.type === "POLYGON") {
972
+ const S = o.geometry.points.map((x) => {
973
+ const D = f.imageToViewportCoordinates(new Be.Point(x[0], x[1])), b = e.get(a).viewport.viewportToViewerElementCoordinates(D);
974
+ return [b.x, b.y];
763
975
  });
764
- let H = 1 / 0, z = 1 / 0, o = -1 / 0, T = -1 / 0;
765
- for (const [y, L] of S)
766
- H = Math.min(H, y), z = Math.min(z, L), o = Math.max(o, y), T = Math.max(T, L);
767
- const b = S.map(([y, L]) => [y - H, L - z]);
768
- f.push({
769
- id: l.id,
976
+ let G = 1 / 0, L = 1 / 0, l = -1 / 0, C = -1 / 0;
977
+ for (const [x, D] of S)
978
+ G = Math.min(G, x), L = Math.min(L, D), l = Math.max(l, x), C = Math.max(C, D);
979
+ const _ = S.map(([x, D]) => [x - G, D - L]);
980
+ v.push({
981
+ id: o.id,
770
982
  type: "POLYGON",
771
- bounds: { x: H, y: z, width: o - H, height: T - z },
772
- points: b,
773
- isSearchHit: l.isSearchHit,
774
- tooltip: l.body.value
983
+ bounds: { x: G, y: L, width: l - G, height: C - L },
984
+ points: _,
985
+ isSearchHit: o.isSearchHit,
986
+ tooltip: o.body.value
775
987
  });
776
988
  }
777
989
  }
778
- return f;
990
+ return v;
779
991
  });
780
- lt(() => {
781
- if (e.get(a))
992
+ dt(() => {
993
+ if (e.get(n))
782
994
  return e.set(
783
- i,
784
- He({
785
- element: e.get(a),
995
+ a,
996
+ Be({
997
+ element: e.get(n),
786
998
  tileSources: null,
787
999
  // Will be set via effect
788
1000
  prefixUrl: "",
@@ -798,995 +1010,835 @@ function Qe(r, t) {
798
1010
  zoomPerClick: 2
799
1011
  }),
800
1012
  !0
801
- ), n().notifyOSDReady(e.get(i)), () => {
802
- var c;
803
- (c = e.get(i)) == null || c.destroy(), n().osdViewer = null;
1013
+ ), s().notifyOSDReady(e.get(a)), () => {
1014
+ var f;
1015
+ (f = e.get(a)) == null || f.destroy(), s().osdViewer = null;
804
1016
  };
805
1017
  }), e.user_effect(() => {
806
- if (!e.get(i)) return;
807
- const c = () => {
808
- e.update(I);
1018
+ if (!e.get(a)) return;
1019
+ const f = () => {
1020
+ e.update(y);
809
1021
  };
810
- return e.get(i).addHandler("open", c), e.get(i).addHandler("animation", c), e.get(i).addHandler("resize", c), e.get(i).addHandler("rotate", c), e.get(i).world.addHandler("add-item", c), e.get(i).world.addHandler("remove-item", c), () => {
811
- e.get(i).removeHandler("open", c), e.get(i).removeHandler("animation", c), e.get(i).removeHandler("resize", c), e.get(i).removeHandler("rotate", c), e.get(i).world.removeHandler("add-item", c), e.get(i).world.removeHandler("remove-item", c);
1022
+ return e.get(a).addHandler("open", f), e.get(a).addHandler("animation", f), e.get(a).addHandler("resize", f), e.get(a).addHandler("rotate", f), e.get(a).world.addHandler("add-item", f), e.get(a).world.addHandler("remove-item", f), () => {
1023
+ e.get(a).removeHandler("open", f), e.get(a).removeHandler("animation", f), e.get(a).removeHandler("resize", f), e.get(a).removeHandler("rotate", f), e.get(a).world.removeHandler("add-item", f), e.get(a).world.removeHandler("remove-item", f);
812
1024
  };
813
1025
  }), e.user_effect(() => {
814
- !e.get(i) || !s() || e.get(i).open(s());
1026
+ !e.get(a) || !r() || e.get(a).open(r());
815
1027
  });
816
- var j = {
1028
+ var z = {
817
1029
  get tileSources() {
818
- return s();
1030
+ return r();
819
1031
  },
820
- set tileSources(c) {
821
- s(c), e.flush();
1032
+ set tileSources(f) {
1033
+ r(f), e.flush();
822
1034
  },
823
1035
  get viewerState() {
824
- return n();
1036
+ return s();
825
1037
  },
826
- set viewerState(c) {
827
- n(c), e.flush();
1038
+ set viewerState(f) {
1039
+ s(f), e.flush();
828
1040
  }
829
- }, d = Et(), u = e.child(d);
830
- e.bind_this(u, (c) => e.set(a, c), () => e.get(a));
831
- var p = e.sibling(u, 2);
832
- return e.each(p, 17, () => e.get($), (c) => c.id, (c, f) => {
833
- var l = e.comment(), S = e.first_child(l);
1041
+ }, d = rr(), g = e.child(d);
1042
+ e.bind_this(g, (f) => e.set(n, f), () => e.get(n));
1043
+ var p = e.sibling(g, 2);
1044
+ return e.each(p, 17, () => e.get(k), (f) => f.id, (f, v) => {
1045
+ var o = e.comment(), S = e.first_child(o);
834
1046
  {
835
- var H = (o) => {
836
- var T = Lt();
1047
+ var G = (l) => {
1048
+ var C = er();
837
1049
  e.template_effect(() => {
838
- e.set_class(T, 1, `absolute border-2 transition-colors cursor-pointer pointer-events-auto ${e.get(f).isSearchHit ? "border-yellow-400 bg-yellow-400/40 hover:bg-yellow-400/60" : "border-red-500 bg-red-500/20 hover:bg-red-500/40"}`), e.set_style(T, `
839
- left: ${e.get(f).rect.x ?? ""}px;
840
- top: ${e.get(f).rect.y ?? ""}px;
841
- width: ${e.get(f).rect.width ?? ""}px;
842
- height: ${e.get(f).rect.height ?? ""}px;
843
- `), e.set_attribute(T, "title", e.get(f).tooltip);
844
- }), e.append(o, T);
845
- }, z = (o) => {
846
- var T = e.comment(), b = e.first_child(T);
1050
+ e.set_class(C, 1, `absolute border-2 transition-colors cursor-pointer pointer-events-auto ${e.get(v).isSearchHit ? "border-yellow-400 bg-yellow-400/40 hover:bg-yellow-400/60" : "border-red-500 bg-red-500/20 hover:bg-red-500/40"}`), e.set_style(C, `
1051
+ left: ${e.get(v).rect.x ?? ""}px;
1052
+ top: ${e.get(v).rect.y ?? ""}px;
1053
+ width: ${e.get(v).rect.width ?? ""}px;
1054
+ height: ${e.get(v).rect.height ?? ""}px;
1055
+ `), e.set_attribute(C, "title", e.get(v).tooltip);
1056
+ }), e.append(l, C);
1057
+ }, L = (l) => {
1058
+ var C = e.comment(), _ = e.first_child(C);
847
1059
  {
848
- var y = (L) => {
849
- var m = Dt(), h = e.child(m), X = e.child(h, !0);
1060
+ var x = (D) => {
1061
+ var b = tr(), h = e.child(b), H = e.child(h, !0);
850
1062
  e.reset(h);
851
1063
  var W = e.sibling(h);
852
- e.reset(m), e.template_effect(
853
- (v) => {
854
- e.set_style(m, `
855
- left: ${e.get(f).bounds.x ?? ""}px;
856
- top: ${e.get(f).bounds.y ?? ""}px;
857
- width: ${e.get(f).bounds.width ?? ""}px;
858
- height: ${e.get(f).bounds.height ?? ""}px;
859
- `), e.set_text(X, e.get(f).tooltip), e.set_attribute(W, "points", v), e.set_class(W, 0, `cursor-pointer transition-colors ${e.get(f).isSearchHit ? "fill-yellow-400/40 stroke-yellow-400 hover:fill-yellow-400/60" : "fill-red-500/20 stroke-red-500 hover:fill-red-500/40"}`);
1064
+ e.reset(b), e.template_effect(
1065
+ (m) => {
1066
+ e.set_style(b, `
1067
+ left: ${e.get(v).bounds.x ?? ""}px;
1068
+ top: ${e.get(v).bounds.y ?? ""}px;
1069
+ width: ${e.get(v).bounds.width ?? ""}px;
1070
+ height: ${e.get(v).bounds.height ?? ""}px;
1071
+ `), e.set_text(H, e.get(v).tooltip), e.set_attribute(W, "points", m), e.set_class(W, 0, `cursor-pointer transition-colors ${e.get(v).isSearchHit ? "fill-yellow-400/40 stroke-yellow-400 hover:fill-yellow-400/60" : "fill-red-500/20 stroke-red-500 hover:fill-red-500/40"}`);
860
1072
  },
861
- [() => e.get(f).points.map((v) => v.join(",")).join(" ")]
862
- ), e.append(L, m);
1073
+ [() => e.get(v).points.map((m) => m.join(",")).join(" ")]
1074
+ ), e.append(D, b);
863
1075
  };
864
1076
  e.if(
865
- b,
866
- (L) => {
867
- e.get(f).type === "POLYGON" && L(y);
1077
+ _,
1078
+ (D) => {
1079
+ e.get(v).type === "POLYGON" && D(x);
868
1080
  },
869
1081
  !0
870
1082
  );
871
1083
  }
872
- e.append(o, T);
1084
+ e.append(l, C);
873
1085
  };
874
- e.if(S, (o) => {
875
- e.get(f).type === "RECTANGLE" ? o(H) : o(z, !1);
1086
+ e.if(S, (l) => {
1087
+ e.get(v).type === "RECTANGLE" ? l(G) : l(L, !1);
876
1088
  });
877
1089
  }
878
- e.append(c, l);
879
- }), e.reset(d), e.append(r, d), e.pop(j);
1090
+ e.append(f, o);
1091
+ }), e.reset(d), e.append(i, d), e.pop(z);
880
1092
  }
881
- e.create_custom_element(Qe, { tileSources: {}, viewerState: {} }, [], [], !0);
882
- const Gt = "en";
883
- let F = () => Gt;
884
- const Rt = /* @__NO_SIDE_EFFECTS__ */ () => "Hello World", Ot = /* @__NO_SIDE_EFFECTS__ */ () => "Search", Ht = /* @__NO_SIDE_EFFECTS__ */ () => "Close Search", Ft = /* @__NO_SIDE_EFFECTS__ */ () => "Search content...", Vt = /* @__NO_SIDE_EFFECTS__ */ (r) => `No results found for "${r.query}"`, Bt = /* @__NO_SIDE_EFFECTS__ */ () => "Enter a search term to find occurrences within this manifest.", Nt = /* @__NO_SIDE_EFFECTS__ */ (r) => `${r.count} Results`, Yt = /* @__NO_SIDE_EFFECTS__ */ () => "Manifest Metadata", Xt = /* @__NO_SIDE_EFFECTS__ */ () => "Loading...", qt = /* @__NO_SIDE_EFFECTS__ */ () => "Attribution", Qt = /* @__NO_SIDE_EFFECTS__ */ () => "License", Wt = /* @__NO_SIDE_EFFECTS__ */ () => "Close", Ut = /* @__NO_SIDE_EFFECTS__ */ () => "Menu", Kt = /* @__NO_SIDE_EFFECTS__ */ () => "Search", Jt = /* @__NO_SIDE_EFFECTS__ */ () => "Toggle Search", Zt = /* @__NO_SIDE_EFFECTS__ */ () => "Hide Gallery", es = /* @__NO_SIDE_EFFECTS__ */ () => "Show Gallery", ts = /* @__NO_SIDE_EFFECTS__ */ () => "Exit Full Screen", ss = /* @__NO_SIDE_EFFECTS__ */ () => "Enter Full Screen", rs = /* @__NO_SIDE_EFFECTS__ */ () => "Hide Annotations", ns = /* @__NO_SIDE_EFFECTS__ */ () => "Show Annotations", as = /* @__NO_SIDE_EFFECTS__ */ () => "Toggle Annotations", is = /* @__NO_SIDE_EFFECTS__ */ () => "Metadata", os = /* @__NO_SIDE_EFFECTS__ */ () => "Toggle Metadata", ls = /* @__NO_SIDE_EFFECTS__ */ () => "Hide All Annotations", cs = /* @__NO_SIDE_EFFECTS__ */ () => "Show All Annotations", ds = /* @__NO_SIDE_EFFECTS__ */ (r) => `${r.count} Annotations`, gs = /* @__NO_SIDE_EFFECTS__ */ (r) => `(${r.count} visible)`, us = /* @__NO_SIDE_EFFECTS__ */ () => "(No content)", fs = /* @__NO_SIDE_EFFECTS__ */ () => "No annotations available.", hs = /* @__NO_SIDE_EFFECTS__ */ () => "Previous Canvas", vs = /* @__NO_SIDE_EFFECTS__ */ () => "Next Canvas", ps = /* @__NO_SIDE_EFFECTS__ */ () => "Docs", ms = /* @__NO_SIDE_EFFECTS__ */ () => "IIIF Manifest:", _s = /* @__NO_SIDE_EFFECTS__ */ () => "Enter IIIF manifest URL", bs = /* @__NO_SIDE_EFFECTS__ */ () => "Load", ys = /* @__NO_SIDE_EFFECTS__ */ () => "GitHub", xs = /* @__NO_SIDE_EFFECTS__ */ () => "Hallo Welt", ws = /* @__NO_SIDE_EFFECTS__ */ () => "Suche", Ss = /* @__NO_SIDE_EFFECTS__ */ () => "Suche schließen", As = /* @__NO_SIDE_EFFECTS__ */ () => "Inhalt durchsuchen...", $s = /* @__NO_SIDE_EFFECTS__ */ (r) => `Keine Ergebnisse für "${r.query}" gefunden`, Is = /* @__NO_SIDE_EFFECTS__ */ () => "Geben Sie einen Suchbegriff ein, um Vorkommen in diesem Manifest zu finden.", Ts = /* @__NO_SIDE_EFFECTS__ */ (r) => `${r.count} Ergebnisse`, ks = /* @__NO_SIDE_EFFECTS__ */ () => "Manifest-Metadaten", Ps = /* @__NO_SIDE_EFFECTS__ */ () => "Lädt...", Ms = /* @__NO_SIDE_EFFECTS__ */ () => "Quellenangabe", Cs = /* @__NO_SIDE_EFFECTS__ */ () => "Lizenz", js = /* @__NO_SIDE_EFFECTS__ */ () => "Schließen", zs = /* @__NO_SIDE_EFFECTS__ */ () => "Menü", Ls = /* @__NO_SIDE_EFFECTS__ */ () => "Suche", Ds = /* @__NO_SIDE_EFFECTS__ */ () => "Suche umschalten", Es = /* @__NO_SIDE_EFFECTS__ */ () => "Galerie ausblenden", Gs = /* @__NO_SIDE_EFFECTS__ */ () => "Galerie einblenden", Rs = /* @__NO_SIDE_EFFECTS__ */ () => "Vollbildmodus beenden", Os = /* @__NO_SIDE_EFFECTS__ */ () => "Vollbildmodus", Hs = /* @__NO_SIDE_EFFECTS__ */ () => "Annotationen ausblenden", Fs = /* @__NO_SIDE_EFFECTS__ */ () => "Annotationen einblenden", Vs = /* @__NO_SIDE_EFFECTS__ */ () => "Annotationen umschalten", Bs = /* @__NO_SIDE_EFFECTS__ */ () => "Metadaten", Ns = /* @__NO_SIDE_EFFECTS__ */ () => "Metadaten umschalten", Ys = /* @__NO_SIDE_EFFECTS__ */ () => "Alle Annotationen ausblenden", Xs = /* @__NO_SIDE_EFFECTS__ */ () => "Alle Annotationen einblenden", qs = /* @__NO_SIDE_EFFECTS__ */ (r) => `${r.count} Annotationen`, Qs = /* @__NO_SIDE_EFFECTS__ */ (r) => `(${r.count} sichtbar)`, Ws = /* @__NO_SIDE_EFFECTS__ */ () => "(Kein Inhalt)", Us = /* @__NO_SIDE_EFFECTS__ */ () => "Keine Annotationen verfügbar.", Ks = /* @__NO_SIDE_EFFECTS__ */ () => "Vorheriges Canvas", Js = /* @__NO_SIDE_EFFECTS__ */ () => "Nächstes Canvas", Zs = /* @__NO_SIDE_EFFECTS__ */ () => "Doku", er = /* @__NO_SIDE_EFFECTS__ */ () => "IIIF-Manifest:", tr = /* @__NO_SIDE_EFFECTS__ */ () => "IIIF-Manifest-URL eingeben", sr = /* @__NO_SIDE_EFFECTS__ */ () => "Laden", rr = /* @__NO_SIDE_EFFECTS__ */ () => "GitHub", nr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
885
- de: xs,
886
- en: Rt
887
- })[t.languageTag ?? F()](), ar = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
888
- de: ws,
889
- en: Ot
890
- })[t.languageTag ?? F()](), ir = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
891
- de: Ss,
892
- en: Ht
893
- })[t.languageTag ?? F()](), or = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
894
- de: As,
895
- en: Ft
896
- })[t.languageTag ?? F()](), lr = /* @__NO_SIDE_EFFECTS__ */ (r, t = {}) => ({
897
- de: $s,
898
- en: Vt
899
- })[t.languageTag ?? F()](r), cr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
900
- de: Is,
901
- en: Bt
902
- })[t.languageTag ?? F()](), dr = /* @__NO_SIDE_EFFECTS__ */ (r, t = {}) => ({
903
- de: Ts,
904
- en: Nt
905
- })[t.languageTag ?? F()](r), gr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
906
- de: ks,
907
- en: Yt
908
- })[t.languageTag ?? F()](), ur = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
909
- de: Ps,
910
- en: Xt
911
- })[t.languageTag ?? F()](), fr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
912
- de: Ms,
913
- en: qt
914
- })[t.languageTag ?? F()](), hr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
915
- de: Cs,
916
- en: Qt
917
- })[t.languageTag ?? F()](), vr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
918
- de: js,
919
- en: Wt
920
- })[t.languageTag ?? F()](), pr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
921
- de: zs,
922
- en: Ut
923
- })[t.languageTag ?? F()](), mr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
924
- de: Ls,
925
- en: Kt
926
- })[t.languageTag ?? F()](), _r = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
927
- de: Ds,
928
- en: Jt
929
- })[t.languageTag ?? F()](), br = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
930
- de: Es,
931
- en: Zt
932
- })[t.languageTag ?? F()](), yr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
933
- de: Gs,
934
- en: es
935
- })[t.languageTag ?? F()](), xr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
936
- de: Rs,
937
- en: ts
938
- })[t.languageTag ?? F()](), wr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
939
- de: Os,
940
- en: ss
941
- })[t.languageTag ?? F()](), Sr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
942
- de: Hs,
943
- en: rs
944
- })[t.languageTag ?? F()](), Ar = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
945
- de: Fs,
946
- en: ns
947
- })[t.languageTag ?? F()](), $r = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
948
- de: Vs,
949
- en: as
950
- })[t.languageTag ?? F()](), Ir = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
951
- de: Bs,
952
- en: is
953
- })[t.languageTag ?? F()](), Tr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
954
- de: Ns,
955
- en: os
956
- })[t.languageTag ?? F()](), kr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
957
- de: Ys,
958
- en: ls
959
- })[t.languageTag ?? F()](), Pr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
960
- de: Xs,
961
- en: cs
962
- })[t.languageTag ?? F()](), Mr = /* @__NO_SIDE_EFFECTS__ */ (r, t = {}) => ({
963
- de: qs,
964
- en: ds
965
- })[t.languageTag ?? F()](r), Cr = /* @__NO_SIDE_EFFECTS__ */ (r, t = {}) => ({
966
- de: Qs,
967
- en: gs
968
- })[t.languageTag ?? F()](r), jr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
969
- de: Ws,
970
- en: us
971
- })[t.languageTag ?? F()](), zr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
972
- de: Us,
973
- en: fs
974
- })[t.languageTag ?? F()](), Lr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
975
- de: Ks,
976
- en: hs
977
- })[t.languageTag ?? F()](), Dr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
978
- de: Js,
979
- en: vs
980
- })[t.languageTag ?? F()](), Er = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
981
- de: Zs,
982
- en: ps
983
- })[t.languageTag ?? F()](), Gr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
984
- de: er,
985
- en: ms
986
- })[t.languageTag ?? F()](), Rr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
987
- de: tr,
988
- en: _s
989
- })[t.languageTag ?? F()](), Or = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
990
- de: sr,
991
- en: bs
992
- })[t.languageTag ?? F()](), Hr = /* @__NO_SIDE_EFFECTS__ */ (r = {}, t = {}) => ({
993
- de: rr,
994
- en: ys
995
- })[t.languageTag ?? F()](), Fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
996
- __proto__: null,
997
- annotations_count: Mr,
998
- attribution: fr,
999
- close: vr,
1000
- docs: Er,
1001
- enter_full_screen: wr,
1002
- exit_full_screen: xr,
1003
- github: Hr,
1004
- hello_world: nr,
1005
- hide_all_annotations: kr,
1006
- hide_annotations: Sr,
1007
- hide_gallery: br,
1008
- iiif_manifest_label: Gr,
1009
- license: hr,
1010
- load: Or,
1011
- loading: ur,
1012
- manifest_placeholder: Rr,
1013
- menu: pr,
1014
- metadata: Ir,
1015
- metadata_label_fallback: gr,
1016
- next_canvas: Dr,
1017
- no_annotations_available: zr,
1018
- no_content: jr,
1019
- previous_canvas: Lr,
1020
- search: mr,
1021
- search_panel_close: ir,
1022
- search_panel_instruction: cr,
1023
- search_panel_no_results: lr,
1024
- search_panel_placeholder: or,
1025
- search_panel_results_count: dr,
1026
- search_panel_title: ar,
1027
- show_all_annotations: Pr,
1028
- show_annotations: Ar,
1029
- show_gallery: yr,
1030
- toggle_annotations: $r,
1031
- toggle_metadata: Tr,
1032
- toggle_search: _r,
1033
- visible_count: Cr
1034
- }, Symbol.toStringTag, { value: "Module" }));
1035
- let We = e.state(e.proxy(F()));
1036
- const Vr = {
1037
- get current() {
1038
- return e.get(We);
1039
- }
1040
- }, B = new Proxy(Fr, {
1041
- get(r, t, s) {
1042
- return e.get(We), Reflect.get(r, t, s);
1043
- }
1044
- });
1045
- var Br = e.from_html('<div class="select-none absolute left-1/2 -translate-x-1/2 bg-base-200/90 backdrop-blur rounded-full shadow-lg px-4 py-2 flex items-center gap-4 z-10 border border-base-300 transition-all duration-200 bottom-4"><button class="btn btn-circle btn-sm btn-ghost"><!></button> <span class="text-sm font-mono tabular-nums text-nowrap"> </span> <button class="btn btn-circle btn-sm btn-ghost"><!></button></div>');
1046
- function Ue(r, t) {
1093
+ e.create_custom_element(Ze, { tileSources: {}, viewerState: {} }, [], [], !0);
1094
+ var ir = e.from_html('<div class="select-none absolute left-1/2 -translate-x-1/2 bg-base-200/90 backdrop-blur rounded-full shadow-lg px-4 py-2 flex items-center gap-4 z-10 border border-base-300 transition-all duration-200 bottom-4"><button class="btn btn-circle btn-sm btn-ghost"><!></button> <span class="text-sm font-mono tabular-nums text-nowrap"> </span> <button class="btn btn-circle btn-sm btn-ghost"><!></button></div>');
1095
+ function et(i, t) {
1047
1096
  e.push(t, !0);
1048
- let s = e.prop(t, "viewerState", 7);
1049
- var n = {
1097
+ let r = e.prop(t, "viewerState", 7);
1098
+ var s = {
1050
1099
  get viewerState() {
1051
- return s();
1100
+ return r();
1052
1101
  },
1053
- set viewerState(j) {
1054
- s(j), e.flush();
1102
+ set viewerState(z) {
1103
+ r(z), e.flush();
1055
1104
  }
1056
- }, a = Br(), i = e.child(a);
1057
- i.__click = () => s().previousCanvas();
1058
- var I = e.child(i);
1059
- ut(I, { size: 20, weight: "bold" }), e.reset(i);
1060
- var C = e.sibling(i, 2), x = e.child(C);
1061
- e.reset(C);
1062
- var w = e.sibling(C, 2);
1063
- w.__click = () => s().nextCanvas();
1064
- var $ = e.child(w);
1065
- return ft($, { size: 20, weight: "bold" }), e.reset(w), e.reset(a), e.template_effect(
1066
- (j, d) => {
1067
- i.disabled = !s().hasPrevious, e.set_attribute(i, "aria-label", j), e.set_text(x, `${s().currentCanvasIndex + 1} / ${s().canvases.length ?? ""}`), w.disabled = !s().hasNext, e.set_attribute(w, "aria-label", d);
1105
+ }, n = ir(), a = e.child(n);
1106
+ a.__click = () => r().previousCanvas();
1107
+ var y = e.child(a);
1108
+ vt(y, { size: 20, weight: "bold" }), e.reset(a);
1109
+ var I = e.sibling(a, 2), c = e.child(I);
1110
+ e.reset(I);
1111
+ var w = e.sibling(I, 2);
1112
+ w.__click = () => r().nextCanvas();
1113
+ var k = e.child(w);
1114
+ return ht(k, { size: 20, weight: "bold" }), e.reset(w), e.reset(n), e.template_effect(
1115
+ (z, d) => {
1116
+ a.disabled = !r().hasPrevious, e.set_attribute(a, "aria-label", z), e.set_text(c, `${r().currentCanvasIndex + 1} / ${r().canvases.length ?? ""}`), w.disabled = !r().hasNext, e.set_attribute(w, "aria-label", d);
1068
1117
  },
1069
1118
  [() => B.previous_canvas(), () => B.next_canvas()]
1070
- ), e.append(r, a), e.pop(n);
1119
+ ), e.append(i, n), e.pop(s);
1071
1120
  }
1072
1121
  e.delegate(["click"]);
1073
- e.create_custom_element(Ue, { viewerState: {} }, [], [], !0);
1074
- var Nr = e.from_html('<span class="text-xs opacity-50 truncate max-w-[150px]"> </span>'), Yr = e.from_html('<button class="w-full text-left p-3 hover:bg-base-300 transition-colors cursor-pointer flex gap-3 group/item items-start focus:outline-none focus:bg-base-300"><div class="btn btn-xs btn-circle btn-ghost mt-0.5 shrink-0 pointer-events-none"><!></div> <div class="flex-1 min-w-0"><div class="flex items-start justify-between"><span class="font-bold text-sm text-primary"></span> <!></div> <div><!></div></div></button>'), Xr = e.from_html('<div class="p-4 text-center opacity-50 text-sm">No annotations available.</div>'), qr = e.from_html('<div class="absolute top-4 right-4 z-500 pointer-events-auto transition-all duration-300"><details class="group relative"><summary class="flex items-center gap-2 bg-base-200/90 backdrop-blur shadow-lg rounded-full px-4 py-2 cursor-pointer list-none hover:bg-base-200 transition-all select-none border border-base-300 pointer-events-auto"><button class="btn btn-xs btn-circle btn-ghost"><!></button> <span class="text-sm font-medium"> <span class="opacity-50 text-xs font-normal ml-1"> </span></span> <!></summary> <div class="absolute right-0 mt-2 w-96 bg-base-200/95 backdrop-blur shadow-xl rounded-box p-0 max-h-[60vh] overflow-y-auto border border-base-300 flex flex-col divide-y divide-base-300"></div></details></div>');
1075
- function Ke(r, t) {
1122
+ e.create_custom_element(et, { viewerState: {} }, [], [], !0);
1123
+ var sr = e.from_html('<span class="text-xs opacity-50 truncate max-w-[150px]"> </span>'), nr = e.from_html('<button class="w-full text-left p-3 hover:bg-base-300 transition-colors cursor-pointer flex gap-3 group/item items-start focus:outline-none focus:bg-base-300"><div class="btn btn-xs btn-circle btn-ghost mt-0.5 shrink-0 pointer-events-none"><!></div> <div class="flex-1 min-w-0"><div class="flex items-start justify-between"><span class="font-bold text-sm text-primary"></span> <!></div> <div><!></div></div></button>'), ar = e.from_html('<div class="p-4 text-center opacity-50 text-sm">No annotations available.</div>'), or = e.from_html('<div class="absolute top-4 right-4 z-500 pointer-events-auto transition-all duration-300"><details class="group relative"><summary class="flex items-center gap-2 bg-base-200/90 backdrop-blur shadow-lg rounded-full px-4 py-2 cursor-pointer list-none hover:bg-base-200 transition-all select-none border border-base-300 pointer-events-auto"><button class="btn btn-xs btn-circle btn-ghost"><!></button> <span class="text-sm font-medium"> <span class="opacity-50 text-xs font-normal ml-1"> </span></span> <!></summary> <div class="absolute right-0 mt-2 w-96 bg-base-200/95 backdrop-blur shadow-xl rounded-box p-0 max-h-[60vh] overflow-y-auto border border-base-300 flex flex-col divide-y divide-base-300"></div></details></div>');
1124
+ function tt(i, t) {
1076
1125
  e.push(t, !0);
1077
- const s = le(ae);
1078
- let n = e.derived(() => {
1079
- if (!s.manifestId || !s.canvasId)
1126
+ const r = oe(se);
1127
+ let s = e.derived(() => {
1128
+ if (!r.manifestId || !r.canvasId)
1080
1129
  return [];
1081
- const d = oe.getAnnotations(s.manifestId, s.canvasId), u = s.currentCanvasSearchAnnotations;
1082
- return [...d, ...u];
1130
+ const d = ae.getAnnotations(r.manifestId, r.canvasId), g = r.currentCanvasSearchAnnotations;
1131
+ return [...d, ...g];
1083
1132
  });
1084
- function a(d) {
1133
+ function n(d) {
1085
1134
  return d.id || d["@id"] || (typeof d.getId == "function" ? d.getId() : "") || "";
1086
1135
  }
1087
1136
  e.user_effect(() => {
1088
- if (e.get(n).length > 0) {
1137
+ if (e.get(s).length > 0) {
1089
1138
  const d = /* @__PURE__ */ new Set();
1090
- e.get(n).forEach((u) => {
1091
- const p = a(u);
1139
+ e.get(s).forEach((g) => {
1140
+ const p = n(g);
1092
1141
  p && d.add(p);
1093
- }), s.visibleAnnotationIds = d;
1142
+ }), r.visibleAnnotationIds = d;
1094
1143
  } else
1095
- s.visibleAnnotationIds = /* @__PURE__ */ new Set();
1144
+ r.visibleAnnotationIds = /* @__PURE__ */ new Set();
1096
1145
  });
1097
- let i = e.derived(() => e.get(n).length === 0 ? !1 : e.get(n).every((d) => {
1098
- const u = a(d);
1099
- return !u || s.visibleAnnotationIds.has(u);
1146
+ let a = e.derived(() => e.get(s).length === 0 ? !1 : e.get(s).every((d) => {
1147
+ const g = n(d);
1148
+ return !g || r.visibleAnnotationIds.has(g);
1100
1149
  }));
1101
- function I(d) {
1102
- s.visibleAnnotationIds.has(d) ? s.visibleAnnotationIds.delete(d) : s.visibleAnnotationIds.add(d), s.visibleAnnotationIds = new Set(s.visibleAnnotationIds);
1150
+ function y(d) {
1151
+ r.visibleAnnotationIds.has(d) ? r.visibleAnnotationIds.delete(d) : r.visibleAnnotationIds.add(d), r.visibleAnnotationIds = new Set(r.visibleAnnotationIds);
1103
1152
  }
1104
- function C() {
1105
- if (e.get(i))
1106
- s.visibleAnnotationIds = /* @__PURE__ */ new Set();
1153
+ function I() {
1154
+ if (e.get(a))
1155
+ r.visibleAnnotationIds = /* @__PURE__ */ new Set();
1107
1156
  else {
1108
1157
  const d = /* @__PURE__ */ new Set();
1109
- e.get(n).forEach((u) => {
1110
- const p = a(u);
1158
+ e.get(s).forEach((g) => {
1159
+ const p = n(g);
1111
1160
  p && d.add(p);
1112
- }), s.visibleAnnotationIds = d;
1161
+ }), r.visibleAnnotationIds = d;
1113
1162
  }
1114
1163
  }
1115
- let x = e.derived(() => e.get(n).length ? e.get(n).map((d) => {
1116
- let u = "", p = !1;
1164
+ let c = e.derived(() => e.get(s).length ? e.get(s).map((d) => {
1165
+ let g = "", p = !1;
1117
1166
  if (typeof d.getBody == "function") {
1118
- const c = d.getBody();
1119
- if (c && c.length) {
1120
- const f = (l) => {
1121
- const S = l.getValue ? l.getValue() : null;
1167
+ const f = d.getBody();
1168
+ if (f && f.length) {
1169
+ const v = (o) => {
1170
+ const S = o.getValue ? o.getValue() : null;
1122
1171
  return S || "";
1123
1172
  };
1124
- u = c.map((l) => f(l)).filter(Boolean).join(" "), p = c.some((l) => {
1125
- const S = l.getFormat ? l.getFormat() : "";
1173
+ g = f.map((o) => v(o)).filter(Boolean).join(" "), p = f.some((o) => {
1174
+ const S = o.getFormat ? o.getFormat() : "";
1126
1175
  return S === "text/html" || S === "application/html";
1127
1176
  });
1128
1177
  }
1129
- if (!u && typeof d.getLabel == "function") {
1130
- const f = d.getLabel();
1131
- f && (u = f);
1178
+ if (!g && typeof d.getLabel == "function") {
1179
+ const v = d.getLabel();
1180
+ v && (g = v);
1132
1181
  }
1133
1182
  } else {
1134
- const c = (l) => l && (l.chars || l.value || l["cnt:chars"]) || "", f = (l) => l ? l.format === "text/html" || l.type === "TextualBody" : !1;
1135
- if (d.resource ? Array.isArray(d.resource) ? (u = d.resource.map((l) => c(l)).join(" "), d.resource.some((l) => f(l)) && (p = !0)) : (u = c(d.resource), f(d.resource) && (p = !0)) : d.body && (Array.isArray(d.body) ? (u = d.body.map((l) => c(l)).join(" "), d.body.some((l) => f(l)) && (p = !0)) : (u = c(d.body), f(d.body) && (p = !0))), !u) {
1136
- const l = d.label || d.name || d.title;
1137
- l && (u = Array.isArray(l) ? l.join(" ") : l);
1183
+ const f = (o) => o && (o.chars || o.value || o["cnt:chars"]) || "", v = (o) => o ? o.format === "text/html" || o.type === "TextualBody" : !1;
1184
+ if (d.resource ? Array.isArray(d.resource) ? (g = d.resource.map((o) => f(o)).join(" "), d.resource.some((o) => v(o)) && (p = !0)) : (g = f(d.resource), v(d.resource) && (p = !0)) : d.body && (Array.isArray(d.body) ? (g = d.body.map((o) => f(o)).join(" "), d.body.some((o) => v(o)) && (p = !0)) : (g = f(d.body), v(d.body) && (p = !0))), !g) {
1185
+ const o = d.label || d.name || d.title;
1186
+ o && (g = Array.isArray(o) ? o.join(" ") : o);
1138
1187
  }
1139
1188
  }
1140
1189
  return {
1141
- id: a(d),
1142
- content: u,
1190
+ id: n(d),
1191
+ content: g,
1143
1192
  isHtml: p,
1144
1193
  label: (typeof d.getLabel == "function" ? d.getLabel() : d.label) || ""
1145
1194
  };
1146
1195
  }) : []);
1147
- var w = e.comment(), $ = e.first_child(w);
1196
+ var w = e.comment(), k = e.first_child(w);
1148
1197
  {
1149
- var j = (d) => {
1150
- var u = qr(), p = e.child(u), c = e.child(p), f = e.child(c);
1151
- f.__click = (m) => {
1152
- m.preventDefault(), C();
1198
+ var z = (d) => {
1199
+ var g = or(), p = e.child(g), f = e.child(p), v = e.child(f);
1200
+ v.__click = (b) => {
1201
+ b.preventDefault(), I();
1153
1202
  };
1154
- var l = e.child(f);
1203
+ var o = e.child(v);
1155
1204
  {
1156
- var S = (m) => {
1157
- Fe(m, { size: 16, weight: "bold" });
1158
- }, H = (m) => {
1159
- Ve(m, { size: 16, weight: "bold" });
1205
+ var S = (b) => {
1206
+ He(b, { size: 16, weight: "bold" });
1207
+ }, G = (b) => {
1208
+ Ne(b, { size: 16, weight: "bold" });
1160
1209
  };
1161
- e.if(l, (m) => {
1162
- e.get(i) ? m(S) : m(H, !1);
1210
+ e.if(o, (b) => {
1211
+ e.get(a) ? b(S) : b(G, !1);
1163
1212
  });
1164
1213
  }
1165
- e.reset(f);
1166
- var z = e.sibling(f, 2), o = e.child(z), T = e.sibling(o), b = e.child(T, !0);
1167
- e.reset(T), e.reset(z);
1168
- var y = e.sibling(z, 2);
1169
- ht(y, {
1214
+ e.reset(v);
1215
+ var L = e.sibling(v, 2), l = e.child(L), C = e.sibling(l), _ = e.child(C, !0);
1216
+ e.reset(C), e.reset(L);
1217
+ var x = e.sibling(L, 2);
1218
+ mt(x, {
1170
1219
  size: 16,
1171
1220
  weight: "bold",
1172
1221
  class: "group-open:rotate-180 transition-transform opacity-80"
1173
- }), e.reset(c);
1174
- var L = e.sibling(c, 2);
1222
+ }), e.reset(f);
1223
+ var D = e.sibling(f, 2);
1175
1224
  e.each(
1176
- L,
1225
+ D,
1177
1226
  21,
1178
- () => e.get(x),
1227
+ () => e.get(c),
1179
1228
  e.index,
1180
- (m, h, X) => {
1181
- const W = e.derived(() => s.visibleAnnotationIds.has(e.get(h).id));
1182
- var v = Yr();
1183
- v.__click = (O) => {
1184
- O.preventDefault(), I(e.get(h).id);
1229
+ (b, h, H) => {
1230
+ const W = e.derived(() => r.visibleAnnotationIds.has(e.get(h).id));
1231
+ var m = nr();
1232
+ m.__click = (R) => {
1233
+ R.preventDefault(), y(e.get(h).id);
1185
1234
  };
1186
- var k = e.child(v), D = e.child(k);
1235
+ var P = e.child(m), O = e.child(P);
1187
1236
  {
1188
- var q = (O) => {
1189
- Fe(O, { size: 16, weight: "bold" });
1190
- }, Q = (O) => {
1191
- Ve(O, { size: 16, weight: "bold" });
1237
+ var Q = (R) => {
1238
+ He(R, { size: 16, weight: "bold" });
1239
+ }, U = (R) => {
1240
+ Ne(R, { size: 16, weight: "bold" });
1192
1241
  };
1193
- e.if(D, (O) => {
1194
- e.get(W) ? O(q) : O(Q, !1);
1242
+ e.if(O, (R) => {
1243
+ e.get(W) ? R(Q) : R(U, !1);
1195
1244
  });
1196
1245
  }
1197
- e.reset(k);
1198
- var V = e.sibling(k, 2), G = e.child(V), N = e.child(G);
1199
- N.textContent = `#${X + 1}`;
1200
- var K = e.sibling(N, 2);
1246
+ e.reset(P);
1247
+ var $ = e.sibling(P, 2), F = e.child($), q = e.child(F);
1248
+ q.textContent = `#${H + 1}`;
1249
+ var J = e.sibling(q, 2);
1201
1250
  {
1202
- var te = (O) => {
1203
- var P = Nr(), M = e.child(P, !0);
1204
- e.reset(P), e.template_effect(() => e.set_text(M, e.get(h).label)), e.append(O, P);
1251
+ var ie = (R) => {
1252
+ var j = sr(), M = e.child(j, !0);
1253
+ e.reset(j), e.template_effect(() => e.set_text(M, e.get(h).label)), e.append(R, j);
1205
1254
  };
1206
- e.if(K, (O) => {
1207
- e.get(h).label && e.get(h).label !== e.get(h).content && O(te);
1255
+ e.if(J, (R) => {
1256
+ e.get(h).label && e.get(h).label !== e.get(h).content && R(ie);
1208
1257
  });
1209
1258
  }
1210
- e.reset(G);
1211
- var g = e.sibling(G, 2), _ = e.child(g);
1259
+ e.reset(F);
1260
+ var u = e.sibling(F, 2), T = e.child(u);
1212
1261
  {
1213
- var R = (O) => {
1214
- var P = e.comment(), M = e.first_child(P);
1215
- e.html(M, () => e.get(h).content), e.append(O, P);
1216
- }, E = (O) => {
1217
- var P = e.text();
1218
- e.template_effect(() => e.set_text(P, e.get(h).content || "(No content)")), e.append(O, P);
1262
+ var N = (R) => {
1263
+ var j = e.comment(), M = e.first_child(j);
1264
+ e.html(M, () => e.get(h).content), e.append(R, j);
1265
+ }, E = (R) => {
1266
+ var j = e.text();
1267
+ e.template_effect(() => e.set_text(j, e.get(h).content || "(No content)")), e.append(R, j);
1219
1268
  };
1220
- e.if(_, (O) => {
1221
- e.get(h).isHtml ? O(R) : O(E, !1);
1269
+ e.if(T, (R) => {
1270
+ e.get(h).isHtml ? R(N) : R(E, !1);
1222
1271
  });
1223
1272
  }
1224
- e.reset(g), e.reset(V), e.reset(v), e.template_effect(() => e.set_class(g, 1, `text-sm prose prose-sm max-w-none prose-p:my-0 prose-a:text-blue-500 wrap-break-word text-left ${e.get(W) ? "" : "opacity-50"}`)), e.append(m, v);
1273
+ e.reset(u), e.reset($), e.reset(m), e.template_effect(() => e.set_class(u, 1, `text-sm prose prose-sm max-w-none prose-p:my-0 prose-a:text-blue-500 wrap-break-word text-left ${e.get(W) ? "" : "opacity-50"}`)), e.append(b, m);
1225
1274
  },
1226
- (m) => {
1227
- var h = Xr();
1228
- e.append(m, h);
1275
+ (b) => {
1276
+ var h = ar();
1277
+ e.append(b, h);
1229
1278
  }
1230
- ), e.reset(L), e.reset(p), e.reset(u), e.template_effect(
1231
- (m, h, X) => {
1232
- e.set_attribute(f, "title", m), e.set_text(o, `${h ?? ""} `), e.set_text(b, X);
1279
+ ), e.reset(D), e.reset(p), e.reset(g), e.template_effect(
1280
+ (b, h, H) => {
1281
+ e.set_attribute(v, "title", b), e.set_text(l, `${h ?? ""} `), e.set_text(_, H);
1233
1282
  },
1234
1283
  [
1235
- () => e.get(i) ? B.hide_all_annotations() : B.show_all_annotations(),
1236
- () => B.annotations_count({ count: e.get(n).length }),
1237
- () => B.visible_count({ count: s.visibleAnnotationIds.size })
1284
+ () => e.get(a) ? B.hide_all_annotations() : B.show_all_annotations(),
1285
+ () => B.annotations_count({ count: e.get(s).length }),
1286
+ () => B.visible_count({ count: r.visibleAnnotationIds.size })
1238
1287
  ]
1239
- ), e.append(d, u);
1288
+ ), e.append(d, g);
1240
1289
  };
1241
- e.if($, (d) => {
1242
- s.showAnnotations && d(j);
1290
+ e.if(k, (d) => {
1291
+ r.showAnnotations && d(z);
1243
1292
  });
1244
1293
  }
1245
- e.append(r, w), e.pop();
1294
+ e.append(i, w), e.pop();
1246
1295
  }
1247
1296
  e.delegate(["click"]);
1248
- e.create_custom_element(Ke, {}, [], [], !0);
1249
- var Qr = e.from_html('<img class="object-contain w-full h-full" loading="lazy" draggable="false"/>'), Wr = e.from_html('<span class="opacity-20 text-4xl">?</span>'), Ur = e.from_html('<button><div class="aspect-4/3 bg-base-300 rounded overflow-hidden relative w-full flex items-center justify-center"><!></div> <div class="text-xs font-medium truncate w-full opacity-70 group-hover:opacity-100"><span class="font-bold mr-1"> </span> </div></button>'), Kr = e.from_html('<div class="absolute bottom-0 right-0 w-6 h-6 cursor-se-resize resize-handle bg-accent hover:bg-accent-focus transition-colors z-50" style="clip-path: polygon(100% 0, 0 100%, 100% 100%);" role="button" tabindex="0" aria-label="Resize"></div>'), Jr = e.from_html('<div role="group"><span class="font-bold text-primary opacity-50">Dock Top</span></div> <div role="group"><span class="font-bold text-primary opacity-50">Dock Bottom</span></div> <div role="group"><span class="font-bold text-primary opacity-50 vertical-rl rotate-180" style="writing-mode: vertical-rl;">Dock Left</span></div> <div role="group"><span class="font-bold text-primary opacity-50 vertical-rl rotate-180" style="writing-mode: vertical-rl;">Dock Right</span></div>', 1), Zr = e.from_html('<div><button class="absolute top-1 right-1 btn btn-error btn-xs btn-circle z-20" aria-label="Close Gallery"><!></button> <div><div role="button" tabindex="0" aria-label="Drag Gallery"><div></div></div></div> <div><div></div></div> <!></div> <!>', 1);
1250
- function ie(r, t) {
1297
+ e.create_custom_element(tt, {}, [], [], !0);
1298
+ var lr = e.from_html('<img class="object-contain w-full h-full" loading="lazy" draggable="false"/>'), cr = e.from_html('<span class="opacity-20 text-4xl">?</span>'), dr = e.from_html('<button><div class="aspect-4/3 bg-base-300 rounded overflow-hidden relative w-full flex items-center justify-center"><!></div> <div class="text-xs font-medium truncate w-full opacity-70 group-hover:opacity-100"><span class="font-bold mr-1"> </span> </div></button>'), fr = e.from_html('<div class="absolute bottom-0 right-0 w-6 h-6 cursor-se-resize resize-handle bg-accent hover:bg-accent-focus transition-colors z-50" style="clip-path: polygon(100% 0, 0 100%, 100% 100%);" role="button" tabindex="0" aria-label="Resize"></div>'), ur = e.from_html('<div role="group"><span class="font-bold text-primary opacity-50">Dock Top</span></div> <div role="group"><span class="font-bold text-primary opacity-50">Dock Bottom</span></div> <div role="group"><span class="font-bold text-primary opacity-50 vertical-rl rotate-180" style="writing-mode: vertical-rl;">Dock Left</span></div> <div role="group"><span class="font-bold text-primary opacity-50 vertical-rl rotate-180" style="writing-mode: vertical-rl;">Dock Right</span></div>', 1), gr = e.from_html('<div><button class="absolute top-1 right-1 btn btn-error btn-xs btn-circle z-20" aria-label="Close Gallery"><!></button> <div><div role="button" tabindex="0" aria-label="Drag Gallery"><div></div></div></div> <div><div></div></div> <!></div> <!>', 1);
1299
+ function ne(i, t) {
1251
1300
  e.push(t, !0);
1252
- const s = le(ae);
1253
- let n = e.prop(t, "canvases", 7), a = e.state(!1), i = { x: 0, y: 0, w: 0, h: 0 }, I = e.state(null), C = e.derived(() => !n() || !Array.isArray(n()) ? [] : n().map((o, T) => {
1254
- let b = "";
1301
+ const r = oe(se);
1302
+ let s = e.prop(t, "canvases", 7), n = e.state(!1), a = { x: 0, y: 0, w: 0, h: 0 }, y = e.state(null), I = e.derived(() => !s() || !Array.isArray(s()) ? [] : s().map((l, C) => {
1303
+ let _ = "";
1255
1304
  try {
1256
- if (o.getThumbnail) {
1257
- const y = o.getThumbnail();
1258
- y && (b = typeof y == "string" ? y : y.id || y["@id"]);
1305
+ if (l.getThumbnail) {
1306
+ const x = l.getThumbnail();
1307
+ x && (_ = typeof x == "string" ? x : x.id || x["@id"]);
1259
1308
  }
1260
- } catch (y) {
1261
- console.warn("Error getting thumbnail", y);
1309
+ } catch (x) {
1310
+ console.warn("Error getting thumbnail", x);
1262
1311
  }
1263
- if (!b) {
1264
- let y = o.getImages();
1265
- if ((!y || !y.length) && o.getContent && (y = o.getContent()), y && y.length > 0) {
1266
- const L = y[0];
1267
- let m = L.getResource ? L.getResource() : null;
1268
- if (!m && L.getBody) {
1269
- const h = L.getBody();
1270
- Array.isArray(h) && h.length > 0 ? m = h[0] : h && (m = h);
1312
+ if (!_) {
1313
+ let x = l.getImages();
1314
+ if ((!x || !x.length) && l.getContent && (x = l.getContent()), x && x.length > 0) {
1315
+ const D = x[0];
1316
+ let b = D.getResource ? D.getResource() : null;
1317
+ if (!b && D.getBody) {
1318
+ const h = D.getBody();
1319
+ Array.isArray(h) && h.length > 0 ? b = h[0] : h && (b = h);
1271
1320
  }
1272
- if (m && !m.id && !m.__jsonld && (!m.getServices || m.getServices().length === 0) && (m = null), !m) {
1273
- const h = L.__jsonld || L;
1274
- h.body && (m = Array.isArray(h.body) ? h.body[0] : h.body);
1321
+ if (b && !b.id && !b.__jsonld && (!b.getServices || b.getServices().length === 0) && (b = null), !b) {
1322
+ const h = D.__jsonld || D;
1323
+ h.body && (b = Array.isArray(h.body) ? h.body[0] : h.body);
1275
1324
  }
1276
- if (m) {
1277
- const X = (() => {
1278
- let v = [];
1279
- if (m.getServices && (v = m.getServices()), !v || v.length === 0) {
1280
- const k = m.__jsonld || m;
1281
- k.service && (v = Array.isArray(k.service) ? k.service : [k.service]);
1325
+ if (b) {
1326
+ const H = (() => {
1327
+ let m = [];
1328
+ if (b.getServices && (m = b.getServices()), !m || m.length === 0) {
1329
+ const P = b.__jsonld || b;
1330
+ P.service && (m = Array.isArray(P.service) ? P.service : [P.service]);
1282
1331
  }
1283
- return v;
1332
+ return m;
1284
1333
  })();
1285
1334
  let W = !1;
1286
- if (X.length > 0) {
1287
- const v = X[0];
1288
- let k = "";
1335
+ if (H.length > 0) {
1336
+ const m = H[0];
1337
+ let P = "";
1289
1338
  try {
1290
- if (k = v.getProfile ? v.getProfile() : v.profile || "", typeof k == "object" && k) {
1291
- const Q = k;
1292
- k = Q.value || Q.id || Q["@id"] || JSON.stringify(Q);
1339
+ if (P = m.getProfile ? m.getProfile() : m.profile || "", typeof P == "object" && P) {
1340
+ const U = P;
1341
+ P = U.value || U.id || U["@id"] || JSON.stringify(U);
1293
1342
  }
1294
1343
  } catch {
1295
1344
  }
1296
- const D = String(k ?? "").toLowerCase();
1297
- (D.includes("level0") || D.includes("level-0")) && (W = !0);
1298
- const q = v.id || v["@id"];
1299
- W || (b = `${q}/full/200,/0/default.jpg`);
1345
+ const O = String(P ?? "").toLowerCase();
1346
+ (O.includes("level0") || O.includes("level-0")) && (W = !0);
1347
+ const Q = m.id || m["@id"];
1348
+ W || (_ = `${Q}/full/200,/0/default.jpg`);
1300
1349
  }
1301
- if (!b && (b = m.id || m["@id"], !b)) {
1302
- let v = null;
1303
- if (L.__jsonld && L.__jsonld.body ? v = L.__jsonld.body : L.body && (v = L.body), v) {
1304
- const k = Array.isArray(v) ? v[0] : v;
1305
- b = k.id || k["@id"];
1350
+ if (!_ && (_ = b.id || b["@id"], !_)) {
1351
+ let m = null;
1352
+ if (D.__jsonld && D.__jsonld.body ? m = D.__jsonld.body : D.body && (m = D.body), m) {
1353
+ const P = Array.isArray(m) ? m[0] : m;
1354
+ _ = P.id || P["@id"];
1306
1355
  }
1307
1356
  }
1308
1357
  }
1309
1358
  }
1310
1359
  }
1311
1360
  return {
1312
- id: o.id,
1313
- label: o.getLabel().length ? o.getLabel()[0].value : `Canvas ${T + 1}`,
1314
- src: b,
1315
- index: T
1361
+ id: l.id,
1362
+ label: l.getLabel().length ? l.getLabel()[0].value : `Canvas ${C + 1}`,
1363
+ src: _,
1364
+ index: C
1316
1365
  };
1317
1366
  }));
1318
- function x(o) {
1319
- if (!s.isGalleryDragging) return;
1320
- let T = o.clientX - s.galleryDragOffset.x, b = o.clientY - s.galleryDragOffset.y;
1321
- const y = Math.max(0, window.innerWidth - s.gallerySize.width), L = Math.max(0, window.innerHeight - s.gallerySize.height);
1322
- T = Math.max(0, Math.min(T, y)), b = Math.max(0, Math.min(b, L)), s.galleryPosition = { x: T, y: b };
1323
- const m = document.getElementById("triiiceratops-center-panel");
1324
- if (m) {
1325
- const h = m.getBoundingClientRect(), X = o.clientX, W = o.clientY, v = 60;
1326
- s.dragOverSide = null, X >= h.left && X <= h.left + v ? s.dragOverSide = "left" : X <= h.right && X >= h.right - v ? s.dragOverSide = "right" : W >= h.top && W <= h.top + v ? s.dragOverSide = "top" : W <= h.bottom && W >= h.bottom - v && (s.dragOverSide = "bottom");
1367
+ function c(l) {
1368
+ if (!r.isGalleryDragging) return;
1369
+ let C = l.clientX - r.galleryDragOffset.x, _ = l.clientY - r.galleryDragOffset.y;
1370
+ const x = Math.max(0, window.innerWidth - r.gallerySize.width), D = Math.max(0, window.innerHeight - r.gallerySize.height);
1371
+ C = Math.max(0, Math.min(C, x)), _ = Math.max(0, Math.min(_, D)), r.galleryPosition = { x: C, y: _ };
1372
+ const b = document.getElementById("triiiceratops-center-panel");
1373
+ if (b) {
1374
+ const h = b.getBoundingClientRect(), H = l.clientX, W = l.clientY, m = 60;
1375
+ r.dragOverSide = null, H >= h.left && H <= h.left + m ? r.dragOverSide = "left" : H <= h.right && H >= h.right - m ? r.dragOverSide = "right" : W >= h.top && W <= h.top + m ? r.dragOverSide = "top" : W <= h.bottom && W >= h.bottom - m && (r.dragOverSide = "bottom");
1327
1376
  }
1328
1377
  }
1329
1378
  function w() {
1330
- const o = s.dragOverSide;
1331
- s.isGalleryDragging = !1, s.dragOverSide = null, window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", w), o && (s.dockSide = o);
1332
- }
1333
- function $(o) {
1334
- o.stopPropagation(), e.set(a, !0), i = {
1335
- x: o.clientX,
1336
- y: o.clientY,
1337
- w: s.gallerySize.width,
1338
- h: s.gallerySize.height
1339
- }, window.addEventListener("mousemove", j), window.addEventListener("mouseup", d);
1340
- }
1341
- function j(o) {
1342
- if (!e.get(a)) return;
1343
- const T = o.clientX - i.x, b = o.clientY - i.y;
1344
- s.gallerySize = {
1345
- width: Math.max(200, i.w + T),
1346
- height: Math.max(200, i.h + b)
1379
+ const l = r.dragOverSide;
1380
+ r.isGalleryDragging = !1, r.dragOverSide = null, window.removeEventListener("mousemove", c), window.removeEventListener("mouseup", w), l && (r.dockSide = l);
1381
+ }
1382
+ function k(l) {
1383
+ l.stopPropagation(), e.set(n, !0), a = {
1384
+ x: l.clientX,
1385
+ y: l.clientY,
1386
+ w: r.gallerySize.width,
1387
+ h: r.gallerySize.height
1388
+ }, window.addEventListener("mousemove", z), window.addEventListener("mouseup", d);
1389
+ }
1390
+ function z(l) {
1391
+ if (!e.get(n)) return;
1392
+ const C = l.clientX - a.x, _ = l.clientY - a.y;
1393
+ r.gallerySize = {
1394
+ width: Math.max(200, a.w + C),
1395
+ height: Math.max(200, a.h + _)
1347
1396
  };
1348
1397
  }
1349
1398
  function d() {
1350
- e.set(a, !1), window.removeEventListener("mousemove", j), window.removeEventListener("mouseup", d);
1399
+ e.set(n, !1), window.removeEventListener("mousemove", z), window.removeEventListener("mouseup", d);
1351
1400
  }
1352
- function u(o) {
1353
- s.canvasId = o;
1401
+ function g(l) {
1402
+ r.canvasId = l;
1354
1403
  }
1355
- let p = e.state(e.proxy(s.dockSide));
1404
+ let p = e.state(e.proxy(r.dockSide));
1356
1405
  e.user_effect(() => {
1357
- const o = s.dockSide;
1358
- e.set(p, o === "none" || o === "top" || o === "bottom" || o === "left" || o === "right" ? o : "none", !0);
1406
+ const l = r.dockSide;
1407
+ e.set(p, l === "none" || l === "top" || l === "bottom" || l === "left" || l === "right" ? l : "none", !0);
1359
1408
  }), e.user_effect(() => {
1360
- s.dockSide !== e.get(p) && (s.dockSide = e.get(p), s.isGalleryDockedBottom = e.get(p) === "bottom", s.isGalleryDockedRight = e.get(p) === "right");
1409
+ r.dockSide !== e.get(p) && (r.dockSide = e.get(p), r.isGalleryDockedBottom = e.get(p) === "bottom", r.isGalleryDockedRight = e.get(p) === "right");
1361
1410
  });
1362
- let c = e.derived(() => e.get(p) === "top" || e.get(p) === "bottom" || e.get(p) === "none" && s.gallerySize.height < 320);
1363
- function f(o) {
1364
- if (!o.target.closest(".resize-handle")) {
1411
+ let f = e.derived(() => e.get(p) === "top" || e.get(p) === "bottom" || e.get(p) === "none" && r.gallerySize.height < 320);
1412
+ function v(l) {
1413
+ if (!l.target.closest(".resize-handle")) {
1365
1414
  if (e.get(p) !== "none") {
1366
- let T = Math.max(0, o.clientX - 150), b = Math.max(0, o.clientY - 20);
1367
- const y = Math.max(0, window.innerWidth - 300), L = Math.max(0, window.innerHeight - 400);
1368
- T = Math.min(T, y), b = Math.min(b, L), s.galleryPosition = { x: T, y: b }, s.galleryDragOffset = { x: o.clientX - T, y: o.clientY - b }, e.set(p, "none");
1415
+ let C = Math.max(0, l.clientX - 150), _ = Math.max(0, l.clientY - 20);
1416
+ const x = Math.max(0, window.innerWidth - 300), D = Math.max(0, window.innerHeight - 400);
1417
+ C = Math.min(C, x), _ = Math.min(_, D), r.galleryPosition = { x: C, y: _ }, r.galleryDragOffset = { x: l.clientX - C, y: l.clientY - _ }, e.set(p, "none");
1369
1418
  } else
1370
- s.galleryDragOffset = {
1371
- x: o.clientX - s.galleryPosition.x,
1372
- y: o.clientY - s.galleryPosition.y
1419
+ r.galleryDragOffset = {
1420
+ x: l.clientX - r.galleryPosition.x,
1421
+ y: l.clientY - r.galleryPosition.y
1373
1422
  };
1374
- s.isGalleryDragging = !0, window.addEventListener("mousemove", x), window.addEventListener("mouseup", w);
1423
+ r.isGalleryDragging = !0, window.addEventListener("mousemove", c), window.addEventListener("mouseup", w);
1375
1424
  }
1376
1425
  }
1377
- var l = {
1426
+ var o = {
1378
1427
  get canvases() {
1379
- return n();
1428
+ return s();
1380
1429
  },
1381
- set canvases(o) {
1382
- n(o), e.flush();
1430
+ set canvases(l) {
1431
+ s(l), e.flush();
1383
1432
  }
1384
- }, S = e.comment(), H = e.first_child(S);
1433
+ }, S = e.comment(), G = e.first_child(S);
1385
1434
  {
1386
- var z = (o) => {
1387
- var T = Zr(), b = e.first_child(T), y = e.child(b);
1388
- y.__click = () => s.toggleThumbnailGallery();
1389
- var L = e.child(y);
1390
- Ye(L, { size: 16, weight: "bold" }), e.reset(y);
1391
- var m = e.sibling(y, 2), h = e.child(m);
1392
- h.__mousedown = f;
1393
- var X = e.child(h);
1394
- e.reset(h), e.reset(m);
1395
- var W = e.sibling(m, 2), v = e.child(W);
1396
- e.each(v, 21, () => e.get(C), e.index, (V, G) => {
1397
- var N = Ur();
1398
- N.__click = () => u(e.get(G).id);
1399
- var K = e.child(N), te = e.child(K);
1435
+ var L = (l) => {
1436
+ var C = gr(), _ = e.first_child(C), x = e.child(_);
1437
+ x.__click = () => r.toggleThumbnailGallery();
1438
+ var D = e.child(x);
1439
+ qe(D, { size: 16, weight: "bold" }), e.reset(x);
1440
+ var b = e.sibling(x, 2), h = e.child(b);
1441
+ h.__mousedown = v;
1442
+ var H = e.child(h);
1443
+ e.reset(h), e.reset(b);
1444
+ var W = e.sibling(b, 2), m = e.child(W);
1445
+ e.each(m, 21, () => e.get(I), e.index, ($, F) => {
1446
+ var q = dr();
1447
+ q.__click = () => g(e.get(F).id);
1448
+ var J = e.child(q), ie = e.child(J);
1400
1449
  {
1401
- var g = (M) => {
1402
- var Z = Qr();
1450
+ var u = (M) => {
1451
+ var Y = lr();
1403
1452
  e.template_effect(() => {
1404
- e.set_attribute(Z, "src", e.get(G).src), e.set_attribute(Z, "alt", e.get(G).label);
1405
- }), e.append(M, Z);
1406
- }, _ = (M) => {
1407
- var Z = Wr();
1408
- e.append(M, Z);
1453
+ e.set_attribute(Y, "src", e.get(F).src), e.set_attribute(Y, "alt", e.get(F).label);
1454
+ }), e.append(M, Y);
1455
+ }, T = (M) => {
1456
+ var Y = cr();
1457
+ e.append(M, Y);
1409
1458
  };
1410
- e.if(te, (M) => {
1411
- e.get(G).src ? M(g) : M(_, !1);
1459
+ e.if(ie, (M) => {
1460
+ e.get(F).src ? M(u) : M(T, !1);
1412
1461
  });
1413
1462
  }
1414
- e.reset(K);
1415
- var R = e.sibling(K, 2), E = e.child(R), O = e.child(E);
1463
+ e.reset(J);
1464
+ var N = e.sibling(J, 2), E = e.child(N), R = e.child(E);
1416
1465
  e.reset(E);
1417
- var P = e.sibling(E);
1418
- e.reset(R), e.reset(N), e.template_effect(() => {
1419
- e.set_class(N, 1, `group flex flex-col gap-1 p-1 rounded hover:bg-base-200 transition-colors text-left relative shrink-0 ${e.get(c) ? "w-[140px]" : ""} ${s.canvasId === e.get(G).id ? "ring-2 ring-primary bg-primary/5" : ""}`), e.set_attribute(N, "aria-label", `Select canvas ${e.get(G).label ?? ""}`), e.set_text(O, `${e.get(G).index + 1}.`), e.set_text(P, ` ${e.get(G).label ?? ""}`);
1420
- }), e.append(V, N);
1421
- }), e.reset(v), e.reset(W);
1422
- var k = e.sibling(W, 2);
1466
+ var j = e.sibling(E);
1467
+ e.reset(N), e.reset(q), e.template_effect(() => {
1468
+ e.set_class(q, 1, `group flex flex-col gap-1 p-1 rounded hover:bg-base-200 transition-colors text-left relative shrink-0 ${e.get(f) ? "w-[140px]" : ""} ${r.canvasId === e.get(F).id ? "ring-2 ring-primary bg-primary/5" : ""}`), e.set_attribute(q, "aria-label", `Select canvas ${e.get(F).label ?? ""}`), e.set_text(R, `${e.get(F).index + 1}.`), e.set_text(j, ` ${e.get(F).label ?? ""}`);
1469
+ }), e.append($, q);
1470
+ }), e.reset(m), e.reset(W);
1471
+ var P = e.sibling(W, 2);
1423
1472
  {
1424
- var D = (V) => {
1425
- var G = Kr();
1426
- G.__mousedown = $, e.append(V, G);
1473
+ var O = ($) => {
1474
+ var F = fr();
1475
+ F.__mousedown = k, e.append($, F);
1427
1476
  };
1428
- e.if(k, (V) => {
1429
- e.get(p) === "none" && V(D);
1477
+ e.if(P, ($) => {
1478
+ e.get(p) === "none" && $(O);
1430
1479
  });
1431
1480
  }
1432
- e.reset(b), e.bind_this(b, (V) => e.set(I, V), () => e.get(I));
1433
- var q = e.sibling(b, 2);
1481
+ e.reset(_), e.bind_this(_, ($) => e.set(y, $), () => e.get(y));
1482
+ var Q = e.sibling(_, 2);
1434
1483
  {
1435
- var Q = (V) => {
1436
- var G = Jr(), N = e.first_child(G), K = e.sibling(N, 2), te = e.sibling(K, 2), g = e.sibling(te, 2);
1484
+ var U = ($) => {
1485
+ var F = ur(), q = e.first_child(F), J = e.sibling(q, 2), ie = e.sibling(J, 2), u = e.sibling(ie, 2);
1437
1486
  e.template_effect(() => {
1438
- e.set_class(N, 1, `absolute top-2 left-2 right-2 h-16 rounded-xl border-4 border-dashed border-primary/40 z-950 flex items-center justify-center transition-all duration-200 ${s.dragOverSide === "top" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(K, 1, `absolute bottom-2 left-2 right-2 h-16 rounded-xl border-4 border-dashed border-primary/40 z-950 flex items-center justify-center transition-all duration-200 ${s.dragOverSide === "bottom" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(te, 1, `absolute top-2 bottom-2 left-2 w-16 rounded-xl border-4 border-dashed border-primary/40 z-950 flex items-center justify-center transition-all duration-200 ${s.dragOverSide === "left" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(g, 1, `absolute top-2 bottom-2 right-2 w-16 rounded-xl border-4 border-dashed border-primary/40 z-950 flex items-center justify-center transition-all duration-300 ${s.dragOverSide === "right" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`);
1439
- }), e.append(V, G);
1487
+ e.set_class(q, 1, `absolute top-2 left-2 right-2 h-16 rounded-xl border-4 border-dashed border-primary/40 z-950 flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "top" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(J, 1, `absolute bottom-2 left-2 right-2 h-16 rounded-xl border-4 border-dashed border-primary/40 z-950 flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "bottom" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(ie, 1, `absolute top-2 bottom-2 left-2 w-16 rounded-xl border-4 border-dashed border-primary/40 z-950 flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "left" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(u, 1, `absolute top-2 bottom-2 right-2 w-16 rounded-xl border-4 border-dashed border-primary/40 z-950 flex items-center justify-center transition-all duration-300 ${r.dragOverSide === "right" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`);
1488
+ }), e.append($, F);
1440
1489
  };
1441
- e.if(q, (V) => {
1442
- s.isGalleryDragging && V(Q);
1490
+ e.if(Q, ($) => {
1491
+ r.isGalleryDragging && $(U);
1443
1492
  });
1444
1493
  }
1445
1494
  e.template_effect(() => {
1446
- e.set_class(b, 1, (e.get(p) !== "none" ? `relative z-50 bg-base-100 shadow-xl border-base-300 flex transition-all duration-200 select-none w-full h-full
1495
+ e.set_class(_, 1, (e.get(p) !== "none" ? `relative z-50 bg-base-100 shadow-xl border-base-300 flex transition-all duration-200 select-none w-full h-full
1447
1496
  ${e.get(p) === "bottom" || e.get(p) === "top" ? "flex-row border-t" : ""}
1448
- ${e.get(p) === "left" || e.get(p) === "right" ? "flex-col border-x" : ""}` : "fixed z-900 bg-base-100 shadow-2xl rounded-lg flex flex-col border border-base-300 overflow-hidden select-none") + (s.isGalleryDragging ? " pointer-events-none opacity-80" : "")), e.set_style(b, e.get(p) !== "none" ? "" : `left: ${s.galleryPosition.x}px; top: ${s.galleryPosition.y}px; width: ${s.gallerySize.width}px; height: ${s.gallerySize.height}px;`), e.set_class(m, 1, "bg-base-100 flex shrink-0 select-none relative " + (e.get(p) === "bottom" || e.get(p) === "top" ? "flex-row h-full items-center border-r border-base-200" : "flex-col w-full border-b border-base-200")), e.set_class(h, 1, "cursor-move flex items-center justify-center hover:bg-base-200/50 active:bg-base-200 transition-colors " + (e.get(p) === "bottom" || e.get(p) === "top" ? "w-8 h-full" : "h-6 w-full")), e.set_class(X, 1, "bg-base-300 rounded-full " + (e.get(p) === "bottom" || e.get(p) === "top" ? "w-1.5 h-12" : "w-12 h-1.5")), e.set_class(W, 1, `flex-1 p-1 bg-base-100 ${e.get(c) ? "overflow-x-auto overflow-y-hidden" : "overflow-y-auto overflow-x-hidden"}`), e.set_class(v, 1, e.clsx(e.get(c) ? "flex flex-row gap-2 h-full items-center" : "grid gap-2")), e.set_style(v, e.get(c) ? "" : "grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));");
1449
- }), e.append(o, T);
1497
+ ${e.get(p) === "left" || e.get(p) === "right" ? "flex-col border-x" : ""}` : "fixed z-900 bg-base-100 shadow-2xl rounded-lg flex flex-col border border-base-300 overflow-hidden select-none") + (r.isGalleryDragging ? " pointer-events-none opacity-80" : "")), e.set_style(_, e.get(p) !== "none" ? "" : `left: ${r.galleryPosition.x}px; top: ${r.galleryPosition.y}px; width: ${r.gallerySize.width}px; height: ${r.gallerySize.height}px;`), e.set_class(b, 1, "bg-base-100 flex shrink-0 select-none relative " + (e.get(p) === "bottom" || e.get(p) === "top" ? "flex-row h-full items-center border-r border-base-200" : "flex-col w-full border-b border-base-200")), e.set_class(h, 1, "cursor-move flex items-center justify-center hover:bg-base-200/50 active:bg-base-200 transition-colors " + (e.get(p) === "bottom" || e.get(p) === "top" ? "w-8 h-full" : "h-6 w-full")), e.set_class(H, 1, "bg-base-300 rounded-full " + (e.get(p) === "bottom" || e.get(p) === "top" ? "w-1.5 h-12" : "w-12 h-1.5")), e.set_class(W, 1, `flex-1 p-1 bg-base-100 ${e.get(f) ? "overflow-x-auto overflow-y-hidden" : "overflow-y-auto overflow-x-hidden"}`), e.set_class(m, 1, e.clsx(e.get(f) ? "flex flex-row gap-2 h-full items-center" : "grid gap-2")), e.set_style(m, e.get(f) ? "" : "grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));");
1498
+ }), e.append(l, C);
1450
1499
  };
1451
- e.if(H, (o) => {
1452
- s.showThumbnailGallery && o(z);
1500
+ e.if(G, (l) => {
1501
+ r.showThumbnailGallery && l(L);
1453
1502
  });
1454
1503
  }
1455
- return e.append(r, S), e.pop(l);
1504
+ return e.append(i, S), e.pop(o);
1456
1505
  }
1457
1506
  e.delegate(["click", "mousedown"]);
1458
- e.create_custom_element(ie, { canvases: {} }, [], [], !0);
1459
- var en = e.from_html('<div class="fab fab-flower fab-top-left absolute z-600 pointer-events-auto flex-col items-end transition-all duration-300 bottom-6 right-6"><div class="tooltip tooltip-left"><div tabindex="0" role="button" class="btn btn-lg btn-primary btn-circle shadow-xl"><span class="sr-only"> </span> <!></div></div> <div class="fab-close tooltip tooltip-top"><button><!></button></div> <div class="tooltip tooltip-left"><button><!></button></div> <div class="tooltip tooltip-left"><button><!></button></div> <div class="tooltip tooltip-top"><button><!></button></div> <div class="tooltip tooltip-top"><button><!></button></div></div>');
1460
- function Je(r, t) {
1507
+ e.create_custom_element(ne, { canvases: {} }, [], [], !0);
1508
+ var vr = e.from_html('<div class="fab fab-flower fab-top-left absolute z-600 pointer-events-auto flex-col items-end transition-all duration-300 bottom-6 right-6"><div class="tooltip tooltip-left"><div tabindex="0" role="button" class="btn btn-lg btn-primary btn-circle shadow-xl"><span class="sr-only"> </span> <!></div></div> <div class="fab-close tooltip tooltip-top"><button><!></button></div> <div class="tooltip tooltip-left"><button><!></button></div> <div class="tooltip tooltip-left"><button><!></button></div> <div class="tooltip tooltip-top"><button><!></button></div> <div class="tooltip tooltip-top"><button><!></button></div></div>');
1509
+ function rt(i, t) {
1461
1510
  e.push(t, !1);
1462
- const s = le(ae);
1511
+ const r = oe(se);
1463
1512
  e.init();
1464
- var n = en(), a = e.child(n), i = e.child(a), I = e.child(i), C = e.child(I, !0);
1465
- e.reset(I);
1466
- var x = e.sibling(I, 2);
1467
- bt(x, { size: 32, weight: "bold" }), e.reset(i), e.reset(a);
1468
- var w = e.sibling(a, 2), $ = e.child(w);
1469
- $.__click = () => s.toggleSearchPanel();
1470
- var j = e.child($);
1471
- Xe(j, { size: 28, weight: "bold" }), e.reset($), e.reset(w);
1472
- var d = e.sibling(w, 2), u = e.child(d);
1473
- u.__click = () => s.toggleThumbnailGallery();
1474
- var p = e.child(u);
1475
- yt(p, { size: 28, weight: "bold" }), e.reset(u), e.reset(d);
1476
- var c = e.sibling(d, 2), f = e.child(c);
1477
- f.__click = () => s.toggleFullScreen();
1478
- var l = e.child(f);
1513
+ var s = vr(), n = e.child(s), a = e.child(n), y = e.child(a), I = e.child(y, !0);
1514
+ e.reset(y);
1515
+ var c = e.sibling(y, 2);
1516
+ xt(c, { size: 32, weight: "bold" }), e.reset(a), e.reset(n);
1517
+ var w = e.sibling(n, 2), k = e.child(w);
1518
+ k.__click = () => r.toggleSearchPanel();
1519
+ var z = e.child(k);
1520
+ Qe(z, { size: 28, weight: "bold" }), e.reset(k), e.reset(w);
1521
+ var d = e.sibling(w, 2), g = e.child(d);
1522
+ g.__click = () => r.toggleThumbnailGallery();
1523
+ var p = e.child(g);
1524
+ St(p, { size: 28, weight: "bold" }), e.reset(g), e.reset(d);
1525
+ var f = e.sibling(d, 2), v = e.child(f);
1526
+ v.__click = () => r.toggleFullScreen();
1527
+ var o = e.child(v);
1479
1528
  {
1480
- var S = (m) => {
1481
- pt(m, { size: 28, weight: "bold" });
1482
- }, H = (m) => {
1483
- mt(m, { size: 28, weight: "bold" });
1529
+ var S = (b) => {
1530
+ _t(b, { size: 28, weight: "bold" });
1531
+ }, G = (b) => {
1532
+ yt(b, { size: 28, weight: "bold" });
1484
1533
  };
1485
- e.if(l, (m) => {
1486
- s.isFullScreen ? m(S) : m(H, !1);
1534
+ e.if(o, (b) => {
1535
+ r.isFullScreen ? b(S) : b(G, !1);
1487
1536
  });
1488
1537
  }
1489
- e.reset(f), e.reset(c);
1490
- var z = e.sibling(c, 2), o = e.child(z);
1491
- o.__click = () => s.toggleAnnotations();
1492
- var T = e.child(o);
1493
- vt(T, { size: 28, weight: "bold" }), e.reset(o), e.reset(z);
1494
- var b = e.sibling(z, 2), y = e.child(b);
1495
- y.__click = () => s.toggleMetadataDialog();
1496
- var L = e.child(y);
1497
- _t(L, { size: 28, weight: "bold" }), e.reset(y), e.reset(b), e.reset(n), e.template_effect(
1498
- (m, h, X, W, v, k, D, q, Q, V, G) => {
1499
- e.set_attribute(a, "data-tip", m), e.set_text(C, h), e.set_attribute(w, "data-tip", X), e.set_attribute($, "aria-label", W), e.set_class($, 1, e.clsx([
1538
+ e.reset(v), e.reset(f);
1539
+ var L = e.sibling(f, 2), l = e.child(L);
1540
+ l.__click = () => r.toggleAnnotations();
1541
+ var C = e.child(l);
1542
+ bt(C, { size: 28, weight: "bold" }), e.reset(l), e.reset(L);
1543
+ var _ = e.sibling(L, 2), x = e.child(_);
1544
+ x.__click = () => r.toggleMetadataDialog();
1545
+ var D = e.child(x);
1546
+ wt(D, { size: 28, weight: "bold" }), e.reset(x), e.reset(_), e.reset(s), e.template_effect(
1547
+ (b, h, H, W, m, P, O, Q, U, $, F) => {
1548
+ e.set_attribute(n, "data-tip", b), e.set_text(I, h), e.set_attribute(w, "data-tip", H), e.set_attribute(k, "aria-label", W), e.set_class(k, 1, e.clsx([
1500
1549
  "btn btn-circle btn-lg shadow-lg",
1501
- s.showSearchPanel && "btn-primary",
1502
- !s.showSearchPanel && "btn-neutral"
1503
- ])), e.set_attribute(d, "data-tip", v), e.set_attribute(u, "aria-label", k), e.set_class(u, 1, `btn btn-lg btn-circle shadow-lg ${s.showThumbnailGallery ? "btn-info" : "btn-neutral"}`), e.set_attribute(c, "data-tip", D), e.set_class(f, 1, `btn btn-circle btn-lg shadow-lg transition-all duration-300 ease-out ${s.isFullScreen ? "btn-warning" : "btn-neutral"}`), e.set_attribute(z, "data-tip", q), e.set_attribute(o, "aria-label", Q), e.set_class(o, 1, `btn btn-lg btn-circle shadow-lg ${s.showAnnotations ? "btn-error" : "btn-neutral"}`), e.set_attribute(b, "data-tip", V), e.set_attribute(y, "aria-label", G), e.set_class(y, 1, `btn btn-lg btn-circle shadow-lg ${s.showMetadataDialog ? "btn-info" : "btn-neutral"}`);
1550
+ r.showSearchPanel && "btn-primary",
1551
+ !r.showSearchPanel && "btn-neutral"
1552
+ ])), e.set_attribute(d, "data-tip", m), e.set_attribute(g, "aria-label", P), e.set_class(g, 1, `btn btn-lg btn-circle shadow-lg ${r.showThumbnailGallery ? "btn-info" : "btn-neutral"}`), e.set_attribute(f, "data-tip", O), e.set_class(v, 1, `btn btn-circle btn-lg shadow-lg transition-all duration-300 ease-out ${r.isFullScreen ? "btn-warning" : "btn-neutral"}`), e.set_attribute(L, "data-tip", Q), e.set_attribute(l, "aria-label", U), e.set_class(l, 1, `btn btn-lg btn-circle shadow-lg ${r.showAnnotations ? "btn-error" : "btn-neutral"}`), e.set_attribute(_, "data-tip", $), e.set_attribute(x, "aria-label", F), e.set_class(x, 1, `btn btn-lg btn-circle shadow-lg ${r.showMetadataDialog ? "btn-info" : "btn-neutral"}`);
1504
1553
  },
1505
1554
  [
1506
1555
  () => B.menu(),
1507
1556
  () => B.menu(),
1508
1557
  () => B.search(),
1509
1558
  () => B.toggle_search(),
1510
- () => s.showThumbnailGallery ? B.hide_gallery() : B.show_gallery(),
1511
- () => s.showThumbnailGallery ? B.hide_gallery() : B.show_gallery(),
1512
- () => s.isFullScreen ? B.exit_full_screen() : B.enter_full_screen(),
1513
- () => s.showAnnotations ? B.hide_annotations() : B.show_annotations(),
1559
+ () => r.showThumbnailGallery ? B.hide_gallery() : B.show_gallery(),
1560
+ () => r.showThumbnailGallery ? B.hide_gallery() : B.show_gallery(),
1561
+ () => r.isFullScreen ? B.exit_full_screen() : B.enter_full_screen(),
1562
+ () => r.showAnnotations ? B.hide_annotations() : B.show_annotations(),
1514
1563
  () => B.toggle_annotations(),
1515
1564
  () => B.metadata(),
1516
1565
  () => B.toggle_metadata()
1517
1566
  ]
1518
- ), e.append(r, n), e.pop();
1567
+ ), e.append(i, s), e.pop();
1519
1568
  }
1520
1569
  e.delegate(["click"]);
1521
- e.create_custom_element(Je, {}, [], [], !0);
1522
- var tn = e.from_html('<div class="tooltip tooltip-right"><button><!></button></div>'), sn = e.from_html('<div class="absolute left-6 bottom-6 z-50 pointer-events-auto flex flex-col items-start transition-all duration-300"><div></div> <div class="tooltip tooltip-right" data-tip="Plugins"><button aria-label="Plugins"><!></button></div></div>');
1523
- function Ze(r, t) {
1570
+ e.create_custom_element(rt, {}, [], [], !0);
1571
+ var hr = e.from_html('<div class="tooltip tooltip-right"><button><!></button></div>'), pr = e.from_html('<div class="absolute left-6 bottom-6 z-50 pointer-events-auto flex flex-col items-start transition-all duration-300"><div></div> <div class="tooltip tooltip-right"><button><!></button></div></div>');
1572
+ function it(i, t) {
1524
1573
  e.push(t, !0);
1525
- const s = le(ae);
1526
- let n = e.derived(() => [...s.pluginMenuButtons].sort((w, $) => (w.order ?? 100) - ($.order ?? 100))), a = e.state(!1);
1527
- function i() {
1528
- e.set(a, !e.get(a));
1574
+ const r = oe(se);
1575
+ let s = e.derived(() => [...r.pluginMenuButtons].sort((w, k) => (w.order ?? 100) - (k.order ?? 100))), n = e.state(!1);
1576
+ function a() {
1577
+ e.set(n, !e.get(n));
1529
1578
  }
1530
- var I = e.comment(), C = e.first_child(I);
1579
+ var y = e.comment(), I = e.first_child(y);
1531
1580
  {
1532
- var x = (w) => {
1533
- var $ = sn(), j = e.child($);
1534
- e.each(j, 21, () => e.get(n), (l) => l.id, (l, S) => {
1535
- const H = e.derived(() => e.get(S).icon);
1536
- var z = tn(), o = e.child(z);
1537
- o.__click = () => {
1538
- e.get(S).onClick(), e.set(a, !1);
1581
+ var c = (w) => {
1582
+ var k = pr(), z = e.child(k);
1583
+ e.each(z, 21, () => e.get(s), (o) => o.id, (o, S) => {
1584
+ const G = e.derived(() => e.get(S).icon);
1585
+ var L = hr(), l = e.child(L);
1586
+ l.__click = () => {
1587
+ e.get(S).onClick(), e.set(n, !1);
1539
1588
  };
1540
- var T = e.child(o);
1541
- e.component(T, () => e.get(H), (b, y) => {
1542
- y(b, { size: 28, weight: "bold" });
1543
- }), e.reset(o), e.reset(z), e.template_effect(
1544
- (b) => {
1545
- e.set_attribute(z, "data-tip", e.get(S).tooltip), e.set_attribute(o, "aria-label", e.get(S).tooltip), e.set_class(o, 1, `btn btn-lg btn-circle shadow-lg ${b ?? ""}`);
1589
+ var C = e.child(l);
1590
+ e.component(C, () => e.get(G), (_, x) => {
1591
+ x(_, { size: 28, weight: "bold" });
1592
+ }), e.reset(l), e.reset(L), e.template_effect(
1593
+ (_) => {
1594
+ e.set_attribute(L, "data-tip", e.get(S).tooltip), e.set_attribute(l, "aria-label", e.get(S).tooltip), e.set_class(l, 1, `btn btn-lg btn-circle shadow-lg ${_ ?? ""}`);
1546
1595
  },
1547
1596
  [
1548
1597
  () => {
1549
- var b, y;
1550
- return (y = (b = e.get(S)).isActive) != null && y.call(b) ? e.get(S).activeClass ?? "btn-primary" : "btn-neutral";
1598
+ var _, x;
1599
+ return (x = (_ = e.get(S)).isActive) != null && x.call(_) ? e.get(S).activeClass ?? "btn-primary" : "btn-neutral";
1551
1600
  }
1552
1601
  ]
1553
- ), e.append(l, z);
1554
- }), e.reset(j);
1555
- var d = e.sibling(j, 2), u = e.child(d);
1556
- u.__click = i;
1557
- var p = e.child(u);
1602
+ ), e.append(o, L);
1603
+ }), e.reset(z);
1604
+ var d = e.sibling(z, 2), g = e.child(d);
1605
+ g.__click = a;
1606
+ var p = e.child(g);
1558
1607
  {
1559
- var c = (l) => {
1560
- Ye(l, { size: 28, weight: "bold" });
1561
- }, f = (l) => {
1562
- xt(l, { size: 28, weight: "bold" });
1608
+ var f = (o) => {
1609
+ qe(o, { size: 28, weight: "bold" });
1610
+ }, v = (o) => {
1611
+ At(o, { size: 28, weight: "bold" });
1563
1612
  };
1564
- e.if(p, (l) => {
1565
- e.get(a) ? l(c) : l(f, !1);
1613
+ e.if(p, (o) => {
1614
+ e.get(n) ? o(f) : o(v, !1);
1566
1615
  });
1567
1616
  }
1568
- e.reset(u), e.reset(d), e.reset($), e.template_effect(() => {
1569
- e.set_class(j, 1, `flex flex-col-reverse gap-3 mb-3 transition-all duration-300 origin-bottom ${e.get(a) ? "opacity-100 translate-y-0 scale-100" : "opacity-0 translate-y-4 scale-90 pointer-events-none"}`), e.set_class(u, 1, `btn btn-lg btn-secondary btn-circle shadow-xl transition-transform duration-300 ${e.get(a) ? "rotate-90" : ""}`);
1570
- }), e.append(w, $);
1617
+ e.reset(g), e.reset(d), e.reset(k), e.template_effect(
1618
+ (o, S) => {
1619
+ e.set_class(z, 1, `flex flex-col-reverse gap-3 mb-3 transition-all duration-300 origin-bottom ${e.get(n) ? "opacity-100 translate-y-0 scale-100" : "opacity-0 translate-y-4 scale-90 pointer-events-none"}`), e.set_attribute(d, "data-tip", o), e.set_class(g, 1, `btn btn-lg btn-secondary btn-circle shadow-xl transition-transform duration-300 ${e.get(n) ? "rotate-90" : ""}`), e.set_attribute(g, "aria-label", S);
1620
+ },
1621
+ [() => B.plugins_tooltip(), () => B.plugins_tooltip()]
1622
+ ), e.append(w, k);
1571
1623
  };
1572
- e.if(C, (w) => {
1573
- e.get(n).length > 0 && w(x);
1624
+ e.if(I, (w) => {
1625
+ e.get(s).length > 0 && w(c);
1574
1626
  });
1575
1627
  }
1576
- e.append(r, I), e.pop();
1628
+ e.append(i, y), e.pop();
1577
1629
  }
1578
1630
  e.delegate(["click"]);
1579
- e.create_custom_element(Ze, {}, [], [], !0);
1580
- var rn = e.from_html('<div class="mb-6 prose"><p><!></p></div>'), nn = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><!></dd>', 1), an = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><a target="_blank" rel="noreferrer" class="link link-primary break-all"> </a></dd>', 1), on = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><!></dd>', 1), ln = e.from_html('<dialog class="modal"><div class="modal-box w-11/12 max-w-5xl"><form method="dialog"><button class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2">✕</button></form> <h3 class="font-bold text-lg mb-4"> </h3> <div class="py-4 overflow-y-auto max-h-[70vh]"><!> <dl class="grid grid-cols-1 md:grid-cols-[200px_1fr]"><!> <!> <!></dl></div> <div class="modal-action"><form method="dialog"><button class="btn"> </button></form></div></div> <form method="dialog" class="modal-backdrop"><button> </button></form></dialog>');
1581
- function et(r, t) {
1631
+ e.create_custom_element(it, {}, [], [], !0);
1632
+ var mr = e.from_html('<div class="mb-6 prose"><p><!></p></div>'), br = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><!></dd>', 1), _r = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><a target="_blank" rel="noreferrer" class="link link-primary break-all"> </a></dd>', 1), yr = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><!></dd>', 1), wr = e.from_html('<dialog class="modal"><div class="modal-box w-11/12 max-w-5xl"><form method="dialog"><button class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2">✕</button></form> <h3 class="font-bold text-lg mb-4"> </h3> <div class="py-4 overflow-y-auto max-h-[70vh]"><!> <dl class="grid grid-cols-1 md:grid-cols-[200px_1fr]"><!> <!> <!></dl></div> <div class="modal-action"><form method="dialog"><button class="btn"> </button></form></div></div> <form method="dialog" class="modal-backdrop"><button> </button></form></dialog>');
1633
+ function st(i, t) {
1582
1634
  e.push(t, !0);
1583
- const s = le(ae);
1584
- let n = e.derived(() => s.manifest), a = e.derived(() => {
1585
- const v = Vr.current;
1586
- if (!e.get(n)) return [];
1587
- const k = e.get(n).getMetadata();
1588
- return k ? k.map((D) => {
1589
- let q = "", Q = "";
1590
- const V = (G) => {
1591
- if (typeof G == "string") return G;
1592
- if (Array.isArray(G)) {
1593
- let N = G.find((K) => K.locale === v || K.language === v);
1594
- return N || (N = G.find((K) => K.locale === "en" || K.language === "en")), N || (N = G.find((K) => !K.locale && !K.language)), N || (N = G[0]), N ? N.value : "";
1635
+ const r = oe(se);
1636
+ let s = e.derived(() => r.manifest), n = e.derived(() => {
1637
+ const m = pt.current;
1638
+ if (!e.get(s)) return [];
1639
+ const P = e.get(s).getMetadata();
1640
+ return P ? P.map((O) => {
1641
+ let Q = "", U = "";
1642
+ const $ = (F) => {
1643
+ if (typeof F == "string") return F;
1644
+ if (Array.isArray(F)) {
1645
+ let q = F.find((J) => J.locale === m || J.language === m);
1646
+ return q || (q = F.find((J) => J.locale === "en" || J.language === "en")), q || (q = F.find((J) => !J.locale && !J.language)), q || (q = F[0]), q ? q.value : "";
1595
1647
  }
1596
- return String(G);
1648
+ return String(F);
1597
1649
  };
1598
- return D.getLabel ? q = V(D.getLabel()) : D.label && (q = V(D.label)), D.getValue ? Q = V(D.getValue()) : D.value && (Q = V(D.value)), { label: q, value: Q };
1650
+ return O.getLabel ? Q = $(O.getLabel()) : O.label && (Q = $(O.label)), O.getValue ? U = $(O.getValue()) : O.value && (U = $(O.value)), { label: Q, value: U };
1599
1651
  }) : [];
1600
- }), i = e.derived(() => e.get(n) ? e.get(n).getDescription() : ""), I = e.derived(() => {
1601
- var v;
1602
- return e.get(n) ? (v = e.get(n).getRequiredStatement()) == null ? void 0 : v.getValue() : "";
1603
- }), C = e.derived(() => e.get(n) ? e.get(n).getLicense() : "");
1604
- var x = ln(), w = e.child(x), $ = e.child(w), j = e.child($);
1605
- j.__click = () => s.toggleMetadataDialog(), e.reset($);
1606
- var d = e.sibling($, 2), u = e.child(d, !0);
1652
+ }), a = e.derived(() => e.get(s) ? e.get(s).getDescription() : ""), y = e.derived(() => {
1653
+ var m;
1654
+ return e.get(s) ? (m = e.get(s).getRequiredStatement()) == null ? void 0 : m.getValue() : "";
1655
+ }), I = e.derived(() => e.get(s) ? e.get(s).getLicense() : "");
1656
+ var c = wr(), w = e.child(c), k = e.child(w), z = e.child(k);
1657
+ z.__click = () => r.toggleMetadataDialog(), e.reset(k);
1658
+ var d = e.sibling(k, 2), g = e.child(d, !0);
1607
1659
  e.reset(d);
1608
- var p = e.sibling(d, 2), c = e.child(p);
1660
+ var p = e.sibling(d, 2), f = e.child(p);
1609
1661
  {
1610
- var f = (v) => {
1611
- var k = rn(), D = e.child(k), q = e.child(D);
1612
- e.html(q, () => e.get(i)), e.reset(D), e.reset(k), e.append(v, k);
1662
+ var v = (m) => {
1663
+ var P = mr(), O = e.child(P), Q = e.child(O);
1664
+ e.html(Q, () => e.get(a)), e.reset(O), e.reset(P), e.append(m, P);
1613
1665
  };
1614
- e.if(c, (v) => {
1615
- e.get(i) && v(f);
1666
+ e.if(f, (m) => {
1667
+ e.get(a) && m(v);
1616
1668
  });
1617
1669
  }
1618
- var l = e.sibling(c, 2), S = e.child(l);
1670
+ var o = e.sibling(f, 2), S = e.child(o);
1619
1671
  {
1620
- var H = (v) => {
1621
- var k = nn(), D = e.first_child(k), q = e.child(D, !0);
1622
- e.reset(D);
1623
- var Q = e.sibling(D, 2), V = e.child(Q);
1624
- e.html(V, () => e.get(I)), e.reset(Q), e.template_effect((G) => e.set_text(q, G), [() => B.attribution()]), e.append(v, k);
1672
+ var G = (m) => {
1673
+ var P = br(), O = e.first_child(P), Q = e.child(O, !0);
1674
+ e.reset(O);
1675
+ var U = e.sibling(O, 2), $ = e.child(U);
1676
+ e.html($, () => e.get(y)), e.reset(U), e.template_effect((F) => e.set_text(Q, F), [() => B.attribution()]), e.append(m, P);
1625
1677
  };
1626
- e.if(S, (v) => {
1627
- e.get(I) && v(H);
1678
+ e.if(S, (m) => {
1679
+ e.get(y) && m(G);
1628
1680
  });
1629
1681
  }
1630
- var z = e.sibling(S, 2);
1682
+ var L = e.sibling(S, 2);
1631
1683
  {
1632
- var o = (v) => {
1633
- var k = an(), D = e.first_child(k), q = e.child(D, !0);
1634
- e.reset(D);
1635
- var Q = e.sibling(D, 2), V = e.child(Q), G = e.child(V, !0);
1636
- e.reset(V), e.reset(Q), e.template_effect(
1637
- (N) => {
1638
- e.set_text(q, N), e.set_attribute(V, "href", e.get(C)), e.set_text(G, e.get(C));
1684
+ var l = (m) => {
1685
+ var P = _r(), O = e.first_child(P), Q = e.child(O, !0);
1686
+ e.reset(O);
1687
+ var U = e.sibling(O, 2), $ = e.child(U), F = e.child($, !0);
1688
+ e.reset($), e.reset(U), e.template_effect(
1689
+ (q) => {
1690
+ e.set_text(Q, q), e.set_attribute($, "href", e.get(I)), e.set_text(F, e.get(I));
1639
1691
  },
1640
1692
  [() => B.license()]
1641
- ), e.append(v, k);
1693
+ ), e.append(m, P);
1642
1694
  };
1643
- e.if(z, (v) => {
1644
- e.get(C) && v(o);
1695
+ e.if(L, (m) => {
1696
+ e.get(I) && m(l);
1645
1697
  });
1646
1698
  }
1647
- var T = e.sibling(z, 2);
1648
- e.each(T, 17, () => e.get(a), e.index, (v, k) => {
1649
- var D = on(), q = e.first_child(D), Q = e.child(q, !0);
1650
- e.reset(q);
1651
- var V = e.sibling(q, 2), G = e.child(V);
1652
- e.html(G, () => e.get(k).value), e.reset(V), e.template_effect(() => e.set_text(Q, e.get(k).label)), e.append(v, D);
1653
- }), e.reset(l), e.reset(p);
1654
- var b = e.sibling(p, 2), y = e.child(b), L = e.child(y);
1655
- L.__click = () => s.toggleMetadataDialog();
1656
- var m = e.child(L, !0);
1657
- e.reset(L), e.reset(y), e.reset(b), e.reset(w);
1658
- var h = e.sibling(w, 2), X = e.child(h);
1659
- X.__click = () => s.toggleMetadataDialog();
1660
- var W = e.child(X, !0);
1661
- e.reset(X), e.reset(h), e.reset(x), e.template_effect(
1662
- (v, k, D) => {
1663
- x.open = s.showMetadataDialog, e.set_text(u, v), e.set_text(m, k), e.set_text(W, D);
1699
+ var C = e.sibling(L, 2);
1700
+ e.each(C, 17, () => e.get(n), e.index, (m, P) => {
1701
+ var O = yr(), Q = e.first_child(O), U = e.child(Q, !0);
1702
+ e.reset(Q);
1703
+ var $ = e.sibling(Q, 2), F = e.child($);
1704
+ e.html(F, () => e.get(P).value), e.reset($), e.template_effect(() => e.set_text(U, e.get(P).label)), e.append(m, O);
1705
+ }), e.reset(o), e.reset(p);
1706
+ var _ = e.sibling(p, 2), x = e.child(_), D = e.child(x);
1707
+ D.__click = () => r.toggleMetadataDialog();
1708
+ var b = e.child(D, !0);
1709
+ e.reset(D), e.reset(x), e.reset(_), e.reset(w);
1710
+ var h = e.sibling(w, 2), H = e.child(h);
1711
+ H.__click = () => r.toggleMetadataDialog();
1712
+ var W = e.child(H, !0);
1713
+ e.reset(H), e.reset(h), e.reset(c), e.template_effect(
1714
+ (m, P, O) => {
1715
+ c.open = r.showMetadataDialog, e.set_text(g, m), e.set_text(b, P), e.set_text(W, O);
1664
1716
  },
1665
1717
  [
1666
- () => e.get(n) ? e.get(n).getLabel().length && e.get(n).getLabel()[0] ? e.get(n).getLabel()[0].value : B.metadata_label_fallback() : B.loading(),
1718
+ () => e.get(s) ? e.get(s).getLabel().length && e.get(s).getLabel()[0] ? e.get(s).getLabel()[0].value : B.metadata_label_fallback() : B.loading(),
1667
1719
  () => B.close(),
1668
1720
  () => B.close()
1669
1721
  ]
1670
- ), e.append(r, x), e.pop();
1722
+ ), e.append(i, c), e.pop();
1671
1723
  }
1672
1724
  e.delegate(["click"]);
1673
- e.create_custom_element(et, {}, [], [], !0);
1674
- var cn = e.from_html('<span class="loading loading-spinner loading-xs"></span>'), dn = e.from_html('<div class="flex justify-center p-8"><span class="loading loading-spinner loading-lg text-primary"></span></div>'), gn = e.from_html('<div class="text-center opacity-50 p-4"> </div>'), un = e.from_html('<div class="text-center opacity-50 p-4 text-sm"> </div>'), fn = e.from_html('<div class="leading-relaxed"><span><!></span> <span class="bg-yellow-200 text-yellow-900 font-bold px-0.5 rounded"><!></span> <span><!></span></div>'), hn = e.from_html('<div class="leading-relaxed"> </div>'), vn = e.from_html('<button class="w-full text-left card bg-base-100 shadow hover:shadow-md transition-all p-4 text-sm group border border-transparent hover:border-primary focus:outline-none focus:ring-2 focus:ring-primary"><div class="flex justify-between items-baseline mb-1"><span class="font-bold text-xs opacity-70 bg-base-200 px-1.5 py-0.5 rounded"> </span></div> <!></button>'), pn = e.from_html('<div class="text-xs font-bold opacity-50 uppercase tracking-wider pb-2"> </div> <!>', 1), mn = e.from_html('<div class="h-full w-80 bg-base-200 shadow-2xl z-100 flex flex-col border-l border-base-300" role="dialog"><div class="p-4 bg-base-300 flex justify-between items-center shrink-0"><h2 class="font-bold text-lg"> </h2> <button class="btn btn-sm btn-circle btn-ghost">✕</button></div> <div class="p-4 border-b border-base-300 shrink-0"><div class="join w-full"><input type="text" class="input input-bordered join-item w-full"/> <button class="btn btn-primary join-item"><!></button></div></div> <div class="flex-1 overflow-y-auto p-4 space-y-4"><!></div></div>');
1675
- function tt(r, t) {
1725
+ e.create_custom_element(st, {}, [], [], !0);
1726
+ var xr = e.from_html('<span class="loading loading-spinner loading-xs"></span>'), Sr = e.from_html('<div class="flex justify-center p-8"><span class="loading loading-spinner loading-lg text-primary"></span></div>'), Ar = e.from_html('<div class="text-center opacity-50 p-4"> </div>'), Ir = e.from_html('<div class="text-center opacity-50 p-4 text-sm"> </div>'), kr = e.from_html('<div class="leading-relaxed"><span><!></span> <span class="bg-yellow-200 text-yellow-900 font-bold px-0.5 rounded"><!></span> <span><!></span></div>'), Cr = e.from_html('<div class="leading-relaxed"> </div>'), Pr = e.from_html('<button class="w-full text-left card bg-base-100 shadow hover:shadow-md transition-all p-4 text-sm group border border-transparent hover:border-primary focus:outline-none focus:ring-2 focus:ring-primary"><div class="flex justify-between items-baseline mb-1"><span class="font-bold text-xs opacity-70 bg-base-200 px-1.5 py-0.5 rounded"> </span></div> <!></button>'), Mr = e.from_html('<div class="text-xs font-bold opacity-50 uppercase tracking-wider pb-2"> </div> <!>', 1), zr = e.from_html('<div class="h-full w-80 bg-base-200 shadow-2xl z-100 flex flex-col border-l border-base-300" role="dialog"><div class="p-4 bg-base-300 flex justify-between items-center shrink-0"><h2 class="font-bold text-lg"> </h2> <button class="btn btn-sm btn-circle btn-ghost">✕</button></div> <div class="p-4 border-b border-base-300 shrink-0"><div class="join w-full"><input type="text" class="input input-bordered join-item w-full"/> <button class="btn btn-primary join-item"><!></button></div></div> <div class="flex-1 overflow-y-auto p-4 space-y-4"><!></div></div>');
1727
+ function nt(i, t) {
1676
1728
  e.push(t, !0);
1677
- const s = le(ae);
1678
- let n = e.state(e.proxy(s.searchQuery));
1679
- function a() {
1680
- s.search(e.get(n));
1729
+ const r = oe(se);
1730
+ let s = e.state(e.proxy(r.searchQuery));
1731
+ function n() {
1732
+ r.search(e.get(s));
1681
1733
  }
1682
- function i($) {
1683
- $.key === "Enter" && a();
1734
+ function a(k) {
1735
+ k.key === "Enter" && n();
1684
1736
  }
1685
- function I($) {
1686
- const j = s.canvases[$.canvasIndex];
1687
- j && (s.canvasId = j.id);
1737
+ function y(k) {
1738
+ const z = r.canvases[k.canvasIndex];
1739
+ z && (r.canvasId = z.id);
1688
1740
  }
1689
- var C = e.comment(), x = e.first_child(C);
1741
+ var I = e.comment(), c = e.first_child(I);
1690
1742
  {
1691
- var w = ($) => {
1692
- var j = mn(), d = e.child(j), u = e.child(d), p = e.child(u, !0);
1693
- e.reset(u);
1694
- var c = e.sibling(u, 2);
1695
- c.__click = () => s.toggleSearchPanel(), e.reset(d);
1696
- var f = e.sibling(d, 2), l = e.child(f), S = e.child(l);
1697
- e.remove_input_defaults(S), S.__keydown = i;
1698
- var H = e.sibling(S, 2);
1699
- H.__click = a;
1700
- var z = e.child(H);
1743
+ var w = (k) => {
1744
+ var z = zr(), d = e.child(z), g = e.child(d), p = e.child(g, !0);
1745
+ e.reset(g);
1746
+ var f = e.sibling(g, 2);
1747
+ f.__click = () => r.toggleSearchPanel(), e.reset(d);
1748
+ var v = e.sibling(d, 2), o = e.child(v), S = e.child(o);
1749
+ e.remove_input_defaults(S), S.__keydown = a;
1750
+ var G = e.sibling(S, 2);
1751
+ G.__click = n;
1752
+ var L = e.child(G);
1701
1753
  {
1702
- var o = (h) => {
1703
- var X = cn();
1704
- e.append(h, X);
1705
- }, T = (h) => {
1706
- Xe(h, { size: 20, weight: "bold" });
1754
+ var l = (h) => {
1755
+ var H = xr();
1756
+ e.append(h, H);
1757
+ }, C = (h) => {
1758
+ Qe(h, { size: 20, weight: "bold" });
1707
1759
  };
1708
- e.if(z, (h) => {
1709
- s.isSearching ? h(o) : h(T, !1);
1760
+ e.if(L, (h) => {
1761
+ r.isSearching ? h(l) : h(C, !1);
1710
1762
  });
1711
1763
  }
1712
- e.reset(H), e.reset(l), e.reset(f);
1713
- var b = e.sibling(f, 2), y = e.child(b);
1764
+ e.reset(G), e.reset(o), e.reset(v);
1765
+ var _ = e.sibling(v, 2), x = e.child(_);
1714
1766
  {
1715
- var L = (h) => {
1716
- var X = dn();
1717
- e.append(h, X);
1718
- }, m = (h) => {
1719
- var X = e.comment(), W = e.first_child(X);
1767
+ var D = (h) => {
1768
+ var H = Sr();
1769
+ e.append(h, H);
1770
+ }, b = (h) => {
1771
+ var H = e.comment(), W = e.first_child(H);
1720
1772
  {
1721
- var v = (D) => {
1722
- var q = gn(), Q = e.child(q, !0);
1723
- e.reset(q), e.template_effect((V) => e.set_text(Q, V), [
1724
- () => B.search_panel_no_results({ query: s.searchQuery })
1725
- ]), e.append(D, q);
1726
- }, k = (D) => {
1727
- var q = e.comment(), Q = e.first_child(q);
1773
+ var m = (O) => {
1774
+ var Q = Ar(), U = e.child(Q, !0);
1775
+ e.reset(Q), e.template_effect(($) => e.set_text(U, $), [
1776
+ () => B.search_panel_no_results({ query: r.searchQuery })
1777
+ ]), e.append(O, Q);
1778
+ }, P = (O) => {
1779
+ var Q = e.comment(), U = e.first_child(Q);
1728
1780
  {
1729
- var V = (N) => {
1730
- var K = un(), te = e.child(K, !0);
1731
- e.reset(K), e.template_effect((g) => e.set_text(te, g), [() => B.search_panel_instruction()]), e.append(N, K);
1732
- }, G = (N) => {
1733
- var K = pn(), te = e.first_child(K), g = e.child(te, !0);
1734
- e.reset(te);
1735
- var _ = e.sibling(te, 2);
1736
- e.each(_, 17, () => s.searchResults, e.index, (R, E) => {
1737
- var O = vn();
1738
- O.__click = () => I(e.get(E));
1739
- var P = e.child(O), M = e.child(P), Z = e.child(M, !0);
1740
- e.reset(M), e.reset(P);
1741
- var se = e.sibling(P, 2);
1781
+ var $ = (q) => {
1782
+ var J = Ir(), ie = e.child(J, !0);
1783
+ e.reset(J), e.template_effect((u) => e.set_text(ie, u), [() => B.search_panel_instruction()]), e.append(q, J);
1784
+ }, F = (q) => {
1785
+ var J = Mr(), ie = e.first_child(J), u = e.child(ie, !0);
1786
+ e.reset(ie);
1787
+ var T = e.sibling(ie, 2);
1788
+ e.each(T, 17, () => r.searchResults, e.index, (N, E) => {
1789
+ var R = Pr();
1790
+ R.__click = () => y(e.get(E));
1791
+ var j = e.child(R), M = e.child(j), Y = e.child(M, !0);
1792
+ e.reset(M), e.reset(j);
1793
+ var Z = e.sibling(j, 2);
1742
1794
  {
1743
- var re = (U) => {
1744
- var ee = fn(), ne = e.child(ee), st = e.child(ne);
1745
- e.html(st, () => e.get(E).before), e.reset(ne);
1746
- var Le = e.sibling(ne, 2), rt = e.child(Le);
1747
- e.html(rt, () => e.get(E).match), e.reset(Le);
1748
- var Ge = e.sibling(Le, 2), nt = e.child(Ge);
1749
- e.html(nt, () => e.get(E).after), e.reset(Ge), e.reset(ee), e.append(U, ee);
1750
- }, Y = (U) => {
1751
- var ee = hn(), ne = e.child(ee, !0);
1752
- e.reset(ee), e.template_effect(() => e.set_text(ne, e.get(E).match)), e.append(U, ee);
1795
+ var te = (X) => {
1796
+ var ee = kr(), re = e.child(ee), le = e.child(re);
1797
+ e.html(le, () => e.get(E).before), e.reset(re);
1798
+ var ce = e.sibling(re, 2), De = e.child(ce);
1799
+ e.html(De, () => e.get(E).match), e.reset(ce);
1800
+ var Fe = e.sibling(ce, 2), at = e.child(Fe);
1801
+ e.html(at, () => e.get(E).after), e.reset(Fe), e.reset(ee), e.append(X, ee);
1802
+ }, V = (X) => {
1803
+ var ee = Cr(), re = e.child(ee, !0);
1804
+ e.reset(ee), e.template_effect(() => e.set_text(re, e.get(E).match)), e.append(X, ee);
1753
1805
  };
1754
- e.if(se, (U) => {
1755
- e.get(E).type === "hit" ? U(re) : U(Y, !1);
1806
+ e.if(Z, (X) => {
1807
+ e.get(E).type === "hit" ? X(te) : X(V, !1);
1756
1808
  });
1757
1809
  }
1758
- e.reset(O), e.template_effect(() => e.set_text(Z, e.get(E).canvasLabel)), e.append(R, O);
1759
- }), e.template_effect((R) => e.set_text(g, R), [
1760
- () => B.search_panel_results_count({ count: s.searchResults.length })
1761
- ]), e.append(N, K);
1810
+ e.reset(R), e.template_effect(() => e.set_text(Y, e.get(E).canvasLabel)), e.append(N, R);
1811
+ }), e.template_effect((N) => e.set_text(u, N), [
1812
+ () => B.search_panel_results_count({ count: r.searchResults.length })
1813
+ ]), e.append(q, J);
1762
1814
  };
1763
1815
  e.if(
1764
- Q,
1765
- (N) => {
1766
- s.searchResults.length === 0 && !s.searchQuery ? N(V) : N(G, !1);
1816
+ U,
1817
+ (q) => {
1818
+ r.searchResults.length === 0 && !r.searchQuery ? q($) : q(F, !1);
1767
1819
  },
1768
1820
  !0
1769
1821
  );
1770
1822
  }
1771
- e.append(D, q);
1823
+ e.append(O, Q);
1772
1824
  };
1773
1825
  e.if(
1774
1826
  W,
1775
- (D) => {
1776
- s.searchResults.length === 0 && s.searchQuery ? D(v) : D(k, !1);
1827
+ (O) => {
1828
+ r.searchResults.length === 0 && r.searchQuery ? O(m) : O(P, !1);
1777
1829
  },
1778
1830
  !0
1779
1831
  );
1780
1832
  }
1781
- e.append(h, X);
1833
+ e.append(h, H);
1782
1834
  };
1783
- e.if(y, (h) => {
1784
- s.isSearching ? h(L) : h(m, !1);
1835
+ e.if(x, (h) => {
1836
+ r.isSearching ? h(D) : h(b, !1);
1785
1837
  });
1786
1838
  }
1787
- e.reset(b), e.reset(j), e.template_effect(
1788
- (h, X, W, v, k) => {
1789
- e.set_attribute(j, "aria-label", h), e.set_text(p, X), e.set_attribute(c, "aria-label", W), e.set_attribute(S, "placeholder", v), e.set_attribute(H, "aria-label", k);
1839
+ e.reset(_), e.reset(z), e.template_effect(
1840
+ (h, H, W, m, P) => {
1841
+ e.set_attribute(z, "aria-label", h), e.set_text(p, H), e.set_attribute(f, "aria-label", W), e.set_attribute(S, "placeholder", m), e.set_attribute(G, "aria-label", P);
1790
1842
  },
1791
1843
  [
1792
1844
  () => B.search_panel_title(),
@@ -1795,317 +1847,378 @@ function tt(r, t) {
1795
1847
  () => B.search_panel_placeholder(),
1796
1848
  () => B.search_panel_title()
1797
1849
  ]
1798
- ), e.bind_value(S, () => e.get(n), (h) => e.set(n, h)), e.append($, j);
1850
+ ), e.bind_value(S, () => e.get(s), (h) => e.set(s, h)), e.append(k, z);
1799
1851
  };
1800
- e.if(x, ($) => {
1801
- s.showSearchPanel && $(w);
1852
+ e.if(c, (k) => {
1853
+ r.showSearchPanel && k(w);
1802
1854
  });
1803
1855
  }
1804
- e.append(r, C), e.pop();
1856
+ e.append(i, I), e.pop();
1805
1857
  }
1806
1858
  e.delegate(["click", "keydown"]);
1807
- e.create_custom_element(tt, {}, [], [], !0);
1808
- var _n = e.from_html('<div class="h-full w-[200px] pointer-events-auto relative"><!></div>'), bn = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), yn = e.from_html('<div class="flex-none h-[140px] w-full pointer-events-auto relative z-20"><!></div>'), xn = e.from_html('<div class="w-full h-full flex items-center justify-center"><span class="loading loading-spinner loading-lg text-primary"></span></div>'), wn = e.from_html('<div class="w-full h-full flex items-center justify-center text-error"> </div>'), Sn = e.from_html('<div class="w-full h-full flex items-center justify-center text-base-content/50">No image found</div>'), An = e.from_html('<div class="absolute inset-0 z-40 pointer-events-none"><!></div>'), $n = e.from_html('<div class="flex-none h-[140px] w-full pointer-events-auto relative z-20"><!></div>'), In = e.from_html('<div class="relative w-full z-40 pointer-events-auto"><!></div>'), Tn = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), kn = e.from_html('<div class="h-full w-[200px] pointer-events-auto relative"><!></div>'), Pn = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), Mn = e.from_html('<div id="triiiceratops-viewer" class="flex w-full h-full relative bg-base-100 overflow-hidden"><div class="flex-none flex flex-row z-20 bg-base-200 border-r border-base-300 transition-all"><!> <!></div> <div id="triiiceratops-center-panel" class="flex-1 relative min-w-0 flex flex-col"><!> <div class="flex-1 relative min-h-0 w-full h-full bg-base-100"><!> <!> <!> <!> <!> <!> <!> <!></div> <!> <!></div> <div class="flex-none flex flex-row z-20 bg-base-200 border-l border-base-300 transition-all"><!> <!> <!></div></div>');
1809
- function Cn(r, t) {
1859
+ e.create_custom_element(nt, {}, [], [], !0);
1860
+ var Tr = e.from_html('<div class="h-full w-[200px] pointer-events-auto relative"><!></div>'), jr = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), Lr = e.from_html('<div class="flex-none flex flex-row z-20 bg-base-200 border-r border-base-300 transition-all"><!> <!></div>'), Or = e.from_html('<div class="flex-none h-[140px] w-full pointer-events-auto relative z-20"><!></div>'), Dr = e.from_html('<div class="w-full h-full flex items-center justify-center"><span class="loading loading-spinner loading-lg text-primary"></span></div>'), Er = e.from_html('<div class="w-full h-full flex items-center justify-center text-error"> </div>'), Rr = e.from_html('<div class="w-full h-full flex items-center justify-center text-base-content/50">No image found</div>'), Gr = e.from_html('<div class="absolute inset-0 z-40 pointer-events-none"><!></div>'), Fr = e.from_html('<div class="flex-none h-[140px] w-full pointer-events-auto relative z-20"><!></div>'), Vr = e.from_html('<div class="relative w-full z-40 pointer-events-auto"><!></div>'), $r = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), Br = e.from_html('<div class="h-full w-[200px] pointer-events-auto relative"><!></div>'), Hr = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), Nr = e.from_html('<div class="flex-none flex flex-row z-20 bg-base-200 border-l border-base-300 transition-all"><!> <!> <!></div>'), Yr = e.from_html('<div id="triiiceratops-viewer" class="flex w-full h-full relative bg-base-100 overflow-hidden"><!> <div id="triiiceratops-center-panel" class="flex-1 relative min-w-0 flex flex-col"><!> <div class="flex-1 relative min-h-0 w-full h-full bg-base-100"><!> <!> <!> <!> <!> <!> <!> <!></div> <!> <!></div> <!></div>');
1861
+ function Xr(i, t) {
1810
1862
  e.push(t, !0);
1811
- let s = e.prop(t, "manifestId", 7), n = e.prop(t, "plugins", 23, () => []);
1812
- const a = new St(null, n());
1813
- ct(ae, a), dt(() => {
1814
- a.destroyAllPlugins();
1863
+ let r = e.prop(t, "manifestId", 7), s = e.prop(t, "canvasId", 7), n = e.prop(t, "plugins", 23, () => []), a = e.prop(t, "theme", 7), y = e.prop(t, "themeConfig", 7), I = e.state(void 0);
1864
+ e.user_effect(() => {
1865
+ e.get(I) && Ht(e.get(I), a(), y());
1866
+ });
1867
+ const c = new kt(null, s(), n());
1868
+ ft(se, c), ut(() => {
1869
+ c.destroyAllPlugins();
1870
+ }), e.user_effect(() => {
1871
+ r() && c.setManifest(r());
1815
1872
  }), e.user_effect(() => {
1816
- s() && a.setManifest(s());
1873
+ s() && c.setCanvas(s());
1817
1874
  }), e.user_effect(() => {
1818
- const g = () => {
1819
- a.isFullScreen = !!document.fullscreenElement;
1875
+ const u = () => {
1876
+ c.isFullScreen = !!document.fullscreenElement;
1820
1877
  };
1821
- return document.addEventListener("fullscreenchange", g), () => {
1822
- document.removeEventListener("fullscreenchange", g);
1878
+ return document.addEventListener("fullscreenchange", u), () => {
1879
+ document.removeEventListener("fullscreenchange", u);
1823
1880
  };
1824
1881
  });
1825
- let i = e.derived(() => a.manifest), I = e.derived(() => a.canvases), C = e.derived(() => a.currentCanvasIndex), x = e.derived(() => {
1826
- var se, re;
1827
- if (!e.get(I) || e.get(C) === -1 || !e.get(I)[e.get(C)])
1828
- return (se = e.get(i)) != null && se.isFetching || console.log("TriiiceratopsViewer: No canvas found"), null;
1829
- const g = e.get(I)[e.get(C)];
1830
- let _ = g.getImages();
1831
- if ((!_ || !_.length) && g.getContent && (_ = g.getContent()), !_ || !_.length)
1832
- return g.__jsonld && g.__jsonld.items, (re = e.get(i)) != null && re.isFetching || console.log("TriiiceratopsViewer: No images/content in canvas"), null;
1833
- const R = _[0];
1834
- let E = R.getResource ? R.getResource() : null;
1835
- if (!E && R.getBody) {
1836
- const Y = R.getBody();
1837
- Array.isArray(Y) && Y.length > 0 ? E = Y[0] : Y && (E = Y);
1882
+ let w = e.derived(() => c.showThumbnailGallery && c.dockSide === "left" || c.pluginPanels.some((u) => u.position === "left" && u.isVisible())), k = e.derived(() => c.showSearchPanel || c.showThumbnailGallery && c.dockSide === "right" || c.pluginPanels.some((u) => u.position === "right" && u.isVisible())), z = e.derived(() => c.manifest), d = e.derived(() => c.canvases), g = e.derived(() => c.currentCanvasIndex), p = e.derived(() => {
1883
+ var Z, te;
1884
+ if (!e.get(d) || e.get(g) === -1 || !e.get(d)[e.get(g)])
1885
+ return (Z = e.get(z)) != null && Z.isFetching || console.log("TriiiceratopsViewer: No canvas found"), null;
1886
+ const u = e.get(d)[e.get(g)];
1887
+ let T = u.getImages();
1888
+ if ((!T || !T.length) && u.getContent && (T = u.getContent()), !T || !T.length)
1889
+ return u.__jsonld && u.__jsonld.items, (te = e.get(z)) != null && te.isFetching || console.log("TriiiceratopsViewer: No images/content in canvas"), null;
1890
+ const N = T[0];
1891
+ let E = N.getResource ? N.getResource() : null;
1892
+ if (!E && N.getBody) {
1893
+ const V = N.getBody();
1894
+ Array.isArray(V) && V.length > 0 ? E = V[0] : V && (E = V);
1838
1895
  }
1839
1896
  if (E && !E.id && !E.__jsonld && (!E.getServices || E.getServices().length === 0) && (E = null), !E) {
1840
- const Y = R.__jsonld || R;
1841
- Y.body && (E = Array.isArray(Y.body) ? Y.body[0] : Y.body);
1897
+ const V = N.__jsonld || N;
1898
+ V.body && (E = Array.isArray(V.body) ? V.body[0] : V.body);
1842
1899
  }
1843
1900
  if (!E)
1844
1901
  return null;
1845
- const O = (Y) => Y.id || Y["@id"];
1846
- let P = [];
1847
- if (E.getServices && (P = E.getServices()), !P.length) {
1848
- const Y = E.__jsonld || E;
1849
- Y.service && (P = Array.isArray(Y.service) ? Y.service : [Y.service]);
1902
+ const R = (V) => V.id || V["@id"];
1903
+ let j = [];
1904
+ if (E.getServices && (j = E.getServices()), !j.length) {
1905
+ const V = E.__jsonld || E;
1906
+ V.service && (j = Array.isArray(V.service) ? V.service : [V.service]);
1850
1907
  }
1851
- if (P.length > 0) {
1852
- const Y = P.find((U) => {
1853
- const ee = U.getType ? U.getType() : U.type || "", ne = U.getProfile ? U.getProfile() : U.profile || "";
1854
- return ee === "ImageService1" || ee === "ImageService2" || ee === "ImageService3" || typeof ne == "string" && ne.includes("http://iiif.io/api/image") || typeof ne == "string" && ne === "level0";
1908
+ if (j.length > 0) {
1909
+ const V = j.find((X) => {
1910
+ const ee = X.getType ? X.getType() : X.type || "", re = X.getProfile ? X.getProfile() : X.profile || "";
1911
+ return ee === "ImageService1" || ee === "ImageService2" || ee === "ImageService3" || typeof re == "string" && re.includes("http://iiif.io/api/image") || typeof re == "string" && re === "level0";
1855
1912
  });
1856
- if (Y) {
1857
- let U = O(Y);
1858
- return U && !U.endsWith("/info.json") && (U = `${U}/info.json`), U;
1913
+ if (V) {
1914
+ let X = R(V);
1915
+ return X && !X.endsWith("/info.json") && (X = `${X}/info.json`), X;
1859
1916
  }
1860
1917
  }
1861
- const M = O(E);
1918
+ const M = R(E);
1862
1919
  if (M && M.includes("/iiif/")) {
1863
- const Y = M.split("/"), U = Y.findIndex((ee) => ee === "full" || ee.match(/^\d+,\d+,\d+,\d+$/));
1864
- if (U > 0)
1865
- return `${Y.slice(0, U).join("/")}/info.json`;
1920
+ const V = M.split("/"), X = V.findIndex((ee) => ee === "full" || ee.match(/^\d+,\d+,\d+,\d+$/));
1921
+ if (X > 0)
1922
+ return `${V.slice(0, X).join("/")}/info.json`;
1866
1923
  }
1867
1924
  return console.log("TriiiceratopsViewer: No service or ID found, returning raw URL"), { type: "image", url: M };
1868
1925
  });
1869
- var w = {
1926
+ var f = {
1870
1927
  get manifestId() {
1928
+ return r();
1929
+ },
1930
+ set manifestId(u) {
1931
+ r(u), e.flush();
1932
+ },
1933
+ get canvasId() {
1871
1934
  return s();
1872
1935
  },
1873
- set manifestId(g) {
1874
- s(g), e.flush();
1936
+ set canvasId(u) {
1937
+ s(u), e.flush();
1875
1938
  },
1876
1939
  get plugins() {
1877
1940
  return n();
1878
1941
  },
1879
- set plugins(g = []) {
1880
- n(g), e.flush();
1942
+ set plugins(u = []) {
1943
+ n(u), e.flush();
1944
+ },
1945
+ get theme() {
1946
+ return a();
1947
+ },
1948
+ set theme(u) {
1949
+ a(u), e.flush();
1950
+ },
1951
+ get themeConfig() {
1952
+ return y();
1953
+ },
1954
+ set themeConfig(u) {
1955
+ y(u), e.flush();
1881
1956
  }
1882
- }, $ = Mn(), j = e.child($), d = e.child(j);
1957
+ }, v = Yr(), o = e.child(v);
1883
1958
  {
1884
- var u = (g) => {
1885
- var _ = _n(), R = e.child(_);
1886
- ie(R, {
1887
- get canvases() {
1888
- return e.get(I);
1959
+ var S = (u) => {
1960
+ var T = Lr(), N = e.child(T);
1961
+ {
1962
+ var E = (j) => {
1963
+ var M = Tr(), Y = e.child(M);
1964
+ ne(Y, {
1965
+ get canvases() {
1966
+ return e.get(d);
1967
+ }
1968
+ }), e.reset(M), e.append(j, M);
1969
+ };
1970
+ e.if(N, (j) => {
1971
+ c.showThumbnailGallery && c.dockSide === "left" && j(E);
1972
+ });
1973
+ }
1974
+ var R = e.sibling(N, 2);
1975
+ e.each(R, 17, () => c.pluginPanels, (j) => j.id, (j, M) => {
1976
+ var Y = e.comment(), Z = e.first_child(Y);
1977
+ {
1978
+ var te = (V) => {
1979
+ var X = jr(), ee = e.child(X);
1980
+ e.component(ee, () => e.get(M).component, (re, le) => {
1981
+ le(re, e.spread_props(() => e.get(M).props ?? {}));
1982
+ }), e.reset(X), e.append(V, X);
1983
+ };
1984
+ e.if(Z, (V) => {
1985
+ e.get(M).isVisible() && e.get(M).position === "left" && V(te);
1986
+ });
1889
1987
  }
1890
- }), e.reset(_), e.append(g, _);
1988
+ e.append(j, Y);
1989
+ }), e.reset(T), e.append(u, T);
1891
1990
  };
1892
- e.if(d, (g) => {
1893
- a.showThumbnailGallery && a.dockSide === "left" && g(u);
1991
+ e.if(o, (u) => {
1992
+ e.get(w) && u(S);
1894
1993
  });
1895
1994
  }
1896
- var p = e.sibling(d, 2);
1897
- e.each(p, 17, () => a.pluginPanels, (g) => g.id, (g, _) => {
1898
- var R = e.comment(), E = e.first_child(R);
1899
- {
1900
- var O = (P) => {
1901
- var M = bn(), Z = e.child(M);
1902
- e.component(Z, () => e.get(_).component, (se, re) => {
1903
- re(se, e.spread_props(() => e.get(_).props ?? {}));
1904
- }), e.reset(M), e.append(P, M);
1905
- };
1906
- e.if(E, (P) => {
1907
- e.get(_).isVisible() && e.get(_).position === "left" && P(O);
1908
- });
1909
- }
1910
- e.append(g, R);
1911
- }), e.reset(j);
1912
- var c = e.sibling(j, 2), f = e.child(c);
1995
+ var G = e.sibling(o, 2), L = e.child(G);
1913
1996
  {
1914
- var l = (g) => {
1915
- var _ = yn(), R = e.child(_);
1916
- ie(R, {
1997
+ var l = (u) => {
1998
+ var T = Or(), N = e.child(T);
1999
+ ne(N, {
1917
2000
  get canvases() {
1918
- return e.get(I);
2001
+ return e.get(d);
1919
2002
  }
1920
- }), e.reset(_), e.append(g, _);
2003
+ }), e.reset(T), e.append(u, T);
1921
2004
  };
1922
- e.if(f, (g) => {
1923
- a.showThumbnailGallery && a.dockSide === "top" && g(l);
2005
+ e.if(L, (u) => {
2006
+ c.showThumbnailGallery && c.dockSide === "top" && u(l);
1924
2007
  });
1925
2008
  }
1926
- var S = e.sibling(f, 2), H = e.child(S);
2009
+ var C = e.sibling(L, 2), _ = e.child(C);
1927
2010
  {
1928
- var z = (g) => {
1929
- var _ = xn();
1930
- e.append(g, _);
1931
- }, o = (g) => {
1932
- var _ = e.comment(), R = e.first_child(_);
2011
+ var x = (u) => {
2012
+ var T = Dr();
2013
+ e.append(u, T);
2014
+ }, D = (u) => {
2015
+ var T = e.comment(), N = e.first_child(T);
1933
2016
  {
1934
- var E = (P) => {
1935
- var M = wn(), Z = e.child(M);
1936
- e.reset(M), e.template_effect(() => e.set_text(Z, `Error: ${e.get(i).error ?? ""}`)), e.append(P, M);
1937
- }, O = (P) => {
1938
- var M = e.comment(), Z = e.first_child(M);
2017
+ var E = (j) => {
2018
+ var M = Er(), Y = e.child(M);
2019
+ e.reset(M), e.template_effect(() => e.set_text(Y, `Error: ${e.get(z).error ?? ""}`)), e.append(j, M);
2020
+ }, R = (j) => {
2021
+ var M = e.comment(), Y = e.first_child(M);
1939
2022
  {
1940
- var se = (Y) => {
1941
- var U = e.comment(), ee = e.first_child(U);
1942
- e.key(ee, () => e.get(x), (ne) => {
1943
- Qe(ne, {
2023
+ var Z = (V) => {
2024
+ var X = e.comment(), ee = e.first_child(X);
2025
+ e.key(ee, () => e.get(p), (re) => {
2026
+ Ze(re, {
1944
2027
  get tileSources() {
1945
- return e.get(x);
2028
+ return e.get(p);
1946
2029
  },
1947
2030
  get viewerState() {
1948
- return a;
2031
+ return c;
1949
2032
  }
1950
2033
  });
1951
- }), e.append(Y, U);
1952
- }, re = (Y) => {
1953
- var U = Sn();
1954
- e.append(Y, U);
2034
+ }), e.append(V, X);
2035
+ }, te = (V) => {
2036
+ var X = Rr();
2037
+ e.append(V, X);
1955
2038
  };
1956
2039
  e.if(
1957
- Z,
1958
- (Y) => {
1959
- e.get(x) ? Y(se) : Y(re, !1);
2040
+ Y,
2041
+ (V) => {
2042
+ e.get(p) ? V(Z) : V(te, !1);
1960
2043
  },
1961
2044
  !0
1962
2045
  );
1963
2046
  }
1964
- e.append(P, M);
2047
+ e.append(j, M);
1965
2048
  };
1966
2049
  e.if(
1967
- R,
1968
- (P) => {
2050
+ N,
2051
+ (j) => {
1969
2052
  var M;
1970
- (M = e.get(i)) != null && M.error ? P(E) : P(O, !1);
2053
+ (M = e.get(z)) != null && M.error ? j(E) : j(R, !1);
1971
2054
  },
1972
2055
  !0
1973
2056
  );
1974
2057
  }
1975
- e.append(g, _);
2058
+ e.append(u, T);
1976
2059
  };
1977
- e.if(H, (g) => {
1978
- var _;
1979
- (_ = e.get(i)) != null && _.isFetching ? g(z) : g(o, !1);
2060
+ e.if(_, (u) => {
2061
+ var T;
2062
+ (T = e.get(z)) != null && T.isFetching ? u(x) : u(D, !1);
1980
2063
  });
1981
2064
  }
1982
- var T = e.sibling(H, 2);
1983
- Ke(T, {});
1984
- var b = e.sibling(T, 2);
1985
- et(b, {});
1986
- var y = e.sibling(b, 2);
1987
- Je(y, {});
1988
- var L = e.sibling(y, 2);
1989
- Ze(L, {});
1990
- var m = e.sibling(L, 2);
1991
- e.each(m, 17, () => a.pluginPanels, (g) => g.id, (g, _) => {
1992
- var R = e.comment(), E = e.first_child(R);
2065
+ var b = e.sibling(_, 2);
2066
+ tt(b, {});
2067
+ var h = e.sibling(b, 2);
2068
+ st(h, {});
2069
+ var H = e.sibling(h, 2);
2070
+ rt(H, {});
2071
+ var W = e.sibling(H, 2);
2072
+ it(W, {});
2073
+ var m = e.sibling(W, 2);
2074
+ e.each(m, 17, () => c.pluginPanels, (u) => u.id, (u, T) => {
2075
+ var N = e.comment(), E = e.first_child(N);
1993
2076
  {
1994
- var O = (P) => {
1995
- var M = An(), Z = e.child(M);
1996
- e.component(Z, () => e.get(_).component, (se, re) => {
1997
- re(se, e.spread_props(() => e.get(_).props ?? {}));
1998
- }), e.reset(M), e.append(P, M);
2077
+ var R = (j) => {
2078
+ var M = Gr(), Y = e.child(M);
2079
+ e.component(Y, () => e.get(T).component, (Z, te) => {
2080
+ te(Z, e.spread_props(() => e.get(T).props ?? {}));
2081
+ }), e.reset(M), e.append(j, M);
1999
2082
  };
2000
- e.if(E, (P) => {
2001
- e.get(_).isVisible() && e.get(_).position === "overlay" && P(O);
2083
+ e.if(E, (j) => {
2084
+ e.get(T).isVisible() && e.get(T).position === "overlay" && j(R);
2002
2085
  });
2003
2086
  }
2004
- e.append(g, R);
2087
+ e.append(u, N);
2005
2088
  });
2006
- var h = e.sibling(m, 2);
2089
+ var P = e.sibling(m, 2);
2007
2090
  {
2008
- var X = (g) => {
2009
- Ue(g, {
2091
+ var O = (u) => {
2092
+ et(u, {
2010
2093
  get viewerState() {
2011
- return a;
2094
+ return c;
2012
2095
  }
2013
2096
  });
2014
2097
  };
2015
- e.if(h, (g) => {
2016
- e.get(I).length > 1 && g(X);
2098
+ e.if(P, (u) => {
2099
+ e.get(d).length > 1 && u(O);
2017
2100
  });
2018
2101
  }
2019
- var W = e.sibling(h, 2);
2102
+ var Q = e.sibling(P, 2);
2020
2103
  {
2021
- var v = (g) => {
2022
- ie(g, {
2104
+ var U = (u) => {
2105
+ ne(u, {
2023
2106
  get canvases() {
2024
- return e.get(I);
2107
+ return e.get(d);
2025
2108
  }
2026
2109
  });
2027
2110
  };
2028
- e.if(W, (g) => {
2029
- a.showThumbnailGallery && a.dockSide === "none" && g(v);
2111
+ e.if(Q, (u) => {
2112
+ c.showThumbnailGallery && c.dockSide === "none" && u(U);
2030
2113
  });
2031
2114
  }
2032
- e.reset(S);
2033
- var k = e.sibling(S, 2);
2115
+ e.reset(C);
2116
+ var $ = e.sibling(C, 2);
2034
2117
  {
2035
- var D = (g) => {
2036
- var _ = $n(), R = e.child(_);
2037
- ie(R, {
2118
+ var F = (u) => {
2119
+ var T = Fr(), N = e.child(T);
2120
+ ne(N, {
2038
2121
  get canvases() {
2039
- return e.get(I);
2122
+ return e.get(d);
2040
2123
  }
2041
- }), e.reset(_), e.append(g, _);
2124
+ }), e.reset(T), e.append(u, T);
2042
2125
  };
2043
- e.if(k, (g) => {
2044
- a.showThumbnailGallery && a.dockSide === "bottom" && g(D);
2126
+ e.if($, (u) => {
2127
+ c.showThumbnailGallery && c.dockSide === "bottom" && u(F);
2045
2128
  });
2046
2129
  }
2047
- var q = e.sibling(k, 2);
2048
- e.each(q, 17, () => a.pluginPanels, (g) => g.id, (g, _) => {
2049
- var R = e.comment(), E = e.first_child(R);
2130
+ var q = e.sibling($, 2);
2131
+ e.each(q, 17, () => c.pluginPanels, (u) => u.id, (u, T) => {
2132
+ var N = e.comment(), E = e.first_child(N);
2050
2133
  {
2051
- var O = (P) => {
2052
- var M = In(), Z = e.child(M);
2053
- e.component(Z, () => e.get(_).component, (se, re) => {
2054
- re(se, e.spread_props(() => e.get(_).props ?? {}));
2055
- }), e.reset(M), e.append(P, M);
2134
+ var R = (j) => {
2135
+ var M = Vr(), Y = e.child(M);
2136
+ e.component(Y, () => e.get(T).component, (Z, te) => {
2137
+ te(Z, e.spread_props(() => e.get(T).props ?? {}));
2138
+ }), e.reset(M), e.append(j, M);
2056
2139
  };
2057
- e.if(E, (P) => {
2058
- e.get(_).isVisible() && e.get(_).position === "bottom" && P(O);
2140
+ e.if(E, (j) => {
2141
+ e.get(T).isVisible() && e.get(T).position === "bottom" && j(R);
2059
2142
  });
2060
2143
  }
2061
- e.append(g, R);
2062
- }), e.reset(c);
2063
- var Q = e.sibling(c, 2), V = e.child(Q);
2144
+ e.append(u, N);
2145
+ }), e.reset(G);
2146
+ var J = e.sibling(G, 2);
2064
2147
  {
2065
- var G = (g) => {
2066
- var _ = Tn(), R = e.child(_);
2067
- tt(R, {}), e.reset(_), e.append(g, _);
2068
- };
2069
- e.if(V, (g) => {
2070
- a.showSearchPanel && g(G);
2071
- });
2072
- }
2073
- var N = e.sibling(V, 2);
2074
- {
2075
- var K = (g) => {
2076
- var _ = kn(), R = e.child(_);
2077
- ie(R, {
2078
- get canvases() {
2079
- return e.get(I);
2148
+ var ie = (u) => {
2149
+ var T = Nr(), N = e.child(T);
2150
+ {
2151
+ var E = (Y) => {
2152
+ var Z = $r(), te = e.child(Z);
2153
+ nt(te, {}), e.reset(Z), e.append(Y, Z);
2154
+ };
2155
+ e.if(N, (Y) => {
2156
+ c.showSearchPanel && Y(E);
2157
+ });
2158
+ }
2159
+ var R = e.sibling(N, 2);
2160
+ {
2161
+ var j = (Y) => {
2162
+ var Z = Br(), te = e.child(Z);
2163
+ ne(te, {
2164
+ get canvases() {
2165
+ return e.get(d);
2166
+ }
2167
+ }), e.reset(Z), e.append(Y, Z);
2168
+ };
2169
+ e.if(R, (Y) => {
2170
+ c.showThumbnailGallery && c.dockSide === "right" && Y(j);
2171
+ });
2172
+ }
2173
+ var M = e.sibling(R, 2);
2174
+ e.each(M, 17, () => c.pluginPanels, (Y) => Y.id, (Y, Z) => {
2175
+ var te = e.comment(), V = e.first_child(te);
2176
+ {
2177
+ var X = (ee) => {
2178
+ var re = Hr(), le = e.child(re);
2179
+ e.component(le, () => e.get(Z).component, (ce, De) => {
2180
+ De(ce, e.spread_props(() => e.get(Z).props ?? {}));
2181
+ }), e.reset(re), e.append(ee, re);
2182
+ };
2183
+ e.if(V, (ee) => {
2184
+ e.get(Z).isVisible() && e.get(Z).position === "right" && ee(X);
2185
+ });
2080
2186
  }
2081
- }), e.reset(_), e.append(g, _);
2187
+ e.append(Y, te);
2188
+ }), e.reset(T), e.append(u, T);
2082
2189
  };
2083
- e.if(N, (g) => {
2084
- a.showThumbnailGallery && a.dockSide === "right" && g(K);
2190
+ e.if(J, (u) => {
2191
+ e.get(k) && u(ie);
2085
2192
  });
2086
2193
  }
2087
- var te = e.sibling(N, 2);
2088
- return e.each(te, 17, () => a.pluginPanels, (g) => g.id, (g, _) => {
2089
- var R = e.comment(), E = e.first_child(R);
2090
- {
2091
- var O = (P) => {
2092
- var M = Pn(), Z = e.child(M);
2093
- e.component(Z, () => e.get(_).component, (se, re) => {
2094
- re(se, e.spread_props(() => e.get(_).props ?? {}));
2095
- }), e.reset(M), e.append(P, M);
2096
- };
2097
- e.if(E, (P) => {
2098
- e.get(_).isVisible() && e.get(_).position === "right" && P(O);
2099
- });
2100
- }
2101
- e.append(g, R);
2102
- }), e.reset(Q), e.reset($), e.append(r, $), e.pop(w);
2194
+ return e.reset(v), e.bind_this(v, (u) => e.set(I, u), () => e.get(I)), e.append(i, v), e.pop(f);
2103
2195
  }
2104
- e.create_custom_element(Cn, { manifestId: {}, plugins: {} }, [], [], !0);
2196
+ e.create_custom_element(
2197
+ Xr,
2198
+ {
2199
+ manifestId: {},
2200
+ canvasId: {},
2201
+ plugins: {},
2202
+ theme: {},
2203
+ themeConfig: {}
2204
+ },
2205
+ [],
2206
+ [],
2207
+ !0
2208
+ );
2105
2209
  export {
2106
- Zn as BasePlugin,
2107
- wt as ManifestsState,
2108
- Cn as TriiiceratopsViewer,
2109
- ae as VIEWER_STATE_KEY,
2110
- St as ViewerState
2210
+ mi as BasePlugin,
2211
+ Ct as DAISYUI_THEMES,
2212
+ It as ManifestsState,
2213
+ Xr as TriiiceratopsViewer,
2214
+ se as VIEWER_STATE_KEY,
2215
+ kt as ViewerState,
2216
+ Vt as applyBuiltInTheme,
2217
+ Ht as applyTheme,
2218
+ $t as applyThemeConfig,
2219
+ Bt as clearThemeConfig,
2220
+ Et as hexToOklch,
2221
+ gi as isBuiltInTheme,
2222
+ Gt as normalizeColor,
2223
+ vi as parseThemeConfig
2111
2224
  };